graphdb-workbench 2.4.2-RC1 → 2.4.2-RC2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/108.99fadee1ed0c7110af9a.bundle.js +1 -1
  2. package/dist/12.dd3a24172cf3cdec30f0.bundle.js +1 -1
  3. package/dist/168.34a1790ea589d9926a97.bundle.js +1 -1
  4. package/dist/170.e24cfa80d3f51df2b1b5.bundle.js +1 -1
  5. package/dist/173.5e3fea538a2a2d5b5c0c.bundle.js +1 -1
  6. package/dist/200.76fd30afe28687f92b15.bundle.js +1 -1
  7. package/dist/23.dc3e430b47f766cc2366.bundle.js +1 -1
  8. package/dist/30.4712f3e92b6469d3d8dd.bundle.js +1 -1
  9. package/dist/37.356f6302c079cea446b6.bundle.js +1 -1
  10. package/dist/44.f26e17d2d3f6033d8938.bundle.js +1 -0
  11. package/dist/49.b0d0df9a0bd2458a38f7.bundle.js +1 -1
  12. package/dist/70.0c7029d27bb084fd643c.bundle.js +1 -0
  13. package/dist/{bundle.5124691819d99ff5da1d.bundle.js → bundle.9d05dba42014b5be9b8f.bundle.js} +2 -2
  14. package/dist/index.html +3 -3
  15. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  16. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  17. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  18. package/dist/js/angular/security/templates/user.html +1 -1
  19. package/dist/license-checker.json +2 -2
  20. package/dist/pages/aclmanagement.html +1 -1
  21. package/dist/pages/autocomplete.html +1 -1
  22. package/dist/pages/choose-repository-type.html +1 -1
  23. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  24. package/dist/pages/create-index.html +4 -4
  25. package/dist/pages/dependencies.html +1 -1
  26. package/dist/pages/domainRangeInfo.html +2 -2
  27. package/dist/pages/edit.html +1 -1
  28. package/dist/pages/explore.html +1 -1
  29. package/dist/pages/export.html +1 -1
  30. package/dist/pages/find.html +1 -1
  31. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  32. package/dist/pages/graphs-visualizations.html +7 -7
  33. package/dist/pages/guides.html +1 -1
  34. package/dist/pages/import.html +1 -1
  35. package/dist/pages/jdbc-create.html +5 -5
  36. package/dist/pages/monitor/backup-and-restore.html +1 -1
  37. package/dist/pages/monitor/queries.html +1 -1
  38. package/dist/pages/monitor/resources.html +2 -2
  39. package/dist/pages/namespaces.html +2 -2
  40. package/dist/pages/plugins.html +1 -1
  41. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  42. package/dist/pages/rdfrank.html +2 -2
  43. package/dist/pages/repositories.html +2 -2
  44. package/dist/pages/repository.html +2 -2
  45. package/dist/pages/similarity-indexes.html +1 -1
  46. package/dist/pages/sparql-template-create.html +5 -5
  47. package/dist/pages/sparql.html +3 -3
  48. package/dist/pages/webapi.html +2 -2
  49. package/dist/res/swagger/index.html +27 -27
  50. package/package.json +1 -1
  51. package/dist/44.e63112a4f3ee65c29a0a.bundle.js +0 -1
  52. package/dist/70.fcca4105919427b384ee.bundle.js +0 -1
@@ -1,4 +1,4 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[12,2,3,9,23,30,36,37,47,48,76,85,86,87,88,89,90,91,93,94,130,134,135,136,140,154],{100:function(e,t){function n(e){return{initLazyList:function(t,n,r,i,o){return e((function(){const e=t+i-1,s=Math.max(0-i,e),a=Math.min(e+n-1,o.length);s>a?r([]):$.isArray(o)&&r(o.slice(s,a+1))}),100,!0)}}}angular.module("graphdb.framework.graphexplore.services.uiscroll",[]).factory("UiScrollService",n),n.$inject=["$timeout"]},101:function(e,t){angular.module("graphdb.framework.graphexplore.services.rdfsdetails",[]).factory("RdfsLabelCommentService",(function(){return{processAndFilterLabelAndComment:function(e){function t(e){const t={};for(let n in e)if(e.hasOwnProperty(n)){let r=n;n.indexOf(":")>-1&&(r=n,n=n.split(":")[1].toLowerCase()),t[n]=e[r]}return t}const n=e.results.bindings,r=[],i=[];_.each(n,(function(e){let n;angular.isUndefined(e.label)||(n=t(e.label),r.push(n)),angular.isUndefined(e.comment)||(n=t(e.comment),i.push(n))}));const o=function(e){return"en"===e.lang||"de"===e.lang},s=$.grep(r,o)[0],a=$.grep(i,o)[0],l=angular.isUndefined(s)?r.length>0?r[0].value:void 0:s.value,u=angular.isUndefined(a)?i.length>0?i[0].value:void 0:a.value;return{rdfsLabel:l,rdfsComment:u}}}}))},102:function(e,t){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",n),n.$inject=["$http"];function n(e){return{getSavedGraphs:function(){return e.get("rest/explore-graph/saved")},getSavedGraph:function(t){return e.get("rest/explore-graph/saved/"+encodeURIComponent(t))},editSavedGraph:function(t){return e.put("rest/explore-graph/saved/"+encodeURIComponent(t.id),t)},deleteSavedGraph:function(t){return e.delete("rest/explore-graph/saved/"+encodeURIComponent(t.id))},addNewSavedGraph:function(t){return e.post("rest/explore-graph/saved",t)}}}},103:function(e,t){angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",n);function n(e){return{getGraphConfigs:function(){return e.get("rest/explore-graph/config")},getGraphConfigSamples:function(){return e.get("rest/explore-graph/samples")},loadGraphForConfig:function(t,n,r,i){return e.get(`rest/explore-graph/config/graph/${encodeURIComponent(t.id)}?includeInferred=${n}&linksLimit=${r}&sameAsState=${i}`)},getConfig:function(t){return e.get("rest/explore-graph/config/"+encodeURIComponent(t))},createGraphConfig:function(t){return e.post("rest/explore-graph/config",t)},updateGraphConfig:function(t){return e.put("rest/explore-graph/config/"+encodeURIComponent(t.id),t)},deleteGraphConfig:function(t){return e.delete("rest/explore-graph/config/"+encodeURIComponent(t.id))},validateQuery:function(t,n,r,i,o){return e({method:"POST",url:"rest/explore-graph/validate",data:{query:t,queryType:n,params:r,all:i,oneOf:o}})}}}n.$inject=["$http"]},104:function(e,t,n){"use strict";n.r(t);n(10);function r(e,t,n,r,i,o,s,a,l,u,c,p,d,f,h,g,m){e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=()=>angular.noop(),e.currentBrowserLimit=2e3,d.firefox?e.currentBrowserLimit=50:(d.safari||d.msie||d.msedge)&&(e.currentBrowserLimit=400);const v={};let E=0,x=0;t.key="",v.get=function(t,n,r){return l.initLazyList(t,n,r,E,e.instancesObj.items)};let y=allGraphs;const T=function(){if(e.getActiveRepository())return g.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,N()})).error((function(t){e.repositoryError=getError(t),s.error(getError(t),m.instant("graphexplore.error.getting.graphs"))}))},N=function(){const t=f.get("classHierarchy-selectedGraph-"+r.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?y=t:f.set("classHierarchy-selectedGraph-"+r.getActiveRepository(),y)};function C(t,n,r){e.classCountSlider.options&&e.classCountSlider.options.ceil!==n&&(e.classCountSlider={});var i;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:n,options:{floor:1,ceil:n,vertical:!0,showSelectionBar:!0,onChange:function(){c(S,100,!0)}}},null===f.get(h.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&n>e.currentBrowserLimit&&(i=e.currentBrowserLimit,d.chrome?s.warning(m.instant("graphexplore.disabling.animations",{classLimit:i}),m.instant("graphexplore.reducing.visual.effects")):s.warning(m.instant("graphexplore.browser.performance",{browser:d.name,classLimit:i}),m.instant("graphexplore.reducing.visual.effects"))));const o=f.get(h.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=o&&"true"!==o&&(e.showExternalElements=!0),r?e.classCountSlider.value=r:n>=1500&&(e.classCountSlider.value=1500,s.warning(m.instant("graphexplore.class.count.slider",{count:1500}),m.instant("graphexplore.reducing.class.count"))),n>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,s.warning(m.instant("graphexplore.class.count.browser",{count:25}),m.instant("graphexplore.reducing.class.count"))),c((function(){e.$broadcast("reCalcViewDimensions")}),200),S();let a=0;$("rzslider").on("wheel",(function(t){t.preventDefault(),t.stopPropagation();const n=(new Date).getTime();if(!(n-a>100))return;a=n,t=t.originalEvent;let r=e.classCountSlider.value;t.deltaY<=-1?r+=1:t.deltaY>=1&&(r-=1),r!==e.classCountSlider.value&&r>=e.classCountSlider.options.floor&&r<=e.classCountSlider.options.ceil&&e.$apply((function(){e.classCountSlider.value=r,c(S,100,!0)}))}))}function S(){e.currentSliderValue=e.classCountSlider.value}function I(e){const t=e.fullName,r=e.name;a.checkDomainRangeData(t).success((function(e,i){204===i?s.warning(m.instant("graphexplore.no.domain.range",{name:r})):(f.set(h.CLASS_HIERARCHY_LAST_SELECTED_CLASS,n.hash()),n.hash("").path("domain-range-graph").search("uri",t).search("name",r))})).error((function(){s.error(m.instant("graphexplore.error.request.failed",{name:r}))}))}function L(){n.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,f.clearClassHieararchyState(),e.hidePrefixes="true"===f.get(h.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function A(){e.hasClassHierarchy()&&c((function(){$("#toolbar").removeClass("ng-hide")}),0)}t.$watch((function(){return t.key}),(function(){E=0,_.each(e.instancesObj.items,(function(e){t.key>e&&E++})),x++})),v.revision=function(){return x},e.adapterContainer={adapter:{remain:!0}},e.$on("goToDomainRangeGraphView",(function(e,t){I(t)})),e.$on("classCount",C),e.$on("repositoryIsSet",(function(){if(!i.isLicenseValid())return;if(b===r.getActiveRepository())return;b=r.getActiveRepository();if(e.repositoryError=null,!b)return;y=allGraphs,T().then(R)})),e.datasource=v,e.goToDomainRangeGraphView=I,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return r.getActiveRepository()},e.isSystemRepository=function(){return r.isSystemRepository()},e.confirmReloadClassHierarchy=function(){p.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){L(),e.loader=!0,e.hierarchyError=!1,a.reloadClassHierarchy(y.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,A(),C()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){p.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){const n={name:e.title};t.$broadcast("searchedClass",n)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},T(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&c((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){const n=t.fullName;let r=t.name;if(r===n){const e=r.lastIndexOf("#");r=r.substring(e+1)}e.encodedUri=encodeURIComponent(n);const i=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+n+"> .\n}");e.viewInstancesUri="sparql?name="+r+"&infer=true&sameAs=false&query="+i+"&execute=true",a.getRdfsLabelAndComment(n).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment,e.expanded=!1})).error((function(){s.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,a.getClassInstances(n).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,n){const r={};r.type=t.startsWith("<<")&&t.endsWith(">>")?"triple":"uri",r.absUri=encodeURIComponent(t),r.absUriNonEncoded=t,r.resolvedUri=n,e.instancesObj.items.push(r)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=e.instancesObj.items.length<1e3?"Search class instances":"Search first 1000 class instances",e.instancesNotFiltered=e.instancesObj.items})).error((function(){s.error(m.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));let b=r.getActiveRepository();function R(){L(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,a.getClassHierarchyData(y.contextID.uri).success((function(t,n){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===n&&s.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),A()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.chosenGraph=function(e){y=e,R(),f.set("classHierarchy-selectedGraph-"+r.getActiveRepository(),y)},e.getSelGraphValue=function(){return y.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelGraphValue()}}angular.module("graphdb.framework.graphexplore.controllers.class",["pageslide-directive","ngAnimate","ui.scroll.jqlite","ui.scroll","angucomplete-alt","rzSlider","toastr","graphdb.framework.utils.localstorageadapter"]).controller("RdfClassHierarchyCtlr",r),r.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},105:function(e,t,n){"use strict";n.r(t);n(10);function r(e,t,n,r,i,o,s,a,l,u,c,p,d){e.predicatesObj={},e.predicatesQueryObj={},e.predicatesObj.items=[],e.predicatesQueryObj.query="",e.predicatesListNotFiltered=[],e.predicatesSearchPlaceholder="Search predicates",e.onopen=e.onclose=()=>angular.noop();const f={};let h=0,g=0;n.key="",f.get=function(t,n,r){return u.initLazyList(t,n,r,h,e.predicatesObj.items)},n.$watch((function(){return n.key}),(function(){h=0,_.each(e.predicatesObj.items,(function(e){n.key>e&&h++})),g++})),f.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};const m=s.get(a.DOMAIN_RANGE_COLLAPSE_EDGES);function v(){const e=s.get(a.CLASS_HIERARCHY_LAST_SELECTED_CLASS);t.search("").hash(e).path("hierarchy")}e.collapseEdges=null===m||"true"===m,e.datasource=f,e.$on("reloadDomainRangeGraphView",(function(e,n){const r=n.objectPropClassUri,i=n.objectPropClassName;t.path("domain-range-graph").search("uri",r).search("name",i)})),e.$on("switchEdgeMode",(function(e,n){t.path("domain-range-graph").search("uri",n.uri).search("name",n.name).search("collapsed",n.collapsed)})),e.$on("repositoryIsSet",(function(){if(E===i.getActiveRepository())return;E=i.getActiveRepository();v()})),e.$on("changeCollapsedEdgesState",(function(t,n){e.collapseEdges=!n,s.set(a.DOMAIN_RANGE_COLLAPSE_EDGES,e.collapseEdges)})),e.goToClassHierarchyView=v,e.copyToClipboard=function(e){c.openCopyToClipboardModal(e)},e.toggleCollapseEdgesState=function(){e.collapseEdges=!e.collapseEdges,o.history.pushState({collapsed:e.collapseEdges},"domainRangePage",null)},e.predicatesListFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.predicatesQueryObj.query.toLowerCase())>=0},e.$watch("predicatesObj.items",(function(){e.predicatesObj.items>0&&r((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedPredicate",(function(){e.showPredicatesInfoPanel&&function(t){const n=t.target,r=t.source;e.encodedUri=encodeURIComponent(t.uri),e.sourceTargetObjectNodeUri=n.objectPropClassUri?n.objectPropClassUri:r.objectPropClassUri,e.encodedSourceTargetObjectNodeUri=encodeURIComponent(e.sourceTargetObjectNodeUri),e.sourceTargetObjectNodeName=n.objectPropClassName?n.objectPropClassName:r.objectPropClassName?r.objectPropClassName:"<i>Literal</i>",-1===e.sourceTargetObjectNodeName.indexOf("Literal")?l.getRdfsLabelAndComment(e.sourceTargetObjectNodeUri).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment})).error((function(){p.error(d.instant("domain.range.error.get.label.comment"))})):(e.rdfsComment=void 0,e.rdfsLabel=void 0);e.predicatesObj.items=[],e.predicatesQueryObj.query="";const i=n.allEdges?n.allEdges:r.allEdges;_.each(i,(function(t){const n={};n.absUri=encodeURIComponent(t.uri),n.absUriNonEncoded=t.uri,n.resolvedUri=t.name,n.isImplicit=t.implicit,e.predicatesObj.items.push(n)})),e.predicatesListNotFiltered=e.predicatesObj.items}(e.selectedPredicate)})),$(document).ready((function(){$(".compact-mode-toggle").click((function(){$(".tooltip").hide()}))}));let E=i.getActiveRepository()}angular.module("graphdb.framework.graphexplore.controllers.domainrange",["ui.scroll.jqlite","ui.scroll","ngSanitize","graphdb.framework.utils.localstorageadapter"]).controller("DomainRangeGraphCtlr",r),r.$inject=["$scope","$location","$rootScope","$timeout","$repositories","$window","LocalStorageAdapter","LSKeys","GraphDataRestService","UiScrollService","ModalService","toastr","$translate"]},106:function(e,t,n){(function(e){const t="WAIT",n="NO_REPO",r="READY",i="IN_PROGRESS",o="ERROR",s={contextID:{type:"all",value:"all.graphs.label",uri:""}};function a(e){if(e<1e3)return e;const t=Math.floor(Math.log(e)/Math.log(1e3));let n=e/Math.pow(1e3,t);return n=n%1>1/Math.pow(1e3,t-1)?n.toFixed(2):n.toFixed(0),n+["K","M","G","T","P","H"][t-1]}function l(e,a,l,u,c,p,d,f,h,g,m){let v=null;e.status=l.getActiveRepository()?t:n;let E=s;const x=function(){g.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,y(),e.isSystemRepository()?"READY"!==e.status&&N():(e.status="WAIT",N(!0))})).error((function(t){e.repositoryError=getError(t),u.error(getError(t),m.instant("graphexplore.error.getting.graph"))}))},y=function(){const t=h.get("dependencies-selectedGraph-"+l.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?E=t:h.set("dependencies-selectedGraph-"+l.getActiveRepository(),E)},T=function(n){d3.select("#dependencies-chord").html(""),e.status=t,p.getRelationshipsData(n,e.direction,E.contextID.uri).success((function(t){e.dependenciesData={matrix:t.right,nodes:t.left,hasLinks:_.sum(_.map(t.right,(function(e){return _.sum(e)})))>0,direction:e.direction},e.status=r})).error((function(t){e.status=r,u.error(getError(t),m.instant("graphexplore.error.dependencies.count"))}))},N=function(n){(e.status!==r||n)&&(e.status=t,p.getRelationshipsStatus(E.contextID.uri).success((function(t){if(e.status=t,e.status===i){if(null!==v)return;v=c(N,2e3)}e.status===r&&(null!==v&&(c.cancel(v),v=null),p.getRelationshipsClasses(e.direction,E.contextID.uri).success((function(t,n){e.allClasses.items=_.filter(t,L),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),T(e.selectedClasses),207===n&&u.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=o,u.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(t){e.status=o,u.error(getError(t),m.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";const C={};let S=0,I=0;function L(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}a.key="",C.get=function(t,n,r){return d.initLazyList(t,n,r,S,e.allClasses.items)},a.$watch((function(){return a.key}),(function(){S=0,_.each(e.allClasses.items,(function(e){a.key>e&&S++})),I++})),C.revision=function(){return I},e.datasource=C,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=L,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&c((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!l.getActiveRepository()||e.isSystemRepository()||l.isActiveRepoFedXType()||x()})),e.$on("$destroy",(function(){c.cancel(v)})),e.isLoading=function(){return e.status===i||e.status===t},e.confirmCalculateDependencies=function(){f.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=t,e.selectedClasses=void 0,p.calculateRelationships(E.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?u.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):N()})).error((function(e){u.error(m.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),T(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),T(e.selectedClasses)},e.showClass=function(t){e.classToShow=t},e.isClassByNameShown=function(t){return void 0!==_.find(e.selectedClasses,{name:t})},e.addClassByName=function(t){e.selectedClasses.push(_.find(e.allClasses.items,{name:t})),T(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),T(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],T(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===l.getActiveRepository()};const A=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,E=s,l.getActiveRepository()&&!l.isActiveRepoFedXType()?x():e.status=n}));window.addEventListener("beforeunload",(function e(){A(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){E=e,N(!0),h.set("dependencies-selectedGraph-"+l.getActiveRepository(),E)},e.getSelectedGraphValue=function(){return E.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:()=>s}),angular.module("graphdb.framework.graphexplore.controllers.dependencies",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).controller("DependenciesChordCtrl",l).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return a})),l.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}).call(this,n(11))},107:function(e,t,n){"use strict";n.r(t);n(7);var r=n(301),i=n(298),o=n.n(i),s=(n(10),n(77));function a(e,t,n,i,a,l,u,c,p,d,f,h,g,m,v,E,x,y,T,N,C,S,I){e.languageChanged=!1,e.propertiesObj={},e.propertiesQueryObj={},e.propertiesObj.items=[],e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=f.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=S.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=S.instant("sidepanel.invalid.limit.links.tooltip"),t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=S.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=S.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=S.instant("visual.search.instance.placeholder")})),e.onopen=e.onclose=()=>angular.noop(),e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);const L={};let A=0,b=0,R={},w=0;const O=d3.behavior.zoom().scaleExtent([.5,10]);let M;let P,D;function k(){return I.isActive()?e.defaultSettings:e.saveSettings}function F(e){m.openCopyToClipboardModal(e)}function G(){e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))}t.key="",L.get=function(t,n,r){return g.initLazyList(t,n,r,A,e.propertiesObj.items)},t.$watch((function(){return t.key}),(function(){A=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&A++})),b++})),L.revision=function(){return b},e.datasource=L,e.adapterContainer={adapter:{remain:!0}},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=S.instant("visual.search.instance.placeholder"),e.propertiesFilterFunc=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.resetState=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,R={},w=0},e.pushHistory=function(t,n){e.embedded&&(t.embedded=!0),f.search(t),f.state(n)},e.goToHome=function(){e.resetState(),f.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&l((function(){e.adapterContainer.adapter.reload()}),500)})),e.toggleMoreInfo=function(e){angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=F,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=angular.copy(e.defaultSettings),d.when(h.getPrincipal()).then(t=>function(t){const n=t.appSettings;e.defaultSettings.includeInferred=n.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=n.DEFAULT_INFERENCE&&n.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=n.DEFAULT_VIS_GRAPH_SCHEMA;const r=x.get(y.GRAPHS_VIZ);if(r&&"object"==typeof r)try{e.saveSettings=r,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=angular.copy(e.defaultSettings),x.set(y.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=angular.copy(e.defaultSettings)}(t)),e.resetSettings=function(){e.settings=angular.copy(e.defaultSettings),e.validateLinksLimit(),G()},e.changeLimit=function(t){let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=function(){e.invalidLimit=!s.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=angular.copy(e.saveSettings):e.settings=angular.copy(e.defaultSettings),G()},e.reExpandNode=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)};const U=function(t,n,r){const i=k(),o=void 0===n?i.sameAsState:!0===n,s=void 0===r?i.includeInferred:!0===r;e.loading=!0,u({url:"rest/explore-graph/graph",method:"POST",headers:{"Content-Type":"application/json"},data:{query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:s,sameAsState:o}}).then((function(e){de(e)}),(function(t){e.loading=!1,a.error(getError(t.data),S.instant("graphexplore.error.cannot.load.graph"))}))};function B(e){return e.replace(/[()']/g,"")}function j(e,t){let n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")}function V(e){return[e.source.iri,e.target.iri].join(">")}function H(e){if(e.isTriple){let t=document.getElementById(B(j(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x}function q(e){if(e.isTriple){let t=document.getElementById(B(j(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y}function z(e){let t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`}function W(e){return B(`${e.source.isTriple?j(e.source.iri,!0):e.source.iri}>${e.target.isTriple?j(e.target.iri,!0):e.target.iri}>marker`)}function Q(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,n){return e.x=t,e.y=n,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(n){const r=n.source.iri,i=n.target.iri,o=_.min([r,i])+"|"+_.max([r,i]);t[o]||(t[o]=1,e[r]=(e[r]||0)+1,e[i]=(e[i]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let n,r;n=e.isTripleSource?ye(e.source):_.find(t,(function(t){return t.iri===e.source})),r=e.isTripleTarget?ye(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:n,target:r,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?j(i.source.iri):i.source.iri}>${i.target.isTriple?j(i.target.iri):i.target.iri}`;if(Y.tripleLinksCopy.has(e)){let t=Y.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),Y.tripleLinksCopy.set(e,t),null}Y.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of Y.tripleLinksCopy.keys())1===Y.tripleLinksCopy.get(e).length&&Y.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return n(e,t).length};function n(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const r=n(e,t),i=_.map(r,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const r=n(e,t),i=_.map(r,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(n){let r=e.split(">"),i=j(n.source.iri),o=j(n.target.iri);if(i===e&&Y.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let s=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return s&&(Y.tripleLinksCopy.delete(`${i}>${o}`),Y.tripleLinksCopy.delete(`${o}>${i}`)),s})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(n){let r=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(j(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(r);const i=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,i)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let r=[],i=this.links;this.links=_.reject(this.links,(function(o){let s=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!s){let r;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(r=n(o.source,i)):r=n(o.target,i),!r)return!1;s=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return s&&(o.target.isTriple&&r.push(j(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),s})),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,(function(n){return 0===t(n,i)&&n.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;let r=j(e.iri);if(this.tripleNodes.has(r)){let t=this.tripleNodes.get(r);t.push(e),this.tripleNodes.set(r,t)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:angular.copy(e.labels),types:angular.copy(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),n=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,(function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}})),tripleNodes:t,tripleLinksCopy:n,colorIndex:w,type2color:R,scale:O.scale(),translate:O.translate()}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=angular.copy(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,(function(t){t.fixed&&e.numberOfPinnedNodes++})),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(w=t.colorIndex,R=angular.copy(t.type2color)),angular.isDefined(t.translate)&&angular.isDefined(t.scale)&&(M="translate("+t.translate[0]+", "+t.translate[1]+") scale("+t.scale+")",O.translate(t.translate),O.scale(t.scale)),ae()}}e.updateSettings=function(){e.invalidLimit?a.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?e.reExpandNode(e.rootNodeIri):e.queryResultsMode&&f.search().query?U(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&e.loadGraphConfig(e.configLoaded),k().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none"),e.showInfoPanel=!1,e.showFilter=!1,x.set(y.GRAPHS_VIZ,e.saveSettings))},e.showInfoPanel=!1;let Y=new Q;e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},e.getGraphConfigs=function(t){N.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.graph.configs.short.msg"))}))},e.loadConfigForId=function(t,n){t===e.defaultGraphConfig.id?e.loadGraphConfig(e.defaultGraphConfig):N.getConfig(t).success((function(t){e.loadGraphConfig(t),n()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.could.not.load.config",{configId:t}))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.loadGraphConfig=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?l((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,N.loadGraphForConfig(t,t.startQueryIncludeInferred,k().linksLimit,t.startQuerySameAs).then((function(e){de(e)}),(function(t){e.loading=!1,a.error(getError(t),S.instant("graphexplore.error.graph.load"))})))},e.deleteConfig=function(t){m.openSimpleModal({title:S.instant("common.confirm"),message:S.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){N.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(t){e.pushHistory({config:t.id},{config:t}),e.resetState(),e.loadGraphConfig(t)},E.onpopstate=function(t){e.resetState(),t.state&&(t.state.config?(e.loadGraphConfig(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))};const X=function(){f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,U(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0;const r=k();angular.isDefined(n)&&(e.rootNodeIri=n,u({url:"rest/explore-graph/node",method:"GET",params:{iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState}}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),Y=new Q;const n=Y.addNode(t.data,500,500);M="translate(0, -70) scale(1)",O.translate([0,-70]),O.scale(1),he(n,!0)})).catch((function(t){e.loading=!1,a.error(getError(t),S.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&T.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.could.not.open"))}))},K=function(){f.search().config?e.loadConfigForId(f.search().config,X):f.search().query||f.search().uri?(e.loadGraphConfig(e.defaultGraphConfig),X()):X()};function Z(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(K),e.getNamespacesPromise=C.getNamespaces(e.getActiveRepository()).success((function(t){const n=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(n,(function(e){return e.uri.length})),J()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.view.will.not.work"))})))}function J(){i.isLicenseValid()&&(e.getAutocompletePromise=p.checkAutocompleteStatus())}e.replaceIRIWithPrefix=function(t){const n=e.namespaces,r=_.findLast(n,(function(e){return 0===t.indexOf(e.uri)}));return r?r.prefix+":"+t.substring(r.uri.length):t},e.addedTag=function(t){return t.text.indexOf(":")<0?(a.warning(S.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){const e=c.getNamespaceUriForPrefix(t,r);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?a.warning(S.instant("graphexplore.absolute.prefixed.iri.option"),t):a.warning(S.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return a.warning(S.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return a.warning(S.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.hasInitedRepository=!1,e.$on("autocompleteStatus",(function(){J()})),e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),Z(n.newRepo),n.newRepo&&(e.resetState(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),X()))})),Z();const ee=d3.scale.linear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),te=d3.scale.linear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(R[e])&&(R[e]=w,w++);const t=R[e];return t>39?"#c2c2c2":t%2==0?ee(t/2):te(t/2)};const ne=d3.layout.force().gravity(.07).size([1e3,1e3]),re=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 1000 1000").attr("preserveAspectRatio","xMidYMid meet");let ie=0,oe=0;const se=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.4.2-RC1").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function ae(t){d3.selectAll("svg g").remove(),d3.selectAll("svg rect").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),O.on("zoom",(function(){if(I.isActive())return;M="translate("+d3.event.translate+") scale("+d3.event.scale+")",n.attr("transform",M)})),re.append("rect").attr("width",1e4).attr("height",1e4).attr("x",-4500).attr("y",-4500).style("fill","none").style("pointer-events","all").call(O).on("click",(function(){d3.event.stopPropagation(),ge(),ne.stop()}));const n=re.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(M)&&!t?M:""})),i=o()().attr("class","d3-tip").customPosition((function(){const e=P.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let n="";return t.fixed&&(n+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?n+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):n+="<i>No types</i>",n})),s=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return Ne(t);if(n<10)return" · "+Ne(t);if(10===n){const t=function(e){return e.predicates.length-10}(e),n=t>1?t+" predicates":t+" predicate";return" · "+S.instant("graphexplore.tip.text",{textToShow:n})}})),""),t};let u;const c=o()().attr("class","d3-tip").customPosition((function(e){const t=u.getBoundingClientRect(),n=function(e){const t=s(e),n=document.createElement("canvas").getContext("2d");return n.font="13px Arial",e.predicates.length<10?n.measureText(t).width:n.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:n+"px"}})).html((function(e){return s(e)}));const p=function(){l.cancel(void 0),l.cancel(ie),P=null,i.hide(),oe=l((function(){ge()}),500)};re.call(i);re.call(c);let d=re.selectAll(".link"),f=re.selectAll(".node");ne.nodes(Y.nodes).charge(-3e3),ne.links(Y.links).linkDistance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness})),n.append("defs").selectAll("marker").data(ne.links()).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return W(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),d=n.selectAll(".link").data(Y.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return B(V(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${W(e)})`}));const h=n.selectAll(".link-wrapper").append("text").text((function(e){return Te(e)})).attr("class",(function(e){return e.predicates.length>1||Y.tripleNodes.has(V(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",k().showLinksText?"":"none").on("mouseover",(function(e){d3.event.stopPropagation(),function(e){l.cancel(void 0);const t=u=d3.event.target;l((function(){u===t&&e.predicates.length>1&&c.show(e,u)}),300)}(e)})).on("mouseout",(function(){l.cancel(void 0),u=null,c.hide()})).on("click",(function(t){d3.event.stopPropagation(),function(t){xe();let n=V(t);if(1===t.predicates.length&&Y.tripleNodes.has(n)){D=null;let e=Y.tripleNodes.get(n)[0];if(ce(e,this,d3.event.button)){let t={};t.iri=e.iri,t.pred=Ne(e.iri.split(" ")[1]),ve(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,D===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(D=null);D=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){let n=function(e,t){let n=V(t);return Y.tripleNodes.has(n)?Y.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:Ne(e),partOfTriple:r,linkId:r?V(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(t)}(t)}));let g,m=0,v=0,E=0;const x=function(){d3.event.button&&0!==d3.event.button||(p(),l.cancel(g),e.showPredicates=!1,d3.event.timeStamp-m<500?v++:v=1,m=d3.event.timeStamp,d3.event.preventDefault())},y=function(t,n,r){Y.countLinks(t,Y.links)<=k().linksLimit?he(t,!1,r||this.parentNode):a.info(S.instant("graphexplore.increase.limit"),S.instant("graphexplore.node.at.max")),e.closeInfoPanel()},T=function(e){if(d3.event.button&&0!==d3.event.button)return;l.cancel(g);const t=d3.event,n=this;I.isActive()||d3.event.timeStamp-m<500&&(1===v?g=l((function(){ce(e,n,t)}),540-(d3.event.timeStamp-m)):2===v&&y(e,0,n.parentNode)),d3.event.preventDefault()};function N(e,t){let r,i,o,s,a=!0;if("down"===t)r=2*e.size,i=e.size/3,o=.8,s=.3;else if("down-fixed"===t)r=2*e.size,i=e.size,o=.8,s=.66;else if("up"===t)r=e.size/3,i=2*e.size,o=.3,s=.8;else{if("fixed"!==t)return;r=e.size,o=.66,a=!1}let l=n.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",r+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",o);"fixed"!==t&&"down-fixed"!==t||(e.pin=l),a&&(l=l.transition().duration(1e3).style("font-size",(function(){return i+"px"})).attr("opacity",s),"down-fixed"!==t&&l.remove())}const C=d3.behavior.drag().origin((function(e){return e})).on("dragstart",(function(e){if(I.isActive())return;0===d3.event.sourceEvent.button&&(e.fixedBeforeDrag=e.fixed,e.isBeingDragged=!0,e.beginDragging=!0,ge(),d3.event.sourceEvent.stopPropagation(),d3.select(this).classed("dragging",!0))})).on("drag",(function(t){t.isBeingDragged&&(v=0,t.px=d3.event.x,t.py=d3.event.y,t.fixed?t.beginDragging&&N(t,"fixed"):(e.numberOfPinnedNodes++,t.fixed=!0,N(t,"down-fixed")),t.pinWasFixed=!0,t.beginDragging=null,ne.resume())})).on("dragend",(function(e){e.isBeingDragged&&(e.pinWasFixed&&(e.pinWasFixed=null,d3.select(".pinned").remove()),e.isBeingDragged=!1,d3.select(this).classed("dragging",!1))}));f=n.selectAll(".node").data(Y.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).call(C).on("mouseover",(function(t){if(!t.isBeingDragged){const n=d3.event;l.cancel(oe),ie=l(()=>{(function(t,n){if(e.showInfoPanel)return!1;(ue.closeIcon||ue.expandIcon||ue.focusIcon||ue.copyURIIcon)&&ue.removeIcons();if(ne.alpha()<.02)return ue.initIcons(t,n.parentNode),ne.stop(),le(),!0;return!1})(t,this)&&function(e,t){l.cancel(void 0);const n=P=t.target;l((function(){P===n&&i.show(e,P)}),300)}(t,n)},400)}})).on("mouseout",p).on("mousedown",x).on("touchstart",(function(e){x(),E=0,g=l((function(){E<5&&pe(e),g=null,v=0}),1e3)})).on("touchmove",(function(){E++})).on("mouseup",T).on("touchend",T).on("contextmenu",(function(t){d3.event.shiftKey||(d3.event.preventDefault(),ge(),e.closeInfoPanel(),t.fixed?(e.numberOfPinnedNodes--,t.fixed=!1,N(t,"up"),ne.resume()):(e.numberOfPinnedNodes++,t.fixed=!0,N(t,"down")),function(e){P&&i.show(e,P)}(t))})).on("gdb-expand-node",y).on("gdb-show-node-info",me);const L=n.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));n.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,16,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),l((function(){$(".node-label-body div").each((function(e,t){let n=t.textContent.substring(0,t.textContent.length-1);let r=0;for(;r<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)n=n.substring(0,n.length-1),t.textContent=n+"…",r++}))}),50)}(L),ne.on("tick",(function(){d3.geom.quadtree(Y.nodes);Y.nodes.length;d.attr("x1",(function(e){return H(e.source)})).attr("y1",(function(e){return q(e.source)})).attr("x2",(function(e){return H(e.target)})).attr("y2",(function(e){return q(e.target)})),h.attr("x",(function(e){let t=H(e.source),n=H(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){let t=q(e.source),n=q(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){const n={x:H(e.source),y:q(e.source)},r={x:H(e.target),y:q(e.target)};if(t)return 180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;{const e=180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),f.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),n.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),n.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),L.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),le()})),angular.isDefined(se)&&se.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(n){let r=B(n.source.iri),i=B(n.target.iri);if(r===t&&i===e){let e=r;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),ne.start()}function le(){t.d3alpha=ne.alpha()}ae();const ue=new function(){function e(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(n,r){const i=o()().attr("class","d3-tip d3-actions-tip").customPosition((function(){const e=d3.event.target.getBoundingClientRect();return{top:e.top-20+"px",left:e.right+10+"px"}})).html((function(e){return e}));re.call(i);n.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return e(20,n)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=n).isExpanded=!1,Y.removeNodeLeafLinks(e),ae()})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(ie),l.cancel(oe)})).on("mouseout",(function(){i.hide(),oe=l((function(){ge()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return e(20,n)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){he(n,!1,r)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(oe),l.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=l((function(){ge()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return e(20,n)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",n.iri)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(oe),l.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=l((function(){ge()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return e(20,n)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){F(n.iri),ge(),i.hide()})).on("mouseover",(function(){i.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>"),l.cancel(oe),l.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=l((function(){ge()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return e(20,n)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){pe(n)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(oe),l.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=l((function(){ge()}),500)})),this.animateMenu(n)},this.animateMenu=function(t){let n=0;let r=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.expandedState=!0}};function ce(n,r,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):i.ctrlKey||i.metaKey?(pe(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(me(n),!0)}function pe(e){Y.removeNode(e),ae()}function de(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),Y=new Q,M="translate(0, -70) scale(1)",O.translate([0,-70]),O.scale(1)}(t),fe(t)}function fe(t,n,r){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(Y.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));let o=[];const s=Y.tripleLinksCopy.values();for(let e=0;e<Y.tripleLinksCopy.size;e++){s.next().value.forEach(e=>{o.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(o,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const l=function(e,t){let n=t.map((function(t){return t[e]}));return t.filter((function(t,r){return n.indexOf(t[e])===r}))}("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),c=_.map(Y.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),p=Y.tripleNodes.values();for(let e=0;e<Y.tripleNodes.size;e++){p.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})})}const f=_.reject(l,(function(e){return _.some(c,e)}));if(0===f.length)(r||0===i.length)&&a.info(S.instant("graphexplore.error.node.connections")),Y.addAndMatchLinks(i),ae();else{const t=[],r=[],o=k();_.forEach(f,(function(n,i){t.push(u({url:"rest/explore-graph/node",method:"GET",params:{iri:n.isTriple?z(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?o.languages:[],includeInferred:o.includeInferred,sameAsState:o.sameAsState}}).then((function(e){r[i]=e.data})))})),d.all(t).then((function(){_.forEach(r,(function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+1e3*Math.cos(i)/3,s=(n?n.y:0)+1e3*Math.sin(i)/3;e.isTriple?Y.addTriple(e,o,s):Y.addNode(e,o,s)})),Y.addAndMatchLinks(i),n&&(n.isExpanded=!0),ae()}))}}function he(t,n,r){if(se.getLoadingState())return;se.init(t,r);const i=k(),o=t.iri;u({url:"rest/explore-graph/links",method:"GET",params:{iri:o,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}}).then((function(e){fe(e,t,n)}),(function(t){const n=getError(t.data);a.error(n,S.instant("graphexplore.error.exploring.node")),e.loading=!1,se.setLoadingState(!1)}))}function ge(){angular.isDefined(ue)&&ue.expandedState&&ue.removeIcons()}function me(t){ne.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(z(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const n=k();u.get("rest/explore-graph/properties",{params:{iri:t.isTriple?z(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState,rejectedPredicates:e.shouldShowSettings()?n.rejectedPredicates:[]}}).then((function(t){e.data=_.mapKeys(t.data,(function(t,n){return e.replaceIRIWithPrefix(n)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,n){e.propertiesObj.items.push({key:n,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const n=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));n&&(e.nodeImage=n.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){a.warning(getError(e.data),"Error")}))}function ve(e){Ee("predicate","var(--primary-color-dark)",e),Ee("predicates","var(--primary-color-dark)",e);let t=document.getElementsByClassName("link");t&&_.each(t,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function Ee(e,t,n){let r=document.getElementsByClassName(e);r&&_.each(r,(function(e){let r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),j(n.iri)===V(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===V(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Te(r))}))}function xe(){_.each(e.predicates,(function(e){let t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));let t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Ee("predicate",""),Ee("predicates","");let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function ye(e){let t=j(e);if(Y.tripleNodes.has(t))return Y.tripleNodes.get(t).find(t=>t.iri===e)}function Te(e){return e.predicates.length>1?e.predicates.length+" predicates":Ne(e.predicates[0])}function Ne(t){const n=e.replaceIRIWithPrefix(t);return n.length===t.length?t.split("/")[t.split("/").length-1]:n}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],D=null,l((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(Y.tripleNodes.has(t.linkId)){xe();let n=Y.tripleNodes.get(t.linkId)[t.nodeIndex];me(n),e.showPredicates=!0;let r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");let i={};const o=Y.tripleLinksCopy.values();for(let e=0;e<Y.tripleLinksCopy.size;e++){let e=o.next().value;e.length>1&&e.every(t=>t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=j(t.target.iri),i.oppTriplePred=Ne(t.target.iri.split(" ")[1])),i.pred=Ne(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==n.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=j(t.source.iri),i.oppTriplePred=Ne(t.source.iri.split(" ")[1])),i.pred=Ne(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=Ne(n.iri.split(" ")[1])),ve(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLoadingLocation=function(){return n.isLoadingLocation()},e.hasActiveLocation=function(){return n.hasActiveLocation()},e.rotate=function(e){ge();const t=2*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t);d3.selectAll(".node-wrapper").each((function(e){e.x=n*(e.x-500)+r*(e.y-500)+500,e.y=-r*(e.x-500)+n*(e.y-500)+500,e.fixed&&(e.px=e.x,e.py=e.y)})),ne.resume()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,e.pushHistory(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(Y.copyState()),n={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};n.id?e.saveGraphModal("update",n):e.saveGraphModal("new",n)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const Ce=function(t){T.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,n,r){v.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:n,graphExists:r,shared:n.shared}}}}).result.then((function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),T.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);a.error(e,S.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Ce(t.graph)}}))},e.refreshSavedGraphs=function(){T.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,n){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig),f.url("?saved="+t.id),Y.restoreState(JSON.parse(t.data)),n||e.pushHistory({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(e){F([location.protocol,"//",location.host,location.pathname,"?saved=",e.id].join(""))},e.deleteSavedGraph=function(t){m.openSimpleModal({title:S.instant("common.confirm"),message:S.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){T.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){ge();const t=e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(n){n.fixed=t,t&&e.numberOfPinnedNodes++})),ne.resume()},$("body").on("keydown",(function(t){!I.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function l(e,t,n,r){switch(e.mode=n.mode,e.graph=angular.copy(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title=r.instant("graphexplore.create.new.graph"),e.okButtonText=r.instant("common.create.btn");break;case"update":e.title=r.instant("graphexplore.update"),e.okButtonText=r.instant("common.save.btn");break;case"rename":e.title=r.instant("graphexplore.rename"),e.okButtonText=r.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter"]).controller("GraphsVisualizationsCtrl",a).controller("SaveGraphModalCtrl",l).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),a.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","$http","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","RDF4JRepositoriesRestService","$translate","GuidesService"],l.$inject=["$scope","$uibModalInstance","data","$translate"]},108:function(e,t,n){"use strict";n.r(t);n(58),n(10);function r(e,t,n,r,i,o,s,a,l,u,c,p,d,f,h){var g;e.page=1,e.totalPages=5,e.helpHidden=1===d.get(f.HIDE_GRAPH_CONFIG_HELP),e.toggleHelp=function(t){void 0===t&&(t=d.get(f.HIDE_GRAPH_CONFIG_HELP)),1!==t?(d.set(f.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(d.set(f.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=function(t,n){e.newConfig.startIRI=t,e.newConfig.startIRILabel=n,g=!0},e.isDefaultGraph=function(e){return"Minimal"===e.name||"Advanced"===e.name},e.isUserGraph=function(t){return!e.isDefaultGraph(t)},e.getSampleName=function(e,t){const n=e[t+"Description"];return n||(e.id?"Copy of "+e.name:e.name)};const m=u.configName;function v(e){r.warning(e)}function E(t){let n;return"query"===t.startMode&&1===e.page?n=t.startGraphQuery:2===e.page?n=t.expandQuery:3===e.page?n=t.resourceQuery:4===e.page?n=t.predicateLabelQuery:5===e.page&&(n=t.resourcePropertiesQuery),angular.isDefined(n)?n:""}function x(){function o(){e.getAutocompletePromise=l.checkAutocompleteStatus()}a.getGraphConfigSamples().success((function(t){e.samples=_.filter(t,(function(t){return!t.id||e.newConfig.id!==t.id||(e.revertConfig=t,!1)}))})).error((function(e){r.error(getError(e),h.instant("graphexplore.error.graph.configs"))})),e.createGraphConfig=function(){a.createGraphConfig(e.newConfig).success((async function(){await c.showToastMessageWithDelay("graphexplore.saved.new.config"),n.url("graphs-visualizations")})).error((function(e){r.error(getError(e),h.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=function(){a.updateGraphConfig(e.newConfig).success((async function(){await c.showToastMessageWithDelay("graphexplore.saved.config"),n.url("graphs-visualizations")})).error((function(e){r.error(getError(e),h.instant("graphexplore.error.could.not.save"))}))},e.$on("autocompleteStatus",(function(){o()})),o(),e.getNamespacesPromise=p.getNamespaces(e.getActiveRepository());const s=function(e,t,n,r,i,o){t?a.validateQuery(t,n,r,i,o).success((function(){e()})).error((function(e){v(getError(e))})):e()};function u(){d()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})}function d(){return 1===e.page&&"node"===e.newConfig.startMode}e.validateCurrentPage=function(t){e.updateModel(),1===e.page?"node"!==e.newConfig.startMode||e.newConfig.startIRI?"query"!==e.newConfig.startMode||e.newConfig.startGraphQuery?"query"===e.newConfig.startMode?s(t,e.newConfig.startGraphQuery,"graph"):t():v(h.instant("graphexplore.provide.query")):v(h.instant("graphexplore.select.start.node")):2===e.page?s(t,e.newConfig.expandQuery,"construct",["node"]):3===e.page?s(t,e.newConfig.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?s(t,e.newConfig.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&s(t,e.newConfig.resourcePropertiesQuery,"tuple",["node"],["property","value"])},e.goToPage=function(t){e.page!==t&&e.validateCurrentPage((function(){e.showEditor(),e.page=t,e.notoolbar=1!==e.page}))},e.goToPreviousPage=function(){e.page>1&&e.goToPage(e.page-1),d()&&(g=!1)},e.goToNextPage=function(){u(),("node"!==e.newConfig.startMode||g)&&e.goToPage(e.page+1)},e.saveGraphConfig=function(){u(),d()&&!g||(e.newConfig.startQueryIncludeInferred=e.currentQuery.inference,e.newConfig.startQuerySameAs=e.currentQuery.sameAs,e.validateCurrentPage((function(){e.newConfig.name?e.isUpdate?e.updateGraphConfig(e.newConfig):e.createGraphConfig(e.newConfig):v(h.instant("graphexplore.provide.config.name"))})))},e.updateModel=function(){const t=window.editor.getValue().trim();"query"===e.newConfig.startMode&&1===e.page?e.newConfig.startGraphQuery=t:2===e.page?e.newConfig.expandQuery=t:3===e.page?e.newConfig.resourceQuery=t:4===e.page?e.newConfig.predicateLabelQuery=t:5===e.page&&(e.newConfig.resourcePropertiesQuery=t)},e.setQuery=function(e){window.editor.setValue(e||" ")},e.updateDirty=function(){if(e.revertConfig){const t=E(e.revertConfig),n=window.editor.getValue().trim();e.queryEditorIsDirty=t!==n}},e.updateEditor=function(){t((function(){e.currentQuery.query=E(e.newConfig),i.isActiveRepoOntopType()&&(e.nocount=!0),e.currentQuery.inference=e.newConfig.startQueryIncludeInferred,e.currentQuery.sameAs=e.newConfig.startQuerySameAs,w(),I(e.currentQuery.id)}),100)},e.showEditor=function(){window.editor&&window.editor.xhr&&window.editor.xhr.abort(),e.viewMode="yasr"},e.showPreview=function(){e.currentQuery.outputType="table",e.runQuery()},e.revertEditor=function(){e.setQuery(E(e.revertConfig))},e.$watch("newConfig.startMode",(function(n){"query"===n&&t((function(){e.updateEditor()}),0)})),e.$watch("page",(function(n){("query"===e.newConfig.startMode||n>1)&&t((function(){e.showEditor(),e.updateEditor()}),0)}))}e.newConfig={startQueryIncludeInferred:!0,startQuerySameAs:!0},e.newConfig.startMode="search",e.isUpdate=!1,e.shared=!1,e.encodeQuery=function(e){return encodeURIComponent(e)},m?(e.isUpdate=!0,a.getConfig(m).success((function(t){e.newConfig=t,x()})).error((function(e){r.error(getError(e),h.instant("created.connector",{name:m}))}))):(e.isUpdate=!1,x());const y={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs};function T(e){}function N(t,n,r){const i=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,i.addClass("hide")):(e.progressMessage="",e.extraMessage="",i.removeClass("hide")),null===e.$$phase&&e.$apply()}function C(n){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}const i=n;if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let n;n=t(i?function(){e.fixSizesOnHorizontalViewModeSwitch(i)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(n)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function S(){C(!0)}function I(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function L(t,n){e.executedQueryTab=e.currentQuery,n&&"SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()&&"DESCRIBE"!==window.editor.getQueryType()?r.warning(h.instant("query.editor.warning.msg")):"update"!==window.editor.getQueryMode()?(e.explainRequested=n,e.queryIsRunning||(t?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.viewMode="editor",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch(),N(!0,h.instant("evaluating.query.msg")),window.editor.query())):r.warning(h.instant("cannot.execute.update.error"))}function A(){N(!0,h.instant("common.refreshing.namespaces"),h.instant("common.extra.message")),p.getRepositoryNamespaces().success((function(t){const n={};t.results.bindings.forEach((function(e){n[e.prefix.value]=e.namespace.value})),e.namespaces=n})).error((function(t){e.repositoryError=getError(t)})).finally((function(){N(!1)}))}function b(){o.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){let t=getError(e);return r.error(t,h.instant("common.add.known.prefixes.error")),!0}))}function R(t){let n=void 0;return angular.forEach(e.tabsData,(function(e){if(e.name===t.name&&e.query===t.body)return n=e.id,e})),n}function w(){e.tabsData=[e.currentQuery];let n=e.currentQuery;null==e.currentQuery.query||""===e.currentQuery.query?window.editor.setValue(" "):window.editor.setValue(e.currentQuery.query),t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=n.queryType,e.currentTabConfig.resultsCount=n.resultsCount,e.currentTabConfig.offset=n.offset,e.currentTabConfig.allResultsCount=n.allResultsCount,e.currentTabConfig.page=n.page,e.currentTabConfig.pageSize=n.pageSize,e.currentTabConfig.timeFinished=n.timeFinished,e.currentTabConfig.timeTook=n.timeTook,e.currentTabConfig.sizeDelta=n.sizeDelta,e.$apply()}),0),$("#yasr").css("padding","0")}function O(e){return $(e).attr("data-id")}e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.tabsData=e.tabs=[y],e.saveTab=function(t){const n=function(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=w,e.addNewTab=function(e,t,n){},e.runQuery=L,e.getNamespaces=A,e.changePagination=function(){L(!0,e.explainRequested)},e.toggleSampleQueries=function(){},e.addKnownPrefixes=b,e.getExistingTabId=R,e.querySelected=function(t){const n=R(t);e.toggleSampleQueries(),angular.isDefined(n)?I(n):e.addNewTab(null,t.name,t.body)},e.saveQueryToLocal=T,e.setLoader=N,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3,n=e.getHumanReadableSeconds(t);let r;r=e.progressMessage?e.progressMessage+"... "+n:h.instant("common.running.operation",{timeHuman:n});e.extraMessage&&t>10&&(r+="\n"+e.extraMessage);return r},e.fixSizesOnHorizontalViewModeSwitch=C,e.changeViewMode=function(n){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,C(),$(".dataTables_filter").remove(),$(".resultsTable").remove(),t((function(){w(),I(n)}),100)},e.showHideEditor=S,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!0,e.orientationViewMode||S(),e.getActiveRepository()&&A(),e.$on("$destroy",(function(){window.editor=null,window.yasr=null})),$("textarea").on("paste",(function(){t((function(){b()}),0)})),e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(){e.currentQuery})),e.$on("tabAction",(function(t,n){n.relatedTarget&&e.saveTab(O(n.relatedTarget)),e.loadTab(O(n.target))})),e.$on("deleteAllexeptSelected",(function(t,n){e.tabsData=n,e.tabs=n})),e.currentQuery=angular.copy(y),e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.getResultsDescription=function(){},e.getUpdateDescription=function(){},e.getStaleWarningMessage=function(){}}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",r),r.$inject=["$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate"]},109:function(e,t,n){"use strict";n.r(t);var r=n(298),i=n.n(r),o=n(308),s=n(301),a=n(302);n(10);function l(e,t,n,r,l,u,c,p,d,f,h,g,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(c,v,E){!function(c,v){var E=d3.layout.pack().size([780,780]).value((function(e){return e.size})),x=d3.scale.linear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),y=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function T(){return y.append("svg:g").attr({id:"main-group",transform:"translate(400,400)"})}function N(){return"true"===h.get(g.CLASS_HIERARCHY_HIDE_PREFIXES)}function C(){var e=a.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.4.2-RC1");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=a.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attr({href:t,download:"class-hierarchy-"+u.getActiveRepository()+".svg"})}c.hidePrefixes=N();var S,I,L=T();if(!c.classHierarchyData.classCount&&u.getActiveRepository()&&!u.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=h.get("classHierarchy-selectedGraph-"+u.getActiveRepository());n.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&p.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),c.classHierarchyData=t,d3.select("#download-svg").on("mouseover",C)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),p.error(m.instant("graphexplore.error.request.failed",{name:f,error:getError(t)}))}))}var A,b,R,w,O,M,P,D,k={};function F(n,a,u,p){R&&R(),w&&w(),d3.selectAll("#main-group").remove(),L=T(),o.a.SingleChild.addPlaceholders(n,!0),b=u||n;var h,g=E.nodes(n);b.isInFocusTransitive=!0,o.a.SingleChild.removePlaceholders(g),o.a.SingleChild.centerNodes(g),o.a.SingleChild.makePositionsRelativeToZero(g);var m=i()().attr("class","d3-tip").customPosition((function(e){return{top:"inherit",bottom:r.innerHeight-d3.event.clientY+"px",right:r.innerWidth-d3.event.clientX+"px"}})).html((function(e){return e.name}));y.call(m);var v=L.selectAll("circle").data(g).enter().append("g");a.doFade&&v.each((function(e){s.a.Transition.fadeIn(d3.select(this),550)}));var N,C=[],O=v.append("circle").attr("class",(function(e){return e.role})).attr("guide-selector",(function(e){return"class-"+e.name})).style("fill",(function(e){return e.children?x(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.name!==f){var t=e.name;C.push({name:t}),k[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(){a.noPrefixes||e.textHidden?m.show(e):m.hide(e)})),e.circle.on("mouseout",m.hide)}})).on("gdb-focus",I).on("gdb-zoom",z);function M(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),N=e}function P(){c.showClassInfoPanel=!1}C&&(C=_.uniqBy(C,"name"),c.flattenedClassNames=C);var D=s.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D);I=function(e){z(e),e.name===f?(P(),d3.selectAll(".selected").classed("selected",!1)):(M(e),c.selectedClass=N,c.showClassInfoPanel=!0,c.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},D.on("click",(function(e){e.id&&r.history.pushState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),m.hide(),I(e)})),D.on("dblclick",(function(t){t!==n&&(m.hide(),M(t),e.$broadcast("goToDomainRangeGraphView",N,b),d3.event.stopPropagation())}));var F=0;y.on("wheel",(function(){m.hide();var e=d3.event;e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-F>100){F=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var i=e.target.__data__;if(i||(i=b),"in"===n){if(i!==b){for(;i.parent&&!i.parent.isInFocusTransitive;)i=i.parent;i.depth<b.depth&&(i=b)}if(i===b&&i.children){for(var o=i.children[0],s=1;s<i.children.length;s++)i.children[s].sortingRank>o.sortingRank&&(o=i.children[s]);o.children&&(i=o)}else i.children||(i=i.parent);z(i,!0)}else"out"===n&&(i=b.parent)&&z(i,!0);b.name===f&&r.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),G()}}));var U=L.selectAll("text").data(g).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));a.noPrefixes?(A!==n&&(U.each((function(e){var t=e.name.indexOf(":");e.name.indexOf("http://")>-1?e.noPrefixName=e.name:t>-1&&(e.noPrefixName=e.name.substring(t+1))})),A=n),U.style("font-size",(function(e){return s.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return s.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):U.style("font-size",(function(e){return s.a.Text.calcFontSize(e.name,e.r)})).text((function(e){return s.a.Text.getTextWithElipsisIfNeeded(e.name,e.r/3)})),U.style("display",(function(e){return e.parent===n?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),a.doFade&&!a.keepPrevState&&U.each((function(e){s.a.Transition.fadeIn(d3.select(this),550)})),S=function(){function e(e){e&&O.each((function(t){e==t.id&&I(t)}))}var n=t.hash();r.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var B=L.selectAll("circle, text");function j(e,t){var n=800/e[2];h=e,B.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),O.attr("r",(function(e){return e.r*n})),t&&U.each((function(e){e.fullName!==b.topLevelParentUri&&b.topLevelParentUri!==f||(e.textSel.style("display","none"),b.children&&b.children.length?_.each(b.children,(function(e){e.textSel.style("display","inline")})):b.textSel.style("display","inline"),b.parent&&_.each(b.parent.children,(function(e){e.name!==b.name&&e.textSel.style("display","inline")})))})),U.style("font-size",(function(e){return a.noPrefixes?s.a.Text.calcFontSize(e.noPrefixName,e.r*n):s.a.Text.calcFontSize(e.name,e.r*n)})).text((function(e){return a.noPrefixes?s.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):s.a.Text.getTextWithElipsisIfNeeded(e.name,e.r*n/3)}))}function V(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function H(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive||(e.textHidden=!0,this.style.display="none")}function q(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive&&(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display="")}function z(e,t){if(l((function(){c.showExternalElements=e.name===f})),b!==e&&(e.id&&r.history.replaceState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),e.children||(e=e.parent,b!==e))){if(t&&(P(),d3.selectAll(".selected").classed("selected",!1)),b.parent)for(var n=b;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=n.children,n=n.parent;if(2*(b=e).r/(2*b.r+20)<.3||c.currentSliderValue>c.currentBrowserLimit)j([b.x,b.y,V(b.r)]),U.each((function(e){H.call(this,e),q.call(this,e)}));else d3.transition().duration(d).tween("zoom",(function(e){var t=d3.interpolateZoom(h,[b.x,b.y,V(b.r)]);return function(e){j(t(e))}})).selectAll("text").each("start",H).each("end",q)}}j([b.x,b.y,V(b.r)],p),R=c.$on("rootFocus",(function(){r.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),I(n)})),w=c.$on("classSearch",(function(e){I(e)}))}function G(){var t=c.classHierarchyData.classCount;let n=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",G),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",G),window.removeEventListener("beforeunload",e)})),c.$watch("classHierarchyData",(function(){O&&O(),M&&M(),P&&P(),D&&D();var e=N();if(c.classHierarchyData.classCount){G();var t=angular.copy(c.classHierarchyData);var n,r,i=function(e){return E.nodes(e).sort((function(e,t){return e.sortingRank>t.sortingRank?-1:e.sortingRank<t.sortingRank||e.depth>t.depth?1:e.depth<t.depth?-1:0}))}(t);function o(e,t){var i={keepPrevState:!0,noPrefixes:N()};r=i.noPrefixes,F(n||e,i,b,!0),l((function(){h.set(g.CLASS_HIERARCHY_SWITCH_PREFIXES,t),S()}),70)}function s(e,i,s){if(e){h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:f,children:[]};for(var a=new Set,l=1;l<=e;l++)a.add(i[l].id),i[l].parent===i[0]&&n.children.push(i[l]);if(function e(t){if(t.children){for(var n=[],r=0;r<t.children.length;r++)a.has(t.children[r].id)&&n.push($.extend({},t.children[r]));t.children=n;for(r=0;r<t.children.length;r++)e(t.children[r])}}(n),s)r=angular.isUndefined(r)?N():r,F(n,{noPrefixes:r});else o(t)}}var a,u=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(u)s(u,i);else{var p={doFade:!0,keepPrevState:!0,noPrefixes:N()};F(t,p),S()}O=c.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:l((function(){!function(e){angular.isUndefined(e)||h.set(g.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),o(t,!0)}),50)}),!0),M=c.$watch("currentSliderValue",(function(e){s(e,i,!0)}),!0),D=c.$on("onEnterKeypressSearchAction",(function(e){a&&I(a)})),P=c.$on("searchedClass",(function(e,t){(a=k[t.name])&&I(a)}))}}),!0)}(c)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},110:function(e,t,n){"use strict";n.r(t);var r=n(302),i=n(301);n(10);function o(e,t,n,o,s,a,l,u,c,p,d,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(p){const d=u((function(){!function(p){d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))};var d=d3.layout.force().size([1200,600]).charge(-900),g=d.drag().on("dragstart",(function(e){d3.select(this).classed("selected",e.selected=!0)})),m=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),v=m.append("defs");v.append("marker").attr({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),v.append("marker").attr({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),v.append("marker").attr({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var e=r.a.Export.getCSSRules("css/domain-range-graph.css?v=2.4.2-RC1");$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>");var t=r.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attr({href:t,download:"domain-range-graph-"+n.getActiveRepository()+".svg"})}));var E=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");E.append("rect").attr({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var x=16+1200/18/2.5,y=x+1200/90;E.append("circle").attr({class:"legend-class-node",cx:(16+x)/2,cy:30,r:1200/18/4.5});E.append("text").attr({x:y,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node");E.append("circle").attr({class:"legend-object-node",cx:(16+x)/2,cy:70,r:1200/110/1.25});E.append("text").attr({x:y,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node");E.append("circle").attr({class:"legend-datatype-node",cx:(16+x)/2,cy:70+1200/45,r:1200/110/2});E.append("text").attr({x:y,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node");d3.select(".legend-class-node");E.append("line").attr({class:"property-arrow",x1:16,y1:123.33333333333334,x2:x,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),E.append("text").attr({x:y,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property");E.append("line").attr({class:"implicit-property-arrow",x1:16,y1:150,x2:x,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),E.append("text").attr({x:y,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property");E.append("line").attr({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:x,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),E.append("text").attr({x:y,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property");var T=m,N=s.search().uri,C=s.search().name,S=s.search().collapsed;o.getDomainRangeData(N,S).success((function(e,t,n){p.domainRangeGraphData=e})).error((function(e){c.error("Request for "+C+" failed!")})),$(window).on("popstate",(function(){a.set(l.DOMAIN_RANGE_WENT_BACK,!0)})),t.onpopstate=function(t){t.state&&e.$broadcast("changeCollapsedEdgesState",t.state.collapsed)},p.$watch("collapseEdges",(function(){angular.isUndefined(p.collapseEdges)||(a.set(l.DOMAIN_RANGE_COLLAPSE_EDGES,p.collapseEdges),"true"!==a.get(l.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:N,name:C,collapsed:t})}(p.collapseEdges),a.remove(l.DOMAIN_RANGE_WENT_BACK))})),p.$watch("domainRangeGraphData",(function(){if(p.domainRangeGraphData){var n=angular.copy(p.domainRangeGraphData);d.nodes(n.nodes).links(n.links);var r=T.selectAll(".link").data(n.links).enter().append("g");function o(e){e.style("stroke",f),e.style("stroke-width",2),e.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var a,l,c=0;r.each((function(e){if(e.objectPropNodeClassUri!==N)a=r.append("line").attr({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(e){switch(e.propertyType){case"objectLeft":e.targetRadius=1200/18;break;case"objectRight":e.targetRadius=1200/110;break;case"datatype":e.targetRadius=1200/110/2;break;default:e.targetRadius=0}var t=d3.select(this);e.targetNodeEdgeCount>1?o(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(l)){l=d3.select(this).append("path").attr({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(c+=e.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var m={};function v(){$.isEmptyObject(m)||(m.text.style("fill","black"),m.background.style("fill","#f0f0f0"))}function E(e){v(),m.text=d3.select(this),m.background=d3.select(this.previousSibling),m.text.style("fill","white"),m.background.style("fill",f),u((function(){p.showPredicatesInfoPanel=!0,p.selectedPredicate=e})),d3.event.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",v)}));var x=r.append("text").attr("class",(function(e){return e.objectPropNodeClassUri===N?"loop-link-property-name":"property-name"})).attr("dx",(function(e){return 1200/18/2*("objectLeft"===e.propertyType?1:-1)})).style("text-anchor",(function(e){return"objectLeft"===e.propertyType?"end":"start"})).style("font-size",1200/90).text((function(e){return e.targetNodeEdgeCount>1?e.targetNodeEdgeCount+" predicates":e.name}));x.each((function(e){var n=d3.select(this);/\d\spredicates/.test(n.text())?n.style("font-weight","bold").on("click",E):n.on("click",(function(e){t.open("resource?uri="+encodeURIComponent(e.uri),"_blank")}))}));var y=r.append("rect").attr("class",(function(e){return e.objectPropNodeClassUri!==N?"link-background":"loop-link-background"})).attr("width",(function(e){return e.calculatedWidth=this.previousSibling.getBBox().width,e.calculatedWidth+4})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+2})).attr("transform",(function(e){var t=2-1200/18/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(2+e.calculatedHeight/2)+")"})).on("click",(function(e){d3.event.stopPropagation()})),S=T.selectAll(".node").data(n.nodes).enter().append("g"),I=S.filter((function(e){return e.objectPropClassUri!==N})).append("circle").each((function(e){var t=d3.select(this);"main"===e.classPosition?t.attr({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===e.objectPropClassName?t.attr({class:"datatype-node",r:1200/110/2}):t.attr({class:"object-prop-node",r:1200/110})})).call(g);d3.selectAll(".object-prop-node").on("dblclick",(function(t,n){p.$apply((function(){e.$broadcast("reloadDomainRangeGraphView",t,n)}))})),S.filter((function(e){return e.objectPropClassName&&e.objectPropClassUri!==N})).append("text").attr("class",(function(e){return e.classPosition+"-class-label"})).style("font-size",1200/90).text((function(e){return e.objectPropClassName})).on("click",(function(e){t.open("resource?uri="+encodeURIComponent(e.objectPropClassUri),"_blank")}));var L=S.select("text");T.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(e){return i.a.Text.calcFontSize(C,1200/18)})).text(C).on("click",(function(e){t.open("resource?uri="+encodeURIComponent(N),"_blank")}))}));var A=T.select(".class-node + text"),b=d3.select(".class-node"),R=d3.selectAll(".loop-link-background"),w=d3.selectAll(".loop-link-property-name");if(x=d3.selectAll(".property-name"),!angular.isUndefined(l)){var O=[];R.each((function(e,t){d3.select(this);O.push({idx:t,width:e.calculatedWidth,height:e.calculatedHeight})}))}d.on("tick",(function(e){var t=8*e.alpha;function n(e){var t=e.x+1200/18*2,n=e.y-1200/18/1.9;var r=[];R.each((function(i,o){r.push(i),o<h?function(r,i){var o=$.grep(O,(function(e){return e.idx==i}));i>0&&(t+=parseFloat(i*(o[0].height/(i/1.4)))),r.attr({transform:"rotate(270, "+e.x+","+e.y+") translate("+t+","+n+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(e){var t;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(n){n.target.allEdges=e,t=this.getComputedTextLength()})).on("click",E),d3.select(".view-more-preds-rect").attr("height",t+4)}(r)}a.filter((function(e){return e.objectPropNodeClassUri!==N})).attr("x1",(function(e){return e.source.x})).attr("y1",(function(e){return e.source.y})).attr("x2",(function(e){return e.targetX})).attr("y2",(function(e){return e.targetY})).each((function(e){!function(e){"objectLeft"===e.propertyType?(e.source.x-=8*t,e.source.y-=t/9):(e.target.x+=8*t,e.target.y-=t/9)}(e);var n=Math.atan2(e.target.y-e.source.y,e.target.x-e.source.x);e.targetX=e.target.x-Math.cos(n)*e.targetRadius,e.targetY=e.target.y-Math.sin(n)*e.targetRadius})),I.each((function(e){"main"!==e.classPosition||angular.isUndefined(l)||(!function(e){var t=e.x+64,n=e.y-1200/18/5.7-5;l.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+n+")")}(e),function(e){function t(t,n){var r=$.grep(O,(function(e){return e.idx==n})),i=0;n>0&&(i=parseFloat(2*n*(r[0].height/1.4)));var o=e.x,s=e.y-1200/18*2.1-i;t.attr({x:o,y:s}).moveToFront()}w.each((function(e,n){var r=d3.select(this),i=w.size()-h;i<0?t(r,n):(0==n&&!p.collapseEdges&&i>1&&(!function(e,t,n){e.classed("view-more-preds-label",!0).text(n+" predicates more ..."),null!==this.nextSibling&&t.classed("view-more-preds-rect",!0)}(r,d3.select(this.nextSibling),i),t(r,n)),n<h?t(r,n):r.remove())}))}(e),n(e)),e.objectPropClassUri!==N&&d3.select(this).attr("cx",(function(e){return"main"===e.classPosition?function(e){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(e){return Math.log(e)/Math.LN10});var t=b.attr("cx")-600,n=.5*Math.log10(Math.abs(t));return e.x+=t>0?-n:n,e.x}(e):e.x})).attr("cy",(function(e){return e.y}))})),A.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).moveToFront(),y.filter((function(e){return e.objectPropNodeClassUri!==N})).attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),x.attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),L.attr("x",(function(e){return"right"===e.classPosition?e.x+1200/110*1.2:e.x-1200/110*1.2})).attr("y",(function(e){return e.y})).moveToFront()})).linkDistance(1200/3.5).start()}}))}(p)}),50);p.$on("$destroy",(function(){u.cancel(d)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--primary-color)").constant("ONTO_GREEN","var(--tertiary-color)").constant("ONTO_BLUE","var(--secondary-color)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},111:function(e,t){function n(e,t){return{restrict:"A",scope:{},templateUrl:"js/angular/graphexplore/templates/systemRepoWarningTemplate.html",link:function(n){n.isSystemRepository=function(){return"SYSTEM"===e.getActiveRepository()},n.hasPermission=function(){return t.hasPermission()}}}}angular.module("graphdb.framework.graphexplore.directives.sysrepo",["graphdb.framework.graphexplore.controllers.class"]).directive("systemRepoWarning",n),n.$inject=["$repositories","$rootScope"]},112:function(e,t){function n(e){return{restrict:"AE",scope:{rdfsLabel:"=",rdfsComment:"=",expanded:"=",alwaysExpanded:"="},templateUrl:"js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html",link:function(t,n){t.stringLimit=e,t.scrollToTop=function(){n[0].getElementsByClassName("rdfs-comment")[0].scrollTop=0},t.checkCommentLength=function(){return n[0].getElementsByClassName("rdfs-comment-text")[0].innerText.length<e},t.equalHeights=function(){const e=n[0].getElementsByClassName("rdfs-comment-text")[0].innerHeight;e<250&&t.expanded&&(n[0].getElementsByClassName("rdfs-comment")[0].innerHeight=e)},t.toggleFullComment=function(){t.expanded=!t.expanded},t.$watch("expanded || alwaysExpanded",(function(n){t.stringLimit=n?t.rdfsComment.length:e}))}}}angular.module("graphdb.framework.graphexplore.directives.rdfsdetails",[]).directive("rdfsCommentLabel",n).constant("SHORT_COMMENT_LENGTH",100),n.$inject=["SHORT_COMMENT_LENGTH"]},113:function(e,t,n){"use strict";n.r(t);var r=n(302);n(84);function i(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(n){n.$watch("dependenciesData",(function(){if(n.dependenciesData){const i=n.dependenciesData;!function(i,o){if(function(){let e=!0;for(const t of i){if(t.some(e=>0!==e)){e=!1;break}}return e}())return;const s=d3.scale.category20(),a=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){a.style("opacity",0)}));const l=Math.min(800,800)/2.8,u=l-24,c=d3.svg.arc().innerRadius(u).outerRadius(l),p=d3.layout.chord().padding(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),d=d3.svg.chord().radius(u),f=d3.select("#dependencies-chord").append("svg").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").style("font","10px sans-serif").append("g").attr("id","circle").attr("transform","translate(400,400)");f.append("circle").attr("r",l).style("fill","none"),p.matrix(i);const h=f.selectAll(".group").data(p.groups).enter().append("g").attr("class","group").on("mouseover",(function(e,t){g.classed("fade",(function(e){return e.source.index!==t&&e.target.index!==t}))}));h.append("title").text((function(e,t){return o[t]})),h.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",c).style("fill",(function(e,t){return s(t)})),h.append("text").each((function(e){e.angle=(e.startAngle+e.endAngle)/2})).attr("dy",".35em").attr("transform",(function(e){return"rotate("+(180*e.angle/Math.PI-90)+")translate("+(u+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return o[e.index]}));const g=f.selectAll(".chord").data(p.chords).enter().append("path").attr("class","chord").style("fill",(function(e){return s(e.target.index)})).style("fill-opacity",".67").style("stroke","#000").style("stroke-width",".25px").style("cursor","pointer").attr("d",d);g.on("mouseover",(function(){d3.select(this).style({"fill-opacity":"1"})})),g.on("mouseout",(function(){d3.select(this).style({"fill-opacity":".67"})})),g.on("click",(function(e){const r=o[e.source.index],i=o[e.target.index],s=d3.event.pageX,l=d3.event.pageY;t.getPredicates(r,i,n.selectedGraph&&n.selectedGraph.contextID.uri).success((function(e){let t="<div class='dependencies-tooltip'>"+("<div class='row'>"+r+" <i class='fa fa-exchange'></i> "+i+"</div>")+_.map(e.slice(0,10),(function(e){const t=" <i class='fa fa-long-arrow-"+("out"===e.direction?"right":"left")+"'></i>";return"<div class='row'>"+e.predicate+" : "+e.weight+t+" </div>"})).join("");e.length>10?t=t+"<div class='pull-right'>And "+(e.length-10).toString()+" more...</div></div>":t+="</div>",a.html(t).style("left",s+"px").style("top",l+"px")})),a.transition().duration(200).style("opacity",1)})),d3.select("#circle").on("mouseleave",(function(){f.selectAll(".chord").classed("fade",!1)})),d3.select("#download-svg").on("mouseover",(function(){const t=r.a.Export.generateBase64ImageSource(".dependencies-chord svg");d3.select(this).attr({href:t,download:"dependencies-"+e.getActiveRepository()+".svg"})}))}(i.matrix,i.nodes,i.direction)}}))}}}angular.module("graphdb.framework.graphexplore.directives.dependencies",["graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.rest.graphexplore.data.service"]).directive("dependenciesChord",i),i.$inject=["$repositories","GraphDataRestService"]},114:function(e,t){function n(){return{restrict:"AE",scope:{filterQueryObj:"=",filterFunction:"&",listItemsObj:"=",listItemsNotFiltered:"=",searchPlaceholder:"@"},templateUrl:"js/angular/graphexplore/templates/listItemsSearchFilterTemplate.html",link:function(e){e.filterFunction=e.filterFunction(),e.$watch("filterQueryObj.query",(function(){var t,n,r,i;e.listItemsObj.items=(t=e.filterQueryObj.query,n=e.listItemsObj.items,r=e.listItemsNotFiltered,i=e.filterFunction,t.length>0?_.filter(r,i):n.length!==r.length?r:n)}))}}}angular.module("graphdb.framework.graphexplore.directives.searchfilter",[]).directive("listItemsSearchFilter",n),n.$inject=[]},115:function(e,t){function n(e,t){return{restrict:"AE",scope:{searchData:"=",searchFields:"@",titleField:"@",searchPlaceholder:"@",initialValue:"=",searchedObjCallback:"&"},templateUrl:"js/angular/graphexplore/templates/searchIconInputTemplate.html",link:function(n,r){n.searchedObjCallback=n.searchedObjCallback(),n.performSearchActionOnEnter=function(){e.$broadcast("onEnterKeypressSearchAction")},n.showInput=function(){$("#selectGraphDropdown").hide(),r.find("#search_input #search_input_value")[0].value="",r.find(".search-icon").addClass("animated bounceOut").css("z-index","-1"),r.find("#search_input .angucomplete-holder").css("display","block"),t((function(){r.find("#search_input .angucomplete-holder").css("width","250px").css("left","-215px"),t((function(){r.find(".close-icon").css("display","block").addClass("animated bounceIn").css("z-index","3"),r.find("#search_input #search_input_value").focus()}),200)}),1)},n.hideInput=function(){r.find("#search_input #search_input_value")[0].value="",r.find("#search_input .angucomplete-holder").css("width","0px").css("left","35px"),t((function(){r.find("#search_input .angucomplete-holder").css("display","none"),$("#selectGraphDropdown").show()}),250),r.find(".close-icon").addClass("animated bounceOut").removeClass("bounceOut").css("z-index","-1").css("display","none").click((function(){$(".tooltip").hide()})),t((function(){r.find(".search-icon").css("display","inline-block").removeClass("bounceOut").addClass("bounceIn").css("z-index","3")}),200)}}}}angular.module("graphdb.framework.graphexplore.directives.searchcontrols",[]).directive("searchIconInput",n),n.$inject=["$rootScope","$timeout"]},152:function(e,t,n){"use strict";n.r(t);n(7),n(29),n(23),n(22),n(315),n(316),n(297),n(304),n(298),n(311),n(317),n(318),n(307),n(301),n(308),n(302),n(84),n(100),n(101),n(102),n(103),n(104),n(105),n(106),n(107),n(108),n(109),n(110),n(111),n(112),n(113),n(114),n(115),n(63),n(83);angular.module("graphdb.framework.graphexplore",["graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.graphexplore.data.service","graphdb.framework.graphexplore.services.uiscroll","graphdb.framework.graphexplore.services.rdfsdetails","graphdb.framework.rest.graphexplore.savedgraphs.service","graphdb.framework.rest.graphconfig.service","graphdb.framework.graphexplore.controllers.class","graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.graphexplore.controllers.graphviz","graphdb.framework.graphexplore.controllers.graphviz.config","graphdb.framework.graphexplore.directives.sysrepo","graphdb.framework.graphexplore.directives.rdfsdetails","graphdb.framework.graphexplore.directives.searchfilter","graphdb.framework.graphexplore.directives.class","graphdb.framework.graphexplore.directives.domainrange","graphdb.framework.graphexplore.directives.dependencies","graphdb.framework.graphexplore.directives.searchcontrols","graphdb.framework.core.directives.queryeditor.controllers","graphdb.framework.core.directives.queryeditor.queryeditor"])},298:function(e,t,n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){return function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=p(),i=null,o=null,s=null,a=null;function l(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,o=i.createSVGPoint(),document.body.appendChild(r)}l.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(s=r.pop());var i,o=n.apply(this,r),p=t.apply(this,r),f=e.apply(this,r),h=d(),g=c.length,m=document.documentElement.scrollTop||document.body.scrollTop,v=document.documentElement.scrollLeft||document.body.scrollLeft,E=a.apply(this,r);for(h.html(o).style({opacity:1,"pointer-events":"all"});g--;)h.classed(c[g],!1);return i=u.get(f).apply(this),E?h.style(E):h.classed(f,!0).style({top:i.top+p[0]+m+"px",left:i.left+p[1]+v+"px"}),l},l.hide=function(){return d().style({opacity:0,"pointer-events":"none"}),l},l.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return d().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d(),n),l},l.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return d().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d(),n),l},l.direction=function(t){return arguments.length?(e=null==t?t:d3.functor(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:d3.functor(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:d3.functor(e),l):n},l.customPosition=function(e){return arguments.length?(a=null==e?e:d3.functor(e),l):a},l.destroy=function(){return r&&(d().remove(),r=null),l};var u=d3.map({n:function(){var e=f();return{top:e.n.y-r.offsetHeight,left:e.n.x-r.offsetWidth/2}},s:function(){var e=f();return{top:e.s.y,left:e.s.x-r.offsetWidth/2}},e:function(){var e=f();return{top:e.e.y-r.offsetHeight/2,left:e.e.x}},w:function(){var e=f();return{top:e.w.y-r.offsetHeight/2,left:e.w.x-r.offsetWidth}},nw:function(){var e=f();return{top:e.nw.y-r.offsetHeight,left:e.nw.x-r.offsetWidth}},ne:function(){var e=f();return{top:e.ne.y-r.offsetHeight,left:e.ne.x}},sw:function(){var e=f();return{top:e.sw.y,left:e.sw.x-r.offsetWidth}},se:function(){var e=f();return{top:e.se.y,left:e.e.x}}}),c=u.keys();function p(){var e=d3.select(document.createElement("div"));return e.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),e.node()}function d(){return null===r&&(r=p(),document.body.appendChild(r)),d3.select(r)}function f(){for(var e=s||d3.event.target;void 0===e.getScreenCTM&&"undefined"===e.parentNode;)e=e.parentNode;var t={},n=e.getScreenCTM(),r=e.getBBox(),i=r.width,a=r.height,l=r.x,u=r.y;return o.x=l,o.y=u,t.nw=o.matrixTransform(n),o.x+=i,t.ne=o.matrixTransform(n),o.y+=a,t.se=o.matrixTransform(n),o.x-=i,t.sw=o.matrixTransform(n),o.y-=a/2,t.w=o.matrixTransform(n),o.x+=i,t.e=o.matrixTransform(n),o.x-=i/2,o.y-=a/2,t.n=o.matrixTransform(n),o.y+=a,t.s=o.matrixTransform(n),t}return l}})?r.apply(t,i):r)||(e.exports=o)},301:function(e,t,n){"use strict";var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),r.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},r.Click={delayDblClick:function(){var e=d3.dispatch("click","dblclick");return d3.rebind((function(t){var n,r=null;t.on("mousedown",(function(){n=d3.mouse(document.body),new Date})),t.on("mouseup",(function(t){var i,o;i=n,o=d3.mouse(document.body),Math.sqrt(Math.pow(i[0]-o[0],2),Math.pow(i[1]-o[1],2))>5||(r?(window.clearTimeout(r),r=null,e.dblclick(t)):r=window.setTimeout((d3.event,function(){e.click(t),r=null}),250))}))}),e,"on")}},t.a=r},302:function(e,t,n){"use strict";var r=n(297),i=i||{};i.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let n="";return _.each(t,(function(e){n+=e.cssText})),n},generateBase64ImageSource:function(e){e||(e="svg");const t=r.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}},t.a=i},303:function(e,t,n){var r,i=i||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),i=e.webkitRequestFileSystem,o=e.requestFileSystem||i||e.mozRequestFileSystem,s=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},a=0,l=function(t){var r=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?r():setTimeout(r,500)},u=function(e,t,n){for(var r=(t=[].concat(t)).length;r--;){var i=e["on"+t[r]];if("function"==typeof i)try{i.call(e,n||e)}catch(e){s(e)}}},c=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},p=function(t,s){t=c(t);var p,d,f,h=this,g=t.type,m=!1,v=function(){u(h,"writestart progress write writeend".split(" "))},E=function(){(!m&&p||(p=n().createObjectURL(t)),d)?d.location.href=p:null==e.open(p,"_blank")&&"undefined"!=typeof safari&&(e.location.href=p);h.readyState=h.DONE,v(),l(p)},x=function(e){return function(){if(h.readyState!==h.DONE)return e.apply(this,arguments)}},y={create:!0,exclusive:!1};if(h.readyState=h.INIT,s||(s="download"),r)return p=n().createObjectURL(t),r.href=p,r.download=s,void setTimeout((function(){var e,t;e=r,t=new MouseEvent("click"),e.dispatchEvent(t),v(),l(p),h.readyState=h.DONE}));e.chrome&&g&&"application/octet-stream"!==g&&(f=t.slice||t.webkitSlice,t=f.call(t,0,t.size,"application/octet-stream"),m=!0),i&&"download"!==s&&(s+=".download"),("application/octet-stream"===g||i)&&(d=e),o?(a+=t.size,o(e.TEMPORARY,a,x((function(e){e.root.getDirectory("saved",y,x((function(e){var n=function(){e.getFile(s,y,x((function(e){e.createWriter(x((function(n){n.onwriteend=function(t){d.location.href=e.toURL(),h.readyState=h.DONE,u(h,"writeend",t),l(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&E()},"writestart progress write abort".split(" ").forEach((function(e){n["on"+e]=h["on"+e]})),n.write(t),h.abort=function(){n.abort(),h.readyState=h.DONE},h.readyState=h.WRITING})),E)})),E)};e.getFile(s,{create:!1},x((function(e){e.remove(),n()})),x((function(e){e.code===e.NOT_FOUND_ERR?n():E()})))})),E)})),E)):E()},d=p.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t){return navigator.msSaveOrOpenBlob(c(e),t)}:(d.abort=function(){this.readyState=this.DONE,u(this,"abort")},d.readyState=d.INIT=0,d.WRITING=1,d.DONE=2,d.error=d.onwritestart=d.onprogress=d.onwrite=d.onabort=d.onerror=d.onwriteend=null,function(e,t){return new p(e,t)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[12,2,3,9,23,30,36,37,47,48,76,85,86,87,88,89,90,91,93,94,130,134,135,136,140,154],{100:function(e,t){function n(e){return{initLazyList:function(t,n,r,i,o){return e((function(){const e=t+i-1,s=Math.max(0-i,e),a=Math.min(e+n-1,o.length);s>a?r([]):$.isArray(o)&&r(o.slice(s,a+1))}),100,!0)}}}angular.module("graphdb.framework.graphexplore.services.uiscroll",[]).factory("UiScrollService",n),n.$inject=["$timeout"]},101:function(e,t){angular.module("graphdb.framework.graphexplore.services.rdfsdetails",[]).factory("RdfsLabelCommentService",(function(){return{processAndFilterLabelAndComment:function(e){function t(e){const t={};for(let n in e)if(e.hasOwnProperty(n)){let r=n;n.indexOf(":")>-1&&(r=n,n=n.split(":")[1].toLowerCase()),t[n]=e[r]}return t}const n=e.results.bindings,r=[],i=[];_.each(n,(function(e){let n;angular.isUndefined(e.label)||(n=t(e.label),r.push(n)),angular.isUndefined(e.comment)||(n=t(e.comment),i.push(n))}));const o=function(e){return"en"===e.lang||"de"===e.lang},s=$.grep(r,o)[0],a=$.grep(i,o)[0],l=angular.isUndefined(s)?r.length>0?r[0].value:void 0:s.value,u=angular.isUndefined(a)?i.length>0?i[0].value:void 0:a.value;return{rdfsLabel:l,rdfsComment:u}}}}))},102:function(e,t){angular.module("graphdb.framework.rest.graphexplore.savedgraphs.service",[]).factory("SavedGraphsRestService",n),n.$inject=["$http"];function n(e){return{getSavedGraphs:function(){return e.get("rest/explore-graph/saved")},getSavedGraph:function(t){return e.get("rest/explore-graph/saved/"+encodeURIComponent(t))},editSavedGraph:function(t){return e.put("rest/explore-graph/saved/"+encodeURIComponent(t.id),t)},deleteSavedGraph:function(t){return e.delete("rest/explore-graph/saved/"+encodeURIComponent(t.id))},addNewSavedGraph:function(t){return e.post("rest/explore-graph/saved",t)}}}},103:function(e,t){angular.module("graphdb.framework.rest.graphconfig.service",[]).factory("GraphConfigRestService",n);function n(e){return{getGraphConfigs:function(){return e.get("rest/explore-graph/config")},getGraphConfigSamples:function(){return e.get("rest/explore-graph/samples")},loadGraphForConfig:function(t,n,r,i){return e.get(`rest/explore-graph/config/graph/${encodeURIComponent(t.id)}?includeInferred=${n}&linksLimit=${r}&sameAsState=${i}`)},getConfig:function(t){return e.get("rest/explore-graph/config/"+encodeURIComponent(t))},createGraphConfig:function(t){return e.post("rest/explore-graph/config",t)},updateGraphConfig:function(t){return e.put("rest/explore-graph/config/"+encodeURIComponent(t.id),t)},deleteGraphConfig:function(t){return e.delete("rest/explore-graph/config/"+encodeURIComponent(t.id))},validateQuery:function(t,n,r,i,o){return e({method:"POST",url:"rest/explore-graph/validate",data:{query:t,queryType:n,params:r,all:i,oneOf:o}})}}}n.$inject=["$http"]},104:function(e,t,n){"use strict";n.r(t);n(10);function r(e,t,n,r,i,o,s,a,l,u,c,p,d,f,h,g,m){e.classHierarchyData={},e.instancesObj={},e.instancesQueryObj={},e.instancesObj.items=[],e.instancesNotFiltered=[],e.isWarningShowed=!1,e.onopen=e.onclose=()=>angular.noop(),e.currentBrowserLimit=2e3,d.firefox?e.currentBrowserLimit=50:(d.safari||d.msie||d.msedge)&&(e.currentBrowserLimit=400);const v={};let E=0,x=0;t.key="",v.get=function(t,n,r){return l.initLazyList(t,n,r,E,e.instancesObj.items)};let y=allGraphs;const T=function(){if(e.getActiveRepository())return g.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,N()})).error((function(t){e.repositoryError=getError(t),s.error(getError(t),m.instant("graphexplore.error.getting.graphs"))}))},N=function(){const t=f.get("classHierarchy-selectedGraph-"+r.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?y=t:f.set("classHierarchy-selectedGraph-"+r.getActiveRepository(),y)};function C(t,n,r){e.classCountSlider.options&&e.classCountSlider.options.ceil!==n&&(e.classCountSlider={});var i;e.classCountSlider.value||(e.showExternalElements=!0,e.classCountSlider={value:n,options:{floor:1,ceil:n,vertical:!0,showSelectionBar:!0,onChange:function(){c(S,100,!0)}}},null===f.get(h.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE)&&n>e.currentBrowserLimit&&(i=e.currentBrowserLimit,d.chrome?s.warning(m.instant("graphexplore.disabling.animations",{classLimit:i}),m.instant("graphexplore.reducing.visual.effects")):s.warning(m.instant("graphexplore.browser.performance",{browser:d.name,classLimit:i}),m.instant("graphexplore.reducing.visual.effects"))));const o=f.get(h.CLASS_HIERARCHY_SWITCH_PREFIXES);null!=o&&"true"!==o&&(e.showExternalElements=!0),r?e.classCountSlider.value=r:n>=1500&&(e.classCountSlider.value=1500,s.warning(m.instant("graphexplore.class.count.slider",{count:1500}),m.instant("graphexplore.reducing.class.count"))),n>=25&&!window.ActiveXObject&&"ActiveXObject"in window&&!e.isWarningShowed&&(e.classCountSlider.value=25,e.isWarningShowed=!0,s.warning(m.instant("graphexplore.class.count.browser",{count:25}),m.instant("graphexplore.reducing.class.count"))),c((function(){e.$broadcast("reCalcViewDimensions")}),200),S();let a=0;$("rzslider").on("wheel",(function(t){t.preventDefault(),t.stopPropagation();const n=(new Date).getTime();if(!(n-a>100))return;a=n,t=t.originalEvent;let r=e.classCountSlider.value;t.deltaY<=-1?r+=1:t.deltaY>=1&&(r-=1),r!==e.classCountSlider.value&&r>=e.classCountSlider.options.floor&&r<=e.classCountSlider.options.ceil&&e.$apply((function(){e.classCountSlider.value=r,c(S,100,!0)}))}))}function S(){e.currentSliderValue=e.classCountSlider.value}function I(e){const t=e.fullName,r=e.name;a.checkDomainRangeData(t).success((function(e,i){204===i?s.warning(m.instant("graphexplore.no.domain.range",{name:r})):(f.set(h.CLASS_HIERARCHY_LAST_SELECTED_CLASS,n.hash()),n.hash("").path("domain-range-graph").search("uri",t).search("name",r))})).error((function(){s.error(m.instant("graphexplore.error.request.failed",{name:r}))}))}function L(){n.replace().hash("1"),e.instancesObj.items=[],e.showExternalElements=!1,e.showClassInfoPanel=!1,f.clearClassHieararchyState(),e.hidePrefixes="true"===f.get(h.CLASS_HIERARCHY_HIDE_PREFIXES),e.currentSliderValue=void 0,e.classHierarchyData={},t.$broadcast("angucomplete-alt:clearInput")}function A(){e.hasClassHierarchy()&&c((function(){$("#toolbar").removeClass("ng-hide")}),0)}t.$watch((function(){return t.key}),(function(){E=0,_.each(e.instancesObj.items,(function(e){t.key>e&&E++})),x++})),v.revision=function(){return x},e.adapterContainer={adapter:{remain:!0}},e.$on("goToDomainRangeGraphView",(function(e,t){I(t)})),e.$on("classCount",C),e.$on("repositoryIsSet",(function(){if(!i.isLicenseValid())return;if(b===r.getActiveRepository())return;b=r.getActiveRepository();if(e.repositoryError=null,!b)return;y=allGraphs,T().then(R)})),e.datasource=v,e.goToDomainRangeGraphView=I,e.toggleClassInfoSidePanel=function(){e.showClassInfoPanel=!e.showClassInfoPanel,t.$broadcast("sidePanelClosed")},e.getActiveRepositoryNoError=function(){if(!e.repositoryError)return r.getActiveRepository()},e.isSystemRepository=function(){return r.isSystemRepository()},e.confirmReloadClassHierarchy=function(){p.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.hierarchy"),warning:!0}).result.then((function(){L(),e.loader=!0,e.hierarchyError=!1,a.reloadClassHierarchy(y.contextID.uri).success((function(t){e.loader=!1,e.classHierarchyData=t,A(),C()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))}))}))},e.focusOnRoot=function(){e.$broadcast("rootFocus")},e.copyToClipboard=function(e){p.openCopyToClipboardModal(e)},e.searchedClassCallback=function(e){if(e){const n={name:e.title};t.$broadcast("searchedClass",n)}},e.instancesQueryObj.query="",e.instancesFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.instancesQueryObj.query.toLowerCase())>=0},T(),e.$watch("instancesObj.items",(function(){e.instancesObj.items.length>0&&c((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedClass",(function(){e.showClassInfoPanel&&function(t){const n=t.fullName;let r=t.name;if(r===n){const e=r.lastIndexOf("#");r=r.substring(e+1)}e.encodedUri=encodeURIComponent(n);const i=encodeURIComponent("prefix onto:<http://www.ontotext.com/>\nselect ?s {\n ?s a <"+n+"> .\n}");e.viewInstancesUri="sparql?name="+r+"&infer=true&sameAs=false&query="+i+"&execute=true",a.getRdfsLabelAndComment(n).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment,e.expanded=!1})).error((function(){s.error("Error getting rdfs:label and rdfs:comment")})),e.instancesQueryObj.query="",e.instancesLoader=!0,a.getClassInstances(n).success((function(t){e.instancesObj.items=[],_.each(t,(function(t,n){const r={};r.type=t.startsWith("<<")&&t.endsWith(">>")?"triple":"uri",r.absUri=encodeURIComponent(t),r.absUriNonEncoded=t,r.resolvedUri=n,e.instancesObj.items.push(r)})),e.instancesLoader=!1,e.instancesSearchPlaceholder=e.instancesObj.items.length<1e3?"Search class instances":"Search first 1000 class instances",e.instancesNotFiltered=e.instancesObj.items})).error((function(){s.error(m.instant("graphexplore.error.instances.request"))}))}(e.selectedClass)})),$(document).ready((function(){$(".prefix-toggle").click((function(){$(".tooltip").hide()}))}));let b=r.getActiveRepository();function R(){L(),!e.isSystemRepository()&&e.isLicenseValid()&&(e.hierarchyError=!1,e.loader=!0,a.getClassHierarchyData(y.contextID.uri).success((function(t,n){e.showExternalElements=!0,e.loader=!1,e.classHierarchyData=t,207===n&&s.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),A()})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),s.error(getError(t),m.instant("graphexplore.error.rdf.class.request"))})))}e.hasClassHierarchy=function(){return e.classHierarchyData.classCount&&e.getActiveRepositoryNoError()&&!e.isSystemRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.chosenGraph=function(e){y=e,R(),f.set("classHierarchy-selectedGraph-"+r.getActiveRepository(),y)},e.getSelGraphValue=function(){return y.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelGraphValue()}}angular.module("graphdb.framework.graphexplore.controllers.class",["pageslide-directive","ngAnimate","ui.scroll.jqlite","ui.scroll","angucomplete-alt","rzSlider","toastr","graphdb.framework.utils.localstorageadapter"]).controller("RdfClassHierarchyCtlr",r),r.$inject=["$scope","$rootScope","$location","$repositories","$licenseService","$window","toastr","GraphDataRestService","UiScrollService","RdfsLabelCommentService","$timeout","ModalService","bowser","LocalStorageAdapter","LSKeys","RDF4JRepositoriesRestService","$translate"]},105:function(e,t,n){"use strict";n.r(t);n(10);function r(e,t,n,r,i,o,s,a,l,u,c,p,d){e.predicatesObj={},e.predicatesQueryObj={},e.predicatesObj.items=[],e.predicatesQueryObj.query="",e.predicatesListNotFiltered=[],e.predicatesSearchPlaceholder="Search predicates",e.onopen=e.onclose=()=>angular.noop();const f={};let h=0,g=0;n.key="",f.get=function(t,n,r){return u.initLazyList(t,n,r,h,e.predicatesObj.items)},n.$watch((function(){return n.key}),(function(){h=0,_.each(e.predicatesObj.items,(function(e){n.key>e&&h++})),g++})),f.revision=function(){return g},e.adapterContainer={adapter:{remain:!0}};const m=s.get(a.DOMAIN_RANGE_COLLAPSE_EDGES);function v(){const e=s.get(a.CLASS_HIERARCHY_LAST_SELECTED_CLASS);t.search("").hash(e).path("hierarchy")}e.collapseEdges=null===m||"true"===m,e.datasource=f,e.$on("reloadDomainRangeGraphView",(function(e,n){const r=n.objectPropClassUri,i=n.objectPropClassName;t.path("domain-range-graph").search("uri",r).search("name",i)})),e.$on("switchEdgeMode",(function(e,n){t.path("domain-range-graph").search("uri",n.uri).search("name",n.name).search("collapsed",n.collapsed)})),e.$on("repositoryIsSet",(function(){if(E===i.getActiveRepository())return;E=i.getActiveRepository();v()})),e.$on("changeCollapsedEdgesState",(function(t,n){e.collapseEdges=!n,s.set(a.DOMAIN_RANGE_COLLAPSE_EDGES,e.collapseEdges)})),e.goToClassHierarchyView=v,e.copyToClipboard=function(e){c.openCopyToClipboardModal(e)},e.toggleCollapseEdgesState=function(){e.collapseEdges=!e.collapseEdges,o.history.pushState({collapsed:e.collapseEdges},"domainRangePage",null)},e.predicatesListFilterFunc=function(t){return t.resolvedUri.toLowerCase().indexOf(e.predicatesQueryObj.query.toLowerCase())>=0},e.$watch("predicatesObj.items",(function(){e.predicatesObj.items>0&&r((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("selectedPredicate",(function(){e.showPredicatesInfoPanel&&function(t){const n=t.target,r=t.source;e.encodedUri=encodeURIComponent(t.uri),e.sourceTargetObjectNodeUri=n.objectPropClassUri?n.objectPropClassUri:r.objectPropClassUri,e.encodedSourceTargetObjectNodeUri=encodeURIComponent(e.sourceTargetObjectNodeUri),e.sourceTargetObjectNodeName=n.objectPropClassName?n.objectPropClassName:r.objectPropClassName?r.objectPropClassName:"<i>Literal</i>",-1===e.sourceTargetObjectNodeName.indexOf("Literal")?l.getRdfsLabelAndComment(e.sourceTargetObjectNodeUri).success((function(t){e.rdfsLabel=t.label,e.rdfsComment=t.comment})).error((function(){p.error(d.instant("domain.range.error.get.label.comment"))})):(e.rdfsComment=void 0,e.rdfsLabel=void 0);e.predicatesObj.items=[],e.predicatesQueryObj.query="";const i=n.allEdges?n.allEdges:r.allEdges;_.each(i,(function(t){const n={};n.absUri=encodeURIComponent(t.uri),n.absUriNonEncoded=t.uri,n.resolvedUri=t.name,n.isImplicit=t.implicit,e.predicatesObj.items.push(n)})),e.predicatesListNotFiltered=e.predicatesObj.items}(e.selectedPredicate)})),$(document).ready((function(){$(".compact-mode-toggle").click((function(){$(".tooltip").hide()}))}));let E=i.getActiveRepository()}angular.module("graphdb.framework.graphexplore.controllers.domainrange",["ui.scroll.jqlite","ui.scroll","ngSanitize","graphdb.framework.utils.localstorageadapter"]).controller("DomainRangeGraphCtlr",r),r.$inject=["$scope","$location","$rootScope","$timeout","$repositories","$window","LocalStorageAdapter","LSKeys","GraphDataRestService","UiScrollService","ModalService","toastr","$translate"]},106:function(e,t,n){(function(e){const t="WAIT",n="NO_REPO",r="READY",i="IN_PROGRESS",o="ERROR",s={contextID:{type:"all",value:"all.graphs.label",uri:""}};function a(e){if(e<1e3)return e;const t=Math.floor(Math.log(e)/Math.log(1e3));let n=e/Math.pow(1e3,t);return n=n%1>1/Math.pow(1e3,t-1)?n.toFixed(2):n.toFixed(0),n+["K","M","G","T","P","H"][t-1]}function l(e,a,l,u,c,p,d,f,h,g,m){let v=null;e.status=l.getActiveRepository()?t:n;let E=s;const x=function(){g.resolveGraphs().success((function(t){e.graphsInRepo=t.results.bindings.length>1002?t.results.bindings.slice(0,1002):t.results.bindings,y(),e.isSystemRepository()?"READY"!==e.status&&N():(e.status="WAIT",N(!0))})).error((function(t){e.repositoryError=getError(t),u.error(getError(t),m.instant("graphexplore.error.getting.graph"))}))},y=function(){const t=h.get("dependencies-selectedGraph-"+l.getActiveRepository());null!==t&&e.graphsInRepo.some(e=>e.contextID.uri===t.contextID.uri)?E=t:h.set("dependencies-selectedGraph-"+l.getActiveRepository(),E)},T=function(n){d3.select("#dependencies-chord").html(""),e.status=t,p.getRelationshipsData(n,e.direction,E.contextID.uri).success((function(t){e.dependenciesData={matrix:t.right,nodes:t.left,hasLinks:_.sum(_.map(t.right,(function(e){return _.sum(e)})))>0,direction:e.direction},e.status=r})).error((function(t){e.status=r,u.error(getError(t),m.instant("graphexplore.error.dependencies.count"))}))},N=function(n){(e.status!==r||n)&&(e.status=t,p.getRelationshipsStatus(E.contextID.uri).success((function(t){if(e.status=t,e.status===i){if(null!==v)return;v=c(N,2e3)}e.status===r&&(null!==v&&(c.cancel(v),v=null),p.getRelationshipsClasses(e.direction,E.contextID.uri).success((function(t,n){e.allClasses.items=_.filter(t,L),e.allNotFilteredClasses=t,e.selectedClasses=void 0,angular.isUndefined(e.selectedClasses)&&(e.selectedClasses=t.slice(0,10)),T(e.selectedClasses),207===n&&u.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed"))}))),0===e.status.indexOf("ERROR;")&&(e.status=o,u.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})))})).error((function(t){e.status=o,u.error(getError(t),m.instant("graphexplore.error.dependencies.count.status"))})))};e.allClasses={},e.allClasses.items=[],e.allNotFilteredClasses=[],e.direction="all";const C={};let S=0,I=0;function L(t){return-1!==t.name.toLowerCase().indexOf(e.classQuery.query.toLowerCase())}a.key="",C.get=function(t,n,r){return d.initLazyList(t,n,r,S,e.allClasses.items)},a.$watch((function(){return a.key}),(function(){S=0,_.each(e.allClasses.items,(function(e){a.key>e&&S++})),I++})),C.revision=function(){return I},e.datasource=C,e.adapterContainer={adapter:{remain:!0}},e.classQuery={},e.classQuery.query="",e.classFilterFunc=L,e.$watch("allClasses.items",(function(){e.allClasses.items.length>0&&c((function(){e.adapterContainer.adapter.reload()}),30)})),e.$watch("direction",(function(){!l.getActiveRepository()||e.isSystemRepository()||l.isActiveRepoFedXType()||x()})),e.$on("$destroy",(function(){c.cancel(v)})),e.isLoading=function(){return e.status===i||e.status===t},e.confirmCalculateDependencies=function(){f.openSimpleModal({title:m.instant("confirm.operation"),message:m.instant("graphexplore.calculating.relationships"),warning:!0}).result.then((function(){e.calculateDependencies()}))},e.calculateDependencies=function(){e.status=t,e.selectedClasses=void 0,p.calculateRelationships(E.contextID.uri).success((function(t){0===t.indexOf("ERROR;")?u.error(m.instant("graphexplore.error.dependencies.calc",{error:e.status.substring("ERROR;".length)})):N()})).error((function(e){u.error(m.instant("graphexplore.error.could.not.force.count",{error:getError(e)}))}))},e.addClass=function(t){e.selectedClasses.push(t),T(e.selectedClasses)},e.removeClass=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t.name})),T(e.selectedClasses)},e.showClass=function(t){e.classToShow=t},e.isClassByNameShown=function(t){return void 0!==_.find(e.selectedClasses,{name:t})},e.addClassByName=function(t){e.selectedClasses.push(_.find(e.allClasses.items,{name:t})),T(e.selectedClasses)},e.removeClassByName=function(t){_.remove(e.selectedClasses,(function(e){return e.name===t})),T(e.selectedClasses)},e.removeAllClasses=function(){e.selectedClasses=[],T(e.selectedClasses)},e.isSystemRepository=function(){return"SYSTEM"===l.getActiveRepository()};const A=e.$on("repositoryIsSet",(function(){e.classQuery={},e.classQuery.query="",e.repositoryError=null,E=s,l.getActiveRepository()&&!l.isActiveRepoFedXType()?x():e.status=n}));window.addEventListener("beforeunload",(function e(){A(),window.removeEventListener("beforeunload",e)})),e.selectGraph=function(e){E=e,N(!0),h.set("dependencies-selectedGraph-"+l.getActiveRepository(),E)},e.getSelectedGraphValue=function(){return E.contextID.value},e.isAllGraphsSelected=function(){return"all.graphs.label"===e.getSelectedGraphValue()}}Object.defineProperty(e,"allGraphs",{get:()=>s}),angular.module("graphdb.framework.graphexplore.controllers.dependencies",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).controller("DependenciesChordCtrl",l).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]).filter("humanize",(function(){return a})),l.$inject=["$scope","$rootScope","$repositories","toastr","$timeout","GraphDataRestService","UiScrollService","ModalService","LocalStorageAdapter","RDF4JRepositoriesRestService","$translate"]}).call(this,n(11))},107:function(e,t,n){"use strict";n.r(t);n(7);var r=n(301),i=n(298),o=n.n(i),s=(n(10),n(77));function a(e,t,n,i,a,l,u,c,p,d,f,h,g,m,v,E,x,y,T,N,C,S,I){e.languageChanged=!1,e.propertiesObj={},e.propertiesQueryObj={},e.propertiesObj.items=[],e.propertiesNotFiltered=[],e.searchVisible=!1,e.nodeSelected=!1,e.queryResultsMode=!1,e.embedded=f.search().embedded,e.openedNodeInfoPanel=void 0,e.invalidLimit=!1,e.INVALID_LINKS_MSG=S.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=S.instant("sidepanel.invalid.limit.links.tooltip"),t.$on("$translateChangeSuccess",(function(){e.INVALID_LINKS_MSG=S.instant("sidepanel.invalid.limit.links.msg"),e.INVALID_LINKS_TOOLTIP=S.instant("sidepanel.invalid.limit.links.tooltip"),e.propertiesSearchPlaceholder=S.instant("visual.search.instance.placeholder")})),e.onopen=e.onclose=()=>angular.noop(),e.embedded&&(f.search().query||f.search().uri||f.search().config||f.search().saved)&&(e.noGoHome=!0);const L={};let A=0,b=0,R={},w=0;const O=d3.behavior.zoom().scaleExtent([.5,10]);let M;let P,D;function k(){return I.isActive()?e.defaultSettings:e.saveSettings}function F(e){m.openCopyToClipboardModal(e)}function G(){e.settings.languagesMap=_.map(e.settings.languages,(function(e){return{text:e}})),e.settings.preferredTypesMap=_.map(e.settings.preferredTypes,(function(e){return{text:e}})),e.settings.rejectedTypesMap=_.map(e.settings.rejectedTypes,(function(e){return{text:e}})),e.settings.preferredPredicatesMap=_.map(e.settings.preferredPredicates,(function(e){return{text:e}})),e.settings.rejectedPredicatesMap=_.map(e.settings.rejectedPredicates,(function(e){return{text:e}}))}t.key="",L.get=function(t,n,r){return g.initLazyList(t,n,r,A,e.propertiesObj.items)},t.$watch((function(){return t.key}),(function(){A=0,_.each(e.propertiesObj.items,(function(e){t.key>e&&A++})),b++})),L.revision=function(){return b},e.datasource=L,e.adapterContainer={adapter:{remain:!0}},e.propertiesQueryObj.query="",e.propertiesSearchPlaceholder=S.instant("visual.search.instance.placeholder"),e.propertiesFilterFunc=function(t){return t.key.toLowerCase().indexOf(e.propertiesQueryObj.query.toLowerCase())>=0},e.resetState=function(){e.searchVisible=!1,e.nodeSelected=!1,e.configLoaded=null,e.queryResultsMode=!1,e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=!1,e.numberOfPinnedNodes=0,R={},w=0},e.pushHistory=function(t,n){e.embedded&&(t.embedded=!0),f.search(t),f.state(n)},e.goToHome=function(){e.resetState(),f.url("graphs-visualizations")},e.shouldShowSettings=function(){return e.configLoaded&&e.configLoaded.id===e.defaultGraphConfig.id},e.shouldDisableSameAs=function(){const t=$("#sameAsCheck");return e.settings&&!e.settings.includeInferred&&t.prop("checked")&&(t.prop("checked",!1),e.settings.sameAsState=!1),e.settings&&!e.settings.includeInferred},e.$watch("propertiesObj.items",(function(){angular.isDefined(e.propertiesObj.items)&&e.propertiesObj.items.length>0&&l((function(){e.adapterContainer.adapter.reload()}),500)})),e.toggleMoreInfo=function(e){angular.element(e.currentTarget).parent().next().toggle(200),angular.element(e.currentTarget).children("span").toggleClass("icon-caret-down").toggleClass("icon-caret-up")},e.copyToClipboard=F,e.defaultSettings={linksLimit:20,includeInferred:!0,sameAsState:!0,languages:["en"],showLinksText:!0,preferredTypes:[],rejectedTypes:[],preferredPredicates:[],rejectedPredicates:["http://dbpedia.org/property/logo","http://dbpedia.org/property/hasPhotoCollection","http://dbpedia.org/property/website","http://dbpedia.org/property/homepage","http://dbpedia.org/ontology/thumbnail","http://xmlns.com/foaf/0.1/depiction","http://xmlns.com/foaf/0.1/homepage","http://xmlns.com/foaf/0.1/mbox","http://dbpedia.org/ontology/wikiPage*","http://dbpedia.org/property/wikiPage*","http://factforge.net/*"],preferredTypesOnly:!1,preferredPredicatesOnly:!1,includeSchema:!0},e.saveSettings=angular.copy(e.defaultSettings),d.when(h.getPrincipal()).then(t=>function(t){const n=t.appSettings;e.defaultSettings.includeInferred=n.DEFAULT_INFERENCE,e.defaultSettings.sameAsState=n.DEFAULT_INFERENCE&&n.DEFAULT_SAMEAS,e.defaultSettings.includeSchema=n.DEFAULT_VIS_GRAPH_SCHEMA;const r=x.get(y.GRAPHS_VIZ);if(r&&"object"==typeof r)try{e.saveSettings=r,void 0===e.saveSettings.includeSchema&&(e.saveSettings.includeSchema=e.defaultSettings.includeSchema,e.saveSettings.rejectedPredicates=[...e.saveSettings.rejectedPredicates,...e.defaultSettings.rejectedPredicates].unique())}catch(t){e.saveSettings=angular.copy(e.defaultSettings),x.set(y.GRAPHS_VIZ,e.saveSettings)}else e.saveSettings=angular.copy(e.defaultSettings)}(t)),e.resetSettings=function(){e.settings=angular.copy(e.defaultSettings),e.validateLinksLimit(),G()},e.changeLimit=function(t){let n=e.settings.linksLimit+t;n<1&&(n=1),n>1e3&&(n=1e3),e.settings.linksLimit=n},e.validateLinksLimit=function(){e.invalidLimit=!s.NUMBER_PATTERN.test(e.settings.linksLimit)},e.showSettings=function(){e.showInfoPanel=!0,e.showFilter=!0,e.showNodeInfo=!1,e.showPredicates=!1,e.saveSettings?e.settings=angular.copy(e.saveSettings):e.settings=angular.copy(e.defaultSettings),G()},e.reExpandNode=function(){e.rootNodeIri&&e.$broadcast("onRootNodeChange",e.rootNodeIri)};const U=function(t,n,r){const i=k(),o=void 0===n?i.sameAsState:!0===n,s=void 0===r?i.includeInferred:!0===r;e.loading=!0,u({url:"rest/explore-graph/graph",method:"POST",headers:{"Content-Type":"application/json"},data:{query:t,linksLimit:i.linksLimit,languages:e.shouldShowSettings()?i.languages:[],includeInferred:s,sameAsState:o}}).then((function(e){de(e)}),(function(t){e.loading=!1,a.error(getError(t.data),S.instant("graphexplore.error.cannot.load.graph"))}))};function B(e){return e.replace(/[()']/g,"")}function j(e,t){let n=e.split(" ");return t?[n[0],n[1],n[2]].join(">"):[n[0],n[2]].join(">")}function V(e){return[e.source.iri,e.target.iri].join(">")}function H(e){if(e.isTriple){let t=document.getElementById(B(j(e.iri)));if(t&&void 0!==t.__data__.x)return t.__data__.x}return e.x}function q(e){if(e.isTriple){let t=document.getElementById(B(j(e.iri)));if(t&&void 0!==t.__data__.y)return t.__data__.y}return e.y}function z(e){let t=e.trim().split(" ");return`<<<${t[0]}> <${t[1]}> <${t[2]}>>>`}function W(e){return B(`${e.source.isTriple?j(e.source.iri,!0):e.source.iri}>${e.target.isTriple?j(e.target.iri,!0):e.target.iri}>marker`)}function Q(){this.nodes=[],this.links=[],this.tripleNodes=new Map,this.tripleLinksCopy=new Map,this.addNode=function(e,t,n){return e.x=t,e.y=n,this.nodes.push(e),e},this.computeConnectedness=function(){const e={},t={};_.each(this.links,(function(n){const r=n.source.iri,i=n.target.iri,o=_.min([r,i])+"|"+_.max([r,i]);t[o]||(t[o]=1,e[r]=(e[r]||0)+1,e[i]=(e[i]||0)+1)})),_.each(this.links,(function(t){e[t.source.iri]>1&&e[t.target.iri]>1?t.connectedness=Math.min(5,Math.max(e[t.source.iri],e[t.target.iri])-1):t.connectedness=0}))},this.addAndMatchLinks=function(e){const t=this.nodes;Array.prototype.push.apply(this.links,function(e,t){return _.map(e,(function(e){let n,r;n=e.isTripleSource?ye(e.source):_.find(t,(function(t){return t.iri===e.source})),r=e.isTripleTarget?ye(e.target):_.find(t,(function(t){return t.iri===e.target}));let i={source:n,target:r,predicates:e.predicates};if(e.isTripleSource||e.isTripleTarget){let e=`${i.source.isTriple?j(i.source.iri):i.source.iri}>${i.target.isTriple?j(i.target.iri):i.target.iri}`;if(Y.tripleLinksCopy.has(e)){let t=Y.tripleLinksCopy.get(e);return t[0].predicates.push(...i.predicates),t.push(i),Y.tripleLinksCopy.set(e,t),null}Y.tripleLinksCopy.set(e,[i])}return i}))}(e,t));for(let e of Y.tripleLinksCopy.keys())1===Y.tripleLinksCopy.get(e).length&&Y.tripleLinksCopy.delete(e);this.links=this.links.filter(e=>null!==e),this.computeConnectedness()};const t=function(e,t){return n(e,t).length};function n(e,t){return _.filter(t,(function(t){return t.source.iri===e.iri||t.target.iri===e.iri}))}this.countLinks=t,this.linksTypes=function(e,t){const r=n(e,t),i=_.map(r,(function(t){return t.source.iri===e.iri?t.target.types:t.source.types}));return _.uniq(_.flatten(i))},this.linksPredicates=function(e,t){const r=n(e,t),i=_.map(r,(function(e){return e.predicates}));return _.uniq(_.flatten(i))},this.removeTriples=function(e){let t=[];this.tripleNodes.size>0&&e.forEach(e=>{this.tripleNodes.has(e)&&(this.tripleNodes.delete(e),this.links=_.reject(this.links,(function(n){let r=e.split(">"),i=j(n.source.iri),o=j(n.target.iri);if(i===e&&Y.tripleNodes.delete(o)){let e=o.split(">");t.push({source:e[0],target:e[1]})}let s=i===e||o===e||n.source.iri===r[0]&&n.target.iri===r[1];return s&&(Y.tripleLinksCopy.delete(`${i}>${o}`),Y.tripleLinksCopy.delete(`${o}>${i}`)),s})))}),t.forEach(e=>{this.links=_.reject(this.links,(function(t){return t.source.iri===e.source&&t.target.iri===e.target}))})},this.removeNode=function(n){let r=[];this.links=_.reject(this.links,(function(e){let t=e.source.iri===n.iri||e.target.iri===n.iri;return t&&(e.target.isTriple&&r.push(j(e.target.iri)),e.source.isTriple||e.target.isTriple||r.push([e.source.iri,e.target.iri].join(">"))),t})),this.removeTriples(r);const i=this.links;this.nodes=_.reject(this.nodes,(function(e){return 0===t(e,i)})),0===this.nodes.length&&(e.nodeSelected=!1),this.computeConnectedness()},this.removeNodeLeafLinks=function(e){let r=[],i=this.links;this.links=_.reject(this.links,(function(o){let s=o.source.iri===e.iri&&1===t(o.target,i)&&!o.target.isTriple||o.target.iri===e.iri&&1===t(o.source,i)&&!o.source.isTriple;if(!s){let r;if(o.source.iri!==e.iri||2!==t(o.target,i)||o.target.isTriple?o.target.iri!==e.iri||2!==t(o.source,i)||o.source.isTriple||(r=n(o.source,i)):r=n(o.target,i),!r)return!1;s=(r[0].source.iri===e.iri||r[0].target.iri)&&(r[1].source.iri===e.iri||r[1].target.iri)}return s&&(o.target.isTriple&&r.push(j(o.target.iri)),o.source.isTriple||o.target.isTriple||r.push([o.source.iri,o.target.iri].join(">"))),s})),this.removeTriples(r),i=this.links,this.nodes=_.reject(this.nodes,(function(n){return 0===t(n,i)&&n.iri!==e.iri})),this.computeConnectedness()},this.addTriple=function(e,t,n){e.x=t,e.y=n,e.weight=0;let r=j(e.iri);if(this.tripleNodes.has(r)){let t=this.tripleNodes.get(r);t.push(e),this.tripleNodes.set(r,t)}else e.weight=10,this.tripleNodes.set(r,[e])},this.copyState=function(){const e=_.map(this.nodes,(function(e){return{iri:e.iri,isTriple:e.isTriple,size:e.size,labels:angular.copy(e.labels),types:angular.copy(e.types),rdfRank:e.rdfRank,x:e.x,y:e.y,fixed:e.fixed}})),t=JSON.stringify(Array.from(this.tripleNodes.entries())),n=JSON.stringify(Array.from(this.tripleLinksCopy.entries()));return{nodes:e,links:_.map(this.links,(function(e){return{source:e.source.iri,isTripleSource:e.source.isTriple,target:e.target.iri,isTripleTarget:e.target.isTriple,predicates:e.predicates}})),tripleNodes:t,tripleLinksCopy:n,colorIndex:w,type2color:R,scale:O.scale(),translate:O.translate()}},this.restoreState=function(t){e.nodeSelected=!0,e.searchVisible=!1,this.nodes=angular.copy(t.nodes),this.tripleNodes=t.tripleNodes?new Map(JSON.parse(t.tripleNodes)):new Map,this.links=[],this.addAndMatchLinks(t.links),this.tripleLinksCopy=t.tripleLinksCopy?new Map(JSON.parse(t.tripleLinksCopy)):new Map,_.each(this.nodes,(function(t){t.fixed&&e.numberOfPinnedNodes++})),angular.isDefined(t.colorIndex)&&angular.isDefined(t.type2color)&&(w=t.colorIndex,R=angular.copy(t.type2color)),angular.isDefined(t.translate)&&angular.isDefined(t.scale)&&(M="translate("+t.translate[0]+", "+t.translate[1]+") scale("+t.scale+")",O.translate(t.translate),O.scale(t.scale)),ae()}}e.updateSettings=function(){e.invalidLimit?a.error(e.INVALID_LINKS_TOOLTIP,e.INVALID_LINKS_MSG):(e.saveSettings=e.settings,e.saveSettings.languages=_.map(e.saveSettings.languagesMap,(function(e){return e.text})),e.saveSettings.preferredTypes=_.map(e.saveSettings.preferredTypesMap,(function(e){return e.text})),e.saveSettings.rejectedTypes=_.map(e.saveSettings.rejectedTypesMap,(function(e){return e.text})),e.saveSettings.preferredPredicates=_.map(e.saveSettings.preferredPredicatesMap,(function(e){return e.text})),e.saveSettings.rejectedPredicates=_.map(e.saveSettings.rejectedPredicatesMap,(function(e){return e.text})),e.rootNodeIri?e.reExpandNode(e.rootNodeIri):e.queryResultsMode&&f.search().query?U(f.search().query,f.search().sameAs,f.search().inference):"query"===e.configLoaded.startMode&&e.loadGraphConfig(e.configLoaded),k().showLinksText?d3.selectAll("svg .link-wrapper text").style("display","block"):d3.selectAll("svg .link-wrapper text").style("display","none"),e.showInfoPanel=!1,e.showFilter=!1,x.set(y.GRAPHS_VIZ,e.saveSettings))},e.showInfoPanel=!1;let Y=new Q;e.defaultGraphConfig={id:"default",name:"Easy graph",startMode:"search"},e.getGraphConfigs=function(t){N.getGraphConfigs().success((function(n){e.graphConfigs=n,t&&t()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.graph.configs.short.msg"))}))},e.loadConfigForId=function(t,n){t===e.defaultGraphConfig.id?e.loadGraphConfig(e.defaultGraphConfig):N.getConfig(t).success((function(t){e.loadGraphConfig(t),n()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.could.not.load.config",{configId:t}))}))},e.findConfigById=function(t){return t===e.defaultGraphConfig.id?e.defaultGraphConfig:$.grep(e.graphConfigs,(function(e){return e.id===t}))[0]},e.easyGraphSearch=function(t){e.configLoaded=e.defaultGraphConfig,e.openUri(t)},e.loadGraphConfig=function(t){e.configLoaded=t,"search"===t.startMode?e.searchVisible=!0:"node"===t.startMode&&t.startIRI?l((function(){e.openUri(t.startIRI,!0)}),0):"query"===t.startMode&&t.startGraphQuery&&(e.loading=!0,N.loadGraphForConfig(t,t.startQueryIncludeInferred,k().linksLimit,t.startQuerySameAs).then((function(e){de(e)}),(function(t){e.loading=!1,a.error(getError(t),S.instant("graphexplore.error.graph.load"))})))},e.deleteConfig=function(t){m.openSimpleModal({title:S.instant("common.confirm"),message:S.instant("graphexplore.delete.graph",{configName:t.name}),warning:!0}).result.then((function(){N.deleteGraphConfig(t).success((function(){e.getGraphConfigs(),e.refreshSavedGraphs()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.cannot.delete.config"))}))}))},e.goToGraphConfig=function(t){e.pushHistory({config:t.id},{config:t}),e.resetState(),e.loadGraphConfig(t)},E.onpopstate=function(t){e.resetState(),t.state&&(t.state.config?(e.loadGraphConfig(t.state.config),t.state.uri&&e.openUri(t.state.uri,!0)):t.state.savedGraph&&e.loadSavedGraph(t.state.savedGraph,!0))};const X=function(){f.search().query?(e.searchVisible=!1,e.queryResultsMode=!0,U(f.search().query,f.search().sameAs,f.search().inference)):e.$on("onRootNodeChange",(function(t,n){e.loading=!0;const r=k();angular.isDefined(n)&&(e.rootNodeIri=n,u({url:"rest/explore-graph/node",method:"GET",params:{iri:n,config:e.configLoaded?e.configLoaded.id:e.defaultGraphConfig.id,languages:e.shouldShowSettings()?r.languages:[],includeInferred:r.includeInferred,sameAsState:r.sameAsState}}).then((function(t){e.nodeSelected=!0,e.searchVisible=!1,null===t.data.types&&(t.data.types="greyColor"),Y=new Q;const n=Y.addNode(t.data,500,500);M="translate(0, -70) scale(1)",O.translate([0,-70]),O.scale(1),he(n,!0)})).catch((function(t){e.loading=!1,a.error(getError(t),S.instant("graphexplore.error.could.not.load.graph"))})))})),f.search().uri&&e.openUri(f.search().uri,!0),f.search().saved&&T.getSavedGraph(f.search().saved).success((function(t){e.loadSavedGraph(t)})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.could.not.open"))}))},K=function(){f.search().config?e.loadConfigForId(f.search().config,X):f.search().query||f.search().uri?(e.loadGraphConfig(e.defaultGraphConfig),X()):X()};function Z(t){!n.getActiveRepository()||e.hasInitedRepository&&!t||(e.hasInitedRepository=!0,t||e.getGraphConfigs(K),e.getNamespacesPromise=C.getNamespaces(e.getActiveRepository()).success((function(t){const n=_.map(t.results.bindings,(function(e){return{uri:e.namespace.value,prefix:e.prefix.value}}));e.namespaces=_.sortBy(n,(function(e){return e.uri.length})),J()})).error((function(e){a.error(getError(e),S.instant("graphexplore.error.view.will.not.work"))})))}function J(){i.isLicenseValid()&&(e.getAutocompletePromise=p.checkAutocompleteStatus())}e.replaceIRIWithPrefix=function(t){const n=e.namespaces,r=_.findLast(n,(function(e){return 0===t.indexOf(e.uri)}));return r?r.prefix+":"+t.substring(r.uri.length):t},e.addedTag=function(t){return t.text.indexOf(":")<0?(a.warning(S.instant("graphexplore.absolute.prefixed.iri")),null):(t.text=function(e,t){if(!/^<?(http|urn).*>?/.test(e)){const n=e.split(":"),r=n[0],i=n[1];if(!angular.isUndefined(i)){const e=c.getNamespaceUriForPrefix(t,r);if(e)return e+i}}return e}(t.text,e.namespaces),e.pageslideExpanded=!0,t)},e.validateTag=function(e,t,n){if(e.text.indexOf(":")<0)return n?a.warning(S.instant("graphexplore.absolute.prefixed.iri.option"),t):a.warning(S.instant("graphexplore.absolute.prefixed.iri"),t),!1;const r=e.text.indexOf("*");if(r>=0){if(!n)return a.warning(S.instant("graphexplore.wildcards.not.allowed"),t),!1;if(r<e.text.length-1)return a.warning(S.instant("graphexplore.wildcards.last.char"),t),!1}return!0},e.getTagClass=function(e){return e.endsWith("*")?"tag-item-wildcard":null},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLicenseValid=function(){return i.isLicenseValid()},e.hasInitedRepository=!1,e.$on("autocompleteStatus",(function(){J()})),e.$on("repositoryIsSet",(function(t,n){n.newRepo&&(e.hasInitedRepository=!1),Z(n.newRepo),n.newRepo&&(e.resetState(),$(".graph-visualization svg").empty(),f.search().query&&(e.goToHome(),X()))})),Z();const ee=d3.scale.linear().domain([0,9]).range(["hsl(0, 100%, 75%)","hsl(360, 90%, 82%)"]).interpolate(d3.interpolateHslLong),te=d3.scale.linear().domain([0,9]).range(["hsl(180, 50%, 75%)","hsl(540, 40%, 82%)"]).interpolate(d3.interpolateHslLong);e.getColor=function(e){angular.isUndefined(R[e])&&(R[e]=w,w++);const t=R[e];return t>39?"#c2c2c2":t%2==0?ee(t/2):te(t/2)};const ne=d3.layout.force().gravity(.07).size([1e3,1e3]),re=d3.select(".main-container .graph-visualization").append("svg").attr("viewBox","0 0 1000 1000").attr("preserveAspectRatio","xMidYMid meet");let ie=0,oe=0;const se=new function(){this.state=!1,this.setLoadingState=function(e){this.state=e},this.getLoadingState=function(){return this.state},this.init=function(e,t){d3.select(t).append("circle").attr("cx",(function(){return e.x})).attr("cy",(function(){return e.y})).attr("class","loader-container").attr("r",(function(){return e.size})).style("fill","fff").style("opacity","0.7"),d3.select(t).append("image").attr("xlink:href","js/angular/templates/loader/ot-loader.svg?v=2.4.2-RC2").attr("x",(function(){return e.x-e.size+5})).attr("y",(function(){return e.y-e.size})).attr("width",(function(){return 2*e.size})).attr("height",(function(){return 2*e.size})).attr("class","node-loader")}};function ae(t){d3.selectAll("svg g").remove(),d3.selectAll("svg rect").remove(),d3.selectAll(".d3-tip").remove(),d3.selectAll(".menu-events").remove(),O.on("zoom",(function(){if(I.isActive())return;M="translate("+d3.event.translate+") scale("+d3.event.scale+")",n.attr("transform",M)})),re.append("rect").attr("width",1e4).attr("height",1e4).attr("x",-4500).attr("y",-4500).style("fill","none").style("pointer-events","all").call(O).on("click",(function(){d3.event.stopPropagation(),ge(),ne.stop()}));const n=re.append("g").attr("class","nodes-container").attr("transform",(function(){return angular.isDefined(M)&&!t?M:""})),i=o()().attr("class","d3-tip").customPosition((function(){const e=P.getBoundingClientRect();return{top:e.bottom+10+"px",left:e.left-30+"px"}})).html((function(t){let n="";return t.fixed&&(n+='<i class="icon-pin"></i>&nbsp;&nbsp;'),t.types.length>0?n+=_.join(_.map(t.types,(function(t){return e.replaceIRIWithPrefix(t)}))," · "):n+="<i>No types</i>",n})),s=function(e){let t="";return t+=_.join(_.map(e.predicates,(function(t,n){if(0===n)return Ne(t);if(n<10)return" · "+Ne(t);if(10===n){const t=function(e){return e.predicates.length-10}(e),n=t>1?t+" predicates":t+" predicate";return" · "+S.instant("graphexplore.tip.text",{textToShow:n})}})),""),t};let u;const c=o()().attr("class","d3-tip").customPosition((function(e){const t=u.getBoundingClientRect(),n=function(e){const t=s(e),n=document.createElement("canvas").getContext("2d");return n.font="13px Arial",e.predicates.length<10?n.measureText(t).width:n.measureText(t).width/2}(e);return{top:t.top-30+"px",left:t.left-30+"px",width:n+"px"}})).html((function(e){return s(e)}));const p=function(){l.cancel(void 0),l.cancel(ie),P=null,i.hide(),oe=l((function(){ge()}),500)};re.call(i);re.call(c);let d=re.selectAll(".link"),f=re.selectAll(".node");ne.nodes(Y.nodes).charge(-3e3),ne.links(Y.links).linkDistance((function(e){return e.source.isTriple||e.target.isTriple?0:function(e){const t=$("<span></span>"),n=e.predicates[0].split("/"),r=n[n.length-1];t.addClass("predicate-text").text(r),$("body").append(t);const i=t.width()+2*e.source.size+2*e.target.size+50;return t.remove(),.75*i}(e)+30*e.connectedness})),n.append("defs").selectAll("marker").data(ne.links()).enter().append("marker").attr("class","arrow-marker").attr("id",(function(e){return W(e)})).attr("viewBox","0 -5 10 10").attr("refX",(function(e){return e.target.isTriple?11:e.target.size+11})).attr("refY",0).attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5 L10,0 L0, -5"),d=n.selectAll(".link").data(Y.links).enter().append("g").attr("class","link-wrapper").attr("id",(function(e){return B(V(e))})).append("line").attr("class","link").style("stroke-width",1).style("fill","transparent").style("marker-end",(function(e){return`url(#${W(e)})`}));const h=n.selectAll(".link-wrapper").append("text").text((function(e){return Te(e)})).attr("class",(function(e){return e.predicates.length>1||Y.tripleNodes.has(V(e))?"predicates":"predicate"})).attr("dy","-0.5em").style("text-anchor","middle").style("display",k().showLinksText?"":"none").on("mouseover",(function(e){d3.event.stopPropagation(),function(e){l.cancel(void 0);const t=u=d3.event.target;l((function(){u===t&&e.predicates.length>1&&c.show(e,u)}),300)}(e)})).on("mouseout",(function(){l.cancel(void 0),u=null,c.hide()})).on("click",(function(t){d3.event.stopPropagation(),function(t){xe();let n=V(t);if(1===t.predicates.length&&Y.tripleNodes.has(n)){D=null;let e=Y.tripleNodes.get(n)[0];if(ce(e,this,d3.event.button)){let t={};t.iri=e.iri,t.pred=Ne(e.iri.split(" ")[1]),ve(t)}return}!function(t){if(e.showNodeInfo=!1,e.showPredicates=t.predicates.length>1,e.showFilter=!1,e.showInfoPanel=!1,D===t)return e.showNodeInfo=!1,e.showInfoPanel=!1,void(D=null);D=t,e.showPredicates&&(e.predicates=_.map(t.predicates,(function(e){let n=function(e,t){let n=V(t);return Y.tripleNodes.has(n)?Y.tripleNodes.get(n).findIndex(t=>t.iri.indexOf(e)>=0):-1}(e,t),r=n>-1;return{value:Ne(e),partOfTriple:r,linkId:r?V(t):"",nodeIndex:n}})),e.showInfoPanel=!0)}(t)}(t)}));let g,m=0,v=0,E=0;const x=function(){d3.event.button&&0!==d3.event.button||(p(),l.cancel(g),e.showPredicates=!1,d3.event.timeStamp-m<500?v++:v=1,m=d3.event.timeStamp,d3.event.preventDefault())},y=function(t,n,r){Y.countLinks(t,Y.links)<=k().linksLimit?he(t,!1,r||this.parentNode):a.info(S.instant("graphexplore.increase.limit"),S.instant("graphexplore.node.at.max")),e.closeInfoPanel()},T=function(e){if(d3.event.button&&0!==d3.event.button)return;l.cancel(g);const t=d3.event,n=this;I.isActive()||d3.event.timeStamp-m<500&&(1===v?g=l((function(){ce(e,n,t)}),540-(d3.event.timeStamp-m)):2===v&&y(e,0,n.parentNode)),d3.event.preventDefault()};function N(e,t){let r,i,o,s,a=!0;if("down"===t)r=2*e.size,i=e.size/3,o=.8,s=.3;else if("down-fixed"===t)r=2*e.size,i=e.size,o=.8,s=.66;else if("up"===t)r=e.size/3,i=2*e.size,o=.3,s=.8;else{if("fixed"!==t)return;r=e.size,o=.66,a=!1}let l=n.selectAll(".node-wrapper").filter((function(t){return t===e})).append("text").text("").classed("icon-any pinned",!0).style("font-size",r+"px").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).attr("opacity",o);"fixed"!==t&&"down-fixed"!==t||(e.pin=l),a&&(l=l.transition().duration(1e3).style("font-size",(function(){return i+"px"})).attr("opacity",s),"down-fixed"!==t&&l.remove())}const C=d3.behavior.drag().origin((function(e){return e})).on("dragstart",(function(e){if(I.isActive())return;0===d3.event.sourceEvent.button&&(e.fixedBeforeDrag=e.fixed,e.isBeingDragged=!0,e.beginDragging=!0,ge(),d3.event.sourceEvent.stopPropagation(),d3.select(this).classed("dragging",!0))})).on("drag",(function(t){t.isBeingDragged&&(v=0,t.px=d3.event.x,t.py=d3.event.y,t.fixed?t.beginDragging&&N(t,"fixed"):(e.numberOfPinnedNodes++,t.fixed=!0,N(t,"down-fixed")),t.pinWasFixed=!0,t.beginDragging=null,ne.resume())})).on("dragend",(function(e){e.isBeingDragged&&(e.pinWasFixed&&(e.pinWasFixed=null,d3.select(".pinned").remove()),e.isBeingDragged=!1,d3.select(this).classed("dragging",!1))}));f=n.selectAll(".node").data(Y.nodes).enter().append("g").attr("class","node-wrapper").attr("id",(function(e){return e.iri})).append("circle").attr("class","node").attr("r",(function(e){return e.size})).style("fill",(function(t){return"greyColor"===t.types?"c2c2c2":e.getColor(t.types[0])})).call(C).on("mouseover",(function(t){if(!t.isBeingDragged){const n=d3.event;l.cancel(oe),ie=l(()=>{(function(t,n){if(e.showInfoPanel)return!1;(ue.closeIcon||ue.expandIcon||ue.focusIcon||ue.copyURIIcon)&&ue.removeIcons();if(ne.alpha()<.02)return ue.initIcons(t,n.parentNode),ne.stop(),le(),!0;return!1})(t,this)&&function(e,t){l.cancel(void 0);const n=P=t.target;l((function(){P===n&&i.show(e,P)}),300)}(t,n)},400)}})).on("mouseout",p).on("mousedown",x).on("touchstart",(function(e){x(),E=0,g=l((function(){E<5&&pe(e),g=null,v=0}),1e3)})).on("touchmove",(function(){E++})).on("mouseup",T).on("touchend",T).on("contextmenu",(function(t){d3.event.shiftKey||(d3.event.preventDefault(),ge(),e.closeInfoPanel(),t.fixed?(e.numberOfPinnedNodes--,t.fixed=!1,N(t,"up"),ne.resume()):(e.numberOfPinnedNodes++,t.fixed=!0,N(t,"down")),function(e){P&&i.show(e,P)}(t))})).on("gdb-expand-node",y).on("gdb-show-node-info",me);const L=n.selectAll(".node-wrapper").append("foreignObject").style("pointer-events","none").attr("width",(function(e){return 2*e.size*1.75}));n.insert("g").attr("class","menu-events"),function(e){e.each((function(e){e.fontSize=r.a.Text.calcFontSizeRaw(e.labels[0].label,e.size,16,!0)})).attr("height",(function(e){return 3*e.fontSize})).append("xhtml:div").attr("class","node-label-body").style("font-size",(function(e){return e.fontSize+"px"})).append("xhtml:div").text((function(e){return e.labels[0].label})),l((function(){$(".node-label-body div").each((function(e,t){let n=t.textContent.substring(0,t.textContent.length-1);let r=0;for(;r<200&&(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)n=n.substring(0,n.length-1),t.textContent=n+"…",r++}))}),50)}(L),ne.on("tick",(function(){d3.geom.quadtree(Y.nodes);Y.nodes.length;d.attr("x1",(function(e){return H(e.source)})).attr("y1",(function(e){return q(e.source)})).attr("x2",(function(e){return H(e.target)})).attr("y2",(function(e){return q(e.target)})),h.attr("x",(function(e){let t=H(e.source),n=H(e.target);return e.x=.5*(t+n)})).attr("y",(function(e){let t=q(e.source),n=q(e.target);return e.y=.5*(t+n)})).attr("transform",(function(e){return"rotate("+function(e,t){const n={x:H(e.source),y:q(e.source)},r={x:H(e.target),y:q(e.target)};if(t)return 180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;{const e=180*Math.atan2(r.y-n.y,r.x-n.x)/Math.PI;return e<=90&&e>=-90?e:(e>0?-1:1)*(180-Math.abs(e))}}(e,e.direction)+", "+e.x+", "+e.y+")"})),f.attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),n.select(".node-loader").attr("x",(function(e){return e.x-e.size+3})).attr("y",(function(e){return e.y-e.size})),n.select(".loader-container").attr("cx",(function(e){return e.x})).attr("cy",(function(e){return e.y})),L.attr("x",(function(e){return e.x-1.75*e.size})).attr("y",(function(e){return e.y-3*e.fontSize/2})),d3.select(".pinned").attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})),le()})),angular.isDefined(se)&&se.setLoadingState(!1),e.loading&&(e.loading=!1),d3.selectAll(".link-wrapper").each((function(){const e=$(this).attr("id").split(">")[0],t=$(this).attr("id").split(">")[1];d3.selectAll(".link").each((function(n){let r=B(n.source.iri),i=B(n.target.iri);if(r===t&&i===e){let e=r;e+=">",e+=i;const t=document.createTextNode(" ⟶");document.getElementById(e).lastChild.appendChild(t),n.direction="double"}}))})),d3.selectAll(".d3-actions-tip").remove(),ne.start()}function le(){t.d3alpha=ne.alpha()}ae();const ue=new function(){function e(e,t){return"translate("+(t.x-14+(t.size+15)*Math.cos(e*Math.PI/180-Math.PI/2))+","+(t.y-14+(t.size+15)*Math.sin(e*Math.PI/180-Math.PI/2))+")"}this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.actionsTip=void 0,this.removeIcons=function(){this.closeIcon.remove("g"),this.expandIcon&&this.expandIcon.remove("g"),this.collapseIcon&&this.collapseIcon.remove("g"),this.focusIcon.remove("g"),this.copyURIIcon.remove("g"),this.closeIcon=void 0,this.expandIcon=void 0,this.collapseIcon=void 0,this.focusIcon=void 0,this.copyURIIcon=void 0,this.expandedState=!1},this.expandedState=!1,this.initIcons=function(n,r){const i=o()().attr("class","d3-tip d3-actions-tip").customPosition((function(){const e=d3.event.target.getBoundingClientRect();return{top:e.top-20+"px",left:e.right+10+"px"}})).html((function(e){return e}));re.call(i);n.isExpanded?(this.collapseIcon=d3.select(".menu-events").append("g").attr("class","collapse-icon").attr("name","collapse").attr("transform",(function(){return e(20,n)})),this.collapseIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.collapseIcon.append("path").attr("d","M22.67,12a.59.59,0,0,1-.53.65l-6.88.72H15.2a.59.59,0,0,1-.59-.65l.72-6.88A.58.58,0,0,1,16,5.33a.59.59,0,0,1,.53.65L16,11.11,21.3,5.79a.64.64,0,0,1,.91.91L16.89,12,22,11.49A.59.59,0,0,1,22.67,12ZM12.59,14.75l-6.75.85a.59.59,0,0,0-.51.66.58.58,0,0,0,.66.51l4.95-.62-5.2,5.2a.64.64,0,1,0,.91.91l5.2-5.2L11.23,22a.59.59,0,0,0,.51.66h.07a.59.59,0,0,0,.59-.52l.85-6.75a.59.59,0,0,0-.17-.49A.58.58,0,0,0,12.59,14.75Z").style("fill","var(--primary-color)"),this.collapseIcon.on("click",(function(){var e;(e=n).isExpanded=!1,Y.removeNodeLeafLinks(e),ae()})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(ie),l.cancel(oe)})).on("mouseout",(function(){i.hide(),oe=l((function(){ge()}),500)}))):(this.expandIcon=d3.select(".menu-events").append("g").attr("class","expand-icon").attr("name","expand").attr("transform",(function(){return e(20,n)})),this.expandIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.expandIcon.append("path").attr("d","M22.37,6.28l-.72,6.88a.59.59,0,0,1-.59.53H21a.59.59,0,0,1-.53-.65L21,7.9l-5.32,5.32a.64.64,0,0,1-.91-.91L20.1,7,15,7.53a.59.59,0,0,1-.12-1.18l6.88-.72a.59.59,0,0,1,.65.65ZM12.89,20.34,7.95,21l5.2-5.2a.64.64,0,0,0-.91-.91L7,20.05l.62-4.95A.59.59,0,0,0,6.48,15l-.85,6.75a.59.59,0,0,0,.59.67h.07L13,21.52a.59.59,0,1,0-.15-1.18Z").style("fill","var(--primary-color)"),this.expandIcon.on("click",(function(){he(n,!1,r)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(oe),l.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=l((function(){ge()}),500)}))),this.focusIcon=d3.select(".menu-events").append("g").attr("class","focus-icon").attr("name","focus").attr("transform",(function(){return e(20,n)})),this.focusIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.focusIcon.append("path").attr("d","M14.2,23.81a9.8,9.8,0,1,1,6.93-2.87h0A9.74,9.74,0,0,1,14.2,23.81Zm0-18.17a8.37,8.37,0,1,0,5.92,14.29h0A8.37,8.37,0,0,0,14.2,5.64Zm1.42,6.95a2,2,0,1,0,0,2.85A2,2,0,0,0,15.62,12.59Z").style("fill","var(--primary-color)"),this.focusIcon.on("click",(function(){t.$broadcast("onRootNodeChange",n.iri)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(oe),l.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=l((function(){ge()}),500)})),this.copyURIIcon=d3.select(".menu-events").append("g").attr("class","icon-link").attr("name","link").attr("transform",(function(){return e(20,n)})),this.copyURIIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.copyURIIcon.append("path").attr("d","M 13.457031 10.164062 C 13.648438 10.164062 13.820312 10.242188 13.941406 10.363281 L 15.492188 11.859375 C 15.984375 12.332031 16.292969 12.992188 16.292969 13.714844 C 16.292969 14.441406 15.984375 15.097656 15.492188 15.574219 L 10.394531 20.496094 C 9.902344 20.972656 9.222656 21.265625 8.472656 21.265625 C 7.71875 21.265625 7.039062 20.972656 6.546875 20.496094 L 4.996094 19 C 4.507812 18.523438 4.203125 17.867188 4.203125 17.144531 C 4.203125 16.421875 4.507812 15.765625 4.996094 15.289062 L 7.542969 12.824219 C 7.667969 12.707031 7.84375 12.628906 8.035156 12.628906 C 8.417969 12.628906 8.726562 12.929688 8.726562 13.300781 C 8.726562 13.484375 8.648438 13.652344 8.523438 13.773438 L 5.976562 16.234375 C 5.738281 16.46875 5.589844 16.792969 5.589844 17.148438 C 5.589844 17.503906 5.738281 17.824219 5.976562 18.058594 L 7.527344 19.566406 C 7.773438 19.792969 8.105469 19.929688 8.472656 19.929688 C 8.835938 19.929688 9.167969 19.792969 9.414062 19.566406 L 14.511719 14.644531 C 14.753906 14.410156 14.90625 14.089844 14.90625 13.730469 C 14.90625 13.375 14.753906 13.054688 14.511719 12.820312 L 12.964844 11.324219 C 12.839844 11.203125 12.761719 11.039062 12.761719 10.855469 C 12.761719 10.488281 13.070312 10.1875 13.449219 10.1875 Z M 17.082031 3.976562 C 17.082031 3.976562 17.085938 3.976562 17.085938 3.976562 C 17.824219 3.976562 18.492188 4.261719 18.980469 4.722656 L 20.535156 6.203125 C 21.042969 6.679688 21.355469 7.34375 21.355469 8.082031 C 21.355469 8.792969 21.058594 9.441406 20.582031 9.914062 L 18.0625 12.402344 C 17.9375 12.527344 17.761719 12.605469 17.566406 12.605469 C 17.183594 12.605469 16.875 12.304688 16.875 11.9375 C 16.875 11.753906 16.949219 11.589844 17.070312 11.46875 L 19.605469 8.984375 C 19.847656 8.75 19.996094 8.429688 19.996094 8.070312 C 19.996094 7.714844 19.847656 7.394531 19.605469 7.160156 L 18.019531 5.667969 C 17.773438 5.445312 17.4375 5.304688 17.070312 5.300781 C 16.703125 5.304688 16.367188 5.453125 16.128906 5.691406 L 11.085938 10.667969 C 10.84375 10.898438 10.695312 11.222656 10.695312 11.578125 C 10.695312 11.933594 10.84375 12.257812 11.085938 12.488281 L 12.675781 13.980469 C 12.804688 14.101562 12.882812 14.273438 12.882812 14.457031 C 12.882812 14.828125 12.574219 15.128906 12.191406 15.128906 C 12.003906 15.128906 11.832031 15.054688 11.707031 14.9375 L 10.140625 13.457031 C 9.636719 12.980469 9.324219 12.316406 9.324219 11.582031 C 9.324219 10.863281 9.621094 10.214844 10.101562 9.742188 L 15.140625 4.765625 C 15.625 4.285156 16.304688 3.980469 17.054688 3.976562 Z M 17.082031 3.976562").style("fill","var(--primary-color)"),this.copyURIIcon.on("click",(function(){F(n.iri),ge(),i.hide()})).on("mouseover",(function(){i.show("<div style='text-align: center;'><b>Copy to ClipBoard</b><br>"+n.iri+"</div>"),l.cancel(oe),l.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=l((function(){ge()}),500)})),this.closeIcon=d3.select(".menu-events").append("g").attr("class","close-icon").attr("name","remove").attr("transform",(function(){return e(20,n)})),this.closeIcon.append("circle").attr("cx",14).attr("cy",14).attr("r",13).style("fill","#eee"),this.closeIcon.append("path").attr("d","M14.94,14l5.87-5.87a.66.66,0,1,0-.94-.94L14,13.06,8.13,7.19a.66.66,0,0,0-.94.94L13.06,14,7.19,19.87a.66.66,0,1,0,.94.94L14,14.94l5.87,5.87a.66.66,0,1,0,.94-.94Z").style("fill","var(--primary-color)"),this.closeIcon.on("click",(function(){pe(n)})).on("mouseover",(function(){i.show(this.getAttribute("name")),l.cancel(oe),l.cancel(ie)})).on("mouseout",(function(){i.hide(),oe=l((function(){ge()}),500)})),this.animateMenu(n)},this.animateMenu=function(t){let n=0;let r=20;this.expandIcon&&this.expandIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.collapseIcon&&this.collapseIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return e(r,t)})).delay(n+=35),this.copyURIIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.focusIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.closeIcon.transition().duration(100).style("opacity",1).ease("sin").attr("transform",(function(){return r+=30,e(r,t)})).delay(n+=35),this.expandedState=!0}};function ce(n,r,i){return e.showInfoPanel=!1,e.showPredicates=!1,e.showNodeInfo=!1,i.shiftKey&&(i.ctrlKey||i.metaKey)?(t.$broadcast("onRootNodeChange",n.iri),!1):i.ctrlKey||i.metaKey?(pe(n),!1):void 0!==e.openedNodeInfoPanel&&e.openedNodeInfoPanel===n?(e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,!1):(me(n),!0)}function pe(e){Y.removeNode(e),ae()}function de(t){!function(t){e.nodeSelected=!0,null===t.data.types&&(t.data.types="greyColor"),Y=new Q,M="translate(0, -70) scale(1)",O.translate([0,-70]),O.scale(1)}(t),fe(t)}function fe(t,n,r){let i=t.data;i=_.filter(i,(function(e){return-1===_.findIndex(Y.links,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))}));let o=[];const s=Y.tripleLinksCopy.values();for(let e=0;e<Y.tripleLinksCopy.size;e++){s.next().value.forEach(e=>{o.push(e)})}i=_.filter(i,(function(e){return-1===_.findIndex(o,(function(t){return e.source===t.source.iri&&e.target===t.target.iri}))})),i=_.filter(i,(function(e){return e.source!==e.target}));const l=function(e,t){let n=t.map((function(t){return t[e]}));return t.filter((function(t,r){return n.indexOf(t[e])===r}))}("iri",_.union(_.flatten(_.map(t.data,(function(e){return[{iri:e.source,isTriple:e.isTripleSource},{iri:e.target,isTriple:e.isTripleTarget}]}))))),c=_.map(Y.nodes,(function(e){return{iri:e.iri,isTriple:Boolean(e.isTriple)}})),p=Y.tripleNodes.values();for(let e=0;e<Y.tripleNodes.size;e++){p.next().value.forEach(e=>{c.push({iri:e.iri,isTriple:e.isTriple})})}const f=_.reject(l,(function(e){return _.some(c,e)}));if(0===f.length)(r||0===i.length)&&a.info(S.instant("graphexplore.error.node.connections")),Y.addAndMatchLinks(i),ae();else{const t=[],r=[],o=k();_.forEach(f,(function(n,i){t.push(u({url:"rest/explore-graph/node",method:"GET",params:{iri:n.isTriple?z(n.iri):n.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?o.languages:[],includeInferred:o.includeInferred,sameAsState:o.sameAsState}}).then((function(e){r[i]=e.data})))})),d.all(t).then((function(){_.forEach(r,(function(e,t){const i=2*Math.PI*t/r.length,o=(n?n.x:0)+1e3*Math.cos(i)/3,s=(n?n.y:0)+1e3*Math.sin(i)/3;e.isTriple?Y.addTriple(e,o,s):Y.addNode(e,o,s)})),Y.addAndMatchLinks(i),n&&(n.isExpanded=!0),ae()}))}}function he(t,n,r){if(se.getLoadingState())return;se.init(t,r);const i=k(),o=t.iri;u({url:"rest/explore-graph/links",method:"GET",params:{iri:o,linksLimit:i.linksLimit,includeInferred:i.includeInferred,config:e.configLoaded.id,preferredTypes:e.shouldShowSettings()?i.preferredTypes:[],rejectedTypes:e.shouldShowSettings()?i.rejectedTypes:[],preferredPredicates:e.shouldShowSettings()?i.preferredPredicates:[],rejectedPredicates:e.shouldShowSettings()?i.rejectedPredicates:[],preferredTypesOnly:e.shouldShowSettings()?i.preferredTypesOnly:[],preferredPredicatesOnly:e.shouldShowSettings()?i.preferredPredicatesOnly:[],languages:e.shouldShowSettings()?i.languages:[],sameAsState:i.sameAsState,includeSchema:i.includeSchema}}).then((function(e){fe(e,t,n)}),(function(t){const n=getError(t.data);a.error(n,S.instant("graphexplore.error.exploring.node")),e.loading=!1,se.setLoadingState(!1)}))}function ge(){angular.isDefined(ue)&&ue.expandedState&&ue.removeIcons()}function me(t){ne.stop(),e.openedNodeInfoPanel=t,e.showNodeInfo=!0,e.showFilter=!1,e.showPredicates=!1,e.nodeLabels=t.labels,e.nodeTypes=t.types,e.rdfRank=t.rdfRank,e.nodeIri=t.iri,e.resourceType=t.isTriple?"triple":"uri",e.encodedIri=t.isTriple?encodeURIComponent(z(t.iri)):encodeURIComponent(t.iri),e.showInfoPanel=!0,e.rdfsLabel=t.labels[0].label,e.rdfsComment=t.comment,e.expanded=!1,e.propertiesQueryObj.query="",e.dataNodeKeysQuery="";const n=k();u.get("rest/explore-graph/properties",{params:{iri:t.isTriple?z(t.iri):t.iri,config:e.configLoaded.id,languages:e.shouldShowSettings()?n.languages:[],includeInferred:n.includeInferred,sameAsState:n.sameAsState,rejectedPredicates:e.shouldShowSettings()?n.rejectedPredicates:[]}}).then((function(t){e.data=_.mapKeys(t.data,(function(t,n){return e.replaceIRIWithPrefix(n)})),e.propertiesObj.items=[],_.forEach(e.data,(function(t,n){e.propertiesObj.items.push({key:n,value:t})})),e.nodeImage=void 0,e.propertiesNotFiltered=e.propertiesObj.items;const n=_.find(e.propertiesObj.items,(function(e){return"image"===e.key}));n&&(e.nodeImage=n.value[0].v),e.propertiesObj.items=_.reject(e.propertiesObj.items,(function(e){return"image"===e.key})),e.propertiesNotFiltered=e.propertiesObj.items}),(function(e){a.warning(getError(e.data),"Error")}))}function ve(e){Ee("predicate","var(--primary-color-dark)",e),Ee("predicates","var(--primary-color-dark)",e);let t=document.getElementsByClassName("link");t&&_.each(t,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.style.strokeWidth=4)}));let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(t){let n=t.__data__;(n.source.iri.indexOf(e.iri)>=0||n.target.iri.indexOf(e.iri)>=0)&&(t.style.stroke="var(--primary-color-dark)",t.__data__.target.isTriple||t.setAttribute("refX","23"))}))}function Ee(e,t,n){let r=document.getElementsByClassName(e);r&&_.each(r,(function(e){let r=e.__data__;n?((r.source.iri.indexOf(n.iri)>=0||r.target.iri.indexOf(n.iri)>=0)&&(e.style.fill=t),j(n.iri)===V(r)&&(e.textContent=n.pred,e.style.fill=t),n.oppLinkIRI&&n.oppLinkIRI===V(r)&&(e.textContent=n.oppTriplePred,e.style.fill=t)):(e.style.fill=t,e.textContent=Te(r))}))}function xe(){_.each(e.predicates,(function(e){let t=document.getElementById(e.linkId+e.nodeIndex);t&&(t.style.fontWeight="normal")}));let t=document.getElementsByClassName("link");t&&_.each(t,(function(e){e.style.stroke="#999",e.style.strokeWidth=1})),Ee("predicate",""),Ee("predicates","");let n=document.getElementsByClassName("arrow-marker");n&&_.each(n,(function(e){e.style.stroke="#999",e.__data__.target.isTriple||e.setAttribute("refX","59")}))}function ye(e){let t=j(e);if(Y.tripleNodes.has(t))return Y.tripleNodes.get(t).find(t=>t.iri===e)}function Te(e){return e.predicates.length>1?e.predicates.length+" predicates":Ne(e.predicates[0])}function Ne(t){const n=e.replaceIRIWithPrefix(t);return n.length===t.length?t.split("/")[t.split("/").length-1]:n}e.toggleSidePanel=function(){e.pageslideExpanded=!e.pageslideExpanded},e.closeInfoPanel=function(){e.pageslideExpanded=!1,e.openedNodeInfoPanel=void 0,e.predicates=[],D=null,l((function(){e.showInfoPanel=!1}))},e.clickLink=function(t){if(Y.tripleNodes.has(t.linkId)){xe();let n=Y.tripleNodes.get(t.linkId)[t.nodeIndex];me(n),e.showPredicates=!0;let r=document.getElementById(t.linkId+t.nodeIndex);r&&(r.style.fontWeight="bold");let i={};const o=Y.tripleLinksCopy.values();for(let e=0;e<Y.tripleLinksCopy.size;e++){let e=o.next().value;e.length>1&&e.every(t=>t.source.iri===n.iri?(i.iri=e[0].source.iri,t.target.isTriple&&(i.oppLinkIRI=j(t.target.iri),i.oppTriplePred=Ne(t.target.iri.split(" ")[1])),i.pred=Ne(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1):t.target.iri!==n.iri||(i.iri=e[0].target.iri,t.source.isTriple&&(i.oppLinkIRI=j(t.source.iri),i.oppTriplePred=Ne(t.source.iri.split(" ")[1])),i.pred=Ne(n.iri.split(" ")[1]),1===t.predicates.length&&(i.linkPred=t.predicates[0]),!1))}i.iri||(i.iri=n.iri,i.pred=Ne(n.iri.split(" ")[1])),ve(i)}},e.splitPredicate=function(e){return e.split("/")[e.split("/").length-1]},e.getActiveRepository=function(){return n.getActiveRepository()},e.isLoadingLocation=function(){return n.isLoadingLocation()},e.hasActiveLocation=function(){return n.hasActiveLocation()},e.rotate=function(e){ge();const t=2*(e?1:-1)*Math.PI/180,n=Math.cos(t),r=Math.sin(t);d3.selectAll(".node-wrapper").each((function(e){e.x=n*(e.x-500)+r*(e.y-500)+500,e.y=-r*(e.x-500)+n*(e.y-500)+500,e.fixed&&(e.px=e.x,e.py=e.y)})),ne.resume()},e.openUri=function(t,n){if(!n){const n={};e.configLoaded.id!==e.defaultGraphConfig.id&&(n.config=e.configLoaded.id),n.uri=t,e.pushHistory(n,{uri:t,config:e.configLoaded})}e.$broadcast("onRootNodeChange",t)},e.saveOrUpdateGraph=function(){const t=JSON.stringify(Y.copyState()),n={id:e.lastSavedGraphId,name:e.lastSavedGraphName,data:t,shared:e.shared};n.id?e.saveGraphModal("update",n):e.saveGraphModal("new",n)},e.renameSavedGraph=function(t){e.saveGraphModal("rename",{id:t.id,name:t.name,config:t.config,shared:t.shared})};const Ce=function(t){T.editSavedGraph(t).success((function(){e.lastSavedGraphName=t.name,e.shared=t.shared,e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph.was.edited",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.cannot.edit"))}))};e.saveGraphModal=function(t,n,r){v.open({templateUrl:"js/angular/graphexplore/templates/modal/save-graph.html",controller:"SaveGraphModalCtrl",resolve:{data:function(){return{mode:t,graph:n,graphExists:r,shared:n.shared}}}}).result.then((function(t){if(t.restart)e.saveGraphModal(t.mode,t.graph,!1);else switch(t.mode){case"new":!function(t){e.configLoaded&&(t.config=e.configLoaded.id),T.addNewSavedGraph(t).success((function(n,r,i){e.lastSavedGraphName=t.name,e.lastSavedGraphId=i()["x-saved-graph-id"],e.shared=t.shared,e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph",{name:t.name}))})).error((function(n,r){if(422===r)e.saveGraphModal("new",t,!0);else{const e=getError(n);a.error(e,S.instant("graphexplore.error.cannot.create.graph"))}}))}(t.graph);break;case"update":case"rename":Ce(t.graph)}}))},e.refreshSavedGraphs=function(){T.getSavedGraphs().success((function(t){e.savedGraphs=t})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.getting.saved.graphs"))}))},e.loadSavedGraph=function(t,n){t.owner?(e.lastSavedGraphName=t.name,e.lastSavedGraphId=t.id,e.shared=t.shared,e.configLoaded=e.findConfigById(t.config)):(e.lastSavedGraphName=null,e.lastSavedGraphId=null,e.shared=t.shared),e.configLoaded||(e.configLoaded=e.defaultGraphConfig),f.url("?saved="+t.id),Y.restoreState(JSON.parse(t.data)),n||e.pushHistory({saved:t.id},{savedGraph:t})},e.copyToClipboardSavedGraph=function(e){F([location.protocol,"//",location.host,location.pathname,"?saved=",e.id].join(""))},e.deleteSavedGraph=function(t){m.openSimpleModal({title:S.instant("common.confirm"),message:S.instant("graphexplore.confirm.delete.graph",{graphName:t.name}),warning:!0}).result.then((function(){!function(t){T.deleteSavedGraph(t).success((function(){e.refreshSavedGraphs(),a.success(S.instant("graphexplore.saved.graph.was.deleted",{name:t.name}))})).error((function(e){const t=getError(e);a.error(t,S.instant("graphexplore.error.cannot.delete"))}))}(t)}))},e.openIRI=function(t,n){return n.shiftKey?e.$broadcast("onRootNodeChange",t):window.open(t,"_blank"),!1},e.togglePinAllNodes=function(){ge();const t=e.numberOfPinnedNodes<=0;e.numberOfPinnedNodes=0,d3.selectAll(".node").each((function(n){n.fixed=t,t&&e.numberOfPinnedNodes++})),ne.resume()},$("body").on("keydown",(function(t){!I.isActive()&&"input"!==t.target.nodeName&&e.nodeSelected&&(37===t.keyCode?e.rotate(!0):39===t.keyCode&&e.rotate(!1))})),e.getLiteralFromPropValue=function(e){return e.substring(e.indexOf(":")+1)}}function l(e,t,n,r){switch(e.mode=n.mode,e.graph=angular.copy(n.graph),e.graphExists=n.graphExists,e.mode){case"new":e.title=r.instant("graphexplore.create.new.graph"),e.okButtonText=r.instant("common.create.btn");break;case"update":e.title=r.instant("graphexplore.update"),e.okButtonText=r.instant("common.save.btn");break;case"rename":e.title=r.instant("graphexplore.rename"),e.okButtonText=r.instant("common.save.btn")}e.ok=function(){e.form.$valid&&t.close({graph:e.graph,mode:e.mode})},e.saveNew=function(){e.graph.name=e.graph.name+" (new)",t.close({graph:e.graph,mode:"new",restart:!0})},e.cancel=function(){t.dismiss("cancel")}}angular.module("graphdb.framework.graphexplore.controllers.graphviz",["ui.scroll.jqlite","ui.scroll","toastr","ui.bootstrap","ngTagsInput","graphdb.framework.utils.localstorageadapter"]).controller("GraphsVisualizationsCtrl",a).controller("SaveGraphModalCtrl",l).config(["$uibTooltipProvider",function(e){e.options({appendToBody:!0})}]),a.$inject=["$scope","$rootScope","$repositories","$licenseService","toastr","$timeout","$http","ClassInstanceDetailsService","AutocompleteRestService","$q","$location","$jwtAuth","UiScrollService","ModalService","$uibModal","$window","LocalStorageAdapter","LSKeys","SavedGraphsRestService","GraphConfigRestService","RDF4JRepositoriesRestService","$translate","GuidesService"],l.$inject=["$scope","$uibModalInstance","data","$translate"]},108:function(e,t,n){"use strict";n.r(t);n(58),n(10);function r(e,t,n,r,i,o,s,a,l,u,c,p,d,f,h){var g;e.page=1,e.totalPages=5,e.helpHidden=1===d.get(f.HIDE_GRAPH_CONFIG_HELP),e.toggleHelp=function(t){void 0===t&&(t=d.get(f.HIDE_GRAPH_CONFIG_HELP)),1!==t?(d.set(f.HIDE_GRAPH_CONFIG_HELP,1),e.helpHidden=!0):(d.set(f.HIDE_GRAPH_CONFIG_HELP,0),e.helpHidden=!1)},e.fixedVisualCallback=function(t,n){e.newConfig.startIRI=t,e.newConfig.startIRILabel=n,g=!0},e.isDefaultGraph=function(e){return"Minimal"===e.name||"Advanced"===e.name},e.isUserGraph=function(t){return!e.isDefaultGraph(t)},e.getSampleName=function(e,t){const n=e[t+"Description"];return n||(e.id?"Copy of "+e.name:e.name)};const m=u.configName;function v(e){r.warning(e)}function E(t){let n;return"query"===t.startMode&&1===e.page?n=t.startGraphQuery:2===e.page?n=t.expandQuery:3===e.page?n=t.resourceQuery:4===e.page?n=t.predicateLabelQuery:5===e.page&&(n=t.resourcePropertiesQuery),angular.isDefined(n)?n:""}function x(){function o(){e.getAutocompletePromise=l.checkAutocompleteStatus()}a.getGraphConfigSamples().success((function(t){e.samples=_.filter(t,(function(t){return!t.id||e.newConfig.id!==t.id||(e.revertConfig=t,!1)}))})).error((function(e){r.error(getError(e),h.instant("graphexplore.error.graph.configs"))})),e.createGraphConfig=function(){a.createGraphConfig(e.newConfig).success((async function(){await c.showToastMessageWithDelay("graphexplore.saved.new.config"),n.url("graphs-visualizations")})).error((function(e){r.error(getError(e),h.instant("graphexplore.error.could.not.create"))}))},e.updateGraphConfig=function(){a.updateGraphConfig(e.newConfig).success((async function(){await c.showToastMessageWithDelay("graphexplore.saved.config"),n.url("graphs-visualizations")})).error((function(e){r.error(getError(e),h.instant("graphexplore.error.could.not.save"))}))},e.$on("autocompleteStatus",(function(){o()})),o(),e.getNamespacesPromise=p.getNamespaces(e.getActiveRepository());const s=function(e,t,n,r,i,o){t?a.validateQuery(t,n,r,i,o).success((function(){e()})).error((function(e){v(getError(e))})):e()};function u(){d()&&e.$broadcast("addStartFixedNodeAutomatically",{startIRI:e.newConfig.startIRI})}function d(){return 1===e.page&&"node"===e.newConfig.startMode}e.validateCurrentPage=function(t){e.updateModel(),1===e.page?"node"!==e.newConfig.startMode||e.newConfig.startIRI?"query"!==e.newConfig.startMode||e.newConfig.startGraphQuery?"query"===e.newConfig.startMode?s(t,e.newConfig.startGraphQuery,"graph"):t():v(h.instant("graphexplore.provide.query")):v(h.instant("graphexplore.select.start.node")):2===e.page?s(t,e.newConfig.expandQuery,"construct",["node"]):3===e.page?s(t,e.newConfig.resourceQuery,"tuple",["node"],[],["type","label","comment","rank"]):4===e.page?s(t,e.newConfig.predicateLabelQuery,"tuple",["edge"],["label"]):5===e.page&&s(t,e.newConfig.resourcePropertiesQuery,"tuple",["node"],["property","value"])},e.goToPage=function(t){e.page!==t&&e.validateCurrentPage((function(){e.showEditor(),e.page=t,e.notoolbar=1!==e.page}))},e.goToPreviousPage=function(){e.page>1&&e.goToPage(e.page-1),d()&&(g=!1)},e.goToNextPage=function(){u(),("node"!==e.newConfig.startMode||g)&&e.goToPage(e.page+1)},e.saveGraphConfig=function(){u(),d()&&!g||(e.newConfig.startQueryIncludeInferred=e.currentQuery.inference,e.newConfig.startQuerySameAs=e.currentQuery.sameAs,e.validateCurrentPage((function(){e.newConfig.name?e.isUpdate?e.updateGraphConfig(e.newConfig):e.createGraphConfig(e.newConfig):v(h.instant("graphexplore.provide.config.name"))})))},e.updateModel=function(){const t=window.editor.getValue().trim();"query"===e.newConfig.startMode&&1===e.page?e.newConfig.startGraphQuery=t:2===e.page?e.newConfig.expandQuery=t:3===e.page?e.newConfig.resourceQuery=t:4===e.page?e.newConfig.predicateLabelQuery=t:5===e.page&&(e.newConfig.resourcePropertiesQuery=t)},e.setQuery=function(e){window.editor.setValue(e||" ")},e.updateDirty=function(){if(e.revertConfig){const t=E(e.revertConfig),n=window.editor.getValue().trim();e.queryEditorIsDirty=t!==n}},e.updateEditor=function(){t((function(){e.currentQuery.query=E(e.newConfig),i.isActiveRepoOntopType()&&(e.nocount=!0),e.currentQuery.inference=e.newConfig.startQueryIncludeInferred,e.currentQuery.sameAs=e.newConfig.startQuerySameAs,w(),I(e.currentQuery.id)}),100)},e.showEditor=function(){window.editor&&window.editor.xhr&&window.editor.xhr.abort(),e.viewMode="yasr"},e.showPreview=function(){e.currentQuery.outputType="table",e.runQuery()},e.revertEditor=function(){e.setQuery(E(e.revertConfig))},e.$watch("newConfig.startMode",(function(n){"query"===n&&t((function(){e.updateEditor()}),0)})),e.$watch("page",(function(n){("query"===e.newConfig.startMode||n>1)&&t((function(){e.showEditor(),e.updateEditor()}),0)}))}e.newConfig={startQueryIncludeInferred:!0,startQuerySameAs:!0},e.newConfig.startMode="search",e.isUpdate=!1,e.shared=!1,e.encodeQuery=function(e){return encodeURIComponent(e)},m?(e.isUpdate=!0,a.getConfig(m).success((function(t){e.newConfig=t,x()})).error((function(e){r.error(getError(e),h.instant("created.connector",{name:m}))}))):(e.isUpdate=!1,x());const y={id:"1",name:"",query:"select * where { \n\t?s ?p ?o .\n} limit 100 \n",inference:e.newConfig.startQueryIncludeInferred,sameAs:e.newConfig.startQuerySameAs};function T(e){}function N(t,n,r){const i=angular.element(document.getElementById("yasr-inner"));e.queryIsRunning=t,t?(e.queryStartTime=Date.now(),e.countTimeouted=!1,e.progressMessage=n,e.extraMessage=r,i.addClass("hide")):(e.progressMessage="",e.extraMessage="",i.removeClass("hide")),null===e.$$phase&&e.$apply()}function C(n){function r(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}const i=n;if(e.orientationViewMode){if("yasr"===e.viewMode){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px"}else e.noPadding={},document.querySelector(".CodeMirror-wrap").style.height="";document.getElementById("yasr").style.minHeight=""}else if(e.noPadding={paddingRight:15,paddingLeft:0},window.editor&&document.querySelector(".CodeMirror-wrap")){let e=r()-document.querySelector(".CodeMirror-wrap").getBoundingClientRect().top;e-=40,document.querySelector(".CodeMirror-wrap").style.height=e+"px",document.getElementById("yasr").style.minHeight=e+"px"}else{let n;n=t(i?function(){e.fixSizesOnHorizontalViewModeSwitch(i)}:e.fixSizesOnHorizontalViewModeSwitch,100),e.$on("$destroy",(function(){t.cancel(n)}))}window.yasr&&window.yasr.container&&t((function(){window.yasr.container.resize()}),100)}function S(){C(!0)}function I(e){t((function(){$('a[data-id = "'+e+'"]').tab("show")}),0)}function L(t,n){e.executedQueryTab=e.currentQuery,n&&"SELECT"!==window.editor.getQueryType()&&"CONSTRUCT"!==window.editor.getQueryType()&&"DESCRIBE"!==window.editor.getQueryType()?r.warning(h.instant("query.editor.warning.msg")):"update"!==window.editor.getQueryMode()?(e.explainRequested=n,e.queryIsRunning||(t?e.currentTabConfig.resultsCount=0:e.resetCurrentTabConfig(),e.viewMode="editor",e.orientationViewMode&&e.fixSizesOnHorizontalViewModeSwitch(),N(!0,h.instant("evaluating.query.msg")),window.editor.query())):r.warning(h.instant("cannot.execute.update.error"))}function A(){N(!0,h.instant("common.refreshing.namespaces"),h.instant("common.extra.message")),p.getRepositoryNamespaces().success((function(t){const n={};t.results.bindings.forEach((function(e){n[e.prefix.value]=e.namespace.value})),e.namespaces=n})).error((function(t){e.repositoryError=getError(t)})).finally((function(){N(!1)}))}function b(){o.addKnownPrefixes(JSON.stringify(window.editor.getValue())).success((function(e){angular.isDefined(window.editor)&&angular.isDefined(e)&&e!==window.editor.getValue()&&window.editor.setValue(e)})).error((function(e){let t=getError(e);return r.error(t,h.instant("common.add.known.prefixes.error")),!0}))}function R(t){let n=void 0;return angular.forEach(e.tabsData,(function(e){if(e.name===t.name&&e.query===t.body)return n=e.id,e})),n}function w(){e.tabsData=[e.currentQuery];let n=e.currentQuery;null==e.currentQuery.query||""===e.currentQuery.query?window.editor.setValue(" "):window.editor.setValue(e.currentQuery.query),t((function(){e.currentTabConfig={},e.currentTabConfig.queryType=n.queryType,e.currentTabConfig.resultsCount=n.resultsCount,e.currentTabConfig.offset=n.offset,e.currentTabConfig.allResultsCount=n.allResultsCount,e.currentTabConfig.page=n.page,e.currentTabConfig.pageSize=n.pageSize,e.currentTabConfig.timeFinished=n.timeFinished,e.currentTabConfig.timeTook=n.timeTook,e.currentTabConfig.sizeDelta=n.sizeDelta,e.$apply()}),0),$("#yasr").css("padding","0")}function O(e){return $(e).attr("data-id")}e.resetCurrentTabConfig=function(){e.currentTabConfig={pageSize:100,page:1,allResultsCount:0,resultsCount:0}},e.queryExists=!1,e.resetCurrentTabConfig(),e.tabsData=e.tabs=[y],e.saveTab=function(t){const n=function(t){for(let n=0;n<e.tabsData.length;n++){if(e.tabsData[n].id===t)return n}}(t);if(void 0===n)return{};const r=e.tabsData[n];return e.saveQueryToLocal(r),r},e.loadTab=w,e.addNewTab=function(e,t,n){},e.runQuery=L,e.getNamespaces=A,e.changePagination=function(){L(!0,e.explainRequested)},e.toggleSampleQueries=function(){},e.addKnownPrefixes=b,e.getExistingTabId=R,e.querySelected=function(t){const n=R(t);e.toggleSampleQueries(),angular.isDefined(n)?I(n):e.addNewTab(null,t.name,t.body)},e.saveQueryToLocal=T,e.setLoader=N,e.getLoaderMessage=function(){const t=(Date.now()-e.queryStartTime)/1e3,n=e.getHumanReadableSeconds(t);let r;r=e.progressMessage?e.progressMessage+"... "+n:h.instant("common.running.operation",{timeHuman:n});e.extraMessage&&t>10&&(r+="\n"+e.extraMessage);return r},e.fixSizesOnHorizontalViewModeSwitch=C,e.changeViewMode=function(n){e.viewMode="none",e.orientationViewMode=!e.orientationViewMode,C(),$(".dataTables_filter").remove(),$(".resultsTable").remove(),t((function(){w(),I(n)}),100)},e.showHideEditor=S,e.focusQueryEditor=function(){angular.element(document).find(".editable-input").is(":focus")||angular.element(document).find(".CodeMirror textarea:first-child").focus()},e.orientationViewMode=!0,e.orientationViewMode||S(),e.getActiveRepository()&&A(),e.$on("$destroy",(function(){window.editor=null,window.yasr=null})),$("textarea").on("paste",(function(){t((function(){b()}),0)})),e.$watchCollection("[currentQuery.inference, currentQuery.sameAs]",(function(){e.currentQuery})),e.$on("tabAction",(function(t,n){n.relatedTarget&&e.saveTab(O(n.relatedTarget)),e.loadTab(O(n.target))})),e.$on("deleteAllexeptSelected",(function(t,n){e.tabsData=n,e.tabs=n})),e.currentQuery=angular.copy(y),e.showSampleQueries=!1,e.savedQuery={},e.sampleQueries={},e.getResultsDescription=function(){},e.getUpdateDescription=function(){},e.getStaleWarningMessage=function(){}}angular.module("graphdb.framework.graphexplore.controllers.graphviz.config",["graphdb.framework.utils.notifications","graphdb.framework.utils.localstorageadapter"]).controller("GraphConfigCtrl",r),r.$inject=["$scope","$timeout","$location","toastr","$repositories","SparqlRestService","$filter","GraphConfigRestService","AutocompleteRestService","$routeParams","Notifications","RDF4JRepositoriesRestService","LocalStorageAdapter","LSKeys","$translate"]},109:function(e,t,n){"use strict";n.r(t);var r=n(298),i=n.n(r),o=n(308),s=n(301),a=n(302);n(10);function l(e,t,n,r,l,u,c,p,d,f,h,g,m){return{restrict:"AE",template:'<div id="classChart"></div>',scope:{classHierarchyData:"=",flattenedClassNames:"=",selectedClass:"=",currentSliderValue:"=",showClassInfoPanel:"=",showExternalElements:"=",hidePrefixes:"=",currentBrowserLimit:"="},link:function(c,v,E){!function(c,v){var E=d3.layout.pack().size([780,780]).value((function(e){return e.size})),x=d3.scale.linear().domain([0,4]).range(["hsl(19, 70%, 90%)","hsl(19, 70%, 50%)"]).interpolate(d3.interpolateHcl),y=d3.select("#classChart").insert("svg:svg","h2").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null);function T(){return y.append("svg:g").attr({id:"main-group",transform:"translate(400,400)"})}function N(){return"true"===h.get(g.CLASS_HIERARCHY_HIDE_PREFIXES)}function C(){var e=a.a.Export.getCSSRules("css/rdf-class-hierarchy-labels.css?v=2.4.2-RC2");d3.selectAll("#main-group").append("defs"),$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>"),d3.selectAll("g").style("opacity",1);var t=a.a.Export.generateBase64ImageSource("#classChart svg");d3.select(this).attr({href:t,download:"class-hierarchy-"+u.getActiveRepository()+".svg"})}c.hidePrefixes=N();var S,I,L=T();if(!c.classHierarchyData.classCount&&u.getActiveRepository()&&!u.isSystemRepository()){e.loader=!0,e.hierarchyError=!1;const t=h.get("classHierarchy-selectedGraph-"+u.getActiveRepository());n.getClassHierarchyData(null!==t?t.contextID.uri:"").success((function(t,n,r){e.loader=!1,207===n&&p.warning(m.instant("graphexplore.update.diagram"),m.instant("graphexplore.repository.data.changed")),c.classHierarchyData=t,d3.select("#download-svg").on("mouseover",C)})).error((function(t){e.loader=!1,e.hierarchyError=getError(t),p.error(m.instant("graphexplore.error.request.failed",{name:f,error:getError(t)}))}))}var A,b,R,w,O,M,P,D,k={};function F(n,a,u,p){R&&R(),w&&w(),d3.selectAll("#main-group").remove(),L=T(),o.a.SingleChild.addPlaceholders(n,!0),b=u||n;var h,g=E.nodes(n);b.isInFocusTransitive=!0,o.a.SingleChild.removePlaceholders(g),o.a.SingleChild.centerNodes(g),o.a.SingleChild.makePositionsRelativeToZero(g);var m=i()().attr("class","d3-tip").customPosition((function(e){return{top:"inherit",bottom:r.innerHeight-d3.event.clientY+"px",right:r.innerWidth-d3.event.clientX+"px"}})).html((function(e){return e.name}));y.call(m);var v=L.selectAll("circle").data(g).enter().append("g");a.doFade&&v.each((function(e){s.a.Transition.fadeIn(d3.select(this),550)}));var N,C=[],O=v.append("circle").attr("class",(function(e){return e.role})).attr("guide-selector",(function(e){return"class-"+e.name})).style("fill",(function(e){return e.children?x(e.depth):"#E0D0D0"})).each((function(e){if(e.circle=d3.select(this),e.name!==f){var t=e.name;C.push({name:t}),k[[t]]=e,e.circle.classed("rdf-class",!0),e.circle.on("mouseover",(function(){a.noPrefixes||e.textHidden?m.show(e):m.hide(e)})),e.circle.on("mouseout",m.hide)}})).on("gdb-focus",I).on("gdb-zoom",z);function M(e){d3.selectAll(".selected").classed("selected",e.selected=!1),e.circle.classed("selected",e.selected=!0),N=e}function P(){c.showClassInfoPanel=!1}C&&(C=_.uniqBy(C,"name"),c.flattenedClassNames=C);var D=s.a.Click.delayDblClick();d3.selectAll(".parent, .topLevelParent, .child, .root").call(D);I=function(e){z(e),e.name===f?(P(),d3.selectAll(".selected").classed("selected",!1)):(M(e),c.selectedClass=N,c.showClassInfoPanel=!0,c.$on("sidePanelClosed",(function(t){d3.selectAll(".selected").classed("selected",e.selected=!1)})))},D.on("click",(function(e){e.id&&r.history.pushState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),m.hide(),I(e)})),D.on("dblclick",(function(t){t!==n&&(m.hide(),M(t),e.$broadcast("goToDomainRangeGraphView",N,b),d3.event.stopPropagation())}));var F=0;y.on("wheel",(function(){m.hide();var e=d3.event;e.preventDefault(),e.stopPropagation();var t=(new Date).getTime();if(t-F>100){F=t;var n="";e.deltaY<=-1?n="in":e.deltaY>=1&&(n="out");var i=e.target.__data__;if(i||(i=b),"in"===n){if(i!==b){for(;i.parent&&!i.parent.isInFocusTransitive;)i=i.parent;i.depth<b.depth&&(i=b)}if(i===b&&i.children){for(var o=i.children[0],s=1;s<i.children.length;s++)i.children[s].sortingRank>o.sortingRank&&(o=i.children[s]);o.children&&(i=o)}else i.children||(i=i.parent);z(i,!0)}else"out"===n&&(i=b.parent)&&z(i,!0);b.name===f&&r.history.replaceState({id:1},"classHierarchyPage1","hierarchy#1"),G()}}));var U=L.selectAll("text").data(g).enter().append("text").attr("class",(function(e){return e.children&&e.children.length?"label":"label child-label"})).each((function(e){e.textSel=d3.select(this)}));a.noPrefixes?(A!==n&&(U.each((function(e){var t=e.name.indexOf(":");e.name.indexOf("http://")>-1?e.noPrefixName=e.name:t>-1&&(e.noPrefixName=e.name.substring(t+1))})),A=n),U.style("font-size",(function(e){return s.a.Text.calcFontSize(e.noPrefixName,e.r)})).text((function(e){return s.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r/3)}))):U.style("font-size",(function(e){return s.a.Text.calcFontSize(e.name,e.r)})).text((function(e){return s.a.Text.getTextWithElipsisIfNeeded(e.name,e.r/3)})),U.style("display",(function(e){return e.parent===n?(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,null):(e.textHidden=!0,"none")})),a.doFade&&!a.keepPrevState&&U.each((function(e){s.a.Transition.fadeIn(d3.select(this),550)})),S=function(){function e(e){e&&O.each((function(t){e==t.id&&I(t)}))}var n=t.hash();r.onpopstate=function(t){t.state&&e(t.state.id)},e(n)};var B=L.selectAll("circle, text");function j(e,t){var n=800/e[2];h=e,B.attr("transform",(function(t){return"translate("+(t.x-e[0])*n+","+(t.y-e[1])*n+")"})),O.attr("r",(function(e){return e.r*n})),t&&U.each((function(e){e.fullName!==b.topLevelParentUri&&b.topLevelParentUri!==f||(e.textSel.style("display","none"),b.children&&b.children.length?_.each(b.children,(function(e){e.textSel.style("display","inline")})):b.textSel.style("display","inline"),b.parent&&_.each(b.parent.children,(function(e){e.name!==b.name&&e.textSel.style("display","inline")})))})),U.style("font-size",(function(e){return a.noPrefixes?s.a.Text.calcFontSize(e.noPrefixName,e.r*n):s.a.Text.calcFontSize(e.name,e.r*n)})).text((function(e){return a.noPrefixes?s.a.Text.getTextWithElipsisIfNeeded(e.noPrefixName,e.r*n/3):s.a.Text.getTextWithElipsisIfNeeded(e.name,e.r*n/3)}))}function V(e){var t=2*e+20;return 2*e/t<.3&&(t=2*e+2),t}function H(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive||(e.textHidden=!0,this.style.display="none")}function q(e){!e.isInFocusTransitive&&e.parent&&e.parent.isInFocusTransitive&&(e.textHidden=this.textContent.indexOf("...")+3===this.textContent.length,this.style.display="")}function z(e,t){if(l((function(){c.showExternalElements=e.name===f})),b!==e&&(e.id&&r.history.replaceState({id:e.id},"classHierarchyPage"+e.id,"hierarchy#"+e.id),e.children||(e=e.parent,b!==e))){if(t&&(P(),d3.selectAll(".selected").classed("selected",!1)),b.parent)for(var n=b;n;)n.isInFocusTransitive=!1,n=n.parent;for(n=e;n;)n.isInFocusTransitive=n.children,n=n.parent;if(2*(b=e).r/(2*b.r+20)<.3||c.currentSliderValue>c.currentBrowserLimit)j([b.x,b.y,V(b.r)]),U.each((function(e){H.call(this,e),q.call(this,e)}));else d3.transition().duration(d).tween("zoom",(function(e){var t=d3.interpolateZoom(h,[b.x,b.y,V(b.r)]);return function(e){j(t(e))}})).selectAll("text").each("start",H).each("end",q)}}j([b.x,b.y,V(b.r)],p),R=c.$on("rootFocus",(function(){r.history.pushState({id:1},"classHierarchyPage1","hierarchy#1"),I(n)})),w=c.$on("classSearch",(function(e){I(e)}))}function G(){var t=c.classHierarchyData.classCount;let n=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);(!n||n>t)&&(n=t,h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,n)),e.$broadcast("classCount",t,n)}window.addEventListener("resize",G),window.addEventListener("beforeunload",(function e(){window.removeEventListener("resize",G),window.removeEventListener("beforeunload",e)})),c.$watch("classHierarchyData",(function(){O&&O(),M&&M(),P&&P(),D&&D();var e=N();if(c.classHierarchyData.classCount){G();var t=angular.copy(c.classHierarchyData);var n,r,i=function(e){return E.nodes(e).sort((function(e,t){return e.sortingRank>t.sortingRank?-1:e.sortingRank<t.sortingRank||e.depth>t.depth?1:e.depth<t.depth?-1:0}))}(t);function o(e,t){var i={keepPrevState:!0,noPrefixes:N()};r=i.noPrefixes,F(n||e,i,b,!0),l((function(){h.set(g.CLASS_HIERARCHY_SWITCH_PREFIXES,t),S()}),70)}function s(e,i,s){if(e){h.set(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE,e),n={name:f,children:[]};for(var a=new Set,l=1;l<=e;l++)a.add(i[l].id),i[l].parent===i[0]&&n.children.push(i[l]);if(function e(t){if(t.children){for(var n=[],r=0;r<t.children.length;r++)a.has(t.children[r].id)&&n.push($.extend({},t.children[r]));t.children=n;for(r=0;r<t.children.length;r++)e(t.children[r])}}(n),s)r=angular.isUndefined(r)?N():r,F(n,{noPrefixes:r});else o(t)}}var a,u=h.get(g.CLASS_HIERARCHY_CURRENT_SLIDER_VALUE);if(u)s(u,i);else{var p={doFade:!0,keepPrevState:!0,noPrefixes:N()};F(t,p),S()}O=c.$watch("hidePrefixes",(function(n){angular.isUndefined(n)||e?e=void 0:l((function(){!function(e){angular.isUndefined(e)||h.set(g.CLASS_HIERARCHY_HIDE_PREFIXES,e)}(n),o(t,!0)}),50)}),!0),M=c.$watch("currentSliderValue",(function(e){s(e,i,!0)}),!0),D=c.$on("onEnterKeypressSearchAction",(function(e){a&&I(a)})),P=c.$on("searchedClass",(function(e,t){(a=k[t.name])&&I(a)}))}}),!0)}(c)}}}angular.module("graphdb.framework.graphexplore.directives.class",["graphdb.framework.graphexplore.controllers.class","graphdb.framework.utils.localstorageadapter"]).constant("ZOOM_DURATION",500).constant("ROOT_OBJ_NAME","RDF Class Hierarchy").directive("rdfClassHierarchy",l),l.$inject=["$rootScope","$location","GraphDataRestService","$window","$timeout","$repositories","$licenseService","toastr","ZOOM_DURATION","ROOT_OBJ_NAME","LocalStorageAdapter","LSKeys","$translate"]},110:function(e,t,n){"use strict";n.r(t);var r=n(302),i=n(301);n(10);function o(e,t,n,o,s,a,l,u,c,p,d,f,h){return{restrict:"AE",template:'<div id="domain-range"></div>',scope:{showPredicatesInfoPanel:"=",selectedPredicate:"=",collapseEdges:"="},link:function(p){const d=u((function(){!function(p){d3.selection.prototype.moveToFront=function(){return this.each((function(){d3.select(this.parentNode.appendChild(this))}))},d3.selection.prototype.moveToBack=function(){return this.each((function(){const e=this.parentNode.firstChild;e&&this.parentNode.insertBefore(this,e)}))};var d=d3.layout.force().size([1200,600]).charge(-900),g=d.drag().on("dragstart",(function(e){d3.select(this).classed("selected",e.selected=!0)})),m=d3.select("#domain-range").append("svg").attr("viewBox","0 0 1200 600").attr("preserveAspectRatio","xMidYMid meet").on("dblclick.zoom",null),v=m.append("defs");v.append("marker").attr({id:"arrow",viewBox:"0 -5 10 10",refX:10,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),v.append("marker").attr({id:"collapsed-arrow",viewBox:"0 -5 10 10",refX:9,refY:0,markerUnits:"strokeWidth",markerWidth:4,markerHeight:4,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),v.append("marker").attr({id:"arrow-loop",viewBox:"0 -5 10 10",refX:7,refY:0,markerUnits:"strokeWidth",markerWidth:5,markerHeight:5,orient:"auto",fill:f}).append("path").attr({d:"M0,-5L10,0L0,5",class:"arrowHead"}),d3.select("#download-svg").on("mouseover",(function(){var e=r.a.Export.getCSSRules("css/domain-range-graph.css?v=2.4.2-RC2");$("defs").append('<style type="text/css"><![CDATA['+e+"]]></style>");var t=r.a.Export.generateBase64ImageSource("#domain-range svg");d3.select(this).attr({href:t,download:"domain-range-graph-"+n.getActiveRepository()+".svg"})}));var E=d3.select(".legend-container").append("svg").attr("viewBox","0 0 "+1200/7+" "+1200/7*1.2).attr("preserveAspectRatio","xMidYMid meet");E.append("rect").attr({width:1200/7,height:1200/7*1.2}).style("fill","rgba(235, 235, 235, 0.9)");var x=16+1200/18/2.5,y=x+1200/90;E.append("circle").attr({class:"legend-class-node",cx:(16+x)/2,cy:30,r:1200/18/4.5});E.append("text").attr({x:y,y:30+1200/370}).style("font-size",1200/90/1.1+"px").text("main class node");E.append("circle").attr({class:"legend-object-node",cx:(16+x)/2,cy:70,r:1200/110/1.25});E.append("text").attr({x:y,y:30+1200/370+40}).style("font-size",1200/90/1.1+"px").text("class node");E.append("circle").attr({class:"legend-datatype-node",cx:(16+x)/2,cy:70+1200/45,r:1200/110/2});E.append("text").attr({x:y,y:99.90990990990991}).style("font-size",1200/90/1.1+"px").text("datatype node");d3.select(".legend-class-node");E.append("line").attr({class:"property-arrow",x1:16,y1:123.33333333333334,x2:x,y2:123.33333333333334}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),E.append("text").attr({x:y,y:126.57657657657658}).style("font-size",1200/90/1.1+"px").text("explicit property");E.append("line").attr({class:"implicit-property-arrow",x1:16,y1:150,x2:x,y2:150}).style("stroke-width",1.2).attr("marker-end","url("+s.absUrl()+"#arrow)"),E.append("text").attr({x:y,y:150+1200/370}).style("font-size",1200/90/1.1+"px").text("implicit property");E.append("line").attr({class:"collapsed-property-arrow",x1:16,y1:150+1200/45,x2:x,y2:150+1200/45}).style("stroke-width",2).attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)"),E.append("text").attr({x:y,y:179.9099099099099}).style("font-size",1200/90/1.1+"px").text("collapsed property");var T=m,N=s.search().uri,C=s.search().name,S=s.search().collapsed;o.getDomainRangeData(N,S).success((function(e,t,n){p.domainRangeGraphData=e})).error((function(e){c.error("Request for "+C+" failed!")})),$(window).on("popstate",(function(){a.set(l.DOMAIN_RANGE_WENT_BACK,!0)})),t.onpopstate=function(t){t.state&&e.$broadcast("changeCollapsedEdgesState",t.state.collapsed)},p.$watch("collapseEdges",(function(){angular.isUndefined(p.collapseEdges)||(a.set(l.DOMAIN_RANGE_COLLAPSE_EDGES,p.collapseEdges),"true"!==a.get(l.DOMAIN_RANGE_WENT_BACK)&&function(t){e.$broadcast("switchEdgeMode",{uri:N,name:C,collapsed:t})}(p.collapseEdges),a.remove(l.DOMAIN_RANGE_WENT_BACK))})),p.$watch("domainRangeGraphData",(function(){if(p.domainRangeGraphData){var n=angular.copy(p.domainRangeGraphData);d.nodes(n.nodes).links(n.links);var r=T.selectAll(".link").data(n.links).enter().append("g");function o(e){e.style("stroke",f),e.style("stroke-width",2),e.attr("marker-end","url("+s.absUrl()+"#collapsed-arrow)")}var a,l,c=0;r.each((function(e){if(e.objectPropNodeClassUri!==N)a=r.append("line").attr({class:"link","marker-end":"url("+s.absUrl()+"#arrow)"}).style("stroke-width",1.2).each((function(e){switch(e.propertyType){case"objectLeft":e.targetRadius=1200/18;break;case"objectRight":e.targetRadius=1200/110;break;case"datatype":e.targetRadius=1200/110/2;break;default:e.targetRadius=0}var t=d3.select(this);e.targetNodeEdgeCount>1?o(t):e.implicit&&t.style("stroke-dasharray","3, 3")}));else{if(angular.isUndefined(l)){l=d3.select(this).append("path").attr({d:"M 0 0 A "+1200/18/2+" "+1200/18/2+" 0 1 1 0 "+1200/18/2,class:"loop-link",fill:"none","marker-end":"url("+s.absUrl()+"#arrow-loop)"}).style("stroke-width",1.2)}(c+=e.targetNodeEdgeCount)>1&&o(d3.select(".loop-link"))}}));var m={};function v(){$.isEmptyObject(m)||(m.text.style("fill","black"),m.background.style("fill","#f0f0f0"))}function E(e){v(),m.text=d3.select(this),m.background=d3.select(this.previousSibling),m.text.style("fill","white"),m.background.style("fill",f),u((function(){p.showPredicatesInfoPanel=!0,p.selectedPredicate=e})),d3.event.stopPropagation()}$("document").ready((function(){$("#domain-range").bind("click",v)}));var x=r.append("text").attr("class",(function(e){return e.objectPropNodeClassUri===N?"loop-link-property-name":"property-name"})).attr("dx",(function(e){return 1200/18/2*("objectLeft"===e.propertyType?1:-1)})).style("text-anchor",(function(e){return"objectLeft"===e.propertyType?"end":"start"})).style("font-size",1200/90).text((function(e){return e.targetNodeEdgeCount>1?e.targetNodeEdgeCount+" predicates":e.name}));x.each((function(e){var n=d3.select(this);/\d\spredicates/.test(n.text())?n.style("font-weight","bold").on("click",E):n.on("click",(function(e){t.open("resource?uri="+encodeURIComponent(e.uri),"_blank")}))}));var y=r.append("rect").attr("class",(function(e){return e.objectPropNodeClassUri!==N?"link-background":"loop-link-background"})).attr("width",(function(e){return e.calculatedWidth=this.previousSibling.getBBox().width,e.calculatedWidth+4})).attr("height",(function(e){return e.calculatedHeight=this.previousSibling.getBBox().height,e.calculatedHeight+2})).attr("transform",(function(e){var t=2-1200/18/2*("objectLeft"===e.propertyType?1:-1);return"objectLeft"===e.propertyType&&(t+=e.calculatedWidth),"translate(-"+t+",-"+(2+e.calculatedHeight/2)+")"})).on("click",(function(e){d3.event.stopPropagation()})),S=T.selectAll(".node").data(n.nodes).enter().append("g"),I=S.filter((function(e){return e.objectPropClassUri!==N})).append("circle").each((function(e){var t=d3.select(this);"main"===e.classPosition?t.attr({class:"class-node",r:1200/18}).attr("marker-end","url("+s.absUrl()+"#loop-link)"):null===e.objectPropClassName?t.attr({class:"datatype-node",r:1200/110/2}):t.attr({class:"object-prop-node",r:1200/110})})).call(g);d3.selectAll(".object-prop-node").on("dblclick",(function(t,n){p.$apply((function(){e.$broadcast("reloadDomainRangeGraphView",t,n)}))})),S.filter((function(e){return e.objectPropClassName&&e.objectPropClassUri!==N})).append("text").attr("class",(function(e){return e.classPosition+"-class-label"})).style("font-size",1200/90).text((function(e){return e.objectPropClassName})).on("click",(function(e){t.open("resource?uri="+encodeURIComponent(e.objectPropClassUri),"_blank")}));var L=S.select("text");T.select(".class-node").each((function(){d3.select(this.parentNode).append("text").attr("class","rdf-class-label").style("font-size",(function(e){return i.a.Text.calcFontSize(C,1200/18)})).text(C).on("click",(function(e){t.open("resource?uri="+encodeURIComponent(N),"_blank")}))}));var A=T.select(".class-node + text"),b=d3.select(".class-node"),R=d3.selectAll(".loop-link-background"),w=d3.selectAll(".loop-link-property-name");if(x=d3.selectAll(".property-name"),!angular.isUndefined(l)){var O=[];R.each((function(e,t){d3.select(this);O.push({idx:t,width:e.calculatedWidth,height:e.calculatedHeight})}))}d.on("tick",(function(e){var t=8*e.alpha;function n(e){var t=e.x+1200/18*2,n=e.y-1200/18/1.9;var r=[];R.each((function(i,o){r.push(i),o<h?function(r,i){var o=$.grep(O,(function(e){return e.idx==i}));i>0&&(t+=parseFloat(i*(o[0].height/(i/1.4)))),r.attr({transform:"rotate(270, "+e.x+","+e.y+") translate("+t+","+n+")",width:o[0].height,height:o[0].width})}(d3.select(this),o):d3.select(this).remove()})),function(e){var t;d3.select(".view-more-preds-label").style("font-weight","bold").each((function(n){n.target.allEdges=e,t=this.getComputedTextLength()})).on("click",E),d3.select(".view-more-preds-rect").attr("height",t+4)}(r)}a.filter((function(e){return e.objectPropNodeClassUri!==N})).attr("x1",(function(e){return e.source.x})).attr("y1",(function(e){return e.source.y})).attr("x2",(function(e){return e.targetX})).attr("y2",(function(e){return e.targetY})).each((function(e){!function(e){"objectLeft"===e.propertyType?(e.source.x-=8*t,e.source.y-=t/9):(e.target.x+=8*t,e.target.y-=t/9)}(e);var n=Math.atan2(e.target.y-e.source.y,e.target.x-e.source.x);e.targetX=e.target.x-Math.cos(n)*e.targetRadius,e.targetY=e.target.y-Math.sin(n)*e.targetRadius})),I.each((function(e){"main"!==e.classPosition||angular.isUndefined(l)||(!function(e){var t=e.x+64,n=e.y-1200/18/5.7-5;l.attr("transform","rotate(270, "+e.x+","+e.y+") translate("+t+","+n+")")}(e),function(e){function t(t,n){var r=$.grep(O,(function(e){return e.idx==n})),i=0;n>0&&(i=parseFloat(2*n*(r[0].height/1.4)));var o=e.x,s=e.y-1200/18*2.1-i;t.attr({x:o,y:s}).moveToFront()}w.each((function(e,n){var r=d3.select(this),i=w.size()-h;i<0?t(r,n):(0==n&&!p.collapseEdges&&i>1&&(!function(e,t,n){e.classed("view-more-preds-label",!0).text(n+" predicates more ..."),null!==this.nextSibling&&t.classed("view-more-preds-rect",!0)}(r,d3.select(this.nextSibling),i),t(r,n)),n<h?t(r,n):r.remove())}))}(e),n(e)),e.objectPropClassUri!==N&&d3.select(this).attr("cx",(function(e){return"main"===e.classPosition?function(e){!window.ActiveXObject&&"ActiveXObject"in window&&(Math.log10=function(e){return Math.log(e)/Math.LN10});var t=b.attr("cx")-600,n=.5*Math.log10(Math.abs(t));return e.x+=t>0?-n:n,e.x}(e):e.x})).attr("cy",(function(e){return e.y}))})),A.attr("x",(function(e){return e.x})).attr("y",(function(e){return e.y})).moveToFront(),y.filter((function(e){return e.objectPropNodeClassUri!==N})).attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),x.attr("x",(function(e){return e.target.x>e.source.x?e.source.x+(e.target.x-e.source.x)/2:e.target.x+(e.source.x-e.target.x)/2})).attr("y",(function(e){return e.target.y>e.source.y?e.source.y+(e.target.y-e.source.y)/2:e.target.y+(e.source.y-e.target.y)/2})).moveToFront(),L.attr("x",(function(e){return"right"===e.classPosition?e.x+1200/110*1.2:e.x-1200/110*1.2})).attr("y",(function(e){return e.y})).moveToFront()})).linkDistance(1200/3.5).start()}}))}(p)}),50);p.$on("$destroy",(function(){u.cancel(d)}))}}}angular.module("graphdb.framework.graphexplore.directives.domainrange",["graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.utils.localstorageadapter"]).constant("ONTO_RED","var(--primary-color)").constant("ONTO_GREEN","var(--tertiary-color)").constant("ONTO_BLUE","var(--secondary-color)").constant("NON_COLLAPSED_REFLEXIVE_LINK_LIMIT",6).directive("domainRangeGraph",o),o.$inject=["$rootScope","$window","$repositories","GraphDataRestService","$location","LocalStorageAdapter","LSKeys","$timeout","toastr","ONTO_RED","ONTO_GREEN","ONTO_BLUE","NON_COLLAPSED_REFLEXIVE_LINK_LIMIT"]},111:function(e,t){function n(e,t){return{restrict:"A",scope:{},templateUrl:"js/angular/graphexplore/templates/systemRepoWarningTemplate.html",link:function(n){n.isSystemRepository=function(){return"SYSTEM"===e.getActiveRepository()},n.hasPermission=function(){return t.hasPermission()}}}}angular.module("graphdb.framework.graphexplore.directives.sysrepo",["graphdb.framework.graphexplore.controllers.class"]).directive("systemRepoWarning",n),n.$inject=["$repositories","$rootScope"]},112:function(e,t){function n(e){return{restrict:"AE",scope:{rdfsLabel:"=",rdfsComment:"=",expanded:"=",alwaysExpanded:"="},templateUrl:"js/angular/graphexplore/templates/rdfsCommentLabelTemplate.html",link:function(t,n){t.stringLimit=e,t.scrollToTop=function(){n[0].getElementsByClassName("rdfs-comment")[0].scrollTop=0},t.checkCommentLength=function(){return n[0].getElementsByClassName("rdfs-comment-text")[0].innerText.length<e},t.equalHeights=function(){const e=n[0].getElementsByClassName("rdfs-comment-text")[0].innerHeight;e<250&&t.expanded&&(n[0].getElementsByClassName("rdfs-comment")[0].innerHeight=e)},t.toggleFullComment=function(){t.expanded=!t.expanded},t.$watch("expanded || alwaysExpanded",(function(n){t.stringLimit=n?t.rdfsComment.length:e}))}}}angular.module("graphdb.framework.graphexplore.directives.rdfsdetails",[]).directive("rdfsCommentLabel",n).constant("SHORT_COMMENT_LENGTH",100),n.$inject=["SHORT_COMMENT_LENGTH"]},113:function(e,t,n){"use strict";n.r(t);var r=n(302);n(84);function i(e,t){return{restrict:"A",template:'<div id="dependencies-chord"></div>',scope:{dependenciesData:"="},link:function(n){n.$watch("dependenciesData",(function(){if(n.dependenciesData){const i=n.dependenciesData;!function(i,o){if(function(){let e=!0;for(const t of i){if(t.some(e=>0!==e)){e=!1;break}}return e}())return;const s=d3.scale.category20(),a=d3.select("body").append("div").attr("class","tooltip").style("opacity",0);d3.select("body").on("click",(function(){a.style("opacity",0)}));const l=Math.min(800,800)/2.8,u=l-24,c=d3.svg.arc().innerRadius(u).outerRadius(l),p=d3.layout.chord().padding(.04).sortSubgroups(d3.descending).sortChords(d3.ascending),d=d3.svg.chord().radius(u),f=d3.select("#dependencies-chord").append("svg").attr("viewBox","0 0 800 800").attr("preserveAspectRatio","xMidYMid meet").style("font","10px sans-serif").append("g").attr("id","circle").attr("transform","translate(400,400)");f.append("circle").attr("r",l).style("fill","none"),p.matrix(i);const h=f.selectAll(".group").data(p.groups).enter().append("g").attr("class","group").on("mouseover",(function(e,t){g.classed("fade",(function(e){return e.source.index!==t&&e.target.index!==t}))}));h.append("title").text((function(e,t){return o[t]})),h.append("path").attr("id",(function(e,t){return"group"+t})).attr("d",c).style("fill",(function(e,t){return s(t)})),h.append("text").each((function(e){e.angle=(e.startAngle+e.endAngle)/2})).attr("dy",".35em").attr("transform",(function(e){return"rotate("+(180*e.angle/Math.PI-90)+")translate("+(u+26)+")"+(e.angle>Math.PI?"rotate(180)":"")})).style("text-anchor",(function(e){return e.angle>Math.PI?"end":null})).text((function(e){return o[e.index]}));const g=f.selectAll(".chord").data(p.chords).enter().append("path").attr("class","chord").style("fill",(function(e){return s(e.target.index)})).style("fill-opacity",".67").style("stroke","#000").style("stroke-width",".25px").style("cursor","pointer").attr("d",d);g.on("mouseover",(function(){d3.select(this).style({"fill-opacity":"1"})})),g.on("mouseout",(function(){d3.select(this).style({"fill-opacity":".67"})})),g.on("click",(function(e){const r=o[e.source.index],i=o[e.target.index],s=d3.event.pageX,l=d3.event.pageY;t.getPredicates(r,i,n.selectedGraph&&n.selectedGraph.contextID.uri).success((function(e){let t="<div class='dependencies-tooltip'>"+("<div class='row'>"+r+" <i class='fa fa-exchange'></i> "+i+"</div>")+_.map(e.slice(0,10),(function(e){const t=" <i class='fa fa-long-arrow-"+("out"===e.direction?"right":"left")+"'></i>";return"<div class='row'>"+e.predicate+" : "+e.weight+t+" </div>"})).join("");e.length>10?t=t+"<div class='pull-right'>And "+(e.length-10).toString()+" more...</div></div>":t+="</div>",a.html(t).style("left",s+"px").style("top",l+"px")})),a.transition().duration(200).style("opacity",1)})),d3.select("#circle").on("mouseleave",(function(){f.selectAll(".chord").classed("fade",!1)})),d3.select("#download-svg").on("mouseover",(function(){const t=r.a.Export.generateBase64ImageSource(".dependencies-chord svg");d3.select(this).attr({href:t,download:"dependencies-"+e.getActiveRepository()+".svg"})}))}(i.matrix,i.nodes,i.direction)}}))}}}angular.module("graphdb.framework.graphexplore.directives.dependencies",["graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.rest.graphexplore.data.service"]).directive("dependenciesChord",i),i.$inject=["$repositories","GraphDataRestService"]},114:function(e,t){function n(){return{restrict:"AE",scope:{filterQueryObj:"=",filterFunction:"&",listItemsObj:"=",listItemsNotFiltered:"=",searchPlaceholder:"@"},templateUrl:"js/angular/graphexplore/templates/listItemsSearchFilterTemplate.html",link:function(e){e.filterFunction=e.filterFunction(),e.$watch("filterQueryObj.query",(function(){var t,n,r,i;e.listItemsObj.items=(t=e.filterQueryObj.query,n=e.listItemsObj.items,r=e.listItemsNotFiltered,i=e.filterFunction,t.length>0?_.filter(r,i):n.length!==r.length?r:n)}))}}}angular.module("graphdb.framework.graphexplore.directives.searchfilter",[]).directive("listItemsSearchFilter",n),n.$inject=[]},115:function(e,t){function n(e,t){return{restrict:"AE",scope:{searchData:"=",searchFields:"@",titleField:"@",searchPlaceholder:"@",initialValue:"=",searchedObjCallback:"&"},templateUrl:"js/angular/graphexplore/templates/searchIconInputTemplate.html",link:function(n,r){n.searchedObjCallback=n.searchedObjCallback(),n.performSearchActionOnEnter=function(){e.$broadcast("onEnterKeypressSearchAction")},n.showInput=function(){$("#selectGraphDropdown").hide(),r.find("#search_input #search_input_value")[0].value="",r.find(".search-icon").addClass("animated bounceOut").css("z-index","-1"),r.find("#search_input .angucomplete-holder").css("display","block"),t((function(){r.find("#search_input .angucomplete-holder").css("width","250px").css("left","-215px"),t((function(){r.find(".close-icon").css("display","block").addClass("animated bounceIn").css("z-index","3"),r.find("#search_input #search_input_value").focus()}),200)}),1)},n.hideInput=function(){r.find("#search_input #search_input_value")[0].value="",r.find("#search_input .angucomplete-holder").css("width","0px").css("left","35px"),t((function(){r.find("#search_input .angucomplete-holder").css("display","none"),$("#selectGraphDropdown").show()}),250),r.find(".close-icon").addClass("animated bounceOut").removeClass("bounceOut").css("z-index","-1").css("display","none").click((function(){$(".tooltip").hide()})),t((function(){r.find(".search-icon").css("display","inline-block").removeClass("bounceOut").addClass("bounceIn").css("z-index","3")}),200)}}}}angular.module("graphdb.framework.graphexplore.directives.searchcontrols",[]).directive("searchIconInput",n),n.$inject=["$rootScope","$timeout"]},152:function(e,t,n){"use strict";n.r(t);n(7),n(29),n(23),n(22),n(315),n(316),n(297),n(304),n(298),n(311),n(317),n(318),n(307),n(301),n(308),n(302),n(84),n(100),n(101),n(102),n(103),n(104),n(105),n(106),n(107),n(108),n(109),n(110),n(111),n(112),n(113),n(114),n(115),n(63),n(83);angular.module("graphdb.framework.graphexplore",["graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.graphexplore.data.service","graphdb.framework.graphexplore.services.uiscroll","graphdb.framework.graphexplore.services.rdfsdetails","graphdb.framework.rest.graphexplore.savedgraphs.service","graphdb.framework.rest.graphconfig.service","graphdb.framework.graphexplore.controllers.class","graphdb.framework.graphexplore.controllers.domainrange","graphdb.framework.graphexplore.controllers.dependencies","graphdb.framework.graphexplore.controllers.graphviz","graphdb.framework.graphexplore.controllers.graphviz.config","graphdb.framework.graphexplore.directives.sysrepo","graphdb.framework.graphexplore.directives.rdfsdetails","graphdb.framework.graphexplore.directives.searchfilter","graphdb.framework.graphexplore.directives.class","graphdb.framework.graphexplore.directives.domainrange","graphdb.framework.graphexplore.directives.dependencies","graphdb.framework.graphexplore.directives.searchcontrols","graphdb.framework.core.directives.queryeditor.controllers","graphdb.framework.core.directives.queryeditor.queryeditor"])},298:function(e,t,n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){return function(){var e=function(){return"n"},t=function(){return[0,0]},n=function(){return" "},r=p(),i=null,o=null,s=null,a=null;function l(e){var t;i="svg"===(t=(t=e).node()).tagName.toLowerCase()?t:t.ownerSVGElement,o=i.createSVGPoint(),document.body.appendChild(r)}l.show=function(){var r=Array.prototype.slice.call(arguments);r[r.length-1]instanceof SVGElement&&(s=r.pop());var i,o=n.apply(this,r),p=t.apply(this,r),f=e.apply(this,r),h=d(),g=c.length,m=document.documentElement.scrollTop||document.body.scrollTop,v=document.documentElement.scrollLeft||document.body.scrollLeft,E=a.apply(this,r);for(h.html(o).style({opacity:1,"pointer-events":"all"});g--;)h.classed(c[g],!1);return i=u.get(f).apply(this),E?h.style(E):h.classed(f,!0).style({top:i.top+p[0]+m+"px",left:i.left+p[1]+v+"px"}),l},l.hide=function(){return d().style({opacity:0,"pointer-events":"none"}),l},l.attr=function(e,t){if(arguments.length<2&&"string"==typeof e)return d().attr(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.attr.apply(d(),n),l},l.style=function(e,t){if(arguments.length<2&&"string"==typeof e)return d().style(e);var n=Array.prototype.slice.call(arguments);return d3.selection.prototype.style.apply(d(),n),l},l.direction=function(t){return arguments.length?(e=null==t?t:d3.functor(t),l):e},l.offset=function(e){return arguments.length?(t=null==e?e:d3.functor(e),l):t},l.html=function(e){return arguments.length?(n=null==e?e:d3.functor(e),l):n},l.customPosition=function(e){return arguments.length?(a=null==e?e:d3.functor(e),l):a},l.destroy=function(){return r&&(d().remove(),r=null),l};var u=d3.map({n:function(){var e=f();return{top:e.n.y-r.offsetHeight,left:e.n.x-r.offsetWidth/2}},s:function(){var e=f();return{top:e.s.y,left:e.s.x-r.offsetWidth/2}},e:function(){var e=f();return{top:e.e.y-r.offsetHeight/2,left:e.e.x}},w:function(){var e=f();return{top:e.w.y-r.offsetHeight/2,left:e.w.x-r.offsetWidth}},nw:function(){var e=f();return{top:e.nw.y-r.offsetHeight,left:e.nw.x-r.offsetWidth}},ne:function(){var e=f();return{top:e.ne.y-r.offsetHeight,left:e.ne.x}},sw:function(){var e=f();return{top:e.sw.y,left:e.sw.x-r.offsetWidth}},se:function(){var e=f();return{top:e.se.y,left:e.e.x}}}),c=u.keys();function p(){var e=d3.select(document.createElement("div"));return e.style({position:"absolute",top:0,opacity:0,"pointer-events":"none","box-sizing":"border-box"}),e.node()}function d(){return null===r&&(r=p(),document.body.appendChild(r)),d3.select(r)}function f(){for(var e=s||d3.event.target;void 0===e.getScreenCTM&&"undefined"===e.parentNode;)e=e.parentNode;var t={},n=e.getScreenCTM(),r=e.getBBox(),i=r.width,a=r.height,l=r.x,u=r.y;return o.x=l,o.y=u,t.nw=o.matrixTransform(n),o.x+=i,t.ne=o.matrixTransform(n),o.y+=a,t.se=o.matrixTransform(n),o.x-=i,t.sw=o.matrixTransform(n),o.y-=a/2,t.w=o.matrixTransform(n),o.x+=i,t.e=o.matrixTransform(n),o.x-=i/2,o.y-=a/2,t.n=o.matrixTransform(n),o.y+=a,t.s=o.matrixTransform(n),t}return l}})?r.apply(t,i):r)||(e.exports=o)},301:function(e,t,n){"use strict";var r=r||{};r.Text=function(){function e(e,t,n,r){n=n||10;var i=t/3;return"string"==typeof e?(i*=10/(e.substring(0,t/3).length+1.5),i+=1,e.match(/[\u0900-\u0DFF\u1100-\u11FF\u2E80-\u2EFF\u3000-\u9FFF]/)&&(i*=.6),i<n&&(i=n),Math.round(i)):(i<n&&(i=n),Math.round(i))}return{calcFontSizeRaw:e,calcFontSize:function(t,n,r,i){return e(t,n,r)+"px"},getTextWithElipsisIfNeeded:function(e,t){return"string"==typeof e&&e.length>t?e.substring(0,t-3)+"...":e}}}(),r.Transition={fadeIn:function(e,t){e.style("opacity",0).transition().duration(t).style("opacity",1)},fadeOut:function(e,t){e.style("opacity",1).transition().duration(t).style("opacity",0)}},r.Click={delayDblClick:function(){var e=d3.dispatch("click","dblclick");return d3.rebind((function(t){var n,r=null;t.on("mousedown",(function(){n=d3.mouse(document.body),new Date})),t.on("mouseup",(function(t){var i,o;i=n,o=d3.mouse(document.body),Math.sqrt(Math.pow(i[0]-o[0],2),Math.pow(i[1]-o[1],2))>5||(r?(window.clearTimeout(r),r=null,e.dblclick(t)):r=window.setTimeout((d3.event,function(){e.click(t),r=null}),250))}))}),e,"on")}},t.a=r},302:function(e,t,n){"use strict";var r=n(297),i=i||{};i.Export={getCSSRules:function(e){const t=$('link[href="'+e+'"]')[0].sheet.rules;let n="";return _.each(t,(function(e){n+=e.cssText})),n},generateBase64ImageSource:function(e){e||(e="svg");const t=r.selectAll(e).attr("version","1.1").attr("xmlns","http://www.w3.org/2000/svg").node().parentNode.innerHTML;return"data:image/svg+xml;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(t)))}},t.a=i},303:function(e,t,n){var r,i=i||function(e){"use strict";if("undefined"==typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),i=e.webkitRequestFileSystem,o=e.requestFileSystem||i||e.mozRequestFileSystem,s=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},a=0,l=function(t){var r=function(){"string"==typeof t?n().revokeObjectURL(t):t.remove()};e.chrome?r():setTimeout(r,500)},u=function(e,t,n){for(var r=(t=[].concat(t)).length;r--;){var i=e["on"+t[r]];if("function"==typeof i)try{i.call(e,n||e)}catch(e){s(e)}}},c=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e},p=function(t,s){t=c(t);var p,d,f,h=this,g=t.type,m=!1,v=function(){u(h,"writestart progress write writeend".split(" "))},E=function(){(!m&&p||(p=n().createObjectURL(t)),d)?d.location.href=p:null==e.open(p,"_blank")&&"undefined"!=typeof safari&&(e.location.href=p);h.readyState=h.DONE,v(),l(p)},x=function(e){return function(){if(h.readyState!==h.DONE)return e.apply(this,arguments)}},y={create:!0,exclusive:!1};if(h.readyState=h.INIT,s||(s="download"),r)return p=n().createObjectURL(t),r.href=p,r.download=s,void setTimeout((function(){var e,t;e=r,t=new MouseEvent("click"),e.dispatchEvent(t),v(),l(p),h.readyState=h.DONE}));e.chrome&&g&&"application/octet-stream"!==g&&(f=t.slice||t.webkitSlice,t=f.call(t,0,t.size,"application/octet-stream"),m=!0),i&&"download"!==s&&(s+=".download"),("application/octet-stream"===g||i)&&(d=e),o?(a+=t.size,o(e.TEMPORARY,a,x((function(e){e.root.getDirectory("saved",y,x((function(e){var n=function(){e.getFile(s,y,x((function(e){e.createWriter(x((function(n){n.onwriteend=function(t){d.location.href=e.toURL(),h.readyState=h.DONE,u(h,"writeend",t),l(e)},n.onerror=function(){var e=n.error;e.code!==e.ABORT_ERR&&E()},"writestart progress write abort".split(" ").forEach((function(e){n["on"+e]=h["on"+e]})),n.write(t),h.abort=function(){n.abort(),h.readyState=h.DONE},h.readyState=h.WRITING})),E)})),E)};e.getFile(s,{create:!1},x((function(e){e.remove(),n()})),x((function(e){e.code===e.NOT_FOUND_ERR?n():E()})))})),E)})),E)):E()},d=p.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t){return navigator.msSaveOrOpenBlob(c(e),t)}:(d.abort=function(){this.readyState=this.DONE,u(this,"abort")},d.readyState=d.INIT=0,d.WRITING=1,d.DONE=2,d.error=d.onwritestart=d.onprogress=d.onwrite=d.onabort=d.onerror=d.onwriteend=null,function(e,t){return new p(e,t)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content);
2
2
  /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */e.exports?e.exports.saveAs=i:null!==n(299)&&null!=n(300)&&(void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r))},304:function(e,t,n){var r,i;!function(){var o={version:"3.5.12"},s=[].slice,a=function(e){return s.call(e)},l=this.document;function u(e){return e&&(e.ownerDocument||e.document||e).documentElement}function c(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(l)try{a(l.documentElement.childNodes)[0].nodeType}catch(e){a=function(e){for(var t=e.length,n=new Array(t);t--;)n[t]=e[t];return n}}if(Date.now||(Date.now=function(){return+new Date}),l)try{l.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var p=this.Element.prototype,d=p.setAttribute,f=p.setAttributeNS,h=this.CSSStyleDeclaration.prototype,g=h.setProperty;p.setAttribute=function(e,t){d.call(this,e,t+"")},p.setAttributeNS=function(e,t,n){f.call(this,e,t,n+"")},h.setProperty=function(e,t,n){g.call(this,e,t+"",n)}}function m(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function v(e){return null===e?NaN:+e}function E(e){return!isNaN(e)}function x(e){return{left:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}o.ascending=m,o.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},o.min=function(e,t){var n,r,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=e[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=e[i])&&n>r&&(n=r)}else{for(;++i<o;)if(null!=(r=t.call(e,e[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=t.call(e,e[i],i))&&n>r&&(n=r)}return n},o.max=function(e,t){var n,r,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=e[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=e[i])&&r>n&&(n=r)}else{for(;++i<o;)if(null!=(r=t.call(e,e[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=t.call(e,e[i],i))&&r>n&&(n=r)}return n},o.extent=function(e,t){var n,r,i,o=-1,s=e.length;if(1===arguments.length){for(;++o<s;)if(null!=(r=e[o])&&r>=r){n=i=r;break}for(;++o<s;)null!=(r=e[o])&&(n>r&&(n=r),i<r&&(i=r))}else{for(;++o<s;)if(null!=(r=t.call(e,e[o],o))&&r>=r){n=i=r;break}for(;++o<s;)null!=(r=t.call(e,e[o],o))&&(n>r&&(n=r),i<r&&(i=r))}return[n,i]},o.sum=function(e,t){var n,r=0,i=e.length,o=-1;if(1===arguments.length)for(;++o<i;)E(n=+e[o])&&(r+=n);else for(;++o<i;)E(n=+t.call(e,e[o],o))&&(r+=n);return r},o.mean=function(e,t){var n,r=0,i=e.length,o=-1,s=i;if(1===arguments.length)for(;++o<i;)E(n=v(e[o]))?r+=n:--s;else for(;++o<i;)E(n=v(t.call(e,e[o],o)))?r+=n:--s;if(s)return r/s},o.quantile=function(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],o=n-r;return o?i+o*(e[r]-i):i},o.median=function(e,t){var n,r=[],i=e.length,s=-1;if(1===arguments.length)for(;++s<i;)E(n=v(e[s]))&&r.push(n);else for(;++s<i;)E(n=v(t.call(e,e[s],s)))&&r.push(n);if(r.length)return o.quantile(r.sort(m),.5)},o.variance=function(e,t){var n,r,i=e.length,o=0,s=0,a=-1,l=0;if(1===arguments.length)for(;++a<i;)E(n=v(e[a]))&&(s+=(r=n-o)*(n-(o+=r/++l)));else for(;++a<i;)E(n=v(t.call(e,e[a],a)))&&(s+=(r=n-o)*(n-(o+=r/++l)));if(l>1)return s/(l-1)},o.deviation=function(){var e=o.variance.apply(this,arguments);return e?Math.sqrt(e):e};var y=x(m);function T(e){return e.length}o.bisectLeft=y.left,o.bisect=o.bisectRight=y.right,o.bisector=function(e){return x(1===e.length?function(t,n){return m(e(t),n)}:e)},o.shuffle=function(e,t,n){(o=arguments.length)<3&&(n=e.length,o<2&&(t=0));for(var r,i,o=n-t;o;)i=Math.random()*o--|0,r=e[o+t],e[o+t]=e[i+t],e[i+t]=r;return e},o.permute=function(e,t){for(var n=t.length,r=new Array(n);n--;)r[n]=e[t[n]];return r},o.pairs=function(e){for(var t=0,n=e.length-1,r=e[0],i=new Array(n<0?0:n);t<n;)i[t]=[r,r=e[++t]];return i},o.zip=function(){if(!(r=arguments.length))return[];for(var e=-1,t=o.min(arguments,T),n=new Array(t);++e<t;)for(var r,i=-1,s=n[e]=new Array(r);++i<r;)s[i]=arguments[i][e];return n},o.transpose=function(e){return o.zip.apply(o,e)},o.keys=function(e){var t=[];for(var n in e)t.push(n);return t},o.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},o.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},o.merge=function(e){for(var t,n,r,i=e.length,o=-1,s=0;++o<i;)s+=e[o].length;for(n=new Array(s);--i>=0;)for(t=(r=e[i]).length;--t>=0;)n[--s]=r[t];return n};var N=Math.abs;function C(e){for(var t=1;e*t%1;)t*=10;return t}function S(e,t){for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}function I(){this._=Object.create(null)}o.range=function(e,t,n){if(arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0)),(t-e)/n==1/0)throw new Error("infinite range");var r,i=[],o=C(N(n)),s=-1;if(e*=o,t*=o,(n*=o)<0)for(;(r=e+n*++s)>t;)i.push(r/o);else for(;(r=e+n*++s)<t;)i.push(r/o);return i},o.map=function(e,t){var n=new I;if(e instanceof I)e.forEach((function(e,t){n.set(e,t)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(1===arguments.length)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t.call(e,r=e[i],i),r)}else for(var s in e)n.set(s,e[s]);return n};function L(e){return"__proto__"==(e+="")||"\0"===e[0]?"\0"+e:e}function A(e){return"\0"===(e+="")[0]?e.slice(1):e}function b(e){return L(e)in this._}function R(e){return(e=L(e))in this._&&delete this._[e]}function w(){var e=[];for(var t in this._)e.push(A(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 P(e){return e}function D(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}function k(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var n=0,r=F.length;n<r;++n){var i=F[n]+t;if(i in e)return i}}S(I,{has:b,get:function(e){return this._[L(e)]},set:function(e,t){return this._[L(e)]=t},remove:R,keys:w,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:A(t),value:this._[t]});return e},size:O,empty:M,forEach:function(e){for(var t in this._)e.call(this,A(t),this._[t])}}),o.nest=function(){var e,t,n={},r=[],i=[];function s(i,o,a){if(a>=r.length)return t?t.call(n,o):e?o.sort(e):o;for(var l,u,c,p,d=-1,f=o.length,h=r[a++],g=new I;++d<f;)(p=g.get(l=h(u=o[d])))?p.push(u):g.set(l,[u]);return i?(u=i(),c=function(e,t){u.set(e,s(i,t,a))}):(u={},c=function(e,t){u[e]=s(i,t,a)}),g.forEach(c),u}return n.map=function(e,t){return s(t,e,0)},n.entries=function(e){return function e(t,n){if(n>=r.length)return t;var o=[],s=i[n++];return t.forEach((function(t,r){o.push({key:t,values:e(r,n)})})),s?o.sort((function(e,t){return s(e.key,t.key)})):o}(s(o.map,e,0),0)},n.key=function(e){return r.push(e),n},n.sortKeys=function(e){return i[r.length-1]=e,n},n.sortValues=function(t){return e=t,n},n.rollup=function(e){return t=e,n},n},o.set=function(e){var t=new _;if(e)for(var n=0,r=e.length;n<r;++n)t.add(e[n]);return t},S(_,{has:b,add:function(e){return this._[L(e+="")]=!0,e},remove:R,values:w,size:O,empty:M,forEach:function(e){for(var t in this._)e.call(this,A(t))}}),o.behavior={},o.rebind=function(e,t){for(var n,r=1,i=arguments.length;++r<i;)e[n=arguments[r]]=D(e,t,t[n]);return e};var F=["webkit","ms","moz","Moz","o","O"];function G(){}function U(){}function B(e){var t=[],n=new I;function r(){for(var n,r=t,i=-1,o=r.length;++i<o;)(n=r[i].on)&&n.apply(this,arguments);return e}return r.on=function(r,i){var o,s=n.get(r);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 j(){o.event.preventDefault()}function V(){for(var e,t=o.event;e=t.sourceEvent;)t=e;return t}function H(e){for(var t=new U,n=0,r=arguments.length;++n<r;)t[arguments[n]]=B(t);return t.of=function(n,r){return function(i){try{var s=i.sourceEvent=o.event;i.target=e,o.event=i,t[i.type].apply(n,r)}finally{o.event=s}}},t}o.dispatch=function(){for(var e=new U,t=-1,n=arguments.length;++t<n;)e[arguments[t]]=B(e);return e},U.prototype.on=function(e,t){var n=e.indexOf("."),r="";if(n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),e)return arguments.length<2?this[e].on(r):this[e].on(r,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(r,null);return this}},o.event=null,o.requote=function(e){return e.replace(q,"\\$&")};var q=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,z={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]};function $(e){return z(e,X),e}var W=function(e,t){return t.querySelector(e)},Q=function(e,t){return t.querySelectorAll(e)},Y=function(e,t){var n=e.matches||e[k(e,"matchesSelector")];return(Y=function(e,t){return n.call(e,t)})(e,t)};"function"==typeof Sizzle&&(W=function(e,t){return Sizzle(e,t)[0]||null},Q=Sizzle,Y=Sizzle.matchesSelector),o.selection=function(){return o.select(l.documentElement)};var X=o.selection.prototype=[];function K(e){return"function"==typeof e?e:function(){return W(e,this)}}function Z(e){return"function"==typeof e?e:function(){return Q(e,this)}}X.select=function(e){var t,n,r,i,o=[];e=K(e);for(var s=-1,a=this.length;++s<a;){o.push(t=[]),t.parentNode=(r=this[s]).parentNode;for(var l=-1,u=r.length;++l<u;)(i=r[l])?(t.push(n=e.call(i,i.__data__,l,s)),n&&"__data__"in i&&(n.__data__=i.__data__)):t.push(null)}return $(o)},X.selectAll=function(e){var t,n,r=[];e=Z(e);for(var i=-1,o=this.length;++i<o;)for(var s=this[i],l=-1,u=s.length;++l<u;)(n=s[l])&&(r.push(t=a(e.call(n,n.__data__,l,i))),t.parentNode=n);return $(r)};var J={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/"};function ee(e,t){return e=o.ns.qualify(e),null==t?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof t?e.local?function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}:function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}:e.local?function(){this.setAttributeNS(e.space,e.local,t)}:function(){this.setAttribute(e,t)}}function te(e){return e.trim().replace(/\s+/g," ")}function ne(e){return new RegExp("(?:^|\\s+)"+o.requote(e)+"(?:\\s+|$)","g")}function re(e){return(e+"").trim().split(/^|\s+/)}function ie(e,t){var n=(e=re(e).map(oe)).length;return"function"==typeof t?function(){for(var r=-1,i=t.apply(this,arguments);++r<n;)e[r](this,i)}:function(){for(var r=-1;++r<n;)e[r](this,t)}}function oe(e){var t=ne(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",te(i+" "+e))):n.setAttribute("class",te(i.replace(t," ")))}}function se(e,t,n){return null==t?function(){this.style.removeProperty(e)}:"function"==typeof t?function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}:function(){this.style.setProperty(e,t,n)}}function ae(e,t){return null==t?function(){delete this[e]}:"function"==typeof t?function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}:function(){this[e]=t}}function le(e){return"function"==typeof e?e:(e=o.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,n=this.namespaceURI;return n?t.createElementNS(n,e):t.createElement(e)}}function ue(){var e=this.parentNode;e&&e.removeChild(this)}function ce(e){return{__data__:e}}function pe(e){return function(){return Y(this,e)}}function de(e){return arguments.length||(e=m),function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}}function fe(e,t){for(var n=0,r=e.length;n<r;n++)for(var i,o=e[n],s=0,a=o.length;s<a;s++)(i=o[s])&&t(i,s,n);return e}function he(e){return z(e,ge),e}o.ns={prefix:J,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&"xmlns"!==(n=e.slice(0,t))&&(e=e.slice(t+1)),J.hasOwnProperty(n)?{space:J[n],local:e}:e}},X.attr=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=o.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(t in e)this.each(ee(t,e[t]));return this}return this.each(ee(e,t))},X.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node(),r=(e=re(e)).length,i=-1;if(t=n.classList){for(;++i<r;)if(!t.contains(e[i]))return!1}else for(t=n.getAttribute("class");++i<r;)if(!ne(e[i]).test(t))return!1;return!0}for(t in e)this.each(ie(t,e[t]));return this}return this.each(ie(e,t))},X.style=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=""),e)this.each(se(n,e[n],t));return this}if(r<2){var i=this.node();return c(i).getComputedStyle(i,null).getPropertyValue(e)}n=""}return this.each(se(e,t,n))},X.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(ae(t,e[t]));return this}return this.each(ae(e,t))},X.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},X.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},X.append=function(e){return e=le(e),this.select((function(){return this.appendChild(e.apply(this,arguments))}))},X.insert=function(e,t){return e=le(e),t=K(t),this.select((function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)}))},X.remove=function(){return this.each(ue)},X.data=function(e,t){var n,r,i=-1,o=this.length;if(!arguments.length){for(e=new Array(o=(n=this[0]).length);++i<o;)(r=n[i])&&(e[i]=r.__data__);return e}function s(e,n){var r,i,o,s=e.length,c=n.length,p=Math.min(s,c),d=new Array(c),f=new Array(c),h=new Array(s);if(t){var g,m=new I,v=new Array(s);for(r=-1;++r<s;)(i=e[r])&&(m.has(g=t.call(i,i.__data__,r))?h[r]=i:m.set(g,i),v[r]=g);for(r=-1;++r<c;)(i=m.get(g=t.call(n,o=n[r],r)))?!0!==i&&(d[r]=i,i.__data__=o):f[r]=ce(o),m.set(g,!0);for(r=-1;++r<s;)r in v&&!0!==m.get(v[r])&&(h[r]=e[r])}else{for(r=-1;++r<p;)i=e[r],o=n[r],i?(i.__data__=o,d[r]=i):f[r]=ce(o);for(;r<c;++r)f[r]=ce(n[r]);for(;r<s;++r)h[r]=e[r]}f.update=d,f.parentNode=d.parentNode=h.parentNode=e.parentNode,a.push(f),l.push(d),u.push(h)}var a=he([]),l=$([]),u=$([]);if("function"==typeof e)for(;++i<o;)s(n=this[i],e.call(n,n.parentNode.__data__,i));else for(;++i<o;)s(n=this[i],e);return l.enter=function(){return a},l.exit=function(){return u},l},X.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},X.filter=function(e){var t,n,r,i=[];"function"!=typeof e&&(e=pe(e));for(var o=0,s=this.length;o<s;o++){i.push(t=[]),t.parentNode=(n=this[o]).parentNode;for(var a=0,l=n.length;a<l;a++)(r=n[a])&&e.call(r,r.__data__,a,o)&&t.push(r)}return $(i)},X.order=function(){for(var e=-1,t=this.length;++e<t;)for(var n,r=this[e],i=r.length-1,o=r[i];--i>=0;)(n=r[i])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},X.sort=function(e){e=de.apply(this,arguments);for(var t=-1,n=this.length;++t<n;)this[t].sort(e);return this.order()},X.each=function(e){return fe(this,(function(t,n,r){e.call(t,t.__data__,n,r)}))},X.call=function(e){var t=a(arguments);return e.apply(t[0]=this,t),this},X.empty=function(){return!this.node()},X.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 o=n[r];if(o)return o}return null},X.size=function(){var e=0;return fe(this,(function(){++e})),e};var ge=[];function me(e){var t,n;return function(r,i,o){var s,a=e[o].update,l=a.length;for(o!=n&&(n=o,t=0),i>=t&&(t=i+1);!(s=a[t])&&++t<l;);return s}}function ve(e,t,n){var r="__on"+e,i=e.indexOf("."),s=xe;i>0&&(e=e.slice(0,i));var l=Ee.get(e);function u(){var t=this[r];t&&(this.removeEventListener(e,t,t.$),delete this[r])}return l&&(e=l,s=ye),i?t?function(){var i=s(t,a(arguments));u.call(this),this.addEventListener(e,this[r]=i,i.$=n),i._=t}:u:t?G:function(){var t,n=new RegExp("^__on([^.]+)"+o.requote(e)+"$");for(var r in this)if(t=r.match(n)){var i=this[r];this.removeEventListener(t[1],i,i.$),delete this[r]}}}o.selection.enter=he,o.selection.enter.prototype=ge,ge.append=X.append,ge.empty=X.empty,ge.node=X.node,ge.call=X.call,ge.size=X.size,ge.select=function(e){for(var t,n,r,i,o,s=[],a=-1,l=this.length;++a<l;){r=(i=this[a]).update,s.push(t=[]),t.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(o=i[u])?(t.push(r[u]=n=e.call(i.parentNode,o.__data__,u,a)),n.__data__=o.__data__):t.push(null)}return $(s)},ge.insert=function(e,t){return arguments.length<2&&(t=me(this)),X.insert.call(this,e,t)},o.select=function(e){var t;return"string"==typeof e?(t=[W(e,l)]).parentNode=l.documentElement:(t=[e]).parentNode=u(e),$([t])},o.selectAll=function(e){var t;return"string"==typeof e?(t=a(Q(e,l))).parentNode=l.documentElement:(t=a(e)).parentNode=null,$([t])},X.on=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=!1),e)this.each(ve(n,e[n],t));return this}if(r<2)return(r=this.node()["__on"+e])&&r._;n=!1}return this.each(ve(e,t,n))};var Ee=o.map({mouseenter:"mouseover",mouseleave:"mouseout"});function xe(e,t){return function(n){var r=o.event;o.event=n,t[0]=this.__data__;try{e.apply(this,t)}finally{o.event=r}}}function ye(e,t){var n=xe(e,t);return function(e){var t=e.relatedTarget;t&&(t===this||8&t.compareDocumentPosition(this))||n.call(this,e)}}l&&Ee.forEach((function(e){"on"+e in l&&Ee.remove(e)}));var Te,Ne=0;function Ce(e){var t=".dragsuppress-"+ ++Ne,n="click"+t,r=o.select(c(e)).on("touchmove"+t,j).on("dragstart"+t,j).on("selectstart"+t,j);if(null==Te&&(Te=!("onselectstart"in e)&&k(e.style,"userSelect")),Te){var i=u(e).style,s=i[Te];i[Te]="none"}return function(e){if(r.on(t,null),Te&&(i[Te]=s),e){var o=function(){r.on(n,null)};r.on(n,(function(){j(),o()}),!0),setTimeout(o,0)}}}o.mouse=function(e){return Ie(e,V())};var Se=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ie(e,t){t.changedTouches&&(t=t.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();if(Se<0){var i=c(e);if(i.scrollX||i.scrollY){var s=(n=o.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();Se=!(s.f||s.e),n.remove()}}return Se?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}var a=e.getBoundingClientRect();return[t.clientX-a.left-e.clientLeft,t.clientY-a.top-e.clientTop]}function Le(){return o.event.changedTouches[0].identifier}o.touch=function(e,t,n){if(arguments.length<3&&(n=t,t=V().changedTouches),t)for(var r,i=0,o=t.length;i<o;++i)if((r=t[i]).identifier===n)return Ie(e,r)},o.behavior.drag=function(){var e=H(i,"drag","dragstart","dragend"),t=null,n=s(G,o.mouse,c,"mousemove","mouseup"),r=s(Le,o.touch,P,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",r)}function s(n,r,i,s,a){return function(){var l,u=this,c=o.event.target,p=u.parentNode,d=e.of(u,arguments),f=0,h=n(),g=".drag"+(null==h?"":"-"+h),m=o.select(i(c)).on(s+g,x).on(a+g,y),v=Ce(c),E=r(p,h);function x(){var e,t,n=r(p,h);n&&(e=n[0]-E[0],t=n[1]-E[1],f|=e|t,E=n,d({type:"drag",x:n[0]+l[0],y:n[1]+l[1],dx:e,dy:t}))}function y(){r(p,h)&&(m.on(s+g,null).on(a+g,null),v(f),d({type:"dragend"}))}l=t?[(l=t.apply(u,arguments)).x-E[0],l.y-E[1]]:[0,0],d({type:"dragstart"})}}return i.origin=function(e){return arguments.length?(t=e,i):t},o.rebind(i,e,"on")},o.touches=function(e,t){return arguments.length<2&&(t=V().touches),t?a(t).map((function(t){var n=Ie(e,t);return n.identifier=t.identifier,n})):[]};var Ae=1e-6,be=1e-12,Re=Math.PI,we=2*Re,Oe=we-Ae,Me=Re/2,_e=Re/180,Pe=180/Re;function De(e){return e>0?1:e<0?-1:0}function ke(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function Fe(e){return e>1?0:e<-1?Re:Math.acos(e)}function Ge(e){return e>1?Me:e<-1?-Me:Math.asin(e)}function Ue(e){return((e=Math.exp(e))+1/e)/2}function Be(e){return(e=Math.sin(e/2))*e}var je=Math.SQRT2;o.interpolateZoom=function(e,t){var n,r,i=e[0],o=e[1],s=e[2],a=t[0],l=t[1],u=t[2],c=a-i,p=l-o,d=c*c+p*p;if(d<be)r=Math.log(u/s)/je,n=function(e){return[i+e*c,o+e*p,s*Math.exp(je*e*r)]};else{var f=Math.sqrt(d),h=(u*u-s*s+4*d)/(2*s*2*f),g=(u*u-s*s-4*d)/(2*u*2*f),m=Math.log(Math.sqrt(h*h+1)-h),v=Math.log(Math.sqrt(g*g+1)-g);r=(v-m)/je,n=function(e){var t,n=e*r,a=Ue(m),l=s/(2*f)*(a*(t=je*n+m,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(m));return[i+l*c,o+l*p,s*a/Ue(je*n+m)]}}return n.duration=1e3*r,n},o.behavior.zoom=function(){var e,t,n,r,i,s,a,u,p,d={x:0,y:0,k:1},f=[960,500],h=qe,g=250,m=0,v="mousedown.zoom",E="mousemove.zoom",x="mouseup.zoom",y="touchstart.zoom",T=H(N,"zoomstart","zoom","zoomend");function N(e){e.on(v,O).on(He+".zoom",_).on("dblclick.zoom",P).on(y,M)}function C(e){return[(e[0]-d.x)/d.k,(e[1]-d.y)/d.k]}function S(e){d.k=Math.max(h[0],Math.min(h[1],e))}function I(e,t){t=function(e){return[e[0]*d.k+d.x,e[1]*d.k+d.y]}(t),d.x+=e[0]-t[0],d.y+=e[1]-t[1]}function L(e,n,r,i){e.__chart__={x:d.x,y:d.y,k:d.k},S(Math.pow(2,i)),I(t=n,r),e=o.select(e),g>0&&(e=e.transition().duration(g)),e.call(N.event)}function A(){a&&a.domain(s.range().map((function(e){return(e-d.x)/d.k})).map(s.invert)),p&&p.domain(u.range().map((function(e){return(e-d.y)/d.k})).map(u.invert))}function b(e){m++||e({type:"zoomstart"})}function R(e){A(),e({type:"zoom",scale:d.k,translate:[d.x,d.y]})}function w(e){--m||(e({type:"zoomend"}),t=null)}function O(){var e=this,t=T.of(e,arguments),n=0,r=o.select(c(e)).on(E,a).on(x,l),i=C(o.mouse(e)),s=Ce(e);function a(){n=1,I(o.mouse(e),i),R(t)}function l(){r.on(E,null).on(x,null),s(n),w(t)}ya.call(e),b(t)}function M(){var e,t=this,n=T.of(t,arguments),r={},s=0,a=".zoom-"+o.event.changedTouches[0].identifier,l="touchmove"+a,u="touchend"+a,c=[],p=o.select(t),f=Ce(t);function h(){var n=o.touches(t);return e=d.k,n.forEach((function(e){e.identifier in r&&(r[e.identifier]=C(e))})),n}function g(){var e=o.event.target;o.select(e).on(l,m).on(u,E),c.push(e);for(var n=o.event.changedTouches,a=0,p=n.length;a<p;++a)r[n[a].identifier]=null;var f=h(),g=Date.now();if(1===f.length){if(g-i<500){var v=f[0];L(t,v,r[v.identifier],Math.floor(Math.log(d.k)/Math.LN2)+1),j()}i=g}else if(f.length>1){v=f[0];var x=f[1],y=v[0]-x[0],T=v[1]-x[1];s=y*y+T*T}}function m(){var a,l,u,c,p=o.touches(t);ya.call(t);for(var d=0,f=p.length;d<f;++d,c=null)if(u=p[d],c=r[u.identifier]){if(l)break;a=u,l=c}if(c){var h=(h=u[0]-a[0])*h+(h=u[1]-a[1])*h,g=s&&Math.sqrt(h/s);a=[(a[0]+u[0])/2,(a[1]+u[1])/2],l=[(l[0]+c[0])/2,(l[1]+c[1])/2],S(g*e)}i=null,I(a,l),R(n)}function E(){if(o.event.touches.length){for(var e=o.event.changedTouches,t=0,i=e.length;t<i;++t)delete r[e[t].identifier];for(var s in r)return void h()}o.selectAll(c).on(a,null),p.on(v,O).on(y,M),f(),w(n)}g(),b(n),p.on(v,null).on(y,g)}function _(){var i=T.of(this,arguments);r?clearTimeout(r):(ya.call(this),e=C(t=n||o.mouse(this)),b(i)),r=setTimeout((function(){r=null,w(i)}),50),j(),S(Math.pow(2,.002*Ve())*d.k),I(t,e),R(i)}function P(){var e=o.mouse(this),t=Math.log(d.k)/Math.LN2;L(this,e,C(e),o.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}return He||(He="onwheel"in l?(Ve=function(){return-o.event.deltaY*(o.event.deltaMode?120:1)},"wheel"):"onmousewheel"in l?(Ve=function(){return o.event.wheelDelta},"mousewheel"):(Ve=function(){return-o.event.detail},"MozMousePixelScroll")),N.event=function(e){e.each((function(){var e=T.of(this,arguments),n=d;Ca?o.select(this).transition().each("start.zoom",(function(){d=this.__chart__||{x:0,y:0,k:1},b(e)})).tween("zoom:zoom",(function(){var r=f[0],i=f[1],s=t?t[0]:r/2,a=t?t[1]:i/2,l=o.interpolateZoom([(s-d.x)/d.k,(a-d.y)/d.k,r/d.k],[(s-n.x)/n.k,(a-n.y)/n.k,r/n.k]);return function(t){var n=l(t),i=r/n[2];this.__chart__=d={x:s-n[0]*i,y:a-n[1]*i,k:i},R(e)}})).each("interrupt.zoom",(function(){w(e)})).each("end.zoom",(function(){w(e)})):(this.__chart__=d,b(e),R(e),w(e))}))},N.translate=function(e){return arguments.length?(d={x:+e[0],y:+e[1],k:d.k},A(),N):[d.x,d.y]},N.scale=function(e){return arguments.length?(d={x:d.x,y:d.y,k:null},S(+e),A(),N):d.k},N.scaleExtent=function(e){return arguments.length?(h=null==e?qe:[+e[0],+e[1]],N):h},N.center=function(e){return arguments.length?(n=e&&[+e[0],+e[1]],N):n},N.size=function(e){return arguments.length?(f=e&&[+e[0],+e[1]],N):f},N.duration=function(e){return arguments.length?(g=+e,N):g},N.x=function(e){return arguments.length?(a=e,s=e.copy(),d={x:0,y:0,k:1},N):a},N.y=function(e){return arguments.length?(p=e,u=e.copy(),d={x:0,y:0,k:1},N):p},o.rebind(N,T,"on")};var Ve,He,qe=[0,1/0];function ze(){}function $e(e,t,n){return this instanceof $e?(this.h=+e,this.s=+t,void(this.l=+n)):arguments.length<2?e instanceof $e?new $e(e.h,e.s,e.l):pt(""+e,dt,$e):new $e(e,t,n)}o.color=ze,ze.prototype.toString=function(){return this.rgb()+""},o.hsl=$e;var We=$e.prototype=new ze;function Qe(e,t,n){var r,i;function o(e){return Math.round(255*function(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}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,r=2*(n=n<0?0:n>1?1:n)-(i=n<=.5?n*(1+t):n+t-n*t),new st(o(e+120),o(e),o(e-120))}function Ye(e,t,n){return this instanceof Ye?(this.h=+e,this.c=+t,void(this.l=+n)):arguments.length<2?e instanceof Ye?new Ye(e.h,e.c,e.l):nt(e instanceof Ze?e.l:(e=ft((e=o.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ye(e,t,n)}We.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new $e(this.h,this.s,this.l/e)},We.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new $e(this.h,this.s,e*this.l)},We.rgb=function(){return Qe(this.h,this.s,this.l)},o.hcl=Ye;var Xe=Ye.prototype=new ze;function Ke(e,t,n){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Ze(n,Math.cos(e*=_e)*t,Math.sin(e)*t)}function Ze(e,t,n){return this instanceof Ze?(this.l=+e,this.a=+t,void(this.b=+n)):arguments.length<2?e instanceof Ze?new Ze(e.l,e.a,e.b):e instanceof Ye?Ke(e.h,e.c,e.l):ft((e=st(e)).r,e.g,e.b):new Ze(e,t,n)}Xe.brighter=function(e){return new Ye(this.h,this.c,Math.min(100,this.l+Je*(arguments.length?e:1)))},Xe.darker=function(e){return new Ye(this.h,this.c,Math.max(0,this.l-Je*(arguments.length?e:1)))},Xe.rgb=function(){return Ke(this.h,this.c,this.l).rgb()},o.lab=Ze;var Je=18,et=Ze.prototype=new ze;function tt(e,t,n){var r=(e+16)/116,i=r+t/500,o=r-n/200;return new st(ot(3.2404542*(i=.95047*rt(i))-1.5371385*(r=1*rt(r))-.4985314*(o=1.08883*rt(o))),ot(-.969266*i+1.8760108*r+.041556*o),ot(.0556434*i-.2040259*r+1.0572252*o))}function nt(e,t,n){return e>0?new Ye(Math.atan2(n,t)*Pe,Math.sqrt(t*t+n*n),e):new Ye(NaN,NaN,e)}function rt(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function it(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function ot(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function st(e,t,n){return this instanceof st?(this.r=~~e,this.g=~~t,void(this.b=~~n)):arguments.length<2?e instanceof st?new st(e.r,e.g,e.b):pt(""+e,st,Qe):new st(e,t,n)}function at(e){return new st(e>>16,e>>8&255,255&e)}function lt(e){return at(e)+""}et.brighter=function(e){return new Ze(Math.min(100,this.l+Je*(arguments.length?e:1)),this.a,this.b)},et.darker=function(e){return new Ze(Math.max(0,this.l-Je*(arguments.length?e:1)),this.a,this.b)},et.rgb=function(){return tt(this.l,this.a,this.b)},o.rgb=st;var ut=st.prototype=new ze;function ct(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function pt(e,t,n){var r,i,o,s=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(gt(i[0]),gt(i[1]),gt(i[2]))}return(o=mt.get(e))?t(o.r,o.g,o.b):(null==e||"#"!==e.charAt(0)||isNaN(o=parseInt(e.slice(1),16))||(4===e.length?(s=(3840&o)>>4,s|=s>>4,a=240&o,a|=a>>4,l=15&o,l|=l<<4):7===e.length&&(s=(16711680&o)>>16,a=(65280&o)>>8,l=255&o)),t(s,a,l))}function dt(e,t,n){var r,i,o=Math.min(e/=255,t/=255,n/=255),s=Math.max(e,t,n),a=s-o,l=(s+o)/2;return a?(i=l<.5?a/(s+o):a/(2-s-o),r=e==s?(t-n)/a+(t<n?6:0):t==s?(n-e)/a+2:(e-t)/a+4,r*=60):(r=NaN,i=l>0&&l<1?0:r),new $e(r,i,l)}function ft(e,t,n){var r=it((.4124564*(e=ht(e))+.3575761*(t=ht(t))+.1804375*(n=ht(n)))/.95047),i=it((.2126729*e+.7151522*t+.072175*n)/1);return Ze(116*i-16,500*(r-i),200*(i-it((.0193339*e+.119192*t+.9503041*n)/1.08883)))}function ht(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function gt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}ut.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?(t&&t<i&&(t=i),n&&n<i&&(n=i),r&&r<i&&(r=i),new st(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e))):new st(i,i,i)},ut.darker=function(e){return new st((e=Math.pow(.7,arguments.length?e:1))*this.r,e*this.g,e*this.b)},ut.hsl=function(){return dt(this.r,this.g,this.b)},ut.toString=function(){return"#"+ct(this.r)+ct(this.g)+ct(this.b)};var mt=o.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,rebeccapurple:6697881,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});function vt(e){return"function"==typeof e?e:function(){return e}}function Et(e){return function(t,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),xt(t,n,e,r)}}function xt(e,t,n,r){var i={},s=o.dispatch("beforesend","progress","load","error"),l={},u=new XMLHttpRequest,c=null;function p(){var e,t=u.status;if(!t&&function(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}(u)||t>=200&&t<300||304===t){try{e=n.call(i,u)}catch(e){return void s.error.call(i,e)}s.load.call(i,e)}else s.error.call(i,u)}return this.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=p:u.onreadystatechange=function(){u.readyState>3&&p()},u.onprogress=function(e){var t=o.event;o.event=e;try{s.progress.call(i,u)}finally{o.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",i):t},i.responseType=function(e){return arguments.length?(c=e,i):c},i.response=function(e){return n=e,i},["get","post"].forEach((function(e){i[e]=function(){return i.send.apply(i,[e].concat(a(arguments)))}})),i.send=function(n,r,o){if(2===arguments.length&&"function"==typeof r&&(o=r,r=null),u.open(n,e,!0),null==t||"accept"in l||(l.accept=t+",*/*"),u.setRequestHeader)for(var a in l)u.setRequestHeader(a,l[a]);return null!=t&&u.overrideMimeType&&u.overrideMimeType(t),null!=c&&(u.responseType=c),null!=o&&i.on("error",o).on("load",(function(e){o(null,e)})),s.beforesend.call(i,u),u.send(null==r?null:r),i},i.abort=function(){return u.abort(),i},o.rebind(i,s,"on"),null==r?i:i.get(function(e){return 1===e.length?function(t,n){e(null==t?n:null)}:e}(r))}mt.forEach((function(e,t){mt.set(e,at(t))})),o.functor=vt,o.xhr=Et(P),o.dsv=function(e,t){var n=new RegExp('["'+e+"\n]"),r=e.charCodeAt(0);function i(e,n,r){arguments.length<3&&(r=n,n=null);var i=xt(e,t,null==n?o:s(n),r);return i.row=function(e){return arguments.length?i.response(null==(n=e)?o:s(e)):n},i}function o(e){return i.parse(e.responseText)}function s(e){return function(t){return i.parse(t.responseText,e)}}function a(t){return t.map(l).join(e)}function l(e){return n.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}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){var n,i,o={},s={},a=[],l=e.length,u=0,c=0;function p(){if(u>=l)return s;if(i)return i=!1,o;var t=u;if(34===e.charCodeAt(t)){for(var n=t;n++<l;)if(34===e.charCodeAt(n)){if(34!==e.charCodeAt(n+1))break;++n}return u=n+2,13===(a=e.charCodeAt(n+1))?(i=!0,10===e.charCodeAt(n+2)&&++u):10===a&&(i=!0),e.slice(t+1,n).replace(/""/g,'"')}for(;u<l;){var a,c=1;if(10===(a=e.charCodeAt(u++)))i=!0;else if(13===a)i=!0,10===e.charCodeAt(u)&&(++u,++c);else if(a!==r)continue;return e.slice(t,u-c)}return e.slice(t)}for(;(n=p())!==s;){for(var d=[];n!==o&&n!==s;)d.push(n),n=p();t&&null==(d=t(d,c++))||a.push(d)}return a},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(l).join(e)].concat(t.map((function(t){return r.map((function(e){return l(t[e])})).join(e)}))).join("\n")},i.formatRows=function(e){return e.map(a).join("\n")},i},o.csv=o.dsv(",","text/csv"),o.tsv=o.dsv("\t","text/tab-separated-values");var yt,Tt,Nt,Ct,St=this[k(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};function It(e,t,n){var r=arguments.length;r<2&&(t=0),r<3&&(n=Date.now());var i=n+t,o={c:e,t:i,n:null};return Tt?Tt.n=o:yt=o,Tt=o,Nt||(Ct=clearTimeout(Ct),Nt=1,St(Lt)),o}function Lt(){var e=At(),t=bt()-e;t>24?(isFinite(t)&&(clearTimeout(Ct),Ct=setTimeout(Lt,t)),Nt=0):(Nt=1,St(Lt))}function At(){for(var e=Date.now(),t=yt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function bt(){for(var e,t=yt,n=1/0;t;)t.c?(t.t<n&&(n=t.t),t=(e=t).n):t=e?e.n=t.n:yt=t.n;return Tt=e,n}function Rt(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}o.timer=function(){It.apply(this,arguments)},o.timer.flush=function(){At(),bt()},o.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var wt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map((function(e,t){var n=Math.pow(10,3*N(8-t));return{scale:t>8?function(e){return e/n}:function(e){return e*n},symbol:e}}));function Ot(e){var t=e.decimal,n=e.thousands,r=e.grouping,i=e.currency,s=r&&n?function(e,t){for(var i=e.length,o=[],s=0,a=r[0],l=0;i>0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),o.push(e.substring(i-=a,i+a)),!((l+=a+1)>t));)a=r[s=(s+1)%r.length];return o.reverse().join(n)}:P;return function(e){var n=Mt.exec(e),r=n[1]||" ",a=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],p=+n[6],d=n[7],f=n[8],h=n[9],g=1,m="",v="",E=!1,x=!0;switch(f&&(f=+f.substring(1)),(c||"0"===r&&"="===a)&&(c=r="0",a="="),h){case"n":d=!0,h="g";break;case"%":g=100,v="%",h="f";break;case"p":g=100,v="%",h="r";break;case"b":case"o":case"x":case"X":"#"===u&&(m="0"+h.toLowerCase());case"c":x=!1;case"d":E=!0,f=0;break;case"s":g=-1,h="r"}"$"===u&&(m=i[0],v=i[1]),"r"!=h||f||(h="g"),null!=f&&("g"==h?f=Math.max(1,Math.min(21,f)):"e"!=h&&"f"!=h||(f=Math.max(0,Math.min(20,f)))),h=_t.get(h)||Pt;var y=c&&d;return function(e){var n=v;if(E&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(g<0){var u=o.formatPrefix(e,f);e=u.scale(e),n=u.symbol+v}else e*=g;var T,N,C=(e=h(e,f)).lastIndexOf(".");if(C<0){var S=x?e.lastIndexOf("e"):-1;S<0?(T=e,N=""):(T=e.substring(0,S),N=e.substring(S))}else T=e.substring(0,C),N=t+e.substring(C+1);!c&&d&&(T=s(T,1/0));var I=m.length+T.length+N.length+(y?0:i.length),L=I<p?new Array(I=p-I+1).join(r):"";return y&&(T=s(L+T,L.length?p-N.length:1/0)),i+=m,e=T+N,("<"===a?i+e+L:">"===a?L+i+e:"^"===a?L.substring(0,I>>=1)+i+e+L.substring(I):i+(y?e:L+e))+n}}}o.formatPrefix=function(e,t){var n=0;return(e=+e)&&(e<0&&(e*=-1),t&&(e=o.round(e,Rt(e,t))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),wt[8+n/3]};var Mt=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,_t=o.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(e,t){return(e=o.round(e,Rt(e,t))).toFixed(Math.max(0,Math.min(20,Rt(e*(1+1e-15),t))))}});function Pt(e){return e+""}var Dt=o.time={},kt=Date;function Ft(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}Ft.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(){Gt.setUTCDate.apply(this._,arguments)},setDay:function(){Gt.setUTCDay.apply(this._,arguments)},setFullYear:function(){Gt.setUTCFullYear.apply(this._,arguments)},setHours:function(){Gt.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Gt.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Gt.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Gt.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Gt.setUTCSeconds.apply(this._,arguments)},setTime:function(){Gt.setTime.apply(this._,arguments)}};var Gt=Date.prototype;function Ut(e,t,n){function r(t){var n=e(t),r=o(n,1);return t-n<r-t?n:r}function i(n){return t(n=e(new kt(n-1)),1),n}function o(e,n){return t(e=new kt(+e),n),e}function s(e,r,o){var s=i(e),a=[];if(o>1)for(;s<r;)n(s)%o||a.push(new Date(+s)),t(s,1);else for(;s<r;)a.push(new Date(+s)),t(s,1);return a}e.floor=e,e.round=r,e.ceil=i,e.offset=o,e.range=s;var a=e.utc=Bt(e);return a.floor=a,a.round=Bt(r),a.ceil=Bt(i),a.offset=Bt(o),a.range=function(e,t,n){try{kt=Ft;var r=new Ft;return r._=e,s(r,t,n)}finally{kt=Date}},e}function Bt(e){return function(t,n){try{kt=Ft;var r=new Ft;return r._=t,e(r,n)._}finally{kt=Date}}}function jt(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,l=e.months,u=e.shortMonths;function c(e){var t=e.length;function n(n){for(var r,i,o,s=[],a=-1,l=0;++a<t;)37===e.charCodeAt(a)&&(s.push(e.slice(l,a)),null!=(i=Vt[r=e.charAt(++a)])&&(r=e.charAt(++a)),(o=T[r])&&(r=o(n,null==i?"e"===r?" ":"0":i)),s.push(r),l=a+1);return s.push(e.slice(l,a)),s.join("")}return n.parse=function(t){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(p(n,e,t,0)!=t.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var r=null!=n.Z&&kt!==Ft,i=new(r?Ft:kt);return"j"in n?i.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),i.setFullYear(n.y,0,1),i.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(i.getDay()+5)%7:n.w+7*n.U-(i.getDay()+6)%7)):i.setFullYear(n.y,n.m,n.d),i.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),r?i._:i},n.toString=function(){return e},n}function p(e,t,n,r){for(var i,o,s,a=0,l=t.length,u=n.length;a<l;){if(r>=u)return-1;if(37===(i=t.charCodeAt(a++))){if(s=t.charAt(a++),!(o=N[s in Vt?t.charAt(a++):s])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}c.utc=function(e){var t=c(e);function n(e){try{var n=new(kt=Ft);return n._=e,t(n)}finally{kt=Date}}return n.parse=function(e){try{kt=Ft;var n=t.parse(e);return n&&n._}finally{kt=Date}},n.toString=t.toString,n},c.multi=c.utc.multi=cn;var d=o.map(),f=$t(s),h=Wt(s),g=$t(a),m=Wt(a),v=$t(l),E=Wt(l),x=$t(u),y=Wt(u);i.forEach((function(e,t){d.set(e.toLowerCase(),t)}));var T={a:function(e){return a[e.getDay()]},A:function(e){return s[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:c(t),d:function(e,t){return zt(e.getDate(),t,2)},e:function(e,t){return zt(e.getDate(),t,2)},H:function(e,t){return zt(e.getHours(),t,2)},I:function(e,t){return zt(e.getHours()%12||12,t,2)},j:function(e,t){return zt(1+Dt.dayOfYear(e),t,3)},L:function(e,t){return zt(e.getMilliseconds(),t,3)},m:function(e,t){return zt(e.getMonth()+1,t,2)},M:function(e,t){return zt(e.getMinutes(),t,2)},p:function(e){return i[+(e.getHours()>=12)]},S:function(e,t){return zt(e.getSeconds(),t,2)},U:function(e,t){return zt(Dt.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return zt(Dt.mondayOfYear(e),t,2)},x:c(n),X:c(r),y:function(e,t){return zt(e.getFullYear()%100,t,2)},Y:function(e,t){return zt(e.getFullYear()%1e4,t,4)},Z:ln,"%":function(){return"%"}},N={a:function(e,t,n){g.lastIndex=0;var r=g.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){f.lastIndex=0;var r=f.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){x.lastIndex=0;var r=x.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){v.lastIndex=0;var r=v.exec(t.slice(n));return r?(e.m=E.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,t,n){return p(e,T.c.toString(),t,n)},d:tn,e:tn,H:rn,I:rn,j:nn,L:an,m:en,M:on,p:function(e,t,n){var r=d.get(t.slice(n,n+=2).toLowerCase());return null==r?-1:(e.p=r,n)},S:sn,U:Yt,w:Qt,W:Xt,x:function(e,t,n){return p(e,T.x.toString(),t,n)},X:function(e,t,n){return p(e,T.X.toString(),t,n)},y:Zt,Y:Kt,Z:Jt,"%":un};return c}Dt.year=Ut((function(e){return(e=Dt.day(e)).setMonth(0,1),e}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e){return e.getFullYear()})),Dt.years=Dt.year.range,Dt.years.utc=Dt.year.utc.range,Dt.day=Ut((function(e){var t=new kt(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})),Dt.days=Dt.day.range,Dt.days.utc=Dt.day.utc.range,Dt.dayOfYear=function(e){var t=Dt.year(e);return Math.floor((e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach((function(e,t){t=7-t;var n=Dt[e]=Ut((function(e){return(e=Dt.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e}),(function(e,t){e.setDate(e.getDate()+7*Math.floor(t))}),(function(e){var n=Dt.year(e).getDay();return Math.floor((Dt.dayOfYear(e)+(n+t)%7)/7)-(n!==t)}));Dt[e+"s"]=n.range,Dt[e+"s"].utc=n.utc.range,Dt[e+"OfYear"]=function(e){var n=Dt.year(e).getDay();return Math.floor((Dt.dayOfYear(e)+(n+t)%7)/7)}})),Dt.week=Dt.sunday,Dt.weeks=Dt.sunday.range,Dt.weeks.utc=Dt.sunday.utc.range,Dt.weekOfYear=Dt.sundayOfYear;var Vt={"-":"",_:" ",0:"0"},Ht=/^\s*\d+/,qt=/^%/;function zt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function $t(e){return new RegExp("^(?:"+e.map(o.requote).join("|")+")","i")}function Wt(e){for(var t=new I,n=-1,r=e.length;++n<r;)t.set(e[n].toLowerCase(),n);return t}function Qt(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Yt(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n));return r?(e.U=+r[0],n+r[0].length):-1}function Xt(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n));return r?(e.W=+r[0],n+r[0].length):-1}function Kt(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Zt(e,t,n){Ht.lastIndex=0;var r,i=Ht.exec(t.slice(n,n+2));return i?(e.y=(r=+i[0])+(r>68?1900:2e3),n+i[0].length):-1}function Jt(e,t,n){return/^[+-]\d{4}$/.test(t=t.slice(n,n+5))?(e.Z=-t,n+5):-1}function en(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function tn(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function nn(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n,n+3));return r?(e.j=+r[0],n+r[0].length):-1}function rn(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function on(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function sn(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function an(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ln(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=N(t)/60|0,i=N(t)%60;return n+zt(r,"0",2)+zt(i,"0",2)}function un(e,t,n){qt.lastIndex=0;var r=qt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function cn(e){for(var t=e.length,n=-1;++n<t;)e[n][0]=this(e[n][0]);return function(t){for(var n=0,r=e[n];!r[1](t);)r=e[++n];return r[0](t)}}o.locale=function(e){return{numberFormat:Ot(e),timeFormat:jt(e)}};var pn=o.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"]});function dn(){}o.format=pn.numberFormat,o.geo={},dn.prototype={s:0,t:0,add:function(e){hn(e,this.t,fn),hn(fn.s,this.s,this),this.s?this.t+=fn.t:this.s=fn.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var fn=new dn;function hn(e,t,n){var r=n.s=e+t,i=r-e,o=r-i;n.t=e-o+(t-i)}function gn(e,t){e&&vn.hasOwnProperty(e.type)&&vn[e.type](e,t)}o.geo.stream=function(e,t){e&&mn.hasOwnProperty(e.type)?mn[e.type](e,t):gn(e,t)};var mn={Feature:function(e,t){gn(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)gn(n[r].geometry,t)}},vn={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){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){En(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)En(n[r],t,0)},Polygon:function(e,t){xn(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)xn(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)gn(n[r],t)}};function En(e,t,n){var r,i=-1,o=e.length-n;for(t.lineStart();++i<o;)r=e[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function xn(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)En(e[n],t,1);t.polygonEnd()}o.geo.area=function(e){return yn=0,o.geo.stream(e,_n),yn};var yn,Tn,Nn,Cn,Sn,In,Ln,An,bn,Rn,wn,On,Mn=new dn,_n={sphere:function(){yn+=4*Re},point:G,lineStart:G,lineEnd:G,polygonStart:function(){Mn.reset(),_n.lineStart=Pn},polygonEnd:function(){var e=2*Mn;yn+=e<0?4*Re+e:e,_n.lineStart=_n.lineEnd=_n.point=G}};function Pn(){var e,t,n,r,i;function o(e,t){t=t*_e/2+Re/4;var o=(e*=_e)-n,s=o>=0?1:-1,a=s*o,l=Math.cos(t),u=Math.sin(t),c=i*u,p=r*l+c*Math.cos(a),d=c*s*Math.sin(a);Mn.add(Math.atan2(d,p)),n=e,r=l,i=u}_n.point=function(s,a){_n.point=o,n=(e=s)*_e,r=Math.cos(a=(t=a)*_e/2+Re/4),i=Math.sin(a)},_n.lineEnd=function(){o(e,t)}}function Dn(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 kn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Fn(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 Gn(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Un(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Bn(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 jn(e){return[Math.atan2(e[1],e[0]),Ge(e[2])]}function Vn(e,t){return N(e[0]-t[0])<Ae&&N(e[1]-t[1])<Ae}o.geo.bounds=function(){var e,t,n,r,i,s,a,l,u,c,p,d={point:f,lineStart:g,lineEnd:m,polygonStart:function(){d.point=v,d.lineStart=E,d.lineEnd=x,u=0,_n.polygonStart()},polygonEnd:function(){_n.polygonEnd(),d.point=f,d.lineStart=g,d.lineEnd=m,Mn<0?(e=-(n=180),t=-(r=90)):u>Ae?r=90:u<-Ae&&(t=-90),p[0]=e,p[1]=n}};function f(i,o){c.push(p=[e=i,n=i]),o<t&&(t=o),o>r&&(r=o)}function h(o,s){var a=Dn([o*_e,s*_e]);if(l){var u=Fn(l,a),c=Fn([u[1],-u[0],0],u);Bn(c),c=jn(c);var p=o-i,d=p>0?1:-1,h=c[0]*Pe*d,g=N(p)>180;if(g^(d*i<h&&h<d*o))(m=c[1]*Pe)>r&&(r=m);else if(g^(d*i<(h=(h+360)%360-180)&&h<d*o)){var m;(m=-c[1]*Pe)<t&&(t=m)}else s<t&&(t=s),s>r&&(r=s);g?o<i?y(e,o)>y(e,n)&&(n=o):y(o,n)>y(e,n)&&(e=o):n>=e?(o<e&&(e=o),o>n&&(n=o)):o>i?y(e,o)>y(e,n)&&(n=o):y(o,n)>y(e,n)&&(e=o)}else f(o,s);l=a,i=o}function g(){d.point=h}function m(){p[0]=e,p[1]=n,d.point=f,l=null}function v(e,t){if(l){var n=e-i;u+=N(n)>180?n+(n>0?360:-360):n}else s=e,a=t;_n.point(e,t),h(e,t)}function E(){_n.lineStart()}function x(){v(s,a),_n.lineEnd(),N(u)>Ae&&(e=-(n=180)),p[0]=e,p[1]=n,l=null}function y(e,t){return(t-=e)<0?t+360:t}function T(e,t){return e[0]-t[0]}function C(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}return function(i){if(r=n=-(e=t=1/0),c=[],o.geo.stream(i,d),u=c.length){c.sort(T);for(var s=1,a=[g=c[0]];s<u;++s)C((f=c[s])[0],g)||C(f[1],g)?(y(g[0],f[1])>y(g[0],g[1])&&(g[1]=f[1]),y(f[0],g[1])>y(g[0],g[1])&&(g[0]=f[0])):a.push(g=f);for(var l,u,f,h=-1/0,g=(s=0,a[u=a.length-1]);s<=u;g=f,++s)f=a[s],(l=y(g[1],f[0]))>h&&(h=l,e=f[0],n=g[1])}return c=p=null,e===1/0||t===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,t],[n,r]]}}(),o.geo.centroid=function(e){Tn=Nn=Cn=Sn=In=Ln=An=bn=Rn=wn=On=0,o.geo.stream(e,Hn);var t=Rn,n=wn,r=On,i=t*t+n*n+r*r;return i<be&&(t=Ln,n=An,r=bn,Nn<Ae&&(t=Cn,n=Sn,r=In),(i=t*t+n*n+r*r)<be)?[NaN,NaN]:[Math.atan2(n,t)*Pe,Ge(r/Math.sqrt(i))*Pe]};var Hn={sphere:G,point:qn,lineStart:$n,lineEnd:Wn,polygonStart:function(){Hn.lineStart=Qn},polygonEnd:function(){Hn.lineStart=$n}};function qn(e,t){e*=_e;var n=Math.cos(t*=_e);zn(n*Math.cos(e),n*Math.sin(e),Math.sin(t))}function zn(e,t,n){++Tn,Cn+=(e-Cn)/Tn,Sn+=(t-Sn)/Tn,In+=(n-In)/Tn}function $n(){var e,t,n;function r(r,i){r*=_e;var o=Math.cos(i*=_e),s=o*Math.cos(r),a=o*Math.sin(r),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=t*l-n*a)*u+(u=n*s-e*l)*u+(u=e*a-t*s)*u),e*s+t*a+n*l);Nn+=u,Ln+=u*(e+(e=s)),An+=u*(t+(t=a)),bn+=u*(n+(n=l)),zn(e,t,n)}Hn.point=function(i,o){i*=_e;var s=Math.cos(o*=_e);e=s*Math.cos(i),t=s*Math.sin(i),n=Math.sin(o),Hn.point=r,zn(e,t,n)}}function Wn(){Hn.point=qn}function Qn(){var e,t,n,r,i;function o(e,t){e*=_e;var o=Math.cos(t*=_e),s=o*Math.cos(e),a=o*Math.sin(e),l=Math.sin(t),u=r*l-i*a,c=i*s-n*l,p=n*a-r*s,d=Math.sqrt(u*u+c*c+p*p),f=n*s+r*a+i*l,h=d&&-Fe(f)/d,g=Math.atan2(d,f);Rn+=h*u,wn+=h*c,On+=h*p,Nn+=g,Ln+=g*(n+(n=s)),An+=g*(r+(r=a)),bn+=g*(i+(i=l)),zn(n,r,i)}Hn.point=function(s,a){e=s,t=a,Hn.point=o,s*=_e;var l=Math.cos(a*=_e);n=l*Math.cos(s),r=l*Math.sin(s),i=Math.sin(a),zn(n,r,i)},Hn.lineEnd=function(){o(e,t),Hn.lineEnd=Wn,Hn.point=qn}}function Yn(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))&&e.invert(n[0],n[1])}),n}function Xn(){return!0}function Kn(e,t,n,r,i){var o=[],s=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],r=e[t];if(Vn(n,r)){i.lineStart();for(var a=0;a<t;++a)i.point((n=e[a])[0],n[1]);i.lineEnd()}else{var l=new Jn(n,e,null,!0),u=new Jn(n,null,l,!1);l.o=u,o.push(l),s.push(u),l=new Jn(r,e,null,!1),u=new Jn(r,null,l,!0),l.o=u,o.push(l),s.push(u)}}})),s.sort(t),Zn(o),Zn(s),o.length){for(var a=0,l=n,u=s.length;a<u;++a)s[a].e=l=!l;for(var c,p,d=o[0];;){for(var f=d,h=!0;f.v;)if((f=f.n)===d)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(h)for(a=0,u=c.length;a<u;++a)i.point((p=c[a])[0],p[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(h)for(a=(c=f.p.z).length-1;a>=0;--a)i.point((p=c[a])[0],p[1]);else r(f.x,f.p.x,-1,i);f=f.p}c=(f=f.o).z,h=!h}while(!f.v);i.lineEnd()}}}function Zn(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r<t;)i.n=n=e[r],n.p=i,i=n;i.n=n=e[0],n.p=i}}function Jn(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 er(e,t,n,r){return function(i,s){var a,l=t(s),u=i.invert(r[0],r[1]),c={point:p,lineStart:f,lineEnd:h,polygonStart:function(){c.point=y,c.lineStart=T,c.lineEnd=N,a=[],g=[]},polygonEnd:function(){c.point=p,c.lineStart=f,c.lineEnd=h,a=o.merge(a);var e=function(e,t){var n=e[0],r=e[1],i=[Math.sin(n),-Math.cos(n),0],o=0,s=0;Mn.reset();for(var a=0,l=t.length;a<l;++a){var u=t[a],c=u.length;if(c)for(var p=u[0],d=p[0],f=p[1]/2+Re/4,h=Math.sin(f),g=Math.cos(f),m=1;;){m===c&&(m=0);var v=(e=u[m])[0],E=e[1]/2+Re/4,x=Math.sin(E),y=Math.cos(E),T=v-d,N=T>=0?1:-1,C=N*T,S=C>Re,I=h*x;if(Mn.add(Math.atan2(I*N*Math.sin(C),g*y+I*Math.cos(C))),o+=S?T+N*we:T,S^d>=n^v>=n){var L=Fn(Dn(p),Dn(e));Bn(L);var A=Fn(i,L);Bn(A);var b=(S^T>=0?-1:1)*Ge(A[2]);(r>b||r===b&&(L[0]||L[1]))&&(s+=S^T>=0?1:-1)}if(!m++)break;d=v,h=x,g=y,p=e}}return(o<-Ae||o<Ae&&Mn<0)^1&s}(u,g);a.length?(x||(s.polygonStart(),x=!0),Kn(a,rr,e,n,s)):e&&(x||(s.polygonStart(),x=!0),s.lineStart(),n(null,null,1,s),s.lineEnd()),x&&(s.polygonEnd(),x=!1),a=g=null},sphere:function(){s.polygonStart(),s.lineStart(),n(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function p(t,n){var r=i(t,n);e(t=r[0],n=r[1])&&s.point(t,n)}function d(e,t){var n=i(e,t);l.point(n[0],n[1])}function f(){c.point=d,l.lineStart()}function h(){c.point=p,l.lineEnd()}var g,m,v=nr(),E=t(v),x=!1;function y(e,t){m.push([e,t]);var n=i(e,t);E.point(n[0],n[1])}function T(){E.lineStart(),m=[]}function N(){y(m[0][0],m[0][1]),E.lineEnd();var e,t=E.clean(),n=v.buffer(),r=n.length;if(m.pop(),g.push(m),m=null,r)if(1&t){var i,o=-1;if((r=(e=n[0]).length-1)>0){for(x||(s.polygonStart(),x=!0),s.lineStart();++o<r;)s.point((i=e[o])[0],i[1]);s.lineEnd()}}else r>1&&2&t&&n.push(n.pop().concat(n.shift())),a.push(n.filter(tr))}return c}}function tr(e){return e.length>1}function nr(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,n){e.push([t,n])},lineEnd:G,buffer:function(){var n=t;return t=[],e=null,n},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function rr(e,t){return((e=e.x)[0]<0?e[1]-Me-Ae:Me-e[1])-((t=t.x)[0]<0?t[1]-Me-Ae:Me-t[1])}var ir=er(Xn,(function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,s){var a=o>0?Re:-Re,l=N(o-n);N(l-Re)<Ae?(e.point(n,r=(r+s)/2>0?Me:-Me),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(a,r),e.point(o,r),t=0):i!==a&&l>=Re&&(N(n-i)<Ae&&(n-=i*Ae),N(o-a)<Ae&&(o-=a*Ae),r=function(e,t,n,r){var i,o,s=Math.sin(e-n);return N(s)>Ae?Math.atan((Math.sin(t)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(t))*Math.sin(e))/(i*o*s)):(t+r)/2}(n,r,o,s),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(a,r),t=0),e.point(n=o,r=s),i=a},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*Me,r.point(-Re,i),r.point(0,i),r.point(Re,i),r.point(Re,0),r.point(Re,-i),r.point(0,-i),r.point(-Re,-i),r.point(-Re,0),r.point(-Re,i);else if(N(e[0]-t[0])>Ae){var o=e[0]<t[0]?Re:-Re;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}),[-Re,-Re/2]);function or(e){var t=Math.cos(e),n=t>0,r=N(t)>Ae;return er(i,(function(e){var t,a,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(p,d){var f,h=[p,d],g=i(p,d),m=n?g?0:s(p,d):g?s(p+(p<0?Re:-Re),d):0;if(!t&&(u=l=g)&&e.lineStart(),g!==l&&(f=o(t,h),(Vn(t,f)||Vn(h,f))&&(h[0]+=Ae,h[1]+=Ae,g=i(h[0],h[1]))),g!==l)c=0,g?(e.lineStart(),f=o(h,t),e.point(f[0],f[1])):(f=o(t,h),e.point(f[0],f[1]),e.lineEnd()),t=f;else if(r&&t&&n^g){var v;m&a||!(v=o(h,t,!0))||(c=0,n?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1])))}!g||t&&Vn(t,h)||e.point(h[0],h[1]),t=h,l=g,a=m},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return c|(u&&l)<<1}}}),jr(e,6*_e),n?[0,-e]:[-Re,e-Re]);function i(e,n){return Math.cos(e)*Math.cos(n)>t}function o(e,n,r){var i=[1,0,0],o=Fn(Dn(e),Dn(n)),s=kn(o,o),a=o[0],l=s-a*a;if(!l)return!r&&e;var u=t*s/l,c=-t*a/l,p=Fn(i,o),d=Un(i,u);Gn(d,Un(o,c));var f=p,h=kn(d,f),g=kn(f,f),m=h*h-g*(kn(d,d)-1);if(!(m<0)){var v=Math.sqrt(m),E=Un(f,(-h-v)/g);if(Gn(E,d),E=jn(E),!r)return E;var x,y=e[0],T=n[0],C=e[1],S=n[1];T<y&&(x=y,y=T,T=x);var I=T-y,L=N(I-Re)<Ae;if(!L&&S<C&&(x=C,C=S,S=x),L||I<Ae?L?C+S>0^E[1]<(N(E[0]-y)<Ae?C:S):C<=E[1]&&E[1]<=S:I>Re^(y<=E[0]&&E[0]<=T)){var A=Un(f,(-h+v)/g);return Gn(A,d),[E,jn(A)]}}}function s(t,r){var i=n?e:Re-e,o=0;return t<-i?o|=1:t>i&&(o|=2),r<-i?o|=4:r>i&&(o|=8),o}}function sr(e,t,n,r){return function(i){var o,s=i.a,a=i.b,l=s.x,u=s.y,c=0,p=1,d=a.x-l,f=a.y-u;if(o=e-l,d||!(o>0)){if(o/=d,d<0){if(o<c)return;o<p&&(p=o)}else if(d>0){if(o>p)return;o>c&&(c=o)}if(o=n-l,d||!(o<0)){if(o/=d,d<0){if(o>p)return;o>c&&(c=o)}else if(d>0){if(o<c)return;o<p&&(p=o)}if(o=t-u,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<p&&(p=o)}else if(f>0){if(o>p)return;o>c&&(c=o)}if(o=r-u,f||!(o<0)){if(o/=f,f<0){if(o>p)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<p&&(p=o)}return c>0&&(i.a={x:l+c*d,y:u+c*f}),p<1&&(i.b={x:l+p*d,y:u+p*f}),i}}}}}}function ar(e,t,n,r){return function(l){var u,c,p,d,f,h,g,m,v,E,x,y=l,T=nr(),N=sr(e,t,n,r),C={point:L,lineStart:function(){C.point=A,c&&c.push(p=[]);E=!0,v=!1,g=m=NaN},lineEnd:function(){u&&(A(d,f),h&&v&&T.rejoin(),u.push(T.buffer()));C.point=L,v&&l.lineEnd()},polygonStart:function(){l=T,u=[],c=[],x=!0},polygonEnd:function(){l=y,u=o.merge(u);var t=function(e){for(var t=0,n=c.length,r=e[1],i=0;i<n;++i)for(var o,s=1,a=c[i],l=a.length,u=a[0];s<l;++s)o=a[s],u[1]<=r?o[1]>r&&ke(u,o,e)>0&&++t:o[1]<=r&&ke(u,o,e)<0&&--t,u=o;return 0!==t}([e,r]),n=x&&t,i=u.length;(n||i)&&(l.polygonStart(),n&&(l.lineStart(),S(null,null,1,l),l.lineEnd()),i&&Kn(u,s,t,S,l),l.polygonEnd()),u=c=p=null}};function S(o,s,l,u){var c=0,p=0;if(null==o||(c=i(o,l))!==(p=i(s,l))||a(o,s)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+l+4)%4)!==p);else u.point(s[0],s[1])}function I(i,o){return e<=i&&i<=n&&t<=o&&o<=r}function L(e,t){I(e,t)&&l.point(e,t)}function A(e,t){var n=I(e=Math.max(-1e9,Math.min(1e9,e)),t=Math.max(-1e9,Math.min(1e9,t)));if(c&&p.push([e,t]),E)d=e,f=t,h=n,E=!1,n&&(l.lineStart(),l.point(e,t));else if(n&&v)l.point(e,t);else{var r={a:{x:g,y:m},b:{x:e,y:t}};N(r)?(v||(l.lineStart(),l.point(r.a.x,r.a.y)),l.point(r.b.x,r.b.y),n||l.lineEnd(),x=!1):n&&(l.lineStart(),l.point(e,t),x=!1)}g=e,m=t,v=n}return C};function i(r,i){return N(r[0]-e)<Ae?i>0?0:3:N(r[0]-n)<Ae?i>0?2:1:N(r[1]-t)<Ae?i>0?1:0:i>0?3:2}function s(e,t){return a(e.x,t.x)}function a(e,t){var n=i(e,1),r=i(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}}function lr(e){var t=0,n=Re/3,r=_r(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*Re/180,n=e[1]*Re/180):[t/Re*180,n/Re*180]},i}function ur(e,t){var n=Math.sin(e),r=(n+Math.sin(t))/2,i=1+n*(2*r-n),o=Math.sqrt(i)/r;function s(e,t){var n=Math.sqrt(i-2*r*Math.sin(t))/r;return[n*Math.sin(e*=r),o-n*Math.cos(e)]}return s.invert=function(e,t){var n=o-t;return[Math.atan2(e,n)/r,Ge((i-(e*e+n*n)*r*r)/(2*r))]},s}o.geo.clipExtent=function(){var e,t,n,r,i,o,s={stream:function(e){return i&&(i.valid=!1),(i=o(e)).valid=!0,i},extent:function(a){return arguments.length?(o=ar(e=+a[0][0],t=+a[0][1],n=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),s):[[e,t],[n,r]]}};return s.extent([[0,0],[960,500]])},(o.geo.conicEqualArea=function(){return lr(ur)}).raw=ur,o.geo.albers=function(){return o.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},o.geo.albersUsa=function(){var e,t,n,r,i=o.geo.albers(),s=o.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=o.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){e=[t,n]}};function u(i){var o=i[0],s=i[1];return e=null,t(o,s),e||(n(o,s),e)||r(o,s),e}return u.invert=function(e){var t=i.scale(),n=i.translate(),r=(e[0]-n[0])/t,o=(e[1]-n[1])/t;return(o>=.12&&o<.234&&r>=-.425&&r<-.214?s:o>=.166&&o<.234&&r>=-.214&&r<-.115?a:i).invert(e)},u.stream=function(e){var t=i.stream(e),n=s.stream(e),r=a.stream(e);return{point:function(e,i){t.point(e,i),n.point(e,i),r.point(e,i)},sphere:function(){t.sphere(),n.sphere(),r.sphere()},lineStart:function(){t.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},u.precision=function(e){return arguments.length?(i.precision(e),s.precision(e),a.precision(e),u):i.precision()},u.scale=function(e){return arguments.length?(i.scale(e),s.scale(.35*e),a.scale(e),u.translate(i.translate())):i.scale()},u.translate=function(e){if(!arguments.length)return i.translate();var o=i.scale(),c=+e[0],p=+e[1];return t=i.translate(e).clipExtent([[c-.455*o,p-.238*o],[c+.455*o,p+.238*o]]).stream(l).point,n=s.translate([c-.307*o,p+.201*o]).clipExtent([[c-.425*o+Ae,p+.12*o+Ae],[c-.214*o-Ae,p+.234*o-Ae]]).stream(l).point,r=a.translate([c-.205*o,p+.212*o]).clipExtent([[c-.214*o+Ae,p+.166*o+Ae],[c-.115*o-Ae,p+.234*o-Ae]]).stream(l).point,u},u.scale(1070)};var cr,pr,dr,fr,hr,gr,mr={point:G,lineStart:G,lineEnd:G,polygonStart:function(){pr=0,mr.lineStart=vr},polygonEnd:function(){mr.lineStart=mr.lineEnd=mr.point=G,cr+=N(pr/2)}};function vr(){var e,t,n,r;function i(e,t){pr+=r*e-n*t,n=e,r=t}mr.point=function(o,s){mr.point=i,e=n=o,t=r=s},mr.lineEnd=function(){i(e,t)}}var Er={point:function(e,t){e<dr&&(dr=e);e>hr&&(hr=e);t<fr&&(fr=t);t>gr&&(gr=t)},lineStart:G,lineEnd:G,polygonStart:G,polygonEnd:G};function xr(){var e=yr(4.5),t=[],n={point:r,lineStart:function(){n.point=i},lineEnd:s,polygonStart:function(){n.lineEnd=a},polygonEnd:function(){n.lineEnd=s,n.point=r},pointRadius:function(t){return e=yr(t),n},result:function(){if(t.length){var e=t.join("");return t=[],e}}};function r(n,r){t.push("M",n,",",r,e)}function i(e,r){t.push("M",e,",",r),n.point=o}function o(e,n){t.push("L",e,",",n)}function s(){n.point=r}function a(){t.push("Z")}return n}function yr(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}var Tr,Nr={point:Cr,lineStart:Sr,lineEnd:Ir,polygonStart:function(){Nr.lineStart=Lr},polygonEnd:function(){Nr.point=Cr,Nr.lineStart=Sr,Nr.lineEnd=Ir}};function Cr(e,t){Cn+=e,Sn+=t,++In}function Sr(){var e,t;function n(n,r){var i=n-e,o=r-t,s=Math.sqrt(i*i+o*o);Ln+=s*(e+n)/2,An+=s*(t+r)/2,bn+=s,Cr(e=n,t=r)}Nr.point=function(r,i){Nr.point=n,Cr(e=r,t=i)}}function Ir(){Nr.point=Cr}function Lr(){var e,t,n,r;function i(e,t){var i=e-n,o=t-r,s=Math.sqrt(i*i+o*o);Ln+=s*(n+e)/2,An+=s*(r+t)/2,bn+=s,Rn+=(s=r*e-n*t)*(n+e),wn+=s*(r+t),On+=3*s,Cr(n=e,r=t)}Nr.point=function(o,s){Nr.point=i,Cr(e=n=o,t=r=s)},Nr.lineEnd=function(){i(e,t)}}function Ar(e){var t=4.5,n={point:r,lineStart:function(){n.point=i},lineEnd:s,polygonStart:function(){n.lineEnd=a},polygonEnd:function(){n.lineEnd=s,n.point=r},pointRadius:function(e){return t=e,n},result:G};function r(n,r){e.moveTo(n+t,r),e.arc(n,r,t,0,we)}function i(t,r){e.moveTo(t,r),n.point=o}function o(t,n){e.lineTo(t,n)}function s(){n.point=r}function a(){e.closePath()}return n}function br(e){var t=.5,n=Math.cos(30*_e),r=16;function i(e){return(r?s:o)(e)}function o(t){return Or(t,(function(n,r){n=e(n,r),t.point(n[0],n[1])}))}function s(t){var n,i,o,s,l,u,c,p,d,f,h,g,m={point:v,lineStart:E,lineEnd:y,polygonStart:function(){t.polygonStart(),m.lineStart=T},polygonEnd:function(){t.polygonEnd(),m.lineStart=E}};function v(n,r){n=e(n,r),t.point(n[0],n[1])}function E(){p=NaN,m.point=x,t.lineStart()}function x(n,i){var o=Dn([n,i]),s=e(n,i);a(p,d,c,f,h,g,p=s[0],d=s[1],c=n,f=o[0],h=o[1],g=o[2],r,t),t.point(p,d)}function y(){m.point=v,t.lineEnd()}function T(){E(),m.point=N,m.lineEnd=C}function N(e,t){x(n=e,t),i=p,o=d,s=f,l=h,u=g,m.point=x}function C(){a(p,d,c,f,h,g,i,o,n,s,l,u,r,t),m.lineEnd=y,y()}return m}function a(r,i,o,s,l,u,c,p,d,f,h,g,m,v){var E=c-r,x=p-i,y=E*E+x*x;if(y>4*t&&m--){var T=s+f,C=l+h,S=u+g,I=Math.sqrt(T*T+C*C+S*S),L=Math.asin(S/=I),A=N(N(S)-1)<Ae||N(o-d)<Ae?(o+d)/2:Math.atan2(C,T),b=e(A,L),R=b[0],w=b[1],O=R-r,M=w-i,_=x*O-E*M;(_*_/y>t||N((E*O+x*M)/y-.5)>.3||s*f+l*h+u*g<n)&&(a(r,i,o,s,l,u,R,w,A,T/=I,C/=I,S,m,v),v.point(R,w),a(R,w,A,T,C,S,c,p,d,f,h,g,m,v))}}return i.precision=function(e){return arguments.length?(r=(t=e*e)>0&&16,i):Math.sqrt(t)},i}function Rr(e){var t=br((function(t,n){return e([t*Pe,n*Pe])}));return function(e){return Pr(t(e))}}function wr(e){this.stream=e}function Or(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 Mr(e){return _r((function(){return e}))()}function _r(e){var t,n,r,i,s,a,l=br((function(e,n){return[(e=t(e,n))[0]*u+i,s-e[1]*u]})),u=150,c=480,p=250,d=0,f=0,h=0,g=0,m=0,v=ir,E=P,x=null,y=null;function T(e){return[(e=r(e[0]*_e,e[1]*_e))[0]*u+i,s-e[1]*u]}function N(e){return(e=r.invert((e[0]-i)/u,(s-e[1])/u))&&[e[0]*Pe,e[1]*Pe]}function C(){r=Yn(n=Fr(h,g,m),t);var e=t(d,f);return i=c-e[0]*u,s=p+e[1]*u,S()}function S(){return a&&(a.valid=!1,a=null),T}return T.stream=function(e){return a&&(a.valid=!1),(a=Pr(v(n,l(E(e))))).valid=!0,a},T.clipAngle=function(e){return arguments.length?(v=null==e?(x=e,ir):or((x=+e)*_e),S()):x},T.clipExtent=function(e){return arguments.length?(y=e,E=e?ar(e[0][0],e[0][1],e[1][0],e[1][1]):P,S()):y},T.scale=function(e){return arguments.length?(u=+e,C()):u},T.translate=function(e){return arguments.length?(c=+e[0],p=+e[1],C()):[c,p]},T.center=function(e){return arguments.length?(d=e[0]%360*_e,f=e[1]%360*_e,C()):[d*Pe,f*Pe]},T.rotate=function(e){return arguments.length?(h=e[0]%360*_e,g=e[1]%360*_e,m=e.length>2?e[2]%360*_e:0,C()):[h*Pe,g*Pe,m*Pe]},o.rebind(T,l,"precision"),function(){return t=e.apply(this,arguments),T.invert=t.invert&&N,C()}}function Pr(e){return Or(e,(function(t,n){e.point(t*_e,n*_e)}))}function Dr(e,t){return[e,t]}function kr(e,t){return[e>Re?e-we:e<-Re?e+we:e,t]}function Fr(e,t,n){return e?t||n?Yn(Ur(e),Br(t,n)):Ur(e):t||n?Br(t,n):kr}function Gr(e){return function(t,n){return[(t+=e)>Re?t-we:t<-Re?t+we:t,n]}}function Ur(e){var t=Gr(e);return t.invert=Gr(-e),t}function Br(e,t){var n=Math.cos(e),r=Math.sin(e),i=Math.cos(t),o=Math.sin(t);function s(e,t){var s=Math.cos(t),a=Math.cos(e)*s,l=Math.sin(e)*s,u=Math.sin(t),c=u*n+a*r;return[Math.atan2(l*i-c*o,a*n-u*r),Ge(c*i+l*o)]}return s.invert=function(e,t){var s=Math.cos(t),a=Math.cos(e)*s,l=Math.sin(e)*s,u=Math.sin(t),c=u*i-l*o;return[Math.atan2(l*i+u*o,a*n+c*r),Ge(c*n-a*r)]},s}function jr(e,t){var n=Math.cos(e),r=Math.sin(e);return function(i,o,s,a){var l=s*t;null!=i?(i=Vr(n,i),o=Vr(n,o),(s>0?i<o:i>o)&&(i+=s*we)):(i=e+s*we,o=e-.5*l);for(var u,c=i;s>0?c>o:c<o;c-=l)a.point((u=jn([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],u[1])}}function Vr(e,t){var n=Dn(t);n[0]-=e,Bn(n);var r=Fe(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Ae)%(2*Math.PI)}function Hr(e,t,n){var r=o.range(e,t-Ae,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function qr(e,t,n){var r=o.range(e,t-Ae,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}function zr(e){return e.source}function $r(e){return e.target}o.geo.path=function(){var e,t,n,r,i,s=4.5;function a(e){return e&&("function"==typeof s&&r.pointRadius(+s.apply(this,arguments)),i&&i.valid||(i=n(r)),o.geo.stream(e,i)),r.result()}function l(){return i=null,a}return a.area=function(e){return cr=0,o.geo.stream(e,n(mr)),cr},a.centroid=function(e){return Cn=Sn=In=Ln=An=bn=Rn=wn=On=0,o.geo.stream(e,n(Nr)),On?[Rn/On,wn/On]:bn?[Ln/bn,An/bn]:In?[Cn/In,Sn/In]:[NaN,NaN]},a.bounds=function(e){return hr=gr=-(dr=fr=1/0),o.geo.stream(e,n(Er)),[[dr,fr],[hr,gr]]},a.projection=function(t){return arguments.length?(n=(e=t)?t.stream||Rr(t):P,l()):e},a.context=function(e){return arguments.length?(r=null==(t=e)?new xr:new Ar(e),"function"!=typeof s&&r.pointRadius(s),l()):t},a.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(r.pointRadius(+e),+e),a):s},a.projection(o.geo.albersUsa()).context(null)},o.geo.transform=function(e){return{stream:function(t){var n=new wr(t);for(var r in e)n[r]=e[r];return n}}},wr.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()}},o.geo.projection=Mr,o.geo.projectionMutator=_r,(o.geo.equirectangular=function(){return Mr(Dr)}).raw=Dr.invert=Dr,o.geo.rotation=function(e){function t(t){return(t=e(t[0]*_e,t[1]*_e))[0]*=Pe,t[1]*=Pe,t}return e=Fr(e[0]%360*_e,e[1]*_e,e.length>2?e[2]*_e:0),t.invert=function(t){return(t=e.invert(t[0]*_e,t[1]*_e))[0]*=Pe,t[1]*=Pe,t},t},kr.invert=Dr,o.geo.circle=function(){var e,t,n=[0,0],r=6;function i(){var e="function"==typeof n?n.apply(this,arguments):n,r=Fr(-e[0]*_e,-e[1]*_e,0).invert,i=[];return t(null,null,1,{point:function(e,t){i.push(e=r(e,t)),e[0]*=Pe,e[1]*=Pe}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(e){return arguments.length?(n=e,i):n},i.angle=function(n){return arguments.length?(t=jr((e=+n)*_e,r*_e),i):e},i.precision=function(n){return arguments.length?(t=jr(e*_e,(r=+n)*_e),i):r},i.angle(90)},o.geo.distance=function(e,t){var n,r=(t[0]-e[0])*_e,i=e[1]*_e,o=t[1]*_e,s=Math.sin(r),a=Math.cos(r),l=Math.sin(i),u=Math.cos(i),c=Math.sin(o),p=Math.cos(o);return Math.atan2(Math.sqrt((n=p*s)*n+(n=u*c-l*p*a)*n),l*c+u*p*a)},o.geo.graticule=function(){var e,t,n,r,i,s,a,l,u,c,p,d,f=10,h=f,g=90,m=360,v=2.5;function E(){return{type:"MultiLineString",coordinates:x()}}function x(){return o.range(Math.ceil(r/g)*g,n,g).map(p).concat(o.range(Math.ceil(l/m)*m,a,m).map(d)).concat(o.range(Math.ceil(t/f)*f,e,f).filter((function(e){return N(e%g)>Ae})).map(u)).concat(o.range(Math.ceil(s/h)*h,i,h).filter((function(e){return N(e%m)>Ae})).map(c))}return E.lines=function(){return x().map((function(e){return{type:"LineString",coordinates:e}}))},E.outline=function(){return{type:"Polygon",coordinates:[p(r).concat(d(a).slice(1),p(n).reverse().slice(1),d(l).reverse().slice(1))]}},E.extent=function(e){return arguments.length?E.majorExtent(e).minorExtent(e):E.minorExtent()},E.majorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],l=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),l>a&&(e=l,l=a,a=e),E.precision(v)):[[r,l],[n,a]]},E.minorExtent=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],s=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),s>i&&(n=s,s=i,i=n),E.precision(v)):[[t,s],[e,i]]},E.step=function(e){return arguments.length?E.majorStep(e).minorStep(e):E.minorStep()},E.majorStep=function(e){return arguments.length?(g=+e[0],m=+e[1],E):[g,m]},E.minorStep=function(e){return arguments.length?(f=+e[0],h=+e[1],E):[f,h]},E.precision=function(o){return arguments.length?(v=+o,u=Hr(s,i,90),c=qr(t,e,v),p=Hr(l,a,90),d=qr(r,n,v),E):v},E.majorExtent([[-180,-90+Ae],[180,90-Ae]]).minorExtent([[-180,-80-Ae],[180,80+Ae]])},o.geo.greatArc=function(){var e,t,n=zr,r=$r;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),t||r.apply(this,arguments)]}}return i.distance=function(){return o.geo.distance(e||n.apply(this,arguments),t||r.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,i):r},i.precision=function(){return arguments.length?i:0},i},o.geo.interpolate=function(e,t){return n=e[0]*_e,r=e[1]*_e,i=t[0]*_e,o=t[1]*_e,s=Math.cos(r),a=Math.sin(r),l=Math.cos(o),u=Math.sin(o),c=s*Math.cos(n),p=s*Math.sin(n),d=l*Math.cos(i),f=l*Math.sin(i),h=2*Math.asin(Math.sqrt(Be(o-r)+s*l*Be(i-n))),g=1/Math.sin(h),(m=h?function(e){var t=Math.sin(e*=h)*g,n=Math.sin(h-e)*g,r=n*c+t*d,i=n*p+t*f,o=n*a+t*u;return[Math.atan2(i,r)*Pe,Math.atan2(o,Math.sqrt(r*r+i*i))*Pe]}:function(){return[n*Pe,r*Pe]}).distance=h,m;var n,r,i,o,s,a,l,u,c,p,d,f,h,g,m},o.geo.length=function(e){return Tr=0,o.geo.stream(e,Wr),Tr};var Wr={sphere:G,point:G,lineStart:function(){var e,t,n;function r(r,i){var o=Math.sin(i*=_e),s=Math.cos(i),a=N((r*=_e)-e),l=Math.cos(a);Tr+=Math.atan2(Math.sqrt((a=s*Math.sin(a))*a+(a=n*o-t*s*l)*a),t*o+n*s*l),e=r,t=o,n=s}Wr.point=function(i,o){e=i*_e,t=Math.sin(o*=_e),n=Math.cos(o),Wr.point=r},Wr.lineEnd=function(){Wr.point=Wr.lineEnd=G}},lineEnd:G,polygonStart:G,polygonEnd:G};function Qr(e,t){function n(t,n){var r=Math.cos(t),i=Math.cos(n),o=e(r*i);return[o*i*Math.sin(t),o*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),i=t(r),o=Math.sin(i),s=Math.cos(i);return[Math.atan2(e*o,r*s),Math.asin(r&&n*o/r)]},n}var Yr=Qr((function(e){return Math.sqrt(2/(1+e))}),(function(e){return 2*Math.asin(e/2)}));(o.geo.azimuthalEqualArea=function(){return Mr(Yr)}).raw=Yr;var Xr=Qr((function(e){var t=Math.acos(e);return t&&t/Math.sin(t)}),P);function Kr(e,t){var n=Math.cos(e),r=function(e){return Math.tan(Re/4+e/2)},i=e===t?Math.sin(e):Math.log(n/Math.cos(t))/Math.log(r(t)/r(e)),o=n*Math.pow(r(e),i)/i;if(!i)return ei;function s(e,t){o>0?t<-Me+Ae&&(t=-Me+Ae):t>Me-Ae&&(t=Me-Ae);var n=o/Math.pow(r(t),i);return[n*Math.sin(i*e),o-n*Math.cos(i*e)]}return s.invert=function(e,t){var n=o-t,r=De(i)*Math.sqrt(e*e+n*n);return[Math.atan2(e,n)/i,2*Math.atan(Math.pow(o/r,1/i))-Me]},s}function Zr(e,t){var n=Math.cos(e),r=e===t?Math.sin(e):(n-Math.cos(t))/(t-e),i=n/r+e;if(N(r)<Ae)return Dr;function o(e,t){var n=i-t;return[n*Math.sin(r*e),i-n*Math.cos(r*e)]}return o.invert=function(e,t){var n=i-t;return[Math.atan2(e,n)/r,i-De(r)*Math.sqrt(e*e+n*n)]},o}(o.geo.azimuthalEquidistant=function(){return Mr(Xr)}).raw=Xr,(o.geo.conicConformal=function(){return lr(Kr)}).raw=Kr,(o.geo.conicEquidistant=function(){return lr(Zr)}).raw=Zr;var Jr=Qr((function(e){return 1/e}),Math.atan);function ei(e,t){return[e,Math.log(Math.tan(Re/4+t/2))]}function ti(e){var t,n=Mr(e),r=n.scale,i=n.translate,o=n.clipExtent;return n.scale=function(){var e=r.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.translate=function(){var e=i.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.clipExtent=function(e){var s=o.apply(n,arguments);if(s===n){if(t=null==e){var a=Re*r(),l=i();o([[l[0]-a,l[1]-a],[l[0]+a,l[1]+a]])}}else t&&(s=null);return s},n.clipExtent(null)}(o.geo.gnomonic=function(){return Mr(Jr)}).raw=Jr,ei.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-Me]},(o.geo.mercator=function(){return ti(ei)}).raw=ei;var ni=Qr((function(){return 1}),Math.asin);(o.geo.orthographic=function(){return Mr(ni)}).raw=ni;var ri=Qr((function(e){return 1/(1+e)}),(function(e){return 2*Math.atan(e)}));function ii(e,t){return[Math.log(Math.tan(Re/4+t/2)),-e]}function oi(e){return e[0]}function si(e){return e[1]}function ai(e){for(var t=e.length,n=[0,1],r=2,i=2;i<t;i++){for(;r>1&&ke(e[n[r-2]],e[n[r-1]],e[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function li(e,t){return e[0]-t[0]||e[1]-t[1]}(o.geo.stereographic=function(){return Mr(ri)}).raw=ri,ii.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-Me]},(o.geo.transverseMercator=function(){var e=ti(ii),t=e.center,n=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return e?n([e[0],e[1],e.length>2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90])}).raw=ii,o.geom={},o.geom.hull=function(e){var t=oi,n=si;if(arguments.length)return r(e);function r(e){if(e.length<3)return[];var r,i=vt(t),o=vt(n),s=e.length,a=[],l=[];for(r=0;r<s;r++)a.push([+i.call(this,e[r],r),+o.call(this,e[r],r),r]);for(a.sort(li),r=0;r<s;r++)l.push([a[r][0],-a[r][1]]);var u=ai(a),c=ai(l),p=c[0]===u[0],d=c[c.length-1]===u[u.length-1],f=[];for(r=u.length-1;r>=0;--r)f.push(e[a[u[r]][2]]);for(r=+p;r<c.length-d;++r)f.push(e[a[c[r]][2]]);return f}return r.x=function(e){return arguments.length?(t=e,r):t},r.y=function(e){return arguments.length?(n=e,r):n},r},o.geom.polygon=function(e){return z(e,ui),e};var ui=o.geom.polygon.prototype=[];function ci(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function pi(e,t,n,r){var i=e[0],o=n[0],s=t[0]-i,a=r[0]-o,l=e[1],u=n[1],c=t[1]-l,p=r[1]-u,d=(a*(l-u)-p*(i-o))/(p*s-a*c);return[i+d*s,l+d*c]}function di(e){var t=e[0],n=e[e.length-1];return!(t[0]-n[0]||t[1]-n[1])}ui.area=function(){for(var e,t=-1,n=this.length,r=this[n-1],i=0;++t<n;)e=r,r=this[t],i+=e[1]*r[0]-e[0]*r[1];return.5*i},ui.centroid=function(e){var t,n,r=-1,i=this.length,o=0,s=0,a=this[i-1];for(arguments.length||(e=-1/(6*this.area()));++r<i;)t=a,a=this[r],n=t[0]*a[1]-a[0]*t[1],o+=(t[0]+a[0])*n,s+=(t[1]+a[1])*n;return[o*e,s*e]},ui.clip=function(e){for(var t,n,r,i,o,s,a=di(e),l=-1,u=this.length-di(this),c=this[u-1];++l<u;){for(t=e.slice(),e.length=0,i=this[l],o=t[(r=t.length-a)-1],n=-1;++n<r;)ci(s=t[n],c,i)?(ci(o,c,i)||e.push(pi(o,s,c,i)),e.push(s)):ci(o,c,i)&&e.push(pi(o,s,c,i)),o=s;a&&e.push(e[0]),c=i}return e};var fi,hi,gi,mi,vi,Ei=[],xi=[];function yi(){Ui(this),this.edge=this.site=this.circle=null}function Ti(e){var t=Ei.pop()||new yi;return t.site=e,t}function Ni(e){Oi(e),gi.remove(e),Ei.push(e),Ui(e)}function Ci(e){var t=e.circle,n=t.x,r=t.cy,i={x:n,y:r},o=e.P,s=e.N,a=[e];Ni(e);for(var l=o;l.circle&&N(n-l.circle.x)<Ae&&N(r-l.circle.cy)<Ae;)o=l.P,a.unshift(l),Ni(l),l=o;a.unshift(l),Oi(l);for(var u=s;u.circle&&N(n-u.circle.x)<Ae&&N(r-u.circle.cy)<Ae;)s=u.N,a.push(u),Ni(u),u=s;a.push(u),Oi(u);var c,p=a.length;for(c=1;c<p;++c)u=a[c],l=a[c-1],ki(u.edge,l.site,u.site,i);l=a[0],(u=a[p-1]).edge=Pi(l.site,u.site,null,i),wi(l),wi(u)}function Si(e){for(var t,n,r,i,o=e.x,s=e.y,a=gi._;a;)if((r=Ii(a,s)-o)>Ae)a=a.L;else{if(!((i=o-Li(a,s))>Ae)){r>-Ae?(t=a.P,n=a):i>-Ae?(t=a,n=a.N):t=n=a;break}if(!a.R){t=a;break}a=a.R}var l=Ti(e);if(gi.insert(t,l),t||n){if(t===n)return Oi(t),n=Ti(t.site),gi.insert(l,n),l.edge=n.edge=Pi(t.site,l.site),wi(t),void wi(n);if(n){Oi(t),Oi(n);var u=t.site,c=u.x,p=u.y,d=e.x-c,f=e.y-p,h=n.site,g=h.x-c,m=h.y-p,v=2*(d*m-f*g),E=d*d+f*f,x=g*g+m*m,y={x:(m*E-f*x)/v+c,y:(d*x-g*E)/v+p};ki(n.edge,u,h,y),l.edge=Pi(u,e,null,y),n.edge=Pi(e,h,null,y),wi(t),wi(n)}else l.edge=Pi(t.site,l.site)}}function Ii(e,t){var n=e.site,r=n.x,i=n.y,o=i-t;if(!o)return r;var s=e.P;if(!s)return-1/0;var a=(n=s.site).x,l=n.y,u=l-t;if(!u)return a;var c=a-r,p=1/o-1/u,d=c/u;return p?(-d+Math.sqrt(d*d-2*p*(c*c/(-2*u)-l+u/2+i-o/2)))/p+r:(r+a)/2}function Li(e,t){var n=e.N;if(n)return Ii(n,t);var r=e.site;return r.y===t?r.x:1/0}function Ai(e){this.site=e,this.edges=[]}function bi(e,t){return t.angle-e.angle}function Ri(){Ui(this),this.x=this.y=this.arc=this.site=this.cy=null}function wi(e){var t=e.P,n=e.N;if(t&&n){var r=t.site,i=e.site,o=n.site;if(r!==o){var s=i.x,a=i.y,l=r.x-s,u=r.y-a,c=o.x-s,p=2*(l*(m=o.y-a)-u*c);if(!(p>=-be)){var d=l*l+u*u,f=c*c+m*m,h=(m*d-u*f)/p,g=(l*f-c*d)/p,m=g+a,v=xi.pop()||new Ri;v.arc=e,v.site=i,v.x=h+s,v.y=m+Math.sqrt(h*h+g*g),v.cy=m,e.circle=v;for(var E=null,x=vi._;x;)if(v.y<x.y||v.y===x.y&&v.x<=x.x){if(!x.L){E=x.P;break}x=x.L}else{if(!x.R){E=x;break}x=x.R}vi.insert(E,v),E||(mi=v)}}}}function Oi(e){var t=e.circle;t&&(t.P||(mi=t.N),vi.remove(t),xi.push(t),Ui(t),e.circle=null)}function Mi(e,t){var n=e.b;if(n)return!0;var r,i,o=e.a,s=t[0][0],a=t[1][0],l=t[0][1],u=t[1][1],c=e.l,p=e.r,d=c.x,f=c.y,h=p.x,g=p.y,m=(d+h)/2,v=(f+g)/2;if(g===f){if(m<s||m>=a)return;if(d>h){if(o){if(o.y>=u)return}else o={x:m,y:l};n={x:m,y:u}}else{if(o){if(o.y<l)return}else o={x:m,y:u};n={x:m,y:l}}}else if(i=v-(r=(d-h)/(g-f))*m,r<-1||r>1)if(d>h){if(o){if(o.y>=u)return}else o={x:(l-i)/r,y:l};n={x:(u-i)/r,y:u}}else{if(o){if(o.y<l)return}else o={x:(u-i)/r,y:u};n={x:(l-i)/r,y:l}}else if(f<g){if(o){if(o.x>=a)return}else o={x:s,y:r*s+i};n={x:a,y:r*a+i}}else{if(o){if(o.x<s)return}else o={x:a,y:r*a+i};n={x:s,y:r*s+i}}return e.a=o,e.b=n,!0}function _i(e,t){this.l=e,this.r=t,this.a=this.b=null}function Pi(e,t,n,r){var i=new _i(e,t);return fi.push(i),n&&ki(i,e,t,n),r&&ki(i,t,e,r),hi[e.i].edges.push(new Fi(i,e,t)),hi[t.i].edges.push(new Fi(i,t,e)),i}function Di(e,t,n){var r=new _i(e,null);return r.a=t,r.b=n,fi.push(r),r}function ki(e,t,n,r){e.a||e.b?e.l===n?e.b=r:e.a=r:(e.a=r,e.l=t,e.r=n)}function Fi(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 Gi(){this._=null}function Ui(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function Bi(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 ji(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 Vi(e){for(;e.L;)e=e.L;return e}function Hi(e,t){var n,r,i,o=e.sort(qi).pop();for(fi=[],hi=new Array(e.length),gi=new Gi,vi=new Gi;;)if(i=mi,o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x))o.x===n&&o.y===r||(hi[o.i]=new Ai(o),Si(o),n=o.x,r=o.y),o=e.pop();else{if(!i)break;Ci(i.arc)}t&&(function(e){for(var t,n=fi,r=sr(e[0][0],e[0][1],e[1][0],e[1][1]),i=n.length;i--;)(!Mi(t=n[i],e)||!r(t)||N(t.a.x-t.b.x)<Ae&&N(t.a.y-t.b.y)<Ae)&&(t.a=t.b=null,n.splice(i,1))}(t),function(e){for(var t,n,r,i,o,s,a,l,u,c,p=e[0][0],d=e[1][0],f=e[0][1],h=e[1][1],g=hi,m=g.length;m--;)if((o=g[m])&&o.prepare())for(l=(a=o.edges).length,s=0;s<l;)r=(c=a[s].end()).x,i=c.y,t=(u=a[++s%l].start()).x,n=u.y,(N(r-t)>Ae||N(i-n)>Ae)&&(a.splice(s,0,new Fi(Di(o.site,c,N(r-p)<Ae&&h-i>Ae?{x:p,y:N(t-p)<Ae?n:h}:N(i-h)<Ae&&d-r>Ae?{x:N(n-h)<Ae?t:d,y:h}:N(r-d)<Ae&&i-f>Ae?{x:d,y:N(t-d)<Ae?n:f}:N(i-f)<Ae&&r-p>Ae?{x:N(n-f)<Ae?t:p,y:f}:null),o.site,null)),++l)}(t));var s={cells:hi,edges:fi};return gi=vi=fi=hi=null,s}function qi(e,t){return t.y-e.y||t.x-e.x}Ai.prototype.prepare=function(){for(var e,t=this.edges,n=t.length;n--;)(e=t[n].edge).b&&e.a||t.splice(n,1);return t.sort(bi),t.length},Fi.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}},Gi.prototype={insert:function(e,t){var n,r,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=Vi(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.R&&(Bi(this,n),n=(e=n).U),n.C=!1,r.C=!0,ji(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.L&&(ji(this,n),n=(e=n).U),n.C=!1,r.C=!0,Bi(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,n,r,i=e.U,o=e.L,s=e.R;if(n=o?s?Vi(s):o:s,i?i.L===e?i.L=n:i.R=n:this._=n,o&&s?(r=n.C,n.C=e.C,n.L=o,o.U=n,n!==s?(i=n.U,n.U=e.U,e=n.R,i.L=e,n.R=s,s.U=n):(n.U=i,i=n,e=n.R)):(r=e.C,e=n),e&&(e.U=i),!r)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,Bi(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ji(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,Bi(this,i),e=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,ji(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Bi(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,ji(this,i),e=this._;break}t.C=!0,e=i,i=i.U}while(!e.C);e&&(e.C=!1)}}},o.geom.voronoi=function(e){var t=oi,n=si,r=t,i=n,o=zi;if(e)return s(e);function s(e){var t=new Array(e.length),n=o[0][0],r=o[0][1],i=o[1][0],s=o[1][1];return Hi(a(e),o).cells.forEach((function(o,a){var l=o.edges,u=o.site;(t[a]=l.length?l.map((function(e){var t=e.start();return[t.x,t.y]})):u.x>=n&&u.x<=i&&u.y>=r&&u.y<=s?[[n,s],[i,s],[i,r],[n,r]]:[]).point=e[a]})),t}function a(e){return e.map((function(e,t){return{x:Math.round(r(e,t)/Ae)*Ae,y:Math.round(i(e,t)/Ae)*Ae,i:t}}))}return s.links=function(e){return Hi(a(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},s.triangles=function(e){var t=[];return Hi(a(e)).cells.forEach((function(n,r){for(var i,o,s,a,l=n.site,u=n.edges.sort(bi),c=-1,p=u.length,d=u[p-1].edge,f=d.l===l?d.r:d.l;++c<p;)d,i=f,f=(d=u[c].edge).l===l?d.r:d.l,r<i.i&&r<f.i&&(s=i,a=f,((o=l).x-a.x)*(s.y-o.y)-(o.x-s.x)*(a.y-o.y)<0)&&t.push([e[r],e[i.i],e[f.i]])})),t},s.x=function(e){return arguments.length?(r=vt(t=e),s):t},s.y=function(e){return arguments.length?(i=vt(n=e),s):n},s.clipExtent=function(e){return arguments.length?(o=null==e?zi:e,s):o===zi?null:o},s.size=function(e){return arguments.length?s.clipExtent(e&&[[0,0],e]):o===zi?null:o&&o[1]},s};var zi=[[-1e6,-1e6],[1e6,1e6]];function $i(e){return e.x}function Wi(e){return e.y}function Qi(e,t,n,r,i,o){if(!e(t,n,r,i,o)){var s=.5*(n+i),a=.5*(r+o),l=t.nodes;l[0]&&Qi(e,l[0],n,r,s,a),l[1]&&Qi(e,l[1],s,r,i,a),l[2]&&Qi(e,l[2],n,a,s,o),l[3]&&Qi(e,l[3],s,a,i,o)}}function Yi(e,t,n,r,i,o,s){var a,l=1/0;return function e(u,c,p,d,f){if(!(c>o||p>s||d<r||f<i)){if(h=u.point){var h,g=t-u.x,m=n-u.y,v=g*g+m*m;if(v<l){var E=Math.sqrt(l=v);r=t-E,i=n-E,o=t+E,s=n+E,a=h}}for(var x=u.nodes,y=.5*(c+d),T=.5*(p+f),N=(n>=T)<<1|t>=y,C=N+4;N<C;++N)if(u=x[3&N])switch(3&N){case 0:e(u,c,p,y,T);break;case 1:e(u,y,p,d,T);break;case 2:e(u,c,T,y,f);break;case 3:e(u,y,T,d,f)}}}(e,r,i,o,s),a}function Xi(e,t){e=o.rgb(e),t=o.rgb(t);var n=e.r,r=e.g,i=e.b,s=t.r-n,a=t.g-r,l=t.b-i;return function(e){return"#"+ct(Math.round(n+s*e))+ct(Math.round(r+a*e))+ct(Math.round(i+l*e))}}function Ki(e,t){var n,r={},i={};for(n in e)n in t?r[n]=no(e[n],t[n]):i[n]=e[n];for(n in t)n in e||(i[n]=t[n]);return function(e){for(n in r)i[n]=r[n](e);return i}}function Zi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ji(e,t){var n,r,i,o=eo.lastIndex=to.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=eo.exec(e))&&(r=to.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:Zi(n,r)})),o=to.lastIndex;return o<t.length&&(i=t.slice(o),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?(t=l[0].x,function(e){return t(e)+""}):function(){return t}:(t=l.length,function(e){for(var n,r=0;r<t;++r)a[(n=l[r]).i]=n.x(e);return a.join("")})}o.geom.delaunay=function(e){return o.geom.voronoi().triangles(e)},o.geom.quadtree=function(e,t,n,r,i){var o,s=oi,a=si;if(o=arguments.length)return s=$i,a=Wi,3===o&&(i=n,r=t,n=t=0),l(e);function l(e){var l,u,c,p,d,f,h,g,m,v=vt(s),E=vt(a);if(null!=t)f=t,h=n,g=r,m=i;else if(g=m=-(f=h=1/0),u=[],c=[],d=e.length,o)for(p=0;p<d;++p)(l=e[p]).x<f&&(f=l.x),l.y<h&&(h=l.y),l.x>g&&(g=l.x),l.y>m&&(m=l.y),u.push(l.x),c.push(l.y);else for(p=0;p<d;++p){var x=+v(l=e[p],p),y=+E(l,p);x<f&&(f=x),y<h&&(h=y),x>g&&(g=x),y>m&&(m=y),u.push(x),c.push(y)}var T=g-f,C=m-h;function S(e,t,n,r,i,o,s,a){if(!isNaN(n)&&!isNaN(r))if(e.leaf){var l=e.x,u=e.y;if(null!=l)if(N(l-n)+N(u-r)<.01)I(e,t,n,r,i,o,s,a);else{var c=e.point;e.x=e.y=e.point=null,I(e,c,l,u,i,o,s,a),I(e,t,n,r,i,o,s,a)}else e.x=n,e.y=r,e.point=t}else I(e,t,n,r,i,o,s,a)}function I(e,t,n,r,i,o,s,a){var l=.5*(i+s),u=.5*(o+a),c=n>=l,p=r>=u,d=p<<1|c;e.leaf=!1,c?i=l:s=l,p?o=u:a=u,S(e=e.nodes[d]||(e.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,n,r,i,o,s,a)}T>C?m=h+T:g=f+C;var L={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){S(L,e,+v(e,++p),+E(e,p),f,h,g,m)},visit:function(e){Qi(e,L,f,h,g,m)},find:function(e){return Yi(L,e[0],e[1],f,h,g,m)}};if(p=-1,null==t){for(;++p<d;)S(L,e[p],u[p],c[p],f,h,g,m);--p}else e.forEach(L.add);return u=c=e=l=null,L}return l.x=function(e){return arguments.length?(s=e,l):s},l.y=function(e){return arguments.length?(a=e,l):a},l.extent=function(e){return arguments.length?(null==e?t=n=r=i=null:(t=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),l):null==t?null:[[t,n],[r,i]]},l.size=function(e){return arguments.length?(null==e?t=n=r=i=null:(t=n=0,r=+e[0],i=+e[1]),l):null==t?null:[r-t,i-n]},l},o.interpolateRgb=Xi,o.interpolateObject=Ki,o.interpolateNumber=Zi,o.interpolateString=Ji;var eo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,to=new RegExp(eo.source,"g");function no(e,t){for(var n,r=o.interpolators.length;--r>=0&&!(n=o.interpolators[r](e,t)););return n}function ro(e,t){var n,r=[],i=[],o=e.length,s=t.length,a=Math.min(e.length,t.length);for(n=0;n<a;++n)r.push(no(e[n],t[n]));for(;n<o;++n)i[n]=e[n];for(;n<s;++n)i[n]=t[n];return function(e){for(n=0;n<a;++n)i[n]=r[n](e);return i}}o.interpolate=no,o.interpolators=[function(e,t){var n=typeof t;return("string"===n?mt.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?Xi:Ji:t instanceof ze?Xi:Array.isArray(t)?ro:"object"===n&&isNaN(t)?Ki:Zi)(e,t)}],o.interpolateArray=ro;var io=function(){return P},oo=o.map({linear:io,poly:function(e){return function(t){return Math.pow(t,e)}},quad:function(){return co},cubic:function(){return po},sin:function(){return ho},exp:function(){return go},circle:function(){return mo},elastic:function(e,t){var n;arguments.length<2&&(t=.45);arguments.length?n=t/we*Math.asin(1/e):(e=1,n=t/4);return function(r){return 1+e*Math.pow(2,-10*r)*Math.sin((r-n)*we/t)}},back:function(e){e||(e=1.70158);return function(t){return t*t*((e+1)*t-e)}},bounce:function(){return vo}}),so=o.map({in:P,out:lo,"in-out":uo,"out-in":function(e){return uo(lo(e))}});function ao(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function lo(e){return function(t){return 1-e(1-t)}}function uo(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function co(e){return e*e}function po(e){return e*e*e}function fo(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 ho(e){return 1-Math.cos(e*Me)}function go(e){return Math.pow(2,10*(e-1))}function mo(e){return 1-Math.sqrt(1-e*e)}function vo(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 Eo(e,t){return t-=e,function(n){return Math.round(e+t*n)}}function xo(e){var t,n,r,i=[e.a,e.b],o=[e.c,e.d],s=To(i),a=yo(i,o),l=To(((t=o)[0]+=(r=-a)*(n=i)[0],t[1]+=r*n[1],t))||0;i[0]*o[1]<o[0]*i[1]&&(i[0]*=-1,i[1]*=-1,s*=-1,a*=-1),this.rotate=(s?Math.atan2(i[1],i[0]):Math.atan2(-o[0],o[1]))*Pe,this.translate=[e.e,e.f],this.scale=[s,l],this.skew=l?Math.atan2(a,l)*Pe:0}function yo(e,t){return e[0]*t[0]+e[1]*t[1]}function To(e){var t=Math.sqrt(yo(e,e));return t&&(e[0]/=t,e[1]/=t),t}o.ease=function(e){var t=e.indexOf("-"),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):"in";return n=oo.get(n)||io,ao((r=so.get(r)||P)(n.apply(null,s.call(arguments,1))))},o.interpolateHcl=function(e,t){e=o.hcl(e),t=o.hcl(t);var n=e.h,r=e.c,i=e.l,s=t.h-n,a=t.c-r,l=t.l-i;isNaN(a)&&(a=0,r=isNaN(r)?t.c:r);isNaN(s)?(s=0,n=isNaN(n)?t.h:n):s>180?s-=360:s<-180&&(s+=360);return function(e){return Ke(n+s*e,r+a*e,i+l*e)+""}},o.interpolateHsl=function(e,t){e=o.hsl(e),t=o.hsl(t);var n=e.h,r=e.s,i=e.l,s=t.h-n,a=t.s-r,l=t.l-i;isNaN(a)&&(a=0,r=isNaN(r)?t.s:r);isNaN(s)?(s=0,n=isNaN(n)?t.h:n):s>180?s-=360:s<-180&&(s+=360);return function(e){return Qe(n+s*e,r+a*e,i+l*e)+""}},o.interpolateHslLong=function(e,t){e=o.hsl(e),t=o.hsl(t);var n=e.h,r=e.s,i=e.l,s=t.h-n,a=t.s-r,l=t.l-i;isNaN(a)&&(a=0,r=isNaN(r)?t.s:r);isNaN(s)&&(s=0,n=isNaN(n)?t.h:n);return function(e){return Qe(n+s*e,r+a*e,i+l*e)+""}},o.interpolateLab=function(e,t){e=o.lab(e),t=o.lab(t);var n=e.l,r=e.a,i=e.b,s=t.l-n,a=t.a-r,l=t.b-i;return function(e){return tt(n+s*e,r+a*e,i+l*e)+""}},o.interpolateRound=Eo,o.transform=function(e){var t=l.createElementNS(o.ns.prefix.svg,"g");return(o.transform=function(e){if(null!=e){t.setAttribute("transform",e);var n=t.transform.baseVal.consolidate()}return new xo(n?n.matrix:No)})(e)},xo.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var No={a:1,b:0,c:0,d:1,e:0,f:0};function Co(e){return e.length?e.pop()+",":""}function So(e,t){var n=[],r=[];return e=o.transform(e),t=o.transform(t),function(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push("translate(",null,",",null,")");r.push({i:i-4,x:Zi(e[0],t[0])},{i:i-2,x:Zi(e[1],t[1])})}else(t[0]||t[1])&&n.push("translate("+t+")")}(e.translate,t.translate,n,r),function(e,t,n,r){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:n.push(Co(n)+"rotate(",null,")")-2,x:Zi(e,t)})):t&&n.push(Co(n)+"rotate("+t+")")}(e.rotate,t.rotate,n,r),function(e,t,n,r){e!==t?r.push({i:n.push(Co(n)+"skewX(",null,")")-2,x:Zi(e,t)}):t&&n.push(Co(n)+"skewX("+t+")")}(e.skew,t.skew,n,r),function(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push(Co(n)+"scale(",null,",",null,")");r.push({i:i-4,x:Zi(e[0],t[0])},{i:i-2,x:Zi(e[1],t[1])})}else 1===t[0]&&1===t[1]||n.push(Co(n)+"scale("+t+")")}(e.scale,t.scale,n,r),e=t=null,function(e){for(var t,i=-1,o=r.length;++i<o;)n[(t=r[i]).i]=t.x(e);return n.join("")}}function Io(e,t){return t=(t-=e=+e)||1/t,function(n){return(n-e)/t}}function Lo(e,t){return t=(t-=e=+e)||1/t,function(n){return Math.max(0,Math.min(1,(n-e)/t))}}function Ao(e){for(var t=e.source,n=e.target,r=function(e,t){if(e===t)return e;var n=bo(e),r=bo(t),i=n.pop(),o=r.pop(),s=null;for(;i===o;)s=i,i=n.pop(),o=r.pop();return s}(t,n),i=[t];t!==r;)t=t.parent,i.push(t);for(var o=i.length;n!==r;)i.splice(o,0,n),n=n.parent;return i}function bo(e){for(var t=[],n=e.parent;null!=n;)t.push(e),e=n,n=n.parent;return t.push(e),t}function Ro(e){e.fixed|=2}function wo(e){e.fixed&=-7}function Oo(e){e.fixed|=4,e.px=e.x,e.py=e.y}function Mo(e){e.fixed&=-5}o.interpolateTransform=So,o.layout={},o.layout.bundle=function(){return function(e){for(var t=[],n=-1,r=e.length;++n<r;)t.push(Ao(e[n]));return t}},o.layout.chord=function(){var e,t,n,r,i,s,a,l={},u=0;function c(){var l,c,d,f,h,g={},m=[],v=o.range(r),E=[];for(e=[],t=[],l=0,f=-1;++f<r;){for(c=0,h=-1;++h<r;)c+=n[f][h];m.push(c),E.push(o.range(r)),l+=c}for(i&&v.sort((function(e,t){return i(m[e],m[t])})),s&&E.forEach((function(e,t){e.sort((function(e,r){return s(n[t][e],n[t][r])}))})),l=(we-u*r)/l,c=0,f=-1;++f<r;){for(d=c,h=-1;++h<r;){var x=v[f],y=E[x][h],T=n[x][y],N=c,C=c+=T*l;g[x+"-"+y]={index:x,subindex:y,startAngle:N,endAngle:C,value:T}}t[x]={index:x,startAngle:d,endAngle:c,value:m[x]},c+=u}for(f=-1;++f<r;)for(h=f-1;++h<r;){var S=g[f+"-"+h],I=g[h+"-"+f];(S.value||I.value)&&e.push(S.value<I.value?{source:I,target:S}:{source:S,target:I})}a&&p()}function p(){e.sort((function(e,t){return a((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)}))}return l.matrix=function(i){return arguments.length?(r=(n=i)&&n.length,e=t=null,l):n},l.padding=function(n){return arguments.length?(u=n,e=t=null,l):u},l.sortGroups=function(n){return arguments.length?(i=n,e=t=null,l):i},l.sortSubgroups=function(t){return arguments.length?(s=t,e=null,l):s},l.sortChords=function(t){return arguments.length?(a=t,e&&p(),l):a},l.chords=function(){return e||c(),e},l.groups=function(){return t||c(),t},l},o.layout.force=function(){var e,t,n,r,i,s,a={},l=o.dispatch("start","tick","end"),u=[1,1],c=.9,p=_o,d=Po,f=-30,h=Do,g=.1,m=.64,v=[],E=[];function x(e){return function(t,n,r,i){if(t.point!==e){var o=t.cx-e.x,s=t.cy-e.y,a=i-n,l=o*o+s*s;if(a*a/m<l){if(l<h){var u=t.charge/l;e.px-=o*u,e.py-=s*u}return!0}if(t.point&&l&&l<h){u=t.pointCharge/l;e.px-=o*u,e.py-=s*u}}return!t.charge}}function y(e){e.px=o.event.x,e.py=o.event.y,a.resume()}return a.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var t,a,p,d,h,m,y,T,N,C=v.length,S=E.length;for(a=0;a<S;++a)d=(p=E[a]).source,(m=(T=(h=p.target).x-d.x)*T+(N=h.y-d.y)*N)&&(T*=m=n*i[a]*((m=Math.sqrt(m))-r[a])/m,N*=m,h.x-=T*(y=d.weight+h.weight?d.weight/(d.weight+h.weight):.5),h.y-=N*y,d.x+=T*(y=1-y),d.y+=N*y);if((y=n*g)&&(T=u[0]/2,N=u[1]/2,a=-1,y))for(;++a<C;)(p=v[a]).x+=(T-p.x)*y,p.y+=(N-p.y)*y;if(f)for(!function e(t,n,r){var i=0,o=0;if(t.charge=0,!t.leaf)for(var s,a=t.nodes,l=a.length,u=-1;++u<l;)null!=(s=a[u])&&(e(s,n,r),t.charge+=s.charge,i+=s.charge*s.cx,o+=s.charge*s.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var c=n*r[t.point.index];t.charge+=t.pointCharge=c,i+=c*t.point.x,o+=c*t.point.y}t.cx=i/t.charge,t.cy=o/t.charge}(t=o.geom.quadtree(v),n,s),a=-1;++a<C;)(p=v[a]).fixed||t.visit(x(p));for(a=-1;++a<C;)(p=v[a]).fixed?(p.x=p.px,p.y=p.py):(p.x-=(p.px-(p.px=p.x))*c,p.y-=(p.py-(p.py=p.y))*c);l.tick({type:"tick",alpha:n})},a.nodes=function(e){return arguments.length?(v=e,a):v},a.links=function(e){return arguments.length?(E=e,a):E},a.size=function(e){return arguments.length?(u=e,a):u},a.linkDistance=function(e){return arguments.length?(p="function"==typeof e?e:+e,a):p},a.distance=a.linkDistance,a.linkStrength=function(e){return arguments.length?(d="function"==typeof e?e:+e,a):d},a.friction=function(e){return arguments.length?(c=+e,a):c},a.charge=function(e){return arguments.length?(f="function"==typeof e?e:+e,a):f},a.chargeDistance=function(e){return arguments.length?(h=e*e,a):Math.sqrt(h)},a.gravity=function(e){return arguments.length?(g=+e,a):g},a.theta=function(e){return arguments.length?(m=e*e,a):Math.sqrt(m)},a.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=It(a.tick)),a):n},a.start=function(){var e,t,n,o=v.length,l=E.length,c=u[0],h=u[1];for(e=0;e<o;++e)(n=v[e]).index=e,n.weight=0;for(e=0;e<l;++e)"number"==typeof(n=E[e]).source&&(n.source=v[n.source]),"number"==typeof n.target&&(n.target=v[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<o;++e)n=v[e],isNaN(n.x)&&(n.x=g("x",c)),isNaN(n.y)&&(n.y=g("y",h)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(r=[],"function"==typeof p)for(e=0;e<l;++e)r[e]=+p.call(this,E[e],e);else for(e=0;e<l;++e)r[e]=p;if(i=[],"function"==typeof d)for(e=0;e<l;++e)i[e]=+d.call(this,E[e],e);else for(e=0;e<l;++e)i[e]=d;if(s=[],"function"==typeof f)for(e=0;e<o;++e)s[e]=+f.call(this,v[e],e);else for(e=0;e<o;++e)s[e]=f;function g(n,r){if(!t){for(t=new Array(o),u=0;u<o;++u)t[u]=[];for(u=0;u<l;++u){var i=E[u];t[i.source.index].push(i.target),t[i.target.index].push(i.source)}}for(var s,a=t[e],u=-1,c=a.length;++u<c;)if(!isNaN(s=a[u][n]))return s;return Math.random()*r}return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){if(t||(t=o.behavior.drag().origin(P).on("dragstart.force",Ro).on("drag.force",y).on("dragend.force",wo)),!arguments.length)return t;this.on("mouseover.force",Oo).on("mouseout.force",Mo).call(t)},o.rebind(a,l,"on")};var _o=20,Po=1,Do=1/0;function ko(e,t){return o.rebind(e,t,"sort","children","value"),e.nodes=e,e.links=Vo,e}function Fo(e,t){for(var n=[e];null!=(e=n.pop());)if(t(e),(i=e.children)&&(r=i.length))for(var r,i;--r>=0;)n.push(i[r])}function Go(e,t){for(var n=[e],r=[];null!=(e=n.pop());)if(r.push(e),(o=e.children)&&(i=o.length))for(var i,o,s=-1;++s<i;)n.push(o[s]);for(;null!=(e=r.pop());)t(e)}function Uo(e){return e.children}function Bo(e){return e.value}function jo(e,t){return t.value-e.value}function Vo(e){return o.merge(e.map((function(e){return(e.children||[]).map((function(t){return{source:e,target:t}}))})))}o.layout.hierarchy=function(){var e=jo,t=Uo,n=Bo;function r(i){var o,s=[i],a=[];for(i.depth=0;null!=(o=s.pop());)if(a.push(o),(u=t.call(r,o,o.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)s.push(c=u[l]),c.parent=o,c.depth=o.depth+1;n&&(o.value=0),o.children=u}else n&&(o.value=+n.call(r,o,o.depth)||0),delete o.children;return Go(i,(function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)})),a}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&&(Fo(e,(function(e){e.children&&(e.value=0)})),Go(e,(function(e){var t;e.children||(e.value=+n.call(r,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},r},o.layout.partition=function(){var e=o.layout.hierarchy(),t=[1,1];function n(n,r){var i=e.call(this,n,r);return function e(t,n,r,i){var o=t.children;if(t.x=n,t.y=t.depth*i,t.dx=r,t.dy=i,o&&(s=o.length)){var s,a,l,u=-1;for(r=t.value?r/t.value:0;++u<s;)e(a=o[u],n,l=a.value*r,i),n+=l}}(i[0],0,t[0],t[1]/function e(t){var n=t.children,r=0;if(n&&(i=n.length))for(var i,o=-1;++o<i;)r=Math.max(r,e(n[o]));return 1+r}(i[0])),i}return n.size=function(e){return arguments.length?(t=e,n):t},ko(n,e)},o.layout.pie=function(){var e=Number,t=Ho,n=0,r=we,i=0;function s(a){var l,u=a.length,c=a.map((function(t,n){return+e.call(s,t,n)})),p=+("function"==typeof n?n.apply(this,arguments):n),d=("function"==typeof r?r.apply(this,arguments):r)-p,f=Math.min(Math.abs(d)/u,+("function"==typeof i?i.apply(this,arguments):i)),h=f*(d<0?-1:1),g=o.sum(c),m=g?(d-u*h)/g:0,v=o.range(u),E=[];return null!=t&&v.sort(t===Ho?function(e,t){return c[t]-c[e]}:function(e,n){return t(a[e],a[n])}),v.forEach((function(e){E[e]={data:a[e],value:l=c[e],startAngle:p,endAngle:p+=l*m+h,padAngle:f}})),E}return s.value=function(t){return arguments.length?(e=t,s):e},s.sort=function(e){return arguments.length?(t=e,s):t},s.startAngle=function(e){return arguments.length?(n=e,s):n},s.endAngle=function(e){return arguments.length?(r=e,s):r},s.padAngle=function(e){return arguments.length?(i=e,s):i},s};var Ho={};function qo(e){return e.x}function zo(e){return e.y}function $o(e,t,n){e.y0=t,e.y=n}o.layout.stack=function(){var e=P,t=Yo,n=Xo,r=$o,i=qo,s=zo;function a(l,u){if(!(f=l.length))return l;var c=l.map((function(t,n){return e.call(a,t,n)})),p=c.map((function(e){return e.map((function(e,t){return[i.call(a,e,t),s.call(a,e,t)]}))})),d=t.call(a,p,u);c=o.permute(c,d),p=o.permute(p,d);var f,h,g,m,v=n.call(a,p,u),E=c[0].length;for(g=0;g<E;++g)for(r.call(a,c[0][g],m=v[g],p[0][g][1]),h=1;h<f;++h)r.call(a,c[h][g],m+=p[h-1][g][1],p[h][g][1]);return l}return a.values=function(t){return arguments.length?(e=t,a):e},a.order=function(e){return arguments.length?(t="function"==typeof e?e:Wo.get(e)||Yo,a):t},a.offset=function(e){return arguments.length?(n="function"==typeof e?e:Qo.get(e)||Xo,a):n},a.x=function(e){return arguments.length?(i=e,a):i},a.y=function(e){return arguments.length?(s=e,a):s},a.out=function(e){return arguments.length?(r=e,a):r},a};var Wo=o.map({"inside-out":function(e){var t,n,r=e.length,i=e.map(Ko),s=e.map(Zo),a=o.range(r).sort((function(e,t){return i[e]-i[t]})),l=0,u=0,c=[],p=[];for(t=0;t<r;++t)n=a[t],l<u?(l+=s[n],c.push(n)):(u+=s[n],p.push(n));return p.reverse().concat(c)},reverse:function(e){return o.range(e.length).reverse()},default:Yo}),Qo=o.map({silhouette:function(e){var t,n,r,i=e.length,o=e[0].length,s=[],a=0,l=[];for(n=0;n<o;++n){for(t=0,r=0;t<i;t++)r+=e[t][n][1];r>a&&(a=r),s.push(r)}for(n=0;n<o;++n)l[n]=(a-s[n])/2;return l},wiggle:function(e){var t,n,r,i,o,s,a,l,u,c=e.length,p=e[0],d=p.length,f=[];for(f[0]=l=u=0,n=1;n<d;++n){for(t=0,i=0;t<c;++t)i+=e[t][n][1];for(t=0,o=0,a=p[n][0]-p[n-1][0];t<c;++t){for(r=0,s=(e[t][n][1]-e[t][n-1][1])/(2*a);r<t;++r)s+=(e[r][n][1]-e[r][n-1][1])/a;o+=s*e[t][n][1]}f[n]=l-=i?o/i*a:0,l<u&&(u=l)}for(n=0;n<d;++n)f[n]-=u;return f},expand:function(e){var t,n,r,i=e.length,o=e[0].length,s=1/i,a=[];for(n=0;n<o;++n){for(t=0,r=0;t<i;t++)r+=e[t][n][1];if(r)for(t=0;t<i;t++)e[t][n][1]/=r;else for(t=0;t<i;t++)e[t][n][1]=s}for(n=0;n<o;++n)a[n]=0;return a},zero:Xo});function Yo(e){return o.range(e.length)}function Xo(e){for(var t=-1,n=e[0].length,r=[];++t<n;)r[t]=0;return r}function Ko(e){for(var t,n=1,r=0,i=e[0][1],o=e.length;n<o;++n)(t=e[n][1])>i&&(r=n,i=t);return r}function Zo(e){return e.reduce(Jo,0)}function Jo(e,t){return e+t[1]}function es(e,t){return ts(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function ts(e,t){for(var n=-1,r=+e[0],i=(e[1]-r)/t,o=[];++n<=t;)o[n]=i*n+r;return o}function ns(e){return[o.min(e),o.max(e)]}function rs(e,t){return e.value-t.value}function is(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function os(e,t){e._pack_next=t,t._pack_prev=e}function ss(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 as(e){if((t=e.children)&&(l=t.length)){var t,n,r,i,o,s,a,l,u=1/0,c=-1/0,p=1/0,d=-1/0;if(t.forEach(ls),(n=t[0]).x=-n.r,n.y=0,x(n),l>1&&((r=t[1]).x=r.r,r.y=0,x(r),l>2))for(cs(n,r,i=t[2]),x(i),is(n,i),n._pack_prev=i,is(i,r),r=n._pack_next,o=3;o<l;o++){cs(n,r,i=t[o]);var f=0,h=1,g=1;for(s=r._pack_next;s!==r;s=s._pack_next,h++)if(ss(s,i)){f=1;break}if(1==f)for(a=n._pack_prev;a!==s._pack_prev&&!ss(a,i);a=a._pack_prev,g++);f?(h<g||h==g&&r.r<n.r?os(n,r=s):os(n=a,r),o--):(is(n,i),r=i,x(i))}var m=(u+c)/2,v=(p+d)/2,E=0;for(o=0;o<l;o++)(i=t[o]).x-=m,i.y-=v,E=Math.max(E,i.r+Math.sqrt(i.x*i.x+i.y*i.y));e.r=E,t.forEach(us)}function x(e){u=Math.min(e.x-e.r,u),c=Math.max(e.x+e.r,c),p=Math.min(e.y-e.r,p),d=Math.max(e.y+e.r,d)}}function ls(e){e._pack_next=e._pack_prev=e}function us(e){delete e._pack_next,delete e._pack_prev}function cs(e,t,n){var r=e.r+n.r,i=t.x-e.x,o=t.y-e.y;if(r&&(i||o)){var s=t.r+n.r,a=i*i+o*o,l=.5+((r*=r)-(s*=s))/(2*a),u=Math.sqrt(Math.max(0,2*s*(r+a)-(r-=a)*r-s*s))/(2*a);n.x=e.x+l*i+u*o,n.y=e.y+l*o-u*i}else n.x=e.x+r,n.y=e.y}function ps(e,t){return e.parent==t.parent?1:2}function ds(e){var t=e.children;return t.length?t[0]:e.t}function fs(e){var t,n=e.children;return(t=n.length)?n[t-1]:e.t}function hs(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 gs(e,t,n){return e.a.parent===t.parent?e.a:n}function ms(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function vs(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],o=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),o<0&&(r+=o/2,o=0),{x:n,y:r,dx:i,dy:o}}function Es(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function xs(e){return e.rangeExtent?e.rangeExtent():Es(e.range())}function ys(e,t,n,r){var i=n(e[0],e[1]),o=r(t[0],t[1]);return function(e){return o(i(e))}}function Ts(e,t){var n,r=0,i=e.length-1,o=e[r],s=e[i];return s<o&&(n=r,r=i,i=n,n=o,o=s,s=n),e[r]=t.floor(o),e[i]=t.ceil(s),e}function Ns(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:Cs}o.layout.histogram=function(){var e=!0,t=Number,n=ns,r=es;function i(i,s){for(var a,l,u=[],c=i.map(t,this),p=n.call(this,c,s),d=r.call(this,p,c,s),f=(s=-1,c.length),h=d.length-1,g=e?1:1/f;++s<h;)(a=u[s]=[]).dx=d[s+1]-(a.x=d[s]),a.y=0;if(h>0)for(s=-1;++s<f;)(l=c[s])>=p[0]&&l<=p[1]&&((a=u[o.bisect(d,l,1,h)-1]).y+=g,a.push(i[s]));return u}return i.value=function(e){return arguments.length?(t=e,i):t},i.range=function(e){return arguments.length?(n=vt(e),i):n},i.bins=function(e){return arguments.length?(r="number"==typeof e?function(t){return ts(t,e)}:vt(e),i):r},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},o.layout.pack=function(){var e,t=o.layout.hierarchy().sort(rs),n=0,r=[1,1];function i(i,o){var s=t.call(this,i,o),a=s[0],l=r[0],u=r[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(a.x=a.y=0,Go(a,(function(e){e.r=+c(e.value)})),Go(a,as),n){var p=n*(e?1:Math.max(2*a.r/l,2*a.r/u))/2;Go(a,(function(e){e.r+=p})),Go(a,as),Go(a,(function(e){e.r-=p}))}return function e(t,n,r,i){var o=t.children;if(t.x=n+=i*t.x,t.y=r+=i*t.y,t.r*=i,o)for(var s=-1,a=o.length;++s<a;)e(o[s],n,r,i)}(a,l/2,u/2,e?1:1/Math.max(2*a.r/l,2*a.r/u)),s}return i.size=function(e){return arguments.length?(r=e,i):r},i.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,i):e},i.padding=function(e){return arguments.length?(n=+e,i):n},ko(i,t)},o.layout.tree=function(){var e=o.layout.hierarchy().sort(null).value(null),t=ps,n=[1,1],r=null;function i(i,o){var u=e.call(this,i,o),c=u[0],p=function(e){var t,n={A:null,children:[e]},r=[n];for(;null!=(t=r.pop());)for(var i,o=t.children,s=0,a=o.length;s<a;++s)r.push((o[s]=i={_:o[s],parent:t,children:(i=o[s].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:s}).a=i);return n.children[0]}(c);if(Go(p,s),p.parent.m=-p.z,Fo(p,a),r)Fo(c,l);else{var d=c,f=c,h=c;Fo(c,(function(e){e.x<d.x&&(d=e),e.x>f.x&&(f=e),e.depth>h.depth&&(h=e)}));var g=t(d,f)/2-d.x,m=n[0]/(f.x+t(f,d)/2+g),v=n[1]/(h.depth||1);Fo(c,(function(e){e.x=(e.x+g)*m,e.y=e.depth*v}))}return u}function s(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n.length){!function(e){var t,n=0,r=0,i=e.children,o=i.length;for(;--o>=0;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,s=e,a=n,l=o.parent.children[0],u=o.m,c=s.m,p=a.m,d=l.m;a=fs(a),o=ds(o),a&&o;)l=ds(l),(s=fs(s)).a=e,(i=a.z+p-o.z-u+t(a._,o._))>0&&(hs(gs(a,e,r),e,i),u+=i,c+=i),p+=a.m,u+=o.m,d+=l.m,c+=s.m;a&&!fs(s)&&(s.t=a,s.m+=p-c),o&&!ds(l)&&(l.t=o,l.m+=u-d,r=e)}return r}(e,i,e.parent.A||r[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=n[0],e.y=e.depth*n[1]}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(r=null==(n=e)?l:null,i):r?null:n},i.nodeSize=function(e){return arguments.length?(r=null==(n=e)?null:l,i):r?n:null},ko(i,e)},o.layout.cluster=function(){var e=o.layout.hierarchy().sort(null).value(null),t=ps,n=[1,1],r=!1;function i(i,s){var a,l=e.call(this,i,s),u=l[0],c=0;Go(u,(function(e){var n=e.children;n&&n.length?(e.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(n),e.y=function(e){return 1+o.max(e,(function(e){return e.y}))}(n)):(e.x=a?c+=t(e,a):0,e.y=0,a=e)}));var p=function e(t){var n=t.children;return n&&n.length?e(n[0]):t}(u),d=function e(t){var n,r=t.children;return r&&(n=r.length)?e(r[n-1]):t}(u),f=p.x-t(p,d)/2,h=d.x+t(d,p)/2;return Go(u,r?function(e){e.x=(e.x-u.x)*n[0],e.y=(u.y-e.y)*n[1]}:function(e){e.x=(e.x-f)/(h-f)*n[0],e.y=(1-(u.y?e.y/u.y:1))*n[1]}),l}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(r=null==(n=e),i):r?null:n},i.nodeSize=function(e){return arguments.length?(r=null!=(n=e),i):r?n:null},ko(i,e)},o.layout.treemap=function(){var e,t=o.layout.hierarchy(),n=Math.round,r=[1,1],i=null,s=ms,a=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(e,t){for(var n,r,i=-1,o=e.length;++i<o;)r=(n=e[i]).value*(t<0?0:t),n.area=isNaN(r)||r<=0?0:r}function p(e){var t=e.children;if(t&&t.length){var n,r,i,o=s(e),a=[],u=t.slice(),d=1/0,g="slice"===l?o.dx:"dice"===l?o.dy:"slice-dice"===l?1&e.depth?o.dy:o.dx:Math.min(o.dx,o.dy);for(c(u,o.dx*o.dy/e.value),a.area=0;(i=u.length)>0;)a.push(n=u[i-1]),a.area+=n.area,"squarify"!==l||(r=f(a,g))<=d?(u.pop(),d=r):(a.area-=a.pop().area,h(a,g,o,!1),g=Math.min(o.dx,o.dy),a.length=a.area=0,d=1/0);a.length&&(h(a,g,o,!0),a.length=a.area=0),t.forEach(p)}}function d(e){var t=e.children;if(t&&t.length){var n,r=s(e),i=t.slice(),o=[];for(c(i,r.dx*r.dy/e.value),o.area=0;n=i.pop();)o.push(n),o.area+=n.area,null!=n.z&&(h(o,n.z?r.dx:r.dy,r,!i.length),o.length=o.area=0);t.forEach(d)}}function f(e,t){for(var n,r=e.area,i=0,o=1/0,s=-1,a=e.length;++s<a;)(n=e[s].area)&&(n<o&&(o=n),n>i&&(i=n));return t*=t,(r*=r)?Math.max(t*i*u/r,r/(t*o*u)):1/0}function h(e,t,r,i){var o,s=-1,a=e.length,l=r.x,u=r.y,c=t?n(e.area/t):0;if(t==r.dx){for((i||c>r.dy)&&(c=r.dy);++s<a;)(o=e[s]).x=l,o.y=u,o.dy=c,l+=o.dx=Math.min(r.x+r.dx-l,c?n(o.area/c):0);o.z=!0,o.dx+=r.x+r.dx-l,r.y+=c,r.dy-=c}else{for((i||c>r.dx)&&(c=r.dx);++s<a;)(o=e[s]).x=l,o.y=u,o.dx=c,u+=o.dy=Math.min(r.y+r.dy-u,c?n(o.area/c):0);o.z=!1,o.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function g(n){var i=e||t(n),o=i[0];return o.x=o.y=0,o.value?(o.dx=r[0],o.dy=r[1]):o.dx=o.dy=0,e&&t.revalue(o),c([o],o.dx*o.dy/o.value),(e?d:p)(o),a&&(e=i),i}return g.size=function(e){return arguments.length?(r=e,g):r},g.padding=function(e){if(!arguments.length)return i;function t(t){var n=e.call(g,t,t.depth);return null==n?ms(t):vs(t,"number"==typeof n?[n,n,n,n]:n)}function n(t){return vs(t,e)}var r;return s=null==(i=e)?ms:"function"==(r=typeof e)?t:"number"===r?(e=[e,e,e,e],n):n,g},g.round=function(e){return arguments.length?(n=e?Math.round:Number,g):n!=Number},g.sticky=function(t){return arguments.length?(a=t,e=null,g):a},g.ratio=function(e){return arguments.length?(u=e,g):u},g.mode=function(e){return arguments.length?(l=e+"",g):l},ko(g,t)},o.random={normal:function(e,t){var n=arguments.length;return n<2&&(t=1),n<1&&(e=0),function(){var n,r,i;do{i=(n=2*Math.random()-1)*n+(r=2*Math.random()-1)*r}while(!i||i>1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=o.random.normal.apply(o,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=o.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t}}},o.scale={};var Cs={floor:P,ceil:P};function Ss(e,t,n,r){var i=[],s=[],a=0,l=Math.min(e.length,t.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<=l;)i.push(n(e[a-1],e[a])),s.push(r(t[a-1],t[a]));return function(t){var n=o.bisect(e,t,1,l)-1;return s[n](i[n](t))}}function Is(e,t){return o.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Ls(e,t){return Ts(e,Ns(As(e,t)[2])),Ts(e,Ns(As(e,t)[2])),e}function As(e,t){null==t&&(t=10);var n=Es(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),o=t/r*i;return o<=.15?i*=10:o<=.35?i*=5:o<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function bs(e,t){return o.range.apply(o,As(e,t))}function Rs(e,t,n){var r=As(e,t);if(n){var i=Mt.exec(n);if(i.shift(),"s"===i[8]){var s=o.formatPrefix(Math.max(N(r[0]),N(r[1])));return i[7]||(i[7]="."+Os(s.scale(r[2]))),i[8]="f",n=o.format(i.join("")),function(e){return n(s.scale(e))+s.symbol}}i[7]||(i[7]="."+function(e,t){var n=Os(t[2]);return e in ws?Math.abs(n-Os(Math.max(N(t[0]),N(t[1]))))+ +("e"!==e):n-2*("%"===e)}(i[8],r)),n=i.join("")}else n=",."+Os(r[2])+"f";return o.format(n)}o.scale.linear=function(){return function e(t,n,r,i){var o,s;function a(){var e=Math.min(t.length,n.length)>2?Ss:ys,a=i?Lo:Io;return o=e(t,n,a,r),s=e(n,t,a,no),l}function l(e){return o(e)}return l.invert=function(e){return s(e)},l.domain=function(e){return arguments.length?(t=e.map(Number),a()):t},l.range=function(e){return arguments.length?(n=e,a()):n},l.rangeRound=function(e){return l.range(e).interpolate(Eo)},l.clamp=function(e){return arguments.length?(i=e,a()):i},l.interpolate=function(e){return arguments.length?(r=e,a()):r},l.ticks=function(e){return bs(t,e)},l.tickFormat=function(e,n){return Rs(t,e,n)},l.nice=function(e){return Ls(t,e),a()},l.copy=function(){return e(t,n,r,i)},a()}([0,1],[0,1],no,!1)};var ws={s:1,g:1,p:1,r:1,e:1};function Os(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}o.scale.log=function(){return function e(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 a(e){return r?Math.pow(n,e):-Math.pow(n,-e)}function l(e){return t(s(e))}return l.invert=function(e){return a(t.invert(e))},l.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((i=e.map(Number)).map(s)),l):i},l.base=function(e){return arguments.length?(n=+e,t.domain(i.map(s)),l):n},l.nice=function(){var e=Ts(i.map(s),r?Math:_s);return t.domain(e),i=e.map(a),l},l.ticks=function(){var e=Es(i),t=[],o=e[0],l=e[1],u=Math.floor(s(o)),c=Math.ceil(s(l)),p=n%1?2:n;if(isFinite(c-u)){if(r){for(;u<c;u++)for(var d=1;d<p;d++)t.push(a(u)*d);t.push(a(u))}else for(t.push(a(u));u++<c;)for(d=p-1;d>0;d--)t.push(a(u)*d);for(u=0;t[u]<o;u++);for(c=t.length;t[c-1]>l;c--);t=t.slice(u,c)}return t},l.tickFormat=function(e,t){if(!arguments.length)return Ms;arguments.length<2?t=Ms:"function"!=typeof t&&(t=o.format(t));var r=Math.max(1,n*e/l.ticks().length);return function(e){var i=e/a(Math.round(s(e)));return i*n<n-.5&&(i*=n),i<=r?t(e):""}},l.copy=function(){return e(t.copy(),n,r,i)},Is(l,t)}(o.scale.linear().domain([0,1]),10,!0,[1,10])};var Ms=o.format(".0e"),_s={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function Ps(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}o.scale.pow=function(){return function e(t,n,r){var i=Ps(n),o=Ps(1/n);function s(e){return t(i(e))}return s.invert=function(e){return o(t.invert(e))},s.domain=function(e){return arguments.length?(t.domain((r=e.map(Number)).map(i)),s):r},s.ticks=function(e){return bs(r,e)},s.tickFormat=function(e,t){return Rs(r,e,t)},s.nice=function(e){return s.domain(Ls(r,e))},s.exponent=function(e){return arguments.length?(i=Ps(n=e),o=Ps(1/n),t.domain(r.map(i)),s):n},s.copy=function(){return e(t.copy(),n,r)},Is(s,t)}(o.scale.linear(),1,[0,1])},o.scale.sqrt=function(){return o.scale.pow().exponent(.5)},o.scale.ordinal=function(){return function e(t,n){var r,i,s;function a(e){return i[((r.get(e)||("range"===n.t?r.set(e,t.push(e)):NaN))-1)%i.length]}function l(e,n){return o.range(t.length).map((function(t){return e+n*t}))}return a.domain=function(e){if(!arguments.length)return t;t=[],r=new I;for(var i,o=-1,s=e.length;++o<s;)r.has(i=e[o])||r.set(i,t.push(i));return a[n.t].apply(a,n.a)},a.range=function(e){return arguments.length?(i=e,s=0,n={t:"range",a:arguments},a):i},a.rangePoints=function(e,r){arguments.length<2&&(r=0);var o=e[0],u=e[1],c=t.length<2?(o=(o+u)/2,0):(u-o)/(t.length-1+r);return i=l(o+c*r/2,c),s=0,n={t:"rangePoints",a:arguments},a},a.rangeRoundPoints=function(e,r){arguments.length<2&&(r=0);var o=e[0],u=e[1],c=t.length<2?(o=u=Math.round((o+u)/2),0):(u-o)/(t.length-1+r)|0;return i=l(o+Math.round(c*r/2+(u-o-(t.length-1+r)*c)/2),c),s=0,n={t:"rangeRoundPoints",a:arguments},a},a.rangeBands=function(e,r,o){arguments.length<2&&(r=0),arguments.length<3&&(o=r);var u=e[1]<e[0],c=e[u-0],p=e[1-u],d=(p-c)/(t.length-r+2*o);return i=l(c+d*o,d),u&&i.reverse(),s=d*(1-r),n={t:"rangeBands",a:arguments},a},a.rangeRoundBands=function(e,r,o){arguments.length<2&&(r=0),arguments.length<3&&(o=r);var u=e[1]<e[0],c=e[u-0],p=e[1-u],d=Math.floor((p-c)/(t.length-r+2*o));return i=l(c+Math.round((p-c-(t.length-r)*d)/2),d),u&&i.reverse(),s=Math.round(d*(1-r)),n={t:"rangeRoundBands",a:arguments},a},a.rangeBand=function(){return s},a.rangeExtent=function(){return Es(n.a[0])},a.copy=function(){return e(t,n)},a.domain(t)}([],{t:"range",a:[[]]})},o.scale.category10=function(){return o.scale.ordinal().range(Ds)},o.scale.category20=function(){return o.scale.ordinal().range(ks)},o.scale.category20b=function(){return o.scale.ordinal().range(Fs)},o.scale.category20c=function(){return o.scale.ordinal().range(Gs)};var Ds=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(lt),ks=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(lt),Fs=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(lt),Gs=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(lt);function Us(){return 0}o.scale.quantile=function(){return function e(t,n){var r;function i(){var e=0,i=n.length;for(r=[];++e<i;)r[e-1]=o.quantile(t,e/i);return s}function s(e){if(!isNaN(e=+e))return n[o.bisect(r,e)]}return s.domain=function(e){return arguments.length?(t=e.map(v).filter(E).sort(m),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))<0?[NaN,NaN]:[e>0?r[e-1]:t[0],e<r.length?r[e]:t[t.length-1]]},s.copy=function(){return e(t,n)},i()}([],[])},o.scale.quantize=function(){return function e(t,n,r){var i,o;function s(e){return r[Math.max(0,Math.min(o,Math.floor(i*(e-t))))]}function a(){return i=r.length/(n-t),o=r.length-1,s}return s.domain=function(e){return arguments.length?(t=+e[0],n=+e[e.length-1],a()):[t,n]},s.range=function(e){return arguments.length?(r=e,a()):r},s.invertExtent=function(e){return[e=(e=r.indexOf(e))<0?NaN:e/i+t,e+1/i]},s.copy=function(){return e(t,n,r)},a()}(0,1,[0,1])},o.scale.threshold=function(){return function e(t,n){function r(e){if(e<=e)return n[o.bisect(t,e)]}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 e(t,n)},r}([.5],[0,1])},o.scale.identity=function(){return function e(t){function n(e){return+e}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=e.map(n),n):t},n.ticks=function(e){return bs(t,e)},n.tickFormat=function(e,n){return Rs(t,e,n)},n.copy=function(){return e(t)},n}([0,1])},o.svg={},o.svg.arc=function(){var e=js,t=Vs,n=Us,r=Bs,i=Hs,o=qs,s=zs;function a(){var a=Math.max(0,+e.apply(this,arguments)),u=Math.max(0,+t.apply(this,arguments)),c=i.apply(this,arguments)-Me,p=o.apply(this,arguments)-Me,d=Math.abs(p-c),f=c>p?0:1;if(u<a&&(h=u,u=a,a=h),d>=Oe)return l(u,f)+(a?l(a,1-f):"")+"Z";var h,g,m,v,E,x,y,T,N,C,S,I,L=0,A=0,b=[];if((v=(+s.apply(this,arguments)||0)/2)&&(m=r===Bs?Math.sqrt(a*a+u*u):+r.apply(this,arguments),f||(A*=-1),u&&(A=Ge(m/u*Math.sin(v))),a&&(L=Ge(m/a*Math.sin(v)))),u){E=u*Math.cos(c+A),x=u*Math.sin(c+A),y=u*Math.cos(p-A),T=u*Math.sin(p-A);var R=Math.abs(p-c-2*A)<=Re?0:1;if(A&&$s(E,x,y,T)===f^R){var w=(c+p)/2;E=u*Math.cos(w),x=u*Math.sin(w),y=T=null}}else E=x=0;if(a){N=a*Math.cos(p-L),C=a*Math.sin(p-L),S=a*Math.cos(c+L),I=a*Math.sin(c+L);var O=Math.abs(c-p+2*L)<=Re?0:1;if(L&&$s(N,C,S,I)===1-f^O){var M=(c+p)/2;N=a*Math.cos(M),C=a*Math.sin(M),S=I=null}}else N=C=0;if(d>Ae&&(h=Math.min(Math.abs(u-a)/2,+n.apply(this,arguments)))>.001){g=a<u^f?0:1;var _=h,P=h;if(d<Re){var D=null==S?[N,C]:null==y?[E,x]:pi([E,x],[S,I],[y,T],[N,C]),k=E-D[0],F=x-D[1],G=y-D[0],U=T-D[1],B=1/Math.sin(Math.acos((k*G+F*U)/(Math.sqrt(k*k+F*F)*Math.sqrt(G*G+U*U)))/2),j=Math.sqrt(D[0]*D[0]+D[1]*D[1]);P=Math.min(h,(a-j)/(B-1)),_=Math.min(h,(u-j)/(B+1))}if(null!=y){var V=Ws(null==S?[N,C]:[S,I],[E,x],u,_,f),H=Ws([y,T],[N,C],u,_,f);h===_?b.push("M",V[0],"A",_,",",_," 0 0,",g," ",V[1],"A",u,",",u," 0 ",1-f^$s(V[1][0],V[1][1],H[1][0],H[1][1]),",",f," ",H[1],"A",_,",",_," 0 0,",g," ",H[0]):b.push("M",V[0],"A",_,",",_," 0 1,",g," ",H[0])}else b.push("M",E,",",x);if(null!=S){var q=Ws([E,x],[S,I],a,-P,f),z=Ws([N,C],null==y?[E,x]:[y,T],a,-P,f);h===P?b.push("L",z[0],"A",P,",",P," 0 0,",g," ",z[1],"A",a,",",a," 0 ",f^$s(z[1][0],z[1][1],q[1][0],q[1][1]),",",1-f," ",q[1],"A",P,",",P," 0 0,",g," ",q[0]):b.push("L",z[0],"A",P,",",P," 0 0,",g," ",q[0])}else b.push("L",N,",",C)}else b.push("M",E,",",x),null!=y&&b.push("A",u,",",u," 0 ",R,",",f," ",y,",",T),b.push("L",N,",",C),null!=S&&b.push("A",a,",",a," 0 ",O,",",1-f," ",S,",",I);return b.push("Z"),b.join("")}function l(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+-e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}return a.innerRadius=function(t){return arguments.length?(e=vt(t),a):e},a.outerRadius=function(e){return arguments.length?(t=vt(e),a):t},a.cornerRadius=function(e){return arguments.length?(n=vt(e),a):n},a.padRadius=function(e){return arguments.length?(r=e==Bs?Bs:vt(e),a):r},a.startAngle=function(e){return arguments.length?(i=vt(e),a):i},a.endAngle=function(e){return arguments.length?(o=vt(e),a):o},a.padAngle=function(e){return arguments.length?(s=vt(e),a):s},a.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Me;return[Math.cos(r)*n,Math.sin(r)*n]},a};var Bs="auto";function js(e){return e.innerRadius}function Vs(e){return e.outerRadius}function Hs(e){return e.startAngle}function qs(e){return e.endAngle}function zs(e){return e&&e.padAngle}function $s(e,t,n,r){return(e-n)*t-(t-r)*e>0?0:1}function Ws(e,t,n,r,i){var o=e[0]-t[0],s=e[1]-t[1],a=(i?r:-r)/Math.sqrt(o*o+s*s),l=a*s,u=-a*o,c=e[0]+l,p=e[1]+u,d=t[0]+l,f=t[1]+u,h=(c+d)/2,g=(p+f)/2,m=d-c,v=f-p,E=m*m+v*v,x=n-r,y=c*f-d*p,T=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*E-y*y)),N=(y*v-m*T)/E,C=(-y*m-v*T)/E,S=(y*v+m*T)/E,I=(-y*m+v*T)/E,L=N-h,A=C-g,b=S-h,R=I-g;return L*L+A*A>b*b+R*R&&(N=S,C=I),[[N-l,C-u],[N*n/x,C*n/x]]}function Qs(e){var t=oi,n=si,r=Xn,i=Xs,o=i.key,s=.7;function a(o){var a,l=[],u=[],c=-1,p=o.length,d=vt(t),f=vt(n);function h(){l.push("M",i(e(u),s))}for(;++c<p;)r.call(this,a=o[c],c)?u.push([+d.call(this,a,c),+f.call(this,a,c)]):u.length&&(h(),u=[]);return u.length&&h(),l.length?l.join(""):null}return a.x=function(e){return arguments.length?(t=e,a):t},a.y=function(e){return arguments.length?(n=e,a):n},a.defined=function(e){return arguments.length?(r=e,a):r},a.interpolate=function(e){return arguments.length?(o="function"==typeof e?i=e:(i=Ys.get(e)||Xs).key,a):o},a.tension=function(e){return arguments.length?(s=e,a):s},a}o.svg.line=function(){return Qs(P)};var Ys=o.map({linear:Xs,"linear-closed":Ks,step:function(e){var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];for(;++t<n;)i.push("H",(r[0]+(r=e[t])[0])/2,"V",r[1]);n>1&&i.push("H",r[0]);return i.join("")},"step-before":Zs,"step-after":Js,basis:na,"basis-open":function(e){if(e.length<4)return Xs(e);var t,n=[],r=-1,i=e.length,o=[0],s=[0];for(;++r<3;)t=e[r],o.push(t[0]),s.push(t[1]);n.push(ra(sa,o)+","+ra(sa,s)),--r;for(;++r<i;)t=e[r],o.shift(),o.push(t[0]),s.shift(),s.push(t[1]),aa(n,o,s);return n.join("")},"basis-closed":function(e){var t,n,r=-1,i=e.length,o=i+4,s=[],a=[];for(;++r<4;)n=e[r%i],s.push(n[0]),a.push(n[1]);t=[ra(sa,s),",",ra(sa,a)],--r;for(;++r<o;)n=e[r%i],s.shift(),s.push(n[0]),a.shift(),a.push(n[1]),aa(t,s,a);return t.join("")},bundle:function(e,t){var n=e.length-1;if(n)for(var r,i,o=e[0][0],s=e[0][1],a=e[n][0]-o,l=e[n][1]-s,u=-1;++u<=n;)r=e[u],i=u/n,r[0]=t*r[0]+(1-t)*(o+i*a),r[1]=t*r[1]+(1-t)*(s+i*l);return na(e)},cardinal:function(e,t){return e.length<3?Xs(e):e[0]+ea(e,ta(e,t))},"cardinal-open":function(e,t){return e.length<4?Xs(e):e[1]+ea(e.slice(1,-1),ta(e,t))},"cardinal-closed":function(e,t){return e.length<3?Ks(e):e[0]+ea((e.push(e[0]),e),ta([e[e.length-2]].concat(e,[e[1]]),t))},monotone:function(e){return e.length<3?Xs(e):e[0]+ea(e,function(e){var t,n,r,i,o=[],s=function(e){var t=0,n=e.length-1,r=[],i=e[0],o=e[1],s=r[0]=la(i,o);for(;++t<n;)r[t]=(s+(s=la(i=o,o=e[t+1])))/2;return r[t]=s,r}(e),a=-1,l=e.length-1;for(;++a<l;)t=la(e[a],e[a+1]),N(t)<Ae?s[a]=s[a+1]=0:(n=s[a]/t,r=s[a+1]/t,(i=n*n+r*r)>9&&(i=3*t/Math.sqrt(i),s[a]=i*n,s[a+1]=i*r));a=-1;for(;++a<=l;)i=(e[Math.min(l,a+1)][0]-e[Math.max(0,a-1)][0])/(6*(1+s[a]*s[a])),o.push([i||0,s[a]*i||0]);return o}(e))}});function Xs(e){return e.length>1?e.join("L"):e+"Z"}function Ks(e){return e.join("L")+"Z"}function Zs(e){for(var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];++t<n;)i.push("V",(r=e[t])[1],"H",r[0]);return i.join("")}function Js(e){for(var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];++t<n;)i.push("H",(r=e[t])[0],"V",r[1]);return i.join("")}function ea(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return Xs(e);var n=e.length!=t.length,r="",i=e[0],o=e[1],s=t[0],a=s,l=1;if(n&&(r+="Q"+(o[0]-2*s[0]/3)+","+(o[1]-2*s[1]/3)+","+o[0]+","+o[1],i=e[1],l=2),t.length>1){a=t[1],o=e[l],l++,r+="C"+(i[0]+s[0])+","+(i[1]+s[1])+","+(o[0]-a[0])+","+(o[1]-a[1])+","+o[0]+","+o[1];for(var u=2;u<t.length;u++,l++)o=e[l],a=t[u],r+="S"+(o[0]-a[0])+","+(o[1]-a[1])+","+o[0]+","+o[1]}if(n){var c=e[l];r+="Q"+(o[0]+2*a[0]/3)+","+(o[1]+2*a[1]/3)+","+c[0]+","+c[1]}return r}function ta(e,t){for(var n,r=[],i=(1-t)/2,o=e[0],s=e[1],a=1,l=e.length;++a<l;)n=o,o=s,s=e[a],r.push([i*(s[0]-n[0]),i*(s[1]-n[1])]);return r}function na(e){if(e.length<3)return Xs(e);var t=1,n=e.length,r=e[0],i=r[0],o=r[1],s=[i,i,i,(r=e[1])[0]],a=[o,o,o,r[1]],l=[i,",",o,"L",ra(sa,s),",",ra(sa,a)];for(e.push(e[n-1]);++t<=n;)r=e[t],s.shift(),s.push(r[0]),a.shift(),a.push(r[1]),aa(l,s,a);return e.pop(),l.push("L",r),l.join("")}function ra(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}Ys.forEach((function(e,t){t.key=e,t.closed=/-closed$/.test(e)}));var ia=[0,2/3,1/3,0],oa=[0,1/3,2/3,0],sa=[0,1/6,2/3,1/6];function aa(e,t,n){e.push("C",ra(ia,t),",",ra(ia,n),",",ra(oa,t),",",ra(oa,n),",",ra(sa,t),",",ra(sa,n))}function la(e,t){return(t[1]-e[1])/(t[0]-e[0])}function ua(e){for(var t,n,r,i=-1,o=e.length;++i<o;)n=(t=e[i])[0],r=t[1]-Me,t[0]=n*Math.cos(r),t[1]=n*Math.sin(r);return e}function ca(e){var t=oi,n=oi,r=0,i=si,o=Xn,s=Xs,a=s.key,l=s,u="L",c=.7;function p(a){var p,d,f,h=[],g=[],m=[],v=-1,E=a.length,x=vt(t),y=vt(r),T=t===n?function(){return d}:vt(n),N=r===i?function(){return f}:vt(i);function C(){h.push("M",s(e(m),c),u,l(e(g.reverse()),c),"Z")}for(;++v<E;)o.call(this,p=a[v],v)?(g.push([d=+x.call(this,p,v),f=+y.call(this,p,v)]),m.push([+T.call(this,p,v),+N.call(this,p,v)])):g.length&&(C(),g=[],m=[]);return g.length&&C(),h.length?h.join(""):null}return p.x=function(e){return arguments.length?(t=n=e,p):n},p.x0=function(e){return arguments.length?(t=e,p):t},p.x1=function(e){return arguments.length?(n=e,p):n},p.y=function(e){return arguments.length?(r=i=e,p):i},p.y0=function(e){return arguments.length?(r=e,p):r},p.y1=function(e){return arguments.length?(i=e,p):i},p.defined=function(e){return arguments.length?(o=e,p):o},p.interpolate=function(e){return arguments.length?(a="function"==typeof e?s=e:(s=Ys.get(e)||Xs).key,l=s.reverse||s,u=s.closed?"M":"L",p):a},p.tension=function(e){return arguments.length?(c=e,p):c},p}function pa(e){return e.radius}function da(e){return[e.x,e.y]}function fa(e){return function(){var t=e.apply(this,arguments),n=t[0],r=t[1]-Me;return[n*Math.cos(r),n*Math.sin(r)]}}function ha(){return 64}function ga(){return"circle"}function ma(e){var t=Math.sqrt(e/Re);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}o.svg.line.radial=function(){var e=Qs(ua);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},Zs.reverse=Js,Js.reverse=Zs,o.svg.area=function(){return ca(P)},o.svg.area.radial=function(){var e=ca(ua);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},o.svg.chord=function(){var e=zr,t=$r,n=pa,r=Hs,i=qs;function o(n,r){var i,o,u=s(this,e,n,r),c=s(this,t,n,r),p=function(e){return!(Math.abs(1e3*e.p0[0]-1e3*e.p1[0])<1&&Math.abs(1e3*e.p0[1]-1e3*e.p1[1])<1)};return"M"+u.p0+(p(u)?a(u.r,u.p1,u.a1-u.a0):"")+(o=c,((i=u).a0==o.a0&&i.a1==o.a1?l(u.r,u.p1,u.r,u.p0):l(u.r,u.p1,c.r,c.p0)+(p(c)?a(c.r,c.p1,c.a1-c.a0):"")+l(c.r,c.p1,u.r,u.p0))+"Z")}function s(e,t,o,s){var a=t.call(e,o,s),l=n.call(e,a,s),u=r.call(e,a,s)-Me,c=i.call(e,a,s)-Me;return{r:l,a0:u,a1:c,p0:[l*Math.cos(u),l*Math.sin(u)],p1:[l*Math.cos(c),l*Math.sin(c)]}}function a(e,t,n){return"A"+e+","+e+" 0 "+ +(n>Re)+",1 "+t}function l(e,t,n,r){return"Q 0,0 "+r}return o.radius=function(e){return arguments.length?(n=vt(e),o):n},o.source=function(t){return arguments.length?(e=vt(t),o):e},o.target=function(e){return arguments.length?(t=vt(e),o):t},o.startAngle=function(e){return arguments.length?(r=vt(e),o):r},o.endAngle=function(e){return arguments.length?(i=vt(e),o):i},o},o.svg.diagonal=function(){var e=zr,t=$r,n=da;function r(r,i){var o=e.call(this,r,i),s=t.call(this,r,i),a=(o.y+s.y)/2,l=[o,{x:o.x,y:a},{x:s.x,y:a},s];return"M"+(l=l.map(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return r.source=function(t){return arguments.length?(e=vt(t),r):e},r.target=function(e){return arguments.length?(t=vt(e),r):t},r.projection=function(e){return arguments.length?(n=e,r):n},r},o.svg.diagonal.radial=function(){var e=o.svg.diagonal(),t=da,n=e.projection;return e.projection=function(e){return arguments.length?n(fa(t=e)):t},e},o.svg.symbol=function(){var e=ga,t=ha;function n(n,r){return(va.get(e.call(this,n,r))||ma)(t.call(this,n,r))}return n.type=function(t){return arguments.length?(e=vt(t),n):e},n.size=function(e){return arguments.length?(t=vt(e),n):t},n};var va=o.map({circle:ma,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*xa)),n=t*xa;return"M0,"+-t+"L"+n+",0 0,"+t+" "+-n+",0Z"},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/Ea),n=t*Ea/2;return"M0,"+n+"L"+t+","+-n+" "+-t+","+-n+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Ea),n=t*Ea/2;return"M0,"+-n+"L"+t+","+n+" "+-t+","+n+"Z"}});o.svg.symbolTypes=va.keys();var Ea=Math.sqrt(3),xa=Math.tan(30*_e);X.transition=function(e){for(var t,n,r=Ca||++La,i=Ra(e),o=[],s=Sa||{time:Date.now(),ease:fo,delay:0,duration:250},a=-1,l=this.length;++a<l;){o.push(t=[]);for(var u=this[a],c=-1,p=u.length;++c<p;)(n=u[c])&&wa(n,c,i,r,s),t.push(n)}return Na(o,i,r)},X.interrupt=function(e){return this.each(null==e?ya:Ta(Ra(e)))};var ya=Ta(Ra());function Ta(e){return function(){var t,n,r;(t=this[e])&&(r=t[n=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[n]:delete this[e],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Na(e,t,n){return z(e,Ia),e.namespace=t,e.id=n,e}var Ca,Sa,Ia=[],La=0;function Aa(e,t,n,r){var i=e.id,o=e.namespace;return fe(e,"function"==typeof n?function(e,s,a){e[o][i].tween.set(t,r(n.call(e,e.__data__,s,a)))}:(n=r(n),function(e){e[o][i].tween.set(t,n)}))}function ba(e){return null==e&&(e=""),function(){this.textContent=e}}function Ra(e){return null==e?"__transition__":"__transition_"+e+"__"}function wa(e,t,n,r,i){var o,s,a,l,u,c=e[n]||(e[n]={active:0,count:0}),p=c[r];function d(n){var i=c.active,d=c[i];for(var h in d&&(d.timer.c=null,d.timer.t=NaN,--c.count,delete c[i],d.event&&d.event.interrupt.call(e,e.__data__,d.index)),c)if(+h<r){var g=c[h];g.timer.c=null,g.timer.t=NaN,--c.count,delete c[h]}s.c=f,It((function(){return s.c&&f(n||1)&&(s.c=null,s.t=NaN),1}),0,o),c.active=r,p.event&&p.event.start.call(e,e.__data__,t),u=[],p.tween.forEach((function(n,r){(r=r.call(e,e.__data__,t))&&u.push(r)})),l=p.ease,a=p.duration}function f(i){for(var o=i/a,s=l(o),d=u.length;d>0;)u[--d].call(e,s);if(o>=1)return p.event&&p.event.end.call(e,e.__data__,t),--c.count?delete c[r]:delete e[n],1}p||(o=i.time,s=It((function(e){var t=p.delay;if(s.t=t+o,t<=e)return d(e-t);s.c=d}),0,o),p=c[r]={tween:new I,time:o,timer:s,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++c.count)}Ia.call=X.call,Ia.empty=X.empty,Ia.node=X.node,Ia.size=X.size,o.transition=function(e,t){return e&&e.transition?Ca?e.transition(t):e:o.selection().transition(e)},o.transition.prototype=Ia,Ia.select=function(e){var t,n,r,i=this.id,o=this.namespace,s=[];e=K(e);for(var a=-1,l=this.length;++a<l;){s.push(t=[]);for(var u=this[a],c=-1,p=u.length;++c<p;)(r=u[c])&&(n=e.call(r,r.__data__,c,a))?("__data__"in r&&(n.__data__=r.__data__),wa(n,c,o,i,r[o][i]),t.push(n)):t.push(null)}return Na(s,o,i)},Ia.selectAll=function(e){var t,n,r,i,o,s=this.id,a=this.namespace,l=[];e=Z(e);for(var u=-1,c=this.length;++u<c;)for(var p=this[u],d=-1,f=p.length;++d<f;)if(r=p[d]){o=r[a][s],n=e.call(r,r.__data__,d,u),l.push(t=[]);for(var h=-1,g=n.length;++h<g;)(i=n[h])&&wa(i,h,a,s,o),t.push(i)}return Na(l,a,s)},Ia.filter=function(e){var t,n,r=[];"function"!=typeof e&&(e=pe(e));for(var i=0,o=this.length;i<o;i++){r.push(t=[]);for(var s,a=0,l=(s=this[i]).length;a<l;a++)(n=s[a])&&e.call(n,n.__data__,a,i)&&t.push(n)}return Na(r,this.namespace,this.id)},Ia.tween=function(e,t){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(e):fe(this,null==t?function(t){t[r][n].tween.remove(e)}:function(i){i[r][n].tween.set(e,t)})},Ia.attr=function(e,t){if(arguments.length<2){for(t in e)this.attr(t,e[t]);return this}var n="transform"==e?So:no,r=o.ns.qualify(e);function i(){this.removeAttribute(r)}function s(){this.removeAttributeNS(r.space,r.local)}function a(e){return null==e?i:(e+="",function(){var t,i=this.getAttribute(r);return i!==e&&(t=n(i,e),function(e){this.setAttribute(r,t(e))})})}function l(e){return null==e?s:(e+="",function(){var t,i=this.getAttributeNS(r.space,r.local);return i!==e&&(t=n(i,e),function(e){this.setAttributeNS(r.space,r.local,t(e))})})}return Aa(this,"attr."+e,t,r.local?l:a)},Ia.attrTween=function(e,t){var n=o.ns.qualify(e);return this.tween("attr."+e,n.local?function(e,r){var i=t.call(this,e,r,this.getAttributeNS(n.space,n.local));return i&&function(e){this.setAttributeNS(n.space,n.local,i(e))}}:function(e,r){var i=t.call(this,e,r,this.getAttribute(n));return i&&function(e){this.setAttribute(n,i(e))}})},Ia.style=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=""),e)this.style(n,e[n],t);return this}n=""}function i(){this.style.removeProperty(e)}function o(t){return null==t?i:(t+="",function(){var r,i=c(this).getComputedStyle(this,null).getPropertyValue(e);return i!==t&&(r=no(i,t),function(t){this.style.setProperty(e,r(t),n)})})}return Aa(this,"style."+e,t,o)},Ia.styleTween=function(e,t,n){function r(r,i){var o=t.call(this,r,i,c(this).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)},Ia.text=function(e){return Aa(this,"text",e,ba)},Ia.remove=function(){var e=this.namespace;return this.each("end.transition",(function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)}))},Ia.ease=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].ease:("function"!=typeof e&&(e=o.ease.apply(o,arguments)),fe(this,(function(r){r[n][t].ease=e})))},Ia.delay=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].delay:fe(this,"function"==typeof e?function(r,i,o){r[n][t].delay=+e.call(r,r.__data__,i,o)}:(e=+e,function(r){r[n][t].delay=e}))},Ia.duration=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].duration:fe(this,"function"==typeof e?function(r,i,o){r[n][t].duration=Math.max(1,e.call(r,r.__data__,i,o))}:(e=Math.max(1,e),function(r){r[n][t].duration=e}))},Ia.each=function(e,t){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Sa,s=Ca;try{Ca=n,fe(this,(function(t,i,o){Sa=t[r][n],e.call(t,t.__data__,i,o)}))}finally{Sa=i,Ca=s}}else fe(this,(function(i){var s=i[r][n];(s.event||(s.event=o.dispatch("start","end","interrupt"))).on(e,t)}));return this},Ia.transition=function(){for(var e,t,n,r=this.id,i=++La,o=this.namespace,s=[],a=0,l=this.length;a<l;a++){s.push(e=[]);for(var u,c=0,p=(u=this[a]).length;c<p;c++)(t=u[c])&&wa(t,c,o,i,{time:(n=t[o][r]).time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration}),e.push(t)}return Na(s,o,i)},o.svg.axis=function(){var e,t=o.scale.linear(),n=Oa,r=6,i=6,s=3,l=[10],u=null;function c(a){a.each((function(){var a,c=o.select(this),p=this.__chart__||t,d=this.__chart__=t.copy(),f=null==u?d.ticks?d.ticks.apply(d,l):d.domain():u,h=null==e?d.tickFormat?d.tickFormat.apply(d,l):P:e,g=c.selectAll(".tick").data(f,d),m=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Ae),v=o.transition(g.exit()).style("opacity",Ae).remove(),E=o.transition(g.order()).style("opacity",1),x=Math.max(r,0)+s,y=xs(d),T=c.selectAll(".domain").data([0]),N=(T.enter().append("path").attr("class","domain"),o.transition(T));m.append("line"),m.append("text");var C,S,I,L,A=m.select("line"),b=E.select("line"),R=g.select("text").text(h),w=m.select("text"),O=E.select("text"),M="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(a=_a,C="x",I="y",S="x2",L="y2",R.attr("dy",M<0?"0em":".71em").style("text-anchor","middle"),N.attr("d","M"+y[0]+","+M*i+"V0H"+y[1]+"V"+M*i)):(a=Pa,C="y",I="x",S="y2",L="x2",R.attr("dy",".32em").style("text-anchor",M<0?"end":"start"),N.attr("d","M"+M*i+","+y[0]+"H0V"+y[1]+"H"+M*i)),A.attr(L,M*r),w.attr(I,M*x),b.attr(S,0).attr(L,M*r),O.attr(C,0).attr(I,M*x),d.rangeBand){var _=d,D=_.rangeBand()/2;p=d=function(e){return _(e)+D}}else p.rangeBand?p=d:v.call(a,d,p);m.call(a,p,d),E.call(a,d,d)}))}return c.scale=function(e){return arguments.length?(t=e,c):t},c.orient=function(e){return arguments.length?(n=e in Ma?e+"":Oa,c):n},c.ticks=function(){return arguments.length?(l=a(arguments),c):l},c.tickValues=function(e){return arguments.length?(u=e,c):u},c.tickFormat=function(t){return arguments.length?(e=t,c):e},c.tickSize=function(e){var t=arguments.length;return t?(r=+e,i=+arguments[t-1],c):r},c.innerTickSize=function(e){return arguments.length?(r=+e,c):r},c.outerTickSize=function(e){return arguments.length?(i=+e,c):i},c.tickPadding=function(e){return arguments.length?(s=+e,c):s},c.tickSubdivide=function(){return arguments.length&&c},c};var Oa="bottom",Ma={top:1,right:1,bottom:1,left:1};function _a(e,t,n){e.attr("transform",(function(e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"}))}function Pa(e,t,n){e.attr("transform",(function(e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"}))}o.svg.brush=function(){var e,t,n=H(d,"brushstart","brush","brushend"),r=null,i=null,s=[0,0],a=[0,0],l=!0,u=!0,p=ka[0];function d(e){e.each((function(){var e=o.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",m).on("touchstart.brush",m),t=e.selectAll(".background").data([0]);t.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(p,P);n.exit().remove(),n.enter().append("g").attr("class",(function(e){return"resize "+e})).style("cursor",(function(e){return Da[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"),n.style("display",d.empty()?"none":null);var s,a=o.transition(e),l=o.transition(t);r&&(s=xs(r),l.attr("x",s[0]).attr("width",s[1]-s[0]),h(a)),i&&(s=xs(i),l.attr("y",s[0]).attr("height",s[1]-s[0]),g(a)),f(a)}))}function f(e){e.selectAll(".resize").attr("transform",(function(e){return"translate("+s[+/e$/.test(e)]+","+a[+/^s/.test(e)]+")"}))}function h(e){e.select(".extent").attr("x",s[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function g(e){e.select(".extent").attr("y",a[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",a[1]-a[0])}function m(){var p,m,v=this,E=o.select(o.event.target),x=n.of(v,arguments),y=o.select(v),T=E.datum(),N=!/^(n|s)$/.test(T)&&r,C=!/^(e|w)$/.test(T)&&i,S=E.classed("extent"),I=Ce(v),L=o.mouse(v),A=o.select(c(v)).on("keydown.brush",w).on("keyup.brush",O);if(o.event.changedTouches?A.on("touchmove.brush",M).on("touchend.brush",P):A.on("mousemove.brush",M).on("mouseup.brush",P),y.interrupt().selectAll("*").interrupt(),S)L[0]=s[0]-L[0],L[1]=a[0]-L[1];else if(T){var b=+/w$/.test(T),R=+/^n/.test(T);m=[s[1-b]-L[0],a[1-R]-L[1]],L[0]=s[b],L[1]=a[R]}else o.event.altKey&&(p=L.slice());function w(){32==o.event.keyCode&&(S||(p=null,L[0]-=s[1],L[1]-=a[1],S=2),j())}function O(){32==o.event.keyCode&&2==S&&(L[0]+=s[1],L[1]+=a[1],S=0,j())}function M(){var e=o.mouse(v),t=!1;m&&(e[0]+=m[0],e[1]+=m[1]),S||(o.event.altKey?(p||(p=[(s[0]+s[1])/2,(a[0]+a[1])/2]),L[0]=s[+(e[0]<p[0])],L[1]=a[+(e[1]<p[1])]):p=null),N&&_(e,r,0)&&(h(y),t=!0),C&&_(e,i,1)&&(g(y),t=!0),t&&(f(y),x({type:"brush",mode:S?"move":"resize"}))}function _(n,r,i){var o,c,d=xs(r),f=d[0],h=d[1],g=L[i],m=i?a:s,v=m[1]-m[0];if(S&&(f-=g,h-=v+g),o=(i?u:l)?Math.max(f,Math.min(h,n[i])):n[i],S?c=(o+=g)+v:(p&&(g=Math.max(f,Math.min(h,2*p[i]-o))),g<o?(c=o,o=g):c=g),m[0]!=o||m[1]!=c)return i?t=null:e=null,m[0]=o,m[1]=c,!0}function P(){M(),y.style("pointer-events","all").selectAll(".resize").style("display",d.empty()?"none":null),o.select("body").style("cursor",null),A.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),I(),x({type:"brushend"})}y.style("pointer-events","none").selectAll(".resize").style("display",null),o.select("body").style("cursor",E.style("cursor")),x({type:"brushstart"}),M()}return d.event=function(r){r.each((function(){var r=n.of(this,arguments),i={x:s,y:a,i:e,j:t},l=this.__chart__||i;this.__chart__=i,Ca?o.select(this).transition().each("start.brush",(function(){e=l.i,t=l.j,s=l.x,a=l.y,r({type:"brushstart"})})).tween("brush:brush",(function(){var n=ro(s,i.x),o=ro(a,i.y);return e=t=null,function(e){s=i.x=n(e),a=i.y=o(e),r({type:"brush",mode:"resize"})}})).each("end.brush",(function(){e=i.i,t=i.j,r({type:"brush",mode:"resize"}),r({type:"brushend"})})):(r({type:"brushstart"}),r({type:"brush",mode:"resize"}),r({type:"brushend"}))}))},d.x=function(e){return arguments.length?(p=ka[!(r=e)<<1|!i],d):r},d.y=function(e){return arguments.length?(p=ka[!r<<1|!(i=e)],d):i},d.clamp=function(e){return arguments.length?(r&&i?(l=!!e[0],u=!!e[1]):r?l=!!e:i&&(u=!!e),d):r&&i?[l,u]:r?l:i?u:null},d.extent=function(n){var o,l,u,c,p;return arguments.length?(r&&(o=n[0],l=n[1],i&&(o=o[0],l=l[0]),e=[o,l],r.invert&&(o=r(o),l=r(l)),l<o&&(p=o,o=l,l=p),o==s[0]&&l==s[1]||(s=[o,l])),i&&(u=n[0],c=n[1],r&&(u=u[1],c=c[1]),t=[u,c],i.invert&&(u=i(u),c=i(c)),c<u&&(p=u,u=c,c=p),u==a[0]&&c==a[1]||(a=[u,c])),d):(r&&(e?(o=e[0],l=e[1]):(o=s[0],l=s[1],r.invert&&(o=r.invert(o),l=r.invert(l)),l<o&&(p=o,o=l,l=p))),i&&(t?(u=t[0],c=t[1]):(u=a[0],c=a[1],i.invert&&(u=i.invert(u),c=i.invert(c)),c<u&&(p=u,u=c,c=p))),r&&i?[[o,u],[l,c]]:r?[o,l]:i&&[u,c])},d.clear=function(){return d.empty()||(s=[0,0],a=[0,0],e=t=null),d},d.empty=function(){return!!r&&s[0]==s[1]||!!i&&a[0]==a[1]},o.rebind(d,n,"on")};var Da={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},ka=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Fa=Dt.format=pn.timeFormat,Ga=Fa.utc,Ua=Ga("%Y-%m-%dT%H:%M:%S.%LZ");function Ba(e){return e.toISOString()}function ja(e,t,n){function r(t){return e(t)}function i(e,n){var r=(e[1]-e[0])/n,i=o.bisect(Ha,r);return i==Ha.length?[t.year,As(e.map((function(e){return e/31536e6})),n)[2]]:i?t[r/Ha[i-1]<Ha[i]/r?i-1:i]:[$a,As(e,n)[2]]}return r.invert=function(t){return Va(e.invert(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain().map(Va)},r.nice=function(e,t){var n=r.domain(),o=Es(n),s=null==e?i(o,10):"number"==typeof e&&i(o,e);function a(n){return!isNaN(n)&&!e.range(n,Va(+n+1),t).length}return s&&(e=s[0],t=s[1]),r.domain(Ts(n,t>1?{floor:function(t){for(;a(t=e.floor(t));)t=Va(t-1);return t},ceil:function(t){for(;a(t=e.ceil(t));)t=Va(+t+1);return t}}:e))},r.ticks=function(e,t){var n=Es(r.domain()),o=null==e?i(n,10):"number"==typeof e?i(n,e):!e.range&&[{range:e},t];return o&&(e=o[0],t=o[1]),e.range(n[0],Va(+n[1]+1),t<1?1:t)},r.tickFormat=function(){return n},r.copy=function(){return ja(e.copy(),t,n)},Is(r,e)}function Va(e){return new Date(e)}Fa.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ba:Ua,Ba.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Ba.toString=Ua.toString,Dt.second=Ut((function(e){return new kt(1e3*Math.floor(e/1e3))}),(function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))}),(function(e){return e.getSeconds()})),Dt.seconds=Dt.second.range,Dt.seconds.utc=Dt.second.utc.range,Dt.minute=Ut((function(e){return new kt(6e4*Math.floor(e/6e4))}),(function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))}),(function(e){return e.getMinutes()})),Dt.minutes=Dt.minute.range,Dt.minutes.utc=Dt.minute.utc.range,Dt.hour=Ut((function(e){var t=e.getTimezoneOffset()/60;return new kt(36e5*(Math.floor(e/36e5-t)+t))}),(function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))}),(function(e){return e.getHours()})),Dt.hours=Dt.hour.range,Dt.hours.utc=Dt.hour.utc.range,Dt.month=Ut((function(e){return(e=Dt.day(e)).setDate(1),e}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e){return e.getMonth()})),Dt.months=Dt.month.range,Dt.months.utc=Dt.month.utc.range;var Ha=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],qa=[[Dt.second,1],[Dt.second,5],[Dt.second,15],[Dt.second,30],[Dt.minute,1],[Dt.minute,5],[Dt.minute,15],[Dt.minute,30],[Dt.hour,1],[Dt.hour,3],[Dt.hour,6],[Dt.hour,12],[Dt.day,1],[Dt.day,2],[Dt.week,1],[Dt.month,1],[Dt.month,3],[Dt.year,1]],za=Fa.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()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",Xn]]),$a={range:function(e,t,n){return o.range(Math.ceil(e/n)*n,+t,n).map(Va)},floor:P,ceil:P};qa.year=Dt.year,Dt.scale=function(){return ja(o.scale.linear(),qa,za)};var Wa=qa.map((function(e){return[e[0].utc,e[1]]})),Qa=Ga.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()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",Xn]]);function Ya(e){return JSON.parse(e.responseText)}function Xa(e){var t=l.createRange();return t.selectNode(l.body),t.createContextualFragment(e.responseText)}Wa.year=Dt.year.utc,Dt.scale.utc=function(){return ja(o.scale.linear(),Wa,Qa)},o.text=Et((function(e){return e.responseText})),o.json=function(e,t){return xt(e,"application/json",Ya,t)},o.html=function(e,t){return xt(e,"text/html",Xa,t)},o.xml=Et((function(e){return e.responseXML})),this.d3=o,void 0===(i="function"==typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i)}()},308:function(e,t,n){"use strict";var r=r||{};r.SingleChild={addPlaceholders:function e(t,n){if(t.children){for(var r=0;r<t.children.length;r++)e(t.children[r]);if(1===t.children.length){var i=1.2*t.size;n&&(i=.1*t.children[0].size),t.children.push({name:"placeholder",size:i})}}},removePlaceholders:function e(t){for(var n=t.length-1;n>=0;n--){var r=t[n];"placeholder"===r.name?t.splice(n,1):r.children&&e(r.children)}},centerNodes:function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.children&&1===n.children.length){var r=n.x-n.children[0].x;n.children[0].x+=r,i(n.children[0],r)}}function i(e,t){if(e.children)for(var n=0;n<e.children.length;n++)e.children[n].x+=t,i(e.children[n],t)}},makePositionsRelativeToZero:function(e){for(var t=e[0].x,n=e[0].y,r=0;r<e.length;r++){var i=e[r];i.x-=t,i.y-=n}}},t.a=r},309:function(module,exports,__webpack_require__){(function(global){var require,require,f;f=function(){var define,module,exports;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){if(!a&&"function"==typeof require&&require)return require(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[s]={exports:{}};t[s][0].call(u.exports,(function(e){return i(t[s][1][e]||e)}),u,u.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";var r=e("jquery");r.deparam=function(e,t){var n={},i={true:!0,false:!1,null:null};return r.each(e.replace(/\+/g," ").split("&"),(function(e,o){var s,a=o.split("="),l=decodeURIComponent(a[0]),u=n,c=0,p=l.split("]["),d=p.length-1;if(/\[/.test(p[0])&&/\]$/.test(p[d])?(p[d]=p[d].replace(/\]$/,""),d=(p=p.shift().split("[").concat(p)).length-1):d=0,2===a.length)if(s=decodeURIComponent(a[1]),t&&(s=s&&!isNaN(s)?+s:"undefined"===s?void 0:void 0!==i[s]?i[s]:s),d)for(;c<=d;c++)u=u[l=""===p[c]?u.length:p[c]]=c<d?u[l]||(p[c+1]&&isNaN(p[c+1])?{}:[]):s;else r.isArray(n[l])?n[l].push(s):void 0!==n[l]?n[l]=[n[l],s]:n[l]=s;else l&&(n[l]=t?void 0:"")})),n}},{jquery:16}],2:[function(e,t,n){t.exports={table:{"*[&&,valueLogical]":{"&&":["[&&,valueLogical]","*[&&,valueLogical]"],AS:[],")":[],",":[],"||":[],";":[]},"*[,,expression]":{",":["[,,expression]","*[,,expression]"],")":[]},"*[,,objectPath]":{",":["[,,objectPath]","*[,,objectPath]"],".":[],";":[],"]":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"*[,,object]":{",":["[,,object]","*[,,object]"],".":[],";":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"*[/,pathEltOrInverse]":{"/":["[/,pathEltOrInverse]","*[/,pathEltOrInverse]"],"|":[],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"*[;,?[or([verbPath,verbSimple]),objectList]]":{";":["[;,?[or([verbPath,verbSimple]),objectList]]","*[;,?[or([verbPath,verbSimple]),objectList]]"],".":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"*[UNION,groupGraphPattern]":{UNION:["[UNION,groupGraphPattern]","*[UNION,groupGraphPattern]"],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],".":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"*[graphPatternNotTriples,?.,?triplesBlock]":{"{":["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],OPTIONAL:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],MINUS:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],GRAPH:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],SERVICE:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],FILTER:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],BIND:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],VALUES:["[graphPatternNotTriples,?.,?triplesBlock]","*[graphPatternNotTriples,?.,?triplesBlock]"],"}":[]},"*[quadsNotTriples,?.,?triplesTemplate]":{GRAPH:["[quadsNotTriples,?.,?triplesTemplate]","*[quadsNotTriples,?.,?triplesTemplate]"],"}":[]},"*[|,pathOneInPropertySet]":{"|":["[|,pathOneInPropertySet]","*[|,pathOneInPropertySet]"],")":[]},"*[|,pathSequence]":{"|":["[|,pathSequence]","*[|,pathSequence]"],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"*[||,conditionalAndExpression]":{"||":["[||,conditionalAndExpression]","*[||,conditionalAndExpression]"],AS:[],")":[],",":[],";":[]},"*dataBlockValue":{UNDEF:["dataBlockValue","*dataBlockValue"],IRI_REF:["dataBlockValue","*dataBlockValue"],TRUE:["dataBlockValue","*dataBlockValue"],FALSE:["dataBlockValue","*dataBlockValue"],"<<":["dataBlockValue","*dataBlockValue"],PNAME_LN:["dataBlockValue","*dataBlockValue"],PNAME_NS:["dataBlockValue","*dataBlockValue"],STRING_LITERAL1:["dataBlockValue","*dataBlockValue"],STRING_LITERAL2:["dataBlockValue","*dataBlockValue"],STRING_LITERAL_LONG1:["dataBlockValue","*dataBlockValue"],STRING_LITERAL_LONG2:["dataBlockValue","*dataBlockValue"],INTEGER:["dataBlockValue","*dataBlockValue"],DECIMAL:["dataBlockValue","*dataBlockValue"],DOUBLE:["dataBlockValue","*dataBlockValue"],INTEGER_POSITIVE:["dataBlockValue","*dataBlockValue"],DECIMAL_POSITIVE:["dataBlockValue","*dataBlockValue"],DOUBLE_POSITIVE:["dataBlockValue","*dataBlockValue"],INTEGER_NEGATIVE:["dataBlockValue","*dataBlockValue"],DECIMAL_NEGATIVE:["dataBlockValue","*dataBlockValue"],DOUBLE_NEGATIVE:["dataBlockValue","*dataBlockValue"],"}":[],")":[]},"*datasetClause":{FROM:["datasetClause","*datasetClause"],WHERE:[],"{":[]},"*describeDatasetClause":{FROM:["describeDatasetClause","*describeDatasetClause"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],WHERE:[],"{":[],VALUES:[],$:[]},"*graphNode":{"(":["graphNode","*graphNode"],"[":["graphNode","*graphNode"],VAR1:["graphNode","*graphNode"],VAR2:["graphNode","*graphNode"],NIL:["graphNode","*graphNode"],IRI_REF:["graphNode","*graphNode"],TRUE:["graphNode","*graphNode"],FALSE:["graphNode","*graphNode"],BLANK_NODE_LABEL:["graphNode","*graphNode"],ANON:["graphNode","*graphNode"],"<<":["graphNode","*graphNode"],PNAME_LN:["graphNode","*graphNode"],PNAME_NS:["graphNode","*graphNode"],STRING_LITERAL1:["graphNode","*graphNode"],STRING_LITERAL2:["graphNode","*graphNode"],STRING_LITERAL_LONG1:["graphNode","*graphNode"],STRING_LITERAL_LONG2:["graphNode","*graphNode"],INTEGER:["graphNode","*graphNode"],DECIMAL:["graphNode","*graphNode"],DOUBLE:["graphNode","*graphNode"],INTEGER_POSITIVE:["graphNode","*graphNode"],DECIMAL_POSITIVE:["graphNode","*graphNode"],DOUBLE_POSITIVE:["graphNode","*graphNode"],INTEGER_NEGATIVE:["graphNode","*graphNode"],DECIMAL_NEGATIVE:["graphNode","*graphNode"],DOUBLE_NEGATIVE:["graphNode","*graphNode"],")":[]},"*graphNodePath":{"(":["graphNodePath","*graphNodePath"],"[":["graphNodePath","*graphNodePath"],VAR1:["graphNodePath","*graphNodePath"],VAR2:["graphNodePath","*graphNodePath"],NIL:["graphNodePath","*graphNodePath"],IRI_REF:["graphNodePath","*graphNodePath"],TRUE:["graphNodePath","*graphNodePath"],FALSE:["graphNodePath","*graphNodePath"],BLANK_NODE_LABEL:["graphNodePath","*graphNodePath"],ANON:["graphNodePath","*graphNodePath"],"<<":["graphNodePath","*graphNodePath"],PNAME_LN:["graphNodePath","*graphNodePath"],PNAME_NS:["graphNodePath","*graphNodePath"],STRING_LITERAL1:["graphNodePath","*graphNodePath"],STRING_LITERAL2:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath","*graphNodePath"],INTEGER:["graphNodePath","*graphNodePath"],DECIMAL:["graphNodePath","*graphNodePath"],DOUBLE:["graphNodePath","*graphNodePath"],INTEGER_POSITIVE:["graphNodePath","*graphNodePath"],DECIMAL_POSITIVE:["graphNodePath","*graphNodePath"],DOUBLE_POSITIVE:["graphNodePath","*graphNodePath"],INTEGER_NEGATIVE:["graphNodePath","*graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath","*graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath","*graphNodePath"],")":[]},"*groupCondition":{"(":["groupCondition","*groupCondition"],STR:["groupCondition","*groupCondition"],LANG:["groupCondition","*groupCondition"],LANGMATCHES:["groupCondition","*groupCondition"],DATATYPE:["groupCondition","*groupCondition"],BOUND:["groupCondition","*groupCondition"],IRI:["groupCondition","*groupCondition"],URI:["groupCondition","*groupCondition"],BNODE:["groupCondition","*groupCondition"],RAND:["groupCondition","*groupCondition"],ABS:["groupCondition","*groupCondition"],CEIL:["groupCondition","*groupCondition"],FLOOR:["groupCondition","*groupCondition"],ROUND:["groupCondition","*groupCondition"],CONCAT:["groupCondition","*groupCondition"],STRLEN:["groupCondition","*groupCondition"],UCASE:["groupCondition","*groupCondition"],LCASE:["groupCondition","*groupCondition"],ENCODE_FOR_URI:["groupCondition","*groupCondition"],CONTAINS:["groupCondition","*groupCondition"],STRSTARTS:["groupCondition","*groupCondition"],STRENDS:["groupCondition","*groupCondition"],STRBEFORE:["groupCondition","*groupCondition"],STRAFTER:["groupCondition","*groupCondition"],YEAR:["groupCondition","*groupCondition"],MONTH:["groupCondition","*groupCondition"],DAY:["groupCondition","*groupCondition"],HOURS:["groupCondition","*groupCondition"],MINUTES:["groupCondition","*groupCondition"],SECONDS:["groupCondition","*groupCondition"],TIMEZONE:["groupCondition","*groupCondition"],TZ:["groupCondition","*groupCondition"],NOW:["groupCondition","*groupCondition"],UUID:["groupCondition","*groupCondition"],STRUUID:["groupCondition","*groupCondition"],MD5:["groupCondition","*groupCondition"],SHA1:["groupCondition","*groupCondition"],SHA256:["groupCondition","*groupCondition"],SHA384:["groupCondition","*groupCondition"],SHA512:["groupCondition","*groupCondition"],COALESCE:["groupCondition","*groupCondition"],IF:["groupCondition","*groupCondition"],STRLANG:["groupCondition","*groupCondition"],STRDT:["groupCondition","*groupCondition"],SAMETERM:["groupCondition","*groupCondition"],ISIRI:["groupCondition","*groupCondition"],ISURI:["groupCondition","*groupCondition"],ISBLANK:["groupCondition","*groupCondition"],ISLITERAL:["groupCondition","*groupCondition"],ISNUMERIC:["groupCondition","*groupCondition"],VAR1:["groupCondition","*groupCondition"],VAR2:["groupCondition","*groupCondition"],SUBSTR:["groupCondition","*groupCondition"],REPLACE:["groupCondition","*groupCondition"],REGEX:["groupCondition","*groupCondition"],EXISTS:["groupCondition","*groupCondition"],NOT:["groupCondition","*groupCondition"],IRI_REF:["groupCondition","*groupCondition"],PNAME_LN:["groupCondition","*groupCondition"],PNAME_NS:["groupCondition","*groupCondition"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],HAVING:[],$:[],"}":[]},"*havingCondition":{"(":["havingCondition","*havingCondition"],STR:["havingCondition","*havingCondition"],LANG:["havingCondition","*havingCondition"],LANGMATCHES:["havingCondition","*havingCondition"],DATATYPE:["havingCondition","*havingCondition"],BOUND:["havingCondition","*havingCondition"],IRI:["havingCondition","*havingCondition"],URI:["havingCondition","*havingCondition"],BNODE:["havingCondition","*havingCondition"],RAND:["havingCondition","*havingCondition"],ABS:["havingCondition","*havingCondition"],CEIL:["havingCondition","*havingCondition"],FLOOR:["havingCondition","*havingCondition"],ROUND:["havingCondition","*havingCondition"],CONCAT:["havingCondition","*havingCondition"],STRLEN:["havingCondition","*havingCondition"],UCASE:["havingCondition","*havingCondition"],LCASE:["havingCondition","*havingCondition"],ENCODE_FOR_URI:["havingCondition","*havingCondition"],CONTAINS:["havingCondition","*havingCondition"],STRSTARTS:["havingCondition","*havingCondition"],STRENDS:["havingCondition","*havingCondition"],STRBEFORE:["havingCondition","*havingCondition"],STRAFTER:["havingCondition","*havingCondition"],YEAR:["havingCondition","*havingCondition"],MONTH:["havingCondition","*havingCondition"],DAY:["havingCondition","*havingCondition"],HOURS:["havingCondition","*havingCondition"],MINUTES:["havingCondition","*havingCondition"],SECONDS:["havingCondition","*havingCondition"],TIMEZONE:["havingCondition","*havingCondition"],TZ:["havingCondition","*havingCondition"],NOW:["havingCondition","*havingCondition"],UUID:["havingCondition","*havingCondition"],STRUUID:["havingCondition","*havingCondition"],MD5:["havingCondition","*havingCondition"],SHA1:["havingCondition","*havingCondition"],SHA256:["havingCondition","*havingCondition"],SHA384:["havingCondition","*havingCondition"],SHA512:["havingCondition","*havingCondition"],COALESCE:["havingCondition","*havingCondition"],IF:["havingCondition","*havingCondition"],STRLANG:["havingCondition","*havingCondition"],STRDT:["havingCondition","*havingCondition"],SAMETERM:["havingCondition","*havingCondition"],ISIRI:["havingCondition","*havingCondition"],ISURI:["havingCondition","*havingCondition"],ISBLANK:["havingCondition","*havingCondition"],ISLITERAL:["havingCondition","*havingCondition"],ISNUMERIC:["havingCondition","*havingCondition"],SUBSTR:["havingCondition","*havingCondition"],REPLACE:["havingCondition","*havingCondition"],REGEX:["havingCondition","*havingCondition"],EXISTS:["havingCondition","*havingCondition"],NOT:["havingCondition","*havingCondition"],IRI_REF:["havingCondition","*havingCondition"],PNAME_LN:["havingCondition","*havingCondition"],PNAME_NS:["havingCondition","*havingCondition"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],$:[],"}":[]},"*or([[(,*dataBlockValue,)],NIL])":{"(":["or([[(,*dataBlockValue,)],NIL])","*or([[(,*dataBlockValue,)],NIL])"],NIL:["or([[(,*dataBlockValue,)],NIL])","*or([[(,*dataBlockValue,)],NIL])"],"}":[]},"*or([[*,unaryExpression],[/,unaryExpression]])":{"*":["or([[*,unaryExpression],[/,unaryExpression]])","*or([[*,unaryExpression],[/,unaryExpression]])"],"/":["or([[*,unaryExpression],[/,unaryExpression]])","*or([[*,unaryExpression],[/,unaryExpression]])"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],";":[]},"*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])":{"+":["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"-":["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_POSITIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_NEGATIVE:["or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],";":[]},"*or([baseDecl,prefixDecl])":{BASE:["or([baseDecl,prefixDecl])","*or([baseDecl,prefixDecl])"],PREFIX:["or([baseDecl,prefixDecl])","*or([baseDecl,prefixDecl])"],$:[],CONSTRUCT:[],DESCRIBE:[],ASK:[],INSERT:[],DELETE:[],SELECT:[],LOAD:[],CLEAR:[],DROP:[],ADD:[],MOVE:[],COPY:[],CREATE:[],WITH:[]},"*or([var,[(,expression,AS,var,)]])":{"(":["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"],VAR1:["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"],VAR2:["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"],WHERE:[],"{":[],FROM:[]},"*or([varOrIRIref,embeddedTriple])":{"<<":["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],VAR1:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],VAR2:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],IRI_REF:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],PNAME_LN:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],PNAME_NS:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],WHERE:[],"{":[],FROM:[],VALUES:[],$:[]},"*orderCondition":{ASC:["orderCondition","*orderCondition"],DESC:["orderCondition","*orderCondition"],VAR1:["orderCondition","*orderCondition"],VAR2:["orderCondition","*orderCondition"],"(":["orderCondition","*orderCondition"],STR:["orderCondition","*orderCondition"],LANG:["orderCondition","*orderCondition"],LANGMATCHES:["orderCondition","*orderCondition"],DATATYPE:["orderCondition","*orderCondition"],BOUND:["orderCondition","*orderCondition"],IRI:["orderCondition","*orderCondition"],URI:["orderCondition","*orderCondition"],BNODE:["orderCondition","*orderCondition"],RAND:["orderCondition","*orderCondition"],ABS:["orderCondition","*orderCondition"],CEIL:["orderCondition","*orderCondition"],FLOOR:["orderCondition","*orderCondition"],ROUND:["orderCondition","*orderCondition"],CONCAT:["orderCondition","*orderCondition"],STRLEN:["orderCondition","*orderCondition"],UCASE:["orderCondition","*orderCondition"],LCASE:["orderCondition","*orderCondition"],ENCODE_FOR_URI:["orderCondition","*orderCondition"],CONTAINS:["orderCondition","*orderCondition"],STRSTARTS:["orderCondition","*orderCondition"],STRENDS:["orderCondition","*orderCondition"],STRBEFORE:["orderCondition","*orderCondition"],STRAFTER:["orderCondition","*orderCondition"],YEAR:["orderCondition","*orderCondition"],MONTH:["orderCondition","*orderCondition"],DAY:["orderCondition","*orderCondition"],HOURS:["orderCondition","*orderCondition"],MINUTES:["orderCondition","*orderCondition"],SECONDS:["orderCondition","*orderCondition"],TIMEZONE:["orderCondition","*orderCondition"],TZ:["orderCondition","*orderCondition"],NOW:["orderCondition","*orderCondition"],UUID:["orderCondition","*orderCondition"],STRUUID:["orderCondition","*orderCondition"],MD5:["orderCondition","*orderCondition"],SHA1:["orderCondition","*orderCondition"],SHA256:["orderCondition","*orderCondition"],SHA384:["orderCondition","*orderCondition"],SHA512:["orderCondition","*orderCondition"],COALESCE:["orderCondition","*orderCondition"],IF:["orderCondition","*orderCondition"],STRLANG:["orderCondition","*orderCondition"],STRDT:["orderCondition","*orderCondition"],SAMETERM:["orderCondition","*orderCondition"],ISIRI:["orderCondition","*orderCondition"],ISURI:["orderCondition","*orderCondition"],ISBLANK:["orderCondition","*orderCondition"],ISLITERAL:["orderCondition","*orderCondition"],ISNUMERIC:["orderCondition","*orderCondition"],SUBSTR:["orderCondition","*orderCondition"],REPLACE:["orderCondition","*orderCondition"],REGEX:["orderCondition","*orderCondition"],EXISTS:["orderCondition","*orderCondition"],NOT:["orderCondition","*orderCondition"],IRI_REF:["orderCondition","*orderCondition"],PNAME_LN:["orderCondition","*orderCondition"],PNAME_NS:["orderCondition","*orderCondition"],VALUES:[],LIMIT:[],OFFSET:[],$:[],"}":[]},"*usingClause":{USING:["usingClause","*usingClause"],WHERE:[]},"*var":{VAR1:["var","*var"],VAR2:["var","*var"],")":[]},"+graphNode":{"(":["graphNode","*graphNode"],"[":["graphNode","*graphNode"],VAR1:["graphNode","*graphNode"],VAR2:["graphNode","*graphNode"],NIL:["graphNode","*graphNode"],IRI_REF:["graphNode","*graphNode"],TRUE:["graphNode","*graphNode"],FALSE:["graphNode","*graphNode"],BLANK_NODE_LABEL:["graphNode","*graphNode"],ANON:["graphNode","*graphNode"],"<<":["graphNode","*graphNode"],PNAME_LN:["graphNode","*graphNode"],PNAME_NS:["graphNode","*graphNode"],STRING_LITERAL1:["graphNode","*graphNode"],STRING_LITERAL2:["graphNode","*graphNode"],STRING_LITERAL_LONG1:["graphNode","*graphNode"],STRING_LITERAL_LONG2:["graphNode","*graphNode"],INTEGER:["graphNode","*graphNode"],DECIMAL:["graphNode","*graphNode"],DOUBLE:["graphNode","*graphNode"],INTEGER_POSITIVE:["graphNode","*graphNode"],DECIMAL_POSITIVE:["graphNode","*graphNode"],DOUBLE_POSITIVE:["graphNode","*graphNode"],INTEGER_NEGATIVE:["graphNode","*graphNode"],DECIMAL_NEGATIVE:["graphNode","*graphNode"],DOUBLE_NEGATIVE:["graphNode","*graphNode"]},"+graphNodePath":{"(":["graphNodePath","*graphNodePath"],"[":["graphNodePath","*graphNodePath"],VAR1:["graphNodePath","*graphNodePath"],VAR2:["graphNodePath","*graphNodePath"],NIL:["graphNodePath","*graphNodePath"],IRI_REF:["graphNodePath","*graphNodePath"],TRUE:["graphNodePath","*graphNodePath"],FALSE:["graphNodePath","*graphNodePath"],BLANK_NODE_LABEL:["graphNodePath","*graphNodePath"],ANON:["graphNodePath","*graphNodePath"],"<<":["graphNodePath","*graphNodePath"],PNAME_LN:["graphNodePath","*graphNodePath"],PNAME_NS:["graphNodePath","*graphNodePath"],STRING_LITERAL1:["graphNodePath","*graphNodePath"],STRING_LITERAL2:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath","*graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath","*graphNodePath"],INTEGER:["graphNodePath","*graphNodePath"],DECIMAL:["graphNodePath","*graphNodePath"],DOUBLE:["graphNodePath","*graphNodePath"],INTEGER_POSITIVE:["graphNodePath","*graphNodePath"],DECIMAL_POSITIVE:["graphNodePath","*graphNodePath"],DOUBLE_POSITIVE:["graphNodePath","*graphNodePath"],INTEGER_NEGATIVE:["graphNodePath","*graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath","*graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath","*graphNodePath"]},"+groupCondition":{"(":["groupCondition","*groupCondition"],STR:["groupCondition","*groupCondition"],LANG:["groupCondition","*groupCondition"],LANGMATCHES:["groupCondition","*groupCondition"],DATATYPE:["groupCondition","*groupCondition"],BOUND:["groupCondition","*groupCondition"],IRI:["groupCondition","*groupCondition"],URI:["groupCondition","*groupCondition"],BNODE:["groupCondition","*groupCondition"],RAND:["groupCondition","*groupCondition"],ABS:["groupCondition","*groupCondition"],CEIL:["groupCondition","*groupCondition"],FLOOR:["groupCondition","*groupCondition"],ROUND:["groupCondition","*groupCondition"],CONCAT:["groupCondition","*groupCondition"],STRLEN:["groupCondition","*groupCondition"],UCASE:["groupCondition","*groupCondition"],LCASE:["groupCondition","*groupCondition"],ENCODE_FOR_URI:["groupCondition","*groupCondition"],CONTAINS:["groupCondition","*groupCondition"],STRSTARTS:["groupCondition","*groupCondition"],STRENDS:["groupCondition","*groupCondition"],STRBEFORE:["groupCondition","*groupCondition"],STRAFTER:["groupCondition","*groupCondition"],YEAR:["groupCondition","*groupCondition"],MONTH:["groupCondition","*groupCondition"],DAY:["groupCondition","*groupCondition"],HOURS:["groupCondition","*groupCondition"],MINUTES:["groupCondition","*groupCondition"],SECONDS:["groupCondition","*groupCondition"],TIMEZONE:["groupCondition","*groupCondition"],TZ:["groupCondition","*groupCondition"],NOW:["groupCondition","*groupCondition"],UUID:["groupCondition","*groupCondition"],STRUUID:["groupCondition","*groupCondition"],MD5:["groupCondition","*groupCondition"],SHA1:["groupCondition","*groupCondition"],SHA256:["groupCondition","*groupCondition"],SHA384:["groupCondition","*groupCondition"],SHA512:["groupCondition","*groupCondition"],COALESCE:["groupCondition","*groupCondition"],IF:["groupCondition","*groupCondition"],STRLANG:["groupCondition","*groupCondition"],STRDT:["groupCondition","*groupCondition"],SAMETERM:["groupCondition","*groupCondition"],ISIRI:["groupCondition","*groupCondition"],ISURI:["groupCondition","*groupCondition"],ISBLANK:["groupCondition","*groupCondition"],ISLITERAL:["groupCondition","*groupCondition"],ISNUMERIC:["groupCondition","*groupCondition"],VAR1:["groupCondition","*groupCondition"],VAR2:["groupCondition","*groupCondition"],SUBSTR:["groupCondition","*groupCondition"],REPLACE:["groupCondition","*groupCondition"],REGEX:["groupCondition","*groupCondition"],EXISTS:["groupCondition","*groupCondition"],NOT:["groupCondition","*groupCondition"],IRI_REF:["groupCondition","*groupCondition"],PNAME_LN:["groupCondition","*groupCondition"],PNAME_NS:["groupCondition","*groupCondition"]},"+havingCondition":{"(":["havingCondition","*havingCondition"],STR:["havingCondition","*havingCondition"],LANG:["havingCondition","*havingCondition"],LANGMATCHES:["havingCondition","*havingCondition"],DATATYPE:["havingCondition","*havingCondition"],BOUND:["havingCondition","*havingCondition"],IRI:["havingCondition","*havingCondition"],URI:["havingCondition","*havingCondition"],BNODE:["havingCondition","*havingCondition"],RAND:["havingCondition","*havingCondition"],ABS:["havingCondition","*havingCondition"],CEIL:["havingCondition","*havingCondition"],FLOOR:["havingCondition","*havingCondition"],ROUND:["havingCondition","*havingCondition"],CONCAT:["havingCondition","*havingCondition"],STRLEN:["havingCondition","*havingCondition"],UCASE:["havingCondition","*havingCondition"],LCASE:["havingCondition","*havingCondition"],ENCODE_FOR_URI:["havingCondition","*havingCondition"],CONTAINS:["havingCondition","*havingCondition"],STRSTARTS:["havingCondition","*havingCondition"],STRENDS:["havingCondition","*havingCondition"],STRBEFORE:["havingCondition","*havingCondition"],STRAFTER:["havingCondition","*havingCondition"],YEAR:["havingCondition","*havingCondition"],MONTH:["havingCondition","*havingCondition"],DAY:["havingCondition","*havingCondition"],HOURS:["havingCondition","*havingCondition"],MINUTES:["havingCondition","*havingCondition"],SECONDS:["havingCondition","*havingCondition"],TIMEZONE:["havingCondition","*havingCondition"],TZ:["havingCondition","*havingCondition"],NOW:["havingCondition","*havingCondition"],UUID:["havingCondition","*havingCondition"],STRUUID:["havingCondition","*havingCondition"],MD5:["havingCondition","*havingCondition"],SHA1:["havingCondition","*havingCondition"],SHA256:["havingCondition","*havingCondition"],SHA384:["havingCondition","*havingCondition"],SHA512:["havingCondition","*havingCondition"],COALESCE:["havingCondition","*havingCondition"],IF:["havingCondition","*havingCondition"],STRLANG:["havingCondition","*havingCondition"],STRDT:["havingCondition","*havingCondition"],SAMETERM:["havingCondition","*havingCondition"],ISIRI:["havingCondition","*havingCondition"],ISURI:["havingCondition","*havingCondition"],ISBLANK:["havingCondition","*havingCondition"],ISLITERAL:["havingCondition","*havingCondition"],ISNUMERIC:["havingCondition","*havingCondition"],SUBSTR:["havingCondition","*havingCondition"],REPLACE:["havingCondition","*havingCondition"],REGEX:["havingCondition","*havingCondition"],EXISTS:["havingCondition","*havingCondition"],NOT:["havingCondition","*havingCondition"],IRI_REF:["havingCondition","*havingCondition"],PNAME_LN:["havingCondition","*havingCondition"],PNAME_NS:["havingCondition","*havingCondition"]},"+or([var,[(,expression,AS,var,)]])":{"(":["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"],VAR1:["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"],VAR2:["or([var,[(,expression,AS,var,)]])","*or([var,[(,expression,AS,var,)]])"]},"+or([varOrIRIref,embeddedTriple])":{"<<":["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],VAR1:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],VAR2:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],IRI_REF:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],PNAME_LN:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"],PNAME_NS:["or([varOrIRIref,embeddedTriple])","*or([varOrIRIref,embeddedTriple])"]},"+orderCondition":{ASC:["orderCondition","*orderCondition"],DESC:["orderCondition","*orderCondition"],VAR1:["orderCondition","*orderCondition"],VAR2:["orderCondition","*orderCondition"],"(":["orderCondition","*orderCondition"],STR:["orderCondition","*orderCondition"],LANG:["orderCondition","*orderCondition"],LANGMATCHES:["orderCondition","*orderCondition"],DATATYPE:["orderCondition","*orderCondition"],BOUND:["orderCondition","*orderCondition"],IRI:["orderCondition","*orderCondition"],URI:["orderCondition","*orderCondition"],BNODE:["orderCondition","*orderCondition"],RAND:["orderCondition","*orderCondition"],ABS:["orderCondition","*orderCondition"],CEIL:["orderCondition","*orderCondition"],FLOOR:["orderCondition","*orderCondition"],ROUND:["orderCondition","*orderCondition"],CONCAT:["orderCondition","*orderCondition"],STRLEN:["orderCondition","*orderCondition"],UCASE:["orderCondition","*orderCondition"],LCASE:["orderCondition","*orderCondition"],ENCODE_FOR_URI:["orderCondition","*orderCondition"],CONTAINS:["orderCondition","*orderCondition"],STRSTARTS:["orderCondition","*orderCondition"],STRENDS:["orderCondition","*orderCondition"],STRBEFORE:["orderCondition","*orderCondition"],STRAFTER:["orderCondition","*orderCondition"],YEAR:["orderCondition","*orderCondition"],MONTH:["orderCondition","*orderCondition"],DAY:["orderCondition","*orderCondition"],HOURS:["orderCondition","*orderCondition"],MINUTES:["orderCondition","*orderCondition"],SECONDS:["orderCondition","*orderCondition"],TIMEZONE:["orderCondition","*orderCondition"],TZ:["orderCondition","*orderCondition"],NOW:["orderCondition","*orderCondition"],UUID:["orderCondition","*orderCondition"],STRUUID:["orderCondition","*orderCondition"],MD5:["orderCondition","*orderCondition"],SHA1:["orderCondition","*orderCondition"],SHA256:["orderCondition","*orderCondition"],SHA384:["orderCondition","*orderCondition"],SHA512:["orderCondition","*orderCondition"],COALESCE:["orderCondition","*orderCondition"],IF:["orderCondition","*orderCondition"],STRLANG:["orderCondition","*orderCondition"],STRDT:["orderCondition","*orderCondition"],SAMETERM:["orderCondition","*orderCondition"],ISIRI:["orderCondition","*orderCondition"],ISURI:["orderCondition","*orderCondition"],ISBLANK:["orderCondition","*orderCondition"],ISLITERAL:["orderCondition","*orderCondition"],ISNUMERIC:["orderCondition","*orderCondition"],SUBSTR:["orderCondition","*orderCondition"],REPLACE:["orderCondition","*orderCondition"],REGEX:["orderCondition","*orderCondition"],EXISTS:["orderCondition","*orderCondition"],NOT:["orderCondition","*orderCondition"],IRI_REF:["orderCondition","*orderCondition"],PNAME_LN:["orderCondition","*orderCondition"],PNAME_NS:["orderCondition","*orderCondition"]},"?.":{".":["."],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?DISTINCT":{DISTINCT:["DISTINCT"],"!":[],"+":[],"-":[],VAR1:[],VAR2:[],"(":[],STR:[],LANG:[],LANGMATCHES:[],DATATYPE:[],BOUND:[],IRI:[],URI:[],BNODE:[],RAND:[],ABS:[],CEIL:[],FLOOR:[],ROUND:[],CONCAT:[],STRLEN:[],UCASE:[],LCASE:[],ENCODE_FOR_URI:[],CONTAINS:[],STRSTARTS:[],STRENDS:[],STRBEFORE:[],STRAFTER:[],YEAR:[],MONTH:[],DAY:[],HOURS:[],MINUTES:[],SECONDS:[],TIMEZONE:[],TZ:[],NOW:[],UUID:[],STRUUID:[],MD5:[],SHA1:[],SHA256:[],SHA384:[],SHA512:[],COALESCE:[],IF:[],STRLANG:[],STRDT:[],SAMETERM:[],ISIRI:[],ISURI:[],ISBLANK:[],ISLITERAL:[],ISNUMERIC:[],TRUE:[],FALSE:[],"<<":[],COUNT:[],SUM:[],MIN:[],MAX:[],AVG:[],SAMPLE:[],GROUP_CONCAT:[],SUBSTR:[],REPLACE:[],REGEX:[],EXISTS:[],NOT:[],IRI_REF:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],PNAME_LN:[],PNAME_NS:[],"*":[]},"?GRAPH":{GRAPH:["GRAPH"],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT":{SILENT:["SILENT"],VAR1:[],VAR2:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT_1":{SILENT:["SILENT"],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?SILENT_2":{SILENT:["SILENT"],GRAPH:[],DEFAULT:[],NAMED:[],ALL:[]},"?SILENT_3":{SILENT:["SILENT"],GRAPH:[]},"?SILENT_4":{SILENT:["SILENT"],DEFAULT:[],GRAPH:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[]},"?WHERE":{WHERE:["WHERE"],"{":[]},"?[,,expression]":{",":["[,,expression]"],")":[]},"?[.,?constructTriples]":{".":["[.,?constructTriples]"],"}":[]},"?[.,?triplesBlock]":{".":["[.,?triplesBlock]"],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?[.,?triplesTemplate]":{".":["[.,?triplesTemplate]"],"}":[],GRAPH:[]},"?[;,SEPARATOR,=,string]":{";":["[;,SEPARATOR,=,string]"],")":[]},"?[;,update]":{";":["[;,update]"],$:[]},"?[AS,var]":{AS:["[AS,var]"],")":[]},"?[INTO,graphRef]":{INTO:["[INTO,graphRef]"],";":[],$:[]},"?[or([verbPath,verbSimple]),objectList]":{VAR1:["[or([verbPath,verbSimple]),objectList]"],VAR2:["[or([verbPath,verbSimple]),objectList]"],"^":["[or([verbPath,verbSimple]),objectList]"],a:["[or([verbPath,verbSimple]),objectList]"],"!":["[or([verbPath,verbSimple]),objectList]"],"(":["[or([verbPath,verbSimple]),objectList]"],IRI_REF:["[or([verbPath,verbSimple]),objectList]"],PNAME_LN:["[or([verbPath,verbSimple]),objectList]"],PNAME_NS:["[or([verbPath,verbSimple]),objectList]"],";":[],".":[],"]":[],"}":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"?[pathOneInPropertySet,*[|,pathOneInPropertySet]]":{a:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],"^":["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],IRI_REF:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],PNAME_LN:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],PNAME_NS:["[pathOneInPropertySet,*[|,pathOneInPropertySet]]"],")":[]},"?[update1,?[;,update]]":{INSERT:["[update1,?[;,update]]"],DELETE:["[update1,?[;,update]]"],LOAD:["[update1,?[;,update]]"],CLEAR:["[update1,?[;,update]]"],DROP:["[update1,?[;,update]]"],ADD:["[update1,?[;,update]]"],MOVE:["[update1,?[;,update]]"],COPY:["[update1,?[;,update]]"],CREATE:["[update1,?[;,update]]"],WITH:["[update1,?[;,update]]"],$:[]},"?argList":{NIL:["argList"],"(":["argList"],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],"*":[],"/":[],";":[]},"?constructTriples":{VAR1:["constructTriples"],VAR2:["constructTriples"],NIL:["constructTriples"],"(":["constructTriples"],"[":["constructTriples"],IRI_REF:["constructTriples"],TRUE:["constructTriples"],FALSE:["constructTriples"],BLANK_NODE_LABEL:["constructTriples"],ANON:["constructTriples"],"<<":["constructTriples"],PNAME_LN:["constructTriples"],PNAME_NS:["constructTriples"],STRING_LITERAL1:["constructTriples"],STRING_LITERAL2:["constructTriples"],STRING_LITERAL_LONG1:["constructTriples"],STRING_LITERAL_LONG2:["constructTriples"],INTEGER:["constructTriples"],DECIMAL:["constructTriples"],DOUBLE:["constructTriples"],INTEGER_POSITIVE:["constructTriples"],DECIMAL_POSITIVE:["constructTriples"],DOUBLE_POSITIVE:["constructTriples"],INTEGER_NEGATIVE:["constructTriples"],DECIMAL_NEGATIVE:["constructTriples"],DOUBLE_NEGATIVE:["constructTriples"],"}":[]},"?groupClause":{GROUP:["groupClause"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],HAVING:[],$:[],"}":[]},"?havingClause":{HAVING:["havingClause"],VALUES:[],LIMIT:[],OFFSET:[],ORDER:[],$:[],"}":[]},"?insertClause":{INSERT:["insertClause"],WHERE:[],USING:[]},"?limitClause":{LIMIT:["limitClause"],VALUES:[],$:[],"}":[]},"?limitOffsetClauses":{LIMIT:["limitOffsetClauses"],OFFSET:["limitOffsetClauses"],VALUES:[],$:[],"}":[]},"?offsetClause":{OFFSET:["offsetClause"],VALUES:[],$:[],"}":[]},"?or([DISTINCT,REDUCED])":{DISTINCT:["or([DISTINCT,REDUCED])"],REDUCED:["or([DISTINCT,REDUCED])"],"*":[],"(":[],VAR1:[],VAR2:[]},"?or([LANGTAG,[^^,iriRef]])":{LANGTAG:["or([LANGTAG,[^^,iriRef]])"],"^^":["or([LANGTAG,[^^,iriRef]])"],UNDEF:[],IRI_REF:[],TRUE:[],FALSE:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],VAR1:[],VAR2:[],"^":[],a:[],"!":[],"(":[],".":[],";":[],",":[],AS:[],")":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],"+":[],"-":[],"*":[],"/":[],"}":[],">>":[],"[":[],NIL:[],BLANK_NODE_LABEL:[],ANON:[],"]":[],GRAPH:[],"{":[],OPTIONAL:[],MINUS:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[]},"?or([[*,unaryExpression],[/,unaryExpression]])":{"*":["or([[*,unaryExpression],[/,unaryExpression]])"],"/":["or([[*,unaryExpression],[/,unaryExpression]])"],"+":[],"-":[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],AS:[],")":[],",":[],"||":[],"&&":[],"=":[],"!=":[],"<":[],">":[],"<=":[],">=":[],IN:[],NOT:[],";":[]},"?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])":{"=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"!=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"<":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],">":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"<=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],">=":["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IN:["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOT:["or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],AS:[],")":[],",":[],"||":[],"&&":[],";":[]},"?orderClause":{ORDER:["orderClause"],VALUES:[],LIMIT:[],OFFSET:[],$:[],"}":[]},"?pathMod":{"*":["pathMod"],"?":["pathMod"],"+":["pathMod"],"{":["pathMod"],"|":[],"/":[],")":[],"(":[],"[":[],VAR1:[],VAR2:[],NIL:[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},"?triplesBlock":{VAR1:["triplesBlock"],VAR2:["triplesBlock"],NIL:["triplesBlock"],"(":["triplesBlock"],"[":["triplesBlock"],IRI_REF:["triplesBlock"],TRUE:["triplesBlock"],FALSE:["triplesBlock"],BLANK_NODE_LABEL:["triplesBlock"],ANON:["triplesBlock"],"<<":["triplesBlock"],PNAME_LN:["triplesBlock"],PNAME_NS:["triplesBlock"],STRING_LITERAL1:["triplesBlock"],STRING_LITERAL2:["triplesBlock"],STRING_LITERAL_LONG1:["triplesBlock"],STRING_LITERAL_LONG2:["triplesBlock"],INTEGER:["triplesBlock"],DECIMAL:["triplesBlock"],DOUBLE:["triplesBlock"],INTEGER_POSITIVE:["triplesBlock"],DECIMAL_POSITIVE:["triplesBlock"],DOUBLE_POSITIVE:["triplesBlock"],INTEGER_NEGATIVE:["triplesBlock"],DECIMAL_NEGATIVE:["triplesBlock"],DOUBLE_NEGATIVE:["triplesBlock"],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},"?triplesTemplate":{VAR1:["triplesTemplate"],VAR2:["triplesTemplate"],NIL:["triplesTemplate"],"(":["triplesTemplate"],"[":["triplesTemplate"],IRI_REF:["triplesTemplate"],TRUE:["triplesTemplate"],FALSE:["triplesTemplate"],BLANK_NODE_LABEL:["triplesTemplate"],ANON:["triplesTemplate"],"<<":["triplesTemplate"],PNAME_LN:["triplesTemplate"],PNAME_NS:["triplesTemplate"],STRING_LITERAL1:["triplesTemplate"],STRING_LITERAL2:["triplesTemplate"],STRING_LITERAL_LONG1:["triplesTemplate"],STRING_LITERAL_LONG2:["triplesTemplate"],INTEGER:["triplesTemplate"],DECIMAL:["triplesTemplate"],DOUBLE:["triplesTemplate"],INTEGER_POSITIVE:["triplesTemplate"],DECIMAL_POSITIVE:["triplesTemplate"],DOUBLE_POSITIVE:["triplesTemplate"],INTEGER_NEGATIVE:["triplesTemplate"],DECIMAL_NEGATIVE:["triplesTemplate"],DOUBLE_NEGATIVE:["triplesTemplate"],"}":[],GRAPH:[]},"?whereClause":{WHERE:["whereClause"],"{":["whereClause"],ORDER:[],HAVING:[],GROUP:[],LIMIT:[],OFFSET:[],VALUES:[],$:[]},"[!=,numericExpression]":{"!=":["!=","numericExpression"]},"[&&,valueLogical]":{"&&":["&&","valueLogical"]},"[(,*dataBlockValue,)]":{"(":["(","*dataBlockValue",")"]},"[(,*var,)]":{"(":["(","*var",")"]},"[(,expression,)]":{"(":["(","expression",")"]},"[(,expression,AS,var,)]":{"(":["(","expression","AS","var",")"]},"[*,unaryExpression]":{"*":["*","unaryExpression"]},"[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]":{WHERE:["*datasetClause","WHERE","{","?triplesTemplate","}","solutionModifier"],FROM:["*datasetClause","WHERE","{","?triplesTemplate","}","solutionModifier"]},"[+,multiplicativeExpression]":{"+":["+","multiplicativeExpression"]},"[,,expression]":{",":[",","expression"]},"[,,integer,}]":{",":[",","integer","}"]},"[,,objectPath]":{",":[",","objectPath"]},"[,,object]":{",":[",","object"]},"[,,or([},[integer,}]])]":{",":[",","or([},[integer,}]])"]},"[-,multiplicativeExpression]":{"-":["-","multiplicativeExpression"]},"[.,?constructTriples]":{".":[".","?constructTriples"]},"[.,?triplesBlock]":{".":[".","?triplesBlock"]},"[.,?triplesTemplate]":{".":[".","?triplesTemplate"]},"[/,pathEltOrInverse]":{"/":["/","pathEltOrInverse"]},"[/,unaryExpression]":{"/":["/","unaryExpression"]},"[;,?[or([verbPath,verbSimple]),objectList]]":{";":[";","?[or([verbPath,verbSimple]),objectList]"]},"[;,SEPARATOR,=,string]":{";":[";","SEPARATOR","=","string"]},"[;,update]":{";":[";","update"]},"[<,numericExpression]":{"<":["<","numericExpression"]},"[<=,numericExpression]":{"<=":["<=","numericExpression"]},"[=,numericExpression]":{"=":["=","numericExpression"]},"[>,numericExpression]":{">":[">","numericExpression"]},"[>=,numericExpression]":{">=":[">=","numericExpression"]},"[AS,var]":{AS:["AS","var"]},"[IN,expressionList]":{IN:["IN","expressionList"]},"[INTO,graphRef]":{INTO:["INTO","graphRef"]},"[NAMED,iriRef]":{NAMED:["NAMED","iriRef"]},"[NOT,IN,expressionList]":{NOT:["NOT","IN","expressionList"]},"[UNION,groupGraphPattern]":{UNION:["UNION","groupGraphPattern"]},"[^^,iriRef]":{"^^":["^^","iriRef"]},"[constructTemplate,*datasetClause,whereClause,solutionModifier]":{"{":["constructTemplate","*datasetClause","whereClause","solutionModifier"]},"[deleteClause,?insertClause]":{DELETE:["deleteClause","?insertClause"]},"[graphPatternNotTriples,?.,?triplesBlock]":{"{":["graphPatternNotTriples","?.","?triplesBlock"],OPTIONAL:["graphPatternNotTriples","?.","?triplesBlock"],MINUS:["graphPatternNotTriples","?.","?triplesBlock"],GRAPH:["graphPatternNotTriples","?.","?triplesBlock"],SERVICE:["graphPatternNotTriples","?.","?triplesBlock"],FILTER:["graphPatternNotTriples","?.","?triplesBlock"],BIND:["graphPatternNotTriples","?.","?triplesBlock"],VALUES:["graphPatternNotTriples","?.","?triplesBlock"]},"[integer,or([[,,or([},[integer,}]])],}])]":{INTEGER:["integer","or([[,,or([},[integer,}]])],}])"]},"[integer,}]":{INTEGER:["integer","}"]},"[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]":{INTEGER_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_POSITIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_NEGATIVE:["or([numericLiteralPositive,numericLiteralNegative])","?or([[*,unaryExpression],[/,unaryExpression]])"]},"[or([verbPath,verbSimple]),objectList]":{VAR1:["or([verbPath,verbSimple])","objectList"],VAR2:["or([verbPath,verbSimple])","objectList"],"^":["or([verbPath,verbSimple])","objectList"],a:["or([verbPath,verbSimple])","objectList"],"!":["or([verbPath,verbSimple])","objectList"],"(":["or([verbPath,verbSimple])","objectList"],IRI_REF:["or([verbPath,verbSimple])","objectList"],PNAME_LN:["or([verbPath,verbSimple])","objectList"],PNAME_NS:["or([verbPath,verbSimple])","objectList"]},"[pathOneInPropertySet,*[|,pathOneInPropertySet]]":{a:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],"^":["pathOneInPropertySet","*[|,pathOneInPropertySet]"],IRI_REF:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],PNAME_LN:["pathOneInPropertySet","*[|,pathOneInPropertySet]"],PNAME_NS:["pathOneInPropertySet","*[|,pathOneInPropertySet]"]},"[quadsNotTriples,?.,?triplesTemplate]":{GRAPH:["quadsNotTriples","?.","?triplesTemplate"]},"[update1,?[;,update]]":{INSERT:["update1","?[;,update]"],DELETE:["update1","?[;,update]"],LOAD:["update1","?[;,update]"],CLEAR:["update1","?[;,update]"],DROP:["update1","?[;,update]"],ADD:["update1","?[;,update]"],MOVE:["update1","?[;,update]"],COPY:["update1","?[;,update]"],CREATE:["update1","?[;,update]"],WITH:["update1","?[;,update]"]},"[|,pathOneInPropertySet]":{"|":["|","pathOneInPropertySet"]},"[|,pathSequence]":{"|":["|","pathSequence"]},"[||,conditionalAndExpression]":{"||":["||","conditionalAndExpression"]},add:{ADD:["ADD","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},additiveExpression:{"!":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"+":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"-":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],VAR1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],VAR2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"(":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LANG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LANGMATCHES:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DATATYPE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],BOUND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IRI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],URI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],BNODE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],RAND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ABS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CEIL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],FLOOR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ROUND:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CONCAT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRLEN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],UCASE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],LCASE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ENCODE_FOR_URI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],CONTAINS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRSTARTS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRENDS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRBEFORE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRAFTER:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],YEAR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MONTH:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DAY:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],HOURS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MINUTES:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SECONDS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TIMEZONE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TZ:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],NOW:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],UUID:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRUUID:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MD5:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA256:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA384:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SHA512:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],COALESCE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IF:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRLANG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRDT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SAMETERM:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISIRI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISURI:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISBLANK:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISLITERAL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],ISNUMERIC:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],TRUE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],FALSE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],"<<":["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],COUNT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SUM:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MIN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],MAX:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],AVG:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SAMPLE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],GROUP_CONCAT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],SUBSTR:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],REPLACE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],REGEX:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],EXISTS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],NOT:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],IRI_REF:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL_LONG1:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],STRING_LITERAL_LONG2:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_POSITIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],INTEGER_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DECIMAL_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],DOUBLE_NEGATIVE:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],PNAME_LN:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"],PNAME_NS:["multiplicativeExpression","*or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])"]},aggregate:{COUNT:["COUNT","(","?DISTINCT","or([*,expression])",")"],SUM:["SUM","(","?DISTINCT","expression",")"],MIN:["MIN","(","?DISTINCT","expression",")"],MAX:["MAX","(","?DISTINCT","expression",")"],AVG:["AVG","(","?DISTINCT","expression",")"],SAMPLE:["SAMPLE","(","?DISTINCT","expression",")"],GROUP_CONCAT:["GROUP_CONCAT","(","?DISTINCT","expression","?[;,SEPARATOR,=,string]",")"]},allowBnodes:{"}":[]},allowVars:{"}":[],UNDEF:[],IRI_REF:[],TRUE:[],FALSE:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[],")":[]},argList:{NIL:["NIL"],"(":["(","?DISTINCT","expression","*[,,expression]",")"]},askQuery:{ASK:["ASK","*datasetClause","whereClause","solutionModifier"]},baseDecl:{BASE:["BASE","IRI_REF"]},bind:{BIND:["BIND","(","expression","AS","var",")"]},blankNode:{BLANK_NODE_LABEL:["BLANK_NODE_LABEL"],ANON:["ANON"]},blankNodePropertyList:{"[":["[","propertyListNotEmpty","]"]},blankNodePropertyListPath:{"[":["[","propertyListPathNotEmpty","]"]},booleanLiteral:{TRUE:["TRUE"],FALSE:["FALSE"]},brackettedExpression:{"(":["(","expression",")"]},builtInCall:{STR:["STR","(","expression",")"],LANG:["LANG","(","expression",")"],LANGMATCHES:["LANGMATCHES","(","expression",",","expression",")"],DATATYPE:["DATATYPE","(","expression",")"],BOUND:["BOUND","(","var",")"],IRI:["IRI","(","expression",")"],URI:["URI","(","expression",")"],BNODE:["BNODE","or([[(,expression,)],NIL])"],RAND:["RAND","NIL"],ABS:["ABS","(","expression",")"],CEIL:["CEIL","(","expression",")"],FLOOR:["FLOOR","(","expression",")"],ROUND:["ROUND","(","expression",")"],CONCAT:["CONCAT","expressionList"],SUBSTR:["substringExpression"],STRLEN:["STRLEN","(","expression",")"],REPLACE:["strReplaceExpression"],UCASE:["UCASE","(","expression",")"],LCASE:["LCASE","(","expression",")"],ENCODE_FOR_URI:["ENCODE_FOR_URI","(","expression",")"],CONTAINS:["CONTAINS","(","expression",",","expression",")"],STRSTARTS:["STRSTARTS","(","expression",",","expression",")"],STRENDS:["STRENDS","(","expression",",","expression",")"],STRBEFORE:["STRBEFORE","(","expression",",","expression",")"],STRAFTER:["STRAFTER","(","expression",",","expression",")"],YEAR:["YEAR","(","expression",")"],MONTH:["MONTH","(","expression",")"],DAY:["DAY","(","expression",")"],HOURS:["HOURS","(","expression",")"],MINUTES:["MINUTES","(","expression",")"],SECONDS:["SECONDS","(","expression",")"],TIMEZONE:["TIMEZONE","(","expression",")"],TZ:["TZ","(","expression",")"],NOW:["NOW","NIL"],UUID:["UUID","NIL"],STRUUID:["STRUUID","NIL"],MD5:["MD5","(","expression",")"],SHA1:["SHA1","(","expression",")"],SHA256:["SHA256","(","expression",")"],SHA384:["SHA384","(","expression",")"],SHA512:["SHA512","(","expression",")"],COALESCE:["COALESCE","expressionList"],IF:["IF","(","expression",",","expression",",","expression",")"],STRLANG:["STRLANG","(","expression",",","expression",")"],STRDT:["STRDT","(","expression",",","expression",")"],SAMETERM:["SAMETERM","(","expression",",","expression",")"],ISIRI:["ISIRI","(","expression",")"],ISURI:["ISURI","(","expression",")"],ISBLANK:["ISBLANK","(","expression",")"],ISLITERAL:["ISLITERAL","(","expression",")"],ISNUMERIC:["ISNUMERIC","(","expression",")"],REGEX:["regexExpression"],EXISTS:["existsFunc"],NOT:["notExistsFunc"]},clear:{CLEAR:["CLEAR","?SILENT_2","graphRefAll"]},collection:{"(":["(","+graphNode",")"]},collectionPath:{"(":["(","+graphNodePath",")"]},conditionalAndExpression:{"!":["valueLogical","*[&&,valueLogical]"],"+":["valueLogical","*[&&,valueLogical]"],"-":["valueLogical","*[&&,valueLogical]"],VAR1:["valueLogical","*[&&,valueLogical]"],VAR2:["valueLogical","*[&&,valueLogical]"],"(":["valueLogical","*[&&,valueLogical]"],STR:["valueLogical","*[&&,valueLogical]"],LANG:["valueLogical","*[&&,valueLogical]"],LANGMATCHES:["valueLogical","*[&&,valueLogical]"],DATATYPE:["valueLogical","*[&&,valueLogical]"],BOUND:["valueLogical","*[&&,valueLogical]"],IRI:["valueLogical","*[&&,valueLogical]"],URI:["valueLogical","*[&&,valueLogical]"],BNODE:["valueLogical","*[&&,valueLogical]"],RAND:["valueLogical","*[&&,valueLogical]"],ABS:["valueLogical","*[&&,valueLogical]"],CEIL:["valueLogical","*[&&,valueLogical]"],FLOOR:["valueLogical","*[&&,valueLogical]"],ROUND:["valueLogical","*[&&,valueLogical]"],CONCAT:["valueLogical","*[&&,valueLogical]"],STRLEN:["valueLogical","*[&&,valueLogical]"],UCASE:["valueLogical","*[&&,valueLogical]"],LCASE:["valueLogical","*[&&,valueLogical]"],ENCODE_FOR_URI:["valueLogical","*[&&,valueLogical]"],CONTAINS:["valueLogical","*[&&,valueLogical]"],STRSTARTS:["valueLogical","*[&&,valueLogical]"],STRENDS:["valueLogical","*[&&,valueLogical]"],STRBEFORE:["valueLogical","*[&&,valueLogical]"],STRAFTER:["valueLogical","*[&&,valueLogical]"],YEAR:["valueLogical","*[&&,valueLogical]"],MONTH:["valueLogical","*[&&,valueLogical]"],DAY:["valueLogical","*[&&,valueLogical]"],HOURS:["valueLogical","*[&&,valueLogical]"],MINUTES:["valueLogical","*[&&,valueLogical]"],SECONDS:["valueLogical","*[&&,valueLogical]"],TIMEZONE:["valueLogical","*[&&,valueLogical]"],TZ:["valueLogical","*[&&,valueLogical]"],NOW:["valueLogical","*[&&,valueLogical]"],UUID:["valueLogical","*[&&,valueLogical]"],STRUUID:["valueLogical","*[&&,valueLogical]"],MD5:["valueLogical","*[&&,valueLogical]"],SHA1:["valueLogical","*[&&,valueLogical]"],SHA256:["valueLogical","*[&&,valueLogical]"],SHA384:["valueLogical","*[&&,valueLogical]"],SHA512:["valueLogical","*[&&,valueLogical]"],COALESCE:["valueLogical","*[&&,valueLogical]"],IF:["valueLogical","*[&&,valueLogical]"],STRLANG:["valueLogical","*[&&,valueLogical]"],STRDT:["valueLogical","*[&&,valueLogical]"],SAMETERM:["valueLogical","*[&&,valueLogical]"],ISIRI:["valueLogical","*[&&,valueLogical]"],ISURI:["valueLogical","*[&&,valueLogical]"],ISBLANK:["valueLogical","*[&&,valueLogical]"],ISLITERAL:["valueLogical","*[&&,valueLogical]"],ISNUMERIC:["valueLogical","*[&&,valueLogical]"],TRUE:["valueLogical","*[&&,valueLogical]"],FALSE:["valueLogical","*[&&,valueLogical]"],"<<":["valueLogical","*[&&,valueLogical]"],COUNT:["valueLogical","*[&&,valueLogical]"],SUM:["valueLogical","*[&&,valueLogical]"],MIN:["valueLogical","*[&&,valueLogical]"],MAX:["valueLogical","*[&&,valueLogical]"],AVG:["valueLogical","*[&&,valueLogical]"],SAMPLE:["valueLogical","*[&&,valueLogical]"],GROUP_CONCAT:["valueLogical","*[&&,valueLogical]"],SUBSTR:["valueLogical","*[&&,valueLogical]"],REPLACE:["valueLogical","*[&&,valueLogical]"],REGEX:["valueLogical","*[&&,valueLogical]"],EXISTS:["valueLogical","*[&&,valueLogical]"],NOT:["valueLogical","*[&&,valueLogical]"],IRI_REF:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL1:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL2:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL_LONG1:["valueLogical","*[&&,valueLogical]"],STRING_LITERAL_LONG2:["valueLogical","*[&&,valueLogical]"],INTEGER:["valueLogical","*[&&,valueLogical]"],DECIMAL:["valueLogical","*[&&,valueLogical]"],DOUBLE:["valueLogical","*[&&,valueLogical]"],INTEGER_POSITIVE:["valueLogical","*[&&,valueLogical]"],DECIMAL_POSITIVE:["valueLogical","*[&&,valueLogical]"],DOUBLE_POSITIVE:["valueLogical","*[&&,valueLogical]"],INTEGER_NEGATIVE:["valueLogical","*[&&,valueLogical]"],DECIMAL_NEGATIVE:["valueLogical","*[&&,valueLogical]"],DOUBLE_NEGATIVE:["valueLogical","*[&&,valueLogical]"],PNAME_LN:["valueLogical","*[&&,valueLogical]"],PNAME_NS:["valueLogical","*[&&,valueLogical]"]},conditionalOrExpression:{"!":["conditionalAndExpression","*[||,conditionalAndExpression]"],"+":["conditionalAndExpression","*[||,conditionalAndExpression]"],"-":["conditionalAndExpression","*[||,conditionalAndExpression]"],VAR1:["conditionalAndExpression","*[||,conditionalAndExpression]"],VAR2:["conditionalAndExpression","*[||,conditionalAndExpression]"],"(":["conditionalAndExpression","*[||,conditionalAndExpression]"],STR:["conditionalAndExpression","*[||,conditionalAndExpression]"],LANG:["conditionalAndExpression","*[||,conditionalAndExpression]"],LANGMATCHES:["conditionalAndExpression","*[||,conditionalAndExpression]"],DATATYPE:["conditionalAndExpression","*[||,conditionalAndExpression]"],BOUND:["conditionalAndExpression","*[||,conditionalAndExpression]"],IRI:["conditionalAndExpression","*[||,conditionalAndExpression]"],URI:["conditionalAndExpression","*[||,conditionalAndExpression]"],BNODE:["conditionalAndExpression","*[||,conditionalAndExpression]"],RAND:["conditionalAndExpression","*[||,conditionalAndExpression]"],ABS:["conditionalAndExpression","*[||,conditionalAndExpression]"],CEIL:["conditionalAndExpression","*[||,conditionalAndExpression]"],FLOOR:["conditionalAndExpression","*[||,conditionalAndExpression]"],ROUND:["conditionalAndExpression","*[||,conditionalAndExpression]"],CONCAT:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRLEN:["conditionalAndExpression","*[||,conditionalAndExpression]"],UCASE:["conditionalAndExpression","*[||,conditionalAndExpression]"],LCASE:["conditionalAndExpression","*[||,conditionalAndExpression]"],ENCODE_FOR_URI:["conditionalAndExpression","*[||,conditionalAndExpression]"],CONTAINS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRSTARTS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRENDS:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRBEFORE:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRAFTER:["conditionalAndExpression","*[||,conditionalAndExpression]"],YEAR:["conditionalAndExpression","*[||,conditionalAndExpression]"],MONTH:["conditionalAndExpression","*[||,conditionalAndExpression]"],DAY:["conditionalAndExpression","*[||,conditionalAndExpression]"],HOURS:["conditionalAndExpression","*[||,conditionalAndExpression]"],MINUTES:["conditionalAndExpression","*[||,conditionalAndExpression]"],SECONDS:["conditionalAndExpression","*[||,conditionalAndExpression]"],TIMEZONE:["conditionalAndExpression","*[||,conditionalAndExpression]"],TZ:["conditionalAndExpression","*[||,conditionalAndExpression]"],NOW:["conditionalAndExpression","*[||,conditionalAndExpression]"],UUID:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRUUID:["conditionalAndExpression","*[||,conditionalAndExpression]"],MD5:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA1:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA256:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA384:["conditionalAndExpression","*[||,conditionalAndExpression]"],SHA512:["conditionalAndExpression","*[||,conditionalAndExpression]"],COALESCE:["conditionalAndExpression","*[||,conditionalAndExpression]"],IF:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRLANG:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRDT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SAMETERM:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISIRI:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISURI:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISBLANK:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISLITERAL:["conditionalAndExpression","*[||,conditionalAndExpression]"],ISNUMERIC:["conditionalAndExpression","*[||,conditionalAndExpression]"],TRUE:["conditionalAndExpression","*[||,conditionalAndExpression]"],FALSE:["conditionalAndExpression","*[||,conditionalAndExpression]"],"<<":["conditionalAndExpression","*[||,conditionalAndExpression]"],COUNT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SUM:["conditionalAndExpression","*[||,conditionalAndExpression]"],MIN:["conditionalAndExpression","*[||,conditionalAndExpression]"],MAX:["conditionalAndExpression","*[||,conditionalAndExpression]"],AVG:["conditionalAndExpression","*[||,conditionalAndExpression]"],SAMPLE:["conditionalAndExpression","*[||,conditionalAndExpression]"],GROUP_CONCAT:["conditionalAndExpression","*[||,conditionalAndExpression]"],SUBSTR:["conditionalAndExpression","*[||,conditionalAndExpression]"],REPLACE:["conditionalAndExpression","*[||,conditionalAndExpression]"],REGEX:["conditionalAndExpression","*[||,conditionalAndExpression]"],EXISTS:["conditionalAndExpression","*[||,conditionalAndExpression]"],NOT:["conditionalAndExpression","*[||,conditionalAndExpression]"],IRI_REF:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL1:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL2:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL_LONG1:["conditionalAndExpression","*[||,conditionalAndExpression]"],STRING_LITERAL_LONG2:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE_POSITIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],INTEGER_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DECIMAL_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],DOUBLE_NEGATIVE:["conditionalAndExpression","*[||,conditionalAndExpression]"],PNAME_LN:["conditionalAndExpression","*[||,conditionalAndExpression]"],PNAME_NS:["conditionalAndExpression","*[||,conditionalAndExpression]"]},constraint:{"(":["brackettedExpression"],STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["functionCall"],PNAME_LN:["functionCall"],PNAME_NS:["functionCall"]},constructQuery:{CONSTRUCT:["CONSTRUCT","or([[constructTemplate,*datasetClause,whereClause,solutionModifier],[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]])"]},constructTemplate:{"{":["{","?constructTriples","}"]},constructTriples:{VAR1:["triplesSameSubject","?[.,?constructTriples]"],VAR2:["triplesSameSubject","?[.,?constructTriples]"],NIL:["triplesSameSubject","?[.,?constructTriples]"],"(":["triplesSameSubject","?[.,?constructTriples]"],"[":["triplesSameSubject","?[.,?constructTriples]"],IRI_REF:["triplesSameSubject","?[.,?constructTriples]"],TRUE:["triplesSameSubject","?[.,?constructTriples]"],FALSE:["triplesSameSubject","?[.,?constructTriples]"],BLANK_NODE_LABEL:["triplesSameSubject","?[.,?constructTriples]"],ANON:["triplesSameSubject","?[.,?constructTriples]"],"<<":["triplesSameSubject","?[.,?constructTriples]"],PNAME_LN:["triplesSameSubject","?[.,?constructTriples]"],PNAME_NS:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL1:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL2:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL_LONG1:["triplesSameSubject","?[.,?constructTriples]"],STRING_LITERAL_LONG2:["triplesSameSubject","?[.,?constructTriples]"],INTEGER:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE:["triplesSameSubject","?[.,?constructTriples]"],INTEGER_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE_POSITIVE:["triplesSameSubject","?[.,?constructTriples]"],INTEGER_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"],DECIMAL_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"],DOUBLE_NEGATIVE:["triplesSameSubject","?[.,?constructTriples]"]},copy:{COPY:["COPY","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},create:{CREATE:["CREATE","?SILENT_3","graphRef"]},dataBlock:{NIL:["or([inlineDataOneVar,inlineDataFull])"],"(":["or([inlineDataOneVar,inlineDataFull])"],VAR1:["or([inlineDataOneVar,inlineDataFull])"],VAR2:["or([inlineDataOneVar,inlineDataFull])"]},dataBlockValue:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],"<<":["disallowVars","embeddedTriple","allowVars"],UNDEF:["UNDEF"]},datasetClause:{FROM:["FROM","or([defaultGraphClause,namedGraphClause])"]},defaultGraphClause:{IRI_REF:["sourceSelector"],PNAME_LN:["sourceSelector"],PNAME_NS:["sourceSelector"]},delete1:{DATA:["DATA","quadDataNoBnodes"],WHERE:["WHERE","quadPatternNoBnodes"],"{":["quadPatternNoBnodes","?insertClause","*usingClause","WHERE","groupGraphPattern"]},deleteClause:{DELETE:["DELETE","quadPattern"]},describeDatasetClause:{FROM:["FROM","or([defaultGraphClause,namedGraphClause])"]},describeQuery:{DESCRIBE:["DESCRIBE","or([+or([varOrIRIref,embeddedTriple]),*])","*describeDatasetClause","?whereClause","solutionModifier"]},disallowBnodes:{"}":[],GRAPH:[],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},disallowVars:{"}":[],GRAPH:[],VAR1:[],VAR2:[],NIL:[],"(":[],"[":[],IRI_REF:[],TRUE:[],FALSE:[],BLANK_NODE_LABEL:[],ANON:[],"<<":[],PNAME_LN:[],PNAME_NS:[],STRING_LITERAL1:[],STRING_LITERAL2:[],STRING_LITERAL_LONG1:[],STRING_LITERAL_LONG2:[],INTEGER:[],DECIMAL:[],DOUBLE:[],INTEGER_POSITIVE:[],DECIMAL_POSITIVE:[],DOUBLE_POSITIVE:[],INTEGER_NEGATIVE:[],DECIMAL_NEGATIVE:[],DOUBLE_NEGATIVE:[]},drop:{DROP:["DROP","?SILENT_2","graphRefAll"]},embeddedTriple:{"<<":["<<","varOrTerm","verb","varOrTerm",">>"]},existsFunc:{EXISTS:["EXISTS","groupGraphPattern"]},expression:{"!":["conditionalOrExpression"],"+":["conditionalOrExpression"],"-":["conditionalOrExpression"],VAR1:["conditionalOrExpression"],VAR2:["conditionalOrExpression"],"(":["conditionalOrExpression"],STR:["conditionalOrExpression"],LANG:["conditionalOrExpression"],LANGMATCHES:["conditionalOrExpression"],DATATYPE:["conditionalOrExpression"],BOUND:["conditionalOrExpression"],IRI:["conditionalOrExpression"],URI:["conditionalOrExpression"],BNODE:["conditionalOrExpression"],RAND:["conditionalOrExpression"],ABS:["conditionalOrExpression"],CEIL:["conditionalOrExpression"],FLOOR:["conditionalOrExpression"],ROUND:["conditionalOrExpression"],CONCAT:["conditionalOrExpression"],STRLEN:["conditionalOrExpression"],UCASE:["conditionalOrExpression"],LCASE:["conditionalOrExpression"],ENCODE_FOR_URI:["conditionalOrExpression"],CONTAINS:["conditionalOrExpression"],STRSTARTS:["conditionalOrExpression"],STRENDS:["conditionalOrExpression"],STRBEFORE:["conditionalOrExpression"],STRAFTER:["conditionalOrExpression"],YEAR:["conditionalOrExpression"],MONTH:["conditionalOrExpression"],DAY:["conditionalOrExpression"],HOURS:["conditionalOrExpression"],MINUTES:["conditionalOrExpression"],SECONDS:["conditionalOrExpression"],TIMEZONE:["conditionalOrExpression"],TZ:["conditionalOrExpression"],NOW:["conditionalOrExpression"],UUID:["conditionalOrExpression"],STRUUID:["conditionalOrExpression"],MD5:["conditionalOrExpression"],SHA1:["conditionalOrExpression"],SHA256:["conditionalOrExpression"],SHA384:["conditionalOrExpression"],SHA512:["conditionalOrExpression"],COALESCE:["conditionalOrExpression"],IF:["conditionalOrExpression"],STRLANG:["conditionalOrExpression"],STRDT:["conditionalOrExpression"],SAMETERM:["conditionalOrExpression"],ISIRI:["conditionalOrExpression"],ISURI:["conditionalOrExpression"],ISBLANK:["conditionalOrExpression"],ISLITERAL:["conditionalOrExpression"],ISNUMERIC:["conditionalOrExpression"],TRUE:["conditionalOrExpression"],FALSE:["conditionalOrExpression"],"<<":["conditionalOrExpression"],COUNT:["conditionalOrExpression"],SUM:["conditionalOrExpression"],MIN:["conditionalOrExpression"],MAX:["conditionalOrExpression"],AVG:["conditionalOrExpression"],SAMPLE:["conditionalOrExpression"],GROUP_CONCAT:["conditionalOrExpression"],SUBSTR:["conditionalOrExpression"],REPLACE:["conditionalOrExpression"],REGEX:["conditionalOrExpression"],EXISTS:["conditionalOrExpression"],NOT:["conditionalOrExpression"],IRI_REF:["conditionalOrExpression"],STRING_LITERAL1:["conditionalOrExpression"],STRING_LITERAL2:["conditionalOrExpression"],STRING_LITERAL_LONG1:["conditionalOrExpression"],STRING_LITERAL_LONG2:["conditionalOrExpression"],INTEGER:["conditionalOrExpression"],DECIMAL:["conditionalOrExpression"],DOUBLE:["conditionalOrExpression"],INTEGER_POSITIVE:["conditionalOrExpression"],DECIMAL_POSITIVE:["conditionalOrExpression"],DOUBLE_POSITIVE:["conditionalOrExpression"],INTEGER_NEGATIVE:["conditionalOrExpression"],DECIMAL_NEGATIVE:["conditionalOrExpression"],DOUBLE_NEGATIVE:["conditionalOrExpression"],PNAME_LN:["conditionalOrExpression"],PNAME_NS:["conditionalOrExpression"]},expressionList:{NIL:["NIL"],"(":["(","expression","*[,,expression]",")"]},filter:{FILTER:["FILTER","constraint"]},functionCall:{IRI_REF:["iriRef","argList"],PNAME_LN:["iriRef","argList"],PNAME_NS:["iriRef","argList"]},graphGraphPattern:{GRAPH:["GRAPH","varOrIRIref","groupGraphPattern"]},graphNode:{VAR1:["varOrTerm"],VAR2:["varOrTerm"],NIL:["varOrTerm"],IRI_REF:["varOrTerm"],TRUE:["varOrTerm"],FALSE:["varOrTerm"],BLANK_NODE_LABEL:["varOrTerm"],ANON:["varOrTerm"],"<<":["varOrTerm"],PNAME_LN:["varOrTerm"],PNAME_NS:["varOrTerm"],STRING_LITERAL1:["varOrTerm"],STRING_LITERAL2:["varOrTerm"],STRING_LITERAL_LONG1:["varOrTerm"],STRING_LITERAL_LONG2:["varOrTerm"],INTEGER:["varOrTerm"],DECIMAL:["varOrTerm"],DOUBLE:["varOrTerm"],INTEGER_POSITIVE:["varOrTerm"],DECIMAL_POSITIVE:["varOrTerm"],DOUBLE_POSITIVE:["varOrTerm"],INTEGER_NEGATIVE:["varOrTerm"],DECIMAL_NEGATIVE:["varOrTerm"],DOUBLE_NEGATIVE:["varOrTerm"],"(":["triplesNode"],"[":["triplesNode"]},graphNodePath:{VAR1:["varOrTerm"],VAR2:["varOrTerm"],NIL:["varOrTerm"],IRI_REF:["varOrTerm"],TRUE:["varOrTerm"],FALSE:["varOrTerm"],BLANK_NODE_LABEL:["varOrTerm"],ANON:["varOrTerm"],"<<":["varOrTerm"],PNAME_LN:["varOrTerm"],PNAME_NS:["varOrTerm"],STRING_LITERAL1:["varOrTerm"],STRING_LITERAL2:["varOrTerm"],STRING_LITERAL_LONG1:["varOrTerm"],STRING_LITERAL_LONG2:["varOrTerm"],INTEGER:["varOrTerm"],DECIMAL:["varOrTerm"],DOUBLE:["varOrTerm"],INTEGER_POSITIVE:["varOrTerm"],DECIMAL_POSITIVE:["varOrTerm"],DOUBLE_POSITIVE:["varOrTerm"],INTEGER_NEGATIVE:["varOrTerm"],DECIMAL_NEGATIVE:["varOrTerm"],DOUBLE_NEGATIVE:["varOrTerm"],"(":["triplesNodePath"],"[":["triplesNodePath"]},graphOrDefault:{DEFAULT:["DEFAULT"],IRI_REF:["?GRAPH","iriRef"],PNAME_LN:["?GRAPH","iriRef"],PNAME_NS:["?GRAPH","iriRef"],GRAPH:["?GRAPH","iriRef"]},graphPatternNotTriples:{"{":["groupOrUnionGraphPattern"],OPTIONAL:["optionalGraphPattern"],MINUS:["minusGraphPattern"],GRAPH:["graphGraphPattern"],SERVICE:["serviceGraphPattern"],FILTER:["filter"],BIND:["bind"],VALUES:["inlineData"]},graphRef:{GRAPH:["GRAPH","iriRef"]},graphRefAll:{GRAPH:["graphRef"],DEFAULT:["DEFAULT"],NAMED:["NAMED"],ALL:["ALL"]},graphTerm:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],BLANK_NODE_LABEL:["blankNode"],ANON:["blankNode"],"<<":["embeddedTriple"],NIL:["NIL"]},groupClause:{GROUP:["GROUP","BY","+groupCondition"]},groupCondition:{STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["functionCall"],PNAME_LN:["functionCall"],PNAME_NS:["functionCall"],"(":["(","expression","?[AS,var]",")"],VAR1:["var"],VAR2:["var"]},groupGraphPattern:{"{":["{","or([subSelect,groupGraphPatternSub])","}"]},groupGraphPatternSub:{"{":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],OPTIONAL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],MINUS:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],GRAPH:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],SERVICE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],FILTER:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],BIND:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VALUES:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VAR1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],VAR2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],NIL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"(":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"[":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],IRI_REF:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],TRUE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],FALSE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],BLANK_NODE_LABEL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],ANON:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"<<":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],PNAME_LN:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],PNAME_NS:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL_LONG1:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],STRING_LITERAL_LONG2:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE_POSITIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],INTEGER_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DECIMAL_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],DOUBLE_NEGATIVE:["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"],"}":["?triplesBlock","*[graphPatternNotTriples,?.,?triplesBlock]"]},groupOrUnionGraphPattern:{"{":["groupGraphPattern","*[UNION,groupGraphPattern]"]},havingClause:{HAVING:["HAVING","+havingCondition"]},havingCondition:{"(":["constraint"],STR:["constraint"],LANG:["constraint"],LANGMATCHES:["constraint"],DATATYPE:["constraint"],BOUND:["constraint"],IRI:["constraint"],URI:["constraint"],BNODE:["constraint"],RAND:["constraint"],ABS:["constraint"],CEIL:["constraint"],FLOOR:["constraint"],ROUND:["constraint"],CONCAT:["constraint"],STRLEN:["constraint"],UCASE:["constraint"],LCASE:["constraint"],ENCODE_FOR_URI:["constraint"],CONTAINS:["constraint"],STRSTARTS:["constraint"],STRENDS:["constraint"],STRBEFORE:["constraint"],STRAFTER:["constraint"],YEAR:["constraint"],MONTH:["constraint"],DAY:["constraint"],HOURS:["constraint"],MINUTES:["constraint"],SECONDS:["constraint"],TIMEZONE:["constraint"],TZ:["constraint"],NOW:["constraint"],UUID:["constraint"],STRUUID:["constraint"],MD5:["constraint"],SHA1:["constraint"],SHA256:["constraint"],SHA384:["constraint"],SHA512:["constraint"],COALESCE:["constraint"],IF:["constraint"],STRLANG:["constraint"],STRDT:["constraint"],SAMETERM:["constraint"],ISIRI:["constraint"],ISURI:["constraint"],ISBLANK:["constraint"],ISLITERAL:["constraint"],ISNUMERIC:["constraint"],SUBSTR:["constraint"],REPLACE:["constraint"],REGEX:["constraint"],EXISTS:["constraint"],NOT:["constraint"],IRI_REF:["constraint"],PNAME_LN:["constraint"],PNAME_NS:["constraint"]},inlineData:{VALUES:["VALUES","dataBlock"]},inlineDataFull:{NIL:["or([NIL,[(,*var,)]])","{","*or([[(,*dataBlockValue,)],NIL])","}"],"(":["or([NIL,[(,*var,)]])","{","*or([[(,*dataBlockValue,)],NIL])","}"]},inlineDataOneVar:{VAR1:["var","{","*dataBlockValue","}"],VAR2:["var","{","*dataBlockValue","}"]},insert1:{DATA:["DATA","quadData"],"{":["quadPattern","*usingClause","WHERE","groupGraphPattern"]},insertClause:{INSERT:["INSERT","quadPattern"]},integer:{INTEGER:["INTEGER"]},iriRef:{IRI_REF:["IRI_REF"],PNAME_LN:["prefixedName"],PNAME_NS:["prefixedName"]},iriRefOrFunction:{IRI_REF:["iriRef","?argList"],PNAME_LN:["iriRef","?argList"],PNAME_NS:["iriRef","?argList"]},limitClause:{LIMIT:["LIMIT","INTEGER"]},limitOffsetClauses:{LIMIT:["limitClause","?offsetClause"],OFFSET:["offsetClause","?limitClause"]},load:{LOAD:["LOAD","?SILENT_1","iriRef","?[INTO,graphRef]"]},minusGraphPattern:{MINUS:["MINUS","groupGraphPattern"]},modify:{WITH:["WITH","iriRef","or([[deleteClause,?insertClause],insertClause])","*usingClause","WHERE","groupGraphPattern"]},move:{MOVE:["MOVE","?SILENT_4","graphOrDefault","TO","graphOrDefault"]},multiplicativeExpression:{"!":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"+":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"-":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],VAR1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],VAR2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"(":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LANG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LANGMATCHES:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DATATYPE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],BOUND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IRI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],URI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],BNODE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],RAND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ABS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CEIL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],FLOOR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ROUND:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CONCAT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRLEN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],UCASE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],LCASE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ENCODE_FOR_URI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],CONTAINS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRSTARTS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRENDS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRBEFORE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRAFTER:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],YEAR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MONTH:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DAY:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],HOURS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MINUTES:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SECONDS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TIMEZONE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TZ:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],NOW:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],UUID:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRUUID:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MD5:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA256:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA384:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SHA512:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],COALESCE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IF:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRLANG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRDT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SAMETERM:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISIRI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISURI:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISBLANK:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISLITERAL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],ISNUMERIC:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],TRUE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],FALSE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],"<<":["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],COUNT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SUM:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MIN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],MAX:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],AVG:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SAMPLE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],GROUP_CONCAT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],SUBSTR:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],REPLACE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],REGEX:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],EXISTS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],NOT:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],IRI_REF:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL_LONG1:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],STRING_LITERAL_LONG2:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_POSITIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],INTEGER_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DECIMAL_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],DOUBLE_NEGATIVE:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],PNAME_LN:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"],PNAME_NS:["unaryExpression","*or([[*,unaryExpression],[/,unaryExpression]])"]},namedGraphClause:{NAMED:["NAMED","sourceSelector"]},notExistsFunc:{NOT:["NOT","EXISTS","groupGraphPattern"]},numericExpression:{"!":["additiveExpression"],"+":["additiveExpression"],"-":["additiveExpression"],VAR1:["additiveExpression"],VAR2:["additiveExpression"],"(":["additiveExpression"],STR:["additiveExpression"],LANG:["additiveExpression"],LANGMATCHES:["additiveExpression"],DATATYPE:["additiveExpression"],BOUND:["additiveExpression"],IRI:["additiveExpression"],URI:["additiveExpression"],BNODE:["additiveExpression"],RAND:["additiveExpression"],ABS:["additiveExpression"],CEIL:["additiveExpression"],FLOOR:["additiveExpression"],ROUND:["additiveExpression"],CONCAT:["additiveExpression"],STRLEN:["additiveExpression"],UCASE:["additiveExpression"],LCASE:["additiveExpression"],ENCODE_FOR_URI:["additiveExpression"],CONTAINS:["additiveExpression"],STRSTARTS:["additiveExpression"],STRENDS:["additiveExpression"],STRBEFORE:["additiveExpression"],STRAFTER:["additiveExpression"],YEAR:["additiveExpression"],MONTH:["additiveExpression"],DAY:["additiveExpression"],HOURS:["additiveExpression"],MINUTES:["additiveExpression"],SECONDS:["additiveExpression"],TIMEZONE:["additiveExpression"],TZ:["additiveExpression"],NOW:["additiveExpression"],UUID:["additiveExpression"],STRUUID:["additiveExpression"],MD5:["additiveExpression"],SHA1:["additiveExpression"],SHA256:["additiveExpression"],SHA384:["additiveExpression"],SHA512:["additiveExpression"],COALESCE:["additiveExpression"],IF:["additiveExpression"],STRLANG:["additiveExpression"],STRDT:["additiveExpression"],SAMETERM:["additiveExpression"],ISIRI:["additiveExpression"],ISURI:["additiveExpression"],ISBLANK:["additiveExpression"],ISLITERAL:["additiveExpression"],ISNUMERIC:["additiveExpression"],TRUE:["additiveExpression"],FALSE:["additiveExpression"],"<<":["additiveExpression"],COUNT:["additiveExpression"],SUM:["additiveExpression"],MIN:["additiveExpression"],MAX:["additiveExpression"],AVG:["additiveExpression"],SAMPLE:["additiveExpression"],GROUP_CONCAT:["additiveExpression"],SUBSTR:["additiveExpression"],REPLACE:["additiveExpression"],REGEX:["additiveExpression"],EXISTS:["additiveExpression"],NOT:["additiveExpression"],IRI_REF:["additiveExpression"],STRING_LITERAL1:["additiveExpression"],STRING_LITERAL2:["additiveExpression"],STRING_LITERAL_LONG1:["additiveExpression"],STRING_LITERAL_LONG2:["additiveExpression"],INTEGER:["additiveExpression"],DECIMAL:["additiveExpression"],DOUBLE:["additiveExpression"],INTEGER_POSITIVE:["additiveExpression"],DECIMAL_POSITIVE:["additiveExpression"],DOUBLE_POSITIVE:["additiveExpression"],INTEGER_NEGATIVE:["additiveExpression"],DECIMAL_NEGATIVE:["additiveExpression"],DOUBLE_NEGATIVE:["additiveExpression"],PNAME_LN:["additiveExpression"],PNAME_NS:["additiveExpression"]},numericLiteral:{INTEGER:["numericLiteralUnsigned"],DECIMAL:["numericLiteralUnsigned"],DOUBLE:["numericLiteralUnsigned"],INTEGER_POSITIVE:["numericLiteralPositive"],DECIMAL_POSITIVE:["numericLiteralPositive"],DOUBLE_POSITIVE:["numericLiteralPositive"],INTEGER_NEGATIVE:["numericLiteralNegative"],DECIMAL_NEGATIVE:["numericLiteralNegative"],DOUBLE_NEGATIVE:["numericLiteralNegative"]},numericLiteralNegative:{INTEGER_NEGATIVE:["INTEGER_NEGATIVE"],DECIMAL_NEGATIVE:["DECIMAL_NEGATIVE"],DOUBLE_NEGATIVE:["DOUBLE_NEGATIVE"]},numericLiteralPositive:{INTEGER_POSITIVE:["INTEGER_POSITIVE"],DECIMAL_POSITIVE:["DECIMAL_POSITIVE"],DOUBLE_POSITIVE:["DOUBLE_POSITIVE"]},numericLiteralUnsigned:{INTEGER:["INTEGER"],DECIMAL:["DECIMAL"],DOUBLE:["DOUBLE"]},object:{"(":["graphNode"],"[":["graphNode"],VAR1:["graphNode"],VAR2:["graphNode"],NIL:["graphNode"],IRI_REF:["graphNode"],TRUE:["graphNode"],FALSE:["graphNode"],BLANK_NODE_LABEL:["graphNode"],ANON:["graphNode"],"<<":["graphNode"],PNAME_LN:["graphNode"],PNAME_NS:["graphNode"],STRING_LITERAL1:["graphNode"],STRING_LITERAL2:["graphNode"],STRING_LITERAL_LONG1:["graphNode"],STRING_LITERAL_LONG2:["graphNode"],INTEGER:["graphNode"],DECIMAL:["graphNode"],DOUBLE:["graphNode"],INTEGER_POSITIVE:["graphNode"],DECIMAL_POSITIVE:["graphNode"],DOUBLE_POSITIVE:["graphNode"],INTEGER_NEGATIVE:["graphNode"],DECIMAL_NEGATIVE:["graphNode"],DOUBLE_NEGATIVE:["graphNode"]},objectList:{"(":["object","*[,,object]"],"[":["object","*[,,object]"],VAR1:["object","*[,,object]"],VAR2:["object","*[,,object]"],NIL:["object","*[,,object]"],IRI_REF:["object","*[,,object]"],TRUE:["object","*[,,object]"],FALSE:["object","*[,,object]"],BLANK_NODE_LABEL:["object","*[,,object]"],ANON:["object","*[,,object]"],"<<":["object","*[,,object]"],PNAME_LN:["object","*[,,object]"],PNAME_NS:["object","*[,,object]"],STRING_LITERAL1:["object","*[,,object]"],STRING_LITERAL2:["object","*[,,object]"],STRING_LITERAL_LONG1:["object","*[,,object]"],STRING_LITERAL_LONG2:["object","*[,,object]"],INTEGER:["object","*[,,object]"],DECIMAL:["object","*[,,object]"],DOUBLE:["object","*[,,object]"],INTEGER_POSITIVE:["object","*[,,object]"],DECIMAL_POSITIVE:["object","*[,,object]"],DOUBLE_POSITIVE:["object","*[,,object]"],INTEGER_NEGATIVE:["object","*[,,object]"],DECIMAL_NEGATIVE:["object","*[,,object]"],DOUBLE_NEGATIVE:["object","*[,,object]"]},objectListPath:{"(":["objectPath","*[,,objectPath]"],"[":["objectPath","*[,,objectPath]"],VAR1:["objectPath","*[,,objectPath]"],VAR2:["objectPath","*[,,objectPath]"],NIL:["objectPath","*[,,objectPath]"],IRI_REF:["objectPath","*[,,objectPath]"],TRUE:["objectPath","*[,,objectPath]"],FALSE:["objectPath","*[,,objectPath]"],BLANK_NODE_LABEL:["objectPath","*[,,objectPath]"],ANON:["objectPath","*[,,objectPath]"],"<<":["objectPath","*[,,objectPath]"],PNAME_LN:["objectPath","*[,,objectPath]"],PNAME_NS:["objectPath","*[,,objectPath]"],STRING_LITERAL1:["objectPath","*[,,objectPath]"],STRING_LITERAL2:["objectPath","*[,,objectPath]"],STRING_LITERAL_LONG1:["objectPath","*[,,objectPath]"],STRING_LITERAL_LONG2:["objectPath","*[,,objectPath]"],INTEGER:["objectPath","*[,,objectPath]"],DECIMAL:["objectPath","*[,,objectPath]"],DOUBLE:["objectPath","*[,,objectPath]"],INTEGER_POSITIVE:["objectPath","*[,,objectPath]"],DECIMAL_POSITIVE:["objectPath","*[,,objectPath]"],DOUBLE_POSITIVE:["objectPath","*[,,objectPath]"],INTEGER_NEGATIVE:["objectPath","*[,,objectPath]"],DECIMAL_NEGATIVE:["objectPath","*[,,objectPath]"],DOUBLE_NEGATIVE:["objectPath","*[,,objectPath]"]},objectPath:{"(":["graphNodePath"],"[":["graphNodePath"],VAR1:["graphNodePath"],VAR2:["graphNodePath"],NIL:["graphNodePath"],IRI_REF:["graphNodePath"],TRUE:["graphNodePath"],FALSE:["graphNodePath"],BLANK_NODE_LABEL:["graphNodePath"],ANON:["graphNodePath"],"<<":["graphNodePath"],PNAME_LN:["graphNodePath"],PNAME_NS:["graphNodePath"],STRING_LITERAL1:["graphNodePath"],STRING_LITERAL2:["graphNodePath"],STRING_LITERAL_LONG1:["graphNodePath"],STRING_LITERAL_LONG2:["graphNodePath"],INTEGER:["graphNodePath"],DECIMAL:["graphNodePath"],DOUBLE:["graphNodePath"],INTEGER_POSITIVE:["graphNodePath"],DECIMAL_POSITIVE:["graphNodePath"],DOUBLE_POSITIVE:["graphNodePath"],INTEGER_NEGATIVE:["graphNodePath"],DECIMAL_NEGATIVE:["graphNodePath"],DOUBLE_NEGATIVE:["graphNodePath"]},offsetClause:{OFFSET:["OFFSET","INTEGER"]},optionalGraphPattern:{OPTIONAL:["OPTIONAL","groupGraphPattern"]},"or([*,expression])":{"*":["*"],"!":["expression"],"+":["expression"],"-":["expression"],VAR1:["expression"],VAR2:["expression"],"(":["expression"],STR:["expression"],LANG:["expression"],LANGMATCHES:["expression"],DATATYPE:["expression"],BOUND:["expression"],IRI:["expression"],URI:["expression"],BNODE:["expression"],RAND:["expression"],ABS:["expression"],CEIL:["expression"],FLOOR:["expression"],ROUND:["expression"],CONCAT:["expression"],STRLEN:["expression"],UCASE:["expression"],LCASE:["expression"],ENCODE_FOR_URI:["expression"],CONTAINS:["expression"],STRSTARTS:["expression"],STRENDS:["expression"],STRBEFORE:["expression"],STRAFTER:["expression"],YEAR:["expression"],MONTH:["expression"],DAY:["expression"],HOURS:["expression"],MINUTES:["expression"],SECONDS:["expression"],TIMEZONE:["expression"],TZ:["expression"],NOW:["expression"],UUID:["expression"],STRUUID:["expression"],MD5:["expression"],SHA1:["expression"],SHA256:["expression"],SHA384:["expression"],SHA512:["expression"],COALESCE:["expression"],IF:["expression"],STRLANG:["expression"],STRDT:["expression"],SAMETERM:["expression"],ISIRI:["expression"],ISURI:["expression"],ISBLANK:["expression"],ISLITERAL:["expression"],ISNUMERIC:["expression"],TRUE:["expression"],FALSE:["expression"],"<<":["expression"],COUNT:["expression"],SUM:["expression"],MIN:["expression"],MAX:["expression"],AVG:["expression"],SAMPLE:["expression"],GROUP_CONCAT:["expression"],SUBSTR:["expression"],REPLACE:["expression"],REGEX:["expression"],EXISTS:["expression"],NOT:["expression"],IRI_REF:["expression"],STRING_LITERAL1:["expression"],STRING_LITERAL2:["expression"],STRING_LITERAL_LONG1:["expression"],STRING_LITERAL_LONG2:["expression"],INTEGER:["expression"],DECIMAL:["expression"],DOUBLE:["expression"],INTEGER_POSITIVE:["expression"],DECIMAL_POSITIVE:["expression"],DOUBLE_POSITIVE:["expression"],INTEGER_NEGATIVE:["expression"],DECIMAL_NEGATIVE:["expression"],DOUBLE_NEGATIVE:["expression"],PNAME_LN:["expression"],PNAME_NS:["expression"]},"or([+or([var,[(,expression,AS,var,)]]),*])":{"(":["+or([var,[(,expression,AS,var,)]])"],VAR1:["+or([var,[(,expression,AS,var,)]])"],VAR2:["+or([var,[(,expression,AS,var,)]])"],"*":["*"]},"or([+or([varOrIRIref,embeddedTriple]),*])":{"<<":["+or([varOrIRIref,embeddedTriple])"],VAR1:["+or([varOrIRIref,embeddedTriple])"],VAR2:["+or([varOrIRIref,embeddedTriple])"],IRI_REF:["+or([varOrIRIref,embeddedTriple])"],PNAME_LN:["+or([varOrIRIref,embeddedTriple])"],PNAME_NS:["+or([varOrIRIref,embeddedTriple])"],"*":["*"]},"or([ASC,DESC])":{ASC:["ASC"],DESC:["DESC"]},"or([DISTINCT,REDUCED])":{DISTINCT:["DISTINCT"],REDUCED:["REDUCED"]},"or([LANGTAG,[^^,iriRef]])":{LANGTAG:["LANGTAG"],"^^":["[^^,iriRef]"]},"or([NIL,[(,*var,)]])":{NIL:["NIL"],"(":["[(,*var,)]"]},"or([[(,*dataBlockValue,)],NIL])":{"(":["[(,*dataBlockValue,)]"],NIL:["NIL"]},"or([[(,expression,)],NIL])":{"(":["[(,expression,)]"],NIL:["NIL"]},"or([[*,unaryExpression],[/,unaryExpression]])":{"*":["[*,unaryExpression]"],"/":["[/,unaryExpression]"]},"or([[+,multiplicativeExpression],[-,multiplicativeExpression],[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]])":{"+":["[+,multiplicativeExpression]"],"-":["[-,multiplicativeExpression]"],INTEGER_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DECIMAL_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DOUBLE_POSITIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],INTEGER_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DECIMAL_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"],DOUBLE_NEGATIVE:["[or([numericLiteralPositive,numericLiteralNegative]),?or([[*,unaryExpression],[/,unaryExpression]])]"]},"or([[,,or([},[integer,}]])],}])":{",":["[,,or([},[integer,}]])]"],"}":["}"]},"or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])":{"=":["[=,numericExpression]"],"!=":["[!=,numericExpression]"],"<":["[<,numericExpression]"],">":["[>,numericExpression]"],"<=":["[<=,numericExpression]"],">=":["[>=,numericExpression]"],IN:["[IN,expressionList]"],NOT:["[NOT,IN,expressionList]"]},"or([[constructTemplate,*datasetClause,whereClause,solutionModifier],[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]])":{"{":["[constructTemplate,*datasetClause,whereClause,solutionModifier]"],WHERE:["[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]"],FROM:["[*datasetClause,WHERE,{,?triplesTemplate,},solutionModifier]"]},"or([[deleteClause,?insertClause],insertClause])":{DELETE:["[deleteClause,?insertClause]"],INSERT:["insertClause"]},"or([[integer,or([[,,or([},[integer,}]])],}])],[,,integer,}]])":{INTEGER:["[integer,or([[,,or([},[integer,}]])],}])]"],",":["[,,integer,}]"]},"or([baseDecl,prefixDecl])":{BASE:["baseDecl"],PREFIX:["prefixDecl"]},"or([defaultGraphClause,namedGraphClause])":{IRI_REF:["defaultGraphClause"],PNAME_LN:["defaultGraphClause"],PNAME_NS:["defaultGraphClause"],NAMED:["namedGraphClause"]},"or([inlineDataOneVar,inlineDataFull])":{VAR1:["inlineDataOneVar"],VAR2:["inlineDataOneVar"],NIL:["inlineDataFull"],"(":["inlineDataFull"]},"or([iriRef,[NAMED,iriRef]])":{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],NAMED:["[NAMED,iriRef]"]},"or([iriRef,a])":{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],a:["a"]},"or([numericLiteralPositive,numericLiteralNegative])":{INTEGER_POSITIVE:["numericLiteralPositive"],DECIMAL_POSITIVE:["numericLiteralPositive"],DOUBLE_POSITIVE:["numericLiteralPositive"],INTEGER_NEGATIVE:["numericLiteralNegative"],DECIMAL_NEGATIVE:["numericLiteralNegative"],DOUBLE_NEGATIVE:["numericLiteralNegative"]},"or([queryAll,updateAll])":{CONSTRUCT:["queryAll"],DESCRIBE:["queryAll"],ASK:["queryAll"],SELECT:["queryAll"],INSERT:["updateAll"],DELETE:["updateAll"],LOAD:["updateAll"],CLEAR:["updateAll"],DROP:["updateAll"],ADD:["updateAll"],MOVE:["updateAll"],COPY:["updateAll"],CREATE:["updateAll"],WITH:["updateAll"],$:["updateAll"]},"or([selectQuery,constructQuery,describeQuery,askQuery])":{SELECT:["selectQuery"],CONSTRUCT:["constructQuery"],DESCRIBE:["describeQuery"],ASK:["askQuery"]},"or([subSelect,groupGraphPatternSub])":{SELECT:["subSelect"],"{":["groupGraphPatternSub"],OPTIONAL:["groupGraphPatternSub"],MINUS:["groupGraphPatternSub"],GRAPH:["groupGraphPatternSub"],SERVICE:["groupGraphPatternSub"],FILTER:["groupGraphPatternSub"],BIND:["groupGraphPatternSub"],VALUES:["groupGraphPatternSub"],VAR1:["groupGraphPatternSub"],VAR2:["groupGraphPatternSub"],NIL:["groupGraphPatternSub"],"(":["groupGraphPatternSub"],"[":["groupGraphPatternSub"],IRI_REF:["groupGraphPatternSub"],TRUE:["groupGraphPatternSub"],FALSE:["groupGraphPatternSub"],BLANK_NODE_LABEL:["groupGraphPatternSub"],ANON:["groupGraphPatternSub"],"<<":["groupGraphPatternSub"],PNAME_LN:["groupGraphPatternSub"],PNAME_NS:["groupGraphPatternSub"],STRING_LITERAL1:["groupGraphPatternSub"],STRING_LITERAL2:["groupGraphPatternSub"],STRING_LITERAL_LONG1:["groupGraphPatternSub"],STRING_LITERAL_LONG2:["groupGraphPatternSub"],INTEGER:["groupGraphPatternSub"],DECIMAL:["groupGraphPatternSub"],DOUBLE:["groupGraphPatternSub"],INTEGER_POSITIVE:["groupGraphPatternSub"],DECIMAL_POSITIVE:["groupGraphPatternSub"],DOUBLE_POSITIVE:["groupGraphPatternSub"],INTEGER_NEGATIVE:["groupGraphPatternSub"],DECIMAL_NEGATIVE:["groupGraphPatternSub"],DOUBLE_NEGATIVE:["groupGraphPatternSub"],"}":["groupGraphPatternSub"]},"or([var,[(,expression,AS,var,)]])":{VAR1:["var"],VAR2:["var"],"(":["[(,expression,AS,var,)]"]},"or([varOrIRIref,embeddedTriple])":{VAR1:["varOrIRIref"],VAR2:["varOrIRIref"],IRI_REF:["varOrIRIref"],PNAME_LN:["varOrIRIref"],PNAME_NS:["varOrIRIref"],"<<":["embeddedTriple"]},"or([verbPath,verbSimple])":{"^":["verbPath"],a:["verbPath"],"!":["verbPath"],"(":["verbPath"],IRI_REF:["verbPath"],PNAME_LN:["verbPath"],PNAME_NS:["verbPath"],VAR1:["verbSimple"],VAR2:["verbSimple"]},"or([},[integer,}]])":{"}":["}"],INTEGER:["[integer,}]"]},orderClause:{ORDER:["ORDER","BY","+orderCondition"]},orderCondition:{ASC:["or([ASC,DESC])","brackettedExpression"],DESC:["or([ASC,DESC])","brackettedExpression"],"(":["constraint"],STR:["constraint"],LANG:["constraint"],LANGMATCHES:["constraint"],DATATYPE:["constraint"],BOUND:["constraint"],IRI:["constraint"],URI:["constraint"],BNODE:["constraint"],RAND:["constraint"],ABS:["constraint"],CEIL:["constraint"],FLOOR:["constraint"],ROUND:["constraint"],CONCAT:["constraint"],STRLEN:["constraint"],UCASE:["constraint"],LCASE:["constraint"],ENCODE_FOR_URI:["constraint"],CONTAINS:["constraint"],STRSTARTS:["constraint"],STRENDS:["constraint"],STRBEFORE:["constraint"],STRAFTER:["constraint"],YEAR:["constraint"],MONTH:["constraint"],DAY:["constraint"],HOURS:["constraint"],MINUTES:["constraint"],SECONDS:["constraint"],TIMEZONE:["constraint"],TZ:["constraint"],NOW:["constraint"],UUID:["constraint"],STRUUID:["constraint"],MD5:["constraint"],SHA1:["constraint"],SHA256:["constraint"],SHA384:["constraint"],SHA512:["constraint"],COALESCE:["constraint"],IF:["constraint"],STRLANG:["constraint"],STRDT:["constraint"],SAMETERM:["constraint"],ISIRI:["constraint"],ISURI:["constraint"],ISBLANK:["constraint"],ISLITERAL:["constraint"],ISNUMERIC:["constraint"],SUBSTR:["constraint"],REPLACE:["constraint"],REGEX:["constraint"],EXISTS:["constraint"],NOT:["constraint"],IRI_REF:["constraint"],PNAME_LN:["constraint"],PNAME_NS:["constraint"],VAR1:["var"],VAR2:["var"]},path:{"^":["pathAlternative"],a:["pathAlternative"],"!":["pathAlternative"],"(":["pathAlternative"],IRI_REF:["pathAlternative"],PNAME_LN:["pathAlternative"],PNAME_NS:["pathAlternative"]},pathAlternative:{"^":["pathSequence","*[|,pathSequence]"],a:["pathSequence","*[|,pathSequence]"],"!":["pathSequence","*[|,pathSequence]"],"(":["pathSequence","*[|,pathSequence]"],IRI_REF:["pathSequence","*[|,pathSequence]"],PNAME_LN:["pathSequence","*[|,pathSequence]"],PNAME_NS:["pathSequence","*[|,pathSequence]"]},pathElt:{a:["pathPrimary","?pathMod"],"!":["pathPrimary","?pathMod"],"(":["pathPrimary","?pathMod"],IRI_REF:["pathPrimary","?pathMod"],PNAME_LN:["pathPrimary","?pathMod"],PNAME_NS:["pathPrimary","?pathMod"]},pathEltOrInverse:{a:["pathElt"],"!":["pathElt"],"(":["pathElt"],IRI_REF:["pathElt"],PNAME_LN:["pathElt"],PNAME_NS:["pathElt"],"^":["^","pathElt"]},pathMod:{"*":["*"],"?":["?"],"+":["+"],"{":["{","or([[integer,or([[,,or([},[integer,}]])],}])],[,,integer,}]])"]},pathNegatedPropertySet:{a:["pathOneInPropertySet"],"^":["pathOneInPropertySet"],IRI_REF:["pathOneInPropertySet"],PNAME_LN:["pathOneInPropertySet"],PNAME_NS:["pathOneInPropertySet"],"(":["(","?[pathOneInPropertySet,*[|,pathOneInPropertySet]]",")"]},pathOneInPropertySet:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"],a:["a"],"^":["^","or([iriRef,a])"]},pathPrimary:{IRI_REF:["storeProperty","iriRef"],PNAME_LN:["storeProperty","iriRef"],PNAME_NS:["storeProperty","iriRef"],a:["storeProperty","a"],"!":["!","pathNegatedPropertySet"],"(":["(","path",")"]},pathSequence:{"^":["pathEltOrInverse","*[/,pathEltOrInverse]"],a:["pathEltOrInverse","*[/,pathEltOrInverse]"],"!":["pathEltOrInverse","*[/,pathEltOrInverse]"],"(":["pathEltOrInverse","*[/,pathEltOrInverse]"],IRI_REF:["pathEltOrInverse","*[/,pathEltOrInverse]"],PNAME_LN:["pathEltOrInverse","*[/,pathEltOrInverse]"],PNAME_NS:["pathEltOrInverse","*[/,pathEltOrInverse]"]},prefixDecl:{PREFIX:["PREFIX","PNAME_NS","IRI_REF"]},prefixedName:{PNAME_LN:["PNAME_LN"],PNAME_NS:["PNAME_NS"]},primaryExpression:{"(":["brackettedExpression"],STR:["builtInCall"],LANG:["builtInCall"],LANGMATCHES:["builtInCall"],DATATYPE:["builtInCall"],BOUND:["builtInCall"],IRI:["builtInCall"],URI:["builtInCall"],BNODE:["builtInCall"],RAND:["builtInCall"],ABS:["builtInCall"],CEIL:["builtInCall"],FLOOR:["builtInCall"],ROUND:["builtInCall"],CONCAT:["builtInCall"],STRLEN:["builtInCall"],UCASE:["builtInCall"],LCASE:["builtInCall"],ENCODE_FOR_URI:["builtInCall"],CONTAINS:["builtInCall"],STRSTARTS:["builtInCall"],STRENDS:["builtInCall"],STRBEFORE:["builtInCall"],STRAFTER:["builtInCall"],YEAR:["builtInCall"],MONTH:["builtInCall"],DAY:["builtInCall"],HOURS:["builtInCall"],MINUTES:["builtInCall"],SECONDS:["builtInCall"],TIMEZONE:["builtInCall"],TZ:["builtInCall"],NOW:["builtInCall"],UUID:["builtInCall"],STRUUID:["builtInCall"],MD5:["builtInCall"],SHA1:["builtInCall"],SHA256:["builtInCall"],SHA384:["builtInCall"],SHA512:["builtInCall"],COALESCE:["builtInCall"],IF:["builtInCall"],STRLANG:["builtInCall"],STRDT:["builtInCall"],SAMETERM:["builtInCall"],ISIRI:["builtInCall"],ISURI:["builtInCall"],ISBLANK:["builtInCall"],ISLITERAL:["builtInCall"],ISNUMERIC:["builtInCall"],SUBSTR:["builtInCall"],REPLACE:["builtInCall"],REGEX:["builtInCall"],EXISTS:["builtInCall"],NOT:["builtInCall"],IRI_REF:["iriRefOrFunction"],PNAME_LN:["iriRefOrFunction"],PNAME_NS:["iriRefOrFunction"],STRING_LITERAL1:["rdfLiteral"],STRING_LITERAL2:["rdfLiteral"],STRING_LITERAL_LONG1:["rdfLiteral"],STRING_LITERAL_LONG2:["rdfLiteral"],INTEGER:["numericLiteral"],DECIMAL:["numericLiteral"],DOUBLE:["numericLiteral"],INTEGER_POSITIVE:["numericLiteral"],DECIMAL_POSITIVE:["numericLiteral"],DOUBLE_POSITIVE:["numericLiteral"],INTEGER_NEGATIVE:["numericLiteral"],DECIMAL_NEGATIVE:["numericLiteral"],DOUBLE_NEGATIVE:["numericLiteral"],TRUE:["booleanLiteral"],FALSE:["booleanLiteral"],"<<":["embeddedTriple"],VAR1:["var"],VAR2:["var"],COUNT:["aggregate"],SUM:["aggregate"],MIN:["aggregate"],MAX:["aggregate"],AVG:["aggregate"],SAMPLE:["aggregate"],GROUP_CONCAT:["aggregate"]},prologue:{BASE:["*or([baseDecl,prefixDecl])"],PREFIX:["*or([baseDecl,prefixDecl])"],$:["*or([baseDecl,prefixDecl])"],CONSTRUCT:["*or([baseDecl,prefixDecl])"],DESCRIBE:["*or([baseDecl,prefixDecl])"],ASK:["*or([baseDecl,prefixDecl])"],INSERT:["*or([baseDecl,prefixDecl])"],DELETE:["*or([baseDecl,prefixDecl])"],SELECT:["*or([baseDecl,prefixDecl])"],LOAD:["*or([baseDecl,prefixDecl])"],CLEAR:["*or([baseDecl,prefixDecl])"],DROP:["*or([baseDecl,prefixDecl])"],ADD:["*or([baseDecl,prefixDecl])"],MOVE:["*or([baseDecl,prefixDecl])"],COPY:["*or([baseDecl,prefixDecl])"],CREATE:["*or([baseDecl,prefixDecl])"],WITH:["*or([baseDecl,prefixDecl])"]},propertyList:{VAR1:["propertyListNotEmpty"],VAR2:["propertyListNotEmpty"],"^":["propertyListNotEmpty"],a:["propertyListNotEmpty"],"!":["propertyListNotEmpty"],"(":["propertyListNotEmpty"],IRI_REF:["propertyListNotEmpty"],PNAME_LN:["propertyListNotEmpty"],PNAME_NS:["propertyListNotEmpty"],".":[],"}":[],GRAPH:[]},propertyListNotEmpty:{VAR1:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],VAR2:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],"^":["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],a:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],"!":["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],"(":["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],IRI_REF:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_LN:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_NS:["or([verbPath,verbSimple])","objectList","*[;,?[or([verbPath,verbSimple]),objectList]]"]},propertyListPath:{VAR1:["propertyListNotEmpty"],VAR2:["propertyListNotEmpty"],"^":["propertyListNotEmpty"],a:["propertyListNotEmpty"],"!":["propertyListNotEmpty"],"(":["propertyListNotEmpty"],IRI_REF:["propertyListNotEmpty"],PNAME_LN:["propertyListNotEmpty"],PNAME_NS:["propertyListNotEmpty"],".":[],"{":[],OPTIONAL:[],MINUS:[],GRAPH:[],SERVICE:[],FILTER:[],BIND:[],VALUES:[],"}":[]},propertyListPathNotEmpty:{VAR1:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],VAR2:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"^":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],a:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"!":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],"(":["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],IRI_REF:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_LN:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"],PNAME_NS:["or([verbPath,verbSimple])","objectListPath","*[;,?[or([verbPath,verbSimple]),objectList]]"]},quadData:{"{":["{","disallowVars","quads","allowVars","}"]},quadDataNoBnodes:{"{":["{","disallowBnodes","disallowVars","quads","allowVars","allowBnodes","}"]},quadPattern:{"{":["{","quads","}"]},quadPatternNoBnodes:{"{":["{","disallowBnodes","quads","allowBnodes","}"]},quads:{GRAPH:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],VAR1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],VAR2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],NIL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"(":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"[":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],IRI_REF:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],TRUE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],FALSE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],BLANK_NODE_LABEL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],ANON:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"<<":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],PNAME_LN:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],PNAME_NS:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL_LONG1:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],STRING_LITERAL_LONG2:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE_POSITIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],INTEGER_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DECIMAL_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],DOUBLE_NEGATIVE:["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"],"}":["?triplesTemplate","*[quadsNotTriples,?.,?triplesTemplate]"]},quadsNotTriples:{GRAPH:["GRAPH","varOrIRIref","{","?triplesTemplate","}"]},queryAll:{CONSTRUCT:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],DESCRIBE:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],ASK:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"],SELECT:["or([selectQuery,constructQuery,describeQuery,askQuery])","valuesClause"]},rdfLiteral:{STRING_LITERAL1:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL2:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL_LONG1:["string","?or([LANGTAG,[^^,iriRef]])"],STRING_LITERAL_LONG2:["string","?or([LANGTAG,[^^,iriRef]])"]},regexExpression:{REGEX:["REGEX","(","expression",",","expression","?[,,expression]",")"]},relationalExpression:{"!":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"+":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"-":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],VAR1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],VAR2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"(":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LANG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LANGMATCHES:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DATATYPE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],BOUND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IRI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],URI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],BNODE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],RAND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ABS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CEIL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],FLOOR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ROUND:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CONCAT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRLEN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],UCASE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],LCASE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ENCODE_FOR_URI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],CONTAINS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRSTARTS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRENDS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRBEFORE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRAFTER:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],YEAR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MONTH:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DAY:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],HOURS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MINUTES:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SECONDS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TIMEZONE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TZ:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOW:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],UUID:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRUUID:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MD5:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA256:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA384:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SHA512:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],COALESCE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IF:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRLANG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRDT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SAMETERM:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISIRI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISURI:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISBLANK:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISLITERAL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],ISNUMERIC:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],TRUE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],FALSE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],"<<":["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],COUNT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SUM:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MIN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],MAX:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],AVG:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SAMPLE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],GROUP_CONCAT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],SUBSTR:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],REPLACE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],REGEX:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],EXISTS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],NOT:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],IRI_REF:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL_LONG1:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],STRING_LITERAL_LONG2:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE_POSITIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],INTEGER_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DECIMAL_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],DOUBLE_NEGATIVE:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],PNAME_LN:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"],PNAME_NS:["numericExpression","?or([[=,numericExpression],[!=,numericExpression],[<,numericExpression],[>,numericExpression],[<=,numericExpression],[>=,numericExpression],[IN,expressionList],[NOT,IN,expressionList]])"]},selectClause:{SELECT:["SELECT","?or([DISTINCT,REDUCED])","or([+or([var,[(,expression,AS,var,)]]),*])"]},selectQuery:{SELECT:["selectClause","*datasetClause","whereClause","solutionModifier"]},serviceGraphPattern:{SERVICE:["SERVICE","?SILENT","varOrIRIref","groupGraphPattern"]},solutionModifier:{LIMIT:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],OFFSET:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],ORDER:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],HAVING:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],GROUP:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],VALUES:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],$:["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"],"}":["?groupClause","?havingClause","?orderClause","?limitOffsetClauses"]},sourceSelector:{IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"]},sparql11:{$:["prologue","or([queryAll,updateAll])","$"],CONSTRUCT:["prologue","or([queryAll,updateAll])","$"],DESCRIBE:["prologue","or([queryAll,updateAll])","$"],ASK:["prologue","or([queryAll,updateAll])","$"],INSERT:["prologue","or([queryAll,updateAll])","$"],DELETE:["prologue","or([queryAll,updateAll])","$"],SELECT:["prologue","or([queryAll,updateAll])","$"],LOAD:["prologue","or([queryAll,updateAll])","$"],CLEAR:["prologue","or([queryAll,updateAll])","$"],DROP:["prologue","or([queryAll,updateAll])","$"],ADD:["prologue","or([queryAll,updateAll])","$"],MOVE:["prologue","or([queryAll,updateAll])","$"],COPY:["prologue","or([queryAll,updateAll])","$"],CREATE:["prologue","or([queryAll,updateAll])","$"],WITH:["prologue","or([queryAll,updateAll])","$"],BASE:["prologue","or([queryAll,updateAll])","$"],PREFIX:["prologue","or([queryAll,updateAll])","$"]},storeProperty:{VAR1:[],VAR2:[],IRI_REF:[],PNAME_LN:[],PNAME_NS:[],a:[]},strReplaceExpression:{REPLACE:["REPLACE","(","expression",",","expression",",","expression","?[,,expression]",")"]},string:{STRING_LITERAL1:["STRING_LITERAL1"],STRING_LITERAL2:["STRING_LITERAL2"],STRING_LITERAL_LONG1:["STRING_LITERAL_LONG1"],STRING_LITERAL_LONG2:["STRING_LITERAL_LONG2"]},subSelect:{SELECT:["selectClause","whereClause","solutionModifier","valuesClause"]},substringExpression:{SUBSTR:["SUBSTR","(","expression",",","expression","?[,,expression]",")"]},triplesBlock:{VAR1:["triplesSameSubjectPath","?[.,?triplesBlock]"],VAR2:["triplesSameSubjectPath","?[.,?triplesBlock]"],NIL:["triplesSameSubjectPath","?[.,?triplesBlock]"],"(":["triplesSameSubjectPath","?[.,?triplesBlock]"],"[":["triplesSameSubjectPath","?[.,?triplesBlock]"],IRI_REF:["triplesSameSubjectPath","?[.,?triplesBlock]"],TRUE:["triplesSameSubjectPath","?[.,?triplesBlock]"],FALSE:["triplesSameSubjectPath","?[.,?triplesBlock]"],BLANK_NODE_LABEL:["triplesSameSubjectPath","?[.,?triplesBlock]"],ANON:["triplesSameSubjectPath","?[.,?triplesBlock]"],"<<":["triplesSameSubjectPath","?[.,?triplesBlock]"],PNAME_LN:["triplesSameSubjectPath","?[.,?triplesBlock]"],PNAME_NS:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL1:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL2:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL_LONG1:["triplesSameSubjectPath","?[.,?triplesBlock]"],STRING_LITERAL_LONG2:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE_POSITIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],INTEGER_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DECIMAL_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"],DOUBLE_NEGATIVE:["triplesSameSubjectPath","?[.,?triplesBlock]"]},triplesNode:{"(":["collection"],"[":["blankNodePropertyList"]},triplesNodePath:{"(":["collectionPath"],"[":["blankNodePropertyListPath"]},triplesSameSubject:{VAR1:["varOrTerm","propertyListNotEmpty"],VAR2:["varOrTerm","propertyListNotEmpty"],NIL:["varOrTerm","propertyListNotEmpty"],IRI_REF:["varOrTerm","propertyListNotEmpty"],TRUE:["varOrTerm","propertyListNotEmpty"],FALSE:["varOrTerm","propertyListNotEmpty"],BLANK_NODE_LABEL:["varOrTerm","propertyListNotEmpty"],ANON:["varOrTerm","propertyListNotEmpty"],"<<":["varOrTerm","propertyListNotEmpty"],PNAME_LN:["varOrTerm","propertyListNotEmpty"],PNAME_NS:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL1:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL2:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL_LONG1:["varOrTerm","propertyListNotEmpty"],STRING_LITERAL_LONG2:["varOrTerm","propertyListNotEmpty"],INTEGER:["varOrTerm","propertyListNotEmpty"],DECIMAL:["varOrTerm","propertyListNotEmpty"],DOUBLE:["varOrTerm","propertyListNotEmpty"],INTEGER_POSITIVE:["varOrTerm","propertyListNotEmpty"],DECIMAL_POSITIVE:["varOrTerm","propertyListNotEmpty"],DOUBLE_POSITIVE:["varOrTerm","propertyListNotEmpty"],INTEGER_NEGATIVE:["varOrTerm","propertyListNotEmpty"],DECIMAL_NEGATIVE:["varOrTerm","propertyListNotEmpty"],DOUBLE_NEGATIVE:["varOrTerm","propertyListNotEmpty"],"(":["triplesNode","propertyList"],"[":["triplesNode","propertyList"]},triplesSameSubjectPath:{VAR1:["varOrTerm","propertyListPathNotEmpty"],VAR2:["varOrTerm","propertyListPathNotEmpty"],NIL:["varOrTerm","propertyListPathNotEmpty"],IRI_REF:["varOrTerm","propertyListPathNotEmpty"],TRUE:["varOrTerm","propertyListPathNotEmpty"],FALSE:["varOrTerm","propertyListPathNotEmpty"],BLANK_NODE_LABEL:["varOrTerm","propertyListPathNotEmpty"],ANON:["varOrTerm","propertyListPathNotEmpty"],"<<":["varOrTerm","propertyListPathNotEmpty"],PNAME_LN:["varOrTerm","propertyListPathNotEmpty"],PNAME_NS:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL1:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL2:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL_LONG1:["varOrTerm","propertyListPathNotEmpty"],STRING_LITERAL_LONG2:["varOrTerm","propertyListPathNotEmpty"],INTEGER:["varOrTerm","propertyListPathNotEmpty"],DECIMAL:["varOrTerm","propertyListPathNotEmpty"],DOUBLE:["varOrTerm","propertyListPathNotEmpty"],INTEGER_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],DECIMAL_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],DOUBLE_POSITIVE:["varOrTerm","propertyListPathNotEmpty"],INTEGER_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],DECIMAL_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],DOUBLE_NEGATIVE:["varOrTerm","propertyListPathNotEmpty"],"(":["triplesNodePath","propertyListPath"],"[":["triplesNodePath","propertyListPath"]},triplesTemplate:{VAR1:["triplesSameSubject","?[.,?triplesTemplate]"],VAR2:["triplesSameSubject","?[.,?triplesTemplate]"],NIL:["triplesSameSubject","?[.,?triplesTemplate]"],"(":["triplesSameSubject","?[.,?triplesTemplate]"],"[":["triplesSameSubject","?[.,?triplesTemplate]"],IRI_REF:["triplesSameSubject","?[.,?triplesTemplate]"],TRUE:["triplesSameSubject","?[.,?triplesTemplate]"],FALSE:["triplesSameSubject","?[.,?triplesTemplate]"],BLANK_NODE_LABEL:["triplesSameSubject","?[.,?triplesTemplate]"],ANON:["triplesSameSubject","?[.,?triplesTemplate]"],"<<":["triplesSameSubject","?[.,?triplesTemplate]"],PNAME_LN:["triplesSameSubject","?[.,?triplesTemplate]"],PNAME_NS:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL1:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL2:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL_LONG1:["triplesSameSubject","?[.,?triplesTemplate]"],STRING_LITERAL_LONG2:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE_POSITIVE:["triplesSameSubject","?[.,?triplesTemplate]"],INTEGER_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DECIMAL_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"],DOUBLE_NEGATIVE:["triplesSameSubject","?[.,?triplesTemplate]"]},unaryExpression:{"!":["!","primaryExpression"],"+":["+","primaryExpression"],"-":["-","primaryExpression"],VAR1:["primaryExpression"],VAR2:["primaryExpression"],"(":["primaryExpression"],STR:["primaryExpression"],LANG:["primaryExpression"],LANGMATCHES:["primaryExpression"],DATATYPE:["primaryExpression"],BOUND:["primaryExpression"],IRI:["primaryExpression"],URI:["primaryExpression"],BNODE:["primaryExpression"],RAND:["primaryExpression"],ABS:["primaryExpression"],CEIL:["primaryExpression"],FLOOR:["primaryExpression"],ROUND:["primaryExpression"],CONCAT:["primaryExpression"],STRLEN:["primaryExpression"],UCASE:["primaryExpression"],LCASE:["primaryExpression"],ENCODE_FOR_URI:["primaryExpression"],CONTAINS:["primaryExpression"],STRSTARTS:["primaryExpression"],STRENDS:["primaryExpression"],STRBEFORE:["primaryExpression"],STRAFTER:["primaryExpression"],YEAR:["primaryExpression"],MONTH:["primaryExpression"],DAY:["primaryExpression"],HOURS:["primaryExpression"],MINUTES:["primaryExpression"],SECONDS:["primaryExpression"],TIMEZONE:["primaryExpression"],TZ:["primaryExpression"],NOW:["primaryExpression"],UUID:["primaryExpression"],STRUUID:["primaryExpression"],MD5:["primaryExpression"],SHA1:["primaryExpression"],SHA256:["primaryExpression"],SHA384:["primaryExpression"],SHA512:["primaryExpression"],COALESCE:["primaryExpression"],IF:["primaryExpression"],STRLANG:["primaryExpression"],STRDT:["primaryExpression"],SAMETERM:["primaryExpression"],ISIRI:["primaryExpression"],ISURI:["primaryExpression"],ISBLANK:["primaryExpression"],ISLITERAL:["primaryExpression"],ISNUMERIC:["primaryExpression"],TRUE:["primaryExpression"],FALSE:["primaryExpression"],"<<":["primaryExpression"],COUNT:["primaryExpression"],SUM:["primaryExpression"],MIN:["primaryExpression"],MAX:["primaryExpression"],AVG:["primaryExpression"],SAMPLE:["primaryExpression"],GROUP_CONCAT:["primaryExpression"],SUBSTR:["primaryExpression"],REPLACE:["primaryExpression"],REGEX:["primaryExpression"],EXISTS:["primaryExpression"],NOT:["primaryExpression"],IRI_REF:["primaryExpression"],STRING_LITERAL1:["primaryExpression"],STRING_LITERAL2:["primaryExpression"],STRING_LITERAL_LONG1:["primaryExpression"],STRING_LITERAL_LONG2:["primaryExpression"],INTEGER:["primaryExpression"],DECIMAL:["primaryExpression"],DOUBLE:["primaryExpression"],INTEGER_POSITIVE:["primaryExpression"],DECIMAL_POSITIVE:["primaryExpression"],DOUBLE_POSITIVE:["primaryExpression"],INTEGER_NEGATIVE:["primaryExpression"],DECIMAL_NEGATIVE:["primaryExpression"],DOUBLE_NEGATIVE:["primaryExpression"],PNAME_LN:["primaryExpression"],PNAME_NS:["primaryExpression"]},update:{INSERT:["prologue","?[update1,?[;,update]]"],DELETE:["prologue","?[update1,?[;,update]]"],LOAD:["prologue","?[update1,?[;,update]]"],CLEAR:["prologue","?[update1,?[;,update]]"],DROP:["prologue","?[update1,?[;,update]]"],ADD:["prologue","?[update1,?[;,update]]"],MOVE:["prologue","?[update1,?[;,update]]"],COPY:["prologue","?[update1,?[;,update]]"],CREATE:["prologue","?[update1,?[;,update]]"],WITH:["prologue","?[update1,?[;,update]]"],BASE:["prologue","?[update1,?[;,update]]"],PREFIX:["prologue","?[update1,?[;,update]]"],$:["prologue","?[update1,?[;,update]]"]},update1:{LOAD:["load"],CLEAR:["clear"],DROP:["drop"],ADD:["add"],MOVE:["move"],COPY:["copy"],CREATE:["create"],INSERT:["INSERT","insert1"],DELETE:["DELETE","delete1"],WITH:["modify"]},updateAll:{INSERT:["?[update1,?[;,update]]"],DELETE:["?[update1,?[;,update]]"],LOAD:["?[update1,?[;,update]]"],CLEAR:["?[update1,?[;,update]]"],DROP:["?[update1,?[;,update]]"],ADD:["?[update1,?[;,update]]"],MOVE:["?[update1,?[;,update]]"],COPY:["?[update1,?[;,update]]"],CREATE:["?[update1,?[;,update]]"],WITH:["?[update1,?[;,update]]"],$:["?[update1,?[;,update]]"]},usingClause:{USING:["USING","or([iriRef,[NAMED,iriRef]])"]},valueLogical:{"!":["relationalExpression"],"+":["relationalExpression"],"-":["relationalExpression"],VAR1:["relationalExpression"],VAR2:["relationalExpression"],"(":["relationalExpression"],STR:["relationalExpression"],LANG:["relationalExpression"],LANGMATCHES:["relationalExpression"],DATATYPE:["relationalExpression"],BOUND:["relationalExpression"],IRI:["relationalExpression"],URI:["relationalExpression"],BNODE:["relationalExpression"],RAND:["relationalExpression"],ABS:["relationalExpression"],CEIL:["relationalExpression"],FLOOR:["relationalExpression"],ROUND:["relationalExpression"],CONCAT:["relationalExpression"],STRLEN:["relationalExpression"],UCASE:["relationalExpression"],LCASE:["relationalExpression"],ENCODE_FOR_URI:["relationalExpression"],CONTAINS:["relationalExpression"],STRSTARTS:["relationalExpression"],STRENDS:["relationalExpression"],STRBEFORE:["relationalExpression"],STRAFTER:["relationalExpression"],YEAR:["relationalExpression"],MONTH:["relationalExpression"],DAY:["relationalExpression"],HOURS:["relationalExpression"],MINUTES:["relationalExpression"],SECONDS:["relationalExpression"],TIMEZONE:["relationalExpression"],TZ:["relationalExpression"],NOW:["relationalExpression"],UUID:["relationalExpression"],STRUUID:["relationalExpression"],MD5:["relationalExpression"],SHA1:["relationalExpression"],SHA256:["relationalExpression"],SHA384:["relationalExpression"],SHA512:["relationalExpression"],COALESCE:["relationalExpression"],IF:["relationalExpression"],STRLANG:["relationalExpression"],STRDT:["relationalExpression"],SAMETERM:["relationalExpression"],ISIRI:["relationalExpression"],ISURI:["relationalExpression"],ISBLANK:["relationalExpression"],ISLITERAL:["relationalExpression"],ISNUMERIC:["relationalExpression"],TRUE:["relationalExpression"],FALSE:["relationalExpression"],"<<":["relationalExpression"],COUNT:["relationalExpression"],SUM:["relationalExpression"],MIN:["relationalExpression"],MAX:["relationalExpression"],AVG:["relationalExpression"],SAMPLE:["relationalExpression"],GROUP_CONCAT:["relationalExpression"],SUBSTR:["relationalExpression"],REPLACE:["relationalExpression"],REGEX:["relationalExpression"],EXISTS:["relationalExpression"],NOT:["relationalExpression"],IRI_REF:["relationalExpression"],STRING_LITERAL1:["relationalExpression"],STRING_LITERAL2:["relationalExpression"],STRING_LITERAL_LONG1:["relationalExpression"],STRING_LITERAL_LONG2:["relationalExpression"],INTEGER:["relationalExpression"],DECIMAL:["relationalExpression"],DOUBLE:["relationalExpression"],INTEGER_POSITIVE:["relationalExpression"],DECIMAL_POSITIVE:["relationalExpression"],DOUBLE_POSITIVE:["relationalExpression"],INTEGER_NEGATIVE:["relationalExpression"],DECIMAL_NEGATIVE:["relationalExpression"],DOUBLE_NEGATIVE:["relationalExpression"],PNAME_LN:["relationalExpression"],PNAME_NS:["relationalExpression"]},valuesClause:{VALUES:["VALUES","dataBlock"],$:[],"}":[]},var:{VAR1:["VAR1"],VAR2:["VAR2"]},varOrIRIref:{VAR1:["var"],VAR2:["var"],IRI_REF:["iriRef"],PNAME_LN:["iriRef"],PNAME_NS:["iriRef"]},varOrTerm:{VAR1:["var"],VAR2:["var"],NIL:["graphTerm"],IRI_REF:["graphTerm"],TRUE:["graphTerm"],FALSE:["graphTerm"],BLANK_NODE_LABEL:["graphTerm"],ANON:["graphTerm"],"<<":["graphTerm"],PNAME_LN:["graphTerm"],PNAME_NS:["graphTerm"],STRING_LITERAL1:["graphTerm"],STRING_LITERAL2:["graphTerm"],STRING_LITERAL_LONG1:["graphTerm"],STRING_LITERAL_LONG2:["graphTerm"],INTEGER:["graphTerm"],DECIMAL:["graphTerm"],DOUBLE:["graphTerm"],INTEGER_POSITIVE:["graphTerm"],DECIMAL_POSITIVE:["graphTerm"],DOUBLE_POSITIVE:["graphTerm"],INTEGER_NEGATIVE:["graphTerm"],DECIMAL_NEGATIVE:["graphTerm"],DOUBLE_NEGATIVE:["graphTerm"]},verb:{VAR1:["storeProperty","varOrIRIref"],VAR2:["storeProperty","varOrIRIref"],IRI_REF:["storeProperty","varOrIRIref"],PNAME_LN:["storeProperty","varOrIRIref"],PNAME_NS:["storeProperty","varOrIRIref"],a:["storeProperty","a"]},verbPath:{"^":["path"],a:["path"],"!":["path"],"(":["path"],IRI_REF:["path"],PNAME_LN:["path"],PNAME_NS:["path"]},verbSimple:{VAR1:["var"],VAR2:["var"]},whereClause:{"{":["?WHERE","groupGraphPattern"],WHERE:["?WHERE","groupGraphPattern"]}},keywords:/^(GROUP_CONCAT|DATATYPE|BASE|PREFIX|SELECT|CONSTRUCT|DESCRIBE|ASK|FROM|NAMED|ORDER|BY|LIMIT|ASC|DESC|OFFSET|DISTINCT|REDUCED|WHERE|GRAPH|OPTIONAL|UNION|FILTER|GROUP|HAVING|AS|VALUES|LOAD|CLEAR|DROP|CREATE|MOVE|COPY|SILENT|INSERT|DELETE|DATA|WITH|TO|USING|NAMED|MINUS|BIND|LANGMATCHES|LANG|BOUND|SAMETERM|ISIRI|ISURI|ISBLANK|ISLITERAL|REGEX|TRUE|FALSE|UNDEF|ADD|DEFAULT|ALL|SERVICE|INTO|IN|NOT|IRI|URI|BNODE|RAND|ABS|CEIL|FLOOR|ROUND|CONCAT|STRLEN|UCASE|LCASE|ENCODE_FOR_URI|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|NOW|UUID|STRUUID|MD5|SHA1|SHA256|SHA384|SHA512|COALESCE|IF|STRLANG|STRDT|ISNUMERIC|SUBSTR|REPLACE|EXISTS|COUNT|SUM|MIN|MAX|AVG|SAMPLE|SEPARATOR|STR|<<|>>)/i,punct:/^(\*|a|\.|\{|\}|,|\(|\)|;|\[|\]|\|\||&&|=|!=|!|<=|>=|<|>|\+|-|\/|\^\^|\?|\||\^)/,startSymbol:"sparql11",acceptEmpty:!0}},{}],3:[function(e,t,n){"use strict";var r=e("codemirror");r.defineMode("sparql11",(function(t,n){t.indentUnit;var r=e("./_tokenizer-table.js"),i=r.table,o="[0-9A-Fa-f]",s="(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD])(((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]))|\\.)*(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])))?)?:",a="[eE][\\+-]?[0-9]+",l="(([0-9]+\\.[0-9]*)|(\\.[0-9]+))",u="(([0-9]+\\.[0-9]*"+a+")|(\\.[0-9]+"+a+")|([0-9]+"+a+"))",c="\\\\[tbnrf\\\\\"']",p=o+"{4}",d="(\\\\u"+p+"|\\\\U00(10|0"+o+")"+p+")",f={SINGLE:{CAT:"STRING_LITERAL_LONG1",QUOTES:"'''",CONTENTS:"(('|'')?([^'\\\\]|"+c+"|"+d+"))*"},DOUBLE:{CAT:"STRING_LITERAL_LONG2",QUOTES:'"""',CONTENTS:'(("|"")?([^"\\\\]|'+c+"|"+d+"))*"}};for(var h in f)f[h].COMPLETE=f[h].QUOTES+f[h].CONTENTS+f[h].QUOTES;var g={};for(var h in f)g[h]={complete:{name:"STRING_LITERAL_LONG_"+h,regex:new RegExp("^"+f[h].COMPLETE),style:"string"},contents:{name:"STRING_LITERAL_LONG_"+h,regex:new RegExp("^"+f[h].CONTENTS),style:"string"},closing:{name:"STRING_LITERAL_LONG_"+h,regex:new RegExp("^"+f[h].CONTENTS+f[h].QUOTES),style:"string"},quotes:{name:"STRING_LITERAL_LONG_QUOTES_"+h,regex:new RegExp("^"+f[h].QUOTES),style:"string"}};var m="[\\x20\\x09\\x0D\\x0A]",v="#([^\\n\\r]*[\\n\\r]|[^\\n\\r]*$)",E=[{name:"WS",regex:new RegExp("^"+m+"+"),style:"ws"},{name:"COMMENT",regex:new RegExp("^"+v),style:"comment"},{name:"IRI_REF",regex:new RegExp("^<[^<>\"'|{}^\\\0- ]*>"),style:"variable-3"},{name:"VAR1",regex:new RegExp("^\\?([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9])([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])*"),style:"atom"},{name:"VAR2",regex:new RegExp("^\\$([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9])([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])*"),style:"atom"},{name:"LANGTAG",regex:new RegExp("^@[a-zA-Z]+(-[a-zA-Z0-9]+)*"),style:"meta"},{name:"DOUBLE",regex:new RegExp("^"+u),style:"number"},{name:"DECIMAL",regex:new RegExp("^"+l),style:"number"},{name:"INTEGER",regex:new RegExp("^[0-9]+"),style:"number"},{name:"DOUBLE_POSITIVE",regex:new RegExp("^\\+(([0-9]+\\.[0-9]*[eE][\\+-]?[0-9]+)|(\\.[0-9]+[eE][\\+-]?[0-9]+)|([0-9]+[eE][\\+-]?[0-9]+))"),style:"number"},{name:"DECIMAL_POSITIVE",regex:new RegExp("^\\+(([0-9]+\\.[0-9]*)|(\\.[0-9]+))"),style:"number"},{name:"INTEGER_POSITIVE",regex:new RegExp("^\\+[0-9]+"),style:"number"},{name:"DOUBLE_NEGATIVE",regex:new RegExp("^-(([0-9]+\\.[0-9]*[eE][\\+-]?[0-9]+)|(\\.[0-9]+[eE][\\+-]?[0-9]+)|([0-9]+[eE][\\+-]?[0-9]+))"),style:"number"},{name:"DECIMAL_NEGATIVE",regex:new RegExp("^-(([0-9]+\\.[0-9]*)|(\\.[0-9]+))"),style:"number"},{name:"INTEGER_NEGATIVE",regex:new RegExp("^-[0-9]+"),style:"number"},{name:"STRING_LITERAL1",regex:new RegExp("^'(([^\\x27\\x5C\\x0A\\x0D])|\\\\[tbnrf\\\\\"']|(\\\\u[0-9A-Fa-f]{4}|\\\\U00(10|0[0-9A-Fa-f])[0-9A-Fa-f]{4}))*'"),style:"string"},{name:"STRING_LITERAL2",regex:new RegExp('^"(([^\\x22\\x5C\\x0A\\x0D])|\\\\[tbnrf\\\\"\']|(\\\\u[0-9A-Fa-f]{4}|\\\\U00(10|0[0-9A-Fa-f])[0-9A-Fa-f]{4}))*"'),style:"string"},{name:"NIL",regex:new RegExp("^\\(([\\x20\\x09\\x0D\\x0A]|(#([^\\n\\r]*[\\n\\r]|[^\\n\\r]*$)))*\\)"),style:"punc"},{name:"ANON",regex:new RegExp("^\\[([\\x20\\x09\\x0D\\x0A]|(#([^\\n\\r]*[\\n\\r]|[^\\n\\r]*$)))*\\]"),style:"punc"},{name:"PNAME_LN",regex:new RegExp("^(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD])(((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]))|\\.)*(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])))?)?:([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|:|[0-9]|((%[0-9A-Fa-f][0-9A-Fa-f])|(\\\\[_~\\.\\-!\\$&'\\(\\)\\*\\+,;=/\\?#@%])))((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])|\\.|:|((%[0-9A-Fa-f][0-9A-Fa-f])|(\\\\[_~\\.\\-!\\$&'\\(\\)\\*\\+,;=/\\?#@%])))*(([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])|:|((%[0-9A-Fa-f][0-9A-Fa-f])|(\\\\[_~\\.\\-!\\$&'\\(\\)\\*\\+,;=/\\?#@%]))))?"),style:"string-2"},{name:"PNAME_NS",regex:new RegExp("^"+s),style:"string-2"},{name:"BLANK_NODE_LABEL",regex:new RegExp("^_:([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|[0-9])((([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040])|\\.)*([A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]|_|-|[0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]))?"),style:"string-2"}];function x(e){var t=[],n=i[e];if(null!=n)for(var r in n)t.push(r.toString());else t.push(e);return t}function y(e,t){function n(){var n=e.column();t.errorStartPos=n,t.errorEndPos=n+a.text.length}function o(e){"disallowVars"==e?t.allowVars=!1:"allowVars"==e?t.allowVars=!0:"disallowBnodes"==e?t.allowBnodes=!1:"allowBnodes"==e?t.allowBnodes=!0:"storeProperty"==e&&(t.storeProperty=!0)}function s(e){return(t.allowVars||"var"!=e)&&(t.allowBnodes||"blankNode"!=e&&"blankNodePropertyList"!=e&&"blankNodePropertyListPath"!=e)}0==e.pos&&(t.possibleCurrent=t.possibleNext);var a=function(){var n=null;if(t.inLiteral){var i=!1;if((n=e.match(g[t.inLiteral].contents.regex,!0,!1))&&0==n[0].length&&(n=e.match(g[t.inLiteral].closing.regex,!0,!1),i=!0),n&&n[0].length>0){var o={quotePos:i?"end":"content",cat:f[t.inLiteral].CAT,style:g[t.inLiteral].complete.style,text:n[0],start:e.start};return i&&(t.inLiteral=!1),o}}for(var s in g){var a;if(n=e.match(g[s].quotes.regex,!0,!1))return t.inLiteral?(t.inLiteral=!1,a="end"):(t.inLiteral=s,a="start"),{cat:f[s].CAT,style:g[s].quotes.style,text:n[0],quotePos:a,start:e.start}}for(var l=0;l<E.length;++l)if(n=e.match(E[l].regex,!0,!1))return{cat:E[l].name,style:E[l].style,text:n[0],start:e.start};return(n=e.match(r.keywords,!0,!1))?{cat:e.current().toUpperCase(),style:"keyword",text:n[0],start:e.start}:(n=e.match(r.punct,!0,!1))?{cat:e.current(),style:"punc",text:n[0],start:e.start}:{cat:"<invalid_token>",style:"error",text:(n=e.match(/^.[A-Za-z0-9]*/,!0,!1))[0],start:e.start}}();if("<invalid_token>"==a.cat)return 1==t.OK&&(t.OK=!1,n()),t.complete=!1,a.style;if("WS"==a.cat||"COMMENT"==a.cat||a.quotePos&&"end"!=a.quotePos)return t.possibleCurrent=t.possibleNext,a.style;var l,u,c=!1,p=a.cat;if(!a.quotePos||"end"==a.quotePos)for(;t.stack.length>0&&p&&t.OK&&!c;)if(l=t.stack.pop(),i[l]){var d=i[l][p];if(null!=d&&s(l)){for(var h=d.length-1;h>=0;--h)t.stack.push(d[h]);o(l)}else t.OK=!1,t.complete=!1,n(),t.stack.push(l)}else if(l==p){c=!0,u=l,null==t.queryType&&("SELECT"!=u&&"CONSTRUCT"!=u&&"ASK"!=u&&"DESCRIBE"!=u&&"INSERT"!=u&&"DELETE"!=u&&"LOAD"!=u&&"CLEAR"!=u&&"CREATE"!=u&&"DROP"!=u&&"COPY"!=u&&"MOVE"!=u&&"ADD"!=u||(t.queryType=u));for(var m=!0,v=t.stack.length;v>0;--v){var y=i[t.stack[v-1]];y&&y.$||(m=!1)}t.complete=m,t.storeProperty&&"punc"!=p.cat&&(t.lastProperty=a.text,t.storeProperty=!1)}else t.OK=!1,t.complete=!1,n();return!c&&t.OK&&(t.OK=!1,t.complete=!1,n()),t.possibleCurrent.indexOf("a")>=0&&(t.lastPredicateOffset=a.start),t.possibleCurrent=t.possibleNext,t.possibleNext=x(t.stack[t.stack.length-1]),a.style}var T={"*[,, object]":3,"*[(,),object]":3,"*[(,),objectPath]":3,"*[/,pathEltOrInverse]":2,object:2,objectPath:2,objectList:2,objectListPath:2,storeProperty:2,pathMod:2,"?pathMod":2,propertyListNotEmpty:1,propertyList:1,propertyListPath:1,propertyListPathNotEmpty:1,"?[verb,objectList]":1},N={"}":1,"]":0,")":1,"{":-1,"(":-1};return{token:y,startState:function(e){return{tokenize:y,OK:!0,complete:r.acceptEmpty,errorStartPos:null,errorEndPos:null,queryType:null,possibleCurrent:x(r.startSymbol),possibleNext:x(r.startSymbol),allowVars:!0,allowBnodes:!0,storeProperty:!1,lastProperty:"",inLiteral:!1,stack:[r.startSymbol],lastPredicateOffset:t.indentUnit}},indent:function(e,n){if(e.inLiteral)return 0;if(e.stack.length&&"?[or([verbPath,verbSimple]),objectList]"==e.stack[e.stack.length-1])return e.lastPredicateOffset;var r=0,i=e.stack.length-1;if(/^[\}\]\)]/.test(n)){for(var o=n.substr(0,1);i>=0;--i)if(e.stack[i]==o){--i;break}}else(s=T[e.stack[i]])&&(r+=s,--i);for(;i>=0;--i){var s;(s=N[e.stack[i]])&&(r+=s)}return r*t.indentUnit},electricChars:"}])"}})),r.defineMIME("application/x-sparql-query","sparql11")},{"./_tokenizer-table.js":2,codemirror:15}],4:[function(e,t,n){var r=t.exports=function(){this.words=0,this.prefixes=0,this.children=[]};r.prototype={insert:function(e,t){if(0!=e.length){var n,i=this;void 0===t&&(t=0),t!==e.length?(i.prefixes++,n=e[t],void 0===i.children[n]&&(i.children[n]=new r),i.children[n].insert(e,t+1)):i.words++}},remove:function(e,t){if(0!=e.length){var n,r=this;void 0===t&&(t=0),void 0!==r&&(t!==e.length?(r.prefixes--,n=e[t],r.children[n].remove(e,t+1)):r.words--)}},update:function(e,t){0!=e.length&&0!=t.length&&(this.remove(e),this.insert(t))},countWord:function(e,t){if(0==e.length)return 0;var n,r,i=0;return void 0===t&&(t=0),t===e.length?this.words:(n=e[t],void 0!==(r=this.children[n])&&(i=r.countWord(e,t+1)),i)},countPrefix:function(e,t){if(0==e.length)return 0;var n,r=0;if(void 0===t&&(t=0),t===e.length)return this.prefixes;var i=e[t];return void 0!==(n=this.children[i])&&(r=n.countPrefix(e,t+1)),r},find:function(e){return 0!=e.length&&this.countWord(e)>0},getAllWords:function(e){var t,n,r=this,i=[];if(void 0===e&&(e=""),void 0===r)return[];for(t in r.words>0&&i.push(e),r.children)n=r.children[t],i=i.concat(n.getAllWords(e+t));return i},autoComplete:function(e,t){var n,r;return 0==e.length?void 0===t?this.getAllWords(e):[]:(void 0===t&&(t=0),n=e[t],void 0===(r=this.children[n])?[]:t===e.length-1?r.getAllWords(e):r.autoComplete(e,t+1))}}},{}],5:[function(e,t,n){var r;r=function(e){"use strict";e.defineOption("fullScreen",!1,(function(t,n,r){r==e.Init&&(r=!1),!r!=!n&&(n?function(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}(t):function(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}(t))}))},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":15}],6:[function(e,t,n){var r;r=function(e){var t={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(o),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(o))}));for(var i=t.pairs+"`",o={Backspace:function(t){var i=l(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var o=r(i,"pairs"),s=t.listSelections(),a=0;a<s.length;a++){if(!s[a].empty())return e.Pass;var u=c(t,s[a].head);if(!u||o.indexOf(u)%2!=0)return e.Pass}for(a=s.length-1;a>=0;a--){var p=s[a].head;t.replaceRange("",n(p.line,p.ch-1),n(p.line,p.ch+1),"+delete")}},Enter:function(t){var n=l(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),s=0;s<o.length;s++){if(!o[s].empty())return e.Pass;var a=c(t,o[s].head);if(!a||i.indexOf(a)%2!=0)return e.Pass}t.operation((function(){t.replaceSelection("\n\n",null),t.execCommand("goCharLeft"),o=t.listSelections();for(var e=0;e<o.length;e++){var n=o[e].head.line;t.indentLine(n,null,!0),t.indentLine(n+1,null,!0)}}))}},s=0;s<i.length;s++)o["'"+i.charAt(s)+"'"]=a(i.charAt(s));function a(t){return function(i){return function(t,i){var o=l(t);if(!o||t.getOption("disableInput"))return e.Pass;var s=r(o,"pairs"),a=s.indexOf(i);if(-1==a)return e.Pass;for(var c,d=r(o,"triples"),f=s.charAt(a+1)==i,h=t.listSelections(),g=a%2==0,m=0;m<h.length;m++){var v,E=h[m],x=E.head,y=t.getRange(x,n(x.line,x.ch+1));if(g&&!E.empty())v="surround";else if(!f&&g||y!=i)if(f&&x.ch>1&&d.indexOf(i)>=0&&t.getRange(n(x.line,x.ch-2),x)==i+i&&(x.ch<=2||t.getRange(n(x.line,x.ch-3),n(x.line,x.ch-2))!=i))v="addFour";else if(f){if(e.isWordChar(y)||!p(t,x,i))return e.Pass;v="both"}else{if(!g||t.getLine(x.line).length!=x.ch&&!u(y,s)&&!/\s/.test(y))return e.Pass;v="both"}else v=d.indexOf(i)>=0&&t.getRange(x,n(x.line,x.ch+3))==i+i+i?"skipThree":"skip";if(c){if(c!=v)return e.Pass}else c=v}var T=a%2?s.charAt(a-1):i,N=a%2?i:s.charAt(a+1);t.operation((function(){if("skip"==c)t.execCommand("goCharRight");else if("skipThree"==c)for(var r=0;r<3;r++)t.execCommand("goCharRight");else if("surround"==c){var i=t.getSelections();for(r=0;r<i.length;r++)i[r]=T+i[r]+N;for(t.replaceSelections(i,"around"),i=t.listSelections().slice(),r=0;r<i.length;r++)i[r]=(o=i[r],s=void 0,s=e.cmpPos(o.anchor,o.head)>0,{anchor:new n(o.anchor.line,o.anchor.ch+(s?-1:1)),head:new n(o.head.line,o.head.ch+(s?1:-1))});t.setSelections(i)}else"both"==c?(t.replaceSelection(T+N,null),t.triggerElectric(T+N),t.execCommand("goCharLeft")):"addFour"==c&&(t.replaceSelection(T+T+T+T,"before"),t.execCommand("goCharRight"));var o,s}))}(i,t)}}function l(e){var t=e.state.closeBrackets;return t?e.getModeAt(e.getCursor()).closeBrackets||t:null}function u(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function c(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function p(t,n,r){var i=t.getLine(n.line),o=t.getTokenAt(n);if(/\bstring2?\b/.test(o.type))return!1;var s=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(s.pos=s.start=o.start;;){var a=t.getMode().token(s,o.state);if(s.pos>=n.ch+1)return/\bstring2?\b/.test(a);s.start=s.pos}}},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":15}],7:[function(e,t,n){var r;r=function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"};function i(e,t,i,s){var a=e.getLineHandle(t.line),l=t.ch-1,u=l>=0&&r[a.text.charAt(l)]||r[a.text.charAt(++l)];if(!u)return null;var c=">"==u.charAt(1)?1:-1;if(i&&c>0!=(l==t.ch))return null;var p=e.getTokenTypeAt(n(t.line,l+1)),d=o(e,n(t.line,l+(c>0?1:0)),c,p||null,s);return null==d?null:{from:n(t.line,l),to:d&&d.pos,match:d&&d.ch==u.charAt(0),forward:c>0}}function o(e,t,i,o,s){for(var a=s&&s.maxScanLineLength||1e4,l=s&&s.maxScanLines||1e3,u=[],c=s&&s.bracketRegex?s.bracketRegex:/[(){}[\]]/,p=i>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),d=t.line;d!=p;d+=i){var f=e.getLine(d);if(f){var h=i>0?0:f.length-1,g=i>0?f.length:-1;if(!(f.length>a))for(d==t.line&&(h=t.ch-(i<0?1:0));h!=g;h+=i){var m=f.charAt(h);if(c.test(m)&&(void 0===o||e.getTokenTypeAt(n(d,h+1))==o))if(">"==r[m].charAt(1)==i>0)u.push(m);else{if(!u.length)return{pos:n(d,h),ch:m};u.pop()}}}}return d-i!=(i>0?e.lastLine():e.firstLine())&&null}function s(e,r,o){for(var s=e.state.matchBrackets.maxHighlightLineLength||1e3,a=[],l=e.listSelections(),u=0;u<l.length;u++){var c=l[u].empty()&&i(e,l[u].head,!1,o);if(c&&e.getLine(c.from.line).length<=s){var p=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";a.push(e.markText(c.from,n(c.from.line,c.from.ch+1),{className:p})),c.to&&e.getLine(c.to.line).length<=s&&a.push(e.markText(c.to,n(c.to.line,c.to.ch+1),{className:p}))}}if(a.length){t&&e.state.focused&&e.focus();var d=function(){e.operation((function(){for(var e=0;e<a.length;e++)a[e].clear()}))};if(!r)return d;setTimeout(d,800)}}var a=null;function l(e){e.operation((function(){a&&(a(),a=null),a=s(e,!1,e.state.matchBrackets)}))}e.defineOption("matchBrackets",!1,(function(t,n,r){r&&r!=e.Init&&t.off("cursorActivity",l),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",l))})),e.defineExtension("matchBrackets",(function(){s(this,!0)})),e.defineExtension("findMatchingBracket",(function(e,t,n){return i(this,e,t,n)})),e.defineExtension("scanForBracket",(function(e,t,n,r){return o(this,e,t,n,r)}))},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":15}],8:[function(e,t,n){var r;r=function(e){"use strict";e.registerHelper("fold","brace",(function(t,n){var r,i=n.line,o=t.getLine(i);function s(s){for(var a=n.ch,l=0;;){var u=a<=0?-1:o.lastIndexOf(s,a-1);if(-1!=u){if(1==l&&u<n.ch)break;if(r=t.getTokenTypeAt(e.Pos(i,u+1)),!/^(comment|string)/.test(r))return u+1;a=u-1}else{if(1==l)break;l=1,a=o.length}}}var a="{",l="}",u=s("{");if(null==u&&(a="[",l="]",u=s("[")),null!=u){var c,p,d=1,f=t.lastLine();e:for(var h=i;h<=f;++h)for(var g=t.getLine(h),m=h==i?u:0;;){var v=g.indexOf(a,m),E=g.indexOf(l,m);if(v<0&&(v=g.length),E<0&&(E=g.length),(m=Math.min(v,E))==g.length)break;if(t.getTokenTypeAt(e.Pos(h,m+1))==r)if(m==v)++d;else if(!--d){c=h,p=m;break e}++m}if(null!=c&&(i!=c||p!=u))return{from:e.Pos(i,u),to:e.Pos(c,p)}}})),e.registerHelper("fold","import",(function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var s=t.getLine(i).indexOf(";");if(-1!=s)return{startCh:r.end,end:e.Pos(i,s)}}}var i,o=n.line,s=r(o);if(!s||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var a=s.end;;){var l=r(a.line+1);if(null==l)break;a=l.end}return{from:t.clipPos(e.Pos(o,s.startCh+1)),to:a}})),e.registerHelper("fold","include",(function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var s=i;null!=r(s+1);)++s;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(s))}}))},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":15}],9:[function(e,t,n){var r;r=function(e){"use strict";function t(t,n,i,o){if(i&&i.call){var s=i;i=null}else s=r(t,i,"rangeFinder");"number"==typeof n&&(n=e.Pos(n,0));var a=r(t,i,"minFoldSize");function l(e){var r=s(t,n);if(!r||r.to.line-r.from.line<a)return null;for(var i=t.findMarksAt(r.from),l=0;l<i.length;++l)if(i[l].__isFold&&"fold"!==o){if(!e)return null;r.cleared=!0,i[l].clear()}return r}var u=l(!0);if(r(t,i,"scanUp"))for(;!u&&n.line>t.firstLine();)n=e.Pos(n.line-1,0),u=l(!1);if(u&&!u.cleared&&"unfold"!==o){var c=function(e,t){var n=r(e,t,"widget");if("string"==typeof n){var i=document.createTextNode(n);(n=document.createElement("span")).appendChild(i),n.className="CodeMirror-foldmarker"}return n}(t,i);e.on(c,"mousedown",(function(t){p.clear(),e.e_preventDefault(t)}));var p=t.markText(u.from,u.to,{replacedWith:c,clearOnEnter:r(t,i,"clearOnEnter"),__isFold:!0});p.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,u.from,u.to)}}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0})),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},e.commands.foldAll=function(t){t.operation((function(){for(var n=t.firstLine(),r=t.lastLine();n<=r;n++)t.foldCode(e.Pos(n,0),null,"fold")}))},e.commands.unfoldAll=function(t){t.operation((function(){for(var n=t.firstLine(),r=t.lastLine();n<=r;n++)t.foldCode(e.Pos(n,0),null,"unfold")}))},e.registerHelper("fold","combine",(function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var r=0;r<e.length;++r){var i=e[r](t,n);if(i)return i}}})),e.registerHelper("fold","auto",(function(e,t){for(var n=e.getHelpers(t,"fold"),r=0;r<n.length;r++){var i=n[r](e,t);if(i)return i}}));var n={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function r(e,t,r){if(t&&void 0!==t[r])return t[r];var i=e.options.foldOptions;return i&&void 0!==i[r]?i[r]:n[r]}e.defineOption("foldOptions",null),e.defineExtension("foldOption",(function(e,t){return r(this,e,t)}))},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":15}],10:[function(e,t,n){var r;r=function(e){"use strict";e.defineOption("foldGutter",!1,(function(t,r,i){var o;i&&i!=e.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",a),t.off("change",l),t.off("viewportChange",u),t.off("fold",c),t.off("unfold",c),t.off("swapDoc",l)),r&&(t.state.foldGutter=new n((!0===(o=r)&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o)),s(t),t.on("gutterClick",a),t.on("change",l),t.on("viewportChange",u),t.on("fold",c),t.on("unfold",c),t.on("swapDoc",l))}));var t=e.Pos;function n(e){this.options=e,this.from=this.to=0}function r(e,n){for(var r=e.findMarks(t(n,0),t(n+1,0)),i=0;i<r.length;++i)if(r[i].__isFold&&r[i].find().from.line==n)return r[i]}function i(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function o(e,n,o){var s=e.state.foldGutter.options,a=n,l=e.foldOption(s,"minFoldSize"),u=e.foldOption(s,"rangeFinder");e.eachLine(n,o,(function(n){var o=null;if(r(e,a))o=i(s.indicatorFolded);else{var c=t(a,0),p=u&&u(e,c);p&&p.to.line-p.from.line>=l&&(o=i(s.indicatorOpen))}e.setGutterMarker(n,s.gutter,o),++a}))}function s(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){o(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function a(e,n,i){var o=e.state.foldGutter;if(o){var s=o.options;if(i==s.gutter){var a=r(e,n);a?a.clear():e.foldCode(t(n,0),s.rangeFinder)}}}function l(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){s(e)}),n.foldOnChangeTimeSpan||600)}}function u(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?s(e):e.operation((function(){n.from<t.from&&(o(e,n.from,t.from),t.from=n.from),n.to>t.to&&(o(e,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function c(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r<n.to&&o(e,r,r+1)}}},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror"),e("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],r):r(CodeMirror)},{"../../lib/codemirror":15,"./foldcode":9}],11:[function(e,t,n){var r;r=function(e){"use strict";var t=e.Pos,n="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",r=new RegExp("<(/?)(["+n+"][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-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function i(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 o(e,n){var r=e.cm.getTokenTypeAt(t(e.line,n));return r&&/\btag\b/.test(r)}function s(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function a(e){if(!(e.line<=e.min))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(-1==t){if(s(e))continue;return}if(o(e,t+1)){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"}e.ch=t+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(o(e,t+1)){r.lastIndex=t,e.ch=t;var n=r.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function c(e){for(;;){r.lastIndex=e.ch;var t=r.exec(e.text);if(!t){if(s(e))continue;return}if(o(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function p(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(o(e,t+1)){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"}e.ch=t}}function d(e,n){for(var r=[];;){var i,o=c(e),s=e.line,a=e.ch-(o?o[0].length:0);if(!o||!(i=l(e)))return;if("selfClose"!=i)if(o[1]){for(var u=r.length-1;u>=0;--u)if(r[u]==o[2]){r.length=u;break}if(u<0&&(!n||n==o[2]))return{tag:o[2],from:t(s,a),to:t(e.line,e.ch)}}else r.push(o[2])}}function f(e,n){for(var r=[];;){var i=p(e);if(!i)return;if("selfClose"!=i){var o=e.line,s=e.ch,a=u(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var l=r.length-1;l>=0;--l)if(r[l]==a[2]){r.length=l;break}if(l<0&&(!n||n==a[2]))return{tag:a[2],from:t(e.line,e.ch),to:t(o,s)}}}else u(e)}}e.registerHelper("fold","xml",(function(e,n){for(var r=new i(e,n.line,0);;){var o,s=c(r);if(!s||r.line!=n.line||!(o=l(r)))return;if(!s[1]&&"selfClose"!=o){var a=t(r.line,r.ch),u=d(r,s[2]);return u&&{from:a,to:u.from}}}})),e.findMatchingTag=function(e,n,r){var o=new i(e,n.line,n.ch,r);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var s=l(o),a=s&&t(o.line,o.ch),c=s&&u(o);if(s&&c&&(h=n,!(((p=o).line-h.line||p.ch-h.ch)>0))){var p,h,g={from:t(o.line,o.ch),to:a,tag:c[2]};return"selfClose"==s?{open:g,close:null,at:"open"}:c[1]?{open:f(o,c[2]),close:g,at:"close"}:{open:g,close:d(o=new i(e,a.line,a.ch,r),c[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,n){for(var r=new i(e,t.line,t.ch,n);;){var o=f(r);if(!o)break;var s=d(new i(e,t.line,t.ch,n),o.tag);if(s)return{open:o,close:s}}},e.scanForClosingTag=function(e,t,n,r){return d(new i(e,t.line,t.ch,r?{from:0,to:r}:null),n)}},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":15}],12:[function(e,t,n){var r;r=function(e){"use strict";function t(e,t){this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}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(n){n=function(e,t,n){var r=e.options.hintOptions,i={};for(var o in l)i[o]=l[o];if(r)for(var o in r)void 0!==r[o]&&(i[o]=r[o]);if(n)for(var o in n)void 0!==n[o]&&(i[o]=n[o]);return i.hint.resolve&&(i.hint=i.hint.resolve(e,t)),i}(this,this.getCursor("start"),n);var r=this.listSelections();if(!(r.length>1)){if(this.somethingSelected()){if(!n.hint.supportsSelection)return;for(var i=0;i<r.length;i++)if(r[i].head.line!=r[i].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var o=this.state.completionActive=new t(this,n);o.options.hint&&(e.signal(this,"startCompletion",this),o.update(!0))}}));var n=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},r=window.cancelAnimationFrame||clearTimeout;function i(e){return"string"==typeof e?e:e.text}function o(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function s(t,n){this.completion=t,this.data=n,this.picked=!1;var r=this,s=t.cm,a=this.hints=document.createElement("ul");a.className="CodeMirror-hints",this.selectedHint=n.selectedHint||0;for(var l=n.list,u=0;u<l.length;++u){var c=a.appendChild(document.createElement("li")),p=l[u],d="CodeMirror-hint"+(u!=this.selectedHint?"":" CodeMirror-hint-active");null!=p.className&&(d=p.className+" "+d),c.className=d,p.render?p.render(c,n,p):c.appendChild(document.createTextNode(p.displayText||i(p))),c.hintId=u}var f=s.cursorCoords(t.options.alignWithWord?n.from:null),h=f.left,g=f.bottom,m=!0;a.style.left=h+"px",a.style.top=g+"px";var v=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),E=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(t.options.container||document.body).appendChild(a);var x=a.getBoundingClientRect(),y=x.bottom-E,T=a.scrollHeight>a.clientHeight+1,N=s.getScrollInfo();if(y>0){var C=x.bottom-x.top;if(f.top-(f.bottom-x.top)-C>0)a.style.top=(g=f.top-C)+"px",m=!1;else if(C>E){a.style.height=E-5+"px",a.style.top=(g=f.bottom-x.top)+"px";var S=s.getCursor();n.from.ch!=S.ch&&(f=s.cursorCoords(S),a.style.left=(h=f.left)+"px",x=a.getBoundingClientRect())}}var I,L=x.right-v;if(L>0&&(x.right-x.left>v&&(a.style.width=v-5+"px",L-=x.right-x.left-v),a.style.left=(h=f.left-L)+"px"),T)for(var A=a.firstChild;A;A=A.nextSibling)A.style.paddingRight=s.display.nativeBarWidth+"px";return s.addKeyMap(this.keyMap=function(e,t){var n={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!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;function o(e,r){var o;o="string"!=typeof r?function(e){return r(e,t)}:n.hasOwnProperty(r)?n[r]:r,i[e]=o}if(r)for(var s in r)r.hasOwnProperty(s)&&o(s,r[s]);var a=e.options.extraKeys;if(a)for(var s in a)a.hasOwnProperty(s)&&o(s,a[s]);return i}(t,{moveFocus:function(e,t){r.changeActive(r.selectedHint+e,t)},setFocus:function(e){r.changeActive(e)},menuSize:function(){return r.screenAmount()},length:l.length,close:function(){t.close()},pick:function(){r.pick()},data:n})),t.options.closeOnUnfocus&&(s.on("blur",this.onBlur=function(){I=setTimeout((function(){t.close()}),100)}),s.on("focus",this.onFocus=function(){clearTimeout(I)})),s.on("scroll",this.onScroll=function(){var e=s.getScrollInfo(),n=s.getWrapperElement().getBoundingClientRect(),r=g+N.top-e.top,i=r-(window.pageYOffset||(document.documentElement||document.body).scrollTop);if(m||(i+=a.offsetHeight),i<=n.top||i>=n.bottom)return t.close();a.style.top=r+"px",a.style.left=h+N.left-e.left+"px"}),e.on(a,"dblclick",(function(e){var t=o(a,e.target||e.srcElement);t&&null!=t.hintId&&(r.changeActive(t.hintId),r.pick())})),e.on(a,"click",(function(e){var n=o(a,e.target||e.srcElement);n&&null!=n.hintId&&(r.changeActive(n.hintId),t.options.completeOnSingleClick&&r.pick())})),e.on(a,"mousedown",(function(){setTimeout((function(){s.focus()}),20)})),e.signal(n,"select",l[0],a.firstChild),!0}function a(e,t,n,r){if(e.async)e(t,r,n);else{var i=e(t,n);i&&i.then?i.then(r):r(i)}}t.prototype={close:function(){this.active()&&(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(i(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),this.close()},cursorActivity:function(){this.debounce&&(r(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 i=this;this.debounce=n((function(){i.update()})),this.widget&&this.widget.disable()}},update:function(e){if(null!=this.tick){var t=this,n=++this.tick;a(this.options.hint,this.cm,this.options,(function(r){t.tick==n&&t.finishUpdate(r,e)}))}},finishUpdate:function(t,n){this.data&&e.signal(this.data,"update");var r,i,o=this.widget&&this.widget.picked||n&&this.options.completeSingle;this.widget&&this.widget.close(),t&&this.data&&(r=this.data,i=t,e.cmpPos(i.from,r.from)>0&&r.to.ch-r.from.ch!=i.to.ch-i.from.ch)||(this.data=t,t&&t.list.length&&(o&&1==t.list.length?this.pick(t,0):(this.widget=new s(this,t),e.signal(t,"shown"))))}},s.prototype={close:function(){if(this.completion.widget==this){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,n){if(t>=this.data.list.length?t=n?this.data.list.length-1:0:t<0&&(t=n?0:this.data.list.length-1),this.selectedHint!=t){var r=this.hints.childNodes[this.selectedHint];r.className=r.className.replace(" CodeMirror-hint-active",""),(r=this.hints.childNodes[this.selectedHint=t]).className+=" CodeMirror-hint-active",r.offsetTop<this.hints.scrollTop?this.hints.scrollTop=r.offsetTop-3:r.offsetTop+r.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=r.offsetTop+r.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],r)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",{resolve:function(t,n){var r,i=t.getHelpers(n,"hint");if(i.length){var o=function(e,t,n){var r=function(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r<t.length;r++)t[r].supportsSelection&&n.push(t[r]);return n}(e,i);!function i(o){if(o==r.length)return t(null);a(r[o],e,n,(function(e){e&&e.list.length>0?t(e):i(o+1)}))}(0)};return o.async=!0,o.supportsSelection=!0,o}return(r=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:r})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}}),e.registerHelper("hint","fromList",(function(t,n){var r=t.getCursor(),i=t.getTokenAt(r),o=e.Pos(r.line,i.end);if(i.string&&/\w/.test(i.string[i.string.length-1]))var s=i.string,a=e.Pos(r.line,i.start);else s="",a=o;for(var l=[],u=0;u<n.words.length;u++){var c=n.words[u];c.slice(0,s.length)==s&&l.push(c)}if(l.length)return{list:l,from:a,to:o}})),e.commands.autocomplete=e.showHint;var l={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":15}],13:[function(e,t,n){var r;r=function(e){"use strict";e.runMode=function(t,n,r,i){var o=e.getMode(e.defaults,n),s=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<9);if(r.appendChild){var a=i&&i.tabSize||e.defaults.tabSize,l=r,u=0;l.innerHTML="",r=function(e,t){if("\n"==e)return l.appendChild(document.createTextNode(s?"\r":e)),void(u=0);for(var n="",r=0;;){var i=e.indexOf("\t",r);if(-1==i){n+=e.slice(r),u+=e.length-r;break}u+=i-r,n+=e.slice(r,i);var o=a-u%a;u+=o;for(var c=0;c<o;++c)n+=" ";r=i+1}if(t){var p=l.appendChild(document.createElement("span"));p.className="cm-"+t.replace(/ +/g," cm-"),p.appendChild(document.createTextNode(n))}else l.appendChild(document.createTextNode(n))}}for(var c=e.splitLines(t),p=i&&i.state||e.startState(o),d=0,f=c.length;d<f;++d){d&&r("\n");var h=new e.StringStream(c[d]);for(!h.string&&o.blankLine&&o.blankLine(p);!h.eol();){var g=o.token(h,p);r(h.current(),g,d,h.start,p),h.start=h.pos}}}},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":15}],14:[function(e,t,n){var r;r=function(e){"use strict";var t=e.Pos;function n(e,n,i,o){if(this.atOccurrence=!1,this.doc=e,null==o&&"string"==typeof n&&(o=!1),i=i?e.clipPos(i):t(0,0),this.pos={from:i,to:i},"string"!=typeof n)n.global||(n=new RegExp(n.source,n.ignoreCase?"ig":"g")),this.matches=function(r,i){if(r){n.lastIndex=0;for(var o=e.getLine(i.line).slice(0,i.ch),s=0;;){n.lastIndex=s;var a=n.exec(o);if(!a)break;if(u=(l=a).index,(s=l.index+(l[0].length||1))==o.length)break}(c=l&&l[0].length||0)||(0==u&&0==o.length?l=void 0:u!=e.getLine(i.line).length&&c++)}else{n.lastIndex=i.ch,o=e.getLine(i.line);var l,u,c=(l=n.exec(o))&&l[0].length||0;(u=l&&l.index)+c==o.length||c||(c=1)}if(l&&c)return{from:t(i.line,u),to:t(i.line,u+c),match:l}};else{var s=n;o&&(n=n.toLowerCase());var a=o?function(e){return e.toLowerCase()}:function(e){return e},l=n.split("\n");if(1==l.length)n.length?this.matches=function(i,o){if(i){var l=e.getLine(o.line).slice(0,o.ch);if((c=(u=a(l)).lastIndexOf(n))>-1)return c=r(l,u,c),{from:t(o.line,c),to:t(o.line,c+s.length)}}else{var u,c;if(l=e.getLine(o.line).slice(o.ch),(c=(u=a(l)).indexOf(n))>-1)return c=r(l,u,c)+o.ch,{from:t(o.line,c),to:t(o.line,c+s.length)}}}:this.matches=function(){};else{var u=s.split("\n");this.matches=function(n,r){var i,o=l.length-1;if(n){if(r.line-(l.length-1)<e.firstLine())return;if(a(e.getLine(r.line).slice(0,u[o].length))!=l[l.length-1])return;for(var s=t(r.line,u[o].length),c=r.line-1,p=o-1;p>=1;--p,--c)if(l[p]!=a(e.getLine(c)))return;var d=(i=e.getLine(c)).length-u[0].length;if(a(i.slice(d))!=l[0])return;return{from:t(c,d),to:s}}if(!(r.line+(l.length-1)>e.lastLine())&&(d=(i=e.getLine(r.line)).length-u[0].length,a(i.slice(d))==l[0])){var f=t(r.line,d);for(c=r.line+1,p=1;p<o;++p,++c)if(l[p]!=a(e.getLine(c)))return;if(a(e.getLine(c).slice(0,u[o].length))==l[o])return{from:f,to:t(c,u[o].length)}}}}}}function r(e,t,n){if(e.length==t.length)return n;for(var r=Math.min(n,e.length);;){var i=e.slice(0,r).toLowerCase().length;if(i<n)++r;else{if(!(i>n))return r;--r}}}n.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);function i(e){var r=t(e,0);return n.pos={from:r,to:r},n.atOccurrence=!1,!1}for(;;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return i(0);r=t(r.line-1,this.doc.getLine(r.line-1).length)}else{var o=this.doc.lineCount();if(r.line==o-1)return i(o);r=t(r.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(n,r){if(this.atOccurrence){var i=e.splitLines(n);this.doc.replaceRange(i,this.pos.from,this.pos.to,r),this.pos.to=t(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,r){return new n(this.doc,e,t,r)})),e.defineDocExtension("getSearchCursor",(function(e,t,r){return new n(this,e,t,r)})),e.defineExtension("selectMatches",(function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],r):r(CodeMirror)},{"../../lib/codemirror":15}],15:[function(e,t,n){!function(e){if("object"==typeof n&&"object"==typeof t)t.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);(this||window).CodeMirror=e()}}((function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=r||i,s=o&&(r?document.documentMode||6:i[1]),a=/WebKit\//.test(e),l=a&&/Qt\/\d+\.\d+/.test(e),u=/Chrome\//.test(e),c=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),h=/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=h||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),m=h||/Mac/.test(t),v=/\bCrOS\b/.test(e),E=/win/i.test(t),x=c&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(c=!1,a=!0);var y=m&&(l||c&&(null==x||x<12.11)),T=n||o&&s>=9,N=!1,C=!1;function S(e,t){if(!(this instanceof S))return new S(e,t);this.options=t=t?No(t):{},No(er,t,!1),k(t);var n=t.value;"string"==typeof n&&(n=new vi(n,t.mode,null,t.lineSeparator)),this.doc=n;var r=new S.inputStyles[t.inputStyle](this),i=this.display=new I(e,n,r);i.wrapper.CodeMirror=this,M(this),w(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),t.autofocus&&!g&&i.input.focus(),B(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new co,keySeq:null,specialChars:null};var l=this;for(var u in o&&s<11&&setTimeout((function(){l.display.input.reset(!0)}),20),function(e){var t=e.display;Wi(t.scroller,"mousedown",Xt(e,pn)),Wi(t.scroller,"dblclick",o&&s<11?Xt(e,(function(t){if(!to(e,t)){var n=cn(e,t);if(n&&!fn(e,t)&&!un(e.display,t)){ji(t);var r=e.findWordAt(n);je(e.doc,r.anchor,r.head)}}})):function(t){to(e,t)||ji(t)}),T||Wi(t.scroller,"contextmenu",(function(t){_n(e,t)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function a(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}Wi(t.scroller,"touchstart",(function(i){if(!to(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)){clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),Wi(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),Wi(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!un(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,s=e.coordsChar(t.activeTouch,"page");o=!r.prev||a(r,r.prev)?new _e(s,s):!r.prev.prev||a(r,r.prev.prev)?e.findWordAt(s):new _e(fe(s.line,0),Fe(e.doc,fe(s.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),ji(n)}i()})),Wi(t.scroller,"touchcancel",i),Wi(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(vn(e,t.scroller.scrollTop),En(e,t.scroller.scrollLeft,!0),Ki(e,"scroll",e))})),Wi(t.scroller,"mousewheel",(function(t){Nn(e,t)})),Wi(t.scroller,"DOMMouseScroll",(function(t){Nn(e,t)})),Wi(t.wrapper,"scroll",(function(){t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){to(e,t)||qi(t)},over:function(t){to(e,t)||(function(e,t){var n=cn(e,t);if(n){var r=document.createDocumentFragment();nt(e,n,r),e.display.dragCursor||(e.display.dragCursor=Oo("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),_o(e.display.dragCursor,r)}}(e,t),qi(t))},start:function(t){!function(e,t){if(o&&(!e.state.draggingText||+new Date-hn<100))qi(t);else if(!to(e,t)&&!un(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p)){var n=Oo("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",c&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),c&&n.parentNode.removeChild(n)}}(e,t)},drop:Xt(e,gn),leave:function(t){to(e,t)||mn(e)}};var l=t.input.getField();Wi(l,"keyup",(function(t){Rn.call(e,t)})),Wi(l,"keydown",Xt(e,bn)),Wi(l,"keypress",Xt(e,wn)),Wi(l,"focus",Co(On,e)),Wi(l,"blur",Co(Mn,e))}(this),function(){var e;Ho||(Wi(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Bo(ln)}),100))})),Wi(window,"blur",(function(){Bo(Mn)})),Ho=!0)}(),Vt(this),this.curOp.forceUpdate=!0,Ti(this,n),t.autofocus&&!g||l.hasFocus()?setTimeout(Co(On,this),20):Mn(this),tr)tr.hasOwnProperty(u)&&tr[u](this,t[u],rr);z(this),t.finishInit&&t.finishInit(this);for(var d=0;d<ar.length;++d)ar[d](this);Ht(this),a&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(i.lineDiv).textRendering&&(i.lineDiv.style.textRendering="auto")}function I(e,t,r){var i=this;this.input=r,i.scrollbarFiller=Oo("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=Oo("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=Oo("div",null,"CodeMirror-code"),i.selectionDiv=Oo("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=Oo("div",null,"CodeMirror-cursors"),i.measure=Oo("div",null,"CodeMirror-measure"),i.lineMeasure=Oo("div",null,"CodeMirror-measure"),i.lineSpace=Oo("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=Oo("div",[Oo("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=Oo("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=Oo("div",null,null,"position: absolute; height: "+oo+"px; width: 1px;"),i.gutters=Oo("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=Oo("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=Oo("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),o&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),a||n&&g||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}function L(e){e.doc.mode=S.getMode(e.options,e.doc.modeOption),A(e)}function A(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.frontier=e.doc.first,ot(e,100),e.state.modeGen++,e.curOp&&tn(e)}function b(e){var t=kt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Ft(e.display)-3);return function(i){if(Hr(e.doc,i))return 0;var o=0;if(i.widgets)for(var s=0;s<i.widgets.length;s++)i.widgets[s].height&&(o+=i.widgets[s].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function R(e){var t=e.doc,n=b(e);t.iter((function(e){var t=n(e);t!=e.height&&Ii(e,t)}))}function w(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),It(e)}function O(e){M(e),tn(e),setTimeout((function(){q(e)}),20)}function M(e){var t=e.display.gutters,n=e.options.gutters;Mo(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(Oo("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",_(e)}function _(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function P(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=Fr(r);)r=(i=t.find(0,!0)).from.line,n+=i.from.ch-i.to.ch;for(r=e;t=Gr(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,n+=(r=i.to.line).text.length-i.to.ch}return n}function D(e){var t=e.display,n=e.doc;t.maxLine=Ni(n,n.first),t.maxLineLength=P(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=P(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}function k(e){var t=Eo(e.gutters,"CodeMirror-linenumbers");-1==t&&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 F(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ut(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+pt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function G(e,t,n){this.cm=n;var r=this.vert=Oo("div",[Oo("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Oo("div",[Oo("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Wi(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),Wi(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,o&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function U(){}function B(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Fo(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new S.scrollbarModel[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Wi(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?En(e,t):vn(e,t)}),e),e.display.scrollbars.addClass&&Go(e.display.wrapper,e.display.scrollbars.addClass)}function j(e,t){t||(t=F(e));var n=e.display.barWidth,r=e.display.barHeight;V(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&J(e),V(e,F(e)),n=e.display.barWidth,r=e.display.barHeight}function V(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",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",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 H(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-lt(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=Ai(t,r),s=Ai(t,i);if(n&&n.ensure){var a=n.ensure.from.line,l=n.ensure.to.line;a<o?(o=a,s=Ai(t,bi(Ni(t,a))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=s&&(o=Ai(t,bi(Ni(t,l))-e.wrapper.clientHeight),s=l)}return{from:o,to:Math.max(s,o+1)}}function q(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=W(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",s=0;s<n.length;s++)if(!n[s].hidden){e.options.fixedGutter&&n[s].gutter&&(n[s].gutter.style.left=o);var a=n[s].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function z(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=$(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(Oo("div",[Oo("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,s=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-s)+1,r.lineNumWidth=r.lineNumInnerWidth+s,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",_(e),!0}return!1}function $(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function W(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Q(e,t,n){var r=e.display;this.viewport=t,this.visible=H(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=dt(e),this.force=n,this.dims=te(e),this.events=[]}function Y(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return rn(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==an(e))return!1;z(e)&&(rn(e),t.dims=te(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),s=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>s&&n.viewTo-s<20&&(s=Math.min(i,n.viewTo)),C&&(o=jr(e.doc,o),s=Vr(e.doc,s));var l=o!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=en(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=en(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(on(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(en(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,on(e,n)))),r.viewTo=n}(e,o,s),n.viewOffset=bi(Ni(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=an(e);if(!l&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Do();return u>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,s=o.firstChild;function l(t){var n=t.nextSibling;return a&&m&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var u=r.view,c=r.viewFrom,p=0;p<u.length;p++){var d=u[p];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;s!=d.node;)s=l(s);var f=i&&null!=t&&t<=c&&d.lineNumber;d.changes&&(Eo(d.changes,"gutter")>-1&&(f=!1),ne(e,d,c,n)),f&&(Mo(d.lineNumber),d.lineNumber.appendChild(document.createTextNode($(e.options,c)))),s=d.node.nextSibling}else{var h=ue(e,d,c,n);o.insertBefore(h,s)}c+=d.size}for(;s;)s=l(s)}(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&Do()!=c&&c.offsetHeight&&c.focus(),Mo(n.cursorDiv),Mo(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ot(e,400)),n.updateLineNumbers=null,!0}function X(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=dt(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+ut(e.display)-ft(e),n.top)}),t.visible=H(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Y(e,t);r=!1){J(e);var i=F(e);et(e),j(e,i),Z(e,i)}t.signal(e,"update",e),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 K(e,t){var n=new Q(e,t);if(Y(e,n)){J(e),X(e,n);var r=F(e);et(e),j(e,r),Z(e,r),n.finish()}}function Z(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+pt(e)+"px"}function J(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i,a=t.view[r];if(!a.hidden){if(o&&s<8){var l=a.node.offsetTop+a.node.offsetHeight;i=l-n,n=l}else{var u=a.node.getBoundingClientRect();i=u.bottom-u.top}var c=a.line.height-i;if(i<2&&(i=kt(t)),(c>.001||c<-.001)&&(Ii(a.line,i),ee(a.line),a.rest))for(var p=0;p<a.rest.length;p++)ee(a.rest[p])}}}function ee(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function te(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s)n[e.options.gutters[s]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[s]]=o.clientWidth;return{fixedPos:W(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function ne(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?oe(e,t):"gutter"==o?ae(e,t,n,r):"class"==o?se(t):"widget"==o&&le(e,t,r)}t.changes=null}function re(e){return e.node==e.text&&(e.node=Oo("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),o&&s<8&&(e.node.style.zIndex=2)),e.node}function ie(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):ai(e,t)}function oe(e,t){var n=t.text.className,r=ie(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,se(t)):n&&(t.text.className=n)}function se(e){!function(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=re(e);e.background=n.insertBefore(Oo("div",null,t),n.firstChild)}}(e),e.line.wrapClass?re(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 ae(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=re(t);t.gutterBackground=Oo("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){i=re(t);var s=t.gutter=Oo("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),i.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(Oo("div",$(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a<e.options.gutters.length;++a){var l=e.options.gutters[a],u=o.hasOwnProperty(l)&&o[l];u&&s.appendChild(Oo("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[l]+"px; width: "+r.gutterWidth[l]+"px"))}}}function le(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild;r;r=i){var i=r.nextSibling;"CodeMirror-linewidget"==r.className&&t.node.removeChild(r)}ce(e,t,n)}function ue(e,t,n,r){var i=ie(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),se(t),ae(e,t,n,r),ce(e,t,r),t.node}function ce(e,t,n){if(pe(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)pe(e,t.rest[r],t,n,!1)}function pe(e,t,n,r,i){if(t.widgets)for(var o=re(n),s=0,a=t.widgets;s<a.length;++s){var l=a[s],u=Oo("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),de(l,u,n,r),e.display.input.setUneditable(u),i&&l.above?o.insertBefore(u,n.gutter||n.text):o.appendChild(u),Ji(l,"redraw")}}function de(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"))}G.prototype=No({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 o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=m&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new co,this.disableVert=new co},enableZeroWidthBar:function(e,t){e.style.pointerEvents="auto",t.set(1e3,(function n(){var r=e.getBoundingClientRect();document.elementFromPoint(r.left+1,r.bottom-1)!=e?e.style.pointerEvents="none":t.set(1e3,n)}))},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},G.prototype),U.prototype=No({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},U.prototype),S.scrollbarModel={native:G,null:U},Q.prototype.signal=function(e,t){ro(e,t)&&this.events.push(arguments)},Q.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ki.apply(null,this.events[e])};var fe=S.Pos=function(e,t){if(!(this instanceof fe))return new fe(e,t);this.line=e,this.ch=t},he=S.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch};function ge(e){return fe(e.line,e.ch)}function me(e,t){return he(e,t)<0?t:e}function ve(e,t){return he(e,t)<0?e:t}function Ee(e){e.state.focused||(e.display.input.focus(),On(e))}var xe=null;function ye(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var s=e.state.pasteIncoming||"paste"==i,a=o.splitLines(t),l=null;if(s&&r.ranges.length>1)if(xe&&xe.text.join("\n")==t){if(r.ranges.length%xe.text.length==0){l=[];for(var u=0;u<xe.text.length;u++)l.push(o.splitLines(xe.text[u]))}}else a.length==r.ranges.length&&(l=xo(a,(function(e){return[e]})));for(u=r.ranges.length-1;u>=0;u--){var c=r.ranges[u],p=c.from(),d=c.to();c.empty()&&(n&&n>0?p=fe(p.line,p.ch-n):e.state.overwrite&&!s?d=fe(d.line,Math.min(Ni(o,d.line).text.length,d.ch+mo(a).length)):xe&&xe.lineWise&&xe.text.join("\n")==t&&(p=d=fe(p.line,0)));var f=e.curOp.updateInput,h={from:p,to:d,text:l?l[u%l.length]:a,origin:i||(s?"paste":e.state.cutIncoming?"cut":"+input")};Un(e.doc,h),Ji(e,"inputRead",e,h)}t&&!s&&Ne(e,t),Wn(e),e.curOp.updateInput=f,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Te(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Yt(t,(function(){ye(t,n,0,null,"paste")})),!0}function Ne(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,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)){var o=e.getModeAt(i.head),s=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){s=Yn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ni(e.doc,i.head.line).text.slice(0,i.head.ch))&&(s=Yn(e,i.head.line,"smart"));s&&Ji(e,"electricInput",e,i.head.line)}}}function Ce(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:fe(i,0),head:fe(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Se(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function Ie(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new co,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function Le(){var e=Oo("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=Oo("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return a?e.style.width="1000px":e.setAttribute("wrap","off"),h&&(e.style.border="1px solid black"),Se(e),t}function Ae(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new co,this.gracePeriod=!1}function be(e,t){var n=mt(e,t.line);if(!n||n.hidden)return null;var r=Ni(e.doc,t.line),i=ht(n,r,t.line),o=Ri(r),s="left";o&&(s=as(o,t.ch)%2?"right":"left");var a=Tt(i.map,t.ch,s);return a.offset="right"==a.collapse?a.end:a.start,a}function Re(e,t){return t&&(e.bad=!0),e}function we(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Re(e.clipPos(fe(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 o=e.display.view[i];if(o.node==r)return Oe(o,t,n)}}function Oe(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!Po(r,t))return Re(fe(Li(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?mo(e.rest):e.line;return Re(fe(Li(o),o.text.length),i)}var s=3==t.nodeType?t:null,a=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,n&&(n=s.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var l=e.measure,u=l.maps;function c(t,n,r){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?l.map:u[i],s=0;s<o.length;s+=3){var a=o[s+2];if(a==t||a==n){var c=Li(i<0?e.line:e.rest[i]),p=o[s]+r;return(r<0||a!=t)&&(p=o[s+(r?1:0)]),fe(c,p)}}}var p=c(s,a,n);if(p)return Re(p,i);for(var d=a.nextSibling,f=s?s.nodeValue.length-n:0;d;d=d.nextSibling){if(p=c(d,d.firstChild,0))return Re(fe(p.line,p.ch-f),i);f+=d.textContent.length}var h=a.previousSibling;for(f=n;h;h=h.previousSibling){if(p=c(h,h.firstChild,-1))return Re(fe(p.line,p.ch+f),i);f+=d.textContent.length}}function Me(e,t){this.ranges=e,this.primIndex=t}function _e(e,t){this.anchor=e,this.head=t}function Pe(e,t){var n=e[t];e.sort((function(e,t){return he(e.from(),t.from())})),t=Eo(e,n);for(var r=1;r<e.length;r++){var i=e[r],o=e[r-1];if(he(o.to(),i.from())>=0){var s=ve(o.from(),i.from()),a=me(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;r<=t&&--t,e.splice(--r,2,new _e(l?a:s,l?s:a))}}return new Me(e,t)}function De(e,t){return new Me([new _e(e,t||e)],0)}function ke(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Fe(e,t){if(t.line<e.first)return fe(e.first,0);var n=e.first+e.size-1;return t.line>n?fe(n,Ni(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?fe(e.line,t):n<0?fe(e.line,0):e}(t,Ni(e,t.line).text.length)}function Ge(e,t){return t>=e.first&&t<e.first+e.size}function Ue(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Fe(e,t[r]);return n}function Be(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var o=he(n,i)<0;o!=he(r,i)<0?(i=n,n=r):o!=he(n,r)<0&&(n=r)}return new _e(i,n)}return new _e(r||n,n)}function je(e,t,n,r){$e(e,new Me([Be(e,e.sel.primary(),t,n)],0),r)}function Ve(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=Be(e,e.sel.ranges[i],t[i],null);$e(e,Pe(r,e.sel.primIndex),n)}function He(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,$e(e,Pe(i,e.sel.primIndex),r)}function qe(e,t,n,r){$e(e,De(t,n),r)}function ze(e,t,n){var r=e.history.done,i=mo(r);i&&i.ranges?(r[r.length-1]=t,We(e,t,n)):$e(e,t,n)}function $e(e,t,n){We(e,t,n),function(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(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)}(e,o,mo(i.done),t))?i.done[i.done.length-1]=t:Pi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Mi(i.undone)}(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function We(e,t,n){(ro(e,"beforeSelectionChange")||e.cm&&ro(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new _e(Fe(e,t[n].anchor),Fe(e,t[n].head))},origin:n&&n.origin};return Ki(e,"beforeSelectionChange",e,r),e.cm&&Ki(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Pe(r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(he(t.primary().head,e.sel.primary().head)<0?-1:1);Qe(e,Xe(e,t,r,!0)),n&&!1===n.scroll||!e.cm||Wn(e.cm)}function Qe(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,no(e.cm)),Ji(e,"cursorActivity",e))}function Ye(e){Qe(e,Xe(e,e.sel,null,!1))}function Xe(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var s=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Ze(e,s.anchor,a&&a.anchor,n,r),u=Ze(e,s.head,a&&a.head,n,r);(i||l!=s.anchor||u!=s.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new _e(l,u))}return i?Pe(i,t.primIndex):t}function Ke(e,t,n,r,i){var o=Ni(e,t.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var a=o.markedSpans[s],l=a.marker;if((null==a.from||(l.inclusiveLeft?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(l.inclusiveRight?a.to>=t.ch:a.to>t.ch))){if(i&&(Ki(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--s;continue}break}if(!l.atomic)continue;if(n){var u,c=l.find(r<0?1:-1);if((r<0?l.inclusiveRight:l.inclusiveLeft)&&(c=Je(e,c,-r,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=he(c,n))&&(r<0?u<0:u>0))return Ke(e,c,t,r,i)}var p=l.find(r<0?-1:1);return(r<0?l.inclusiveLeft:l.inclusiveRight)&&(p=Je(e,p,r,p.line==t.line?o:null)),p?Ke(e,p,t,r,i):null}}return t}function Ze(e,t,n,r,i){var o=r||1,s=Ke(e,t,n,o,i)||!i&&Ke(e,t,n,o,!0)||Ke(e,t,n,-o,i)||!i&&Ke(e,t,n,-o,!0);return s||(e.cantEdit=!0,fe(e.first,0))}function Je(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?Fe(e,fe(t.line-1)):null:n>0&&t.ch==(r||Ni(e,t.line)).text.length?t.line<e.first+e.size-1?fe(t.line+1,0):null:new fe(t.line,t.ch+n)}function et(e){e.display.input.showSelection(e.display.input.prepareSelection())}function tt(e,t){for(var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),s=0;s<n.sel.ranges.length;s++)if(!1!==t||s!=n.sel.primIndex){var a=n.sel.ranges[s];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var l=a.empty();(l||e.options.showCursorWhenSelecting)&&nt(e,a.head,i),l||rt(e,a,o)}}return r}function nt(e,t,n){var r=Ot(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(Oo("div"," ","CodeMirror-cursor"));if(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",r.other){var o=n.appendChild(Oo("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=r.other.left+"px",o.style.top=r.other.top+"px",o.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function rt(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),s=ct(e.display),a=s.left,l=Math.max(r.sizerWidth,dt(e)-r.sizer.offsetLeft)-s.right;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(Oo("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?l-e:n)+"px; height: "+(r-t)+"px"))}function c(t,n,r){var o,s,c=Ni(i,t),p=c.text.length;function d(n,r){return wt(e,fe(t,n),"div",c,r)}return function(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var s=e[o];(s.from<n&&s.to>t||t==n&&s.to==t)&&(r(Math.max(s.from,t),Math.min(s.to,n),1==s.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}(Ri(c),n||0,null==r?p:r,(function(e,t,i){var c,f,h,g=d(e,"left");if(e==t)c=g,f=h=g.left;else{if(c=d(t-1,"right"),"rtl"==i){var m=g;g=c,c=m}f=g.left,h=c.right}null==n&&0==e&&(f=a),c.top-g.top>3&&(u(f,g.top,null,g.bottom),f=a,g.bottom<c.top&&u(f,g.bottom,null,c.top)),null==r&&t==p&&(h=l),(!o||g.top<o.top||g.top==o.top&&g.left<o.left)&&(o=g),(!s||c.bottom>s.bottom||c.bottom==s.bottom&&c.right>s.right)&&(s=c),f<a+1&&(f=a),u(f,c.top,h-f,c.bottom)})),{start:o,end:s}}var p=t.from(),d=t.to();if(p.line==d.line)c(p.line,p.ch,d.ch);else{var f=Ni(i,p.line),h=Ni(i,d.line),g=Br(f)==Br(h),m=c(p.line,p.ch,g?f.text.length+1:null).end,v=c(d.line,g?0:null,d.ch).start;g&&(m.top<v.top-2?(u(m.right,m.top,null,m.bottom),u(a,v.top,v.left,v.bottom)):u(m.right,m.top,v.left-m.right,m.bottom)),m.bottom<v.top&&u(a,m.bottom,null,v.top)}n.appendChild(o)}function it(e){if(e.state.focused){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 ot(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Co(st,e))}function st(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ur(t.mode,at(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(t.frontier>=e.display.viewFrom){var s=o.styles,a=o.text.length>e.options.maxHighlightLength,l=ti(e,o,a?ur(t.mode,r):r,!0);o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var p=!s||s.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!p&&d<s.length;++d)p=s[d]!=o.styles[d];p&&i.push(t.frontier),o.stateAfter=a?r:ur(t.mode,r)}else o.text.length<=e.options.maxHighlightLength&&ri(e,o.text,r),o.stateAfter=t.frontier%5==0?ur(t.mode,r):null;if(++t.frontier,+new Date>n)return ot(e,e.options.workDelay),!0})),i.length&&Yt(e,(function(){for(var t=0;t<i.length;t++)nn(e,i[t],"text")}))}}function at(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=function(e,t,n){for(var r,i,o=e.doc,s=n?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>s;--a){if(a<=o.first)return o.first;var l=Ni(o,a-1);if(l.stateAfter&&(!n||a<=o.frontier))return a;var u=po(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=a-1,r=u)}return i}(e,t,n),s=o>r.first&&Ni(r,o-1).stateAfter;return s=s?ur(r.mode,s):cr(r.mode),r.iter(o,t,(function(n){ri(e,n.text,s);var a=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;n.stateAfter=a?ur(r.mode,s):null,++o})),n&&(r.frontier=o),s}function lt(e){return e.lineSpace.offsetTop}function ut(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ct(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=_o(e.measure,Oo("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 pt(e){return oo-e.display.nativeBarWidth}function dt(e){return e.display.scroller.clientWidth-pt(e)-e.display.barWidth}function ft(e){return e.display.scroller.clientHeight-pt(e)-e.display.barHeight}function ht(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(r=0;r<e.rest.length;r++)if(Li(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function gt(e,t,n,r){return Et(e,vt(e,t),n,r)}function mt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[on(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function vt(e,t){var n=Li(t),r=mt(e,n);r&&!r.text?r=null:r&&r.changes&&(ne(e,r,n,te(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Li(t=Br(t)),r=e.display.externalMeasured=new Jt(e.doc,t,n);r.lineN=n;var i=r.built=ai(e,r);return r.text=i.pre,_o(e.display.lineMeasure,i.pre),r}(e,t));var i=ht(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Et(e,t,n,r,i){t.before&&(n=-1);var a,l=n+(r||"");return t.cache.hasOwnProperty(l)?a=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&dt(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var s=t.text.firstChild.getClientRects(),a=0;a<s.length-1;a++){var l=s[a],u=s[a+1];Math.abs(l.bottom-u.bottom)>2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(a=function(e,t,n,r){var i,a=Tt(t.map,n,r),l=a.node,u=a.start,c=a.end,p=a.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;u&&wo(t.line.text.charAt(a.coverStart+u));)--u;for(;a.coverStart+c<a.coverEnd&&wo(t.line.text.charAt(a.coverStart+c));)++c;if((i=o&&s<9&&0==u&&c==a.coverEnd-a.coverStart?l.parentNode.getBoundingClientRect():Nt(bo(l,u,c).getClientRects(),r)).left||i.right||0==u)break;c=u,u-=1,p="right"}o&&s<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Zo)return Zo;var t=_o(e,Oo("span","x")),n=t.getBoundingClientRect(),r=bo(t,0,1).getBoundingClientRect();return Zo=Math.abs(n.left-r.left)>1}(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}}(e.display.measure,i))}else{var f;u>0&&(p=r="right"),i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(o&&s<9&&!u&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+Ft(e.display),top:h.top,bottom:h.bottom}:yt}var g=i.top-t.rect.top,m=i.bottom-t.rect.top,v=(g+m)/2,E=t.view.measure.heights;for(d=0;d<E.length-1&&!(v<E[d]);d++);var x=d?E[d-1]:0,y=E[d],T={left:("right"==p?i.right:i.left)-t.rect.left,right:("left"==p?i.left:i.right)-t.rect.left,top:x,bottom:y};return i.left||i.right||(T.bogus=!0),e.options.singleCursorHeightPerLine||(T.rtop=g,T.rbottom=m),T}(e,t,n,r)).bogus||(t.cache[l]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}Ie.prototype=No({init:function(e){var t=this,n=this.cm,r=this.wrapper=Le(),i=this.textarea=r.firstChild;function a(e){if(!to(n,e)){if(n.somethingSelected())xe={lineWise:!1,text:n.getSelections()},t.inaccurateSelection&&(t.prevInput="",t.inaccurateSelection=!1,i.value=xe.text.join("\n"),vo(i));else{if(!n.options.lineWiseCopyCut)return;var r=Ce(n);xe={lineWise:!0,text:r.text},"cut"==e.type?n.setSelections(r.ranges,null,ao):(t.prevInput="",i.value=r.text.join("\n"),vo(i))}"cut"==e.type&&(n.state.cutIncoming=!0)}}e.wrapper.insertBefore(r,e.wrapper.firstChild),h&&(i.style.width="0px"),Wi(i,"input",(function(){o&&s>=9&&t.hasSelection&&(t.hasSelection=null),t.poll()})),Wi(i,"paste",(function(e){to(n,e)||Te(e,n)||(n.state.pasteIncoming=!0,t.fastPoll())})),Wi(i,"cut",a),Wi(i,"copy",a),Wi(e.scroller,"paste",(function(r){un(e,r)||to(n,r)||(n.state.pasteIncoming=!0,t.focus())})),Wi(e.lineSpace,"selectstart",(function(t){un(e,t)||ji(t)})),Wi(i,"compositionstart",(function(){var e=n.getCursor("from");t.composing&&t.composing.range.clear(),t.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}})),Wi(i,"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=tt(e);if(e.options.moveInputWithCursor){var i=Ot(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+s.left-o.left))}return r},showSelection:function(e){var t=this.cm.display;_o(t.cursorDiv,e.cursors),_o(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var a=i.sel.primary(),l=(t=Ko&&(a.to().line-a.from().line>100||(n=r.getSelection()).length>1e3))?"-":n||r.getSelection();this.textarea.value=l,r.state.focused&&vo(this.textarea),o&&s>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",o&&s>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!g||Do()!=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;e.pollingFast||e.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},fastPoll:function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||Xo(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(o&&s>=9&&this.hasSelection===r||m&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(n.length,r.length);a<l&&n.charCodeAt(a)==r.charCodeAt(a);)++a;var u=this;return Yt(e,(function(){ye(e,r.slice(a),n.length-a,null,u.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=u.prevInput="":u.prevInput=r,u.composing&&(u.composing.range.clear(),u.composing.range=e.markText(u.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){o&&s>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){var t=this,n=t.cm,r=n.display,i=t.textarea,l=cn(n,e),u=r.scroller.scrollTop;if(l&&!c){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(l)&&Xt(n,$e)(n.doc,De(l),ao);var p=i.style.cssText,d=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var f=t.wrapper.getBoundingClientRect();if(i.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px; z-index: 1000; background: "+(o?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",a)var h=window.scrollY;if(r.input.focus(),a&&window.scrollTo(null,h),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),o&&s>=9&&m(),T){qi(e);var g=function(){Xi(window,"mouseup",g),setTimeout(v,20)};Wi(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=p,o&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart){(!o||o&&s<9)&&m();var e=0,a=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Xt(n,pr.selectAll)(n):e++<10?r.detectingSelectAll=setTimeout(a,500):r.input.reset()};r.detectingSelectAll=setTimeout(a,200)}}},readOnlyChanged:function(e){e||this.reset()},setUneditable:yo,needsContentAttribute:!1},Ie.prototype),Ae.prototype=No({init:function(e){var t=this,n=t.cm,r=t.div=e.lineDiv;function i(e){if(!to(n,e)){if(n.somethingSelected())xe={lineWise:!1,text:n.getSelections()},"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=Ce(n);xe={lineWise:!0,text:t.text},"cut"==e.type&&n.operation((function(){n.setSelections(t.ranges,0,ao),n.replaceSelection("",null,"cut")}))}if(e.clipboardData&&!h)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",xe.text.join("\n"));else{var r=Le(),i=r.firstChild;n.display.lineSpace.insertBefore(r,n.display.lineSpace.firstChild),i.value=xe.text.join("\n");var o=document.activeElement;vo(i),setTimeout((function(){n.display.lineSpace.removeChild(r),o.focus()}),50)}}}Se(r),Wi(r,"paste",(function(e){to(n,e)||Te(e,n)})),Wi(r,"compositionstart",(function(e){var r=e.data;if(t.composing={sel:n.doc.sel,data:r,startData:r},r){var i=n.doc.sel.primary(),o=n.getLine(i.head.line).indexOf(r,Math.max(0,i.head.ch-r.length));o>-1&&o<=i.head.ch&&(t.composing.sel=De(fe(i.head.line,o),fe(i.head.line,o+r.length)))}})),Wi(r,"compositionupdate",(function(e){t.composing.data=e.data})),Wi(r,"compositionend",(function(e){var n=t.composing;n&&(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))})),Wi(r,"touchstart",(function(){t.forceCompositionEnd()})),Wi(r,"input",(function(){t.composing||!n.isReadOnly()&&t.pollContent()||Yt(t.cm,(function(){tn(n)}))})),Wi(r,"copy",i),Wi(r,"cut",i)},prepareSelection:function(){var e=tt(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=we(this.cm,e.anchorNode,e.anchorOffset),i=we(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!i||i.bad||0!=he(ve(r,i),t.from())||0!=he(me(r,i),t.to())){var o=be(this.cm,t.from()),s=be(this.cm,t.to());if(o||s){var a=this.cm.display.view,l=e.rangeCount&&e.getRangeAt(0);if(o){if(!s){var u=a[a.length-1].measure,c=u.maps?u.maps[u.maps.length-1]:u.map;s={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else o={node:a[0].measure.map[2],offset:0};try{var p=bo(o.node,o.offset,s.offset,s.node)}catch(e){}p&&(!n&&this.cm.state.focused?(e.collapse(o.node,o.offset),p.collapsed||e.addRange(p)):(e.removeAllRanges(),e.addRange(p)),l&&null==e.anchorNode?e.addRange(l):n&&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){_o(this.cm.display.cursorDiv,e.cursors),_o(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 Po(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){var e=this;this.selectionInEditor()?this.pollSelection():Yt(this.cm,(function(){e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.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=we(t,e.anchorNode,e.anchorOffset),r=we(t,e.focusNode,e.focusOffset);n&&r&&Yt(t,(function(){$e(t.doc,De(n,r),ao),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}},pollContent:function(){var e,t=this.cm,n=t.display,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(i.line<n.viewFrom||o.line>n.viewTo-1)return!1;if(i.line==n.viewFrom||0==(e=on(t,i.line)))var s=Li(n.view[0].line),a=n.view[0].node;else s=Li(n.view[e].line),a=n.view[e-1].node.nextSibling;var l=on(t,o.line);if(l==n.view.length-1)var u=n.viewTo-1,c=n.lineDiv.lastChild;else u=Li(n.view[l+1].line)-1,c=n.view[l+1].node.previousSibling;for(var p=t.doc.splitLines(function(e,t,n,r,i){var o="",s=!1,a=e.doc.lineSeparator();function l(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(o+=n);var u,c=t.getAttribute("cm-marker");if(c){var p=e.findMarks(fe(r,0),fe(i+1,0),(h=+c,function(e){return e.id==h}));return void(p.length&&(u=p[0].find())&&(o+=Ci(e.doc,u.from,u.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d<t.childNodes.length;d++)l(t.childNodes[d]);/^(pre|div|p)$/i.test(t.nodeName)&&(s=!0)}else if(3==t.nodeType){var f=t.nodeValue;if(!f)return;s&&(o+=a,s=!1),o+=f}var h}for(;l(t),t!=n;)t=t.nextSibling;return o}(t,a,c,s,u)),d=Ci(t.doc,fe(s,0),fe(u,Ni(t.doc,u).text.length));p.length>1&&d.length>1;)if(mo(p)==mo(d))p.pop(),d.pop(),u--;else{if(p[0]!=d[0])break;p.shift(),d.shift(),s++}for(var f=0,h=0,g=p[0],m=d[0],v=Math.min(g.length,m.length);f<v&&g.charCodeAt(f)==m.charCodeAt(f);)++f;for(var E=mo(p),x=mo(d),y=Math.min(E.length-(1==p.length?f:0),x.length-(1==d.length?f:0));h<y&&E.charCodeAt(E.length-h-1)==x.charCodeAt(x.length-h-1);)++h;p[p.length-1]=E.slice(0,E.length-h),p[0]=p[0].slice(f);var T=fe(s,f),N=fe(u,d.length?mo(d).length-h:0);return p.length>1||p[0]||he(T,N)?(qn(t.doc,p,T,N,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Xt(this.cm,tn)(this.cm):e.data&&e.data!=e.startData&&Xt(this.cm,ye)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Xt(this.cm,ye)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:yo,resetPosition:yo,needsContentAttribute:!0},Ae.prototype),S.inputStyles={textarea:Ie,contenteditable:Ae},Me.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(0!=he(n.anchor,r.anchor)||0!=he(n.head,r.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new _e(ge(this.ranges[t].anchor),ge(this.ranges[t].head));return new Me(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(he(t,r.from())>=0&&he(e,r.to())<=0)return n}return-1}},_e.prototype={from:function(){return ve(this.anchor,this.head)},to:function(){return me(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var xt,yt={left:0,right:0,top:0,bottom:0};function Tt(e,t,n){for(var r,i,o,s,a=0;a<e.length;a+=3){var l=e[a],u=e[a+1];if(t<l?(i=0,o=1,s="left"):t<u?o=1+(i=t-l):(a==e.length-3||t==u&&e[a+3]>t)&&(i=(o=u-l)-1,t>=u&&(s="right")),null!=i){if(r=e[a+2],l==u&&n==(r.insertLeft?"left":"right")&&(s=n),"left"==n&&0==i)for(;a&&e[a-2]==e[a-3]&&e[a-1].insertLeft;)r=e[2+(a-=3)],s="left";if("right"==n&&i==u-l)for(;a<e.length-3&&e[a+3]==e[a+4]&&!e[a+5].insertLeft;)r=e[(a+=3)+2],s="right";break}}return{node:r,start:i,end:o,collapse:s,coverStart:l,coverEnd:u}}function Nt(e,t){var n=yt;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(r=e.length-1;r>=0&&(n=e[r]).left==n.right;r--);return n}function Ct(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function St(e){e.display.externalMeasure=null,Mo(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ct(e.display.view[t])}function It(e){St(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Lt(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function At(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function bt(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var o=Wr(t.widgets[i]);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var s=bi(t);if("local"==r?s+=lt(e.display):s-=e.display.viewOffset,"page"==r||"window"==r){var a=e.display.lineSpace.getBoundingClientRect();s+=a.top+("window"==r?0:At());var l=a.left+("window"==r?0:Lt());n.left+=l,n.right+=l}return n.top+=s,n.bottom+=s,n}function Rt(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Lt(),i-=At();else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:r-s.left,top:i-s.top}}function wt(e,t,n,r,i){return r||(r=Ni(e.doc,t.line)),bt(e,r,gt(e,r,t.ch,i),n)}function Ot(e,t,n,r,i,o){function s(t,s){var a=Et(e,i,t,s?"right":"left",o);return s?a.left=a.right:a.right=a.left,bt(e,r,a,n)}function a(e,t){var n=l[t],r=n.level%2;return e==es(n)&&t&&n.level<l[t-1].level?(e=ts(n=l[--t])-(n.level%2?0:1),r=!0):e==ts(n)&&t<l.length-1&&n.level<l[t+1].level&&(e=es(n=l[++t])-n.level%2,r=!1),r&&e==n.to&&e>n.from?s(e-1):s(e,r)}r=r||Ni(e.doc,t.line),i||(i=vt(e,r));var l=Ri(r),u=t.ch;if(!l)return s(u);var c=a(u,as(l,u));return null!=Qo&&(c.other=a(u,Qo)),c}function Mt(e,t){var n=0;t=Fe(e.doc,t),e.options.lineWrapping||(n=Ft(e.display)*t.ch);var r=Ni(e.doc,t.line),i=bi(r)+lt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function _t(e,t,n,r){var i=fe(e,t);return i.xRel=r,n&&(i.outside=!0),i}function Pt(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return _t(r.first,0,!0,-1);var i=Ai(r,n),o=r.first+r.size-1;if(i>o)return _t(r.first+r.size-1,Ni(r,o).text.length,!0,1);t<0&&(t=0);for(var s=Ni(r,i);;){var a=Dt(e,s,i,t,n),l=Gr(s),u=l&&l.find(0,!0);if(!l||!(a.ch>u.from.ch||a.ch==u.from.ch&&a.xRel>0))return a;i=Li(s=u.to.line)}}function Dt(e,t,n,r,i){var o=i-bi(t),s=!1,a=2*e.display.wrapper.clientWidth,l=vt(e,t);function u(r){var i=Ot(e,fe(n,r),"line",t,l);return s=!0,o>i.bottom?i.left-a:o<i.top?i.left+a:(s=!1,i.left)}var c=Ri(t),p=t.text.length,d=ns(t),f=rs(t),h=u(d),g=s,m=u(f),v=s;if(r>m)return _t(n,f,v,1);for(;;){if(c?f==d||f==us(t,d,1):f-d<=1){var E=r<h||r-h<=m-r?d:f,x=E==d?g:v,y=r-(E==d?h:m);if(v&&!c&&!/\s/.test(t.text.charAt(E))&&y>0&&E<t.text.length&&l.view.measure.heights.length>1){var T=Et(e,l,E,"right");o<=T.bottom&&o>=T.top&&Math.abs(r-T.right)<y&&(x=!1,E++,y=r-T.right)}for(;wo(t.text.charAt(E));)++E;return _t(n,E,x,y<-1?-1:y>1?1:0)}var N=Math.ceil(p/2),C=d+N;if(c){C=d;for(var S=0;S<N;++S)C=us(t,C,1)}var I=u(C);I>r?(f=C,m=I,(v=s)&&(m+=1e3),p=N):(d=C,h=I,g=s,p-=N)}}function kt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==xt){xt=Oo("pre");for(var t=0;t<49;++t)xt.appendChild(document.createTextNode("x")),xt.appendChild(Oo("br"));xt.appendChild(document.createTextNode("x"))}_o(e.measure,xt);var n=xt.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Mo(e.measure),n||1}function Ft(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Oo("span","xxxxxxxxxx"),n=Oo("pre",[t]);_o(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}var Gt,Ut,Bt=null,jt=0;function Vt(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:++jt},Bt?Bt.ops.push(e.curOp):e.curOp.ownsGroup=Bt={ops:[e.curOp],delayedCallbacks:[]}}function Ht(e){var t=e.curOp.ownsGroup;if(t)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(t)}finally{Bt=null;for(var n=0;n<t.ops.length;n++)t.ops[n].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)qt(t[n]);for(n=0;n<t.length;n++)zt(t[n]);for(n=0;n<t.length;n++)$t(t[n]);for(n=0;n<t.length;n++)Wt(t[n]);for(n=0;n<t.length;n++)Qt(t[n])}(t)}}function qt(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=pt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=pt(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&D(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Q(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function zt(e){e.updatedDisplay=e.mustUpdate&&Y(e.cm,e.update)}function $t(e){var t=e.cm,n=t.display;e.updatedDisplay&&J(t),e.barMeasure=F(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=gt(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+pt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-dt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function Wt(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&En(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==Do()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&j(t,e.barMeasure),e.updatedDisplay&&Z(t,e.barMeasure),e.selectionChanged&&it(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Ee(e.cm)}function Qt(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&X(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null==e.scrollTop||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),null==e.scrollLeft||n.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-n.scroller.clientWidth,e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,q(t)),e.scrollToPos){var i=function(e,t,n,r){null==r&&(r=0);for(var i=0;i<5;i++){var o=!1,s=Ot(e,t),a=n&&n!=t?Ot(e,n):s,l=zn(e,Math.min(s.left,a.left),Math.min(s.top,a.top)-r,Math.max(s.left,a.left),Math.max(s.bottom,a.bottom)+r),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=l.scrollTop&&(vn(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=l.scrollLeft&&(En(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return s}(t,Fe(r,e.scrollToPos.from),Fe(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&function(e,t){if(!to(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!f){var o=Oo("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-lt(e.display))+"px; height: "+(t.bottom-t.top+pt(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,i)}var o=e.maybeHiddenMarkers,s=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||Ki(o[a],"hide");if(s)for(a=0;a<s.length;++a)s[a].lines.length&&Ki(s[a],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ki(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Yt(e,t){if(e.curOp)return t();Vt(e);try{return t()}finally{Ht(e)}}function Xt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Vt(e);try{return t.apply(e,arguments)}finally{Ht(e)}}}function Kt(e){return function(){if(this.curOp)return e.apply(this,arguments);Vt(this);try{return e.apply(this,arguments)}finally{Ht(this)}}}function Zt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Vt(t);try{return e.apply(this,arguments)}finally{Ht(t)}}}function Jt(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=Gr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Li(mo(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Hr(e,t)}function en(e,t,n){for(var r,i=[],o=t;o<n;o=r){var s=new Jt(e.doc,Ni(e.doc,o),o);r=o+s.size,i.push(s)}return i}function tn(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)C&&jr(e.doc,t)<i.viewTo&&rn(e);else if(n<=i.viewFrom)C&&Vr(e.doc,n+r)>i.viewFrom?rn(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)rn(e);else if(t<=i.viewFrom)(o=sn(e,n,n+r,1))?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):rn(e);else if(n>=i.viewTo){var o;(o=sn(e,t,t,-1))?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):rn(e)}else{var s=sn(e,t,t,-1),a=sn(e,n,n+r,1);s&&a?(i.view=i.view.slice(0,s.index).concat(en(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=r):rn(e)}var l=i.externalMeasured;l&&(n<l.lineN?l.lineN+=r:t<l.lineN+l.size&&(i.externalMeasured=null))}function nn(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[on(e,t)];if(null!=o.node){var s=o.changes||(o.changes=[]);-1==Eo(s,n)&&s.push(n)}}}function rn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function on(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function sn(e,t,n,r){var i,o=on(e,t),s=e.display.view;if(!C||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var a=0,l=e.display.viewFrom;a<o;a++)l+=s[a].size;if(l!=t){if(r>0){if(o==s.length-1)return null;i=l+s[o].size-t,o++}else i=l-t;t+=i,n+=i}for(;jr(e.doc,n)!=n;){if(o==(r<0?0:s.length-1))return null;n+=r*s[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function an(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function ln(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function un(e,t){for(var n=zi(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function cn(e,t,n,r){var i=e.display;if(!n&&"true"==zi(t).getAttribute("cm-not-content"))return null;var o,s,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,s=t.clientY-a.top}catch(t){return null}var l,u=Pt(e,o,s);if(r&&1==u.xRel&&(l=Ni(e.doc,u.line).text).length==u.ch){var c=po(l,l.length,e.options.tabSize)-l.length;u=fe(u.line,Math.max(0,Math.round((o-ct(e.display).left)/Ft(e.display))-c))}return u}function pn(e){var t=this,n=t.display;if(!(to(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.shift=e.shiftKey,un(n,e))a||(n.scroller.draggable=!1,setTimeout((function(){n.scroller.draggable=!0}),100));else if(!fn(t,e)){var r=cn(t,e);switch(window.focus(),$i(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?function(e,t,n){o?setTimeout(Co(Ee,e),0):e.curOp.focus=Do();var r,i=+new Date;Ut&&Ut.time>i-400&&0==he(Ut.pos,n)?r="triple":Gt&&Gt.time>i-400&&0==he(Gt.pos,n)?(r="double",Ut={time:i,pos:n}):(r="single",Gt={time:i,pos:n});var l,u=e.doc.sel,c=m?t.metaKey:t.ctrlKey;e.options.dragDrop&&qo&&!e.isReadOnly()&&"single"==r&&(l=u.contains(n))>-1&&(he((l=u.ranges[l]).from(),n)<0||n.xRel>0)&&(he(l.to(),n)>0||n.xRel<0)?function(e,t,n,r){var i=e.display,l=+new Date,u=Xt(e,(function(c){a&&(i.scroller.draggable=!1),e.state.draggingText=!1,Xi(document,"mouseup",u),Xi(i.scroller,"drop",u),Math.abs(t.clientX-c.clientX)+Math.abs(t.clientY-c.clientY)<10&&(ji(c),!r&&+new Date-200<l&&je(e.doc,n),a||o&&9==s?setTimeout((function(){document.body.focus(),i.input.focus()}),20):i.input.focus())}));a&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=m?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),Wi(document,"mouseup",u),Wi(i.scroller,"drop",u)}(e,t,n,c):function(e,t,n,r,i){var o=e.display,s=e.doc;ji(t);var a,l,u=s.sel,c=u.ranges;if(i&&!t.shiftKey?(l=s.sel.contains(n),a=l>-1?c[l]:new _e(n,n)):(a=s.sel.primary(),l=s.sel.primIndex),v?t.shiftKey&&t.metaKey:t.altKey)r="rect",i||(a=new _e(n,n)),n=cn(e,t,!0,!0),l=-1;else if("double"==r){var p=e.findWordAt(n);a=e.display.shift||s.extend?Be(s,a,p.anchor,p.head):p}else if("triple"==r){var d=new _e(fe(n.line,0),Fe(s,fe(n.line+1,0)));a=e.display.shift||s.extend?Be(s,a,d.anchor,d.head):d}else a=Be(s,a,n);i?-1==l?(l=c.length,$e(s,Pe(c.concat([a]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"single"==r&&!t.shiftKey?($e(s,Pe(c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=s.sel):He(s,l,a,lo):(l=0,$e(s,new Me([a],0),lo),u=s.sel);var f=n,h=o.wrapper.getBoundingClientRect(),g=0;function m(t){var i=++g,c=cn(e,t,!0,"rect"==r);if(c)if(0!=he(c,f)){e.curOp.focus=Do(),function(t){if(0!=he(f,t))if(f=t,"rect"==r){for(var i=[],o=e.options.tabSize,c=po(Ni(s,n.line).text,n.ch,o),p=po(Ni(s,t.line).text,t.ch,o),d=Math.min(c,p),h=Math.max(c,p),g=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=m;g++){var v=Ni(s,g).text,E=fo(v,d,o);d==h?i.push(new _e(fe(g,E),fe(g,E))):v.length>E&&i.push(new _e(fe(g,E),fe(g,fo(v,h,o))))}i.length||i.push(new _e(n,n)),$e(s,Pe(u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=a,y=x.anchor,T=t;if("single"!=r){if("double"==r)var N=e.findWordAt(t);else N=new _e(fe(t.line,0),Fe(s,fe(t.line+1,0)));he(N.anchor,y)>0?(T=N.head,y=ve(x.from(),N.anchor)):(T=N.anchor,y=me(x.to(),N.head))}(i=u.ranges.slice(0))[l]=new _e(Fe(s,y),T),$e(s,Pe(i,l),lo)}}(c);var p=H(o,s);(c.line>=p.to||c.line<p.from)&&setTimeout(Xt(e,(function(){g==i&&m(t)})),150)}else{var d=t.clientY<h.top?-20:t.clientY>h.bottom?20:0;d&&setTimeout(Xt(e,(function(){g==i&&(o.scroller.scrollTop+=d,m(t))})),50)}}function E(t){e.state.selectingText=!1,g=1/0,ji(t),o.input.focus(),Xi(document,"mousemove",x),Xi(document,"mouseup",y),s.history.lastSelOrigin=null}var x=Xt(e,(function(e){$i(e)?m(e):E(e)})),y=Xt(e,E);e.state.selectingText=y,Wi(document,"mousemove",x),Wi(document,"mouseup",y)}(e,t,n,r,c)}(t,e,r):zi(e)==n.scroller&&ji(e);break;case 2:a&&(t.state.lastMiddleDown=+new Date),r&&je(t.doc,r),setTimeout((function(){n.input.focus()}),20),ji(e);break;case 3:T?_n(t,e):function(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Mn(e))}),100)}(t)}}}function dn(e,t,n,r){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&ji(t);var s=e.display,a=s.lineDiv.getBoundingClientRect();if(o>a.bottom||!ro(e,n))return Hi(t);o-=a.top-s.viewOffset;for(var l=0;l<e.options.gutters.length;++l){var u=s.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=i){var c=Ai(e.doc,o),p=e.options.gutters[l];return Ki(e,n,e,c,p,t),Hi(t)}}}function fn(e,t){return dn(e,t,"gutterClick",!0)}var hn=0;function gn(e){var t=this;if(mn(t),!to(t,e)&&!un(t.display,e)){ji(e),o&&(hn=+new Date);var n=cn(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,s=Array(i),a=0,l=function(e,r){if(!t.options.allowDropFileTypes||-1!=Eo(t.options.allowDropFileTypes,e.type)){var o=new FileReader;o.onload=Xt(t,(function(){var e=o.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),s[r]=e,++a==i){var l={from:n=Fe(t.doc,n),to:n,text:t.doc.splitLines(s.join(t.doc.lineSeparator())),origin:"paste"};Un(t.doc,l),ze(t.doc,De(n,Pn(l)))}})),o.readAsText(e)}},u=0;u<i;++u)l(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){t.display.input.focus()}),20);try{if(s=e.dataTransfer.getData("Text")){if(t.state.draggingText&&!t.state.draggingText.copy)var c=t.listSelections();if(We(t.doc,De(n,n)),c)for(u=0;u<c.length;++u)qn(t.doc,"",c[u].anchor,c[u].head,"drag");t.replaceSelection(s,"around","paste"),t.display.input.focus()}}catch(e){}}}}function mn(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function vn(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,n||K(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),n&&K(e),ot(e,100))}function En(e,t,n){(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,q(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}var xn=0,yn=null;o?yn=-.53:n?yn=15:u?yn=-.7:p&&(yn=-1/3);var Tn=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};function Nn(e,t){var r=Tn(t),i=r.x,o=r.y,s=e.display,l=s.scroller,u=l.scrollWidth>l.clientWidth,p=l.scrollHeight>l.clientHeight;if(i&&u||o&&p){if(o&&m&&a)e:for(var d=t.target,f=s.view;d!=l;d=d.parentNode)for(var h=0;h<f.length;h++)if(f[h].node==d){e.display.currentWheelTarget=d;break e}if(i&&!n&&!c&&null!=yn)return o&&p&&vn(e,Math.max(0,Math.min(l.scrollTop+o*yn,l.scrollHeight-l.clientHeight))),En(e,Math.max(0,Math.min(l.scrollLeft+i*yn,l.scrollWidth-l.clientWidth))),(!o||o&&p)&&ji(t),void(s.wheelStartX=null);if(o&&null!=yn){var g=o*yn,v=e.doc.scrollTop,E=v+s.wrapper.clientHeight;g<0?v=Math.max(0,v+g-50):E=Math.min(e.doc.height,E+g+50),K(e,{top:v,bottom:E})}xn<20&&(null==s.wheelStartX?(s.wheelStartX=l.scrollLeft,s.wheelStartY=l.scrollTop,s.wheelDX=i,s.wheelDY=o,setTimeout((function(){if(null!=s.wheelStartX){var e=l.scrollLeft-s.wheelStartX,t=l.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(yn=(yn*xn+n)/(xn+1),++xn)}}),200)):(s.wheelDX+=i,s.wheelDY+=o))}}function Cn(e,t,n){if("string"==typeof t&&!(t=pr[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=so}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}S.wheelEventPixels=function(e){var t=Tn(e);return t.x*=yn,t.y*=yn,t};var Sn=new co;function In(e,t,n,r){var i=e.state.keySeq;if(i){if(gr(t))return"handled";Sn.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),t=i+" "+t}var o=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=hr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&hr(t,e.options.extraKeys,n,e)||hr(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==o&&(e.state.keySeq=t),"handled"==o&&Ji(e,"keyHandled",e,t,n),"handled"!=o&&"multi"!=o||(ji(n),it(e)),i&&!o&&/\'$/.test(t)?(ji(n),!0):!!o}function Ln(e,t){var n=mr(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?In(e,"Shift-"+n,t,(function(t){return Cn(e,t,!0)}))||In(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Cn(e,t)})):In(e,n,t,(function(t){return Cn(e,t)})))}var An=null;function bn(e){var t=this;if(t.curOp.focus=Do(),!to(t,e)){o&&s<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=Ln(t,e);c&&(An=r?n:null,r||88!=n||Ko||!(m?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(Fo(t,"CodeMirror-crosshair"),Xi(document,"keyup",n),Xi(document,"mouseover",n))}Go(t,"CodeMirror-crosshair"),Wi(document,"keyup",n),Wi(document,"mouseover",n)}(t)}}function Rn(e){16==e.keyCode&&(this.doc.sel.shift=!1),to(this,e)}function wn(e){var t=this;if(!(un(t.display,e)||to(t,e)||e.ctrlKey&&!e.altKey||m&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(c&&n==An)return An=null,void ji(e);c&&(!e.which||e.which<10)&&Ln(t,e)||function(e,t,n){return In(e,"'"+n+"'",t,(function(t){return Cn(e,t,!0)}))}(t,e,String.fromCharCode(null==r?n:r))||t.display.input.onKeyPress(e)}}function On(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ki(e,"focus",e),e.state.focused=!0,Go(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),a&&setTimeout((function(){e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),it(e))}function Mn(e){e.state.delayingBlurEvent||(e.state.focused&&(Ki(e,"blur",e),e.state.focused=!1,Fo(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function _n(e,t){un(e.display,t)||function(e,t){return!!ro(e,"gutterContextMenu")&&dn(e,t,"gutterContextMenu",!1)}(e,t)||to(e,t,"contextmenu")||e.display.input.onContextMenu(t)}var Pn=S.changeEnd=function(e){return e.text?fe(e.from.line+e.text.length-1,mo(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};function Dn(e,t){if(he(e,t.from)<0)return e;if(he(e,t.to)<=0)return Pn(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+=Pn(t).ch-t.to.ch),fe(n,r)}function kn(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new _e(Dn(i.anchor,t),Dn(i.head,t)))}return Pe(n,e.sel.primIndex)}function Fn(e,t,n){return e.line==t.line?fe(n.line,e.ch-t.ch+n.ch):fe(n.line+(e.line-t.line),e.ch)}function Gn(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=Fe(e,t)),n&&(this.to=Fe(e,n)),r&&(this.text=r),void 0!==i&&(this.origin=i)}),Ki(e,"beforeChange",e,r),e.cm&&Ki(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Un(e,t,n){if(e.cm){if(!e.cm.curOp)return Xt(e.cm,Un)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(ro(e,"beforeChange")||e.cm&&ro(e.cm,"beforeChange"))||(t=Gn(e,t,!0))){var r=N&&!n&&function(e,t,n){var r=null;if(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&&-1!=Eo(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var s=r[o],a=s.find(0),l=0;l<i.length;++l){var u=i[l];if(!(he(u.to,a.from)<0||he(u.from,a.to)>0)){var c=[l,1],p=he(u.from,a.from),d=he(u.to,a.to);(p<0||!s.inclusiveLeft&&!p)&&c.push({from:u.from,to:a.from}),(d>0||!s.inclusiveRight&&!d)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),l+=c.length-1}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Bn(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else Bn(e,t)}}function Bn(e,t){if(1!=t.text.length||""!=t.text[0]||0!=he(t.from,t.to)){var n=kn(e,t);_i(e,t,n,e.cm?e.cm.curOp.id:NaN),Hn(e,t,n,br(e,t));var r=[];yi(e,(function(e,n){n||-1!=Eo(r,e.history)||(Bi(e.history,t),r.push(e.history)),Hn(e,t,null,br(e,t))}))}}function jn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits||n){for(var r,i=e.history,o=e.sel,s="undo"==t?i.done:i.undone,a="undo"==t?i.undone:i.done,l=0;l<s.length&&(r=s[l],n?!r.ranges||r.equals(e.sel):r.ranges);l++);if(l!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;(r=s.pop()).ranges;){if(Pi(r,a),n&&!r.equals(e.sel))return void $e(e,r,{clearRedo:!1});o=r}var u=[];Pi(o,a),a.push({changes:u,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;var c=ro(e,"beforeChange")||e.cm&&ro(e.cm,"beforeChange");for(l=r.changes.length-1;l>=0;--l){var p=r.changes[l];if(p.origin=t,c&&!Gn(e,p,!1))return void(s.length=0);u.push(Oi(e,p));var d=l?kn(e,p):mo(s);Hn(e,p,d,wr(e,p)),!l&&e.cm&&e.cm.scrollIntoView({from:p.from,to:Pn(p)});var f=[];yi(e,(function(e,t){t||-1!=Eo(f,e.history)||(Bi(e.history,p),f.push(e.history)),Hn(e,p,null,wr(e,p))}))}}}}function Vn(e,t){if(0!=t&&(e.first+=t,e.sel=new Me(xo(e.sel.ranges,(function(e){return new _e(fe(e.anchor.line+t,e.anchor.ch),fe(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){tn(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)nn(e.cm,r,"gutter")}}function Hn(e,t,n,r){if(e.cm&&!e.cm.curOp)return Xt(e.cm,Hn)(e,t,n,r);if(t.to.line<e.first)Vn(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Vn(e,i),t={from:fe(e.first,0),to:fe(t.to.line+i,t.to.ch),text:[mo(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:fe(o,Ni(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ci(e,t.from,t.to),n||(n=kn(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,s=t.to,a=!1,l=o.line;e.options.lineWrapping||(l=Li(Br(Ni(r,o.line))),r.iter(l,s.line+1,(function(e){if(e==i.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&no(e),fi(r,t,n,b(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=P(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,o.line),ot(e,400);var u=t.text.length-(s.line-o.line)-1;t.full?tn(e):o.line!=s.line||1!=t.text.length||di(e.doc,t)?tn(e,o.line,s.line+1,u):nn(e,o.line,"text");var c=ro(e,"changes"),p=ro(e,"change");if(p||c){var d={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};p&&Ji(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,r):fi(e,t,r),We(e,n,ao)}}function qn(e,t,n,r,i){if(r||(r=n),he(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Un(e,{from:n,to:r,text:t,origin:i})}function zn(e,t,n,r,i){var o=e.display,s=kt(e.display);n<0&&(n=0);var a=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,l=ft(e),u={};i-n>l&&(i=n+l);var c=e.doc.height+ut(o),p=n<s,d=i>c-s;if(n<a)u.scrollTop=p?0:n;else if(i>a+l){var f=Math.min(n,(d?c:i)-l);f!=a&&(u.scrollTop=f)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=dt(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),m=r-t>g;return m&&(r=t+g),t<10?u.scrollLeft=0:t<h?u.scrollLeft=Math.max(0,t-(m?0:10)):r>g+h-3&&(u.scrollLeft=r+(m?0:10)-g),u}function $n(e,t,n){null==t&&null==n||Qn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Wn(e){Qn(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?fe(t.line,t.ch-1):t,r=fe(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Qn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Mt(e,t.from),r=Mt(e,t.to),i=zn(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 Yn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=at(e,t):n="prev");var s=e.options.tabSize,a=Ni(o,t),l=po(a.text,null,s);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==n&&((u=o.mode.indent(i,a.text.slice(c.length),a.text))==so||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=t>o.first?po(Ni(o,t-1).text,null,s):0:"add"==n?u=l+e.options.indentUnit:"subtract"==n?u=l-e.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var p="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(u/s);f;--f)d+=s,p+="\t";if(d<u&&(p+=go(u-d)),p!=c)return qn(o,p,fe(t,0),fe(t,c.length),"+input"),a.stateAfter=null,!0;for(f=0;f<o.sel.ranges.length;f++){var h=o.sel.ranges[f];if(h.head.line==t&&h.head.ch<c.length){He(o,f,new _e(d=fe(t,c.length),d));break}}}function Xn(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Ni(e,ke(e,t)):i=Li(t),null==i?null:(r(o,i)&&e.cm&&nn(e.cm,i,n),o)}function Kn(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&he(o.from,mo(r).to)<=0;){var s=r.pop();if(he(s.from,o.from)<0){o.from=s.from;break}}r.push(o)}Yt(e,(function(){for(var t=r.length-1;t>=0;t--)qn(e.doc,"",r[t].from,r[t].to,"+delete");Wn(e)}))}function Zn(e,t,n,r,i){var o=t.line,s=t.ch,a=n,l=Ni(e,o);function u(t){var r,a=(i?us:cs)(l,s,n,!0);if(null==a){if(t||(r=o+n)<e.first||r>=e.first+e.size||(o=r,!(l=Ni(e,r))))return!1;s=i?(n<0?rs:ns)(l):n<0?l.text.length:0}else s=a;return!0}if("char"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var c=null,p="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||u(!f);f=!1){var h=l.text.charAt(s)||"\n",g=Lo(h,d)?"w":p&&"\n"==h?"n":!p||/\s/.test(h)?null:"p";if(!p||f||g||(g="s"),c&&c!=g){n<0&&(n=1,u());break}if(g&&(c=g),n>0&&!u(!f))break}var m=Ze(e,fe(o,s),t,a,!0);return he(t,m)||(m.hitSide=!0),m}function Jn(e,t,n,r){var i,o=e.doc,s=t.left;if("page"==r){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(a-(n<0?1.5:.5)*kt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var l=Pt(e,s,i);if(!l.outside)break;if(n<0?i<=0:i>=o.height){l.hitSide=!0;break}i+=5*n}return l}S.prototype={constructor:S,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,tr.hasOwnProperty(e)&&Xt(this,tr[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"](vr(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Kt((function(e,t){var n=e.token?e:S.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++,tn(this)})),removeOverlay:Kt((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void tn(this)}})),indentLine:Kt((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),Ge(this.doc,e)&&Yn(this,e,t,n)})),indentSelection:Kt((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Yn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Wn(this));else{var o=i.from(),s=i.to(),a=Math.max(n,o.line);n=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1;for(var l=a;l<n;++l)Yn(this,l,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[r].from().ch>0&&He(this.doc,r,new _e(o,u[r].to()),ao)}}})),getTokenAt:function(e,t){return Jr(this,e,t)},getLineTokens:function(e,t){return Jr(this,fe(e),t,!0)},getTokenTypeAt:function(e){e=Fe(this.doc,e);var t,n=ni(this,Ni(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var s=r+i>>1;if((s?n[2*s-1]:0)>=o)i=s;else{if(!(n[2*s+1]<o)){t=n[2*s+2];break}r=s+1}}var a=t?t.indexOf("cm-overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?S.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(!lr.hasOwnProperty(t))return n;var r=lr[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var s=r[i[t][o]];s&&n.push(s)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(o=0;o<r._global.length;o++){var a=r._global[o];a.pred(i,this)&&-1==Eo(n,a.val)&&n.push(a.val)}return n},getStateAfter:function(e,t){var n=this.doc;return at(this,(e=ke(n,null==e?n.first+n.size-1:e))+1,t)},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Ot(this,null==e?n.head:"object"==typeof e?Fe(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return wt(this,Fe(this.doc,e),t||"page")},coordsChar:function(e,t){return Pt(this,(e=Rt(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Rt(this,{top:e,left:0},t||"page").top,Ai(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n,r=!1;if("number"==typeof e){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,r=!0),n=Ni(this.doc,e)}else n=e;return bt(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-bi(n):0)},defaultTextHeight:function(){return kt(this.display)},defaultCharWidth:function(){return Ft(this.display)},setGutterMarker:Kt((function(e,t,n){return Xn(this.doc,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Ao(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:Kt((function(e){var t=this,n=t.doc,r=n.first;n.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,nn(t,r,"gutter"),Ao(n.gutterMarkers)&&(n.gutterMarkers=null)),++r}))})),lineInfo:function(e){if("number"==typeof e){if(!Ge(this.doc,e))return null;var t=e;if(!(e=Ni(this.doc,e)))return null}else if(null==(t=Li(e)))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 o,s,a,l,u,c,p=this.display,d=(e=Ot(this,Fe(this.doc,e))).bottom,f=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),p.sizer.appendChild(t),"over"==r)d=e.top;else if("above"==r||"near"==r){var h=Math.max(p.wrapper.clientHeight,this.doc.height),g=Math.max(p.sizer.clientWidth,p.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?d=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(d=e.bottom),f+t.offsetWidth>g&&(f=g-t.offsetWidth)}t.style.top=d+"px",t.style.left=t.style.right="","right"==i?(f=p.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?f=0:"middle"==i&&(f=(p.sizer.clientWidth-t.offsetWidth)/2),t.style.left=f+"px"),n&&(o=this,s=f,a=d,l=f+t.offsetWidth,u=d+t.offsetHeight,null!=(c=zn(o,s,a,l,u)).scrollTop&&vn(o,c.scrollTop),null!=c.scrollLeft&&En(o,c.scrollLeft))},triggerOnKeyDown:Kt(bn),triggerOnKeyPress:Kt(wn),triggerOnKeyUp:Rn,execCommand:function(e){if(pr.hasOwnProperty(e))return pr[e].call(null,this)},triggerElectric:Kt((function(e){Ne(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=0,s=Fe(this.doc,e);o<t&&!(s=Zn(this.doc,s,i,n,r)).hitSide;++o);return s},moveH:Kt((function(e,t){var n=this;n.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Zn(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),uo)})),deleteH:Kt((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Kn(this,(function(n){var i=Zn(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,o=r;t<0&&(i=-1,t=-t);for(var s=0,a=Fe(this.doc,e);s<t;++s){var l=Ot(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Jn(this,l,i,n)).hitSide)break}return a},moveV:Kt((function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(s){if(o)return e<0?s.from():s.to();var a=Ot(n,s.head,"div");null!=s.goalColumn&&(a.left=s.goalColumn),i.push(a.left);var l=Jn(n,a,e,t);return"page"==t&&s==r.sel.primary()&&$n(n,null,wt(n,l,"div").top-a.top),l}),uo),i.length)for(var s=0;s<r.sel.ranges.length;s++)r.sel.ranges[s].goalColumn=i[s]})),findWordAt:function(e){var t=Ni(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");(e.xRel<0||r==t.length)&&n?--n:++r;for(var o=t.charAt(n),s=Lo(o,i)?function(e){return Lo(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Lo(e)};n>0&&s(t.charAt(n-1));)--n;for(;r<t.length&&s(t.charAt(r));)++r}return new _e(fe(e.line,n),fe(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Go(this.display.cursorDiv,"CodeMirror-overwrite"):Fo(this.display.cursorDiv,"CodeMirror-overwrite"),Ki(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Do()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Kt((function(e,t){null==e&&null==t||Qn(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-pt(this)-this.display.barHeight,width:e.scrollWidth-pt(this)-this.display.barWidth,clientHeight:ft(this),clientWidth:dt(this)}},scrollIntoView:Kt((function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:fe(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)Qn(this),this.curOp.scrollToPos=e;else{var n=zn(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:Kt((function(e,t){var n=this;function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}null!=e&&(n.display.wrapper.style.width=r(e)),null!=t&&(n.display.wrapper.style.height=r(t)),n.options.lineWrapping&&St(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){nn(n,i,"widget");break}++i})),n.curOp.forceUpdate=!0,Ki(n,"refresh",this)})),operation:function(e){return Yt(this,e)},refresh:Kt((function(){var e=this.display.cachedTextHeight;tn(this),this.curOp.forceUpdate=!0,It(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),_(this),(null==e||Math.abs(e-kt(this.display))>.5)&&R(this),Ki(this,"refresh",this)})),swapDoc:Kt((function(e){var t=this.doc;return t.cm=null,Ti(this,e),It(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ji(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}},io(S);var er=S.defaults={},tr=S.optionHandlers={};function nr(e,t,n,r){S.defaults[e]=t,n&&(tr[e]=r?function(e,t,r){r!=rr&&n(e,t,r)}:n)}var rr=S.Init={toString:function(){return"CodeMirror.Init"}};nr("value","",(function(e,t){e.setValue(t)}),!0),nr("mode",null,(function(e,t){e.doc.modeOption=t,L(e)}),!0),nr("indentUnit",2,L,!0),nr("indentWithTabs",!1),nr("smartIndent",!0),nr("tabSize",4,(function(e){A(e),It(e),tn(e)}),!0),nr("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(fe(r,o))}r++}));for(var i=n.length-1;i>=0;i--)qn(e.doc,t,n[i],fe(n[i].line,n[i].ch+t.length))}})),nr("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=S.Init&&e.refresh()})),nr("specialCharPlaceholder",(function(e){var t=Oo("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}),(function(e){e.refresh()}),!0),nr("electricChars",!0),nr("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),nr("rtlMoveVisually",!E),nr("wholeLineUpdateBefore",!0),nr("theme","default",(function(e){w(e),O(e)}),!0),nr("keyMap","default",(function(e,t,n){var r=vr(t),i=n!=S.Init&&vr(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),nr("extraKeys",null),nr("lineWrapping",!1,(function(e){e.options.lineWrapping?(Go(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Fo(e.display.wrapper,"CodeMirror-wrap"),D(e)),R(e),tn(e),It(e),setTimeout((function(){j(e)}),100)}),!0),nr("gutters",[],(function(e){k(e.options),O(e)}),!0),nr("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?W(e.display)+"px":"0",e.refresh()}),!0),nr("coverGutterNextToScrollbar",!1,(function(e){j(e)}),!0),nr("scrollbarStyle","native",(function(e){B(e),j(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),nr("lineNumbers",!1,(function(e){k(e.options),O(e)}),!0),nr("firstLineNumber",1,O,!0),nr("lineNumberFormatter",(function(e){return e}),O,!0),nr("showCursorWhenSelecting",!1,et,!0),nr("resetSelectionOnContextMenu",!0),nr("lineWiseCopyCut",!0),nr("readOnly",!1,(function(e,t){"nocursor"==t?(Mn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)})),nr("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),nr("dragDrop",!0,(function(e,t,n){if(!t!=!(n&&n!=S.Init)){var r=e.display.dragFunctions,i=t?Wi:Xi;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}})),nr("allowDropFileTypes",null),nr("cursorBlinkRate",530),nr("cursorScrollMargin",0),nr("cursorHeight",1,et,!0),nr("singleCursorHeightPerLine",!0,et,!0),nr("workTime",100),nr("workDelay",100),nr("flattenSpans",!0,A,!0),nr("addModeClass",!1,A,!0),nr("pollInterval",100),nr("undoDepth",200,(function(e,t){e.doc.history.undoDepth=t})),nr("historyEventDelay",1250),nr("viewportMargin",10,(function(e){e.refresh()}),!0),nr("maxHighlightLength",1e4,A,!0),nr("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),nr("tabindex",null,(function(e,t){e.display.input.getField().tabIndex=t||""})),nr("autofocus",null);var ir=S.modes={},or=S.mimeModes={};S.defineMode=function(e,t){S.defaults.mode||"null"==e||(S.defaults.mode=e),arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ir[e]=t},S.defineMIME=function(e,t){or[e]=t},S.resolveMode=function(e){if("string"==typeof e&&or.hasOwnProperty(e))e=or[e];else if(e&&"string"==typeof e.name&&or.hasOwnProperty(e.name)){var t=or[e.name];"string"==typeof t&&(t={name:t}),(e=To(t,e)).name=t.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return S.resolveMode("application/xml");return"string"==typeof e?{name:e}:e||{name:"null"}},S.getMode=function(e,t){t=S.resolveMode(t);var n=ir[t.name];if(!n)return S.getMode(e,"text/plain");var r=n(e,t);if(sr.hasOwnProperty(t.name)){var i=sr[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r},S.defineMode("null",(function(){return{token:function(e){e.skipToEnd()}}})),S.defineMIME("text/plain","null");var sr=S.modeExtensions={};S.extendMode=function(e,t){No(t,sr.hasOwnProperty(e)?sr[e]:sr[e]={})},S.defineExtension=function(e,t){S.prototype[e]=t},S.defineDocExtension=function(e,t){vi.prototype[e]=t},S.defineOption=nr;var ar=[];S.defineInitHook=function(e){ar.push(e)};var lr=S.helpers={};S.registerHelper=function(e,t,n){lr.hasOwnProperty(e)||(lr[e]=S[e]={_global:[]}),lr[e][t]=n},S.registerGlobalHelper=function(e,t,n,r){S.registerHelper(e,t,r),lr[e]._global.push({pred:n,val:r})};var ur=S.copyState=function(e,t){if(!0===t)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},cr=S.startState=function(e,t,n){return!e.startState||e.startState(t,n)};S.innerMode=function(e,t){for(;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 pr=S.commands={selectAll:function(e){e.setSelection(fe(e.firstLine(),0),fe(e.lastLine()),ao)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ao)},killLine:function(e){Kn(e,(function(t){if(t.empty()){var n=Ni(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:fe(t.head.line+1,0)}:{from:t.head,to:fe(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){Kn(e,(function(t){return{from:fe(t.from().line,0),to:Fe(e.doc,fe(t.to().line+1,0))}}))},delLineLeft:function(e){Kn(e,(function(e){return{from:fe(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){Kn(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){Kn(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(fe(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(fe(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy((function(t){return is(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy((function(t){return os(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy((function(t){return function(e,t){for(var n,r=Ni(e.doc,t);n=Gr(r);)r=n.find(1,!0).line,t=null;var i=Ri(r),o=i?i[0].level%2?ns(r):rs(r):r.text.length;return fe(null==t?Li(r):t,o)}(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")}),uo)},goLineLeft:function(e){e.extendSelectionsBy((function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),uo)},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/)?os(e,t.head):r}),uo)},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("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),s=po(e.getLine(o.line),o.ch,r);t.push(go(r-s%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){Yt(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r].head,o=Ni(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new fe(i.line,i.ch-1)),i.ch>0)i=new fe(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),fe(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var s=Ni(e.doc,i.line-1).text;s&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),fe(i.line-1,s.length-1),fe(i.line,1),"+transpose")}n.push(new _e(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){Yt(e,(function(){for(var t=e.listSelections().length,n=0;n<t;n++){var r=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0)}Wn(e)}))},openLine:function(e){e.replaceSelection("\n","start")},toggleOverwrite:function(e){e.toggleOverwrite()}},dr=S.keyMap={};function fr(e){for(var t,n,r,i,o=e.split(/-(?!$)/),s=(e=o[o.length-1],0);s<o.length-1;s++){var a=o[s];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)$/i.test(a))throw new Error("Unrecognized modifier name: "+a);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}dr.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"},dr.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"},dr.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","Ctrl-O":"openLine"},dr.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"]},dr.default=m?dr.macDefault:dr.pcDefault,S.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}for(var i=xo(n.split(" "),fr),o=0;o<i.length;o++){var s,a;o==i.length-1?(a=i.join(" "),s=r):(a=i.slice(0,o+1).join(" "),s="...");var l=t[a];if(l){if(l!=s)throw new Error("Inconsistent bindings for "+a)}else t[a]=s}delete e[n]}for(var u in t)e[u]=t[u];return e};var hr=S.lookupKey=function(e,t,n,r){var i=(t=vr(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return hr(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var s=hr(e,t.fallthrough[o],n,r);if(s)return s}}},gr=S.isModifierKey=function(e){var t="string"==typeof e?e:Jo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},mr=S.keyName=function(e,t){if(c&&34==e.keyCode&&e.char)return!1;var n=Jo[e.keyCode],r=n;return null!=r&&!e.altGraphKey&&(e.altKey&&"Alt"!=n&&(r="Alt-"+r),(y?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(y?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r),!t&&e.shiftKey&&"Shift"!=n&&(r="Shift-"+r),r)};function vr(e){return"string"==typeof e?dr[e]:e}S.fromTextArea=function(e,t){if((t=t?No(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=Do();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=a.getValue()}if(e.form&&(Wi(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var i=e.form,o=i.submit;try{var s=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=s}}catch(e){}}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&&(Xi(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=o))}},e.style.display="none";var a=S((function(t){e.parentNode.insertBefore(t,e.nextSibling)}),t);return a};var Er=S.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Er.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},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("string"==typeof e)var n=t==e;else n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\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=po(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?po(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return po(this.string,null,this.tabSize)-(this.lineStart?po(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(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 xr=0,yr=S.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++xr};function Tr(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=No(r)).shared=!1;var o=[Tr(e,t,n,r,i)],s=o[0],a=r.widgetNode;return yi(e,(function(e){a&&(r.widgetNode=a.cloneNode(!0)),o.push(Tr(e,Fe(e,t),Fe(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;s=mo(o)})),new Nr(o,s)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return Xt(e.cm,Tr)(e,t,n,r,i);var o=new yr(e,i),s=he(t,n);if(r&&No(r,o,!1),s>0||0==s&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Oo("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ur(e,t.line,t,n,o)||t.line!=n.line&&Ur(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");C=!0}o.addToHistory&&_i(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var a,l=t.line,u=e.cm;if(e.iter(l,n.line+1,(function(e){u&&o.collapsed&&!u.options.lineWrapping&&Br(e)==u.display.maxLine&&(a=!0),o.collapsed&&l!=t.line&&Ii(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Ir(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Hr(e,t)&&Ii(t,0)})),o.clearOnEnter&&Wi(o,"beforeCursorEnter",(function(){o.clear()})),o.readOnly&&(N=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++xr,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)tn(u,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=n.line;c++)nn(u,c,"text");o.atomic&&Ye(u.doc),Ji(u,"markerAdded",u,o)}return o}io(yr),yr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Vt(e),ro(this,"clear")){var n=this.find();n&&Ji(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var s=this.lines[o],a=Lr(s.markedSpans,this);e&&!this.collapsed?nn(e,Li(s),"text"):e&&(null!=a.to&&(i=Li(s)),null!=a.from&&(r=Li(s))),s.markedSpans=Ar(s.markedSpans,a),null==a.from&&this.collapsed&&!Hr(this.doc,s)&&e&&Ii(s,kt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(o=0;o<this.lines.length;++o){var l=Br(this.lines[o]),u=P(l);u>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&tn(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ye(e.doc)),e&&Ji(e,"markerCleared",e,this),t&&Ht(e),this.parent&&this.parent.clear()}},yr.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],s=Lr(o.markedSpans,this);if(null!=s.from&&(n=fe(t?o:Li(o),s.from),-1==e))return n;if(null!=s.to&&(r=fe(t?o:Li(o),s.to),1==e))return r}return n&&{from:n,to:r}},yr.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&Yt(n,(function(){var r=e.line,i=Li(e.line),o=mt(n,i);if(o&&(Ct(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Hr(t.doc,r)&&null!=t.height){var s=t.height;t.height=null;var a=Wr(t)-s;a&&Ii(r,r.height+a)}}))},yr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Eo(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},yr.prototype.detachLine=function(e){if(this.lines.splice(Eo(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xr=0;var Nr=S.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Cr(e){return e.findMarks(fe(e.first,0),e.clipPos(fe(e.lastLine())),(function(e){return e.parent}))}function Sr(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];yi(n.primary.doc,(function(e){r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==Eo(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}}function Ir(e,t,n){this.marker=e,this.from=t,this.to=n}function Lr(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Ar(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function br(e,t){if(t.full)return null;var n=Ge(e,t.from.line)&&Ni(e,t.from.line).markedSpans,r=Ge(e,t.to.line)&&Ni(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,s=0==he(t.from,t.to),a=function(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],s=o.marker;if(null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==s.type&&(!n||!o.marker.insertLeft)){var a=null==o.to||(s.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Ir(s,o.from,a?null:o.to))}}return r}(n,i,s),l=function(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o=e[i],s=o.marker;if(null==o.to||(s.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==s.type&&(!n||o.marker.insertLeft)){var a=null==o.from||(s.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Ir(s,a?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,o,s),u=1==t.text.length,c=mo(t.text).length+(u?i:0);if(a)for(var p=0;p<a.length;++p)null==(d=a[p]).to&&((f=Lr(l,d.marker))?u&&(d.to=null==f.to?null:f.to+c):d.to=i);if(l)for(p=0;p<l.length;++p){var d,f;null!=(d=l[p]).to&&(d.to+=c),null==d.from?(f=Lr(a,d.marker))||(d.from=c,u&&(a||(a=[])).push(d)):(d.from+=c,u&&(a||(a=[])).push(d))}a&&(a=Rr(a)),l&&l!=a&&(l=Rr(l));var h=[a];if(!u){var g,m=t.text.length-2;if(m>0&&a)for(p=0;p<a.length;++p)null==a[p].to&&(g||(g=[])).push(new Ir(a[p].marker,null,null));for(p=0;p<m;++p)h.push(g);h.push(l)}return h}function Rr(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function wr(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(ki(n[r]));return i}(e,t),r=br(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],s=r[i];if(o&&s)e:for(var a=0;a<s.length;++a){for(var l=s[a],u=0;u<o.length;++u)if(o[u].marker==l.marker)continue e;o.push(l)}else s&&(n[i]=s)}return n}function Or(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Mr(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function _r(e){return e.inclusiveLeft?-1:0}function Pr(e){return e.inclusiveRight?1:0}function Dr(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=he(r.from,i.from)||_r(e)-_r(t);if(o)return-o;var s=he(r.to,i.to)||Pr(e)-Pr(t);return s||t.id-e.id}function kr(e,t){var n,r=C&&e.markedSpans;if(r)for(var i,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Dr(n,i.marker)<0)&&(n=i.marker);return n}function Fr(e){return kr(e,!0)}function Gr(e){return kr(e,!1)}function Ur(e,t,n,r,i){var o=Ni(e,t),s=C&&o.markedSpans;if(s)for(var a=0;a<s.length;++a){var l=s[a];if(l.marker.collapsed){var u=l.marker.find(0),c=he(u.from,n)||_r(l.marker)-_r(i),p=he(u.to,r)||Pr(l.marker)-Pr(i);if(!(c>=0&&p<=0||c<=0&&p>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?he(u.to,n)>=0:he(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?he(u.from,r)<=0:he(u.from,r)<0)))return!0}}}function Br(e){for(var t;t=Fr(e);)e=t.find(-1,!0).line;return e}function jr(e,t){var n=Ni(e,t),r=Br(n);return n==r?t:Li(r)}function Vr(e,t){if(t>e.lastLine())return t;var n,r=Ni(e,t);if(!Hr(e,r))return t;for(;n=Gr(r);)r=n.find(1,!0).line;return Li(r)+1}function Hr(e,t){var n=C&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&qr(e,t,r))return!0}}function qr(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return qr(e,r.line,Lr(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&qr(e,t,i))return!0}io(Nr),Nr.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ji(this,"clear")}},Nr.prototype.find=function(e,t){return this.primary.find(e,t)};var zr=S.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};function $r(e,t,n){bi(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&$n(e,null,n)}function Wr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Po(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;"),_o(t.display.measure,Oo("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}io(zr),zr.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Li(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Wr(this);Ii(n,Math.max(0,n.height-o)),e&&Yt(e,(function(){$r(e,n,-o),nn(e,r,"widget")}))}},zr.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=Wr(this)-e;r&&(Ii(n,n.height+r),t&&Yt(t,(function(){t.curOp.forceUpdate=!0,$r(t,n,r)})))};var Qr=S.Line=function(e,t,n){this.text=e,Mr(this,t),this.height=n?n(this):1};function Yr(e){e.parent=null,Or(e)}function Xr(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";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Kr(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=S.innerMode(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Zr(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=S.innerMode(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function Jr(e,t,n,r){function i(e){return{start:p.start,end:p.pos,string:p.current(),type:o||null,state:e?ur(s.mode,c):c}}var o,s=e.doc,a=s.mode;t=Fe(s,t);var l,u=Ni(s,t.line),c=at(e,t.line,n),p=new Er(u.text,e.options.tabSize);for(r&&(l=[]);(r||p.pos<t.ch)&&!p.eol();)p.start=p.pos,o=Zr(a,p,c),r&&l.push(i(!0));return r?l:i()}function ei(e,t,n,r,i,o,s){var a=n.flattenSpans;null==a&&(a=e.options.flattenSpans);var l,u=0,c=null,p=new Er(t,e.options.tabSize),d=e.options.addModeClass&&[null];for(""==t&&Xr(Kr(n,r),o);!p.eol();){if(p.pos>e.options.maxHighlightLength?(a=!1,s&&ri(e,t,r,p.pos),p.pos=t.length,l=null):l=Xr(Zr(n,p,r,d),o),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||c!=l){for(;u<p.start;)i(u=Math.min(p.start,u+5e4),c);c=l}p.start=p.pos}for(;u<p.pos;){var h=Math.min(p.pos,u+5e4);i(h,c),u=h}}function ti(e,t,n,r){var i=[e.state.modeGen],o={};ei(e,t.text,e.doc.mode,n,(function(e,t){i.push(e,t)}),o,r);for(var s=0;s<e.state.overlays.length;++s){var a=e.state.overlays[s],l=1,u=0;ei(e,t.text,a.mode,!0,(function(e,t){for(var n=l;u<e;){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r),l+=2,u=Math.min(e,r)}if(t)if(a.opaque)i.splice(n,l-n,e,"cm-overlay "+t),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}}),o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function ni(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=at(e,Li(t)),i=ti(e,t,t.text.length>e.options.maxHighlightLength?ur(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function ri(e,t,n,r){var i=e.doc.mode,o=new Er(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Kr(i,n);!o.eol();)Zr(i,o,n),o.start=o.pos}io(Qr),Qr.prototype.lineNo=function(){return Li(this)};var ii={},oi={};function si(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?oi:ii;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function ai(e,t){var n=Oo("span",null,null,a?"padding-right: .1px":null),r={pre:Oo("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(o||a)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var s,l=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=li,$o(e.display.measure)&&(s=Ri(l))&&(r.addToken=ui(r.addToken,s)),r.map=[],pi(l,r,ni(e,l,t!=e.display.externalMeasured&&Li(l))),l.styleClasses&&(l.styleClasses.bgClass&&(r.bgClass=Uo(l.styleClasses.bgClass,r.bgClass||"")),l.styleClasses.textClass&&(r.textClass=Uo(l.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(zo(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(a){var u=r.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ki(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Uo(r.pre.className,r.textClass||"")),r}function li(e,t,n,r,i,a,l){if(t){var u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(t,e.trailingSpace):t,c=e.cm.state.specialChars,p=!1;if(c.test(t)){E=document.createDocumentFragment();for(var d=0;;){c.lastIndex=d;var f=c.exec(t),h=f?f.index-d:t.length-d;if(h){var g=document.createTextNode(u.slice(d,d+h));o&&s<9?E.appendChild(Oo("span",[g])):E.appendChild(g),e.map.push(e.pos,e.pos+h,g),e.col+=h,e.pos+=h}if(!f)break;if(d+=h+1,"\t"==f[0]){var m=e.cm.options.tabSize,v=m-e.col%m;(g=E.appendChild(Oo("span",go(v),"cm-tab"))).setAttribute("role","presentation"),g.setAttribute("cm-text","\t"),e.col+=v}else"\r"==f[0]||"\n"==f[0]?((g=E.appendChild(Oo("span","\r"==f[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",f[0]),e.col+=1):((g=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),o&&s<9?E.appendChild(Oo("span",[g])):E.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}else{e.col+=t.length;var E=document.createTextNode(u);e.map.push(e.pos,e.pos+t.length,E),o&&s<9&&(p=!0),e.pos+=t.length}if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||p||l){var x=n||"";r&&(x+=r),i&&(x+=i);var y=Oo("span",[E],x,l);return a&&(y.title=a),e.content.appendChild(y)}e.content.appendChild(E)}}function ui(e,t){return function(n,r,i,o,s,a,l){i=i?i+" cm-force-border":"cm-force-border";for(var u=n.pos,c=u+r.length;;){for(var p=0;p<t.length;p++){var d=t[p];if(d.to>u&&d.from<=u)break}if(d.to>=c)return e(n,r,i,o,s,a,l);e(n,r.slice(0,d.to-u),i,o,null,a,l),o=null,r=r.slice(d.to-u),u=d.to}}}function ci(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,e.trailingSpace=!1}function pi(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var s,a,l,u,c,p,d,f=i.length,h=0,g=(I=1,""),m=0;;){if(m==h){l=u=c=p=a="",d=null,m=1/0;for(var v,E=[],x=0;x<r.length;++x){var y=r[x],T=y.marker;"bookmark"==T.type&&y.from==h&&T.widgetNode?E.push(T):y.from<=h&&(null==y.to||y.to>h||T.collapsed&&y.to==h&&y.from==h)?(null!=y.to&&y.to!=h&&m>y.to&&(m=y.to,u=""),T.className&&(l+=" "+T.className),T.css&&(a=(a?a+";":"")+T.css),T.startStyle&&y.from==h&&(c+=" "+T.startStyle),T.endStyle&&y.to==m&&(v||(v=[])).push(T.endStyle,y.to),T.title&&!p&&(p=T.title),T.collapsed&&(!d||Dr(d.marker,T)<0)&&(d=y)):y.from>h&&m>y.from&&(m=y.from)}if(v)for(x=0;x<v.length;x+=2)v[x+1]==m&&(u+=" "+v[x]);if(!d||d.from==h)for(x=0;x<E.length;++x)ci(t,0,E[x]);if(d&&(d.from||0)==h){if(ci(t,(null==d.to?f+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}}if(h>=f)break;for(var N=Math.min(f,m);;){if(g){var C=h+g.length;if(!d){var S=C>N?g.slice(0,N-h):g;t.addToken(t,S,s?s+l:l,c,h+S.length==m?u:"",p,a)}if(C>=N){g=g.slice(N-h),h=N;break}h=C,c=""}g=i.slice(o,o=n[I++]),s=si(n[I++],t.cm.options)}}else for(var I=1;I<n.length;I+=2)t.addToken(t,i.slice(o,o=n[I]),si(n[I+1],t.cm.options))}function di(e,t){return 0==t.from.ch&&0==t.to.ch&&""==mo(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function fi(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Or(e),Mr(e,n);var i=r?r(e):1;i!=e.height&&Ii(e,i)}(e,n,i,r),Ji(e,"change",e,t)}function s(e,t){for(var n=e,o=[];n<t;++n)o.push(new Qr(u[n],i(n),r));return o}var a=t.from,l=t.to,u=t.text,c=Ni(e,a.line),p=Ni(e,l.line),d=mo(u),f=i(u.length-1),h=l.line-a.line;if(t.full)e.insert(0,s(0,u.length)),e.remove(u.length,e.size-u.length);else if(di(e,t)){var g=s(0,u.length-1);o(p,p.text,f),h&&e.remove(a.line,h),g.length&&e.insert(a.line,g)}else c==p?1==u.length?o(c,c.text.slice(0,a.ch)+d+c.text.slice(l.ch),f):((g=s(1,u.length-1)).push(new Qr(d+c.text.slice(l.ch),f,r)),o(c,c.text.slice(0,a.ch)+u[0],i(0)),e.insert(a.line+1,g)):1==u.length?(o(c,c.text.slice(0,a.ch)+u[0]+p.text.slice(l.ch),i(0)),e.remove(a.line+1,h)):(o(c,c.text.slice(0,a.ch)+u[0],i(0)),o(p,d+p.text.slice(l.ch),f),g=s(1,u.length-1),h>1&&e.remove(a.line+1,h-1),e.insert(a.line+1,g));Ji(e,"change",e,t)}function hi(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 gi(e){this.children=e;for(var t=0,n=0,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}hi.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,Yr(i),Ji(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}},gi.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 o=Math.min(t,i-e),s=r.height;if(r.removeInner(e,o),this.height-=s-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof hi))){var a=[];this.collapse(a),this.children=[new hi(a)],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],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var s=i.lines.length%25+25,a=s;a<i.lines.length;){var l=new hi(i.lines.slice(a,a+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,s),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new gi(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=Eo(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new gi(e.children);r.parent=e,e.children=[r,t],e=r}t.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],o=i.chunkSize();if(e<o){var s=Math.min(t,o-e);if(i.iterN(e,s,n))return!0;if(0==(t-=s))break;e=0}else e-=o}}};var mi=0,vi=S.Doc=function(e,t,n,r){if(!(this instanceof vi))return new vi(e,t,n,r);null==n&&(n=0),gi.call(this,[new hi([new Qr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var i=fe(n,0);this.sel=De(i),this.history=new wi(null),this.id=++mi,this.modeOption=t,this.lineSep=r,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),fi(this,{from:i,to:i,text:e}),$e(this,De(i),ao)};vi.prototype=To(gi.prototype,{constructor:vi,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){for(var n=0,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=Si(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Zt((function(e){var t=fe(this.first,0),n=this.first+this.size-1;Un(this,{from:t,to:fe(n,Ni(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),$e(this,De(t))})),replaceRange:function(e,t,n,r){qn(this,e,t=Fe(this,t),n=n?Fe(this,n):t,r)},getRange:function(e,t,n){var r=Ci(this,Fe(this,e),Fe(this,t));return!1===n?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ge(this,e))return Ni(this,e)},getLineNumber:function(e){return Li(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ni(this,e)),Br(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Fe(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Zt((function(e,t,n){qe(this,Fe(this,"number"==typeof e?fe(e,t||0):e),null,n)})),setSelection:Zt((function(e,t,n){qe(this,Fe(this,e),Fe(this,t||e),n)})),extendSelection:Zt((function(e,t,n){je(this,Fe(this,e),t&&Fe(this,t),n)})),extendSelections:Zt((function(e,t){Ve(this,Ue(this,e),t)})),extendSelectionsBy:Zt((function(e,t){Ve(this,Ue(this,xo(this.sel.ranges,e)),t)})),setSelections:Zt((function(e,t,n){if(e.length){for(var r=0,i=[];r<e.length;r++)i[r]=new _e(Fe(this,e[r].anchor),Fe(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),$e(this,Pe(i,t),n)}})),addSelection:Zt((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new _e(Fe(this,e),Fe(this,t||e))),$e(this,Pe(r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=Ci(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Ci(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Zt((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var s=i.ranges[o];r[o]={from:s.from(),to:s.to(),text:this.splitLines(e[o]),origin:n}}var a=t&&"end"!=t&&function(e,t,n){for(var r=[],i=fe(e.first,0),o=i,s=0;s<t.length;s++){var a=t[s],l=Fn(a.from,i,o),u=Fn(Pn(a),i,o);if(i=a.to,o=u,"around"==n){var c=e.sel.ranges[s],p=he(c.head,c.anchor)<0;r[s]=new _e(p?u:l,p?l:u)}else r[s]=new _e(l,l)}return new Me(r,e.sel.primIndex)}(this,r,t);for(o=r.length-1;o>=0;o--)Un(this,r[o]);a?ze(this,a):this.cm&&Wn(this.cm)})),undo:Zt((function(){jn(this,"undo")})),redo:Zt((function(){jn(this,"redo")})),undoSelection:Zt((function(){jn(this,"undo",!0)})),redoSelection:Zt((function(){jn(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new wi(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:Fi(this.history.done),undone:Fi(this.history.undone)}},setHistory:function(e){var t=this.history=new wi(this.history.maxGeneration);t.done=Fi(e.done.slice(0),null,!0),t.undone=Fi(e.undone.slice(0),null,!0)},addLineClass:Zt((function(e,t,n){return Xn(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(ko(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:Zt((function(e,t,n){return Xn(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(ko(n));if(!o)return!1;var s=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&s!=i.length?" ":"")+i.slice(s)||null}return!0}))})),addLineWidget:Zt((function(e,t,n){return function(e,t,n,r){var i=new zr(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Xn(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Hr(e,t)){var r=bi(t)<e.scrollTop;Ii(t,t.height+Wr(i)),r&&$n(o,null,i.height),o.curOp.forceUpdate=!0}return!0})),i}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Tr(this,Fe(this,e),Fe(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Tr(this,e=Fe(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ni(this,(e=Fe(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Fe(this,e),t=Fe(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var s=o.markedSpans;if(s)for(var a=0;a<s.length;a++){var l=s[a];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.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)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),Fe(this,fe(n,t))},indexFromPos:function(e){var t=(e=Fe(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new vi(Si(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);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;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new vi(Si(this,t,n),e.mode||this.modeOption,t,this.lineSep);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}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),s=e.clipPos(i.to);if(he(o,s)){var a=Tr(e,o,s,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}(r,Cr(this)),r},unlinkDoc:function(e){if(e instanceof S&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Sr(Cr(this));break}if(e.history==this.history){var n=[e.id];yi(e,(function(e){n.push(e.id)}),!0),e.history=new wi(null),e.history.done=Fi(this.history.done,n),e.history.undone=Fi(this.history.undone,n)}},iterLinkedDocs:function(e){yi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Yo(e)},lineSeparator:function(){return this.lineSep||"\n"}}),vi.prototype.eachLine=vi.prototype.iter;var Ei="iter insert remove copy getEditor constructor".split(" ");for(var xi in vi.prototype)vi.prototype.hasOwnProperty(xi)&&Eo(Ei,xi)<0&&(S.prototype[xi]=function(e){return function(){return e.apply(this.doc,arguments)}}(vi.prototype[xi]));function yi(e,t,n){!function e(r,i,o){if(r.linked)for(var s=0;s<r.linked.length;++s){var a=r.linked[s];if(a.doc!=i){var l=o&&a.sharedHist;n&&!l||(t(a.doc,l),e(a.doc,r,l))}}}(e,null,!0)}function Ti(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,R(e),L(e),e.options.lineWrapping||D(e),e.options.mode=t.modeOption,tn(e)}function Ni(e,t){if((t-=e.first)<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],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Ci(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function Si(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Ii(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Li(e){if(null==e.parent)return null;for(var t=e.parent,n=Eo(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Ai(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(r=0;r<e.lines.length;++r){var s=e.lines[r].height;if(t<s)break;t-=s}return n+r}function bi(e){for(var t=0,n=(e=Br(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(r=0;r<o.children.length;++r){var s=o.children[r];if(s==n)break;t+=s.height}return t}function Ri(e){var t=e.order;return null==t&&(t=e.order=ps(e.text)),t}function wi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Oi(e,t){var n={from:ge(t.from),to:Pn(t),text:Ci(e,t.from,t.to)};return Di(e,n,t.from.line,t.to.line+1),yi(e,(function(e){Di(e,n,t.from.line,t.to.line+1)}),!0),n}function Mi(e){for(;e.length&&mo(e).ranges;)e.pop()}function _i(e,t,n,r){var i=e.history;i.undone.length=0;var o,s=+new Date;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=function(e,t){return t?(Mi(e.done),mo(e.done)):e.done.length&&!mo(e.done).ranges?mo(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),mo(e.done)):void 0}(i,i.lastOp==r))){var a=mo(o.changes);0==he(t.from,t.to)&&0==he(t.from,a.to)?a.to=Pn(t):o.changes.push(Oi(e,t))}else{var l=mo(i.done);for(l&&l.ranges||Pi(e.sel,i.done),o={changes:[Oi(e,t)],generation:i.generation},i.done.push(o);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,a||Ki(e,"historyAdded")}function Pi(e,t){var n=mo(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Di(e,t,n,r){var i=t["spans_"+e.id],o=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]={}))[o]=n.markedSpans),++o}))}function ki(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Fi(e,t,n){for(var r=0,i=[];r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?Me.prototype.deepCopy.call(o):o);else{var s=o.changes,a=[];i.push({changes:a});for(var l=0;l<s.length;++l){var u,c=s[l];if(a.push({from:c.from,to:c.to,text:c.text}),t)for(var p in c)(u=p.match(/^spans_(\d+)$/))&&Eo(t,Number(u[1]))>-1&&(mo(a)[p]=c[p],delete c[p])}}}return i}function Gi(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ui(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],s=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var a=0;a<o.ranges.length;a++)Gi(o.ranges[a].anchor,t,n,r),Gi(o.ranges[a].head,t,n,r)}else{for(a=0;a<o.changes.length;++a){var l=o.changes[a];if(n<l.from.line)l.from=fe(l.from.line+r,l.from.ch),l.to=fe(l.to.line+r,l.to.ch);else if(t<=l.to.line){s=!1;break}}s||(e.splice(0,i+1),i=0)}}}function Bi(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Ui(e.done,n,r,i),Ui(e.undone,n,r,i)}io(vi);var ji=S.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Vi=S.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0};function Hi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}var qi=S.e_stop=function(e){ji(e),Vi(e)};function zi(e){return e.target||e.srcElement}function $i(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),m&&e.ctrlKey&&1==t&&(t=3),t}var Wi=S.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={});(r[t]||(r[t]=[])).push(n)}},Qi=[];function Yi(e,t,n){var r=e._handlers&&e._handlers[t];return n?r&&r.length>0?r.slice():Qi:r||Qi}var Xi=S.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else for(var r=Yi(e,t,!1),i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}},Ki=S.signal=function(e,t){var n=Yi(e,t,!0);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},Zi=null;function Ji(e,t){var n=Yi(e,t,!1);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);Bt?r=Bt.delayedCallbacks:Zi?r=Zi:(r=Zi=[],setTimeout(eo,0));for(var o=0;o<n.length;++o)r.push(s(n[o]))}function s(e){return function(){e.apply(null,i)}}}function eo(){var e=Zi;Zi=null;for(var t=0;t<e.length;++t)e[t]()}function to(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ki(e,n||t.type,e,t),Hi(t)||t.codemirrorIgnore}function no(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==Eo(n,t[r])&&n.push(t[r])}function ro(e,t){return Yi(e,t).length>0}function io(e){e.prototype.on=function(e,t){Wi(this,e,t)},e.prototype.off=function(e,t){Xi(this,e,t)}}var oo=30,so=S.Pass={toString:function(){return"CodeMirror.Pass"}},ao={scroll:!1},lo={origin:"*mouse"},uo={origin:"+move"};function co(){this.id=null}co.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var po=S.countColumn=function(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,s=i||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return s+(t-o);s+=a-o,s+=n-s%n,o=a+1}},fo=S.findColumn=function(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var s=o-r;if(o==e.length||i+s>=t)return r+Math.min(s,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}},ho=[""];function go(e){for(;ho.length<=e;)ho.push(mo(ho)+" ");return ho[e]}function mo(e){return e[e.length-1]}var vo=function(e){e.select()};function Eo(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function xo(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function yo(){}function To(e,t){var n;return Object.create?n=Object.create(e):(yo.prototype=e,n=new yo),t&&No(t,n),n}function No(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function Co(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}h?vo=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(vo=function(e){try{e.select()}catch(e){}});var So=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Io=S.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||So.test(e))};function Lo(e,t){return t?!!(t.source.indexOf("\\w")>-1&&Io(e))||t.test(e):Io(e)}function Ao(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var bo,Ro=/[\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]/;function wo(e){return e.charCodeAt(0)>=768&&Ro.test(e)}function Oo(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Mo(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function _o(e,t){return Mo(e).appendChild(t)}bo=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Po=S.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)};function Do(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function ko(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}o&&s<11&&(Do=function(){try{return document.activeElement}catch(e){return document.body}});var Fo=S.rmClass=function(e,t){var n=e.className,r=ko(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:"")}},Go=S.addClass=function(e,t){var n=e.className;ko(t).test(n)||(e.className+=(n?" ":"")+t)};function Uo(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!ko(n[r]).test(t)&&(t+=" "+n[r]);return t}function Bo(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}var jo,Vo,Ho=!1,qo=function(){if(o&&s<9)return!1;var e=Oo("div");return"draggable"in e||"dragDrop"in e}();function zo(e){if(null==jo){var t=Oo("span","​");_o(e,Oo("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(jo=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&s<8))}var n=jo?Oo("span","​"):Oo("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function $o(e){if(null!=Vo)return Vo;var t=_o(e,document.createTextNode("AخA")),n=bo(t,0,1).getBoundingClientRect(),r=bo(t,1,2).getBoundingClientRect();return Mo(e),!(!n||n.left==n.right)&&(Vo=r.right-n.right<3)}var Wo,Qo,Yo=S.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),s=o.indexOf("\r");-1!=s?(n.push(o.slice(0,s)),t+=s+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Xo=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Ko="oncopy"in(Wo=Oo("div"))||(Wo.setAttribute("oncopy","return;"),"function"==typeof Wo.oncopy),Zo=null,Jo=S.keyNames={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",106:"*",107:"=",109:"-",110:".",111:"/",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"};function es(e){return e.level%2?e.to:e.from}function ts(e){return e.level%2?e.from:e.to}function ns(e){var t=Ri(e);return t?es(t[0]):0}function rs(e){var t=Ri(e);return t?ts(mo(t)):e.text.length}function is(e,t){var n=Ni(e.doc,t),r=Br(n);r!=n&&(t=Li(r));var i=Ri(r),o=i?i[0].level%2?rs(r):ns(r):0;return fe(t,o)}function os(e,t){var n=is(e,t.line),r=Ni(e.doc,n.line),i=Ri(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),s=t.line==n.line&&t.ch<=o&&t.ch;return fe(n.line,s?0:o)}return n}function ss(e,t,n){var r=e[0].level;return t==r||n!=r&&t<n}function as(e,t){Qo=null;for(var n,r=0;r<e.length;++r){var i=e[r];if(i.from<t&&i.to>t)return r;if(i.from==t||i.to==t){if(null!=n)return ss(e,i.level,e[n].level)?(i.from!=i.to&&(Qo=n),r):(i.from!=i.to&&(Qo=r),n);n=r}}return n}function ls(e,t,n,r){if(!r)return t+n;do{t+=n}while(t>0&&wo(e.text.charAt(t)));return t}function us(e,t,n,r){var i=Ri(e);if(!i)return cs(e,t,n,r);for(var o=as(i,t),s=i[o],a=ls(e,t,s.level%2?-n:n,r);;){if(a>s.from&&a<s.to)return a;if(a==s.from||a==s.to)return as(i,a)==o?a:n>0==(s=i[o+=n]).level%2?s.to:s.from;if(!(s=i[o+=n]))return null;a=n>0==s.level%2?ls(e,s.to,-1,r):ls(e,s.from,1,r)}}function cs(e,t,n,r){var i=t+n;if(r)for(;i>0&&wo(e.text.charAt(i));)i+=n;return i<0||i>e.text.length?null:i}!function(){for(var e=0;e<10;e++)Jo[e+48]=Jo[e+96]=String(e);for(e=65;e<=90;e++)Jo[e]=String.fromCharCode(e);for(e=1;e<=12;e++)Jo[e+111]=Jo[e+63235]="F"+e}();var ps=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(s){if(!e.test(s))return!1;for(var a,l=s.length,u=[],c=0;c<l;++c)u.push(m=(a=s.charCodeAt(c))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(a):1424<=a&&a<=1524?"R":1536<=a&&a<=1773?"rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm".charAt(a-1536):1774<=a&&a<=2220?"r":8192<=a&&a<=8203?"w":8204==a?"b":"L");c=0;for(var p="L";c<l;++c)"m"==(m=u[c])?u[c]=p:p=m;c=0;for(var d="L";c<l;++c)"1"==(m=u[c])&&"r"==d?u[c]="n":n.test(m)&&(d=m,"r"==m&&(u[c]="R"));for(c=1,p=u[0];c<l-1;++c)"+"==(m=u[c])&&"1"==p&&"1"==u[c+1]?u[c]="1":","!=m||p!=u[c+1]||"1"!=p&&"n"!=p||(u[c]=p),p=m;for(c=0;c<l;++c)if(","==(m=u[c]))u[c]="N";else if("%"==m){for(var f=c+1;f<l&&"%"==u[f];++f);for(var h=c&&"!"==u[c-1]||f<l&&"1"==u[f]?"1":"N",g=c;g<f;++g)u[g]=h;c=f-1}for(c=0,d="L";c<l;++c){var m=u[c];"L"==d&&"1"==m?u[c]="L":n.test(m)&&(d=m)}for(c=0;c<l;++c)if(t.test(u[c])){for(f=c+1;f<l&&t.test(u[f]);++f);var v="L"==(c?u[c-1]:"L"),E="L"==(f<l?u[f]:"L");for(h=v||E?"L":"R",g=c;g<f;++g)u[g]=h;c=f-1}var x,y=[];for(c=0;c<l;)if(r.test(u[c])){var T=c;for(++c;c<l&&r.test(u[c]);++c);y.push(new o(0,T,c))}else{var N=c,C=y.length;for(++c;c<l&&"L"!=u[c];++c);for(g=N;g<c;)if(i.test(u[g])){N<g&&y.splice(C,0,new o(1,N,g));var S=g;for(++g;g<c&&i.test(u[g]);++g);y.splice(C,0,new o(2,S,g)),N=g}else++g;N<c&&y.splice(C,0,new o(1,N,c))}return 1==y[0].level&&(x=s.match(/^\s+/))&&(y[0].from=x[0].length,y.unshift(new o(0,0,x[0].length))),1==mo(y).level&&(x=s.match(/\s+$/))&&(mo(y).to-=x[0].length,y.push(new o(0,l-x[0].length,l))),2==y[0].level&&y.unshift(new o(1,y[0].to,y[0].to)),y[0].level!=mo(y).level&&y.push(new o(y[0].level,l,l)),y}}();return S.version="5.17.0",S}))},{}],16:[function(e,t,n){
3
3
  /*!
4
4
  * jQuery JavaScript Library v2.2.4