@bino-bi/bn-template-engine 1.0.0-alpha.17 → 1.0.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
- package/dist/bn-template-engine/p-0107f0cc.entry.js +1 -0
- package/dist/bn-template-engine/p-209351c9.entry.js +1 -0
- package/dist/bn-template-engine/p-22d0fb7a.entry.js +1 -0
- package/dist/bn-template-engine/p-2e6dc267.entry.js +1 -0
- package/dist/bn-template-engine/p-485d23d7.entry.js +1 -0
- package/dist/bn-template-engine/p-5651417d.entry.js +1 -0
- package/dist/bn-template-engine/p-5bfdc1e5.entry.js +1 -0
- package/dist/bn-template-engine/p-6b75762d.entry.js +1 -0
- package/dist/bn-template-engine/{p-1a1fd8eb.entry.js → p-7bdc0e28.entry.js} +1 -1
- package/dist/bn-template-engine/p-9879c9b2.entry.js +1 -0
- package/dist/bn-template-engine/p-BWKdb9ym.js +1 -0
- package/dist/bn-template-engine/{p-CIXlJoMr.js → p-BZV1b5VH.js} +1 -1
- package/dist/bn-template-engine/p-Bdfxd_Ke.js +1 -0
- package/dist/bn-template-engine/p-BqhIhYr1.js +1 -0
- package/dist/bn-template-engine/p-C0Pwqx-O.js +1 -0
- package/dist/bn-template-engine/{p-44L8rZSd.js → p-CBqUr7I8.js} +1 -1
- package/dist/bn-template-engine/{p-COXiPUfj.js → p-CPzF3Q2m.js} +1 -1
- package/dist/bn-template-engine/{p-DHibUOw5.js → p-CiudZRQr.js} +1 -1
- package/dist/bn-template-engine/{p-B2KOyHRY.js → p-Dg9OcXAO.js} +1 -1
- package/dist/bn-template-engine/p-DsTzlzxQ.js +1 -0
- package/dist/bn-template-engine/p-X6CxL6W-.js +1 -0
- package/dist/bn-template-engine/p-a130cb43.entry.js +1 -0
- package/dist/bn-template-engine/p-aakBGfzL.js +1 -0
- package/dist/bn-template-engine/p-dc745c32.entry.js +1 -0
- package/dist/bn-template-engine/p-e96da91f.entry.js +1 -0
- package/dist/bn-template-engine/{p-d3fc17ee.entry.js → p-f3d1fa06.entry.js} +1 -1
- package/dist/bn-template-engine/p-fcb43f2c.entry.js +1 -0
- package/dist/bn-template-engine/p-rdqTC0_5.js +1 -0
- package/dist/cjs/{AxisConfig-B_GMRfX_.js → AxisConfig-VnVelfSV.js} +1 -1
- package/dist/cjs/LabelCollisionManager-nfD5P__k.js +412 -0
- package/dist/cjs/NumericScale-BAyYXpKL.js +107 -0
- package/dist/cjs/Order-DobBozQC.js +87 -0
- package/dist/cjs/{LabelCollisionManager-8HGn9W0V.js → SVGStyle-BQOmGWLX.js} +2 -409
- package/dist/cjs/SVGVariancesStyleGroup-DCGfHrqh.js +50 -0
- package/dist/cjs/{VarianceMeasure-DEOzP-XZ.js → VarianceMeasure-NY9yhiNV.js} +1 -1
- package/dist/cjs/{XYChartDataRow-CDl1Ofnv.js → XYChartDataRow-B7OKrAcC.js} +7 -111
- package/dist/cjs/bn-asset_21.cjs.entry.js +221 -263
- package/dist/cjs/bn-chart-bubble.cjs.entry.js +8 -7
- package/dist/cjs/bn-chart-bullet.cjs.entry.js +785 -0
- package/dist/cjs/bn-chart-scatter.cjs.entry.js +8 -7
- package/dist/cjs/bn-grid.cjs.entry.js +5 -4
- package/dist/cjs/bn-image.cjs.entry.js +5 -4
- package/dist/cjs/bn-internationalization.cjs.entry.js +2 -2
- package/dist/cjs/bn-ruleset.cjs.entry.js +2 -2
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-template.cjs.entry.js +1 -1
- package/dist/cjs/bn-text.cjs.entry.js +6 -5
- package/dist/cjs/bn-tree.cjs.entry.js +4 -3
- package/dist/cjs/{context-protocol-CIuyJKkK.js → context-protocol-BDrMkhc4.js} +66 -0
- package/dist/cjs/editor-companion.cjs.entry.js +2 -2
- package/dist/cjs/ibcs-chart-bubble.cjs.entry.js +20 -18
- package/dist/cjs/ibcs-chart-bullet.cjs.entry.js +673 -0
- package/dist/cjs/ibcs-chart-scatter.cjs.entry.js +19 -17
- package/dist/cjs/{layoutObserver-CJWRV_y6.js → layoutObserver-p0wXIWFg.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scaling-B4UPXivZ.js → scaling-BmqxcNOf.js} +1 -1
- package/dist/cjs/{withScalingGroup-D832DQKp.js → withScalingGroup-BmcRlWBs.js} +1 -1
- package/dist/cjs/{withStyled-COxuhL-N.js → withStyled-CRiC9fzc.js} +5 -86
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.css +10 -0
- package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1014 -0
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.css +9 -0
- package/dist/collection/components/bn-chart-bullet/ibcs-chart-bullet.js +538 -0
- package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +440 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletChartStyle.js +132 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/BulletConfig.js +89 -0
- package/dist/collection/components/bn-chart-bullet/utils/model/index.js +2 -0
- package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +1 -1
- package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +1 -1
- package/dist/collection/components/bn-chart-time/bn-chart-time.js +1 -1
- package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
- package/dist/collection/components/bn-context/bn-context.js +1 -1
- package/dist/collection/components/bn-dataset/bn-dataset.js +1 -1
- package/dist/collection/components/bn-datasource/bn-datasource.js +1 -1
- package/dist/collection/components/bn-footer/bn-footer.js +1 -1
- package/dist/collection/components/bn-grid/bn-grid.js +1 -1
- package/dist/collection/components/bn-image/bn-image.js +1 -1
- package/dist/collection/components/bn-internationalization/bn-internationalization.js +1 -1
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +1 -1
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +1 -1
- package/dist/collection/components/bn-message/bn-message.js +1 -1
- package/dist/collection/components/bn-page/bn-page.js +1 -1
- package/dist/collection/components/bn-ruleset/bn-ruleset.js +1 -1
- package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +1 -1
- package/dist/collection/components/bn-table/bn-table.js +1 -1
- package/dist/collection/components/bn-template/bn-template.js +1 -1
- package/dist/collection/components/bn-text/bn-text.js +1 -1
- package/dist/collection/components/bn-title/bn-title.js +1 -1
- package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +1 -1
- package/dist/collection/components/editor-companion/editor-companion.js +1 -1
- package/dist/collection/stores/componentStyles.js +38 -0
- package/dist/collection/stores/internationalization.js +28 -0
- package/dist/components/NumericScale.js +1 -0
- package/dist/components/Order.js +1 -1
- package/dist/components/XYChartDataRow.js +1 -1
- package/dist/components/bn-chart-bullet.d.ts +11 -0
- package/dist/components/bn-chart-bullet.js +1 -0
- package/dist/components/bn-chart-scatter.js +1 -1
- package/dist/components/bn-chart-structure.js +1 -1
- package/dist/components/bn-chart-time.js +1 -1
- package/dist/components/bn-component-style.js +1 -1
- package/dist/components/bn-context.js +1 -1
- package/dist/components/bn-dataset.js +1 -1
- package/dist/components/bn-datasource.js +1 -1
- package/dist/components/bn-footer2.js +1 -1
- package/dist/components/bn-grid.js +1 -1
- package/dist/components/bn-image.js +1 -1
- package/dist/components/bn-internationalization.js +1 -1
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-message2.js +1 -1
- package/dist/components/bn-page2.js +1 -1
- package/dist/components/bn-ruleset.js +1 -1
- package/dist/components/bn-scaling-group.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/bn-template.js +1 -1
- package/dist/components/bn-text.js +1 -1
- package/dist/components/bn-title2.js +1 -1
- package/dist/components/context-protocol.js +1 -1
- package/dist/components/editor-companion.js +1 -1
- package/dist/components/ibcs-chart-bubble2.js +1 -1
- package/dist/components/ibcs-chart-bullet.d.ts +11 -0
- package/dist/components/ibcs-chart-bullet.js +1 -0
- package/dist/components/ibcs-chart-bullet2.js +1 -0
- package/dist/components/ibcs-chart-scatter2.js +1 -1
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-chart-time2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/ibcs-title2.js +1 -1
- package/dist/components/main.js +1 -0
- package/dist/components/stackColors.js +1 -1
- package/dist/esm/{AxisConfig-BwUQrme0.js → AxisConfig-C_zWCKlL.js} +1 -1
- package/dist/esm/LabelCollisionManager-8swVQHKA.js +404 -0
- package/dist/esm/NumericScale-DsTzlzxQ.js +105 -0
- package/dist/esm/Order-BPeWfygb.js +83 -0
- package/dist/esm/{LabelCollisionManager-DZP5Vl8T.js → SVGStyle-BxEDw9zh.js} +3 -403
- package/dist/esm/SVGVariancesStyleGroup-DRQYvSDD.js +48 -0
- package/dist/esm/{VarianceMeasure-Cxshx01h.js → VarianceMeasure-DnwNKspZ.js} +1 -1
- package/dist/esm/{XYChartDataRow-FF_VxRnF.js → XYChartDataRow-DeV4r-Wm.js} +5 -108
- package/dist/esm/bn-asset_21.entry.js +25 -67
- package/dist/esm/bn-chart-bubble.entry.js +8 -7
- package/dist/esm/bn-chart-bullet.entry.js +783 -0
- package/dist/esm/bn-chart-scatter.entry.js +8 -7
- package/dist/esm/bn-grid.entry.js +5 -4
- package/dist/esm/bn-image.entry.js +5 -4
- package/dist/esm/bn-internationalization.entry.js +2 -2
- package/dist/esm/bn-ruleset.entry.js +2 -2
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-template.entry.js +1 -1
- package/dist/esm/bn-text.entry.js +6 -5
- package/dist/esm/bn-tree.entry.js +4 -3
- package/dist/esm/{context-protocol-BNHTlllP.js → context-protocol-1Yj1uKvh.js} +66 -0
- package/dist/esm/editor-companion.entry.js +2 -2
- package/dist/esm/ibcs-chart-bubble.entry.js +6 -4
- package/dist/esm/ibcs-chart-bullet.entry.js +671 -0
- package/dist/esm/ibcs-chart-scatter.entry.js +6 -4
- package/dist/esm/{layoutObserver-D5FY_lQa.js → layoutObserver-DCbmpGrz.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scaling-B7Pa0d_s.js → scaling-B_k50v9z.js} +1 -1
- package/dist/esm/{withScalingGroup-DBheBsP4.js → withScalingGroup-Br70pAv9.js} +1 -1
- package/dist/esm/{withStyled-DTvj2nar.js → withStyled-Br2DGTPs.js} +4 -83
- package/dist/types/components/bn-chart-bullet/bn-chart-bullet.d.ts +172 -0
- package/dist/types/components/bn-chart-bullet/ibcs-chart-bullet.d.ts +52 -0
- package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +91 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletChartStyle.d.ts +70 -0
- package/dist/types/components/bn-chart-bullet/utils/model/BulletConfig.d.ts +43 -0
- package/dist/types/components/bn-chart-bullet/utils/model/index.d.ts +2 -0
- package/dist/types/components.d.ts +399 -4
- package/dist/types/stores/componentStyles.d.ts +20 -0
- package/package.json +1 -1
- package/dist/bn-template-engine/p-172499ac.entry.js +0 -1
- package/dist/bn-template-engine/p-19e65c04.entry.js +0 -1
- package/dist/bn-template-engine/p-2849c367.entry.js +0 -1
- package/dist/bn-template-engine/p-5dd11fcc.entry.js +0 -1
- package/dist/bn-template-engine/p-63f891d9.entry.js +0 -1
- package/dist/bn-template-engine/p-72f63181.entry.js +0 -1
- package/dist/bn-template-engine/p-836ad6f3.entry.js +0 -1
- package/dist/bn-template-engine/p-BnOTt2YD.js +0 -1
- package/dist/bn-template-engine/p-CDPTCKVx.js +0 -1
- package/dist/bn-template-engine/p-CPZIJpxn.js +0 -1
- package/dist/bn-template-engine/p-a50da0f0.entry.js +0 -1
- package/dist/bn-template-engine/p-a9a34fb2.entry.js +0 -1
- package/dist/bn-template-engine/p-b0369558.entry.js +0 -1
- package/dist/bn-template-engine/p-f8c46905.entry.js +0 -1
- package/dist/bn-template-engine/p-lIy3SJs2.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as t,S as s}from"./p-BnOTt2YD.js";import{m as n,C as i}from"./p-CIXlJoMr.js";class r{constructor(t){this.type="",this.base="",this.delta="",this.direction="",this.isValid=!1;const s=/(d|dr)(pl\d|ac\d|fc\d|pp\d)_(pl\d|ac\d|fc\d|pp\d)_(pos|neg|neu)/;if(s.test(t)){const n=s.exec(t);null!=n&&(this.type=String(n[1]),this.base=String(n[2]),this.delta=String(n[3]),this.direction=String(n[4]),this.isValid=!0)}}}var e;!function(t){t.OPERATION="operation",t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CURRENTROW="currentRow",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.COLUMNGROUP="columnGroup",t.COLUMNGROUPINDEX="columnIndex",t.COLUMNSUBGROUP="columnSubGroup",t.COLUMNSUBGROUPINDEX="columnSubGroupIndex",t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4",t.TOTALROWCOUNT="totalRowCnt",t.ROWNR="rowNr",t.TYPE="type"}(e||(e={}));var h,o={},u=t(function(){if(h)return o;h=1;var t={};return Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(s,n){void 0===n&&(n={});var i=JSON.stringify({text:s,options:n});if(t[i])return t[i];n.font=n.font||"Times",n.fontSize=n.fontSize||"16px",n.fontWeight=n.fontWeight||"normal",n.width=n.width||"auto";var r=function(t,s){var n=document.createElement("div"),i=document.createTextNode(t);return n.appendChild(i),n.style.fontFamily=s.font,n.style.fontSize=s.fontSize,n.style.fontWeight=s.fontWeight,n.style.position="absolute",n.style.visibility="hidden",n.style.left="-999px",n.style.top="-999px",n.style.width=s.width,n.style.height="auto",document.body.appendChild(n),n}(s,n),e={width:r.offsetWidth,height:r.offsetHeight};return function(t){t.parentNode.removeChild(t)}(r),t[i]=e,e},o}());class c{static number(t,s="decimal",n=1,i=0,r=1){return(t/r).toLocaleString("de-DE",{style:s,useGrouping:!0,maximumFractionDigits:n,minimumFractionDigits:i}).replace(/\s+(%)/g,"$1").replace(/\s/g,this.postfixSeperator).replace(/\./g,this.tsdDelimiter)}static translateScenarioLabel(t,s){if(null==t)return"";const n=new r(t);if(!n.isValid)return`${s.get(t)||t}`;let i,h;return e.AC1===n.base?(i=s.get("dr"===n.type?"ibcssymbol_delta_ac_relative":"ibcssymbol_delta_ac"),h=s.get(n.delta)||n.delta):(i=s.get("dr"===n.type?"ibcssymbol_delta_generic_relative":"ibcssymbol_delta_generic"),h=`${s.get(n.base)||n.base} - ${s.get(n.delta)||n.delta}`),void 0===i&&(i="{%}"),`${i.replace("{%}",h)}`}static getMaxWidthOfArrayItems(t,s,n){return u(t.map((t=>c.translateScenarioLabel(t,s))).reduce(((t,s)=>t.length<s.length?s:t),""),{font:n.fontStyles.font,fontSize:n.fontStyles.size+"px"}).width}}c.tsdDelimiter=".",c.postfixSeperator=",";const l={},a=[];function f(t,s){if(Array.isArray(t))for(const n of t)f(n,s);else if("object"!=typeof t)d(Object.getOwnPropertyNames(s)),l[t]=Object.assign(l[t]||{},s);else for(const s in t)f(s,t[s])}function p(t){return l[t]||{}}function d(t){a.push(...t)}function w(t,s){let n;const i=t.length,r=[];for(n=0;n<i;n++)r.push(s(t[n]));return r}function m(t){return t%360*Math.PI/180}function y(t){return t.charAt(0).toUpperCase()+t.slice(1)}function g(t,s,n,i){return null!=s&&null!=n||(i=i||t.bbox(),null==s?s=i.width/i.height*n:null==n&&(n=i.height/i.width*s)),{width:s,height:n}}function b(t,s){const n=t.origin;let i=null!=t.ox?t.ox:null!=t.originX?t.originX:"center",r=null!=t.oy?t.oy:null!=t.originY?t.originY:"center";null!=n&&([i,r]=Array.isArray(n)?n:"object"==typeof n?[n.x,n.y]:[n,n]);const e="string"==typeof i,h="string"==typeof r;if(e||h){const{height:t,width:n,x:o,y:u}=s.bbox();e&&(i=i.includes("left")?o:i.includes("right")?o+n:o+n/2),h&&(r=r.includes("top")?u:r.includes("bottom")?u+t:u+t/2)}return[i,r]}const x=new Set(["desc","metadata","title"]),v=t=>x.has(t.nodeName),_=(t,s,n={})=>{const i={...s};for(const t in i)i[t].valueOf()===n[t]&&delete i[t];Object.keys(i).length?t.node.setAttribute("data-svgjs",JSON.stringify(i)):(t.node.removeAttribute("data-svgjs"),t.node.removeAttribute("svgjs:data"))},M="http://www.w3.org/2000/svg",A="http://www.w3.org/2000/xmlns/",k="http://www.w3.org/1999/xlink",O={window:"undefined"==typeof window?null:window,document:"undefined"==typeof document?null:document};class S{}const j={},T="___SYMBOL___ROOT___";function E(t,s=M){return O.document.createElementNS(s,t)}function C(t,s=!1){if(t instanceof S)return t;if("object"==typeof t)return N(t);if(null==t)return new j[T];if("string"==typeof t&&"<"!==t.trim().charAt(0))return N(O.document.querySelector(t));const n=s?O.document.createElement("div"):E("svg");return n.innerHTML=t.trim(),t=N(n.firstElementChild),n.removeChild(n.firstElementChild),t}function D(t,s){return s&&(s instanceof O.window.Node||s.ownerDocument&&s instanceof s.ownerDocument.defaultView.Node)?s:E(t)}function z(t){if(!t)return null;if(t.instance instanceof S)return t.instance;if("#document-fragment"===t.nodeName)return new j.Fragment(t);let s=y(t.nodeName||"Dom");return"LinearGradient"===s||"RadialGradient"===s?s="Gradient":j[s]||(s="Dom"),new j[s](t)}let N=z;function Y(t,s=t.name,n=!1){return j[s]=t,n&&(j[T]=t),d(Object.getOwnPropertyNames(t.prototype)),t}let F=1e3;function I(t){return"Svgjs"+y(t)+F++}function P(t){for(let s=t.children.length-1;s>=0;s--)P(t.children[s]);return t.id?(t.id=I(t.nodeName),t):t}function L(t,s){let n,i;for(i=(t=Array.isArray(t)?t:[t]).length-1;i>=0;i--)for(n in s)t[i].prototype[n]=s[n]}function R(t){return function(...s){const n=s[s.length-1];return!n||n.constructor!==Object||n instanceof Array?t.apply(this,s):t.apply(this,s.slice(0,-1)).attr(n)}}f("Dom",{siblings:function(){return this.parent().children()},position:function(){return this.parent().index(this)},next:function(){return this.siblings()[this.position()+1]},prev:function(){return this.siblings()[this.position()-1]},forward:function(){const t=this.position();return this.parent().add(this.remove(),t+1),this},backward:function(){const t=this.position();return this.parent().add(this.remove(),t?t-1:0),this},front:function(){return this.parent().add(this.remove()),this},back:function(){return this.parent().add(this.remove(),0),this},before:function(t){(t=C(t)).remove();const s=this.position();return this.parent().add(t,s),this},after:function(t){(t=C(t)).remove();const s=this.position();return this.parent().add(t,s+1),this},insertBefore:function(t){return(t=C(t)).before(this),this},insertAfter:function(t){return(t=C(t)).after(this),this}});const G=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i,$=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,H=/rgb\((\d+),(\d+),(\d+)\)/,X=/(#[a-z_][a-z0-9\-_]*)/i,V=/\)\s*,?\s*/,B=/\s/g,Q=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i,W=/^rgb\(/,J=/^(\s+)?$/,q=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,U=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i,Z=/[\s,]+/,K=/[MLHVCSQTAZ]/i;function tt(t){const s=Math.round(t),n=Math.max(0,Math.min(255,s)).toString(16);return 1===n.length?"0"+n:n}function st(t,s){for(let n=s.length;n--;)if(null==t[s[n]])return!1;return!0}function nt(t,s,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(s-t)*n:n<.5?s:n<2/3?t+(s-t)*(2/3-n)*6:t}f("Dom",{classes:function(){const t=this.attr("class");return null==t?[]:t.trim().split(Z)},hasClass:function(t){return-1!==this.classes().indexOf(t)},addClass:function(t){if(!this.hasClass(t)){const s=this.classes();s.push(t),this.attr("class",s.join(" "))}return this},removeClass:function(t){return this.hasClass(t)&&this.attr("class",this.classes().filter((function(s){return s!==t})).join(" ")),this},toggleClass:function(t){return this.hasClass(t)?this.removeClass(t):this.addClass(t)}}),f("Dom",{css:function(t,s){const n={};if(0===arguments.length)return this.node.style.cssText.split(/\s*;\s*/).filter((function(t){return!!t.length})).forEach((function(t){const s=t.split(/\s*:\s*/);n[s[0]]=s[1]})),n;if(arguments.length<2){if(Array.isArray(t)){for(const s of t)n[s]=this.node.style.getPropertyValue(s);return n}if("string"==typeof t)return this.node.style.getPropertyValue(t);if("object"==typeof t)for(const s in t)this.node.style.setProperty(s,null==t[s]||J.test(t[s])?"":t[s])}return 2===arguments.length&&this.node.style.setProperty(t,null==s||J.test(s)?"":s),this},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},visible:function(){return"none"!==this.css("display")}}),f("Dom",{data:function(t,s,n){if(null==t)return this.data(w(function(t){let s;const n=t.length,i=[];for(s=0;s<n;s++)0===t[s].nodeName.indexOf("data-")&&i.push(t[s]);return i}(this.node.attributes),(t=>t.nodeName.slice(5))));if(t instanceof Array){const s={};for(const n of t)s[n]=this.data(n);return s}if("object"==typeof t)for(s in t)this.data(s,t[s]);else if(arguments.length<2)try{return JSON.parse(this.attr("data-"+t))}catch(s){return this.attr("data-"+t)}else this.attr("data-"+t,null===s?null:!0===n||"string"==typeof s||"number"==typeof s?s:JSON.stringify(s));return this}}),f("Dom",{remember:function(t,s){if("object"==typeof arguments[0])for(const s in t)this.remember(s,t[s]);else{if(1===arguments.length)return this.memory()[t];this.memory()[t]=s}return this},forget:function(){if(0===arguments.length)this._memory={};else for(let t=arguments.length-1;t>=0;t--)delete this.memory()[arguments[t]];return this},memory:function(){return this._memory=this._memory||{}}});class it{constructor(...t){this.init(...t)}static isColor(t){return t&&(t instanceof it||this.isRgb(t)||this.test(t))}static isRgb(t){return t&&"number"==typeof t.r&&"number"==typeof t.g&&"number"==typeof t.b}static random(t="vibrant",s){const{random:n,round:i,sin:r,PI:e}=Math;if("vibrant"===t){const t=24*n()+57,s=38*n()+45,i=360*n();return new it(t,s,i,"lch")}if("sine"===t){const t=i(80*r(2*e*(s=null==s?n():s)/.5+.01)+150),h=i(50*r(2*e*s/.5+4.6)+200),o=i(100*r(2*e*s/.5+2.3)+150);return new it(t,h,o)}if("pastel"===t){const t=8*n()+86,s=17*n()+9,i=360*n();return new it(t,s,i,"lch")}if("dark"===t){const t=10+10*n(),s=50*n()+86,i=360*n();return new it(t,s,i,"lch")}if("rgb"===t){const t=255*n(),s=255*n(),i=255*n();return new it(t,s,i)}if("lab"===t){const t=100*n(),s=256*n()-128,i=256*n()-128;return new it(t,s,i,"lab")}if("grey"===t){const t=255*n();return new it(t,t,t)}throw new Error("Unsupported random color mode")}static test(t){return"string"==typeof t&&(Q.test(t)||W.test(t))}cmyk(){const{_a:t,_b:s,_c:n}=this.rgb(),[i,r,e]=[t,s,n].map((t=>t/255)),h=Math.min(1-i,1-r,1-e);return 1===h?new it(0,0,0,1,"cmyk"):new it((1-i-h)/(1-h),(1-r-h)/(1-h),(1-e-h)/(1-h),h,"cmyk")}hsl(){const{_a:t,_b:s,_c:n}=this.rgb(),[i,r,e]=[t,s,n].map((t=>t/255)),h=Math.max(i,r,e),o=Math.min(i,r,e),u=(h+o)/2,c=h===o,l=h-o;return new it(360*(c?0:h===i?((r-e)/l+(r<e?6:0))/6:h===r?((e-i)/l+2)/6:h===e?((i-r)/l+4)/6:0),100*(c?0:u>.5?l/(2-h-o):l/(h+o)),100*u,"hsl")}init(t=0,s=0,n=0,i=0,r="rgb"){if(t=t||0,this.space)for(const t in this.space)delete this[this.space[t]];if("number"==typeof t)r="string"==typeof i?i:r,i="string"==typeof i?0:i,Object.assign(this,{_a:t,_b:s,_c:n,_d:i,space:r});else if(t instanceof Array)this.space=s||("string"==typeof t[3]?t[3]:t[4])||"rgb",Object.assign(this,{_a:t[0],_b:t[1],_c:t[2],_d:t[3]||0});else if(t instanceof Object){const n=function(t,s){const n=st(t,"rgb")?{_a:t.r,_b:t.g,_c:t.b,_d:0,space:"rgb"}:st(t,"xyz")?{_a:t.x,_b:t.y,_c:t.z,_d:0,space:"xyz"}:st(t,"hsl")?{_a:t.h,_b:t.s,_c:t.l,_d:0,space:"hsl"}:st(t,"lab")?{_a:t.l,_b:t.a,_c:t.b,_d:0,space:"lab"}:st(t,"lch")?{_a:t.l,_b:t.c,_c:t.h,_d:0,space:"lch"}:st(t,"cmyk")?{_a:t.c,_b:t.m,_c:t.y,_d:t.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};return n.space=s||n.space,n}(t,s);Object.assign(this,n)}else if("string"==typeof t)if(W.test(t)){const s=t.replace(B,""),[n,i,r]=H.exec(s).slice(1,4).map((t=>parseInt(t)));Object.assign(this,{_a:n,_b:i,_c:r,_d:0,space:"rgb"})}else{if(!Q.test(t))throw Error("Unsupported string format, can't construct Color");{const s=t=>parseInt(t,16),[,n,i,r]=$.exec(function(t){return 4===t.length?["#",t.substring(1,2),t.substring(1,2),t.substring(2,3),t.substring(2,3),t.substring(3,4),t.substring(3,4)].join(""):t}(t)).map(s);Object.assign(this,{_a:n,_b:i,_c:r,_d:0,space:"rgb"})}}const{_a:e,_b:h,_c:o,_d:u}=this;Object.assign(this,"rgb"===this.space?{r:e,g:h,b:o}:"xyz"===this.space?{x:e,y:h,z:o}:"hsl"===this.space?{h:e,s:h,l:o}:"lab"===this.space?{l:e,a:h,b:o}:"lch"===this.space?{l:e,c:h,h:o}:"cmyk"===this.space?{c:e,m:h,y:o,k:u}:{})}lab(){const{x:t,y:s,z:n}=this.xyz();return new it(116*s-16,500*(t-s),200*(s-n),"lab")}lch(){const{l:t,a:s,b:n}=this.lab(),i=Math.sqrt(s**2+n**2);let r=180*Math.atan2(n,s)/Math.PI;return r<0&&(r*=-1,r=360-r),new it(t,i,r,"lch")}rgb(){if("rgb"===this.space)return this;if("lab"===(t=this.space)||"xyz"===t||"lch"===t){let{x:t,y:s,z:n}=this;if("lab"===this.space||"lch"===this.space){let{l:i,a:r,b:e}=this;if("lch"===this.space){const{c:t,h:s}=this,n=Math.PI/180;r=t*Math.cos(n*s),e=t*Math.sin(n*s)}const h=(i+16)/116,o=r/500+h,u=h-e/200,c=16/116,l=.008856,a=7.787;t=.95047*(o**3>l?o**3:(o-c)/a),s=1*(h**3>l?h**3:(h-c)/a),n=1.08883*(u**3>l?u**3:(u-c)/a)}const i=3.2406*t+-1.5372*s+-.4986*n,r=-.9689*t+1.8758*s+.0415*n,e=.0557*t+-.204*s+1.057*n,h=Math.pow,o=.0031308,u=i>o?1.055*h(i,1/2.4)-.055:12.92*i,c=r>o?1.055*h(r,1/2.4)-.055:12.92*r,l=e>o?1.055*h(e,1/2.4)-.055:12.92*e;return new it(255*u,255*c,255*l)}if("hsl"===this.space){let{h:t,s,l:n}=this;if(t/=360,s/=100,n/=100,0===s)return n*=255,new it(n,n,n);const i=n<.5?n*(1+s):n+s-n*s,r=2*n-i,e=255*nt(r,i,t+1/3),h=255*nt(r,i,t),o=255*nt(r,i,t-1/3);return new it(e,h,o)}if("cmyk"===this.space){const{c:t,m:s,y:n,k:i}=this,r=255*(1-Math.min(1,t*(1-i)+i)),e=255*(1-Math.min(1,s*(1-i)+i)),h=255*(1-Math.min(1,n*(1-i)+i));return new it(r,e,h)}return this;var t}toArray(){const{_a:t,_b:s,_c:n,_d:i,space:r}=this;return[t,s,n,i,r]}toHex(){const[t,s,n]=this._clamped().map(tt);return`#${t}${s}${n}`}toRgb(){const[t,s,n]=this._clamped();return`rgb(${t},${s},${n})`}toString(){return this.toHex()}xyz(){const{_a:t,_b:s,_c:n}=this.rgb(),[i,r,e]=[t,s,n].map((t=>t/255)),h=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,o=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,u=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,c=(.4124*h+.3576*o+.1805*u)/.95047,l=(.2126*h+.7152*o+.0722*u)/1,a=(.0193*h+.1192*o+.9505*u)/1.08883,f=c>.008856?Math.pow(c,1/3):7.787*c+16/116,p=l>.008856?Math.pow(l,1/3):7.787*l+16/116,d=a>.008856?Math.pow(a,1/3):7.787*a+16/116;return new it(f,p,d,"xyz")}_clamped(){const{_a:t,_b:s,_c:n}=this.rgb(),{max:i,min:r,round:e}=Math;return[t,s,n].map((t=>i(0,r(e(t),255))))}}class rt{constructor(...t){this.init(...t)}clone(){return new rt(this)}init(t,s){const n=Array.isArray(t)?{x:t[0],y:t[1]}:"object"==typeof t?{x:t.x,y:t.y}:{x:t,y:s};return this.x=null==n.x?0:n.x,this.y=null==n.y?0:n.y,this}toArray(){return[this.x,this.y]}transform(t){return this.clone().transformO(t)}transformO(t){ht.isMatrixLike(t)||(t=new ht(t));const{x:s,y:n}=this;return this.x=t.a*s+t.c*n+t.e,this.y=t.b*s+t.d*n+t.f,this}}function et(t,s){return Math.abs(s-t)<1e-6}class ht{constructor(...t){this.init(...t)}static formatTransforms(t){const s="both"===t.flip||!0===t.flip,n=t.flip&&(s||"x"===t.flip)?-1:1,i=t.flip&&(s||"y"===t.flip)?-1:1,r=t.skew&&t.skew.length?t.skew[0]:isFinite(t.skew)?t.skew:isFinite(t.skewX)?t.skewX:0,e=t.skew&&t.skew.length?t.skew[1]:isFinite(t.skew)?t.skew:isFinite(t.skewY)?t.skewY:0,h=t.scale&&t.scale.length?t.scale[0]*n:isFinite(t.scale)?t.scale*n:isFinite(t.scaleX)?t.scaleX*n:n,o=t.scale&&t.scale.length?t.scale[1]*i:isFinite(t.scale)?t.scale*i:isFinite(t.scaleY)?t.scaleY*i:i,u=t.shear||0,c=t.rotate||t.theta||0,l=new rt(t.origin||t.around||t.ox||t.originX,t.oy||t.originY),a=l.x,f=l.y,p=new rt(t.position||t.px||t.positionX||NaN,t.py||t.positionY||NaN),d=p.x,w=p.y,m=new rt(t.translate||t.tx||t.translateX,t.ty||t.translateY),y=m.x,g=m.y,b=new rt(t.relative||t.rx||t.relativeX,t.ry||t.relativeY);return{scaleX:h,scaleY:o,skewX:r,skewY:e,shear:u,theta:c,rx:b.x,ry:b.y,tx:y,ty:g,ox:a,oy:f,px:d,py:w}}static fromArray(t){return{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}}static isMatrixLike(t){return null!=t.a||null!=t.b||null!=t.c||null!=t.d||null!=t.e||null!=t.f}static matrixMultiply(t,s,n){const i=t.b*s.a+t.d*s.b,r=t.a*s.c+t.c*s.d,e=t.b*s.c+t.d*s.d,h=t.e+t.a*s.e+t.c*s.f,o=t.f+t.b*s.e+t.d*s.f;return n.a=t.a*s.a+t.c*s.b,n.b=i,n.c=r,n.d=e,n.e=h,n.f=o,n}around(t,s,n){return this.clone().aroundO(t,s,n)}aroundO(t,s,n){const i=t||0,r=s||0;return this.translateO(-i,-r).lmultiplyO(n).translateO(i,r)}clone(){return new ht(this)}decompose(t=0,s=0){const n=this.a,i=this.b,r=this.c,e=this.d,h=this.e,o=this.f,u=n*e-i*r,c=u>0?1:-1,l=c*Math.sqrt(n*n+i*i),a=Math.atan2(c*i,c*n),f=180/Math.PI*a,p=Math.cos(a),d=Math.sin(a),w=(n*r+i*e)/u,m=r*l/(w*n-i)||e*l/(w*i+n);return{scaleX:l,scaleY:m,shear:w,rotate:f,translateX:h-t+t*p*l+s*(w*p*l-d*m),translateY:o-s+t*d*l+s*(w*d*l+p*m),originX:t,originY:s,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(t){if(t===this)return!0;const s=new ht(t);return et(this.a,s.a)&&et(this.b,s.b)&&et(this.c,s.c)&&et(this.d,s.d)&&et(this.e,s.e)&&et(this.f,s.f)}flip(t,s){return this.clone().flipO(t,s)}flipO(t,s){return"x"===t?this.scaleO(-1,1,s,0):"y"===t?this.scaleO(1,-1,0,s):this.scaleO(-1,-1,t,s||t)}init(t){const s=ht.fromArray([1,0,0,1,0,0]);return t=t instanceof jt?t.matrixify():"string"==typeof t?ht.fromArray(t.split(Z).map(parseFloat)):Array.isArray(t)?ht.fromArray(t):"object"==typeof t&&ht.isMatrixLike(t)?t:"object"==typeof t?(new ht).transform(t):6===arguments.length?ht.fromArray([].slice.call(arguments)):s,this.a=null!=t.a?t.a:s.a,this.b=null!=t.b?t.b:s.b,this.c=null!=t.c?t.c:s.c,this.d=null!=t.d?t.d:s.d,this.e=null!=t.e?t.e:s.e,this.f=null!=t.f?t.f:s.f,this}inverse(){return this.clone().inverseO()}inverseO(){const t=this.a,s=this.b,n=this.c,i=this.d,r=this.e,e=this.f,h=t*i-s*n;if(!h)throw new Error("Cannot invert "+this);const o=i/h,u=-s/h,c=-n/h,l=t/h,a=-(o*r+c*e),f=-(u*r+l*e);return this.a=o,this.b=u,this.c=c,this.d=l,this.e=a,this.f=f,this}lmultiply(t){return this.clone().lmultiplyO(t)}lmultiplyO(t){const s=t instanceof ht?t:new ht(t);return ht.matrixMultiply(s,this,this)}multiply(t){return this.clone().multiplyO(t)}multiplyO(t){const s=t instanceof ht?t:new ht(t);return ht.matrixMultiply(this,s,this)}rotate(t,s,n){return this.clone().rotateO(t,s,n)}rotateO(t,s=0,n=0){t=m(t);const i=Math.cos(t),r=Math.sin(t),{a:e,b:h,c:o,d:u,e:c,f:l}=this;return this.a=e*i-h*r,this.b=h*i+e*r,this.c=o*i-u*r,this.d=u*i+o*r,this.e=c*i-l*r+n*r-s*i+s,this.f=l*i+c*r-s*r-n*i+n,this}scale(){return this.clone().scaleO(...arguments)}scaleO(t,s=t,n=0,i=0){3===arguments.length&&(i=n,n=s,s=t);const{a:r,b:e,c:h,d:o,e:u,f:c}=this;return this.a=r*t,this.b=e*s,this.c=h*t,this.d=o*s,this.e=u*t-n*t+n,this.f=c*s-i*s+i,this}shear(t,s,n){return this.clone().shearO(t,s,n)}shearO(t,s=0,n=0){const{a:i,b:r,c:e,d:h,e:o,f:u}=this;return this.a=i+r*t,this.c=e+h*t,this.e=o+u*t-n*t,this}skew(){return this.clone().skewO(...arguments)}skewO(t,s=t,n=0,i=0){3===arguments.length&&(i=n,n=s,s=t),t=m(t),s=m(s);const r=Math.tan(t),e=Math.tan(s),{a:h,b:o,c:u,d:c,e:l,f:a}=this;return this.a=h+o*r,this.b=o+h*e,this.c=u+c*r,this.d=c+u*e,this.e=l+a*r-i*r,this.f=a+l*e-n*e,this}skewX(t,s,n){return this.skew(t,0,s,n)}skewY(t,s,n){return this.skew(0,t,s,n)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(t){if(ht.isMatrixLike(t))return new ht(t).multiplyO(this);const s=ht.formatTransforms(t),{x:n,y:i}=new rt(s.ox,s.oy).transform(this),r=(new ht).translateO(s.rx,s.ry).lmultiplyO(this).translateO(-n,-i).scaleO(s.scaleX,s.scaleY).skewO(s.skewX,s.skewY).shearO(s.shear).rotateO(s.theta).translateO(n,i);if(isFinite(s.px)||isFinite(s.py)){const t=new rt(n,i).transform(r),e=isFinite(s.px)?s.px-t.x:0,h=isFinite(s.py)?s.py-t.y:0;r.translateO(e,h)}return r.translateO(s.tx,s.ty),r}translate(t,s){return this.clone().translateO(t,s)}translateO(t,s){return this.e+=t||0,this.f+=s||0,this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function ot(){if(!ot.nodes){const t=C().size(2,0);t.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";"),t.attr("focusable","false"),t.attr("aria-hidden","true");const s=t.path().node;ot.nodes={svg:t,path:s}}return ot.nodes.svg.node.parentNode||ot.nodes.svg.addTo(O.document.body||O.document.documentElement),ot.nodes}function ut(t){return!(t.width||t.height||t.x||t.y)}Y(ht,"Matrix");class ct{constructor(...t){this.init(...t)}addOffset(){return this.x+=O.window.pageXOffset,this.y+=O.window.pageYOffset,new ct(this)}init(t){return t="string"==typeof t?t.split(Z).map(parseFloat):Array.isArray(t)?t:"object"==typeof t?[null!=t.left?t.left:t.x,null!=t.top?t.top:t.y,t.width,t.height]:4===arguments.length?[].slice.call(arguments):[0,0,0,0],this.x=t[0]||0,this.y=t[1]||0,this.width=this.w=t[2]||0,this.height=this.h=t[3]||0,this.x2=this.x+this.w,this.y2=this.y+this.h,this.cx=this.x+this.w/2,this.cy=this.y+this.h/2,this}isNulled(){return ut(this)}merge(t){const s=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x+this.width,t.x+t.width)-s,r=Math.max(this.y+this.height,t.y+t.height)-n;return new ct(s,n,i,r)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(t){t instanceof ht||(t=new ht(t));let s=1/0,n=-1/0,i=1/0,r=-1/0;return[new rt(this.x,this.y),new rt(this.x2,this.y),new rt(this.x,this.y2),new rt(this.x2,this.y2)].forEach((function(e){e=e.transform(t),s=Math.min(s,e.x),n=Math.max(n,e.x),i=Math.min(i,e.y),r=Math.max(r,e.y)})),new ct(s,i,n-s,r-i)}}function lt(t,s,n){let i;try{if(i=s(t.node),ut(i)&&(r=t.node)!==O.document&&!(O.document.documentElement.contains||function(t){for(;t.parentNode;)t=t.parentNode;return t===O.document}).call(O.document.documentElement,r))throw new Error("Element not in the dom")}catch(s){i=n(t)}var r;return i}f({viewbox:{viewbox(t,s,n,i){return null==t?new ct(this.attr("viewBox")):this.attr("viewBox",new ct(t,s,n,i))},zoom(t,s){let{width:n,height:i}=this.attr(["width","height"]);if((n||i)&&"string"!=typeof n&&"string"!=typeof i||(n=this.node.clientWidth,i=this.node.clientHeight),!n||!i)throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");const r=this.viewbox(),e=n/r.width,h=i/r.height,o=Math.min(e,h);if(null==t)return o;let u=o/t;u===1/0&&(u=Number.MAX_SAFE_INTEGER/100),s=s||new rt(n/2/e+r.x,i/2/h+r.y);const c=new ct(r).transform(new ht({scale:u,origin:s}));return this.viewbox(c)}}}),Y(ct,"Box");class at extends Array{constructor(t=[],...s){if(super(t,...s),"number"==typeof t)return this;this.length=0,this.push(...t)}}L([at],{each(t,...s){return this.map("function"==typeof t?(s,n,i)=>t.call(s,s,n,i):n=>n[t](...s))},toArray(){return Array.prototype.concat.apply([],this)}});const ft=["toArray","constructor","each"];function pt(t,s){return new at(w((s||O.document).querySelectorAll(t),(function(t){return z(t)})))}at.extend=function(t){t=t.reduce(((t,s)=>(ft.includes(s)||"_"===s[0]||(s in Array.prototype&&(t["$"+s]=Array.prototype[s]),t[s]=function(...t){return this.each(s,...t)}),t)),{}),L([at],t)};let dt=0;const wt={};function mt(t){let s=t.getEventHolder();return s===O.window&&(s=wt),s.events||(s.events={}),s.events}function yt(t){return t.getEventTarget()}function gt(t,s,n,i,r){const e=n.bind(i||t),h=C(t),o=mt(h),u=yt(h);s=Array.isArray(s)?s:s.split(Z),n._svgjsListenerId||(n._svgjsListenerId=++dt),s.forEach((function(t){const s=t.split(".")[0],i=t.split(".")[1]||"*";o[s]=o[s]||{},o[s][i]=o[s][i]||{},o[s][i][n._svgjsListenerId]=e,u.addEventListener(s,e,r||!1)}))}function bt(t,s,n,i){const r=C(t),e=mt(r),h=yt(r);("function"!=typeof n||(n=n._svgjsListenerId))&&(s=Array.isArray(s)?s:(s||"").split(Z)).forEach((function(t){const s=t&&t.split(".")[0],o=t&&t.split(".")[1];let u,c;if(n)e[s]&&e[s][o||"*"]&&(h.removeEventListener(s,e[s][o||"*"][n],i||!1),delete e[s][o||"*"][n]);else if(s&&o){if(e[s]&&e[s][o]){for(c in e[s][o])bt(h,[s,o].join("."),c);delete e[s][o]}}else if(o)for(t in e)for(u in e[t])o===u&&bt(h,[t,o].join("."));else if(s){if(e[s]){for(u in e[s])bt(h,[s,u].join("."));delete e[s]}}else{for(t in e)bt(h,t);!function(t){let s=t.getEventHolder();s===O.window&&(s=wt),s.events&&(s.events={})}(r)}}))}class xt extends S{addEventListener(){}dispatch(t,s,n){return function(t,s,n,i){const r=yt(t);return s instanceof O.window.Event||(s=new O.window.CustomEvent(s,{detail:n,cancelable:!0,...i})),r.dispatchEvent(s),s}(this,t,s,n)}dispatchEvent(t){const s=this.getEventHolder().events;if(!s)return!0;const n=s[t.type];for(const s in n)for(const i in n[s])n[s][i](t);return!t.defaultPrevented}fire(t,s,n){return this.dispatch(t,s,n),this}getEventHolder(){return this}getEventTarget(){return this}off(t,s,n){return bt(this,t,s,n),this}on(t,s,n,i){return gt(this,t,s,n,i),this}removeEventListener(){}}function vt(){}Y(xt,"EventTarget");const _t={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};class Mt extends Array{constructor(...t){super(...t),this.init(...t)}clone(){return new this.constructor(this)}init(t){return"number"==typeof t||(this.length=0,this.push(...this.parse(t))),this}parse(t=[]){return t instanceof Array?t:t.trim().split(Z).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const t=[];return t.push(...this),t}}class At{constructor(...t){this.init(...t)}convert(t){return new At(this.value,t)}divide(t){return t=new At(t),new At(this/t,this.unit||t.unit)}init(t,s){return s=Array.isArray(t)?t[1]:s,t=Array.isArray(t)?t[0]:t,this.value=0,this.unit=s||"","number"==typeof t?this.value=isNaN(t)?0:isFinite(t)?t:t<0?-34e37:34e37:"string"==typeof t?(s=t.match(G))&&(this.value=parseFloat(s[1]),"%"===s[5]?this.value/=100:"s"===s[5]&&(this.value*=1e3),this.unit=s[5]):t instanceof At&&(this.value=t.valueOf(),this.unit=t.unit),this}minus(t){return t=new At(t),new At(this-t,this.unit||t.unit)}plus(t){return t=new At(t),new At(this+t,this.unit||t.unit)}times(t){return t=new At(t),new At(this*t,this.unit||t.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return("%"===this.unit?~~(1e8*this.value)/1e6:"s"===this.unit?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const kt=new Set(["fill","stroke","color","bgcolor","stop-color","flood-color","lighting-color"]),Ot=[];class St extends xt{constructor(t,s){super(),this.node=t,this.type=t.nodeName,s&&t!==s&&this.attr(s)}add(t,s){return(t=C(t)).removeNamespace&&this.node instanceof O.window.SVGElement&&t.removeNamespace(),null==s?this.node.appendChild(t.node):t.node!==this.node.childNodes[s]&&this.node.insertBefore(t.node,this.node.childNodes[s]),this}addTo(t,s){return C(t).put(this,s)}children(){return new at(w(this.node.children,(function(t){return z(t)})))}clear(){for(;this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);return this}clone(t=!0,s=!0){this.writeDataToDom();let n=this.node.cloneNode(t);return s&&(n=P(n)),new this.constructor(n)}each(t,s){const n=this.children();let i,r;for(i=0,r=n.length;i<r;i++)t.apply(n[i],[i,n]),s&&n[i].each(t,s);return this}element(t,s){return this.put(new St(E(t),s))}first(){return z(this.node.firstChild)}get(t){return z(this.node.childNodes[t])}getEventHolder(){return this.node}getEventTarget(){return this.node}has(t){return this.index(t)>=0}html(t,s){return this.xml(t,s,"http://www.w3.org/1999/xhtml")}id(t){return void 0!==t||this.node.id||(this.node.id=I(this.type)),this.attr("id",t)}index(t){return[].slice.call(this.node.childNodes).indexOf(t.node)}last(){return z(this.node.lastChild)}matches(t){const s=this.node,n=s.matches||s.matchesSelector||s.msMatchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||null;return n&&n.call(s,t)}parent(t){let s=this;if(!s.node.parentNode)return null;if(s=z(s.node.parentNode),!t)return s;do{if("string"==typeof t?s.matches(t):s instanceof t)return s}while(s=z(s.node.parentNode));return s}put(t,s){return t=C(t),this.add(t,s),t}putIn(t,s){return C(t).add(this,s)}remove(){return this.parent()&&this.parent().removeElement(this),this}removeElement(t){return this.node.removeChild(t.node),this}replace(t){return t=C(t),this.node.parentNode&&this.node.parentNode.replaceChild(t.node,this.node),t}round(t=2,s=null){const n=10**t,i=this.attr(s);for(const t in i)"number"==typeof i[t]&&(i[t]=Math.round(i[t]*n)/n);return this.attr(i),this}svg(t,s){return this.xml(t,s,M)}toString(){return this.id()}words(t){return this.node.textContent=t,this}wrap(t){const s=this.parent();if(!s)return this.addTo(t);const n=s.index(this);return s.put(t,n).put(this)}writeDataToDom(){return this.each((function(){this.writeDataToDom()})),this}xml(t,s,n){if("boolean"==typeof t&&(n=s,s=t,t=null),null==t||"function"==typeof t){s=null==s||s,this.writeDataToDom();let n=this;if(null!=t){if(n=z(n.node.cloneNode(!0)),s){const s=t(n);if(n=s||n,!1===s)return""}n.each((function(){const s=t(this),n=s||this;!1===s?this.remove():s&&this!==n&&this.replace(n)}),!0)}return s?n.node.outerHTML:n.node.innerHTML}s=null!=s&&s;const i=E("wrapper",n),r=O.document.createDocumentFragment();i.innerHTML=t;for(let t=i.children.length;t--;)r.appendChild(i.firstElementChild);const e=this.parent();return s?this.replace(r)&&e:this.add(r)}}L(St,{attr:function(t,s,n){if(null==t){t={},s=this.node.attributes;for(const n of s)t[n.nodeName]=q.test(n.nodeValue)?parseFloat(n.nodeValue):n.nodeValue;return t}if(t instanceof Array)return t.reduce(((t,s)=>(t[s]=this.attr(s),t)),{});if("object"==typeof t&&t.constructor===Object)for(s in t)this.attr(s,t[s]);else if(null===s)this.node.removeAttribute(t);else{if(null==s)return null==(s=this.node.getAttribute(t))?_t[t]:q.test(s)?parseFloat(s):s;"number"==typeof(s=Ot.reduce(((s,n)=>n(t,s,this)),s))?s=new At(s):kt.has(t)&&it.isColor(s)?s=new it(s):s.constructor===Array&&(s=new Mt(s)),"leading"===t?this.leading&&this.leading(s):"string"==typeof n?this.node.setAttributeNS(n,t,s.toString()):this.node.setAttribute(t,s.toString()),!this.rebuild||"font-size"!==t&&"x"!==t||this.rebuild()}return this},find:function(t){return pt(t,this.node)},findOne:function(t){return z(this.node.querySelector(t))}}),Y(St,"Dom");class jt extends St{constructor(t,s){super(t,s),this.dom={},this.node.instance=this,(t.hasAttribute("data-svgjs")||t.hasAttribute("svgjs:data"))&&this.setData(JSON.parse(t.getAttribute("data-svgjs"))??JSON.parse(t.getAttribute("svgjs:data"))??{})}center(t,s){return this.cx(t).cy(s)}cx(t){return null==t?this.x()+this.width()/2:this.x(t-this.width()/2)}cy(t){return null==t?this.y()+this.height()/2:this.y(t-this.height()/2)}defs(){const t=this.root();return t&&t.defs()}dmove(t,s){return this.dx(t).dy(s)}dx(t=0){return this.x(new At(t).plus(this.x()))}dy(t=0){return this.y(new At(t).plus(this.y()))}getEventHolder(){return this}height(t){return this.attr("height",t)}move(t,s){return this.x(t).y(s)}parents(t=this.root()){const s="string"==typeof t;s||(t=C(t));const n=new at;let i=this;for(;(i=i.parent())&&i.node!==O.document&&"#document-fragment"!==i.nodeName&&(n.push(i),s||i.node!==t.node)&&(!s||!i.matches(t));)if(i.node===this.root().node)return null;return n}reference(t){if(!(t=this.attr(t)))return null;const s=(t+"").match(X);return s?C(s[1]):null}root(){const t=this.parent(j[T]);return t&&t.root()}setData(t){return this.dom=t,this}size(t,s){const n=g(this,t,s);return this.width(new At(n.width)).height(new At(n.height))}width(t){return this.attr("width",t)}writeDataToDom(){return _(this,this.dom),super.writeDataToDom()}x(t){return this.attr("x",t)}y(t){return this.attr("y",t)}}L(jt,{bbox:function(){const t=lt(this,(t=>t.getBBox()),(t=>{try{const s=t.clone().addTo(ot().svg).show(),n=s.node.getBBox();return s.remove(),n}catch(s){throw new Error(`Getting bbox of element "${t.node.nodeName}" is not possible: ${s.toString()}`)}}));return new ct(t)},rbox:function(t){const s=lt(this,(t=>t.getBoundingClientRect()),(t=>{throw new Error(`Getting rbox of element "${t.node.nodeName}" is not possible`)})),n=new ct(s);return t?n.transform(t.screenCTM().inverseO()):n.addOffset()},inside:function(t,s){const n=this.bbox();return t>n.x&&s>n.y&&t<n.x+n.width&&s<n.y+n.height},point:function(t,s){return new rt(t,s).transformO(this.screenCTM().inverseO())},ctm:function(){return new ht(this.node.getCTM())},screenCTM:function(){try{if("function"==typeof this.isRoot&&!this.isRoot()){const t=this.rect(1,1),s=t.node.getScreenCTM();return t.remove(),new ht(s)}return new ht(this.node.getScreenCTM())}catch(t){return console.warn(`Cannot get CTM from SVG node ${this.node.nodeName}. Is the element rendered?`),new ht}}}),Y(jt,"Element");const Tt={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,s){return"color"===s?t:t+"-"+s}};["fill","stroke"].forEach((function(t){const s={};let n;s[t]=function(s){if(void 0===s)return this.attr(t);if("string"==typeof s||s instanceof it||it.isRgb(s)||s instanceof jt)this.attr(t,s);else for(n=Tt[t].length-1;n>=0;n--)null!=s[Tt[t][n]]&&this.attr(Tt.prefix(t,Tt[t][n]),s[Tt[t][n]]);return this},f(["Element","Runner"],s)})),f(["Element","Runner"],{matrix:function(t,s,n,i,r,e){return null==t?new ht(this):this.attr("transform",new ht(t,s,n,i,r,e))},rotate:function(t,s,n){return this.transform({rotate:t,ox:s,oy:n},!0)},skew:function(t,s,n,i){return this.transform(1===arguments.length||3===arguments.length?{skew:t,ox:s,oy:n}:{skew:[t,s],ox:n,oy:i},!0)},shear:function(t,s,n){return this.transform({shear:t,ox:s,oy:n},!0)},scale:function(t,s,n,i){return this.transform(1===arguments.length||3===arguments.length?{scale:t,ox:s,oy:n}:{scale:[t,s],ox:n,oy:i},!0)},translate:function(t,s){return this.transform({translate:[t,s]},!0)},relative:function(t,s){return this.transform({relative:[t,s]},!0)},flip:function(t="both",s="center"){return-1==="xybothtrue".indexOf(t)&&(s=t,t="both"),this.transform({flip:t,origin:s},!0)},opacity:function(t){return this.attr("opacity",t)}}),f("radius",{radius:function(t,s=t){return"radialGradient"===(this._element||this).type?this.attr("r",new At(t)):this.rx(t).ry(s)}}),f("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(t){return new rt(this.node.getPointAtLength(t))}}),f(["Element","Runner"],{font:function(t,s){if("object"==typeof t){for(s in t)this.font(s,t[s]);return this}return"leading"===t?this.leading(s):this.attr("anchor"===t?"text-anchor":"size"===t||"family"===t||"weight"===t||"stretch"===t||"variant"===t||"style"===t?"font-"+t:t,s)}}),f("Element",["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel","contextmenu","wheel","pointerdown","pointermove","pointerup","pointerleave","pointercancel"].reduce((function(t,s){return t[s]=function(t){return null===t?this.off(s):this.on(s,t),this},t}),{})),f("Element",{untransform:function(){return this.attr("transform",null)},matrixify:function(){return(this.attr("transform")||"").split(V).slice(0,-1).map((function(t){const s=t.trim().split("(");return[s[0],s[1].split(Z).map((function(t){return parseFloat(t)}))]})).reverse().reduce((function(t,s){return"matrix"===s[0]?t.lmultiply(ht.fromArray(s[1])):t[s[0]].apply(t,s[1])}),new ht)},toParent:function(t,s){if(this===t)return this;if(v(this.node))return this.addTo(t,s);const n=this.screenCTM(),i=t.screenCTM().inverse();return this.addTo(t,s).untransform().transform(i.multiply(n)),this},toRoot:function(t){return this.toParent(this.root(),t)},transform:function(t,s){if(null==t||"string"==typeof t){const s=new ht(this).decompose();return null==t?s:s[t]}ht.isMatrixLike(t)||(t={...t,origin:b(t,this)});const n=new ht(!0===s?this:s||!1).transform(t);return this.attr("transform",n)}});class Et extends jt{flatten(){return this.each((function(){if(this instanceof Et)return this.flatten().ungroup()})),this}ungroup(t=this.parent(),s=t.index(this)){return s=-1===s?t.children().length:s,this.each((function(n,i){return i[i.length-n-1].toParent(t,s)})),this.remove()}}Y(Et,"Container");class Ct extends Et{constructor(t,s=t){super(D("defs",t),s)}flatten(){return this}ungroup(){return this}}Y(Ct,"Defs");class Dt extends jt{}function zt(t){return this.attr("rx",t)}function Nt(t){return this.attr("ry",t)}function Yt(t){return null==t?this.cx()-this.rx():this.cx(t+this.rx())}function Ft(t){return null==t?this.cy()-this.ry():this.cy(t+this.ry())}function It(t){return this.attr("cx",t)}function Pt(t){return this.attr("cy",t)}function Lt(t){return null==t?2*this.rx():this.rx(new At(t).divide(2))}function Rt(t){return null==t?2*this.ry():this.ry(new At(t).divide(2))}Y(Dt,"Shape");var Gt=Object.freeze({__proto__:null,cx:It,cy:Pt,height:Rt,rx:zt,ry:Nt,width:Lt,x:Yt,y:Ft});class $t extends Dt{constructor(t,s=t){super(D("ellipse",t),s)}size(t,s){const n=g(this,t,s);return this.rx(new At(n.width).divide(2)).ry(new At(n.height).divide(2))}}L($t,Gt),f("Container",{ellipse:R((function(t=0,s=t){return this.put(new $t).size(t,s).move(0,0)}))}),Y($t,"Ellipse");class Ht extends St{constructor(t=O.document.createDocumentFragment()){super(t)}xml(t,s,n){if("boolean"==typeof t&&(n=s,s=t,t=null),null==t||"function"==typeof t){const t=new St(E("wrapper",n));return t.add(this.node.cloneNode(!0)),t.xml(!1,n)}return super.xml(t,!1,n)}}function Xt(t,s){return this.attr("radialGradient"===(this._element||this).type?{fx:new At(t),fy:new At(s)}:{x1:new At(t),y1:new At(s)})}function Vt(t,s){return this.attr("radialGradient"===(this._element||this).type?{cx:new At(t),cy:new At(s)}:{x2:new At(t),y2:new At(s)})}Y(Ht,"Fragment");var Bt=Object.freeze({__proto__:null,from:Xt,to:Vt});class Qt extends Et{constructor(t,s){super(D(t+"Gradient","string"==typeof t?null:t),s)}attr(t,s,n){return"transform"===t&&(t="gradientTransform"),super.attr(t,s,n)}bbox(){return new ct}targets(){return pt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}L(Qt,Bt),f({Container:{gradient(...t){return this.defs().gradient(...t)}},Defs:{gradient:R((function(t,s){return this.put(new Qt(t)).update(s)}))}}),Y(Qt,"Gradient");class Wt extends Et{constructor(t,s=t){super(D("pattern",t),s)}attr(t,s,n){return"transform"===t&&(t="patternTransform"),super.attr(t,s,n)}bbox(){return new ct}targets(){return pt("svg [fill*="+this.id()+"]")}toString(){return this.url()}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}url(){return"url(#"+this.id()+")"}}f({Container:{pattern(...t){return this.defs().pattern(...t)}},Defs:{pattern:R((function(t,s,n){return this.put(new Wt).update(n).attr({x:0,y:0,width:t,height:s,patternUnits:"userSpaceOnUse"})}))}}),Y(Wt,"Pattern");class Jt extends Dt{constructor(t,s=t){super(D("image",t),s)}load(t,s){if(!t)return this;const n=new O.window.Image;return gt(n,"load",(function(t){const i=this.parent(Wt);0===this.width()&&0===this.height()&&this.size(n.width,n.height),i instanceof Wt&&0===i.width()&&0===i.height()&&i.size(this.width(),this.height()),"function"==typeof s&&s.call(this,t)}),this),gt(n,"load error",(function(){bt(n)})),this.attr("href",n.src=t,k)}}Ot.push((function(t,s,n){return"fill"!==t&&"stroke"!==t||U.test(s)&&(s=n.root().defs().image(s)),s instanceof Jt&&(s=n.root().defs().pattern(0,0,(t=>{t.add(s)}))),s})),f({Container:{image:R((function(t,s){return this.put(new Jt).size(0,0).load(t,s)}))}}),Y(Jt,"Image");class qt extends Mt{bbox(){let t=-1/0,s=-1/0,n=1/0,i=1/0;return this.forEach((function(r){t=Math.max(r[0],t),s=Math.max(r[1],s),n=Math.min(r[0],n),i=Math.min(r[1],i)})),new ct(n,i,t-n,s-i)}move(t,s){const n=this.bbox();if(t-=n.x,s-=n.y,!isNaN(t)&&!isNaN(s))for(let n=this.length-1;n>=0;n--)this[n]=[this[n][0]+t,this[n][1]+s];return this}parse(t=[0,0]){const s=[];(t=t instanceof Array?Array.prototype.concat.apply([],t):t.trim().split(Z).map(parseFloat)).length%2!=0&&t.pop();for(let n=0,i=t.length;n<i;n+=2)s.push([t[n],t[n+1]]);return s}size(t,s){let n;const i=this.bbox();for(n=this.length-1;n>=0;n--)i.width&&(this[n][0]=(this[n][0]-i.x)*t/i.width+i.x),i.height&&(this[n][1]=(this[n][1]-i.y)*s/i.height+i.y);return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const t=[];for(let s=0,n=this.length;s<n;s++)t.push(this[s].join(","));return t.join(" ")}transform(t){return this.clone().transformO(t)}transformO(t){ht.isMatrixLike(t)||(t=new ht(t));for(let s=this.length;s--;){const[n,i]=this[s];this[s][0]=t.a*n+t.c*i+t.e,this[s][1]=t.b*n+t.d*i+t.f}return this}}var Ut=Object.freeze({__proto__:null,MorphArray:qt,height:function(t){const s=this.bbox();return null==t?s.height:this.size(s.width,t)},width:function(t){const s=this.bbox();return null==t?s.width:this.size(t,s.height)},x:function(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)},y:function(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}});class Zt extends Dt{constructor(t,s=t){super(D("line",t),s)}array(){return new qt([[this.attr("x1"),this.attr("y1")],[this.attr("x2"),this.attr("y2")]])}move(t,s){return this.attr(this.array().move(t,s).toLine())}plot(t,s,n,i){return null==t?this.array():(t=void 0!==s?{x1:t,y1:s,x2:n,y2:i}:new qt(t).toLine(),this.attr(t))}size(t,s){const n=g(this,t,s);return this.attr(this.array().size(n.width,n.height).toLine())}}L(Zt,Ut),f({Container:{line:R((function(...t){return Zt.prototype.plot.apply(this.put(new Zt),null!=t[0]?t:[0,0,0,0])}))}}),Y(Zt,"Line");class Kt extends Et{constructor(t,s=t){super(D("marker",t),s)}height(t){return this.attr("markerHeight",t)}orient(t){return this.attr("orient",t)}ref(t,s){return this.attr("refX",t).attr("refY",s)}toString(){return"url(#"+this.id()+")"}update(t){return this.clear(),"function"==typeof t&&t.call(this,this),this}width(t){return this.attr("markerWidth",t)}}function ts(t,s){return function(n){return null==n?this[t]:(this[t]=n,s&&s.call(this),this)}}f({Container:{marker(...t){return this.defs().marker(...t)}},Defs:{marker:R((function(t,s,n){return this.put(new Kt).size(t,s).ref(t/2,s/2).viewbox(0,0,t,s).attr("orient","auto").update(n)}))},marker:{marker(t,s,n,i){let r=["marker"];return"all"!==t&&r.push(t),r=r.join("-"),t=arguments[1]instanceof Kt?arguments[1]:this.defs().marker(s,n,i),this.attr(r,t)}}}),Y(Kt,"Marker");const ss={"-":function(t){return t},"<>":function(t){return-Math.cos(t*Math.PI)/2+.5},">":function(t){return Math.sin(t*Math.PI/2)},"<":function(t){return 1-Math.cos(t*Math.PI/2)},bezier:function(t,s,n,i){return function(r){return r<0?t>0?s/t*r:n>0?i/n*r:0:r>1?n<1?(1-i)/(1-n)*r+(i-n)/(1-n):t<1?(1-s)/(1-t)*r+(s-t)/(1-t):1:3*r*(1-r)**2*s+3*r**2*(1-r)*i+r**3}},steps:function(t,s="end"){s=s.split("-").reverse()[0];let n=t;return"none"===s?--n:"both"===s&&++n,(i,r=!1)=>{let e=Math.floor(i*t);const h=i*e%1==0;return"start"!==s&&"both"!==s||++e,r&&h&&--e,i>=0&&e<0&&(e=0),i<=1&&e>n&&(e=n),e/n}}};class ns{done(){return!1}}class is extends ns{constructor(t=">"){super(),this.ease=ss[t]||t}step(t,s,n){return"number"!=typeof t?n<1?t:s:t+(s-t)*this.ease(n)}}class rs extends ns{constructor(t){super(),this.stepper=t}done(t){return t.done}step(t,s,n,i){return this.stepper(t,s,n,i)}}function es(){const t=(this._duration||500)/1e3,s=Math.PI,n=Math.log((this._overshoot||0)/100+1e-10),i=-n/Math.sqrt(s*s+n*n),r=3.9/(i*t);this.d=2*i*r,this.k=r*r}L(class extends rs{constructor(t=500,s=0){super(),this.duration(t).overshoot(s)}step(t,s,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return s;if(0===n)return t;n>100&&(n=16);const r=i.velocity||0,e=-this.d*r-this.k*(t-s),h=t+r*(n/=1e3)+e*n*n/2;return i.velocity=r+e*n,i.done=Math.abs(s-h)+Math.abs(r)<.002,i.done?s:h}},{duration:ts("_duration",es),overshoot:ts("_overshoot",es)}),L(class extends rs{constructor(t=.1,s=.01,n=0,i=1e3){super(),this.p(t).i(s).d(n).windup(i)}step(t,s,n,i){if("string"==typeof t)return t;if(i.done=n===1/0,n===1/0)return s;if(0===n)return t;const r=s-t;let e=(i.integral||0)+r*n;const h=(r-(i.error||0))/n,o=this._windup;return!1!==o&&(e=Math.max(-o,Math.min(e,o))),i.error=r,i.integral=e,i.done=Math.abs(r)<.001,i.done?s:t+(this.P*r+this.I*e+this.D*h)}},{windup:ts("_windup"),p:ts("P"),i:ts("I"),d:ts("D")});const hs={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0},os={M:function(t,s,n){return s.x=n.x=t[0],s.y=n.y=t[1],["M",s.x,s.y]},L:function(t,s){return s.x=t[0],s.y=t[1],["L",t[0],t[1]]},H:function(t,s){return s.x=t[0],["H",t[0]]},V:function(t,s){return s.y=t[0],["V",t[0]]},C:function(t,s){return s.x=t[4],s.y=t[5],["C",t[0],t[1],t[2],t[3],t[4],t[5]]},S:function(t,s){return s.x=t[2],s.y=t[3],["S",t[0],t[1],t[2],t[3]]},Q:function(t,s){return s.x=t[2],s.y=t[3],["Q",t[0],t[1],t[2],t[3]]},T:function(t,s){return s.x=t[0],s.y=t[1],["T",t[0],t[1]]},Z:function(t,s,n){return s.x=n.x,s.y=n.y,["Z"]},A:function(t,s){return s.x=t[5],s.y=t[6],["A",t[0],t[1],t[2],t[3],t[4],t[5],t[6]]}},us="mlhvqtcsaz".split("");for(let t=0,s=us.length;t<s;++t)os[us[t]]=function(t){return function(s,n,i){if("H"===t)s[0]=s[0]+n.x;else if("V"===t)s[0]=s[0]+n.y;else if("A"===t)s[5]=s[5]+n.x,s[6]=s[6]+n.y;else for(let t=0,i=s.length;t<i;++t)s[t]=s[t]+(t%2?n.y:n.x);return os[t](s,n,i)}}(us[t].toUpperCase());function cs(t){return t.segment.length&&t.segment.length-1===hs[t.segment[0].toUpperCase()]}function ls(t,s){t.inNumber&&as(t,!1);const n=K.test(s);if(n)t.segment=[s];else{const s=t.lastCommand,n=s.toLowerCase();t.segment=["m"===n?s===n?"l":"L":s]}return t.inSegment=!0,t.lastCommand=t.segment[0],n}function as(t,s){if(!t.inNumber)throw new Error("Parser Error");t.number&&t.segment.push(parseFloat(t.number)),t.inNumber=s,t.number="",t.pointSeen=!1,t.hasExponent=!1,cs(t)&&fs(t)}function fs(t){t.inSegment=!1,t.absolute&&(t.segment=function(t){return os[t.segment[0]](t.segment.slice(1),t.p,t.p0)}(t)),t.segments.push(t.segment)}function ps(t){if(!t.segment.length)return!1;const s="A"===t.segment[0].toUpperCase(),n=t.segment.length;return s&&(4===n||5===n)}function ds(t){return"E"===t.lastToken.toUpperCase()}const ws=new Set([" ",",","\t","\n","\r","\f"]);class ms extends Mt{bbox(){return ot().path.setAttribute("d",this.toString()),new ct(ot.nodes.path.getBBox())}move(t,s){const n=this.bbox();if(t-=n.x,s-=n.y,!isNaN(t)&&!isNaN(s))for(let n,i=this.length-1;i>=0;i--)n=this[i][0],"M"===n||"L"===n||"T"===n?(this[i][1]+=t,this[i][2]+=s):"H"===n?this[i][1]+=t:"V"===n?this[i][1]+=s:"C"===n||"S"===n||"Q"===n?(this[i][1]+=t,this[i][2]+=s,this[i][3]+=t,this[i][4]+=s,"C"===n&&(this[i][5]+=t,this[i][6]+=s)):"A"===n&&(this[i][6]+=t,this[i][7]+=s);return this}parse(t="M0 0"){return Array.isArray(t)&&(t=Array.prototype.concat.apply([],t).toString()),function(t,s=!0){let n=0,i="";const r={segment:[],inNumber:!1,number:"",lastToken:"",inSegment:!1,segments:[],pointSeen:!1,hasExponent:!1,absolute:s,p0:new rt,p:new rt};for(;r.lastToken=i,i=t.charAt(n++);)if(r.inSegment||!ls(r,i))if("."!==i)if(isNaN(parseInt(i)))if(ws.has(i))r.inNumber&&as(r,!1);else if("-"!==i&&"+"!==i)if("E"!==i.toUpperCase()){if(K.test(i)){if(r.inNumber)as(r,!1);else{if(!cs(r))throw new Error("parser Error");fs(r)}--n}}else r.number+=i,r.hasExponent=!0;else{if(r.inNumber&&!ds(r)){as(r,!1),--n;continue}r.number+=i,r.inNumber=!0}else{if("0"===r.number||ps(r)){r.inNumber=!0,r.number=i,as(r,!0);continue}r.inNumber=!0,r.number+=i}else{if(r.pointSeen||r.hasExponent){as(r,!1),--n;continue}r.inNumber=!0,r.pointSeen=!0,r.number+=i}return r.inNumber&&as(r,!1),r.inSegment&&cs(r)&&fs(r),r.segments}(t)}size(t,s){const n=this.bbox();let i,r;for(n.width=0===n.width?1:n.width,n.height=0===n.height?1:n.height,i=this.length-1;i>=0;i--)r=this[i][0],"M"===r||"L"===r||"T"===r?(this[i][1]=(this[i][1]-n.x)*t/n.width+n.x,this[i][2]=(this[i][2]-n.y)*s/n.height+n.y):"H"===r?this[i][1]=(this[i][1]-n.x)*t/n.width+n.x:"V"===r?this[i][1]=(this[i][1]-n.y)*s/n.height+n.y:"C"===r||"S"===r||"Q"===r?(this[i][1]=(this[i][1]-n.x)*t/n.width+n.x,this[i][2]=(this[i][2]-n.y)*s/n.height+n.y,this[i][3]=(this[i][3]-n.x)*t/n.width+n.x,this[i][4]=(this[i][4]-n.y)*s/n.height+n.y,"C"===r&&(this[i][5]=(this[i][5]-n.x)*t/n.width+n.x,this[i][6]=(this[i][6]-n.y)*s/n.height+n.y)):"A"===r&&(this[i][1]=this[i][1]*t/n.width,this[i][2]=this[i][2]*s/n.height,this[i][6]=(this[i][6]-n.x)*t/n.width+n.x,this[i][7]=(this[i][7]-n.y)*s/n.height+n.y);return this}toString(){return function(t){let s="";for(let n=0,i=t.length;n<i;n++)s+=t[n][0],null!=t[n][1]&&(s+=t[n][1],null!=t[n][2]&&(s+=" ",s+=t[n][2],null!=t[n][3]&&(s+=" ",s+=t[n][3],s+=" ",s+=t[n][4],null!=t[n][5]&&(s+=" ",s+=t[n][5],s+=" ",s+=t[n][6],null!=t[n][7]&&(s+=" ",s+=t[n][7])))));return s+" "}(this)}}const ys=t=>{const s=typeof t;return"number"===s?At:"string"===s?it.isColor(t)?it:Z.test(t)?K.test(t)?ms:Mt:G.test(t)?At:bs:Ms.indexOf(t.constructor)>-1?t.constructor:Array.isArray(t)?Mt:"object"===s?_s:bs};class gs{constructor(t){this._stepper=t||new is("-"),this._from=null,this._to=null,this._type=null,this._context=null,this._morphObj=null}at(t){return this._morphObj.morph(this._from,this._to,t,this._stepper,this._context)}done(){return this._context.map(this._stepper.done).reduce((function(t,s){return t&&s}),!0)}from(t){return null==t?this._from:(this._from=this._set(t),this)}stepper(t){return null==t?this._stepper:(this._stepper=t,this)}to(t){return null==t?this._to:(this._to=this._set(t),this)}type(t){return null==t?this._type:(this._type=t,this)}_set(t){this._type||this.type(ys(t));let s=new this._type(t);return this._type===it&&(s=this._to?s[this._to[4]]():this._from?s[this._from[4]]():s),this._type===_s&&(s=this._to?s.align(this._to):this._from?s.align(this._from):s),s=s.toConsumable(),this._morphObj=this._morphObj||new this._type,this._context=this._context||Array.apply(null,Array(s.length)).map(Object).map((function(t){return t.done=!0,t})),s}}class bs{constructor(...t){this.init(...t)}init(t){return t=Array.isArray(t)?t[0]:t,this.value=t,this}toArray(){return[this.value]}valueOf(){return this.value}}class xs{constructor(...t){this.init(...t)}init(t){return Array.isArray(t)&&(t={scaleX:t[0],scaleY:t[1],shear:t[2],rotate:t[3],translateX:t[4],translateY:t[5],originX:t[6],originY:t[7]}),Object.assign(this,xs.defaults,t),this}toArray(){const t=this;return[t.scaleX,t.scaleY,t.shear,t.rotate,t.translateX,t.translateY,t.originX,t.originY]}}xs.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const vs=(t,s)=>t[0]<s[0]?-1:t[0]>s[0]?1:0;class _s{constructor(...t){this.init(...t)}align(t){const s=this.values;for(let n=0,i=s.length;n<i;++n){if(s[n+1]===t[n+1]){if(s[n+1]===it&&t[n+7]!==s[n+7]){const s=t[n+7],i=new it(this.values.splice(n+3,5))[s]().toArray();this.values.splice(n+3,0,...i)}n+=s[n+2]+2;continue}if(!t[n+1])return this;const i=(new t[n+1]).toArray();s.splice(n,s[n+2]+3,t[n],t[n+1],t[n+2],...i),n+=s[n+2]+2}return this}init(t){if(this.values=[],Array.isArray(t))return void(this.values=t.slice());t=t||{};const s=[];for(const n in t){const i=ys(t[n]),r=new i(t[n]).toArray();s.push([n,i,r.length,...r])}return s.sort(vs),this.values=s.reduce(((t,s)=>t.concat(s)),[]),this}toArray(){return this.values}valueOf(){const t={},s=this.values;for(;s.length;){const n=s.shift(),i=s.shift(),r=s.shift(),e=s.splice(0,r);t[n]=new i(e)}return t}}const Ms=[bs,xs,_s];class As extends Dt{constructor(t,s=t){super(D("path",t),s)}array(){return this._array||(this._array=new ms(this.attr("d")))}clear(){return delete this._array,this}height(t){return null==t?this.bbox().height:this.size(this.bbox().width,t)}move(t,s){return this.attr("d",this.array().move(t,s))}plot(t){return null==t?this.array():this.clear().attr("d","string"==typeof t?t:this._array=new ms(t))}size(t,s){const n=g(this,t,s);return this.attr("d",this.array().size(n.width,n.height))}width(t){return null==t?this.bbox().width:this.size(t,this.bbox().height)}x(t){return null==t?this.bbox().x:this.move(t,this.bbox().y)}y(t){return null==t?this.bbox().y:this.move(this.bbox().x,t)}}As.prototype.MorphArray=ms,f({Container:{path:R((function(t){return this.put(new As).plot(t||new ms)}))}}),Y(As,"Path");var ks=Object.freeze({__proto__:null,array:function(){return this._array||(this._array=new qt(this.attr("points")))},clear:function(){return delete this._array,this},move:function(t,s){return this.attr("points",this.array().move(t,s))},plot:function(t){return null==t?this.array():this.clear().attr("points","string"==typeof t?t:this._array=new qt(t))},size:function(t,s){const n=g(this,t,s);return this.attr("points",this.array().size(n.width,n.height))}});class Os extends Dt{constructor(t,s=t){super(D("polygon",t),s)}}f({Container:{polygon:R((function(t){return this.put(new Os).plot(t||new qt)}))}}),L(Os,Ut),L(Os,ks),Y(Os,"Polygon");class Ss extends Dt{constructor(t,s=t){super(D("polyline",t),s)}}f({Container:{polyline:R((function(t){return this.put(new Ss).plot(t||new qt)}))}}),L(Ss,Ut),L(Ss,ks),Y(Ss,"Polyline");class js extends Dt{constructor(t,s=t){super(D("rect",t),s)}}L(js,{rx:zt,ry:Nt}),f({Container:{rect:R((function(t,s){return this.put(new js).size(t,s)}))}}),Y(js,"Rect");class Ts{constructor(){this._first=null,this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(t){const s=void 0!==t.next?t:{value:t,next:null,prev:null};return this._last?(s.prev=this._last,this._last.next=s,this._last=s):(this._last=s,this._first=s),s}remove(t){t.prev&&(t.prev.next=t.next),t.next&&(t.next.prev=t.prev),t===this._last&&(this._last=t.prev),t===this._first&&(this._first=t.next),t.prev=null,t.next=null}shift(){const t=this._first;return t?(this._first=t.next,this._first&&(this._first.prev=null),this._last=this._first?this._last:null,t.value):null}}const Es={nextDraw:null,frames:new Ts,timeouts:new Ts,immediates:new Ts,timer:()=>O.window.performance||O.window.Date,transforms:[],frame(t){const s=Es.frames.push({run:t});return null===Es.nextDraw&&(Es.nextDraw=O.window.requestAnimationFrame(Es._draw)),s},timeout(t,s){s=s||0;const n=Es.timer().now()+s,i=Es.timeouts.push({run:t,time:n});return null===Es.nextDraw&&(Es.nextDraw=O.window.requestAnimationFrame(Es._draw)),i},immediate(t){const s=Es.immediates.push(t);return null===Es.nextDraw&&(Es.nextDraw=O.window.requestAnimationFrame(Es._draw)),s},cancelFrame(t){null!=t&&Es.frames.remove(t)},clearTimeout(t){null!=t&&Es.timeouts.remove(t)},cancelImmediate(t){null!=t&&Es.immediates.remove(t)},_draw(t){let s=null;const n=Es.timeouts.last();for(;(s=Es.timeouts.shift())&&(t>=s.time?s.run():Es.timeouts.push(s),s!==n););let i=null;const r=Es.frames.last();for(;i!==r&&(i=Es.frames.shift());)i.run(t);let e=null;for(;e=Es.immediates.shift();)e();Es.nextDraw=Es.timeouts.first()||Es.frames.first()?O.window.requestAnimationFrame(Es._draw):null}},Cs=function(t){const s=t.start,n=t.runner.duration();return{start:s,duration:n,end:s+n,runner:t.runner}},Ds=function(){const t=O.window;return(t.performance||t.Date).now()};class zs extends xt{constructor(t=Ds){super(),this._timeSource=t,this.terminate()}active(){return!!this._nextFrame}finish(){return this.time(this.getEndTimeOfTimeline()+1),this.pause()}getEndTime(){const t=this.getLastRunnerInfo(),s=t?t.runner.duration():0;return(t?t.start:this._time)+s}getEndTimeOfTimeline(){const t=this._runners.map((t=>t.start+t.runner.duration()));return Math.max(0,...t)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(t){return this._runners[this._runnerIds.indexOf(t)]||null}pause(){return this._paused=!0,this._continue()}persist(t){return null==t?this._persist:(this._persist=t,this)}play(){return this._paused=!1,this.updateTime()._continue()}reverse(t){const s=this.speed();if(null==t)return this.speed(-s);const n=Math.abs(s);return this.speed(t?-n:n)}schedule(t,s,n){if(null==t)return this._runners.map(Cs);let i=0;const r=this.getEndTime();if(s=s||0,null==n||"last"===n||"after"===n)i=r;else if("absolute"===n||"start"===n)i=s,s=0;else if("now"===n)i=this._time;else if("relative"===n){const n=this.getRunnerInfoById(t.id);n&&(i=n.start+s,s=0)}else{if("with-last"!==n)throw new Error('Invalid value for the "when" parameter');{const t=this.getLastRunnerInfo();i=t?t.start:this._time}}t.unschedule(),t.timeline(this);const e=t.persist(),h={persist:null===e?this._persist:e,start:i+s,runner:t};return this._lastRunnerId=t.id,this._runners.push(h),this._runners.sort(((t,s)=>t.start-s.start)),this._runnerIds=this._runners.map((t=>t.runner.id)),this.updateTime()._continue(),this}seek(t){return this.time(this._time+t)}source(t){return null==t?this._timeSource:(this._timeSource=t,this)}speed(t){return null==t?this._speed:(this._speed=t,this)}stop(){return this.time(0),this.pause()}time(t){return null==t?this._time:(this._time=t,this._continue(!0))}unschedule(t){const s=this._runnerIds.indexOf(t.id);return s<0||(this._runners.splice(s,1),this._runnerIds.splice(s,1),t.timeline(null)),this}updateTime(){return this.active()||(this._lastSourceTime=this._timeSource()),this}_continue(t=!1){return Es.cancelFrame(this._nextFrame),this._nextFrame=null,t?this._stepImmediate():(this._paused||(this._nextFrame=Es.frame(this._step)),this)}_stepFn(t=!1){const s=this._timeSource();let n=s-this._lastSourceTime;t&&(n=0);const i=this._speed*n+(this._time-this._lastStepTime);this._lastSourceTime=s,t||(this._time+=i,this._time=this._time<0?0:this._time),this._lastStepTime=this._time,this.fire("time",this._time);for(let t=this._runners.length;t--;){const s=this._runners[t];this._time-s.start<=0&&s.runner.reset()}let r=!1;for(let t=0,s=this._runners.length;t<s;t++){const n=this._runners[t],e=n.runner;let h=i;const o=this._time-n.start;o<=0?r=!0:(o<h&&(h=o),e.active()&&(e.step(h).done?!0!==n.persist&&e.duration()-e.time()+this._time+n.persist<this._time&&(e.unschedule(),--t,--s):r=!0))}return r&&!(this._speed<0&&0===this._time)||this._runnerIds.length&&this._speed<0&&this._time>0?this._continue():(this.pause(),this.fire("finished")),this}terminate(){this._startTime=0,this._speed=1,this._persist=0,this._nextFrame=null,this._paused=!0,this._runners=[],this._runnerIds=[],this._lastRunnerId=-1,this._time=0,this._lastSourceTime=0,this._lastStepTime=0,this._step=this._stepFn.bind(this,!1),this._stepImmediate=this._stepFn.bind(this,!0)}}f({Element:{timeline:function(t){return null==t?(this._timeline=this._timeline||new zs,this._timeline):(this._timeline=t,this)}}});class Ns extends xt{constructor(t){super(),this.id=Ns.id++,t="function"==typeof(t=null==t?400:t)?new rs(t):t,this._element=null,this._timeline=null,this.done=!1,this._queue=[],this._duration="number"==typeof t&&t,this._isDeclarative=t instanceof rs,this._stepper=this._isDeclarative?t:new is,this._history={},this.enabled=!0,this._time=0,this._lastTime=0,this._reseted=!0,this.transforms=new ht,this.transformId=1,this._haveReversed=!1,this._reverse=!1,this._loopsDone=0,this._swing=!1,this._wait=0,this._times=1,this._frameId=null,this._persist=!!this._isDeclarative||null}static sanitise(t,s,n){let i=1,r=!1,e=0;return s=s??0,n=n||"last","object"!=typeof(t=t??400)||t instanceof ns||(s=t.delay??s,n=t.when??n,r=t.swing||r,i=t.times??i,e=t.wait??e,t=t.duration??400),{duration:t,delay:s,swing:r,times:i,wait:e,when:n}}active(t){return null==t?this.enabled:(this.enabled=t,this)}addTransform(t){return this.transforms.lmultiplyO(t),this}after(t){return this.on("finished",t)}animate(t,s,n){const i=Ns.sanitise(t,s,n),r=new Ns(i.duration);return this._timeline&&r.timeline(this._timeline),this._element&&r.element(this._element),r.loop(i).schedule(i.delay,i.when)}clearTransform(){return this.transforms=new ht,this}clearTransformsFromQueue(){this.done&&this._timeline&&this._timeline._runnerIds.includes(this.id)||(this._queue=this._queue.filter((t=>!t.isTransform)))}delay(t){return this.animate(0,t)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(t){return this.queue(null,t)}ease(t){return this._stepper=new is(t),this}element(t){return null==t?this._element:(this._element=t,t._prepareRunner(),this)}finish(){return this.step(1/0)}loop(t,s,n){return"object"==typeof t&&(s=t.swing,n=t.wait,t=t.times),this._times=t||1/0,this._swing=s||!1,this._wait=n||0,!0===this._times&&(this._times=1/0),this}loops(t){const s=this._duration+this._wait;if(null==t){const t=Math.floor(this._time/s);return Math.min(t+(this._time-t*s)/this._duration,this._times)}const n=Math.floor(t);return this.time(s*n+this._duration*(t%1))}persist(t){return null==t?this._persist:(this._persist=t,this)}position(t){const s=this._time,n=this._duration,i=this._wait,r=this._swing,e=this._reverse;let h;if(null==t){const t=function(t){const s=r*Math.floor(t%(2*(i+n))/(i+n)),h=s&&!e||!s&&e,o=Math.pow(-1,h)*(t%(i+n))/n+h;return Math.max(Math.min(o,1),0)},o=this._times*(i+n)-i;return h=s<=0?Math.round(t(1e-5)):s<o?t(s):Math.round(t(o-1e-5)),h}const o=Math.floor(this.loops()),u=r&&o%2==0;return h=o+(u&&!e||e&&u?t:1-t),this.loops(h)}progress(t){return null==t?Math.min(1,this._time/this.duration()):this.time(t*this.duration())}queue(t,s,n,i){return this._queue.push({initialiser:t||vt,runner:s||vt,retarget:n,isTransform:i,initialised:!1,finished:!1}),this.timeline()&&this.timeline()._continue(),this}reset(){return this._reseted||(this.time(0),this._reseted=!0),this}reverse(t){return this._reverse=null==t?!this._reverse:t,this}schedule(t,s,n){if(t instanceof zs||(n=s,s=t,t=this.timeline()),!t)throw Error("Runner cannot be scheduled without timeline");return t.schedule(this,s,n),this}step(t){if(!this.enabled)return this;this._time+=t=null==t?16:t;const s=this.position(),n=this._lastPosition!==s&&this._time>=0;this._lastPosition=s;const i=this.duration(),r=this._lastTime<=0&&this._time>0,e=this._lastTime<i&&this._time>=i;this._lastTime=this._time,r&&this.fire("start",this);const h=this._isDeclarative;this.done=!h&&!e&&this._time>=i,this._reseted=!1;let o=!1;return(n||h)&&(this._initialise(n),this.transforms=new ht,o=this._run(h?t:s),this.fire("step",this)),this.done=this.done||o&&h,e&&this.fire("finished",this),this}time(t){return null==t?this._time:(this.step(t-this._time),this)}timeline(t){return void 0===t?this._timeline:(this._timeline=t,this)}unschedule(){const t=this.timeline();return t&&t.unschedule(this),this}_initialise(t){if(t||this._isDeclarative)for(let s=0,n=this._queue.length;s<n;++s){const n=this._queue[s],i=this._isDeclarative||!n.initialised&&t;t=!n.finished,i&&t&&(n.initialiser.call(this),n.initialised=!0)}}_rememberMorpher(t,s){if(this._history[t]={morpher:s,caller:this._queue[this._queue.length-1]},this._isDeclarative){const t=this.timeline();t&&t.play()}}_run(t){let s=!0;for(let n=0,i=this._queue.length;n<i;++n){const i=this._queue[n],r=i.runner.call(this,t);i.finished=i.finished||!0===r,s=s&&i.finished}return s}_tryRetarget(t,s,n){if(this._history[t]){if(!this._history[t].caller.initialised){const s=this._queue.indexOf(this._history[t].caller);return this._queue.splice(s,1),!1}this._history[t].caller.retarget?this._history[t].caller.retarget.call(this,s,n):this._history[t].morpher.to(s),this._history[t].caller.finished=!1;const i=this.timeline();return i&&i.play(),!0}return!1}}Ns.id=0;class Ys{constructor(t=new ht,s=-1,n=!0){this.transforms=t,this.id=s,this.done=n}clearTransformsFromQueue(){}}L([Ns,Ys],{mergeWith(t){return new Ys(t.transforms.lmultiply(this.transforms),t.id)}});const Fs=(t,s)=>t.lmultiplyO(s),Is=t=>t.transforms;function Ps(){const t=this._transformationRunners.runners.map(Is).reduce(Fs,new ht);this.transform(t),this._transformationRunners.merge(),1===this._transformationRunners.length()&&(this._frameId=null)}class Ls{constructor(){this.runners=[],this.ids=[]}add(t){if(this.runners.includes(t))return;const s=t.id+1;return this.runners.push(t),this.ids.push(s),this}clearBefore(t){const s=this.ids.indexOf(t+1)||1;return this.ids.splice(0,s,0),this.runners.splice(0,s,new Ys).forEach((t=>t.clearTransformsFromQueue())),this}edit(t,s){const n=this.ids.indexOf(t+1);return this.ids.splice(n,1,t+1),this.runners.splice(n,1,s),this}getByID(t){return this.runners[this.ids.indexOf(t+1)]}length(){return this.ids.length}merge(){let t=null;for(let s=0;s<this.runners.length;++s){const n=this.runners[s];if(!(t&&n.done&&t.done)||n._timeline&&n._timeline._runnerIds.includes(n.id)||t._timeline&&t._timeline._runnerIds.includes(t.id))t=n;else{this.remove(n.id);const i=n.mergeWith(t);this.edit(t.id,i),t=i,--s}}return this}remove(t){const s=this.ids.indexOf(t+1);return this.ids.splice(s,1),this.runners.splice(s,1),this}}f({Element:{animate(t,s,n){const i=Ns.sanitise(t,s,n),r=this.timeline();return new Ns(i.duration).loop(i).element(this).timeline(r.play()).schedule(i.delay,i.when)},delay(t,s){return this.animate(0,t,s)},_clearTransformRunnersBefore(t){this._transformationRunners.clearBefore(t.id)},_currentTransform(t){return this._transformationRunners.runners.filter((s=>s.id<=t.id)).map(Is).reduce(Fs,new ht)},_addRunner(t){this._transformationRunners.add(t),Es.cancelImmediate(this._frameId),this._frameId=Es.immediate(Ps.bind(this))},_prepareRunner(){null==this._frameId&&(this._transformationRunners=(new Ls).add(new Ys(new ht(this))))}}}),L(Ns,{attr(t,s){return this.styleAttr("attr",t,s)},css(t,s){return this.styleAttr("css",t,s)},styleAttr(t,s,n){if("string"==typeof s)return this.styleAttr(t,{[s]:n});let i=s;if(this._tryRetarget(t,i))return this;let r=new gs(this._stepper).to(i),e=Object.keys(i);return this.queue((function(){r=r.from(this.element()[t](e))}),(function(s){return this.element()[t](r.at(s).valueOf()),r.done()}),(function(s){const n=Object.keys(s),h=(o=e,n.filter((t=>!o.includes(t))));var o;if(h.length){const s=this.element()[t](h),n=new _s(r.from()).valueOf();Object.assign(n,s),r.from(n)}const u=new _s(r.to()).valueOf();Object.assign(u,s),r.to(u),e=n,i=s})),this._rememberMorpher(t,r),this},zoom(t,s){if(this._tryRetarget("zoom",t,s))return this;let n=new gs(this._stepper).to(new At(t));return this.queue((function(){n=n.from(this.element().zoom())}),(function(t){return this.element().zoom(n.at(t),s),n.done()}),(function(t,i){s=i,n.to(t)})),this._rememberMorpher("zoom",n),this},transform(t,s,n){if(s=t.relative||s,this._isDeclarative&&!s&&this._tryRetarget("transform",t))return this;const i=ht.isMatrixLike(t);n=null!=t.affine?t.affine:null!=n?n:!i;const r=new gs(this._stepper).type(n?xs:ht);let e,h,o,u,c;return this.queue((function(){h=h||this.element(),e=e||b(t,h),c=new ht(s?void 0:h),h._addRunner(this),s||h._clearTransformRunnersBefore(this)}),(function(l){s||this.clearTransform();const{x:a,y:f}=new rt(e).transform(h._currentTransform(this));let p=new ht({...t,origin:[a,f]}),d=this._isDeclarative&&o?o:c;if(n){p=p.decompose(a,f),d=d.decompose(a,f);const t=p.rotate,s=d.rotate,n=[t-360,t,t+360],i=n.map((t=>Math.abs(t-s))),r=Math.min(...i),e=i.indexOf(r);p.rotate=n[e]}s&&(i||(p.rotate=t.rotate||0),this._isDeclarative&&u&&(d.rotate=u)),r.from(d),r.to(p);const w=r.at(l);return u=w.rotate,o=new ht(w),this.addTransform(o),h._addRunner(this),r.done()}),(function(s){(s.origin||"center").toString()!==(t.origin||"center").toString()&&(e=b(s,h)),t={...s,origin:e}}),!0),this._isDeclarative&&this._rememberMorpher("transform",r),this},x(t){return this._queueNumber("x",t)},y(t){return this._queueNumber("y",t)},ax(t){return this._queueNumber("ax",t)},ay(t){return this._queueNumber("ay",t)},dx(t=0){return this._queueNumberDelta("x",t)},dy(t=0){return this._queueNumberDelta("y",t)},dmove(t,s){return this.dx(t).dy(s)},_queueNumberDelta(t,s){if(s=new At(s),this._tryRetarget(t,s))return this;const n=new gs(this._stepper).to(s);let i=null;return this.queue((function(){i=this.element()[t](),n.from(i),n.to(i+s)}),(function(s){return this.element()[t](n.at(s)),n.done()}),(function(t){n.to(i+new At(t))})),this._rememberMorpher(t,n),this},_queueObject(t,s){if(this._tryRetarget(t,s))return this;const n=new gs(this._stepper).to(s);return this.queue((function(){n.from(this.element()[t]())}),(function(s){return this.element()[t](n.at(s)),n.done()})),this._rememberMorpher(t,n),this},_queueNumber(t,s){return this._queueObject(t,new At(s))},cx(t){return this._queueNumber("cx",t)},cy(t){return this._queueNumber("cy",t)},move(t,s){return this.x(t).y(s)},amove(t,s){return this.ax(t).ay(s)},center(t,s){return this.cx(t).cy(s)},size(t,s){let n;return t&&s||(n=this._element.bbox()),t||(t=n.width/n.height*s),s||(s=n.height/n.width*t),this.width(t).height(s)},width(t){return this._queueNumber("width",t)},height(t){return this._queueNumber("height",t)},plot(t,s,n,i){if(4===arguments.length)return this.plot([t,s,n,i]);if(this._tryRetarget("plot",t))return this;const r=new gs(this._stepper).type(this._element.MorphArray).to(t);return this.queue((function(){r.from(this._element.array())}),(function(t){return this._element.plot(r.at(t)),r.done()})),this._rememberMorpher("plot",r),this},leading(t){return this._queueNumber("leading",t)},viewbox(t,s,n,i){return this._queueObject("viewbox",new ct(t,s,n,i))},update(t){return"object"!=typeof t?this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]}):(null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",t.offset),this)}}),L(Ns,{rx:zt,ry:Nt,from:Xt,to:Vt}),Y(Ns,"Runner");class Rs extends Et{constructor(t,s=t){super(D("svg",t),s),this.namespace()}defs(){return this.isRoot()?z(this.node.querySelector("defs"))||this.put(new Ct):this.root().defs()}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof O.window.SVGElement)&&"#document-fragment"!==this.node.parentNode.nodeName}namespace(){return this.isRoot()?this.attr({xmlns:M,version:"1.1"}).attr("xmlns:xlink",k,A):this.root().namespace()}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,A).attr("xmlns:svgjs",null,A)}root(){return this.isRoot()?this:super.root()}}f({Container:{nested:R((function(){return this.put(new Rs)}))}}),Y(Rs,"Svg",!0);class Gs extends Et{constructor(t,s=t){super(D("symbol",t),s)}}f({Container:{symbol:R((function(){return this.put(new Gs)}))}}),Y(Gs,"Symbol");var $s=Object.freeze({__proto__:null,amove:function(t,s){return this.ax(t).ay(s)},ax:function(t){return this.attr("x",t)},ay:function(t){return this.attr("y",t)},build:function(t){return this._build=!!t,this},center:function(t,s,n=this.bbox()){return this.cx(t,n).cy(s,n)},cx:function(t,s=this.bbox()){return null==t?s.cx:this.attr("x",this.attr("x")+t-s.cx)},cy:function(t,s=this.bbox()){return null==t?s.cy:this.attr("y",this.attr("y")+t-s.cy)},length:function(){return this.node.getComputedTextLength()},move:function(t,s,n=this.bbox()){return this.x(t,n).y(s,n)},plain:function(t){return!1===this._build&&this.clear(),this.node.appendChild(O.document.createTextNode(t)),this},x:function(t,s=this.bbox()){return null==t?s.x:this.attr("x",this.attr("x")+t-s.x)},y:function(t,s=this.bbox()){return null==t?s.y:this.attr("y",this.attr("y")+t-s.y)}});class Hs extends Dt{constructor(t,s=t){super(D("text",t),s),this.dom.leading=this.dom.leading??new At(1.3),this._rebuild=!0,this._build=!1}leading(t){return null==t?this.dom.leading:(this.dom.leading=new At(t),this.rebuild())}rebuild(t){if("boolean"==typeof t&&(this._rebuild=t),this._rebuild){const t=this;let s=0;const n=this.dom.leading;this.each((function(i){if(v(this.node))return;const r=O.window.getComputedStyle(this.node).getPropertyValue("font-size"),e=n*new At(r);this.dom.newLined&&(this.attr("x",t.attr("x")),"\n"===this.text()?s+=e:(this.attr("dy",i?e+s:0),s=0))})),this.fire("rebuild")}return this}setData(t){return this.dom=t,this.dom.leading=new At(t.leading||1.3),this}writeDataToDom(){return _(this,this.dom,{leading:1.3}),this}text(t){if(void 0===t){const s=this.node.childNodes;let n=0;t="";for(let i=0,r=s.length;i<r;++i)"textPath"===s[i].nodeName||v(s[i])?0===i&&(n=i+1):(i!==n&&3!==s[i].nodeType&&!0===z(s[i]).dom.newLined&&(t+="\n"),t+=s[i].textContent);return t}if(this.clear().build(!0),"function"==typeof t)t.call(this,this);else for(let s=0,n=(t=(t+"").split("\n")).length;s<n;s++)this.newLine(t[s]);return this.build(!1).rebuild()}}L(Hs,$s),f({Container:{text:R((function(t=""){return this.put(new Hs).text(t)})),plain:R((function(t=""){return this.put(new Hs).plain(t)}))}}),Y(Hs,"Text");class Xs extends Dt{constructor(t,s=t){super(D("tspan",t),s),this._build=!1}dx(t){return this.attr("dx",t)}dy(t){return this.attr("dy",t)}newLine(){this.dom.newLined=!0;const t=this.parent();if(!(t instanceof Hs))return this;const s=t.index(this),n=O.window.getComputedStyle(this.node).getPropertyValue("font-size"),i=t.dom.leading*new At(n);return this.dy(s?i:0).attr("x",t.x())}text(t){return null==t?this.node.textContent+(this.dom.newLined?"\n":""):("function"==typeof t?(this.clear().build(!0),t.call(this,this),this.build(!1)):this.plain(t),this)}}L(Xs,$s),f({Tspan:{tspan:R((function(t=""){const s=new Xs;return this._build||this.clear(),this.put(s).text(t)}))},Text:{newLine:function(t=""){return this.tspan(t).newLine()}}}),Y(Xs,"Tspan");class Vs extends Dt{constructor(t,s=t){super(D("circle",t),s)}radius(t){return this.attr("r",t)}rx(t){return this.attr("r",t)}ry(t){return this.rx(t)}size(t){return this.radius(new At(t).divide(2))}}L(Vs,{x:Yt,y:Ft,cx:It,cy:Pt,width:Lt,height:Rt}),f({Container:{circle:R((function(t=0){return this.put(new Vs).size(t).move(0,0)}))}}),Y(Vs,"Circle");class Bs extends Et{constructor(t,s=t){super(D("clipPath",t),s)}remove(){return this.targets().forEach((function(t){t.unclip()})),super.remove()}targets(){return pt("svg [clip-path*="+this.id()+"]")}}f({Container:{clip:R((function(){return this.defs().put(new Bs)}))},Element:{clipper(){return this.reference("clip-path")},clipWith(t){const s=t instanceof Bs?t:this.parent().clip().add(t);return this.attr("clip-path","url(#"+s.id()+")")},unclip(){return this.attr("clip-path",null)}}}),Y(Bs,"ClipPath");class Qs extends jt{constructor(t,s=t){super(D("foreignObject",t),s)}}f({Container:{foreignObject:R((function(t,s){return this.put(new Qs).size(t,s)}))}}),Y(Qs,"ForeignObject");var Ws=Object.freeze({__proto__:null,dmove:function(t,s){return this.children().forEach((n=>{let i;try{i=n.node instanceof O.window.SVGSVGElement?new ct(n.attr(["x","y","width","height"])):n.bbox()}catch(t){return}const r=new ht(n),e=r.translate(t,s).transform(r.inverse()),h=new rt(i.x,i.y).transform(e);n.move(h.x,h.y)})),this},dx:function(t){return this.dmove(t,0)},dy:function(t){return this.dmove(0,t)},height:function(t,s=this.bbox()){return null==t?s.height:this.size(s.width,t,s)},move:function(t=0,s=0,n=this.bbox()){return this.dmove(t-n.x,s-n.y)},size:function(t,s,n=this.bbox()){const i=g(this,t,s,n),r=i.width/n.width,e=i.height/n.height;return this.children().forEach((t=>{const s=new rt(n).transform(new ht(t).inverse());t.scale(r,e,s.x,s.y)})),this},width:function(t,s=this.bbox()){return null==t?s.width:this.size(t,s.height,s)},x:function(t,s=this.bbox()){return null==t?s.x:this.move(t,s.y,s)},y:function(t,s=this.bbox()){return null==t?s.y:this.move(s.x,t,s)}});class Js extends Et{constructor(t,s=t){super(D("g",t),s)}}L(Js,Ws),f({Container:{group:R((function(){return this.put(new Js)}))}}),Y(Js,"G");class qs extends Et{constructor(t,s=t){super(D("a",t),s)}target(t){return this.attr("target",t)}to(t){return this.attr("href",t,k)}}L(qs,Ws),f({Container:{link:R((function(t){return this.put(new qs).to(t)}))},Element:{unlink(){const t=this.linker();if(!t)return this;const s=t.parent();if(!s)return this.remove();const n=s.index(t);return s.add(this,n),t.remove(),this},linkTo(t){let s=this.linker();return s||(s=new qs,this.wrap(s)),"function"==typeof t?t.call(s,s):s.to(t),this},linker(){const t=this.parent();return t&&"a"===t.node.nodeName.toLowerCase()?t:null}}}),Y(qs,"A");class Us extends Et{constructor(t,s=t){super(D("mask",t),s)}remove(){return this.targets().forEach((function(t){t.unmask()})),super.remove()}targets(){return pt("svg [mask*="+this.id()+"]")}}f({Container:{mask:R((function(){return this.defs().put(new Us)}))},Element:{masker(){return this.reference("mask")},maskWith(t){const s=t instanceof Us?t:this.parent().mask().add(t);return this.attr("mask","url(#"+s.id()+")")},unmask(){return this.attr("mask",null)}}}),Y(Us,"Mask");class Zs extends jt{constructor(t,s=t){super(D("stop",t),s)}update(t){return("number"==typeof t||t instanceof At)&&(t={offset:arguments[0],color:arguments[1],opacity:arguments[2]}),null!=t.opacity&&this.attr("stop-opacity",t.opacity),null!=t.color&&this.attr("stop-color",t.color),null!=t.offset&&this.attr("offset",new At(t.offset)),this}}f({Gradient:{stop:function(t,s,n){return this.put(new Zs).update(t,s,n)}}}),Y(Zs,"Stop");class Ks extends jt{constructor(t,s=t){super(D("style",t),s)}addText(t=""){return this.node.textContent+=t,this}font(t,s,n={}){return this.rule("@font-face",{fontFamily:t,src:s,...n})}rule(t,s){return this.addText(function(t,s){if(!t)return"";if(!s)return t;let n=t+"{";for(const t in s)n+=t.replace(/([A-Z])/g,(function(t,s){return"-"+s.toLowerCase()}))+":"+s[t]+";";return n+="}",n}(t,s))}}f("Dom",{style(t,s){return this.put(new Ks).rule(t,s)},fontface(t,s,n){return this.put(new Ks).font(t,s,n)}}),Y(Ks,"Style");class tn extends Hs{constructor(t,s=t){super(D("textPath",t),s)}array(){const t=this.track();return t?t.array():null}plot(t){const s=this.track();let n=null;return s&&(n=s.plot(t)),null==t?n:this}track(){return this.reference("href")}}f({Container:{textPath:R((function(t,s){return t instanceof Hs||(t=this.text(t)),t.path(s)}))},Text:{path:R((function(t,s=!0){const n=new tn;let i;if(t instanceof As||(t=this.defs().path(t)),n.attr("href","#"+t,k),s)for(;i=this.node.firstChild;)n.node.appendChild(i);return this.put(n)})),textPath(){return this.findOne("textPath")}},Path:{text:R((function(t){return t instanceof Hs||(t=(new Hs).addTo(this.parent()).text(t)),t.path(this)})),targets(){return pt("svg textPath").filter((t=>(t.attr("href")||"").includes(this.id())))}}}),tn.prototype.MorphArray=ms,Y(tn,"TextPath");class sn extends Dt{constructor(t,s=t){super(D("use",t),s)}use(t,s){return this.attr("href",(s||"")+"#"+t,k)}}f({Container:{use:R((function(t,s){return this.put(new sn).use(t,s)}))}}),Y(sn,"Use"),L([Rs,Gs,Jt,Wt,Kt],p("viewbox")),L([Zt,Ss,Os,As],p("marker")),L(Hs,p("Text")),L(As,p("Path")),L(Ct,p("Defs")),L([Hs,Xs],p("Tspan")),L([js,$t,Qt,Ns],p("radius")),L(xt,p("EventTarget")),L(St,p("Dom")),L(jt,p("Element")),L(Dt,p("Shape")),L([Et,Ht],p("Container")),L(Qt,p("Gradient")),L(Ns,p("Runner")),at.extend([...new Set(a)]),function(t=[]){Ms.push(...[].concat(t))}([At,it,ct,ht,Mt,qt,ms,rt]),L(Ms,{to(t){return(new gs).type(this.constructor).from(this.toArray()).to(t)},fromArray(t){return this.init(t),this},toConsumable(){return this.toArray()},morph(t,s,n,i,r){return this.fromArray(t.map((function(t,e){return i.step(t,s[e],n,r[e],r)})))}});class nn{constructor(t="",s=1){this.prefix=t,this.value=s}}const rn=["pl","fc","pp","ac"];function en(t){return t.replace(/\d+$/,"")}function hn(t){return.299*parseInt(t.slice(1,3),16)+.587*parseInt(t.slice(3,5),16)+.114*parseInt(t.slice(5,7),16)>128?"#000000":"#ffffff"}class on{constructor(t){this._dateFormat={year:"YYYY",quarter:"Q[Q] YYYY",month:"MMM YYYY",locale:"[KW]WW YYYY",day:"DD.MM.YYYY"},this._dateLinkFormat={avg:"Ø[DATE]",interval:"[DATE]..[DATE]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE]",mat:"~[DATE]",none:"[DATE]"},this._scenarioMap=new Map;const i=n([s,null!=t?t:{}]);Object.entries(i.scenarios).forEach((([t,s])=>{var n,i,r;this.createScenarioMapEntry(t,null!==(n=s.name)&&void 0!==n?n:t,null!==(i=s.colorIndex)&&void 0!==i?i:10,null!==(r=s.sortIndex)&&void 0!==r?r:0)})),this._fallBackScenario=i.fallback}createScenarioMapEntry(t,s,n,i){const r=s,e=n;[1,2,3,4].forEach((n=>{this._scenarioMap.set(t+n,{name:s+n,group:r,colorIndex:e,sortIndex:i+10*n})}))}getScenario(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t):this._fallBackScenario}getScenarioGroup(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).name:this._fallBackScenario.name}getScenarioColorIndex(t){return this._scenarioMap.has(t)?this._scenarioMap.get(t).colorIndex:this._fallBackScenario.colorIndex}getScenarioSorIndex(t){const s=this.normalizeVarianceScenario(t);return this._scenarioMap.has(s)?this._scenarioMap.get(s).sortIndex:this._fallBackScenario.sortIndex}normalizeVarianceScenario(t){if(null==t)return"";const s=new r(t);return s.isValid?s.type+s.delta:t}}class un{constructor(){this.font="16px Arial",this.size=16,this.color="#000000",this.background="#ffffff",this.leading=1.8}}class cn{adapt(t){const s=new un;return i.isString(t.font)&&(s.font=t.font),i.isNumber(t.size)&&(s.size=t.size),i.isString(t.color)&&(s.color=t.color),i.isString(t.background)&&(s.background=t.background),i.isNumber(t.leading)&&(s.leading=t.leading),s}default(){return new un}}class ln{constructor(t,s,n,i){this.ac=t,this.fc=s,this.pp=n,this.pl=i}getSVGStyle(t){return"ac"===t?this.ac:"fc"===t?this.fc:"pp"===t?this.pp:"pl"===t?this.pl:this.ac}}class an{constructor(t){this.svgStyleAdapter=t}adapt(t){const s=new ln(this.svgStyleAdapter.defaultAC(),this.svgStyleAdapter.defaultFC(),this.svgStyleAdapter.defaultPP(),this.svgStyleAdapter.defaultPL());return i.isExisting(t.ac)&&(s.ac=this.svgStyleAdapter.adapt(t.ac)),i.isExisting(t.fc)&&(s.fc=this.svgStyleAdapter.adapt(t.fc)),i.isExisting(t.pp)&&(s.pp=this.svgStyleAdapter.adapt(t.pp)),i.isExisting(t.pl)&&(s.pl=this.svgStyleAdapter.adapt(t.pl)),s}default(){return new ln(this.svgStyleAdapter.defaultAC(),this.svgStyleAdapter.defaultFC(),this.svgStyleAdapter.defaultPP(),this.svgStyleAdapter.defaultPL())}}class fn{constructor(){this.top=10,this.left=10,this.right=10,this.bottom=10}}class pn{adapt(t){const s=new fn;return i.isNumber(t.top)&&(s.top=t.top),i.isNumber(t.left)&&(s.left=t.left),i.isNumber(t.right)&&(s.right=t.right),i.isNumber(t.bottom)&&(s.bottom=t.bottom),s}default(){return new fn}}class dn{constructor(t="#000000",s="#000000",n=.1){this.stroke=t,this.fill=s,this.width=n}}class wn{adapt(t){const s=new dn(t.stroke,t.fill,t.width);return i.isString(t.fillpattern)&&(s.fillpattern=t.fillpattern),i.isString(t.dasharray)&&(s.dasharray=t.dasharray),s}default(){return new dn("#000000","#000000",.3)}defaultAC(){return new dn("#000000","#000000",.3)}defaultFC(){const t=new dn("#000000","#000000",.3);return t.dasharray="10 5 5 5",t.fillpattern="fc",t}defaultPP(){return new dn("#999999","#999999",.3)}defaultPL(){return new dn("#000000","#ffffff",.3)}defaultPos(){return new dn("#00ff00","#00ff00",.3)}defaultNeg(){return new dn("#ff0000","#ff0000",.3)}defaultNeu(){return new dn("#999999","#999999",.3)}}var mn;!function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right",t[t.Top=3]="Top",t[t.Bottom=4]="Bottom"}(mn||(mn={}));class yn{constructor(t,s,n,i,r,e,h,o){this.ID_SCENARIOLABEL="Label",this.CSS_CATEGORIES="categories",this.isRelativeLabel=!1,this.segmentFillColor=null,this.x=s,this.y=n,this.value=r,this.group=t.group().id(this.createElementID(t.toString(),i)),this.styles=e,this.isVarianceLabel=!1,this.verticalHookLocation=h||mn.Top,this.horizontalHookLocation=o||mn.Left}setToVarianceLabel(){return this.isVarianceLabel=!0,this}setToRelativeVarianceLabel(){return this.isVarianceLabel=!0,this.isRelativeLabel=!0,this}setSegmentFill(t){return this.segmentFillColor=t,this}updateGroup(t){return this.group=t,this}draw(t=!0,s={percent:2,decimal:1},n=new nn){if(this.isEmpty())return this;const i=this.group;let r,e="";if(!1===Number.isNaN(Number(this.value))){let t="percent",i=s.percent,h=s.percent,o=1;!1===this.isRelativeLabel&&(i=s.decimal,h=s.decimal,o=n.value,t="decimal"),r=c.number(Number(this.value),t,i,h,o),this.isVarianceLabel&&Number(this.value)>=0&&(e="+")}else r=""+this.value;const h=this.drawLabel(i,e+r);return!1===t&&(h.addClass("hide"),i.addClass("hide")),this}isEmpty(){return null==this.value||""===this.value}setPos(t,s){return this.x=t,this.y=s,this}forceStringTypeDraw(){return this.drawLabel(this.group,""+this.value),this}drawLabel(t,s){const n=this.styles.fontStyles.background||"#ffffff";let i="start";const r=t.text(s);r.move(this.x,this.y);const e=r.bbox().w,h=r.bbox().h;let o=0,u=0;const c=r.x();let l=r.y();return this.horizontalHookLocation===mn.Left?(i="left",o=r.x()):this.horizontalHookLocation===mn.Center?(i="middle",o=r.x()-(e+2)/2):this.horizontalHookLocation===mn.Right&&(i="end",o=r.x()-e),this.verticalHookLocation===mn.Center?(l=r.y()-1.2*h/2,u=l+.2*h):this.verticalHookLocation===mn.Top?(l-=h/4,u=l+.2*h):this.verticalHookLocation===mn.Bottom&&(l-=h,u=l+.2*h),r.move(c,l),r.font({anchor:i}),null!=this.segmentFillColor?r.fill(hn(this.segmentFillColor)):t.rect(e+2,.8*h).stroke(n).fill(n).opacity(.9).move(o-1,u).insertBefore(r),r}createElementID(t,s){return t+"_"+s+"_"+this.ID_SCENARIOLABEL}}const gn={ac:1,pp:2,fc:3,pl:4};var bn;!function(t){t[t.Above=0]="Above",t[t.Below=1]="Below",t[t.Left=2]="Left",t[t.Right=3]="Right"}(bn||(bn={}));class xn{constructor(){this.labels=[],this.scenarioLabels=[]}clear(){this.labels=[],this.scenarioLabels=[]}register(t){this.labels.push(t)}hasCollision(t){return this.labels.some((s=>this.intersects(t,s)))}getOptimalPlacement(t,s,n,i,r,e,h,o){const u=gn[h]||99,c=e/2;for(const e of o){const h=this.calculatePlacementForDirection(t,s,n,i,r,c,8,e);if(!this.hasCollision(h.bounds))return h}for(const e of o){const h=this.calculatePlacementForDirection(t,s,n,i,r,c,8,e);if(!this.collidesWithHigherPriority(h.bounds,u))return h}return null}calculatePlacementForDirection(t,s,n,i,r,e,h,o){let u,c,l,a,f,p;switch(o){case bn.Above:u=t,c=s-e-h,l=mn.Bottom,a=mn.Center,f=t-n/2,p=s-e-h-i;break;case bn.Below:u=t,c=s+e+h,l=mn.Top,a=mn.Center,f=t-n/2,p=s+e+h-i/4;break;case bn.Left:u=t-e-h,c=s,l=mn.Center,a=mn.Right,f=t-e-h-n,p=s-.6*i;break;case bn.Right:u=t+e+h,c=s,l=mn.Center,a=mn.Left,f=t+e+h,p=s-.6*i}return{labelX:u,labelY:c,verticalHook:l,horizontalHook:a,bounds:{x:f,y:p,width:n,height:i,pointIndex:r,preferredHook:l}}}collidesWithHigherPriority(t,s){return this.labels.some((n=>!!n.scenarioType&&((gn[n.scenarioType]||99)<s&&this.intersects(t,n))))}shouldHideScenarioLabel(t,s,n,i=20){const r=gn[n]||99;return!(r<=1)&&this.scenarioLabels.some((n=>{if((gn[n.scenarioType]||99)>=r)return!1;const e=Math.abs(s-n.y),h=Math.abs(t-n.x);return e<i&&h<i}))}registerScenarioLabel(t,s,n){this.scenarioLabels.push({x:t,y:s,scenarioType:n})}intersects(t,s){return!(t.x+t.width<s.x||s.x+s.width<t.x||t.y+t.height<s.y||s.y+s.height<t.y)}getLabelCount(){return this.labels.length}}export{u as C,c as F,mn as H,on as I,xn as L,pn as P,e as Q,Rs as S,r as V,cn as a,an as b,wn as c,nn as d,en as e,rn as f,hn as g,yn as h,bn as i,gn as j}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as t,a as s}from"./p-CIXlJoMr.js";import{X as i,D as n}from"./p-BnOTt2YD.js";import{L as o,H as e,F as h,C as r}from"./p-CDPTCKVx.js";class l{constructor(t,s,n,o){this.scaleFactors=t,this.fontStyles=s,this.axisStyles=n,this.padding=o,this.seriesColors=[...i]}}class a{constructor(t,s,i,n){this.scaleFactorsXYChartAdapter=t,this.fontStyleAdapter=s,this.svgStyleGroupAdapter=i,this.paddingAdapter=n}adapt(s){const i=this.default();return t.isExisting(s)&&(t.isExisting(s.scaleFactors)&&(i.scaleFactors=this.scaleFactorsXYChartAdapter.adapt(s.scaleFactors)),t.isExisting(s.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(s.fontStyles)),t.isExisting(s.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(s.axisStyles)),t.isExisting(s.padding)&&(i.padding=this.paddingAdapter.adapt(s.padding)),Array.isArray(s.seriesColors)&&s.seriesColors.length>0&&(i.seriesColors=s.seriesColors)),i}default(){return new l(this.scaleFactorsXYChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.paddingAdapter.default())}}class c{constructor(){this.pointRadius=.4,this.bubbleMaxRadius=3.2,this.bubbleMinRadius=.35,this.axisTickLength=.35,this.labelToMark=.3,this.legendSwatch=.9,this.panelGap=1.6,this.refLineWidth=1,this.gridLineWidth=1}}class u{adapt(s){const i=new c;return t.isNumber(s.pointRadius)&&(i.pointRadius=s.pointRadius),t.isNumber(s.bubbleMaxRadius)&&(i.bubbleMaxRadius=s.bubbleMaxRadius),t.isNumber(s.bubbleMinRadius)&&(i.bubbleMinRadius=s.bubbleMinRadius),t.isNumber(s.axisTickLength)&&(i.axisTickLength=s.axisTickLength),t.isNumber(s.labelToMark)&&(i.labelToMark=s.labelToMark),t.isNumber(s.legendSwatch)&&(i.legendSwatch=s.legendSwatch),t.isNumber(s.panelGap)&&(i.panelGap=s.panelGap),t.isNumber(s.refLineWidth)&&(i.refLineWidth=s.refLineWidth),t.isNumber(s.gridLineWidth)&&(i.gridLineWidth=s.gridLineWidth),i}default(){return new c}}class f{constructor(t,s,i,n){this.count=t,this.drawingRect=i,this.panelGapPx=n,this.columns=Math.max(1,Math.min(null!=s?s:t,t)),this.rows=Math.max(1,Math.ceil(t/this.columns))}panelRect(t){const s=t%this.columns,i=Math.floor(t/this.columns),n=(this.drawingRect.width-(this.columns-1)*this.panelGapPx)/this.columns,o=(this.drawingRect.height-(this.rows-1)*this.panelGapPx)/this.rows;return{x:this.drawingRect.x+s*(n+this.panelGapPx),y:this.drawingRect.y+i*(o+this.panelGapPx),width:n,height:o}}isOuterLeft(t){return t%this.columns==0}isOuterBottom(t){return t+this.columns>=this.count}}class d{constructor(t,s,i,n){this.domainMin=t,this.domainMax=s,this.rangeMin=i,this.rangeMax=n}scale(t){const s=this.domainMax-this.domainMin;return 0===s?(this.rangeMin+this.rangeMax)/2:this.rangeMin+(t-this.domainMin)/s*(this.rangeMax-this.rangeMin)}static domain(t,s,i,n=.04){let o=s-t;if(0===o){const i=0===t?1:.1*Math.abs(t);o=(s+=i)-(t-=i)}return[void 0!==(null==i?void 0:i.min)?i.min:t-o*n,void 0!==(null==i?void 0:i.max)?i.max:s+o*n]}static niceStep(t,s){if(t<=0||s<=0)return 1;const i=t/s,n=Math.pow(10,Math.floor(Math.log10(i))),o=i/n;let e;return e=o<=1?1:o<=2?2:o<=2.5?2.5:o<=5?5:10,e*n}ticks(t){const s=this.domainMax-this.domainMin;if(s<=0)return[this.domainMin];const i=d.niceStep(s,t),n=[];for(let t=Math.ceil(this.domainMin/i)*i;t<=this.domainMax+1e-9*i;t+=i)n.push(Math.abs(t)<1e-9*i?0:t);return n}static tickDecimals(t){let s=0;for(const i of t){const t=String(i),n=t.indexOf(".");n>=0&&(s=Math.max(s,Math.min(2,t.length-n-1)))}return s}}const v=["n","ne","e","se","s","sw","w","nw"],w=Math.SQRT1_2;class m{constructor(t,s,i=new o){this.frame=t,this.gapPx=s,this.manager=i}registerMark(t,s,i){this.manager.register(this.bounds(t-i,s-i,2*i,2*i))}selectCandidates(t,s,i,n){if("none"===s)return{selected:[],unknownNames:[]};if("all"===s)return{selected:[...t],unknownNames:[]};if("auto"===s)return{selected:t.slice(0,i),unknownNames:[]};const o=new Set(s),e=t.filter((t=>o.has(n(t)))),h=new Set(e.map((t=>n(t))));return{selected:e,unknownNames:s.filter((t=>!h.has(t)))}}place(t){const s=[];for(const i of t)for(const t of v){const n=this.anchorBox(i,t);if(!this.insideFrame(n.x,n.y,i.width,i.height))continue;const o=this.bounds(n.x,n.y,i.width,i.height);if(!this.manager.hasCollision(o)){this.manager.register(o),s.push({candidate:i,x:n.x,y:n.y,anchor:t});break}}return s}anchorBox(t,s){const i=t.r+this.gapPx,n=t.r*w+.5*this.gapPx;switch(s){case"n":return{x:t.cx-t.width/2,y:t.cy-i-t.height};case"ne":return{x:t.cx+n,y:t.cy-n-t.height};case"e":return{x:t.cx+i,y:t.cy-t.height/2};case"se":return{x:t.cx+n,y:t.cy+n};case"s":return{x:t.cx-t.width/2,y:t.cy+i};case"sw":return{x:t.cx-n-t.width,y:t.cy+n};case"w":return{x:t.cx-i-t.width,y:t.cy-t.height/2};case"nw":return{x:t.cx-n-t.width,y:t.cy-n-t.height}}}insideFrame(t,s,i,n){return t>=this.frame.x&&s>=this.frame.y&&t+i<=this.frame.x+this.frame.width&&s+n<=this.frame.y+this.frame.height}bounds(t,s,i,n){return{x:t,y:s,width:i,height:n,pointIndex:0,preferredHook:e.Center}}}class x{constructor(t,s,i,n){this.xScale=t,this.yScale=s,this.rect=i,this.styles=n}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}drawBands(t,s,i){var n,o,e,h;const r=this.styles.axisStyles.pl.fill;if(void 0!==s&&(void 0!==s.from||void 0!==s.to)){const i=this.xScale.scale(null!==(n=s.from)&&void 0!==n?n:this.xScale.domainMin),e=this.xScale.scale(null!==(o=s.to)&&void 0!==o?o:this.xScale.domainMax);t.rect(Math.abs(e-i),this.rect.height).move(Math.min(i,e),this.rect.y).fill(r)}if(void 0!==i&&(void 0!==i.from||void 0!==i.to)){const s=this.yScale.scale(null!==(e=i.from)&&void 0!==e?e:this.yScale.domainMin),n=this.yScale.scale(null!==(h=i.to)&&void 0!==h?h:this.yScale.domainMax);t.rect(this.rect.width,Math.abs(s-n)).move(this.rect.x,Math.min(s,n)).fill(r)}}drawGrid(t,s,i){const n={color:this.styles.axisStyles.pp.stroke,width:this.styles.scaleFactors.gridLineWidth};for(const i of s){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}if(void 0!==i)for(const s of i){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}}drawRefLines(t,s,i){const n={color:this.styles.axisStyles.fc.stroke,width:this.styles.scaleFactors.refLineWidth};if(void 0!==s){const i=this.xScale.scale(s);t.line(i,this.rect.y,i,this.rect.y+this.rect.height).stroke(n)}if(void 0!==i){const s=this.yScale.scale(i);t.line(this.rect.x,s,this.rect.x+this.rect.width,s).stroke(n)}}drawFrame(t){t.rect(this.rect.width,this.rect.height).move(this.rect.x,this.rect.y).fill("none").stroke({color:this.styles.axisStyles.ac.stroke,width:this.styles.scaleFactors.gridLineWidth})}drawTickLabels(t,s){const i=this.styles.scaleFactors.axisTickLength*this.em,n={size:this.styles.fontStyles.size,anchor:"start"},o=this.fontFamily(),e=this.styles.fontStyles.color;if(s.showXLabels)for(const r of s.ticksX){const l=this.xScale.scale(r);t.text(h.number(r,"decimal",s.xDecimals,s.xDecimals)).font(Object.assign(Object.assign({},n),{anchor:"middle"})).fill(e).attr({x:l,y:this.rect.y+this.rect.height+i+.8*this.em,"font-family":o})}if(s.showYLabels)for(const r of s.ticksY){const l=this.yScale.scale(r);t.text(h.number(r,"decimal",s.yDecimals,s.yDecimals)).font(Object.assign(Object.assign({},n),{anchor:"end"})).fill(e).attr({x:this.rect.x-i,y:l+.35*this.em,"font-family":o})}}drawPanelTitle(t,s){""!==s&&t.text(s).font({size:this.styles.fontStyles.size,weight:"bold",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:this.rect.x+.5*this.em,y:this.rect.y+1.2*this.em,"font-family":this.fontFamily()})}}class p{constructor(t){this.styles=t}get em(){return this.styles.fontStyles.size}get rowHeight(){return 1.5*this.em}get swatchSize(){return this.styles.scaleFactors.legendSwatch*this.em}textWidth(t,s=!1){const i=r(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:s?"bold":"normal"}).width;return Number.isFinite(i)&&i>0?i:.6*t.length*this.em}rows(t){const s=[];t.sizeCaption.forEach(((t,i)=>{s.push({text:t,bold:0===i,treatment:null})})),null!==t.title&&""!==t.title&&s.push({text:t.title,bold:!0,treatment:null});for(const i of t.compareEntries)s.push({text:i.label,bold:!1,treatment:i.treatment});for(const i of t.entries)s.push({text:i.label,bold:!1,treatment:i.treatment});return s}measure(t,s){const i=this.rows(t);if(0===i.length)return{width:0,height:0};const n=this.swatchSize+.4*this.em;if("bottom"===s){let t=0;for(const s of i)t+=(null!==s.treatment?n:0)+this.textWidth(s.text,s.bold)+1.5*this.em;return{width:t,height:this.rowHeight}}let o=0;for(const t of i)o=Math.max(o,(null!==t.treatment?n:0)+this.textWidth(t.text,t.bold));return{width:o,height:i.length*this.rowHeight}}draw(t,s,i,n,o){const e=this.rows(s),h=this.swatchSize+.4*this.em;let r=i,l=n;for(const s of e){let i=r;if(null!==s.treatment){const n=t.circle(this.swatchSize).move(r,l+(this.rowHeight-this.swatchSize)/2).fill(s.treatment.hatch?"#ffffff":s.treatment.fill).stroke({color:"#ffffff"===s.treatment.stroke?s.treatment.fill:s.treatment.stroke,width:s.treatment.strokeWidth});void 0!==s.treatment.dasharray&&n.attr("stroke-dasharray",s.treatment.dasharray),i+=h}t.text(s.text).font({size:this.styles.fontStyles.size,weight:s.bold?"bold":"normal",anchor:"start"}).fill(this.styles.fontStyles.color).attr({x:i,y:l+this.rowHeight/2+.35*this.em,"font-family":this.fontFamily()}),"bottom"===o?r=i+this.textWidth(s.text,s.bold)+1.5*this.em:l+=this.rowHeight}}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}}class y{constructor(){this.operation="+",this.custom={},this.counts={}}slotValue(s){const i=this[s];return t.isNumber(i)?i:null}slotHasNoData(t){return 0===this.counts[t]}}const M=["ac1","ac2","ac3","ac4","pp1","pp2","pp3","pp4","fc1","fc2","fc3","fc4","pl1","pl2","pl3","pl4"];class b{adapt(s){const i=new y;if(t.isOperator(s.operation)&&(i.operation=s.operation),t.isString(s.date)){const t=n.fromISO(s.date);i.date=t.isValid?t:void 0}t.isString(s.rowGroup)&&t.isNumber(s.rowGroupIndex)&&(i.rowGroup=s.rowGroup,i.rowGroupIndex=s.rowGroupIndex),t.isString(s.category)&&t.isNumber(s.categoryIndex)&&(i.category=s.category,i.categoryIndex=s.categoryIndex),t.isString(s.subCategory)&&t.isNumber(s.subCategoryIndex)&&(i.subCategory=s.subCategory,i.subCategoryIndex=s.subCategoryIndex),t.isString(s.columnGroup)&&t.isNumber(s.columnGroupIndex)&&(i.columnGroup=s.columnGroup,i.columnGroupIndex=s.columnGroupIndex),t.isString(s.columnSubGroup)&&t.isNumber(s.columnSubGroupIndex)&&(i.columnSubGroup=s.columnSubGroup,i.columnSubGroupIndex=s.columnSubGroupIndex);for(const n of M){t.isNumber(s[n])&&(i[n]=s[n]);const o=s[`${n}_cnt`];t.isNumber(o)&&(i.counts[n]=o)}for(const t of Object.keys(s))t.startsWith("_")&&(i.custom[t]=s[t]);return i}default(){return new y}}const g={rowGroup:"rowGroupIndex",category:"categoryIndex",subCategory:"subCategoryIndex"};function N(t,s){if("scenario"===s.kind)return{value:t.slotValue(s.slot),varianceNoData:!1};if(t.slotHasNoData(s.measure.base)||t.slotHasNoData(s.measure.delta))return{value:null,varianceNoData:!0};const i=s.measure.compute(t.slotValue(s.measure.base),t.slotValue(s.measure.delta));return{value:i,varianceNoData:null===i}}function S(t,s){return void 0!==s&&(void 0!==s.min&&t<s.min||void 0!==s.max&&t>s.max)}function k(t,i){return"scenario"!==t.kind?null:i+s(t.slot)}function j(t,s){var i,n,o,e,h,r,l,a,c;const u=[],f=new Set,d=[];let v=0,w=0,m=0,x=0,p=0;const y=new Map,M=new Map,b=new Map,j=null!==(i=s.compareFamily)&&void 0!==i?i:null,z=null!==j?k(s.measures.x,j):null,C=null!==j?k(s.measures.y,j):null,D=null!==j&&void 0!==s.measures.size?k(s.measures.size,j):null;for(const i of t){const t=i[s.pointLevel];if(null==t||""===t)continue;const u=null!==(n=null!==s.facetLevel?i[s.facetLevel]:"")&&void 0!==n?n:"",k=null!==(o=null!==s.seriesLevel?i[s.seriesLevel]:"")&&void 0!==o?o:"",j=`${u}\0${t}`;if(f.has(j)){v++,d.length<5&&!d.includes(t)&&d.push(t);continue}const O=N(i,s.measures.x),F=N(i,s.measures.y);if(null===O.value||null===F.value){(O.varianceNoData||F.varianceNoData)&&w++;continue}if(S(O.value,null===(e=s.domains)||void 0===e?void 0:e.x)||S(F.value,null===(h=s.domains)||void 0===h?void 0:h.y)){m++;continue}const I={name:t,seriesKey:k,facetKey:u,x:O.value,y:F.value,row:i};if(void 0!==s.measures.size){const t=N(i,s.measures.size).value;if(null===t)continue;if(t<0){x++;continue}I.size=t}if(void 0!==s.measures.share){const t=N(i,s.measures.share).value;null!==t&&(t<0||t>1?(p++,I.share=Math.min(1,Math.max(0,t))):I.share=t)}if(null!==z&&null!==C){const t=i.slotValue(z),n=i.slotValue(C),o=null!==D?i.slotValue(D):null;null===t||null===n||null!==D&&null===o?I.compare=null:S(t,null===(r=s.domains)||void 0===r?void 0:r.x)||S(n,null===(l=s.domains)||void 0===l?void 0:l.y)?(m++,I.compare=null):(I.compare={x:t,y:n},null!==o&&(I.compare.size=o))}if(f.add(j),b.has(u)||b.set(u,[]),b.get(u).push(I),null!==s.facetLevel){const t=i[g[s.facetLevel]];null!=t&&t<(null!==(a=y.get(u))&&void 0!==a?a:Number.POSITIVE_INFINITY)&&y.set(u,t)}if(null!==s.seriesLevel){const t=i[g[s.seriesLevel]];null!=t&&t<(null!==(c=M.get(k))&&void 0!==c?c:Number.POSITIVE_INFINITY)&&M.set(k,t)}}const O=[...b.keys()].sort(((t,s)=>{var i,n;return(null!==(i=y.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=y.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})),F=O.map((t=>{let i=b.get(t);return s.limit>0&&i.length>s.limit&&(i="size"===s.limitBy?[...i].sort(((t,s)=>{var i,n;return(null!==(i=s.size)&&void 0!==i?i:0)-(null!==(n=t.size)&&void 0!==n?n:0)})).slice(0,s.limit):i.slice(0,s.limit)),{key:t,points:i}})),I=new Set;for(const t of F)for(const s of t.points)I.add(s.seriesKey);const B=[...I].sort(((t,s)=>{var i,n;return(null!==(i=M.get(t))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)-(null!==(n=M.get(s))&&void 0!==n?n:Number.MAX_SAFE_INTEGER)})).map(((t,s)=>({key:t,index:s})));let H=null,L=0;for(const t of F)for(const s of t.points){L++;const t=[s.x],i=[s.y],n=void 0!==s.size?[s.size]:[];null!=s.compare&&(t.push(s.compare.x),i.push(s.compare.y),void 0!==s.compare.size&&n.push(s.compare.size)),null===H&&(H={xMin:t[0],xMax:t[0],yMin:i[0],yMax:i[0],sizeMax:0});for(const s of t)H.xMin=Math.min(H.xMin,s),H.xMax=Math.max(H.xMax,s);for(const t of i)H.yMin=Math.min(H.yMin,t),H.yMax=Math.max(H.yMax,t);for(const t of n)H.sizeMax=Math.max(H.sizeMax,t)}return v>0&&u.push({code:"xy-duplicate-point",data:{count:String(v),names:d.join(", ")}}),w>0&&u.push({code:"xy-variance-nodata",data:{count:String(w)}}),m>0&&u.push({code:"xy-point-clipped",data:{count:String(m)}}),x>0&&u.push({code:"bubble-size-negative",data:{count:String(x)}}),p>0&&u.push({code:"bubble-share-range",data:{count:String(p)}}),L>5e3&&u.push({code:"xy-point-budget",data:{count:String(L)}}),{facets:F,series:B,extents:H,warnings:u,totalPoints:L}}export{f as F,d as N,m as P,u as S,b as X,p as a,x as b,a as c,j as r}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,d as i,f as e,h as s,H as a,g as r}from"./p-B_d-jp99.js";import{a as n}from"./p-BnOTt2YD.js";import{w as l,a as o,g as h,p as u}from"./p-COXiPUfj.js";import{w as c,o as d}from"./p-44L8rZSd.js";import{i as p,a as v,w as m,b as f,c as g}from"./p-lIy3SJs2.js";import{w as y,a as b}from"./p-B4JfKvVT.js";import{w as x}from"./p-DHibUOw5.js";import{r as _,s as w}from"./p-CIXlJoMr.js";import{t as $,a as R,b as S,c as E,d as L,e as j,p as O}from"./p-B2KOyHRY.js";const A={rowGroup:0,category:1,subCategory:2},C=["ac","pp","fc","pl"],z=class{validateX(t){this.validateMeasureSpec("x",t,!0,(t=>$(t)))}validateY(t){this.validateMeasureSpec("y",t,!0,(t=>$(t)))}validateSize(t){this.validateMeasureSpec("size",t,!0,(t=>R(t))),this.validateSizeScaling()}validateShare(t){this.validateMeasureSpec("share",t,!1,(t=>S(t)))}validateCompareWith(t){const i="ERR_compareWith";p(t)||C.includes(t.trim().toLowerCase())?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`compare-with: invalid value '${t}' — expected ${C.join("/")}; ignored.`})}validateLevel(t){const i="ERR_level",e=["auto","category","subcategory"];p(t)||e.includes(t.trim().toLowerCase())?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`level: invalid value '${t}' — expected ${e.join("/")}; using 'auto'.`})}validateSeriesLevel(t){const i="ERR_seriesLevel",e=["auto","rowgroup","category","none"];p(t)||e.includes(t.trim().toLowerCase())?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`series-level: invalid value '${t}' — expected ${e.join("/")}; using 'auto'.`})}validateFacet(t){this.validateObjectSpec("facet",t,(t=>E(t)))}validateLabels(t){this.validateObjectSpec("labels",t,(t=>L(t,this.labelDefaults())))}validateLegend(t){this.validateObjectSpec("legend",t,(t=>j(t)))}validateAspect(t){const i="ERR_aspect";p(t)||null!==this.parseAspect(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`aspect: invalid value '${t}' — expected "w:h" (e.g. "16:9"); using the default.`})}validateLimit(t){const i="ERR_limit";v(t)&&Number(t)>=0?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`limit: invalid value '${t}' — expected a non-negative integer; using 0.`})}validateScale(t){const i="ERR_scale";if(p(t))return void this.errors.remove(i);const{mode:e,factor:s}=u(t);"factor"===e&&(void 0===s||s<=0)?this.errors.addOrReplace({id:i,type:"warning",message:`scale: invalid value '${t}' — expected none/auto or a positive number.`}):this.errors.remove(i)}constructor(i){t(this,i),this.datasetName="",this.dataVersion=0,this.datasetMeta=null,this.appliedScaleFactor=1,this.layoutObserver=null,this.activeErrors=new Set,this.pixelPerUnitGroupMap=new Map,this.chartTitle="",this.filter="",this.share="",this.compareWith="",this.level="auto",this.seriesLevel="auto",this.facet="",this.labels="",this.legend="",this.aspect="16:9",this.limit=0,this._autoScaleGuard=!1,this._lastObservedWidth=0,this.translateForInner=(t,i)=>this.t(t,i),m(this),y(this),l(this,(t=>{this.datasetName=(null==t?void 0:t.startsWith("$"))?t.substring(1):t||"",this.dataVersion=this.dataVersion+1}),((t,i)=>{this.datasetMeta=i})),this.errors=b(this),x(this),this.componentStyle=f(this),this.ruleSetConfig=c(this),this.t=o(this).t}componentWillLoad(){this.validateX(this.x),this.validateY(this.y),this.validateSize(this.size),this.validateShare(this.share),this.validateCompareWith(this.compareWith),this.validateLevel(this.level),this.validateSeriesLevel(this.seriesLevel),this.validateFacet(this.facet),this.validateLabels(this.labels),this.validateLegend(this.legend),this.validateAspect(this.aspect),this.validateLimit(this.limit),this.validateScale(this.scale)}componentDidRender(){const{mode:t}=u(this.scale);if("auto"!==t&&"empty"!==t){this._autoScaleGuard=!1;const t=h(this.element),i="WARN_overflow";return void(t.width>0&&this.element.scrollWidth>t.width+1?this.errors.addOrReplace({id:i,type:"warning",message:"Chart exceeds available space and will be cut off. Check the scale value."}):this.errors.remove(i))}if(this._autoScaleGuard)return void(this._autoScaleGuard=!1);const e=this.element,{width:s}=h(e);if(s<=0)return;this._lastObservedWidth=s;const a=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333})),r=e.scrollWidth,n=this.appliedScaleFactor;if(!Number.isFinite(r)||r<=s+1)return void this.errors.remove("AUTO_scale");const l=Math.max(.3,n*(s-1)/r);Math.abs(l-n)<.01||(e.style.setProperty("--bn-font-size",a*l+"px"),"empty"===t?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${l.toFixed(3)}`}):this.errors.remove("AUTO_scale"),this._autoScaleGuard=!0,i((()=>{this.appliedScaleFactor=l})))}componentDidLoad(){this.layoutObserver=d(this.element,(()=>{if(this._autoScaleGuard)return;const{width:t}=h(this.element);t>0&&Math.abs(t-this._lastObservedWidth)>2&&(this._lastObservedWidth=t,e(this))})),requestAnimationFrame((()=>{requestAnimationFrame((()=>{if(this._autoScaleGuard)return;const{width:t}=h(this.element);this._lastObservedWidth=t,e(this)}))}))}disconnectedCallback(){var t;null===(t=this.layoutObserver)||void 0===t||t.disconnect(),this.layoutObserver=null}labelDefaults(){return{points:"all",values:!0,max:12}}setBlockingError(t,i){null===i?(this.errors.remove(t),this.activeErrors.delete(t)):(this.errors.addOrReplace({id:t,type:"error",message:i}),this.activeErrors.add(t))}hasBlockingErrors(){return this.activeErrors.size>0}validateSizeScaling(){var t;const i=null===(t=this.prepareSize())||void 0===t?void 0:t.group;this.setBlockingError("ERR_xy_scale_group",void 0===i||this.pixelPerUnitGroupMap.has(i)?null:this.t(".bubble-scale-group-unknown",{group:i}))}validateMeasureSpec(t,i,e,s){var a;const r=`ERR_xy_json_${t}`,n=`ERR_xy_measure_${t}`,l=`WARN_xy_fields_${t}`,{data:o,parseError:h}=O(i,"measure");if(h)return this.setBlockingError(r,this.t(".xy-prop-json",{prop:t})),this.setBlockingError(n,null),void this.errors.remove(l);if(this.setBlockingError(r,null),null===o)return this.setBlockingError(n,e?this.t(".xy-measure-invalid",{prop:t,measure:""}):null),void this.errors.remove(l);const u=null!==(a=o.measure)&&void 0!==a?a:"";g(u)?this.setBlockingError(n,null):this.setBlockingError(n,this.t(".xy-measure-invalid",{prop:t,measure:u})),this.reportSpecIssues(l,t,s(o))}validateObjectSpec(t,i,e){const s=`ERR_xy_json_${t}`,a=`WARN_xy_fields_${t}`,{data:r,parseError:n}=O(i,null);if(n)return this.setBlockingError(s,this.t(".xy-prop-json",{prop:t})),void this.errors.remove(a);this.setBlockingError(s,null),null!==r?this.reportSpecIssues(a,t,e(r)):this.errors.remove(a)}reportSpecIssues(t,i,e){const s=[];null!==e&&e.invalidFields.length>0&&s.push(`invalid: ${e.invalidFields.join(", ")}`),null!==e&&e.unknownKeys.length>0&&s.push(`unknown: ${e.unknownKeys.join(", ")}`),s.length>0?this.errors.addOrReplace({id:t,type:"warning",message:`${i}: ignored sub-fields (${s.join("; ")}).`}):this.errors.remove(t)}prepareAxis(t,i){const{data:e,parseError:s}=O(i,"measure");if(s||null===e)return null;const{config:a}=$(e);return null!==a&&g(a.measure)?(void 0!==a.min&&void 0!==a.max&&a.min>=a.max?(this.errors.addOrReplace({id:`WARN_xy_domain_${t}`,type:"warning",message:`${t}: min must be smaller than max; the override is ignored.`}),a.min=void 0,a.max=void 0):this.errors.remove(`WARN_xy_domain_${t}`),a):null}prepareSize(){const{data:t,parseError:i}=O(this.size,"measure");if(i||null===t)return null;const{config:e}=R(t);return null!==e&&g(e.measure)?e:null}prepareShare(){const{data:t,parseError:i}=O(this.share,"measure");if(i||null===t)return null;const{config:e}=S(t);return null!==e&&g(e.measure)?e:null}prepareCompareFamily(){var t;const i=null===(t=this.compareWith)||void 0===t?void 0:t.trim().toLowerCase();return C.includes(i)?i:null}prepareLabels(){const t=this.labelDefaults(),{data:i,parseError:e}=O(this.labels,null);return e||null===i?{points:t.points,values:t.values,max:t.max}:L(i,t).config}prepareLegend(){const{data:t,parseError:i}=O(this.legend,null);return i||null===t?{show:!0,position:"right"}:j(t).config}prepareFacet(){const{data:t,parseError:i}=O(this.facet,null);return i||null===t?null:E(t).config}preparePointLevel(){var t,i;const e=null===(t=this.level)||void 0===t?void 0:t.trim().toLowerCase();if("category"===e)return"category";if("subcategory"===e)return"subCategory";const s=null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedLevel;return"rowGroup"===s||"category"===s||"subCategory"===s?s:"category"}prepareSeriesLevel(t){var i;const e=null===(i=this.seriesLevel)||void 0===i?void 0:i.trim().toLowerCase();return"none"===e?null:"rowgroup"===e?"rowGroup":"category"===e||"subCategory"===t?"category":"category"===t?"rowGroup":null}validateCrossProp(t,i){const e=new Set;let s=!1;for(const i of t){if(void 0===i)continue;const t=_(i);null!==t&&("scenario"===t.kind?e.add(w(t.slot)):s=!0)}this.setBlockingError("ERR_xy_family",e.size>1?this.t(".xy-family-mixed",{families:[...e].join(", ")}):null);const a=this.prepareCompareFamily();this.setBlockingError("ERR_xy_compare_variance",null!==a&&s?this.t(".xy-compare-variance"):null),this.setBlockingError("ERR_xy_compare_family",null!==a&&1===e.size&&e.has(a)?`compare-with: '${a}' is already the primary scenario family.`:null);const r=this.preparePointLevel(),n=this.prepareSeriesLevel(r),l=null!==i?"rowgroup"===i.level?"rowGroup":"category":null;let o=null;if(null!==n&&A[n]>=A[r]&&(o=`series '${n}' vs point '${r}'`),null!==l){const t=null!=n?n:r;A[l]>=A[t]&&(o=`facet '${l}' vs '${t}'`)}this.setBlockingError("ERR_xy_level_order",null!==o?this.t(".xy-level-order",{detail:o}):null)}parseAspect(t){const i=/^\s*(\d+(?:\.\d+)?)\s*:\s*(\d+(?:\.\d+)?)\s*$/.exec(null!=t?t:"");if(null===i)return null;const e=Number(i[1]),s=Number(i[2]);return e<=0||s<=0?null:e/s}prepareAspect(){var t;return null!==(t=this.parseAspect(this.aspect))&&void 0!==t?t:16/9}prepareLimit(){const t=Math.floor(Number(this.limit)||0);return t>0?t:0}prepareSizeAreaPerUnit(){var t;const i=null===(t=this.prepareSize())||void 0===t?void 0:t.group;if(void 0===i||!this.pixelPerUnitGroupMap.has(i))return 0;const e=this.getEffectiveScaleFactor();return this.pixelPerUnitGroupMap.get(i)*e*e}i18nLocalKeys(){return["no-data","axis.in","legend.title","legend.size","legend.compare"]}prepareI18n(){const t=new Map(this.i18nLocalKeys().map((t=>[t,this.t(".".concat(t))]))),i=new Map(n.map((t=>[t,this.t("global.".concat(t))])));return new Map([...i.entries(),...t.entries()])}prepareStyle(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{const e=i.global.fontSizePx*t;return{scaleFactors:i["bn-chart-bubble"].scaleFactors,fontStyles:{font:`${e}px ${i.global.fontFamily}`,size:e,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i["bn-chart-bubble"].axisStyles,seriesColors:i["bn-chart-bubble"].seriesColors,padding:i["bn-chart-bubble"].padding}}))}getEffectiveScaleFactor(){const{mode:t,factor:i}=u(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var e,s,a,r;const n=(null===(e=i.global)||void 0===e?void 0:e.fontSizePx)||13.3333;return{"--bn-font-family":(null===(s=i.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":n*t+"px","--bn-font-color":(null===(a=i.global)||void 0===a?void 0:a.fontColor)||"#000000","--bn-font-background":(null===(r=i.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}getDataStructure(){const t={};for(const i of["ac","pp","fc","pl"])for(const e of[1,2,3,4])t[`${i}${e}`]={type:"number",isOptional:!0,description:""};const i={x:this.prepareAxis("x",this.x),y:this.prepareAxis("y",this.y),size:this.prepareSize(),share:this.prepareShare()};for(const[e,s]of Object.entries(i)){if(null===s)continue;const i=_(s.measure);null!==i&&("scenario"===i.kind?t[i.slot].description=`${e}: ${void 0!==s.label?s.label:s.measure}`:(t[i.measure.base].description=`${e}: ${s.measure} (base)`,t[i.measure.delta].description=`${e}: ${s.measure} (delta)`))}const e=this.prepareCompareFamily();if(null!==e)for(const[s,a]of Object.entries(i)){if(null===a||"share"===s)continue;const i=_(a.measure);if(null!==i&&"scenario"===i.kind){const a=e+i.slot.replace(/^[a-z]+/,"");""===t[a].description&&(t[a].description=`${s}: compareWith`)}}return{IBubbleChartDataRow:Object.assign({operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!0,description:""},rowGroupIndex:{type:"number",isOptional:!0,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!0,description:""},subCategoryIndex:{type:"number",isOptional:!0,description:""}},t)}}chartTemplate(){const t=this.prepareAxis("x",this.x),i=this.prepareAxis("y",this.y),e=this.prepareSize(),a=this.prepareShare(),r=this.prepareFacet();if(this.validateCrossProp([null==t?void 0:t.measure,null==i?void 0:i.measure,null==e?void 0:e.measure,null==a?void 0:a.measure],r),this.validateSizeScaling(),this.hasBlockingErrors()||null===t||null===i||null===e)return null;const n=this.preparePointLevel(),l=this.prepareI18n(),o=this.prepareStyle(),u=h(this.element).width;return s("ibcs-chart-bubble",{tableName:this.datasetName,dataVersion:this.dataVersion,chartTitle:this.chartTitle,x:t,y:i,size:e,share:a,compareFamily:this.prepareCompareFamily(),labels:this.prepareLabels(),legend:this.prepareLegend(),facet:r,pointLevel:n,seriesLevel:this.prepareSeriesLevel(n),aspect:this.prepareAspect(),limit:this.prepareLimit(),filter:this.filter,sizeAreaPerUnit:this.prepareSizeAreaPerUnit(),styles:o,i18n:l,containerWidth:u,ruleSetConfig:this.ruleSetConfig(),errors:this.errors,translate:this.translateForInner})}render(){return s(a,{key:"4191801f8d17e3241a9b681d9a7f0ab8a453bf64",style:this.getFontStyles()},s("div",{key:"a5284956b892a3647331532daae8d3251dbb6fad",class:"container"},this.chartTemplate()))}get element(){return r(this)}static get watchers(){return{x:[{validateX:0}],y:[{validateY:0}],size:[{validateSize:0}],share:[{validateShare:0}],compareWith:[{validateCompareWith:0}],level:[{validateLevel:0}],seriesLevel:[{validateSeriesLevel:0}],facet:[{validateFacet:0}],labels:[{validateLabels:0}],legend:[{validateLegend:0}],aspect:[{validateAspect:0}],limit:[{validateLimit:0}],scale:[{validateScale:0}]}}};z.style=":host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:column}";export{z as bn_chart_bubble}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,H as s,g as h}from"./p-B_d-jp99.js";import{r as e,m as n,s as o,g as l,b as a}from"./p-BnOTt2YD.js";import{C as r,S as d,F as c,g as u,I as v,a as b,b as m,c as f,P as w}from"./p-CDPTCKVx.js";import{X as p,r as g,a as x,N as y,b as M,P as $,F as S,c as L,S as k}from"./p-CPZIJpxn.js";import{r as C}from"./p-CIXlJoMr.js";class N{constructor(t,i,s,h,e){this.mode=t,this.vMax=i,this.rMaxPx=s,this.rMinPx=h,this.areaPerUnitPx2=e}static local(t,i,s){return new N("local",t,i,s,0)}static grouped(t){return new N("grouped",0,0,0,t)}radius(t){return"grouped"===this.mode?t<=0?0:Math.sqrt(this.areaPerUnitPx2*t/Math.PI):this.vMax<=0||t<=0?this.rMinPx:Math.max(this.rMinPx,this.rMaxPx*Math.sqrt(t/this.vMax))}}class T{constructor(t,i,s,h,e,n){var o,l,a,r;this.ruleSet=t,this.config=h,this.styles=e,this.availableWidth=n,this.warnings=[],this.canvasHeight=0,this.i18nMap=new Map,this.hatchPatterns=new Set,this.scaleOverflowCount=0,this.svgRoot=null;const d=new p,c=""!==s?i.exec(`SELECT * FROM ${s}`):[],u=(null!=c?c:[]).map((t=>d.adapt(t)));this.data=g(u,{pointLevel:h.pointLevel,seriesLevel:h.seriesLevel,facetLevel:null!==h.facet?"rowgroup"===h.facet.level?"rowGroup":"category":null,measures:{x:null!==(o=C(h.x.measure))&&void 0!==o?o:{kind:"scenario",slot:"ac1"},y:null!==(l=C(h.y.measure))&&void 0!==l?l:{kind:"scenario",slot:"ac2"},size:null!==(a=C(h.size.measure))&&void 0!==a?a:{kind:"scenario",slot:"ac3"},share:null!==h.share&&null!==(r=C(h.share.measure))&&void 0!==r?r:void 0},compareFamily:h.compareFamily,domains:{x:{min:h.x.min,max:h.x.max},y:{min:h.y.min,max:h.y.max}},limit:h.limit,limitBy:"size"}),this.warnings.push(...this.data.warnings)}get em(){return this.styles.fontStyles.size}fontFamily(){return this.styles.fontStyles.font.replace(/^[\d.]+px\s*/,"")}textWidth(t,i=!1){const s=r(t,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px",fontWeight:i?"bold":"normal"}).width;return Number.isFinite(s)&&s>0?s:.6*t.length*this.em}drawText(t,i,s,h,e={}){var n,o;t.text(i).font({size:this.styles.fontStyles.size,weight:e.bold?"bold":"normal",anchor:null!==(n=e.anchor)&&void 0!==n?n:"start"}).fill(null!==(o=e.color)&&void 0!==o?o:this.styles.fontStyles.color).attr({x:s,y:h,"font-family":this.fontFamily()})}hasNoData(){return 0===this.data.totalPoints}getWarnings(){return this.warnings}getAllocatedCanvasWidth(){return this.availableWidth}getAllocatedCanvasHeight(){return this.canvasHeight}setI18n(t){this.i18nMap=t}addWarningOnce(t,i){this.warnings.some((i=>i.code===t))||this.warnings.push({code:t,data:i})}primaryColorIndex(){const t=C(this.config.size.measure);return null===t||"variance"===t.kind?10:this.ruleSet.getScenarioColorIndex(t.slot)}compareColorIndex(){return this.ruleSet.getScenarioColorIndex(`${this.config.compareFamily}1`)}seriesHue(t){const{color:i,overflowed:s}=e(t,this.styles.seriesColors);return s&&this.addWarningOnce("xy-series-overflow",{}),i}familyDisplayName(t){return this.ruleSet.getScenario(`${t}1`).group}legendModel(){var t,i;const s=[],h=null!==(i=null!==(t=this.config.size.label)&&void 0!==t?t:this.i18nMap.get("legend.size"))&&void 0!==i?i:"";""!==h&&(s.push(h),void 0!==this.config.size.unit&&""!==this.config.size.unit&&s.push(`${this.i18nMap.get("axis.in")||"in"} ${this.config.size.unit}`));const e=this.seriesHue(0),o=[];if(null!==this.config.compareFamily){const t=C(this.config.size.measure),i=null!==t&&"scenario"===t.kind?t.slot.replace(/\d+$/,""):"ac";o.push({label:this.familyDisplayName(this.config.compareFamily),treatment:n(this.compareColorIndex(),e,"bubble")}),o.push({label:this.familyDisplayName(i),treatment:n(this.primaryColorIndex(),e,"bubble")})}const l=this.data.series.map((t=>{var i;return{label:""===t.key?null!==(i=this.ruleSet.getScenario("").name)&&void 0!==i?i:"Series":t.key,treatment:n(this.primaryColorIndex(),this.seriesHue(t.index),"bubble")}}));return{sizeCaption:s,title:this.i18nMap.get("legend.title")||null,compareEntries:o,entries:l}}toString(){const t=new d;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.attr("overflow","visible"),t.svg()}axisTitle(t,i){var s;const h=null!==(s=t.label)&&void 0!==s?s:"";return""===h?"":void 0===t.unit||""===t.unit?h:`${h} ${i} ${t.unit}`}draw(t){var i,s,h,e,n,o,l,a,r,d,c;this.warnings=this.data.warnings.slice(),this.hatchPatterns.clear(),this.scaleOverflowCount=0,this.svgRoot=t;const u=this.em,v=this.styles.padding,b=this.i18nMap.get("axis.in")||"in",m=t.group(),f=new x(this.styles),w=this.legendModel(),p=this.config.legend.show&&(w.entries.length>0||w.sizeCaption.length>0),g=p?f.measure(w,this.config.legend.position):{width:0,height:0},M="right"===this.config.legend.position&&p?g.width+u:0,$=""!==this.config.chartTitle?1.6*u:0,L=this.axisTitle(this.config.y,b),k=this.axisTitle(this.config.x,b),C=""!==L?1.4*u:.4*u,T=1.4*u+(""!==k?1.3*u:0);let z,P=3*u,W={x:0,y:0,width:0,height:0},D=[];const F=Math.max(1,this.data.facets.length),H=null===(i=this.config.facet)||void 0===i?void 0:i.columns,I=y.domain(null!==(h=null===(s=this.data.extents)||void 0===s?void 0:s.xMin)&&void 0!==h?h:0,null!==(n=null===(e=this.data.extents)||void 0===e?void 0:e.xMax)&&void 0!==n?n:1,{min:this.config.x.min,max:this.config.x.max}),j=y.domain(null!==(l=null===(o=this.data.extents)||void 0===o?void 0:o.yMin)&&void 0!==l?l:0,null!==(r=null===(a=this.data.extents)||void 0===a?void 0:a.yMax)&&void 0!==r?r:1,{min:this.config.y.min,max:this.config.y.max});for(let t=0;t<2;t++){const t=Math.max(10,this.availableWidth-v.left-v.right-P-M);W={x:v.left+P,y:v.top+$+C,width:t,height:t/this.config.aspect},z=new S(F,H,W,this.styles.scaleFactors.panelGap*u);const i=z.panelRect(0).height,s=Math.max(4,Math.min(8,Math.round(i/(4*u)))),h=new y(j[0],j[1],i,0);D=h.ticks(s);const e=y.tickDecimals(D);P=Math.max(...D.map((t=>this.textWidth(this.formatTick(t,e)))),u)+this.styles.scaleFactors.axisTickLength*u+.4*u}this.canvasHeight=W.y+W.height+T+("bottom"===this.config.legend.position&&p?g.height+u:0)+v.bottom,""!==this.config.chartTitle&&this.drawText(m,this.config.chartTitle,v.left,v.top+u,{bold:!0}),""!==L&&this.drawAxisTitleText(m,this.config.y,b,v.left,W.y-.6*u,"start");const A=this.buildPanels(z,I,j),B=A[0].xScale.ticks(Math.max(3,Math.min(8,Math.round(A[0].rect.width/(7*u))))),E=y.tickDecimals(B),X=y.tickDecimals(D),_=this.config.sizeAreaPerUnit>0?N.grouped(this.config.sizeAreaPerUnit):N.local(null!==(c=null===(d=this.data.extents)||void 0===d?void 0:d.sizeMax)&&void 0!==c?c:0,this.styles.scaleFactors.bubbleMaxRadius*u,this.styles.scaleFactors.bubbleMinRadius*u);0===this.data.facets.length?this.drawPanel(m,A[0],{key:"",points:[]},_,B,D,E,X,!0,!0):this.data.facets.forEach(((t,i)=>{this.drawPanel(m,A[i],t,_,B,D,E,X,z.isOuterLeft(i),z.isOuterBottom(i),this.data.facets.length>1?t.key:"")})),""!==k&&this.drawAxisTitleText(m,this.config.x,b,W.x+W.width,W.y+W.height+2.6*u,"end"),p&&("right"===this.config.legend.position?f.draw(m,w,W.x+W.width+u,W.y,"right"):f.draw(m,w,W.x,W.y+W.height+T,"bottom")),this.scaleOverflowCount>0&&this.addWarningOnce("bubble-scale-overflow",{count:String(this.scaleOverflowCount)}),t.group().addClass("annotations")}drawAxisTitleText(t,i,s,h,e,n){var o;const l=null!==(o=i.label)&&void 0!==o?o:"",a=void 0!==i.unit&&""!==i.unit?`${s} ${i.unit}`:"",r=.3*this.em;"start"===n?(this.drawText(t,l,h,e,{bold:!0}),""!==a&&this.drawText(t,a,h+this.textWidth(l,!0)+r,e,{})):""!==a?(this.drawText(t,a,h,e,{anchor:"end"}),this.drawText(t,l,h-this.textWidth(a)-r,e,{anchor:"end",bold:!0})):this.drawText(t,l,h,e,{anchor:"end",bold:!0})}buildPanels(t,i,s){const h=[];for(let e=0;e<t.count;e++){const n=t.panelRect(e),o=new y(i[0],i[1],n.x,n.x+n.width),l=new y(s[0],s[1],n.y+n.height,n.y);h.push({rect:n,xScale:o,yScale:l,frame:new M(o,l,n,this.styles)})}return h}treatmentFill(t,i,s){return!0!==t.hatch?t.fill:(this.ensureHatchPattern(i,s),`url(#xy-fc-${i})`)}ensureHatchPattern(t,i){this.hatchPatterns.has(t)||null===this.svgRoot||(this.hatchPatterns.add(t),this.svgRoot.defs().pattern(10,10,(t=>{t.rect(10,10).fill("#ffffff"),t.line(0,10,10,0).stroke({color:i,width:2}),t.line(-2.5,2.5,2.5,-2.5).stroke({color:i,width:2}),t.line(7.5,12.5,12.5,7.5).stroke({color:i,width:2})})).id(`xy-fc-${t}`))}drawPanel(t,i,s,h,e,l,a,r,d,c,u=""){var v,b,m,f;const w=t.group(),p=this.em;i.frame.drawBands(w,this.config.x.highlight,this.config.y.highlight),i.frame.drawGrid(w,l,void 0===this.config.x.refLine&&void 0===this.config.y.refLine&&i.rect.width>30*p?e:void 0),i.frame.drawRefLines(w,this.config.x.refLine,this.config.y.refLine),i.frame.drawFrame(w);const g=w.group().id("compare"),x=w.group().id("primary"),y=new $(i.rect,this.styles.scaleFactors.labelToMark*p),M=[...s.points].sort(((t,i)=>{var s,h;return(null!==(s=i.size)&&void 0!==s?s:0)-(null!==(h=t.size)&&void 0!==h?h:0)})),S=[];for(const t of M){const s=null!==(b=null===(v=this.data.series.find((i=>i.key===t.seriesKey)))||void 0===v?void 0:v.index)&&void 0!==b?b:0,e=this.seriesHue(s),l=n(this.primaryColorIndex(),e,"bubble"),a=i.xScale.scale(t.x),r=i.yScale.scale(t.y),d=h.radius(null!==(m=t.size)&&void 0!==m?m:0);if(this.config.sizeAreaPerUnit>0&&this.bubbleExceedsPanel(i.rect,a,r,d)&&this.scaleOverflowCount++,null!=t.compare){const o=n(this.compareColorIndex(),e,"bubble"),l=i.xScale.scale(t.compare.x),a=i.yScale.scale(t.compare.y),r=h.radius(null!==(f=t.compare.size)&&void 0!==f?f:0);this.drawBubble(g,l,a,r,o,s,e),y.registerMark(l,a,r),this.config.labels.values&&void 0!==t.compare.size&&r>=1.2*p&&this.drawValueLabel(g,l,a,r,t.compare.size,o.fill)}this.drawBubble(x,a,r,d,l,s,e),y.registerMark(a,r,d),void 0!==t.share&&d>0&&this.drawShareSlice(x,a,r,d,t.share,o(e)),this.config.labels.values&&void 0!==t.size&&this.drawValueLabel(x,a,r,d,t.size,!0===l.hatch?"#ffffff":l.fill),S.push({point:t,cx:a,cy:r,r:d,seriesIndex:s,hue:e,treatment:l})}this.drawNameLabels(w,y,S),i.frame.drawTickLabels(w,{ticksX:e,ticksY:l,xDecimals:a,yDecimals:r,showXLabels:c,showYLabels:d}),""!==u&&i.frame.drawPanelTitle(w,u)}bubbleExceedsPanel(t,i,s,h){return i-h<t.x||i+h>t.x+t.width||s-h<t.y||s+h>t.y+t.height}drawBubble(t,i,s,h,e,n,o){h<=0||t.circle(2*h).center(i,s).fill(this.treatmentFill(e,n,o)).stroke({color:e.stroke,width:e.strokeWidth})}drawShareSlice(t,i,s,h,e,n){if(e<=0)return;if(e>=1)return void t.circle(2*h).center(i,s).fill(n);const o=2*e*Math.PI,l=i+h*Math.sin(o),a=s-h*Math.cos(o),r=o>Math.PI?1:0;t.path(`M ${i} ${s} L ${i} ${s-h} A ${h} ${h} 0 ${r} 1 ${l} ${a} Z`).fill(n).stroke("none")}drawValueLabel(t,i,s,h,e,n){const o=c.number(e,"decimal",1,1);this.textWidth(o)+.4*this.em>2*h||this.drawText(t,o,i,s+.35*this.em,{anchor:"middle",color:u(n.startsWith("#")?n:"#ffffff")})}drawNameLabels(t,i,s){const h=[...s].sort(((t,i)=>{var s,h;return(null!==(s=i.point.size)&&void 0!==s?s:0)-(null!==(h=t.point.size)&&void 0!==h?h:0)})),{selected:e,unknownNames:n}=i.selectCandidates(h,this.config.labels.points,this.config.labels.max,(t=>t.point.name));n.length>0&&this.addWarningOnce("xy-label-unknown",{names:n.join(", ")});const o=e.map((t=>({name:t.point.name,cx:t.cx,cy:t.cy,r:t.r,width:this.textWidth(t.point.name),height:1.1*this.em})));for(const s of i.place(o))this.drawText(t,s.candidate.name,s.x,s.y+.9*s.candidate.height,{})}formatTick(t,i){return c.number(t,"decimal",i,i)}}const z=["xy-duplicate-point","xy-point-clipped","xy-variance-nodata","xy-label-unknown","xy-series-overflow","xy-point-budget","bubble-size-negative","bubble-share-range","bubble-scale-overflow"],P=class{constructor(i){t(this,i),this.tableName="",this.dataVersion=0,this.chartTitle="",this.share=null,this.compareFamily=null,this.facet=null,this.pointLevel="category",this.seriesLevel=null,this.aspect=16/9,this.limit=0,this.filter="",this.sizeAreaPerUnit=0,this.i18n=new Map,this.containerWidth=0,this.svgMarkup=""}getDb(){return this.stores||(this.stores=l(this.element)),this.stores.db.db}componentWillLoad(){this.rebuild()}componentWillUpdate(){this.rebuild()}rebuild(){const t=this.prepareStyle(),i=this.tableName?a(this.tableName,this.filter):"";this.chart=new T(new v(this.ruleSetConfig),this.getDb(),i,{chartTitle:this.chartTitle,x:this.x,y:this.y,size:this.size,share:this.share,compareFamily:this.compareFamily,labels:this.labels,legend:this.legend,facet:this.facet,pointLevel:this.pointLevel,seriesLevel:this.seriesLevel,aspect:this.aspect,limit:this.limit,sizeAreaPerUnit:this.sizeAreaPerUnit},t,this.containerWidth||0),this.chart.setI18n(this.i18n),this.svgMarkup=this.chart.hasNoData()?"":this.chart.toString(),this.syncWarnings(this.chart.getWarnings())}syncWarnings(t){if(void 0===this.errors)return;const i=new Map(t.map((t=>[t.code,t.data])));for(const t of z){const s=`WARN_${t}`;if(i.has(t)){const h=void 0!==this.translate?this.translate(`.${t}`,i.get(t)):t;this.errors.addOrReplace({id:s,type:"warning",message:h})}else this.errors.remove(s)}}prepareStyle(){return new L(new k,new b,new m(new f),new w).adapt(this.styles)}render(){if(void 0===this.chart)return i(s,null);if(this.chart.hasNoData()){const t=this.i18n.get("no-data")||"==No Data==";return i(s,null,i("p",{class:"warning"},t))}return i(s,null,i("div",{innerHTML:this.svgMarkup}))}get element(){return h(this)}};P.style=':host{position:relative;display:inline-block}.warning{font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}';export{P as ibcs_chart_bubble}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as s,H as t,g as a}from"./p-B_d-jp99.js";import{w as r,a as o}from"./p-B4JfKvVT.js";const c=class{constructor(s){e(this,s),r(this),this.errors=o(this)}render(){return s(t,{key:"297aed9fd195f26fa714ee9f616ea6db30c749ce"},s("slot",{key:"3048b6ea5c3770ad7d9149e2be83dc82294107fb"}))}get element(){return a(this)}};export{c as bn_template}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as s,g as r}from"./p-B_d-jp99.js";import{d as i,w as o,b as n}from"./p-lIy3SJs2.js";import{w as a,a as d}from"./p-B4JfKvVT.js";import"./p-BnOTt2YD.js";import"./p-CIXlJoMr.js";function l(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e.map(((t,e)=>{var s,r,i;return"string"==typeof t?{label:t,id:String(e)}:"object"==typeof t&&null!==t?{label:null!==(r=null!==(s=t.label)&&void 0!==s?s:t.name)&&void 0!==r?r:String(e),id:null!==(i=t.id)&&void 0!==i?i:String(e)}:{label:String(t),id:String(e)}})):[]}catch(t){return console.error("parseHeaders: failed to parse JSON",t),[]}}function h(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);if(!Array.isArray(e))return["Headers must be an array"];const s=[],r=new Set;return e.forEach(((t,e)=>{"object"==typeof t&&null!==t&&void 0!==t.id&&("string"!=typeof t.id?s.push(`Header[${e}]: 'id' must be a string`):r.has(t.id)?s.push(`Header[${e}]: duplicate id '${t.id}'`):r.add(t.id),void 0!==t.label&&"string"!=typeof t.label&&s.push(`Header[${e}]: 'label' must be a string`))})),s}catch(t){return console.error("validateHeadersJson: failed to parse JSON",t),["Invalid JSON structure"]}}const u=class{validateRowHeaders(t){const e="ERR_rowHeaders",s=h(t);s.length>0?this.errors.addOrReplace({id:e,type:"error",message:`row-headers: ${s.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateColumnHeaders(t){const e="ERR_columnHeaders",s=h(t);s.length>0?this.errors.addOrReplace({id:e,type:"error",message:`column-headers: ${s.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateShowRowHeaders(t){const e="ERR_showRowHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-row-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowColumnHeaders(t){const e="ERR_showColumnHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-column-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowBorders(t){const e="ERR_showBorders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-borders: invalid value '${t}', must be 'true' or 'false'`})}constructor(e){t(this,e),this.gridConfig={rows:[],columns:[]},this.chartTitle="",this.rowHeaders="[]",this.columnHeaders="[]",this.showRowHeaders="true",this.showColumnHeaders="true",this.showBorders="true",this.rowHeaderWidth="auto",this.cellGap="0px",o(this),a(this),this.errors=d(this),this.componentStyle=n(this)}getGridStyle(){return this.componentStyle((t=>t["bn-grid"]))}componentWillLoad(){this.validateRowHeaders(this.rowHeaders),this.validateColumnHeaders(this.columnHeaders),this.validateShowRowHeaders(this.showRowHeaders),this.validateShowColumnHeaders(this.showColumnHeaders),this.validateShowBorders(this.showBorders)}updateGridConfig(){var t;this.gridConfig=(t=this.columnHeaders,{rows:l(this.rowHeaders),columns:l(t)})}shouldShowRowHeaders(){return"true"===this.showRowHeaders&&this.gridConfig.rows.length>0}shouldShowColumnHeaders(){return"true"===this.showColumnHeaders&&this.gridConfig.columns.length>0}shouldShowBorders(){return"true"===this.showBorders}getGridTemplateColumns(){const t=[];this.shouldShowRowHeaders()&&t.push(this.rowHeaderWidth);const e=this.gridConfig.columns.length||1;for(let s=0;s<e;s++)t.push("auto");return t.join(" ")}getGridTemplateRows(){const t=[];this.chartTitle&&t.push("auto"),this.shouldShowColumnHeaders()&&t.push("auto");const e=this.gridConfig.rows.length||1;for(let s=0;s<e;s++)t.push("auto");return t.join(" ")}renderTitle(){if(!this.chartTitle)return null;const t=(this.shouldShowRowHeaders()?1:0)+this.gridConfig.columns.length;return e("div",{class:"grid-title",style:{"grid-column":`1 / span ${t}`,"grid-row":"1"}},this.chartTitle)}renderColumnHeaders(){if(!this.shouldShowColumnHeaders())return null;const t=this.getGridStyle(),s=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,i=this.chartTitle?2:1;return this.gridConfig.columns.map(((o,n)=>{const a=n>0;return e("div",{key:`col-header-${o.id}`,class:"grid-header grid-header-col",style:{"grid-column":String(r+n),"grid-row":String(i),"border-left":a?s:"none",padding:`${t.cellPadding}px`,"padding-left":a?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},o.label)}))}renderDataCells(){const t=this.getGridStyle(),s=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,i=(this.chartTitle?1:0)+(this.shouldShowColumnHeaders()?1:0)+1,o=[];return this.gridConfig.rows.length>0&&this.gridConfig.columns.length>0&&this.gridConfig.rows.forEach(((n,a)=>{if(this.shouldShowRowHeaders()){const r=a>0;o.push(e("div",{key:`row-header-${n.id}`,class:"grid-header grid-header-row",style:{"grid-column":"1","grid-row":String(i+a),"border-top":r?s:"none",padding:`${t.cellPadding}px`,"padding-top":r?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},n.label))}this.gridConfig.columns.forEach(((d,l)=>{const h=function(t,e){return`${t.id}-${e.id}`}(n,d),u=l>0,c=a>0;o.push(e("div",{key:`cell-${h}`,class:"grid-cell",style:{"grid-column":String(r+l),"grid-row":String(i+a),"border-left":u?s:"none","border-top":c?s:"none","padding-left":u?`${t.cellPadding+4}px`:"0","padding-top":c?`${t.cellPadding+4}px`:"0"}},e("slot",{name:h})))}))})),o}getFontStyles(){return this.componentStyle((t=>{var e,s,r,i;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(s=t.global)||void 0===s?void 0:s.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(r=t.global)||void 0===r?void 0:r.fontColor)||"#000000","--bn-font-background":(null===(i=t.global)||void 0===i?void 0:i.fontBackgroundColor)||"#ffffff"}}))}render(){const t={display:"inline-grid","grid-template-columns":this.getGridTemplateColumns(),"grid-template-rows":this.getGridTemplateRows(),gap:this.cellGap};return e(s,{key:"b764369a9ec0f55923408d7935b3595c296a1f3f",style:this.getFontStyles()},e("div",{key:"47f0bf65ba39079902449e541f6c447ad171cd83",class:"grid-container",style:t},this.renderTitle(),this.renderColumnHeaders(),this.renderDataCells()),e("slot",{key:"502168eab311d3d09be9e5b176a28c0ba3420c74"}))}get element(){return r(this)}static get watchers(){return{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],showRowHeaders:[{validateShowRowHeaders:0}],showColumnHeaders:[{validateShowColumnHeaders:0}],showBorders:[{validateShowBorders:0}]}}};u.style=':host{display:inline-block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.grid-container{display:inline-grid;box-sizing:border-box}.grid-title{font-weight:normal;padding-bottom:8px}.grid-header{display:flex;align-items:flex-end;box-sizing:border-box}.grid-header-row{justify-content:flex-end;padding-right:8px}.grid-header-col{white-space:nowrap;justify-content:flex-start}.grid-cell{position:relative;box-sizing:border-box}';export{u as bn_grid}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t,f as e}from"./p-B_d-jp99.js";import{g as r,c as s,D as n}from"./p-BnOTt2YD.js";import{r as a}from"./p-B4JfKvVT.js";import{m as i,C as o,S as u,b as c,A as l,c as d,T as h,D as m,d as f,M as y,e as p,r as b}from"./p-CIXlJoMr.js";const N=n=>{let o,u,c,l;const d=()=>{const t=u.componentStyles.state;l=i([t._system||{},t._default||{},t[c]||{}],{arrayMergeType:"overwrite"})},h=new MutationObserver((r=>{r.forEach((r=>{"selected-style"===r.attributeName&&(c=t(n).getAttribute("selected-style"),d(),e(n))}))})),m=n.connectedCallback;n.connectedCallback=()=>{const s=t(n);u=r(s),l=u.componentStyles.state._system,h.observe(s,{attributes:!0,attributeFilter:["selected-style"]}),c=t(n).getAttribute("selected-style"),d(),o=u.componentStyles.on("set",(r=>{r===c&&(c=t(n).getAttribute("selected-style"),d(),e(t(n)))})),a(m,n)};const f=n.disconnectedCallback;return n.disconnectedCallback=()=>{h.disconnect(),a(o),s(t(n)),a(f,n)},t=>t(l)},g=/^\s*(set|first|last|min|max|avg|sum|lit)\(\s*(.*?)\s*\)\s*$/,v=/^[A-Za-z_][A-Za-z0-9_]*$/,S=["min","max","avg","sum"];class D{constructor(t,e,r,s){this.label=t,this.alias=e,this.fn=r,this.arg=s}get isNumeric(){return S.includes(this.fn)}}function w(t){if("string"!=typeof t)return!1;const e=g.exec(t);if(!e)return!1;const[,r,s]=e;return"lit"===r?s.length>0:v.test(s)}function T(t,e,r){if(!w(r))return null;const[,s,n]=g.exec(r);return new D(t,e,s,n)}var k,A,O,J;!function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(k||(k={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(A||(A={}));class M{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW yyyy",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t}setDateFormatShort(t){this.dateFormatShort=t}setLocale(t){this.locale=t}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,e){switch(e){case k.DAY:return this.getFormatedDayDate(t);case k.MONTH:return this.getFormatedMonthDate(t);case k.QUARTER:return this.getFormatedQuarterDate(t);case k.WEEK:return this.getFormatedWeekDate(t);case k.HOUR:return this.getFormatedHourDate(t);case k.MINUTE:return this.getFormatedMinuteDate(t);case k.SECOND:return this.getFormatedSecondDate(t);case k.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,e)}}calculateDistanceType(t,e,r=32){if(null==e)return k.DAY;const s="number"==typeof t?n.fromMillis(t):t,a="number"==typeof e?n.fromMillis(e):e;return 0===a.diff(s).as("milliseconds")?k.DAY:a.diff(s).as("milliseconds")<r?k.MILLISECOND:a.diff(s).as("seconds")<r?k.SECOND:a.diff(s).as("minutes")<r?k.MINUTE:a.diff(s).as("hours")<r?k.HOUR:a.diff(s).as("days")<r?k.DAY:a.diff(s).as("weeks")<r?k.WEEK:a.diff(s).as("months")<r?k.MONTH:a.diff(s).as("quarters")<r?k.QUARTER:k.YEAR}datesBetween(t,e,r,s){const n=this.convertDateDistanceToMomentunitOfTime(r),a=t.startOf(n),i=e.endOf(n);let o=i.diff(a).as(n);const u=[];o>=s&&(o=s);let c=a;do{u.push(c),c=c.plus(this.createDiratonLike(n,1))}while(c<=i&&u.length<o);return u}getDateLinkString(t,e,r,s,a){if(null==t&&null==e)return"";if(null==t&&r!==A.END&&r!==A.YTD)return"";if(null==e&&(A.INTERVAL===r||A.CUM===r||A.END===r||A.YTD===r))return"";const i=t||n.now(),o=e;s===k.AUTO&&(s=this.calculateDistanceType(i,o,a));let u=this.getDateString(i,s),c="",l=A.NONE;return null!=o&&(c=this.getDateString(o,s),l=A.INTERVAL,u===c&&r===A.INTERVAL&&(r=A.NONE),u===c&&r===A.AVG&&(l=A.NONE),A.END!==r&&A.YTD!==r||(u=c),(r===A.INTERVAL||r===A.CUM||A.AVG)&&(s===k.QUARTER?i.quarter===o.quarter&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):s===k.MONTH?i.month===o.month&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):s===k.WEEK&&(i.weekNumber===o.weekNumber&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,""))))),this.dateLinkFormat[r].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",u).replace("[DATE2]",c)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let e;switch(t){case k.YEAR:e="year";break;case k.MONTH:e="month";break;case k.QUARTER:e="quarter";break;case k.WEEK:e="week";break;case k.DAY:e="day";break;case k.HOUR:e="hour";break;case k.MINUTE:e="minute";break;case k.SECOND:e="second";break;case k.MILLISECOND:e="millisecond";break;default:e="day"}return e}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}class F{static adaptDefaultString(t){return o.isString(t)?t.trim():""}static adaptArray(t,e){const r=[];return o.isArray(t)&&t.forEach((t=>{r.push(e.adapt(t))})),r}}!function(t){t.ASC="asc",t.DESC="desc"}(O||(O={})),function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(J||(J={}));class E{constructor(t=["category"],e=O.ASC){this.hierarchy=t,this.direction=e}}class L{constructor(t){this.stringAdapter=t}adapt(t){var e;const r=F.adaptArray(t.hierarchy,this.stringAdapter),s=O[null===(e=t.direction)||void 0===e?void 0:e.toUpperCase()]||O.ASC;return new E(r.map((t=>J[t.toUpperCase()]||J.CATEGORY)),s)}default(){return new E(["category"],O.ASC)}}function I(t){return null==t||""===t||"null"===t}function $(t){return I(t)||"auto"===t.trim().toLowerCase()?[]:j((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in u)))).toString())}function j(t){return I(t)?[]:t.replace(";",",").split(",").filter((t=>{var e,r,s;const n=t.split("_"),a=null===(e=n[0])||void 0===e?void 0:e.replace(/^dr|^d/,"").toUpperCase().trim(),i=null===(r=n[1])||void 0===r?void 0:r.toUpperCase().trim(),o=null===(s=n[2])||void 0===s?void 0:s.toUpperCase().trim();return 3!==n.length||!(a in u)||!(i in u)||!(o in c)}))}function q(t){return I(t)?[]:j(t.split(",").filter((t=>!(t.toUpperCase().trim()in u))).toString())}function x(t){return I(t)||"auto"===t.trim().toLowerCase()?[]:j(t.split(",").filter((t=>!(t.toUpperCase()in J))).toString())}function _(t){return!I(t)&&Number.isInteger(Number(t))}function C(t){return!I(t)&&!Number.isNaN(Number(t))}function G(t){return!I(t)&&(null==t?void 0:t.toUpperCase())in O}function W(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in l}function z(t){if(I(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("name")&&t.hasOwnProperty("unit"))))}catch(t){console.error("validateMeasureList: failed to parse JSON",t)}return["Invalid JSON structure"]}function K(t){const e=Date.parse(t);return Number.isInteger(e)}function B(t){return(null==t?void 0:t.toUpperCase())in A}function Q(t){return(null==t?void 0:t.toUpperCase())in k}function H(t){return(null==t?void 0:t.toUpperCase())in d}function P(t){return!I(t)&&(null==t?void 0:t.toUpperCase())in m}function Z(t){return!I(t)&&["true","false",!0,!1].some((e=>e===t))}function Y(t){return!I(t)&&(null==t?void 0:t.toUpperCase())in f}function R(t){if(I(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category")&&t.hasOwnProperty("subCategory"))))}catch(t){console.error("validateThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function V(t){if(I(t))return[];try{const e=JSON.parse(t);if(null!==e&&"object"==typeof e&&!(e instanceof Array))return Object.entries(e).filter((([,t])=>"string"!=typeof t||!w(t))).map((([t,e])=>`${t}: ${e}`))}catch(t){console.error("validateAttributesJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function X(t){if(I(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category"))))}catch(t){console.error("validatePartOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function U(t){return(null==t?void 0:t.trim().toUpperCase())in y}function tt(t){return["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function et(t){return(null==t?void 0:t.toUpperCase().trim())in p}function rt(t){return(null==t?void 0:t.toUpperCase().trim())in h}function st(t){if(I(t))return[];try{return JSON.parse(t).filter((t=>!(t.hasOwnProperty("scenario")&&t.hasOwnProperty("name")&&t.hasOwnProperty("subGroups"))))}catch(t){console.error("validateColumnThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function nt(t){if(I(t))return[];try{const e=JSON.parse(t);if("object"!=typeof e||null===e||Array.isArray(e))return["stack: must be a JSON object"];const r=[];if(e.hasOwnProperty("by")){const t=["scenarios","dimensions"];t.includes(e.by)||r.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else r.push("stack: 'by' is required");if(e.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(e.mode)||r.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(e.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(e.order)||r.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return r}catch(t){return["stack: invalid JSON"]}}function at(t){return!I(t)&&null!==b(t)}class it{constructor(){this.cache=new Map,this.tag=it.makeStyleTag()}static makeStyleTag(){const t=document.createElement("style");return t.type="text/css",t.setAttribute("data-bn-computed-style",""),t.append(document.createTextNode("")),(document.head||document.querySelector("head")).append(t),t}apply(t){t.forEach((t=>this.cache.set(t.className,t.style))),this.tag.innerHTML=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const ot=new it;function ut(t){for(var e,r=0,s=0,n=t.length;n>=4;++s,n-=4)e=1540483477*(65535&(e=255&t.charCodeAt(s)|(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(++s))<<24))+(59797*(e>>>16)<<16),r=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(n){case 3:r^=(255&t.charCodeAt(s+2))<<16;case 2:r^=(255&t.charCodeAt(s+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(s)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}const ct=t=>C(t)?`${t}px`:t,lt={width:{className:"w",cssName:"width",attrName:"width",transform:ct},height:{className:"h",cssName:"height",attrName:"height",transform:ct},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:ct},right:{className:"rgt",cssName:"right",attrName:"right",transform:ct},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:ct},left:{className:"lft",cssName:"left",attrName:"left",transform:ct},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:ct},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},dt=Object.keys(lt);function ht(t,e){const r=function(t,e){const r=ut(e);return`bn-c-${t.className}_${r}`}(t,e),s=function(t,e,r){return`.${e} {${t.cssName}: ${r};}`}(t,r,e);return{className:r,style:s}}const mt=t=>{const e=new Map;return dt.forEach((r=>{const s=t.getAttribute(r);s&&(["top","left","right","bottom"].includes(r)&&e.set("position",ht(lt.position,"absolute")),e.set(r,ht(lt[r],(lt[r].transform||function(t){return t})(s))))})),e},ft=new MutationObserver((t=>{for(const r of t){const t=r.target,s=mt(t);ot.apply(s);const n=Array.from(s.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...n).join(" "),e(t)}})),yt=e=>{const r=e.connectedCallback,s=e.disconnectedCallback;e.connectedCallback=()=>{const s=t(e);if(!s)throw new Error("Can't find element field in component undefined");(t=>{const e=mt(t);ot.apply(e);const r=Array.from(e.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...r).join(" "),ft.observe(t,{attributes:!0,attributeFilter:dt,childList:!1,subtree:!1})})(s),a(r,e)},e.disconnectedCallback=()=>{a(s,e)}};export{et as A,st as B,V as C,k as D,T as E,z as F,K as G,B as H,A as I,F as J,L as K,O,_ as a,N as b,at as c,Z as d,C as e,j as f,W as g,x as h,I as i,G as j,tt as k,nt as l,J as m,Q as n,H as o,ut as p,M as q,q as r,rt as s,P as t,Y as u,$ as v,yt as w,R as x,X as y,U as z}
|