billboard.js 3.17.2 → 3.17.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.
Files changed (49) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +25 -15
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +12 -12
  5. package/dist/billboard.pkgd.js +2127 -1610
  6. package/dist/billboard.pkgd.min.js +21 -19
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +16 -4
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -4
  11. package/dist/plugin/billboardjs-plugin-stanford.js +16 -4
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +4 -4
  13. package/dist/plugin/billboardjs-plugin-tableview.js +18 -8
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +16 -4
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -4
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2168 -1661
  18. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +8 -6
  19. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +2178 -1659
  20. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +10 -8
  21. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2179 -1660
  22. package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +12 -10
  23. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +2182 -1665
  24. package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +11 -9
  25. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2181 -1662
  26. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +10 -8
  27. package/dist/theme/dark.css +1 -1
  28. package/dist/theme/dark.min.css +1 -1
  29. package/dist/theme/datalab.css +1 -1
  30. package/dist/theme/datalab.min.css +1 -1
  31. package/dist/theme/graph.css +1 -1
  32. package/dist/theme/graph.min.css +1 -1
  33. package/dist/theme/insight.css +1 -1
  34. package/dist/theme/insight.min.css +1 -1
  35. package/dist/theme/modern.css +1 -1
  36. package/dist/theme/modern.min.css +1 -1
  37. package/dist-esm/billboard.js +27 -16
  38. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  39. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  40. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  41. package/dist-esm/plugin/billboardjs-plugin-tableview.js +27 -6
  42. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  43. package/package.json +3 -3
  44. package/src/ChartInternal/internals/color.ts +4 -6
  45. package/src/ChartInternal/internals/legend.ts +2 -1
  46. package/src/ChartInternal/internals/tooltip.ts +2 -2
  47. package/src/ChartInternal/shape/point.common.ts +4 -4
  48. package/src/Plugin/tableview/index.ts +2 -5
  49. package/src/module/util.ts +24 -6
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.2
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -135,7 +135,7 @@ class Plugin {
135
135
  });
136
136
  }
137
137
  }
138
- __publicField(Plugin, "version", "3.17.2");
138
+ __publicField(Plugin, "version", "3.17.3");
139
139
 
140
140
  ;// ./src/Plugin/bubblecompare/index.ts
141
141
  var bubblecompare_defProp = Object.defineProperty;
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.2
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
- */(function(n,i){typeof exports=="object"&&typeof module=="object"?module.exports=i(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],i):typeof exports=="object"?exports.bb=i(require("d3-selection")):(n.bb=n.bb||{},n.bb.plugin=n.bb.plugin||{},n.bb.plugin.bubblecompare=i(n.d3))})(this,function(p){return(function(){"use strict";var n={747:(function(r){r.exports=p})},i={};function s(r){var e=i[r];if(e!==void 0)return e.exports;var t=i[r]={exports:{}};return n[r](t,t.exports,s),t.exports}(function(){s.d=function(r,e){for(var t in e)s.o(e,t)&&!s.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}})(),(function(){s.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)}})();var b={};s.d(b,{default:function(){return R}});var $=s(747),g=Object.defineProperty,v=(r,e,t)=>e in r?g(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,l=(r,e,t)=>v(r,typeof e!="symbol"?e+"":e,t);class d{constructor(e={}){l(this,"$$"),l(this,"options"),this.options=e}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}l(d,"version","3.17.2");var x=Object.defineProperty,B=(r,e,t)=>e in r?x(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,_=(r,e,t)=>B(r,typeof e!="symbol"?e+"":e,t);const f=class m extends d{constructor(e){return super(e),_(this,"$$"),this}$init(){const{$$:e}=this;e.findClosest=this.findClosest.bind(this),e.getBubbleR=this.getBubbleR.bind(this),e.pointExpandedR=this.pointExpandedR.bind(this)}pointExpandedR(e){const t=this.getBubbleR(e),{expandScale:a=1}=this.options;return m.raiseFocusedBubbleLayer(e),this.changeCursorPoint(),t*a}static raiseFocusedBubbleLayer(e){e.raise&&(0,$.select)(e.node().parentNode.parentNode).raise()}changeCursorPoint(){this.$$.$el.eventRect.style("cursor","pointer")}findClosest(e,t){const{$$:a}=this;return e.filter(o=>o&&!a.isBarType(o.id)).reduce((o,u)=>a.dist(u,t)<this.getBubbleR(u)?u:o,0)}getBubbleR(e){const{minR:t,maxR:a}=this.options,o=this.getZData(e);if(!o)return t;const[u,c]=this.$$.data.targets.reduce(([w,C],j)=>{const h=this.getZData(j.values[0]);return[Math.min(w,h),Math.max(C,h)]},[1e4,0]),P=u>0&&c===u?0:o/c;return Math.abs(P)*(a-t)+t}getZData(e){return this.$$.isBubbleZType(e)?this.$$.getBubbleZData(e.value,"z"):e.value}};_(f,"version","0.0.1");let R=f;return b=b.default,b})()});
11
+ */(function(n,i){typeof exports=="object"&&typeof module=="object"?module.exports=i(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],i):typeof exports=="object"?exports.bb=i(require("d3-selection")):(n.bb=n.bb||{},n.bb.plugin=n.bb.plugin||{},n.bb.plugin.bubblecompare=i(n.d3))})(this,function(p){return(function(){"use strict";var n={747:(function(r){r.exports=p})},i={};function s(r){var e=i[r];if(e!==void 0)return e.exports;var t=i[r]={exports:{}};return n[r](t,t.exports,s),t.exports}(function(){s.d=function(r,e){for(var t in e)s.o(e,t)&&!s.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}})(),(function(){s.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)}})();var b={};s.d(b,{default:function(){return R}});var $=s(747),g=Object.defineProperty,v=(r,e,t)=>e in r?g(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,l=(r,e,t)=>v(r,typeof e!="symbol"?e+"":e,t);class d{constructor(e={}){l(this,"$$"),l(this,"options"),this.options=e}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}l(d,"version","3.17.3");var x=Object.defineProperty,B=(r,e,t)=>e in r?x(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,_=(r,e,t)=>B(r,typeof e!="symbol"?e+"":e,t);const f=class m extends d{constructor(e){return super(e),_(this,"$$"),this}$init(){const{$$:e}=this;e.findClosest=this.findClosest.bind(this),e.getBubbleR=this.getBubbleR.bind(this),e.pointExpandedR=this.pointExpandedR.bind(this)}pointExpandedR(e){const t=this.getBubbleR(e),{expandScale:a=1}=this.options;return m.raiseFocusedBubbleLayer(e),this.changeCursorPoint(),t*a}static raiseFocusedBubbleLayer(e){e.raise&&(0,$.select)(e.node().parentNode.parentNode).raise()}changeCursorPoint(){this.$$.$el.eventRect.style("cursor","pointer")}findClosest(e,t){const{$$:a}=this;return e.filter(o=>o&&!a.isBarType(o.id)).reduce((o,u)=>a.dist(u,t)<this.getBubbleR(u)?u:o,0)}getBubbleR(e){const{minR:t,maxR:a}=this.options,o=this.getZData(e);if(!o)return t;const[u,c]=this.$$.data.targets.reduce(([w,C],j)=>{const h=this.getZData(j.values[0]);return[Math.min(w,h),Math.max(C,h)]},[1e4,0]),P=u>0&&c===u?0:o/c;return Math.abs(P)*(a-t)+t}getZData(e){return this.$$.isBubbleZType(e)?this.$$.getBubbleZData(e.value,"z"):e.value}};_(f,"version","0.0.1");let R=f;return b=b.default,b})()});
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.2
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -374,8 +374,20 @@ function endall(transition, cb) {
374
374
  transition.call(end);
375
375
  }
376
376
  }
377
+ const dangerousTags = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math";
378
+ const sanitizeRx = {
379
+ tags: new RegExp(
380
+ `<(${dangerousTags})[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(${dangerousTags})[^>]*\\/?>`,
381
+ "gi"
382
+ ),
383
+ eventHandlers: /\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,
384
+ dangerousUrls: /(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi
385
+ };
377
386
  function sanitize(str) {
378
- return isString(str) ? str.replace(/<(script|img)?/ig, "&lt;").replace(/(script)?>/ig, "&gt;") : str;
387
+ if (!isString(str) || !str || str.indexOf("<") === -1) {
388
+ return str;
389
+ }
390
+ return str.replace(sanitizeRx.tags, "").replace(sanitizeRx.eventHandlers, "").replace(sanitizeRx.dangerousUrls, '$1=""');
379
391
  }
380
392
  function setTextValue(node, text, dy = [-1, 1], toMiddle = false) {
381
393
  if (!node || !isString(text)) {
@@ -687,7 +699,7 @@ function tplProcess(tpl, data) {
687
699
  for (const x in data) {
688
700
  res = res.replace(new RegExp(`{=${x}}`, "g"), data[x]);
689
701
  }
690
- return res;
702
+ return sanitize(res);
691
703
  }
692
704
  function parseDate(date) {
693
705
  var _a;
@@ -847,7 +859,7 @@ class Plugin {
847
859
  });
848
860
  }
849
861
  }
850
- __publicField(Plugin, "version", "3.17.2");
862
+ __publicField(Plugin, "version", "3.17.3");
851
863
 
852
864
  ;// ./src/Plugin/sparkline/Options.ts
853
865
  class Options {
@@ -5,9 +5,9 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.2
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
- */(function(b,d){typeof exports=="object"&&typeof module=="object"?module.exports=d(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],d):typeof exports=="object"?exports.bb=d(require("d3-brush"),require("d3-selection")):(b.bb=b.bb||{},b.bb.plugin=b.bb.plugin||{},b.bb.plugin.sparkline=d(b.d3,b.d3))})(this,function(T,b){return(function(){"use strict";var d={747:(function(e){e.exports=b}),853:(function(e){e.exports=T})},C={};function f(e){var t=C[e];if(t!==void 0)return t.exports;var n=C[e]={exports:{}};return d[e](n,n.exports,f),n.exports}(function(){f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var m={};f.d(m,{default:function(){return N}});var q=Object.defineProperty,P=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,A=(e,t,n)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))k.call(t,n)&&A(e,n,t[n]);if(P)for(var n of P(t))H.call(t,n)&&A(e,n,t[n]);return e};const R={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},X={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},U={area:"bb-area",areas:"bb-areas"},Y={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},V={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},G={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},z={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},W={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},K={dragarea:"bb-dragarea",INCLUDED:"_included_"},Z={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},J={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},Q={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},ee={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},te={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},ne={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},re={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},Be={level:"bb-level",levels:"bb-levels"},ie={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},oe={region:"bb-region",regions:"bb-regions"},se={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},ce={shape:"bb-shape",shapes:"bb-shapes"},le={brush:"bb-brush",subchart:"bb-subchart"},ae={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",textBorderRect:"bb-text-border",textLabelImage:"bb-text-label-image",TextOverlapping:"text-overlapping"},ue={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},be={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},fe={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var je=c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c({},R),X),U),Y),V),G),z),W),K),J),Q),ee),te),ne),Z),re),ie),oe),se),ce),le),ae),ue),be),fe),Fe=f(853),Ne=f(747);function de(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function he(e){const t=typeof(e==null?void 0:e.requestAnimationFrame)=="function"&&typeof(e==null?void 0:e.cancelAnimationFrame)=="function",n=typeof(e==null?void 0:e.requestIdleCallback)=="function"&&typeof(e==null?void 0:e.cancelIdleCallback)=="function",r=o=>setTimeout(o,1),i=o=>clearTimeout(o);return[t?e.requestAnimationFrame:r,t?e.cancelAnimationFrame:i,n?e.requestIdleCallback:r,n?e.cancelIdleCallback:i]}const v=de(),pe=v==null?void 0:v.document,[qe,ke,He,Xe]=he(v);var ge=Object.defineProperty,S=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,I=(e,t,n)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))me.call(t,n)&&I(e,n,t[n]);if(S)for(var n of S(t))ve.call(t,n)&&I(e,n,t[n]);return e};const Ue=e=>e||e===0,_e=e=>typeof e=="function",h=e=>typeof e=="string",_=e=>typeof e=="number",xe=e=>typeof e=="undefined",M=e=>typeof e!="undefined",Ye=e=>typeof e=="boolean",Ve=e=>Math.ceil(e/10)*10,Ge=e=>Math.ceil(e)+.5,ze=e=>e[1]-e[0],x=e=>typeof e=="object",ye=e=>{for(const t in e)return!1;return!0},$e=e=>xe(e)||e===null||h(e)&&e.length===0||x(e)&&!(e instanceof Date)&&ye(e)||_(e)&&isNaN(e),we=e=>!$e(e),y=e=>Array.isArray(e),g=e=>e&&!(e!=null&&e.nodeType)&&x(e)&&!y(e);function We(e,t,n){return M(e[t])?e[t]:n}function Ke(e,t){let n=!1;return Object.keys(e).forEach(r=>e[r]===t&&(n=!0)),n}function Ze(e,t,...n){const r=_e(e);return r&&e.call(t,...n),r}function Je(e,t){let n=0;const r=function(...i){!--n&&t.apply(this,...i)};"duration"in e?e.each(()=>++n).on("end",r):(++n,e.call(r))}function Qe(e){return h(e)?e.replace(/<(script|img)?/ig,"&lt;").replace(/(script)?>/ig,"&gt;"):e}function et(e,t,n=[-1,1],r=!1){if(!(!e||!h(t)))if(t.indexOf(`
12
- `)===-1)e.text(t);else{const i=[e.text(),t].map(o=>o.replace(/[\s\n]/g,""));if(i[0]!==i[1]){const o=t.split(`
13
- `),s=r?o.length-1:1;e.html(""),o.forEach((l,a)=>{e.append("tspan").attr("x",0).attr("dy",`${a===0?n[0]*s:n[1]}em`).text(l)})}}}function Ee(e){const{x:t,y:n,width:r,height:i}=e.getBBox();return[{x:t,y:n+i},{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+i}]}function tt(e){const{width:t,height:n}=B(e),r=Ee(e),i=r[0].x,o=Math.min(r[0].y,r[1].y);return{x:i,y:o,width:t,height:n}}function nt(e,t){var n;const r=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let i=[0,0];try{i=d3Pointer(r||e,t)}catch(o){}return i.map(o=>isNaN(o)?0:o)}function Oe(e){const{event:t,$el:n}=e,r=n.subchart.main||n.main;let i;return t&&t.type==="brush"?i=t.selection:r&&(i=r.select(".bb-brush").node())&&(i=d3BrushSelection(i)),i}function D(e,t,n=!1){const r=i=>i[e?"getBoundingClientRect":"getBBox"]();return n?r(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=r(t):t.rect}function B(e,t=!1){return D(!0,e,t)}function rt(e,t=!1){return D(!1,e,t)}function it(e=!0,t=0,n=1e4){const r=window.crypto||window.msCrypto,i=r?t+r.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(i):i}function j(e,t,n,r,i){if(n>r)return-1;const o=Math.floor((n+r)/2);let{x:s,w:l=0}=e[o];return i&&(s=e[o].y,l=e[o].h),t>=s&&t<=s+l?o:t<s?j(e,t,n,o-1,i):j(e,t,o+1,r,i)}function ot(e){const t=Oe(e);return t?t[0]===t[1]:!0}function st(...e){const t=n=>{if(g(n)&&n.constructor){const r=new n.constructor;for(const i in n)r[i]=t(n[i]);return r}return n};return e.map(n=>t(n)).reduce((n,r)=>L(L({},n),r))}function Te(e={},t){y(t)&&t.forEach(n=>Te(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const ct=e=>e.charAt(0).toUpperCase()+e.slice(1);function lt(e,t="-"){return e.split(t).map((n,r)=>r?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Ce=e=>[].slice.call(e);function at(e,t,n){const{rootSelector:r="",sheet:i}=e,s=`${r} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return i[i.insertRule?"insertRule":"addRule"](s,i.cssRules.length)}function ut(e){let t=[];return e.forEach(n=>{var r;try{n.cssRules&&n.cssRules.length&&(t=t.concat(Ce(n.cssRules)))}catch(i){(r=window.console)==null||r.warn(`Error while reading rules from ${n.href}: ${i.toString()}`)}}),t}function bt(e){var t,n,r,i,o,s;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((r=e.scrollLeft)!=null?r:0),y:((o=(i=window.pageYOffset)!=null?i:window.scrollY)!=null?o:0)+((s=e.scrollTop)!=null?s:0)}}function ft(e,t=0,n=0,r=!0){const i=new DOMPoint(t,n),o=e.getScreenCTM(),s=i.matrixTransform(r?o==null?void 0:o.inverse():o);if(r===!1){const l=B(e);s.x-=l.x,s.y-=l.y}return s}function dt(e){const t=e?e.transform:null,n=t&&t.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function ht(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((r,i,o)=>o.indexOf(r)===i);return t?n.map(r=>new Date(r)):n}function pt(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function $(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return g(e)&&g(n)&&Object.keys(n).forEach(r=>{if(!/^(__proto__|constructor|prototype)$/i.test(r)){const i=n[r];g(i)?(!e[r]&&(e[r]={}),e[r]=$(e[r],i)):e[r]=y(i)?i.concat():i}}),$(e,...t)}function Pe(e,t=!0){let n;return e[0]instanceof Date?n=t?(r,i)=>r-i:(r,i)=>i-r:t&&!e.every(isNaN)?n=(r,i)=>r-i:t||(n=(r,i)=>r>i&&-1||r<i&&1||r===i&&0),e.concat().sort(n)}function gt(e,t){let n=t.filter(r=>we(r));return n.length?_(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=Pe(n,e==="min")[0]):n=void 0,n}const mt=(e,t,n=1)=>{const r=[],i=Math.max(0,Math.ceil((t-e)/n))|0;for(let o=e;o<i;o++)r.push(e+o*n);return r},vt={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,r=e())=>{t.dispatchEvent(new MouseEvent(n,r))}}catch(t){return(n,r,i=e())=>{const o=pe.createEvent("MouseEvent");o.initMouseEvent(r,i.bubbles,i.cancelable,v,0,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(o)}}})(),touch:(e,t,n)=>{const r=new Touch($({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[r],targetTouches:[],changedTouches:[r]}))}};function _t(e,t){let n=e;for(const r in t)n=n.replace(new RegExp(`{=${r}}`,"g"),t[r]);return n}function xt(e){var t;let n;if(e instanceof Date)n=e;else if(h(e)){const{config:r,format:i}=this;n=(t=i.dataTime(r.data_xFormat)(e))!=null?t:new Date(e)}else _(e)&&!isNaN(e)&&(n=new Date(+e));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),n}function yt(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function $t(e,t,n=!1){const r=!!e.node;let i=!1;for(const[o,s]of Object.entries(t))if(i=r?e.style(o)===s:e.style[o]===s,n===!1&&i)break;return i}function wt(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function Et(e,t){const{DocumentTouch:n,matchMedia:r,navigator:i}=window,o=r==null?void 0:r("(pointer:coarse)").matches;let s=!1;if(t)if(i&&"maxTouchPoints"in i)s=i.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)s=!0;else if(o)s=!0;else{const a=i.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(a)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(a)}return e&&!o&&(r==null?void 0:r("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function Ae(e,t){t()===!1?requestAnimationFrame(()=>Ae(e,t)):e()}function Ot(e){if(g(e)&&!h(e)){const s=e;return{top:s.top||0,right:s.right||0,bottom:s.bottom||0,left:s.left||0}}const t=(h(e)?e.trim().split(/\s+/):[e]).map(s=>+s||0),[n,r=n,i=n,o=r]=t;return{top:n,right:r,bottom:i,left:o}}function Re(e){const t=this.config;let n,r,i;const o=()=>{const s=r.shift();if(s&&n&&x(n)&&s in n)return n=n[s],o();if(!s)return n};Object.keys(t).forEach(s=>{n=e,r=s.split("_"),i=o(),M(i)&&(t[s]=i)}),this.api&&(this.state.orgConfig=e)}var Se=Object.defineProperty,Ie=(e,t,n)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t,n)=>Ie(e,typeof t!="symbol"?t+"":t,n);class F{constructor(t={}){w(this,"$$"),w(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}w(F,"version","3.17.2");class Le{constructor(){return{selector:void 0}}}var Me=Object.defineProperty,De=(e,t,n)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>De(e,typeof t!="symbol"?t+"":t,n);class N extends F{constructor(t){return super(t),E(this,"config"),E(this,"element"),this.config=new Le,this}$beforeInit(){Re.call(this,this.options),this.validate(),this.element=[].slice.call(document.querySelectorAll(this.config.selector)),this.overrideInternals(),this.overrideOptions(),this.overHandler=this.overHandler.bind(this),this.moveHandler=this.moveHandler.bind(this),this.outHandler=this.outHandler.bind(this)}validate(){const{$$:t,config:n}=this;let r="";if((!n.selector||!document.querySelector(n.selector))&&(r="No holder elements found from given selector option."),(t.hasType("bubble")||t.hasType("scatter")||t.hasArcType(t.data.targets))&&(r="Contains non supported chart types."),r)throw new Error(`[Sparkline plugin] ${r}`)}overrideInternals(){const{$$:t}=this,{getBarW:n,getIndices:r}=t;t.getIndices=function(i,o,s){return s==="getShapeX"?{}:r.call(this,i,o)},t.getBarW=function(i,o){return n.call(this,i,o,1)}}overrideOptions(){const{config:t}=this.$$;if(t.legend_show=!1,t.resize_auto=!1,t.axis_x_show=!1,t.padding!==!1){const n=r=>Object.keys(r||{}).length>0;n(t.axis_x_padding)&&(t.axis_x_padding={left:15,right:15,unit:"px"}),n(t.axis_y_padding)&&(t.axis_y_padding=5)}t.axis_y_show=!1,t.tooltip_position||(t.tooltip_position=function(n,r,i){const{internal:{state:{event:o}}}=this;let s=o.pageY-i*1.35,l=o.pageX-r/2;return s<0&&(s=0),l<0&&(l=0),{top:s,left:l}})}$init(){var t;const{$$:{$el:n}}=this;n.chart.style("width","0").style("height","0").style("pointer-events","none"),(t=n.tooltip)!=null&&t.node()&&document.body.appendChild(n.tooltip.node())}$afterInit(){const{$$:t}=this;t.$el.svg.attr("style",null).style("width","0").style("height","0"),this.bindEvents(!0)}bindEvents(t=!0){const{$$:{config:n}}=this;if(n.interaction_enabled&&n.tooltip_show){const r=`${t?"add":"remove"}EventListener`;this.element.forEach(i=>{const o=i.querySelector("svg");o[r]("mouseover",this.overHandler),o[r]("mousemove",this.moveHandler),o[r]("mouseout",this.outHandler)})}}overHandler(t){const{$$:n}=this,{state:{eventReceiver:r}}=n;r.rect=t.target.getBoundingClientRect()}moveHandler(t){var n,r,i,o;const{$$:s}=this,l=s.getDataIndexFromEvent(t),a=(n=s.api.data(t.target.__id))==null?void 0:n[0],u=(r=a==null?void 0:a.values)==null?void 0:r[l];u&&!u.name&&(u.name=u.id),s.state.event=t,(i=s.isPointFocusOnly)!=null&&i.call(s)&&u&&((o=s.showCircleFocus)==null||o.call(s,[u])),s.setExpand(l,a.id,!0),s.showTooltip([u],t.target)}outHandler(t){const{$$:n}=this;n.state.event=t,n.isPointFocusOnly()?n.hideCircleFocus():n.unexpandCircles(),n.hideTooltip()}$redraw(){var t;const{$$:n}=this,{$el:r}=n;let i=this.element;const o=n.api.data(),s=(t=r.chart.html().match(/<svg[^>]*>/))==null?void 0:t[0];if(i.length<o.length){const l=r.chart.node();for(let a=o.length-i.length;a>0;a--)l.parentNode.insertBefore(i[0].cloneNode(),l.nextSibling);this.element=document.querySelectorAll(this.config.selector),i=this.element}o.map(l=>l.id).forEach((l,a)=>{const u=`.${R.target}-${l}`,O=r.main.selectAll(u);let p=i[a].querySelector("svg");p||(i[a].innerHTML=`${s}</svg>`,p=i[a].querySelector("svg"),p.__id=l),p.querySelector(u)||O.style("opacity",null),O.style("fill","none").style("opacity",null),p.innerHTML="",p.appendChild(O.node())})}$willDestroy(){this.bindEvents(!1),this.element.forEach(t=>{t.innerHTML=""})}}return E(N,"version","0.0.1"),m=m.default,m})()});
11
+ */(function(b,f){typeof exports=="object"&&typeof module=="object"?module.exports=f(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],f):typeof exports=="object"?exports.bb=f(require("d3-brush"),require("d3-selection")):(b.bb=b.bb||{},b.bb.plugin=b.bb.plugin||{},b.bb.plugin.sparkline=f(b.d3,b.d3))})(this,function(C,b){return(function(){"use strict";var f={747:(function(e){e.exports=b}),853:(function(e){e.exports=C})},P={};function d(e){var t=P[e];if(t!==void 0)return t.exports;var n=P[e]={exports:{}};return f[e](n,n.exports,d),n.exports}(function(){d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var m={};d.d(m,{default:function(){return q}});var H=Object.defineProperty,A=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,R=(e,t,n)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))U.call(t,n)&&R(e,n,t[n]);if(A)for(var n of A(t))X.call(t,n)&&R(e,n,t[n]);return e};const S={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},Y={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},V={area:"bb-area",areas:"bb-areas"},G={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},z={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},W={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},K={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},Z={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},J={dragarea:"bb-dragarea",INCLUDED:"_included_"},Q={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},ee={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},te={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},ne={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},re={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},se={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},ie={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},Ne={level:"bb-level",levels:"bb-levels"},oe={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},ce={region:"bb-region",regions:"bb-regions"},le={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},ae={shape:"bb-shape",shapes:"bb-shapes"},ue={brush:"bb-brush",subchart:"bb-subchart"},be={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",textBorderRect:"bb-text-border",textLabelImage:"bb-text-label-image",TextOverlapping:"text-overlapping"},de={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},fe={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},he={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var ke=c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c({},S),Y),V),G),z),W),K),Z),J),ee),te),ne),re),se),Q),ie),oe),ce),le),ae),ue),be),de),fe),he),qe=d(853),He=d(747);function pe(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function ge(e){const t=typeof(e==null?void 0:e.requestAnimationFrame)=="function"&&typeof(e==null?void 0:e.cancelAnimationFrame)=="function",n=typeof(e==null?void 0:e.requestIdleCallback)=="function"&&typeof(e==null?void 0:e.cancelIdleCallback)=="function",r=i=>setTimeout(i,1),s=i=>clearTimeout(i);return[t?e.requestAnimationFrame:r,t?e.cancelAnimationFrame:s,n?e.requestIdleCallback:r,n?e.cancelIdleCallback:s]}const v=pe(),me=v==null?void 0:v.document,[Ue,Xe,Ye,Ve]=ge(v);var ve=Object.defineProperty,I=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable,L=(e,t,n)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t)=>{for(var n in t||(t={}))_e.call(t,n)&&L(e,n,t[n]);if(I)for(var n of I(t))xe.call(t,n)&&L(e,n,t[n]);return e};const Ge=e=>e||e===0,ye=e=>typeof e=="function",h=e=>typeof e=="string",_=e=>typeof e=="number",$e=e=>typeof e=="undefined",D=e=>typeof e!="undefined",ze=e=>typeof e=="boolean",We=e=>Math.ceil(e/10)*10,Ke=e=>Math.ceil(e)+.5,Ze=e=>e[1]-e[0],x=e=>typeof e=="object",we=e=>{for(const t in e)return!1;return!0},Ee=e=>$e(e)||e===null||h(e)&&e.length===0||x(e)&&!(e instanceof Date)&&we(e)||_(e)&&isNaN(e),Oe=e=>!Ee(e),y=e=>Array.isArray(e),g=e=>e&&!(e!=null&&e.nodeType)&&x(e)&&!y(e);function Je(e,t,n){return D(e[t])?e[t]:n}function Qe(e,t){let n=!1;return Object.keys(e).forEach(r=>e[r]===t&&(n=!0)),n}function et(e,t,...n){const r=ye(e);return r&&e.call(t,...n),r}function tt(e,t){let n=0;const r=function(...s){!--n&&t.apply(this,...s)};"duration"in e?e.each(()=>++n).on("end",r):(++n,e.call(r))}const j="script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math",$={tags:new RegExp(`<(${j})[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(${j})[^>]*\\/?>`,"gi"),eventHandlers:/\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,dangerousUrls:/(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi};function Te(e){return!h(e)||!e||e.indexOf("<")===-1?e:e.replace($.tags,"").replace($.eventHandlers,"").replace($.dangerousUrls,'$1=""')}function nt(e,t,n=[-1,1],r=!1){if(!(!e||!h(t)))if(t.indexOf(`
12
+ `)===-1)e.text(t);else{const s=[e.text(),t].map(i=>i.replace(/[\s\n]/g,""));if(s[0]!==s[1]){const i=t.split(`
13
+ `),o=r?i.length-1:1;e.html(""),i.forEach((l,a)=>{e.append("tspan").attr("x",0).attr("dy",`${a===0?n[0]*o:n[1]}em`).text(l)})}}}function Ce(e){const{x:t,y:n,width:r,height:s}=e.getBBox();return[{x:t,y:n+s},{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+s}]}function rt(e){const{width:t,height:n}=F(e),r=Ce(e),s=r[0].x,i=Math.min(r[0].y,r[1].y);return{x:s,y:i,width:t,height:n}}function st(e,t){var n;const r=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let s=[0,0];try{s=d3Pointer(r||e,t)}catch(i){}return s.map(i=>isNaN(i)?0:i)}function Pe(e){const{event:t,$el:n}=e,r=n.subchart.main||n.main;let s;return t&&t.type==="brush"?s=t.selection:r&&(s=r.select(".bb-brush").node())&&(s=d3BrushSelection(s)),s}function B(e,t,n=!1){const r=s=>s[e?"getBoundingClientRect":"getBBox"]();return n?r(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=r(t):t.rect}function F(e,t=!1){return B(!0,e,t)}function it(e,t=!1){return B(!1,e,t)}function ot(e=!0,t=0,n=1e4){const r=window.crypto||window.msCrypto,s=r?t+r.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(s):s}function N(e,t,n,r,s){if(n>r)return-1;const i=Math.floor((n+r)/2);let{x:o,w:l=0}=e[i];return s&&(o=e[i].y,l=e[i].h),t>=o&&t<=o+l?i:t<o?N(e,t,n,i-1,s):N(e,t,i+1,r,s)}function ct(e){const t=Pe(e);return t?t[0]===t[1]:!0}function lt(...e){const t=n=>{if(g(n)&&n.constructor){const r=new n.constructor;for(const s in n)r[s]=t(n[s]);return r}return n};return e.map(n=>t(n)).reduce((n,r)=>M(M({},n),r))}function Ae(e={},t){y(t)&&t.forEach(n=>Ae(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const at=e=>e.charAt(0).toUpperCase()+e.slice(1);function ut(e,t="-"){return e.split(t).map((n,r)=>r?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Re=e=>[].slice.call(e);function bt(e,t,n){const{rootSelector:r="",sheet:s}=e,o=`${r} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return s[s.insertRule?"insertRule":"addRule"](o,s.cssRules.length)}function dt(e){let t=[];return e.forEach(n=>{var r;try{n.cssRules&&n.cssRules.length&&(t=t.concat(Re(n.cssRules)))}catch(s){(r=window.console)==null||r.warn(`Error while reading rules from ${n.href}: ${s.toString()}`)}}),t}function ft(e){var t,n,r,s,i,o;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((r=e.scrollLeft)!=null?r:0),y:((i=(s=window.pageYOffset)!=null?s:window.scrollY)!=null?i:0)+((o=e.scrollTop)!=null?o:0)}}function ht(e,t=0,n=0,r=!0){const s=new DOMPoint(t,n),i=e.getScreenCTM(),o=s.matrixTransform(r?i==null?void 0:i.inverse():i);if(r===!1){const l=F(e);o.x-=l.x,o.y-=l.y}return o}function pt(e){const t=e?e.transform:null,n=t&&t.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function gt(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((r,s,i)=>i.indexOf(r)===s);return t?n.map(r=>new Date(r)):n}function mt(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function w(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return g(e)&&g(n)&&Object.keys(n).forEach(r=>{if(!/^(__proto__|constructor|prototype)$/i.test(r)){const s=n[r];g(s)?(!e[r]&&(e[r]={}),e[r]=w(e[r],s)):e[r]=y(s)?s.concat():s}}),w(e,...t)}function Se(e,t=!0){let n;return e[0]instanceof Date?n=t?(r,s)=>r-s:(r,s)=>s-r:t&&!e.every(isNaN)?n=(r,s)=>r-s:t||(n=(r,s)=>r>s&&-1||r<s&&1||r===s&&0),e.concat().sort(n)}function vt(e,t){let n=t.filter(r=>Oe(r));return n.length?_(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=Se(n,e==="min")[0]):n=void 0,n}const _t=(e,t,n=1)=>{const r=[],s=Math.max(0,Math.ceil((t-e)/n))|0;for(let i=e;i<s;i++)r.push(e+i*n);return r},xt={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,r=e())=>{t.dispatchEvent(new MouseEvent(n,r))}}catch(t){return(n,r,s=e())=>{const i=me.createEvent("MouseEvent");i.initMouseEvent(r,s.bubbles,s.cancelable,v,0,s.screenX,s.screenY,s.clientX,s.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}}})(),touch:(e,t,n)=>{const r=new Touch(w({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[r],targetTouches:[],changedTouches:[r]}))}};function yt(e,t){let n=e;for(const r in t)n=n.replace(new RegExp(`{=${r}}`,"g"),t[r]);return Te(n)}function $t(e){var t;let n;if(e instanceof Date)n=e;else if(h(e)){const{config:r,format:s}=this;n=(t=s.dataTime(r.data_xFormat)(e))!=null?t:new Date(e)}else _(e)&&!isNaN(e)&&(n=new Date(+e));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),n}function wt(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function Et(e,t,n=!1){const r=!!e.node;let s=!1;for(const[i,o]of Object.entries(t))if(s=r?e.style(i)===o:e.style[i]===o,n===!1&&s)break;return s}function Ot(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function Tt(e,t){const{DocumentTouch:n,matchMedia:r,navigator:s}=window,i=r==null?void 0:r("(pointer:coarse)").matches;let o=!1;if(t)if(s&&"maxTouchPoints"in s)o=s.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)o=!0;else if(i)o=!0;else{const a=s.userAgent;o=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(a)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(a)}return e&&!i&&(r==null?void 0:r("(pointer:fine)").matches)&&"mouse"||o&&"touch"||"mouse"}function Ie(e,t){t()===!1?requestAnimationFrame(()=>Ie(e,t)):e()}function Ct(e){if(g(e)&&!h(e)){const o=e;return{top:o.top||0,right:o.right||0,bottom:o.bottom||0,left:o.left||0}}const t=(h(e)?e.trim().split(/\s+/):[e]).map(o=>+o||0),[n,r=n,s=n,i=r]=t;return{top:n,right:r,bottom:s,left:i}}function Le(e){const t=this.config;let n,r,s;const i=()=>{const o=r.shift();if(o&&n&&x(n)&&o in n)return n=n[o],i();if(!o)return n};Object.keys(t).forEach(o=>{n=e,r=o.split("_"),s=i(),D(s)&&(t[o]=s)}),this.api&&(this.state.orgConfig=e)}var Me=Object.defineProperty,De=(e,t,n)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>De(e,typeof t!="symbol"?t+"":t,n);class k{constructor(t={}){E(this,"$$"),E(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}E(k,"version","3.17.3");class je{constructor(){return{selector:void 0}}}var Be=Object.defineProperty,Fe=(e,t,n)=>t in e?Be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O=(e,t,n)=>Fe(e,typeof t!="symbol"?t+"":t,n);class q extends k{constructor(t){return super(t),O(this,"config"),O(this,"element"),this.config=new je,this}$beforeInit(){Le.call(this,this.options),this.validate(),this.element=[].slice.call(document.querySelectorAll(this.config.selector)),this.overrideInternals(),this.overrideOptions(),this.overHandler=this.overHandler.bind(this),this.moveHandler=this.moveHandler.bind(this),this.outHandler=this.outHandler.bind(this)}validate(){const{$$:t,config:n}=this;let r="";if((!n.selector||!document.querySelector(n.selector))&&(r="No holder elements found from given selector option."),(t.hasType("bubble")||t.hasType("scatter")||t.hasArcType(t.data.targets))&&(r="Contains non supported chart types."),r)throw new Error(`[Sparkline plugin] ${r}`)}overrideInternals(){const{$$:t}=this,{getBarW:n,getIndices:r}=t;t.getIndices=function(s,i,o){return o==="getShapeX"?{}:r.call(this,s,i)},t.getBarW=function(s,i){return n.call(this,s,i,1)}}overrideOptions(){const{config:t}=this.$$;if(t.legend_show=!1,t.resize_auto=!1,t.axis_x_show=!1,t.padding!==!1){const n=r=>Object.keys(r||{}).length>0;n(t.axis_x_padding)&&(t.axis_x_padding={left:15,right:15,unit:"px"}),n(t.axis_y_padding)&&(t.axis_y_padding=5)}t.axis_y_show=!1,t.tooltip_position||(t.tooltip_position=function(n,r,s){const{internal:{state:{event:i}}}=this;let o=i.pageY-s*1.35,l=i.pageX-r/2;return o<0&&(o=0),l<0&&(l=0),{top:o,left:l}})}$init(){var t;const{$$:{$el:n}}=this;n.chart.style("width","0").style("height","0").style("pointer-events","none"),(t=n.tooltip)!=null&&t.node()&&document.body.appendChild(n.tooltip.node())}$afterInit(){const{$$:t}=this;t.$el.svg.attr("style",null).style("width","0").style("height","0"),this.bindEvents(!0)}bindEvents(t=!0){const{$$:{config:n}}=this;if(n.interaction_enabled&&n.tooltip_show){const r=`${t?"add":"remove"}EventListener`;this.element.forEach(s=>{const i=s.querySelector("svg");i[r]("mouseover",this.overHandler),i[r]("mousemove",this.moveHandler),i[r]("mouseout",this.outHandler)})}}overHandler(t){const{$$:n}=this,{state:{eventReceiver:r}}=n;r.rect=t.target.getBoundingClientRect()}moveHandler(t){var n,r,s,i;const{$$:o}=this,l=o.getDataIndexFromEvent(t),a=(n=o.api.data(t.target.__id))==null?void 0:n[0],u=(r=a==null?void 0:a.values)==null?void 0:r[l];u&&!u.name&&(u.name=u.id),o.state.event=t,(s=o.isPointFocusOnly)!=null&&s.call(o)&&u&&((i=o.showCircleFocus)==null||i.call(o,[u])),o.setExpand(l,a.id,!0),o.showTooltip([u],t.target)}outHandler(t){const{$$:n}=this;n.state.event=t,n.isPointFocusOnly()?n.hideCircleFocus():n.unexpandCircles(),n.hideTooltip()}$redraw(){var t;const{$$:n}=this,{$el:r}=n;let s=this.element;const i=n.api.data(),o=(t=r.chart.html().match(/<svg[^>]*>/))==null?void 0:t[0];if(s.length<i.length){const l=r.chart.node();for(let a=i.length-s.length;a>0;a--)l.parentNode.insertBefore(s[0].cloneNode(),l.nextSibling);this.element=document.querySelectorAll(this.config.selector),s=this.element}i.map(l=>l.id).forEach((l,a)=>{const u=`.${S.target}-${l}`,T=r.main.selectAll(u);let p=s[a].querySelector("svg");p||(s[a].innerHTML=`${o}</svg>`,p=s[a].querySelector("svg"),p.__id=l),p.querySelector(u)||T.style("opacity",null),T.style("fill","none").style("opacity",null),p.innerHTML="",p.appendChild(T.node())})}$willDestroy(){this.bindEvents(!1),this.element.forEach(t=>{t.innerHTML=""})}}return O(q,"version","0.0.1"),m=m.default,m})()});
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.2
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -411,8 +411,20 @@ function endall(transition, cb) {
411
411
  transition.call(end);
412
412
  }
413
413
  }
414
+ const dangerousTags = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math";
415
+ const sanitizeRx = {
416
+ tags: new RegExp(
417
+ `<(${dangerousTags})[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(${dangerousTags})[^>]*\\/?>`,
418
+ "gi"
419
+ ),
420
+ eventHandlers: /\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,
421
+ dangerousUrls: /(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi
422
+ };
414
423
  function sanitize(str) {
415
- return isString(str) ? str.replace(/<(script|img)?/ig, "&lt;").replace(/(script)?>/ig, "&gt;") : str;
424
+ if (!isString(str) || !str || str.indexOf("<") === -1) {
425
+ return str;
426
+ }
427
+ return str.replace(sanitizeRx.tags, "").replace(sanitizeRx.eventHandlers, "").replace(sanitizeRx.dangerousUrls, '$1=""');
416
428
  }
417
429
  function setTextValue(node, text, dy = [-1, 1], toMiddle = false) {
418
430
  if (!node || !isString(text)) {
@@ -724,7 +736,7 @@ function tplProcess(tpl, data) {
724
736
  for (const x in data) {
725
737
  res = res.replace(new RegExp(`{=${x}}`, "g"), data[x]);
726
738
  }
727
- return res;
739
+ return sanitize(res);
728
740
  }
729
741
  function parseDate(date) {
730
742
  var _a;
@@ -884,7 +896,7 @@ class Plugin {
884
896
  });
885
897
  }
886
898
  }
887
- __publicField(Plugin, "version", "3.17.2");
899
+ __publicField(Plugin, "version", "3.17.3");
888
900
 
889
901
  // EXTERNAL MODULE: external {"commonjs":"d3-axis","commonjs2":"d3-axis","amd":"d3-axis","root":"d3"}
890
902
  var external_commonjs_d3_axis_commonjs2_d3_axis_amd_d3_axis_root_d3_ = __webpack_require__(8);
@@ -5,12 +5,12 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.2
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
- */(function(f,x){typeof exports=="object"&&typeof module=="object"?module.exports=x(require("d3-color"),require("d3-interpolate"),require("d3-scale"),require("d3-brush"),require("d3-selection"),require("d3-axis"),require("d3-format")):typeof define=="function"&&define.amd?define("bb",["d3-color","d3-interpolate","d3-scale","d3-brush","d3-selection","d3-axis","d3-format"],x):typeof exports=="object"?exports.bb=x(require("d3-color"),require("d3-interpolate"),require("d3-scale"),require("d3-brush"),require("d3-selection"),require("d3-axis"),require("d3-format")):(f.bb=f.bb||{},f.bb.plugin=f.bb.plugin||{},f.bb.plugin.stanford=x(f.d3,f.d3,f.d3,f.d3,f.d3,f.d3,f.d3))})(this,function(j,f,x,K,W,Z,J){return(function(){"use strict";var Q={218:(function(t){t.exports=j}),390:(function(t){t.exports=J}),455:(function(t){t.exports=x}),747:(function(t){t.exports=W}),798:(function(t){t.exports=f}),853:(function(t){t.exports=K}),996:(function(t){t.exports=Z})},M={};function h(t){var e=M[t];if(e!==void 0)return e.exports;var n=M[t]={exports:{}};return Q[t](n,n.exports,h),n.exports}(function(){h.d=function(t,e){for(var n in e)h.o(e,n)&&!h.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})}})(),(function(){h.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}})();var v={};h.d(v,{default:function(){return ce}});var D=h(218),tt=h(798),E=h(455),et=Object.defineProperty,I=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,N=(t,e,n)=>e in t?et(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,u=(t,e)=>{for(var n in e||(e={}))nt.call(e,n)&&N(t,n,e[n]);if(I)for(var n of I(e))ot.call(e,n)&&N(t,n,e[n]);return t};const rt={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},st={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},at={area:"bb-area",areas:"bb-areas"},it={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},ct={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},lt={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},ut={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},dt={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},bt={dragarea:"bb-dragarea",INCLUDED:"_included_"},ft={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},ht={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},pt={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},gt={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},mt={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},_t={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},xt={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},ue={level:"bb-level",levels:"bb-levels"},yt={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},vt={region:"bb-region",regions:"bb-regions"},$t={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},wt={shape:"bb-shape",shapes:"bb-shapes"},Et={brush:"bb-brush",subchart:"bb-subchart"},St={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",textBorderRect:"bb-text-border",textLabelImage:"bb-text-label-image",TextOverlapping:"text-overlapping"},S={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},Ct={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},Ot={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var de=u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({},rt),st),at),it),ct),lt),ut),dt),bt),ht),pt),gt),mt),_t),ft),xt),yt),vt),$t),wt),Et),St),S),Ct),Ot),be=h(853),fe=h(747);function Pt(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function Rt(t){const e=typeof(t==null?void 0:t.requestAnimationFrame)=="function"&&typeof(t==null?void 0:t.cancelAnimationFrame)=="function",n=typeof(t==null?void 0:t.requestIdleCallback)=="function"&&typeof(t==null?void 0:t.cancelIdleCallback)=="function",o=s=>setTimeout(s,1),r=s=>clearTimeout(s);return[e?t.requestAnimationFrame:o,e?t.cancelAnimationFrame:r,n?t.requestIdleCallback:o,n?t.cancelIdleCallback:r]}const $=Pt(),Tt=$==null?void 0:$.document,[he,pe,ge,me]=Rt($);var At=Object.defineProperty,F=Object.getOwnPropertySymbols,Lt=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,B=(t,e,n)=>e in t?At(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,q=(t,e)=>{for(var n in e||(e={}))Lt.call(e,n)&&B(t,n,e[n]);if(F)for(var n of F(e))jt.call(e,n)&&B(t,n,e[n]);return t};const _e=t=>t||t===0,C=t=>typeof t=="function",_=t=>typeof t=="string",O=t=>typeof t=="number",Mt=t=>typeof t=="undefined",U=t=>typeof t!="undefined",xe=t=>typeof t=="boolean",ye=t=>Math.ceil(t/10)*10,ve=t=>Math.ceil(t)+.5,$e=t=>t[1]-t[0],P=t=>typeof t=="object",Dt=t=>{for(const e in t)return!1;return!0},X=t=>Mt(t)||t===null||_(t)&&t.length===0||P(t)&&!(t instanceof Date)&&Dt(t)||O(t)&&isNaN(t),It=t=>!X(t),R=t=>Array.isArray(t),y=t=>t&&!(t!=null&&t.nodeType)&&P(t)&&!R(t);function we(t,e,n){return U(t[e])?t[e]:n}function Ee(t,e){let n=!1;return Object.keys(t).forEach(o=>t[o]===e&&(n=!0)),n}function Se(t,e,...n){const o=C(t);return o&&t.call(e,...n),o}function Ce(t,e){let n=0;const o=function(...r){!--n&&e.apply(this,...r)};"duration"in t?t.each(()=>++n).on("end",o):(++n,t.call(o))}function Oe(t){return _(t)?t.replace(/<(script|img)?/ig,"&lt;").replace(/(script)?>/ig,"&gt;"):t}function Pe(t,e,n=[-1,1],o=!1){if(!(!t||!_(e)))if(e.indexOf(`
11
+ */(function(f,x){typeof exports=="object"&&typeof module=="object"?module.exports=x(require("d3-color"),require("d3-interpolate"),require("d3-scale"),require("d3-brush"),require("d3-selection"),require("d3-axis"),require("d3-format")):typeof define=="function"&&define.amd?define("bb",["d3-color","d3-interpolate","d3-scale","d3-brush","d3-selection","d3-axis","d3-format"],x):typeof exports=="object"?exports.bb=x(require("d3-color"),require("d3-interpolate"),require("d3-scale"),require("d3-brush"),require("d3-selection"),require("d3-axis"),require("d3-format")):(f.bb=f.bb||{},f.bb.plugin=f.bb.plugin||{},f.bb.plugin.stanford=x(f.d3,f.d3,f.d3,f.d3,f.d3,f.d3,f.d3))})(this,function(M,f,x,Z,J,Q,tt){return(function(){"use strict";var et={218:(function(t){t.exports=M}),390:(function(t){t.exports=tt}),455:(function(t){t.exports=x}),747:(function(t){t.exports=J}),798:(function(t){t.exports=f}),853:(function(t){t.exports=Z}),996:(function(t){t.exports=Q})},D={};function h(t){var e=D[t];if(e!==void 0)return e.exports;var n=D[t]={exports:{}};return et[t](n,n.exports,h),n.exports}(function(){h.d=function(t,e){for(var n in e)h.o(e,n)&&!h.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})}})(),(function(){h.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}})();var v={};h.d(v,{default:function(){return de}});var I=h(218),nt=h(798),E=h(455),ot=Object.defineProperty,N=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,F=(t,e,n)=>e in t?ot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,u=(t,e)=>{for(var n in e||(e={}))rt.call(e,n)&&F(t,n,e[n]);if(N)for(var n of N(e))st.call(e,n)&&F(t,n,e[n]);return t};const at={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},it={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},ct={area:"bb-area",areas:"bb-areas"},lt={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},ut={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},dt={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},bt={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},ft={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},ht={dragarea:"bb-dragarea",INCLUDED:"_included_"},pt={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},gt={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},mt={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},_t={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},xt={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},yt={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},vt={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},fe={level:"bb-level",levels:"bb-levels"},$t={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},wt={region:"bb-region",regions:"bb-regions"},Et={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},St={shape:"bb-shape",shapes:"bb-shapes"},Ct={brush:"bb-brush",subchart:"bb-subchart"},Ot={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",textBorderRect:"bb-text-border",textLabelImage:"bb-text-label-image",TextOverlapping:"text-overlapping"},S={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},Pt={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},Rt={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var he=u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({},at),it),ct),lt),ut),dt),bt),ft),ht),gt),mt),_t),xt),yt),pt),vt),$t),wt),Et),St),Ct),Ot),S),Pt),Rt),pe=h(853),ge=h(747);function Tt(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function At(t){const e=typeof(t==null?void 0:t.requestAnimationFrame)=="function"&&typeof(t==null?void 0:t.cancelAnimationFrame)=="function",n=typeof(t==null?void 0:t.requestIdleCallback)=="function"&&typeof(t==null?void 0:t.cancelIdleCallback)=="function",o=s=>setTimeout(s,1),r=s=>clearTimeout(s);return[e?t.requestAnimationFrame:o,e?t.cancelAnimationFrame:r,n?t.requestIdleCallback:o,n?t.cancelIdleCallback:r]}const $=Tt(),Lt=$==null?void 0:$.document,[me,_e,xe,ye]=At($);var jt=Object.defineProperty,B=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,q=(t,e,n)=>e in t?jt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,U=(t,e)=>{for(var n in e||(e={}))Mt.call(e,n)&&q(t,n,e[n]);if(B)for(var n of B(e))Dt.call(e,n)&&q(t,n,e[n]);return t};const ve=t=>t||t===0,C=t=>typeof t=="function",_=t=>typeof t=="string",O=t=>typeof t=="number",It=t=>typeof t=="undefined",X=t=>typeof t!="undefined",$e=t=>typeof t=="boolean",we=t=>Math.ceil(t/10)*10,Ee=t=>Math.ceil(t)+.5,Se=t=>t[1]-t[0],P=t=>typeof t=="object",Nt=t=>{for(const e in t)return!1;return!0},Y=t=>It(t)||t===null||_(t)&&t.length===0||P(t)&&!(t instanceof Date)&&Nt(t)||O(t)&&isNaN(t),Ft=t=>!Y(t),R=t=>Array.isArray(t),y=t=>t&&!(t!=null&&t.nodeType)&&P(t)&&!R(t);function Ce(t,e,n){return X(t[e])?t[e]:n}function Oe(t,e){let n=!1;return Object.keys(t).forEach(o=>t[o]===e&&(n=!0)),n}function Pe(t,e,...n){const o=C(t);return o&&t.call(e,...n),o}function Re(t,e){let n=0;const o=function(...r){!--n&&e.apply(this,...r)};"duration"in t?t.each(()=>++n).on("end",o):(++n,t.call(o))}const V="script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math",T={tags:new RegExp(`<(${V})[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(${V})[^>]*\\/?>`,"gi"),eventHandlers:/\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,dangerousUrls:/(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi};function Bt(t){return!_(t)||!t||t.indexOf("<")===-1?t:t.replace(T.tags,"").replace(T.eventHandlers,"").replace(T.dangerousUrls,'$1=""')}function Te(t,e,n=[-1,1],o=!1){if(!(!t||!_(e)))if(e.indexOf(`
12
12
  `)===-1)t.text(e);else{const r=[t.text(),e].map(s=>s.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const s=e.split(`
13
- `),a=o?s.length-1:1;t.html(""),s.forEach((i,d)=>{t.append("tspan").attr("x",0).attr("dy",`${d===0?n[0]*a:n[1]}em`).text(i)})}}}function Nt(t){const{x:e,y:n,width:o,height:r}=t.getBBox();return[{x:e,y:n+r},{x:e,y:n},{x:e+o,y:n},{x:e+o,y:n+r}]}function Re(t){const{width:e,height:n}=V(t),o=Nt(t),r=o[0].x,s=Math.min(o[0].y,o[1].y);return{x:r,y:s,width:e,height:n}}function Te(t,e){var n;const o=t&&((n=t.touches||t.sourceEvent&&t.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=d3Pointer(o||t,e)}catch(s){}return r.map(s=>isNaN(s)?0:s)}function Ft(t){const{event:e,$el:n}=t,o=n.subchart.main||n.main;let r;return e&&e.type==="brush"?r=e.selection:o&&(r=o.select(".bb-brush").node())&&(r=d3BrushSelection(r)),r}function Y(t,e,n=!1){const o=r=>r[t?"getBoundingClientRect":"getBBox"]();return n?o(e):!("rect"in e)||"rect"in e&&e.hasAttribute("width")&&e.rect.width!==+(e.getAttribute("width")||0)?e.rect=o(e):e.rect}function V(t,e=!1){return Y(!0,t,e)}function Ae(t,e=!1){return Y(!1,t,e)}function Le(t=!0,e=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?e+o.getRandomValues(new Uint32Array(1))[0]%(n-e+1):Math.floor(Math.random()*(n-e)+e);return t?String(r):r}function G(t,e,n,o,r){if(n>o)return-1;const s=Math.floor((n+o)/2);let{x:a,w:i=0}=t[s];return r&&(a=t[s].y,i=t[s].h),e>=a&&e<=a+i?s:e<a?G(t,e,n,s-1,r):G(t,e,s+1,o,r)}function je(t){const e=Ft(t);return e?e[0]===e[1]:!0}function Me(...t){const e=n=>{if(y(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=e(n[r]);return o}return n};return t.map(n=>e(n)).reduce((n,o)=>q(q({},n),o))}function Bt(t={},e){R(e)&&e.forEach(n=>Bt(t,n));for(const n in e)/^\d+$/.test(n)||n in t||(t[n]=e[n]);return t}const De=t=>t.charAt(0).toUpperCase()+t.slice(1);function Ie(t,e="-"){return t.split(e).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const qt=t=>[].slice.call(t);function Ne(t,e,n){const{rootSelector:o="",sheet:r}=t,a=`${o} ${(i=>i.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(e)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](a,r.cssRules.length)}function Fe(t){let e=[];return t.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(e=e.concat(qt(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),e}function Be(t){var e,n,o,r,s,a;return{x:((n=(e=window.pageXOffset)!=null?e:window.scrollX)!=null?n:0)+((o=t.scrollLeft)!=null?o:0),y:((s=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?s:0)+((a=t.scrollTop)!=null?a:0)}}function qe(t,e=0,n=0,o=!0){const r=new DOMPoint(e,n),s=t.getScreenCTM(),a=r.matrixTransform(o?s==null?void 0:s.inverse():s);if(o===!1){const i=V(t);a.x-=i.x,a.y-=i.y}return a}function Ue(t){const e=t?t.transform:null,n=e&&e.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Xe(t){const e=t[0]instanceof Date,n=(e?t.map(Number):t).filter((o,r,s)=>s.indexOf(o)===r);return e?n.map(o=>new Date(o)):n}function Ye(t){return t&&t.length?t.reduce((e,n)=>e.concat(n)):[]}function T(t,...e){if(!e.length||e.length===1&&!e[0])return t;const n=e.shift();return y(t)&&y(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];y(r)?(!t[o]&&(t[o]={}),t[o]=T(t[o],r)):t[o]=R(r)?r.concat():r}}),T(t,...e)}function Ut(t,e=!0){let n;return t[0]instanceof Date?n=e?(o,r)=>o-r:(o,r)=>r-o:e&&!t.every(isNaN)?n=(o,r)=>o-r:e||(n=(o,r)=>o>r&&-1||o<r&&1||o===r&&0),t.concat().sort(n)}function Ve(t,e){let n=e.filter(o=>It(o));return n.length?O(n[0])?n=Math[t](...n):n[0]instanceof Date&&(n=Ut(n,t==="min")[0]):n=void 0,n}const Xt=(t,e,n=1)=>{const o=[],r=Math.max(0,Math.ceil((e-t)/n))|0;for(let s=t;s<r;s++)o.push(t+s*n);return o},Ge={mouse:(()=>{const t=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(e,n,o=t())=>{e.dispatchEvent(new MouseEvent(n,o))}}catch(e){return(n,o,r=t())=>{const s=Tt.createEvent("MouseEvent");s.initMouseEvent(o,r.bubbles,r.cancelable,$,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(s)}}})(),touch:(t,e,n)=>{const o=new Touch(T({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));t.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function ke(t,e){let n=t;for(const o in e)n=n.replace(new RegExp(`{=${o}}`,"g"),e[o]);return n}function Yt(t){var e;let n;if(t instanceof Date)n=t;else if(_(t)){const{config:o,format:r}=this;n=(e=r.dataTime(o.data_xFormat)(t))!=null?e:new Date(t)}else O(t)&&!isNaN(t)&&(n=new Date(+t));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${t}' to Date object`),n}function ze(t){const e=t.attr("viewBox");return e?/(\d+(\.\d+)?){3}/.test(e):!1}function He(t,e,n=!1){const o=!!t.node;let r=!1;for(const[s,a]of Object.entries(e))if(r=o?t.style(s)===a:t.style[s]===a,n===!1&&r)break;return r}function Ke(){var t,e;return((t=document)==null?void 0:t.hidden)===!1||((e=document)==null?void 0:e.visibilityState)==="visible"}function We(t,e){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,s=o==null?void 0:o("(pointer:coarse)").matches;let a=!1;if(e)if(r&&"maxTouchPoints"in r)a=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)a=!0;else if(s)a=!0;else{const d=r.userAgent;a=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(d)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(d)}return t&&!s&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||a&&"touch"||"mouse"}function Vt(t,e){e()===!1?requestAnimationFrame(()=>Vt(t,e)):t()}function Ze(t){if(y(t)&&!_(t)){const a=t;return{top:a.top||0,right:a.right||0,bottom:a.bottom||0,left:a.left||0}}const e=(_(t)?t.trim().split(/\s+/):[t]).map(a=>+a||0),[n,o=n,r=n,s=o]=e;return{top:n,right:o,bottom:r,left:s}}function Gt(t){const e=this.config;let n,o,r;const s=()=>{const a=o.shift();if(a&&n&&P(n)&&a in n)return n=n[a],s();if(!a)return n};Object.keys(e).forEach(a=>{n=t,o=a.split("_"),r=s(),U(r)&&(e[a]=r)}),this.api&&(this.state.orgConfig=t)}var kt=Object.defineProperty,zt=(t,e,n)=>e in t?kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,A=(t,e,n)=>zt(t,typeof e!="symbol"?e+"":e,n);class k{constructor(e={}){A(this,"$$"),A(this,"options"),this.options=e}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}A(k,"version","3.17.2");var Ht=h(996),Kt=h(390),p={colorScale:"bb-colorscale",stanfordElements:"bb-stanford-elements",stanfordLine:"bb-stanford-line",stanfordLines:"bb-stanford-lines",stanfordRegion:"bb-stanford-region",stanfordRegions:"bb-stanford-regions"},Wt=Object.defineProperty,Zt=(t,e,n)=>e in t?Wt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,z=(t,e,n)=>Zt(t,typeof e!="symbol"?e+"":e,n);class Jt{constructor(e){z(this,"owner"),z(this,"colorScale"),this.owner=e}drawColorScale(){const{$$:e,config:n}=this.owner,o=e.data.targets[0],r=e.state.height-n.padding_bottom-n.padding_top,s=n.scale_width,a=5,i=Xt(n.padding_bottom,r,a),d=(0,E.scaleSequential)(o.colors).domain([i[i.length-1],i[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",r).attr("class",p.colorScale),this.colorScale.append("g").attr("transform",`translate(0, ${n.padding_top})`).selectAll("bars").data(i).enter().append("rect").attr("y",(m,le)=>le*a).attr("x",0).attr("width",s).attr("height",a).attr("fill",m=>d(m));const b=(0,E.scaleSymlog)().domain([o.minEpochs,o.maxEpochs]).range([i[0]+n.padding_top+i[i.length-1]+a-1,i[0]+n.padding_top]),c=(0,Ht.axisRight)(b),l=n.scale_format;l==="pow10"?c.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):C(l)?c.tickFormat(l):c.tickFormat((0,Kt.format)("d"));const g=this.colorScale.append("g").attr("class","legend axis").attr("transform",`translate(${s},0)`).call(c);l==="pow10"&&g.selectAll(".tick text").text(null).filter(m=>m/Math.pow(10,Math.ceil(Math.log(m)/Math.LN10-1e-12))===1).text(10).append("tspan").attr("dy","-.7em").text(m=>Math.round(Math.log(m)/Math.LN10)),this.colorScale.attr("transform",`translate(${e.state.current.width-this.xForColorScale()}, 0)`)}xForColorScale(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width}getColorScalePadding(){return this.xForColorScale()+this.owner.config.padding_left+20}}function Qt(t,e){const n=t.x,o=t.value;let r=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const i=e[s].x,d=e[s].y,b=e[a].x,c=e[a].y;d>o!=c>o&&n<(b-i)*(o-d)/(c-d)+i&&(r=!r)}return r}function te(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function ee(t){let e=0,n,o;for(let r=0,s=t.length,a=s-1;r<s;a=r,r++)n=t[r],o=t[a],e+=n.x*o.y,e-=n.y*o.x;return e/=2,e}function w(t){const e=ee(t);let n=0,o=0,r;for(let s=0,a=t.length,i=a-1;s<a;i=s,s++){const d=t[s],b=t[i];r=d.x*b.y-b.x*d.y,n+=(d.x+b.x)*r,o+=(d.y+b.y)*r}return r=e*6,{x:n/r,y:o/r}}var ne=Object.defineProperty,oe=(t,e,n)=>e in t?ne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,re=(t,e,n)=>oe(t,typeof e!="symbol"?e+"":e,n);class se{constructor(e){re(this,"owner"),this.owner=e;const n=e.$$.$el.main.select(".bb-chart").append("g").attr("class",p.stanfordElements);n.append("g").attr("class",p.stanfordLines),n.append("g").attr("class",p.stanfordRegions)}updateStanfordLines(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=r.select(`.${p.stanfordLines}`).style("shape-rendering","geometricprecision").selectAll(`.${p.stanfordLine}`).data(this.owner.config.lines);d.exit().transition().duration(e).style("opacity","0").remove();const b=d.enter().append("g");b.append("line").style("opacity","0"),b.merge(d).attr("class",c=>p.stanfordLine+(c.class?` ${c.class}`:"")).select("line").transition().duration(e).attr("x1",c=>s?i(c,"y1"):a(c,"x1")).attr("x2",c=>s?i(c,"y2"):a(c,"x2")).attr("y1",c=>s?a(c,"x1"):i(c,"y1")).attr("y2",c=>s?a(c,"x2"):i(c,"y2")).transition().style("opacity",null)}updateStanfordRegions(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=this.owner.countEpochsInRegion.bind(n);let b=r.select(`.${p.stanfordRegions}`).selectAll(`.${p.stanfordRegion}`).data(this.owner.config.regions);b.exit().transition().duration(e).style("opacity","0").remove();const c=b.enter().append("g");c.append("polygon").style("opacity","0"),c.append("text").attr("transform",s?"rotate(-90)":"").style("opacity","0"),b=c.merge(b),b.attr("class",l=>p.stanfordRegion+(l.class?` ${l.class}`:"")).select("polygon").transition().duration(e).attr("points",l=>l.points.map(g=>[s?i(g,"y"):a(g,"x"),s?a(g,"x"):i(g,"y")].join(",")).join(" ")).transition().style("opacity",l=>String(l.opacity?l.opacity:.2)),b.select("text").transition().duration(e).attr("x",l=>s?i(w(l.points),"y"):a(w(l.points),"x")).attr("y",l=>s?a(w(l.points),"x"):i(w(l.points),"y")).text(l=>{if(l.text){const{value:g,percentage:m}=d(l.points);return l.text(g,m)}return""}).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)}updateStanfordElements(e=0){this.updateStanfordLines(e),this.updateStanfordRegions(e)}xvCustom(e,n){const o=this,{axis:r,config:s}=o;let a=n?e[n]:o.getBaseValue(e);return r.isTimeSeries()?a=Yt.call(o,a):r.isCategorized()&&_(a)&&(a=s.axis_x_categories.indexOf(e.value)),o.scale.x(a)}yvCustom(e,n){const o=this,r=e.axis&&e.axis==="y2"?o.scale.y2:o.scale.y,s=n?e[n]:o.getBaseValue(e);return r(s)}}class H{constructor(){return{colors:void 0,epochs:[],lines:[],scale_min:void 0,scale_max:void 0,scale_width:20,scale_format:void 0,padding_top:0,padding_right:0,padding_bottom:0,padding_left:0,regions:[]}}}var ae=Object.defineProperty,ie=(t,e,n)=>e in t?ae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L=(t,e,n)=>ie(t,typeof e!="symbol"?e+"":e,n);class ce extends k{constructor(e){return super(e),L(this,"config"),L(this,"colorScale"),L(this,"elements"),this.config=new H,this}$beforeInit(){const{$$:e}=this;e.config.data_xSort=!1,e.isMultipleX=()=>!0,e.showGridFocus=()=>{},e.labelishData=o=>o.values,e.opacityForCircle=()=>1;const n=e.getCurrentPadding.bind(e);e.getCurrentPadding=()=>{const o=n();return o.right+=this.colorScale?this.colorScale.getColorScalePadding():0,o}}$init(){const{$$:e}=this;Gt.call(this,this.options),e.color=this.getStanfordPointColor.bind(e),this.colorScale=new Jt(this),this.elements=new se(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),e.right+=this.colorScale?this.colorScale.getColorScalePadding():0,this.$redraw()}$redraw(e){var n,o;(n=this.colorScale)==null||n.drawColorScale(),(o=this.elements)==null||o.updateStanfordElements(e)}getOptions(){return new H}convertData(){const e=this.$$.data.targets,n=this.options.epochs;e.forEach(o=>{o.values.forEach((r,s)=>{r.epochs=n[s]}),o.minEpochs=void 0,o.maxEpochs=void 0,o.colors=void 0,o.colorscale=void 0})}initStanfordData(){const{config:e}=this,n=this.$$.data.targets[0];n.values.sort(te);const o=n.values.map(r=>r.epochs);n.minEpochs=isNaN(e.scale_min)?Math.min(...o):e.scale_min,n.maxEpochs=isNaN(e.scale_max)?Math.max(...o):e.scale_max,n.colors=C(e.colors)?e.colors:(0,tt.interpolateHslLong)((0,D.hsl)(250,1,.5),(0,D.hsl)(0,1,.5)),n.colorscale=(0,E.scaleSequentialLog)(n.colors).domain([n.minEpochs,n.maxEpochs])}getStanfordPointColor(e){return this.data.targets[0].colorscale(e.epochs)}setStanfordTooltip(){const{config:e}=this.$$;X(e.tooltip_contents)&&(e.tooltip_contents=function(n,o,r,s){const{data_x:a}=e;let i=`<table class="${S.tooltip}"><tbody>`;return n.forEach(d=>{const{id:b="",value:c=0,epochs:l=0,x:g=""}=d;i+=`<tr>
13
+ `),a=o?s.length-1:1;t.html(""),s.forEach((i,d)=>{t.append("tspan").attr("x",0).attr("dy",`${d===0?n[0]*a:n[1]}em`).text(i)})}}}function qt(t){const{x:e,y:n,width:o,height:r}=t.getBBox();return[{x:e,y:n+r},{x:e,y:n},{x:e+o,y:n},{x:e+o,y:n+r}]}function Ae(t){const{width:e,height:n}=k(t),o=qt(t),r=o[0].x,s=Math.min(o[0].y,o[1].y);return{x:r,y:s,width:e,height:n}}function Le(t,e){var n;const o=t&&((n=t.touches||t.sourceEvent&&t.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=d3Pointer(o||t,e)}catch(s){}return r.map(s=>isNaN(s)?0:s)}function Ut(t){const{event:e,$el:n}=t,o=n.subchart.main||n.main;let r;return e&&e.type==="brush"?r=e.selection:o&&(r=o.select(".bb-brush").node())&&(r=d3BrushSelection(r)),r}function G(t,e,n=!1){const o=r=>r[t?"getBoundingClientRect":"getBBox"]();return n?o(e):!("rect"in e)||"rect"in e&&e.hasAttribute("width")&&e.rect.width!==+(e.getAttribute("width")||0)?e.rect=o(e):e.rect}function k(t,e=!1){return G(!0,t,e)}function je(t,e=!1){return G(!1,t,e)}function Me(t=!0,e=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?e+o.getRandomValues(new Uint32Array(1))[0]%(n-e+1):Math.floor(Math.random()*(n-e)+e);return t?String(r):r}function z(t,e,n,o,r){if(n>o)return-1;const s=Math.floor((n+o)/2);let{x:a,w:i=0}=t[s];return r&&(a=t[s].y,i=t[s].h),e>=a&&e<=a+i?s:e<a?z(t,e,n,s-1,r):z(t,e,s+1,o,r)}function De(t){const e=Ut(t);return e?e[0]===e[1]:!0}function Ie(...t){const e=n=>{if(y(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=e(n[r]);return o}return n};return t.map(n=>e(n)).reduce((n,o)=>U(U({},n),o))}function Xt(t={},e){R(e)&&e.forEach(n=>Xt(t,n));for(const n in e)/^\d+$/.test(n)||n in t||(t[n]=e[n]);return t}const Ne=t=>t.charAt(0).toUpperCase()+t.slice(1);function Fe(t,e="-"){return t.split(e).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Yt=t=>[].slice.call(t);function Be(t,e,n){const{rootSelector:o="",sheet:r}=t,a=`${o} ${(i=>i.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(e)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](a,r.cssRules.length)}function qe(t){let e=[];return t.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(e=e.concat(Yt(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),e}function Ue(t){var e,n,o,r,s,a;return{x:((n=(e=window.pageXOffset)!=null?e:window.scrollX)!=null?n:0)+((o=t.scrollLeft)!=null?o:0),y:((s=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?s:0)+((a=t.scrollTop)!=null?a:0)}}function Xe(t,e=0,n=0,o=!0){const r=new DOMPoint(e,n),s=t.getScreenCTM(),a=r.matrixTransform(o?s==null?void 0:s.inverse():s);if(o===!1){const i=k(t);a.x-=i.x,a.y-=i.y}return a}function Ye(t){const e=t?t.transform:null,n=e&&e.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Ve(t){const e=t[0]instanceof Date,n=(e?t.map(Number):t).filter((o,r,s)=>s.indexOf(o)===r);return e?n.map(o=>new Date(o)):n}function Ge(t){return t&&t.length?t.reduce((e,n)=>e.concat(n)):[]}function A(t,...e){if(!e.length||e.length===1&&!e[0])return t;const n=e.shift();return y(t)&&y(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];y(r)?(!t[o]&&(t[o]={}),t[o]=A(t[o],r)):t[o]=R(r)?r.concat():r}}),A(t,...e)}function Vt(t,e=!0){let n;return t[0]instanceof Date?n=e?(o,r)=>o-r:(o,r)=>r-o:e&&!t.every(isNaN)?n=(o,r)=>o-r:e||(n=(o,r)=>o>r&&-1||o<r&&1||o===r&&0),t.concat().sort(n)}function ke(t,e){let n=e.filter(o=>Ft(o));return n.length?O(n[0])?n=Math[t](...n):n[0]instanceof Date&&(n=Vt(n,t==="min")[0]):n=void 0,n}const Gt=(t,e,n=1)=>{const o=[],r=Math.max(0,Math.ceil((e-t)/n))|0;for(let s=t;s<r;s++)o.push(t+s*n);return o},ze={mouse:(()=>{const t=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(e,n,o=t())=>{e.dispatchEvent(new MouseEvent(n,o))}}catch(e){return(n,o,r=t())=>{const s=Lt.createEvent("MouseEvent");s.initMouseEvent(o,r.bubbles,r.cancelable,$,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(s)}}})(),touch:(t,e,n)=>{const o=new Touch(A({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));t.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function He(t,e){let n=t;for(const o in e)n=n.replace(new RegExp(`{=${o}}`,"g"),e[o]);return Bt(n)}function kt(t){var e;let n;if(t instanceof Date)n=t;else if(_(t)){const{config:o,format:r}=this;n=(e=r.dataTime(o.data_xFormat)(t))!=null?e:new Date(t)}else O(t)&&!isNaN(t)&&(n=new Date(+t));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${t}' to Date object`),n}function Ke(t){const e=t.attr("viewBox");return e?/(\d+(\.\d+)?){3}/.test(e):!1}function We(t,e,n=!1){const o=!!t.node;let r=!1;for(const[s,a]of Object.entries(e))if(r=o?t.style(s)===a:t.style[s]===a,n===!1&&r)break;return r}function Ze(){var t,e;return((t=document)==null?void 0:t.hidden)===!1||((e=document)==null?void 0:e.visibilityState)==="visible"}function Je(t,e){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,s=o==null?void 0:o("(pointer:coarse)").matches;let a=!1;if(e)if(r&&"maxTouchPoints"in r)a=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)a=!0;else if(s)a=!0;else{const d=r.userAgent;a=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(d)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(d)}return t&&!s&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||a&&"touch"||"mouse"}function zt(t,e){e()===!1?requestAnimationFrame(()=>zt(t,e)):t()}function Qe(t){if(y(t)&&!_(t)){const a=t;return{top:a.top||0,right:a.right||0,bottom:a.bottom||0,left:a.left||0}}const e=(_(t)?t.trim().split(/\s+/):[t]).map(a=>+a||0),[n,o=n,r=n,s=o]=e;return{top:n,right:o,bottom:r,left:s}}function Ht(t){const e=this.config;let n,o,r;const s=()=>{const a=o.shift();if(a&&n&&P(n)&&a in n)return n=n[a],s();if(!a)return n};Object.keys(e).forEach(a=>{n=t,o=a.split("_"),r=s(),X(r)&&(e[a]=r)}),this.api&&(this.state.orgConfig=t)}var Kt=Object.defineProperty,Wt=(t,e,n)=>e in t?Kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L=(t,e,n)=>Wt(t,typeof e!="symbol"?e+"":e,n);class H{constructor(e={}){L(this,"$$"),L(this,"options"),this.options=e}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}L(H,"version","3.17.3");var Zt=h(996),Jt=h(390),p={colorScale:"bb-colorscale",stanfordElements:"bb-stanford-elements",stanfordLine:"bb-stanford-line",stanfordLines:"bb-stanford-lines",stanfordRegion:"bb-stanford-region",stanfordRegions:"bb-stanford-regions"},Qt=Object.defineProperty,te=(t,e,n)=>e in t?Qt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,K=(t,e,n)=>te(t,typeof e!="symbol"?e+"":e,n);class ee{constructor(e){K(this,"owner"),K(this,"colorScale"),this.owner=e}drawColorScale(){const{$$:e,config:n}=this.owner,o=e.data.targets[0],r=e.state.height-n.padding_bottom-n.padding_top,s=n.scale_width,a=5,i=Gt(n.padding_bottom,r,a),d=(0,E.scaleSequential)(o.colors).domain([i[i.length-1],i[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",r).attr("class",p.colorScale),this.colorScale.append("g").attr("transform",`translate(0, ${n.padding_top})`).selectAll("bars").data(i).enter().append("rect").attr("y",(m,be)=>be*a).attr("x",0).attr("width",s).attr("height",a).attr("fill",m=>d(m));const b=(0,E.scaleSymlog)().domain([o.minEpochs,o.maxEpochs]).range([i[0]+n.padding_top+i[i.length-1]+a-1,i[0]+n.padding_top]),c=(0,Zt.axisRight)(b),l=n.scale_format;l==="pow10"?c.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):C(l)?c.tickFormat(l):c.tickFormat((0,Jt.format)("d"));const g=this.colorScale.append("g").attr("class","legend axis").attr("transform",`translate(${s},0)`).call(c);l==="pow10"&&g.selectAll(".tick text").text(null).filter(m=>m/Math.pow(10,Math.ceil(Math.log(m)/Math.LN10-1e-12))===1).text(10).append("tspan").attr("dy","-.7em").text(m=>Math.round(Math.log(m)/Math.LN10)),this.colorScale.attr("transform",`translate(${e.state.current.width-this.xForColorScale()}, 0)`)}xForColorScale(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width}getColorScalePadding(){return this.xForColorScale()+this.owner.config.padding_left+20}}function ne(t,e){const n=t.x,o=t.value;let r=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const i=e[s].x,d=e[s].y,b=e[a].x,c=e[a].y;d>o!=c>o&&n<(b-i)*(o-d)/(c-d)+i&&(r=!r)}return r}function oe(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function re(t){let e=0,n,o;for(let r=0,s=t.length,a=s-1;r<s;a=r,r++)n=t[r],o=t[a],e+=n.x*o.y,e-=n.y*o.x;return e/=2,e}function w(t){const e=re(t);let n=0,o=0,r;for(let s=0,a=t.length,i=a-1;s<a;i=s,s++){const d=t[s],b=t[i];r=d.x*b.y-b.x*d.y,n+=(d.x+b.x)*r,o+=(d.y+b.y)*r}return r=e*6,{x:n/r,y:o/r}}var se=Object.defineProperty,ae=(t,e,n)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ie=(t,e,n)=>ae(t,typeof e!="symbol"?e+"":e,n);class ce{constructor(e){ie(this,"owner"),this.owner=e;const n=e.$$.$el.main.select(".bb-chart").append("g").attr("class",p.stanfordElements);n.append("g").attr("class",p.stanfordLines),n.append("g").attr("class",p.stanfordRegions)}updateStanfordLines(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=r.select(`.${p.stanfordLines}`).style("shape-rendering","geometricprecision").selectAll(`.${p.stanfordLine}`).data(this.owner.config.lines);d.exit().transition().duration(e).style("opacity","0").remove();const b=d.enter().append("g");b.append("line").style("opacity","0"),b.merge(d).attr("class",c=>p.stanfordLine+(c.class?` ${c.class}`:"")).select("line").transition().duration(e).attr("x1",c=>s?i(c,"y1"):a(c,"x1")).attr("x2",c=>s?i(c,"y2"):a(c,"x2")).attr("y1",c=>s?a(c,"x1"):i(c,"y1")).attr("y2",c=>s?a(c,"x2"):i(c,"y2")).transition().style("opacity",null)}updateStanfordRegions(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=this.owner.countEpochsInRegion.bind(n);let b=r.select(`.${p.stanfordRegions}`).selectAll(`.${p.stanfordRegion}`).data(this.owner.config.regions);b.exit().transition().duration(e).style("opacity","0").remove();const c=b.enter().append("g");c.append("polygon").style("opacity","0"),c.append("text").attr("transform",s?"rotate(-90)":"").style("opacity","0"),b=c.merge(b),b.attr("class",l=>p.stanfordRegion+(l.class?` ${l.class}`:"")).select("polygon").transition().duration(e).attr("points",l=>l.points.map(g=>[s?i(g,"y"):a(g,"x"),s?a(g,"x"):i(g,"y")].join(",")).join(" ")).transition().style("opacity",l=>String(l.opacity?l.opacity:.2)),b.select("text").transition().duration(e).attr("x",l=>s?i(w(l.points),"y"):a(w(l.points),"x")).attr("y",l=>s?a(w(l.points),"x"):i(w(l.points),"y")).text(l=>{if(l.text){const{value:g,percentage:m}=d(l.points);return l.text(g,m)}return""}).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)}updateStanfordElements(e=0){this.updateStanfordLines(e),this.updateStanfordRegions(e)}xvCustom(e,n){const o=this,{axis:r,config:s}=o;let a=n?e[n]:o.getBaseValue(e);return r.isTimeSeries()?a=kt.call(o,a):r.isCategorized()&&_(a)&&(a=s.axis_x_categories.indexOf(e.value)),o.scale.x(a)}yvCustom(e,n){const o=this,r=e.axis&&e.axis==="y2"?o.scale.y2:o.scale.y,s=n?e[n]:o.getBaseValue(e);return r(s)}}class W{constructor(){return{colors:void 0,epochs:[],lines:[],scale_min:void 0,scale_max:void 0,scale_width:20,scale_format:void 0,padding_top:0,padding_right:0,padding_bottom:0,padding_left:0,regions:[]}}}var le=Object.defineProperty,ue=(t,e,n)=>e in t?le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,j=(t,e,n)=>ue(t,typeof e!="symbol"?e+"":e,n);class de extends H{constructor(e){return super(e),j(this,"config"),j(this,"colorScale"),j(this,"elements"),this.config=new W,this}$beforeInit(){const{$$:e}=this;e.config.data_xSort=!1,e.isMultipleX=()=>!0,e.showGridFocus=()=>{},e.labelishData=o=>o.values,e.opacityForCircle=()=>1;const n=e.getCurrentPadding.bind(e);e.getCurrentPadding=()=>{const o=n();return o.right+=this.colorScale?this.colorScale.getColorScalePadding():0,o}}$init(){const{$$:e}=this;Ht.call(this,this.options),e.color=this.getStanfordPointColor.bind(e),this.colorScale=new ee(this),this.elements=new ce(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),e.right+=this.colorScale?this.colorScale.getColorScalePadding():0,this.$redraw()}$redraw(e){var n,o;(n=this.colorScale)==null||n.drawColorScale(),(o=this.elements)==null||o.updateStanfordElements(e)}getOptions(){return new W}convertData(){const e=this.$$.data.targets,n=this.options.epochs;e.forEach(o=>{o.values.forEach((r,s)=>{r.epochs=n[s]}),o.minEpochs=void 0,o.maxEpochs=void 0,o.colors=void 0,o.colorscale=void 0})}initStanfordData(){const{config:e}=this,n=this.$$.data.targets[0];n.values.sort(oe);const o=n.values.map(r=>r.epochs);n.minEpochs=isNaN(e.scale_min)?Math.min(...o):e.scale_min,n.maxEpochs=isNaN(e.scale_max)?Math.max(...o):e.scale_max,n.colors=C(e.colors)?e.colors:(0,nt.interpolateHslLong)((0,I.hsl)(250,1,.5),(0,I.hsl)(0,1,.5)),n.colorscale=(0,E.scaleSequentialLog)(n.colors).domain([n.minEpochs,n.maxEpochs])}getStanfordPointColor(e){return this.data.targets[0].colorscale(e.epochs)}setStanfordTooltip(){const{config:e}=this.$$;Y(e.tooltip_contents)&&(e.tooltip_contents=function(n,o,r,s){const{data_x:a}=e;let i=`<table class="${S.tooltip}"><tbody>`;return n.forEach(d=>{const{id:b="",value:c=0,epochs:l=0,x:g=""}=d;i+=`<tr>
14
14
  <th>${a||""}</th>
15
15
  <th class="value">${o(g)}</th>
16
16
  </tr>
@@ -21,4 +21,4 @@
21
21
  <tr class="${S.tooltipName}-${b}">
22
22
  <td class="name"><span style="background-color:${s(d)}"></span>Epochs</td>
23
23
  <td class="value">${r(l)}</td>
24
- </tr>`}),`${i}</tbody></table>`})}countEpochsInRegion(e){const o=this.data.targets[0],r=o.values.reduce((a,i)=>a+Number(i.epochs),0),s=o.values.reduce((a,i)=>Qt(i,e)?a+Number(i.epochs):a,0);return{value:s,percentage:s!==0?+(s/r*100).toFixed(1):0}}}return v=v.default,v})()});
24
+ </tr>`}),`${i}</tbody></table>`})}countEpochsInRegion(e){const o=this.data.targets[0],r=o.values.reduce((a,i)=>a+Number(i.epochs),0),s=o.values.reduce((a,i)=>ne(i,e)?a+Number(i.epochs):a,0);return{value:s,percentage:s!==0?+(s/r*100).toFixed(1):0}}}return v=v.default,v})()});
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.2
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -187,8 +187,20 @@ function endall(transition, cb) {
187
187
  transition.call(end);
188
188
  }
189
189
  }
190
+ const dangerousTags = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math";
191
+ const sanitizeRx = {
192
+ tags: new RegExp(
193
+ `<(${dangerousTags})[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(${dangerousTags})[^>]*\\/?>`,
194
+ "gi"
195
+ ),
196
+ eventHandlers: /\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,
197
+ dangerousUrls: /(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi
198
+ };
190
199
  function sanitize(str) {
191
- return isString(str) ? str.replace(/<(script|img)?/ig, "&lt;").replace(/(script)?>/ig, "&gt;") : str;
200
+ if (!isString(str) || !str || str.indexOf("<") === -1) {
201
+ return str;
202
+ }
203
+ return str.replace(sanitizeRx.tags, "").replace(sanitizeRx.eventHandlers, "").replace(sanitizeRx.dangerousUrls, '$1=""');
192
204
  }
193
205
  function setTextValue(node, text, dy = [-1, 1], toMiddle = false) {
194
206
  if (!node || !isString(text)) {
@@ -500,7 +512,7 @@ function tplProcess(tpl, data) {
500
512
  for (const x in data) {
501
513
  res = res.replace(new RegExp(`{=${x}}`, "g"), data[x]);
502
514
  }
503
- return res;
515
+ return sanitize(res);
504
516
  }
505
517
  function parseDate(date) {
506
518
  var _a;
@@ -660,7 +672,7 @@ class Plugin {
660
672
  });
661
673
  }
662
674
  }
663
- __publicField(Plugin, "version", "3.17.2");
675
+ __publicField(Plugin, "version", "3.17.3");
664
676
 
665
677
  ;// ./src/Plugin/tableview/const.ts
666
678
 
@@ -890,13 +902,11 @@ class TableView extends Plugin {
890
902
  })
891
903
  ).join("")}</tr>`;
892
904
  });
893
- const rx = /(<\/?(script|img)[^>]*>|<[^>]+><\/[^>]+>)/ig;
894
- const r = tplProcess(tpl.body, __spreadProps(tableview_spreadValues({}, config), {
905
+ element.innerHTML = tplProcess(tpl.body, __spreadProps(tableview_spreadValues({}, config), {
895
906
  title: config.title || $$.config.title_text || "",
896
907
  thead,
897
908
  tbody
898
- })).replace(rx, "");
899
- element.innerHTML = r;
909
+ }));
900
910
  }
901
911
  $redraw() {
902
912
  const { state } = this.$$;
@@ -5,12 +5,12 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.2
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
- */(function(c,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],u):typeof exports=="object"?exports.bb=u(require("d3-brush"),require("d3-selection")):(c.bb=c.bb||{},c.bb.plugin=c.bb.plugin||{},c.bb.plugin.tableview=u(c.d3,c.d3))})(this,function(j,c){return(function(){"use strict";var u={747:(function(e){e.exports=c}),853:(function(e){e.exports=j})},S={};function a(e){var t=S[e];if(t!==void 0)return t.exports;var n=S[e]={exports:{}};return u[e](n,n.exports,a),n.exports}(function(){a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var _={};a.d(_,{default:function(){return he}});var me=a(853),ge=a(747);function V(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function L(e){const t=typeof(e==null?void 0:e.requestAnimationFrame)=="function"&&typeof(e==null?void 0:e.cancelAnimationFrame)=="function",n=typeof(e==null?void 0:e.requestIdleCallback)=="function"&&typeof(e==null?void 0:e.cancelIdleCallback)=="function",o=i=>setTimeout(i,1),r=i=>clearTimeout(i);return[t?e.requestAnimationFrame:o,t?e.cancelAnimationFrame:r,n?e.requestIdleCallback:o,n?e.cancelIdleCallback:r]}const y=V(),U=y==null?void 0:y.document,[_e,ye,ve,we]=L(y);var z=Object.defineProperty,C=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,M=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t)=>{for(var n in t||(t={}))X.call(t,n)&&M(e,n,t[n]);if(C)for(var n of C(t))Y.call(t,n)&&M(e,n,t[n]);return e};const xe=e=>e||e===0,H=e=>typeof e=="function",f=e=>typeof e=="string",v=e=>typeof e=="number",k=e=>typeof e=="undefined",B=e=>typeof e!="undefined",Oe=e=>typeof e=="boolean",Ee=e=>Math.ceil(e/10)*10,Pe=e=>Math.ceil(e)+.5,Te=e=>e[1]-e[0],O=e=>typeof e=="object",G=e=>{for(const t in e)return!1;return!0},K=e=>k(e)||e===null||f(e)&&e.length===0||O(e)&&!(e instanceof Date)&&G(e)||v(e)&&isNaN(e),W=e=>!K(e),E=e=>Array.isArray(e),m=e=>e&&!(e!=null&&e.nodeType)&&O(e)&&!E(e);function $e(e,t,n){return B(e[t])?e[t]:n}function je(e,t){let n=!1;return Object.keys(e).forEach(o=>e[o]===t&&(n=!0)),n}function Se(e,t,...n){const o=H(e);return o&&e.call(t,...n),o}function Ce(e,t){let n=0;const o=function(...r){!--n&&t.apply(this,...r)};"duration"in e?e.each(()=>++n).on("end",o):(++n,e.call(o))}function Me(e){return f(e)?e.replace(/<(script|img)?/ig,"&lt;").replace(/(script)?>/ig,"&gt;"):e}function De(e,t,n=[-1,1],o=!1){if(!(!e||!f(t)))if(t.indexOf(`
11
+ */(function(c,f){typeof exports=="object"&&typeof module=="object"?module.exports=f(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],f):typeof exports=="object"?exports.bb=f(require("d3-brush"),require("d3-selection")):(c.bb=c.bb||{},c.bb.plugin=c.bb.plugin||{},c.bb.plugin.tableview=f(c.d3,c.d3))})(this,function(j,c){return(function(){"use strict";var f={747:(function(e){e.exports=c}),853:(function(e){e.exports=j})},S={};function u(e){var t=S[e];if(t!==void 0)return t.exports;var n=S[e]={exports:{}};return f[e](n,n.exports,u),n.exports}(function(){u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var _={};u.d(_,{default:function(){return me}});var ge=u(853),_e=u(747);function V(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function L(e){const t=typeof(e==null?void 0:e.requestAnimationFrame)=="function"&&typeof(e==null?void 0:e.cancelAnimationFrame)=="function",n=typeof(e==null?void 0:e.requestIdleCallback)=="function"&&typeof(e==null?void 0:e.cancelIdleCallback)=="function",o=i=>setTimeout(i,1),r=i=>clearTimeout(i);return[t?e.requestAnimationFrame:o,t?e.cancelAnimationFrame:r,n?e.requestIdleCallback:o,n?e.cancelIdleCallback:r]}const y=V(),z=y==null?void 0:y.document,[ye,ve,we,xe]=L(y);var H=Object.defineProperty,C=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,M=(e,t,n)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t)=>{for(var n in t||(t={}))X.call(t,n)&&M(e,n,t[n]);if(C)for(var n of C(t))Y.call(t,n)&&M(e,n,t[n]);return e};const Oe=e=>e||e===0,k=e=>typeof e=="function",d=e=>typeof e=="string",v=e=>typeof e=="number",G=e=>typeof e=="undefined",B=e=>typeof e!="undefined",Ee=e=>typeof e=="boolean",$e=e=>Math.ceil(e/10)*10,Pe=e=>Math.ceil(e)+.5,Te=e=>e[1]-e[0],x=e=>typeof e=="object",K=e=>{for(const t in e)return!1;return!0},W=e=>G(e)||e===null||d(e)&&e.length===0||x(e)&&!(e instanceof Date)&&K(e)||v(e)&&isNaN(e),J=e=>!W(e),O=e=>Array.isArray(e),m=e=>e&&!(e!=null&&e.nodeType)&&x(e)&&!O(e);function je(e,t,n){return B(e[t])?e[t]:n}function Se(e,t){let n=!1;return Object.keys(e).forEach(o=>e[o]===t&&(n=!0)),n}function Ce(e,t,...n){const o=k(e);return o&&e.call(t,...n),o}function Me(e,t){let n=0;const o=function(...r){!--n&&t.apply(this,...r)};"duration"in e?e.each(()=>++n).on("end",o):(++n,e.call(o))}const A="script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math",E={tags:new RegExp(`<(${A})[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(${A})[^>]*\\/?>`,"gi"),eventHandlers:/\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,dangerousUrls:/(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi};function Q(e){return!d(e)||!e||e.indexOf("<")===-1?e:e.replace(E.tags,"").replace(E.eventHandlers,"").replace(E.dangerousUrls,'$1=""')}function De(e,t,n=[-1,1],o=!1){if(!(!e||!d(t)))if(t.indexOf(`
12
12
  `)===-1)e.text(t);else{const r=[e.text(),t].map(i=>i.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const i=t.split(`
13
- `),s=o?i.length-1:1;e.html(""),i.forEach((l,b)=>{e.append("tspan").attr("x",0).attr("dy",`${b===0?n[0]*s:n[1]}em`).text(l)})}}}function J(e){const{x:t,y:n,width:o,height:r}=e.getBBox();return[{x:t,y:n+r},{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r}]}function Be(e){const{width:t,height:n}=N(e),o=J(e),r=o[0].x,i=Math.min(o[0].y,o[1].y);return{x:r,y:i,width:t,height:n}}function Ae(e,t){var n;const o=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=d3Pointer(o||e,t)}catch(i){}return r.map(i=>isNaN(i)?0:i)}function Q(e){const{event:t,$el:n}=e,o=n.subchart.main||n.main;let r;return t&&t.type==="brush"?r=t.selection:o&&(r=o.select(".bb-brush").node())&&(r=d3BrushSelection(r)),r}function A(e,t,n=!1){const o=r=>r[e?"getBoundingClientRect":"getBBox"]();return n?o(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=o(t):t.rect}function N(e,t=!1){return A(!0,e,t)}function Ne(e,t=!1){return A(!1,e,t)}function Ie(e=!0,t=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?t+o.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(r):r}function I(e,t,n,o,r){if(n>o)return-1;const i=Math.floor((n+o)/2);let{x:s,w:l=0}=e[i];return r&&(s=e[i].y,l=e[i].h),t>=s&&t<=s+l?i:t<s?I(e,t,n,i-1,r):I(e,t,i+1,o,r)}function Fe(e){const t=Q(e);return t?t[0]===t[1]:!0}function Re(...e){const t=n=>{if(m(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=t(n[r]);return o}return n};return e.map(n=>t(n)).reduce((n,o)=>D(D({},n),o))}function Z(e={},t){E(t)&&t.forEach(n=>Z(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const qe=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ve(e,t="-"){return e.split(t).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const ee=e=>[].slice.call(e);function Le(e,t,n){const{rootSelector:o="",sheet:r}=e,s=`${o} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](s,r.cssRules.length)}function Ue(e){let t=[];return e.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(t=t.concat(ee(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),t}function ze(e){var t,n,o,r,i,s;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((o=e.scrollLeft)!=null?o:0),y:((i=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?i:0)+((s=e.scrollTop)!=null?s:0)}}function Xe(e,t=0,n=0,o=!0){const r=new DOMPoint(t,n),i=e.getScreenCTM(),s=r.matrixTransform(o?i==null?void 0:i.inverse():i);if(o===!1){const l=N(e);s.x-=l.x,s.y-=l.y}return s}function Ye(e){const t=e?e.transform:null,n=t&&t.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function He(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((o,r,i)=>i.indexOf(o)===r);return t?n.map(o=>new Date(o)):n}function ke(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function P(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return m(e)&&m(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];m(r)?(!e[o]&&(e[o]={}),e[o]=P(e[o],r)):e[o]=E(r)?r.concat():r}}),P(e,...t)}function te(e,t=!0){let n;return e[0]instanceof Date?n=t?(o,r)=>o-r:(o,r)=>r-o:t&&!e.every(isNaN)?n=(o,r)=>o-r:t||(n=(o,r)=>o>r&&-1||o<r&&1||o===r&&0),e.concat().sort(n)}function Ge(e,t){let n=t.filter(o=>W(o));return n.length?v(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=te(n,e==="min")[0]):n=void 0,n}const Ke=(e,t,n=1)=>{const o=[],r=Math.max(0,Math.ceil((t-e)/n))|0;for(let i=e;i<r;i++)o.push(e+i*n);return o},We={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,o=e())=>{t.dispatchEvent(new MouseEvent(n,o))}}catch(t){return(n,o,r=e())=>{const i=U.createEvent("MouseEvent");i.initMouseEvent(o,r.bubbles,r.cancelable,y,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}}})(),touch:(e,t,n)=>{const o=new Touch(P({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function w(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return n}function Je(e){var t;let n;if(e instanceof Date)n=e;else if(f(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else v(e)&&!isNaN(e)&&(n=new Date(+e));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),n}function Qe(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function Ze(e,t,n=!1){const o=!!e.node;let r=!1;for(const[i,s]of Object.entries(t))if(r=o?e.style(i)===s:e.style[i]===s,n===!1&&r)break;return r}function et(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function tt(e,t){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,i=o==null?void 0:o("(pointer:coarse)").matches;let s=!1;if(t)if(r&&"maxTouchPoints"in r)s=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)s=!0;else if(i)s=!0;else{const b=r.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(b)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(b)}return e&&!i&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function ne(e,t){t()===!1?requestAnimationFrame(()=>ne(e,t)):e()}function nt(e){if(m(e)&&!f(e)){const s=e;return{top:s.top||0,right:s.right||0,bottom:s.bottom||0,left:s.left||0}}const t=(f(e)?e.trim().split(/\s+/):[e]).map(s=>+s||0),[n,o=n,r=n,i=o]=t;return{top:n,right:o,bottom:r,left:i}}function oe(e){const t=this.config;let n,o,r;const i=()=>{const s=o.shift();if(s&&n&&O(n)&&s in n)return n=n[s],i();if(!s)return n};Object.keys(t).forEach(s=>{n=e,o=s.split("_"),r=i(),B(r)&&(t[s]=r)}),this.api&&(this.state.orgConfig=e)}var re=Object.defineProperty,ie=(e,t,n)=>t in e?re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t,n)=>ie(e,typeof t!="symbol"?t+"":t,n);class F{constructor(t={}){T(this,"$$"),T(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}T(F,"version","3.17.2");const d={id:"__tableview-style__",class:"bb-tableview",rule:`.bb-tableview {
13
+ `),s=o?i.length-1:1;e.html(""),i.forEach((l,a)=>{e.append("tspan").attr("x",0).attr("dy",`${a===0?n[0]*s:n[1]}em`).text(l)})}}}function Z(e){const{x:t,y:n,width:o,height:r}=e.getBBox();return[{x:t,y:n+r},{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r}]}function Be(e){const{width:t,height:n}=I(e),o=Z(e),r=o[0].x,i=Math.min(o[0].y,o[1].y);return{x:r,y:i,width:t,height:n}}function Ae(e,t){var n;const o=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=d3Pointer(o||e,t)}catch(i){}return r.map(i=>isNaN(i)?0:i)}function ee(e){const{event:t,$el:n}=e,o=n.subchart.main||n.main;let r;return t&&t.type==="brush"?r=t.selection:o&&(r=o.select(".bb-brush").node())&&(r=d3BrushSelection(r)),r}function N(e,t,n=!1){const o=r=>r[e?"getBoundingClientRect":"getBBox"]();return n?o(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=o(t):t.rect}function I(e,t=!1){return N(!0,e,t)}function Ne(e,t=!1){return N(!1,e,t)}function Ie(e=!0,t=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?t+o.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(r):r}function R(e,t,n,o,r){if(n>o)return-1;const i=Math.floor((n+o)/2);let{x:s,w:l=0}=e[i];return r&&(s=e[i].y,l=e[i].h),t>=s&&t<=s+l?i:t<s?R(e,t,n,i-1,r):R(e,t,i+1,o,r)}function Re(e){const t=ee(e);return t?t[0]===t[1]:!0}function Fe(...e){const t=n=>{if(m(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=t(n[r]);return o}return n};return e.map(n=>t(n)).reduce((n,o)=>D(D({},n),o))}function te(e={},t){O(t)&&t.forEach(n=>te(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const qe=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ue(e,t="-"){return e.split(t).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const ne=e=>[].slice.call(e);function Ve(e,t,n){const{rootSelector:o="",sheet:r}=e,s=`${o} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](s,r.cssRules.length)}function Le(e){let t=[];return e.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(t=t.concat(ne(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),t}function ze(e){var t,n,o,r,i,s;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((o=e.scrollLeft)!=null?o:0),y:((i=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?i:0)+((s=e.scrollTop)!=null?s:0)}}function He(e,t=0,n=0,o=!0){const r=new DOMPoint(t,n),i=e.getScreenCTM(),s=r.matrixTransform(o?i==null?void 0:i.inverse():i);if(o===!1){const l=I(e);s.x-=l.x,s.y-=l.y}return s}function Xe(e){const t=e?e.transform:null,n=t&&t.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Ye(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((o,r,i)=>i.indexOf(o)===r);return t?n.map(o=>new Date(o)):n}function ke(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function $(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return m(e)&&m(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];m(r)?(!e[o]&&(e[o]={}),e[o]=$(e[o],r)):e[o]=O(r)?r.concat():r}}),$(e,...t)}function oe(e,t=!0){let n;return e[0]instanceof Date?n=t?(o,r)=>o-r:(o,r)=>r-o:t&&!e.every(isNaN)?n=(o,r)=>o-r:t||(n=(o,r)=>o>r&&-1||o<r&&1||o===r&&0),e.concat().sort(n)}function Ge(e,t){let n=t.filter(o=>J(o));return n.length?v(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=oe(n,e==="min")[0]):n=void 0,n}const Ke=(e,t,n=1)=>{const o=[],r=Math.max(0,Math.ceil((t-e)/n))|0;for(let i=e;i<r;i++)o.push(e+i*n);return o},We={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,o=e())=>{t.dispatchEvent(new MouseEvent(n,o))}}catch(t){return(n,o,r=e())=>{const i=z.createEvent("MouseEvent");i.initMouseEvent(o,r.bubbles,r.cancelable,y,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}}})(),touch:(e,t,n)=>{const o=new Touch($({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function w(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return Q(n)}function Je(e){var t;let n;if(e instanceof Date)n=e;else if(d(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else v(e)&&!isNaN(e)&&(n=new Date(+e));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),n}function Qe(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function Ze(e,t,n=!1){const o=!!e.node;let r=!1;for(const[i,s]of Object.entries(t))if(r=o?e.style(i)===s:e.style[i]===s,n===!1&&r)break;return r}function et(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function tt(e,t){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,i=o==null?void 0:o("(pointer:coarse)").matches;let s=!1;if(t)if(r&&"maxTouchPoints"in r)s=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)s=!0;else if(i)s=!0;else{const a=r.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(a)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(a)}return e&&!i&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function re(e,t){t()===!1?requestAnimationFrame(()=>re(e,t)):e()}function nt(e){if(m(e)&&!d(e)){const s=e;return{top:s.top||0,right:s.right||0,bottom:s.bottom||0,left:s.left||0}}const t=(d(e)?e.trim().split(/\s+/):[e]).map(s=>+s||0),[n,o=n,r=n,i=o]=t;return{top:n,right:o,bottom:r,left:i}}function ie(e){const t=this.config;let n,o,r;const i=()=>{const s=o.shift();if(s&&n&&x(n)&&s in n)return n=n[s],i();if(!s)return n};Object.keys(t).forEach(s=>{n=e,o=s.split("_"),r=i(),B(r)&&(t[s]=r)}),this.api&&(this.state.orgConfig=e)}var se=Object.defineProperty,le=(e,t,n)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>le(e,typeof t!="symbol"?t+"":t,n);class F{constructor(t={}){P(this,"$$"),P(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}P(F,"version","3.17.3");const b={id:"__tableview-style__",class:"bb-tableview",rule:`.bb-tableview {
14
14
  border-collapse:collapse;
15
15
  border-spacing:0;
16
16
  background:#fff;
@@ -36,4 +36,4 @@
36
36
  margin-bottom: -1px;
37
37
  }`},g={body:`<caption>{=title}</caption>
38
38
  <thead><tr>{=thead}</tr></thead>
39
- <tbody>{=tbody}</tbody>`,thead:'<th scope="col">{=title}</th>',tbodyHeader:'<th scope="row">{=value}</th>',tbody:"<td>{=value}</td>"};class se{constructor(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(t){let n=t;return this.$$.axis.isCategorized()?n=this.$$.categoryName(t):this.$$.axis.isTimeSeries()&&(n=t.toLocaleDateString()),n},class:void 0,style:!0,title:void 0,updateOnToggle:!0,nullString:"-"}}}var le=Object.defineProperty,ce=Object.defineProperties,ae=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,ue=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,$=(e,t,n)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,de=(e,t)=>{for(var n in t||(t={}))ue.call(t,n)&&$(e,n,t[n]);if(R)for(var n of R(t))fe.call(t,n)&&$(e,n,t[n]);return e},be=(e,t)=>ce(e,ae(t)),q=(e,t,n)=>$(e,typeof t!="symbol"?t+"":t,n);class he extends F{constructor(t){return super(t),q(this,"config"),q(this,"element"),this.config=new se,this}$beforeInit(){oe.call(this,this.options)}$init(){const{class:t,selector:n,style:o}=this.config;let r=document.querySelector(n||`.${t||d.class}`);if(!r){const i=this.$$.$el.chart.node();r=document.createElement("table"),i.parentNode.insertBefore(r,i.nextSibling)}if(r.tagName!=="TABLE"){const i=document.createElement("table");r.appendChild(i),r=i}if(o&&!document.getElementById(d.id)){const i=document.createElement("style");i.id=d.id,i.innerHTML=d.rule,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}r.classList.add(...[o&&d.class,t].filter(Boolean)),this.element=r}generateTable(){const{$$:t,config:n,element:o}=this,r=t.filterTargetsToShow(t.data.targets);let i=w(g.thead,{title:r.length?this.config.categoryTitle:""}),s="";const l=[];r.forEach(x=>{i+=w(g.thead,{title:x.id}),x.values.forEach((h,p)=>{l[p]||(l[p]=[h.x]),l[p].push(h.value)})}),l.forEach(x=>{s+=`<tr>${x.map((h,p)=>w(p?g.tbody:g.tbodyHeader,{value:p===0?n.categoryFormat.bind(this)(h):v(h)?h.toLocaleString():n.nullString})).join("")}</tr>`});const b=/(<\/?(script|img)[^>]*>|<[^>]+><\/[^>]+>)/ig,pe=w(g.body,be(de({},n),{title:n.title||t.config.title_text||"",thead:i,tbody:s})).replace(b,"");o.innerHTML=pe}$redraw(){const{state:t}=this.$$;!(t.resizing||!this.config.updateOnToggle&&t.toggling)&&this.generateTable()}$willDestroy(){var t,n;if((t=this.element.parentNode)==null||t.removeChild(this.element),this.$$.charts.length===1){const o=document.getElementById(d.id);(n=o==null?void 0:o.parentNode)==null||n.removeChild(o)}}}return _=_.default,_})()});
39
+ <tbody>{=tbody}</tbody>`,thead:'<th scope="col">{=title}</th>',tbodyHeader:'<th scope="row">{=value}</th>',tbody:"<td>{=value}</td>"};class ce{constructor(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(t){let n=t;return this.$$.axis.isCategorized()?n=this.$$.categoryName(t):this.$$.axis.isTimeSeries()&&(n=t.toLocaleDateString()),n},class:void 0,style:!0,title:void 0,updateOnToggle:!0,nullString:"-"}}}var ae=Object.defineProperty,ue=Object.defineProperties,fe=Object.getOwnPropertyDescriptors,q=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,T=(e,t,n)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,he=(e,t)=>{for(var n in t||(t={}))de.call(t,n)&&T(e,n,t[n]);if(q)for(var n of q(t))be.call(t,n)&&T(e,n,t[n]);return e},pe=(e,t)=>ue(e,fe(t)),U=(e,t,n)=>T(e,typeof t!="symbol"?t+"":t,n);class me extends F{constructor(t){return super(t),U(this,"config"),U(this,"element"),this.config=new ce,this}$beforeInit(){ie.call(this,this.options)}$init(){const{class:t,selector:n,style:o}=this.config;let r=document.querySelector(n||`.${t||b.class}`);if(!r){const i=this.$$.$el.chart.node();r=document.createElement("table"),i.parentNode.insertBefore(r,i.nextSibling)}if(r.tagName!=="TABLE"){const i=document.createElement("table");r.appendChild(i),r=i}if(o&&!document.getElementById(b.id)){const i=document.createElement("style");i.id=b.id,i.innerHTML=b.rule,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}r.classList.add(...[o&&b.class,t].filter(Boolean)),this.element=r}generateTable(){const{$$:t,config:n,element:o}=this,r=t.filterTargetsToShow(t.data.targets);let i=w(g.thead,{title:r.length?this.config.categoryTitle:""}),s="";const l=[];r.forEach(a=>{i+=w(g.thead,{title:a.id}),a.values.forEach((h,p)=>{l[p]||(l[p]=[h.x]),l[p].push(h.value)})}),l.forEach(a=>{s+=`<tr>${a.map((h,p)=>w(p?g.tbody:g.tbodyHeader,{value:p===0?n.categoryFormat.bind(this)(h):v(h)?h.toLocaleString():n.nullString})).join("")}</tr>`}),o.innerHTML=w(g.body,pe(he({},n),{title:n.title||t.config.title_text||"",thead:i,tbody:s}))}$redraw(){const{state:t}=this.$$;!(t.resizing||!this.config.updateOnToggle&&t.toggling)&&this.generateTable()}$willDestroy(){var t,n;if((t=this.element.parentNode)==null||t.removeChild(this.element),this.$$.charts.length===1){const o=document.getElementById(b.id);(n=o==null?void 0:o.parentNode)==null||n.removeChild(o)}}}return _=_.default,_})()});
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.17.2
8
+ * @version 3.17.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -206,8 +206,20 @@ function endall(transition, cb) {
206
206
  transition.call(end);
207
207
  }
208
208
  }
209
+ const dangerousTags = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|svg|math";
210
+ const sanitizeRx = {
211
+ tags: new RegExp(
212
+ `<(${dangerousTags})[\\s\\S]*?>[\\s\\S]*?<\\/\\1>|<(${dangerousTags})[^>]*\\/?>`,
213
+ "gi"
214
+ ),
215
+ eventHandlers: /\s*on\w+\s*=\s*["'][^"']*["']|\s*on\w+\s*=\s*[^\s>]+/gi,
216
+ dangerousUrls: /(href|src|action|formaction|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript):[^"'\s>]*/gi
217
+ };
209
218
  function sanitize(str) {
210
- return isString(str) ? str.replace(/<(script|img)?/ig, "&lt;").replace(/(script)?>/ig, "&gt;") : str;
219
+ if (!isString(str) || !str || str.indexOf("<") === -1) {
220
+ return str;
221
+ }
222
+ return str.replace(sanitizeRx.tags, "").replace(sanitizeRx.eventHandlers, "").replace(sanitizeRx.dangerousUrls, '$1=""');
211
223
  }
212
224
  function setTextValue(node, text, dy = [-1, 1], toMiddle = false) {
213
225
  if (!node || !isString(text)) {
@@ -519,7 +531,7 @@ function tplProcess(tpl, data) {
519
531
  for (const x in data) {
520
532
  res = res.replace(new RegExp(`{=${x}}`, "g"), data[x]);
521
533
  }
522
- return res;
534
+ return sanitize(res);
523
535
  }
524
536
  function parseDate(date) {
525
537
  var _a;
@@ -679,7 +691,7 @@ class Plugin {
679
691
  });
680
692
  }
681
693
  }
682
- __publicField(Plugin, "version", "3.17.2");
694
+ __publicField(Plugin, "version", "3.17.3");
683
695
 
684
696
  ;// ./src/Plugin/textoverlap/Options.ts
685
697
  class Options {