@hpcc-js/eclwatch 3.5.2 → 3.5.3
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.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +12 -12
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/codemirror"),require("@hpcc-js/comms"),require("@hpcc-js/phosphor"),require("@hpcc-js/tree"),require("@hpcc-js/util"),require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/graph"),require("@hpcc-js/layout"),require("@hpcc-js/timeline")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/codemirror","@hpcc-js/comms","@hpcc-js/phosphor","@hpcc-js/tree","@hpcc-js/util","@hpcc-js/common","@hpcc-js/dgrid","@hpcc-js/graph","@hpcc-js/layout","@hpcc-js/timeline"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/eclwatch"]={},t["@hpcc-js/codemirror"],t["@hpcc-js/comms"],t["@hpcc-js/phosphor"],t["@hpcc-js/tree"],t["@hpcc-js/util"],t["@hpcc-js/common"],t["@hpcc-js/dgrid"],t["@hpcc-js/graph"],t["@hpcc-js/layout"],t["@hpcc-js/timeline"])}(this,function(t,e,i,n,o,s,a,r,l,h,c){"use strict";var u,p,d,f,y,_,x,m,g,b,v,w,S,k,A,C,M,T,P,I,E,F,D,z,R,O,j=Object.defineProperty,L=(t,e)=>j(t,"name",{value:e,configurable:!0});const N=class _ECLArchiveViewer extends n.SplitPanel{_prevHash;_contentStr;_directoryPane=new o.DirectoryTree;_fileEditorPane=(new e.Editor).text("");constructor(){super("horizontal"),this._directoryPane.rowClick=t=>{this._fileEditorPane.text(t).render()}}transformArchiveTreeData(t){const e={label:t.name,children:t._children.map(i).filter(t=>t)};return e.children&&e.children[0]&&"html"===e.children[0].label?{label:"root",children:[{label:"error",content:JSON.stringify(e,null,4)}]}:e;function i(t){const e={};if(e.label=t.name+(t.$&&t.$.key?` (${t.$.key})`:""),t._children&&t._children.length>0)e.children=t._children.map(t=>i(t)).filter(t=>t);else{if("string"!=typeof t.content||!t.content.trim())return!1;e.content=t.content}return e}}updateDirectoryPane(t){let e;if(t)try{e=JSON.parse(t)}catch(i){e=s.xml2json(t)}if(e){const t=this.transformArchiveTreeData(e);this._directoryPane.data(t).render()}}enter(t,e){super.enter(t,e),this.addWidget(this._directoryPane).addWidget(this._fileEditorPane)}update(t,e){super.update(t,e);const n=s.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==n||void 0===this._contentStr?i.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchArchive().then(t=>{this._contentStr=t,this.updateDirectoryPane(this._contentStr),this._prevHash=n}):this.updateDirectoryPane(this._contentStr),this.relativeSizes([this.directoryWidthRatio(),1-this.directoryWidthRatio()])}};L(N,"ECLArchiveViewer");let B=N;B.prototype._class+=" eclwatch_ECLArchiveViewer",B.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),B.prototype.publish("wuid","","string","Workunit ID"),B.prototype.publish("directoryWidthRatio",.38,"number","Default directory panel width ratio relative to the full width"),B.prototype.publish("contentString",null,"string","XML/JSON archive content string"),B.prototype.publishProxy("directoryPaneColor","_directoryPane","backgroundColor"),B.prototype.publishProxy("directoryPaneHoverColor","_directoryPane","hoverBackgroundColor"),B.prototype.publishProxy("iconSize","_directoryPane"),B.prototype.publishProxy("fontColor","_directoryPane"),B.prototype.publishProxy("fontFamily","_directoryPane"),B.prototype.publishProxy("fontSize","_directoryPane"),B.prototype.publishProxy("folderIconOpen","_directoryPane"),B.prototype.publishProxy("folderIconClosed","_directoryPane"),B.prototype.publishProxy("textFileIcon","_directoryPane"),B.prototype.publishProxy("codeFileIcon","_directoryPane"),B.prototype.publishProxy("verticalScroll","_directoryPane");const V=class _LegendVertex extends l.Vertex{constructor(){super()}enter(t,e){super.enter(t,e),this._icon.on("click",()=>{this.click(this.data())})}click(t){}};L(V,"LegendVertex");let H=V;const W=class _WUGraphLegend extends h.Legend{icon=a.local();_disabled2={};disabled(t){if(!arguments.length){const t=[];for(const e in this._disabled2)this._disabled2[e]&&t.push(e);return t}return this._disabled2={},t.forEach(t=>this._disabled2[t]=!0),this}toggle(t){this._disabled2[t]=!this._disabled2[t]}update(t,e){super.update(t,e);const i=this,n=this._g.selectAll(".legendItem").data(this.data(),t=>t.kind);n.enter().append("g").attr("class","legendItem").each(function(t){i.icon.set(this,(new H).target(this).data(t.kind).textbox_shape_colorStroke("none").textbox_shape_colorFill("none").iconAnchor("left").faChar(t.faChar).text(`${t.label} (${t.count})`).tooltip(`${t.kind} - ${t.label}`).on("click",t=>{i.toggle(t),i.render(),i.click(t)}).on("mouseover",t=>{i.mouseover(t)}).on("mouseout",t=>{i.mouseout(t)}))}).merge(n).each(function(t,e){const n=i.icon.get(this).icon_shape_colorFill(i._disabled2[t.kind]?"gray":null).render().getBBox();a.select(this).attr("transform",`translate(${+n.width/2}, ${30*e})`)}),n.exit().each(function(t){i.icon.get(this).target(null).render()}).remove();const o=this.getBBox(!0,!0);this._g.attr("transform",`translate(16, ${this.height()/2-o.height/2})`)}click(t){}mouseover(t){}mouseout(t){}};L(W,"WUGraphLegend");let $=W;function q(t){switch(t){case"2":case"44":case"47":case"56":case"61":case"35":case"37":return"";case"3":return"";case"5":return"";case"6":return"";case"12":return"";case"15":case"17":case"59":return"";case"22":return"";case"23":return"";case"25":case"133":case"148":return"";case"26":case"19":return"";case"29":case"16":return"";case"36":return"";case"54":return"";case"82":case"88":case"99":case"105":case"71":return"";case"92":case"93":return"";case"7":return"";case"9":return"";case"21":case"168":return""}return""}$.prototype._class+=" eclwatch_WUGraphLegend",L(q,"faCharFactory");const G=class _WUScopeController{graphDB;subgraphsMap={};rSubgraphsMap={};verticesMap={};rVerticesMap={};edgesMap={};rEdgesMap={};kindMap={};_disabled={};constructor(){}clear(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={}}set(t){this.graphDB=t,this.graphGui(this.graphDB),this.kindMap={},this.graphDB.walk(t=>{if(t instanceof s.Subgraph);else if(t instanceof s.Vertex){const e=t._.attr("Kind").RawValue;this.kindMap[e]||(this.kindMap[e]=[]),this.kindMap[e].push(t)}})}disabled(t){if(!arguments.length){const t=[];for(const e in this._disabled)this._disabled[e]&&t.push(e);return t}return this._disabled={},t.forEach(t=>this._disabled[t]=!0),this}graphGui(t){const e={subgraphs:[],vertices:[],edges:[],hierarchy:[]};return t.walk(t=>{if(t instanceof s.Subgraph){const i=this.appendSubgraph(t,e.hierarchy,e.subgraphs);i.showMinMax(t.vertices.length>3||"normal"!==i.minState())}else t instanceof s.Vertex?this.appendVertex(t,e.hierarchy,e.vertices):t instanceof s.Edge&&this.appendEdge(t,e.edges)}),e}format(t,e){let i="",n=t.indexOf("%"),o=-1;for(;n>=0;){if(i+=t.substring(o+1,n),o=t.indexOf("%",n+1),o<0){console.warn("Invalid Label Template");break}i+=t.substring(n+1,o)?e[t.substring(n+1,o)]||"":"%",n=t.indexOf("%",o+1)}return i+=t.substring(o+1,t.length),i.split("\\n").join("\n")}createSubgraph(t){let e=this.subgraphsMap[t._.Id];return e||(e=(new l.Subgraph).title(t._.Id).on("minClick",()=>{this.minClick(e)}),this.subgraphsMap[t._.Id]=e,this.rSubgraphsMap[e.id()]=t),e}createVertex(t){let e=this.verticesMap[t._.Id];if(!e){const i=t._.rawAttrs();if("dummy"===t._.ScopeType){const i=this.subgraphsMap[t.parent._.Id];e=(new a.Icon).shape_colorFill("darkred").shape_colorStroke("darkred").image_colorFill("white").faChar("").on("click",()=>{i.minState("normal"),this.minClick(i)})}else{e=(new l.Vertex).icon_shape_colorFill("#1f77b4").icon_image_colorFill("white").faChar(q(i.Kind)).text(i.Label);const n=[];t._.hasAttr("Definition")&&n.push({faChar:"",tooltip:"Definition",shape_colorFill:"lightgray",shape_colorStroke:"lightgray",image_colorFill:"black"}),t._.hasAttr("IsInternal")&&n.push({faChar:"",tooltip:"IsInternal",shape_colorFill:"red",shape_colorStroke:"red",image_colorFill:"white"}),e.annotationIcons(n)}this.verticesMap[t._.Id]=e,this.rVerticesMap[e.id()]=t}return e}isSpill(t){const e=t.source._.attr("Kind").RawValue,i=t.target._.attr("Kind").RawValue;return"2"===e||"71"===i}spansSubgraph(t){return t.source.parent._.Id!==t.target.parent._.Id}createEdge(t){let e=this.edgesMap[t._.Id];if(!e){const i=t._.rawAttrs(),n=this.verticesMap[t.source._.Id],o=this.verticesMap[t.target._.Id];if(n&&o){const s=this.isSpill(t),a=this.spansSubgraph(t),r=this.format("%Label%\n%NumRowsProcessed%",i);let h=null,c=100;i.IsDependency?(c=10,h="1,5"):i._childGraph?h="5,5":s?(c=25,h="5,5,10,5"):a&&(c=5,h="5,5"),e=(new l.Edge).sourceVertex(n).targetVertex(o).sourceMarker("circle").targetMarker("arrow").weight(c).strokeDasharray(h).text(r),this.edgesMap[t._.Id]=e,this.rEdgesMap[e.id()]=t}}return e}appendSubgraph(t,e,i){const n=this.createSubgraph(t);i.push(n);const o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:n}),n}appendVertex(t,e,i){const n=this.createVertex(t);i.push(n);const o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:n}),n}appendEdge(t,e){const i=this.createEdge(t);return i&&e.push(i),i}filterLegend(t){for(let e=t.vertices.length-1;e>=0;--e){const n=t.vertices[e],o=n._.attr("Kind").RawValue;this._disabled[o]&&n.remove(!1,(t,e)=>new i.BaseScope({ScopeName:n._.ScopeName+":in",Id:t.Id+"->"+e.Id,ScopeType:"dummy-edge",Properties:{Property:[n._.attr("Label")]},Notes:{Note:[]},SinkActivity:""}))}}filterPartial(t){for(const e of t.subgraphs){if("partial"===this.subgraphsMap[e._.Id].minState()){const t=e.vertices,n=[],o=[];for(const e of t)0===e.inEdges.length||e.inEdges.some(t=>t.source.parent!==t.target.parent)||0===e.outEdges.length||e.outEdges.some(t=>t.source.parent!==t.target.parent)?n.push(e):o.push(e);if(o.length>1){const t={ScopeName:e._.ScopeName,Id:e._.Id+":dummy",ScopeType:"dummy",Properties:{Property:[{Name:"Activities",RawValue:""+o.length,Formatted:""+o.length,Measure:"count",Creator:"",CreatorType:""}]},Notes:{Note:[]},SinkActivity:""},s=new i.BaseScope(t),a=e.createVertex(s);for(const r of o){for(const t of r.inEdges)if(n.indexOf(t.source)>=0){const n=new i.BaseScope({ScopeName:t.source._.ScopeName,Id:t.source._.Id+"->"+a._.Id,ScopeType:"dummy-in",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});e.createEdge(t.source,a,n)}for(const t of r.outEdges)if(n.indexOf(t.target)>=0){const n=new i.BaseScope({ScopeName:t.target._.ScopeName,Id:a._.Id+"->"+t.target._.Id,ScopeType:"dummy-out",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});e.createEdge(a,t.target,n)}}o.forEach(t=>t.remove(!0))}}}}filterEmptySubgraphs(t){for(;;){const e=t.subgraphs.filter(t=>0===t.subgraphs.length&&0===t.vertices.length);if(0===e.length)break;e.forEach(t=>t.remove(!0))}}removeObsoleteSubgraphs(t){for(const e of[...t.subgraphs])0===e.vertices.length&&e.remove(!1)}graphData(){const t=this.graphDB.clone();return this.filterLegend(t),this.filterPartial(t),this.filterEmptySubgraphs(t),this.removeObsoleteSubgraphs(t),this.graphGui(t)}calcLegend(){const t=[];for(const e in this.kindMap)t.push({kind:parseInt(e),faChar:q(e),label:this.kindMap[e][0]._.attr("Label").RawValue.split("\n")[0],count:this.kindMap[e].length});return t}vertices(t){const e=[];for(const i of this.kindMap[t])e.push(this.verticesMap[i._.Id]);return e}formatRow(t,e,i){const n=t._.formattedAttrs();for(const o in n){const t=e.indexOf(o);-1===t?(e.push(o),i.push(n[o])):i[t]=n[o]}for(let o=0;o<100;++o)void 0===i[o]&&(i[o]="");return i}activityData(){const t=["Id","Kind","Label"],e=this.graphDB.vertices.map(e=>{const i=[parseInt(e._.Id.split("a")[1])];return this.formatRow(e,t,i)});return{columns:t,data:e}}edgeData(){const t=["Id","Label"],e=this.graphDB.edges.map(e=>{const i=[e._.Id];return this.formatRow(e,t,i)});return{columns:t,data:e}}subgraphData(){const t=["Id","Label"],e=this.graphDB.subgraphs.map(e=>{const i=[e._.Id];return this.formatRow(e,t,i)});return{columns:t,data:e}}calcGraphTooltip(t){let e,i;if(t instanceof l.Subgraph){const n=this.rSubgraphsMap[t.id()];e=n._,i=n.parent._}else if(t instanceof l.Vertex||t instanceof a.Icon){const n=this.rVerticesMap[t.id()];e=n._,i=n.parent._}else if(t instanceof l.Edge){const n=this.rEdgesMap[t.id()];e=n._,i=n.parent._}return e?e.calcTooltip(i):""}subgraph(t){return this.subgraphsMap[t]}vertex(t){return this.verticesMap[t]}edge(t){return this.edgesMap[t]}minClick(t){}};L(G,"WUScopeController");let U=G;const X=class _WUGraph extends h.ChartPanel{_partialAll=(new a.Button).faChar("fa-window-restore").tooltip("Partial All").on("click",()=>{this.stateClick(this._partialAll)});_maxAll=(new a.Button).faChar("fa-window-maximize").tooltip("Max All").on("click",()=>{this.stateClick(this._maxAll)});_toggleGraph=(new a.ToggleButton).faChar("fa-chain").tooltip("Graph").selected(!0).on("click",()=>{this.viewClick(this._toggleGraph)});_toggleActivities=(new a.ToggleButton).faChar("fa-table").tooltip("Activitiies").selected(!1).on("click",()=>{this.viewClick(this._toggleActivities)});_toggleEdges=(new a.ToggleButton).faChar("fa-table").tooltip("Edges").selected(!1).on("click",()=>{this.viewClick(this._toggleEdges)});_toggleSubgraphs=(new a.ToggleButton).faChar("fa-table").tooltip("Subgraphs").selected(!1).on("click",()=>{this.viewClick(this._toggleSubgraphs)});_graph=(new l.Graph).layout("Hierarchy").applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1);_activities=(new r.Table).pagination(!1);_edges=(new r.Table).pagination(!1);_subgraphs=(new r.Table).pagination(!1);_legend=new $(this).on("click",t=>{this.render()}).on("mouseover",t=>{const e={};for(const i of this._gc.vertices(t))e[i.id()]=!0;this._graph.highlightVerticies(e)}).on("mouseout",t=>{this._graph.highlightVerticies()});_view=(new h.Carousel).widgets([this._graph,this._activities,this._edges,this._subgraphs]);_gc=new U;constructor(){super(),this.topOverlay(!1),this.widget(this._view);const t=[this._toggleGraph,this._toggleActivities,this._toggleEdges,this._toggleSubgraphs,new a.Spacer,this._partialAll,this._maxAll,new a.Spacer,...this._graph.iconBarButtons(),new a.Spacer];this.buttons(t.concat(this.buttons())),this._gc.minClick=t=>{this.loadGraph(),this._graph.render(e=>{this._graph.selection([t]).centerOnItem(t)})},this._graph.tooltipHTML(t=>this._gc.calcGraphTooltip(t))}stateClick(t){switch(t){case this._partialAll:this._graph.data().subgraphs.forEach(t=>{t.minState("partial")});break;case this._maxAll:this._graph.data().subgraphs.forEach(t=>{t.minState("normal")})}this.render()}viewClick(t){switch(this._toggleGraph.selected(t===this._toggleGraph),this._toggleActivities.selected(t===this._toggleActivities),this._toggleEdges.selected(t===this._toggleEdges),this._toggleSubgraphs.selected(t===this._toggleSubgraphs),t){case this._toggleGraph:this._view.active(0);break;case this._toggleActivities:this._view.active(1);break;case this._toggleEdges:this._view.active(2);break;case this._toggleSubgraphs:this._view.active(3)}this.render(t=>{})}_prevHashSum;_prevScopeGraph;fetchScopeGraph(){const t=s.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),graphID:this.graphID(),subgraphID:this.subgraphID()});if(!this._prevScopeGraph||this._prevHashSum!==t){this.startProgress(),this._prevHashSum=t,this._gc.clear();return i.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchGraphs().then(t=>{for(const e of t)if(e.Name===this.graphID())return this.finishProgress(),e.fetchScopeGraph(this.subgraphID())}).then(t=>(this._prevScopeGraph=t,this._prevScopeGraph))}return Promise.resolve(this._prevScopeGraph)}enter(t,e){super.enter(t,e)}update(t,e){super.update(t,e)}exit(t,e){super.exit(t,e)}loadGraph(){this._gc.disabled(this._legend.disabled()),this._graph.data(this._gc.graphData(),!0);{const{columns:t,data:e}=this._gc.activityData();this._activities.columns(t).data(e)}{const{columns:t,data:e}=this._gc.edgeData();this._edges.columns(t).data(e)}{const{columns:t,data:e}=this._gc.subgraphData();this._subgraphs.columns(t).data(e)}}render(t){return this.wuid()&&this.graphID()?this.fetchScopeGraph().then(e=>{this._gc.set(e),this._legend.data(this._gc.calcLegend()),this.loadGraph(),super.render(t)}):super.render(t),this}selection(t){if(!arguments.length)return this._graph.selection();const e=this._gc.vertex(t)||this._gc.edge(t)||this._gc.subgraph(t);return e&&this._graph.selection([e]),this}};L(X,"WUGraph");let Y=X;function Q(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Z(t){switch(Object.prototype.toString.call(t)){case"[object Undefined]":case"[object Boolean]":case"[object Number]":return t;case"[object String]":return Q(t);default:console.warn("Unknown cell type: "+Object.prototype.toString.call(t))}return t}Y.prototype._class+=" eclwatch_WUGraph",Y.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),Y.prototype.publish("wuid","","string","Workunit ID"),Y.prototype.publish("graphID","","string","Graph ID"),Y.prototype.publish("subgraphID","","string","Subgraph ID"),L(Q,"entitiesEncode"),L(Z,"safeEncode");const J=class _Store{wuResult;schema;_columns;_cache={};rowFormatter;_filter={};onError;constructor(t,e,i,n={},o){this.wuResult=t,this.schema=e,this._columns=this.schema2Columns(this.schema.root),this.rowFormatter=new r.RowFormatter(this._columns,i),this._filter=n,this.onError=o}columns(){return this._columns}schema2Columns(t,e=""){return t?t.children().filter(t=>-1===t.name.indexOf("__hidden",t.name.length-8)).map((t,i)=>{const n=t.name,o=t.attrs["hpcc:keyed"],s={field:e+n,leafID:n,idx:i,label:n+(o?" (i)":""),className:"resultGridCell",sortable:!1,width:o?16:0,isSet:t.isSet},a=this.schema2Columns(t,e+n+"_");return a.length?(s.width+=10+a.reduce((t,e)=>t+e.width,0),s.children=a):(s.width+=9*t.charWidth(),s.formatter=(t,e)=>{switch(typeof t){case"string":return{html:t.replace(/\t/g," ").trim()};case"undefined":return""}return t}),s}):[]}isChildDataset(t){if("[object Object]"!==Object.prototype.toString.call(t))return!1;let e=0,i=null;for(const n in t)i||(i=Object.prototype.toString.call(t[n])),e++;return 1===e&&"[object Array]"===i}rowToTable(t,e,i){if(this.isChildDataset(t)){for(const n in t)this.rowToTable(t[n],e,i);return}const n=r.domConstruct.create("table",{border:1,cellspacing:0,width:"100%"},i);switch(Object.prototype.toString.call(t)){case"[object Object]":let o=r.domConstruct.create("tr",null,n);for(const e in t)r.domConstruct.create("th",{innerHTML:Z(e)},o);o=r.domConstruct.create("tr",null,n);for(const n in t)switch(Object.prototype.toString.call(t[n])){case"[object Object]":case"[object Array]":this.rowToTable(t[n],e,i);break;default:r.domConstruct.create("td",{innerHTML:Z(t[n])},o)}break;case"[object Array]":for(let e=0;e<t.length;++e)switch(Object.prototype.toString.call(t[e])){case"[object Boolean]":case"[object Number]":case"[object String]":const i=r.domConstruct.create("tr",null,n);r.domConstruct.create("td",{innerHTML:Z(t[e])},i);break;default:if(0===e){const i=r.domConstruct.create("tr",null,n);for(const n in t[e])r.domConstruct.create("th",{innerHTML:Z(n)},i)}r.domConstruct.create("tr",null,n);for(const n in t[e])if(t[e][n])if("[object Object]"===Object.prototype.toString.call(t[e][n])||"[object Array]"===Object.prototype.toString.call(t[e][n])){const o=r.domConstruct.create("td",null,i);this.rowToTable(t[e][n],t[e],o)}else if(-1!==n.indexOf("__html",n.length-6))r.domConstruct.create("td",{innerHTML:t[e][n]},i);else if(-1!==n.indexOf("__javascript",n.length-12))r.domConstruct.create("td",null,i);else{const o=t[e][n];r.domConstruct.create("td",{innerHTML:Z(o)},i)}else r.domConstruct.create("td",{innerHTML:""},i)}}}getIdentity(t){return t.__hpcc_id}_request(t,e){if(!this.wuResult)return Promise.resolve({totalLength:0,data:[]});const i=`${t}->${e}`;if(this._cache[i])return this._cache[i];const n=this.wuResult.fetchRows(t,e-t,!1,this._filter).then(e=>({totalLength:this.wuResult.Total,data:e.map((e,i)=>{const n=this.rowFormatter.format(e);return n.__hpcc_id=t+i,n.__hpcc_orig=e,n})})).catch(t=>(this.onError(t.Message||"An exception has occurred"),{totalLength:0,data:[]}));return this._cache[i]=n,n}fetchRange(t){const e=new r.Deferred;return this._request(t.start,t.end).then(t=>e.resolve(t)),new r.QueryResults(e.then(t=>t.data),{totalLength:e.then(t=>t.totalLength)})}};L(J,"Store");let K=J;const tt=class _WUResult extends r.Common{_result;_localStore;constructor(){super(),this.renderHtml(!1)}hashSum(t={}){return s.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),resultName:this.resultName(),sequence:this.sequence(),nodeGroup:this.nodeGroup(),logicalFile:this.logicalFile(),userID:this.user(),password:this.password(),bypassCache:this.bypassCache(),...t})}_prevResultHash;calcResult(){const t=this.hashSum();if(this._prevResultHash!==t){this._prevResultHash=t;const e={baseUrl:this.baseUrl(),userID:this.user(),password:this.password()};this.wuid()&&this.resultName()?this._result=i.Result.attach(e,this.wuid(),this.resultName()):this.wuid()&&void 0!==this.sequence()?this._result=i.Result.attach(e,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=i.Result.attachLogicalFile(e,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=i.Result.attachLogicalFile(e,"",this.logicalFile())),this._result&&this.bypassCache()&&this._result.bypassCache(this.bypassCache())}return this._result}fetch(t,e,i=new AbortController){const n=this.calcResult();return n?n.fetchRows(t,e,!1,{},i.signal):Promise.resolve([])}_prevStoreHash;_prevQueryHash;update(t,e){super.update(t,e);const i=this.hashSum({renderHtml:this.renderHtml(),filter:this.filter()});if(this._prevStoreHash!==i){this._prevStoreHash=i;const t=this.calcResult();t&&t.fetchXMLSchema().then(e=>{this._localStore=new K(t,e,this.renderHtml(),this.filter(),t=>{this._dgrid&&(this._dgrid.noDataMessage=`<span class='dojoxGridNoData'>${t}</span>`,this._dgrid.refresh())}),this._dgrid?.set("columns",this._localStore.columns()),this._dgrid?.set("collection",this._localStore)})}}click(t,e,i){}};L(tt,"WUResult");let et=tt;et.prototype._class+=" eclwatch_WUResult",et.prototype.publish("baseUrl","","string","URL to WsWorkunits"),et.prototype.publish("user","","string","User ID"),et.prototype.publish("password","","string","Password"),et.prototype.publish("wuid","","string","Workunit ID"),et.prototype.publish("resultName","","string","Result Name"),et.prototype.publish("sequence",void 0,"number","Sequence Number"),et.prototype.publish("nodeGroup","","string","NodeGroup"),et.prototype.publish("logicalFile","","string","Logical File Name"),et.prototype.publish("filter",{},"object","Filter"),et.prototype.publish("bypassCache",!1,"boolean","Bypass cached results");var it=(t=>(t.CREATE="Created",t.COMPILE="Compiled",t.EXECUTE="Executed",t.COMPLETE="Completed",t))(it||{}),nt=(t=>(t.CREATE="Creating",t.COMPILE="Compiling",t.EXECUTE="Executing",t.COMPLETE="Completed",t))(nt||{});const ot=class _WUStatus extends l.Graph{_wu;_wuHandle;_create;_compile;_execute;_complete;constructor(){super(),this.zoomable(!1).zoomToFitLimit(1).layout("Hierarchy").hierarchyRankDirection("LR").showToolbar(!1).allowDragging(!1)}_prevHash;attachWorkunit(){const t=s.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==t&&(this._prevHash=t,this._wu=i.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch(t=>{this.lazyRender()}))}createVertex(t){return(new l.Vertex).icon_diameter(32).icon_shape_colorFill("none").icon_shape_colorStroke("none").icon_image_colorFill("darkgray").iconAnchor("middle").textbox_shape_colorFill("none").textbox_shape_colorStroke("none").textbox_text_colorFill("darkgray").faChar(t)}updateVertex(t,e){t.icon_image_colorFill(e).textbox_text_colorFill(e)}updateVertexStatus(t,e=!1){const i=this._wu.isFailed()?"darkred":"darkgreen";switch(this._create.text("Created"),this._compile.text("Compiled"),this._execute.text("Executed"),this._complete.text("Completed"),t){case 0:this.updateVertex(this._create,"darkgray"),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 1:this._create.text("Creating"),this.updateVertex(this._create,e?"orange":i),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 2:this._compile.text("Compiling"),this.updateVertex(this._create,i),this.updateVertex(this._compile,e?"orange":i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,"darkgray");break;case 3:this._execute.text("Executing"),this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,e?"orange":i),this.updateVertex(this._complete,"darkgray");break;case 4:this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,i)}}createEdge(t,e){return(new l.Edge).sourceVertex(t).targetVertex(e).strokeColor("black").showArc(!1)}enter(t,e){super.enter(t,e),this._create=this.createVertex(""),this._compile=this.createVertex(""),this._execute=this.createVertex(""),this._complete=this.createVertex("");const i=this.createEdge(this._create,this._compile),n=this.createEdge(this._compile,this._execute),o=this.createEdge(this._execute,this._complete);this.data({vertices:[this._create,this._compile,this._execute,this._complete],edges:[i,n,o]})}update(t,e){switch(this.attachWorkunit(),this._wu.StateID){case i.WUStateID.Blocked:case i.WUStateID.Wait:case i.WUStateID.Scheduled:case i.WUStateID.UploadingFiled:this.updateVertexStatus(1);break;case i.WUStateID.Compiling:this.updateVertexStatus(2,!0);break;case i.WUStateID.Submitted:this.updateVertexStatus(1,!0);break;case i.WUStateID.Compiled:this.updateVertexStatus(2);break;case i.WUStateID.Aborting:case i.WUStateID.Running:this.updateVertexStatus(3,!0);break;case i.WUStateID.Aborted:case i.WUStateID.Archived:case i.WUStateID.Completed:this.updateVertexStatus(4);break;case i.WUStateID.Failed:this.updateVertexStatus(4,!1);break;case i.WUStateID.DebugPaused:case i.WUStateID.DebugRunning:case i.WUStateID.Paused:case i.WUStateID.Unknown:default:this.updateVertexStatus(0)}super.update(t,e),this.zoomToFit()}exit(t,e){this._wuHandle&&this._wuHandle.release(),super.exit(t,e)}};L(ot,"WUStatus");let st=ot;st.prototype._class+=" eclwatch_WUStatus",st.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),st.prototype.publish("wuid","","string","Workunit ID");var at=Object.defineProperty,rt=L((t,e)=>at(t,"name",{value:e,configurable:!0}),"o");function lt(){}function ht(){}function ct(){}function ut(){}function pt(t){return"function"==typeof t.highlightColumn}function dt(){}function ft(){}function yt(){let t=c,e=u,i=p,n=M(document.body),o=S(),s=null,r=null,l=null;const h=rt(function(t){if(s=k(t),!s)return;r=s.createSVGPoint();const e=n();e&&o&&e.appendChild(o)},"tip2");function c(){return"n"}function u(){return[0,0]}function p(){return" "}L(c,"h"),L(u,"y"),L(p,"d"),h.show=function(t,o,s){l=s[o];const a=Array.prototype.slice.call(arguments),r=i.apply(this,a);if(null===r)return h;const c=e.apply(this,a),u=A();let p,y=f.length;const _=n().getBoundingClientRect();for(u.html(r).style("opacity",1).style("pointer-events","all");y--;)u.classed(f[y],!1);let x=!1;const m={};let g=f[0];for(let e=0;e<f.length&&(x=w(f[e]),!x);e++);if(x)u.classed("notick",!1);else{u.classed("notick",!0);const t=v(m[g]),e=b(m[g]);w(g,t,e)}return h;function b(t){return t.left>t.right?t.left>0?-t.left:0:t.right>0?t.right:0}function v(t){return t.top>t.bottom?t.top>0?-t.top:0:t.bottom}function w(t,e,i){e=e||0,i=i||0,u.style("white-space","nowrap"),p=d.get(t).apply(this),u.classed(t,!0).style("top",p.top+c[0]-e+"px").style("left",p.left+c[1]-i+"px");const n=u.node().getBoundingClientRect(),o=n.top>_.top&&n.left>_.left&&n.bottom<_.bottom&&n.right<_.right;return m[t]={top:_.top-n.top,right:n.right-_.right,bottom:n.bottom-_.bottom,left:_.left-n.left},u.style("white-space","normal"),m[t].total_overflow=Object.keys(m[t]).filter(e=>m[t][e]>0).reduce((e,i)=>e+m[t][i],0),m[g].total_overflow>m[t].total_overflow&&(g=t),o||u.classed(t,!1),o}},h.hide=function(){return A().style("opacity",0).style("pointer-events","none"),h},h.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return A().attr(t);const i=Array.prototype.slice.call(arguments);return a.selection.prototype.attr.apply(A(),i),h},h.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return A().style(t);const i=Array.prototype.slice.call(arguments);return a.selection.prototype.style.apply(A(),i),h},h.direction=function(e){return arguments.length?(t=null==e?e:M(e),h):t},h.offset=function(t){return arguments.length?(e=null==t?t:M(t),h):e},h.html=function(t){return arguments.length?(i=null==t?t:M(t),h):i},h.rootElement=function(t){return arguments.length?(n=M(t),h):n},h.destroy=function(){return o&&(A().remove(),o=null),h},rt(c,"d3TipDirection"),rt(u,"d3TipOffset"),rt(p,"d3TipHTML");const d=a.map({n:y,s:_,e:x,w:m,nw:g,ne:b,sw:v,se:w}),f=d.keys();function y(){const t=C(window);return{top:t.n.y-o.offsetHeight,left:t.n.x-o.offsetWidth/2}}function _(){const t=C(window);return{top:t.s.y+8,left:t.s.x-o.offsetWidth/2}}function x(){const t=C(window);return{top:t.e.y-o.offsetHeight/2,left:t.e.x+8}}function m(){const t=C(window);return{top:t.w.y-o.offsetHeight/2,left:t.w.x-o.offsetWidth-8}}function g(){const t=C(window);return{top:t.nw.y-o.offsetHeight,left:t.nw.x-o.offsetWidth}}function b(){const t=C(window);return{top:t.ne.y-o.offsetHeight,left:t.ne.x}}function v(){const t=C(window);return{top:t.sw.y,left:t.sw.x-o.offsetWidth}}function w(){const t=C(window);return{top:t.se.y,left:t.se.x}}function S(){const t=a.select(document.createElement("div"));return t.attr("class","d3-tip").style("position","absolute").style("top","0px").style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function k(t){const e=t.node();return e?"svg"===e.tagName.toLowerCase()?e:e.ownerSVGElement:null}function A(){return null==o&&(o=S(),n().appendChild(o)),a.select(o)}function C(t){let e=l||t;for(;null==e.getCTM&&null!=e.parentNode;)e=e.parentNode;const i={},n=e.getCTM(),o=e.getBBox(),s=o.width,a=o.height,h=o.x,c=o.y;return r.x=h,r.y=c,i.nw=r.matrixTransform(n),r.x+=s,i.ne=r.matrixTransform(n),r.y+=a,i.se=r.matrixTransform(n),r.x-=s,i.sw=r.matrixTransform(n),r.y-=a/2,i.w=r.matrixTransform(n),r.x+=s,i.e=r.matrixTransform(n),r.x-=s/2,r.y-=a/2,i.n=r.matrixTransform(n),r.y+=a,i.s=r.matrixTransform(n),i}function M(t){return"function"==typeof t?t:function(){return t}}return L(y,"g"),L(_,"v"),L(x,"x"),L(m,"w"),L(g,"C"),L(b,"_"),L(v,"k"),L(w,"F"),L(S,"E"),L(k,"T"),L(A,"V"),L(C,"S"),L(M,"I"),rt(y,"directionNorth"),rt(_,"directionSouth"),rt(x,"directionEast"),rt(m,"directionWest"),rt(g,"directionNorthWest"),rt(b,"directionNorthEast"),rt(v,"directionSouthWest"),rt(w,"directionSouthEast"),rt(S,"initNode"),rt(k,"getSVGNode"),rt(A,"getNodeEl"),rt(C,"getScreenBBox"),rt(M,"functor"),h}function _t(){if(this.tooltip=yt(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=a.format(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=a.format(this.tooltipValueFormat())),this.layerEnter){const t=this.layerEnter;this.layerEnter=function(e,i,n){this._parentOverlay||(this._parentOverlay=e._parentOverlay),this.tooltipEnter(i),t.apply(this,arguments)};const e=this.layerUpdate;this.layerUpdate=function(t){e.apply(this,arguments),this.tooltipUpdate()};const i=this.layerExit;this.layerExit=function(t){this.tooltipExit(),i.apply(this,arguments)}}else{const t=this.enter;this.enter=function(e,i){this.tooltipEnter(i),t.apply(this,arguments)};const e=this.update;this.update=function(t,i){e.apply(this,arguments),this.tooltipUpdate()};const i=this.exit;this.exit=function(t,e){this.tooltipExit(),i.apply(this,arguments)}}}L(lt,"f"),L(ht,"h"),L(ct,"y"),L(ut,"d"),L(pt,"b"),L(dt,"m"),L(ft,"g"),L(yt,"v"),L(_t,"x"),rt(lt,"I1DChart"),lt.prototype._dataFamily="1D",lt.prototype._palette=a.Palette.rainbow("default"),lt.prototype.click=function(t,e,i){},lt.prototype.dblclick=function(t,e,i){},rt(ht,"I2DChart"),ht.prototype._dataFamily="2D",ht.prototype._palette=a.Palette.ordinal("default"),ht.prototype.fillColor=function(t,e,i,n){return this._palette(t[0])},ht.prototype.strokeColor=function(t,e,i,n){return a.hsl(this.fillColor(t,e,i,n)).darker().toString()},ht.prototype.textColor=function(t,e,i,n){return a.Palette.textColor(this.fillColor(t,e,i,n))},ht.prototype.click=function(t,e,i){},ht.prototype.dblclick=function(t,e,i){},rt(ct,"I2DAggrChart"),ct.prototype._palette=a.Palette.rainbow("default"),ct.prototype.fillColor=function(t,e,i){return this._palette(t.length)},ct.prototype.strokeColor=function(t,e,i){return a.hsl(this.fillColor(t,e,i)).darker().toString()},ct.prototype.textColor=function(t,e,i){return a.Palette.textColor(this.fillColor(t,e,i))},ct.prototype.click=function(t,e,i){},ct.prototype.dblclick=function(t,e,i){},rt(ut,"IGraph"),ut.prototype._dataFamily="graph",ut.prototype.vertex_click=function(t,e,i,n){n&&n.vertex},ut.prototype.vertex_dblclick=function(t,e,i,n){n&&n.vertex},ut.prototype.edge_click=function(t,e,i,n){n&&n.edge},ut.prototype.edge_dblclick=function(t,e,i,n){n&&n.edge},rt(pt,"instanceOfIHighlight"),rt(dt,"IInput"),dt.prototype=Object.create(a.Widget.prototype),dt.prototype.constructor=dt,dt.prototype.isValid=function(){return!(this.validate()&&!new RegExp(this.validate()).test(this.value()))},dt.prototype.hasValue=function(){if("function"==typeof this.type){switch(this.type()){case"radio":case"checkbox":if(this.value()&&"false"!==this.value())return!0;break;default:if(this.value())return!0}return!1}return""!==this.value()},dt.prototype.blur=function(t){},dt.prototype.keyup=function(t){},dt.prototype.focus=function(t){},dt.prototype.click=function(t){},dt.prototype.dblclick=function(t){},dt.prototype.change=function(t,e){},dt.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},dt.prototype.disable=function(t){this._inputElement.forEach(function(e,i){e.attr("disabled",t?"disabled":null)})},dt.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},dt.prototype.publish("name","","string","HTML name for the input"),dt.prototype.publish("label","","string","Descriptive label"),dt.prototype.publish("value","","string","Input Current Value"),dt.prototype.publish("validate",null,"string","Input Validation"),rt(ft,"INDChart"),ft.prototype._dataFamily="ND",ft.prototype._palette=a.Palette.ordinal("default"),ft.prototype.fillColor=function(t,e,i,n){return this._palette(e)},ft.prototype.strokeColor=function(t,e,i,n){return a.hsl(this.fillColor(t,e,i,n)).darker().toString()},ft.prototype.textColor=function(t,e,i,n){return a.Palette.textColor(this.fillColor(t,e,i,n))},ft.prototype.click=function(t,e,i){},ft.prototype.dblclick=function(t,e,i){},rt(yt,"tip"),rt(_t,"ITooltip"),_t.prototype=Object.create(a.Widget.prototype),_t.prototype.constructor=_t,_t.prototype.tooltipEnter=function(t){const e=this.parentOverlay();e.empty()||this.tooltip.rootElement(e.node().parentNode),t.call(this.tooltip)},_t.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){const t=document.querySelector(".d3-tip");return t.style.display="block",t.style.left=this.tooltipOffset()+event.clientX+"px",t.style.top=event.clientY+"px",[]}return"e"===this.tooltip.direction()()?[0,this.tooltipOffset()]:[-this.tooltipOffset(),0]});let t=this.tooltip.attr("class");t&&(t=t.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":""),t=t.split(" ").filter(function(t){return 0!==t.indexOf("ITooltip-tooltipStyle-")}).join(" "),t+=" ITooltip-tooltipStyle-"+this.tooltipStyle(),this.tooltip.attr("class",t))},_t.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},_t.prototype._tooltipHTML=function(t){return t},_t.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},_t.prototype.tooltipFormat=function(t={}){switch(t.label=void 0===t.label?"":t.label,this._labelFormatter?t.label=this._labelFormatter(t.label)||"":this.formatData&&this.parseData&&(t.label=this.formatData(this.parseData(t.label))),t.series=t.series||"",t.value instanceof Date?t.value=t.value||"":this._valueFormatter?t.value=this._valueFormatter(t.value)||"":this.formatValue&&this.parseValue&&(t.value=this.formatValue(this.parseValue(t.value))),this.tooltipStyle()){case"none":break;case"series-table":let e='<table class="ITooltip-series-table"><thead><tr><th colspan="2">'+t.label+"</th></tr></thead><tbody>";return t.arr.forEach(function(t){e+="<tr>",e+="<td>",e+='<div class="series-table-row-color" style="background-color:'+t.color+'"></div>',e+='<div class="series-table-row-label">'+t.label+"</div>",e+="</td>",e+='<td><div class="series-table-row-value">'+t.value+"</div></td>",e+="</tr>"}),e+="</tbody>",e+="</table>",e;default:return t.series?"<span style='color:"+this.tooltipSeriesColor()+"'>"+t.series+"</span> / <span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":""!==t.label?"<span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":"<span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>"}},_t.prototype.tooltipKeyValueFormat=function(t,e){let i="";for(const n in e)if(n!==t){const t=e&&e[n]?e[n]:"";i+=`<tr><td style="${this.tooltipLabelColor_exists()?"color:"+this.tooltipLabelColor():""}">${n}</td><td style="font-weight:normal">${t}</td></tr>`}return`<table>\n <thead>\n <tr><th colspan="2" style="font-weight:bold;font-size:16px">${e[t]}</th></tr>\n </thead>\n <tbody>\n ${i}\n </tbody>\n </table>`},_t.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{}),_t.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{}),_t.prototype.publish("tooltipLabelFormat",void 0,"string","Format of tooltip label(s) (the domain axis)",null,{}),_t.prototype.publish("tooltipValueFormat",void 0,"string","Number format of tooltip value(s)",null,{}),_t.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{}),_t.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text (the domain axis)",null,{}),_t.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{}),_t.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),_t.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});const xt=_t.prototype.tooltipLabelFormat;_t.prototype.tooltipLabelFormat=function(t){const e=xt.apply(this,arguments);return arguments.length&&(this._labelFormatter=a.format(t)),e};const mt=_t.prototype.tooltipValueFormat;function gt(){}L(gt,"_"),_t.prototype.tooltipValueFormat=function(t){const e=mt.apply(this,arguments);return arguments.length&&(this._valueFormatter=a.format(t)),e},rt(gt,"ITree"),gt.prototype.constructor=gt,gt.prototype.click=function(t,e,i){},gt.prototype.dblclick=function(t,e,i){},gt.prototype._palette=a.Palette.ordinal("default"),function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('.d3-tip{line-height:1;font-weight:700;padding:12px;background:#000000a8;color:#fff;border-radius:2px;pointer-events:none!important;z-index:10}.d3-tip.hidden{visibility:hidden}.d3-tip:after{content:" ";box-sizing:border-box;display:inline-block;border:4px solid rgba(0,0,0,.66);position:absolute;pointer-events:none!important;width:8px;height:8px;margin:0}.d3-tip.n:after{top:100%;left:calc(50% - 4px);border-top-width:8px;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.e:after{top:calc(50% - 4px);left:-12px;border-top-color:transparent;border-right-width:8px;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.s{margin-top:8px}.d3-tip.s:after{top:-12px;left:calc(50% - 4px);border-top-color:transparent;border-right-color:transparent;border-bottom-width:8px;border-left-color:transparent}.d3-tip.w:after{top:calc(50% - 4px);left:100%;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-width:8px}.d3-tip.notick:after{border-color:transparent!important}.common_Widget .over{stroke:#000000a8;opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table th,.d3-tip .ITooltip-series-table td{padding:6px;text-align:left;border:1px solid #D1D1D1}.d3-tip .ITooltip-series-table .series-table-row-color{display:inline-block;height:10px;width:10px;margin-right:10px}.d3-tip .ITooltip-series-table .series-table-row-label{display:inline-block}.d3-tip .ITooltip-series-table th{background-color:#b3b3b3}.d3-tip .ITooltip-series-table td{background-color:#fff;color:#555;font-weight:400}.d3-tip .ITooltip-series-table td:first-child{border-right:0}table.ITooltip-series-table td:last-child{border-left:1px dotted #A3A3A3}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();var bt=Object.defineProperty,vt=L((t,e)=>bt(t,"name",{value:e,configurable:!0}),"e"),wt=L((t,e,i)=>{return s=i,(o=e+"")in(n=t)?bt(n,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[o]=s;var n,o,s},"i"),St=Math.PI,kt=2*St,At=1e-6,Ct=kt-At;function Mt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Tt(){return new Mt}function Pt(t){return vt(function(){return t},"constant")}L(Mt,"et"),L(Tt,"it"),L(Pt,"nt"),vt(Mt,"Path"),vt(Tt,"path"),Mt.prototype=Tt.prototype={constructor:Mt,moveTo:vt(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:vt(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:vt(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:vt(function(t,e,i,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+n)},"quadraticCurveTo"),bezierCurveTo:vt(function(t,e,i,n,o,s){this._+="C"+ +t+","+ +e+","+ +i+","+ +n+","+(this._x1=+o)+","+(this._y1=+s)},"bezierCurveTo"),arcTo:vt(function(t,e,i,n,o){t=+t,e=+e,i=+i,n=+n,o=+o;var s=this._x1,a=this._y1,r=i-t,l=n-e,h=s-t,c=a-e,u=h*h+c*c;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(u>At)if(Math.abs(c*r-l*h)>At&&o){var p=i-s,d=n-a,f=r*r+l*l,y=p*p+d*d,_=Math.sqrt(f),x=Math.sqrt(u),m=o*Math.tan((St-Math.acos((f+u-y)/(2*_*x)))/2),g=m/x,b=m/_;Math.abs(g-1)>At&&(this._+="L"+(t+g*h)+","+(e+g*c)),this._+="A"+o+","+o+",0,0,"+ +(c*p>h*d)+","+(this._x1=t+b*r)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},"arcTo"),arc:vt(function(t,e,i,n,o,s){t=+t,e=+e,s=!!s;var a=(i=+i)*Math.cos(n),r=i*Math.sin(n),l=t+a,h=e+r,c=1^s,u=s?n-o:o-n;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>At||Math.abs(this._y1-h)>At)&&(this._+="L"+l+","+h),i&&(u<0&&(u=u%kt+kt),u>Ct?this._+="A"+i+","+i+",0,1,"+c+","+(t-a)+","+(e-r)+"A"+i+","+i+",0,1,"+c+","+(this._x1=l)+","+(this._y1=h):u>At&&(this._+="A"+i+","+i+",0,"+ +(u>=St)+","+c+","+(this._x1=t+i*Math.cos(o))+","+(this._y1=e+i*Math.sin(o))))},"arc"),rect:vt(function(t,e,i,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},"rect"),toString:vt(function(){return this._},"toString")},vt(Pt,"constant$3");var It=Math.abs,Et=Math.atan2,Ft=Math.cos,Dt=Math.max,zt=Math.min,Rt=Math.sin,Ot=Math.sqrt,jt=1e-12,Lt=Math.PI,Nt=Lt/2,Bt=2*Lt;function Vt(t){return t>1?0:t<-1?Lt:Math.acos(t)}function Ht(t){return t>=1?Nt:t<=-1?-Nt:Math.asin(t)}function Wt(t){return t.innerRadius}function $t(t){return t.outerRadius}function qt(t){return t.startAngle}function Gt(t){return t.endAngle}function Ut(t){return t&&t.padAngle}function Xt(t,e,i,n,o,s,a,r){var l=i-t,h=n-e,c=a-o,u=r-s,p=u*l-c*h;if(!(p*p<jt))return[t+(p=(c*(e-s)-u*(t-o))/p)*l,e+p*h]}function Yt(t,e,i,n,o,s,a){var r=t-i,l=e-n,h=(a?s:-s)/Ot(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-s,w=p*y-f*d,S=(g<0?-1:1)*Ot(Dt(0,v*v*b-w*w)),k=(w*g-m*S)/b,A=(-w*m-g*S)/b,C=(w*g+m*S)/b,M=(-w*m+g*S)/b,T=k-_,P=A-x,I=C-_,E=M-x;return T*T+P*P>I*I+E*E&&(k=C,A=M),{cx:k,cy:A,x01:-c,y01:-u,x11:k*(o/v-1),y11:A*(o/v-1)}}function Qt(){var t=Wt,e=$t,i=Pt(0),n=null,o=qt,s=Gt,a=Ut,r=null;function l(){var l,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),p=o.apply(this,arguments)-Nt,d=s.apply(this,arguments)-Nt,f=It(d-p),y=d>p;if(r||(r=l=Tt()),u<c&&(h=u,u=c,c=h),u>jt)if(f>Bt-jt)r.moveTo(u*Ft(p),u*Rt(p)),r.arc(0,0,u,p,d,!y),c>jt&&(r.moveTo(c*Ft(d),c*Rt(d)),r.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,k=a.apply(this,arguments)/2,A=k>jt&&(n?+n.apply(this,arguments):Ot(c*c+u*u)),C=zt(It(u-c)/2,+i.apply(this,arguments)),M=C,T=C;if(A>jt){var P=Ht(A/c*Rt(k)),I=Ht(A/u*Rt(k));(w-=2*P)>jt?(b+=P*=y?1:-1,v-=P):(w=0,b=v=(p+d)/2),(S-=2*I)>jt?(m+=I*=y?1:-1,g-=I):(S=0,m=g=(p+d)/2)}var E=u*Ft(m),F=u*Rt(m),D=c*Ft(v),z=c*Rt(v);if(C>jt){var R,O=u*Ft(g),j=u*Rt(g),L=c*Ft(b),N=c*Rt(b);if(f<Lt&&(R=Xt(E,F,L,N,O,j,D,z))){var B=E-R[0],V=F-R[1],H=O-R[0],W=j-R[1],$=1/Rt(Vt((B*H+V*W)/(Ot(B*B+V*V)*Ot(H*H+W*W)))/2),q=Ot(R[0]*R[0]+R[1]*R[1]);M=zt(C,(c-q)/($-1)),T=zt(C,(u-q)/($+1))}}S>jt?T>jt?(_=Yt(L,N,E,F,u,T,y),x=Yt(O,j,D,z,u,T,y),r.moveTo(_.cx+_.x01,_.cy+_.y01),T<C?r.arc(_.cx,_.cy,T,Et(_.y01,_.x01),Et(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,T,Et(_.y01,_.x01),Et(_.y11,_.x11),!y),r.arc(0,0,u,Et(_.cy+_.y11,_.cx+_.x11),Et(x.cy+x.y11,x.cx+x.x11),!y),r.arc(x.cx,x.cy,T,Et(x.y11,x.x11),Et(x.y01,x.x01),!y))):(r.moveTo(E,F),r.arc(0,0,u,m,g,!y)):r.moveTo(E,F),c>jt&&w>jt?M>jt?(_=Yt(D,z,O,j,c,-M,y),x=Yt(E,F,L,N,c,-M,y),r.lineTo(_.cx+_.x01,_.cy+_.y01),M<C?r.arc(_.cx,_.cy,M,Et(_.y01,_.x01),Et(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,M,Et(_.y01,_.x01),Et(_.y11,_.x11),!y),r.arc(0,0,c,Et(_.cy+_.y11,_.cx+_.x11),Et(x.cy+x.y11,x.cx+x.x11),y),r.arc(x.cx,x.cy,M,Et(x.y11,x.x11),Et(x.y01,x.x01),!y))):r.arc(0,0,c,v,b,y):r.lineTo(D,z)}else r.moveTo(0,0);if(r.closePath(),l)return r=null,l+""||null}return L(l,"h"),vt(l,"arc"),l.centroid=function(){var i=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-Lt/2;return[Ft(n)*i,Rt(n)*i]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Pt(+t),l):e},l.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:Pt(+t),l):i},l.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Pt(+t),l):n},l.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:Pt(+t),l):o},l.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:Pt(+t),l):s},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Pt(+t),l):a},l.context=function(t){return arguments.length?(r=null==t?null:t,l):r},l}function Zt(t){this._context=t}function Jt(t){return new Zt(t)}function Kt(t){return t[0]}function te(t){return t[1]}function ee(){var t=Kt,e=te,i=Pt(!0),n=null,o=Jt,s=null;function a(a){var r,l,h,c=a.length,u=!1;for(null==n&&(s=o(h=Tt())),r=0;r<=c;++r)!(r<c&&i(l=a[r],r,a))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+t(l,r,a),+e(l,r,a));if(h)return s=null,h+""||null}return L(a,"r"),vt(a,"line"),a.x=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:Pt(+t),a):e},a.defined=function(t){return arguments.length?(i="function"==typeof t?t:Pt(!!t),a):i},a.curve=function(t){return arguments.length?(o=t,null!=n&&(s=o(n)),a):o},a.context=function(t){return arguments.length?(null==t?n=s=null:s=o(n=t),a):n},a}function ie(){var t=Kt,e=null,i=Pt(0),n=te,o=Pt(!0),s=null,a=Jt,r=null;function l(l){var h,c,u,p,d,f=l.length,y=!1,_=new Array(f),x=new Array(f);for(null==s&&(r=a(d=Tt())),h=0;h<=f;++h){if(!(h<f&&o(p=l[h],h,l))===y)if(y=!y)c=h,r.areaStart(),r.lineStart();else{for(r.lineEnd(),r.lineStart(),u=h-1;u>=c;--u)r.point(_[u],x[u]);r.lineEnd(),r.areaEnd()}y&&(_[h]=+t(p,h,l),x[h]=+i(p,h,l),r.point(e?+e(p,h,l):_[h],n?+n(p,h,l):x[h]))}if(d)return r=null,d+""||null}function h(){return ee().defined(o).curve(a).context(s)}return L(l,"h"),L(h,"c"),vt(l,"area"),vt(h,"arealine"),l.x=function(i){return arguments.length?(t="function"==typeof i?i:Pt(+i),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:Pt(+t),l):e},l.y=function(t){return arguments.length?(i="function"==typeof t?t:Pt(+t),n=null,l):i},l.y0=function(t){return arguments.length?(i="function"==typeof t?t:Pt(+t),l):i},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Pt(+t),l):n},l.lineX0=l.lineY0=function(){return h().x(t).y(i)},l.lineY1=function(){return h().x(t).y(n)},l.lineX1=function(){return h().x(e).y(i)},l.defined=function(t){return arguments.length?(o="function"==typeof t?t:Pt(!!t),l):o},l.curve=function(t){return arguments.length?(a=t,null!=s&&(r=a(s)),l):a},l.context=function(t){return arguments.length?(null==t?s=r=null:r=a(s=t),l):s},l}function ne(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function oe(t){return t}function se(){var t=oe,e=ne,i=null,n=Pt(0),o=Pt(Bt),s=Pt(0);function a(a){var r,l,h,c,u,p=a.length,d=0,f=new Array(p),y=new Array(p),_=+n.apply(this,arguments),x=Math.min(Bt,Math.max(-Bt,o.apply(this,arguments)-_)),m=Math.min(Math.abs(x)/p,s.apply(this,arguments)),g=m*(x<0?-1:1);for(r=0;r<p;++r)(u=y[f[r]=r]=+t(a[r],r,a))>0&&(d+=u);for(null!=e?f.sort(function(t,i){return e(y[t],y[i])}):null!=i&&f.sort(function(t,e){return i(a[t],a[e])}),r=0,h=d?(x-p*g)/d:0;r<p;++r,_=c)l=f[r],c=_+((u=y[l])>0?u*h:0)+g,y[l]={data:a[l],index:r,value:u,startAngle:_,endAngle:c,padAngle:m};return y}return L(a,"r"),vt(a,"pie"),a.value=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,i=null,a):e},a.sort=function(t){return arguments.length?(i=t,e=null,a):i},a.startAngle=function(t){return arguments.length?(n="function"==typeof t?t:Pt(+t),a):n},a.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Pt(+t),a):o},a.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Pt(+t),a):s},a}function ae(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function re(t){this._context=t}function le(t){return new re(t)}function he(t,e){this._basis=new re(t),this._beta=e}L(Vt,"yt"),L(Ht,"_t"),L(Wt,"xt"),L($t,"mt"),L(qt,"gt"),L(Gt,"bt"),L(Ut,"vt"),L(Xt,"wt"),L(Yt,"St"),L(Qt,"At"),L(Zt,"kt"),L(Jt,"Mt"),L(Kt,"Pt"),L(te,"Tt"),L(ee,"Ct"),L(ie,"zt"),L(ne,"Ft"),L(oe,"It"),L(se,"Et"),L(ae,"Ot"),L(re,"Rt"),L(le,"Dt"),L(he,"jt"),vt(Vt,"acos"),vt(Ht,"asin$1"),vt(Wt,"arcInnerRadius$1"),vt($t,"arcOuterRadius$1"),vt(qt,"arcStartAngle$1"),vt(Gt,"arcEndAngle$1"),vt(Ut,"arcPadAngle$1"),vt(Xt,"intersect$1"),vt(Yt,"cornerTangents$1"),vt(Qt,"d3Arc"),vt(Zt,"Linear$1"),Zt.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},vt(Jt,"d3CurveLinear"),vt(Kt,"x$1"),vt(te,"y$1"),vt(ee,"d3Line"),vt(ie,"d3Area"),vt(ne,"descending"),vt(oe,"identity$2"),vt(se,"d3Pie"),vt(ae,"point$7"),vt(re,"Basis$1"),re.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 3:ae(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ae(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},vt(le,"d3CurveBasis"),vt(he,"Bundle$1"),he.prototype={lineStart:vt(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:vt(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],s=e[0],a=t[i]-o,r=e[i]-s,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*a),this._beta*e[l]+(1-this._beta)*(s+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:vt(function(t,e){this._x.push(+t),this._y.push(+e)},"point")};const ce=vt(L(function t(e){function i(t){return 1===e?new re(t):new he(t,e)}return L(i,"n"),vt(i,"bundle"),i.beta=function(e){return t(+e)},i},"t"),"custom")(.85);function ue(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function pe(t,e){this._context=t,this._k=(1-e)/6}L(ue,"Lt"),L(pe,"Bt"),vt(ue,"point$6"),vt(pe,"Cardinal$1"),pe.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ue(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ue(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const de=vt(L(function t(e){function i(t){return new pe(t,e)}return L(i,"n"),vt(i,"cardinal"),i.tension=function(e){return t(+e)},i},"t"),"custom")(0);function fe(t,e,i){var n=t._x1,o=t._y1,s=t._x2,a=t._y2;if(t._l01_a>jt){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>jt){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*h+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,s,a,t._x2,t._y2)}function ye(t,e){this._context=t,this._alpha=e}L(fe,"Ht"),L(ye,"qt"),vt(fe,"point$5"),vt(ye,"CatmullRom$1"),ye.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:fe(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const _e=vt(L(function t(e){function i(t){return e?new ye(t,e):new pe(t,0)}return L(i,"n"),vt(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"t"),"custom")(.5);function xe(t){return t<0?-1:1}function me(t,e,i){var n=t._x1-t._x0,o=e-t._x1,s=(t._y1-t._y0)/(n||o<0&&-0),a=(i-t._y1)/(o||n<0&&-0),r=(s*o+a*n)/(n+o);return(xe(s)+xe(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(r))||0}function ge(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function be(t,e,i){var n=t._x0,o=t._y0,s=t._x1,a=t._y1,r=(s-n)/3;t._context.bezierCurveTo(n+r,o+r*e,s-r,a-r*i,s,a)}function ve(t){this._context=t}function we(t){return new ve(t)}function Se(t){this._context=t}function ke(t){var e,i,n=t.length-1,o=new Array(n),s=new Array(n),a=new Array(n);for(o[0]=0,s[0]=2,a[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,s[e]=4,a[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,s[n-1]=7,a[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)i=o[e]/s[e-1],s[e]-=i,a[e]-=i*a[e-1];for(o[n-1]=a[n-1]/s[n-1],e=n-2;e>=0;--e)o[e]=(a[e]-o[e+1])/s[e];for(s[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)s[e]=2*t[e+1]-o[e+1];return[o,s]}function Ae(t){return new Se(t)}function Ce(t,e){this._context=t,this._t=e}function Me(t){return new Ce(t,.5)}function Te(t){return new Ce(t,0)}function Pe(t){return new Ce(t,1)}L(xe,"Wt"),L(me,"Gt"),L(ge,"Xt"),L(be,"Yt"),L(ve,"Ut"),L(we,"Qt"),L(Se,"Zt"),L(ke,"Jt"),L(Ae,"Kt"),L(Ce,"te"),L(Me,"ee"),L(Te,"ie"),L(Pe,"ne"),vt(xe,"sign$1"),vt(me,"slope3$1"),vt(ge,"slope2$1"),vt(be,"point$4"),vt(ve,"MonotoneX$1"),ve.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:be(this,this._t0,ge(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,be(this,ge(this,i=me(this,t,e)),i);break;default:be(this,this._t0,i=me(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(ve.prototype).point=function(t,e){ve.prototype.point.call(this,e,t)},vt(we,"monotoneX"),vt(Se,"Natural"),Se.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x=[],this._y=[]},"lineStart"),lineEnd:vt(function(){var t=this._x,e=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===i)this._context.lineTo(t[1],e[1]);else for(var n=ke(t),o=ke(e),s=0,a=1;a<i;++s,++a)this._context.bezierCurveTo(n[0][s],o[0][s],n[1][s],o[1][s],t[a],e[a]);(this._line||0!==this._line&&1===i)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},"lineEnd"),point:vt(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},vt(ke,"controlPoints"),vt(Ae,"d3CurveNatural"),vt(Ce,"Step$1"),Ce.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x=this._y=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,e)}}this._x=t,this._y=e},"point")},vt(Me,"d3CurveStep"),vt(Te,"stepBefore"),vt(Pe,"stepAfter");var Ie=Array.prototype.slice;function Ee(t){return t}L(Ee,"se"),vt(Ee,"identity$1");var Fe=1e-6;function De(t){return"translate("+(t+.5)+",0)"}function ze(t){return"translate(0,"+(t+.5)+")"}function Re(t){return function(e){return+t(e)}}function Oe(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(i){return+t(i)+e}}function je(){return!this.__axis}function Le(t,e){var i=[],n=null,o=null,s=6,a=6,r=3,l=1===t||4===t?-1:1,h=4===t||2===t?"x":"y",c=1===t||3===t?De:ze;function u(u){var p=null==n?e.ticks?e.ticks.apply(e,i):e.domain():n,d=null==o?e.tickFormat?e.tickFormat.apply(e,i):Ee:o,f=Math.max(s,0)+r,y=e.range(),_=+y[0]+.5,x=+y[y.length-1]+.5,m=(e.bandwidth?Oe:Re)(e.copy()),g=u.selection?u.selection():u,b=g.selectAll(".domain").data([null]),v=g.selectAll(".tick").data(p,e).order(),w=v.exit(),S=v.enter().append("g").attr("class","tick"),k=v.select("line"),A=v.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),v=v.merge(S),k=k.merge(S.append("line").attr("stroke","currentColor").attr(h+"2",l*s)),A=A.merge(S.append("text").attr("fill","currentColor").attr(h,l*f).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),u!==g&&(b=b.transition(u),v=v.transition(u),k=k.transition(u),A=A.transition(u),w=w.transition(u).attr("opacity",Fe).attr("transform",function(t){return isFinite(t=m(t))?c(t):this.getAttribute("transform")}),S.attr("opacity",Fe).attr("transform",function(t){var e=this.parentNode.__axis;return c(e&&isFinite(e=e(t))?e:m(t))})),w.remove(),b.attr("d",4===t||2==t?a?"M"+l*a+","+_+"H0.5V"+x+"H"+l*a:"M0.5,"+_+"V"+x:a?"M"+_+","+l*a+"V0.5H"+x+"V"+l*a:"M"+_+",0.5H"+x),v.attr("opacity",1).attr("transform",function(t){return c(m(t))}),k.attr(h+"2",l*s),A.attr(h,l*f).text(d),g.filter(je).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),g.each(function(){this.__axis=m})}return L(u,"p"),vt(u,"axis"),u.scale=function(t){return arguments.length?(e=t,u):e},u.ticks=function(){return i=Ie.call(arguments),u},u.tickArguments=function(t){return arguments.length?(i=null==t?[]:Ie.call(t),u):i.slice()},u.tickValues=function(t){return arguments.length?(n=null==t?null:Ie.call(t),u):n&&n.slice()},u.tickFormat=function(t){return arguments.length?(o=t,u):o},u.tickSize=function(t){return arguments.length?(s=a=+t,u):s},u.tickSizeInner=function(t){return arguments.length?(s=+t,u):s},u.tickSizeOuter=function(t){return arguments.length?(a=+t,u):a},u.tickPadding=function(t){return arguments.length?(r=+t,u):r},u}function Ne(t){return Le(1,t)}function Be(t){return Le(2,t)}function Ve(t){return Le(3,t)}function He(t){return Le(4,t)}L(De,"re"),L(ze,"le"),L(Re,"he"),L(Oe,"ce"),L(je,"ue"),L(Le,"pe"),L(Ne,"de"),L(Be,"fe"),L(Ve,"ye"),L(He,"_e"),vt(De,"translateX"),vt(ze,"translateY"),vt(Re,"number"),vt(Oe,"center"),vt(je,"entering"),vt(Le,"axis"),vt(Ne,"axisTop"),vt(Be,"axisRight"),vt(Ve,"axisBottom"),vt(He,"axisLeft");const We=(u=class extends a.SVGWidget{_origType;_origTimePattern;parser;parserInvert;formatter;d3Scale;d3Axis;d3Guides;_guideElement;svg;svgAxis;svgGuides;_tickFormatFunc;constructor(t="origin"){super(),this._drawStartPos=t,this.updateScale()}lowValue(){return this.parse(this.low())}highValue(){return this.parse(this.high())}parse(t,e){if(t instanceof Array)return t.map(function(t){return this.parse(t)},this);if(null!=t){if(this.parser)return this.parser("number"==typeof t?t.toString():t);if(e&&"string"==typeof t)return+t}return t}parseInvert(t){return t instanceof Array?t.map(function(t){return this.parseInvert(t)},this):this.parserInvert&&t?this.parserInvert(t):t}format(t){return t instanceof Array?t.map(function(t){return this.format(t)},this):null!=t&&this.formatter?this.formatter(t):t}parseFormat(t){return this.format(this.parse(t))}tickFormatFunc(t){return arguments.length?(this._tickFormatFunc=t,this.updateScale(),this):this._tickFormatFunc}scalePos(t){let e=this.d3Scale(this.parse(t));return"ordinal"===this.type()&&(e+=this.bandwidth()/2),e}bandwidth(){return this.d3Scale.bandwidth?this.d3Scale.bandwidth():0}isHorizontal(){switch(this.orientation()){case"left":case"right":return!1}return!0}domain(t){return arguments.length?(this.d3Scale.domain(t),this):this.d3Scale.domain()}range(t){if(!arguments.length){if(this.d3Scale.rangeRoundBands)return this.d3Scale.rangeExtent();if(this.d3Scale.rangeRound)return this.d3Scale.range()}return this.d3Scale.rangeRoundBands?this.d3Scale.rangeRoundBands(t,.1):this.d3Scale.rangeRound&&this.d3Scale.range(t),this}invert(t){return this.d3Scale.invert(t)}guideTarget(t){return this._guideElement=a.select(t).attr("class",this._class),this}enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgAxis=this.svg.append("g").attr("class","axis"),this.svgGuides=(this._guideElement||e).append("g").attr("class","guide")}_prevOrientation;updateScale(){switch(this.type()){case"ordinal":if(this.d3Scale=a.scaleBand().paddingInner(this.ordinalPaddingInner()).paddingOuter(this.ordinalPaddingOuter()),this.ordinals_exists()&&this.d3Scale.domain(this.ordinals()),this.parser=null,this.ordinalMappings_exists()){const t=this.ordinalMappings();this.formatter=e=>t[e]||e}else this.formatter=null;break;case"linear":this.d3Scale=a.scaleLinear(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?a.format(this.tickFormat()):null;break;case"pow":this.d3Scale=a.scalePow().exponent(this.powExponent()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?a.format(this.tickFormat()):null;break;case"log":this.d3Scale=a.scaleLog().base(this.logBase()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?a.format(this.tickFormat()):null;break;case"time":this.d3Scale=a.scaleTime(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=this.timePattern_exists()?a.timeParse(this.timePattern()):null,this.parserInvert=this.timePattern_exists()?a.timeFormat(this.timePattern()):null,this._tickFormatFunc?this.formatter=this._tickFormatFunc:this.formatter=this.tickFormat_exists()?a.timeFormat(this.tickFormat()):null}if(this._prevOrientation!==this.orientation()){switch(this.orientation()){case"left":this.d3Axis=He(this.d3Scale),this.d3Guides=He(this.d3Scale);break;case"top":this.d3Axis=Ne(this.d3Scale),this.d3Guides=Ne(this.d3Scale);break;case"right":this.d3Axis=Be(this.d3Scale),this.d3Guides=Be(this.d3Scale);break;default:this.d3Axis=Ve(this.d3Scale),this.d3Guides=Ve(this.d3Scale)}this._prevOrientation=this.orientation(),this.svgAxis&&this.svgAxis.html(""),this.svgGuides&&this.svgGuides.html("")}if(this.extend())if("ordinal"===this.type());else{let t,e,i,n,o,s;this.isHorizontal()?(t=this.width(),this.d3Scale.range([0,t]),e=t*this.extend()/100,i=this.d3Scale.invert(0),o=this.d3Scale.invert(-e),n=this.d3Scale.invert(t),s=this.d3Scale.invert(t+e)):(t=this.height(),this.d3Scale.range([t,0]),e=t*this.extend()/100,i=this.d3Scale.invert(t),o=this.d3Scale.invert(t+e),n=this.d3Scale.invert(0),s=this.d3Scale.invert(-e)),o===i&&(o=i-i*this.extend()/100),s===n&&(s=n+n*this.extend()/100),Math.sign(i)!==Math.sign(o)&&(o=0),Math.sign(n)!==Math.sign(s)&&(s=0),this.d3Scale.domain([o,s])}this.d3Axis.scale(this.d3Scale).tickFormat(this.formatter).ticks(this.tickCount()),this.d3Guides.scale(this.d3Scale).tickSize(this.tickLength_exists()?-this.tickLength():0).tickFormat("").ticks(this.tickCount());const t=this.ticks();return t.length&&(this.d3Axis.tickValues(t.map(t=>this.parse(t.value))).tickFormat((e,i)=>t[i].label),this.d3Guides.tickValues(t.map(t=>this.parse(t.value)))),this}adjustText(t,e){const i=this.isHorizontal(),n="left"===this.orientation(),o="bottom"===this.orientation(),s=this,r=t.selectAll(".tick > text").style("font-family",this.fontFamily()).style("font-size",this.fontSize_exists()?this.fontSize()+"px":null);if("linebreak"===this.overlapMode())"ordinal"===this.type()&&r.call(function(){return s.linebreak.apply(s,arguments)},this.bandwidth());else if("wrap"===this.overlapMode())"ordinal"===this.type()&&r.call(function(){return s.wrap.apply(s,arguments)},this.bandwidth());else switch(i?this.overlapMode():"none"){case"stagger":r.style("text-anchor","middle").attr("dy",function(t,i){return(o?1:-1)*((o?.71:0)+i%e)+"em"}).attr("dx",0).attr("visibility",null).attr("transform","rotate(0)");break;case"hide":r.style("text-anchor","middle").attr("dy",(o?.71:0)+"em").attr("dx",0).attr("visibility",function(t,i){return i%e?"hidden":null}).attr("transform","rotate(0)");break;case"rotate":const t=-this.labelRotation()||0;if(0!==t&&e>1){r.each(function(){const e=a.select(this),i=e.node().getBBox(),n=(o?1:-1)*Math.sin(Math.PI*(-Math.abs(t)/180));e.style("text-anchor",t>0?o?"start":"end":o?"end":"start").attr("dy",i.height/2*n+"px").attr("dx",t>0?o?"0.71em":"-0.71em":o?"-0.71em":"0.71em").attr("transform","rotate("+t+")").attr("visibility",null)});break}default:r.style("text-anchor",i?"middle":n?"end":"start").attr("dy",i?(o?.71:0)+"em":"0.32em").attr("dx",0).attr("visibility",null).attr("transform","rotate(0)")}}calcTickOverlapModulus(t){let e=1;switch(this.overlapMode()){case"rotate":case"stagger":case"hide":const i=[];t.selectAll(".tick > text").each(function(){const t=this.getBoundingClientRect();for(let n=i.length-1;n>=0&&!(i[n].right<t.left);--n)i.length+1-n>e&&(e=i.length+1-n);i.push(t)})}return e}calcOverflow(t,e){if(this.updateScale(),this.hidden())return{left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:1};const i=this.isHorizontal();this.range(i?[0,this.width()]:[this.height(),0]);const n=t.append("g").attr("class",this.classID()),o=n.append("g");o.attr("class",i?"x":"y").call(this.d3Axis),e&&t.selectAll(".tick > text").remove();const s={left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:this.calcTickOverlapModulus(o)};this.adjustText(o,s.tickOverlapModulus);const a=o.node().getBBox();switch(s.depth=i?a.height:a.width,this.shrinkToFit()){case"low":case"both":s.left=i?-a.x:0,s.bottom=i?0:-(this.height()-(a.height+a.y))}switch(this.shrinkToFit()){case"high":case"both":s.top=i?0:-a.y,s.right=i?-(this.width()-a.x-a.width):0}return n.remove(),s}wrap(t,e,i){i=i||/\s+/;const n=this;t.each(function(){const t=a.select(this),o=t.text().split(i).reverse();let s=[],r=0;const l=t.attr("x"),h=t.attr("y"),c=parseFloat(t.style("font-size"))||10,u=Math.floor(e/(1.1*c))-1,p=n.isHorizontal()?1:Math.ceil(o.length/u),d=parseFloat(t.attr("dy"));let f=t.text(null).append("tspan").attr("x",l).attr("y",h).attr("dy",d+"em"),y=0,_=o.pop();for(;_;)s.push(_),f.text(s.join(" ")),y++,f.node().getComputedTextLength()>e&&y>=p&&(s.pop(),f.text(s.join(" ")),s=[_],f=t.append("tspan").attr("x",l).attr("y",h).attr("dy",1.1*++r+d+"em").text(_),y=0),_=o.pop();n.isHorizontal()||t.selectAll("tspan").attr("y",-r/2+"em")})}linebreak(t,e){this.wrap(t,e,"\n")}update(t,e){super.update(t,e),this.svg.style("display",this.hidden()?"none":null);const i=this.calcOverflow(e),n=this.isHorizontal()?i.left:this.height()-i.top-i.bottom,o=this.isHorizontal()?this.width()-i.right-this.padding():0+this.padding();this.range(this.reverse()?[o,n]:[n,o]);const s=this;function a(t){t.attr("transform",function(){switch(s.orientation()){case"left":return"translate("+i.depth+", "+i.top+")";case"top":return"translate(0,"+i.depth+")";case"right":return"translate("+(s.width()-i.depth)+", "+i.top+")";case"bottom":return"translate(0,"+(s.height()-i.depth)+")"}return"translate(0,0)"})}L(a,"r"),vt(a,"doPosition"),this.svg.style("visibility","none"===this.type()?"hidden":null).transition().call(a),this._guideElement&&this.svgGuides.transition().call(a),this.svgAxis.call(this.d3Axis),this.adjustText(this.svgAxis,i.tickOverlapModulus),this.pos().x;const r=this.width(),l=this.svgAxis.selectAll(".axisTitle").data(this.title()?[this.title()]:[]),h=l.enter().append("text").attr("class","axisTitle").merge(l).transition().attr("dx",null).style("text-anchor","end");switch(this.orientation()){case"left":h.attr("transform","rotate(-90)").attr("x",-2).attr("y",2).attr("dy",".71em");break;case"right":h.attr("transform","rotate(-90)").attr("x",-2).attr("y",4).attr("dx",null).attr("dy","-.71em");break;case"top":h.attr("transform","rotate(0)").attr("x",r-2).attr("y",2).attr("dx",null).attr("dy",".71em");break;case"bottom":h.attr("transform","rotate(0)").attr("x",r-2).attr("y",-2).attr("dy",null)}h.text(this.title_exists()?this.title():""),l.exit().remove(),this.svgGuides.call(this.d3Guides).selectAll(".tick").classed("guide-0",t=>0===t&&this.low()<0)}rerender(){this.svgAxis.call(this.d3Axis),this.svgGuides.call(this.d3Guides)}postUpdate(t,e){super.postUpdate(t,e),this._guideElement&&this._guideElement.attr("transform",this._element.attr("transform"))}},L(u,"_Axis"),u);vt(We,"Axis");let $e=We;$e.prototype._class+=" chart_Axis",$e.prototype.publish("type","linear","set","Type",["none","ordinal","linear","pow","log","time"]),$e.prototype.publish("timePattern","%Y-%m-%d","string","Time Series Pattern",null,{disable:vt(t=>"time"!==t.type(),"disable")}),$e.prototype.publish("reverse",!1,"boolean","Reverse"),$e.prototype.publish("title",null,"string","Title"),$e.prototype.publish("orientation","bottom","set","Placement/orientation of the axis",["left","top","right","bottom"]),$e.prototype.publish("powExponent",2,"number","Power exponent (disabled when type is not 'pow')",null,{disable:vt(t=>"pow"!==t.type(),"disable")}),$e.prototype.publish("logBase",10,"number","Logarithmic base (disabled when type is not 'log')",null,{disable:vt(t=>"log"!==t.type(),"disable")}),$e.prototype.publish("ordinals",[],"array","Array of ordinal values to display (disabled when type is not 'ordinal')",null,{disable:vt(t=>"ordinal"!==t.type(),"disable")}),$e.prototype.publish("fontSize",null,"number","Size of tick label font (pixels)",null,{optional:!0}),$e.prototype.publish("fontFamily",null,"string","Font family of tick labels",null,{optional:!0}),$e.prototype.publish("tickCount",null,"number","Number of ticks to display (disabled when type is 'ordinal')",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("tickFormat",null,"string","Format rules for tick text (disabled when type is 'ordinal')",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("tickLength",null,"number","Height (or width for left/right orientations) of the axis ticks (in pixels)",null,{optional:!0}),$e.prototype.publish("ticks",[],"array","Custom tick labels",null,{optional:!0}),$e.prototype.publish("low",null,"any","Minimum tick value (disabled when type is ordinal)",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("high",null,"any","Maximum tick value (disabled when type is ordinal)",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("overlapMode","none","set","Specifies the behavior when tick labels overlap",["none","stagger","hide","rotate","linebreak","wrap"]),$e.prototype.publish("labelRotation",33,"number","Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')",null,{optional:!0,disable:vt(t=>"rotate"!==t.overlapMode(),"disable")}),$e.prototype.publish("shrinkToFit","both","set","shrinkToFit",["none","low","high","both"]),$e.prototype.publish("extend",5,"number","Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("hidden",!1,"boolean","Hides axis when 'true'"),$e.prototype.publish("ordinalPaddingInner",.1,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)",null,{disable:vt(t=>"ordinal"!==t.type(),"disable")}),$e.prototype.publish("ordinalPaddingOuter",.1,"number","Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)",null,{disable:vt(t=>"ordinal"!==t.type(),"disable")}),$e.prototype.publish("ordinalMappings",null,"object","Alternative label mappings (icons)",null,{optional:!0}),$e.prototype.publish("padding",0,"number","Padding space at top of axis (pixels)",null,{optional:!0}),$e.prototype._origType=$e.prototype.type,$e.prototype.type=function(t){const e=$e.prototype._origType.apply(this,arguments);return void 0!==t&&(this._type=t,this.updateScale()),e},$e.prototype._origTimePattern=$e.prototype.timePattern,$e.prototype.timePattern=function(t){const e=$e.prototype._origTimePattern.apply(this,arguments);return void 0!==t&&(this._timePattern=t,this.updateScale()),e};const qe=(p=class extends a.SVGWidget{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),a.Utility.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.domainAxis=(new $e).classed({domain:!0}).orientation_default("bottom").type("ordinal").overlapMode_default("stagger").shrinkToFit_default("high").extend_default(0),this.valueAxis=(new $e).classed({value:!0}).orientation_default("left").type("linear").shrinkToFit_default("high"),this.xyBrush=a.brush().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.xBrush=a.brushX().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.yBrush=a.brushY().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2())}_prevBrush;resetSelection(){return this._prevBrush=null,this}parseData(t){return this.domainAxis.parse(t)}parseValue(t){return this.valueAxis.parse(t,!0)}formatData(t){return this.domainAxis.format(t)}formatValue(t){return this.valueAxis.format(t)}parsedData(){return this.data().map(function(t){let e=0;return t.map(function(t,i){if(0===i)return this.parseData(t);if(i>=this.columns().length)return t;const n=this.yAxisStacked()?[e,e+this.parseValue(t)]:this.parseValue(t);return e+=this.parseValue(t),n},this)},this)}bandwidth(){return this.domainAxis.bandwidth()}svg;svgRegions;svgDomainGuide;svgValueGuide;svgData;svgDataClipRect;svgFocus;svgBrush;enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgRegions=e.append("g"),this.svgDomainGuide=this.svg.append("g"),this.svgValueGuide=this.svg.append("g"),this.svgData=this.svg.append("g"),this.svgDataClipRect=this.svg.append("clipPath").attr("id",this.id()+"_clippath").append("rect").attr("x",0).attr("y",0),this.svgData=this.svg.append("g").attr("clip-path","url(#"+this.id()+"_clippath)"),this._selection.widgetElement(this.svgData),this.svgFocus=e.append("g"),this.domainAxis.target(this.svg.node()).guideTarget(this.svgDomainGuide.node()),this.valueAxis.target(this.svg.node()).guideTarget(this.svgValueGuide.node()),this.svgBrush=e.append("g").attr("class","brush"),this.chartsEnter(this,this.svgData,250)}resizeBrushHandle(t,e,i){let n,o,s;return"e"===t.type||"w"===t.type?(n=+("e"===t.type),o=n?1:-1,s=i/3,"M"+.5*o+","+s+"A6,6 0 0 "+n+" "+6.5*o+","+(s+6)+"V"+(2*s-6)+"A6,6 0 0 "+n+" "+.5*o+","+2*s+"ZM"+2.5*o+","+(s+8)+"V"+(2*s-8)+"M"+4.5*o+","+(s+8)+"V"+(2*s-8)):(n=+("s"===t.type),s=n?1:-1,o=e/3,"M"+o+", "+.5*s+"A6,6 0 0 "+(n+1)%2+" "+(o+6)+","+6.5*s+"H"+(2*o-6)+"A6,6 0 0 "+(n+1)%2+" "+2*o+","+.5*s+"ZM"+(o+8)+","+2.5*s+"H"+(2*o-8)+"M"+(o+8)+","+4.5*s+"H"+(2*o-8))}_skipSelection=!1;skipSelection(t){return arguments.length?(this._skipSelection=t,this):this._skipSelection}brushMoved(){if(this._skipSelection)return;let t=[];const e=this,i=a.brushSelection(this.svgBrush.node());i&&(t=this.data().filter(function(t){const n=e.dataPos(t[0]);if(e.use2dSelection()){const o=e.valuePos(t[1])+e.valueAxis.bandwidth()/2;return n>=i[0][0]&&n<=i[1][0]&&o>=i[0][1]&&o<=i[1][1]}return n>=i[0]&&n<=i[1]})),this.selection(t)}brushMoved2(){const t="horizontal"===this.orientation(),e=this.use2dSelection()?[]:t?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],i=this.svgBrush.selectAll(".handle--custom").data(e),n=a.d3Event()?.selection;null==n?i.attr("display","none"):t?i.attr("display",null).attr("transform",(t,e)=>"translate("+n[e]+",0)"):i.attr("display",null).attr("transform",(t,e)=>"translate(0, "+n[e]+")")}dataPos(t){return this.domainAxis.scalePos(t)}valuePos(t){return this.valueAxis.scalePos(t)}getAxisSize(t){return{width:this.xAxis?this.xAxis.width():t.xAxis.width(),height:this.yAxis?this.yAxis.height():t.yAxis.width()}}calcMargin(t,e,i){const n={top:!i&&this.selectionMode()?10:2,right:i&&(this.selectionMode()||this.xAxisFocus())?10:2,bottom:(this.xAxisFocus()?this.xAxisFocusHeight():0)+2,left:2},o=this.width()-n.left-n.right,s=this.height()-n.top-n.bottom;let a=0,r=30,l=0,h=30;for(let c=0;c<10;++c){this.xAxis.width(o-h).height(0);const t=this.xAxis.calcOverflow(e),i=t.depth;this.yAxis.width(0).height(s-r);const n=this.yAxis.calcOverflow(e),c=n.depth;if(a=t.right,l=n.top,i===r&&c===h)break;r=i,h=c}return this.xAxis.x(o/2+h/2+n.left).y(s+n.top).width(o-h),this.yAxis.x(n.left).y(s/2-r/2+n.top).height(s-r),n.left+=h,n.top+=l,n.right+=a,n.bottom+=r,n}updateRegions(t,e,i){const n=this,o=this.svgRegions.selectAll(".region").data(this.regions());o.enter().append("rect").attr("class","region"),i?o.attr("x",function(t){return n.dataPos(t.x0)}).attr("y",0).attr("width",function(t){return n.dataPos(t.x1)-n.dataPos(t.x0)}).attr("height",this.height()).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return a.hsl(n._palette(t.colorID)).brighter()}):o.attr("x",0).attr("y",function(t){return n.dataPos(t.x0)}).attr("width",this.width()).attr("height",function(t){return n.dataPos(t.x0)-n.dataPos(t.x1)}).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return a.hsl(n._palette(t.colorID)).brighter()}),o.exit().remove()}_prevXAxisType;update(t,e){super.update(t,e);const i=this,n="horizontal"===this.orientation();if(this.updateRegions(t,e,n),this.domainAxis.orientation(n?"bottom":"left").title(this.xAxisTitle_exists()?this.xAxisTitle():this.columns()[0]),this.valueAxis.orientation(n?"left":"bottom"),this.xAxis=n?this.domainAxis:this.valueAxis,this.yAxis=n?this.valueAxis:this.domainAxis,"ordinal"===this.xAxisType()){const t=this.columns().length,e={};this.domainAxis.ordinals(this.data().map(function(n){return e[n[0]]=i.xAxisOrdinalMapping(n,n[t]),n[0]})).ordinalMappings(e)}else{const t=this.xAxisDomainLow()?this.xAxisDomainLow():this.domainAxis.parseInvert(a.min(this.parsedData(),function(t){return t[0]})),e=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert(a.max(this.parsedData(),function(t){return t[0]}));void 0!==t&&void 0!==e&&this.domainAxis.low(t).high(e)}const o=this.yAxisDomainLow()?this.yAxisDomainLow():this.valueAxis.parseInvert(a.min(this.parsedData(),function(t){return a.min(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[0]:t})})),s=this.yAxisDomainHigh()?this.yAxisDomainHigh():this.valueAxis.parseInvert(a.max(this.parsedData(),function(t){return a.max(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[1]:t})}));this.valueAxis.low(o).high(s),this.margin=this.calcMargin(t,e,n);let r=this.width()-this.margin.left-this.margin.right;r<0&&(r=0);let l=this.height()-this.margin.top-this.margin.bottom;l<0&&(l=0);const h=n?r:l,c=n?l:r;if(this.domainAxis.tickLength(this.xAxisGuideLines()?c:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?h:0).render(),this.svgDataClipRect.attr("width",r).attr("height",l),this.svgData.transition().attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.updateBrush(r,l,h,n),this.updateFocusChart(t,e,this.margin,r,l,n),this.chartsUpdate(r,l,250),this.selectionMode())return this.brushMoved()}updateBrush(t,e,i,n){const o=this.use2dSelection()?this.xyBrush:n?this.xBrush:this.yBrush,s=a.brushSelection(this.svgBrush.node());o.extent([[0,0],[t,e]]),this.svgBrush.attr("transform","translate("+this.margin.left+", "+this.margin.top+")").style("display",this.selectionMode()?null:"none").call(o);const r=this.use2dSelection()?[]:n?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],l=this.svgBrush.selectAll(".handle--custom").data(r);if(l.enter().append("path").attr("class","handle--custom").merge(l).attr("cursor",n?"ew-resize":"ns-resize").attr("d",i=>this.resizeBrushHandle(i,t,e)),this.selectionMode()){if(this._prevXAxisType!==this.xAxisType()&&(this._prevXAxisType=this.xAxisType(),this._prevBrush=null),this._prevBrush){if(s){if(this._prevBrush.orientation!==this.orientation()){const t=s[0];s[0]=this._prevBrush.maxCurrExtent-s[1],s[1]=this._prevBrush.maxCurrExtent-t}const t=i/this._prevBrush.maxCurrExtent;1!==t&&this.svgBrush.transition().on("start",function(){o.on("end",null)}).call(o.move,[s[0]*t,s[1]*t]).on("end",()=>{o.on("end",()=>this.brushMoved())})}}else this.svgBrush.call(o.move,[0,i]);this._prevBrush={orientation:this.orientation(),maxCurrExtent:i}}}updateFocusChart(t,e,i,n,o,s){const a=this,r=this.svgFocus.selectAll("#"+this.id()+"_focusChart").data(this.xAxisFocus()?[!0]:[]);r.enter().append("g").attr("id",this.id()+"_focusChart").attr("class","focus").each(function(){a.focusChart=(new a.constructor).target(this),a.focusChart.xBrush.on("brush.focus",function(){a.syncAxis(n),a.chartsUpdate(n,o,0)}),a.focusChart.layers(a.layers().map(t=>new t.constructor))}).merge(r).each(function(){a.copyPropsTo(a.focusChart,["layers"]);let t=0;for(const e of a.layers())e.copyPropsTo(a.focusChart.layers()[t]),t++;a.focusChart.xAxisFocus(!1).selectionMode(!0).skipSelection(!0).orientation("horizontal").xAxisGuideLines(!1).xAxisDomainLow(null).xAxisDomainHigh(null).yAxisGuideLines(!1).x(a.width()/2).y(a.height()-a.xAxisFocusHeight()/2).width(a.width()).height(a.xAxisFocusHeight()).columns(a.columns()).data(a.data()).render(),a.syncAxis(n)}),r.exit().each(function(){a.focusChart&&(a.focusChart.target(null),delete a.focusChart)}).remove()}syncAxis(t){const e=a.brushSelection(this.focusChart.svgBrush.node());if(e){if("ordinal"!==this.focusChart.xAxisType())this.xAxis.domain([this.focusChart.xAxis.invert(e[0]),this.focusChart.xAxis.invert(e[1])]);else{const i=(e[1]-e[0])/t;this.xAxis.range([-e[0]/i,(t-e[0])/i])}this.xAxis.rerender()}}layerColumns(t){const e=t.columns(),i=super.columns().filter(t=>t!==e[0]);return i.length?[e[0],...i]:e}layerColumnIndices(t){const e=t.columns();return this.layerColumns(t).map(t=>e.indexOf(t))}layerColumnIndex(t,e){return t.columns().indexOf(e)}layerData(t){if(1===arguments.length){const e=this.layerColumnIndices(t);return t.data().map(t=>{const i=e.map(e=>t[e]);return i.__hpcc_origRow=t,i})}throw new Error("Setting data on XYAxisLayer is not supported.")}layerEnter(t,e,i=250){}layerUpdate(t,e,i=250){}layerExit(t,e,i=250){}chartsEnter(t,e,i=250){this.layerEnter(this,e,i);for(const n of this.layers())n.__xyAxisElement=e.append("g").attr("class",n.class()),n.target(n.__xyAxisElement.node()).layerEnter(this,e,i)}chartsUpdate(t,e,i){this.layerUpdate(this,this.svgData,i);for(const n of this.layers())n.resize({width:t,height:e}).layerUpdate(this,n.__xyAxisElement,i)}exit(t,e){this.valueAxis.target(null),this.domainAxis.target(null),super.exit(t,e)}selection(t){const e=this;this._selection.widgetElement().selectAll(".selected,.deselected").each(function(i){const n=t.indexOf(i.origRow)>=0;a.select(this).classed("selected",n).classed("deselected",!n).attr("filter",e._selection.svgGlowID()&&n?`url(#${e._selection.svgGlowID()})`:null)});const i=t.map(t=>this.rowToObj(t));setTimeout(()=>{this.click(i,"",!0)},0)}xAxisOrdinalMapping(t,e){return t[0]}click(t,e,i){}_selection},L(p,"_XYAxis"),p);vt(qe,"XYAxis");let Ge=qe;Ge.prototype._class+=" chart_XYAxis",Ge.prototype.mixin(a.Utility.SimpleSelectionMixin),Ge.prototype.publish("orientation","horizontal","set","Selects orientation for the axis",["horizontal","vertical"]),Ge.prototype.publish("pointSizeColumn",null,"string","pointSizeColumn",null,{optional:!0}),Ge.prototype.publish("minPointSize",6,"number","minPointSize"),Ge.prototype.publish("maxPointSize",26,"number","maxPointSize"),Ge.prototype.publish("use2dSelection",!1,"boolean","2D Range Selector"),Ge.prototype.publish("selectionMode",!1,"boolean","Range Selector"),Ge.prototype.publishProxy("xAxisTitle","domainAxis","title"),Ge.prototype.publishProxy("xAxisTickCount","domainAxis","tickCount"),Ge.prototype.publishProxy("xAxisTickFormat","domainAxis","tickFormat"),Ge.prototype.publishProxy("xAxisTicks","domainAxis","ticks"),Ge.prototype.publishProxy("xAxisType","domainAxis","type"),Ge.prototype.publishProxy("xAxisTypeTimePattern","domainAxis","timePattern"),Ge.prototype.publish("xAxisDomainLow",null,"string","X-Axis Low",null,{optional:!0,disable:vt(t=>"ordinal"===t.xAxisType(),"disable")}),Ge.prototype.publish("xAxisDomainHigh",null,"string","X-Axis High",null,{optional:!0,disable:vt(t=>"ordinal"===t.xAxisType(),"disable")}),Ge.prototype.publishProxy("xAxisFontSize","domainAxis","fontSize"),Ge.prototype.publishProxy("xAxisFontFamily","domainAxis","fontFamily"),Ge.prototype.publishProxy("xAxisOrdinalPaddingInner","domainAxis","ordinalPaddingInner"),Ge.prototype.publishProxy("xAxisOrdinalPaddingOuter","domainAxis","ordinalPaddingOuter"),Ge.prototype.publishProxy("xAxisOverlapMode","domainAxis","overlapMode"),Ge.prototype.publishProxy("xAxisLabelRotation","domainAxis","labelRotation"),Ge.prototype.publishProxy("xAxisDomainPadding","domainAxis","extend"),Ge.prototype.publish("xAxisGuideLines",!1,"boolean","Y-Axis Guide Lines"),Ge.prototype.publish("xAxisFocus",!1,"boolean","X-Axis Focus",null,{disable:vt(t=>"horizontal"!==t.orientation(),"disable")}),Ge.prototype.publish("xAxisFocusHeight",80,"number","X-Axis Focus Height",null,{disable:vt(t=>!t.xAxisFocus(),"disable")}),Ge.prototype.publishProxy("xAxisHidden","domainAxis","hidden"),Ge.prototype.publishProxy("yAxisFontSize","valueAxis","fontSize"),Ge.prototype.publishProxy("yAxisFontFamily","valueAxis","fontFamily"),Ge.prototype.publishProxy("yAxisTitle","valueAxis","title"),Ge.prototype.publishProxy("yAxisTickCount","valueAxis","tickCount"),Ge.prototype.publishProxy("yAxisTickFormat","valueAxis","tickFormat"),Ge.prototype.publishProxy("yAxisTicks","valueAxis","ticks"),Ge.prototype.publishProxy("yAxisType","valueAxis","type"),Ge.prototype.publishProxy("yAxisTypeTimePattern","valueAxis","timePattern"),Ge.prototype.publishProxy("yAxisTypePowExponent","valueAxis","powExponent"),Ge.prototype.publishProxy("yAxisTypeLogBase","valueAxis","logBase"),Ge.prototype.publish("yAxisStacked",!1,"boolean","Stacked Chart",null,{tags:["Basic"],disable:vt(t=>"ordinal"!==t.xAxisType()||t._class.indexOf("chart_Column")<0,"disable")}),Ge.prototype.publish("yAxisDomainLow",null,"string","Y-Axis Low",null,{optional:!0,disable:vt(t=>"ordinal"===t.yAxisType(),"disable")}),Ge.prototype.publish("yAxisDomainHigh",null,"string","Y-Axis High",null,{optional:!0,disable:vt(t=>"ordinal"===t.yAxisType(),"disable")}),Ge.prototype.publishProxy("yAxisDomainPadding","valueAxis","extend"),Ge.prototype.publish("yAxisGuideLines",!0,"boolean","Y-Axis Guide Lines"),Ge.prototype.publishProxy("yAxisHidden","valueAxis","hidden"),Ge.prototype.publish("regions",[],"array","Regions"),Ge.prototype.publish("layers",[],"widgetArray","Layers",null,{render:!1}),Ge.prototype.publishProxy("xAxisPadding","domainAxis","padding"),Ge.prototype.publishProxy("yAxisPadding","valueAxis","padding");const Ue=(d=class extends Ge{constructor(){super(),ft.call(this),_t.call(this),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}curve(){switch(this.interpolate()){case"linear":return Jt;case"step":return Me;case"step-before":return Te;case"step-after":return Pe;case"basis":return le;case"bundle":return ce;case"cardinal":return de;case"catmullRom":return _e;case"natural":return Ae;default:return we}}getScale(){switch(this.pointSizeScale()){case"linear":return a.scaleLinear();case"pow":return a.scalePow().exponent(2);case"log":return a.scaleLog();case"sqrt":return a.scaleSqrt()}}pointColor(t,e,i,n){return this.interpolate()&&this.pointDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}lineColor(t,e,i,n){return this.interpolateFill()&&this.interpolateDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}areaColor(t,e,i,n){return this.fillColor(t,e,i,n)}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(t){return"series-table"===n.tooltipStyle()?n.tooltipFormat({label:t.label,arr:n.columns().slice(1).map(function(e,i){return{label:e,color:n._palette(e),value:n.data()[t.rowIdx][i+1]}})}):n.tooltipFormat({label:t.label,series:t.column,value:t.value})})}_prevPointShape;layerUpdate(t,e,i=250){super.layerUpdate(t,e);const n="horizontal"===t.orientation(),o=n?this.height():this.width(),s=this;function r(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}let l,h,c;L(r,"r"),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._prevPointShape!==this.pointShape()&&(e.selectAll(".data").remove(),this._prevPointShape=this.pointShape()),vt(r,"mapShape"),this.pointSizeColumn_exists()&&(l=this.columns().indexOf(this.pointSizeColumn()),h=a.extent(this.data(),t=>t[l]),c=this.getScale().domain(h));const u=this.layerColumns(t),p=this.layerData(t),d=this.flattenData(u,p).map(function(t){return t.shape=r(s.pointShape()),t.column=u[t.colIdx],t.row=p[t.rowIdx],t.origRow=p[t.rowIdx].__hpcc_origRow,h?(t.size=c(t.row[l])*(s.maxPointSize()-s.minPointSize())+s.minPointSize(),t.column!==s.pointSizeColumn()&&t):(t.size=s.pointSize(),t)}).filter(t=>t),f=e.selectAll(".area").data(u.filter(function(t,e){return s.interpolate()&&s.interpolateFill()&&e>0})),y=f.enter().append("path"),_=ie().curve(this.curve());n?_.x(function(e){return s.xPos(t,e)}).y0(Math.min(o,this.yPos(t,{value:0}))).y1(function(e){return s.yPos(t,e)}):_.y(function(e){return s.yPos(t,e)}).x0(Math.max(0,this.xPos(t,{value:0}))).x1(function(e){return s.xPos(t,e)}),y.merge(f).attr("class",t=>"area series series-"+this.cssTag(t)).each(function(t,e){a.select(this).attr("d",_(d.filter(function(t){return t.colIdx===e+1}))).style("opacity",s.interpolateFillOpacity()).style("stroke","none").style("fill",s.areaColor([],t,void 0,[]))}),f.exit().remove();const x=e.selectAll(".line").data(u.filter(function(t,e){return s.interpolate()&&e>0})),m=x.enter().append("path"),g=ee().x(function(e){return s.xPos(t,e)}).y(function(e){return s.yPos(t,e)}).curve(this.curve());m.merge(x).attr("class",t=>"line series series-"+this.cssTag(t)).each(function(t,e){const i=a.select(this),n=d.filter(function(t){return t.colIdx===e+1});i.attr("d",g(n)).style("stroke",s.lineColor([],t,void 0,[])).style("fill","none")}),x.exit().remove();const b=e.selectAll(".point").data(d,function(t,e){return t.shape+"_"+e});b.enter().append("g").each(function(e){const i=a.select(this);i.append(e.shape).attr("class","pointShape"),i.append("text").attr("class","pointValue").style("display","none").attr("text-anchor",s.valueAnchor()).attr("alignment-baseline",s.valueBaseline()).attr("fill",function(t,e){return"middle"===s.valueBaseline()||"central"===s.valueBaseline()?s.textColor(t.row,t.column,t.value,t.origRow):null}),i.append("circle").attr("class","pointSelection").on("mouseout.tooltip",s.tooltip.hide).on("mousemove.tooltip",s.tooltip.show).call(t._selection.enter.bind(t._selection)).on("click",function(e,i){s.click(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))}).on("dblclick",function(e,i){s.dblclick(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))})}).merge(b).attr("class",t=>"point series series-"+this.cssTag(t.column)).each(function(e){a.select(this).select(".pointValue").attr("x",function(e){return s.xPos(t,e)}).attr("y",function(e){return s.yPos(t,e)}).style("display",s.showValue()?"block":"none").attr("text-anchor",s.valueAnchor()).attr("alignment-baseline",s.valueBaseline()).text(function(t){return t.value}),a.select(this).select(".pointSelection").attr("cx",function(e){return s.xPos(t,e)}).attr("cy",function(e){return s.yPos(t,e)}).attr("r",e.size);const i=a.select(this).select(".pointShape");switch(e.shape){case"rect":i.attr("x",function(i){return s.xPos(t,i)-e.size/2}).attr("y",function(i){return s.yPos(t,i)-e.size/2}).attr("width",e.size).attr("height",e.size).style("fill",s.pointColor(e.row,e.column,e.value,e.origRow));break;case"circle":i.attr("cx",function(e){return s.xPos(t,e)}).attr("cy",function(e){return s.yPos(t,e)}).attr("r",.9*e.size).style("fill",s.pointColor(e.row,e.column,e.value,e.origRow));break;case"path":i.attr("d",function(i){return"M"+(s.xPos(t,i)-e.size/2)+" "+(s.yPos(t,i)-e.size/2)+" L"+(s.xPos(t,i)+e.size/2)+" "+(s.yPos(t,i)+e.size/2)+" M"+(s.xPos(t,i)-e.size/2)+" "+(s.yPos(t,i)+e.size/2)+" L"+(s.xPos(t,i)+e.size/2)+" "+(s.yPos(t,i)-e.size/2)}).style("stroke",s.pointColor(e.row,e.column,e.value,e.origRow))}}),b.exit().remove()}exit(t,e){super.exit(t,e)}},L(d,"_Scatter"),d);vt(Ue,"Scatter"),wt(Ue,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number",multi:!0}]);let Xe=Ue;Xe.prototype._class+=" chart_Scatter",Xe.prototype.implements(ft.prototype),Xe.prototype.implements(_t.prototype),Xe.prototype.publish("paletteID","default","set","Color palette for this widget",Xe.prototype._palette.switch(),{tags:["Basic","Shared"]}),Xe.prototype.publish("pointSizeScale","linear","set","pointSizeScale",["linear","pow","log","sqrt"]),Xe.prototype.publish("pointShape","cross","set","Shape of the data points",["circle","rectangle","cross"]),Xe.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),Xe.prototype.publish("interpolate","","set","Interpolate Data",["","linear","step","step-before","step-after","basis","bundle","cardinal","catmullRom","natural","monotone"]),Xe.prototype.publish("pointDarken",!0,"boolean","If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color",null,{disable:vt(t=>!t.interpolate(),"disable")}),Xe.prototype.publish("interpolateDarken",!0,"boolean","If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color",null,{disable:vt(t=>!t.interpolateFill(),"disable")}),Xe.prototype.publish("interpolateFill",!1,"boolean","If true, the area between the line and zero will be filled"),Xe.prototype.publish("interpolateFillOpacity",.66,"number","Fill interpolation Opacity",null,{range:{min:0,step:.01,max:1}}),Xe.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Xe.prototype.publish("showValue",!1,"boolean"),Xe.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),Xe.prototype.publish("valueBaseline","ideographic","set","alignment-baseline for shown value text",["auto","baseline","before-edge","text-before-edge","middle","central","after-edge","text-after-edge","ideographic","alphabetic","hanging","mathematical","inherit"]);const Ye=(L(f=class extends Xe{constructor(){super(),this.interpolate_default("linear").interpolateFill_default(!0)}},"_Area"),f);vt(Ye,"Area"),Ye.prototype._class+=" chart_Area";const Qe=(y=class extends Ge{_linearGap;textLocal=a.local();stackedTextLocal=a.local();isHorizontal;constructor(){super(),ft.call(this),_t.call(this),this._selection.skipBringToTop(!0),this._linearGap=25}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(e){if("series-table"===n.tooltipStyle())return n.tooltipFormat({label:e.row[0],arr:n.columns().slice(1).map(function(t,i){return{label:t,color:n._palette(t),value:e.row[i+1]}})});{let i=e.row[e.idx];return i instanceof Array&&(i=i[1]-i[0]),n.tooltipFormat({label:e.row[0],series:n.layerColumns(t)[e.idx],value:i})}})}adjustedData(t){return this.layerData(t).map(e=>{let i=0;return e.map((e,n)=>{if(0===n)return e;if(n>=this.layerColumns(t).length)return e;const o=t.yAxisStacked()?[i,i+e]:e;return i+=e,o},this)},this)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n="horizontal"===t.orientation();this.isHorizontal=n;const o=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const s=a.format(o.showValueAsPercentFormat());let r=10,l=0;switch(t.xAxisType()){case"ordinal":r=t.bandwidth(),l=-r/2;break;case"linear":case"time":r=Math.max(Math.abs(t.dataPos(2)-t.dataPos(1))*(100-this._linearGap)/100,r),l=-r/2}this.tooltip.direction(n?"n":"e");const h=a.scaleBand().domain(o.layerColumns(t).filter(function(t,e){return e>0})).rangeRound(n?[0,r]:[r,0]).paddingInner(this.xAxisSeriesPaddingInner()).paddingOuter(0);let c=[];const u=[],p=this.columns().length,d=this.data();this.showValue()&&"series"===this.showValueAsPercent()&&d.forEach(t=>{t.filter((t,e)=>e>0&&e<p).forEach((t,e)=>{void 0===u[e+1]&&(u[e+1]=0),u[e+1]+=t})}),(this.showDomainTotal()||this.showValue()&&"domain"===this.showValueAsPercent())&&(c=d.map(t=>t.filter((t,e)=>e>0&&e<p).reduce((t,e)=>t+e,0)));const f=e.selectAll(".dataRow").data(this.adjustedData(t)),y=t.data(),_=this.getAxisSize(t);f.enter().append("g").attr("class","dataRow").merge(f).each(function(e,d){const f=a.select(this),x=f.selectAll(".dataCell").data(e.filter(function(e,i){return i<o.layerColumns(t).length}).map(function(i,n){return{column:o.layerColumns(t)[n],row:e,origRow:y[d],value:i,idx:n}}).filter(function(t){return null!==t.value&&t.idx>0}),t=>t.column),m=x.enter().append("g").attr("class","dataCell").on("mouseout.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.hide.apply(o,arguments)}).on("mousemove.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.show.apply(o,arguments)}).call(t._selection.enter.bind(t._selection)).on("click",function(e){o.click(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).on("dblclick",function(e){o.dblclick(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).style("opacity",0).each(function(t){const e=a.select(this);e.append("rect").attr("class","columnRect series series-"+o.cssTag(t.column)),e.append("text").attr("class","columnRectText").style("stroke","transparent")});m.transition().duration(i).style("opacity",1);const g=t.yAxisStacked()?r:h.bandwidth();m.merge(x).each(function(r){const f=a.select(this),y=t.dataPos(e[0])+(t.yAxisStacked()?0:h(r.column))+l,x=r.value instanceof Array?r.value[1]:r.value;let m=r.origRow[r.idx];if(o.showValue()){const t=o.dataMeta();switch(o.showValueAsPercent()){case"series":const e=void 0!==t.sum?t.sum:u[r.idx];m=s(m/e);break;case"domain":const i=void 0!==t.sum?t.sum:c[d];m=s(m/i);break;default:m=a.format(o.showValueFormat())(m)}}const b=t.valuePos(x),v=t.valuePos(r.value instanceof Array?r.value[0]:0),w=Math.min(v,b),S=Math.abs(b-v),k=o.innerTextFontSize(),A=o.innerTextPadding_exists()?o.innerTextPadding():k/2.5,C=o.intersectRectRect({x:n?y:w,y:n?w:y,width:n?g:S,height:n?S:g},{x:0,y:0,width:_.width,height:_.height}),M=f.select("rect").transition().duration(i).style("fill",t=>o.fillColor(t.row,t.column,t.value,t.origRow));n?M.attr("x",y).attr("y",w).attr("width",g).attr("height",S):M.attr("y",y).attr("x",w).attr("height",g).attr("width",S);const T=f.select("text").transition().duration(i).style("font-size",k+"px").style("fill",t=>o.textColor(t.row,t.column,t.value,t.origRow));T.style("font-family",o.innerTextFontFamily_exists()?o.innerTextFontFamily():null);const P=o.innerTextPadding_exists()?o.innerTextPadding():8,I=k/2.7;if(n){const t=C.y+C.height-A;T.attr("x",y+g/2).attr("y",t+I).attr("transform",`rotate(-90, ${y+g/2}, ${t})`)}else T.attr("x",C.x+P).attr("y",y+g/2+I);T.attr("height",g).attr("width",S),o.showInnerText()&&T.text(t=>{const e=o.innerText(t.origRow,t.origRow[p],t.idx);if(e){const i=n?C.height:C.width,s=o.calcInnerText(i,e,m);return t.innerTextObj=s,s.text}return""});const E=f.selectAll(".dataText").data(o.showValue()?[`${x}`]:[]);E.enter().append("g").attr("class","dataText").each(function(t){o.textLocal.set(this,(new a.Text).target(this).colorStroke_default("transparent"))}).merge(E).each(function(){const t={x:0,y:0},e=o.valueFontFamily(),i=o.valueFontSize(),s=o.textSize(m,e,i),a=parseFloat(m)>=0;let l=o.valueAnchor()?o.valueAnchor():n?"middle":"start";const h=C.x,c=_.width-(C.x+C.width),u=C.y,p=_.height-(C.y+C.height);let d,f,x;if(r.innerTextObj){const{padding:e,valueTextWidth:o}=r.innerTextObj;f=!1,n?(l="middle",t.x=y+g/2,4===r.innerTextObj.category?(f=!0,t.y=w-e-i/2):t.y=w+e+i/2):(l="start",4===r.innerTextObj.category?(f=!0,t.x=S+w+e):t.x=S+w-o-e,t.y=y+g/2)}else n?(d=C.height<s.height,f=!o.valueCentered()||d,t.x=C.x+C.width/2,f?a?(x=u<s.height+P,x?d?t.y=C.y+C.height+s.height:(f=!1,t.y=C.y+C.height/2):t.y=C.y-s.height/2-P):(x=p<s.height,x?d?t.y=C.y-s.height/2-P:(f=!1,t.y=C.y+C.height/2):t.y=C.y+s.height+P):t.y=C.y+C.height/2):(d=C.width<s.width,f=!o.valueCentered()||d,t.y=C.y+C.height/2,f?a?(x=c<s.width+P,x?o.showInnerText()||!d?(f=!1,t.x=C.x+C.width/2):t.x=C.x-(s.width-P):t.x=C.x+C.width+s.width/2+P):(x=h<s.width,x?o.showInnerText()||!d?(f=!1,t.x=C.x+C.width/2):t.x=C.x+C.width+(s.width-P):t.x=C.x-(s.width-P)):t.x=C.x+C.width/2);const b=f?null:o.textColor(r.row,r.column,r.value,r.origRow),v=o.columns(),k=o.yAxisStacked()&&d||f&&o.yAxisStacked()&&v.indexOf(r.column)!==v.length-1;o.textLocal.get(this).pos(t).anchor(l).fontFamily(e).fontSize(i).text(`${m}`).colorFill(b).visible(o.showValue()&&!k).render()}),E.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),x.exit().transition().duration(i).style("opacity",0).remove();const b=t.yAxisStacked()?c[d]:Math.max(...e.filter((t,e)=>e>0&&e<p)),v=f.selectAll(".stackedTotalText").data(o.showDomainTotal()?[c[d]]:[]);v.enter().append("g").attr("class","stackedTotalText").each(function(t){o.stackedTextLocal.set(this,(new a.Text).target(this).colorStroke_default("transparent"))}).merge(v).each(function(i){const s={x:0,y:0},a=t.dataPos(e[0]),r=t.valuePos(b),l=o.valueFontFamily(),h=o.valueFontSize(),c=o.textSize(i,l,h),u=parseFloat(i)>=0;let p="middle";n?(s.x=a,s.y=u?r-c.height/2:r+c.height/2):(p="start",s.y=a,s.x=u?r+c.width/2:r-c.width/2),o.stackedTextLocal.get(this).pos(s).anchor(p).fontFamily(l).fontSize(h).text(i).render()}),v.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),f.exit().transition().duration(i).remove()}calcInnerText(t,e,i){const n=this.innerTextFontFamily_exists()?this.innerTextFontFamily():"Verdana",o=this.innerTextFontSize(),s=this.valueFontFamily_exists()?this.valueFontFamily():"Verdana",a=this.valueFontSize(),r=this.innerTextPadding_exists()?this.innerTextPadding():o/2.5,l=this.isHorizontal?a:this.textSize(i,s,a).width,h=e,c=3*r+this.textSize("...",n,o).width+l,u=1*r+l;let p=4;if(3*r+this.textSize(e,n,o).width+l<t)p=1;else if(c<t){const i=t-c;let s="";for(const t of e){if(this.textSize(s+t,n,o).width>i){e=s+"...";break}s+=t}p=2}else u<t?(e="",p=3):e="";return{text:e,isTruncated:h!==e,padding:r,category:p,valueTextWidth:l}}innerText(t,e,i){return t[0]}},L(y,"_Column"),y);vt(Qe,"Column"),wt(Qe,"__inputs",[{id:"label",type:"string"},{id:"values",type:"number",multi:!0}]);let Ze=Qe;Ze.prototype._class+=" chart_Column",Ze.prototype.implements(ft.prototype),Ze.prototype.implements(_t.prototype),Ze.prototype.publish("valueFontFamily",null,"string","Font family of value text",null,{optional:!0}),Ze.prototype.publish("valueFontSize",12,"number","Height of value text (pixels)"),Ze.prototype.publish("innerTextFontFamily",null,"string","Font family of inner text",null,{optional:!0}),Ze.prototype.publish("innerTextPadding",8,"number","Offset of inner text (pixels)",null,{optional:!0}),Ze.prototype.publish("innerTextFontSize",12,"number","Height of inner text (pixels)"),Ze.prototype.publish("paletteID","default","set","Color palette for this widget",()=>Ze.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ze.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ze.prototype.publish("showValue",!1,"boolean","Show Value in column"),Ze.prototype.publish("showInnerText",!1,"boolean","Show Label in column"),Ze.prototype.publish("showValueFormat",",","string","D3 Format for Value",null,{disable:vt(t=>!t.showValue()||!!t.showValueAsPercent(),"disable")}),Ze.prototype.publish("showValueAsPercent",null,"set","If showValue is true, optionally show value as a percentage by Series or Domain",[null,"series","domain"],{disable:vt(t=>!t.showValue(),"disable"),optional:!0}),Ze.prototype.publish("showValueAsPercentFormat",".0%","string","D3 Format for %",null,{disable:vt(t=>!t.showValue()||!t.showValueAsPercent(),"disable")}),Ze.prototype.publish("showDomainTotal",!1,"boolean","Show Total Value for Stacked Columns",null),Ze.prototype.publish("valueCentered",!1,"boolean","Show Value in center of column"),Ze.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),Ze.prototype.publish("xAxisSeriesPaddingInner",0,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)"),Ze.prototype.publish("tooltipInnerTextEllipsedOnly",!1,"boolean","Show tooltip only when inner text is truncated with an ellipsis");const Je=(L(_=class extends Ze{constructor(){super(),this.orientation_default("vertical")}},"_Bar"),_);vt(Je,"Bar");let Ke=Je;function ti(t){var e=0,i=t.children,n=i&&i.length;if(n)for(;--n>=0;)e+=i[n].value;else e=1;t.value=e}function ei(){return this.eachAfter(ti)}function ii(t){var e,i,n,o,s=this,a=[s];do{for(e=a.reverse(),a=[];s=e.pop();)if(t(s),i=s.children)for(n=0,o=i.length;n<o;++n)a.push(i[n])}while(a.length);return this}function ni(t){for(var e,i,n=this,o=[n];n=o.pop();)if(t(n),e=n.children)for(i=e.length-1;i>=0;--i)o.push(e[i]);return this}function oi(t){for(var e,i,n,o=this,s=[o],a=[];o=s.pop();)if(a.push(o),e=o.children)for(i=0,n=e.length;i<n;++i)s.push(e[i]);for(;o=a.pop();)t(o);return this}function si(t){return this.eachAfter(function(e){for(var i=+t(e.data)||0,n=e.children,o=n&&n.length;--o>=0;)i+=n[o].value;e.value=i})}function ai(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function ri(t){for(var e=this,i=li(e,t),n=[e];e!==i;)e=e.parent,n.push(e);for(var o=n.length;t!==i;)n.splice(o,0,t),t=t.parent;return n}function li(t,e){if(t===e)return t;var i=t.ancestors(),n=e.ancestors(),o=null;for(t=i.pop(),e=n.pop();t===e;)o=t,t=i.pop(),e=n.pop();return o}function hi(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function ci(){var t=[];return this.each(function(e){t.push(e)}),t}function ui(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function pi(){var t=this,e=[];return t.each(function(i){i!==t&&e.push({source:i.parent,target:i})}),e}function di(t,e){var i,n,o,s,a,r=new mi(t),l=+t.value&&(r.value=t.value),h=[r];for(null==e&&(e=yi);i=h.pop();)if(l&&(i.value=+i.data.value),(o=e(i.data))&&(a=o.length))for(i.children=new Array(a),s=a-1;s>=0;--s)h.push(n=i.children[s]=new mi(o[s])),n.parent=i,n.depth=i.depth+1;return r.eachBefore(xi)}function fi(){return di(this).eachBefore(_i)}function yi(t){return t.children}function _i(t){t.data=t.data.data}function xi(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function mi(t){this.data=t,this.depth=this.height=0,this.parent=null}L(ti,"Ce"),L(ei,"ze"),L(ii,"Fe"),L(ni,"Ie"),L(oi,"Ee"),L(si,"Oe"),L(ai,"Re"),L(ri,"De"),L(li,"je"),L(hi,"Ne"),L(ci,"Le"),L(ui,"Be"),L(pi,"$e"),L(di,"He"),L(fi,"qe"),L(yi,"Ve"),L(_i,"We"),L(xi,"Ge"),L(mi,"Xe"),Ke.prototype._class+=" chart_Bar",vt(ti,"count"),vt(ei,"node_count"),vt(ii,"node_each"),vt(ni,"node_eachBefore"),vt(oi,"node_eachAfter"),vt(si,"node_sum"),vt(ai,"node_sort"),vt(ri,"node_path"),vt(li,"leastCommonAncestor"),vt(hi,"node_ancestors"),vt(ci,"node_descendants"),vt(ui,"node_leaves"),vt(pi,"node_links"),vt(di,"hierarchy"),vt(fi,"node_copy"),vt(yi,"defaultChildren"),vt(_i,"copyData"),vt(xi,"computeHeight"),vt(mi,"Node$1"),mi.prototype=di.prototype={constructor:mi,count:ei,each:ii,eachAfter:oi,eachBefore:ni,sum:si,sort:ai,path:ri,ancestors:hi,descendants:ci,leaves:ui,links:pi,copy:fi};var gi=Array.prototype.slice;function bi(t){for(var e,i,n=t.length;n;)i=Math.random()*n--|0,e=t[n],t[n]=t[i],t[i]=e;return t}function vi(t){for(var e,i,n=0,o=(t=bi(gi.call(t))).length,s=[];n<o;)e=t[n],i&&ki(i,e)?++n:(i=Ci(s=wi(s,e)),n=0);return i}function wi(t,e){var i,n;if(Ai(e,t))return[e];for(i=0;i<t.length;++i)if(Si(e,t[i])&&Ai(Ti(t[i],e),t))return[t[i],e];for(i=0;i<t.length-1;++i)for(n=i+1;n<t.length;++n)if(Si(Ti(t[i],t[n]),e)&&Si(Ti(t[i],e),t[n])&&Si(Ti(t[n],e),t[i])&&Ai(Pi(t[i],t[n],e),t))return[t[i],t[n],e];throw new Error}function Si(t,e){var i=t.r-e.r,n=e.x-t.x,o=e.y-t.y;return i<0||i*i<n*n+o*o}function ki(t,e){var i=t.r-e.r+1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function Ai(t,e){for(var i=0;i<e.length;++i)if(!ki(t,e[i]))return!1;return!0}function Ci(t){switch(t.length){case 1:return Mi(t[0]);case 2:return Ti(t[0],t[1]);case 3:return Pi(t[0],t[1],t[2])}}function Mi(t){return{x:t.x,y:t.y,r:t.r}}function Ti(t,e){var i=t.x,n=t.y,o=t.r,s=e.x,a=e.y,r=e.r,l=s-i,h=a-n,c=r-o,u=Math.sqrt(l*l+h*h);return{x:(i+s+l/u*c)/2,y:(n+a+h/u*c)/2,r:(u+o+r)/2}}function Pi(t,e,i){var n=t.x,o=t.y,s=t.r,a=e.x,r=e.y,l=e.r,h=i.x,c=i.y,u=i.r,p=n-a,d=n-h,f=o-r,y=o-c,_=l-s,x=u-s,m=n*n+o*o-s*s,g=m-a*a-r*r+l*l,b=m-h*h-c*c+u*u,v=d*f-p*y,w=(f*b-y*g)/(2*v)-n,S=(y*_-f*x)/v,k=(d*g-p*b)/(2*v)-o,A=(p*x-d*_)/v,C=S*S+A*A-1,M=2*(s+w*S+k*A),T=w*w+k*k-s*s,P=-(C?(M+Math.sqrt(M*M-4*C*T))/(2*C):T/M);return{x:n+w+S*P,y:o+k+A*P,r:P}}function Ii(t,e,i){var n,o,s,a,r=t.x-e.x,l=t.y-e.y,h=r*r+l*l;h?(o=e.r+i.r,o*=o,a=t.r+i.r,o>(a*=a)?(n=(h+a-o)/(2*h),s=Math.sqrt(Math.max(0,a/h-n*n)),i.x=t.x-n*r-s*l,i.y=t.y-n*l+s*r):(n=(h+o-a)/(2*h),s=Math.sqrt(Math.max(0,o/h-n*n)),i.x=e.x+n*r-s*l,i.y=e.y+n*l+s*r)):(i.x=e.x+i.r,i.y=e.y)}function Ei(t,e){var i=t.r+e.r-1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function Fi(t){var e=t._,i=t.next._,n=e.r+i.r,o=(e.x*i.r+i.x*e.r)/n,s=(e.y*i.r+i.y*e.r)/n;return o*o+s*s}function Di(t){this._=t,this.next=null,this.previous=null}function zi(t){if(!(o=t.length))return 0;var e,i,n,o,s,a,r,l,h,c,u;if((e=t[0]).x=0,e.y=0,!(o>1))return e.r;if(i=t[1],e.x=-i.r,i.x=e.r,i.y=0,!(o>2))return e.r+i.r;Ii(i,e,n=t[2]),e=new Di(e),i=new Di(i),n=new Di(n),e.next=n.previous=i,i.next=e.previous=n,n.next=i.previous=e;t:for(r=3;r<o;++r){Ii(e._,i._,n=t[r]),n=new Di(n),l=i.next,h=e.previous,c=i._.r,u=e._.r;do{if(c<=u){if(Ei(l._,n._)){i=l,e.next=i,i.previous=e,--r;continue t}c+=l._.r,l=l.next}else{if(Ei(h._,n._)){(e=h).next=i,i.previous=e,--r;continue t}u+=h._.r,h=h.previous}}while(l!==h.next);for(n.previous=e,n.next=i,e.next=i.previous=i=n,s=Fi(e);(n=n.next)!==i;)(a=Fi(n))<s&&(e=n,s=a);i=e.next}for(e=[i._],n=i;(n=n.next)!==i;)e.push(n._);for(n=vi(e),r=0;r<o;++r)(e=t[r]).x-=n.x,e.y-=n.y;return n.r}function Ri(t){return null==t?null:Oi(t)}function Oi(t){if("function"!=typeof t)throw new Error;return t}function ji(){return 0}function Li(t){return function(){return t}}function Ni(t){return Math.sqrt(t.value)}function Bi(){var t=null,e=1,i=1,n=ji;function o(o){return o.x=e/2,o.y=i/2,t?o.eachBefore(Vi(t)).eachAfter(Hi(n,.5)).eachBefore(Wi(1)):o.eachBefore(Vi(Ni)).eachAfter(Hi(ji,1)).eachAfter(Hi(n,o.r/Math.min(e,i))).eachBefore(Wi(Math.min(e,i)/(2*o.r))),o}return L(o,"s"),vt(o,"pack"),o.radius=function(e){return arguments.length?(t=Ri(e),o):t},o.size=function(t){return arguments.length?(e=+t[0],i=+t[1],o):[e,i]},o.padding=function(t){return arguments.length?(n="function"==typeof t?t:Li(+t),o):n},o}function Vi(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function Hi(t,e){return function(i){if(n=i.children){var n,o,s,a=n.length,r=t(i)*e||0;if(r)for(o=0;o<a;++o)n[o].r+=r;if(s=zi(n),r)for(o=0;o<a;++o)n[o].r-=r;i.r=s+r}}}function Wi(t){return function(e){var i=e.parent;e.r*=t,i&&(e.x=i.x+t*e.x,e.y=i.y+t*e.y)}}L(bi,"Ue"),L(vi,"Qe"),L(wi,"Ze"),L(Si,"Je"),L(ki,"Ke"),L(Ai,"ti"),L(Ci,"ei"),L(Mi,"ii"),L(Ti,"ni"),L(Pi,"oi"),L(Ii,"si"),L(Ei,"ai"),L(Fi,"ri"),L(Di,"li"),L(zi,"hi"),L(Ri,"ci"),L(Oi,"ui"),L(ji,"pi"),L(Li,"di"),L(Ni,"fi"),L(Bi,"yi"),L(Vi,"_i"),L(Hi,"xi"),L(Wi,"mi"),vt(bi,"shuffle"),vt(vi,"enclose"),vt(wi,"extendBasis"),vt(Si,"enclosesNot"),vt(ki,"enclosesWeak"),vt(Ai,"enclosesWeakAll"),vt(Ci,"encloseBasis"),vt(Mi,"encloseBasis1"),vt(Ti,"encloseBasis2"),vt(Pi,"encloseBasis3"),vt(Ii,"place"),vt(Ei,"intersects"),vt(Fi,"score"),vt(Di,"Node"),vt(zi,"packEnclose"),vt(Ri,"optional"),vt(Oi,"required"),vt(ji,"constantZero"),vt(Li,"constant$2"),vt(Ni,"defaultRadius"),vt(Bi,"d3Pack"),vt(Vi,"radiusLeaf"),vt(Hi,"packChildren"),vt(Wi,"translateChild");const $i=(x=class extends a.SVGWidget{labelWidgets;d3Pack;constructor(){super(),ht.call(this),_t.call(this),a.Utility.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.labelWidgets={},this.d3Pack=Bi().size([this.width(),this.height()]).padding(1.5)}size(t){const e=super.size.apply(this,arguments);return arguments.length&&this.d3Pack.size([this.width(),this.height()]),e}enter(t,e){super.enter(t,e),this._selection.widgetElement(e);const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t[0]),value:t[1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){super.update(t,e);const i=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const n=di({children:this.cloneData()}).sum(function(t){return t[1]}).sort(function(t,e){return e[1]<t[1]?-1:e[1]>t[1]?1:0});this.d3Pack(n);const o=e.selectAll(".node").data(n.children||[],t=>t.data[0]);o.enter().append("g").attr("class",(t,e)=>"node series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).each(function(t){const e=a.select(this),n=t.x,o=t.y;e.append("circle").attr("transform","translate("+n+","+o+")").attr("r",0).on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show),t.__viz_faChar?i.labelWidgets[t.data[0]]=(new a.FAChar).char(t.__viz_faChar).target(this).render():i.labelWidgets[t.data[0]]=(new a.Text).text(t.data[0]).target(this).render()}).merge(o).transition().attr("opacity",1).each(function(t){const e=a.select(this),n={x:t.x,y:t.y};e.select("circle").transition().attr("transform","translate("+n.x+","+n.y+")").style("fill",i.fillColor(t.data,i.columns()[1],t.data[1])).attr("r",t.r).select("title").text(t.data[0]+" ("+t.data[1]+")"),t.__viz_faChar?i.labelWidgets[t.data[0]].pos(n).render():i.labelWidgets[t.data[0]].pos(n).colorFill_default(i.textColor(t.data,i.columns()[1],t.data[1])).width(2*t.r).text(t.data[0]).render()}),o.exit().transition().style("opacity",0).remove()}exit(t,e){super.exit(t,e)}},L(x,"_Bubble"),x);vt($i,"Bubble"),wt($i,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let qi=$i;qi.prototype._class+=" chart_Bubble",qi.prototype.implements(ht.prototype),qi.prototype.implements(_t.prototype),qi.prototype.mixin(a.Utility.SimpleSelectionMixin),qi.prototype.publish("paletteID","default","set","Color palette for this widget",qi.prototype._palette.switch(),{tags:["Basic","Shared"]}),qi.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});const Gi=(L(m=class extends Xe{constructor(){super()}enter(t,e){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(t,e)}},"_BubbleXY"),m);vt(Gi,"BubbleXY"),Gi.prototype._class+=" chart_BubbleXY";var Ui,Xi,Yi=0,Qi=0,Zi=0,Ji=0,Ki=0,tn=0,en="object"==typeof performance&&performance.now?performance:Date,nn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function on(){return Ki||(nn(sn),Ki=en.now()+tn)}function sn(){Ki=0}function an(){this._call=this._time=this._next=null}function rn(){on(),++Yi;for(var t,e=Ui;e;)(t=Ki-e._time)>=0&&e._call.call(null,t),e=e._next;--Yi}function ln(){Ki=(Ji=en.now())+tn,Yi=Qi=0;try{rn()}finally{Yi=0,cn(),Ki=0}}function hn(){var t=en.now(),e=t-Ji;e>1e3&&(tn-=e,Ji=t)}function cn(){for(var t,e,i=Ui,n=1/0;i;)i._call?(n>i._time&&(n=i._time),t=i,i=i._next):(e=i._next,i._next=null,i=t?t._next=e:Ui=e);Xi=t,un(n)}function un(t){Yi||(Qi&&(Qi=clearTimeout(Qi)),t-Ki>24?(t<1/0&&(Qi=setTimeout(ln,t-en.now()-tn)),Zi&&(Zi=clearInterval(Zi))):(Zi||(Ji=en.now(),Zi=setInterval(hn,1e3)),Yi=1,nn(ln)))}function pn(){var t="left",e=!1,i=!1,n=dn,o=fn,s=yn,r=380,l=30,h=He();function c(t){t.each(function(t,c){var u,p,d=n.call(this,t,c).slice().sort(a.descending),f=o.call(this,t,c).slice().sort(a.descending),y=s.call(this,t,c).slice().sort(a.descending),_=a.select(this),x=_.select("g.wrap");x.empty()&&(x=_.append("g").attr("class","wrap")),i?(u=l,p=r,x.attr("transform","rotate(90)translate(0,"+-r+")")):(u=r,p=l,x.attr("transform",null));var m=a.scaleLinear().domain([0,Math.max(d[0],f[0],y[0])]).range(e?[u,0]:[0,u]),g=this.__chart__||a.scaleLinear().domain([0,1/0]).range(m.range());this.__chart__=m;var b=_n(g),v=_n(m),w=x.selectAll("rect.range").data(d);w.enter().append("rect").attr("class",function(t,e){return"range s"+e}).attr("width",b).attr("height",p).attr("x",e?g:0).merge(w).transition(w).attr("x",e?m:0).attr("width",v).attr("height",p);var S=x.selectAll("rect.measure").data(y);S.enter().append("rect").attr("class",function(t,e){return"measure s"+e}).attr("width",b).attr("height",p/3).attr("x",e?g:0).attr("y",p/3).merge(S).transition(S).attr("width",v).attr("height",p/3).attr("x",e?m:0).attr("y",p/3);var k=x.selectAll("line.marker").data(f);k.enter().append("line").attr("class","marker").attr("x1",g).attr("x2",g).attr("y1",p/6).attr("y2",5*p/6).merge(k).transition(k).attr("x1",m).attr("x2",m).attr("y1",p/6).attr("y2",5*p/6);var A=_.selectAll("g.axis").data([0]);A.enter().append("g").attr("class","axis"),A.attr("transform",i?null:"translate(0,"+p+")").call(h.scale(m))}),rn()}return L(c,"u"),vt(c,"bulvar"),c.orient=function(n){return arguments.length?(e="right"==(t=n+"")||"bottom"===t,h.orient((i="top"===t||"bottom"===t)?"left":"bottom"),c):t},c.ranges=function(t){return arguments.length?(n=t,c):n},c.markers=function(t){return arguments.length?(o=t,c):o},c.measures=function(t){return arguments.length?(s=t,c):s},c.width=function(t){return arguments.length?(r=+t,c):r},c.height=function(t){return arguments.length?(l=+t,c):l},c.tickFormat=function(t){return arguments.length?(h.tickFormat(t),c):h.tickFormat()},c}function dn(t){return t.ranges}function fn(t){return t.markers}function yn(t){return t.measures}function _n(t){var e=t(0);return function(i){return Math.abs(t(i)-e)}}L(on,"Ei"),L(sn,"Oi"),L(an,"Ri"),L(rn,"Di"),L(ln,"ji"),L(hn,"Ni"),L(cn,"Li"),L(un,"Bi"),L(pn,"$i"),L(dn,"Hi"),L(fn,"qi"),L(yn,"Vi"),L(_n,"Wi"),vt(on,"now"),vt(sn,"clearNow"),vt(an,"Timer"),an.prototype={constructor:an,restart:vt(function(t,e,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?on():+i)+(null==e?0:+e),this._next||Xi===this||(Xi?Xi._next=this:Ui=this,Xi=this),this._call=t,this._time=i,un()},"restart"),stop:vt(function(){this._call&&(this._call=null,this._time=1/0,un())},"stop")},vt(rn,"timerFlush"),vt(ln,"wake"),vt(hn,"poke"),vt(cn,"nap"),vt(un,"sleep"),vt(pn,"d3Bullet"),vt(dn,"bulvarRanges"),vt(fn,"bulvarMarkers"),vt(yn,"bulvarMeasures"),vt(_n,"bulvarWidth");const xn=(g=class extends a.HTMLWidget{_hiddenColumns={};constructor(){super(),a.Utility.SimpleSelectionMixin.call(this,!0)}bulletData(){const t=this;this._hiddenColumns={};const e=this.columns();return this.data().map(function(t){return{title:i(t,this.titleColumn()),subtitle:i(t,this.subtitleColumn()),ranges:i(t,this.rangesColumn(),"range"),measures:i(t,this.measuresColumn(),"measure"),markers:i(t,this.markersColumn(),"marker"),origRow:t}},this);function i(i,n,o){const s=e.indexOf(n);return s>=0?i[s]instanceof Array?i[s]:[i[s]]:(o&&(t._hiddenColumns[o]=!0),[0])}}enter(t,e){super.enter(t,e),a.select(t.parentNode).style("overflow","auto"),this._selection.widgetElement(e)}update(t,e){super.update(t,e);const i=this;e.selectAll(".axis").style("display","none"),e.selectAll(".range,.measure,.marker").style("display",null);const n=this.width()-2-2,o=e.selectAll("svg").data(this.bulletData()),s=o.enter().append("svg").attr("class","bullet").call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).each(function(){const t=a.select(this).append("g").attr("class",(t,e)=>"bulletBar series series-"+i.cssTag(i.titleColumn())).append("g").attr("class","bulletTitle");t.append("text").attr("class","title"),t.append("text").attr("class","subtitle").attr("dy","1em")}).merge(o),r=s.select(".bulletTitle").style("text-anchor","end").attr("transform","translate(-6,12)");r.select(".title").text(function(t){return t.title}),r.select(".subtitle").text(function(t){return t.subtitle});let l=0;r.each(function(){const t=this.getBBox();t.width>l&&(l=t.width)});const h=pn().width(n-l-6).height(24);s.attr("width",n).attr("height",40).style("margin-left","2px"),s.select(".bulletBar").attr("transform","translate("+(l+6)+",8)").call(h),o.exit().remove(),Object.keys(this._hiddenColumns).length>0&&e.selectAll(`.${Object.keys(this._hiddenColumns).join(",.")}`).style("display","none")}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}_selection},L(g,"_Bullet"),g);vt(xn,"Bullet");let mn=xn;mn.prototype._class+=" chart_Bullet",mn.prototype.publish("titleColumn",null,"set","Title Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("subtitleColumn",null,"set","Subtitle Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("rangesColumn",null,"set","Ranges Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("measuresColumn",null,"set","Measures Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("markersColumn",null,"set","Markers Column",function(){return this.columns()},{optional:!0});var gn=Array.prototype.slice;function bn(t,e){return t-e}function vn(t){for(var e=0,i=t.length,n=t[i-1][1]*t[0][0]-t[i-1][0]*t[0][1];++e<i;)n+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return n}function wn(t){return function(){return t}}function Sn(t,e){for(var i,n=-1,o=e.length;++n<o;)if(i=kn(t,e[n]))return i;return 0}function kn(t,e){for(var i=e[0],n=e[1],o=-1,s=0,a=t.length,r=a-1;s<a;r=s++){var l=t[s],h=l[0],c=l[1],u=t[r],p=u[0],d=u[1];if(An(l,u,e))return 0;c>n!=d>n&&i<(p-h)*(n-c)/(d-c)+h&&(o=-o)}return o}function An(t,e,i){var n;return Cn(t,e,i)&&Mn(t[n=+(t[0]===e[0])],i[n],e[n])}function Cn(t,e,i){return(e[0]-t[0])*(i[1]-t[1])===(i[0]-t[0])*(e[1]-t[1])}function Mn(t,e,i){return t<=e&&e<=i||i<=e&&e<=t}function Tn(){}L(bn,"Ui"),L(vn,"Qi"),L(wn,"Zi"),L(Sn,"Ji"),L(kn,"Ki"),L(An,"tn"),L(Cn,"en"),L(Mn,"nn"),L(Tn,"on"),vt(bn,"ascending"),vt(vn,"area"),vt(wn,"constant$1"),vt(Sn,"contains"),vt(kn,"ringContains"),vt(An,"segmentContains"),vt(Cn,"collinear"),vt(Mn,"within"),vt(Tn,"noop$2");var Pn=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function In(){var t=1,e=1,i=a.thresholdSturges,n=h;function o(t){var e=i(t);if(Array.isArray(e))e=e.slice().sort(bn);else{var n=a.extent(t),o=n[0],r=n[1];e=a.tickStep(o,r,e),e=a.range(Math.floor(o/e)*e,Math.floor(r/e)*e,e)}return e.map(function(e){return s(t,e)})}function s(t,e){var i=[],o=[];return r(t,e,function(s){n(s,t,e),vn(s)>0?i.push([s]):o.push(s)}),o.forEach(function(t){for(var e,n=0,o=i.length;n<o;++n)if(-1!==Sn((e=i[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:e,coordinates:i}}function r(i,n,o){var s,a,r,h,c,u,p=new Array,d=new Array;for(s=a=-1,h=i[0]>=n,Pn[h<<1].forEach(f);++s<t-1;)r=h,h=i[s+1]>=n,Pn[r|h<<1].forEach(f);for(Pn[0|h].forEach(f);++a<e-1;){for(s=-1,h=i[a*t+t]>=n,c=i[a*t]>=n,Pn[h<<1|c<<2].forEach(f);++s<t-1;)r=h,h=i[a*t+t+s+1]>=n,u=c,c=i[a*t+s+1]>=n,Pn[r|h<<1|c<<2|u<<3].forEach(f);Pn[h|c<<3].forEach(f)}for(s=-1,c=i[a*t]>=n,Pn[c<<2].forEach(f);++s<t-1;)u=c,c=i[a*t+s+1]>=n,Pn[c<<2|u<<3].forEach(f);function f(t){var e,i,n=[t[0][0]+s,t[0][1]+a],r=[t[1][0]+s,t[1][1]+a],h=l(n),c=l(r);(e=d[h])?(i=p[c])?(delete d[e.end],delete p[i.start],e===i?(e.ring.push(r),o(e.ring)):p[e.start]=d[i.end]={start:e.start,end:i.end,ring:e.ring.concat(i.ring)}):(delete d[e.end],e.ring.push(r),d[e.end=c]=e):(e=p[c])?(i=d[h])?(delete p[e.start],delete d[i.end],e===i?(e.ring.push(r),o(e.ring)):p[i.start]=d[e.end]={start:i.start,end:e.end,ring:i.ring.concat(e.ring)}):(delete p[e.start],e.ring.unshift(n),p[e.start=h]=e):p[h]=d[c]={start:h,end:c,ring:[n,r]}}L(f,"y"),Pn[c<<3].forEach(f),vt(f,"stitch")}function l(e){return 2*e[0]+e[1]*(t+1)*4}function h(i,n,o){i.forEach(function(i){var s,a=i[0],r=i[1],l=0|a,h=0|r,c=n[h*t+l];a>0&&a<t&&l===a&&(s=n[h*t+l-1],i[0]=a+(o-s)/(c-s)-.5),r>0&&r<e&&h===r&&(s=n[(h-1)*t+l],i[1]=r+(o-s)/(c-s)-.5)})}return L(o,"s"),L(s,"a"),L(r,"r"),L(l,"l"),L(h,"h"),vt(o,"contours"),vt(s,"contour"),vt(r,"isorings"),vt(l,"index"),vt(h,"smoothLinear"),o.contour=s,o.size=function(i){if(!arguments.length)return[t,e];var n=Math.ceil(i[0]),s=Math.ceil(i[1]);if(!(n>0&&s>0))throw new Error("invalid size");return t=n,e=s,o},o.thresholds=function(t){return arguments.length?(i="function"==typeof t?t:Array.isArray(t)?wn(gn.call(t)):wn(t),o):i},o.smooth=function(t){return arguments.length?(n=t?h:Tn,o):n===h},o}function En(t,e,i){for(var n=t.width,o=t.height,s=1+(i<<1),a=0;a<o;++a)for(var r=0,l=0;r<n+i;++r)r<n&&(l+=t.data[r+a*n]),r>=i&&(r>=s&&(l-=t.data[r-s+a*n]),e.data[r-i+a*n]=l/Math.min(r+1,n-1+s-r,s))}function Fn(t,e,i){for(var n=t.width,o=t.height,s=1+(i<<1),a=0;a<n;++a)for(var r=0,l=0;r<o+i;++r)r<o&&(l+=t.data[a+r*n]),r>=i&&(r>=s&&(l-=t.data[a+(r-s)*n]),e.data[a+(r-i)*n]=l/Math.min(r+1,o-1+s-r,s))}function Dn(t){return t[0]}function zn(t){return t[1]}function Rn(){return 1}function On(){var t=Dn,e=zn,i=Rn,n=960,o=500,s=20,r=2,l=3*s,h=n+2*l>>r,c=o+2*l>>r,u=wn(20);function p(n){var o=new Float32Array(h*c),p=new Float32Array(h*c);n.forEach(function(n,s,a){var u=+t(n,s,a)+l>>r,p=+e(n,s,a)+l>>r,d=+i(n,s,a);u>=0&&u<h&&p>=0&&p<c&&(o[u+p*h]+=d)}),En({width:h,height:c,data:o},{data:p},s>>r),Fn({width:h,height:c,data:p},{data:o},s>>r),En({width:h,height:c,data:o},{data:p},s>>r),Fn({width:h,height:c,data:p},{data:o},s>>r),En({width:h,height:c,data:o},{data:p},s>>r),Fn({width:h,height:c,data:p},{data:o},s>>r);var f=u(o);if(!Array.isArray(f)){var y=a.max(o);f=a.tickStep(0,y,f),(f=a.range(0,Math.floor(y/f)*f,f)).shift()}return In().thresholds(f).size([h,c])(o).map(d)}function d(t){return t.value*=Math.pow(2,-2*r),t.coordinates.forEach(f),t}function f(t){t.forEach(y)}function y(t){t.forEach(_)}function _(t){t[0]=t[0]*Math.pow(2,r)-l,t[1]=t[1]*Math.pow(2,r)-l}function x(){return h=n+2*(l=3*s)>>r,c=o+2*l>>r,p}return L(p,"p"),L(d,"d"),L(f,"f"),L(y,"y"),L(_,"_"),L(x,"x"),vt(p,"density"),vt(d,"transform"),vt(f,"transformPolygon"),vt(y,"transformRing"),vt(_,"transformPoint"),vt(x,"resize"),p.x=function(e){return arguments.length?(t="function"==typeof e?e:wn(+e),p):t},p.y=function(t){return arguments.length?(e="function"==typeof t?t:wn(+t),p):e},p.weight=function(t){return arguments.length?(i="function"==typeof t?t:wn(+t),p):i},p.size=function(t){if(!arguments.length)return[n,o];var e=Math.ceil(t[0]),i=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return n=e,o=i,x()},p.cellSize=function(t){if(!arguments.length)return 1<<r;if(!((t=+t)>=1))throw new Error("invalid cell size");return r=Math.floor(Math.log(t)/Math.LN2),x()},p.thresholds=function(t){return arguments.length?(u="function"==typeof t?t:Array.isArray(t)?wn(gn.call(t)):wn(t),p):u},p.bandwidth=function(t){if(!arguments.length)return Math.sqrt(s*(s+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return s=Math.round((Math.sqrt(4*t*t+1)-1)/2),x()},p}function jn(){return new Ln}function Ln(){this.reset()}L(In,"an"),L(En,"rn"),L(Fn,"ln"),L(Dn,"hn"),L(zn,"cn"),L(Rn,"un"),L(On,"pn"),L(jn,"dn"),L(Ln,"fn"),vt(In,"contours"),vt(En,"blurX"),vt(Fn,"blurY"),vt(Dn,"defaultX"),vt(zn,"defaultY"),vt(Rn,"defaultWeight"),vt(On,"d3ContourDensity"),vt(jn,"adder"),vt(Ln,"Adder"),Ln.prototype={constructor:Ln,reset:vt(function(){this.s=this.t=0},"reset"),add:vt(function(t){Bn(Nn,t,this.t),Bn(this,Nn.s,this.s),this.s?this.t+=Nn.t:this.s=Nn.t},"add"),valueOf:vt(function(){return this.s},"valueOf")};var Nn=new Ln;function Bn(t,e,i){var n=t.s=e+i,o=n-e,s=n-o;t.t=e-s+(i-o)}L(Bn,"_n"),vt(Bn,"add");var Vn=2*Math.PI,Hn=Math.abs,Wn=Math.sqrt;function $n(){}function qn(t,e){t&&Un.hasOwnProperty(t.type)&&Un[t.type](t,e)}L($n,"bn"),L(qn,"vn"),vt($n,"noop$1"),vt(qn,"streamGeometry");var Gn={Feature:vt(function(t,e){qn(t.geometry,e)},"Feature"),FeatureCollection:vt(function(t,e){for(var i=t.features,n=-1,o=i.length;++n<o;)qn(i[n].geometry,e)},"FeatureCollection")},Un={Sphere:vt(function(t,e){e.sphere()},"Sphere"),Point:vt(function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},"Point"),MultiPoint:vt(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)t=i[n],e.point(t[0],t[1],t[2])},"MultiPoint"),LineString:vt(function(t,e){Xn(t.coordinates,e,0)},"LineString"),MultiLineString:vt(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)Xn(i[n],e,0)},"MultiLineString"),Polygon:vt(function(t,e){Yn(t.coordinates,e)},"Polygon"),MultiPolygon:vt(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)Yn(i[n],e)},"MultiPolygon"),GeometryCollection:vt(function(t,e){for(var i=t.geometries,n=-1,o=i.length;++n<o;)qn(i[n],e)},"GeometryCollection")};function Xn(t,e,i){var n,o=-1,s=t.length-i;for(e.lineStart();++o<s;)n=t[o],e.point(n[0],n[1],n[2]);e.lineEnd()}function Yn(t,e){var i=-1,n=t.length;for(e.polygonStart();++i<n;)Xn(t[i],e,1);e.polygonEnd()}function Qn(t,e){t&&Gn.hasOwnProperty(t.type)?Gn[t.type](t,e):qn(t,e)}function Zn(t){return t}L(Xn,"An"),L(Yn,"kn"),L(Qn,"Mn"),L(Zn,"Pn"),vt(Xn,"streamLine"),vt(Yn,"streamPolygon"),vt(Qn,"geoStream"),vt(Zn,"identity");var Jn,Kn,to,eo,io=jn(),no=jn(),oo={point:$n,lineStart:$n,lineEnd:$n,polygonStart:vt(function(){oo.lineStart=so,oo.lineEnd=lo},"polygonStart"),polygonEnd:vt(function(){oo.lineStart=oo.lineEnd=oo.point=$n,io.add(Hn(no)),no.reset()},"polygonEnd"),result:vt(function(){var t=io/2;return io.reset(),t},"result")};function so(){oo.point=ao}function ao(t,e){oo.point=ro,Jn=to=t,Kn=eo=e}function ro(t,e){no.add(eo*t-to*e),to=t,eo=e}function lo(){ro(Jn,Kn)}L(so,"Rn"),L(ao,"Dn"),L(ro,"jn"),L(lo,"Nn"),vt(so,"areaRingStart"),vt(ao,"areaPointFirst"),vt(ro,"areaPoint"),vt(lo,"areaRingEnd");var ho=1/0,co=ho,uo=-ho,po=uo,fo={point:yo,lineStart:$n,lineEnd:$n,polygonStart:$n,polygonEnd:$n,result:vt(function(){var t=[[ho,co],[uo,po]];return uo=po=-(co=ho=1/0),t},"result")};function yo(t,e){t<ho&&(ho=t),t>uo&&(uo=t),e<co&&(co=e),e>po&&(po=e)}L(yo,"Vn"),vt(yo,"boundsPoint");var _o,xo,mo,go,bo=0,vo=0,wo=0,So=0,ko=0,Ao=0,Co=0,Mo=0,To=0,Po={point:Io,lineStart:Eo,lineEnd:zo,polygonStart:vt(function(){Po.lineStart=Ro,Po.lineEnd=Oo},"polygonStart"),polygonEnd:vt(function(){Po.point=Io,Po.lineStart=Eo,Po.lineEnd=zo},"polygonEnd"),result:vt(function(){var t=To?[Co/To,Mo/To]:Ao?[So/Ao,ko/Ao]:wo?[bo/wo,vo/wo]:[NaN,NaN];return bo=vo=wo=So=ko=Ao=Co=Mo=To=0,t},"result")};function Io(t,e){bo+=t,vo+=e,++wo}function Eo(){Po.point=Fo}function Fo(t,e){Po.point=Do,Io(mo=t,go=e)}function Do(t,e){var i=t-mo,n=e-go,o=Wn(i*i+n*n);So+=o*(mo+t)/2,ko+=o*(go+e)/2,Ao+=o,Io(mo=t,go=e)}function zo(){Po.point=Io}function Ro(){Po.point=jo}function Oo(){Lo(_o,xo)}function jo(t,e){Po.point=Lo,Io(_o=mo=t,xo=go=e)}function Lo(t,e){var i=t-mo,n=e-go,o=Wn(i*i+n*n);So+=o*(mo+t)/2,ko+=o*(go+e)/2,Ao+=o,Co+=(o=go*t-mo*e)*(mo+t),Mo+=o*(go+e),To+=3*o,Io(mo=t,go=e)}function No(t){this._context=t}L(Io,"so"),L(Eo,"ao"),L(Fo,"ro"),L(Do,"lo"),L(zo,"ho"),L(Ro,"co"),L(Oo,"uo"),L(jo,"po"),L(Lo,"fo"),L(No,"yo"),vt(Io,"centroidPoint"),vt(Eo,"centroidLineStart"),vt(Fo,"centroidPointFirstLine"),vt(Do,"centroidPointLine"),vt(zo,"centroidLineEnd"),vt(Ro,"centroidRingStart"),vt(Oo,"centroidRingEnd"),vt(jo,"centroidPointFirstRing"),vt(Lo,"centroidPointRing"),vt(No,"PathContext"),No.prototype={_radius:4.5,pointRadius:vt(function(t){return this._radius=t,this},"pointRadius"),polygonStart:vt(function(){this._line=0},"polygonStart"),polygonEnd:vt(function(){this._line=NaN},"polygonEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){0===this._line&&this._context.closePath(),this._point=NaN},"lineEnd"),point:vt(function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Vn)}},"point"),result:$n};var Bo,Vo,Ho,Wo,$o,qo=jn(),Go={point:$n,lineStart:vt(function(){Go.point=Uo},"lineStart"),lineEnd:vt(function(){Bo&&Xo(Vo,Ho),Go.point=$n},"lineEnd"),polygonStart:vt(function(){Bo=!0},"polygonStart"),polygonEnd:vt(function(){Bo=null},"polygonEnd"),result:vt(function(){var t=+qo;return qo.reset(),t},"result")};function Uo(t,e){Go.point=Xo,Vo=Wo=t,Ho=$o=e}function Xo(t,e){Wo-=t,$o-=e,qo.add(Wn(Wo*Wo+$o*$o)),Wo=t,$o=e}function Yo(){this._string=[]}function Qo(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Zo(t,e){var i,n,o=4.5;function s(t){return t&&("function"==typeof o&&n.pointRadius(+o.apply(this,arguments)),Qn(t,i(n))),n.result()}return L(s,"a"),vt(s,"path"),s.area=function(t){return Qn(t,i(oo)),oo.result()},s.measure=function(t){return Qn(t,i(Go)),Go.result()},s.bounds=function(t){return Qn(t,i(fo)),fo.result()},s.centroid=function(t){return Qn(t,i(Po)),Po.result()},s.projection=function(e){return arguments.length?(i=null==e?(t=null,Zn):(t=e).stream,s):t},s.context=function(t){return arguments.length?(n=null==t?(e=null,new Yo):new No(e=t),"function"!=typeof o&&n.pointRadius(o),s):e},s.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(n.pointRadius(+t),+t),s):o},s.projection(t).context(e)}L(Uo,"So"),L(Xo,"Ao"),L(Yo,"ko"),L(Qo,"Mo"),L(Zo,"Po"),vt(Uo,"lengthPointFirst"),vt(Xo,"lengthPoint"),vt(Yo,"PathString"),Yo.prototype={_radius:4.5,_circle:Qo(4.5),pointRadius:vt(function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},"pointRadius"),polygonStart:vt(function(){this._line=0},"polygonStart"),polygonEnd:vt(function(){this._line=NaN},"polygonEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){0===this._line&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:vt(function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Qo(this._radius)),this._string.push("M",t,",",e,this._circle)}},"point"),result:vt(function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null},"result")},vt(Qo,"circle"),vt(Zo,"geoPath");const Jo=(L(b=class extends Ge{_dataMinWeight;_dataMaxWeight;constructor(){super(),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerEnter(t,e,i=250){super.layerEnter(t,e,i)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i),this._palette=this._palette.switch(this.paletteID());const n=this.flattenData(this.layerColumns(t),this.layerData(t)),o=On().x(e=>this.xPos(t,e)).y(e=>this.yPos(t,e)).size([this.width(),this.height()]).bandwidth(this.contourBandwidth())(n),s=o.map(t=>t.value),a=Math.min.apply(this,s),r=Math.max.apply(this,s);this._dataMinWeight=a,this._dataMaxWeight=r;const l=e.selectAll("path").data(o);l.enter().append("path").merge(l).attr("d",Zo()).attr("fill",t=>this.showContourFill()?this._palette(t.value,a,r):"none").attr("stroke",this.contourStrokeColor()).attr("stroke-linejoin","round").attr("stroke-width",this.contourStrokeWidth()),l.exit().remove()}exit(t,e){super.exit(t,e)}},"_Contour"),b);vt(Jo,"Contour"),wt(Jo,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let Ko=Jo;Ko.prototype._class+=" chart_Contour",Ko.prototype.implements(lt.prototype),Ko.prototype.publish("paletteID","YlGnBu","string","Color palette for this widget"),Ko.prototype.publish("useClonedPalette",!0,"boolean","Enable or disable using a cloned palette"),Ko.prototype.publish("showContourFill",!0,"boolean","Show/hide the contour background colors"),Ko.prototype.publish("showContour",!0,"boolean","Show/hide the contour border lines"),Ko.prototype.publish("contourBandwidth",40,"number","Controls the sensitivity of the contour grouping algorithm"),Ko.prototype.publish("contourStrokeColor","#2C3A47","html-color","Color of the contour border lines"),Ko.prototype.publish("contourStrokeWidth",1,"number","Width of the contour border lines");const ts=(L(v=class extends Ke{constructor(){super(),this.orientation_default("vertical").xAxisType_default("ordinal").yAxisType_default("time")}},"_Gantt"),v);vt(ts,"Gantt");let es=ts;function is(t){return vt(function(){return t},"constant")}L(is,"Io"),es.prototype._class+=" chart_Gantt",vt(is,"constant");var ns=1e-12,os=Math.PI,ss=os/2,as=2*os;function rs(t){return t.innerRadius}function ls(t){return t.outerRadius}function hs(t){return t.startAngle}function cs(t){return t.endAngle}function us(t){return t&&t.padAngle}function ps(t){return t>=1?ss:t<=-1?-ss:Math.asin(t)}function ds(t,e,i,n,o,s,a,r){var l=i-t,h=n-e,c=a-o,u=r-s,p=(c*(e-s)-u*(t-o))/(u*l-c*h);return[t+p*l,e+p*h]}function fs(t,e,i,n,o,s,a){var r=t-i,l=e-n,h=(a?s:-s)/Math.sqrt(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-s,w=p*y-f*d,S=(g<0?-1:1)*Math.sqrt(Math.max(0,v*v*b-w*w)),k=(w*g-m*S)/b,A=(-w*m-g*S)/b,C=(w*g+m*S)/b,M=(-w*m+g*S)/b,T=k-_,P=A-x,I=C-_,E=M-x;return T*T+P*P>I*I+E*E&&(k=C,A=M),{cx:k,cy:A,x01:-c,y01:-u,x11:k*(o/v-1),y11:A*(o/v-1)}}function ys(){var t=rs,e=ls,i=is(0),n=null,o=hs,s=cs,a=us,r=null;function l(){var l,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),p=o.apply(this,arguments)-ss,d=s.apply(this,arguments)-ss,f=Math.abs(d-p),y=d>p;if(r||(r=l=Tt()),u<c&&(h=u,u=c,c=h),u>ns)if(f>as-ns)r.moveTo(u*Math.cos(p),u*Math.sin(p)),r.arc(0,0,u,p,d,!y),c>ns&&(r.moveTo(c*Math.cos(d),c*Math.sin(d)),r.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,k=a.apply(this,arguments)/2,A=k>ns&&(n?+n.apply(this,arguments):Math.sqrt(c*c+u*u)),C=Math.min(Math.abs(u-c)/2,+i.apply(this,arguments)),M=C,T=C;if(A>ns){var P=ps(A/c*Math.sin(k)),I=ps(A/u*Math.sin(k));(w-=2*P)>ns?(b+=P*=y?1:-1,v-=P):(w=0,b=v=(p+d)/2),(S-=2*I)>ns?(m+=I*=y?1:-1,g-=I):(S=0,m=g=(p+d)/2)}var E=u*Math.cos(m),F=u*Math.sin(m),D=c*Math.cos(v),z=c*Math.sin(v);if(C>ns){var R=u*Math.cos(g),O=u*Math.sin(g),j=c*Math.cos(b),L=c*Math.sin(b);if(f<os){var N=w>ns?ds(E,F,j,L,R,O,D,z):[D,z],B=E-N[0],V=F-N[1],H=R-N[0],W=O-N[1],$=1/Math.sin(Math.acos((B*H+V*W)/(Math.sqrt(B*B+V*V)*Math.sqrt(H*H+W*W)))/2),q=Math.sqrt(N[0]*N[0]+N[1]*N[1]);M=Math.min(C,(c-q)/($-1)),T=Math.min(C,(u-q)/($+1))}}S>ns?T>ns?(_=fs(j,L,E,F,u,T,y),x=fs(R,O,D,z,u,T,y),r.moveTo(_.cx+_.x01,_.cy+_.y01),T<C?r.arc(_.cx,_.cy,T,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,T,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),r.arc(0,0,u,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),!y),r.arc(x.cx,x.cy,T,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):(r.moveTo(E,F),r.arc(0,0,u,m,g,!y)):r.moveTo(E,F),c>ns&&w>ns?M>ns?(_=fs(D,z,R,O,c,-M,y),x=fs(E,F,j,L,c,-M,y),r.lineTo(_.cx+_.x01,_.cy+_.y01),M<C?r.arc(_.cx,_.cy,M,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,M,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),r.arc(0,0,c,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),y),r.arc(x.cx,x.cy,M,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):r.arc(0,0,c,v,b,y):r.lineTo(D,z)}else r.moveTo(0,0);if(r.closePath(),l)return r=null,l+""||null}return L(l,"h"),vt(l,"arc"),l.centroid=function(){var i=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-os/2;return[Math.cos(n)*i,Math.sin(n)*i]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:is(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:is(+t),l):e},l.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:is(+t),l):i},l.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:is(+t),l):n},l.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:is(+t),l):o},l.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:is(+t),l):s},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:is(+t),l):a},l.context=function(t){return arguments.length?(r=null==t?null:t,l):r},l}function _s(t){this._context=t}function xs(t){return new _s(t)}function ms(t){return t[0]}function gs(t){return t[1]}function bs(){var t=ms,e=gs,i=is(!0),n=null,o=xs,s=null;function a(a){var r,l,h,c=a.length,u=!1;for(null==n&&(s=o(h=Tt())),r=0;r<=c;++r)!(r<c&&i(l=a[r],r,a))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+t(l,r,a),+e(l,r,a));if(h)return s=null,h+""||null}return L(a,"r"),vt(a,"line"),a.x=function(e){return arguments.length?(t="function"==typeof e?e:is(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:is(+t),a):e},a.defined=function(t){return arguments.length?(i="function"==typeof t?t:is(!!t),a):i},a.curve=function(t){return arguments.length?(o=t,null!=n&&(s=o(n)),a):o},a.context=function(t){return arguments.length?(null==t?n=s=null:s=o(n=t),a):n},a}function vs(){}function ws(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function Ss(t){this._context=t}function ks(t,e){this._basis=new Ss(t),this._beta=e}function As(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function Cs(t,e){this._context=t,this._k=(1-e)/6}function Ms(t,e){this._context=t,this._k=(1-e)/6}function Ts(t,e){this._context=t,this._k=(1-e)/6}function Ps(t,e,i){var n=t._x1,o=t._y1,s=t._x2,a=t._y2;if(t._l01_a>ns){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>ns){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*h+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,s,a,t._x2,t._y2)}function Is(t,e){this._context=t,this._alpha=e}L(rs,"jo"),L(ls,"No"),L(hs,"Lo"),L(cs,"Bo"),L(us,"$o"),L(ps,"Ho"),L(ds,"qo"),L(fs,"Vo"),L(ys,"Wo"),L(_s,"Go"),L(xs,"Xo"),L(ms,"Yo"),L(gs,"Uo"),L(bs,"Qo"),L(vs,"Zo"),L(ws,"Jo"),L(Ss,"Ko"),L(ks,"ts"),L(As,"es"),L(Cs,"is"),L(Ms,"ns"),L(Ts,"os"),L(Ps,"ss"),L(Is,"as"),vt(rs,"arcInnerRadius"),vt(ls,"arcOuterRadius"),vt(hs,"arcStartAngle"),vt(cs,"arcEndAngle"),vt(us,"arcPadAngle"),vt(ps,"asin"),vt(ds,"intersect"),vt(fs,"cornerTangents"),vt(ys,"arc"),vt(_s,"Linear"),_s.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},vt(xs,"curveLinear"),vt(ms,"x"),vt(gs,"y"),vt(bs,"line"),vt(vs,"noop"),vt(ws,"point$3"),vt(Ss,"Basis"),Ss.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 3:ws(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ws(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},vt(ks,"Bundle"),ks.prototype={lineStart:vt(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:vt(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],s=e[0],a=t[i]-o,r=e[i]-s,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*a),this._beta*e[l]+(1-this._beta)*(s+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:vt(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},vt(As,"point$2"),vt(Cs,"Cardinal"),Cs.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:As(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:As(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},vt(Ms,"CardinalClosed"),Ms.prototype={areaStart:vs,areaEnd:vs,lineStart:vt(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:As(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},vt(Ts,"CardinalOpen"),Ts.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:As(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},vt(Ps,"point$1"),vt(Is,"CatmullRom"),Is.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Ps(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const Es=vt(L(function t(e){function i(t){return e?new Is(t,e):new Cs(t,0)}return L(i,"n"),vt(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"t"),"custom")(.5);function Fs(t,e){this._context=t,this._alpha=e}function Ds(t,e){this._context=t,this._alpha=e}function zs(t){return t<0?-1:1}function Rs(t,e,i){var n=t._x1-t._x0,o=e-t._x1,s=(t._y1-t._y0)/(n||o<0&&-0),a=(i-t._y1)/(o||n<0&&-0),r=(s*o+a*n)/(n+o);return(zs(s)+zs(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(r))||0}function Os(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function js(t,e,i){var n=t._x0,o=t._y0,s=t._x1,a=t._y1,r=(s-n)/3;t._context.bezierCurveTo(n+r,o+r*e,s-r,a-r*i,s,a)}function Ls(t){this._context=t}L(Fs,"ls"),L(Ds,"hs"),L(zs,"cs"),L(Rs,"us"),L(Os,"ps"),L(js,"ds"),L(Ls,"fs"),vt(Fs,"CatmullRomClosed"),Fs.prototype={areaStart:vs,areaEnd:vs,lineStart:vt(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:vt(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ps(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},vt(Ds,"CatmullRomOpen"),Ds.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:vt(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ps(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},vt(zs,"sign"),vt(Rs,"slope3"),vt(Os,"slope2"),vt(js,"point"),vt(Ls,"MonotoneX"),Ls.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:js(this,this._t0,Os(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,js(this,Os(this,i=Rs(this,t,e)),i);break;default:js(this,this._t0,i=Rs(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(Ls.prototype).point=function(t,e){Ls.prototype.point.call(this,e,t)};var Ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bs=vt(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},"classCallCheck"),Vs=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return L(t,"t"),vt(t,"defineProperties"),function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Hs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},Ws=vt(L(function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var s=Object.getPrototypeOf(e);return null===s?void 0:t(s,i,n)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(n):void 0},"t"),"get"),$s=vt(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},"inherits"),qs=vt(function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},"possibleConstructorReturn"),Gs=vt(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)},"toConsumableArray"),Us=function(){function t(e){var i=e.x,n=void 0===i?0:i,o=e.y,s=void 0===o?0:o,a=e.nx,r=e.ny,l=e.dy,h=void 0===l?0:l,c=e.dx,u=void 0===c?0:c,p=e.color,d=void 0===p?"grey":p,f=e.data,y=e.type,_=e.subject,x=e.connector,m=e.note,g=e.disable,b=e.id,v=e.className;Bs(this,t),this._dx=void 0!==a?a-n:u,this._dy=void 0!==r?r-s:h,this._x=n,this._y=s,this._color=d,this.id=b,this._className=v||"",this._type=y||"",this.data=f,this.note=m||{},this.connector=x||{},this.subject=_||{},this.disable=g||[]}return L(t,"t"),vt(t,"Annotation"),Vs(t,[{key:"updatePosition",value:vt(function(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&0!==this.type.subject.selectAll(":not(.handle)").nodes().length&&this.type.redrawSubject())},"updatePosition")},{key:"clearComponents",value:vt(function(){this.type.clearComponents&&this.type.clearComponents()},"clearComponents")},{key:"updateOffset",value:vt(function(){this.type.setOffset&&(this.type.setOffset(),0!==this.type.connector.selectAll(":not(.handle)").nodes().length&&this.type.redrawConnector(),this.type.redrawNote())},"updateOffset")},{key:"className",get:vt(function(){return this._className},"get$$1"),set:vt(function(t){this._className=t,this.type.setClassName&&this.type.setClassName()},"set$$1")},{key:"type",get:vt(function(){return this._type},"get$$1"),set:vt(function(t){this._type=t,this.clearComponents()},"set$$1")},{key:"x",get:vt(function(){return this._x},"get$$1"),set:vt(function(t){this._x=t,this.updatePosition()},"set$$1")},{key:"y",get:vt(function(){return this._y},"get$$1"),set:vt(function(t){this._y=t,this.updatePosition()},"set$$1")},{key:"color",get:vt(function(){return this._color},"get$$1"),set:vt(function(t){this._color=t,this.updatePosition()},"set$$1")},{key:"dx",get:vt(function(){return this._dx},"get$$1"),set:vt(function(t){this._dx=t,this.updateOffset()},"set$$1")},{key:"dy",get:vt(function(){return this._dy},"get$$1"),set:vt(function(t){this._dy=t,this.updateOffset()},"set$$1")},{key:"nx",set:vt(function(t){this._dx=t-this._x,this.updateOffset()},"set$$1")},{key:"ny",set:vt(function(t){this._dy=t-this._y,this.updateOffset()},"set$$1")},{key:"offset",get:vt(function(){return{x:this._dx,y:this._dy}},"get$$1"),set:vt(function(t){var e=t.x,i=t.y;this._dx=e,this._dy=i,this.updateOffset()},"set$$1")},{key:"position",get:vt(function(){return{x:this._x,y:this._y}},"get$$1"),set:vt(function(t){var e=t.x,i=t.y;this._x=e,this._y=i,this.updatePosition()},"set$$1")},{key:"translation",get:vt(function(){return{x:this._x+this._dx,y:this._y+this._dy}},"get$$1")},{key:"json",get:vt(function(){var t={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t},"get$$1")}]),t}(),Xs=function(){function t(e){var i=e.annotations,n=e.accessors,o=e.accessorsInverse;Bs(this,t),this.accessors=n,this.accessorsInverse=o,this.annotations=i}return L(t,"t"),vt(t,"AnnotationCollection"),Vs(t,[{key:"clearTypes",value:vt(function(t){this.annotations.forEach(function(e){e.type=void 0,e.subject=t&&t.subject||e.subject,e.connector=t&&t.connector||e.connector,e.note=t&&t.note||e.note})},"clearTypes")},{key:"setPositionWithAccessors",value:vt(function(){var t=this;this.annotations.forEach(function(e){e.type.setPositionWithAccessors(t.accessors)})},"setPositionWithAccessors")},{key:"editMode",value:vt(function(t){this.annotations.forEach(function(e){e.type&&(e.type.editMode=t,e.type.updateEditMode())})},"editMode")},{key:"updateDisable",value:vt(function(t){this.annotations.forEach(function(e){e.disable=t,e.type&&t.forEach(function(t){e.type[t]&&(e.type[t].remove&&e.type[t].remove(),e.type[t]=void 0)})})},"updateDisable")},{key:"updateTextWrap",value:vt(function(t){this.annotations.forEach(function(e){e.type&&e.type.updateTextWrap&&e.type.updateTextWrap(t)})},"updateTextWrap")},{key:"updateText",value:vt(function(){this.annotations.forEach(function(t){t.type&&t.type.drawText&&t.type.drawText()})},"updateText")},{key:"updateNotePadding",value:vt(function(t){this.annotations.forEach(function(e){e.type&&(e.type.notePadding=t)})},"updateNotePadding")},{key:"json",get:vt(function(){var t=this;return this.annotations.map(function(e){var i=e.json;return t.accessorsInverse&&e.data&&(i.data={},Object.keys(t.accessorsInverse).forEach(function(n){i.data[n]=t.accessorsInverse[n]({x:e.x,y:e.y})})),i})},"get$$1")},{key:"noteNodes",get:vt(function(){return this.annotations.map(function(t){return Hs({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})})},"get$$1")}]),t}(),Ys=vt(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy;return{move:{x:i,y:void 0===n?0:n}}},"pointHandle"),Qs=vt(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy,o=void 0===n?0:n,s=t.r1,a=t.r2,r=t.padding,l={move:{x:i,y:o}};return void 0!==s&&(l.r1={x:i+s/Math.sqrt(2),y:o+s/Math.sqrt(2)}),void 0!==a&&(l.r2={x:i+a/Math.sqrt(2),y:o+a/Math.sqrt(2)}),void 0!==r&&(l.padding={x:i+s+r,y:o}),l},"circleHandles"),Zs=vt(function(t){var e=t.group,i=t.handles,n=t.r,o=void 0===n?10:n,s=e.selectAll("circle.handle").data(i);s.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(a.drag().container(a.select("g.annotations").node()).on("start",function(t){return t.start&&t.start(t)}).on("drag",function(t){return t.drag&&t.drag(t)}).on("end",function(t){return t.end&&t.end(t)})),e.selectAll("circle.handle").attr("cx",function(t){return t.x}).attr("cy",function(t){return t.y}).attr("r",function(t){return t.r||o}).attr("class",function(t){return"handle "+(t.className||"")}),s.exit().remove()},"addHandles"),Js=vt(function(t,e){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},"leftRightDynamic"),Ks=vt(function(t,e){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},"topBottomDynamic"),ta=["topBottom","top","bottom"],ea=["leftRight","left","right"],ia=vt(function(t){var e=t.padding,i=void 0===e?0:e,n=t.bbox,o=void 0===n?{x:0,width:0,height:0}:n,s=t.align,a=t.orientation,r=t.offset,l=void 0===r?{x:0,y:0}:r,h=-o.x,c=0;return-1!==ta.indexOf(a)?(s=Ks(s,l.x),l.y<0&&"topBottom"===a||"top"===a?c-=o.height+i:c+=i,"middle"===s?h-=o.width/2:"right"===s&&(h-=o.width)):-1!==ea.indexOf(a)&&(s=Js(s,l.y),l.x<0&&"leftRight"===a||"left"===a?h-=o.width+i:h+=i,"middle"===s?c-=o.height/2:"top"===s&&(c-=o.height)),{x:h,y:c}},"noteAlignment"),na=vt(function(t){var e=t.data,i=t.curve,n=void 0===i?xs:i,o=t.canvasContext,s=t.className,a=t.classID,r=bs().curve(n),l={type:"path",className:s,classID:a,data:e};return o?(r.context(o),l.pathMethods=r):l.attrs={d:r(e)},l},"lineBuilder"),oa=vt(function(t){var e=t.data,i=t.canvasContext,n={type:"path",className:t.className,classID:t.classID,data:e},o=ys().innerRadius(e.innerRadius||0).outerRadius(e.outerRadius||e.radius||2).startAngle(e.startAngle||0).endAngle(e.endAngle||2*Math.PI);return i?(o.context(i),n.pathMethods=lineGen):n.attrs={d:o()},n},"arcBuilder"),sa=vt(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,s=void 0===o?0:o,a=t.bbox,r=t.offset;"top"===(e=Js(e,r.y))?s-=a.height:"middle"===e&&(s-=a.height/2);var l=[[n,s],[n,s+a.height]];return{components:[na({data:l,className:"note-line"})]}},"noteVertical"),aa=vt(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,s=void 0===o?0:o,a=t.offset,r=t.bbox;"right"===(e=Ks(e,a.x))?n-=r.width:"middle"===e&&(n-=r.width/2);var l=[[n,s],[n+r.width,s]];return{components:[na({data:l,className:"note-line"})]}},"noteHorizontal"),ra=vt(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,s=n.x-o.x,a=s+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("circle"===i&&(h.outerRadius||h.radius)){var c=Math.sqrt((s-a)*(s-a)+(r-l)*(r-l)),u=Math.asin(-l/c),p=h.outerRadius||h.radius+(h.radiusPadding||0);s=Math.abs(Math.cos(u)*p)*(a<0?-1:1),r=Math.abs(Math.sin(u)*p)*(l<0?-1:1)}if("rect"===i){var d=h.width,f=h.height;(d>0&&n.dx>0||d<0&&n.dx<0)&&(s=Math.abs(d)>Math.abs(n.dx)?d/2:d),(f>0&&n.dy>0||f<0&&n.dy<0)&&(r=Math.abs(f)>Math.abs(n.dy)?f/2:f),s===d/2&&r===f/2&&(s=a,r=l)}return[[s,r],[a,l]]},"lineSetup"),la=vt(function(t){var e=ra(t);return{components:[na({data:e,className:"connector"})]}},"connectorLine"),ha=vt(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,s=n.x-o.x,a=s+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("rect"===i){var c=h.width,u=h.height;(c>0&&n.dx>0||c<0&&n.dx<0)&&(s=Math.abs(c)>Math.abs(n.dx)?c/2:c),(u>0&&n.dy>0||u<0&&n.dy<0)&&(r=Math.abs(u)>Math.abs(n.dy)?u/2:u),s===c/2&&r===u/2&&(s=a,r=l)}var p=[[s,r],[a,l]],d=l-r,f=a-s,y=a,_=l,x=l<r&&a>s||a<s&&l>r?-1:1;if(Math.abs(f)<Math.abs(d)?(y=a,_=r+f*x):(_=l,y=s+d*x),"circle"===i&&(h.outerRadius||h.radius)){var m=(h.outerRadius||h.radius)+(h.radiusPadding||0),g=m/Math.sqrt(2);if(Math.abs(f)>g&&Math.abs(d)>g)p=[[s=g*(a<0?-1:1),r=g*(l<0?-1:1)],[y,_],[a,l]];else if(Math.abs(f)>Math.abs(d)){var b=Math.asin(-l/m);p=[[s=Math.abs(Math.cos(b)*m)*(a<0?-1:1),l],[a,l]]}else{var v=Math.acos(a/m);p=[[a,r=Math.abs(Math.sin(v)*m)*(l<0?-1:1)],[a,l]]}}else p=[[s,r],[y,_],[a,l]];return{components:[na({data:p,className:"connector"})]}},"connectorElbow"),ca=vt(function(t){var e=t.type,i=t.connectorData,n=t.subjectType;i||(i={}),i.points&&"number"!=typeof i.points||(i.points=ua(e.annotation.offset,i.points)),i.curve||(i.curve=Es);var o=[];if(e.editMode){var s=i.points.map(function(t,e){return Hs({},Ys({cx:t[0],cy:t[1]}),{index:e})}),r=vt(function(t){i.points[t][0]+=a.event.dx,i.points[t][1]+=a.event.dy,e.redrawConnector()},"updatePoint");o=e.mapHandles(s.map(function(t){return Hs({},t.move,{drag:r.bind(e,t.index)})}))}var l=ra({type:e,subjectType:n});return l=[l[0]].concat(Gs(i.points),[l[1]]),{components:[na({data:l,curve:i.curve,className:"connector"})],handles:o}},"connectorCurve"),ua=vt(function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=t.x/(e+1),n=t.y/(e+1),o=[],s=1;s<=e;s++)o.push([i*s+s%2*20,n*s-s%2*20]);return o},"createPoints"),pa=vt(function(t){var e=t.annotation,i=t.start,n=t.end,o=t.scale,s=void 0===o?1:o,a=e.position;i=i?[-n[0]+i[0],-n[1]+i[1]]:[e.dx,e.dy],n||(n=[e.x-a.x,e.y-a.y]);var r=n[0],l=n[1],h=i[0],c=i[1],u=10*s,p=16/180*Math.PI,d=Math.atan(c/h);h<0&&(d+=Math.PI);var f=[[r,l],[Math.cos(d+p)*u+r,Math.sin(d+p)*u+l],[Math.cos(d-p)*u+r,Math.sin(d-p)*u+l],[r,l]];return{components:[na({data:f,className:"connector-end connector-arrow",classID:"connector-end"})]}},"connectorArrow"),da=vt(function(t){var e=t.line,i=t.scale,n=void 0===i?1:i,o=oa({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(n)}});return o.attrs.transform="translate("+e.data[0][0]+", "+e.data[0][1]+")",{components:[o]}},"connectorDot"),fa=vt(function(t){var e=t.subjectData,i=t.type;e.radius||e.outerRadius||(e.radius=20);var n=[],o=oa({data:e,className:"subject"});if(i.editMode){var s=Qs({r1:o.data.outerRadius||o.data.radius,r2:o.data.innerRadius,padding:e.radiusPadding}),r=vt(function(t){var n=e[t]+a.event.dx*Math.sqrt(2);e[t]=n,i.redrawSubject(),i.redrawConnector()},"updateRadius"),l=[Hs({},s.r1,{drag:r.bind(i,void 0!==e.outerRadius?"outerRadius":"radius")})];e.innerRadius&&l.push(Hs({},s.r2,{drag:r.bind(i,"innerRadius")})),n=i.mapHandles(l)}return o.attrs["fill-opacity"]=0,{components:[o],handles:n}},"subjectCircle"),ya=vt(function(t){var e=t.subjectData,i=t.type;e.width||(e.width=100),e.height||(e.height=100);var n=[],o=e.width,s=e.height,r=na({data:[[0,0],[o,0],[o,s],[0,s],[0,0]],className:"subject"});if(i.editMode){var l=vt(function(){e.width=a.event.x,i.redrawSubject(),i.redrawConnector()},"updateWidth"),h=vt(function(){e.height=a.event.y,i.redrawSubject(),i.redrawConnector()},"updateHeight"),c=[{x:o,y:s/2,drag:l.bind(i)},{x:o/2,y:s,drag:h.bind(i)}];n=i.mapHandles(c)}return r.attrs["fill-opacity"]=.1,{components:[r],handles:n}},"subjectRect"),_a=vt(function(t){var e=t.subjectData,i=t.type.annotation.position,n=(void 0!==e.x1?e.x1:i.x)-i.x,o=(void 0!==e.x2?e.x2:i.x)-i.x,s=(void 0!==e.y1?e.y1:i.y)-i.y,a=(void 0!==e.y2?e.y2:i.y)-i.y;return{components:[na({data:[[n,s],[o,a]],className:"subject"})]}},"subjectThreshold"),xa=vt(function(t){var e=t.subjectData,i=void 0===e?{}:e,n=t.type,o=void 0===n?{}:n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=o.typeSettings&&o.typeSettings.subject;i.radius||(r&&r.radius?i.radius=r.radius:i.radius=14),i.x||r&&r.x&&(i.x=r.x),i.y||r&&r.y&&(i.y=r.y);var l=[],h=[],c=i.radius,u=.7*c,p=0,d=0,f=Math.sqrt(2)*c,y={xleftcorner:-c,xrightcorner:c,ytopcorner:-c,ybottomcorner:c,xleft:-f,xright:f,ytop:-f,ybottom:f};i.x&&!i.y?p=y["x"+i.x]:i.y&&!i.x?d=y["y"+i.y]:i.x&&i.y&&(p=y["x"+i.x+"corner"],d=y["y"+i.y+"corner"]);var _="translate("+p+", "+d+")",x=oa({className:"subject",data:{radius:c}});x.attrs.transform=_,x.attrs.fill=s.color,x.attrs["stroke-linecap"]="round",x.attrs["stroke-width"]="3px";var m=oa({className:"subject-ring",data:{outerRadius:c,innerRadius:u}});m.attrs.transform=_,m.attrs["stroke-width"]="3px",m.attrs.fill="white";var g=void 0;if(p&&d||!p&&!d)g=na({className:"subject-pointer",data:[[0,0],[p||0,0],[0,d||0],[0,0]]});else if(p||d){var b=vt(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*c/Math.sqrt(2)},"notCornerPointerXY");g=na({className:"subject-pointer",data:[[0,0],[b(p),b(d)],[b(p,-1),b(d,-1)],[0,0]]})}if(g&&(g.attrs.fill=s.color,g.attrs["stroke-linecap"]="round",g.attrs["stroke-width"]="3px",h.push(g)),o.editMode){var v={x:2*p,y:2*d,drag:vt(function(){i.x=a.event.x<2*-c?"left":a.event.x>2*c?"right":void 0,i.y=a.event.y<2*-c?"top":a.event.y>2*c?"bottom":void 0,o.redrawSubject()},"dragBadge").bind(o)};v.x||v.y||(v.y=-c),l=o.mapHandles([v])}var w=void 0;return i.text&&(w={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:i.text,"text-anchor":"middle",dy:".25em",x:p,y:d}}),h.push(x),h.push(m),h.push(w),{components:h,handles:l}},"subjectBadge"),ma=function(){function t(e){var i=e.a,n=e.annotation,o=e.editMode,s=e.dispatcher,a=e.notePadding,r=e.accessors;if(Bs(this,t),this.a=i,this.note=-1===n.disable.indexOf("note")&&i.select("g.annotation-note"),this.noteContent=this.note&&i.select("g.annotation-note-content"),this.connector=-1===n.disable.indexOf("connector")&&i.select("g.annotation-connector"),this.subject=-1===n.disable.indexOf("subject")&&i.select("g.annotation-subject"),this.dispatcher=s,s){var l=ka.bind(null,s,n);l({component:this.note,name:"note"}),l({component:this.connector,name:"connector"}),l({component:this.subject,name:"subject"})}this.annotation=n,this.editMode=n.editMode||o,this.notePadding=void 0!==a?a:3,this.offsetCornerX=0,this.offsetCornerY=0,r&&n.data&&this.init(r)}return L(t,"t"),vt(t,"Type"),Vs(t,[{key:"init",value:vt(function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)},"init")},{key:"mapY",value:vt(function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))},"mapY")},{key:"mapX",value:vt(function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))},"mapX")},{key:"updateEditMode",value:vt(function(){this.a.selectAll("circle.handle").remove()},"updateEditMode")},{key:"drawOnSVG",value:vt(function(t,e){var i=this;Array.isArray(e)||(e=[e]),e.filter(function(t){return t}).forEach(function(e){var n=e.type,o=e.className,s=e.attrs,a=e.handles,r=e.classID;if("handle"===n)Zs({group:t,r:s&&s.r,handles:a});else{Sa(t,[i.annotation],n,o,r);for(var l=t.select(n+"."+(r||o)),h=Object.keys(s),c=[],u=l.node().attributes,p=u.length-1;p>=0;p--){var d=u[p].name;-1===h.indexOf(d)&&"class"!==d&&c.push(d)}h.forEach(function(t){"text"===t?l.text(s[t]):l.attr(t,s[t])}),c.forEach(function(t){return l.attr(t,null)})}})},"drawOnSVG")},{key:"getNoteBBox",value:vt(function(){return Ca(this.note,".annotation-note-content text")},"getNoteBBox")},{key:"getNoteBBoxOffset",value:vt(function(){var t=Ca(this.note,".annotation-note-content"),e=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(e[1])+this.annotation.dx,t.offsetCornerY=parseFloat(e[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t},"getNoteBBoxOffset")},{key:"drawSubject",value:vt(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.subject,n=e.type,o={type:this,subjectData:i},s={};"circle"===n?s=fa(o):"rect"===n?s=ya(o):"threshold"===n?s=_a(o):"badge"===n&&(s=xa(o,this.annotation));var a=s,r=a.components,l=void 0===r?[]:r,h=a.handles,c=void 0===h?[]:h;return l.forEach(function(e){e&&e.attrs&&!e.attrs.stroke&&(e.attrs.stroke=t.annotation.color)}),this.editMode&&(c=c.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),l.push({type:"handle",handles:c})),l},"drawSubject")},{key:"drawConnector",value:vt(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.connector,n=i.type||e.type,o={type:this,connectorData:i};o.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var s="curve"===n?ca(o):"elbow"===n?ha(o):la(o),a=s.components,r=void 0===a?[]:a,l=s.handles,h=void 0===l?[]:l,c=r[0];c&&(c.attrs.stroke=this.annotation.color,c.attrs.fill="none");var u=i.end||e.end,p={};if("arrow"===u){var d=c.data[1],f=c.data[0];Math.sqrt(Math.pow(d[0]-f[0],2)+Math.pow(d[1]-f[1],2))<5&&c.data[2]&&(d=c.data[2]),p=pa({annotation:this.annotation,start:d,end:f,scale:i.endScale})}else"dot"===u?p=da({line:c,scale:i.endScale}):u&&"none"!==u||this.connector&&this.connector.select(".connector-end").remove();return p.components&&(p.components.forEach(function(e){e.attrs.fill=t.annotation.color,e.attrs.stroke=t.annotation.color}),r=r.concat(p.components)),this.editMode&&0!==h.length&&r.push({type:"handle",handles:h}),r},"drawConnector")},{key:"drawNote",value:vt(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.note,n=i.align||e.align||"dynamic",o={bbox:e.bbox,align:n,offset:this.annotation.offset},s=i.lineType||e.lineType,r={};"vertical"===s?r=sa(o):"horizontal"===s&&(r=aa(o));var l=r,h=l.components,c=void 0===h?[]:h,u=l.handles,p=void 0===u?[]:u;if(c.forEach(function(e){e.attrs.stroke=t.annotation.color}),this.editMode){p=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),c.push({type:"handle",handles:p});var d=this.dragNote.bind(this),f=this.dragstarted.bind(this),y=this.dragended.bind(this);this.note.call(a.drag().container(a.select("g.annotations").node()).on("start",function(t){return f(t)}).on("drag",function(t){return d(t)}).on("end",function(t){return y(t)}))}else this.note.on("mousedown.drag",null);return c},"drawNote")},{key:"drawNoteContent",value:vt(function(t){var e=this.annotation.note,i=void 0!==e.padding?e.padding:this.notePadding,n=e.orientation||t.orientation||"topBottom",o=e.lineType||t.lineType,s=e.align||t.align||"dynamic";"vertical"===o?n="leftRight":"horizontal"===o&&(n="topBottom");var a={padding:i,bbox:t.bbox,offset:this.annotation.offset,orientation:n,align:s},r=ia(a),l=r.x,h=r.y;return this.offsetCornerX=l+this.annotation.dx,this.offsetCornerY=h+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+l+", "+h+")"),[]},"drawNoteContent")},{key:"drawOnScreen",value:vt(function(t,e){return this.drawOnSVG(t,e)},"drawOnScreen")},{key:"redrawSubject",value:vt(function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())},"redrawSubject")},{key:"redrawConnector",value:vt(function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())},"redrawConnector")},{key:"redrawNote",value:vt(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))},"redrawNote")},{key:"setPosition",value:vt(function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")},"setPosition")},{key:"clearComponents",value:vt(function(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()},"clearComponents")},{key:"setOffset",value:vt(function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}},"setOffset")},{key:"setPositionWithAccessors",value:vt(function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()},"setPositionWithAccessors")},{key:"setClassName",value:vt(function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))},"setClassName")},{key:"draw",value:vt(function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()},"draw")},{key:"dragstarted",value:vt(function(){a.event.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")},"dragstarted")},{key:"dragended",value:vt(function(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")},"dragended")},{key:"dragSubject",value:vt(function(){var t=this.annotation.position;t.x+=a.event.dx,t.y+=a.event.dy,this.annotation.position=t},"dragSubject")},{key:"dragNote",value:vt(function(){var t=this.annotation.offset;t.x+=a.event.dx,t.y+=a.event.dy,this.annotation.offset=t},"dragNote")},{key:"mapHandles",value:vt(function(t){var e=this;return t.map(function(t){return Hs({},t,{start:e.dragstarted.bind(e),end:e.dragended.bind(e)})})},"mapHandles")}]),t}(),ga=vt(function(t,e,i){return function(t){function n(t){Bs(this,n);var i=qs(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));return i.typeSettings=e,e.disable&&e.disable.forEach(function(t){i[t]&&i[t].remove(),i[t]=void 0,"note"===t&&(i.noteContent=void 0)}),i}return L(n,"o"),$s(n,t),vt(n,"customType"),Vs(n,[{key:"className",value:vt(function(){return""+(e.className||Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this)&&Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this).call(this)||"")},"className")},{key:"drawSubject",value:vt(function(t){return this.typeSettings.subject=Hs({},e.subject,this.typeSettings.subject),Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawSubject",this).call(this,Hs({},t,this.typeSettings.subject))},"drawSubject")},{key:"drawConnector",value:vt(function(t){return this.typeSettings.connector=Hs({},e.connector,this.typeSettings.connector),Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawConnector",this).call(this,Hs({},t,e.connector,this.typeSettings.connector))},"drawConnector")},{key:"drawNote",value:vt(function(t){return this.typeSettings.note=Hs({},e.note,this.typeSettings.note),Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNote",this).call(this,Hs({},t,e.note,this.typeSettings.note))},"drawNote")},{key:"drawNoteContent",value:vt(function(t){return Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNoteContent",this).call(this,Hs({},t,e.note,this.typeSettings.note))},"drawNoteContent")}],[{key:"init",value:vt(function(t,e){return Ws(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,t,e),i&&(t=i(t,e)),t},"init")}]),n}(t)},"customType"),ba=function(){function t(e){Bs(this,t);var i=qs(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.textWrap=e.textWrap||120,i.drawText(),i}return L(t,"t"),$s(t,ma),vt(t,"d3NoteText"),Vs(t,[{key:"updateTextWrap",value:vt(function(t){this.textWrap=t,this.drawText()},"updateTextWrap")},{key:"drawText",value:vt(function(){if(this.note){Sa(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");Sa(t,[this.annotation],"rect","annotation-note-bg"),Sa(t,[this.annotation],"text","annotation-note-label"),Sa(t,[this.annotation],"text","annotation-note-title");var e={height:0},i=this.a.select("text.annotation-note-label"),n=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,o=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,s=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,a={top:0,bottom:0,left:0,right:0};if("number"==typeof s?a={top:s,bottom:s,left:s,right:s}:s&&"object"===(void 0===s?"undefined":Ns(s))&&(a=Hs(a,s)),this.annotation.note.title){var r=this.a.select("text.annotation-note-title");r.text(this.annotation.note.title),r.attr("fill",this.annotation.color),r.attr("font-weight","bold"),r.call(Aa,n,o),e=r.node().getBBox()}i.text(this.annotation.note.label).attr("dx","0"),i.call(Aa,n,o),i.attr("y",1.1*e.height||0),i.attr("fill",this.annotation.color);var l=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",l.width+a.left+a.right).attr("height",l.height+a.top+a.bottom).attr("x",l.x-a.left).attr("y",-a.top).attr("fill","white").attr("fill-opacity",0)}},"drawText")}]),t}();ga(ba,{className:"label",note:{align:"middle"}});var va=ga(ba,{className:"callout",note:{lineType:"horizontal"}}),wa=ga(va,{className:"callout elbow",connector:{type:"elbow"}});ga(va,{className:"callout curve",connector:{type:"curve"}}),ga(ma,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),ga(ba,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),ga(ba,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),ga(function(){function t(){return Bs(this,t),qs(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return L(t,"t"),$s(t,va),vt(t,"ThresholdMap"),Vs(t,[{key:"mapY",value:vt(function(e){Ws(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapY",this).call(this,e);var i=this.annotation;(i.subject.x1||i.subject.x2)&&i.data&&e.y&&(i.y=e.y(i.data)),!i.subject.x1&&!i.subject.x2||i.x||(i.x=i.subject.x1||i.subject.x2)},"mapY")},{key:"mapX",value:vt(function(e){Ws(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapX",this).call(this,e);var i=this.annotation;(i.subject.y1||i.subject.y2)&&i.data&&e.x&&(i.x=e.x(i.data)),!i.subject.y1&&!i.subject.y2||i.y||(i.y=i.subject.y1||i.subject.y2)},"mapX")}]),t}(),{className:"callout xythreshold",subject:{type:"threshold"}});var Sa=vt(function(t,e,i,n,o){var s=t.selectAll(i+"."+(o||n)).data(e);return s.enter().append(i).merge(s).attr("class",n),s.exit().remove(),t},"newWithClass"),ka=vt(function(t,e,i){var n=i.component,o=i.name;n&&n.on("mouseover.annotations",function(){t.call(o+"over",n,e)}).on("mouseout.annotations",function(){return t.call(o+"out",n,e)}).on("click.annotations",function(){return t.call(o+"click",n,e)})},"addHandlers"),Aa=vt(function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each(function(){for(var t=a.select(this),o=t.text().split(i||/[ \t\r\n]+/).reverse().filter(function(t){return""!==t}),s=void 0,r=[],l=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");s=o.pop();)r.push(s),l.text(r.join(" ")),l.node().getComputedTextLength()>e&&r.length>1&&(r.pop(),l.text(r.join(" ")),r=[s],l=t.append("tspan").attr("x",0).attr("dy",n+"em").text(s))})},"wrap"),Ca=vt(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(e).nodes().reduce(function(t,e){var i=e.getBBox();t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),t.width=Math.max(t.width,i.width);var n=e&&e.attributes&&e.attributes.y;return t.height=Math.max(t.height,(n&&parseFloat(n.value)||0)+i.height),t},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}},"bboxWithoutHandles");function Ma(){var t=[],e=void 0,i=void 0,n=[],o={},s={},r=!1,l=void 0,h=va,c=void 0,u=void 0,p=a.dispatch("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),d=void 0,f=vt(function(i){d=i,r||i.selectAll("circle.handle").remove();var f=t.map(function(t){return t.type||(t.type=h),t.disable||(t.disable=n),new Us(t)});e=e||new Xs({annotations:f,accessors:o,accessorsInverse:s,ids:l}),i.selectAll("g").data([e]).enter().append("g").attr("class","annotations");var y=i.select("g.annotations");Sa(y,e.annotations,"g","annotation"),y.selectAll("g.annotation").each(function(t){var e=a.select(this);e.attr("class","annotation"),Sa(e,[t],"g","annotation-connector"),Sa(e,[t],"g","annotation-subject"),Sa(e,[t],"g","annotation-note"),Sa(e.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:e,annotation:t,textWrap:c,notePadding:u,editMode:r,dispatcher:p,accessors:o}),t.type.draw(),t.type.drawText&&t.type.drawText()})},"annotation");return f.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",e.json),window.copy(JSON.stringify(e.json.map(function(t){return delete t.type,t}))),f},f.update=function(){return t&&e&&(t=e.annotations.map(function(t){return t.type.draw(),t})),f},f.updateText=function(){return e&&(e.updateText(c),t=e.annotations),f},f.updatedAccessors=function(){return e.setPositionWithAccessors(),t=e.annotations,f},f.disable=function(i){return arguments.length?(n=i,e&&(e.updateDisable(n),t=e.annotations),f):n},f.textWrap=function(i){return arguments.length?(c=i,e&&(e.updateTextWrap(c),t=e.annotations),f):c},f.notePadding=function(i){return arguments.length?(u=i,e&&(e.updateNotePadding(u),t=e.annotations),f):u},f.type=function(i,n){return arguments.length?(h=i,e&&(e.annotations.map(function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=h,t.subject=n&&n.subject||t.subject,t.connector=n&&n.connector||t.connector,t.note=n&&n.note||t.note}),t=e.annotations),f):h},f.annotations=function(i){return arguments.length?(t=i,e&&e.annotations&&(t.some(function(t){return!t.type||"[object Object]"!==t.type.toString()})?(e=null,f(d)):e.annotations=t),f):e&&e.annotations||t},f.context=function(t){return arguments.length?(i=t,f):i},f.accessors=function(t){return arguments.length?(o=t,f):o},f.accessorsInverse=function(t){return arguments.length?(s=t,f):s},f.ids=function(t){return arguments.length?(l=t,f):l},f.editMode=function(i){return arguments.length?(r=i,d&&d.selectAll("g.annotation").classed("editable",r),e&&(e.editMode(r),t=e.annotations),f):r},f.collection=function(t){return arguments.length?(e=t,f):e},f.on=function(){var t=p.on.apply(p,arguments);return t===p?f:t},f}function Ta(t){return.65*(t-.5)*2*Math.PI}function Pa(t,e){return{x:Math.cos(t-Math.PI/2)*e,y:Math.sin(t-Math.PI/2)*e}}function Ia(t,e,i=!1){const n=Pa(t,e),o=180*t/Math.PI+(!0===i?180:0);return`translate(${n.x}, ${n.y}) rotate(${o})`}function Ea(t,e,i=!1){return function(n){const o=a.interpolate(n.angle,t);return n.angle=t,function(t){return Ia(o(t),e,i)}}}function Fa(t,e,i){return function(n){const o=a.interpolate(n.startAngle,t),s=a.interpolate(n.endAngle,e);return function(t){return n.startAngle=o(t),n.endAngle=s(t),i(n)}}}L(Ma,"na"),L(Ta,"oa"),L(Pa,"sa"),L(Ia,"aa"),L(Ea,"ra"),L(Fa,"la"),vt(Ma,"annotation"),vt(Ta,"value2Angle"),vt(Pa,"pointOnArc"),vt(Ia,"indicatorTranslate"),vt(Ea,"indicatorTween"),vt(Fa,"arcTween");const Da=(w=class extends a.SVGWidget{_d3Arc=Qt().innerRadius(85).outerRadius(100);_colorScale=a.scaleLinear().interpolate(a.interpolateHcl);_usageArc;_meanArc;_freeArc;_indInner;_indOuter;_centerTextG;_centerText;_bottomText;_tooltipG;_mainTooltip;constructor(){super()}tip(t){if(null===t||""===t.label)this._tooltipG.transition().style("opacity",0).on("interrupt end",()=>{this._tooltipG.selectAll("g").remove()});else{this._tooltipG.interrupt().style("opacity",1),t.w=this._centerText.datum().w+10;let e="horizontal",i=0,n=5,o=5;t.y>=5&&t.y<=25?(i=t.x<0?-t.w/2:t.w/2,n=12.5,o=void 0,e="vertical"):t.y>25&&(n=25,o=0);const s=Ma().type(wa).annotations([{data:t,dx:-t.x+i,dy:-t.y+n,color:"black",note:{label:t.label,lineType:e,padding:o,align:"middle"}}]).accessors({x:vt(t=>t.x,"x"),y:vt(t=>t.y,"y")});this._tooltipG.call(s)}}calcSize(t,e,i){const n=t.node().getBBox(),o=e/n.width,s=i/n.height,a=o<s?o:s;return{width:n.width,height:n.height,scale:a}}updateText(t,e,i,n,o){t.datum({x:e,y:i,w:n,h:o}).attr("transform",null);const s=this.calcSize(t,n,o),a=e+n/2-s.width/2*s.scale,r=i+o/2-s.height/2*s.scale;t.attr("transform",`translate(${a}, ${r}) scale(${s.scale})`)}calcWidth(){return Math.min(this.width(),this.height(),this.maxDiameter())}enter(t,e){super.enter(t,e),e.on("click",t=>{this.click(t)}),this._usageArc=e.append("path").datum({startAngle:Ta(0),endAngle:Ta(0)}).style("fill","green").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._freeArc=e.append("path").datum({startAngle:Ta(0),endAngle:Ta(1)}).style("fill","lightGrey"),this._meanArc=e.append("path").datum({startAngle:Ta(0),endAngle:Ta(0)}).style("fill","black").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.tickValueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._mainTooltip=e.append("title");const i=this;function n(){return e.append("path").datum({angle:Ta(0)}).style("fill","black").style("stroke","black").attr("d","M 0 0 l -3 -3 l 6 0 z").on("mousemove",t=>{const[e,n]=i._d3Arc.centroid(i._meanArc.datum());i.tip({x:e,y:n,label:i.tickValueDescription()})}).on("mouseout",t=>{i.tip(null)})}L(n,"o"),vt(n,"appendIndicator"),this._indInner=n(),this._indOuter=n(),this._centerText=e.append("text").attr("dy",".66em").style("fill","green").on("mousemove",t=>{this.tip({x:0,y:0,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._bottomText=e.append("text").attr("dy",".66em").on("mousemove",t=>{this.tip({x:0,y:t.y,label:this.titleDescription()})}).on("mouseout",t=>{this.tip(null)}),this._tooltipG=e.append("g").attr("class","annotation-tip")}update(t,e){super.update(t,e),this._colorScale.domain(this.colorDomain()).range(this.colorRange()),e.attr("title",this.tooltip()).style("cursor",this.click!==w.prototype.click?"pointer":null);const i=this.calcWidth()/3,n=this.calcWidth()/2-5;this._d3Arc.innerRadius(i).outerRadius(n);const o=this.value(),s=this.tickValue();this._usageArc.style("fill",this._colorScale(o)).transition().duration(750).attrTween("d",Fa(Ta(0),Ta(o),this._d3Arc)),this._freeArc.style("fill",this.emptyColor()).transition().duration(750).attrTween("d",Fa(Ta(o),Ta(1),this._d3Arc)),this._meanArc.style("fill",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("d",Fa(Ta(s-.001),Ta(s+.001),this._d3Arc)),this._indInner.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",Ea(Ta(s),i,!0)),this._indOuter.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",Ea(Ta(s),n)),this._centerText.style("fill",this._colorScale(o)).text(a.format(".0%")(o)),this._bottomText.style("fill",this.click!==w.prototype.click?this.titleClickColor():this.titleColor()).style("text-decoration",this.click!==w.prototype.click?"underline":null).text(this.title());const r=Pa(Ta(1),i-8);this.updateText(this._centerText,-r.x,-r.y,2*r.x,2*r.y);const l=Pa(Ta(1),n);l.y+=5;const h=this.calcWidth()-20,c=this.calcWidth()/2-l.y-5;this.updateText(this._bottomText,-h/2,l.y,h,c),this._mainTooltip.text(this.tooltip())}click(t){}},L(w,"_Gauge"),w);vt(Da,"Gauge");let za=Da;za.prototype._class+=" chart_Gauge",za.prototype.publish("title","","string","Title"),za.prototype.publish("titleDescription","","string","Title Description"),za.prototype.publish("titleColor","black","html-color","Color of the title text"),za.prototype.publish("titleClickColor","blue","html-color","Color of the title text when clickable"),za.prototype.publish("maxDiameter",128,"number","Max Diameter"),za.prototype.publish("value",0,"number","Value"),za.prototype.publish("valueDescription","","string","Value Description"),za.prototype.publish("showTick",!1,"boolean","Show Tick"),za.prototype.publish("tickValue",0,"number","Tick Value"),za.prototype.publish("tickValueDescription","","string","Tick Value Description"),za.prototype.publish("tooltip","","string","Tooltip"),za.prototype.publish("colorRange",["green","green","green","green","green","green","green","green","orange","red","red"],"array","Array of colors for the filled gauge portion. The fill color will be relative to the gauge value."),za.prototype.publish("colorDomain",[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],"array","This array augments the mapping of the value to the fill colorRange."),za.prototype.publish("emptyColor","lightgrey","html-color","Color of the empty portion of the gauge"),za.prototype.publish("tickColor","black","html-color","Color of the tick");const Ra=vt((t,e)=>t[1]-e[1]>0?1:-1,"sortAscending"),Oa=vt((t,e)=>t[1]-e[1]>0?-1:1,"sortDescending"),ja=(S=class extends a.SVGWidget{_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),ht.call(this),_t.call(this),a.Utility.SimpleSelectionMixin.call(this),this.d3Pie=se(),this.d3Arc=Qt(),this.d3LabelArc=Qt(),this.tooltipTick_default(!1).tooltipOffset_default(0)}intersection(t,e){return this.intersectCircle(this.calcOuterRadius(),t,e)}calcInnerRadius(){return this.innerRadius_exists()?this.calcOuterRadius()*this.innerRadius()/100:0}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t},!1)),"Verdana",12).width,e=this._size.width-(this.showLabels()?2*t:0)-20,i=this._size.height-36-(this.showLabels()?this._smallValueLabelHeight:0),n=Math.min(e,i)/2-2;return e/2-2<this.minOuterRadius()?this._labelWidthLimit=t-(this.minOuterRadius()-(e/2-2)):this._labelWidthLimit=t,n<this.minOuterRadius()?this.minOuterRadius():n}calcSmallValueLabelHeight(){const t=this.data().reduce((t,e)=>t+e[1],0);let e=0;return this.data().forEach(i=>{i[1]/t<.1&&e++}),this.labelHeight()*e}calcTotalValue(){return this.data().reduce((t,e)=>t+e[1],0)}getLabelText(t,e){let i,n=t.data[0];if(void 0!==this._labelWidthLimit&&e){const t=this.textSize(n,"Verdana",this.labelHeight()).width;this._labelWidthLimit<t&&(i=n.length*(this._labelWidthLimit/t)-3,n=i<n.length?n.slice(0,i)+"...":n)}if(this.showSeriesValue()&&(n+=` : ${this._seriesValueFormatter(t.data[1])}`),this.showSeriesPercentage()){let e=this._totalValue;const i=this.dataMeta();void 0!==i.sum&&(e=i.sum);const o=t.data[1]/e*100;n+=` : ${this._seriesPercentageFormatter(o)}%`}return n}selection(t){if(!arguments.length)try{return this._selection.selection2()[0]?.data}catch(i){return}const e=JSON.stringify(t);this._selection.selection2(t=>e===JSON.stringify(t.data))}selectByLabel(t){const e=this.data().filter(e=>e[0]===t)[0];e&&this.selection(e)}_slices;_labels;enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this._slices=e.append("g"),this._labels=e.append("g");const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t.data[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t.data[0]),value:t.data[n+1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){super.update(t,e);const i=this;this.updateD3Pie(),this._palette=this._palette.switch(this.paletteID()),this._seriesValueFormatter=a.format(this.seriesValueFormat()),this._seriesPercentageFormatter=a.format(this.seriesPercentageFormat()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._smallValueLabelHeight=this.calcSmallValueLabelHeight(),this._totalValue=this.calcTotalValue();const n=this.calcInnerRadius(),o=this.calcOuterRadius(),s=o+12;this.d3Arc.innerRadius(n).padRadius(o).outerRadius(o),this._quadIdxArr=[[],[],[],[]];const r=[...this.data()];switch(this.sortDataByValue()){case"ascending":r.sort(Ra);break;case"descending":r.sort(Oa)}const l=this._slices.selectAll(".arc").data(this.d3Pie(r),t=>t.data[0]);this._labelPositions=[],l.enter().append("g").attr("class",(t,e)=>"arc series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).each(function(t,e){a.select(this).append("path").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).on("mouseover",d(0,0)).on("mouseout",d(-5,150))}).merge(l).transition().attr("opacity",1).each(function(t,e){const n=i.getQuadrant(p(t));i._quadIdxArr[n].push(e),t.outerRadius=o-5,a.select(this).select("path").transition().attr("d",i.d3Arc).style("fill",i.fillColor(t.data,i.columns()[1],t.data[1]))}),l.exit().transition().style("opacity",0).remove(),this.d3LabelArc.innerRadius(s).outerRadius(s);const h=this._labels.selectAll("text").data(this.showLabels()?this.d3Pie(r):[],t=>t.data[0]),c=h.enter().append("text").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).attr("dy",".5em").on("click",function(t){i._slices.selectAll("g").filter(function(e){t.data===e.data&&(i._selection.click(this),i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this)))})}).on("dblclick",function(t){i._slices.selectAll("g").filter(function(e){t.data===e.data&&i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))})}).merge(h).text(t=>this.getLabelText(t,!0)).each(function(t,e){const n=i.d3LabelArc.centroid(t),o=p(t);n[0]=s*(i.isLeftSide(o)?1:-1),i._labelPositions.push({top:n[1],bottom:n[1]+i.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),c.transition().style("font-size",this.labelHeight()+"px").attr("transform",(t,e)=>{const n=i.d3LabelArc.centroid(t);return n[0]=s*(i.isLeftSide(p(t))?1:-1),n[1]=i._labelPositions[e].top,"translate("+n+")"}).style("text-anchor",t=>this.isLeftSide(p(t))?"start":"end")),h.exit().remove();const u=this._labels.selectAll("polyline").data(this.showLabels()?this.d3Pie(r):[],t=>this.getLabelText(t,!0));function p(t){return t.startAngle+(t.endAngle-t.startAngle)/2}function d(t,e){return function(){a.select(this).transition().delay(e).attrTween("d",function(e){const n=a.interpolate(e.outerRadius,o+t);return function(t){return e.outerRadius=n(t),i.d3Arc(e)}})}}L(p,"d"),L(d,"y"),u.enter().append("polyline").merge(u).transition().attr("points",function(t,e){const n=i.d3LabelArc.centroid(t),o=i.d3Arc.centroid(t),a=[...n];return n[0]=s*(i.isLeftSide(p(t))?1:-1),n[1]=i._labelPositions[e].top,[o,a,n]}),u.exit().remove(),this.showLabels()&&this.centerOnLabels(),vt(p,"midAngle"),vt(d,"arcTween")}isLeftSide(t){return(t=s.normalizeRadians(t))>2*Math.PI?t:t<Math.PI&&t>0}getQuadrant(t){let e=0;const i=s.normalizeRadians(t);return e=i<=1*Math.PI&&i>=.5*Math.PI?3:e,e=i<=.5*Math.PI&&i>=0*Math.PI?2:e,e=i<=0*Math.PI&&i>=-.5*Math.PI?1:e,e}centerOnLabels(){const t=this.pos().y,e=2*t,i=this.calcOuterRadius(),n=Math.min(this._minLabelTop,-i),o=Math.max(this._maxLabelBottom,i),s=e-(o-n),a=Math.abs(this._minLabelTop);let r=0;o>t?(r=t-o+this.labelHeight()/2,r-=s/2):n<0&&a>t&&(r=a-t+this.labelHeight()/2,r+=s/2);const l=this.pos();this.pos({y:l.y+r,x:l.x})}adjustForOverlap(){const t=this.labelHeight();this._quadIdxArr.forEach((e,i)=>{let n;this._quadIdxArr[i].sort((t,e)=>1===i||2===i?this._labelPositions[t].top>this._labelPositions[e].top?-1:1:0===i||3===i?this._labelPositions[t].top>this._labelPositions[e].top?1:-1:void 0),this._quadIdxArr[i].forEach((e,o)=>{if(o>0)if(1===i||2===i){if(n<this._labelPositions[e].bottom){const t=this._labelPositions[e].bottom-n;this._labelPositions[e].top-=t,this._labelPositions[e].bottom-=t}}else if((0===i||3===i)&&n+t>this._labelPositions[e].top){const i=Math.abs(this._labelPositions[e].top)-Math.abs(n+t);this._labelPositions[e].top-=i,this._labelPositions[e].bottom-=i}n=this._labelPositions[e].top})}),this._minLabelTop=0,this._maxLabelBottom=0,this._quadIdxArr.forEach((t,e)=>{this._quadIdxArr[e].forEach((t,e)=>{this._minLabelTop>this._labelPositions[t].top&&(this._minLabelTop=this._labelPositions[t].top),this._maxLabelBottom<this._labelPositions[t].bottom&&(this._maxLabelBottom=this._labelPositions[t].bottom)})})}exit(t,e){super.exit(t,e)}updateD3Pie(){const t=s.normalizeRadians(s.degreesToRadians(this.startAngle()));switch(this.sortDataByValue()){case"ascending":this.d3Pie.sort(Ra);break;case"descending":this.d3Pie.sort(Oa);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(.0025).startAngle(t).endAngle(2*Math.PI+t).value(function(t){return t[1]})}},L(S,"_Pie"),S);vt(ja,"Pie"),wt(ja,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let La=ja;La.prototype._class+=" chart_Pie",La.prototype.implements(ht.prototype),La.prototype.implements(_t.prototype),La.prototype.mixin(a.Utility.SimpleSelectionMixin),La.prototype.publish("showLabels",!0,"boolean","If true, wedge labels will display"),La.prototype.publish("showSeriesValue",!1,"boolean","Append data series value next to label",null,{disable:vt(t=>!t.showLabels(),"disable")}),La.prototype.publish("seriesValueFormat",",.0f","string","Number format used for formatting series values",null,{disable:vt(t=>!t.showSeriesValue(),"disable")}),La.prototype.publish("showSeriesPercentage",!1,"boolean","Append data series percentage next to label",null,{disable:vt(t=>!t.showLabels(),"disable")}),La.prototype.publish("seriesPercentageFormat",",.0f","string","Number format used for formatting series percentages",null,{disable:vt(t=>!t.showSeriesPercentage(),"disable")}),La.prototype.publish("paletteID","default","set","Color palette for this widget",La.prototype._palette.switch(),{tags:["Basic","Shared"]}),La.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),La.prototype.publish("innerRadius",0,"number","Sets inner pie hole radius as a percentage of the radius of the pie chart",null,{tags:["Basic"],range:{min:0,step:1,max:100}}),La.prototype.publish("minOuterRadius",20,"number","Minimum outer radius (pixels)"),La.prototype.publish("startAngle",0,"number","Starting angle of the first (and largest) wedge (degrees)"),La.prototype.publish("labelHeight",12,"number","Font size of labels (pixels)",null,{disable:vt(t=>!t.showLabels(),"disable")}),La.prototype.publish("sortDataByValue","descending","set","Sort data by value",["none","ascending","descending"]);const Na=(L(k=class extends La{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i=this._pos.x,n=this._pos.y;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),n+=this._size.height/4,this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(-Math.PI/2).endAngle(Math.PI/2)}},"_HalfPie"),k);vt(Na,"HalfPie"),Na.prototype._class+=" chart_HalfPie";const Ba=(L(A=class extends Ge{_domForeignObject;_domCanvas;_heat;constructor(){super(),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}radius(t){return this.radiusX(t),this.radiusY(t),this}layerEnter(t,e,i=250){super.layerEnter(t,e,i),this._domForeignObject=this.svg.insert("foreignObject","#"+this.id()+"_clippath"),this._domCanvas=this._domForeignObject.append("xhtml:body").style("margin","0px").style("padding","0px").style("background-color","transparent").append("canvas"),this._heat=Ha(this._domCanvas.node())}layerUpdate(t,e,i=250){super.layerUpdate(t,e),this._palette=this._palette.switch(this.paletteID());let n=this.width()-this.margin.left-this.margin.right;n<0&&(n=0);let o=this.height()-this.margin.top-this.margin.bottom;o<0&&(o=0),this._domForeignObject.attr("x",this.margin.left).attr("y",this.margin.top).attr("width",n).attr("height",o),this._domCanvas.attr("width",n).attr("height",o);const s="horizontal"===t.orientation()?this.data().map(e=>[t.dataPos(e[0]),t.valuePos(e[1]),e[2]]):this.data().map(e=>[t.valuePos(e[1]),t.dataPos(e[0]),e[2]]),r=this.maxWeight_exists()?this.maxWeight():a.max(s,t=>t[2]);if("default"!==this.paletteID()){const t={},e=8,i=this.reversePalette();for(let n=0;n<e;++n)t[n/e]=this._palette((i?e-n:n)/e,0,1);this._heat.gradient(t)}else this._heat.gradient(this._heat.defaultGradient);this._heat.resize();const l=this.radiusAsPercent()?this.radiusX()*n/100:this.radiusX(),h=this.radiusAsPercent()?this.radiusY()*o/100:this.radiusY();this._heat.clear().radius(l,h,this.blur()).max(r).data(s).draw(this.minOpacity())}},"_Heat"),A);vt(Ba,"Heat");let Va=Ba;function Ha(t){if(!(this instanceof Ha))return new Ha(t);this._canvas=t="string"==typeof t?document.getElementById(t):t,this._ctx=t.getContext("2d"),this._width=t.width,this._height=t.height,this._max=1,this._data=[]}L(Ha,"ga"),Va.prototype._class+=" chart_Heat",Va.prototype._palette=a.Palette.rainbow("default"),Va.prototype.publish("paletteID","default","set","Color palette for this widget",Va.prototype._palette.switch(),{tags:["Basic"]}),Va.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Va.prototype.publish("reversePalette",!1,"boolean","Reverse Palette Colors",null,{disable:vt(t=>"default"===t.paletteID(),"disable")}),Va.prototype.publish("radiusX",25,"number","Point X radius (25 by default)"),Va.prototype.publish("radiusY",25,"number","Point Y radius (25 by default)"),Va.prototype.publish("radiusAsPercent",!1,"boolean","Calculate RadiusX + RadiusY as % of size"),Va.prototype.publish("blur",15,"number","Point blur radius (15 by default)"),Va.prototype.publish("maxWeight",void 0,"number","Clamp max weight to value (optional), omitting uses max data point",void 0,{optional:!0}),Va.prototype.publish("minOpacity",.05,"number","Minimum point opacity (0.05 by default)"),vt(Ha,"simpleheat"),Ha.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:vt(function(t){return this._data=t,this},"data"),max:vt(function(t){return this._max=t,this},"max"),add:vt(function(t){return this._data.push(t),this},"add"),clear:vt(function(){return this._data=[],this},"clear"),radius:vt(function(t,e,i){i=void 0===i?15:i;const n=this._ellipse=this._createCanvas(),o=n.getContext("2d"),s=this._r=t+i,a=this._r=e+i;return n.width=2*s,n.height=2*a,o.shadowOffsetX=o.shadowOffsetY=2*s,o.shadowOffsetY=o.shadowOffsetY=2*a,o.shadowBlur=i,o.shadowColor="black",o.beginPath(),o.ellipse(-s,-a,t,e,0,0,2*Math.PI,!0),o.closePath(),o.fill(),this},"radius"),resize:vt(function(){this._width=this._canvas.width,this._height=this._canvas.height},"resize"),gradient:vt(function(t){const e=this._createCanvas(),i=e.getContext("2d"),n=i.createLinearGradient(0,0,0,256);e.width=1,e.height=256;for(const o in t)n.addColorStop(+o,t[o]);return i.fillStyle=n,i.fillRect(0,0,1,256),this._grad=i.getImageData(0,0,1,256).data,this},"gradient"),draw:vt(function(t){this._ellipse||this.radius(this.defaultRadius,this.defaultRadius),this._grad||this.gradient(this.defaultGradient);const e=this._ctx;e.clearRect(0,0,this._width,this._height);for(let n,o=0,s=this._data.length;o<s;o++)n=this._data[o],n[2]<0?n[2]=0:n[2]>this._max&&(n[2]=this._max),e.globalAlpha=Math.max(n[2]/this._max,void 0===t?.05:t),e.drawImage(this._ellipse,n[0]-this._r,n[1]-this._r);const i=e.getImageData(0,0,this._width,this._height);return this._colorize(i.data,this._grad),e.putImageData(i,0,0),this},"draw"),_colorize:vt(function(t,e){for(let i,n=0,o=t.length;n<o;n+=4)i=4*t[n+3],i&&(t[n]=e[i],t[n+1]=e[i+1],t[n+2]=e[i+2])},"_colorize"),_createCanvas:vt(function(){return"undefined"!=typeof document?document.createElement("canvas"):new this._canvas.constructor},"_createCanvas")};var Wa=Math.PI/3,$a=[0,Wa,2*Wa,3*Wa,4*Wa,5*Wa];function qa(t){return t[0]}function Ga(t){return t[1]}function Ua(){var t,e,i,n=0,o=0,s=1,a=1,r=qa,l=Ga;function h(t){var n,o={},s=[],a=t.length;for(n=0;n<a;++n)if(!isNaN(c=+r.call(null,h=t[n],n,t))&&!isNaN(u=+l.call(null,h,n,t))){var h,c,u,p=Math.round(u/=i),d=Math.round(c=c/e-(1&p)/2),f=u-p;if(3*Math.abs(f)>1){var y=c-d,_=d+(c<d?-1:1)/2,x=p+(u<p?-1:1),m=c-_,g=u-x;y*y+f*f>m*m+g*g&&(d=_+(1&p?1:-1)/2,p=x)}var b=d+"-"+p,v=o[b];v?v.push(h):(s.push(v=o[b]=[h]),v.x=(d+(1&p)/2)*e,v.y=p*i)}return s}function c(t){var e=0,i=0;return $a.map(function(n){var o=Math.sin(n)*t,s=-Math.cos(n)*t,a=o-e,r=s-i;return e=o,i=s,[a,r]})}return L(h,"c"),L(c,"u"),vt(h,"hexbin"),vt(c,"hexagon"),h.hexagon=function(e){return"m"+c(null==e?t:+e).join("l")+"z"},h.centers=function(){for(var r=[],l=Math.round(o/i),h=Math.round(n/e),c=l*i;c<a+t;c+=i,++l)for(var u=h*e+(1&l)*e/2;u<s+e/2;u+=e)r.push([u,c]);return r},h.mesh=function(){var e=c(t).slice(0,4).join("l");return h.centers().map(function(t){return"M"+t+"m"+e}).join("")},h.x=function(t){return arguments.length?(r=t,h):r},h.y=function(t){return arguments.length?(l=t,h):l},h.radius=function(n){return arguments.length?(e=2*(t=+n)*Math.sin(Wa),i=1.5*t,h):t},h.size=function(t){return arguments.length?(n=o=0,s=+t[0],a=+t[1],h):[s-n,a-o]},h.extent=function(t){return arguments.length?(n=+t[0][0],o=+t[0][1],s=+t[1][0],a=+t[1][1],h):[[n,o],[s,a]]},h.radius(1)}L(qa,"wa"),L(Ga,"Sa"),L(Ua,"Aa"),vt(qa,"pointX"),vt(Ga,"pointY"),vt(Ua,"d3HexBin");const Xa=(L(C=class extends Ge{_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),ct.call(this),this.tooltipValueFormat_default(",.0f"),_t.call(this),this.tooltipHTML(t=>{const e=a.extent(t,t=>t.label),i=a.extent(t,t=>t.value);return this.tooltipFormat({series:e[0]===e[1]?e[0]:`${e[0]} -> ${e[1]}`,label:i[0]===i[1]?i[0]:`${i[0]} -> ${i[1]}`,value:t.length})}),this._hexbin=Ua().x(t=>t.x).y(t=>t.y),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._hexbin.extent([0,0],[this.width(),this.height()]).radius(this.binSize());const o=this.flattenData().map(e=>({x:n.xPos(t,e),y:n.yPos(t,e),label:t.parseData(e.label),value:t.parseValue(e.value),origRow:e})),s=this._hexbin(o),r=a.min(s,function(t){return t.length}),l=a.max(s,function(t){return t.length});this._dataMinWeight=r,this._dataMaxWeight=l;const h=e.selectAll(".hexagon").data(s,function(t){return t.i+"_"+t.j});h.enter().append("path").attr("class","hexagon").call(t._selection.enter.bind(t._selection)).on("click",function(e){const i=n.data();n.click(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("dblclick",function(e){const i=n.data();n.dblclick(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).merge(h).transition().duration(i).attr("d",this._hexbin.hexagon()).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(1)"}).style("fill",function(t){return n._palette(t.length,r,l)}),h.exit().transition().duration(i).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).remove()}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}},"_HexBin"),C);vt(Xa,"HexBin"),wt(Xa,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let Ya=Xa;Ya.prototype._class+=" chart_HexBin",Ya.prototype.implements(ct.prototype),Ya.prototype.implements(_t.prototype),Ya.prototype.publish("paletteID","Blues","set","Color palette for this widget",Ya.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ya.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ya.prototype.publish("binSize",20,"number","Bin radius",null,{range:{min:1,max:300,step:1}});const Qa=(L(M=class extends Xe{constructor(){super(),this.interpolate_default("linear")}},"_Line"),M);vt(Qa,"Line"),Qa.prototype._class+=" chart_Line";const Za=(L(T=class extends La{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i="left"===this.orientation()?0:this._size.width,n=this._size.height;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle("left"===this.orientation()?0:-Math.PI/2).endAngle("left"===this.orientation()?Math.PI/2:0)}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t})),"Verdana",12).width;return Math.min(this._size.width-t-10,this._size.height-36)-2}},"_QuarterPie"),T);vt(Za,"QuarterPie");let Ja=Za;Ja.prototype._class+=" chart_QuarterPie",Ja.prototype.publish("orientation","left","set","Determines the placement and start/end angle.",["left","right"]);const Ka=(P=class extends a.SVGWidget{_g;_leftLine;_rightLine;_midLine;_midOuterRect;_midInnerRect1;_midInnerRect2;_q0text;_q1text;_q2text;_q3text;_q4text;_q0val;_q1val;_q2val;_q3val;_q4val;constructor(){super()}enter(t,e){super.enter(t,e),this._g=e.append("g"),this._leftLine=this._g.append("rect"),this._rightLine=this._g.append("rect"),this._midLine=this._g.append("rect"),this._midOuterRect=this._g.append("rect"),this._midInnerRect1=this._g.append("rect"),this._midInnerRect2=this._g.append("rect"),this._q0text=this._g.append("text"),this._q1text=this._g.append("text"),this._q2text=this._g.append("text"),this._q3text=this._g.append("text"),this._q4text=this._g.append("text"),this._q0val=this._g.append("text"),this._q1val=this._g.append("text"),this._q2val=this._g.append("text"),this._q3val=this._g.append("text"),this._q4val=this._g.append("text")}update(t,e){super.update(t,e);const i=("horizontal"===this.orientation()?this.width():this.height())-this.lineWidth(),n="horizontal"===this.orientation()?this.height():this.width(),o=a.scaleLinear().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),i-this.edgePadding()]),s=this.candleWidth_exists()?this.candleWidth():n,r=this.lineWidth(),l=this.lineColor(),h=this.roundedCorners(),c=this.edgePadding();let u=o(this.data()[1]),p=o(this.data()[2]),d=o(this.data()[3]);const f=-s/2,y=s/2,_=this.upperTextRotation(),x=this.lowerTextRotation(),m=this.textPadding(),g=this.labelFontSize(),b=this.valueFontSize(),v=Math.max(g,b),w=i-c;if(v>0){for(;u-c<v;)u+=v;for(;p-u<v;)p+=v;for(;d-p<v;)d+=v;for(;w-d<v;)d-=v;for(;d-p<v;)p-=v;for(;p-u<v;)u-=v}let S=-i/2-this.lineWidth()/2,k=0,A=0,C=1,M="start",T="end";"vertical"===this.orientation()&&(S=0,k=i/2+this.lineWidth()/2,A=-90,M="end",T="start",C=-1),this._g.style("shape-rendering","crispEdges").attr("transform",`translate(${S},${k})rotate(${A})scale(1)`),this._leftLine.attr("fill",l).attr("height",s).attr("width",r).attr("x",c).attr("y",f).attr("rx",h).attr("ry",h),this._rightLine.attr("class","right-line").attr("fill",l).attr("height",s).attr("width",r).attr("x",w).attr("y",f).attr("rx",h).attr("ry",h),this._midLine.attr("fill",l).attr("height",r).attr("width",w-c).attr("x",c).attr("y",-r/2),this._midOuterRect.attr("fill",l).attr("height",s).attr("width",d-u).attr("x",u).attr("y",f).attr("rx",h).attr("ry",h),this._midInnerRect1.attr("fill",this.innerRectColor()).attr("height",s-2*r).attr("width",p-(u+2*r)).attr("x",u+r).attr("y",r-s/2).attr("rx",.618*h).attr("ry",.618*h),this._midInnerRect2.attr("fill",this.innerRectColor()).attr("height",s-2*r).attr("width",d-p-r).attr("x",p).attr("y",r-s/2).attr("rx",.618*h).attr("ry",.618*h),this._q0text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","hanging").text(this.columns()[0]),this._q1text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.columns()[1]),this._q2text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.columns()[2]),this._q3text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${d}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.columns()[3]),this._q4text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+r}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","baseline").text(this.columns()[4]),this._q0val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","hanging").text(this.data()[0]),this._q1val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[1]),this._q2val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[2]),this._q3val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${d}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[3]),this._q4val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+r}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","baseline").text(this.data()[4])}},L(P,"_QuartileCandlestick"),P);vt(Ka,"QuartileCandlestick");let tr=Ka;tr.prototype._class+=" chart_QuartileCandlestick",tr.prototype.publish("textColor","black","html-color","Color of label and value text"),tr.prototype.publish("showLabels",!0,"boolean","If true, labels will be shown"),tr.prototype.publish("showValues",!0,"boolean","If true, values will be shown"),tr.prototype.publish("orientation","horizontal","set","Determines layout",["horizontal","vertical"]),tr.prototype.publish("valueFontSize",12,"number","Font size of value text (pixels)"),tr.prototype.publish("labelFontSize",12,"number","Font size of label text (pixels)"),tr.prototype.publish("roundedCorners",8,"number","Radius of rounded rect corners (pixels)"),tr.prototype.publish("lineWidth",4,"number","Width of lines (pixels)"),tr.prototype.publish("candleWidth",null,"number","Height of outer rect (pixels)",null,{optional:!0}),tr.prototype.publish("textPadding",8,"number","Padding between outer rect and text (pixels)"),tr.prototype.publish("edgePadding",30,"number","Padding between outer rect and left/right sides (pixels)"),tr.prototype.publish("lineColor","#333","html-color","Color of outer rect and lines"),tr.prototype.publish("innerRectColor","white","html-color","Color of the inner rects"),tr.prototype.publish("upperTextRotation",-60,"number","Rotation of label text (degrees)"),tr.prototype.publish("lowerTextRotation",-60,"number","Rotation of value text (degrees)");const er=(I=class extends a.SVGWidget{constructor(){super(),ft.call(this),_t.call(this),a.Utility.SimpleSelectionMixin.call(this)}mapShape(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}setPointAttributes(t,e,i){const n=this;switch(this.mapShape(this.pointShape())){case"rect":t.attr("width",n.pointSize()).attr("height",n.pointSize()).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"circle":t.attr("r",n.pointSize()/2).attr("cx",e).attr("cy",i).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"path":const o=n.pointSize()/2;t.attr("d",function(t){return"M"+(e-o)+" "+(i-o)+" L"+(e+o)+" "+(i+o)+" M"+(e-o)+" "+(i+o)+" L"+(e+o)+" "+(i-o)}).style("stroke",t=>this.strokeColor(t.data,t.column,t.value))}}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t.label,series:t.column,value:t.value}))}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID());const i=this,n=this.height()/2,o=this.width()/2,s=this.columns(),r=this.data(),l=this.flattenData(s,r).map((t,e)=>(t.shape=this.mapShape(this.pointShape()),t.column=s[t.colIdx],t.row=r[e],t)),h=[],c=this.degrees2radians(360/this.data().length),u=this.fontSize();let p=0;l.filter(t=>1===t.colIdx).forEach(t=>{const e=super.textSize(t.label,`${this.fontFamily()}`,this.fontSize());p<e.width&&(p=e.width)});const d=Math.min(n-u,o-p),f=e.selectAll(".label").data(l.filter(t=>1===t.colIdx)),y=Math.max.apply(i,l.map(t=>t.value));f.enter().append("text").attr("class","label").attr("text-anchor","middle").merge(f).attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).each(function(t,e){const n=i.polar2cartesian(d,e*c-Math.PI/2);h.push(n.map(t=>t*i.labelPaddingRatio()));let o="middle";const s=Math.round(n[0]);o=s>0?"start":o,o=s<0?"end":o,a.select(this).attr("text-anchor",o).attr("x",n[0]).attr("y",n[1])}).text(t=>t.label),f.exit().remove();const _=e.selectAll(".domain").data(l.filter(t=>1===t.colIdx));_.enter().append("line").classed("domain",!0).style("stroke","#000").style("stroke-opacity","0.75").style("stroke-width","1px").merge(_).attr("x1",0).attr("y1",0).attr("x2",(t,e)=>h[e][0]).attr("y2",(t,e)=>h[e][1]),_.exit().remove();const x=e.selectAll(".value_guide").data(this.valueGuideRatios());x.enter().append("polygon").classed("value_guide",!0).style("stroke","grey").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(x).each(function(t,e){const i=[];h.forEach((e,n)=>{i.push([e[0]*t,e[1]*t])}),a.select(this).attr("points",i.join(" ")).attr("stroke","rgb(0, 0, 0)").attr("stroke-opacity",.75).attr("stroke-width",.3).attr("fill-opacity",0)}),x.exit().remove();const m=e.selectAll(".value_guide_text").data(this.valueGuideRatios());m.enter().append("text").attr("class","value_guide_text").attr("text-anchor","start").attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).merge(m).attr("x",2).attr("y",t=>h[0][1]*t).text((t,e)=>Math.round(t*y)),x.exit().remove();const g=e.selectAll(".area").data(s.filter((t,e)=>e>0));g.enter().append("polygon").attr("class","area").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(g).style("stroke",t=>this.strokeColor([],t,0)).style("fill",t=>this.fillColor([],t,0)).style("fill-opacity",this.fillOpacity()).attr("points",(t,e)=>h.map((t,i)=>{const n=r[i][e+1],o=0===n?0:n/y;return t[0]*o+","+t[1]*o}).join(" ")),g.exit().remove();const b=e.selectAll(".point").data(l);b.enter().append("g").attr("class","point").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).on("click",function(t,e){const n=i.data()[t.rowIdx],o=i.rowToObj(n),s=i._selection.selected(this);i.click(o,i.columns()[t.colIdx],s)}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(i.data()[t.rowIdx]),t.column,i._selection.selected(this))}).each(function(t){const e=a.select(this);e.append("circle").attr("class","pointSelection").attr("r",i.pointSize()).call(i._selection.enter.bind(i._selection)),e.append(i.mapShape(i.pointShape())).attr("class","pointShape")}).merge(b).each(function(t){const e=a.select(this),n=0===t.value?0:t.value/y,o=h[t.rowIdx][0]*n,s=h[t.rowIdx][1]*n;e.select(".pointSelection").attr("cx",o).attr("cy",s);const r=e.select(".pointShape").style("stroke",i.strokeColor(t.row,t.column,t.value)).style("fill",i.fillColor(t.row,t.column,t.value));i.setPointAttributes(r,o,s)}),b.exit().remove()}polar2cartesian(t,e){return[t*Math.cos(e),t*Math.sin(e)]}cartesian2polar(t,e){return[Math.atan2(e,t),Math.sqrt(t*t+e*e)]}degrees2radians(t){return t/57.295779513}radians2degrees(t){return 57.295779513*t}point_in_polygon(t,e){const i=t[0],n=t[1];let o=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const t=e[s][0],r=e[s][1],l=e[a][0],h=e[a][1];r>n!=h>n&&i<(l-t)*(n-r)/(h-r)+t&&(o=!o)}return o}},L(I,"_Radar"),I);vt(er,"Radar");let ir=er;ir.prototype._class+=" chart_Radar",ir.prototype.implements(ft.prototype),ir.prototype.implements(_t.prototype),ir.prototype.mixin(a.Utility.SimpleSelectionMixin),ir.prototype.publish("paletteID","default","set","Color palette for this widget",ir.prototype._palette.switch()),ir.prototype.publish("pointShape","cross","set","pointShape",["circle","rectangle","cross"]),ir.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),ir.prototype.publish("valueGuideRatios",[.2,.4,.6,.8,1],"array","Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines"),ir.prototype.publish("fillOpacity",.66,"number","Opacity of the data polygon(s)"),ir.prototype.publish("fontFamily","","string","fontFamily"),ir.prototype.publish("fontSize",16,"number","fontSize"),ir.prototype.publish("labelPaddingRatio",.9,"number","labelPaddingRatio");const nr=(E=class extends a.SVGWidget{_domainScale=a.scaleBand();_valueScale=a.scaleLinear();_d3Arc=Qt().startAngle(0).endAngle(t=>this._valueScale(t[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),ft.call(this),_t.call(this),a.Utility.SimpleSelectionMixin.call(this)}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t[0],value:t[1]})),this._radialAxis=e.append("g").attr("class","r axis"),this._axialAxis=e.append("g").attr("class","a axis"),this._arcs=e.append("g").attr("class","data")}update(t,e){super.update(t,e);const i=this,n=Math.max(this.valueDomainHigh_exists()?this.valueDomainHigh():0,...this.data().map(t=>t[1]));this._valueScale.domain([0,n]).range([0,this.radians(this.valueMaxAngle())]);const o=this._valueScale.ticks(this.tickCount()),s=this.textSize(o.map(t=>""+t),"Verdana",12).width,r=Math.min(this.width()-2*(10+s),this.height()-44)/2,l=this.data().map(t=>t[0]);this._domainScale.domain(l).range([0,r]).padding(this.domainPadding());const h=this._domainScale.step()*this._domainScale.padding(),c=this._radialAxis.selectAll("circle").data(l);c.enter().append("circle").attr("fill","transparent").merge(c).attr("r",t=>this._domainScale(t)+this._domainScale.step()-h/2),c.exit().remove();const u=this._radialAxis.selectAll(".arc-text").data(l);u.enter().append("text").attr("class","arc-text").attr("x",-4).attr("alignment-baseline","middle").attr("text-anchor","end").merge(u).attr("y",t=>-this._domainScale(t)-this._domainScale.bandwidth()/2).text(t=>t),u.exit().remove();const p=this._axialAxis.selectAll("line").data(o);p.enter().append("line").merge(p).attr("x2",t=>r*Math.cos(this._valueScale(t)-this.radians(90))).attr("y2",t=>r*Math.sin(this._valueScale(t)-this.radians(90))),p.exit().remove();const d=this._axialAxis.selectAll("text").data(o);d.enter().append("text").style("dominant-baseline","central").merge(d).attr("x",t=>(r+10)*Math.cos(this._valueScale(t)-this.radians(90))).attr("y",t=>(r+10)*Math.sin(this._valueScale(t)-this.radians(90))).style("text-anchor",t=>{const e=this.degrees(this._valueScale(t));return e>=0&&e<=20||e>=160&&e<=200||e>=340&&e<=360?"middle":e>=180&&e<=360?"end":null}).text(t=>t),d.exit().remove();const f=this.columns().length>1?this.columns()[1]:"";this._d3Arc.innerRadius(t=>this._domainScale(t[0])).outerRadius(t=>this._domainScale(t[0])+this._domainScale.bandwidth());const y=this._arcs.selectAll("path").data(this.data(),t=>t[0]);y.enter().append("path").attr("class","arc").call(this._selection.enter.bind(this._selection)).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("click",function(t,e){i.click(i.rowToObj(t),f,i._selection.selected(this))}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(t),f,i._selection.selected(this))}).merge(y).style("fill",(t,e)=>this.fillColor(t,t[0],t[1])).transition().delay((t,e)=>e*this.transitionDelay()).duration(this.transitionDuration()).attrTween("d",(t,e)=>{const i=a.interpolate(t._current||0,t[1]);return t._current=t[1],n=>this._d3Arc([t[0],i(n)],e)}),y.exit().remove()}degrees(t){return 180*t/Math.PI}radians(t){return t*Math.PI/180}},L(E,"_RadialBar"),E);vt(nr,"RadialBar"),wt(nr,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number"}]);let or=nr;or.prototype._class+=" chart_RadialBar",or.prototype.implements(ft.prototype),or.prototype.implements(_t.prototype),or.prototype.mixin(a.Utility.SimpleSelectionMixin),or.prototype.publish("paletteID","default","set","Color palette for this widget",or.prototype._palette.switch()),or.prototype.publish("tickCount",10,"number","Number of ticks to display"),or.prototype.publish("domainPadding",.25,"number","Padding between chart edge and container edge (0..1)"),or.prototype.publish("valueMaxAngle",270,"number","Maximum angular length of a bar (degrees)"),or.prototype.publish("valueDomainHigh",null,"number","Value domain high",void 0,{optional:!0}),or.prototype.publish("transitionDelay",100,"number","Delay between the start of each row animation (ms)"),or.prototype.publish("transitionDuration",750,"number","Duration of a row's animation (ms)");const sr=a.Palette.rainbow("Blues"),ar=a.Palette.ordinal("Quartile",[sr(100,0,100),sr(50,0,100),sr(50,0,100),sr(75,0,100)]);function rr(t){const e=a.format(t);return function(t){const i=(Math.round(100*t)/100).toString();return i.length<=4?i:e(t)}}L(rr,"La"),ar("Std. Dev."),ar("MinMax"),ar("25%"),ar("50%"),vt(rr,"myFormatter");const lr=(F=class extends a.HTMLWidget{_selectElement;_tickFormatter;_bellCurve=(new Xe).columns(["","Std. Dev."]).paletteID("Quartile").interpolate_default("basis").pointSize(0).xAxisType("linear").xAxisOverlapMode("none").xAxisTickFormat(",").yAxisHidden(!0).yAxisDomainLow(0).yAxisDomainHigh(110).yAxisGuideLines(!1);_candle=(new tr).columns(["Min","25%","50%","75%","Max"]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(sr(90,0,100)).innerRectColor(sr(10,0,100));constructor(){super(),this.columns(["Min","25%","50%","75%","Max","Mean","Std. Dev."])}stdDev(t){return this.mean()+t*this.standardDeviation()}formatStdDev(t){return this._tickFormatter(this.stdDev(t))}quartile(t){return this.quartiles()[t]}formatQ(t){return this._tickFormatter(this.quartile(t))}domain(t){switch(t){case"25_75":return[this.quartile(1),this.quartile(3)];case"normal":return[this.stdDev(-4),this.stdDev(4)];default:return[this.quartile(0),this.quartile(4)]}}min(){return this.quartile(0)}max(){return this.quartile(4)}data(t){if(!arguments.length)return[[...this.quartiles(),this.mean(),this.standardDeviation()]];const e=t[0];return this.quartiles([e[0],e[1],e[2],e[3],e[4]]),this.mean(e[5]),this.standardDeviation(e[6]),this}enter(t,e){super.enter(t,e),this._bellCurve.target(e.append("div").node()),this._candle.target(e.append("div").node()),this._selectElement=e.append("div").style("position","absolute").style("top","0px").style("right","0px").append("select").on("change",()=>{this.view(this._selectElement.node().value),this.lazyRender()}),this._selectElement.append("option").attr("value","min_max").text("Min / Max"),this._selectElement.append("option").attr("value","25_75").text("25% / 75%"),this._selectElement.append("option").attr("value","normal").text("Normal")}bellTicks(t){let e;switch(t){case"25_75":e=[{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)}];break;case"normal":e=[{label:this.formatStdDev(-4),value:this.stdDev(-4)},{label:"-3σ",value:this.stdDev(-3)},{label:"-2σ",value:this.stdDev(-2)},{label:"-1σ",value:this.stdDev(-1)},{label:this.formatStdDev(0),value:this.stdDev(0)},{label:"+1σ",value:this.stdDev(1)},{label:"+2σ",value:this.stdDev(2)},{label:"+3σ",value:this.stdDev(3)},{label:this.formatStdDev(4),value:this.stdDev(4)}];break;default:e=[{label:this.formatQ(0),value:this.quartile(0)},{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)},{label:this.formatQ(4),value:this.quartile(4)}]}const[i,n]=this.domain(this._selectElement.node().value);return e.filter(t=>t.value>=i&&t.value<=n).map(t=>({label:t.label,value:t.value.toString()}))}updateScatter(){const t=this._selectElement.node().value,[e,i]=this.domain(t),n=(i-e)*(this.domainPadding()/100);this._bellCurve.xAxisDomainLow(e-n).xAxisDomainHigh(i+n).xAxisTicks(this.bellTicks(t)).data([[this.stdDev(-4),0],[this.stdDev(-3),.3],[this.stdDev(-2),5],[this.stdDev(-1),68],[this.stdDev(0),100],[this.stdDev(1),68],[this.stdDev(2),5],[this.stdDev(3),.3],[this.stdDev(4),0]]).resize({width:this.width(),height:this.height()-this.candleHeight()}).render()}updateCandle(){const t=this._bellCurve.dataPos(this.quartile(0)),e=this._bellCurve.dataPos(this.quartile(4))-t;this._candle.resize({width:this.width(),height:this.candleHeight()}).pos({x:t+e/2+2,y:this.candleHeight()/2}).width(e).candleWidth(this.candleHeight()).data(this.quartiles()).render()}update(t,e){super.update(t,e),this._tickFormatter=rr(this.tickFormat()),this._selectElement.node().value=this.view(),this.updateScatter(),this.updateCandle()}exit(t,e){this._bellCurve.target(null),this._candle.target(null),this._selectElement.remove(),super.exit(t,e)}},L(F,"_StatChart"),F);vt(lr,"StatChart");let hr=lr;hr.prototype._class+=" chart_StatChart",hr.prototype.publish("view","min_max","set","View",["min_max","25_75","normal"]),hr.prototype.publish("tickFormat",".2e","string","X-Axis Tick Format"),hr.prototype.publish("candleHeight",20,"number","Height of candle widget (pixels)"),hr.prototype.publish("domainPadding",10,"number","Domain value padding"),hr.prototype.publish("mean",.5,"number","Mean"),hr.prototype.publish("standardDeviation",.125,"number","Standard Deviation (σ)"),hr.prototype.publish("quartiles",[0,.25,.5,.75,1],"object","Quartiles (Min, 25%, 50%, 75%, Max)");const cr=(L(D=class extends Xe{constructor(){super(),this.interpolate_default("step")}},"_Step"),D);vt(cr,"Step"),cr.prototype._class+=" chart_Step";const ur="text",pr="html",dr=(z=class extends a.HTMLWidget{_playIntervalIdx=0;_mainDiv;_headerDiv;_textDiv;constructor(){super(),this._tag="div",this._drawStartPos="center",this.playInterval(this.playInterval())}lookupFieldIdx(t,e){let i=e;if(!(this[t+"_exists"]()&&(i=this.columns().indexOf(this[t]()),i<0)))return i}lookupFieldText(t,e){return this[t+"_exists"]()?this[t]():void 0!==e&&this.columns()[e]||""}currentRow(){return this.data()[this._playIntervalIdx]}summaryData(){let t;this.hideLabel()||(t=this.lookupFieldIdx("labelColumn",0));const e=this.lookupFieldIdx("iconColumn"),i=this.lookupFieldIdx("valueColumn",1);let n,o;this.hideMore()||(n=this.lookupFieldIdx("moreIconColumn"),o=this.lookupFieldIdx("moreTextColumn"));const s=this.lookupFieldIdx("colorFillColumn"),a=this.lookupFieldIdx("colorStrokeColumn");return this.formattedData().map(function(r){return{icon:void 0===e?this.icon():r[e],label:void 0===t?"":r[t],value:r[i],moreIcon:void 0===n?this.hideMore()?"":this.moreIcon():r[n],moreText:void 0===o?this.hideMore()?"":this.moreText():r[o],fill:void 0===s?this.colorFill():r[s],stroke:void 0===a?this.colorStroke():r[a]}},this)}enter(t,e){super.enter(t,e),this._mainDiv=e.append("div");const i=this;this._headerDiv=this._mainDiv.append("h2").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}),this._textDiv=this._mainDiv.append("div").attr("class","text").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)})}update(t,e){super.update(t,e),this.data().length;const i=this.summaryData();this._playIntervalIdx>=i.length&&(this._playIntervalIdx=0);const n=this._playIntervalIdx<i.length?i[this._playIntervalIdx]:["",""];e.style("width",this.fixedSize()?this.minWidth_exists()?this.minWidth()+"px":null:"100%").style("height",this.fixedSize()?this.minHeight_exists()?this.minHeight()+"px":null:"100%"),this._mainDiv.attr("class","content bgIcon "+n.icon).transition().style("background-color",n.fill).style("color",n.stroke).style("min-width",this.minWidth_exists()?this.minWidth()+"px":null).style("min-height",this.minHeight_exists()?this.minHeight()+"px":null).style("font-size",this.iconFontSize()+"px"),this._headerDiv.transition().style("color",n.stroke).style("font-size",this.headerFontSize()+"px")[this.valueHTML()?pr:ur](n.value),this._textDiv.style("font-size",this.textFontSize()+"px")[this.labelHTML()?pr:ur](n.label);const o=this,s=this._mainDiv.selectAll(".more").data([n]),r=s.enter().append("div").attr("class","more").on("click",function(t){o.click(o.rowToObj(o.currentRow()),o.lookupFieldText("moreTextColumn")||"more",!0)}).each(function(){const t=a.select(this);t.append("i"),t.append("span")}).merge(s).style("display",this.hideMoreWrapper()?"none":null).style("font-size",this.moreFontSize()+"px").style("height",this.moreWrapperHeight_exists()?this.moreWrapperHeight()+"px":null).transition().style("background-color",a.rgb(n.fill).darker(.75).toString());r.select("i").attr("class",function(t){return"fa "+t.moreIcon}),this.moreTextHTML()?r.select("span").each(function(t){this.innerHTML=t.moreText}):r.select("span").text(t=>t.moreText),s.exit().remove()}exit(t,e){super.exit(t,e)}},L(z,"_Summary"),z);vt(dr,"Summary");let fr=dr;fr.prototype._class+=" chart_Summary",fr.prototype.implements(ht.prototype),fr.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),fr.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:vt(t=>t.iconColumn(),"disable")}),fr.prototype.publish("headerFontSize",null,"number","headerFontSize"),fr.prototype.publish("textFontSize",null,"number","textFontSize"),fr.prototype.publish("moreFontSize",null,"number","moreFontSize"),fr.prototype.publish("iconFontSize",null,"number","iconFontSize"),fr.prototype.publish("hideLabel",!1,"boolean","Hide label column"),fr.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:vt(t=>t.hideLabel(),"disable")}),fr.prototype.publish("labelHTML",!1,"boolean","Allow HTML",null,{disable:vt(t=>t.hideLabel(),"disable")}),fr.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),fr.prototype.publish("valueHTML",!1,"boolean","Allow HTML"),fr.prototype.publish("hideMore",!1,"boolean","Hide More Information"),fr.prototype.publish("hideMoreWrapper",!1,"boolean","Hide More Information Wrapper"),fr.prototype.publish("moreWrapperHeight",null,"number","Height of the 'more' text wrapper (pixels)"),fr.prototype.publish("moreIconColumn",null,"set","Select More Icon Column",function(){return this.columns()},{optional:!0,disable:vt(t=>t.hideMore(),"disable")}),fr.prototype.publish("moreIcon","fa-info-circle","string","FA Char icon class",null,{disable:vt(t=>t.hideMore()||t.moreIconColumn(),"disable")}),fr.prototype.publish("moreTextColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:vt(t=>t.hideMore(),"disable")}),fr.prototype.publish("moreText","More Info","string","More text",null,{disable:vt(t=>t.hideMore()||t.moreTextColumn(),"disable")}),fr.prototype.publish("moreTextHTML",!1,"boolean","Allow HTML",null,{disable:vt(t=>t.hideMore(),"disable")}),fr.prototype.publish("colorFillColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),fr.prototype.publish("colorFill","#3498db","html-color","Fill Color",null,{disable:vt(t=>t.colorFillColumn(),"disable")}),fr.prototype.publish("colorStrokeColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),fr.prototype.publish("colorStroke","#ffffff","html-color","Fill Color",null,{disable:vt(t=>t.colorStrokeColumn(),"disable")}),fr.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),fr.prototype.publish("minWidth",225,"number","Minimum Width"),fr.prototype.publish("minHeight",150,"number","Minimum Height"),fr.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0});const yr=fr.prototype.playInterval;fr.prototype.playInterval=function(t){const e=yr.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const _r=(R=class extends a.CanvasWidget{_playIntervalIdx=0;constructor(){super(),ht.call(this),this.playInterval(this.playInterval())}currentRow(){return this.data()[this._playIntervalIdx]}enter(t,e){super.enter.apply(this,arguments);const{width:i,height:n}=this.size();t.height=n,t.width=i}update(t,e){super.update.apply(this,arguments);const i=this;this._playIntervalIdx>=this.data().length&&(this._playIntervalIdx=0);const n=this.size(),o=Math.min(n.width,n.height),s=this.fontSizeRatio(),r=this.columns().indexOf(this.labelColumn()),l=this.columns().indexOf(this.valueColumn()),h=this.columns().indexOf(this.colorFillColumn()),c=this.columns().indexOf(this.colorStrokeColumn()),u=this.columns().indexOf(this.iconColumn()),p=-1!==u?this.currentRow()[u]:this.icon(),d=-1!==r?this.currentRow()[r]:"",f=-1!==l?this.currentRow()[l]:"",y=-1!==h?this.currentRow()[h]:this.colorFill(),_=-1!==c?this.currentRow()[c]:this.colorStroke();let x=n.height*(s-this.paddingSizeRatio());const m=n.height*(1-s-this.paddingSizeRatio()),g=n.height*(this.iconSizeRatio()-this.paddingSizeRatio()),b=o*this.paddingSizeRatio(),v=t.getContext("2d");v.clearRect(0,0,n.width,n.height);const w=i.fontFamily();function S(t,e,i,o){v.textBaseline="top",v.font=`${i}px ${w}`,v.fillStyle=_;let s=v.measureText(t);s.width>n.width-2*b&&(i*=(n.width-2*b)/s.width,v.font=`${i}px ${w}`,s=v.measureText(t));const a=A(s.width,o);return v.fillText(t,a,e),i}function k(t,e,o){if(void 0===t)return;v.textBaseline=i.iconBaseline(),v.font=`${e}px FontAwesome`,v.fillStyle=_;let s=v.measureText(t);if(s.width>n.width-2*b){const i=(n.width-2*b)/s.width;v.font=e*i+"px FontAwesome",s=v.measureText(t)}const a=A(s.width,o),r=C(i.iconBaseline());v.fillText(t,a,r)}function A(t,e){switch(e){case"start":return b;case"middle":return n.width/2-t/2;case"end":return n.width-t-b}}function C(t){switch(t){case"top":return b;case"middle":return n.height/2;case"bottom":return n.height-b}}L(S,"A"),L(k,"k"),L(A,"M"),L(C,"P"),v.fillStyle=y,v.fillRect(0,0,n.width,n.height),v.globalAlpha=this.iconOpacity(),k(a.Utility.faChar(p),g,i.iconAnchor()),v.globalAlpha=this.valueOpacity(),x=S(f,b,x,i.valueAnchor()),v.globalAlpha=this.labelOpacity(),S(d,x+b,m,i.labelAnchor()),vt(S,"drawText"),vt(k,"drawIcon"),vt(A,"getTextOffsetX"),vt(C,"getTextOffsetY")}},L(R,"_SummaryC"),R);vt(_r,"SummaryC");let xr=_r;xr.prototype._class+=" chart_SummaryC",xr.prototype.implements(ht.prototype),xr.prototype.publish("iconBaseline","bottom","string","Text baseline for the icon",["top","middle","bottom"]),xr.prototype.publish("iconAnchor","end","set","Anchors the icon either at the start, middle, or end of the summary",["start","middle","end"]),xr.prototype.publish("valueAnchor","start","set","Anchors the value either at the start, middle, or end of the summary",["start","middle","end"]),xr.prototype.publish("labelAnchor","start","set","Anchors the label either at the start, middle, or end of the summary",["start","middle","end"]),xr.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),xr.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:vt(t=>t.iconColumn(),"disable")}),xr.prototype.publish("fontFamily","Arial","string","Font Family"),xr.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),xr.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),xr.prototype.publish("colorFillColumn",null,"set","Column for background color",function(){return this.columns()},{optional:!0}),xr.prototype.publish("colorFill","#0097e6","html-color","Background Color",null,{disable:vt(t=>t.colorFillColumn(),"disable")}),xr.prototype.publish("colorStrokeColumn",null,"set","Column for font color",function(){return this.columns()},{optional:!0}),xr.prototype.publish("colorStroke","#2f3640","html-color","Font Color",null,{disable:vt(t=>t.colorStrokeColumn(),"disable")}),xr.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),xr.prototype.publish("minWidth",225,"number","Minimum Width"),xr.prototype.publish("minHeight",150,"number","Minimum Height"),xr.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0}),xr.prototype.publish("fontSizeRatio",.618,"number","Ratio between widget height and value font size"),xr.prototype.publish("valueOpacity",1,"number","Opacity of value text (0..1)"),xr.prototype.publish("labelOpacity",.9,"number","Opacity of label text (0..1)"),xr.prototype.publish("iconOpacity",.3,"number","Opacity of icon text (0..1)"),xr.prototype.publish("paddingSizeRatio",.1,"number","Ratio of the smallest dimension for edge padding (0..1)"),xr.prototype.publish("iconSizeRatio",.9,"number","Ratio of the height for icon size (0..1)");const mr=xr.prototype.playInterval;xr.prototype.playInterval=function(t){const e=mr.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const gr=Math.PI/180,br=2048;function vr(){const t=a.dispatch("word","end"),e={};let i=[256,256],n=wr,o=Sr,s=Ar,r=kr,l=kr,h=Cr,c=Mr,u=[],p=Fr,d=1/0,f=null,y=Math.random,_=Rr;function x(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=br/e;const i=t.getContext("2d");return i.fillStyle=i.strokeStyle="red",i.textAlign="center",{context:i,ratio:e}}function m(t,e,n){const o=e.x,s=e.y,a=Math.sqrt(i[0]*i[0]+i[1]*i[1]),r=p(i),l=y()<.5?1:-1;let h,c,u,d=-l;for(;(h=r(d+=l))&&(c=~~h[0],u=~~h[1],!(Math.min(Math.abs(c),Math.abs(u))>=a));)if(e.x=o+c,e.y=s+u,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>i[0]||e.y+e.y1>i[1])&&(!n||!Pr(e,t,i[0]))&&(!n||Er(e,n))){const n=e.sprite,o=e.width>>5,s=i[0]>>5,a=e.x-(o<<4),r=127&a,l=32-r,h=e.y1-e.y0;let c,u=(e.y+e.y0)*s+(a>>5);for(let e=0;e<h;e++){c=0;for(let i=0;i<=o;i++)t[u+i]|=c<<l|(i<o?(c=n[e*o+i])>>>r:0);u+=s}return delete e.sprite,!0}return!1}return L(x,"x"),L(m,"m"),e.canvas=function(t){return arguments.length?(_=Or(t),e):_},e.start=function(){const a=x(_()),p=zr((i[0]>>5)*i[1]);let g=null;const b=u.length;let v=-1;const w=[],S=u.map(function(t,e){return t.text=n.call(this,t,e),t.font=o.call(this,t,e),t.style=r.call(this,t,e),t.weight=l.call(this,t,e),t.rotate=h.call(this,t,e),t.size=~~s.call(this,t,e),t.padding=c.call(this,t,e),t}).sort(function(t,e){return e.size-t.size});return f&&clearInterval(f),f=setInterval(k,0),k(),e;function k(){const n=Date.now();for(;Date.now()-n<d&&++v<b&&f;){const n=S[v];n.x=i[0]*(y()+.5)>>1,n.y=i[1]*(y()+.5)>>1,Tr(a,n,S,v),n.hasText&&m(p,n,g)&&(w.push(n),t.call("word",e,n),g?Ir(g,n):g=[{x:n.x+n.x0,y:n.y+n.y0},{x:n.x+n.x1,y:n.y+n.y1}],n.x-=i[0]>>1,n.y-=i[1]>>1)}v>=b&&(e.stop(),t.call("end",e,w,g))}},e.stop=function(){return f&&(clearInterval(f),f=null),e},vt(x,"getContext"),vt(m,"place"),e.timeInterval=function(t){return arguments.length?(d=null==t?1/0:t,e):d},e.words=function(t){return arguments.length?(u=t,e):u},e.size=function(t){return arguments.length?(i=[+t[0],+t[1]],e):i},e.font=function(t){return arguments.length?(o=Or(t),e):o},e.fontStyle=function(t){return arguments.length?(r=Or(t),e):r},e.fontWeight=function(t){return arguments.length?(l=Or(t),e):l},e.rotate=function(t){return arguments.length?(h=Or(t),e):h},e.text=function(t){return arguments.length?(n=Or(t),e):n},e.spiral=function(t){return arguments.length?(p=jr[t]||t,e):p},e.fontSize=function(t){return arguments.length?(s=Or(t),e):s},e.padding=function(t){return arguments.length?(c=Or(t),e):c},e.random=function(t){return arguments.length?(y=t,e):y},e.on=function(){const i=t.on.apply(t,arguments);return i===t?e:i},e}function wr(t){return t.text}function Sr(){return"serif"}function kr(){return"normal"}function Ar(t){return Math.sqrt(t.value)}function Cr(){return 30*(~~(6*Math.random())-3)}function Mr(){return 1}function Tr(t,e,i,n){if(e.sprite)return;const o=t.context,s=t.ratio;o.clearRect(0,0,2048/s,br/s);let a=0,r=0,l=0;const h=i.length;for(--n;++n<h;){e=i[n],o.save(),o.font=e.style+" "+e.weight+" "+~~((e.size+1)/s)+"px "+e.font;let t=o.measureText(e.text+"m").width*s,h=e.size<<1;if(e.rotate){const i=Math.sin(e.rotate*gr),n=Math.cos(e.rotate*gr),o=t*n,s=t*i,a=h*n,r=h*i;t=Math.max(Math.abs(o+r),Math.abs(o-r))+31>>5<<5,h=~~Math.max(Math.abs(s+a),Math.abs(s-a))}else t=t+31>>5<<5;if(h>l&&(l=h),a+t>=2048&&(a=0,r+=l,l=0),r+h>=br)break;o.translate((a+(t>>1))/s,(r+(h>>1))/s),e.rotate&&o.rotate(e.rotate*gr),o.fillText(e.text,0,0),e.padding&&(o.lineWidth=2*e.padding,o.strokeText(e.text,0,0)),o.restore(),e.width=t,e.height=h,e.xoff=a,e.yoff=r,e.x1=t>>1,e.y1=h>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,a+=t}const c=o.getImageData(0,0,2048/s,br/s).data,u=[];for(;--n>=0;){if(!(e=i[n]).hasText)continue;const t=e.width,o=t>>5;let s=e.y1-e.y0;for(let e=0;e<s*o;e++)u[e]=0;if(a=e.xoff,null==a)return;r=e.yoff;let l=0,h=-1;for(let i=0;i<s;i++){for(let e=0;e<t;e++){const t=o*i+(e>>5),n=c[2048*(r+i)+(a+e)<<2]?1<<31-e%32:0;u[t]|=n,l|=n}l?h=i:(e.y0++,s--,i--,r++)}e.y1=e.y0+h,e.sprite=u.slice(0,(e.y1-e.y0)*o)}}function Pr(t,e,i){i>>=5;const n=t.sprite,o=t.width>>5,s=t.x-(o<<4),a=127&s,r=32-a,l=t.y1-t.y0;let h,c=(t.y+t.y0)*i+(s>>5);for(let u=0;u<l;u++){h=0;for(let t=0;t<=o;t++)if((h<<r|(t<o?(h=n[u*o+t])>>>a:0))&e[c+t])return!0;c+=i}return!1}function Ir(t,e){const i=t[0],n=t[1];e.x+e.x0<i.x&&(i.x=e.x+e.x0),e.y+e.y0<i.y&&(i.y=e.y+e.y0),e.x+e.x1>n.x&&(n.x=e.x+e.x1),e.y+e.y1>n.y&&(n.y=e.y+e.y1)}function Er(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function Fr(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function Dr(t){const e=4*t[0]/t[1];let i=0,n=0;return function(t){const o=t<0?-1:1;switch(Math.sqrt(1+4*o*t)-o&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}function zr(t){const e=[];let i=-1;for(;++i<t;)e[i]=0;return e}function Rr(){return document.createElement("canvas")}function Or(t){return"function"==typeof t?t:function(){return t}}L(vr,"tr"),L(wr,"er"),L(Sr,"ir"),L(kr,"nr"),L(Ar,"or"),L(Cr,"sr"),L(Mr,"ar"),L(Tr,"rr"),L(Pr,"lr"),L(Ir,"hr"),L(Er,"cr"),L(Fr,"ur"),L(Dr,"pr"),L(zr,"dr"),L(Rr,"fr"),L(Or,"yr"),vt(vr,"d3Cloud"),vt(wr,"cloudText"),vt(Sr,"cloudFont"),vt(kr,"cloudFontNormal"),vt(Ar,"cloudFontSize"),vt(Cr,"cloudRotate"),vt(Mr,"cloudPadding"),vt(Tr,"cloudSprite"),vt(Pr,"cloudCollide"),vt(Ir,"cloudBounds"),vt(Er,"collideRects"),vt(Fr,"archimedeanSpiral"),vt(Dr,"rectangularSpiral"),vt(zr,"zeroArray"),vt(Rr,"cloudCanvas"),vt(Or,"functor");const jr={archimedean:Fr,rectangular:Dr},Lr=(O=class extends a.SVGWidget{_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),ht.call(this),_t.call(this),a.Utility.SimpleSelectionMixin.call(this),this._prevOffsetX=this.offsetX(),this._prevOffsetY=this.offsetY(),this._prevZoom=this.zoom()}calcData(){return this.data().map(t=>({__viz_label:t[0],__viz_weight:t[1],__viz_row:t}))}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this._root=e.append("g"),this._canvas=document.createElement("canvas");const i=this;this._d3Zoom=a.zoom().scaleExtent([.1,10]),this._d3Zoom.on("zoom",function(t){const e=a.d3Event();e&&e.transform&&i.zoomed(i._d3Zoom,[e.transform.x,e.transform.y],e.transform.k)}),e.call(this._d3Zoom),this.tooltipHTML(function(t){const e=i.columns(),n=e&&e.length?e[0]:"Word";return i.tooltipFormat({label:t.__viz_label,series:n,value:t.__viz_weight})})}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._d3Cloud=vr().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());const i=this.calcData(),n=this,o=a.extent(i,function(t){return t.__viz_weight});let s;switch(this.scaleMode()){case"log":s=a.scaleLog;break;case"sqrt":s=a.scaleSqrt;break;case"pow":s=a.scalePow;break;default:s=a.scaleLinear}const r=s().domain(o).range([this.fontSizeFrom(),this.fontSizeTo()]),l=a.scaleLinear().domain([0,n.angleCount()-1]).range([n.angleFrom(),n.angleTo()]);function h(t,e){const i=n._root.selectAll("text").data(t,function(t){return t.__viz_label?t.__viz_label.toLowerCase():""});i.enter().append("text").attr("text-anchor","middle").call(n._selection.enter.bind(n._selection)).text(function(t){return t.__viz_label}).on("click",function(t){n.click(n.rowToObj(t.__viz_row),n.columns()[1],n._selection.selected(this))}).on("dblclick",function(t){n.dblclick(n.rowToObj(t.__viz_row),n.columns()[1],n._selection.selected(this))}).on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).style("opacity",1e-6).merge(i).style("font-size",function(t){return r(t.__viz_weight)+"px"}).style("font-family",n.fontFamily()).transition().duration(1e3).attr("transform",function(t){return"translate("+[t.x,t.y]+")rotate("+t.rotate+")"}).style("fill",function(t){return n._palette(t.__viz_label?t.__viz_label.toLowerCase():"")}).style("opacity",1),i.exit().transition().duration(1e3).style("opacity",1e-4).remove()}L(h,"h"),this._d3Cloud.stop().size([this.width(),this.height()]).words(i).font(this.fontFamily()).padding(this.padding()).spiral(this.spiral()).text(function(t){return t.__viz_label.trim()}).fontSize(function(t){return r(t.__viz_weight)}).rotate((t,e)=>l(e%n.angleCount())).on("word",t=>{}).on("end",h).start(),vt(h,"draw")}zoomed(t,e,i){if(e[0]!==this._prevOffsetX||e[1]!==this._prevOffsetY||i!==this._prevZoom){switch(this._root.attr("transform",e),t){case this:break;case this._d3Zoom:this.offsetX(e[0]),this.offsetY(e[1]),this.zoom(i)}this._prevOffsetX=e[0],this._prevOffsetY=e[1],this._prevZoom=i}}},L(O,"_WordCloud"),O);vt(Lr,"WordCloud"),wt(Lr,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let Nr=Lr;function Br(){const t=a.timeFormat(".%L"),e=a.timeFormat(":%S"),i=a.timeFormat("%H:%M"),n=a.timeFormat("%H:00"),o=a.timeFormat("%b %d"),s=a.timeFormat("%b"),r=a.timeFormat("%Y");return a=>0!==a.getMilliseconds()?t(a):0!==a.getSeconds()?e(a):0!==a.getMinutes()?i(a):0!==a.getHours()?n(a):1!==a.getDate()?o(a):0!==a.getMonth()?s(a):r(a)}L(Br,"gr"),Nr.prototype._class+=" chart_WordCloud",Nr.prototype.implements(ht.prototype),Nr.prototype.implements(_t.prototype),Nr.prototype.mixin(a.Utility.SimpleSelectionMixin),Nr.prototype.publish("paletteID","default","set","Color palette for this widget",Nr.prototype._palette.switch(),{tags:["Basic","Shared"]}),Nr.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Nr.prototype.publish("fontFamily","Impact","string","Font Name",null,{tags:["Basic"]}),Nr.prototype.publish("fontSizeFrom",6,"number","Minimum font size (pixels)",null,{tags:["Basic"]}),Nr.prototype.publish("fontSizeTo",48,"number","Maximum font size (pixels)",null,{tags:["Basic"]}),Nr.prototype.publish("angleFrom",-60,"number","Minimum angle (degrees)",null,{tags:["Basic"]}),Nr.prototype.publish("angleTo",60,"number","Maximum angle (degrees)",null,{tags:["Basic"]}),Nr.prototype.publish("angleCount",5,"number","Number of different angles",null,{tags:["Basic"]}),Nr.prototype.publish("padding",0,"number","Padding between words (pixels)",null,{tags:["Intermediate"]}),Nr.prototype.publish("scaleMode","linear","set","Text scaling mode",["linear","log","sqrt","pow"],{tags:["Intermediate"]}),Nr.prototype.publish("spiral","archimedean","set","Text scaling mode",["archimedean","rectangular"],{tags:["Intermediate"]}),Nr.prototype.publish("offsetX",0,"number","X offset",null,{tags:["Advanced"]}),Nr.prototype.publish("offsetY",0,"number","Y offset",null,{tags:["Advanced"]}),Nr.prototype.publish("zoom",1,"number","Zoom",null,{tags:["Advanced"]}),vt(Br,"multiScale24Hours"),function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".chart_Axis{fill:#000;font:10px sans-serif}.chart_Axis .axis .tick>text{font:10px sans-serif}.chart_Axis .axis path.domain,.chart_Axis .axis .tick line{fill:none;stroke:#000}.chart_Axis .guide path.domain{fill:none;stroke:none}.chart_Axis .guide .tick line{fill:none;stroke:#d3d3d3;opacity:.7}.chart_Axis .guide .tick.guide-0 line{stroke:#000;stroke-width:1;stroke-dasharray:3 5}.chart_Axis line,.chart_Axis path{shape-rendering:crispEdges}.chart_XYAxis .axis{fill:#000;font:10px sans-serif}.chart_XYAxis .tick>text{font:10px sans-serif}.chart_XYAxis .focus .chart_Axis.value .tick{visibility:hidden}.chart_XYAxis .axis path,.chart_XYAxis .axis line{fill:none;stroke:#000;shape-rendering:crispEdges}.chart_XYAxis .region{opacity:.33}.chart_XYAxis .brush rect.background{z-index:-999}.chart_XYAxis .brush .selection{stroke:#4682b4;stroke-opacity:1;stroke-width:1px;fill:#4682b4;fill-opacity:.125;shape-rendering:crispEdges}.chart_XYAxis .brush path.handle--custom{fill:#eee;stroke:#666}.chart_Scatter .pointShape,.chart_Scatter .line,.chart_Scatter .area{pointer-events:none}.chart_Scatter .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Scatter .point .pointSelection.selected{fill:none;stroke:red}.chart_Column .columnRect{fill:#4682b4;cursor:pointer}.chart_Column .data.axis path{display:none}.chart_Column .columnRect{stroke:transparent;border-width:1.5px}.chart_Column .columnRect.selected{stroke:red}.chart_Bubble circle{cursor:pointer}.chart_Bubble .selected circle{stroke:red;stroke-width:1.5px}.chart_Bubble .common_FAChar{fill:#fff;pointer-events:none}.chart_Bubble .common_Text{pointer-events:none}.chart_Bullet .domain{opacity:0}.chart_Bullet .bullet{border:solid 1px;border-color:transparent;font:10px sans-serif}.chart_Bullet .bullet.selected{border-color:red}.chart_Bullet .bullet.over{border-color:orange}.chart_Bullet .bullet.selected.over{border-color:red}.chart_Bullet .bullet .marker{stroke:#000;stroke-width:2px}.chart_Bullet .bullet .tick line{stroke:#666;stroke-width:.5px}.chart_Bullet .bullet .range.s0{fill:#eee}.chart_Bullet .bullet .range.s1{fill:#ddd}.chart_Bullet .bullet .range.s2{fill:#ccc}.chart_Bullet .bullet .measure.s0{fill:#b0c4de}.chart_Bullet .bullet .measure.s1{fill:#4682b4}.chart_Bullet .bullet .title{font-size:14px;font-weight:700}.chart_Bullet .bullet .subtitle{fill:#999}.chart_Pie path{cursor:pointer}.chart_Pie>g>text{cursor:pointer}.chart_Pie .arc path{stroke:#fff;stroke-width:.75px}.chart_Pie .arc.selected path{stroke:red;stroke-width:1.5px}.chart_Pie polyline{opacity:.3;stroke:#000;stroke-width:2px;fill:none}.chart_HexBin .hexagon{fill:none;stroke:#000;stroke-width:.5px}.chart_HexBin .hexagon.selected{stroke:red}.chart_Line .dataLine{fill:none;stroke:#4682b4;stroke-width:1.5px}.chart_Radar .pointShape,.chart_Radar .area{pointer-events:none}.chart_Radar .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Radar .point .pointSelection.selected{fill:none;stroke:red}.chart_RadialBar path.arc{opacity:.9;transition:opacity .5s}.chart_RadialBar path.arc.selected{stroke:red}.chart_RadialBar path.arc:hover{opacity:.7}.chart_RadialBar .axis line,.chart_RadialBar .axis circle{stroke:#ccc;stroke-width:1px}.chart_RadialBar .axis circle{fill:none}.chart_RadialBar .r.axis text{text-anchor:end}.chart_Summary{width:225px;height:150px;font-size:14px}.chart_Summary .content h2{font-weight:700;font-size:3em;margin-left:10px;margin-top:10px;margin-bottom:10px}.chart_Summary .bgIcon:before{position:absolute;font-family:FontAwesome;font-size:5.5em;opacity:.4;top:.5em;right:15px}.chart_Summary .bgIcon{position:relative}.chart_Summary .content{float:left;width:100%;height:100%;background-color:#efd752}.chart_Summary .content div{margin-top:-1.1em;font-size:1.1em;opacity:.8}.chart_Summary .content .text{padding-left:10px}.chart_Summary .content .more{position:absolute;bottom:0;width:100%;height:3em;line-height:3em}.chart_Summary .content .more i{padding-left:10px;padding-right:.5em}.other_Wordcloud text{cursor:pointer}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();const Vr=["label","start","end","icon","color","series"],Hr=class _WUTimeline extends c.ReactTimelineSeries{_palette=a.Palette.ordinal("default");constructor(){super(),this.columns(Vr).titleColumn("label").iconColumn("icon").colorColumn("color").seriesColumn("series").timePattern("%Y-%m-%dT%H:%M:%S.%LZ").tickFormatFunc(Br()).tooltipTimeFormat("%H:%M:%S.%L").tooltipHTML(t=>t[Vr.length].calcTooltip())}_prevHashSum;clear(){return delete this._prevHashSum,this}fetchScopes(){const t=s.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});if(this._prevHashSum!==t){this._prevHashSum=t;i.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchDetails(this.request()).then(t=>t.filter(t=>t.Id&&t.attr("WhenStarted").RawValue).map(t=>{const e=+t.attr("WhenStarted").RawValue/1e3,i=+t.attr("TimeElapsed").RawValue/1e6;return[t.Id,new Date(e).toISOString(),i?new Date(e+i).toISOString():void 0,null,this._palette(t.ScopeType),t.ScopeName.split("::").join(":").split(":").slice(0,1),t]})).then(t=>{this.data(t).render()})}}enter(t,e){super.enter(t,e)}update(t,e){this.fetchScopes(),super.update(t,e)}exit(t,e){super.exit(t,e)}};L(Hr,"WUTimeline");let Wr=Hr;Wr.prototype._class+=" eclwatch_WUTimeline",Wr.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),Wr.prototype.publish("wuid","","string","Workunit ID"),Wr.prototype.publish("request",{ScopeFilter:{MaxDepth:3,ScopeTypes:["graph","subgraph"]},NestedFilter:{Depth:0,ScopeTypes:[]},PropertiesToReturn:{AllProperties:!1,AllStatistics:!0,AllHints:!1,Properties:["WhenStarted","TimeElapsed"]},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},"object","WUDetails Request"),t.BUILD_VERSION="3.16.0",t.ECLArchiveViewer=B,t.PKG_NAME="@hpcc-js/eclwatch",t.PKG_VERSION="3.5.2",t.STATUS=it,t.STATUS_ACTIVE=nt,t.WUGraph=Y,t.WUResult=et,t.WUScopeController=U,t.WUStatus=st,t.WUTimeline=Wr,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/codemirror"),require("@hpcc-js/comms"),require("@hpcc-js/phosphor"),require("@hpcc-js/tree"),require("@hpcc-js/util"),require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/graph"),require("@hpcc-js/layout"),require("@hpcc-js/timeline")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/codemirror","@hpcc-js/comms","@hpcc-js/phosphor","@hpcc-js/tree","@hpcc-js/util","@hpcc-js/common","@hpcc-js/dgrid","@hpcc-js/graph","@hpcc-js/layout","@hpcc-js/timeline"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/eclwatch"]={},t["@hpcc-js/codemirror"],t["@hpcc-js/comms"],t["@hpcc-js/phosphor"],t["@hpcc-js/tree"],t["@hpcc-js/util"],t["@hpcc-js/common"],t["@hpcc-js/dgrid"],t["@hpcc-js/graph"],t["@hpcc-js/layout"],t["@hpcc-js/timeline"])}(this,function(t,e,i,n,o,s,a,r,l,h,c){"use strict";var u,p,d,f,y,_,x,m,g,b,v,w,S,k,A,C,M,T,P,I,E,F,D,z,R,O,j=Object.defineProperty,L=(t,e)=>j(t,"name",{value:e,configurable:!0});const N=class _ECLArchiveViewer extends n.SplitPanel{_prevHash;_contentStr;_directoryPane=new o.DirectoryTree;_fileEditorPane=(new e.Editor).text("");constructor(){super("horizontal"),this._directoryPane.rowClick=t=>{this._fileEditorPane.text(t).render()}}transformArchiveTreeData(t){const e={label:t.name,children:t._children.map(i).filter(t=>t)};return e.children&&e.children[0]&&"html"===e.children[0].label?{label:"root",children:[{label:"error",content:JSON.stringify(e,null,4)}]}:e;function i(t){const e={};if(e.label=t.name+(t.$&&t.$.key?` (${t.$.key})`:""),t._children&&t._children.length>0)e.children=t._children.map(t=>i(t)).filter(t=>t);else{if("string"!=typeof t.content||!t.content.trim())return!1;e.content=t.content}return e}}updateDirectoryPane(t){let e;if(t)try{e=JSON.parse(t)}catch(i){e=s.xml2json(t)}if(e){const t=this.transformArchiveTreeData(e);this._directoryPane.data(t).render()}}enter(t,e){super.enter(t,e),this.addWidget(this._directoryPane).addWidget(this._fileEditorPane)}update(t,e){super.update(t,e);const n=s.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==n||void 0===this._contentStr?i.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchArchive().then(t=>{this._contentStr=t,this.updateDirectoryPane(this._contentStr),this._prevHash=n}):this.updateDirectoryPane(this._contentStr),this.relativeSizes([this.directoryWidthRatio(),1-this.directoryWidthRatio()])}};L(N,"ECLArchiveViewer");let B=N;B.prototype._class+=" eclwatch_ECLArchiveViewer",B.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),B.prototype.publish("wuid","","string","Workunit ID"),B.prototype.publish("directoryWidthRatio",.38,"number","Default directory panel width ratio relative to the full width"),B.prototype.publish("contentString",null,"string","XML/JSON archive content string"),B.prototype.publishProxy("directoryPaneColor","_directoryPane","backgroundColor"),B.prototype.publishProxy("directoryPaneHoverColor","_directoryPane","hoverBackgroundColor"),B.prototype.publishProxy("iconSize","_directoryPane"),B.prototype.publishProxy("fontColor","_directoryPane"),B.prototype.publishProxy("fontFamily","_directoryPane"),B.prototype.publishProxy("fontSize","_directoryPane"),B.prototype.publishProxy("folderIconOpen","_directoryPane"),B.prototype.publishProxy("folderIconClosed","_directoryPane"),B.prototype.publishProxy("textFileIcon","_directoryPane"),B.prototype.publishProxy("codeFileIcon","_directoryPane"),B.prototype.publishProxy("verticalScroll","_directoryPane");const V=class _LegendVertex extends l.Vertex{constructor(){super()}enter(t,e){super.enter(t,e),this._icon.on("click",()=>{this.click(this.data())})}click(t){}};L(V,"LegendVertex");let H=V;const W=class _WUGraphLegend extends h.Legend{icon=a.local();_disabled2={};disabled(t){if(!arguments.length){const t=[];for(const e in this._disabled2)this._disabled2[e]&&t.push(e);return t}return this._disabled2={},t.forEach(t=>this._disabled2[t]=!0),this}toggle(t){this._disabled2[t]=!this._disabled2[t]}update(t,e){super.update(t,e);const i=this,n=this._g.selectAll(".legendItem").data(this.data(),t=>t.kind);n.enter().append("g").attr("class","legendItem").each(function(t){i.icon.set(this,(new H).target(this).data(t.kind).textbox_shape_colorStroke("none").textbox_shape_colorFill("none").iconAnchor("left").faChar(t.faChar).text(`${t.label} (${t.count})`).tooltip(`${t.kind} - ${t.label}`).on("click",t=>{i.toggle(t),i.render(),i.click(t)}).on("mouseover",t=>{i.mouseover(t)}).on("mouseout",t=>{i.mouseout(t)}))}).merge(n).each(function(t,e){const n=i.icon.get(this).icon_shape_colorFill(i._disabled2[t.kind]?"gray":null).render().getBBox();a.select(this).attr("transform",`translate(${+n.width/2}, ${30*e})`)}),n.exit().each(function(t){i.icon.get(this).target(null).render()}).remove();const o=this.getBBox(!0,!0);this._g.attr("transform",`translate(16, ${this.height()/2-o.height/2})`)}click(t){}mouseover(t){}mouseout(t){}};L(W,"WUGraphLegend");let $=W;function q(t){switch(t){case"2":case"44":case"47":case"56":case"61":case"35":case"37":return"";case"3":return"";case"5":return"";case"6":return"";case"12":return"";case"15":case"17":case"59":return"";case"22":return"";case"23":return"";case"25":case"133":case"148":return"";case"26":case"19":return"";case"29":case"16":return"";case"36":return"";case"54":return"";case"82":case"88":case"99":case"105":case"71":return"";case"92":case"93":return"";case"7":return"";case"9":return"";case"21":case"168":return""}return""}$.prototype._class+=" eclwatch_WUGraphLegend",L(q,"faCharFactory");const G=class _WUScopeController{graphDB;subgraphsMap={};rSubgraphsMap={};verticesMap={};rVerticesMap={};edgesMap={};rEdgesMap={};kindMap={};_disabled={};constructor(){}clear(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={}}set(t){this.graphDB=t,this.graphGui(this.graphDB),this.kindMap={},this.graphDB.walk(t=>{if(t instanceof s.Subgraph);else if(t instanceof s.Vertex){const e=t._.attr("Kind").RawValue;this.kindMap[e]||(this.kindMap[e]=[]),this.kindMap[e].push(t)}})}disabled(t){if(!arguments.length){const t=[];for(const e in this._disabled)this._disabled[e]&&t.push(e);return t}return this._disabled={},t.forEach(t=>this._disabled[t]=!0),this}graphGui(t){const e={subgraphs:[],vertices:[],edges:[],hierarchy:[]};return t.walk(t=>{if(t instanceof s.Subgraph){const i=this.appendSubgraph(t,e.hierarchy,e.subgraphs);i.showMinMax(t.vertices.length>3||"normal"!==i.minState())}else t instanceof s.Vertex?this.appendVertex(t,e.hierarchy,e.vertices):t instanceof s.Edge&&this.appendEdge(t,e.edges)}),e}format(t,e){let i="",n=t.indexOf("%"),o=-1;for(;n>=0;){if(i+=t.substring(o+1,n),o=t.indexOf("%",n+1),o<0){console.warn("Invalid Label Template");break}i+=t.substring(n+1,o)?e[t.substring(n+1,o)]||"":"%",n=t.indexOf("%",o+1)}return i+=t.substring(o+1,t.length),i.split("\\n").join("\n")}createSubgraph(t){let e=this.subgraphsMap[t._.Id];return e||(e=(new l.Subgraph).title(t._.Id).on("minClick",()=>{this.minClick(e)}),this.subgraphsMap[t._.Id]=e,this.rSubgraphsMap[e.id()]=t),e}createVertex(t){let e=this.verticesMap[t._.Id];if(!e){const i=t._.rawAttrs();if("dummy"===t._.ScopeType){const i=this.subgraphsMap[t.parent._.Id];e=(new a.Icon).shape_colorFill("darkred").shape_colorStroke("darkred").image_colorFill("white").faChar("").on("click",()=>{i.minState("normal"),this.minClick(i)})}else{e=(new l.Vertex).icon_shape_colorFill("#1f77b4").icon_image_colorFill("white").faChar(q(i.Kind)).text(i.Label);const n=[];t._.hasAttr("Definition")&&n.push({faChar:"",tooltip:"Definition",shape_colorFill:"lightgray",shape_colorStroke:"lightgray",image_colorFill:"black"}),t._.hasAttr("IsInternal")&&n.push({faChar:"",tooltip:"IsInternal",shape_colorFill:"red",shape_colorStroke:"red",image_colorFill:"white"}),e.annotationIcons(n)}this.verticesMap[t._.Id]=e,this.rVerticesMap[e.id()]=t}return e}isSpill(t){const e=t.source._.attr("Kind").RawValue,i=t.target._.attr("Kind").RawValue;return"2"===e||"71"===i}spansSubgraph(t){return t.source.parent._.Id!==t.target.parent._.Id}createEdge(t){let e=this.edgesMap[t._.Id];if(!e){const i=t._.rawAttrs(),n=this.verticesMap[t.source._.Id],o=this.verticesMap[t.target._.Id];if(n&&o){const s=this.isSpill(t),a=this.spansSubgraph(t),r=this.format("%Label%\n%NumRowsProcessed%",i);let h=null,c=100;i.IsDependency?(c=10,h="1,5"):i._childGraph?h="5,5":s?(c=25,h="5,5,10,5"):a&&(c=5,h="5,5"),e=(new l.Edge).sourceVertex(n).targetVertex(o).sourceMarker("circle").targetMarker("arrow").weight(c).strokeDasharray(h).text(r),this.edgesMap[t._.Id]=e,this.rEdgesMap[e.id()]=t}}return e}appendSubgraph(t,e,i){const n=this.createSubgraph(t);i.push(n);const o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:n}),n}appendVertex(t,e,i){const n=this.createVertex(t);i.push(n);const o=this.subgraphsMap[t.parent._.Id];return o&&e.push({parent:o,child:n}),n}appendEdge(t,e){const i=this.createEdge(t);return i&&e.push(i),i}filterLegend(t){for(let e=t.vertices.length-1;e>=0;--e){const n=t.vertices[e],o=n._.attr("Kind").RawValue;this._disabled[o]&&n.remove(!1,(t,e)=>new i.BaseScope({ScopeName:n._.ScopeName+":in",Id:t.Id+"->"+e.Id,ScopeType:"dummy-edge",Properties:{Property:[n._.attr("Label")]},Notes:{Note:[]},SinkActivity:""}))}}filterPartial(t){for(const e of t.subgraphs){if("partial"===this.subgraphsMap[e._.Id].minState()){const t=e.vertices,n=[],o=[];for(const e of t)0===e.inEdges.length||e.inEdges.some(t=>t.source.parent!==t.target.parent)||0===e.outEdges.length||e.outEdges.some(t=>t.source.parent!==t.target.parent)?n.push(e):o.push(e);if(o.length>1){const t={ScopeName:e._.ScopeName,Id:e._.Id+":dummy",ScopeType:"dummy",Properties:{Property:[{Name:"Activities",RawValue:""+o.length,Formatted:""+o.length,Measure:"count",Creator:"",CreatorType:""}]},Notes:{Note:[]},SinkActivity:""},s=new i.BaseScope(t),a=e.createVertex(s);for(const r of o){for(const t of r.inEdges)if(n.indexOf(t.source)>=0){const n=new i.BaseScope({ScopeName:t.source._.ScopeName,Id:t.source._.Id+"->"+a._.Id,ScopeType:"dummy-in",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});e.createEdge(t.source,a,n)}for(const t of r.outEdges)if(n.indexOf(t.target)>=0){const n=new i.BaseScope({ScopeName:t.target._.ScopeName,Id:a._.Id+"->"+t.target._.Id,ScopeType:"dummy-out",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});e.createEdge(a,t.target,n)}}o.forEach(t=>t.remove(!0))}}}}filterEmptySubgraphs(t){for(;;){const e=t.subgraphs.filter(t=>0===t.subgraphs.length&&0===t.vertices.length);if(0===e.length)break;e.forEach(t=>t.remove(!0))}}removeObsoleteSubgraphs(t){for(const e of[...t.subgraphs])0===e.vertices.length&&e.remove(!1)}graphData(){const t=this.graphDB.clone();return this.filterLegend(t),this.filterPartial(t),this.filterEmptySubgraphs(t),this.removeObsoleteSubgraphs(t),this.graphGui(t)}calcLegend(){const t=[];for(const e in this.kindMap)t.push({kind:parseInt(e),faChar:q(e),label:this.kindMap[e][0]._.attr("Label").RawValue.split("\n")[0],count:this.kindMap[e].length});return t}vertices(t){const e=[];for(const i of this.kindMap[t])e.push(this.verticesMap[i._.Id]);return e}formatRow(t,e,i){const n=t._.formattedAttrs();for(const o in n){const t=e.indexOf(o);-1===t?(e.push(o),i.push(n[o])):i[t]=n[o]}for(let o=0;o<100;++o)void 0===i[o]&&(i[o]="");return i}activityData(){const t=["Id","Kind","Label"],e=this.graphDB.vertices.map(e=>{const i=[parseInt(e._.Id.split("a")[1])];return this.formatRow(e,t,i)});return{columns:t,data:e}}edgeData(){const t=["Id","Label"],e=this.graphDB.edges.map(e=>{const i=[e._.Id];return this.formatRow(e,t,i)});return{columns:t,data:e}}subgraphData(){const t=["Id","Label"],e=this.graphDB.subgraphs.map(e=>{const i=[e._.Id];return this.formatRow(e,t,i)});return{columns:t,data:e}}calcGraphTooltip(t){let e,i;if(t instanceof l.Subgraph){const n=this.rSubgraphsMap[t.id()];e=n._,i=n.parent._}else if(t instanceof l.Vertex||t instanceof a.Icon){const n=this.rVerticesMap[t.id()];e=n._,i=n.parent._}else if(t instanceof l.Edge){const n=this.rEdgesMap[t.id()];e=n._,i=n.parent._}return e?e.calcTooltip(i):""}subgraph(t){return this.subgraphsMap[t]}vertex(t){return this.verticesMap[t]}edge(t){return this.edgesMap[t]}minClick(t){}};L(G,"WUScopeController");let U=G;const X=class _WUGraph extends h.ChartPanel{_partialAll=(new a.Button).faChar("fa-window-restore").tooltip("Partial All").on("click",()=>{this.stateClick(this._partialAll)});_maxAll=(new a.Button).faChar("fa-window-maximize").tooltip("Max All").on("click",()=>{this.stateClick(this._maxAll)});_toggleGraph=(new a.ToggleButton).faChar("fa-chain").tooltip("Graph").selected(!0).on("click",()=>{this.viewClick(this._toggleGraph)});_toggleActivities=(new a.ToggleButton).faChar("fa-table").tooltip("Activitiies").selected(!1).on("click",()=>{this.viewClick(this._toggleActivities)});_toggleEdges=(new a.ToggleButton).faChar("fa-table").tooltip("Edges").selected(!1).on("click",()=>{this.viewClick(this._toggleEdges)});_toggleSubgraphs=(new a.ToggleButton).faChar("fa-table").tooltip("Subgraphs").selected(!1).on("click",()=>{this.viewClick(this._toggleSubgraphs)});_graph=(new l.Graph).layout("Hierarchy").applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1);_activities=(new r.Table).pagination(!1);_edges=(new r.Table).pagination(!1);_subgraphs=(new r.Table).pagination(!1);_legend=new $(this).on("click",t=>{this.render()}).on("mouseover",t=>{const e={};for(const i of this._gc.vertices(t))e[i.id()]=!0;this._graph.highlightVerticies(e)}).on("mouseout",t=>{this._graph.highlightVerticies()});_view=(new h.Carousel).widgets([this._graph,this._activities,this._edges,this._subgraphs]);_gc=new U;constructor(){super(),this.topOverlay(!1),this.widget(this._view);const t=[this._toggleGraph,this._toggleActivities,this._toggleEdges,this._toggleSubgraphs,new a.Spacer,this._partialAll,this._maxAll,new a.Spacer,...this._graph.iconBarButtons(),new a.Spacer];this.buttons(t.concat(this.buttons())),this._gc.minClick=t=>{this.loadGraph(),this._graph.render(e=>{this._graph.selection([t]).centerOnItem(t)})},this._graph.tooltipHTML(t=>this._gc.calcGraphTooltip(t))}stateClick(t){switch(t){case this._partialAll:this._graph.data().subgraphs.forEach(t=>{t.minState("partial")});break;case this._maxAll:this._graph.data().subgraphs.forEach(t=>{t.minState("normal")})}this.render()}viewClick(t){switch(this._toggleGraph.selected(t===this._toggleGraph),this._toggleActivities.selected(t===this._toggleActivities),this._toggleEdges.selected(t===this._toggleEdges),this._toggleSubgraphs.selected(t===this._toggleSubgraphs),t){case this._toggleGraph:this._view.active(0);break;case this._toggleActivities:this._view.active(1);break;case this._toggleEdges:this._view.active(2);break;case this._toggleSubgraphs:this._view.active(3)}this.render(t=>{})}_prevHashSum;_prevScopeGraph;fetchScopeGraph(){const t=s.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),graphID:this.graphID(),subgraphID:this.subgraphID()});if(!this._prevScopeGraph||this._prevHashSum!==t){this.startProgress(),this._prevHashSum=t,this._gc.clear();return i.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchGraphs().then(t=>{for(const e of t)if(e.Name===this.graphID())return this.finishProgress(),e.fetchScopeGraph(this.subgraphID())}).then(t=>(this._prevScopeGraph=t,this._prevScopeGraph))}return Promise.resolve(this._prevScopeGraph)}enter(t,e){super.enter(t,e)}update(t,e){super.update(t,e)}exit(t,e){super.exit(t,e)}loadGraph(){this._gc.disabled(this._legend.disabled()),this._graph.data(this._gc.graphData(),!0);{const{columns:t,data:e}=this._gc.activityData();this._activities.columns(t).data(e)}{const{columns:t,data:e}=this._gc.edgeData();this._edges.columns(t).data(e)}{const{columns:t,data:e}=this._gc.subgraphData();this._subgraphs.columns(t).data(e)}}render(t){return this.wuid()&&this.graphID()?this.fetchScopeGraph().then(e=>{this._gc.set(e),this._legend.data(this._gc.calcLegend()),this.loadGraph(),super.render(t)}):super.render(t),this}selection(t){if(!arguments.length)return this._graph.selection();const e=this._gc.vertex(t)||this._gc.edge(t)||this._gc.subgraph(t);return e&&this._graph.selection([e]),this}};L(X,"WUGraph");let Y=X;function Q(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Z(t){switch(Object.prototype.toString.call(t)){case"[object Undefined]":case"[object Boolean]":case"[object Number]":return t;case"[object String]":return Q(t);default:console.warn("Unknown cell type: "+Object.prototype.toString.call(t))}return t}Y.prototype._class+=" eclwatch_WUGraph",Y.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),Y.prototype.publish("wuid","","string","Workunit ID"),Y.prototype.publish("graphID","","string","Graph ID"),Y.prototype.publish("subgraphID","","string","Subgraph ID"),L(Q,"entitiesEncode"),L(Z,"safeEncode");const J=class _Store{wuResult;schema;_columns;_cache={};rowFormatter;_filter={};onError;constructor(t,e,i,n={},o){this.wuResult=t,this.schema=e,this._columns=this.schema2Columns(this.schema.root),this.rowFormatter=new r.RowFormatter(this._columns,i),this._filter=n,this.onError=o}columns(){return this._columns}schema2Columns(t,e=""){return t?t.children().filter(t=>-1===t.name.indexOf("__hidden",t.name.length-8)).map((t,i)=>{const n=t.name,o=t.attrs["hpcc:keyed"],s={field:e+n,leafID:n,idx:i,label:n+(o?" (i)":""),className:"resultGridCell",sortable:!1,width:o?16:0,isSet:t.isSet},a=this.schema2Columns(t,e+n+"_");return a.length?(s.width+=10+a.reduce((t,e)=>t+e.width,0),s.children=a):(s.width+=9*t.charWidth(),s.formatter=(t,e)=>{switch(typeof t){case"string":return{html:t.replace(/\t/g," ").trim()};case"undefined":return""}return t}),s}):[]}isChildDataset(t){if("[object Object]"!==Object.prototype.toString.call(t))return!1;let e=0,i=null;for(const n in t)i||(i=Object.prototype.toString.call(t[n])),e++;return 1===e&&"[object Array]"===i}rowToTable(t,e,i){if(this.isChildDataset(t)){for(const n in t)this.rowToTable(t[n],e,i);return}const n=r.domConstruct.create("table",{border:1,cellspacing:0,width:"100%"},i);switch(Object.prototype.toString.call(t)){case"[object Object]":let o=r.domConstruct.create("tr",null,n);for(const e in t)r.domConstruct.create("th",{innerHTML:Z(e)},o);o=r.domConstruct.create("tr",null,n);for(const n in t)switch(Object.prototype.toString.call(t[n])){case"[object Object]":case"[object Array]":this.rowToTable(t[n],e,i);break;default:r.domConstruct.create("td",{innerHTML:Z(t[n])},o)}break;case"[object Array]":for(let e=0;e<t.length;++e)switch(Object.prototype.toString.call(t[e])){case"[object Boolean]":case"[object Number]":case"[object String]":const i=r.domConstruct.create("tr",null,n);r.domConstruct.create("td",{innerHTML:Z(t[e])},i);break;default:if(0===e){const i=r.domConstruct.create("tr",null,n);for(const n in t[e])r.domConstruct.create("th",{innerHTML:Z(n)},i)}r.domConstruct.create("tr",null,n);for(const n in t[e])if(t[e][n])if("[object Object]"===Object.prototype.toString.call(t[e][n])||"[object Array]"===Object.prototype.toString.call(t[e][n])){const o=r.domConstruct.create("td",null,i);this.rowToTable(t[e][n],t[e],o)}else if(-1!==n.indexOf("__html",n.length-6))r.domConstruct.create("td",{innerHTML:t[e][n]},i);else if(-1!==n.indexOf("__javascript",n.length-12))r.domConstruct.create("td",null,i);else{const o=t[e][n];r.domConstruct.create("td",{innerHTML:Z(o)},i)}else r.domConstruct.create("td",{innerHTML:""},i)}}}getIdentity(t){return t.__hpcc_id}_request(t,e){if(!this.wuResult)return Promise.resolve({totalLength:0,data:[]});const i=`${t}->${e}`;if(this._cache[i])return this._cache[i];const n=this.wuResult.fetchRows(t,e-t,!1,this._filter).then(e=>({totalLength:this.wuResult.Total,data:e.map((e,i)=>{const n=this.rowFormatter.format(e);return n.__hpcc_id=t+i,n.__hpcc_orig=e,n})})).catch(t=>(this.onError(t.Message||"An exception has occurred"),{totalLength:0,data:[]}));return this._cache[i]=n,n}fetchRange(t){const e=new r.Deferred;return this._request(t.start,t.end).then(t=>e.resolve(t)),new r.QueryResults(e.then(t=>t.data),{totalLength:e.then(t=>t.totalLength)})}};L(J,"Store");let K=J;const tt=class _WUResult extends r.Common{_result;_localStore;constructor(){super(),this.renderHtml(!1)}hashSum(t={}){return s.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),resultName:this.resultName(),sequence:this.sequence(),nodeGroup:this.nodeGroup(),logicalFile:this.logicalFile(),userID:this.user(),password:this.password(),bypassCache:this.bypassCache(),...t})}_prevResultHash;calcResult(){const t=this.hashSum();if(this._prevResultHash!==t){this._prevResultHash=t;const e={baseUrl:this.baseUrl(),userID:this.user(),password:this.password()};this.wuid()&&this.resultName()?this._result=i.Result.attach(e,this.wuid(),this.resultName()):this.wuid()&&void 0!==this.sequence()?this._result=i.Result.attach(e,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=i.Result.attachLogicalFile(e,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=i.Result.attachLogicalFile(e,"",this.logicalFile())),this._result&&this.bypassCache()&&this._result.bypassCache(this.bypassCache())}return this._result}fetch(t,e,i=new AbortController){const n=this.calcResult();return n?n.fetchRows(t,e,!1,{},i.signal):Promise.resolve([])}_prevStoreHash;_prevQueryHash;update(t,e){super.update(t,e);const i=this.hashSum({renderHtml:this.renderHtml(),filter:this.filter()});if(this._prevStoreHash!==i){this._prevStoreHash=i;const t=this.calcResult();t&&t.fetchXMLSchema().then(e=>{this._localStore=new K(t,e,this.renderHtml(),this.filter(),t=>{this._dgrid&&(this._dgrid.noDataMessage=`<span class='dojoxGridNoData'>${t}</span>`,this._dgrid.refresh())}),this._dgrid?.set("columns",this._localStore.columns()),this._dgrid?.set("collection",this._localStore)})}}click(t,e,i){}};L(tt,"WUResult");let et=tt;et.prototype._class+=" eclwatch_WUResult",et.prototype.publish("baseUrl","","string","URL to WsWorkunits"),et.prototype.publish("user","","string","User ID"),et.prototype.publish("password","","string","Password"),et.prototype.publish("wuid","","string","Workunit ID"),et.prototype.publish("resultName","","string","Result Name"),et.prototype.publish("sequence",void 0,"number","Sequence Number"),et.prototype.publish("nodeGroup","","string","NodeGroup"),et.prototype.publish("logicalFile","","string","Logical File Name"),et.prototype.publish("filter",{},"object","Filter"),et.prototype.publish("bypassCache",!1,"boolean","Bypass cached results");var it=(t=>(t.CREATE="Created",t.COMPILE="Compiled",t.EXECUTE="Executed",t.COMPLETE="Completed",t))(it||{}),nt=(t=>(t.CREATE="Creating",t.COMPILE="Compiling",t.EXECUTE="Executing",t.COMPLETE="Completed",t))(nt||{});const ot=class _WUStatus extends l.Graph{_wu;_wuHandle;_create;_compile;_execute;_complete;constructor(){super(),this.zoomable(!1).zoomToFitLimit(1).layout("Hierarchy").hierarchyRankDirection("LR").showToolbar(!1).allowDragging(!1)}_prevHash;attachWorkunit(){const t=s.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==t&&(this._prevHash=t,this._wu=i.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch(t=>{this.lazyRender()}))}createVertex(t){return(new l.Vertex).icon_diameter(32).icon_shape_colorFill("none").icon_shape_colorStroke("none").icon_image_colorFill("darkgray").iconAnchor("middle").textbox_shape_colorFill("none").textbox_shape_colorStroke("none").textbox_text_colorFill("darkgray").faChar(t)}updateVertex(t,e){t.icon_image_colorFill(e).textbox_text_colorFill(e)}updateVertexStatus(t,e=!1){const i=this._wu.isFailed()?"darkred":"darkgreen";switch(this._create.text("Created"),this._compile.text("Compiled"),this._execute.text("Executed"),this._complete.text("Completed"),t){case 0:this.updateVertex(this._create,"darkgray"),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 1:this._create.text("Creating"),this.updateVertex(this._create,e?"orange":i),this.updateVertex(this._compile,"darkgray"),this.updateVertex(this._execute,"darkgray"),this.updateVertex(this._complete,"darkgray");break;case 2:this._compile.text("Compiling"),this.updateVertex(this._create,i),this.updateVertex(this._compile,e?"orange":i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,"darkgray");break;case 3:this._execute.text("Executing"),this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,e?"orange":i),this.updateVertex(this._complete,"darkgray");break;case 4:this.updateVertex(this._create,i),this.updateVertex(this._compile,i),this.updateVertex(this._execute,i),this.updateVertex(this._complete,i)}}createEdge(t,e){return(new l.Edge).sourceVertex(t).targetVertex(e).strokeColor("black").showArc(!1)}enter(t,e){super.enter(t,e),this._create=this.createVertex(""),this._compile=this.createVertex(""),this._execute=this.createVertex(""),this._complete=this.createVertex("");const i=this.createEdge(this._create,this._compile),n=this.createEdge(this._compile,this._execute),o=this.createEdge(this._execute,this._complete);this.data({vertices:[this._create,this._compile,this._execute,this._complete],edges:[i,n,o]})}update(t,e){switch(this.attachWorkunit(),this._wu.StateID){case i.WUStateID.Blocked:case i.WUStateID.Wait:case i.WUStateID.Scheduled:case i.WUStateID.UploadingFiled:this.updateVertexStatus(1);break;case i.WUStateID.Compiling:this.updateVertexStatus(2,!0);break;case i.WUStateID.Submitted:this.updateVertexStatus(1,!0);break;case i.WUStateID.Compiled:this.updateVertexStatus(2);break;case i.WUStateID.Aborting:case i.WUStateID.Running:this.updateVertexStatus(3,!0);break;case i.WUStateID.Aborted:case i.WUStateID.Archived:case i.WUStateID.Completed:this.updateVertexStatus(4);break;case i.WUStateID.Failed:this.updateVertexStatus(4,!1);break;case i.WUStateID.DebugPaused:case i.WUStateID.DebugRunning:case i.WUStateID.Paused:case i.WUStateID.Unknown:default:this.updateVertexStatus(0)}super.update(t,e),this.zoomToFit()}exit(t,e){this._wuHandle&&this._wuHandle.release(),super.exit(t,e)}};L(ot,"WUStatus");let st=ot;st.prototype._class+=" eclwatch_WUStatus",st.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),st.prototype.publish("wuid","","string","Workunit ID");var at=Object.defineProperty,rt=L((t,e)=>at(t,"name",{value:e,configurable:!0}),"o");function lt(){}function ht(){}function ct(){}function ut(){}function pt(t){return"function"==typeof t.highlightColumn}function dt(){}function ft(){}function yt(){let t=c,e=u,i=p,n=M(document.body),o=S(),s=null,r=null,l=null;const h=rt(function(t){if(s=k(t),!s)return;r=s.createSVGPoint();const e=n();e&&o&&e.appendChild(o)},"tip2");function c(){return"n"}function u(){return[0,0]}function p(){return" "}L(c,"h"),L(u,"y"),L(p,"d"),h.show=function(t,o,s){l=s[o];const a=Array.prototype.slice.call(arguments),r=i.apply(this,a);if(null===r)return h;const c=e.apply(this,a),u=A();let p,y=f.length;const _=n().getBoundingClientRect();for(u.html(r).style("opacity",1).style("pointer-events","all");y--;)u.classed(f[y],!1);let x=!1;const m={};let g=f[0];for(let e=0;e<f.length&&(x=w(f[e]),!x);e++);if(x)u.classed("notick",!1);else{u.classed("notick",!0);const t=v(m[g]),e=b(m[g]);w(g,t,e)}return h;function b(t){return t.left>t.right?t.left>0?-t.left:0:t.right>0?t.right:0}function v(t){return t.top>t.bottom?t.top>0?-t.top:0:t.bottom}function w(t,e,i){e=e||0,i=i||0,u.style("white-space","nowrap"),p=d.get(t).apply(this),u.classed(t,!0).style("top",p.top+c[0]-e+"px").style("left",p.left+c[1]-i+"px");const n=u.node().getBoundingClientRect(),o=n.top>_.top&&n.left>_.left&&n.bottom<_.bottom&&n.right<_.right;return m[t]={top:_.top-n.top,right:n.right-_.right,bottom:n.bottom-_.bottom,left:_.left-n.left},u.style("white-space","normal"),m[t].total_overflow=Object.keys(m[t]).filter(e=>m[t][e]>0).reduce((e,i)=>e+m[t][i],0),m[g].total_overflow>m[t].total_overflow&&(g=t),o||u.classed(t,!1),o}},h.hide=function(){return A().style("opacity",0).style("pointer-events","none"),h},h.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return A().attr(t);const i=Array.prototype.slice.call(arguments);return a.selection.prototype.attr.apply(A(),i),h},h.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return A().style(t);const i=Array.prototype.slice.call(arguments);return a.selection.prototype.style.apply(A(),i),h},h.direction=function(e){return arguments.length?(t=null==e?e:M(e),h):t},h.offset=function(t){return arguments.length?(e=null==t?t:M(t),h):e},h.html=function(t){return arguments.length?(i=null==t?t:M(t),h):i},h.rootElement=function(t){return arguments.length?(n=M(t),h):n},h.destroy=function(){return o&&(A().remove(),o=null),h},rt(c,"d3TipDirection"),rt(u,"d3TipOffset"),rt(p,"d3TipHTML");const d=a.map({n:y,s:_,e:x,w:m,nw:g,ne:b,sw:v,se:w}),f=d.keys();function y(){const t=C(window);return{top:t.n.y-o.offsetHeight,left:t.n.x-o.offsetWidth/2}}function _(){const t=C(window);return{top:t.s.y+8,left:t.s.x-o.offsetWidth/2}}function x(){const t=C(window);return{top:t.e.y-o.offsetHeight/2,left:t.e.x+8}}function m(){const t=C(window);return{top:t.w.y-o.offsetHeight/2,left:t.w.x-o.offsetWidth-8}}function g(){const t=C(window);return{top:t.nw.y-o.offsetHeight,left:t.nw.x-o.offsetWidth}}function b(){const t=C(window);return{top:t.ne.y-o.offsetHeight,left:t.ne.x}}function v(){const t=C(window);return{top:t.sw.y,left:t.sw.x-o.offsetWidth}}function w(){const t=C(window);return{top:t.se.y,left:t.se.x}}function S(){const t=a.select(document.createElement("div"));return t.attr("class","d3-tip").style("position","absolute").style("top","0px").style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function k(t){const e=t.node();return e?"svg"===e.tagName.toLowerCase()?e:e.ownerSVGElement:null}function A(){return null==o&&(o=S(),n().appendChild(o)),a.select(o)}function C(t){let e=l||t;for(;null==e.getCTM&&null!=e.parentNode;)e=e.parentNode;const i={},n=e.getCTM(),o=e.getBBox(),s=o.width,a=o.height,h=o.x,c=o.y;return r.x=h,r.y=c,i.nw=r.matrixTransform(n),r.x+=s,i.ne=r.matrixTransform(n),r.y+=a,i.se=r.matrixTransform(n),r.x-=s,i.sw=r.matrixTransform(n),r.y-=a/2,i.w=r.matrixTransform(n),r.x+=s,i.e=r.matrixTransform(n),r.x-=s/2,r.y-=a/2,i.n=r.matrixTransform(n),r.y+=a,i.s=r.matrixTransform(n),i}function M(t){return"function"==typeof t?t:function(){return t}}return L(y,"g"),L(_,"v"),L(x,"x"),L(m,"w"),L(g,"C"),L(b,"_"),L(v,"k"),L(w,"F"),L(S,"E"),L(k,"T"),L(A,"V"),L(C,"S"),L(M,"I"),rt(y,"directionNorth"),rt(_,"directionSouth"),rt(x,"directionEast"),rt(m,"directionWest"),rt(g,"directionNorthWest"),rt(b,"directionNorthEast"),rt(v,"directionSouthWest"),rt(w,"directionSouthEast"),rt(S,"initNode"),rt(k,"getSVGNode"),rt(A,"getNodeEl"),rt(C,"getScreenBBox"),rt(M,"functor"),h}function _t(){if(this.tooltip=yt(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=a.format(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=a.format(this.tooltipValueFormat())),this.layerEnter){const t=this.layerEnter;this.layerEnter=function(e,i,n){this._parentOverlay||(this._parentOverlay=e._parentOverlay),this.tooltipEnter(i),t.apply(this,arguments)};const e=this.layerUpdate;this.layerUpdate=function(t){e.apply(this,arguments),this.tooltipUpdate()};const i=this.layerExit;this.layerExit=function(t){this.tooltipExit(),i.apply(this,arguments)}}else{const t=this.enter;this.enter=function(e,i){this.tooltipEnter(i),t.apply(this,arguments)};const e=this.update;this.update=function(t,i){e.apply(this,arguments),this.tooltipUpdate()};const i=this.exit;this.exit=function(t,e){this.tooltipExit(),i.apply(this,arguments)}}}L(lt,"f"),L(ht,"h"),L(ct,"y"),L(ut,"d"),L(pt,"b"),L(dt,"m"),L(ft,"g"),L(yt,"v"),L(_t,"x"),rt(lt,"I1DChart"),lt.prototype._dataFamily="1D",lt.prototype._palette=a.Palette.rainbow("default"),lt.prototype.click=function(t,e,i){},lt.prototype.dblclick=function(t,e,i){},rt(ht,"I2DChart"),ht.prototype._dataFamily="2D",ht.prototype._palette=a.Palette.ordinal("default"),ht.prototype.fillColor=function(t,e,i,n){return this._palette(t[0])},ht.prototype.strokeColor=function(t,e,i,n){return a.hsl(this.fillColor(t,e,i,n)).darker().toString()},ht.prototype.textColor=function(t,e,i,n){return a.Palette.textColor(this.fillColor(t,e,i,n))},ht.prototype.click=function(t,e,i){},ht.prototype.dblclick=function(t,e,i){},rt(ct,"I2DAggrChart"),ct.prototype._palette=a.Palette.rainbow("default"),ct.prototype.fillColor=function(t,e,i){return this._palette(t.length)},ct.prototype.strokeColor=function(t,e,i){return a.hsl(this.fillColor(t,e,i)).darker().toString()},ct.prototype.textColor=function(t,e,i){return a.Palette.textColor(this.fillColor(t,e,i))},ct.prototype.click=function(t,e,i){},ct.prototype.dblclick=function(t,e,i){},rt(ut,"IGraph"),ut.prototype._dataFamily="graph",ut.prototype.vertex_click=function(t,e,i,n){n&&n.vertex},ut.prototype.vertex_dblclick=function(t,e,i,n){n&&n.vertex},ut.prototype.edge_click=function(t,e,i,n){n&&n.edge},ut.prototype.edge_dblclick=function(t,e,i,n){n&&n.edge},rt(pt,"instanceOfIHighlight"),rt(dt,"IInput"),dt.prototype=Object.create(a.Widget.prototype),dt.prototype.constructor=dt,dt.prototype.isValid=function(){return!(this.validate()&&!new RegExp(this.validate()).test(this.value()))},dt.prototype.hasValue=function(){if("function"==typeof this.type){switch(this.type()){case"radio":case"checkbox":if(this.value()&&"false"!==this.value())return!0;break;default:if(this.value())return!0}return!1}return""!==this.value()},dt.prototype.blur=function(t){},dt.prototype.keyup=function(t){},dt.prototype.focus=function(t){},dt.prototype.click=function(t){},dt.prototype.dblclick=function(t){},dt.prototype.change=function(t,e){},dt.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},dt.prototype.disable=function(t){this._inputElement.forEach(function(e,i){e.attr("disabled",t?"disabled":null)})},dt.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},dt.prototype.publish("name","","string","HTML name for the input"),dt.prototype.publish("label","","string","Descriptive label"),dt.prototype.publish("value","","string","Input Current Value"),dt.prototype.publish("validate",null,"string","Input Validation"),rt(ft,"INDChart"),ft.prototype._dataFamily="ND",ft.prototype._palette=a.Palette.ordinal("default"),ft.prototype.fillColor=function(t,e,i,n){return this._palette(e)},ft.prototype.strokeColor=function(t,e,i,n){return a.hsl(this.fillColor(t,e,i,n)).darker().toString()},ft.prototype.textColor=function(t,e,i,n){return a.Palette.textColor(this.fillColor(t,e,i,n))},ft.prototype.click=function(t,e,i){},ft.prototype.dblclick=function(t,e,i){},rt(yt,"tip"),rt(_t,"ITooltip"),_t.prototype=Object.create(a.Widget.prototype),_t.prototype.constructor=_t,_t.prototype.tooltipEnter=function(t){const e=this.parentOverlay();e.empty()||this.tooltip.rootElement(e.node().parentNode),t.call(this.tooltip)},_t.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){const t=document.querySelector(".d3-tip");return t.style.display="block",t.style.left=this.tooltipOffset()+event.clientX+"px",t.style.top=event.clientY+"px",[]}return"e"===this.tooltip.direction()()?[0,this.tooltipOffset()]:[-this.tooltipOffset(),0]});let t=this.tooltip.attr("class");t&&(t=t.split(" notick").join("")+(this.tooltipTick()?"":" notick")+("none"===this.tooltipStyle()?" hidden":""),t=t.split(" ").filter(function(t){return 0!==t.indexOf("ITooltip-tooltipStyle-")}).join(" "),t+=" ITooltip-tooltipStyle-"+this.tooltipStyle(),this.tooltip.attr("class",t))},_t.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},_t.prototype._tooltipHTML=function(t){return t},_t.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},_t.prototype.tooltipFormat=function(t={}){switch(t.label=void 0===t.label?"":t.label,this._labelFormatter?t.label=this._labelFormatter(t.label)||"":this.formatData&&this.parseData&&(t.label=this.formatData(this.parseData(t.label))),t.series=t.series||"",t.value instanceof Date?t.value=t.value||"":this._valueFormatter?t.value=this._valueFormatter(t.value)||"":this.formatValue&&this.parseValue&&(t.value=this.formatValue(this.parseValue(t.value))),this.tooltipStyle()){case"none":break;case"series-table":let e='<table class="ITooltip-series-table"><thead><tr><th colspan="2">'+t.label+"</th></tr></thead><tbody>";return t.arr.forEach(function(t){e+="<tr>",e+="<td>",e+='<div class="series-table-row-color" style="background-color:'+t.color+'"></div>',e+='<div class="series-table-row-label">'+t.label+"</div>",e+="</td>",e+='<td><div class="series-table-row-value">'+t.value+"</div></td>",e+="</tr>"}),e+="</tbody>",e+="</table>",e;default:return t.series?"<span style='color:"+this.tooltipSeriesColor()+"'>"+t.series+"</span> / <span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":""!==t.label?"<span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":"<span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>"}},_t.prototype.tooltipKeyValueFormat=function(t,e){let i="";for(const n in e)if(n!==t){const t=e&&e[n]?e[n]:"";i+=`<tr><td style="${this.tooltipLabelColor_exists()?"color:"+this.tooltipLabelColor():""}">${n}</td><td style="font-weight:normal">${t}</td></tr>`}return`<table>\n <thead>\n <tr><th colspan="2" style="font-weight:bold;font-size:16px">${e[t]}</th></tr>\n </thead>\n <tbody>\n ${i}\n </tbody>\n </table>`},_t.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{}),_t.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{}),_t.prototype.publish("tooltipLabelFormat",void 0,"string","Format of tooltip label(s) (the domain axis)",null,{}),_t.prototype.publish("tooltipValueFormat",void 0,"string","Number format of tooltip value(s)",null,{}),_t.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{}),_t.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text (the domain axis)",null,{}),_t.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{}),_t.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),_t.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});const xt=_t.prototype.tooltipLabelFormat;_t.prototype.tooltipLabelFormat=function(t){const e=xt.apply(this,arguments);return arguments.length&&(this._labelFormatter=a.format(t)),e};const mt=_t.prototype.tooltipValueFormat;function gt(){}L(gt,"_"),_t.prototype.tooltipValueFormat=function(t){const e=mt.apply(this,arguments);return arguments.length&&(this._valueFormatter=a.format(t)),e},rt(gt,"ITree"),gt.prototype.constructor=gt,gt.prototype.click=function(t,e,i){},gt.prototype.dblclick=function(t,e,i){},gt.prototype._palette=a.Palette.ordinal("default"),function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('.d3-tip{line-height:1;font-weight:700;padding:12px;background:#000000a8;color:#fff;border-radius:2px;pointer-events:none!important;z-index:10}.d3-tip.hidden{visibility:hidden}.d3-tip:after{content:" ";box-sizing:border-box;display:inline-block;border:4px solid rgba(0,0,0,.66);position:absolute;pointer-events:none!important;width:8px;height:8px;margin:0}.d3-tip.n:after{top:100%;left:calc(50% - 4px);border-top-width:8px;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.e:after{top:calc(50% - 4px);left:-12px;border-top-color:transparent;border-right-width:8px;border-bottom-color:transparent;border-left-color:transparent}.d3-tip.s{margin-top:8px}.d3-tip.s:after{top:-12px;left:calc(50% - 4px);border-top-color:transparent;border-right-color:transparent;border-bottom-width:8px;border-left-color:transparent}.d3-tip.w:after{top:calc(50% - 4px);left:100%;border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-width:8px}.d3-tip.notick:after{border-color:transparent!important}.common_Widget .over{stroke:#000000a8;opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table th,.d3-tip .ITooltip-series-table td{padding:6px;text-align:left;border:1px solid #D1D1D1}.d3-tip .ITooltip-series-table .series-table-row-color{display:inline-block;height:10px;width:10px;margin-right:10px}.d3-tip .ITooltip-series-table .series-table-row-label{display:inline-block}.d3-tip .ITooltip-series-table th{background-color:#b3b3b3}.d3-tip .ITooltip-series-table td{background-color:#fff;color:#555;font-weight:400}.d3-tip .ITooltip-series-table td:first-child{border-right:0}table.ITooltip-series-table td:last-child{border-left:1px dotted #A3A3A3}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();var bt=Object.defineProperty,vt=L((t,e)=>bt(t,"name",{value:e,configurable:!0}),"e"),wt=L((t,e,i)=>{return s=i,(o=e+"")in(n=t)?bt(n,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[o]=s;var n,o,s},"i"),St=Math.PI,kt=2*St,At=1e-6,Ct=kt-At;function Mt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Tt(){return new Mt}function Pt(t){return vt(function(){return t},"constant")}L(Mt,"et"),L(Tt,"it"),L(Pt,"nt"),vt(Mt,"Path"),vt(Tt,"path"),Mt.prototype=Tt.prototype={constructor:Mt,moveTo:vt(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:vt(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:vt(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:vt(function(t,e,i,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+n)},"quadraticCurveTo"),bezierCurveTo:vt(function(t,e,i,n,o,s){this._+="C"+ +t+","+ +e+","+ +i+","+ +n+","+(this._x1=+o)+","+(this._y1=+s)},"bezierCurveTo"),arcTo:vt(function(t,e,i,n,o){t=+t,e=+e,i=+i,n=+n,o=+o;var s=this._x1,a=this._y1,r=i-t,l=n-e,h=s-t,c=a-e,u=h*h+c*c;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(u>At)if(Math.abs(c*r-l*h)>At&&o){var p=i-s,d=n-a,f=r*r+l*l,y=p*p+d*d,_=Math.sqrt(f),x=Math.sqrt(u),m=o*Math.tan((St-Math.acos((f+u-y)/(2*_*x)))/2),g=m/x,b=m/_;Math.abs(g-1)>At&&(this._+="L"+(t+g*h)+","+(e+g*c)),this._+="A"+o+","+o+",0,0,"+ +(c*p>h*d)+","+(this._x1=t+b*r)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},"arcTo"),arc:vt(function(t,e,i,n,o,s){t=+t,e=+e,s=!!s;var a=(i=+i)*Math.cos(n),r=i*Math.sin(n),l=t+a,h=e+r,c=1^s,u=s?n-o:o-n;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+l+","+h:(Math.abs(this._x1-l)>At||Math.abs(this._y1-h)>At)&&(this._+="L"+l+","+h),i&&(u<0&&(u=u%kt+kt),u>Ct?this._+="A"+i+","+i+",0,1,"+c+","+(t-a)+","+(e-r)+"A"+i+","+i+",0,1,"+c+","+(this._x1=l)+","+(this._y1=h):u>At&&(this._+="A"+i+","+i+",0,"+ +(u>=St)+","+c+","+(this._x1=t+i*Math.cos(o))+","+(this._y1=e+i*Math.sin(o))))},"arc"),rect:vt(function(t,e,i,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},"rect"),toString:vt(function(){return this._},"toString")},vt(Pt,"constant$3");var It=Math.abs,Et=Math.atan2,Ft=Math.cos,Dt=Math.max,zt=Math.min,Rt=Math.sin,Ot=Math.sqrt,jt=1e-12,Lt=Math.PI,Nt=Lt/2,Bt=2*Lt;function Vt(t){return t>1?0:t<-1?Lt:Math.acos(t)}function Ht(t){return t>=1?Nt:t<=-1?-Nt:Math.asin(t)}function Wt(t){return t.innerRadius}function $t(t){return t.outerRadius}function qt(t){return t.startAngle}function Gt(t){return t.endAngle}function Ut(t){return t&&t.padAngle}function Xt(t,e,i,n,o,s,a,r){var l=i-t,h=n-e,c=a-o,u=r-s,p=u*l-c*h;if(!(p*p<jt))return[t+(p=(c*(e-s)-u*(t-o))/p)*l,e+p*h]}function Yt(t,e,i,n,o,s,a){var r=t-i,l=e-n,h=(a?s:-s)/Ot(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-s,w=p*y-f*d,S=(g<0?-1:1)*Ot(Dt(0,v*v*b-w*w)),k=(w*g-m*S)/b,A=(-w*m-g*S)/b,C=(w*g+m*S)/b,M=(-w*m+g*S)/b,T=k-_,P=A-x,I=C-_,E=M-x;return T*T+P*P>I*I+E*E&&(k=C,A=M),{cx:k,cy:A,x01:-c,y01:-u,x11:k*(o/v-1),y11:A*(o/v-1)}}function Qt(){var t=Wt,e=$t,i=Pt(0),n=null,o=qt,s=Gt,a=Ut,r=null;function l(){var l,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),p=o.apply(this,arguments)-Nt,d=s.apply(this,arguments)-Nt,f=It(d-p),y=d>p;if(r||(r=l=Tt()),u<c&&(h=u,u=c,c=h),u>jt)if(f>Bt-jt)r.moveTo(u*Ft(p),u*Rt(p)),r.arc(0,0,u,p,d,!y),c>jt&&(r.moveTo(c*Ft(d),c*Rt(d)),r.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,k=a.apply(this,arguments)/2,A=k>jt&&(n?+n.apply(this,arguments):Ot(c*c+u*u)),C=zt(It(u-c)/2,+i.apply(this,arguments)),M=C,T=C;if(A>jt){var P=Ht(A/c*Rt(k)),I=Ht(A/u*Rt(k));(w-=2*P)>jt?(b+=P*=y?1:-1,v-=P):(w=0,b=v=(p+d)/2),(S-=2*I)>jt?(m+=I*=y?1:-1,g-=I):(S=0,m=g=(p+d)/2)}var E=u*Ft(m),F=u*Rt(m),D=c*Ft(v),z=c*Rt(v);if(C>jt){var R,O=u*Ft(g),j=u*Rt(g),L=c*Ft(b),N=c*Rt(b);if(f<Lt&&(R=Xt(E,F,L,N,O,j,D,z))){var B=E-R[0],V=F-R[1],H=O-R[0],W=j-R[1],$=1/Rt(Vt((B*H+V*W)/(Ot(B*B+V*V)*Ot(H*H+W*W)))/2),q=Ot(R[0]*R[0]+R[1]*R[1]);M=zt(C,(c-q)/($-1)),T=zt(C,(u-q)/($+1))}}S>jt?T>jt?(_=Yt(L,N,E,F,u,T,y),x=Yt(O,j,D,z,u,T,y),r.moveTo(_.cx+_.x01,_.cy+_.y01),T<C?r.arc(_.cx,_.cy,T,Et(_.y01,_.x01),Et(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,T,Et(_.y01,_.x01),Et(_.y11,_.x11),!y),r.arc(0,0,u,Et(_.cy+_.y11,_.cx+_.x11),Et(x.cy+x.y11,x.cx+x.x11),!y),r.arc(x.cx,x.cy,T,Et(x.y11,x.x11),Et(x.y01,x.x01),!y))):(r.moveTo(E,F),r.arc(0,0,u,m,g,!y)):r.moveTo(E,F),c>jt&&w>jt?M>jt?(_=Yt(D,z,O,j,c,-M,y),x=Yt(E,F,L,N,c,-M,y),r.lineTo(_.cx+_.x01,_.cy+_.y01),M<C?r.arc(_.cx,_.cy,M,Et(_.y01,_.x01),Et(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,M,Et(_.y01,_.x01),Et(_.y11,_.x11),!y),r.arc(0,0,c,Et(_.cy+_.y11,_.cx+_.x11),Et(x.cy+x.y11,x.cx+x.x11),y),r.arc(x.cx,x.cy,M,Et(x.y11,x.x11),Et(x.y01,x.x01),!y))):r.arc(0,0,c,v,b,y):r.lineTo(D,z)}else r.moveTo(0,0);if(r.closePath(),l)return r=null,l+""||null}return L(l,"h"),vt(l,"arc"),l.centroid=function(){var i=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-Lt/2;return[Ft(n)*i,Rt(n)*i]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Pt(+t),l):e},l.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:Pt(+t),l):i},l.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Pt(+t),l):n},l.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:Pt(+t),l):o},l.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:Pt(+t),l):s},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Pt(+t),l):a},l.context=function(t){return arguments.length?(r=null==t?null:t,l):r},l}function Zt(t){this._context=t}function Jt(t){return new Zt(t)}function Kt(t){return t[0]}function te(t){return t[1]}function ee(){var t=Kt,e=te,i=Pt(!0),n=null,o=Jt,s=null;function a(a){var r,l,h,c=a.length,u=!1;for(null==n&&(s=o(h=Tt())),r=0;r<=c;++r)!(r<c&&i(l=a[r],r,a))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+t(l,r,a),+e(l,r,a));if(h)return s=null,h+""||null}return L(a,"r"),vt(a,"line"),a.x=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:Pt(+t),a):e},a.defined=function(t){return arguments.length?(i="function"==typeof t?t:Pt(!!t),a):i},a.curve=function(t){return arguments.length?(o=t,null!=n&&(s=o(n)),a):o},a.context=function(t){return arguments.length?(null==t?n=s=null:s=o(n=t),a):n},a}function ie(){var t=Kt,e=null,i=Pt(0),n=te,o=Pt(!0),s=null,a=Jt,r=null;function l(l){var h,c,u,p,d,f=l.length,y=!1,_=new Array(f),x=new Array(f);for(null==s&&(r=a(d=Tt())),h=0;h<=f;++h){if(!(h<f&&o(p=l[h],h,l))===y)if(y=!y)c=h,r.areaStart(),r.lineStart();else{for(r.lineEnd(),r.lineStart(),u=h-1;u>=c;--u)r.point(_[u],x[u]);r.lineEnd(),r.areaEnd()}y&&(_[h]=+t(p,h,l),x[h]=+i(p,h,l),r.point(e?+e(p,h,l):_[h],n?+n(p,h,l):x[h]))}if(d)return r=null,d+""||null}function h(){return ee().defined(o).curve(a).context(s)}return L(l,"h"),L(h,"c"),vt(l,"area"),vt(h,"arealine"),l.x=function(i){return arguments.length?(t="function"==typeof i?i:Pt(+i),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:Pt(+t),l):e},l.y=function(t){return arguments.length?(i="function"==typeof t?t:Pt(+t),n=null,l):i},l.y0=function(t){return arguments.length?(i="function"==typeof t?t:Pt(+t),l):i},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Pt(+t),l):n},l.lineX0=l.lineY0=function(){return h().x(t).y(i)},l.lineY1=function(){return h().x(t).y(n)},l.lineX1=function(){return h().x(e).y(i)},l.defined=function(t){return arguments.length?(o="function"==typeof t?t:Pt(!!t),l):o},l.curve=function(t){return arguments.length?(a=t,null!=s&&(r=a(s)),l):a},l.context=function(t){return arguments.length?(null==t?s=r=null:r=a(s=t),l):s},l}function ne(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function oe(t){return t}function se(){var t=oe,e=ne,i=null,n=Pt(0),o=Pt(Bt),s=Pt(0);function a(a){var r,l,h,c,u,p=a.length,d=0,f=new Array(p),y=new Array(p),_=+n.apply(this,arguments),x=Math.min(Bt,Math.max(-Bt,o.apply(this,arguments)-_)),m=Math.min(Math.abs(x)/p,s.apply(this,arguments)),g=m*(x<0?-1:1);for(r=0;r<p;++r)(u=y[f[r]=r]=+t(a[r],r,a))>0&&(d+=u);for(null!=e?f.sort(function(t,i){return e(y[t],y[i])}):null!=i&&f.sort(function(t,e){return i(a[t],a[e])}),r=0,h=d?(x-p*g)/d:0;r<p;++r,_=c)l=f[r],c=_+((u=y[l])>0?u*h:0)+g,y[l]={data:a[l],index:r,value:u,startAngle:_,endAngle:c,padAngle:m};return y}return L(a,"r"),vt(a,"pie"),a.value=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,i=null,a):e},a.sort=function(t){return arguments.length?(i=t,e=null,a):i},a.startAngle=function(t){return arguments.length?(n="function"==typeof t?t:Pt(+t),a):n},a.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Pt(+t),a):o},a.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Pt(+t),a):s},a}function ae(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function re(t){this._context=t}function le(t){return new re(t)}function he(t,e){this._basis=new re(t),this._beta=e}L(Vt,"yt"),L(Ht,"_t"),L(Wt,"xt"),L($t,"mt"),L(qt,"gt"),L(Gt,"bt"),L(Ut,"vt"),L(Xt,"wt"),L(Yt,"St"),L(Qt,"At"),L(Zt,"kt"),L(Jt,"Mt"),L(Kt,"Pt"),L(te,"Tt"),L(ee,"Ct"),L(ie,"zt"),L(ne,"Ft"),L(oe,"It"),L(se,"Et"),L(ae,"Ot"),L(re,"Rt"),L(le,"Dt"),L(he,"jt"),vt(Vt,"acos"),vt(Ht,"asin$1"),vt(Wt,"arcInnerRadius$1"),vt($t,"arcOuterRadius$1"),vt(qt,"arcStartAngle$1"),vt(Gt,"arcEndAngle$1"),vt(Ut,"arcPadAngle$1"),vt(Xt,"intersect$1"),vt(Yt,"cornerTangents$1"),vt(Qt,"d3Arc"),vt(Zt,"Linear$1"),Zt.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},vt(Jt,"d3CurveLinear"),vt(Kt,"x$1"),vt(te,"y$1"),vt(ee,"d3Line"),vt(ie,"d3Area"),vt(ne,"descending"),vt(oe,"identity$2"),vt(se,"d3Pie"),vt(ae,"point$7"),vt(re,"Basis$1"),re.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 3:ae(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ae(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},vt(le,"d3CurveBasis"),vt(he,"Bundle$1"),he.prototype={lineStart:vt(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:vt(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],s=e[0],a=t[i]-o,r=e[i]-s,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*a),this._beta*e[l]+(1-this._beta)*(s+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:vt(function(t,e){this._x.push(+t),this._y.push(+e)},"point")};const ce=vt(L(function t(e){function i(t){return 1===e?new re(t):new he(t,e)}return L(i,"n"),vt(i,"bundle"),i.beta=function(e){return t(+e)},i},"t"),"custom")(.85);function ue(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function pe(t,e){this._context=t,this._k=(1-e)/6}L(ue,"Lt"),L(pe,"Bt"),vt(ue,"point$6"),vt(pe,"Cardinal$1"),pe.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ue(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ue(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const de=vt(L(function t(e){function i(t){return new pe(t,e)}return L(i,"n"),vt(i,"cardinal"),i.tension=function(e){return t(+e)},i},"t"),"custom")(0);function fe(t,e,i){var n=t._x1,o=t._y1,s=t._x2,a=t._y2;if(t._l01_a>jt){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>jt){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*h+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,s,a,t._x2,t._y2)}function ye(t,e){this._context=t,this._alpha=e}L(fe,"Ht"),L(ye,"qt"),vt(fe,"point$5"),vt(ye,"CatmullRom$1"),ye.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:fe(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const _e=vt(L(function t(e){function i(t){return e?new ye(t,e):new pe(t,0)}return L(i,"n"),vt(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"t"),"custom")(.5);function xe(t){return t<0?-1:1}function me(t,e,i){var n=t._x1-t._x0,o=e-t._x1,s=(t._y1-t._y0)/(n||o<0&&-0),a=(i-t._y1)/(o||n<0&&-0),r=(s*o+a*n)/(n+o);return(xe(s)+xe(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(r))||0}function ge(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function be(t,e,i){var n=t._x0,o=t._y0,s=t._x1,a=t._y1,r=(s-n)/3;t._context.bezierCurveTo(n+r,o+r*e,s-r,a-r*i,s,a)}function ve(t){this._context=t}function we(t){return new ve(t)}function Se(t){this._context=t}function ke(t){var e,i,n=t.length-1,o=new Array(n),s=new Array(n),a=new Array(n);for(o[0]=0,s[0]=2,a[0]=t[0]+2*t[1],e=1;e<n-1;++e)o[e]=1,s[e]=4,a[e]=4*t[e]+2*t[e+1];for(o[n-1]=2,s[n-1]=7,a[n-1]=8*t[n-1]+t[n],e=1;e<n;++e)i=o[e]/s[e-1],s[e]-=i,a[e]-=i*a[e-1];for(o[n-1]=a[n-1]/s[n-1],e=n-2;e>=0;--e)o[e]=(a[e]-o[e+1])/s[e];for(s[n-1]=(t[n]+o[n-1])/2,e=0;e<n-1;++e)s[e]=2*t[e+1]-o[e+1];return[o,s]}function Ae(t){return new Se(t)}function Ce(t,e){this._context=t,this._t=e}function Me(t){return new Ce(t,.5)}function Te(t){return new Ce(t,0)}function Pe(t){return new Ce(t,1)}L(xe,"Wt"),L(me,"Gt"),L(ge,"Xt"),L(be,"Yt"),L(ve,"Ut"),L(we,"Qt"),L(Se,"Zt"),L(ke,"Jt"),L(Ae,"Kt"),L(Ce,"te"),L(Me,"ee"),L(Te,"ie"),L(Pe,"ne"),vt(xe,"sign$1"),vt(me,"slope3$1"),vt(ge,"slope2$1"),vt(be,"point$4"),vt(ve,"MonotoneX$1"),ve.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:be(this,this._t0,ge(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,be(this,ge(this,i=me(this,t,e)),i);break;default:be(this,this._t0,i=me(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(ve.prototype).point=function(t,e){ve.prototype.point.call(this,e,t)},vt(we,"monotoneX"),vt(Se,"Natural"),Se.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x=[],this._y=[]},"lineStart"),lineEnd:vt(function(){var t=this._x,e=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===i)this._context.lineTo(t[1],e[1]);else for(var n=ke(t),o=ke(e),s=0,a=1;a<i;++s,++a)this._context.bezierCurveTo(n[0][s],o[0][s],n[1][s],o[1][s],t[a],e[a]);(this._line||0!==this._line&&1===i)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},"lineEnd"),point:vt(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},vt(ke,"controlPoints"),vt(Ae,"d3CurveNatural"),vt(Ce,"Step$1"),Ce.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x=this._y=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,e)}}this._x=t,this._y=e},"point")},vt(Me,"d3CurveStep"),vt(Te,"stepBefore"),vt(Pe,"stepAfter");var Ie=Array.prototype.slice;function Ee(t){return t}L(Ee,"se"),vt(Ee,"identity$1");var Fe=1e-6;function De(t){return"translate("+(t+.5)+",0)"}function ze(t){return"translate(0,"+(t+.5)+")"}function Re(t){return function(e){return+t(e)}}function Oe(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(i){return+t(i)+e}}function je(){return!this.__axis}function Le(t,e){var i=[],n=null,o=null,s=6,a=6,r=3,l=1===t||4===t?-1:1,h=4===t||2===t?"x":"y",c=1===t||3===t?De:ze;function u(u){var p=null==n?e.ticks?e.ticks.apply(e,i):e.domain():n,d=null==o?e.tickFormat?e.tickFormat.apply(e,i):Ee:o,f=Math.max(s,0)+r,y=e.range(),_=+y[0]+.5,x=+y[y.length-1]+.5,m=(e.bandwidth?Oe:Re)(e.copy()),g=u.selection?u.selection():u,b=g.selectAll(".domain").data([null]),v=g.selectAll(".tick").data(p,e).order(),w=v.exit(),S=v.enter().append("g").attr("class","tick"),k=v.select("line"),A=v.select("text");b=b.merge(b.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),v=v.merge(S),k=k.merge(S.append("line").attr("stroke","currentColor").attr(h+"2",l*s)),A=A.merge(S.append("text").attr("fill","currentColor").attr(h,l*f).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),u!==g&&(b=b.transition(u),v=v.transition(u),k=k.transition(u),A=A.transition(u),w=w.transition(u).attr("opacity",Fe).attr("transform",function(t){return isFinite(t=m(t))?c(t):this.getAttribute("transform")}),S.attr("opacity",Fe).attr("transform",function(t){var e=this.parentNode.__axis;return c(e&&isFinite(e=e(t))?e:m(t))})),w.remove(),b.attr("d",4===t||2==t?a?"M"+l*a+","+_+"H0.5V"+x+"H"+l*a:"M0.5,"+_+"V"+x:a?"M"+_+","+l*a+"V0.5H"+x+"V"+l*a:"M"+_+",0.5H"+x),v.attr("opacity",1).attr("transform",function(t){return c(m(t))}),k.attr(h+"2",l*s),A.attr(h,l*f).text(d),g.filter(je).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),g.each(function(){this.__axis=m})}return L(u,"p"),vt(u,"axis"),u.scale=function(t){return arguments.length?(e=t,u):e},u.ticks=function(){return i=Ie.call(arguments),u},u.tickArguments=function(t){return arguments.length?(i=null==t?[]:Ie.call(t),u):i.slice()},u.tickValues=function(t){return arguments.length?(n=null==t?null:Ie.call(t),u):n&&n.slice()},u.tickFormat=function(t){return arguments.length?(o=t,u):o},u.tickSize=function(t){return arguments.length?(s=a=+t,u):s},u.tickSizeInner=function(t){return arguments.length?(s=+t,u):s},u.tickSizeOuter=function(t){return arguments.length?(a=+t,u):a},u.tickPadding=function(t){return arguments.length?(r=+t,u):r},u}function Ne(t){return Le(1,t)}function Be(t){return Le(2,t)}function Ve(t){return Le(3,t)}function He(t){return Le(4,t)}L(De,"re"),L(ze,"le"),L(Re,"he"),L(Oe,"ce"),L(je,"ue"),L(Le,"pe"),L(Ne,"de"),L(Be,"fe"),L(Ve,"ye"),L(He,"_e"),vt(De,"translateX"),vt(ze,"translateY"),vt(Re,"number"),vt(Oe,"center"),vt(je,"entering"),vt(Le,"axis"),vt(Ne,"axisTop"),vt(Be,"axisRight"),vt(Ve,"axisBottom"),vt(He,"axisLeft");const We=(u=class extends a.SVGWidget{_origType;_origTimePattern;parser;parserInvert;formatter;d3Scale;d3Axis;d3Guides;_guideElement;svg;svgAxis;svgGuides;_tickFormatFunc;constructor(t="origin"){super(),this._drawStartPos=t,this.updateScale()}lowValue(){return this.parse(this.low())}highValue(){return this.parse(this.high())}parse(t,e){if(t instanceof Array)return t.map(function(t){return this.parse(t)},this);if(null!=t){if(this.parser)return this.parser("number"==typeof t?t.toString():t);if(e&&"string"==typeof t)return+t}return t}parseInvert(t){return t instanceof Array?t.map(function(t){return this.parseInvert(t)},this):this.parserInvert&&t?this.parserInvert(t):t}format(t){return t instanceof Array?t.map(function(t){return this.format(t)},this):null!=t&&this.formatter?this.formatter(t):t}parseFormat(t){return this.format(this.parse(t))}tickFormatFunc(t){return arguments.length?(this._tickFormatFunc=t,this.updateScale(),this):this._tickFormatFunc}scalePos(t){let e=this.d3Scale(this.parse(t));return"ordinal"===this.type()&&(e+=this.bandwidth()/2),e}bandwidth(){return this.d3Scale.bandwidth?this.d3Scale.bandwidth():0}isHorizontal(){switch(this.orientation()){case"left":case"right":return!1}return!0}domain(t){return arguments.length?(this.d3Scale.domain(t),this):this.d3Scale.domain()}range(t){if(!arguments.length){if(this.d3Scale.rangeRoundBands)return this.d3Scale.rangeExtent();if(this.d3Scale.rangeRound)return this.d3Scale.range()}return this.d3Scale.rangeRoundBands?this.d3Scale.rangeRoundBands(t,.1):this.d3Scale.rangeRound&&this.d3Scale.range(t),this}invert(t){return this.d3Scale.invert(t)}guideTarget(t){return this._guideElement=a.select(t).attr("class",this._class),this}enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgAxis=this.svg.append("g").attr("class","axis"),this.svgGuides=(this._guideElement||e).append("g").attr("class","guide")}_prevOrientation;updateScale(){switch(this.type()){case"ordinal":if(this.d3Scale=a.scaleBand().paddingInner(this.ordinalPaddingInner()).paddingOuter(this.ordinalPaddingOuter()),this.ordinals_exists()&&this.d3Scale.domain(this.ordinals()),this.parser=null,this.ordinalMappings_exists()){const t=this.ordinalMappings();this.formatter=e=>t[e]||e}else this.formatter=null;break;case"linear":this.d3Scale=a.scaleLinear(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?a.format(this.tickFormat()):null;break;case"pow":this.d3Scale=a.scalePow().exponent(this.powExponent()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?a.format(this.tickFormat()):null;break;case"log":this.d3Scale=a.scaleLog().base(this.logBase()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?a.format(this.tickFormat()):null;break;case"time":this.d3Scale=a.scaleTime(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=this.timePattern_exists()?a.timeParse(this.timePattern()):null,this.parserInvert=this.timePattern_exists()?a.timeFormat(this.timePattern()):null,this._tickFormatFunc?this.formatter=this._tickFormatFunc:this.formatter=this.tickFormat_exists()?a.timeFormat(this.tickFormat()):null}if(this._prevOrientation!==this.orientation()){switch(this.orientation()){case"left":this.d3Axis=He(this.d3Scale),this.d3Guides=He(this.d3Scale);break;case"top":this.d3Axis=Ne(this.d3Scale),this.d3Guides=Ne(this.d3Scale);break;case"right":this.d3Axis=Be(this.d3Scale),this.d3Guides=Be(this.d3Scale);break;default:this.d3Axis=Ve(this.d3Scale),this.d3Guides=Ve(this.d3Scale)}this._prevOrientation=this.orientation(),this.svgAxis&&this.svgAxis.html(""),this.svgGuides&&this.svgGuides.html("")}if(this.extend())if("ordinal"===this.type());else{let t,e,i,n,o,s;this.isHorizontal()?(t=this.width(),this.d3Scale.range([0,t]),e=t*this.extend()/100,i=this.d3Scale.invert(0),o=this.d3Scale.invert(-e),n=this.d3Scale.invert(t),s=this.d3Scale.invert(t+e)):(t=this.height(),this.d3Scale.range([t,0]),e=t*this.extend()/100,i=this.d3Scale.invert(t),o=this.d3Scale.invert(t+e),n=this.d3Scale.invert(0),s=this.d3Scale.invert(-e)),o===i&&(o=i-i*this.extend()/100),s===n&&(s=n+n*this.extend()/100),Math.sign(i)!==Math.sign(o)&&(o=0),Math.sign(n)!==Math.sign(s)&&(s=0),this.d3Scale.domain([o,s])}this.d3Axis.scale(this.d3Scale).tickFormat(this.formatter).ticks(this.tickCount()),this.d3Guides.scale(this.d3Scale).tickSize(this.tickLength_exists()?-this.tickLength():0).tickFormat("").ticks(this.tickCount());const t=this.ticks();return t.length&&(this.d3Axis.tickValues(t.map(t=>this.parse(t.value))).tickFormat((e,i)=>t[i].label),this.d3Guides.tickValues(t.map(t=>this.parse(t.value)))),this}adjustText(t,e){const i=this.isHorizontal(),n="left"===this.orientation(),o="bottom"===this.orientation(),s=this,r=t.selectAll(".tick > text").style("font-family",this.fontFamily()).style("font-size",this.fontSize_exists()?this.fontSize()+"px":null);if("linebreak"===this.overlapMode())"ordinal"===this.type()&&r.call(function(){return s.linebreak.apply(s,arguments)},this.bandwidth());else if("wrap"===this.overlapMode())"ordinal"===this.type()&&r.call(function(){return s.wrap.apply(s,arguments)},this.bandwidth());else switch(i?this.overlapMode():"none"){case"stagger":r.style("text-anchor","middle").attr("dy",function(t,i){return(o?1:-1)*((o?.71:0)+i%e)+"em"}).attr("dx",0).attr("visibility",null).attr("transform","rotate(0)");break;case"hide":r.style("text-anchor","middle").attr("dy",(o?.71:0)+"em").attr("dx",0).attr("visibility",function(t,i){return i%e?"hidden":null}).attr("transform","rotate(0)");break;case"rotate":const t=-this.labelRotation()||0;if(0!==t&&e>1){r.each(function(){const e=a.select(this),i=e.node().getBBox(),n=(o?1:-1)*Math.sin(Math.PI*(-Math.abs(t)/180));e.style("text-anchor",t>0?o?"start":"end":o?"end":"start").attr("dy",i.height/2*n+"px").attr("dx",t>0?o?"0.71em":"-0.71em":o?"-0.71em":"0.71em").attr("transform","rotate("+t+")").attr("visibility",null)});break}default:r.style("text-anchor",i?"middle":n?"end":"start").attr("dy",i?(o?.71:0)+"em":"0.32em").attr("dx",0).attr("visibility",null).attr("transform","rotate(0)")}}calcTickOverlapModulus(t){let e=1;switch(this.overlapMode()){case"rotate":case"stagger":case"hide":const i=[];t.selectAll(".tick > text").each(function(){const t=this.getBoundingClientRect();for(let n=i.length-1;n>=0&&!(i[n].right<t.left);--n)i.length+1-n>e&&(e=i.length+1-n);i.push(t)})}return e}calcOverflow(t,e){if(this.updateScale(),this.hidden())return{left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:1};const i=this.isHorizontal();this.range(i?[0,this.width()]:[this.height(),0]);const n=t.append("g").attr("class",this.classID()),o=n.append("g");o.attr("class",i?"x":"y").call(this.d3Axis),e&&t.selectAll(".tick > text").remove();const s={left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:this.calcTickOverlapModulus(o)};this.adjustText(o,s.tickOverlapModulus);const a=o.node().getBBox();switch(s.depth=i?a.height:a.width,this.shrinkToFit()){case"low":case"both":s.left=i?-a.x:0,s.bottom=i?0:-(this.height()-(a.height+a.y))}switch(this.shrinkToFit()){case"high":case"both":s.top=i?0:-a.y,s.right=i?-(this.width()-a.x-a.width):0}return n.remove(),s}wrap(t,e,i){i=i||/\s+/;const n=this;t.each(function(){const t=a.select(this),o=t.text().split(i).reverse();let s=[],r=0;const l=t.attr("x"),h=t.attr("y"),c=parseFloat(t.style("font-size"))||10,u=Math.floor(e/(1.1*c))-1,p=n.isHorizontal()?1:Math.ceil(o.length/u),d=parseFloat(t.attr("dy"));let f=t.text(null).append("tspan").attr("x",l).attr("y",h).attr("dy",d+"em"),y=0,_=o.pop();for(;_;)s.push(_),f.text(s.join(" ")),y++,f.node().getComputedTextLength()>e&&y>=p&&(s.pop(),f.text(s.join(" ")),s=[_],f=t.append("tspan").attr("x",l).attr("y",h).attr("dy",1.1*++r+d+"em").text(_),y=0),_=o.pop();n.isHorizontal()||t.selectAll("tspan").attr("y",-r/2+"em")})}linebreak(t,e){this.wrap(t,e,"\n")}update(t,e){super.update(t,e),this.svg.style("display",this.hidden()?"none":null);const i=this.calcOverflow(e),n=this.isHorizontal()?i.left:this.height()-i.top-i.bottom,o=this.isHorizontal()?this.width()-i.right-this.padding():0+this.padding();this.range(this.reverse()?[o,n]:[n,o]);const s=this;function a(t){t.attr("transform",function(){switch(s.orientation()){case"left":return"translate("+i.depth+", "+i.top+")";case"top":return"translate(0,"+i.depth+")";case"right":return"translate("+(s.width()-i.depth)+", "+i.top+")";case"bottom":return"translate(0,"+(s.height()-i.depth)+")"}return"translate(0,0)"})}L(a,"r"),vt(a,"doPosition"),this.svg.style("visibility","none"===this.type()?"hidden":null).transition().call(a),this._guideElement&&this.svgGuides.transition().call(a),this.svgAxis.call(this.d3Axis),this.adjustText(this.svgAxis,i.tickOverlapModulus),this.pos().x;const r=this.width(),l=this.svgAxis.selectAll(".axisTitle").data(this.title()?[this.title()]:[]),h=l.enter().append("text").attr("class","axisTitle").merge(l).transition().attr("dx",null).style("text-anchor","end");switch(this.orientation()){case"left":h.attr("transform","rotate(-90)").attr("x",-2).attr("y",2).attr("dy",".71em");break;case"right":h.attr("transform","rotate(-90)").attr("x",-2).attr("y",4).attr("dx",null).attr("dy","-.71em");break;case"top":h.attr("transform","rotate(0)").attr("x",r-2).attr("y",2).attr("dx",null).attr("dy",".71em");break;case"bottom":h.attr("transform","rotate(0)").attr("x",r-2).attr("y",-2).attr("dy",null)}h.text(this.title_exists()?this.title():""),l.exit().remove(),this.svgGuides.call(this.d3Guides).selectAll(".tick").classed("guide-0",t=>0===t&&this.low()<0)}rerender(){this.svgAxis.call(this.d3Axis),this.svgGuides.call(this.d3Guides)}postUpdate(t,e){super.postUpdate(t,e),this._guideElement&&this._guideElement.attr("transform",this._element.attr("transform"))}},L(u,"_Axis"),u);vt(We,"Axis");let $e=We;$e.prototype._class+=" chart_Axis",$e.prototype.publish("type","linear","set","Type",["none","ordinal","linear","pow","log","time"]),$e.prototype.publish("timePattern","%Y-%m-%d","string","Time Series Pattern",null,{disable:vt(t=>"time"!==t.type(),"disable")}),$e.prototype.publish("reverse",!1,"boolean","Reverse"),$e.prototype.publish("title",null,"string","Title"),$e.prototype.publish("orientation","bottom","set","Placement/orientation of the axis",["left","top","right","bottom"]),$e.prototype.publish("powExponent",2,"number","Power exponent (disabled when type is not 'pow')",null,{disable:vt(t=>"pow"!==t.type(),"disable")}),$e.prototype.publish("logBase",10,"number","Logarithmic base (disabled when type is not 'log')",null,{disable:vt(t=>"log"!==t.type(),"disable")}),$e.prototype.publish("ordinals",[],"array","Array of ordinal values to display (disabled when type is not 'ordinal')",null,{disable:vt(t=>"ordinal"!==t.type(),"disable")}),$e.prototype.publish("fontSize",null,"number","Size of tick label font (pixels)",null,{optional:!0}),$e.prototype.publish("fontFamily",null,"string","Font family of tick labels",null,{optional:!0}),$e.prototype.publish("tickCount",null,"number","Number of ticks to display (disabled when type is 'ordinal')",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("tickFormat",null,"string","Format rules for tick text (disabled when type is 'ordinal')",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("tickLength",null,"number","Height (or width for left/right orientations) of the axis ticks (in pixels)",null,{optional:!0}),$e.prototype.publish("ticks",[],"array","Custom tick labels",null,{optional:!0}),$e.prototype.publish("low",null,"any","Minimum tick value (disabled when type is ordinal)",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("high",null,"any","Maximum tick value (disabled when type is ordinal)",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("overlapMode","none","set","Specifies the behavior when tick labels overlap",["none","stagger","hide","rotate","linebreak","wrap"]),$e.prototype.publish("labelRotation",33,"number","Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')",null,{optional:!0,disable:vt(t=>"rotate"!==t.overlapMode(),"disable")}),$e.prototype.publish("shrinkToFit","both","set","shrinkToFit",["none","low","high","both"]),$e.prototype.publish("extend",5,"number","Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("hidden",!1,"boolean","Hides axis when 'true'"),$e.prototype.publish("ordinalPaddingInner",.1,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)",null,{disable:vt(t=>"ordinal"!==t.type(),"disable")}),$e.prototype.publish("ordinalPaddingOuter",.1,"number","Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)",null,{disable:vt(t=>"ordinal"!==t.type(),"disable")}),$e.prototype.publish("ordinalMappings",null,"object","Alternative label mappings (icons)",null,{optional:!0}),$e.prototype.publish("padding",0,"number","Padding space at top of axis (pixels)",null,{optional:!0}),$e.prototype._origType=$e.prototype.type,$e.prototype.type=function(t){const e=$e.prototype._origType.apply(this,arguments);return void 0!==t&&(this._type=t,this.updateScale()),e},$e.prototype._origTimePattern=$e.prototype.timePattern,$e.prototype.timePattern=function(t){const e=$e.prototype._origTimePattern.apply(this,arguments);return void 0!==t&&(this._timePattern=t,this.updateScale()),e};const qe=(p=class extends a.SVGWidget{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),a.Utility.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.domainAxis=(new $e).classed({domain:!0}).orientation_default("bottom").type("ordinal").overlapMode_default("stagger").shrinkToFit_default("high").extend_default(0),this.valueAxis=(new $e).classed({value:!0}).orientation_default("left").type("linear").shrinkToFit_default("high"),this.xyBrush=a.brush().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.xBrush=a.brushX().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.yBrush=a.brushY().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2())}_prevBrush;resetSelection(){return this._prevBrush=null,this}parseData(t){return this.domainAxis.parse(t)}parseValue(t){return this.valueAxis.parse(t,!0)}formatData(t){return this.domainAxis.format(t)}formatValue(t){return this.valueAxis.format(t)}parsedData(){return this.data().map(function(t){let e=0;return t.map(function(t,i){if(0===i)return this.parseData(t);if(i>=this.columns().length)return t;const n=this.yAxisStacked()?[e,e+this.parseValue(t)]:this.parseValue(t);return e+=this.parseValue(t),n},this)},this)}bandwidth(){return this.domainAxis.bandwidth()}svg;svgRegions;svgDomainGuide;svgValueGuide;svgData;svgDataClipRect;svgFocus;svgBrush;enter(t,e){super.enter(t,e),this.svg=e.append("g"),this.svgRegions=e.append("g"),this.svgDomainGuide=this.svg.append("g"),this.svgValueGuide=this.svg.append("g"),this.svgData=this.svg.append("g"),this.svgDataClipRect=this.svg.append("clipPath").attr("id",this.id()+"_clippath").append("rect").attr("x",0).attr("y",0),this.svgData=this.svg.append("g").attr("clip-path","url(#"+this.id()+"_clippath)"),this._selection.widgetElement(this.svgData),this.svgFocus=e.append("g"),this.domainAxis.target(this.svg.node()).guideTarget(this.svgDomainGuide.node()),this.valueAxis.target(this.svg.node()).guideTarget(this.svgValueGuide.node()),this.svgBrush=e.append("g").attr("class","brush"),this.chartsEnter(this,this.svgData,250)}resizeBrushHandle(t,e,i){let n,o,s;return"e"===t.type||"w"===t.type?(n=+("e"===t.type),o=n?1:-1,s=i/3,"M"+.5*o+","+s+"A6,6 0 0 "+n+" "+6.5*o+","+(s+6)+"V"+(2*s-6)+"A6,6 0 0 "+n+" "+.5*o+","+2*s+"ZM"+2.5*o+","+(s+8)+"V"+(2*s-8)+"M"+4.5*o+","+(s+8)+"V"+(2*s-8)):(n=+("s"===t.type),s=n?1:-1,o=e/3,"M"+o+", "+.5*s+"A6,6 0 0 "+(n+1)%2+" "+(o+6)+","+6.5*s+"H"+(2*o-6)+"A6,6 0 0 "+(n+1)%2+" "+2*o+","+.5*s+"ZM"+(o+8)+","+2.5*s+"H"+(2*o-8)+"M"+(o+8)+","+4.5*s+"H"+(2*o-8))}_skipSelection=!1;skipSelection(t){return arguments.length?(this._skipSelection=t,this):this._skipSelection}brushMoved(){if(this._skipSelection)return;let t=[];const e=this,i=a.brushSelection(this.svgBrush.node());i&&(t=this.data().filter(function(t){const n=e.dataPos(t[0]);if(e.use2dSelection()){const o=e.valuePos(t[1])+e.valueAxis.bandwidth()/2;return n>=i[0][0]&&n<=i[1][0]&&o>=i[0][1]&&o<=i[1][1]}return n>=i[0]&&n<=i[1]})),this.selection(t)}brushMoved2(){const t="horizontal"===this.orientation(),e=this.use2dSelection()?[]:t?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],i=this.svgBrush.selectAll(".handle--custom").data(e),n=a.d3Event()?.selection;null==n?i.attr("display","none"):t?i.attr("display",null).attr("transform",(t,e)=>"translate("+n[e]+",0)"):i.attr("display",null).attr("transform",(t,e)=>"translate(0, "+n[e]+")")}dataPos(t){return this.domainAxis.scalePos(t)}valuePos(t){return this.valueAxis.scalePos(t)}getAxisSize(t){return{width:this.xAxis?this.xAxis.width():t.xAxis.width(),height:this.yAxis?this.yAxis.height():t.yAxis.width()}}calcMargin(t,e,i){const n={top:!i&&this.selectionMode()?10:2,right:i&&(this.selectionMode()||this.xAxisFocus())?10:2,bottom:(this.xAxisFocus()?this.xAxisFocusHeight():0)+2,left:2},o=this.width()-n.left-n.right,s=this.height()-n.top-n.bottom;let a=0,r=30,l=0,h=30;for(let c=0;c<10;++c){this.xAxis.width(o-h).height(0);const t=this.xAxis.calcOverflow(e),i=t.depth;this.yAxis.width(0).height(s-r);const n=this.yAxis.calcOverflow(e),c=n.depth;if(a=t.right,l=n.top,i===r&&c===h)break;r=i,h=c}return this.xAxis.x(o/2+h/2+n.left).y(s+n.top).width(o-h),this.yAxis.x(n.left).y(s/2-r/2+n.top).height(s-r),n.left+=h,n.top+=l,n.right+=a,n.bottom+=r,n}updateRegions(t,e,i){const n=this,o=this.svgRegions.selectAll(".region").data(this.regions());o.enter().append("rect").attr("class","region"),i?o.attr("x",function(t){return n.dataPos(t.x0)}).attr("y",0).attr("width",function(t){return n.dataPos(t.x1)-n.dataPos(t.x0)}).attr("height",this.height()).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return a.hsl(n._palette(t.colorID)).brighter()}):o.attr("x",0).attr("y",function(t){return n.dataPos(t.x0)}).attr("width",this.width()).attr("height",function(t){return n.dataPos(t.x0)-n.dataPos(t.x1)}).style("stroke",function(t){return n._palette(t.colorID)}).style("fill",function(t){return a.hsl(n._palette(t.colorID)).brighter()}),o.exit().remove()}_prevXAxisType;update(t,e){super.update(t,e);const i=this,n="horizontal"===this.orientation();if(this.updateRegions(t,e,n),this.domainAxis.orientation(n?"bottom":"left").title(this.xAxisTitle_exists()?this.xAxisTitle():this.columns()[0]),this.valueAxis.orientation(n?"left":"bottom"),this.xAxis=n?this.domainAxis:this.valueAxis,this.yAxis=n?this.valueAxis:this.domainAxis,"ordinal"===this.xAxisType()){const t=this.columns().length,e={};this.domainAxis.ordinals(this.data().map(function(n){return e[n[0]]=i.xAxisOrdinalMapping(n,n[t]),n[0]})).ordinalMappings(e)}else{const t=this.xAxisDomainLow()?this.xAxisDomainLow():this.domainAxis.parseInvert(a.min(this.parsedData(),function(t){return t[0]})),e=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert(a.max(this.parsedData(),function(t){return t[0]}));void 0!==t&&void 0!==e&&this.domainAxis.low(t).high(e)}const o=this.yAxisDomainLow()?this.yAxisDomainLow():this.valueAxis.parseInvert(a.min(this.parsedData(),function(t){return a.min(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[0]:t})})),s=this.yAxisDomainHigh()?this.yAxisDomainHigh():this.valueAxis.parseInvert(a.max(this.parsedData(),function(t){return a.max(t.filter(function(t,e){return e>0&&i.columns()[e]&&0!==i.columns()[e].indexOf("__")&&null!==t}),function(t){return t instanceof Array?t[1]:t})}));this.valueAxis.low(o).high(s),this.margin=this.calcMargin(t,e,n);let r=this.width()-this.margin.left-this.margin.right;r<0&&(r=0);let l=this.height()-this.margin.top-this.margin.bottom;l<0&&(l=0);const h=n?r:l,c=n?l:r;if(this.domainAxis.tickLength(this.xAxisGuideLines()?c:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?h:0).render(),this.svgDataClipRect.attr("width",r).attr("height",l),this.svgData.transition().attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.updateBrush(r,l,h,n),this.updateFocusChart(t,e,this.margin,r,l,n),this.chartsUpdate(r,l,250),this.selectionMode())return this.brushMoved()}updateBrush(t,e,i,n){const o=this.use2dSelection()?this.xyBrush:n?this.xBrush:this.yBrush,s=a.brushSelection(this.svgBrush.node());o.extent([[0,0],[t,e]]),this.svgBrush.attr("transform","translate("+this.margin.left+", "+this.margin.top+")").style("display",this.selectionMode()?null:"none").call(o);const r=this.use2dSelection()?[]:n?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],l=this.svgBrush.selectAll(".handle--custom").data(r);if(l.enter().append("path").attr("class","handle--custom").merge(l).attr("cursor",n?"ew-resize":"ns-resize").attr("d",i=>this.resizeBrushHandle(i,t,e)),this.selectionMode()){if(this._prevXAxisType!==this.xAxisType()&&(this._prevXAxisType=this.xAxisType(),this._prevBrush=null),this._prevBrush){if(s){if(this._prevBrush.orientation!==this.orientation()){const t=s[0];s[0]=this._prevBrush.maxCurrExtent-s[1],s[1]=this._prevBrush.maxCurrExtent-t}const t=i/this._prevBrush.maxCurrExtent;1!==t&&this.svgBrush.transition().on("start",function(){o.on("end",null)}).call(o.move,[s[0]*t,s[1]*t]).on("end",()=>{o.on("end",()=>this.brushMoved())})}}else this.svgBrush.call(o.move,[0,i]);this._prevBrush={orientation:this.orientation(),maxCurrExtent:i}}}updateFocusChart(t,e,i,n,o,s){const a=this,r=this.svgFocus.selectAll("#"+this.id()+"_focusChart").data(this.xAxisFocus()?[!0]:[]);r.enter().append("g").attr("id",this.id()+"_focusChart").attr("class","focus").each(function(){a.focusChart=(new a.constructor).target(this),a.focusChart.xBrush.on("brush.focus",function(){a.syncAxis(n),a.chartsUpdate(n,o,0)}),a.focusChart.layers(a.layers().map(t=>new t.constructor))}).merge(r).each(function(){a.copyPropsTo(a.focusChart,["layers"]);let t=0;for(const e of a.layers())e.copyPropsTo(a.focusChart.layers()[t]),t++;a.focusChart.xAxisFocus(!1).selectionMode(!0).skipSelection(!0).orientation("horizontal").xAxisGuideLines(!1).xAxisDomainLow(null).xAxisDomainHigh(null).yAxisGuideLines(!1).x(a.width()/2).y(a.height()-a.xAxisFocusHeight()/2).width(a.width()).height(a.xAxisFocusHeight()).columns(a.columns()).data(a.data()).render(),a.syncAxis(n)}),r.exit().each(function(){a.focusChart&&(a.focusChart.target(null),delete a.focusChart)}).remove()}syncAxis(t){const e=a.brushSelection(this.focusChart.svgBrush.node());if(e){if("ordinal"!==this.focusChart.xAxisType())this.xAxis.domain([this.focusChart.xAxis.invert(e[0]),this.focusChart.xAxis.invert(e[1])]);else{const i=(e[1]-e[0])/t;this.xAxis.range([-e[0]/i,(t-e[0])/i])}this.xAxis.rerender()}}layerColumns(t){const e=t.columns(),i=super.columns().filter(t=>t!==e[0]);return i.length?[e[0],...i]:e}layerColumnIndices(t){const e=t.columns();return this.layerColumns(t).map(t=>e.indexOf(t))}layerColumnIndex(t,e){return t.columns().indexOf(e)}layerData(t){if(1===arguments.length){const e=this.layerColumnIndices(t);return t.data().map(t=>{const i=e.map(e=>t[e]);return i.__hpcc_origRow=t,i})}throw new Error("Setting data on XYAxisLayer is not supported.")}layerEnter(t,e,i=250){}layerUpdate(t,e,i=250){}layerExit(t,e,i=250){}chartsEnter(t,e,i=250){this.layerEnter(this,e,i);for(const n of this.layers())n.__xyAxisElement=e.append("g").attr("class",n.class()),n.target(n.__xyAxisElement.node()).layerEnter(this,e,i)}chartsUpdate(t,e,i){this.layerUpdate(this,this.svgData,i);for(const n of this.layers())n.resize({width:t,height:e}).layerUpdate(this,n.__xyAxisElement,i)}exit(t,e){this.valueAxis.target(null),this.domainAxis.target(null),super.exit(t,e)}selection(t){const e=this;this._selection.widgetElement().selectAll(".selected,.deselected").each(function(i){const n=t.indexOf(i.origRow)>=0;a.select(this).classed("selected",n).classed("deselected",!n).attr("filter",e._selection.svgGlowID()&&n?`url(#${e._selection.svgGlowID()})`:null)});const i=t.map(t=>this.rowToObj(t));setTimeout(()=>{this.click(i,"",!0)},0)}xAxisOrdinalMapping(t,e){return t[0]}click(t,e,i){}_selection},L(p,"_XYAxis"),p);vt(qe,"XYAxis");let Ge=qe;Ge.prototype._class+=" chart_XYAxis",Ge.prototype.mixin(a.Utility.SimpleSelectionMixin),Ge.prototype.publish("orientation","horizontal","set","Selects orientation for the axis",["horizontal","vertical"]),Ge.prototype.publish("pointSizeColumn",null,"string","pointSizeColumn",null,{optional:!0}),Ge.prototype.publish("minPointSize",6,"number","minPointSize"),Ge.prototype.publish("maxPointSize",26,"number","maxPointSize"),Ge.prototype.publish("use2dSelection",!1,"boolean","2D Range Selector"),Ge.prototype.publish("selectionMode",!1,"boolean","Range Selector"),Ge.prototype.publishProxy("xAxisTitle","domainAxis","title"),Ge.prototype.publishProxy("xAxisTickCount","domainAxis","tickCount"),Ge.prototype.publishProxy("xAxisTickFormat","domainAxis","tickFormat"),Ge.prototype.publishProxy("xAxisTicks","domainAxis","ticks"),Ge.prototype.publishProxy("xAxisType","domainAxis","type"),Ge.prototype.publishProxy("xAxisTypeTimePattern","domainAxis","timePattern"),Ge.prototype.publish("xAxisDomainLow",null,"string","X-Axis Low",null,{optional:!0,disable:vt(t=>"ordinal"===t.xAxisType(),"disable")}),Ge.prototype.publish("xAxisDomainHigh",null,"string","X-Axis High",null,{optional:!0,disable:vt(t=>"ordinal"===t.xAxisType(),"disable")}),Ge.prototype.publishProxy("xAxisFontSize","domainAxis","fontSize"),Ge.prototype.publishProxy("xAxisFontFamily","domainAxis","fontFamily"),Ge.prototype.publishProxy("xAxisOrdinalPaddingInner","domainAxis","ordinalPaddingInner"),Ge.prototype.publishProxy("xAxisOrdinalPaddingOuter","domainAxis","ordinalPaddingOuter"),Ge.prototype.publishProxy("xAxisOverlapMode","domainAxis","overlapMode"),Ge.prototype.publishProxy("xAxisLabelRotation","domainAxis","labelRotation"),Ge.prototype.publishProxy("xAxisDomainPadding","domainAxis","extend"),Ge.prototype.publish("xAxisGuideLines",!1,"boolean","Y-Axis Guide Lines"),Ge.prototype.publish("xAxisFocus",!1,"boolean","X-Axis Focus",null,{disable:vt(t=>"horizontal"!==t.orientation(),"disable")}),Ge.prototype.publish("xAxisFocusHeight",80,"number","X-Axis Focus Height",null,{disable:vt(t=>!t.xAxisFocus(),"disable")}),Ge.prototype.publishProxy("xAxisHidden","domainAxis","hidden"),Ge.prototype.publishProxy("yAxisFontSize","valueAxis","fontSize"),Ge.prototype.publishProxy("yAxisFontFamily","valueAxis","fontFamily"),Ge.prototype.publishProxy("yAxisTitle","valueAxis","title"),Ge.prototype.publishProxy("yAxisTickCount","valueAxis","tickCount"),Ge.prototype.publishProxy("yAxisTickFormat","valueAxis","tickFormat"),Ge.prototype.publishProxy("yAxisTicks","valueAxis","ticks"),Ge.prototype.publishProxy("yAxisType","valueAxis","type"),Ge.prototype.publishProxy("yAxisTypeTimePattern","valueAxis","timePattern"),Ge.prototype.publishProxy("yAxisTypePowExponent","valueAxis","powExponent"),Ge.prototype.publishProxy("yAxisTypeLogBase","valueAxis","logBase"),Ge.prototype.publish("yAxisStacked",!1,"boolean","Stacked Chart",null,{tags:["Basic"],disable:vt(t=>"ordinal"!==t.xAxisType()||t._class.indexOf("chart_Column")<0,"disable")}),Ge.prototype.publish("yAxisDomainLow",null,"string","Y-Axis Low",null,{optional:!0,disable:vt(t=>"ordinal"===t.yAxisType(),"disable")}),Ge.prototype.publish("yAxisDomainHigh",null,"string","Y-Axis High",null,{optional:!0,disable:vt(t=>"ordinal"===t.yAxisType(),"disable")}),Ge.prototype.publishProxy("yAxisDomainPadding","valueAxis","extend"),Ge.prototype.publish("yAxisGuideLines",!0,"boolean","Y-Axis Guide Lines"),Ge.prototype.publishProxy("yAxisHidden","valueAxis","hidden"),Ge.prototype.publish("regions",[],"array","Regions"),Ge.prototype.publish("layers",[],"widgetArray","Layers",null,{render:!1}),Ge.prototype.publishProxy("xAxisPadding","domainAxis","padding"),Ge.prototype.publishProxy("yAxisPadding","valueAxis","padding");const Ue=(d=class extends Ge{constructor(){super(),ft.call(this),_t.call(this),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}curve(){switch(this.interpolate()){case"linear":return Jt;case"step":return Me;case"step-before":return Te;case"step-after":return Pe;case"basis":return le;case"bundle":return ce;case"cardinal":return de;case"catmullRom":return _e;case"natural":return Ae;default:return we}}getScale(){switch(this.pointSizeScale()){case"linear":return a.scaleLinear();case"pow":return a.scalePow().exponent(2);case"log":return a.scaleLog();case"sqrt":return a.scaleSqrt()}}pointColor(t,e,i,n){return this.interpolate()&&this.pointDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}lineColor(t,e,i,n){return this.interpolateFill()&&this.interpolateDarken()?this.strokeColor(t,e,i,n):this.fillColor(t,e,i,n)}areaColor(t,e,i,n){return this.fillColor(t,e,i,n)}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(t){return"series-table"===n.tooltipStyle()?n.tooltipFormat({label:t.label,arr:n.columns().slice(1).map(function(e,i){return{label:e,color:n._palette(e),value:n.data()[t.rowIdx][i+1]}})}):n.tooltipFormat({label:t.label,series:t.column,value:t.value})})}_prevPointShape;layerUpdate(t,e,i=250){super.layerUpdate(t,e);const n="horizontal"===t.orientation(),o=n?this.height():this.width(),s=this;function r(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}let l,h,c;L(r,"r"),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._prevPointShape!==this.pointShape()&&(e.selectAll(".data").remove(),this._prevPointShape=this.pointShape()),vt(r,"mapShape"),this.pointSizeColumn_exists()&&(l=this.columns().indexOf(this.pointSizeColumn()),h=a.extent(this.data(),t=>t[l]),c=this.getScale().domain(h));const u=this.layerColumns(t),p=this.layerData(t),d=this.flattenData(u,p).map(function(t){return t.shape=r(s.pointShape()),t.column=u[t.colIdx],t.row=p[t.rowIdx],t.origRow=p[t.rowIdx].__hpcc_origRow,h?(t.size=c(t.row[l])*(s.maxPointSize()-s.minPointSize())+s.minPointSize(),t.column!==s.pointSizeColumn()&&t):(t.size=s.pointSize(),t)}).filter(t=>t),f=e.selectAll(".area").data(u.filter(function(t,e){return s.interpolate()&&s.interpolateFill()&&e>0})),y=f.enter().append("path"),_=ie().curve(this.curve());n?_.x(function(e){return s.xPos(t,e)}).y0(Math.min(o,this.yPos(t,{value:0}))).y1(function(e){return s.yPos(t,e)}):_.y(function(e){return s.yPos(t,e)}).x0(Math.max(0,this.xPos(t,{value:0}))).x1(function(e){return s.xPos(t,e)}),y.merge(f).attr("class",t=>"area series series-"+this.cssTag(t)).each(function(t,e){a.select(this).attr("d",_(d.filter(function(t){return t.colIdx===e+1}))).style("opacity",s.interpolateFillOpacity()).style("stroke","none").style("fill",s.areaColor([],t,void 0,[]))}),f.exit().remove();const x=e.selectAll(".line").data(u.filter(function(t,e){return s.interpolate()&&e>0})),m=x.enter().append("path"),g=ee().x(function(e){return s.xPos(t,e)}).y(function(e){return s.yPos(t,e)}).curve(this.curve());m.merge(x).attr("class",t=>"line series series-"+this.cssTag(t)).each(function(t,e){const i=a.select(this),n=d.filter(function(t){return t.colIdx===e+1});i.attr("d",g(n)).style("stroke",s.lineColor([],t,void 0,[])).style("fill","none")}),x.exit().remove();const b=e.selectAll(".point").data(d,function(t,e){return t.shape+"_"+e});b.enter().append("g").each(function(e){const i=a.select(this);i.append(e.shape).attr("class","pointShape"),i.append("text").attr("class","pointValue").style("display","none").attr("text-anchor",s.valueAnchor()).attr("alignment-baseline",s.valueBaseline()).attr("fill",function(t,e){return"middle"===s.valueBaseline()||"central"===s.valueBaseline()?s.textColor(t.row,t.column,t.value,t.origRow):null}),i.append("circle").attr("class","pointSelection").on("mouseout.tooltip",s.tooltip.hide).on("mousemove.tooltip",s.tooltip.show).call(t._selection.enter.bind(t._selection)).on("click",function(e,i){s.click(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))}).on("dblclick",function(e,i){s.dblclick(t.rowToObj(t.data()[e.rowIdx]),e.column,t._selection.selected(this))})}).merge(b).attr("class",t=>"point series series-"+this.cssTag(t.column)).each(function(e){a.select(this).select(".pointValue").attr("x",function(e){return s.xPos(t,e)}).attr("y",function(e){return s.yPos(t,e)}).style("display",s.showValue()?"block":"none").attr("text-anchor",s.valueAnchor()).attr("alignment-baseline",s.valueBaseline()).text(function(t){return t.value}),a.select(this).select(".pointSelection").attr("cx",function(e){return s.xPos(t,e)}).attr("cy",function(e){return s.yPos(t,e)}).attr("r",e.size);const i=a.select(this).select(".pointShape");switch(e.shape){case"rect":i.attr("x",function(i){return s.xPos(t,i)-e.size/2}).attr("y",function(i){return s.yPos(t,i)-e.size/2}).attr("width",e.size).attr("height",e.size).style("fill",s.pointColor(e.row,e.column,e.value,e.origRow));break;case"circle":i.attr("cx",function(e){return s.xPos(t,e)}).attr("cy",function(e){return s.yPos(t,e)}).attr("r",.9*e.size).style("fill",s.pointColor(e.row,e.column,e.value,e.origRow));break;case"path":i.attr("d",function(i){return"M"+(s.xPos(t,i)-e.size/2)+" "+(s.yPos(t,i)-e.size/2)+" L"+(s.xPos(t,i)+e.size/2)+" "+(s.yPos(t,i)+e.size/2)+" M"+(s.xPos(t,i)-e.size/2)+" "+(s.yPos(t,i)+e.size/2)+" L"+(s.xPos(t,i)+e.size/2)+" "+(s.yPos(t,i)-e.size/2)}).style("stroke",s.pointColor(e.row,e.column,e.value,e.origRow))}}),b.exit().remove()}exit(t,e){super.exit(t,e)}},L(d,"_Scatter"),d);vt(Ue,"Scatter"),wt(Ue,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number",multi:!0}]);let Xe=Ue;Xe.prototype._class+=" chart_Scatter",Xe.prototype.implements(ft.prototype),Xe.prototype.implements(_t.prototype),Xe.prototype.publish("paletteID","default","set","Color palette for this widget",Xe.prototype._palette.switch(),{tags:["Basic","Shared"]}),Xe.prototype.publish("pointSizeScale","linear","set","pointSizeScale",["linear","pow","log","sqrt"]),Xe.prototype.publish("pointShape","cross","set","Shape of the data points",["circle","rectangle","cross"]),Xe.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),Xe.prototype.publish("interpolate","","set","Interpolate Data",["","linear","step","step-before","step-after","basis","bundle","cardinal","catmullRom","natural","monotone"]),Xe.prototype.publish("pointDarken",!0,"boolean","If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color",null,{disable:vt(t=>!t.interpolate(),"disable")}),Xe.prototype.publish("interpolateDarken",!0,"boolean","If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color",null,{disable:vt(t=>!t.interpolateFill(),"disable")}),Xe.prototype.publish("interpolateFill",!1,"boolean","If true, the area between the line and zero will be filled"),Xe.prototype.publish("interpolateFillOpacity",.66,"number","Fill interpolation Opacity",null,{range:{min:0,step:.01,max:1}}),Xe.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Xe.prototype.publish("showValue",!1,"boolean"),Xe.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),Xe.prototype.publish("valueBaseline","ideographic","set","alignment-baseline for shown value text",["auto","baseline","before-edge","text-before-edge","middle","central","after-edge","text-after-edge","ideographic","alphabetic","hanging","mathematical","inherit"]);const Ye=(L(f=class extends Xe{constructor(){super(),this.interpolate_default("linear").interpolateFill_default(!0)}},"_Area"),f);vt(Ye,"Area"),Ye.prototype._class+=" chart_Area";const Qe=(y=class extends Ge{_linearGap;textLocal=a.local();stackedTextLocal=a.local();isHorizontal;constructor(){super(),ft.call(this),_t.call(this),this._selection.skipBringToTop(!0),this._linearGap=25}layerEnter(t,e,i=250){super.layerEnter(t,e,i);const n=this;this.tooltipHTML(function(e){if("series-table"===n.tooltipStyle())return n.tooltipFormat({label:e.row[0],arr:n.columns().slice(1).map(function(t,i){return{label:t,color:n._palette(t),value:e.row[i+1]}})});{let i=e.row[e.idx];return i instanceof Array&&(i=i[1]-i[0]),n.tooltipFormat({label:e.row[0],series:n.layerColumns(t)[e.idx],value:i})}})}adjustedData(t){return this.layerData(t).map(e=>{let i=0;return e.map((e,n)=>{if(0===n)return e;if(n>=this.layerColumns(t).length)return e;const o=t.yAxisStacked()?[i,i+e]:e;return i+=e,o},this)},this)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n="horizontal"===t.orientation();this.isHorizontal=n;const o=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const s=a.format(o.showValueAsPercentFormat());let r=10,l=0;switch(t.xAxisType()){case"ordinal":r=t.bandwidth(),l=-r/2;break;case"linear":case"time":r=Math.max(Math.abs(t.dataPos(2)-t.dataPos(1))*(100-this._linearGap)/100,r),l=-r/2}this.tooltip.direction(n?"n":"e");const h=a.scaleBand().domain(o.layerColumns(t).filter(function(t,e){return e>0})).rangeRound(n?[0,r]:[r,0]).paddingInner(this.xAxisSeriesPaddingInner()).paddingOuter(0);let c=[];const u=[],p=this.columns().length,d=this.data();this.showValue()&&"series"===this.showValueAsPercent()&&d.forEach(t=>{t.filter((t,e)=>e>0&&e<p).forEach((t,e)=>{void 0===u[e+1]&&(u[e+1]=0),u[e+1]+=t})}),(this.showDomainTotal()||this.showValue()&&"domain"===this.showValueAsPercent())&&(c=d.map(t=>t.filter((t,e)=>e>0&&e<p).reduce((t,e)=>t+e,0)));const f=e.selectAll(".dataRow").data(this.adjustedData(t)),y=t.data(),_=this.getAxisSize(t);f.enter().append("g").attr("class","dataRow").merge(f).each(function(e,d){const f=a.select(this),x=f.selectAll(".dataCell").data(e.filter(function(e,i){return i<o.layerColumns(t).length}).map(function(i,n){return{column:o.layerColumns(t)[n],row:e,origRow:y[d],value:i,idx:n}}).filter(function(t){return null!==t.value&&t.idx>0}),t=>t.column),m=x.enter().append("g").attr("class","dataCell").on("mouseout.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.hide.apply(o,arguments)}).on("mousemove.tooltip",function(t){(!o.tooltipInnerTextEllipsedOnly()||t.innerTextObj&&t.innerTextObj.isTruncated)&&o.tooltip.show.apply(o,arguments)}).call(t._selection.enter.bind(t._selection)).on("click",function(e){o.click(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).on("dblclick",function(e){o.dblclick(t.rowToObj(e.origRow),e.column,t._selection.selected(this))}).style("opacity",0).each(function(t){const e=a.select(this);e.append("rect").attr("class","columnRect series series-"+o.cssTag(t.column)),e.append("text").attr("class","columnRectText").style("stroke","transparent")});m.transition().duration(i).style("opacity",1);const g=t.yAxisStacked()?r:h.bandwidth();m.merge(x).each(function(r){const f=a.select(this),y=t.dataPos(e[0])+(t.yAxisStacked()?0:h(r.column))+l,x=r.value instanceof Array?r.value[1]:r.value;let m=r.origRow[r.idx];if(o.showValue()){const t=o.dataMeta();switch(o.showValueAsPercent()){case"series":const e=void 0!==t.sum?t.sum:u[r.idx];m=s(m/e);break;case"domain":const i=void 0!==t.sum?t.sum:c[d];m=s(m/i);break;default:m=a.format(o.showValueFormat())(m)}}const b=t.valuePos(x),v=t.valuePos(r.value instanceof Array?r.value[0]:0),w=Math.min(v,b),S=Math.abs(b-v),k=o.innerTextFontSize(),A=o.innerTextPadding_exists()?o.innerTextPadding():k/2.5,C=o.intersectRectRect({x:n?y:w,y:n?w:y,width:n?g:S,height:n?S:g},{x:0,y:0,width:_.width,height:_.height}),M=f.select("rect").transition().duration(i).style("fill",t=>o.fillColor(t.row,t.column,t.value,t.origRow));n?M.attr("x",y).attr("y",w).attr("width",g).attr("height",S):M.attr("y",y).attr("x",w).attr("height",g).attr("width",S);const T=f.select("text").transition().duration(i).style("font-size",k+"px").style("fill",t=>o.textColor(t.row,t.column,t.value,t.origRow));T.style("font-family",o.innerTextFontFamily_exists()?o.innerTextFontFamily():null);const P=o.innerTextPadding_exists()?o.innerTextPadding():8,I=k/2.7;if(n){const t=C.y+C.height-A;T.attr("x",y+g/2).attr("y",t+I).attr("transform",`rotate(-90, ${y+g/2}, ${t})`)}else T.attr("x",C.x+P).attr("y",y+g/2+I);T.attr("height",g).attr("width",S),o.showInnerText()&&T.text(t=>{const e=o.innerText(t.origRow,t.origRow[p],t.idx);if(e){const i=n?C.height:C.width,s=o.calcInnerText(i,e,m);return t.innerTextObj=s,s.text}return""});const E=f.selectAll(".dataText").data(o.showValue()?[`${x}`]:[]);E.enter().append("g").attr("class","dataText").each(function(t){o.textLocal.set(this,(new a.Text).target(this).colorStroke_default("transparent"))}).merge(E).each(function(){const t={x:0,y:0},e=o.valueFontFamily(),i=o.valueFontSize(),s=o.textSize(m,e,i),a=parseFloat(m)>=0;let l=o.valueAnchor()?o.valueAnchor():n?"middle":"start";const h=C.x,c=_.width-(C.x+C.width),u=C.y,p=_.height-(C.y+C.height);let d,f,x;if(r.innerTextObj){const{padding:e,valueTextWidth:o}=r.innerTextObj;f=!1,n?(l="middle",t.x=y+g/2,4===r.innerTextObj.category?(f=!0,t.y=w-e-i/2):t.y=w+e+i/2):(l="start",4===r.innerTextObj.category?(f=!0,t.x=S+w+e):t.x=S+w-o-e,t.y=y+g/2)}else n?(d=C.height<s.height,f=!o.valueCentered()||d,t.x=C.x+C.width/2,f?a?(x=u<s.height+P,x?d?t.y=C.y+C.height+s.height:(f=!1,t.y=C.y+C.height/2):t.y=C.y-s.height/2-P):(x=p<s.height,x?d?t.y=C.y-s.height/2-P:(f=!1,t.y=C.y+C.height/2):t.y=C.y+s.height+P):t.y=C.y+C.height/2):(d=C.width<s.width,f=!o.valueCentered()||d,t.y=C.y+C.height/2,f?a?(x=c<s.width+P,x?o.showInnerText()||!d?(f=!1,t.x=C.x+C.width/2):t.x=C.x-(s.width-P):t.x=C.x+C.width+s.width/2+P):(x=h<s.width,x?o.showInnerText()||!d?(f=!1,t.x=C.x+C.width/2):t.x=C.x+C.width+(s.width-P):t.x=C.x-(s.width-P)):t.x=C.x+C.width/2);const b=f?null:o.textColor(r.row,r.column,r.value,r.origRow),v=o.columns(),k=o.yAxisStacked()&&d||f&&o.yAxisStacked()&&v.indexOf(r.column)!==v.length-1;o.textLocal.get(this).pos(t).anchor(l).fontFamily(e).fontSize(i).text(`${m}`).colorFill(b).visible(o.showValue()&&!k).render()}),E.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),x.exit().transition().duration(i).style("opacity",0).remove();const b=t.yAxisStacked()?c[d]:Math.max(...e.filter((t,e)=>e>0&&e<p)),v=f.selectAll(".stackedTotalText").data(o.showDomainTotal()?[c[d]]:[]);v.enter().append("g").attr("class","stackedTotalText").each(function(t){o.stackedTextLocal.set(this,(new a.Text).target(this).colorStroke_default("transparent"))}).merge(v).each(function(i){const s={x:0,y:0},a=t.dataPos(e[0]),r=t.valuePos(b),l=o.valueFontFamily(),h=o.valueFontSize(),c=o.textSize(i,l,h),u=parseFloat(i)>=0;let p="middle";n?(s.x=a,s.y=u?r-c.height/2:r+c.height/2):(p="start",s.y=a,s.x=u?r+c.width/2:r-c.width/2),o.stackedTextLocal.get(this).pos(s).anchor(p).fontFamily(l).fontSize(h).text(i).render()}),v.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),f.exit().transition().duration(i).remove()}calcInnerText(t,e,i){const n=this.innerTextFontFamily_exists()?this.innerTextFontFamily():"Verdana",o=this.innerTextFontSize(),s=this.valueFontFamily_exists()?this.valueFontFamily():"Verdana",a=this.valueFontSize(),r=this.innerTextPadding_exists()?this.innerTextPadding():o/2.5,l=this.isHorizontal?a:this.textSize(i,s,a).width,h=e,c=3*r+this.textSize("...",n,o).width+l,u=1*r+l;let p=4;if(3*r+this.textSize(e,n,o).width+l<t)p=1;else if(c<t){const i=t-c;let s="";for(const t of e){if(this.textSize(s+t,n,o).width>i){e=s+"...";break}s+=t}p=2}else u<t?(e="",p=3):e="";return{text:e,isTruncated:h!==e,padding:r,category:p,valueTextWidth:l}}innerText(t,e,i){return t[0]}},L(y,"_Column"),y);vt(Qe,"Column"),wt(Qe,"__inputs",[{id:"label",type:"string"},{id:"values",type:"number",multi:!0}]);let Ze=Qe;Ze.prototype._class+=" chart_Column",Ze.prototype.implements(ft.prototype),Ze.prototype.implements(_t.prototype),Ze.prototype.publish("valueFontFamily",null,"string","Font family of value text",null,{optional:!0}),Ze.prototype.publish("valueFontSize",12,"number","Height of value text (pixels)"),Ze.prototype.publish("innerTextFontFamily",null,"string","Font family of inner text",null,{optional:!0}),Ze.prototype.publish("innerTextPadding",8,"number","Offset of inner text (pixels)",null,{optional:!0}),Ze.prototype.publish("innerTextFontSize",12,"number","Height of inner text (pixels)"),Ze.prototype.publish("paletteID","default","set","Color palette for this widget",()=>Ze.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ze.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ze.prototype.publish("showValue",!1,"boolean","Show Value in column"),Ze.prototype.publish("showInnerText",!1,"boolean","Show Label in column"),Ze.prototype.publish("showValueFormat",",","string","D3 Format for Value",null,{disable:vt(t=>!t.showValue()||!!t.showValueAsPercent(),"disable")}),Ze.prototype.publish("showValueAsPercent",null,"set","If showValue is true, optionally show value as a percentage by Series or Domain",[null,"series","domain"],{disable:vt(t=>!t.showValue(),"disable"),optional:!0}),Ze.prototype.publish("showValueAsPercentFormat",".0%","string","D3 Format for %",null,{disable:vt(t=>!t.showValue()||!t.showValueAsPercent(),"disable")}),Ze.prototype.publish("showDomainTotal",!1,"boolean","Show Total Value for Stacked Columns",null),Ze.prototype.publish("valueCentered",!1,"boolean","Show Value in center of column"),Ze.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),Ze.prototype.publish("xAxisSeriesPaddingInner",0,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)"),Ze.prototype.publish("tooltipInnerTextEllipsedOnly",!1,"boolean","Show tooltip only when inner text is truncated with an ellipsis");const Je=(L(_=class extends Ze{constructor(){super(),this.orientation_default("vertical")}},"_Bar"),_);vt(Je,"Bar");let Ke=Je;function ti(t){var e=0,i=t.children,n=i&&i.length;if(n)for(;--n>=0;)e+=i[n].value;else e=1;t.value=e}function ei(){return this.eachAfter(ti)}function ii(t){var e,i,n,o,s=this,a=[s];do{for(e=a.reverse(),a=[];s=e.pop();)if(t(s),i=s.children)for(n=0,o=i.length;n<o;++n)a.push(i[n])}while(a.length);return this}function ni(t){for(var e,i,n=this,o=[n];n=o.pop();)if(t(n),e=n.children)for(i=e.length-1;i>=0;--i)o.push(e[i]);return this}function oi(t){for(var e,i,n,o=this,s=[o],a=[];o=s.pop();)if(a.push(o),e=o.children)for(i=0,n=e.length;i<n;++i)s.push(e[i]);for(;o=a.pop();)t(o);return this}function si(t){return this.eachAfter(function(e){for(var i=+t(e.data)||0,n=e.children,o=n&&n.length;--o>=0;)i+=n[o].value;e.value=i})}function ai(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function ri(t){for(var e=this,i=li(e,t),n=[e];e!==i;)e=e.parent,n.push(e);for(var o=n.length;t!==i;)n.splice(o,0,t),t=t.parent;return n}function li(t,e){if(t===e)return t;var i=t.ancestors(),n=e.ancestors(),o=null;for(t=i.pop(),e=n.pop();t===e;)o=t,t=i.pop(),e=n.pop();return o}function hi(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function ci(){var t=[];return this.each(function(e){t.push(e)}),t}function ui(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function pi(){var t=this,e=[];return t.each(function(i){i!==t&&e.push({source:i.parent,target:i})}),e}function di(t,e){var i,n,o,s,a,r=new mi(t),l=+t.value&&(r.value=t.value),h=[r];for(null==e&&(e=yi);i=h.pop();)if(l&&(i.value=+i.data.value),(o=e(i.data))&&(a=o.length))for(i.children=new Array(a),s=a-1;s>=0;--s)h.push(n=i.children[s]=new mi(o[s])),n.parent=i,n.depth=i.depth+1;return r.eachBefore(xi)}function fi(){return di(this).eachBefore(_i)}function yi(t){return t.children}function _i(t){t.data=t.data.data}function xi(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function mi(t){this.data=t,this.depth=this.height=0,this.parent=null}L(ti,"Ce"),L(ei,"ze"),L(ii,"Fe"),L(ni,"Ie"),L(oi,"Ee"),L(si,"Oe"),L(ai,"Re"),L(ri,"De"),L(li,"je"),L(hi,"Ne"),L(ci,"Le"),L(ui,"Be"),L(pi,"$e"),L(di,"He"),L(fi,"qe"),L(yi,"Ve"),L(_i,"We"),L(xi,"Ge"),L(mi,"Xe"),Ke.prototype._class+=" chart_Bar",vt(ti,"count"),vt(ei,"node_count"),vt(ii,"node_each"),vt(ni,"node_eachBefore"),vt(oi,"node_eachAfter"),vt(si,"node_sum"),vt(ai,"node_sort"),vt(ri,"node_path"),vt(li,"leastCommonAncestor"),vt(hi,"node_ancestors"),vt(ci,"node_descendants"),vt(ui,"node_leaves"),vt(pi,"node_links"),vt(di,"hierarchy"),vt(fi,"node_copy"),vt(yi,"defaultChildren"),vt(_i,"copyData"),vt(xi,"computeHeight"),vt(mi,"Node$1"),mi.prototype=di.prototype={constructor:mi,count:ei,each:ii,eachAfter:oi,eachBefore:ni,sum:si,sort:ai,path:ri,ancestors:hi,descendants:ci,leaves:ui,links:pi,copy:fi};var gi=Array.prototype.slice;function bi(t){for(var e,i,n=t.length;n;)i=Math.random()*n--|0,e=t[n],t[n]=t[i],t[i]=e;return t}function vi(t){for(var e,i,n=0,o=(t=bi(gi.call(t))).length,s=[];n<o;)e=t[n],i&&ki(i,e)?++n:(i=Ci(s=wi(s,e)),n=0);return i}function wi(t,e){var i,n;if(Ai(e,t))return[e];for(i=0;i<t.length;++i)if(Si(e,t[i])&&Ai(Ti(t[i],e),t))return[t[i],e];for(i=0;i<t.length-1;++i)for(n=i+1;n<t.length;++n)if(Si(Ti(t[i],t[n]),e)&&Si(Ti(t[i],e),t[n])&&Si(Ti(t[n],e),t[i])&&Ai(Pi(t[i],t[n],e),t))return[t[i],t[n],e];throw new Error}function Si(t,e){var i=t.r-e.r,n=e.x-t.x,o=e.y-t.y;return i<0||i*i<n*n+o*o}function ki(t,e){var i=t.r-e.r+1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function Ai(t,e){for(var i=0;i<e.length;++i)if(!ki(t,e[i]))return!1;return!0}function Ci(t){switch(t.length){case 1:return Mi(t[0]);case 2:return Ti(t[0],t[1]);case 3:return Pi(t[0],t[1],t[2])}}function Mi(t){return{x:t.x,y:t.y,r:t.r}}function Ti(t,e){var i=t.x,n=t.y,o=t.r,s=e.x,a=e.y,r=e.r,l=s-i,h=a-n,c=r-o,u=Math.sqrt(l*l+h*h);return{x:(i+s+l/u*c)/2,y:(n+a+h/u*c)/2,r:(u+o+r)/2}}function Pi(t,e,i){var n=t.x,o=t.y,s=t.r,a=e.x,r=e.y,l=e.r,h=i.x,c=i.y,u=i.r,p=n-a,d=n-h,f=o-r,y=o-c,_=l-s,x=u-s,m=n*n+o*o-s*s,g=m-a*a-r*r+l*l,b=m-h*h-c*c+u*u,v=d*f-p*y,w=(f*b-y*g)/(2*v)-n,S=(y*_-f*x)/v,k=(d*g-p*b)/(2*v)-o,A=(p*x-d*_)/v,C=S*S+A*A-1,M=2*(s+w*S+k*A),T=w*w+k*k-s*s,P=-(C?(M+Math.sqrt(M*M-4*C*T))/(2*C):T/M);return{x:n+w+S*P,y:o+k+A*P,r:P}}function Ii(t,e,i){var n,o,s,a,r=t.x-e.x,l=t.y-e.y,h=r*r+l*l;h?(o=e.r+i.r,o*=o,a=t.r+i.r,o>(a*=a)?(n=(h+a-o)/(2*h),s=Math.sqrt(Math.max(0,a/h-n*n)),i.x=t.x-n*r-s*l,i.y=t.y-n*l+s*r):(n=(h+o-a)/(2*h),s=Math.sqrt(Math.max(0,o/h-n*n)),i.x=e.x+n*r-s*l,i.y=e.y+n*l+s*r)):(i.x=e.x+i.r,i.y=e.y)}function Ei(t,e){var i=t.r+e.r-1e-6,n=e.x-t.x,o=e.y-t.y;return i>0&&i*i>n*n+o*o}function Fi(t){var e=t._,i=t.next._,n=e.r+i.r,o=(e.x*i.r+i.x*e.r)/n,s=(e.y*i.r+i.y*e.r)/n;return o*o+s*s}function Di(t){this._=t,this.next=null,this.previous=null}function zi(t){if(!(o=t.length))return 0;var e,i,n,o,s,a,r,l,h,c,u;if((e=t[0]).x=0,e.y=0,!(o>1))return e.r;if(i=t[1],e.x=-i.r,i.x=e.r,i.y=0,!(o>2))return e.r+i.r;Ii(i,e,n=t[2]),e=new Di(e),i=new Di(i),n=new Di(n),e.next=n.previous=i,i.next=e.previous=n,n.next=i.previous=e;t:for(r=3;r<o;++r){Ii(e._,i._,n=t[r]),n=new Di(n),l=i.next,h=e.previous,c=i._.r,u=e._.r;do{if(c<=u){if(Ei(l._,n._)){i=l,e.next=i,i.previous=e,--r;continue t}c+=l._.r,l=l.next}else{if(Ei(h._,n._)){(e=h).next=i,i.previous=e,--r;continue t}u+=h._.r,h=h.previous}}while(l!==h.next);for(n.previous=e,n.next=i,e.next=i.previous=i=n,s=Fi(e);(n=n.next)!==i;)(a=Fi(n))<s&&(e=n,s=a);i=e.next}for(e=[i._],n=i;(n=n.next)!==i;)e.push(n._);for(n=vi(e),r=0;r<o;++r)(e=t[r]).x-=n.x,e.y-=n.y;return n.r}function Ri(t){return null==t?null:Oi(t)}function Oi(t){if("function"!=typeof t)throw new Error;return t}function ji(){return 0}function Li(t){return function(){return t}}function Ni(t){return Math.sqrt(t.value)}function Bi(){var t=null,e=1,i=1,n=ji;function o(o){return o.x=e/2,o.y=i/2,t?o.eachBefore(Vi(t)).eachAfter(Hi(n,.5)).eachBefore(Wi(1)):o.eachBefore(Vi(Ni)).eachAfter(Hi(ji,1)).eachAfter(Hi(n,o.r/Math.min(e,i))).eachBefore(Wi(Math.min(e,i)/(2*o.r))),o}return L(o,"s"),vt(o,"pack"),o.radius=function(e){return arguments.length?(t=Ri(e),o):t},o.size=function(t){return arguments.length?(e=+t[0],i=+t[1],o):[e,i]},o.padding=function(t){return arguments.length?(n="function"==typeof t?t:Li(+t),o):n},o}function Vi(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function Hi(t,e){return function(i){if(n=i.children){var n,o,s,a=n.length,r=t(i)*e||0;if(r)for(o=0;o<a;++o)n[o].r+=r;if(s=zi(n),r)for(o=0;o<a;++o)n[o].r-=r;i.r=s+r}}}function Wi(t){return function(e){var i=e.parent;e.r*=t,i&&(e.x=i.x+t*e.x,e.y=i.y+t*e.y)}}L(bi,"Ue"),L(vi,"Qe"),L(wi,"Ze"),L(Si,"Je"),L(ki,"Ke"),L(Ai,"ti"),L(Ci,"ei"),L(Mi,"ii"),L(Ti,"ni"),L(Pi,"oi"),L(Ii,"si"),L(Ei,"ai"),L(Fi,"ri"),L(Di,"li"),L(zi,"hi"),L(Ri,"ci"),L(Oi,"ui"),L(ji,"pi"),L(Li,"di"),L(Ni,"fi"),L(Bi,"yi"),L(Vi,"_i"),L(Hi,"xi"),L(Wi,"mi"),vt(bi,"shuffle"),vt(vi,"enclose"),vt(wi,"extendBasis"),vt(Si,"enclosesNot"),vt(ki,"enclosesWeak"),vt(Ai,"enclosesWeakAll"),vt(Ci,"encloseBasis"),vt(Mi,"encloseBasis1"),vt(Ti,"encloseBasis2"),vt(Pi,"encloseBasis3"),vt(Ii,"place"),vt(Ei,"intersects"),vt(Fi,"score"),vt(Di,"Node"),vt(zi,"packEnclose"),vt(Ri,"optional"),vt(Oi,"required"),vt(ji,"constantZero"),vt(Li,"constant$2"),vt(Ni,"defaultRadius"),vt(Bi,"d3Pack"),vt(Vi,"radiusLeaf"),vt(Hi,"packChildren"),vt(Wi,"translateChild");const $i=(x=class extends a.SVGWidget{labelWidgets;d3Pack;constructor(){super(),ht.call(this),_t.call(this),a.Utility.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.labelWidgets={},this.d3Pack=Bi().size([this.width(),this.height()]).padding(1.5)}size(t){const e=super.size.apply(this,arguments);return arguments.length&&this.d3Pack.size([this.width(),this.height()]),e}enter(t,e){super.enter(t,e),this._selection.widgetElement(e);const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t[0]),value:t[1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){super.update(t,e);const i=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const n=di({children:this.cloneData()}).sum(function(t){return t[1]}).sort(function(t,e){return e[1]<t[1]?-1:e[1]>t[1]?1:0});this.d3Pack(n);const o=e.selectAll(".node").data(n.children||[],t=>t.data[0]);o.enter().append("g").attr("class",(t,e)=>"node series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).each(function(t){const e=a.select(this),n=t.x,o=t.y;e.append("circle").attr("transform","translate("+n+","+o+")").attr("r",0).on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show),t.__viz_faChar?i.labelWidgets[t.data[0]]=(new a.FAChar).char(t.__viz_faChar).target(this).render():i.labelWidgets[t.data[0]]=(new a.Text).text(t.data[0]).target(this).render()}).merge(o).transition().attr("opacity",1).each(function(t){const e=a.select(this),n={x:t.x,y:t.y};e.select("circle").transition().attr("transform","translate("+n.x+","+n.y+")").style("fill",i.fillColor(t.data,i.columns()[1],t.data[1])).attr("r",t.r).select("title").text(t.data[0]+" ("+t.data[1]+")"),t.__viz_faChar?i.labelWidgets[t.data[0]].pos(n).render():i.labelWidgets[t.data[0]].pos(n).colorFill_default(i.textColor(t.data,i.columns()[1],t.data[1])).width(2*t.r).text(t.data[0]).render()}),o.exit().transition().style("opacity",0).remove()}exit(t,e){super.exit(t,e)}},L(x,"_Bubble"),x);vt($i,"Bubble"),wt($i,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let qi=$i;qi.prototype._class+=" chart_Bubble",qi.prototype.implements(ht.prototype),qi.prototype.implements(_t.prototype),qi.prototype.mixin(a.Utility.SimpleSelectionMixin),qi.prototype.publish("paletteID","default","set","Color palette for this widget",qi.prototype._palette.switch(),{tags:["Basic","Shared"]}),qi.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});const Gi=(L(m=class extends Xe{constructor(){super()}enter(t,e){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(t,e)}},"_BubbleXY"),m);vt(Gi,"BubbleXY"),Gi.prototype._class+=" chart_BubbleXY";var Ui,Xi,Yi=0,Qi=0,Zi=0,Ji=0,Ki=0,tn=0,en="object"==typeof performance&&performance.now?performance:Date,nn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function on(){return Ki||(nn(sn),Ki=en.now()+tn)}function sn(){Ki=0}function an(){this._call=this._time=this._next=null}function rn(){on(),++Yi;for(var t,e=Ui;e;)(t=Ki-e._time)>=0&&e._call.call(null,t),e=e._next;--Yi}function ln(){Ki=(Ji=en.now())+tn,Yi=Qi=0;try{rn()}finally{Yi=0,cn(),Ki=0}}function hn(){var t=en.now(),e=t-Ji;e>1e3&&(tn-=e,Ji=t)}function cn(){for(var t,e,i=Ui,n=1/0;i;)i._call?(n>i._time&&(n=i._time),t=i,i=i._next):(e=i._next,i._next=null,i=t?t._next=e:Ui=e);Xi=t,un(n)}function un(t){Yi||(Qi&&(Qi=clearTimeout(Qi)),t-Ki>24?(t<1/0&&(Qi=setTimeout(ln,t-en.now()-tn)),Zi&&(Zi=clearInterval(Zi))):(Zi||(Ji=en.now(),Zi=setInterval(hn,1e3)),Yi=1,nn(ln)))}function pn(){var t="left",e=!1,i=!1,n=dn,o=fn,s=yn,r=380,l=30,h=He();function c(t){t.each(function(t,c){var u,p,d=n.call(this,t,c).slice().sort(a.descending),f=o.call(this,t,c).slice().sort(a.descending),y=s.call(this,t,c).slice().sort(a.descending),_=a.select(this),x=_.select("g.wrap");x.empty()&&(x=_.append("g").attr("class","wrap")),i?(u=l,p=r,x.attr("transform","rotate(90)translate(0,"+-r+")")):(u=r,p=l,x.attr("transform",null));var m=a.scaleLinear().domain([0,Math.max(d[0],f[0],y[0])]).range(e?[u,0]:[0,u]),g=this.__chart__||a.scaleLinear().domain([0,1/0]).range(m.range());this.__chart__=m;var b=_n(g),v=_n(m),w=x.selectAll("rect.range").data(d);w.enter().append("rect").attr("class",function(t,e){return"range s"+e}).attr("width",b).attr("height",p).attr("x",e?g:0).merge(w).transition(w).attr("x",e?m:0).attr("width",v).attr("height",p);var S=x.selectAll("rect.measure").data(y);S.enter().append("rect").attr("class",function(t,e){return"measure s"+e}).attr("width",b).attr("height",p/3).attr("x",e?g:0).attr("y",p/3).merge(S).transition(S).attr("width",v).attr("height",p/3).attr("x",e?m:0).attr("y",p/3);var k=x.selectAll("line.marker").data(f);k.enter().append("line").attr("class","marker").attr("x1",g).attr("x2",g).attr("y1",p/6).attr("y2",5*p/6).merge(k).transition(k).attr("x1",m).attr("x2",m).attr("y1",p/6).attr("y2",5*p/6);var A=_.selectAll("g.axis").data([0]);A.enter().append("g").attr("class","axis"),A.attr("transform",i?null:"translate(0,"+p+")").call(h.scale(m))}),rn()}return L(c,"u"),vt(c,"bulvar"),c.orient=function(n){return arguments.length?(e="right"==(t=n+"")||"bottom"===t,h.orient((i="top"===t||"bottom"===t)?"left":"bottom"),c):t},c.ranges=function(t){return arguments.length?(n=t,c):n},c.markers=function(t){return arguments.length?(o=t,c):o},c.measures=function(t){return arguments.length?(s=t,c):s},c.width=function(t){return arguments.length?(r=+t,c):r},c.height=function(t){return arguments.length?(l=+t,c):l},c.tickFormat=function(t){return arguments.length?(h.tickFormat(t),c):h.tickFormat()},c}function dn(t){return t.ranges}function fn(t){return t.markers}function yn(t){return t.measures}function _n(t){var e=t(0);return function(i){return Math.abs(t(i)-e)}}L(on,"Ei"),L(sn,"Oi"),L(an,"Ri"),L(rn,"Di"),L(ln,"ji"),L(hn,"Ni"),L(cn,"Li"),L(un,"Bi"),L(pn,"$i"),L(dn,"Hi"),L(fn,"qi"),L(yn,"Vi"),L(_n,"Wi"),vt(on,"now"),vt(sn,"clearNow"),vt(an,"Timer"),an.prototype={constructor:an,restart:vt(function(t,e,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?on():+i)+(null==e?0:+e),this._next||Xi===this||(Xi?Xi._next=this:Ui=this,Xi=this),this._call=t,this._time=i,un()},"restart"),stop:vt(function(){this._call&&(this._call=null,this._time=1/0,un())},"stop")},vt(rn,"timerFlush"),vt(ln,"wake"),vt(hn,"poke"),vt(cn,"nap"),vt(un,"sleep"),vt(pn,"d3Bullet"),vt(dn,"bulvarRanges"),vt(fn,"bulvarMarkers"),vt(yn,"bulvarMeasures"),vt(_n,"bulvarWidth");const xn=(g=class extends a.HTMLWidget{_hiddenColumns={};constructor(){super(),a.Utility.SimpleSelectionMixin.call(this,!0)}bulletData(){const t=this;this._hiddenColumns={};const e=this.columns();return this.data().map(function(t){return{title:i(t,this.titleColumn()),subtitle:i(t,this.subtitleColumn()),ranges:i(t,this.rangesColumn(),"range"),measures:i(t,this.measuresColumn(),"measure"),markers:i(t,this.markersColumn(),"marker"),origRow:t}},this);function i(i,n,o){const s=e.indexOf(n);return s>=0?i[s]instanceof Array?i[s]:[i[s]]:(o&&(t._hiddenColumns[o]=!0),[0])}}enter(t,e){super.enter(t,e),a.select(t.parentNode).style("overflow","auto"),this._selection.widgetElement(e)}update(t,e){super.update(t,e);const i=this;e.selectAll(".axis").style("display","none"),e.selectAll(".range,.measure,.marker").style("display",null);const n=this.width()-2-2,o=e.selectAll("svg").data(this.bulletData()),s=o.enter().append("svg").attr("class","bullet").call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.origRow),i.titleColumn(),i._selection.selected(this))}).each(function(){const t=a.select(this).append("g").attr("class",(t,e)=>"bulletBar series series-"+i.cssTag(i.titleColumn())).append("g").attr("class","bulletTitle");t.append("text").attr("class","title"),t.append("text").attr("class","subtitle").attr("dy","1em")}).merge(o),r=s.select(".bulletTitle").style("text-anchor","end").attr("transform","translate(-6,12)");r.select(".title").text(function(t){return t.title}),r.select(".subtitle").text(function(t){return t.subtitle});let l=0;r.each(function(){const t=this.getBBox();t.width>l&&(l=t.width)});const h=pn().width(n-l-6).height(24);s.attr("width",n).attr("height",40).style("margin-left","2px"),s.select(".bulletBar").attr("transform","translate("+(l+6)+",8)").call(h),o.exit().remove(),Object.keys(this._hiddenColumns).length>0&&e.selectAll(`.${Object.keys(this._hiddenColumns).join(",.")}`).style("display","none")}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}_selection},L(g,"_Bullet"),g);vt(xn,"Bullet");let mn=xn;mn.prototype._class+=" chart_Bullet",mn.prototype.publish("titleColumn",null,"set","Title Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("subtitleColumn",null,"set","Subtitle Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("rangesColumn",null,"set","Ranges Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("measuresColumn",null,"set","Measures Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("markersColumn",null,"set","Markers Column",function(){return this.columns()},{optional:!0});var gn=Array.prototype.slice;function bn(t,e){return t-e}function vn(t){for(var e=0,i=t.length,n=t[i-1][1]*t[0][0]-t[i-1][0]*t[0][1];++e<i;)n+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return n}function wn(t){return function(){return t}}function Sn(t,e){for(var i,n=-1,o=e.length;++n<o;)if(i=kn(t,e[n]))return i;return 0}function kn(t,e){for(var i=e[0],n=e[1],o=-1,s=0,a=t.length,r=a-1;s<a;r=s++){var l=t[s],h=l[0],c=l[1],u=t[r],p=u[0],d=u[1];if(An(l,u,e))return 0;c>n!=d>n&&i<(p-h)*(n-c)/(d-c)+h&&(o=-o)}return o}function An(t,e,i){var n;return Cn(t,e,i)&&Mn(t[n=+(t[0]===e[0])],i[n],e[n])}function Cn(t,e,i){return(e[0]-t[0])*(i[1]-t[1])===(i[0]-t[0])*(e[1]-t[1])}function Mn(t,e,i){return t<=e&&e<=i||i<=e&&e<=t}function Tn(){}L(bn,"Ui"),L(vn,"Qi"),L(wn,"Zi"),L(Sn,"Ji"),L(kn,"Ki"),L(An,"tn"),L(Cn,"en"),L(Mn,"nn"),L(Tn,"on"),vt(bn,"ascending"),vt(vn,"area"),vt(wn,"constant$1"),vt(Sn,"contains"),vt(kn,"ringContains"),vt(An,"segmentContains"),vt(Cn,"collinear"),vt(Mn,"within"),vt(Tn,"noop$2");var Pn=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function In(){var t=1,e=1,i=a.thresholdSturges,n=h;function o(t){var e=i(t);if(Array.isArray(e))e=e.slice().sort(bn);else{var n=a.extent(t),o=n[0],r=n[1];e=a.tickStep(o,r,e),e=a.range(Math.floor(o/e)*e,Math.floor(r/e)*e,e)}return e.map(function(e){return s(t,e)})}function s(t,e){var i=[],o=[];return r(t,e,function(s){n(s,t,e),vn(s)>0?i.push([s]):o.push(s)}),o.forEach(function(t){for(var e,n=0,o=i.length;n<o;++n)if(-1!==Sn((e=i[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:e,coordinates:i}}function r(i,n,o){var s,a,r,h,c,u,p=new Array,d=new Array;for(s=a=-1,h=i[0]>=n,Pn[h<<1].forEach(f);++s<t-1;)r=h,h=i[s+1]>=n,Pn[r|h<<1].forEach(f);for(Pn[0|h].forEach(f);++a<e-1;){for(s=-1,h=i[a*t+t]>=n,c=i[a*t]>=n,Pn[h<<1|c<<2].forEach(f);++s<t-1;)r=h,h=i[a*t+t+s+1]>=n,u=c,c=i[a*t+s+1]>=n,Pn[r|h<<1|c<<2|u<<3].forEach(f);Pn[h|c<<3].forEach(f)}for(s=-1,c=i[a*t]>=n,Pn[c<<2].forEach(f);++s<t-1;)u=c,c=i[a*t+s+1]>=n,Pn[c<<2|u<<3].forEach(f);function f(t){var e,i,n=[t[0][0]+s,t[0][1]+a],r=[t[1][0]+s,t[1][1]+a],h=l(n),c=l(r);(e=d[h])?(i=p[c])?(delete d[e.end],delete p[i.start],e===i?(e.ring.push(r),o(e.ring)):p[e.start]=d[i.end]={start:e.start,end:i.end,ring:e.ring.concat(i.ring)}):(delete d[e.end],e.ring.push(r),d[e.end=c]=e):(e=p[c])?(i=d[h])?(delete p[e.start],delete d[i.end],e===i?(e.ring.push(r),o(e.ring)):p[i.start]=d[e.end]={start:i.start,end:e.end,ring:i.ring.concat(e.ring)}):(delete p[e.start],e.ring.unshift(n),p[e.start=h]=e):p[h]=d[c]={start:h,end:c,ring:[n,r]}}L(f,"y"),Pn[c<<3].forEach(f),vt(f,"stitch")}function l(e){return 2*e[0]+e[1]*(t+1)*4}function h(i,n,o){i.forEach(function(i){var s,a=i[0],r=i[1],l=0|a,h=0|r,c=n[h*t+l];a>0&&a<t&&l===a&&(s=n[h*t+l-1],i[0]=a+(o-s)/(c-s)-.5),r>0&&r<e&&h===r&&(s=n[(h-1)*t+l],i[1]=r+(o-s)/(c-s)-.5)})}return L(o,"s"),L(s,"a"),L(r,"r"),L(l,"l"),L(h,"h"),vt(o,"contours"),vt(s,"contour"),vt(r,"isorings"),vt(l,"index"),vt(h,"smoothLinear"),o.contour=s,o.size=function(i){if(!arguments.length)return[t,e];var n=Math.ceil(i[0]),s=Math.ceil(i[1]);if(!(n>0&&s>0))throw new Error("invalid size");return t=n,e=s,o},o.thresholds=function(t){return arguments.length?(i="function"==typeof t?t:Array.isArray(t)?wn(gn.call(t)):wn(t),o):i},o.smooth=function(t){return arguments.length?(n=t?h:Tn,o):n===h},o}function En(t,e,i){for(var n=t.width,o=t.height,s=1+(i<<1),a=0;a<o;++a)for(var r=0,l=0;r<n+i;++r)r<n&&(l+=t.data[r+a*n]),r>=i&&(r>=s&&(l-=t.data[r-s+a*n]),e.data[r-i+a*n]=l/Math.min(r+1,n-1+s-r,s))}function Fn(t,e,i){for(var n=t.width,o=t.height,s=1+(i<<1),a=0;a<n;++a)for(var r=0,l=0;r<o+i;++r)r<o&&(l+=t.data[a+r*n]),r>=i&&(r>=s&&(l-=t.data[a+(r-s)*n]),e.data[a+(r-i)*n]=l/Math.min(r+1,o-1+s-r,s))}function Dn(t){return t[0]}function zn(t){return t[1]}function Rn(){return 1}function On(){var t=Dn,e=zn,i=Rn,n=960,o=500,s=20,r=2,l=3*s,h=n+2*l>>r,c=o+2*l>>r,u=wn(20);function p(n){var o=new Float32Array(h*c),p=new Float32Array(h*c);n.forEach(function(n,s,a){var u=+t(n,s,a)+l>>r,p=+e(n,s,a)+l>>r,d=+i(n,s,a);u>=0&&u<h&&p>=0&&p<c&&(o[u+p*h]+=d)}),En({width:h,height:c,data:o},{data:p},s>>r),Fn({width:h,height:c,data:p},{data:o},s>>r),En({width:h,height:c,data:o},{data:p},s>>r),Fn({width:h,height:c,data:p},{data:o},s>>r),En({width:h,height:c,data:o},{data:p},s>>r),Fn({width:h,height:c,data:p},{data:o},s>>r);var f=u(o);if(!Array.isArray(f)){var y=a.max(o);f=a.tickStep(0,y,f),(f=a.range(0,Math.floor(y/f)*f,f)).shift()}return In().thresholds(f).size([h,c])(o).map(d)}function d(t){return t.value*=Math.pow(2,-2*r),t.coordinates.forEach(f),t}function f(t){t.forEach(y)}function y(t){t.forEach(_)}function _(t){t[0]=t[0]*Math.pow(2,r)-l,t[1]=t[1]*Math.pow(2,r)-l}function x(){return h=n+2*(l=3*s)>>r,c=o+2*l>>r,p}return L(p,"p"),L(d,"d"),L(f,"f"),L(y,"y"),L(_,"_"),L(x,"x"),vt(p,"density"),vt(d,"transform"),vt(f,"transformPolygon"),vt(y,"transformRing"),vt(_,"transformPoint"),vt(x,"resize"),p.x=function(e){return arguments.length?(t="function"==typeof e?e:wn(+e),p):t},p.y=function(t){return arguments.length?(e="function"==typeof t?t:wn(+t),p):e},p.weight=function(t){return arguments.length?(i="function"==typeof t?t:wn(+t),p):i},p.size=function(t){if(!arguments.length)return[n,o];var e=Math.ceil(t[0]),i=Math.ceil(t[1]);if(!(e>=0||e>=0))throw new Error("invalid size");return n=e,o=i,x()},p.cellSize=function(t){if(!arguments.length)return 1<<r;if(!((t=+t)>=1))throw new Error("invalid cell size");return r=Math.floor(Math.log(t)/Math.LN2),x()},p.thresholds=function(t){return arguments.length?(u="function"==typeof t?t:Array.isArray(t)?wn(gn.call(t)):wn(t),p):u},p.bandwidth=function(t){if(!arguments.length)return Math.sqrt(s*(s+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return s=Math.round((Math.sqrt(4*t*t+1)-1)/2),x()},p}function jn(){return new Ln}function Ln(){this.reset()}L(In,"an"),L(En,"rn"),L(Fn,"ln"),L(Dn,"hn"),L(zn,"cn"),L(Rn,"un"),L(On,"pn"),L(jn,"dn"),L(Ln,"fn"),vt(In,"contours"),vt(En,"blurX"),vt(Fn,"blurY"),vt(Dn,"defaultX"),vt(zn,"defaultY"),vt(Rn,"defaultWeight"),vt(On,"d3ContourDensity"),vt(jn,"adder"),vt(Ln,"Adder"),Ln.prototype={constructor:Ln,reset:vt(function(){this.s=this.t=0},"reset"),add:vt(function(t){Bn(Nn,t,this.t),Bn(this,Nn.s,this.s),this.s?this.t+=Nn.t:this.s=Nn.t},"add"),valueOf:vt(function(){return this.s},"valueOf")};var Nn=new Ln;function Bn(t,e,i){var n=t.s=e+i,o=n-e,s=n-o;t.t=e-s+(i-o)}L(Bn,"_n"),vt(Bn,"add");var Vn=2*Math.PI,Hn=Math.abs,Wn=Math.sqrt;function $n(){}function qn(t,e){t&&Un.hasOwnProperty(t.type)&&Un[t.type](t,e)}L($n,"bn"),L(qn,"vn"),vt($n,"noop$1"),vt(qn,"streamGeometry");var Gn={Feature:vt(function(t,e){qn(t.geometry,e)},"Feature"),FeatureCollection:vt(function(t,e){for(var i=t.features,n=-1,o=i.length;++n<o;)qn(i[n].geometry,e)},"FeatureCollection")},Un={Sphere:vt(function(t,e){e.sphere()},"Sphere"),Point:vt(function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},"Point"),MultiPoint:vt(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)t=i[n],e.point(t[0],t[1],t[2])},"MultiPoint"),LineString:vt(function(t,e){Xn(t.coordinates,e,0)},"LineString"),MultiLineString:vt(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)Xn(i[n],e,0)},"MultiLineString"),Polygon:vt(function(t,e){Yn(t.coordinates,e)},"Polygon"),MultiPolygon:vt(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)Yn(i[n],e)},"MultiPolygon"),GeometryCollection:vt(function(t,e){for(var i=t.geometries,n=-1,o=i.length;++n<o;)qn(i[n],e)},"GeometryCollection")};function Xn(t,e,i){var n,o=-1,s=t.length-i;for(e.lineStart();++o<s;)n=t[o],e.point(n[0],n[1],n[2]);e.lineEnd()}function Yn(t,e){var i=-1,n=t.length;for(e.polygonStart();++i<n;)Xn(t[i],e,1);e.polygonEnd()}function Qn(t,e){t&&Gn.hasOwnProperty(t.type)?Gn[t.type](t,e):qn(t,e)}function Zn(t){return t}L(Xn,"An"),L(Yn,"kn"),L(Qn,"Mn"),L(Zn,"Pn"),vt(Xn,"streamLine"),vt(Yn,"streamPolygon"),vt(Qn,"geoStream"),vt(Zn,"identity");var Jn,Kn,to,eo,io=jn(),no=jn(),oo={point:$n,lineStart:$n,lineEnd:$n,polygonStart:vt(function(){oo.lineStart=so,oo.lineEnd=lo},"polygonStart"),polygonEnd:vt(function(){oo.lineStart=oo.lineEnd=oo.point=$n,io.add(Hn(no)),no.reset()},"polygonEnd"),result:vt(function(){var t=io/2;return io.reset(),t},"result")};function so(){oo.point=ao}function ao(t,e){oo.point=ro,Jn=to=t,Kn=eo=e}function ro(t,e){no.add(eo*t-to*e),to=t,eo=e}function lo(){ro(Jn,Kn)}L(so,"Rn"),L(ao,"Dn"),L(ro,"jn"),L(lo,"Nn"),vt(so,"areaRingStart"),vt(ao,"areaPointFirst"),vt(ro,"areaPoint"),vt(lo,"areaRingEnd");var ho=1/0,co=ho,uo=-ho,po=uo,fo={point:yo,lineStart:$n,lineEnd:$n,polygonStart:$n,polygonEnd:$n,result:vt(function(){var t=[[ho,co],[uo,po]];return uo=po=-(co=ho=1/0),t},"result")};function yo(t,e){t<ho&&(ho=t),t>uo&&(uo=t),e<co&&(co=e),e>po&&(po=e)}L(yo,"Vn"),vt(yo,"boundsPoint");var _o,xo,mo,go,bo=0,vo=0,wo=0,So=0,ko=0,Ao=0,Co=0,Mo=0,To=0,Po={point:Io,lineStart:Eo,lineEnd:zo,polygonStart:vt(function(){Po.lineStart=Ro,Po.lineEnd=Oo},"polygonStart"),polygonEnd:vt(function(){Po.point=Io,Po.lineStart=Eo,Po.lineEnd=zo},"polygonEnd"),result:vt(function(){var t=To?[Co/To,Mo/To]:Ao?[So/Ao,ko/Ao]:wo?[bo/wo,vo/wo]:[NaN,NaN];return bo=vo=wo=So=ko=Ao=Co=Mo=To=0,t},"result")};function Io(t,e){bo+=t,vo+=e,++wo}function Eo(){Po.point=Fo}function Fo(t,e){Po.point=Do,Io(mo=t,go=e)}function Do(t,e){var i=t-mo,n=e-go,o=Wn(i*i+n*n);So+=o*(mo+t)/2,ko+=o*(go+e)/2,Ao+=o,Io(mo=t,go=e)}function zo(){Po.point=Io}function Ro(){Po.point=jo}function Oo(){Lo(_o,xo)}function jo(t,e){Po.point=Lo,Io(_o=mo=t,xo=go=e)}function Lo(t,e){var i=t-mo,n=e-go,o=Wn(i*i+n*n);So+=o*(mo+t)/2,ko+=o*(go+e)/2,Ao+=o,Co+=(o=go*t-mo*e)*(mo+t),Mo+=o*(go+e),To+=3*o,Io(mo=t,go=e)}function No(t){this._context=t}L(Io,"so"),L(Eo,"ao"),L(Fo,"ro"),L(Do,"lo"),L(zo,"ho"),L(Ro,"co"),L(Oo,"uo"),L(jo,"po"),L(Lo,"fo"),L(No,"yo"),vt(Io,"centroidPoint"),vt(Eo,"centroidLineStart"),vt(Fo,"centroidPointFirstLine"),vt(Do,"centroidPointLine"),vt(zo,"centroidLineEnd"),vt(Ro,"centroidRingStart"),vt(Oo,"centroidRingEnd"),vt(jo,"centroidPointFirstRing"),vt(Lo,"centroidPointRing"),vt(No,"PathContext"),No.prototype={_radius:4.5,pointRadius:vt(function(t){return this._radius=t,this},"pointRadius"),polygonStart:vt(function(){this._line=0},"polygonStart"),polygonEnd:vt(function(){this._line=NaN},"polygonEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){0===this._line&&this._context.closePath(),this._point=NaN},"lineEnd"),point:vt(function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Vn)}},"point"),result:$n};var Bo,Vo,Ho,Wo,$o,qo=jn(),Go={point:$n,lineStart:vt(function(){Go.point=Uo},"lineStart"),lineEnd:vt(function(){Bo&&Xo(Vo,Ho),Go.point=$n},"lineEnd"),polygonStart:vt(function(){Bo=!0},"polygonStart"),polygonEnd:vt(function(){Bo=null},"polygonEnd"),result:vt(function(){var t=+qo;return qo.reset(),t},"result")};function Uo(t,e){Go.point=Xo,Vo=Wo=t,Ho=$o=e}function Xo(t,e){Wo-=t,$o-=e,qo.add(Wn(Wo*Wo+$o*$o)),Wo=t,$o=e}function Yo(){this._string=[]}function Qo(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Zo(t,e){var i,n,o=4.5;function s(t){return t&&("function"==typeof o&&n.pointRadius(+o.apply(this,arguments)),Qn(t,i(n))),n.result()}return L(s,"a"),vt(s,"path"),s.area=function(t){return Qn(t,i(oo)),oo.result()},s.measure=function(t){return Qn(t,i(Go)),Go.result()},s.bounds=function(t){return Qn(t,i(fo)),fo.result()},s.centroid=function(t){return Qn(t,i(Po)),Po.result()},s.projection=function(e){return arguments.length?(i=null==e?(t=null,Zn):(t=e).stream,s):t},s.context=function(t){return arguments.length?(n=null==t?(e=null,new Yo):new No(e=t),"function"!=typeof o&&n.pointRadius(o),s):e},s.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(n.pointRadius(+t),+t),s):o},s.projection(t).context(e)}L(Uo,"So"),L(Xo,"Ao"),L(Yo,"ko"),L(Qo,"Mo"),L(Zo,"Po"),vt(Uo,"lengthPointFirst"),vt(Xo,"lengthPoint"),vt(Yo,"PathString"),Yo.prototype={_radius:4.5,_circle:Qo(4.5),pointRadius:vt(function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},"pointRadius"),polygonStart:vt(function(){this._line=0},"polygonStart"),polygonEnd:vt(function(){this._line=NaN},"polygonEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){0===this._line&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:vt(function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Qo(this._radius)),this._string.push("M",t,",",e,this._circle)}},"point"),result:vt(function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null},"result")},vt(Qo,"circle"),vt(Zo,"geoPath");const Jo=(L(b=class extends Ge{_dataMinWeight;_dataMaxWeight;constructor(){super(),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerEnter(t,e,i=250){super.layerEnter(t,e,i)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i),this._palette=this._palette.switch(this.paletteID());const n=this.flattenData(this.layerColumns(t),this.layerData(t)),o=On().x(e=>this.xPos(t,e)).y(e=>this.yPos(t,e)).size([this.width(),this.height()]).bandwidth(this.contourBandwidth())(n),s=o.map(t=>t.value),a=Math.min.apply(this,s),r=Math.max.apply(this,s);this._dataMinWeight=a,this._dataMaxWeight=r;const l=e.selectAll("path").data(o);l.enter().append("path").merge(l).attr("d",Zo()).attr("fill",t=>this.showContourFill()?this._palette(t.value,a,r):"none").attr("stroke",this.contourStrokeColor()).attr("stroke-linejoin","round").attr("stroke-width",this.contourStrokeWidth()),l.exit().remove()}exit(t,e){super.exit(t,e)}},"_Contour"),b);vt(Jo,"Contour"),wt(Jo,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let Ko=Jo;Ko.prototype._class+=" chart_Contour",Ko.prototype.implements(lt.prototype),Ko.prototype.publish("paletteID","YlGnBu","string","Color palette for this widget"),Ko.prototype.publish("useClonedPalette",!0,"boolean","Enable or disable using a cloned palette"),Ko.prototype.publish("showContourFill",!0,"boolean","Show/hide the contour background colors"),Ko.prototype.publish("showContour",!0,"boolean","Show/hide the contour border lines"),Ko.prototype.publish("contourBandwidth",40,"number","Controls the sensitivity of the contour grouping algorithm"),Ko.prototype.publish("contourStrokeColor","#2C3A47","html-color","Color of the contour border lines"),Ko.prototype.publish("contourStrokeWidth",1,"number","Width of the contour border lines");const ts=(L(v=class extends Ke{constructor(){super(),this.orientation_default("vertical").xAxisType_default("ordinal").yAxisType_default("time")}},"_Gantt"),v);vt(ts,"Gantt");let es=ts;function is(t){return vt(function(){return t},"constant")}L(is,"Io"),es.prototype._class+=" chart_Gantt",vt(is,"constant");var ns=1e-12,os=Math.PI,ss=os/2,as=2*os;function rs(t){return t.innerRadius}function ls(t){return t.outerRadius}function hs(t){return t.startAngle}function cs(t){return t.endAngle}function us(t){return t&&t.padAngle}function ps(t){return t>=1?ss:t<=-1?-ss:Math.asin(t)}function ds(t,e,i,n,o,s,a,r){var l=i-t,h=n-e,c=a-o,u=r-s,p=(c*(e-s)-u*(t-o))/(u*l-c*h);return[t+p*l,e+p*h]}function fs(t,e,i,n,o,s,a){var r=t-i,l=e-n,h=(a?s:-s)/Math.sqrt(r*r+l*l),c=h*l,u=-h*r,p=t+c,d=e+u,f=i+c,y=n+u,_=(p+f)/2,x=(d+y)/2,m=f-p,g=y-d,b=m*m+g*g,v=o-s,w=p*y-f*d,S=(g<0?-1:1)*Math.sqrt(Math.max(0,v*v*b-w*w)),k=(w*g-m*S)/b,A=(-w*m-g*S)/b,C=(w*g+m*S)/b,M=(-w*m+g*S)/b,T=k-_,P=A-x,I=C-_,E=M-x;return T*T+P*P>I*I+E*E&&(k=C,A=M),{cx:k,cy:A,x01:-c,y01:-u,x11:k*(o/v-1),y11:A*(o/v-1)}}function ys(){var t=rs,e=ls,i=is(0),n=null,o=hs,s=cs,a=us,r=null;function l(){var l,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),p=o.apply(this,arguments)-ss,d=s.apply(this,arguments)-ss,f=Math.abs(d-p),y=d>p;if(r||(r=l=Tt()),u<c&&(h=u,u=c,c=h),u>ns)if(f>as-ns)r.moveTo(u*Math.cos(p),u*Math.sin(p)),r.arc(0,0,u,p,d,!y),c>ns&&(r.moveTo(c*Math.cos(d),c*Math.sin(d)),r.arc(0,0,c,d,p,y));else{var _,x,m=p,g=d,b=p,v=d,w=f,S=f,k=a.apply(this,arguments)/2,A=k>ns&&(n?+n.apply(this,arguments):Math.sqrt(c*c+u*u)),C=Math.min(Math.abs(u-c)/2,+i.apply(this,arguments)),M=C,T=C;if(A>ns){var P=ps(A/c*Math.sin(k)),I=ps(A/u*Math.sin(k));(w-=2*P)>ns?(b+=P*=y?1:-1,v-=P):(w=0,b=v=(p+d)/2),(S-=2*I)>ns?(m+=I*=y?1:-1,g-=I):(S=0,m=g=(p+d)/2)}var E=u*Math.cos(m),F=u*Math.sin(m),D=c*Math.cos(v),z=c*Math.sin(v);if(C>ns){var R=u*Math.cos(g),O=u*Math.sin(g),j=c*Math.cos(b),L=c*Math.sin(b);if(f<os){var N=w>ns?ds(E,F,j,L,R,O,D,z):[D,z],B=E-N[0],V=F-N[1],H=R-N[0],W=O-N[1],$=1/Math.sin(Math.acos((B*H+V*W)/(Math.sqrt(B*B+V*V)*Math.sqrt(H*H+W*W)))/2),q=Math.sqrt(N[0]*N[0]+N[1]*N[1]);M=Math.min(C,(c-q)/($-1)),T=Math.min(C,(u-q)/($+1))}}S>ns?T>ns?(_=fs(j,L,E,F,u,T,y),x=fs(R,O,D,z,u,T,y),r.moveTo(_.cx+_.x01,_.cy+_.y01),T<C?r.arc(_.cx,_.cy,T,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,T,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),r.arc(0,0,u,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),!y),r.arc(x.cx,x.cy,T,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):(r.moveTo(E,F),r.arc(0,0,u,m,g,!y)):r.moveTo(E,F),c>ns&&w>ns?M>ns?(_=fs(D,z,R,O,c,-M,y),x=fs(E,F,j,L,c,-M,y),r.lineTo(_.cx+_.x01,_.cy+_.y01),M<C?r.arc(_.cx,_.cy,M,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,M,Math.atan2(_.y01,_.x01),Math.atan2(_.y11,_.x11),!y),r.arc(0,0,c,Math.atan2(_.cy+_.y11,_.cx+_.x11),Math.atan2(x.cy+x.y11,x.cx+x.x11),y),r.arc(x.cx,x.cy,M,Math.atan2(x.y11,x.x11),Math.atan2(x.y01,x.x01),!y))):r.arc(0,0,c,v,b,y):r.lineTo(D,z)}else r.moveTo(0,0);if(r.closePath(),l)return r=null,l+""||null}return L(l,"h"),vt(l,"arc"),l.centroid=function(){var i=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,n=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-os/2;return[Math.cos(n)*i,Math.sin(n)*i]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:is(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:is(+t),l):e},l.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:is(+t),l):i},l.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:is(+t),l):n},l.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:is(+t),l):o},l.endAngle=function(t){return arguments.length?(s="function"==typeof t?t:is(+t),l):s},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:is(+t),l):a},l.context=function(t){return arguments.length?(r=null==t?null:t,l):r},l}function _s(t){this._context=t}function xs(t){return new _s(t)}function ms(t){return t[0]}function gs(t){return t[1]}function bs(){var t=ms,e=gs,i=is(!0),n=null,o=xs,s=null;function a(a){var r,l,h,c=a.length,u=!1;for(null==n&&(s=o(h=Tt())),r=0;r<=c;++r)!(r<c&&i(l=a[r],r,a))===u&&((u=!u)?s.lineStart():s.lineEnd()),u&&s.point(+t(l,r,a),+e(l,r,a));if(h)return s=null,h+""||null}return L(a,"r"),vt(a,"line"),a.x=function(e){return arguments.length?(t="function"==typeof e?e:is(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:is(+t),a):e},a.defined=function(t){return arguments.length?(i="function"==typeof t?t:is(!!t),a):i},a.curve=function(t){return arguments.length?(o=t,null!=n&&(s=o(n)),a):o},a.context=function(t){return arguments.length?(null==t?n=s=null:s=o(n=t),a):n},a}function vs(){}function ws(t,e,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6)}function Ss(t){this._context=t}function ks(t,e){this._basis=new Ss(t),this._beta=e}function As(t,e,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function Cs(t,e){this._context=t,this._k=(1-e)/6}function Ms(t,e){this._context=t,this._k=(1-e)/6}function Ts(t,e){this._context=t,this._k=(1-e)/6}function Ps(t,e,i){var n=t._x1,o=t._y1,s=t._x2,a=t._y2;if(t._l01_a>ns){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);n=(n*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>ns){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*h+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*h+t._y1*t._l23_2a-i*t._l12_2a)/c}t._context.bezierCurveTo(n,o,s,a,t._x2,t._y2)}function Is(t,e){this._context=t,this._alpha=e}L(rs,"jo"),L(ls,"No"),L(hs,"Lo"),L(cs,"Bo"),L(us,"$o"),L(ps,"Ho"),L(ds,"qo"),L(fs,"Vo"),L(ys,"Wo"),L(_s,"Go"),L(xs,"Xo"),L(ms,"Yo"),L(gs,"Uo"),L(bs,"Qo"),L(vs,"Zo"),L(ws,"Jo"),L(Ss,"Ko"),L(ks,"ts"),L(As,"es"),L(Cs,"is"),L(Ms,"ns"),L(Ts,"os"),L(Ps,"ss"),L(Is,"as"),vt(rs,"arcInnerRadius"),vt(ls,"arcOuterRadius"),vt(hs,"arcStartAngle"),vt(cs,"arcEndAngle"),vt(us,"arcPadAngle"),vt(ps,"asin"),vt(ds,"intersect"),vt(fs,"cornerTangents"),vt(ys,"arc"),vt(_s,"Linear"),_s.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}},"point")},vt(xs,"curveLinear"),vt(ms,"x"),vt(gs,"y"),vt(bs,"line"),vt(vs,"noop"),vt(ws,"point$3"),vt(Ss,"Basis"),Ss.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 3:ws(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ws(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},vt(ks,"Bundle"),ks.prototype={lineStart:vt(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:vt(function(){var t=this._x,e=this._y,i=t.length-1;if(i>0)for(var n,o=t[0],s=e[0],a=t[i]-o,r=e[i]-s,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*t[l]+(1-this._beta)*(o+n*a),this._beta*e[l]+(1-this._beta)*(s+n*r));this._x=this._y=null,this._basis.lineEnd()},"lineEnd"),point:vt(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},vt(As,"point$2"),vt(Cs,"Cardinal"),Cs.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:As(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:As(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},vt(Ms,"CardinalClosed"),Ms.prototype={areaStart:vs,areaEnd:vs,lineStart:vt(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:As(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},vt(Ts,"CardinalOpen"),Ts.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:As(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},vt(Ps,"point$1"),vt(Is,"CatmullRom"),Is.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Ps(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")};const Es=vt(L(function t(e){function i(t){return e?new Is(t,e):new Cs(t,0)}return L(i,"n"),vt(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"t"),"custom")(.5);function Fs(t,e){this._context=t,this._alpha=e}function Ds(t,e){this._context=t,this._alpha=e}function zs(t){return t<0?-1:1}function Rs(t,e,i){var n=t._x1-t._x0,o=e-t._x1,s=(t._y1-t._y0)/(n||o<0&&-0),a=(i-t._y1)/(o||n<0&&-0),r=(s*o+a*n)/(n+o);return(zs(s)+zs(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(r))||0}function Os(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function js(t,e,i){var n=t._x0,o=t._y0,s=t._x1,a=t._y1,r=(s-n)/3;t._context.bezierCurveTo(n+r,o+r*e,s-r,a-r*i,s,a)}function Ls(t){this._context=t}L(Fs,"ls"),L(Ds,"hs"),L(zs,"cs"),L(Rs,"us"),L(Os,"ps"),L(js,"ds"),L(Ls,"fs"),vt(Fs,"CatmullRomClosed"),Fs.prototype={areaStart:vs,areaEnd:vs,lineStart:vt(function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},"lineEnd"),point:vt(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ps(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},vt(Ds,"CatmullRomOpen"),Ds.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},"lineStart"),lineEnd:vt(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){if(t=+t,e=+e,this._point){var i=this._x2-t,n=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ps(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e},"point")},vt(zs,"sign"),vt(Rs,"slope3"),vt(Os,"slope2"),vt(js,"point"),vt(Ls,"MonotoneX"),Ls.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:js(this,this._t0,Os(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(function(t,e){var i=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,js(this,Os(this,i=Rs(this,t,e)),i);break;default:js(this,this._t0,i=Rs(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(Ls.prototype).point=function(t,e){Ls.prototype.point.call(this,e,t)};var Ns="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bs=vt(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},"classCallCheck"),Vs=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return L(t,"t"),vt(t,"defineProperties"),function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Hs=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},Ws=vt(L(function t(e,i,n){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,i);if(void 0===o){var s=Object.getPrototypeOf(e);return null===s?void 0:t(s,i,n)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(n):void 0},"t"),"get"),$s=vt(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},"inherits"),qs=vt(function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},"possibleConstructorReturn"),Gs=vt(function(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)},"toConsumableArray"),Us=function(){function t(e){var i=e.x,n=void 0===i?0:i,o=e.y,s=void 0===o?0:o,a=e.nx,r=e.ny,l=e.dy,h=void 0===l?0:l,c=e.dx,u=void 0===c?0:c,p=e.color,d=void 0===p?"grey":p,f=e.data,y=e.type,_=e.subject,x=e.connector,m=e.note,g=e.disable,b=e.id,v=e.className;Bs(this,t),this._dx=void 0!==a?a-n:u,this._dy=void 0!==r?r-s:h,this._x=n,this._y=s,this._color=d,this.id=b,this._className=v||"",this._type=y||"",this.data=f,this.note=m||{},this.connector=x||{},this.subject=_||{},this.disable=g||[]}return L(t,"t"),vt(t,"Annotation"),Vs(t,[{key:"updatePosition",value:vt(function(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&0!==this.type.subject.selectAll(":not(.handle)").nodes().length&&this.type.redrawSubject())},"updatePosition")},{key:"clearComponents",value:vt(function(){this.type.clearComponents&&this.type.clearComponents()},"clearComponents")},{key:"updateOffset",value:vt(function(){this.type.setOffset&&(this.type.setOffset(),0!==this.type.connector.selectAll(":not(.handle)").nodes().length&&this.type.redrawConnector(),this.type.redrawNote())},"updateOffset")},{key:"className",get:vt(function(){return this._className},"get$$1"),set:vt(function(t){this._className=t,this.type.setClassName&&this.type.setClassName()},"set$$1")},{key:"type",get:vt(function(){return this._type},"get$$1"),set:vt(function(t){this._type=t,this.clearComponents()},"set$$1")},{key:"x",get:vt(function(){return this._x},"get$$1"),set:vt(function(t){this._x=t,this.updatePosition()},"set$$1")},{key:"y",get:vt(function(){return this._y},"get$$1"),set:vt(function(t){this._y=t,this.updatePosition()},"set$$1")},{key:"color",get:vt(function(){return this._color},"get$$1"),set:vt(function(t){this._color=t,this.updatePosition()},"set$$1")},{key:"dx",get:vt(function(){return this._dx},"get$$1"),set:vt(function(t){this._dx=t,this.updateOffset()},"set$$1")},{key:"dy",get:vt(function(){return this._dy},"get$$1"),set:vt(function(t){this._dy=t,this.updateOffset()},"set$$1")},{key:"nx",set:vt(function(t){this._dx=t-this._x,this.updateOffset()},"set$$1")},{key:"ny",set:vt(function(t){this._dy=t-this._y,this.updateOffset()},"set$$1")},{key:"offset",get:vt(function(){return{x:this._dx,y:this._dy}},"get$$1"),set:vt(function(t){var e=t.x,i=t.y;this._dx=e,this._dy=i,this.updateOffset()},"set$$1")},{key:"position",get:vt(function(){return{x:this._x,y:this._y}},"get$$1"),set:vt(function(t){var e=t.x,i=t.y;this._x=e,this._y=i,this.updatePosition()},"set$$1")},{key:"translation",get:vt(function(){return{x:this._x+this._dx,y:this._y+this._dy}},"get$$1")},{key:"json",get:vt(function(){var t={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(t.data=this.data),this.type&&(t.type=this.type),this._className&&(t.className=this._className),Object.keys(this.connector).length>0&&(t.connector=this.connector),Object.keys(this.subject).length>0&&(t.subject=this.subject),Object.keys(this.note).length>0&&(t.note=this.note),t},"get$$1")}]),t}(),Xs=function(){function t(e){var i=e.annotations,n=e.accessors,o=e.accessorsInverse;Bs(this,t),this.accessors=n,this.accessorsInverse=o,this.annotations=i}return L(t,"t"),vt(t,"AnnotationCollection"),Vs(t,[{key:"clearTypes",value:vt(function(t){this.annotations.forEach(function(e){e.type=void 0,e.subject=t&&t.subject||e.subject,e.connector=t&&t.connector||e.connector,e.note=t&&t.note||e.note})},"clearTypes")},{key:"setPositionWithAccessors",value:vt(function(){var t=this;this.annotations.forEach(function(e){e.type.setPositionWithAccessors(t.accessors)})},"setPositionWithAccessors")},{key:"editMode",value:vt(function(t){this.annotations.forEach(function(e){e.type&&(e.type.editMode=t,e.type.updateEditMode())})},"editMode")},{key:"updateDisable",value:vt(function(t){this.annotations.forEach(function(e){e.disable=t,e.type&&t.forEach(function(t){e.type[t]&&(e.type[t].remove&&e.type[t].remove(),e.type[t]=void 0)})})},"updateDisable")},{key:"updateTextWrap",value:vt(function(t){this.annotations.forEach(function(e){e.type&&e.type.updateTextWrap&&e.type.updateTextWrap(t)})},"updateTextWrap")},{key:"updateText",value:vt(function(){this.annotations.forEach(function(t){t.type&&t.type.drawText&&t.type.drawText()})},"updateText")},{key:"updateNotePadding",value:vt(function(t){this.annotations.forEach(function(e){e.type&&(e.type.notePadding=t)})},"updateNotePadding")},{key:"json",get:vt(function(){var t=this;return this.annotations.map(function(e){var i=e.json;return t.accessorsInverse&&e.data&&(i.data={},Object.keys(t.accessorsInverse).forEach(function(n){i.data[n]=t.accessorsInverse[n]({x:e.x,y:e.y})})),i})},"get$$1")},{key:"noteNodes",get:vt(function(){return this.annotations.map(function(t){return Hs({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})})},"get$$1")}]),t}(),Ys=vt(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy;return{move:{x:i,y:void 0===n?0:n}}},"pointHandle"),Qs=vt(function(t){var e=t.cx,i=void 0===e?0:e,n=t.cy,o=void 0===n?0:n,s=t.r1,a=t.r2,r=t.padding,l={move:{x:i,y:o}};return void 0!==s&&(l.r1={x:i+s/Math.sqrt(2),y:o+s/Math.sqrt(2)}),void 0!==a&&(l.r2={x:i+a/Math.sqrt(2),y:o+a/Math.sqrt(2)}),void 0!==r&&(l.padding={x:i+s+r,y:o}),l},"circleHandles"),Zs=vt(function(t){var e=t.group,i=t.handles,n=t.r,o=void 0===n?10:n,s=e.selectAll("circle.handle").data(i);s.enter().append("circle").attr("class","handle").attr("fill","grey").attr("fill-opacity",.1).attr("cursor","move").attr("stroke-dasharray",5).attr("stroke","grey").call(a.drag().container(a.select("g.annotations").node()).on("start",function(t){return t.start&&t.start(t)}).on("drag",function(t){return t.drag&&t.drag(t)}).on("end",function(t){return t.end&&t.end(t)})),e.selectAll("circle.handle").attr("cx",function(t){return t.x}).attr("cy",function(t){return t.y}).attr("r",function(t){return t.r||o}).attr("class",function(t){return"handle "+(t.className||"")}),s.exit().remove()},"addHandles"),Js=vt(function(t,e){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},"leftRightDynamic"),Ks=vt(function(t,e){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},"topBottomDynamic"),ta=["topBottom","top","bottom"],ea=["leftRight","left","right"],ia=vt(function(t){var e=t.padding,i=void 0===e?0:e,n=t.bbox,o=void 0===n?{x:0,width:0,height:0}:n,s=t.align,a=t.orientation,r=t.offset,l=void 0===r?{x:0,y:0}:r,h=-o.x,c=0;return-1!==ta.indexOf(a)?(s=Ks(s,l.x),l.y<0&&"topBottom"===a||"top"===a?c-=o.height+i:c+=i,"middle"===s?h-=o.width/2:"right"===s&&(h-=o.width)):-1!==ea.indexOf(a)&&(s=Js(s,l.y),l.x<0&&"leftRight"===a||"left"===a?h-=o.width+i:h+=i,"middle"===s?c-=o.height/2:"top"===s&&(c-=o.height)),{x:h,y:c}},"noteAlignment"),na=vt(function(t){var e=t.data,i=t.curve,n=void 0===i?xs:i,o=t.canvasContext,s=t.className,a=t.classID,r=bs().curve(n),l={type:"path",className:s,classID:a,data:e};return o?(r.context(o),l.pathMethods=r):l.attrs={d:r(e)},l},"lineBuilder"),oa=vt(function(t){var e=t.data,i=t.canvasContext,n={type:"path",className:t.className,classID:t.classID,data:e},o=ys().innerRadius(e.innerRadius||0).outerRadius(e.outerRadius||e.radius||2).startAngle(e.startAngle||0).endAngle(e.endAngle||2*Math.PI);return i?(o.context(i),n.pathMethods=lineGen):n.attrs={d:o()},n},"arcBuilder"),sa=vt(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,s=void 0===o?0:o,a=t.bbox,r=t.offset;"top"===(e=Js(e,r.y))?s-=a.height:"middle"===e&&(s-=a.height/2);var l=[[n,s],[n,s+a.height]];return{components:[na({data:l,className:"note-line"})]}},"noteVertical"),aa=vt(function(t){var e=t.align,i=t.x,n=void 0===i?0:i,o=t.y,s=void 0===o?0:o,a=t.offset,r=t.bbox;"right"===(e=Ks(e,a.x))?n-=r.width:"middle"===e&&(n-=r.width/2);var l=[[n,s],[n+r.width,s]];return{components:[na({data:l,className:"note-line"})]}},"noteHorizontal"),ra=vt(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,s=n.x-o.x,a=s+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("circle"===i&&(h.outerRadius||h.radius)){var c=Math.sqrt((s-a)*(s-a)+(r-l)*(r-l)),u=Math.asin(-l/c),p=h.outerRadius||h.radius+(h.radiusPadding||0);s=Math.abs(Math.cos(u)*p)*(a<0?-1:1),r=Math.abs(Math.sin(u)*p)*(l<0?-1:1)}if("rect"===i){var d=h.width,f=h.height;(d>0&&n.dx>0||d<0&&n.dx<0)&&(s=Math.abs(d)>Math.abs(n.dx)?d/2:d),(f>0&&n.dy>0||f<0&&n.dy<0)&&(r=Math.abs(f)>Math.abs(n.dy)?f/2:f),s===d/2&&r===f/2&&(s=a,r=l)}return[[s,r],[a,l]]},"lineSetup"),la=vt(function(t){var e=ra(t);return{components:[na({data:e,className:"connector"})]}},"connectorLine"),ha=vt(function(t){var e=t.type,i=t.subjectType,n=e.annotation,o=n.position,s=n.x-o.x,a=s+n.dx,r=n.y-o.y,l=r+n.dy,h=n.subject;if("rect"===i){var c=h.width,u=h.height;(c>0&&n.dx>0||c<0&&n.dx<0)&&(s=Math.abs(c)>Math.abs(n.dx)?c/2:c),(u>0&&n.dy>0||u<0&&n.dy<0)&&(r=Math.abs(u)>Math.abs(n.dy)?u/2:u),s===c/2&&r===u/2&&(s=a,r=l)}var p=[[s,r],[a,l]],d=l-r,f=a-s,y=a,_=l,x=l<r&&a>s||a<s&&l>r?-1:1;if(Math.abs(f)<Math.abs(d)?(y=a,_=r+f*x):(_=l,y=s+d*x),"circle"===i&&(h.outerRadius||h.radius)){var m=(h.outerRadius||h.radius)+(h.radiusPadding||0),g=m/Math.sqrt(2);if(Math.abs(f)>g&&Math.abs(d)>g)p=[[s=g*(a<0?-1:1),r=g*(l<0?-1:1)],[y,_],[a,l]];else if(Math.abs(f)>Math.abs(d)){var b=Math.asin(-l/m);p=[[s=Math.abs(Math.cos(b)*m)*(a<0?-1:1),l],[a,l]]}else{var v=Math.acos(a/m);p=[[a,r=Math.abs(Math.sin(v)*m)*(l<0?-1:1)],[a,l]]}}else p=[[s,r],[y,_],[a,l]];return{components:[na({data:p,className:"connector"})]}},"connectorElbow"),ca=vt(function(t){var e=t.type,i=t.connectorData,n=t.subjectType;i||(i={}),i.points&&"number"!=typeof i.points||(i.points=ua(e.annotation.offset,i.points)),i.curve||(i.curve=Es);var o=[];if(e.editMode){var s=i.points.map(function(t,e){return Hs({},Ys({cx:t[0],cy:t[1]}),{index:e})}),r=vt(function(t){i.points[t][0]+=a.event.dx,i.points[t][1]+=a.event.dy,e.redrawConnector()},"updatePoint");o=e.mapHandles(s.map(function(t){return Hs({},t.move,{drag:r.bind(e,t.index)})}))}var l=ra({type:e,subjectType:n});return l=[l[0]].concat(Gs(i.points),[l[1]]),{components:[na({data:l,curve:i.curve,className:"connector"})],handles:o}},"connectorCurve"),ua=vt(function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=t.x/(e+1),n=t.y/(e+1),o=[],s=1;s<=e;s++)o.push([i*s+s%2*20,n*s-s%2*20]);return o},"createPoints"),pa=vt(function(t){var e=t.annotation,i=t.start,n=t.end,o=t.scale,s=void 0===o?1:o,a=e.position;i=i?[-n[0]+i[0],-n[1]+i[1]]:[e.dx,e.dy],n||(n=[e.x-a.x,e.y-a.y]);var r=n[0],l=n[1],h=i[0],c=i[1],u=10*s,p=16/180*Math.PI,d=Math.atan(c/h);h<0&&(d+=Math.PI);var f=[[r,l],[Math.cos(d+p)*u+r,Math.sin(d+p)*u+l],[Math.cos(d-p)*u+r,Math.sin(d-p)*u+l],[r,l]];return{components:[na({data:f,className:"connector-end connector-arrow",classID:"connector-end"})]}},"connectorArrow"),da=vt(function(t){var e=t.line,i=t.scale,n=void 0===i?1:i,o=oa({className:"connector-end connector-dot",classID:"connector-end",data:{radius:3*Math.sqrt(n)}});return o.attrs.transform="translate("+e.data[0][0]+", "+e.data[0][1]+")",{components:[o]}},"connectorDot"),fa=vt(function(t){var e=t.subjectData,i=t.type;e.radius||e.outerRadius||(e.radius=20);var n=[],o=oa({data:e,className:"subject"});if(i.editMode){var s=Qs({r1:o.data.outerRadius||o.data.radius,r2:o.data.innerRadius,padding:e.radiusPadding}),r=vt(function(t){var n=e[t]+a.event.dx*Math.sqrt(2);e[t]=n,i.redrawSubject(),i.redrawConnector()},"updateRadius"),l=[Hs({},s.r1,{drag:r.bind(i,void 0!==e.outerRadius?"outerRadius":"radius")})];e.innerRadius&&l.push(Hs({},s.r2,{drag:r.bind(i,"innerRadius")})),n=i.mapHandles(l)}return o.attrs["fill-opacity"]=0,{components:[o],handles:n}},"subjectCircle"),ya=vt(function(t){var e=t.subjectData,i=t.type;e.width||(e.width=100),e.height||(e.height=100);var n=[],o=e.width,s=e.height,r=na({data:[[0,0],[o,0],[o,s],[0,s],[0,0]],className:"subject"});if(i.editMode){var l=vt(function(){e.width=a.event.x,i.redrawSubject(),i.redrawConnector()},"updateWidth"),h=vt(function(){e.height=a.event.y,i.redrawSubject(),i.redrawConnector()},"updateHeight"),c=[{x:o,y:s/2,drag:l.bind(i)},{x:o/2,y:s,drag:h.bind(i)}];n=i.mapHandles(c)}return r.attrs["fill-opacity"]=.1,{components:[r],handles:n}},"subjectRect"),_a=vt(function(t){var e=t.subjectData,i=t.type.annotation.position,n=(void 0!==e.x1?e.x1:i.x)-i.x,o=(void 0!==e.x2?e.x2:i.x)-i.x,s=(void 0!==e.y1?e.y1:i.y)-i.y,a=(void 0!==e.y2?e.y2:i.y)-i.y;return{components:[na({data:[[n,s],[o,a]],className:"subject"})]}},"subjectThreshold"),xa=vt(function(t){var e=t.subjectData,i=void 0===e?{}:e,n=t.type,o=void 0===n?{}:n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=o.typeSettings&&o.typeSettings.subject;i.radius||(r&&r.radius?i.radius=r.radius:i.radius=14),i.x||r&&r.x&&(i.x=r.x),i.y||r&&r.y&&(i.y=r.y);var l=[],h=[],c=i.radius,u=.7*c,p=0,d=0,f=Math.sqrt(2)*c,y={xleftcorner:-c,xrightcorner:c,ytopcorner:-c,ybottomcorner:c,xleft:-f,xright:f,ytop:-f,ybottom:f};i.x&&!i.y?p=y["x"+i.x]:i.y&&!i.x?d=y["y"+i.y]:i.x&&i.y&&(p=y["x"+i.x+"corner"],d=y["y"+i.y+"corner"]);var _="translate("+p+", "+d+")",x=oa({className:"subject",data:{radius:c}});x.attrs.transform=_,x.attrs.fill=s.color,x.attrs["stroke-linecap"]="round",x.attrs["stroke-width"]="3px";var m=oa({className:"subject-ring",data:{outerRadius:c,innerRadius:u}});m.attrs.transform=_,m.attrs["stroke-width"]="3px",m.attrs.fill="white";var g=void 0;if(p&&d||!p&&!d)g=na({className:"subject-pointer",data:[[0,0],[p||0,0],[0,d||0],[0,0]]});else if(p||d){var b=vt(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*c/Math.sqrt(2)},"notCornerPointerXY");g=na({className:"subject-pointer",data:[[0,0],[b(p),b(d)],[b(p,-1),b(d,-1)],[0,0]]})}if(g&&(g.attrs.fill=s.color,g.attrs["stroke-linecap"]="round",g.attrs["stroke-width"]="3px",h.push(g)),o.editMode){var v={x:2*p,y:2*d,drag:vt(function(){i.x=a.event.x<2*-c?"left":a.event.x>2*c?"right":void 0,i.y=a.event.y<2*-c?"top":a.event.y>2*c?"bottom":void 0,o.redrawSubject()},"dragBadge").bind(o)};v.x||v.y||(v.y=-c),l=o.mapHandles([v])}var w=void 0;return i.text&&(w={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:i.text,"text-anchor":"middle",dy:".25em",x:p,y:d}}),h.push(x),h.push(m),h.push(w),{components:h,handles:l}},"subjectBadge"),ma=function(){function t(e){var i=e.a,n=e.annotation,o=e.editMode,s=e.dispatcher,a=e.notePadding,r=e.accessors;if(Bs(this,t),this.a=i,this.note=-1===n.disable.indexOf("note")&&i.select("g.annotation-note"),this.noteContent=this.note&&i.select("g.annotation-note-content"),this.connector=-1===n.disable.indexOf("connector")&&i.select("g.annotation-connector"),this.subject=-1===n.disable.indexOf("subject")&&i.select("g.annotation-subject"),this.dispatcher=s,s){var l=ka.bind(null,s,n);l({component:this.note,name:"note"}),l({component:this.connector,name:"connector"}),l({component:this.subject,name:"subject"})}this.annotation=n,this.editMode=n.editMode||o,this.notePadding=void 0!==a?a:3,this.offsetCornerX=0,this.offsetCornerY=0,r&&n.data&&this.init(r)}return L(t,"t"),vt(t,"Type"),Vs(t,[{key:"init",value:vt(function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)},"init")},{key:"mapY",value:vt(function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))},"mapY")},{key:"mapX",value:vt(function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))},"mapX")},{key:"updateEditMode",value:vt(function(){this.a.selectAll("circle.handle").remove()},"updateEditMode")},{key:"drawOnSVG",value:vt(function(t,e){var i=this;Array.isArray(e)||(e=[e]),e.filter(function(t){return t}).forEach(function(e){var n=e.type,o=e.className,s=e.attrs,a=e.handles,r=e.classID;if("handle"===n)Zs({group:t,r:s&&s.r,handles:a});else{Sa(t,[i.annotation],n,o,r);for(var l=t.select(n+"."+(r||o)),h=Object.keys(s),c=[],u=l.node().attributes,p=u.length-1;p>=0;p--){var d=u[p].name;-1===h.indexOf(d)&&"class"!==d&&c.push(d)}h.forEach(function(t){"text"===t?l.text(s[t]):l.attr(t,s[t])}),c.forEach(function(t){return l.attr(t,null)})}})},"drawOnSVG")},{key:"getNoteBBox",value:vt(function(){return Ca(this.note,".annotation-note-content text")},"getNoteBBox")},{key:"getNoteBBoxOffset",value:vt(function(){var t=Ca(this.note,".annotation-note-content"),e=this.noteContent.attr("transform").split(/\(|\,|\)/g);return t.offsetCornerX=parseFloat(e[1])+this.annotation.dx,t.offsetCornerY=parseFloat(e[2])+this.annotation.dy,t.offsetX=this.annotation.dx,t.offsetY=this.annotation.dy,t},"getNoteBBoxOffset")},{key:"drawSubject",value:vt(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.subject,n=e.type,o={type:this,subjectData:i},s={};"circle"===n?s=fa(o):"rect"===n?s=ya(o):"threshold"===n?s=_a(o):"badge"===n&&(s=xa(o,this.annotation));var a=s,r=a.components,l=void 0===r?[]:r,h=a.handles,c=void 0===h?[]:h;return l.forEach(function(e){e&&e.attrs&&!e.attrs.stroke&&(e.attrs.stroke=t.annotation.color)}),this.editMode&&(c=c.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),l.push({type:"handle",handles:c})),l},"drawSubject")},{key:"drawConnector",value:vt(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.connector,n=i.type||e.type,o={type:this,connectorData:i};o.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var s="curve"===n?ca(o):"elbow"===n?ha(o):la(o),a=s.components,r=void 0===a?[]:a,l=s.handles,h=void 0===l?[]:l,c=r[0];c&&(c.attrs.stroke=this.annotation.color,c.attrs.fill="none");var u=i.end||e.end,p={};if("arrow"===u){var d=c.data[1],f=c.data[0];Math.sqrt(Math.pow(d[0]-f[0],2)+Math.pow(d[1]-f[1],2))<5&&c.data[2]&&(d=c.data[2]),p=pa({annotation:this.annotation,start:d,end:f,scale:i.endScale})}else"dot"===u?p=da({line:c,scale:i.endScale}):u&&"none"!==u||this.connector&&this.connector.select(".connector-end").remove();return p.components&&(p.components.forEach(function(e){e.attrs.fill=t.annotation.color,e.attrs.stroke=t.annotation.color}),r=r.concat(p.components)),this.editMode&&0!==h.length&&r.push({type:"handle",handles:h}),r},"drawConnector")},{key:"drawNote",value:vt(function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this.annotation.note,n=i.align||e.align||"dynamic",o={bbox:e.bbox,align:n,offset:this.annotation.offset},s=i.lineType||e.lineType,r={};"vertical"===s?r=sa(o):"horizontal"===s&&(r=aa(o));var l=r,h=l.components,c=void 0===h?[]:h,u=l.handles,p=void 0===u?[]:u;if(c.forEach(function(e){e.attrs.stroke=t.annotation.color}),this.editMode){p=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),c.push({type:"handle",handles:p});var d=this.dragNote.bind(this),f=this.dragstarted.bind(this),y=this.dragended.bind(this);this.note.call(a.drag().container(a.select("g.annotations").node()).on("start",function(t){return f(t)}).on("drag",function(t){return d(t)}).on("end",function(t){return y(t)}))}else this.note.on("mousedown.drag",null);return c},"drawNote")},{key:"drawNoteContent",value:vt(function(t){var e=this.annotation.note,i=void 0!==e.padding?e.padding:this.notePadding,n=e.orientation||t.orientation||"topBottom",o=e.lineType||t.lineType,s=e.align||t.align||"dynamic";"vertical"===o?n="leftRight":"horizontal"===o&&(n="topBottom");var a={padding:i,bbox:t.bbox,offset:this.annotation.offset,orientation:n,align:s},r=ia(a),l=r.x,h=r.y;return this.offsetCornerX=l+this.annotation.dx,this.offsetCornerY=h+this.annotation.dy,this.note&&this.noteContent.attr("transform","translate("+l+", "+h+")"),[]},"drawNoteContent")},{key:"drawOnScreen",value:vt(function(t,e){return this.drawOnSVG(t,e)},"drawOnScreen")},{key:"redrawSubject",value:vt(function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())},"redrawSubject")},{key:"redrawConnector",value:vt(function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())},"redrawConnector")},{key:"redrawNote",value:vt(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:t})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:t}))},"redrawNote")},{key:"setPosition",value:vt(function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")},"setPosition")},{key:"clearComponents",value:vt(function(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()},"clearComponents")},{key:"setOffset",value:vt(function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}},"setOffset")},{key:"setPositionWithAccessors",value:vt(function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()},"setPositionWithAccessors")},{key:"setClassName",value:vt(function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))},"setClassName")},{key:"draw",value:vt(function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()},"draw")},{key:"dragstarted",value:vt(function(){a.event.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call("dragstart",this.a,this.annotation),this.a.classed("dragging",!0),this.a.selectAll("circle.handle").style("pointer-events","none")},"dragstarted")},{key:"dragended",value:vt(function(){this.dispatcher&&this.dispatcher.call("dragend",this.a,this.annotation),this.a.classed("dragging",!1),this.a.selectAll("circle.handle").style("pointer-events","all")},"dragended")},{key:"dragSubject",value:vt(function(){var t=this.annotation.position;t.x+=a.event.dx,t.y+=a.event.dy,this.annotation.position=t},"dragSubject")},{key:"dragNote",value:vt(function(){var t=this.annotation.offset;t.x+=a.event.dx,t.y+=a.event.dy,this.annotation.offset=t},"dragNote")},{key:"mapHandles",value:vt(function(t){var e=this;return t.map(function(t){return Hs({},t,{start:e.dragstarted.bind(e),end:e.dragended.bind(e)})})},"mapHandles")}]),t}(),ga=vt(function(t,e,i){return function(t){function n(t){Bs(this,n);var i=qs(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,t));return i.typeSettings=e,e.disable&&e.disable.forEach(function(t){i[t]&&i[t].remove(),i[t]=void 0,"note"===t&&(i.noteContent=void 0)}),i}return L(n,"o"),$s(n,t),vt(n,"customType"),Vs(n,[{key:"className",value:vt(function(){return""+(e.className||Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this)&&Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this).call(this)||"")},"className")},{key:"drawSubject",value:vt(function(t){return this.typeSettings.subject=Hs({},e.subject,this.typeSettings.subject),Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawSubject",this).call(this,Hs({},t,this.typeSettings.subject))},"drawSubject")},{key:"drawConnector",value:vt(function(t){return this.typeSettings.connector=Hs({},e.connector,this.typeSettings.connector),Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawConnector",this).call(this,Hs({},t,e.connector,this.typeSettings.connector))},"drawConnector")},{key:"drawNote",value:vt(function(t){return this.typeSettings.note=Hs({},e.note,this.typeSettings.note),Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNote",this).call(this,Hs({},t,e.note,this.typeSettings.note))},"drawNote")},{key:"drawNoteContent",value:vt(function(t){return Ws(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNoteContent",this).call(this,Hs({},t,e.note,this.typeSettings.note))},"drawNoteContent")}],[{key:"init",value:vt(function(t,e){return Ws(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,t,e),i&&(t=i(t,e)),t},"init")}]),n}(t)},"customType"),ba=function(){function t(e){Bs(this,t);var i=qs(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.textWrap=e.textWrap||120,i.drawText(),i}return L(t,"t"),$s(t,ma),vt(t,"d3NoteText"),Vs(t,[{key:"updateTextWrap",value:vt(function(t){this.textWrap=t,this.drawText()},"updateTextWrap")},{key:"drawText",value:vt(function(){if(this.note){Sa(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");Sa(t,[this.annotation],"rect","annotation-note-bg"),Sa(t,[this.annotation],"text","annotation-note-label"),Sa(t,[this.annotation],"text","annotation-note-title");var e={height:0},i=this.a.select("text.annotation-note-label"),n=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,o=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,s=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,a={top:0,bottom:0,left:0,right:0};if("number"==typeof s?a={top:s,bottom:s,left:s,right:s}:s&&"object"===(void 0===s?"undefined":Ns(s))&&(a=Hs(a,s)),this.annotation.note.title){var r=this.a.select("text.annotation-note-title");r.text(this.annotation.note.title),r.attr("fill",this.annotation.color),r.attr("font-weight","bold"),r.call(Aa,n,o),e=r.node().getBBox()}i.text(this.annotation.note.label).attr("dx","0"),i.call(Aa,n,o),i.attr("y",1.1*e.height||0),i.attr("fill",this.annotation.color);var l=this.getNoteBBox();this.a.select("rect.annotation-note-bg").attr("width",l.width+a.left+a.right).attr("height",l.height+a.top+a.bottom).attr("x",l.x-a.left).attr("y",-a.top).attr("fill","white").attr("fill-opacity",0)}},"drawText")}]),t}();ga(ba,{className:"label",note:{align:"middle"}});var va=ga(ba,{className:"callout",note:{lineType:"horizontal"}}),wa=ga(va,{className:"callout elbow",connector:{type:"elbow"}});ga(va,{className:"callout curve",connector:{type:"curve"}}),ga(ma,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),ga(ba,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),ga(ba,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),ga(function(){function t(){return Bs(this,t),qs(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return L(t,"t"),$s(t,va),vt(t,"ThresholdMap"),Vs(t,[{key:"mapY",value:vt(function(e){Ws(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapY",this).call(this,e);var i=this.annotation;(i.subject.x1||i.subject.x2)&&i.data&&e.y&&(i.y=e.y(i.data)),!i.subject.x1&&!i.subject.x2||i.x||(i.x=i.subject.x1||i.subject.x2)},"mapY")},{key:"mapX",value:vt(function(e){Ws(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"mapX",this).call(this,e);var i=this.annotation;(i.subject.y1||i.subject.y2)&&i.data&&e.x&&(i.x=e.x(i.data)),!i.subject.y1&&!i.subject.y2||i.y||(i.y=i.subject.y1||i.subject.y2)},"mapX")}]),t}(),{className:"callout xythreshold",subject:{type:"threshold"}});var Sa=vt(function(t,e,i,n,o){var s=t.selectAll(i+"."+(o||n)).data(e);return s.enter().append(i).merge(s).attr("class",n),s.exit().remove(),t},"newWithClass"),ka=vt(function(t,e,i){var n=i.component,o=i.name;n&&n.on("mouseover.annotations",function(){t.call(o+"over",n,e)}).on("mouseout.annotations",function(){return t.call(o+"out",n,e)}).on("click.annotations",function(){return t.call(o+"click",n,e)})},"addHandlers"),Aa=vt(function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each(function(){for(var t=a.select(this),o=t.text().split(i||/[ \t\r\n]+/).reverse().filter(function(t){return""!==t}),s=void 0,r=[],l=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");s=o.pop();)r.push(s),l.text(r.join(" ")),l.node().getComputedTextLength()>e&&r.length>1&&(r.pop(),l.text(r.join(" ")),r=[s],l=t.append("tspan").attr("x",0).attr("dy",n+"em").text(s))})},"wrap"),Ca=vt(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:":not(.handle)";return t?t.selectAll(e).nodes().reduce(function(t,e){var i=e.getBBox();t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),t.width=Math.max(t.width,i.width);var n=e&&e.attributes&&e.attributes.y;return t.height=Math.max(t.height,(n&&parseFloat(n.value)||0)+i.height),t},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}},"bboxWithoutHandles");function Ma(){var t=[],e=void 0,i=void 0,n=[],o={},s={},r=!1,l=void 0,h=va,c=void 0,u=void 0,p=a.dispatch("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),d=void 0,f=vt(function(i){d=i,r||i.selectAll("circle.handle").remove();var f=t.map(function(t){return t.type||(t.type=h),t.disable||(t.disable=n),new Us(t)});e=e||new Xs({annotations:f,accessors:o,accessorsInverse:s,ids:l}),i.selectAll("g").data([e]).enter().append("g").attr("class","annotations");var y=i.select("g.annotations");Sa(y,e.annotations,"g","annotation"),y.selectAll("g.annotation").each(function(t){var e=a.select(this);e.attr("class","annotation"),Sa(e,[t],"g","annotation-connector"),Sa(e,[t],"g","annotation-subject"),Sa(e,[t],"g","annotation-note"),Sa(e.select("g.annotation-note"),[t],"g","annotation-note-content"),t.type="[object Object]"===t.type.toString()?t.type:new t.type({a:e,annotation:t,textWrap:c,notePadding:u,editMode:r,dispatcher:p,accessors:o}),t.type.draw(),t.type.drawText&&t.type.drawText()})},"annotation");return f.json=function(){return console.log("Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.",e.json),window.copy(JSON.stringify(e.json.map(function(t){return delete t.type,t}))),f},f.update=function(){return t&&e&&(t=e.annotations.map(function(t){return t.type.draw(),t})),f},f.updateText=function(){return e&&(e.updateText(c),t=e.annotations),f},f.updatedAccessors=function(){return e.setPositionWithAccessors(),t=e.annotations,f},f.disable=function(i){return arguments.length?(n=i,e&&(e.updateDisable(n),t=e.annotations),f):n},f.textWrap=function(i){return arguments.length?(c=i,e&&(e.updateTextWrap(c),t=e.annotations),f):c},f.notePadding=function(i){return arguments.length?(u=i,e&&(e.updateNotePadding(u),t=e.annotations),f):u},f.type=function(i,n){return arguments.length?(h=i,e&&(e.annotations.map(function(t){t.type.note&&t.type.note.selectAll("*:not(.annotation-note-content)").remove(),t.type.noteContent&&t.type.noteContent.selectAll("*").remove(),t.type.subject&&t.type.subject.selectAll("*").remove(),t.type.connector&&t.type.connector.selectAll("*").remove(),t.type.typeSettings={},t.type=h,t.subject=n&&n.subject||t.subject,t.connector=n&&n.connector||t.connector,t.note=n&&n.note||t.note}),t=e.annotations),f):h},f.annotations=function(i){return arguments.length?(t=i,e&&e.annotations&&(t.some(function(t){return!t.type||"[object Object]"!==t.type.toString()})?(e=null,f(d)):e.annotations=t),f):e&&e.annotations||t},f.context=function(t){return arguments.length?(i=t,f):i},f.accessors=function(t){return arguments.length?(o=t,f):o},f.accessorsInverse=function(t){return arguments.length?(s=t,f):s},f.ids=function(t){return arguments.length?(l=t,f):l},f.editMode=function(i){return arguments.length?(r=i,d&&d.selectAll("g.annotation").classed("editable",r),e&&(e.editMode(r),t=e.annotations),f):r},f.collection=function(t){return arguments.length?(e=t,f):e},f.on=function(){var t=p.on.apply(p,arguments);return t===p?f:t},f}function Ta(t){return.65*(t-.5)*2*Math.PI}function Pa(t,e){return{x:Math.cos(t-Math.PI/2)*e,y:Math.sin(t-Math.PI/2)*e}}function Ia(t,e,i=!1){const n=Pa(t,e),o=180*t/Math.PI+(!0===i?180:0);return`translate(${n.x}, ${n.y}) rotate(${o})`}function Ea(t,e,i=!1){return function(n){const o=a.interpolate(n.angle,t);return n.angle=t,function(t){return Ia(o(t),e,i)}}}function Fa(t,e,i){return function(n){const o=a.interpolate(n.startAngle,t),s=a.interpolate(n.endAngle,e);return function(t){return n.startAngle=o(t),n.endAngle=s(t),i(n)}}}L(Ma,"na"),L(Ta,"oa"),L(Pa,"sa"),L(Ia,"aa"),L(Ea,"ra"),L(Fa,"la"),vt(Ma,"annotation"),vt(Ta,"value2Angle"),vt(Pa,"pointOnArc"),vt(Ia,"indicatorTranslate"),vt(Ea,"indicatorTween"),vt(Fa,"arcTween");const Da=(w=class extends a.SVGWidget{_d3Arc=Qt().innerRadius(85).outerRadius(100);_colorScale=a.scaleLinear().interpolate(a.interpolateHcl);_usageArc;_meanArc;_freeArc;_indInner;_indOuter;_centerTextG;_centerText;_bottomText;_tooltipG;_mainTooltip;constructor(){super()}tip(t){if(null===t||""===t.label)this._tooltipG.transition().style("opacity",0).on("interrupt end",()=>{this._tooltipG.selectAll("g").remove()});else{this._tooltipG.interrupt().style("opacity",1),t.w=this._centerText.datum().w+10;let e="horizontal",i=0,n=5,o=5;t.y>=5&&t.y<=25?(i=t.x<0?-t.w/2:t.w/2,n=12.5,o=void 0,e="vertical"):t.y>25&&(n=25,o=0);const s=Ma().type(wa).annotations([{data:t,dx:-t.x+i,dy:-t.y+n,color:"black",note:{label:t.label,lineType:e,padding:o,align:"middle"}}]).accessors({x:vt(t=>t.x,"x"),y:vt(t=>t.y,"y")});this._tooltipG.call(s)}}calcSize(t,e,i){const n=t.node().getBBox(),o=e/n.width,s=i/n.height,a=o<s?o:s;return{width:n.width,height:n.height,scale:a}}updateText(t,e,i,n,o){t.datum({x:e,y:i,w:n,h:o}).attr("transform",null);const s=this.calcSize(t,n,o),a=e+n/2-s.width/2*s.scale,r=i+o/2-s.height/2*s.scale;t.attr("transform",`translate(${a}, ${r}) scale(${s.scale})`)}calcWidth(){return Math.min(this.width(),this.height(),this.maxDiameter())}enter(t,e){super.enter(t,e),e.on("click",t=>{this.click(t)}),this._usageArc=e.append("path").datum({startAngle:Ta(0),endAngle:Ta(0)}).style("fill","green").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._freeArc=e.append("path").datum({startAngle:Ta(0),endAngle:Ta(1)}).style("fill","lightGrey"),this._meanArc=e.append("path").datum({startAngle:Ta(0),endAngle:Ta(0)}).style("fill","black").on("mousemove",t=>{const[e,i]=this._d3Arc.centroid(t);this.tip({x:e,y:i,label:this.tickValueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._mainTooltip=e.append("title");const i=this;function n(){return e.append("path").datum({angle:Ta(0)}).style("fill","black").style("stroke","black").attr("d","M 0 0 l -3 -3 l 6 0 z").on("mousemove",t=>{const[e,n]=i._d3Arc.centroid(i._meanArc.datum());i.tip({x:e,y:n,label:i.tickValueDescription()})}).on("mouseout",t=>{i.tip(null)})}L(n,"o"),vt(n,"appendIndicator"),this._indInner=n(),this._indOuter=n(),this._centerText=e.append("text").attr("dy",".66em").style("fill","green").on("mousemove",t=>{this.tip({x:0,y:0,label:this.valueDescription()})}).on("mouseout",t=>{this.tip(null)}),this._bottomText=e.append("text").attr("dy",".66em").on("mousemove",t=>{this.tip({x:0,y:t.y,label:this.titleDescription()})}).on("mouseout",t=>{this.tip(null)}),this._tooltipG=e.append("g").attr("class","annotation-tip")}update(t,e){super.update(t,e),this._colorScale.domain(this.colorDomain()).range(this.colorRange()),e.attr("title",this.tooltip()).style("cursor",this.click!==w.prototype.click?"pointer":null);const i=this.calcWidth()/3,n=this.calcWidth()/2-5;this._d3Arc.innerRadius(i).outerRadius(n);const o=this.value(),s=this.tickValue();this._usageArc.style("fill",this._colorScale(o)).transition().duration(750).attrTween("d",Fa(Ta(0),Ta(o),this._d3Arc)),this._freeArc.style("fill",this.emptyColor()).transition().duration(750).attrTween("d",Fa(Ta(o),Ta(1),this._d3Arc)),this._meanArc.style("fill",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("d",Fa(Ta(s-.001),Ta(s+.001),this._d3Arc)),this._indInner.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",Ea(Ta(s),i,!0)),this._indOuter.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",Ea(Ta(s),n)),this._centerText.style("fill",this._colorScale(o)).text(a.format(".0%")(o)),this._bottomText.style("fill",this.click!==w.prototype.click?this.titleClickColor():this.titleColor()).style("text-decoration",this.click!==w.prototype.click?"underline":null).text(this.title());const r=Pa(Ta(1),i-8);this.updateText(this._centerText,-r.x,-r.y,2*r.x,2*r.y);const l=Pa(Ta(1),n);l.y+=5;const h=this.calcWidth()-20,c=this.calcWidth()/2-l.y-5;this.updateText(this._bottomText,-h/2,l.y,h,c),this._mainTooltip.text(this.tooltip())}click(t){}},L(w,"_Gauge"),w);vt(Da,"Gauge");let za=Da;za.prototype._class+=" chart_Gauge",za.prototype.publish("title","","string","Title"),za.prototype.publish("titleDescription","","string","Title Description"),za.prototype.publish("titleColor","black","html-color","Color of the title text"),za.prototype.publish("titleClickColor","blue","html-color","Color of the title text when clickable"),za.prototype.publish("maxDiameter",128,"number","Max Diameter"),za.prototype.publish("value",0,"number","Value"),za.prototype.publish("valueDescription","","string","Value Description"),za.prototype.publish("showTick",!1,"boolean","Show Tick"),za.prototype.publish("tickValue",0,"number","Tick Value"),za.prototype.publish("tickValueDescription","","string","Tick Value Description"),za.prototype.publish("tooltip","","string","Tooltip"),za.prototype.publish("colorRange",["green","green","green","green","green","green","green","green","orange","red","red"],"array","Array of colors for the filled gauge portion. The fill color will be relative to the gauge value."),za.prototype.publish("colorDomain",[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],"array","This array augments the mapping of the value to the fill colorRange."),za.prototype.publish("emptyColor","lightgrey","html-color","Color of the empty portion of the gauge"),za.prototype.publish("tickColor","black","html-color","Color of the tick");const Ra=vt((t,e)=>t[1]-e[1]>0?1:-1,"sortAscending"),Oa=vt((t,e)=>t[1]-e[1]>0?-1:1,"sortDescending"),ja=(S=class extends a.SVGWidget{_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),ht.call(this),_t.call(this),a.Utility.SimpleSelectionMixin.call(this),this.d3Pie=se(),this.d3Arc=Qt(),this.d3LabelArc=Qt(),this.tooltipTick_default(!1).tooltipOffset_default(0)}intersection(t,e){return this.intersectCircle(this.calcOuterRadius(),t,e)}calcInnerRadius(){return this.innerRadius_exists()?this.calcOuterRadius()*this.innerRadius()/100:0}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t},!1)),"Verdana",12).width,e=this._size.width-(this.showLabels()?2*t:0)-20,i=this._size.height-36-(this.showLabels()?this._smallValueLabelHeight:0),n=Math.min(e,i)/2-2;return e/2-2<this.minOuterRadius()?this._labelWidthLimit=t-(this.minOuterRadius()-(e/2-2)):this._labelWidthLimit=t,n<this.minOuterRadius()?this.minOuterRadius():n}calcSmallValueLabelHeight(){const t=this.data().reduce((t,e)=>t+e[1],0);let e=0;return this.data().forEach(i=>{i[1]/t<.1&&e++}),this.labelHeight()*e}calcTotalValue(){return this.data().reduce((t,e)=>t+e[1],0)}getLabelText(t,e){let i,n=t.data[0];if(void 0!==this._labelWidthLimit&&e){const t=this.textSize(n,"Verdana",this.labelHeight()).width;this._labelWidthLimit<t&&(i=n.length*(this._labelWidthLimit/t)-3,n=i<n.length?n.slice(0,i)+"...":n)}if(this.showSeriesValue()&&(n+=` : ${this._seriesValueFormatter(t.data[1])}`),this.showSeriesPercentage()){let e=this._totalValue;const i=this.dataMeta();void 0!==i.sum&&(e=i.sum);const o=t.data[1]/e*100;n+=` : ${this._seriesPercentageFormatter(o)}%`}return n}selection(t){if(!arguments.length)try{return this._selection.selection2()[0]?.data}catch(i){return}const e=JSON.stringify(t);this._selection.selection2(t=>e===JSON.stringify(t.data))}selectByLabel(t){const e=this.data().filter(e=>e[0]===t)[0];e&&this.selection(e)}_slices;_labels;enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this._slices=e.append("g"),this._labels=e.append("g");const i=this;this.tooltipHTML(function(t){return"series-table"===i.tooltipStyle()?i.tooltipFormat({label:t.data[0],arr:i.columns().slice(1).map(function(e,n){return{label:e,color:i._palette(t.data[0]),value:t.data[n+1]}})}):i.tooltipFormat({label:t.data[0],value:t.data[1]})})}update(t,e){super.update(t,e);const i=this;this.updateD3Pie(),this._palette=this._palette.switch(this.paletteID()),this._seriesValueFormatter=a.format(this.seriesValueFormat()),this._seriesPercentageFormatter=a.format(this.seriesPercentageFormat()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._smallValueLabelHeight=this.calcSmallValueLabelHeight(),this._totalValue=this.calcTotalValue();const n=this.calcInnerRadius(),o=this.calcOuterRadius(),s=o+12;this.d3Arc.innerRadius(n).padRadius(o).outerRadius(o),this._quadIdxArr=[[],[],[],[]];const r=[...this.data()];switch(this.sortDataByValue()){case"ascending":r.sort(Ra);break;case"descending":r.sort(Oa)}const l=this._slices.selectAll(".arc").data(this.d3Pie(r),t=>t.data[0]);this._labelPositions=[],l.enter().append("g").attr("class",(t,e)=>"arc series series-"+this.cssTag(t.data[0])).attr("opacity",0).call(this._selection.enter.bind(this._selection)).on("click",function(t){i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).on("dblclick",function(t){i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))}).each(function(t,e){a.select(this).append("path").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).on("mouseover",d(0,0)).on("mouseout",d(-5,150))}).merge(l).transition().attr("opacity",1).each(function(t,e){const n=i.getQuadrant(p(t));i._quadIdxArr[n].push(e),t.outerRadius=o-5,a.select(this).select("path").transition().attr("d",i.d3Arc).style("fill",i.fillColor(t.data,i.columns()[1],t.data[1]))}),l.exit().transition().style("opacity",0).remove(),this.d3LabelArc.innerRadius(s).outerRadius(s);const h=this._labels.selectAll("text").data(this.showLabels()?this.d3Pie(r):[],t=>t.data[0]),c=h.enter().append("text").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).attr("dy",".5em").on("click",function(t){i._slices.selectAll("g").filter(function(e){t.data===e.data&&(i._selection.click(this),i.click(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this)))})}).on("dblclick",function(t){i._slices.selectAll("g").filter(function(e){t.data===e.data&&i.dblclick(i.rowToObj(t.data),i.columns()[1],i._selection.selected(this))})}).merge(h).text(t=>this.getLabelText(t,!0)).each(function(t,e){const n=i.d3LabelArc.centroid(t),o=p(t);n[0]=s*(i.isLeftSide(o)?1:-1),i._labelPositions.push({top:n[1],bottom:n[1]+i.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),c.transition().style("font-size",this.labelHeight()+"px").attr("transform",(t,e)=>{const n=i.d3LabelArc.centroid(t);return n[0]=s*(i.isLeftSide(p(t))?1:-1),n[1]=i._labelPositions[e].top,"translate("+n+")"}).style("text-anchor",t=>this.isLeftSide(p(t))?"start":"end")),h.exit().remove();const u=this._labels.selectAll("polyline").data(this.showLabels()?this.d3Pie(r):[],t=>this.getLabelText(t,!0));function p(t){return t.startAngle+(t.endAngle-t.startAngle)/2}function d(t,e){return function(){a.select(this).transition().delay(e).attrTween("d",function(e){const n=a.interpolate(e.outerRadius,o+t);return function(t){return e.outerRadius=n(t),i.d3Arc(e)}})}}L(p,"d"),L(d,"y"),u.enter().append("polyline").merge(u).transition().attr("points",function(t,e){const n=i.d3LabelArc.centroid(t),o=i.d3Arc.centroid(t),a=[...n];return n[0]=s*(i.isLeftSide(p(t))?1:-1),n[1]=i._labelPositions[e].top,[o,a,n]}),u.exit().remove(),this.showLabels()&&this.centerOnLabels(),vt(p,"midAngle"),vt(d,"arcTween")}isLeftSide(t){return(t=s.normalizeRadians(t))>2*Math.PI?t:t<Math.PI&&t>0}getQuadrant(t){let e=0;const i=s.normalizeRadians(t);return e=i<=1*Math.PI&&i>=.5*Math.PI?3:e,e=i<=.5*Math.PI&&i>=0*Math.PI?2:e,e=i<=0*Math.PI&&i>=-.5*Math.PI?1:e,e}centerOnLabels(){const t=this.pos().y,e=2*t,i=this.calcOuterRadius(),n=Math.min(this._minLabelTop,-i),o=Math.max(this._maxLabelBottom,i),s=e-(o-n),a=Math.abs(this._minLabelTop);let r=0;o>t?(r=t-o+this.labelHeight()/2,r-=s/2):n<0&&a>t&&(r=a-t+this.labelHeight()/2,r+=s/2);const l=this.pos();this.pos({y:l.y+r,x:l.x})}adjustForOverlap(){const t=this.labelHeight();this._quadIdxArr.forEach((e,i)=>{let n;this._quadIdxArr[i].sort((t,e)=>1===i||2===i?this._labelPositions[t].top>this._labelPositions[e].top?-1:1:0===i||3===i?this._labelPositions[t].top>this._labelPositions[e].top?1:-1:void 0),this._quadIdxArr[i].forEach((e,o)=>{if(o>0)if(1===i||2===i){if(n<this._labelPositions[e].bottom){const t=this._labelPositions[e].bottom-n;this._labelPositions[e].top-=t,this._labelPositions[e].bottom-=t}}else if((0===i||3===i)&&n+t>this._labelPositions[e].top){const i=Math.abs(this._labelPositions[e].top)-Math.abs(n+t);this._labelPositions[e].top-=i,this._labelPositions[e].bottom-=i}n=this._labelPositions[e].top})}),this._minLabelTop=0,this._maxLabelBottom=0,this._quadIdxArr.forEach((t,e)=>{this._quadIdxArr[e].forEach((t,e)=>{this._minLabelTop>this._labelPositions[t].top&&(this._minLabelTop=this._labelPositions[t].top),this._maxLabelBottom<this._labelPositions[t].bottom&&(this._maxLabelBottom=this._labelPositions[t].bottom)})})}exit(t,e){super.exit(t,e)}updateD3Pie(){const t=s.normalizeRadians(s.degreesToRadians(this.startAngle()));switch(this.sortDataByValue()){case"ascending":this.d3Pie.sort(Ra);break;case"descending":this.d3Pie.sort(Oa);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(.0025).startAngle(t).endAngle(2*Math.PI+t).value(function(t){return t[1]})}},L(S,"_Pie"),S);vt(ja,"Pie"),wt(ja,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let La=ja;La.prototype._class+=" chart_Pie",La.prototype.implements(ht.prototype),La.prototype.implements(_t.prototype),La.prototype.mixin(a.Utility.SimpleSelectionMixin),La.prototype.publish("showLabels",!0,"boolean","If true, wedge labels will display"),La.prototype.publish("showSeriesValue",!1,"boolean","Append data series value next to label",null,{disable:vt(t=>!t.showLabels(),"disable")}),La.prototype.publish("seriesValueFormat",",.0f","string","Number format used for formatting series values",null,{disable:vt(t=>!t.showSeriesValue(),"disable")}),La.prototype.publish("showSeriesPercentage",!1,"boolean","Append data series percentage next to label",null,{disable:vt(t=>!t.showLabels(),"disable")}),La.prototype.publish("seriesPercentageFormat",",.0f","string","Number format used for formatting series percentages",null,{disable:vt(t=>!t.showSeriesPercentage(),"disable")}),La.prototype.publish("paletteID","default","set","Color palette for this widget",La.prototype._palette.switch(),{tags:["Basic","Shared"]}),La.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),La.prototype.publish("innerRadius",0,"number","Sets inner pie hole radius as a percentage of the radius of the pie chart",null,{tags:["Basic"],range:{min:0,step:1,max:100}}),La.prototype.publish("minOuterRadius",20,"number","Minimum outer radius (pixels)"),La.prototype.publish("startAngle",0,"number","Starting angle of the first (and largest) wedge (degrees)"),La.prototype.publish("labelHeight",12,"number","Font size of labels (pixels)",null,{disable:vt(t=>!t.showLabels(),"disable")}),La.prototype.publish("sortDataByValue","descending","set","Sort data by value",["none","ascending","descending"]);const Na=(L(k=class extends La{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i=this._pos.x,n=this._pos.y;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),n+=this._size.height/4,this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(-Math.PI/2).endAngle(Math.PI/2)}},"_HalfPie"),k);vt(Na,"HalfPie"),Na.prototype._class+=" chart_HalfPie";const Ba=(L(A=class extends Ge{_domForeignObject;_domCanvas;_heat;constructor(){super(),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}radius(t){return this.radiusX(t),this.radiusY(t),this}layerEnter(t,e,i=250){super.layerEnter(t,e,i),this._domForeignObject=this.svg.insert("foreignObject","#"+this.id()+"_clippath"),this._domCanvas=this._domForeignObject.append("xhtml:body").style("margin","0px").style("padding","0px").style("background-color","transparent").append("canvas"),this._heat=Ha(this._domCanvas.node())}layerUpdate(t,e,i=250){super.layerUpdate(t,e),this._palette=this._palette.switch(this.paletteID());let n=this.width()-this.margin.left-this.margin.right;n<0&&(n=0);let o=this.height()-this.margin.top-this.margin.bottom;o<0&&(o=0),this._domForeignObject.attr("x",this.margin.left).attr("y",this.margin.top).attr("width",n).attr("height",o),this._domCanvas.attr("width",n).attr("height",o);const s="horizontal"===t.orientation()?this.data().map(e=>[t.dataPos(e[0]),t.valuePos(e[1]),e[2]]):this.data().map(e=>[t.valuePos(e[1]),t.dataPos(e[0]),e[2]]),r=this.maxWeight_exists()?this.maxWeight():a.max(s,t=>t[2]);if("default"!==this.paletteID()){const t={},e=8,i=this.reversePalette();for(let n=0;n<e;++n)t[n/e]=this._palette((i?e-n:n)/e,0,1);this._heat.gradient(t)}else this._heat.gradient(this._heat.defaultGradient);this._heat.resize();const l=this.radiusAsPercent()?this.radiusX()*n/100:this.radiusX(),h=this.radiusAsPercent()?this.radiusY()*o/100:this.radiusY();this._heat.clear().radius(l,h,this.blur()).max(r).data(s).draw(this.minOpacity())}},"_Heat"),A);vt(Ba,"Heat");let Va=Ba;function Ha(t){if(!(this instanceof Ha))return new Ha(t);this._canvas=t="string"==typeof t?document.getElementById(t):t,this._ctx=t.getContext("2d"),this._width=t.width,this._height=t.height,this._max=1,this._data=[]}L(Ha,"ga"),Va.prototype._class+=" chart_Heat",Va.prototype._palette=a.Palette.rainbow("default"),Va.prototype.publish("paletteID","default","set","Color palette for this widget",Va.prototype._palette.switch(),{tags:["Basic"]}),Va.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Va.prototype.publish("reversePalette",!1,"boolean","Reverse Palette Colors",null,{disable:vt(t=>"default"===t.paletteID(),"disable")}),Va.prototype.publish("radiusX",25,"number","Point X radius (25 by default)"),Va.prototype.publish("radiusY",25,"number","Point Y radius (25 by default)"),Va.prototype.publish("radiusAsPercent",!1,"boolean","Calculate RadiusX + RadiusY as % of size"),Va.prototype.publish("blur",15,"number","Point blur radius (15 by default)"),Va.prototype.publish("maxWeight",void 0,"number","Clamp max weight to value (optional), omitting uses max data point",void 0,{optional:!0}),Va.prototype.publish("minOpacity",.05,"number","Minimum point opacity (0.05 by default)"),vt(Ha,"simpleheat"),Ha.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:vt(function(t){return this._data=t,this},"data"),max:vt(function(t){return this._max=t,this},"max"),add:vt(function(t){return this._data.push(t),this},"add"),clear:vt(function(){return this._data=[],this},"clear"),radius:vt(function(t,e,i){i=void 0===i?15:i;const n=this._ellipse=this._createCanvas(),o=n.getContext("2d"),s=this._r=t+i,a=this._r=e+i;return n.width=2*s,n.height=2*a,o.shadowOffsetX=o.shadowOffsetY=2*s,o.shadowOffsetY=o.shadowOffsetY=2*a,o.shadowBlur=i,o.shadowColor="black",o.beginPath(),o.ellipse(-s,-a,t,e,0,0,2*Math.PI,!0),o.closePath(),o.fill(),this},"radius"),resize:vt(function(){this._width=this._canvas.width,this._height=this._canvas.height},"resize"),gradient:vt(function(t){const e=this._createCanvas(),i=e.getContext("2d"),n=i.createLinearGradient(0,0,0,256);e.width=1,e.height=256;for(const o in t)n.addColorStop(+o,t[o]);return i.fillStyle=n,i.fillRect(0,0,1,256),this._grad=i.getImageData(0,0,1,256).data,this},"gradient"),draw:vt(function(t){this._ellipse||this.radius(this.defaultRadius,this.defaultRadius),this._grad||this.gradient(this.defaultGradient);const e=this._ctx;e.clearRect(0,0,this._width,this._height);for(let n,o=0,s=this._data.length;o<s;o++)n=this._data[o],n[2]<0?n[2]=0:n[2]>this._max&&(n[2]=this._max),e.globalAlpha=Math.max(n[2]/this._max,void 0===t?.05:t),e.drawImage(this._ellipse,n[0]-this._r,n[1]-this._r);const i=e.getImageData(0,0,this._width,this._height);return this._colorize(i.data,this._grad),e.putImageData(i,0,0),this},"draw"),_colorize:vt(function(t,e){for(let i,n=0,o=t.length;n<o;n+=4)i=4*t[n+3],i&&(t[n]=e[i],t[n+1]=e[i+1],t[n+2]=e[i+2])},"_colorize"),_createCanvas:vt(function(){return"undefined"!=typeof document?document.createElement("canvas"):new this._canvas.constructor},"_createCanvas")};var Wa=Math.PI/3,$a=[0,Wa,2*Wa,3*Wa,4*Wa,5*Wa];function qa(t){return t[0]}function Ga(t){return t[1]}function Ua(){var t,e,i,n=0,o=0,s=1,a=1,r=qa,l=Ga;function h(t){var n,o={},s=[],a=t.length;for(n=0;n<a;++n)if(!isNaN(c=+r.call(null,h=t[n],n,t))&&!isNaN(u=+l.call(null,h,n,t))){var h,c,u,p=Math.round(u/=i),d=Math.round(c=c/e-(1&p)/2),f=u-p;if(3*Math.abs(f)>1){var y=c-d,_=d+(c<d?-1:1)/2,x=p+(u<p?-1:1),m=c-_,g=u-x;y*y+f*f>m*m+g*g&&(d=_+(1&p?1:-1)/2,p=x)}var b=d+"-"+p,v=o[b];v?v.push(h):(s.push(v=o[b]=[h]),v.x=(d+(1&p)/2)*e,v.y=p*i)}return s}function c(t){var e=0,i=0;return $a.map(function(n){var o=Math.sin(n)*t,s=-Math.cos(n)*t,a=o-e,r=s-i;return e=o,i=s,[a,r]})}return L(h,"c"),L(c,"u"),vt(h,"hexbin"),vt(c,"hexagon"),h.hexagon=function(e){return"m"+c(null==e?t:+e).join("l")+"z"},h.centers=function(){for(var r=[],l=Math.round(o/i),h=Math.round(n/e),c=l*i;c<a+t;c+=i,++l)for(var u=h*e+(1&l)*e/2;u<s+e/2;u+=e)r.push([u,c]);return r},h.mesh=function(){var e=c(t).slice(0,4).join("l");return h.centers().map(function(t){return"M"+t+"m"+e}).join("")},h.x=function(t){return arguments.length?(r=t,h):r},h.y=function(t){return arguments.length?(l=t,h):l},h.radius=function(n){return arguments.length?(e=2*(t=+n)*Math.sin(Wa),i=1.5*t,h):t},h.size=function(t){return arguments.length?(n=o=0,s=+t[0],a=+t[1],h):[s-n,a-o]},h.extent=function(t){return arguments.length?(n=+t[0][0],o=+t[0][1],s=+t[1][0],a=+t[1][1],h):[[n,o],[s,a]]},h.radius(1)}L(qa,"wa"),L(Ga,"Sa"),L(Ua,"Aa"),vt(qa,"pointX"),vt(Ga,"pointY"),vt(Ua,"d3HexBin");const Xa=(L(C=class extends Ge{_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),ct.call(this),this.tooltipValueFormat_default(",.0f"),_t.call(this),this.tooltipHTML(t=>{const e=a.extent(t,t=>t.label),i=a.extent(t,t=>t.value);return this.tooltipFormat({series:e[0]===e[1]?e[0]:`${e[0]} -> ${e[1]}`,label:i[0]===i[1]?i[0]:`${i[0]} -> ${i[1]}`,value:t.length})}),this._hexbin=Ua().x(t=>t.x).y(t=>t.y),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default("linear")}xPos(t,e){return"horizontal"===t.orientation()?t.dataPos(e.label):t.valuePos(e.value)}yPos(t,e){return"horizontal"===t.orientation()?t.valuePos(e.value):t.dataPos(e.label)}layerUpdate(t,e,i=250){super.layerUpdate(t,e,i);const n=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._hexbin.extent([0,0],[this.width(),this.height()]).radius(this.binSize());const o=this.flattenData().map(e=>({x:n.xPos(t,e),y:n.yPos(t,e),label:t.parseData(e.label),value:t.parseValue(e.value),origRow:e})),s=this._hexbin(o),r=a.min(s,function(t){return t.length}),l=a.max(s,function(t){return t.length});this._dataMinWeight=r,this._dataMaxWeight=l;const h=e.selectAll(".hexagon").data(s,function(t){return t.i+"_"+t.j});h.enter().append("path").attr("class","hexagon").call(t._selection.enter.bind(t._selection)).on("click",function(e){const i=n.data();n.click(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("dblclick",function(e){const i=n.data();n.dblclick(e.map(e=>t.rowToObj(i[e.origRow.rowIdx])),n.columns()[1],t._selection.selected(this))}).on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).merge(h).transition().duration(i).attr("d",this._hexbin.hexagon()).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(1)"}).style("fill",function(t){return n._palette(t.length,r,l)}),h.exit().transition().duration(i).attr("transform",function(t){return"translate("+t.x+","+t.y+")scale(0)"}).remove()}exit(t,e){super.exit(t,e)}click(t,e,i){}dblclick(t,e,i){}},"_HexBin"),C);vt(Xa,"HexBin"),wt(Xa,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let Ya=Xa;Ya.prototype._class+=" chart_HexBin",Ya.prototype.implements(ct.prototype),Ya.prototype.implements(_t.prototype),Ya.prototype.publish("paletteID","Blues","set","Color palette for this widget",Ya.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ya.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ya.prototype.publish("binSize",20,"number","Bin radius",null,{range:{min:1,max:300,step:1}});const Qa=(L(M=class extends Xe{constructor(){super(),this.interpolate_default("linear")}},"_Line"),M);vt(Qa,"Line"),Qa.prototype._class+=" chart_Line";const Za=(L(T=class extends La{constructor(){super()}postUpdate(t,e){super.postUpdate(t,e);let i="left"===this.orientation()?0:this._size.width,n=this._size.height;"origin"===this._drawStartPos&&this._target instanceof SVGElement&&(i-=this._size.width/2,n-=this._size.height/2),this._element.attr("transform","translate("+i+","+n+")scale("+this._widgetScale+")")}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle("left"===this.orientation()?0:-Math.PI/2).endAngle("left"===this.orientation()?Math.PI/2:0)}calcOuterRadius(){const t=this.textSize(this.data().map(t=>this.getLabelText({data:t})),"Verdana",12).width;return Math.min(this._size.width-t-10,this._size.height-36)-2}},"_QuarterPie"),T);vt(Za,"QuarterPie");let Ja=Za;Ja.prototype._class+=" chart_QuarterPie",Ja.prototype.publish("orientation","left","set","Determines the placement and start/end angle.",["left","right"]);const Ka=(P=class extends a.SVGWidget{_g;_leftLine;_rightLine;_midLine;_midOuterRect;_midInnerRect1;_midInnerRect2;_q0text;_q1text;_q2text;_q3text;_q4text;_q0val;_q1val;_q2val;_q3val;_q4val;constructor(){super()}enter(t,e){super.enter(t,e),this._g=e.append("g"),this._leftLine=this._g.append("rect"),this._rightLine=this._g.append("rect"),this._midLine=this._g.append("rect"),this._midOuterRect=this._g.append("rect"),this._midInnerRect1=this._g.append("rect"),this._midInnerRect2=this._g.append("rect"),this._q0text=this._g.append("text"),this._q1text=this._g.append("text"),this._q2text=this._g.append("text"),this._q3text=this._g.append("text"),this._q4text=this._g.append("text"),this._q0val=this._g.append("text"),this._q1val=this._g.append("text"),this._q2val=this._g.append("text"),this._q3val=this._g.append("text"),this._q4val=this._g.append("text")}update(t,e){super.update(t,e);const i=("horizontal"===this.orientation()?this.width():this.height())-this.lineWidth(),n="horizontal"===this.orientation()?this.height():this.width(),o=a.scaleLinear().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),i-this.edgePadding()]),s=this.candleWidth_exists()?this.candleWidth():n,r=this.lineWidth(),l=this.lineColor(),h=this.roundedCorners(),c=this.edgePadding();let u=o(this.data()[1]),p=o(this.data()[2]),d=o(this.data()[3]);const f=-s/2,y=s/2,_=this.upperTextRotation(),x=this.lowerTextRotation(),m=this.textPadding(),g=this.labelFontSize(),b=this.valueFontSize(),v=Math.max(g,b),w=i-c;if(v>0){for(;u-c<v;)u+=v;for(;p-u<v;)p+=v;for(;d-p<v;)d+=v;for(;w-d<v;)d-=v;for(;d-p<v;)p-=v;for(;p-u<v;)u-=v}let S=-i/2-this.lineWidth()/2,k=0,A=0,C=1,M="start",T="end";"vertical"===this.orientation()&&(S=0,k=i/2+this.lineWidth()/2,A=-90,M="end",T="start",C=-1),this._g.style("shape-rendering","crispEdges").attr("transform",`translate(${S},${k})rotate(${A})scale(1)`),this._leftLine.attr("fill",l).attr("height",s).attr("width",r).attr("x",c).attr("y",f).attr("rx",h).attr("ry",h),this._rightLine.attr("class","right-line").attr("fill",l).attr("height",s).attr("width",r).attr("x",w).attr("y",f).attr("rx",h).attr("ry",h),this._midLine.attr("fill",l).attr("height",r).attr("width",w-c).attr("x",c).attr("y",-r/2),this._midOuterRect.attr("fill",l).attr("height",s).attr("width",d-u).attr("x",u).attr("y",f).attr("rx",h).attr("ry",h),this._midInnerRect1.attr("fill",this.innerRectColor()).attr("height",s-2*r).attr("width",p-(u+2*r)).attr("x",u+r).attr("y",r-s/2).attr("rx",.618*h).attr("ry",.618*h),this._midInnerRect2.attr("fill",this.innerRectColor()).attr("height",s-2*r).attr("width",d-p-r).attr("x",p).attr("y",r-s/2).attr("rx",.618*h).attr("ry",.618*h),this._q0text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","hanging").text(this.columns()[0]),this._q1text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.columns()[1]),this._q2text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.columns()[2]),this._q3text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${d}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.columns()[3]),this._q4text.attr("height",s).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+r}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","baseline").text(this.columns()[4]),this._q0val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","hanging").text(this.data()[0]),this._q1val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[1]),this._q2val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[2]),this._q3val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${d}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[3]),this._q4val.attr("height",s).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+r}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","baseline").text(this.data()[4])}},L(P,"_QuartileCandlestick"),P);vt(Ka,"QuartileCandlestick");let tr=Ka;tr.prototype._class+=" chart_QuartileCandlestick",tr.prototype.publish("textColor","black","html-color","Color of label and value text"),tr.prototype.publish("showLabels",!0,"boolean","If true, labels will be shown"),tr.prototype.publish("showValues",!0,"boolean","If true, values will be shown"),tr.prototype.publish("orientation","horizontal","set","Determines layout",["horizontal","vertical"]),tr.prototype.publish("valueFontSize",12,"number","Font size of value text (pixels)"),tr.prototype.publish("labelFontSize",12,"number","Font size of label text (pixels)"),tr.prototype.publish("roundedCorners",8,"number","Radius of rounded rect corners (pixels)"),tr.prototype.publish("lineWidth",4,"number","Width of lines (pixels)"),tr.prototype.publish("candleWidth",null,"number","Height of outer rect (pixels)",null,{optional:!0}),tr.prototype.publish("textPadding",8,"number","Padding between outer rect and text (pixels)"),tr.prototype.publish("edgePadding",30,"number","Padding between outer rect and left/right sides (pixels)"),tr.prototype.publish("lineColor","#333","html-color","Color of outer rect and lines"),tr.prototype.publish("innerRectColor","white","html-color","Color of the inner rects"),tr.prototype.publish("upperTextRotation",-60,"number","Rotation of label text (degrees)"),tr.prototype.publish("lowerTextRotation",-60,"number","Rotation of value text (degrees)");const er=(I=class extends a.SVGWidget{constructor(){super(),ft.call(this),_t.call(this),a.Utility.SimpleSelectionMixin.call(this)}mapShape(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}setPointAttributes(t,e,i){const n=this;switch(this.mapShape(this.pointShape())){case"rect":t.attr("width",n.pointSize()).attr("height",n.pointSize()).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"circle":t.attr("r",n.pointSize()/2).attr("cx",e).attr("cy",i).style("fill",t=>this.strokeColor(t.data,t.column,t.value));break;case"path":const o=n.pointSize()/2;t.attr("d",function(t){return"M"+(e-o)+" "+(i-o)+" L"+(e+o)+" "+(i+o)+" M"+(e-o)+" "+(i+o)+" L"+(e+o)+" "+(i-o)}).style("stroke",t=>this.strokeColor(t.data,t.column,t.value))}}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t.label,series:t.column,value:t.value}))}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID());const i=this,n=this.height()/2,o=this.width()/2,s=this.columns(),r=this.data(),l=this.flattenData(s,r).map((t,e)=>(t.shape=this.mapShape(this.pointShape()),t.column=s[t.colIdx],t.row=r[e],t)),h=[],c=this.degrees2radians(360/this.data().length),u=this.fontSize();let p=0;l.filter(t=>1===t.colIdx).forEach(t=>{const e=super.textSize(t.label,`${this.fontFamily()}`,this.fontSize());p<e.width&&(p=e.width)});const d=Math.min(n-u,o-p),f=e.selectAll(".label").data(l.filter(t=>1===t.colIdx)),y=Math.max.apply(i,l.map(t=>t.value));f.enter().append("text").attr("class","label").attr("text-anchor","middle").merge(f).attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).each(function(t,e){const n=i.polar2cartesian(d,e*c-Math.PI/2);h.push(n.map(t=>t*i.labelPaddingRatio()));let o="middle";const s=Math.round(n[0]);o=s>0?"start":o,o=s<0?"end":o,a.select(this).attr("text-anchor",o).attr("x",n[0]).attr("y",n[1])}).text(t=>t.label),f.exit().remove();const _=e.selectAll(".domain").data(l.filter(t=>1===t.colIdx));_.enter().append("line").classed("domain",!0).style("stroke","#000").style("stroke-opacity","0.75").style("stroke-width","1px").merge(_).attr("x1",0).attr("y1",0).attr("x2",(t,e)=>h[e][0]).attr("y2",(t,e)=>h[e][1]),_.exit().remove();const x=e.selectAll(".value_guide").data(this.valueGuideRatios());x.enter().append("polygon").classed("value_guide",!0).style("stroke","grey").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(x).each(function(t,e){const i=[];h.forEach((e,n)=>{i.push([e[0]*t,e[1]*t])}),a.select(this).attr("points",i.join(" ")).attr("stroke","rgb(0, 0, 0)").attr("stroke-opacity",.75).attr("stroke-width",.3).attr("fill-opacity",0)}),x.exit().remove();const m=e.selectAll(".value_guide_text").data(this.valueGuideRatios());m.enter().append("text").attr("class","value_guide_text").attr("text-anchor","start").attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).merge(m).attr("x",2).attr("y",t=>h[0][1]*t).text((t,e)=>Math.round(t*y)),x.exit().remove();const g=e.selectAll(".area").data(s.filter((t,e)=>e>0));g.enter().append("polygon").attr("class","area").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(g).style("stroke",t=>this.strokeColor([],t,0)).style("fill",t=>this.fillColor([],t,0)).style("fill-opacity",this.fillOpacity()).attr("points",(t,e)=>h.map((t,i)=>{const n=r[i][e+1],o=0===n?0:n/y;return t[0]*o+","+t[1]*o}).join(" ")),g.exit().remove();const b=e.selectAll(".point").data(l);b.enter().append("g").attr("class","point").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).on("click",function(t,e){const n=i.data()[t.rowIdx],o=i.rowToObj(n),s=i._selection.selected(this);i.click(o,i.columns()[t.colIdx],s)}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(i.data()[t.rowIdx]),t.column,i._selection.selected(this))}).each(function(t){const e=a.select(this);e.append("circle").attr("class","pointSelection").attr("r",i.pointSize()).call(i._selection.enter.bind(i._selection)),e.append(i.mapShape(i.pointShape())).attr("class","pointShape")}).merge(b).each(function(t){const e=a.select(this),n=0===t.value?0:t.value/y,o=h[t.rowIdx][0]*n,s=h[t.rowIdx][1]*n;e.select(".pointSelection").attr("cx",o).attr("cy",s);const r=e.select(".pointShape").style("stroke",i.strokeColor(t.row,t.column,t.value)).style("fill",i.fillColor(t.row,t.column,t.value));i.setPointAttributes(r,o,s)}),b.exit().remove()}polar2cartesian(t,e){return[t*Math.cos(e),t*Math.sin(e)]}cartesian2polar(t,e){return[Math.atan2(e,t),Math.sqrt(t*t+e*e)]}degrees2radians(t){return t/57.295779513}radians2degrees(t){return 57.295779513*t}point_in_polygon(t,e){const i=t[0],n=t[1];let o=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const t=e[s][0],r=e[s][1],l=e[a][0],h=e[a][1];r>n!=h>n&&i<(l-t)*(n-r)/(h-r)+t&&(o=!o)}return o}},L(I,"_Radar"),I);vt(er,"Radar");let ir=er;ir.prototype._class+=" chart_Radar",ir.prototype.implements(ft.prototype),ir.prototype.implements(_t.prototype),ir.prototype.mixin(a.Utility.SimpleSelectionMixin),ir.prototype.publish("paletteID","default","set","Color palette for this widget",ir.prototype._palette.switch()),ir.prototype.publish("pointShape","cross","set","pointShape",["circle","rectangle","cross"]),ir.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),ir.prototype.publish("valueGuideRatios",[.2,.4,.6,.8,1],"array","Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines"),ir.prototype.publish("fillOpacity",.66,"number","Opacity of the data polygon(s)"),ir.prototype.publish("fontFamily","","string","fontFamily"),ir.prototype.publish("fontSize",16,"number","fontSize"),ir.prototype.publish("labelPaddingRatio",.9,"number","labelPaddingRatio");const nr=(E=class extends a.SVGWidget{_domainScale=a.scaleBand();_valueScale=a.scaleLinear();_d3Arc=Qt().startAngle(0).endAngle(t=>this._valueScale(t[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),ft.call(this),_t.call(this),a.Utility.SimpleSelectionMixin.call(this)}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this.tooltipHTML(t=>this.tooltipFormat({label:t[0],value:t[1]})),this._radialAxis=e.append("g").attr("class","r axis"),this._axialAxis=e.append("g").attr("class","a axis"),this._arcs=e.append("g").attr("class","data")}update(t,e){super.update(t,e);const i=this,n=Math.max(this.valueDomainHigh_exists()?this.valueDomainHigh():0,...this.data().map(t=>t[1]));this._valueScale.domain([0,n]).range([0,this.radians(this.valueMaxAngle())]);const o=this._valueScale.ticks(this.tickCount()),s=this.textSize(o.map(t=>""+t),"Verdana",12).width,r=Math.min(this.width()-2*(10+s),this.height()-44)/2,l=this.data().map(t=>t[0]);this._domainScale.domain(l).range([0,r]).padding(this.domainPadding());const h=this._domainScale.step()*this._domainScale.padding(),c=this._radialAxis.selectAll("circle").data(l);c.enter().append("circle").attr("fill","transparent").merge(c).attr("r",t=>this._domainScale(t)+this._domainScale.step()-h/2),c.exit().remove();const u=this._radialAxis.selectAll(".arc-text").data(l);u.enter().append("text").attr("class","arc-text").attr("x",-4).attr("alignment-baseline","middle").attr("text-anchor","end").merge(u).attr("y",t=>-this._domainScale(t)-this._domainScale.bandwidth()/2).text(t=>t),u.exit().remove();const p=this._axialAxis.selectAll("line").data(o);p.enter().append("line").merge(p).attr("x2",t=>r*Math.cos(this._valueScale(t)-this.radians(90))).attr("y2",t=>r*Math.sin(this._valueScale(t)-this.radians(90))),p.exit().remove();const d=this._axialAxis.selectAll("text").data(o);d.enter().append("text").style("dominant-baseline","central").merge(d).attr("x",t=>(r+10)*Math.cos(this._valueScale(t)-this.radians(90))).attr("y",t=>(r+10)*Math.sin(this._valueScale(t)-this.radians(90))).style("text-anchor",t=>{const e=this.degrees(this._valueScale(t));return e>=0&&e<=20||e>=160&&e<=200||e>=340&&e<=360?"middle":e>=180&&e<=360?"end":null}).text(t=>t),d.exit().remove();const f=this.columns().length>1?this.columns()[1]:"";this._d3Arc.innerRadius(t=>this._domainScale(t[0])).outerRadius(t=>this._domainScale(t[0])+this._domainScale.bandwidth());const y=this._arcs.selectAll("path").data(this.data(),t=>t[0]);y.enter().append("path").attr("class","arc").call(this._selection.enter.bind(this._selection)).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).on("click",function(t,e){i.click(i.rowToObj(t),f,i._selection.selected(this))}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(t),f,i._selection.selected(this))}).merge(y).style("fill",(t,e)=>this.fillColor(t,t[0],t[1])).transition().delay((t,e)=>e*this.transitionDelay()).duration(this.transitionDuration()).attrTween("d",(t,e)=>{const i=a.interpolate(t._current||0,t[1]);return t._current=t[1],n=>this._d3Arc([t[0],i(n)],e)}),y.exit().remove()}degrees(t){return 180*t/Math.PI}radians(t){return t*Math.PI/180}},L(E,"_RadialBar"),E);vt(nr,"RadialBar"),wt(nr,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number"}]);let or=nr;or.prototype._class+=" chart_RadialBar",or.prototype.implements(ft.prototype),or.prototype.implements(_t.prototype),or.prototype.mixin(a.Utility.SimpleSelectionMixin),or.prototype.publish("paletteID","default","set","Color palette for this widget",or.prototype._palette.switch()),or.prototype.publish("tickCount",10,"number","Number of ticks to display"),or.prototype.publish("domainPadding",.25,"number","Padding between chart edge and container edge (0..1)"),or.prototype.publish("valueMaxAngle",270,"number","Maximum angular length of a bar (degrees)"),or.prototype.publish("valueDomainHigh",null,"number","Value domain high",void 0,{optional:!0}),or.prototype.publish("transitionDelay",100,"number","Delay between the start of each row animation (ms)"),or.prototype.publish("transitionDuration",750,"number","Duration of a row's animation (ms)");const sr=a.Palette.rainbow("Blues"),ar=a.Palette.ordinal("Quartile",[sr(100,0,100),sr(50,0,100),sr(50,0,100),sr(75,0,100)]);function rr(t){const e=a.format(t);return function(t){const i=(Math.round(100*t)/100).toString();return i.length<=4?i:e(t)}}L(rr,"La"),ar("Std. Dev."),ar("MinMax"),ar("25%"),ar("50%"),vt(rr,"myFormatter");const lr=(F=class extends a.HTMLWidget{_selectElement;_tickFormatter;_bellCurve=(new Xe).columns(["","Std. Dev."]).paletteID("Quartile").interpolate_default("basis").pointSize(0).xAxisType("linear").xAxisOverlapMode("none").xAxisTickFormat(",").yAxisHidden(!0).yAxisDomainLow(0).yAxisDomainHigh(110).yAxisGuideLines(!1);_candle=(new tr).columns(["Min","25%","50%","75%","Max"]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(sr(90,0,100)).innerRectColor(sr(10,0,100));constructor(){super(),this.columns(["Min","25%","50%","75%","Max","Mean","Std. Dev."])}stdDev(t){return this.mean()+t*this.standardDeviation()}formatStdDev(t){return this._tickFormatter(this.stdDev(t))}quartile(t){return this.quartiles()[t]}formatQ(t){return this._tickFormatter(this.quartile(t))}domain(t){switch(t){case"25_75":return[this.quartile(1),this.quartile(3)];case"normal":return[this.stdDev(-4),this.stdDev(4)];default:return[this.quartile(0),this.quartile(4)]}}min(){return this.quartile(0)}max(){return this.quartile(4)}data(t){if(!arguments.length)return[[...this.quartiles(),this.mean(),this.standardDeviation()]];const e=t[0];return this.quartiles([e[0],e[1],e[2],e[3],e[4]]),this.mean(e[5]),this.standardDeviation(e[6]),this}enter(t,e){super.enter(t,e),this._bellCurve.target(e.append("div").node()),this._candle.target(e.append("div").node()),this._selectElement=e.append("div").style("position","absolute").style("top","0px").style("right","0px").append("select").on("change",()=>{this.view(this._selectElement.node().value),this.lazyRender()}),this._selectElement.append("option").attr("value","min_max").text("Min / Max"),this._selectElement.append("option").attr("value","25_75").text("25% / 75%"),this._selectElement.append("option").attr("value","normal").text("Normal")}bellTicks(t){let e;switch(t){case"25_75":e=[{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)}];break;case"normal":e=[{label:this.formatStdDev(-4),value:this.stdDev(-4)},{label:"-3σ",value:this.stdDev(-3)},{label:"-2σ",value:this.stdDev(-2)},{label:"-1σ",value:this.stdDev(-1)},{label:this.formatStdDev(0),value:this.stdDev(0)},{label:"+1σ",value:this.stdDev(1)},{label:"+2σ",value:this.stdDev(2)},{label:"+3σ",value:this.stdDev(3)},{label:this.formatStdDev(4),value:this.stdDev(4)}];break;default:e=[{label:this.formatQ(0),value:this.quartile(0)},{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)},{label:this.formatQ(4),value:this.quartile(4)}]}const[i,n]=this.domain(this._selectElement.node().value);return e.filter(t=>t.value>=i&&t.value<=n).map(t=>({label:t.label,value:t.value.toString()}))}updateScatter(){const t=this._selectElement.node().value,[e,i]=this.domain(t),n=(i-e)*(this.domainPadding()/100);this._bellCurve.xAxisDomainLow(e-n).xAxisDomainHigh(i+n).xAxisTicks(this.bellTicks(t)).data([[this.stdDev(-4),0],[this.stdDev(-3),.3],[this.stdDev(-2),5],[this.stdDev(-1),68],[this.stdDev(0),100],[this.stdDev(1),68],[this.stdDev(2),5],[this.stdDev(3),.3],[this.stdDev(4),0]]).resize({width:this.width(),height:this.height()-this.candleHeight()}).render()}updateCandle(){const t=this._bellCurve.dataPos(this.quartile(0)),e=this._bellCurve.dataPos(this.quartile(4))-t;this._candle.resize({width:this.width(),height:this.candleHeight()}).pos({x:t+e/2+2,y:this.candleHeight()/2}).width(e).candleWidth(this.candleHeight()).data(this.quartiles()).render()}update(t,e){super.update(t,e),this._tickFormatter=rr(this.tickFormat()),this._selectElement.node().value=this.view(),this.updateScatter(),this.updateCandle()}exit(t,e){this._bellCurve.target(null),this._candle.target(null),this._selectElement.remove(),super.exit(t,e)}},L(F,"_StatChart"),F);vt(lr,"StatChart");let hr=lr;hr.prototype._class+=" chart_StatChart",hr.prototype.publish("view","min_max","set","View",["min_max","25_75","normal"]),hr.prototype.publish("tickFormat",".2e","string","X-Axis Tick Format"),hr.prototype.publish("candleHeight",20,"number","Height of candle widget (pixels)"),hr.prototype.publish("domainPadding",10,"number","Domain value padding"),hr.prototype.publish("mean",.5,"number","Mean"),hr.prototype.publish("standardDeviation",.125,"number","Standard Deviation (σ)"),hr.prototype.publish("quartiles",[0,.25,.5,.75,1],"object","Quartiles (Min, 25%, 50%, 75%, Max)");const cr=(L(D=class extends Xe{constructor(){super(),this.interpolate_default("step")}},"_Step"),D);vt(cr,"Step"),cr.prototype._class+=" chart_Step";const ur="text",pr="html",dr=(z=class extends a.HTMLWidget{_playIntervalIdx=0;_mainDiv;_headerDiv;_textDiv;constructor(){super(),this._tag="div",this._drawStartPos="center",this.playInterval(this.playInterval())}lookupFieldIdx(t,e){let i=e;if(!(this[t+"_exists"]()&&(i=this.columns().indexOf(this[t]()),i<0)))return i}lookupFieldText(t,e){return this[t+"_exists"]()?this[t]():void 0!==e&&this.columns()[e]||""}currentRow(){return this.data()[this._playIntervalIdx]}summaryData(){let t;this.hideLabel()||(t=this.lookupFieldIdx("labelColumn",0));const e=this.lookupFieldIdx("iconColumn"),i=this.lookupFieldIdx("valueColumn",1);let n,o;this.hideMore()||(n=this.lookupFieldIdx("moreIconColumn"),o=this.lookupFieldIdx("moreTextColumn"));const s=this.lookupFieldIdx("colorFillColumn"),a=this.lookupFieldIdx("colorStrokeColumn");return this.formattedData().map(function(r){return{icon:void 0===e?this.icon():r[e],label:void 0===t?"":r[t],value:r[i],moreIcon:void 0===n?this.hideMore()?"":this.moreIcon():r[n],moreText:void 0===o?this.hideMore()?"":this.moreText():r[o],fill:void 0===s?this.colorFill():r[s],stroke:void 0===a?this.colorStroke():r[a]}},this)}enter(t,e){super.enter(t,e),this._mainDiv=e.append("div");const i=this;this._headerDiv=this._mainDiv.append("h2").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("valueColumn",1),!0)}),this._textDiv=this._mainDiv.append("div").attr("class","text").on("click",function(){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)}).on("dblclick",function(){i.dblclick(i.rowToObj(i.currentRow()),i.lookupFieldText("labelColumn",0),!0)})}update(t,e){super.update(t,e),this.data().length;const i=this.summaryData();this._playIntervalIdx>=i.length&&(this._playIntervalIdx=0);const n=this._playIntervalIdx<i.length?i[this._playIntervalIdx]:["",""];e.style("width",this.fixedSize()?this.minWidth_exists()?this.minWidth()+"px":null:"100%").style("height",this.fixedSize()?this.minHeight_exists()?this.minHeight()+"px":null:"100%"),this._mainDiv.attr("class","content bgIcon "+n.icon).transition().style("background-color",n.fill).style("color",n.stroke).style("min-width",this.minWidth_exists()?this.minWidth()+"px":null).style("min-height",this.minHeight_exists()?this.minHeight()+"px":null).style("font-size",this.iconFontSize()+"px"),this._headerDiv.transition().style("color",n.stroke).style("font-size",this.headerFontSize()+"px")[this.valueHTML()?pr:ur](n.value),this._textDiv.style("font-size",this.textFontSize()+"px")[this.labelHTML()?pr:ur](n.label);const o=this,s=this._mainDiv.selectAll(".more").data([n]),r=s.enter().append("div").attr("class","more").on("click",function(t){o.click(o.rowToObj(o.currentRow()),o.lookupFieldText("moreTextColumn")||"more",!0)}).each(function(){const t=a.select(this);t.append("i"),t.append("span")}).merge(s).style("display",this.hideMoreWrapper()?"none":null).style("font-size",this.moreFontSize()+"px").style("height",this.moreWrapperHeight_exists()?this.moreWrapperHeight()+"px":null).transition().style("background-color",a.rgb(n.fill).darker(.75).toString());r.select("i").attr("class",function(t){return"fa "+t.moreIcon}),this.moreTextHTML()?r.select("span").each(function(t){this.innerHTML=t.moreText}):r.select("span").text(t=>t.moreText),s.exit().remove()}exit(t,e){super.exit(t,e)}},L(z,"_Summary"),z);vt(dr,"Summary");let fr=dr;fr.prototype._class+=" chart_Summary",fr.prototype.implements(ht.prototype),fr.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),fr.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:vt(t=>t.iconColumn(),"disable")}),fr.prototype.publish("headerFontSize",null,"number","headerFontSize"),fr.prototype.publish("textFontSize",null,"number","textFontSize"),fr.prototype.publish("moreFontSize",null,"number","moreFontSize"),fr.prototype.publish("iconFontSize",null,"number","iconFontSize"),fr.prototype.publish("hideLabel",!1,"boolean","Hide label column"),fr.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:vt(t=>t.hideLabel(),"disable")}),fr.prototype.publish("labelHTML",!1,"boolean","Allow HTML",null,{disable:vt(t=>t.hideLabel(),"disable")}),fr.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),fr.prototype.publish("valueHTML",!1,"boolean","Allow HTML"),fr.prototype.publish("hideMore",!1,"boolean","Hide More Information"),fr.prototype.publish("hideMoreWrapper",!1,"boolean","Hide More Information Wrapper"),fr.prototype.publish("moreWrapperHeight",null,"number","Height of the 'more' text wrapper (pixels)"),fr.prototype.publish("moreIconColumn",null,"set","Select More Icon Column",function(){return this.columns()},{optional:!0,disable:vt(t=>t.hideMore(),"disable")}),fr.prototype.publish("moreIcon","fa-info-circle","string","FA Char icon class",null,{disable:vt(t=>t.hideMore()||t.moreIconColumn(),"disable")}),fr.prototype.publish("moreTextColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:vt(t=>t.hideMore(),"disable")}),fr.prototype.publish("moreText","More Info","string","More text",null,{disable:vt(t=>t.hideMore()||t.moreTextColumn(),"disable")}),fr.prototype.publish("moreTextHTML",!1,"boolean","Allow HTML",null,{disable:vt(t=>t.hideMore(),"disable")}),fr.prototype.publish("colorFillColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),fr.prototype.publish("colorFill","#3498db","html-color","Fill Color",null,{disable:vt(t=>t.colorFillColumn(),"disable")}),fr.prototype.publish("colorStrokeColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),fr.prototype.publish("colorStroke","#ffffff","html-color","Fill Color",null,{disable:vt(t=>t.colorStrokeColumn(),"disable")}),fr.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),fr.prototype.publish("minWidth",225,"number","Minimum Width"),fr.prototype.publish("minHeight",150,"number","Minimum Height"),fr.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0});const yr=fr.prototype.playInterval;fr.prototype.playInterval=function(t){const e=yr.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const _r=(R=class extends a.CanvasWidget{_playIntervalIdx=0;constructor(){super(),ht.call(this),this.playInterval(this.playInterval())}currentRow(){return this.data()[this._playIntervalIdx]}enter(t,e){super.enter.apply(this,arguments);const{width:i,height:n}=this.size();t.height=n,t.width=i}update(t,e){super.update.apply(this,arguments);const i=this;this._playIntervalIdx>=this.data().length&&(this._playIntervalIdx=0);const n=this.size(),o=Math.min(n.width,n.height),s=this.fontSizeRatio(),r=this.columns().indexOf(this.labelColumn()),l=this.columns().indexOf(this.valueColumn()),h=this.columns().indexOf(this.colorFillColumn()),c=this.columns().indexOf(this.colorStrokeColumn()),u=this.columns().indexOf(this.iconColumn()),p=-1!==u?this.currentRow()[u]:this.icon(),d=-1!==r?this.currentRow()[r]:"",f=-1!==l?this.currentRow()[l]:"",y=-1!==h?this.currentRow()[h]:this.colorFill(),_=-1!==c?this.currentRow()[c]:this.colorStroke();let x=n.height*(s-this.paddingSizeRatio());const m=n.height*(1-s-this.paddingSizeRatio()),g=n.height*(this.iconSizeRatio()-this.paddingSizeRatio()),b=o*this.paddingSizeRatio(),v=t.getContext("2d");v.clearRect(0,0,n.width,n.height);const w=i.fontFamily();function S(t,e,i,o){v.textBaseline="top",v.font=`${i}px ${w}`,v.fillStyle=_;let s=v.measureText(t);s.width>n.width-2*b&&(i*=(n.width-2*b)/s.width,v.font=`${i}px ${w}`,s=v.measureText(t));const a=A(s.width,o);return v.fillText(t,a,e),i}function k(t,e,o){if(void 0===t)return;v.textBaseline=i.iconBaseline(),v.font=`${e}px FontAwesome`,v.fillStyle=_;let s=v.measureText(t);if(s.width>n.width-2*b){const i=(n.width-2*b)/s.width;v.font=e*i+"px FontAwesome",s=v.measureText(t)}const a=A(s.width,o),r=C(i.iconBaseline());v.fillText(t,a,r)}function A(t,e){switch(e){case"start":return b;case"middle":return n.width/2-t/2;case"end":return n.width-t-b}}function C(t){switch(t){case"top":return b;case"middle":return n.height/2;case"bottom":return n.height-b}}L(S,"A"),L(k,"k"),L(A,"M"),L(C,"P"),v.fillStyle=y,v.fillRect(0,0,n.width,n.height),v.globalAlpha=this.iconOpacity(),k(a.Utility.faChar(p),g,i.iconAnchor()),v.globalAlpha=this.valueOpacity(),x=S(f,b,x,i.valueAnchor()),v.globalAlpha=this.labelOpacity(),S(d,x+b,m,i.labelAnchor()),vt(S,"drawText"),vt(k,"drawIcon"),vt(A,"getTextOffsetX"),vt(C,"getTextOffsetY")}},L(R,"_SummaryC"),R);vt(_r,"SummaryC");let xr=_r;xr.prototype._class+=" chart_SummaryC",xr.prototype.implements(ht.prototype),xr.prototype.publish("iconBaseline","bottom","string","Text baseline for the icon",["top","middle","bottom"]),xr.prototype.publish("iconAnchor","end","set","Anchors the icon either at the start, middle, or end of the summary",["start","middle","end"]),xr.prototype.publish("valueAnchor","start","set","Anchors the value either at the start, middle, or end of the summary",["start","middle","end"]),xr.prototype.publish("labelAnchor","start","set","Anchors the label either at the start, middle, or end of the summary",["start","middle","end"]),xr.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),xr.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:vt(t=>t.iconColumn(),"disable")}),xr.prototype.publish("fontFamily","Arial","string","Font Family"),xr.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),xr.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),xr.prototype.publish("colorFillColumn",null,"set","Column for background color",function(){return this.columns()},{optional:!0}),xr.prototype.publish("colorFill","#0097e6","html-color","Background Color",null,{disable:vt(t=>t.colorFillColumn(),"disable")}),xr.prototype.publish("colorStrokeColumn",null,"set","Column for font color",function(){return this.columns()},{optional:!0}),xr.prototype.publish("colorStroke","#2f3640","html-color","Font Color",null,{disable:vt(t=>t.colorStrokeColumn(),"disable")}),xr.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),xr.prototype.publish("minWidth",225,"number","Minimum Width"),xr.prototype.publish("minHeight",150,"number","Minimum Height"),xr.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0}),xr.prototype.publish("fontSizeRatio",.618,"number","Ratio between widget height and value font size"),xr.prototype.publish("valueOpacity",1,"number","Opacity of value text (0..1)"),xr.prototype.publish("labelOpacity",.9,"number","Opacity of label text (0..1)"),xr.prototype.publish("iconOpacity",.3,"number","Opacity of icon text (0..1)"),xr.prototype.publish("paddingSizeRatio",.1,"number","Ratio of the smallest dimension for edge padding (0..1)"),xr.prototype.publish("iconSizeRatio",.9,"number","Ratio of the height for icon size (0..1)");const mr=xr.prototype.playInterval;xr.prototype.playInterval=function(t){const e=mr.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);const e=this;t&&(this._playIntervalHandle=setInterval(function(){e._playIntervalIdx++,e._renderCount&&e.data().length&&e.render()},t))}return e};const gr=Math.PI/180,br=2048;function vr(){const t=a.dispatch("word","end"),e={};let i=[256,256],n=wr,o=Sr,s=Ar,r=kr,l=kr,h=Cr,c=Mr,u=[],p=Fr,d=1/0,f=null,y=Math.random,_=Rr;function x(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=br/e;const i=t.getContext("2d");return i.fillStyle=i.strokeStyle="red",i.textAlign="center",{context:i,ratio:e}}function m(t,e,n){const o=e.x,s=e.y,a=Math.sqrt(i[0]*i[0]+i[1]*i[1]),r=p(i),l=y()<.5?1:-1;let h,c,u,d=-l;for(;(h=r(d+=l))&&(c=~~h[0],u=~~h[1],!(Math.min(Math.abs(c),Math.abs(u))>=a));)if(e.x=o+c,e.y=s+u,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>i[0]||e.y+e.y1>i[1])&&(!n||!Pr(e,t,i[0]))&&(!n||Er(e,n))){const n=e.sprite,o=e.width>>5,s=i[0]>>5,a=e.x-(o<<4),r=127&a,l=32-r,h=e.y1-e.y0;let c,u=(e.y+e.y0)*s+(a>>5);for(let e=0;e<h;e++){c=0;for(let i=0;i<=o;i++)t[u+i]|=c<<l|(i<o?(c=n[e*o+i])>>>r:0);u+=s}return delete e.sprite,!0}return!1}return L(x,"x"),L(m,"m"),e.canvas=function(t){return arguments.length?(_=Or(t),e):_},e.start=function(){const a=x(_()),p=zr((i[0]>>5)*i[1]);let g=null;const b=u.length;let v=-1;const w=[],S=u.map(function(t,e){return t.text=n.call(this,t,e),t.font=o.call(this,t,e),t.style=r.call(this,t,e),t.weight=l.call(this,t,e),t.rotate=h.call(this,t,e),t.size=~~s.call(this,t,e),t.padding=c.call(this,t,e),t}).sort(function(t,e){return e.size-t.size});return f&&clearInterval(f),f=setInterval(k,0),k(),e;function k(){const n=Date.now();for(;Date.now()-n<d&&++v<b&&f;){const n=S[v];n.x=i[0]*(y()+.5)>>1,n.y=i[1]*(y()+.5)>>1,Tr(a,n,S,v),n.hasText&&m(p,n,g)&&(w.push(n),t.call("word",e,n),g?Ir(g,n):g=[{x:n.x+n.x0,y:n.y+n.y0},{x:n.x+n.x1,y:n.y+n.y1}],n.x-=i[0]>>1,n.y-=i[1]>>1)}v>=b&&(e.stop(),t.call("end",e,w,g))}},e.stop=function(){return f&&(clearInterval(f),f=null),e},vt(x,"getContext"),vt(m,"place"),e.timeInterval=function(t){return arguments.length?(d=null==t?1/0:t,e):d},e.words=function(t){return arguments.length?(u=t,e):u},e.size=function(t){return arguments.length?(i=[+t[0],+t[1]],e):i},e.font=function(t){return arguments.length?(o=Or(t),e):o},e.fontStyle=function(t){return arguments.length?(r=Or(t),e):r},e.fontWeight=function(t){return arguments.length?(l=Or(t),e):l},e.rotate=function(t){return arguments.length?(h=Or(t),e):h},e.text=function(t){return arguments.length?(n=Or(t),e):n},e.spiral=function(t){return arguments.length?(p=jr[t]||t,e):p},e.fontSize=function(t){return arguments.length?(s=Or(t),e):s},e.padding=function(t){return arguments.length?(c=Or(t),e):c},e.random=function(t){return arguments.length?(y=t,e):y},e.on=function(){const i=t.on.apply(t,arguments);return i===t?e:i},e}function wr(t){return t.text}function Sr(){return"serif"}function kr(){return"normal"}function Ar(t){return Math.sqrt(t.value)}function Cr(){return 30*(~~(6*Math.random())-3)}function Mr(){return 1}function Tr(t,e,i,n){if(e.sprite)return;const o=t.context,s=t.ratio;o.clearRect(0,0,2048/s,br/s);let a=0,r=0,l=0;const h=i.length;for(--n;++n<h;){e=i[n],o.save(),o.font=e.style+" "+e.weight+" "+~~((e.size+1)/s)+"px "+e.font;let t=o.measureText(e.text+"m").width*s,h=e.size<<1;if(e.rotate){const i=Math.sin(e.rotate*gr),n=Math.cos(e.rotate*gr),o=t*n,s=t*i,a=h*n,r=h*i;t=Math.max(Math.abs(o+r),Math.abs(o-r))+31>>5<<5,h=~~Math.max(Math.abs(s+a),Math.abs(s-a))}else t=t+31>>5<<5;if(h>l&&(l=h),a+t>=2048&&(a=0,r+=l,l=0),r+h>=br)break;o.translate((a+(t>>1))/s,(r+(h>>1))/s),e.rotate&&o.rotate(e.rotate*gr),o.fillText(e.text,0,0),e.padding&&(o.lineWidth=2*e.padding,o.strokeText(e.text,0,0)),o.restore(),e.width=t,e.height=h,e.xoff=a,e.yoff=r,e.x1=t>>1,e.y1=h>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,a+=t}const c=o.getImageData(0,0,2048/s,br/s).data,u=[];for(;--n>=0;){if(!(e=i[n]).hasText)continue;const t=e.width,o=t>>5;let s=e.y1-e.y0;for(let e=0;e<s*o;e++)u[e]=0;if(a=e.xoff,null==a)return;r=e.yoff;let l=0,h=-1;for(let i=0;i<s;i++){for(let e=0;e<t;e++){const t=o*i+(e>>5),n=c[2048*(r+i)+(a+e)<<2]?1<<31-e%32:0;u[t]|=n,l|=n}l?h=i:(e.y0++,s--,i--,r++)}e.y1=e.y0+h,e.sprite=u.slice(0,(e.y1-e.y0)*o)}}function Pr(t,e,i){i>>=5;const n=t.sprite,o=t.width>>5,s=t.x-(o<<4),a=127&s,r=32-a,l=t.y1-t.y0;let h,c=(t.y+t.y0)*i+(s>>5);for(let u=0;u<l;u++){h=0;for(let t=0;t<=o;t++)if((h<<r|(t<o?(h=n[u*o+t])>>>a:0))&e[c+t])return!0;c+=i}return!1}function Ir(t,e){const i=t[0],n=t[1];e.x+e.x0<i.x&&(i.x=e.x+e.x0),e.y+e.y0<i.y&&(i.y=e.y+e.y0),e.x+e.x1>n.x&&(n.x=e.x+e.x1),e.y+e.y1>n.y&&(n.y=e.y+e.y1)}function Er(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function Fr(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function Dr(t){const e=4*t[0]/t[1];let i=0,n=0;return function(t){const o=t<0?-1:1;switch(Math.sqrt(1+4*o*t)-o&3){case 0:i+=e;break;case 1:n+=4;break;case 2:i-=e;break;default:n-=4}return[i,n]}}function zr(t){const e=[];let i=-1;for(;++i<t;)e[i]=0;return e}function Rr(){return document.createElement("canvas")}function Or(t){return"function"==typeof t?t:function(){return t}}L(vr,"tr"),L(wr,"er"),L(Sr,"ir"),L(kr,"nr"),L(Ar,"or"),L(Cr,"sr"),L(Mr,"ar"),L(Tr,"rr"),L(Pr,"lr"),L(Ir,"hr"),L(Er,"cr"),L(Fr,"ur"),L(Dr,"pr"),L(zr,"dr"),L(Rr,"fr"),L(Or,"yr"),vt(vr,"d3Cloud"),vt(wr,"cloudText"),vt(Sr,"cloudFont"),vt(kr,"cloudFontNormal"),vt(Ar,"cloudFontSize"),vt(Cr,"cloudRotate"),vt(Mr,"cloudPadding"),vt(Tr,"cloudSprite"),vt(Pr,"cloudCollide"),vt(Ir,"cloudBounds"),vt(Er,"collideRects"),vt(Fr,"archimedeanSpiral"),vt(Dr,"rectangularSpiral"),vt(zr,"zeroArray"),vt(Rr,"cloudCanvas"),vt(Or,"functor");const jr={archimedean:Fr,rectangular:Dr},Lr=(O=class extends a.SVGWidget{_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),ht.call(this),_t.call(this),a.Utility.SimpleSelectionMixin.call(this),this._prevOffsetX=this.offsetX(),this._prevOffsetY=this.offsetY(),this._prevZoom=this.zoom()}calcData(){return this.data().map(t=>({__viz_label:t[0],__viz_weight:t[1],__viz_row:t}))}enter(t,e){super.enter(t,e),this._selection.widgetElement(e),this._root=e.append("g"),this._canvas=document.createElement("canvas");const i=this;this._d3Zoom=a.zoom().scaleExtent([.1,10]),this._d3Zoom.on("zoom",function(t){const e=a.d3Event();e&&e.transform&&i.zoomed(i._d3Zoom,[e.transform.x,e.transform.y],e.transform.k)}),e.call(this._d3Zoom),this.tooltipHTML(function(t){const e=i.columns(),n=e&&e.length?e[0]:"Word";return i.tooltipFormat({label:t.__viz_label,series:n,value:t.__viz_weight})})}update(t,e){super.update(t,e),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._d3Cloud=vr().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());const i=this.calcData(),n=this,o=a.extent(i,function(t){return t.__viz_weight});let s;switch(this.scaleMode()){case"log":s=a.scaleLog;break;case"sqrt":s=a.scaleSqrt;break;case"pow":s=a.scalePow;break;default:s=a.scaleLinear}const r=s().domain(o).range([this.fontSizeFrom(),this.fontSizeTo()]),l=a.scaleLinear().domain([0,n.angleCount()-1]).range([n.angleFrom(),n.angleTo()]);function h(t,e){const i=n._root.selectAll("text").data(t,function(t){return t.__viz_label?t.__viz_label.toLowerCase():""});i.enter().append("text").attr("text-anchor","middle").call(n._selection.enter.bind(n._selection)).text(function(t){return t.__viz_label}).on("click",function(t){n.click(n.rowToObj(t.__viz_row),n.columns()[1],n._selection.selected(this))}).on("dblclick",function(t){n.dblclick(n.rowToObj(t.__viz_row),n.columns()[1],n._selection.selected(this))}).on("mouseout.tooltip",n.tooltip.hide).on("mousemove.tooltip",n.tooltip.show).style("opacity",1e-6).merge(i).style("font-size",function(t){return r(t.__viz_weight)+"px"}).style("font-family",n.fontFamily()).transition().duration(1e3).attr("transform",function(t){return"translate("+[t.x,t.y]+")rotate("+t.rotate+")"}).style("fill",function(t){return n._palette(t.__viz_label?t.__viz_label.toLowerCase():"")}).style("opacity",1),i.exit().transition().duration(1e3).style("opacity",1e-4).remove()}L(h,"h"),this._d3Cloud.stop().size([this.width(),this.height()]).words(i).font(this.fontFamily()).padding(this.padding()).spiral(this.spiral()).text(function(t){return t.__viz_label.trim()}).fontSize(function(t){return r(t.__viz_weight)}).rotate((t,e)=>l(e%n.angleCount())).on("word",t=>{}).on("end",h).start(),vt(h,"draw")}zoomed(t,e,i){if(e[0]!==this._prevOffsetX||e[1]!==this._prevOffsetY||i!==this._prevZoom){switch(this._root.attr("transform",e),t){case this:break;case this._d3Zoom:this.offsetX(e[0]),this.offsetY(e[1]),this.zoom(i)}this._prevOffsetX=e[0],this._prevOffsetY=e[1],this._prevZoom=i}}},L(O,"_WordCloud"),O);vt(Lr,"WordCloud"),wt(Lr,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let Nr=Lr;function Br(){const t=a.timeFormat(".%L"),e=a.timeFormat(":%S"),i=a.timeFormat("%H:%M"),n=a.timeFormat("%H:00"),o=a.timeFormat("%b %d"),s=a.timeFormat("%b"),r=a.timeFormat("%Y");return a=>0!==a.getMilliseconds()?t(a):0!==a.getSeconds()?e(a):0!==a.getMinutes()?i(a):0!==a.getHours()?n(a):1!==a.getDate()?o(a):0!==a.getMonth()?s(a):r(a)}L(Br,"gr"),Nr.prototype._class+=" chart_WordCloud",Nr.prototype.implements(ht.prototype),Nr.prototype.implements(_t.prototype),Nr.prototype.mixin(a.Utility.SimpleSelectionMixin),Nr.prototype.publish("paletteID","default","set","Color palette for this widget",Nr.prototype._palette.switch(),{tags:["Basic","Shared"]}),Nr.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Nr.prototype.publish("fontFamily","Impact","string","Font Name",null,{tags:["Basic"]}),Nr.prototype.publish("fontSizeFrom",6,"number","Minimum font size (pixels)",null,{tags:["Basic"]}),Nr.prototype.publish("fontSizeTo",48,"number","Maximum font size (pixels)",null,{tags:["Basic"]}),Nr.prototype.publish("angleFrom",-60,"number","Minimum angle (degrees)",null,{tags:["Basic"]}),Nr.prototype.publish("angleTo",60,"number","Maximum angle (degrees)",null,{tags:["Basic"]}),Nr.prototype.publish("angleCount",5,"number","Number of different angles",null,{tags:["Basic"]}),Nr.prototype.publish("padding",0,"number","Padding between words (pixels)",null,{tags:["Intermediate"]}),Nr.prototype.publish("scaleMode","linear","set","Text scaling mode",["linear","log","sqrt","pow"],{tags:["Intermediate"]}),Nr.prototype.publish("spiral","archimedean","set","Text scaling mode",["archimedean","rectangular"],{tags:["Intermediate"]}),Nr.prototype.publish("offsetX",0,"number","X offset",null,{tags:["Advanced"]}),Nr.prototype.publish("offsetY",0,"number","Y offset",null,{tags:["Advanced"]}),Nr.prototype.publish("zoom",1,"number","Zoom",null,{tags:["Advanced"]}),vt(Br,"multiScale24Hours"),function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode(".chart_Axis{fill:#000;font:10px sans-serif}.chart_Axis .axis .tick>text{font:10px sans-serif}.chart_Axis .axis path.domain,.chart_Axis .axis .tick line{fill:none;stroke:#000}.chart_Axis .guide path.domain{fill:none;stroke:none}.chart_Axis .guide .tick line{fill:none;stroke:#d3d3d3;opacity:.7}.chart_Axis .guide .tick.guide-0 line{stroke:#000;stroke-width:1;stroke-dasharray:3 5}.chart_Axis line,.chart_Axis path{shape-rendering:crispEdges}.chart_XYAxis .axis{fill:#000;font:10px sans-serif}.chart_XYAxis .tick>text{font:10px sans-serif}.chart_XYAxis .focus .chart_Axis.value .tick{visibility:hidden}.chart_XYAxis .axis path,.chart_XYAxis .axis line{fill:none;stroke:#000;shape-rendering:crispEdges}.chart_XYAxis .region{opacity:.33}.chart_XYAxis .brush rect.background{z-index:-999}.chart_XYAxis .brush .selection{stroke:#4682b4;stroke-opacity:1;stroke-width:1px;fill:#4682b4;fill-opacity:.125;shape-rendering:crispEdges}.chart_XYAxis .brush path.handle--custom{fill:#eee;stroke:#666}.chart_Scatter .pointShape,.chart_Scatter .line,.chart_Scatter .area{pointer-events:none}.chart_Scatter .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Scatter .point .pointSelection.selected{fill:none;stroke:red}.chart_Column .columnRect{fill:#4682b4;cursor:pointer}.chart_Column .data.axis path{display:none}.chart_Column .columnRect{stroke:transparent;border-width:1.5px}.chart_Column .columnRect.selected{stroke:red}.chart_Bubble circle{cursor:pointer}.chart_Bubble .selected circle{stroke:red;stroke-width:1.5px}.chart_Bubble .common_FAChar{fill:#fff;pointer-events:none}.chart_Bubble .common_Text{pointer-events:none}.chart_Bullet .domain{opacity:0}.chart_Bullet .bullet{border:solid 1px;border-color:transparent;font:10px sans-serif}.chart_Bullet .bullet.selected{border-color:red}.chart_Bullet .bullet.over{border-color:orange}.chart_Bullet .bullet.selected.over{border-color:red}.chart_Bullet .bullet .marker{stroke:#000;stroke-width:2px}.chart_Bullet .bullet .tick line{stroke:#666;stroke-width:.5px}.chart_Bullet .bullet .range.s0{fill:#eee}.chart_Bullet .bullet .range.s1{fill:#ddd}.chart_Bullet .bullet .range.s2{fill:#ccc}.chart_Bullet .bullet .measure.s0{fill:#b0c4de}.chart_Bullet .bullet .measure.s1{fill:#4682b4}.chart_Bullet .bullet .title{font-size:14px;font-weight:700}.chart_Bullet .bullet .subtitle{fill:#999}.chart_Pie path{cursor:pointer}.chart_Pie>g>text{cursor:pointer}.chart_Pie .arc path{stroke:#fff;stroke-width:.75px}.chart_Pie .arc.selected path{stroke:red;stroke-width:1.5px}.chart_Pie polyline{opacity:.3;stroke:#000;stroke-width:2px;fill:none}.chart_HexBin .hexagon{fill:none;stroke:#000;stroke-width:.5px}.chart_HexBin .hexagon.selected{stroke:red}.chart_Line .dataLine{fill:none;stroke:#4682b4;stroke-width:1.5px}.chart_Radar .pointShape,.chart_Radar .area{pointer-events:none}.chart_Radar .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Radar .point .pointSelection.selected{fill:none;stroke:red}.chart_RadialBar path.arc{opacity:.9;transition:opacity .5s}.chart_RadialBar path.arc.selected{stroke:red}.chart_RadialBar path.arc:hover{opacity:.7}.chart_RadialBar .axis line,.chart_RadialBar .axis circle{stroke:#ccc;stroke-width:1px}.chart_RadialBar .axis circle{fill:none}.chart_RadialBar .r.axis text{text-anchor:end}.chart_Summary{width:225px;height:150px;font-size:14px}.chart_Summary .content h2{font-weight:700;font-size:3em;margin-left:10px;margin-top:10px;margin-bottom:10px}.chart_Summary .bgIcon:before{position:absolute;font-family:FontAwesome;font-size:5.5em;opacity:.4;top:.5em;right:15px}.chart_Summary .bgIcon{position:relative}.chart_Summary .content{float:left;width:100%;height:100%;background-color:#efd752}.chart_Summary .content div{margin-top:-1.1em;font-size:1.1em;opacity:.8}.chart_Summary .content .text{padding-left:10px}.chart_Summary .content .more{position:absolute;bottom:0;width:100%;height:3em;line-height:3em}.chart_Summary .content .more i{padding-left:10px;padding-right:.5em}.other_Wordcloud text{cursor:pointer}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();const Vr=["label","start","end","icon","color","series"],Hr=class _WUTimeline extends c.ReactTimelineSeries{_palette=a.Palette.ordinal("default");constructor(){super(),this.columns(Vr).titleColumn("label").iconColumn("icon").colorColumn("color").seriesColumn("series").timePattern("%Y-%m-%dT%H:%M:%S.%LZ").tickFormatFunc(Br()).tooltipTimeFormat("%H:%M:%S.%L").tooltipHTML(t=>t[Vr.length].calcTooltip())}_prevHashSum;clear(){return delete this._prevHashSum,this}fetchScopes(){const t=s.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});if(this._prevHashSum!==t){this._prevHashSum=t;i.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchDetails(this.request()).then(t=>t.filter(t=>t.Id&&t.attr("WhenStarted").RawValue).map(t=>{const e=+t.attr("WhenStarted").RawValue/1e3,i=+t.attr("TimeElapsed").RawValue/1e6;return[t.Id,new Date(e).toISOString(),i?new Date(e+i).toISOString():void 0,null,this._palette(t.ScopeType),t.ScopeName.split("::").join(":").split(":").slice(0,1),t]})).then(t=>{this.data(t).render()})}}enter(t,e){super.enter(t,e)}update(t,e){this.fetchScopes(),super.update(t,e)}exit(t,e){super.exit(t,e)}};L(Hr,"WUTimeline");let Wr=Hr;Wr.prototype._class+=" eclwatch_WUTimeline",Wr.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),Wr.prototype.publish("wuid","","string","Workunit ID"),Wr.prototype.publish("request",{ScopeFilter:{MaxDepth:3,ScopeTypes:["graph","subgraph"]},NestedFilter:{Depth:0,ScopeTypes:[]},PropertiesToReturn:{AllProperties:!1,AllStatistics:!0,AllHints:!1,Properties:["WhenStarted","TimeElapsed"]},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},"object","WUDetails Request"),t.BUILD_VERSION="3.16.1",t.ECLArchiveViewer=B,t.PKG_NAME="@hpcc-js/eclwatch",t.PKG_VERSION="3.5.3",t.STATUS=it,t.STATUS_ACTIVE=nt,t.WUGraph=Y,t.WUResult=et,t.WUScopeController=U,t.WUStatus=st,t.WUTimeline=Wr,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=index.umd.cjs.map
|
|
3
3
|
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".eclwatch_WUGraphLegend .graph_Vertex{cursor:auto}.eclwatch_WUGraphLegend .graph_Vertex .common_Icon{cursor:pointer}.eclwatch_WUGraph .graph_Vertex{cursor:auto}.eclwatch_WUGraph .marker{fill:#656565;stroke:none;stroke-width:1px}.eclwatch_WUGraph .zoom{fill:none;pointer-events:all}.eclwatch_WUGraph .selectionBrush{fill:none;stroke:#a9a9a9}.d3-tip .eclwatch_WUGraph_Tooltip h3,.d3-tip .eclwatch_WUGraph_Tooltip h4{margin:0}.d3-tip .eclwatch_WUGraph_Tooltip table{border-collapse:separate;border-spacing:5px}.d3-tip .eclwatch_WUGraph_Tooltip table .key{font-weight:700}.d3-tip .eclwatch_WUGraph_Tooltip table .value{font-weight:400}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|