@bino-bi/bn-template-engine 1.0.0-alpha.4 → 1.0.0-alpha.6
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-06946f44.entry.js +1 -0
- package/dist/bn-template-engine/p-0fabe296.entry.js +1 -0
- package/dist/bn-template-engine/p-1164c0b0.entry.js +1 -0
- package/dist/bn-template-engine/p-355abdf0.entry.js +1 -0
- package/dist/bn-template-engine/p-79KuA4Ox.js +1 -0
- package/dist/bn-template-engine/p-859cc06d.entry.js +1 -0
- package/dist/bn-template-engine/p-8acec99e.entry.js +1 -0
- package/dist/bn-template-engine/p-8f490c45.entry.js +1 -0
- package/dist/bn-template-engine/p-98cf512f.entry.js +1 -0
- package/dist/bn-template-engine/p-9a564f8f.entry.js +1 -0
- package/dist/bn-template-engine/{p-CL1RYuNU.js → p-B0lsgVuN.js} +1 -1
- package/dist/bn-template-engine/p-B7p8beYH.js +1 -0
- package/dist/bn-template-engine/p-BDh7GfC5.js +1 -0
- package/dist/bn-template-engine/p-BoMtoHJB.js +1 -0
- package/dist/bn-template-engine/p-Bs8BqBsb.js +1 -0
- package/dist/bn-template-engine/p-CYjZRKdI.js +1 -0
- package/dist/bn-template-engine/{p-P7pGJBgc.js → p-DG-1MR_T.js} +1 -1
- package/dist/bn-template-engine/p-bdd2b243.entry.js +1 -0
- package/dist/bn-template-engine/p-e6b24f15.entry.js +1 -0
- package/dist/bn-template-engine/p-f27995c9.entry.js +1 -0
- package/dist/bn-template-engine/{p-Bnhh02CF.js → p-sRO-lj7X.js} +1 -1
- package/dist/bn-template-engine/p-tzFCK9qn.js +1 -0
- package/dist/cjs/{Order-iG11HI4R.js → Order-BGx39pS5.js} +448 -0
- package/dist/cjs/{alasql.min-C_nHTuEQ.js → SVGVariancesStyleGroup-BqAdPYtL.js} +8228 -3
- package/dist/cjs/bn-asset_16.cjs.entry.js +9018 -0
- package/dist/cjs/bn-card.cjs.entry.js +3 -4
- package/dist/cjs/bn-chart-time.cjs.entry.js +11 -16
- package/dist/cjs/bn-grid.cjs.entry.js +5 -8
- package/dist/cjs/bn-image.cjs.entry.js +5 -8
- package/dist/cjs/bn-internationalization.cjs.entry.js +3 -4
- package/dist/cjs/bn-layout-card.cjs.entry.js +125 -6
- package/dist/cjs/bn-template-engine.cjs.js +1 -1
- package/dist/cjs/bn-template.cjs.entry.js +2 -3
- package/dist/cjs/bn-text.cjs.entry.js +7 -11
- package/dist/cjs/bn-tree.cjs.entry.js +5 -8
- package/dist/cjs/{formatter-DIJL_crx.js → formatter-4XCS0d2B.js} +8 -2
- package/dist/cjs/ibcs-chart-time.cjs.entry.js +37 -42
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{scaling-9Tz595RQ.js → scaling-BidPsO53.js} +115 -12
- package/dist/cjs/{withBodyObserver-CKpSD8UT.js → withBodyObserver-C6gLgq_e.js} +3 -3
- package/dist/cjs/{withComponentStatus-Bw70BhO0.js → withComponentStatus-_x4LQZ0N.js} +5 -5
- package/dist/cjs/{withComponentStyle-aIbTCtfj.js → withComponentStyle-ClSJfCku.js} +4 -4
- package/dist/cjs/{utils-CwHIVbbL.js → withHasError-B8gHkfV2.js} +69 -1
- package/dist/cjs/{withStyled-CS1Yp4sv.js → withStyled-9tG024gQ.js} +62 -9
- package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +11 -0
- package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +5 -2
- package/dist/collection/components/bn-layout-card/bn-layout-card.css +1 -0
- package/dist/collection/components/bn-layout-card/bn-layout-card.js +162 -27
- package/dist/collection/components/bn-layout-page/bn-layout-page.css +1 -0
- package/dist/collection/components/bn-layout-page/bn-layout-page.js +151 -33
- package/dist/collection/components/bn-table/bn-table.js +12 -10
- package/dist/collection/components/bn-table/ibcs-table.js +2 -2
- package/dist/collection/utils/parentDimensions.js +38 -6
- package/dist/components/bn-layout-card.js +1 -1
- package/dist/components/bn-layout-page.js +1 -1
- package/dist/components/bn-table.js +1 -1
- package/dist/components/ibcs-chart-structure2.js +1 -1
- package/dist/components/ibcs-table2.js +1 -1
- package/dist/components/scaling.js +1 -1
- package/dist/esm/{Order-Bnhh02CF.js → Order-sRO-lj7X.js} +448 -1
- package/dist/esm/{alasql.min-CWu4NkIt.js → SVGVariancesStyleGroup-DOIT-zvI.js} +8212 -2
- package/dist/esm/bn-asset_16.entry.js +9001 -0
- package/dist/esm/bn-card.entry.js +4 -5
- package/dist/esm/bn-chart-time.entry.js +8 -13
- package/dist/esm/bn-grid.entry.js +6 -9
- package/dist/esm/bn-image.entry.js +6 -9
- package/dist/esm/bn-internationalization.entry.js +4 -5
- package/dist/esm/bn-layout-card.entry.js +126 -7
- package/dist/esm/bn-template-engine.js +1 -1
- package/dist/esm/bn-template.entry.js +2 -3
- package/dist/esm/bn-text.entry.js +7 -11
- package/dist/esm/bn-tree.entry.js +6 -9
- package/dist/esm/{context-protocol-BHnQsVsr.js → context-protocol-2peaD4y8.js} +1 -1
- package/dist/esm/editor-companion.entry.js +1 -1
- package/dist/esm/{formatter-DTMEZ6d8.js → formatter-BDh7GfC5.js} +6 -2
- package/dist/esm/ibcs-chart-time.entry.js +3 -8
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{scaling-Cehc74IE.js → scaling-BOcjT8M0.js} +112 -10
- package/dist/esm/{withBodyObserver-FQ8NwCIz.js → withBodyObserver-DczL5ia8.js} +1 -1
- package/dist/esm/{withComponentStatus-DWjDYtZ7.js → withComponentStatus-DodoSXe-.js} +1 -1
- package/dist/esm/{withComponentStyle-9uP_hcDq.js → withComponentStyle-D3VWOsto.js} +2 -2
- package/dist/esm/{utils-DvvwfRQG.js → withHasError-B3QX2emi.js} +69 -1
- package/dist/esm/{withStyled--qQWquTH.js → withStyled-CE3_3taP.js} +57 -5
- package/dist/types/components/bn-chart-structure/utils/elements/Label.d.ts +2 -0
- package/dist/types/components/bn-layout-card/bn-layout-card.d.ts +139 -0
- package/dist/types/components/bn-layout-page/bn-layout-page.d.ts +154 -0
- package/dist/types/components/bn-table/bn-table.d.ts +7 -5
- package/dist/types/components.d.ts +170 -2
- package/dist/types/utils/parentDimensions.d.ts +6 -1
- package/package.json +1 -1
- package/dist/bn-template-engine/p-1265d8d3.entry.js +0 -1
- package/dist/bn-template-engine/p-15516dac.entry.js +0 -1
- package/dist/bn-template-engine/p-1c716641.entry.js +0 -1
- package/dist/bn-template-engine/p-1jFf17Vj.js +0 -1
- package/dist/bn-template-engine/p-27cc8dc0.entry.js +0 -1
- package/dist/bn-template-engine/p-4426d484.entry.js +0 -1
- package/dist/bn-template-engine/p-51f8dc9e.entry.js +0 -1
- package/dist/bn-template-engine/p-53d4e690.entry.js +0 -1
- package/dist/bn-template-engine/p-5KQYRQLK.js +0 -1
- package/dist/bn-template-engine/p-745f4596.entry.js +0 -1
- package/dist/bn-template-engine/p-75e97c87.entry.js +0 -1
- package/dist/bn-template-engine/p-7a560278.entry.js +0 -1
- package/dist/bn-template-engine/p-7ea7c325.entry.js +0 -1
- package/dist/bn-template-engine/p-945cc95d.entry.js +0 -1
- package/dist/bn-template-engine/p-BFTU3MAI.js +0 -1
- package/dist/bn-template-engine/p-BYBpC0EO.js +0 -1
- package/dist/bn-template-engine/p-BYmPQYxx.js +0 -1
- package/dist/bn-template-engine/p-BfXY5dsy.js +0 -1
- package/dist/bn-template-engine/p-BgnHJQ9Q.js +0 -1
- package/dist/bn-template-engine/p-Bhd_WSML.js +0 -1
- package/dist/bn-template-engine/p-Bka-Z6jo.js +0 -1
- package/dist/bn-template-engine/p-C7dQL8CS.js +0 -1
- package/dist/bn-template-engine/p-CYwd_ZNM.js +0 -1
- package/dist/bn-template-engine/p-ChlK-T9I.js +0 -1
- package/dist/bn-template-engine/p-DHezf8pZ.js +0 -1
- package/dist/bn-template-engine/p-DlppAFq9.js +0 -1
- package/dist/bn-template-engine/p-DvDDgmcV.js +0 -1
- package/dist/bn-template-engine/p-DvvwfRQG.js +0 -1
- package/dist/bn-template-engine/p-b34eaf86.entry.js +0 -1
- package/dist/bn-template-engine/p-bdb8b44c.entry.js +0 -1
- package/dist/bn-template-engine/p-c44fcb8e.entry.js +0 -1
- package/dist/bn-template-engine/p-c7e1a49b.entry.js +0 -1
- package/dist/bn-template-engine/p-d9003041.entry.js +0 -1
- package/dist/bn-template-engine/p-daa7ffa3.entry.js +0 -1
- package/dist/bn-template-engine/p-e084f50a.entry.js +0 -1
- package/dist/bn-template-engine/p-eaba6658.entry.js +0 -1
- package/dist/bn-template-engine/p-u8igQLRZ.js +0 -1
- package/dist/cjs/DataFormatDigits-DKcOeLNK.js +0 -142
- package/dist/cjs/DateStringFactory-CSKvbS8K.js +0 -452
- package/dist/cjs/SVGVariancesStyleGroup-K-Tw6lOD.js +0 -7960
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +0 -10
- package/dist/cjs/bn-asset.cjs.entry.js +0 -42
- package/dist/cjs/bn-body_4.cjs.entry.js +0 -748
- package/dist/cjs/bn-chart-structure_5.cjs.entry.js +0 -3934
- package/dist/cjs/bn-component-style.cjs.entry.js +0 -44
- package/dist/cjs/bn-dataset.cjs.entry.js +0 -306
- package/dist/cjs/bn-layout-page.cjs.entry.js +0 -143
- package/dist/cjs/bn-message.cjs.entry.js +0 -52
- package/dist/cjs/bn-table.cjs.entry.js +0 -979
- package/dist/cjs/contentDecoder-JxOldq1e.js +0 -419
- package/dist/cjs/emotion-hash.esm-nbbEQ0Dn.js +0 -57
- package/dist/cjs/ibcs-table.cjs.entry.js +0 -2276
- package/dist/cjs/ibcsRuleSet-DgUoXOfd.js +0 -136
- package/dist/cjs/index-Dm85hG6t.js +0 -65
- package/dist/cjs/withHasError-D7ue5vAv.js +0 -72
- package/dist/cjs/withTranslation-rwgyITqe.js +0 -77
- package/dist/esm/DataFormatDigits-oSZ1hBKE.js +0 -137
- package/dist/esm/DateStringFactory-CSGz6TDk.js +0 -450
- package/dist/esm/SVGVariancesStyleGroup-CqTjrZYg.js +0 -7950
- package/dist/esm/_commonjsHelpers-BFTU3MAI.js +0 -7
- package/dist/esm/bn-asset.entry.js +0 -40
- package/dist/esm/bn-body_4.entry.js +0 -743
- package/dist/esm/bn-chart-structure_5.entry.js +0 -3928
- package/dist/esm/bn-component-style.entry.js +0 -42
- package/dist/esm/bn-dataset.entry.js +0 -304
- package/dist/esm/bn-layout-page.entry.js +0 -141
- package/dist/esm/bn-message.entry.js +0 -50
- package/dist/esm/bn-table.entry.js +0 -977
- package/dist/esm/contentDecoder-oMmxz6nJ.js +0 -416
- package/dist/esm/emotion-hash.esm-BYBpC0EO.js +0 -55
- package/dist/esm/ibcs-table.entry.js +0 -2274
- package/dist/esm/ibcsRuleSet-K4ytuA1f.js +0 -133
- package/dist/esm/index-DHezf8pZ.js +0 -65
- package/dist/esm/withHasError-FyY5mQ_3.js +0 -70
- package/dist/esm/withTranslation-BqD0Kp7b.js +0 -75
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,H as s,g as e}from"./p-JNHhIe7t.js";import{v as h,a as n,i as r,c as a,d as o,e as l,b as c,j as d,k as u,g as p,w as f,l as g}from"./p-Bka-Z6jo.js";import{w as v,g as m,p as w}from"./p-DlppAFq9.js";import{w as b}from"./p-BfXY5dsy.js";import{w as y}from"./p-BgnHJQ9Q.js";import{a as S,b as x,g as P}from"./p-CL1RYuNU.js";import{w as k}from"./p-DvDDgmcV.js";import{w as L}from"./p-C7dQL8CS.js";import{j as O,O as _,a as M,S as T,b as R,c as C,f as A,g as $,l as E}from"./p-Bnhh02CF.js";import{w as N}from"./p-P7pGJBgc.js";import{c as W,d as D}from"./p-CYwd_ZNM.js";import{S as U,g as B,a as Y,I as H,F as V,b as z,c as X,d as F,P as G}from"./p-u8igQLRZ.js";import{D as j,S as I,b as K}from"./p-5KQYRQLK.js";import{F as Q,C as J,V as Z}from"./p-1jFf17Vj.js";import{a as q}from"./p-BYmPQYxx.js";import{S as tt,I as it}from"./p-ChlK-T9I.js";import"./p-BYBpC0EO.js";import"./p-Bhd_WSML.js";import"./p-DvvwfRQG.js";import"./p-BFTU3MAI.js";const st=class{validateScenario(t){const i=h(t),s="ERR_scenarios";i.length>0?this.errors.addOrReplace({id:s,type:"warning",message:"scenarios: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(s)}validateVariances(t){const i="ERR_variances",s=n(t);s.length>0?this.errors.addOrReplace({id:i,type:"warning",message:"variances: invalid value(s) '"+JSON.stringify(s)+"' are not supported."}):this.errors.remove(i)}validateUnitScaling(t){const i="ERR_unitScaling";r(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"unitScaling: invalid value(s) '"+t+"' are not supported."})}validatePercentageScaling(t){const i="ERR_percentageScaling";r(t)||this.pixelPerUnitGroupMap.has(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"percentageScaling: invalid value(s) '"+t+"' are not supported."})}validateLevel(t){const i="ERR_level";a(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"level: invalid value(s) '"+t+"' are not supported."})}validateOrderList(t){const i=o(t),s="ERR_order";i.length>0?this.errors.addOrReplace({id:s,type:"warning",message:"order: invalid value(s) '"+JSON.stringify(i)+"' are not supported."}):this.errors.remove(s)}validateOrderDirection(t){const i="ERR_orderDirection";l(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"orderDirection: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateLimit(t){const i="ERR_limit";c(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"limit: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateShowCategories(t){const i="ERR_showCategories";d(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showCategories: invalid value(s) '"+(null==t?void 0:t.toString())+"' are not supported."})}validateMeasureScale(t){const i="ERR_measureScale";u(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"measureScale: invalid value '"+(null==t?void 0:t.toString())+"' is not supported."})}validateShowMeasureScale(t){const i="ERR_grouped";d(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:"showMeasureScale: invalid value(s) '"+(null==t?void 0:t.toString())+"' are not supported."})}validateStack(t){const i="ERR_stack",s=p(t);s.length>0?this.errors.addOrReplace({id:i,type:"warning",message:s.join("; ")}):this.errors.remove(i)}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("ERR_scale");const i=Number(t);isNaN(i)||i<=0?this.errors.addOrReplace({id:"ERR_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("ERR_scale")}constructor(i){t(this,i),this.data=[],this.datasetMeta=null,this.appliedScaleFactor=1,this.chartTitle="",this.filter="",this.limit=0,this.showCategories="true",this.measureScale="greatest",this.showMeasureScale="false",this.measureUnit="",this.stack="",this.scenariosArray=[""],this.pixelPerUnitGroupMap=new Map,this._autoScaleGuard=!1,f(this),b(this),v(this,((t,i)=>{this.data=i||[]}),((t,i)=>{this.datasetMeta=i})),this.chartTemplate=this.chartTemplate.bind(this),this.errors=L(this),this.componentStyle=k(this),this.t=y(this).t}componentWillLoad(){this.validateScenario(this.scenarios),this.validateVariances(this.variances),this.validateUnitScaling(this.unitScaling),this.validateLevel(this.level),this.validateOrderDirection(this.orderDirection),this.validateOrderList(this.order),this.validateShowCategories(this.showCategories),this.validateMeasureScale(this.measureScale),this.validateShowMeasureScale(this.showMeasureScale),this.validateStack(this.stack),this.validateScaling(this.scale)}componentDidRender(){var t,i;const{mode:s}=w(this.scale);if("auto"!==s&&"empty"!==s)return this._autoScaleGuard=!1,void this.checkWidthOverflow();if(this._autoScaleGuard)return this._autoScaleGuard=!1,void this.checkWidthOverflow();const e=this.element,{height:h}=m(e);if(h<=0)return void this.checkWidthOverflow();const n=this.componentStyle((t=>{var i;return(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}));e.style.setProperty("--bn-font-size",`${n}px`);const r=null===(t=e.shadowRoot)||void 0===t?void 0:t.querySelector(".container"),a=null!==(i=null==r?void 0:r.scrollHeight)&&void 0!==i?i:e.scrollHeight;if(a<=h+1)return this.errors.remove("AUTO_scale"),1!==this.appliedScaleFactor&&(this._autoScaleGuard=!0,this.appliedScaleFactor=1),void this.checkWidthOverflow();const o=(h-1)/a;e.style.setProperty("--bn-font-size",n*o+"px"),"empty"===s?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled chart by factor ${o.toFixed(3)}`}):this.errors.remove("AUTO_scale"),Math.abs(o-this.appliedScaleFactor)>.001&&(this._autoScaleGuard=!0,this.appliedScaleFactor=o),this.checkWidthOverflow()}checkWidthOverflow(){var t;const i="WARN_overflow",s=String(null!==(t=this.unitScaling)&&void 0!==t?t:"").trim().toLowerCase();if(""===s||"auto"===s)return void this.errors.remove(i);const e=m(this.element);e.width>0&&this.element.scrollWidth>e.width+1?this.errors.addOrReplace({id:i,type:"error",message:`Chart exceeds available width (${this.element.scrollWidth}px > ${Math.round(e.width)}px). Reduce unit-scaling or set to "auto".`}):this.errors.remove(i)}prepareDimension(){const t=m(this.element);return this.canvasWidthSegmented=t.width/this.scenariosArray.length,{width:this.canvasWidthSegmented,height:t.height}}prepareScenarios(){var t,i,s,e;const h="auto"===(null===(t=this.scenarios)||void 0===t?void 0:t.trim().toLowerCase());return g(this.scenarios)||h?(null===(s=null===(i=this.datasetMeta)||void 0===i?void 0:i.availableScenarios)||void 0===s?void 0:s.length)>0?(h?this.errors.remove("AUTO_scenarios"):this.errors.addOrReplace({id:"AUTO_scenarios",type:"warning",message:`scenarios: not set, auto-detected: ${this.datasetMeta.availableScenarios.join(",")}`}),this.datasetMeta.availableScenarios):[]:(this.errors.remove("AUTO_scenarios"),null===(e=this.scenarios)||void 0===e?void 0:e.split(",").map((t=>t.trim())))}prepareVariances(){var t;return g(this.variances)?[]:null===(t=this.variances)||void 0===t?void 0:t.split(",").map((t=>t.trim()))}prepareHideCategories(t){return t>=1||"true"!==this.showCategories}prepareI18n(){const t=S,i=new Map([].map((t=>[t,this.t(".".concat(t))]))),s=new Map(t.map((t=>[t,this.t("global.".concat(t))])));return new Map([...s.entries(),...i.entries()])}preparePixelPerUnit(){var t;if(this.pixelPerUnitGroupMap.has(this.unitScaling))return this.errors.remove("AUTO_unitScaling"),this.pixelPerUnitGroupMap.get(this.unitScaling);if("auto"===(null===(t=this.unitScaling)||void 0===t?void 0:t.toString().trim().toLowerCase()))return this.errors.remove("AUTO_unitScaling"),0;const i=Number(this.unitScaling);return!isNaN(i)&&i>0?(this.errors.remove("AUTO_unitScaling"),i):(this.errors.addOrReplace({id:"AUTO_unitScaling",type:"warning",message:"unit-scaling: not set, auto-calculated to fit available space."}),0)}preparePixelPerPercentage(){return this.pixelPerUnitGroupMap.has(this.percentageScaling)?this.pixelPerUnitGroupMap.get(this.percentageScaling):100*Number(this.percentageScaling)}prepareLevel(){var t,i,s;const e="auto"===(null===(t=this.level)||void 0===t?void 0:t.trim().toLowerCase());return g(this.level)||e?(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedLevel)?(e?this.errors.remove("AUTO_level"):this.errors.addOrReplace({id:"AUTO_level",type:"warning",message:`level: not set, auto-detected: ${this.datasetMeta.suggestedLevel}`}),O[this.datasetMeta.suggestedLevel.toUpperCase()]):void 0:(this.errors.remove("AUTO_level"),O[null===(s=this.level)||void 0===s?void 0:s.toUpperCase()])}prepareOrder(){var t,i,s;const e="auto"===(null===(t=this.order)||void 0===t?void 0:t.trim().toLowerCase());let h;return g(this.order)||e?(null===(i=this.datasetMeta)||void 0===i?void 0:i.suggestedOrder)?(e?this.errors.remove("AUTO_order"):this.errors.addOrReplace({id:"AUTO_order",type:"warning",message:`order: not set, auto-detected: ${this.datasetMeta.suggestedOrder}`}),h=this.datasetMeta.suggestedOrder):h=this.order:(this.errors.remove("AUTO_order"),h=this.order),{hierarchy:null==h?void 0:h.split(",").map((t=>M[null==t?void 0:t.toUpperCase()])),direction:_[null===(s=this.orderDirection)||void 0===s?void 0:s.toUpperCase()]}}prepareStyle(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{const s=i.global.fontSizePx*t;return{scaleFactors:{scenarioOffset:i["bn-chart-structure"].scaleFactors.scenarioOffset,scenarioLabelToBar:i["bn-chart-structure"].scaleFactors.scenarioLabelToBar,labelToBar:i["bn-chart-structure"].scaleFactors.labelToBar,labelToAxis:i["bn-chart-structure"].scaleFactors.labelToAxis,needleWidth:i["bn-chart-structure"].scaleFactors.needleWidth,needleHeadWidth:i["bn-chart-structure"].scaleFactors.needleHeadWidth,barWidth:i["bn-chart-structure"].scaleFactors.barWidth,varianceAxisLineWidth:i["bn-chart-structure"].scaleFactors.varianceAxisLineWidth,axisLineWidth:i["bn-chart-structure"].scaleFactors.axisLineWidth,auxiliaryLineWidth:i["bn-chart-structure"].scaleFactors.auxiliaryLineWidth,scenarioLineWidth:i["bn-chart-structure"].scaleFactors.scenarioLineWidth,markerWidth:i["bn-chart-structure"].scaleFactors.markerWidth,markerOffset:i["bn-chart-structure"].scaleFactors.markerOffset,categoryWidth:i["bn-chart-structure"].scaleFactors.categoryWidth,axisTickLength:i["bn-chart-structure"].scaleFactors.axisTickLength},fontStyles:{font:`${s}px ${i.global.fontFamily}`,size:s,color:i.global.fontColor,background:i.global.fontBackgroundColor,leading:1.8},axisStyles:i["bn-chart-structure"].axisStyles,barStyles:i["bn-chart-structure"].barStyles,varianceStyles:i["bn-chart-structure"].varianceStyles,padding:i["bn-chart-structure"].padding,pattern:null}}))}prepareChartTitle(t){return t>=1?"":this.chartTitle}prepareStackConfig(){if(g(this.stack))return this.errors.remove("WARN_stack_dimensions_scenarios"),null;try{const t=JSON.parse(this.stack),i=t.by,s="WARN_stack_dimensions_scenarios";if(i===T.DIMENSIONS){const t=this.prepareScenarios();t.length>1?this.errors.addOrReplace({id:s,type:"warning",message:`stack by dimensions: only the first scenario "${t[0]}" is used, the rest (${t.slice(1).join(", ")}) are discarded.`}):this.errors.remove(s)}else this.errors.remove(s);return{by:i,mode:t.mode||C.ABSOLUTE,order:t.order||R.DATASET}}catch(t){return this.errors.remove("WARN_stack_dimensions_scenarios"),null}}prepareFilter(){return 0===this.filter.length?"":this.filter}prepareLimit(){return Math.floor(Number(this.limit)||0)}getDataStructure(){return{IStructureChartDataRow:{operation:{type:"string",isOptional:!1,description:""},rowGroup:{type:"string",isOptional:!1,description:""},rowGroupIndex:{type:"number",isOptional:!1,description:""},category:{type:"string",isOptional:!1,description:""},categoryIndex:{type:"number",isOptional:!1,description:""},subCategory:{type:"string",isOptional:!1,description:""},subCategoryIndex:{type:"number",isOptional:!1,description:""},columnGroup:{type:"string",isOptional:!1,description:""},columnGroupIndex:{type:"number",isOptional:!1,description:""},columnSubGroup:{type:"string",isOptional:!1,description:""},columnSubGroupIndex:{type:"number",isOptional:!1,description:""},ac1:{type:"number",isOptional:!1,description:""},ac2:{type:"number",isOptional:!1,description:""},ac3:{type:"number",isOptional:!1,description:""},ac4:{type:"number",isOptional:!1,description:""},pp1:{type:"number",isOptional:!1,description:""},pp2:{type:"number",isOptional:!1,description:""},pp3:{type:"number",isOptional:!1,description:""},pp4:{type:"number",isOptional:!1,description:""},fc1:{type:"number",isOptional:!1,description:""},fc2:{type:"number",isOptional:!1,description:""},fc3:{type:"number",isOptional:!1,description:""},fc4:{type:"number",isOptional:!1,description:""},pl1:{type:"number",isOptional:!1,description:""},pl2:{type:"number",isOptional:!1,description:""},pl3:{type:"number",isOptional:!1,description:""},pl4:{type:"number",isOptional:!1,description:""}}}}prepareMeasureScale(){return g(this.measureScale)?"GREATEST":["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(this.measureScale.trim())||"LEAST"===this.measureScale.trim().toUpperCase()?this.measureScale.trim():"GREATEST"}prepareShowMeasureScale(t){return 0===t&&"true"===this.showMeasureScale}prepareMeasureUnit(){return""===this.measureUnit||null==this.measureUnit?"":this.measureUnit}chartTemplate(t,s){const e=this.getEffectiveScaleFactor(),h=this.preparePixelPerUnit(),n=this.preparePixelPerPercentage(),r=this.prepareStackConfig(),a=this.prepareScenarios(),o=(null==r?void 0:r.by)===T.DIMENSIONS?a.slice(0,1):a;return i("ibcs-chart-structure",{data:this.data,chartTitle:this.prepareChartTitle(s),scenarios:o,variances:[t],hideCategories:this.prepareHideCategories(s),pixelPerUnit:h>0?h*e:0,pixelPerPercentage:n>0?n*e:0,limit:this.prepareLimit(),styles:this.prepareStyle(),i18n:this.prepareI18n(),order:this.prepareOrder(),level:this.prepareLevel(),filter:this.prepareFilter(),"measure-scale":this.prepareMeasureScale(),"measure-unit":this.prepareMeasureUnit(),showMeasureScale:this.prepareShowMeasureScale(s),stackConfig:r,parentDimensions:this.prepareDimension()})}getEffectiveScaleFactor(){const{mode:t,factor:i}=w(this.scale);return"factor"===t?i:"auto"===t||"empty"===t?this.appliedScaleFactor:1}getFontStyles(){const t=this.getEffectiveScaleFactor();return this.componentStyle((i=>{var s,e,h,n;const r=(null===(s=i.global)||void 0===s?void 0:s.fontSizePx)||13.3333;return{"--bn-font-family":(null===(e=i.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":r*t+"px","--bn-font-color":(null===(h=i.global)||void 0===h?void 0:h.fontColor)||"#000000","--bn-font-background":(null===(n=i.global)||void 0===n?void 0:n.fontBackgroundColor)||"#ffffff"}}))}render(){let t=[""];const e=this.prepareVariances();e.length>0&&(t=[...t,...e]);const h=this.getFontStyles();return i(s,{key:"570fb741ddf481be0f3055d346314ad39a455361",style:h},i("div",{key:"e84cfe2e00dd2f960f038844e00449431efa6ce0",class:"container"},t.map(this.chartTemplate)))}get element(){return e(this)}static get watchers(){return{scenarios:[{validateScenario:0}],variances:[{validateVariances:0}],unitScaling:[{validateUnitScaling:0}],percentageScaling:[{validatePercentageScaling:0}],level:[{validateLevel:0}],order:[{validateOrderList:0}],orderDirection:[{validateOrderDirection:0}],limit:[{validateLimit:0}],showCategories:[{validateShowCategories:0}],measureScale:[{validateMeasureScale:0}],showMeasureScale:[{validateShowMeasureScale:0}],stack:[{validateStack:0}],scale:[{validateScaling:0}]}}};st.style=':host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:row}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}div{float:left}.warning{font-size:0.8em;font-style:italic}.footer{margin:0.2em;font-size:0.6em}.footer-hide{margin:0.2em;font-size:0.6em;opacity:0}';const et=class{constructor(i){t(this,i),this.currentPageUpdate=void 0,b(this),this.errors=L(this)}setLocale(t){this.stores.context.state.locale=t}connectedCallback(){this.stores=x(this.element),this.locale&&(this.stores.context.state.locale=this.locale),this.currentPageUpdate=setTimeout((()=>{this.element.querySelectorAll("bn-page, bn-layout-page").forEach(((t,i)=>{if("bn-layout-page"===t.localName)t.setAttribute("page-number",(i+1).toString());else{const s=t.querySelector("bn-footer");s&&s.setAttribute("page-number",(i+1).toString())}}))}),250)}disconnectedCallback(){this.currentPageUpdate&&clearTimeout(this.currentPageUpdate)}componentWillLoad(){}componentDidLoad(){}componentShouldUpdate(){}componentWillRender(){}componentDidRender(){}componentWillUpdate(){}componentDidUpdate(){}render(){return i(s,{key:"b92019b909e271225baca2cf740c8301e324164e"},i("slot",{key:"87bac4bb29bca32d961afe31355dc1bd48fff0f8"}))}get element(){return e(this)}static get watchers(){return{locale:[{setLocale:0}]}}};et.style=":host{display:block}";const ht=class{constructor(i){t(this,i),this.raw=!0,this.lastHash=null,b(this),this.errors=L(this),N(this,(t=>{this.stores||(this.stores=P(this.element));try{let i,s;if(this.raw)i=W(t),s=t;else{const e=D(t);i=e.hash,s=e.json}if(i===this.lastHash)return;this.lastHash=i;const e=JSON.parse(s);this.stores.datasources.set(this.name,e)}catch(i){console.error("Error parsing datasource",i,String(t).slice(0,200)),this.stores.datasources.set(this.name,[])}}))}render(){return i(s,{key:"43b691b07f63d12ad6c835dfb5d5bf6053b3bbf4"})}get element(){return e(this)}};ht.style="bn-datasource{display:none}";const nt=["xga","hd","full-hd","4k","4k2k","a4","a3","a2","a1","a0","letter","legal"],rt=["landscape","portrait"],at=class{constructor(i){t(this,i),b(this),this.errors=L(this),this.componentStyle=k(this)}validateFormat(t){const i="ERR_format";g(t)||nt.includes(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`format: invalid value '${t}' is not supported. Valid values: ${nt.join(", ")}`})}validateOrientation(t){const i="ERR_orientation";g(t)||rt.includes(t)?this.errors.remove(i):this.errors.addOrReplace({id:i,type:"warning",message:`orientation: invalid value '${t}' is not supported. Valid values: ${rt.join(", ")}`})}render(){return i(s,{key:"b4d682a8f6e83f77c58236265eaf9d1327809c6f",format:this.format,orientation:this.orientation,style:this.prepareStyle()},i("slot",{key:"ef49c43c1f8926c4c968b752608627adbe330d6c"}))}prepareStyle(){return{"font-family":this.componentStyle((t=>t.global.fontFamily)),"font-size":`${this.componentStyle((t=>t.global.fontSizePx))}px`,"--bn-font-family":this.componentStyle((t=>t.global.fontFamily))||"'Noto Sans', sans-serif","--bn-font-size":`${this.componentStyle((t=>t.global.fontSizePx))||13.3333}px`,"--bn-font-color":this.componentStyle((t=>t.global.fontColor))||"#000000","--bn-font-background":this.componentStyle((t=>t.global.fontBackgroundColor))||"#ffffff"}}get element(){return e(this)}static get watchers(){return{format:[{validateFormat:0}],orientation:[{validateOrientation:0}]}}};at.style=':host{background:var(--bn-font-background, white);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);height:768px;width:1024px;display:flex;flex-direction:column;page-break-after:always;overflow:hidden}:host([format=xga]){height:768px;width:1024px}:host([format=xga][orientation=portrait]){height:1024px;width:768px}:host([format=xga][orientation=landscape]){height:768px;width:1024px}:host([format=hd]){height:720px;width:1280px}:host([format=hd][orientation=portrait]){height:1280px;width:720px}:host([format=hd][orientation=landscape]){height:720px;width:1280px}:host([format=full_hd]){height:1080px;width:1920px}:host([format=full_hd][orientation=portrait]){height:1920px;width:1080px}:host([format=full_hd][orientation=landscape]){height:1080px;width:1920px}:host([format="4k"]){height:2160px;width:3840px}:host([format="4k"][orientation=portrait]){height:3840px;width:2160px}:host([format="4k"][orientation=landscape]){height:2160px;width:3840px}:host([format="4k2k"]){height:2160px;width:4096px}:host([format="4k2k"][orientation=portrait]){height:4096px;width:2160px}:host([format="4k2k"][orientation=landscape]){height:2160px;width:4096px}:host([format=a6]){height:5.83in;width:4.13in}:host([format=a6][orientation=portrait]){height:5.83in;width:4.13in}:host([format=a6][orientation=landscape]){height:4.13in;width:5.83in}:host([format=a5]){height:8.27in;width:5.83in}:host([format=a5][orientation=portrait]){height:8.27in;width:5.83in}:host([format=a5][orientation=landscape]){height:5.83in;width:8.27in}:host([format=a4]){height:11.6in;width:8.17in}:host([format=a4][orientation=portrait]){height:11.6in;width:8.17in}:host([format=a4][orientation=landscape]){height:8.17in;width:11.6in}:host([format=a3]){height:16.54in;width:11.7in}:host([format=a3][orientation=portrait]){height:16.54in;width:11.7in}:host([format=a3][orientation=landscape]){height:11.7in;width:16.54in}:host([format=a2]){height:23.4in;width:16.54in}:host([format=a2][orientation=portrait]){height:23.4in;width:16.54in}:host([format=a2][orientation=landscape]){height:16.54in;width:23.4in}:host([format=a1]){height:33.1in;width:23.4in}:host([format=a1][orientation=portrait]){height:33.1in;width:23.4in}:host([format=a1][orientation=landscape]){height:23.4in;width:33.1in}:host([format=a0]){height:46.8in;width:33.1in}:host([format=a0][orientation=portrait]){height:46.8in;width:33.1in}:host([format=a0][orientation=landscape]){height:33.1in;width:46.8in}:host([format=letter]){height:11in;width:8.5in}:host([format=letter][orientation=portrait]){height:11in;width:8.5in}:host([format=letter][orientation=landscape]){height:8.5in;width:11in}:host([format=legal]){height:14in;width:8.5in}:host([format=legal][orientation=portrait]){height:14in;width:8.5in}:host([format=legal][orientation=landscape]){height:8.5in;width:14in}:host([format=tabloid]){height:17in;width:11in}:host([format=tabloid][orientation=portrait]){height:17in;width:11in}:host([format=tabloid][orientation=landscape]){height:11in;width:17in}:host([format=ledger]){height:11in;width:17in}:host([format=ledger][orientation=portrait]){height:17in;width:11in}:host([format=ledger][orientation=landscape]){height:11in;width:17in}';class ot{constructor(t,i,s,e,h,n,r,a){this.categoryPosition={x:0,y:0},this.spacings={scenarioOffset:0,markerOffset:0,scenarioLabelToBar:0,labelToBar:0,labelToAxis:0,needleWidth:0,needleHeadWidth:0,barWidth:0,varianceAxisLineWidth:0,axisLineWidth:0,auxiliaryLineWidth:0,scenarioLineWidth:0,markerWidth:0,categoryWidth:0,axisTickLength:0},this.categoriesBoxOffset={width:0,height:0},this.padding=t,this.scaleFactors=i,this.fontSize=s,this.axisPosition={x:0,y:0},this.numberOfColumns=e,this.leftSideLengthSync=h,this.topSideLabelHeight=n>0?this.fontSize:0,this.leftSideLabelLength=this.calculateSideLabelLength(n,r,a),this.calculateSpacings(),this.calculateCategoryPosition(),this.calculateAxisPosition()}getBarPositionX(){return this.axisPosition.x}getBarCenterPositionY(t){return this.categoryPosition.y+this.spacings.scenarioOffset+t*this.spacings.categoryWidth}getBarPositionY(t,i){return i?this.getBarCenterPositionY(t):this.getBarCenterPositionY(t)-this.spacings.scenarioOffset}getCategoryPositionX(t){let i=this.spacings.labelToAxis;return t&&(i=-this.spacings.labelToAxis),this.getAxisPositionX()+i}getAxisTitlePositionX(){return this.axisPosition.x}getAxisTitlePositionY(){return this.axisPosition.y-this.spacings.labelToAxis}getNeedleWidth(){return this.spacings.needleWidth}getAxisPositionX(){return this.leftSideLabelLength+this.padding.left+this.spacings.labelToAxis}getAxisPositionY(){return this.padding.top+this.getAxisTitleOffset()}loadCategoriesBox(t){this.categoriesBoxOffset=t,this.calculateAxisPosition()}addOffsetByNegativeDataPoints(t,i,s,e){null!=t&&null!=t.value&&t.value<0&&(s&&t.isClipped()?this.axisPosition.x+=Math.abs(t.getClippedValue()*t.pixelPerUnit):this.axisPosition.x+=Math.abs(t.value*t.pixelPerUnit),this.axisPosition.x+=i,this.axisPosition.x+=this.spacings.labelToBar),this.axisPosition.x<e/2&&(this.axisPosition.x=e/2+this.spacings.labelToBar)}getLabelPositionX(t){let i=this.spacings.labelToBar;return t<0&&(i*=-1),this.axisPosition.x+t+i}getLabelPositionY(t){return this.axisPosition.y+t+this.spacings.labelToBar}getCategoryToAxisSpaceing(){return this.spacings.labelToAxis}getCategoryToTopSpaceing(){return this.spacings.scenarioOffset}getCategoryToBottomSpaceing(){return this.spacings.scenarioOffset}getAxisEndPositionY(){return this.getAxisPositionY()+(this.numberOfColumns+.5)*this.spacings.categoryWidth}getScenarioLabelPositionOffsetY(t){return t?.5*this.getBarWidth()+this.spacings.scenarioLabelToBar:-(.5*this.getBarWidth()+this.spacings.scenarioLabelToBar)}getBarWidth(){return this.spacings.barWidth}getMarkerPositionY(t,i){return i?this.getBarCenterPositionY(t)-this.spacings.markerOffset-.5*this.getBarWidth():this.getBarCenterPositionY(t)+this.spacings.markerOffset+.5*this.getBarWidth()}getMarkerPositionX(){return this.getBarPositionX()}getMarkerScenarioLabelPositionOffsetY(t){return t?-(.5*this.spacings.markerWidth+this.spacings.scenarioLabelToBar):this.spacings.scenarioLabelToBar+.5*this.spacings.markerWidth}getAxisEndPositionX(){return this.getAxisPositionX()}calculateSpacings(){this.spacings={scenarioOffset:this.fontSize*this.scaleFactors.scenarioOffset,markerOffset:this.fontSize*this.scaleFactors.markerOffset,scenarioLabelToBar:this.fontSize*this.scaleFactors.scenarioLabelToBar,labelToBar:this.fontSize*this.scaleFactors.labelToBar,labelToAxis:this.fontSize*this.scaleFactors.labelToAxis,needleWidth:this.fontSize*this.scaleFactors.needleWidth,needleHeadWidth:this.fontSize*this.scaleFactors.needleHeadWidth,barWidth:this.fontSize*this.scaleFactors.barWidth,varianceAxisLineWidth:this.fontSize*this.scaleFactors.varianceAxisLineWidth,axisLineWidth:this.fontSize*this.scaleFactors.axisLineWidth,auxiliaryLineWidth:this.fontSize*this.scaleFactors.auxiliaryLineWidth,scenarioLineWidth:this.fontSize*this.scaleFactors.scenarioLineWidth,markerWidth:this.fontSize*this.scaleFactors.markerWidth,categoryWidth:this.fontSize*this.scaleFactors.categoryWidth,axisTickLength:this.fontSize*this.scaleFactors.axisTickLength}}calculateCategoryPosition(){this.categoryPosition={x:this.padding.left,y:this.getAxisPositionY()+.5*this.spacings.categoryWidth}}calculateAxisPosition(){this.axisPosition={x:this.getAxisPositionX(),y:this.getAxisPositionY()}}recalculatePositions(){this.calculateCategoryPosition(),this.calculateAxisPosition()}getAxisTitleOffset(){return this.topSideLabelHeight}calculateSideLabelLength(t,i,s){if(this.leftSideLengthSync)return this.leftSideLengthSync;const e=t/2;let h=i;return e>h&&(h=e),s>h&&(h=s),h}}class lt{constructor(t){this.top=t.top,this.bottom=t.bottom,this.left=t.left,this.right=t.right}addBoxTopLeft(t){return this.top+=t.height|this.top,this.left+=t.width|this.top,this}}class ct{constructor(t){const i=1*t,s=.7*t;this.bgOffset=(i-s)/2,this.markerUp={top:s/2+",0",left:"0,"+s,right:s+","+s},this.markerUpBackground={top:i/2+",0",left:"0,"+i,right:i+","+i},this.markerDown={bottom:s/2+","+s,left:"0,0",right:s+",0"},this.markerDownBackground={bottom:i/2+","+i,left:"0,0",right:i+",0"}}upMarkerPatternStrings(){return{background:this.markerUpBackground.left+" "+this.markerUpBackground.right+" "+this.markerUpBackground.top+" "+this.markerUpBackground.left,foreground:this.markerUp.left+" "+this.markerUp.right+" "+this.markerUp.top+" "+this.markerUp.left,bgOffset:this.bgOffset}}downMarkerPatternStrings(){return{background:this.markerDownBackground.left+" "+this.markerDownBackground.right+" "+this.markerDownBackground.bottom+" "+this.markerDownBackground.left,foreground:this.markerDown.left+" "+this.markerDown.right+" "+this.markerDown.bottom+" "+this.markerDown.left,bgOffset:this.bgOffset}}createPatternMapForStructureBar(){const t=new Map;return t.set("marker-up",this.upMarkerPatternStrings()),t.set("marker-down",this.downMarkerPatternStrings()),t}}class dt{constructor(t){this.container=new U,this.pattern=this.createFCPattern(this.container.group(),t),this.styles=t;let i=10;null!=t&&null!=t.fontStyles&&t.fontStyles.size&&(i=t.fontStyles.size),this.bgOffset=(1*i-.7*i)/2}createFCPattern(t,i){const s=i;return t.pattern(10,10,(function(t){t.rect(10,10).fill(s.barStyles.fc.fill),t.line(0,5,5,0).stroke({width:s.barStyles.fc.width,color:s.barStyles.fc.stroke,linecap:"square"}),t.line(5,10,10,5).stroke({width:s.barStyles.fc.width,color:s.barStyles.fc.stroke,linecap:"square"})})).id("pattern-structure-fc")}getFCPolygonPattern(){return{background:"",foreground:"",bgOffset:0,pattern:this.pattern}}toString(){return this.container.svg()}}var ut,pt,ft,gt,vt;!function(t){t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.DIRTY=1]="DIRTY"}(ut||(ut={})),function(t){t.RELATIVE="dr",t.ABSOLUTE="d",t.NONE=""}(pt||(pt={}));class mt{constructor(t,i){this.data=t,this.scenarios=i,this.variances=[],this.title="",this.hideCategories=!1,this.pixelPerUnit=10,this.pixelPerPercentage=50,this.limit=0,this.sortOrder=new E(new tt).default(),this.level=O.CATEGORY,this.filter="",this.measureScale=new I,this.measureUnit="",this.showMeasureScale=!0,this.dataFormatDigits={decimal:1,percent:2},this.stackConfig=null}}class wt{constructor(t,i,s,e,h){this.dataRowAdapter=t,this.orderAdapter=i,this.stringAdapter=s,this.dataFormatDigitsAdapter=e,this.dataSet=h}adapt(t){const i=A.adaptArray(t.data,this.dataRowAdapter),s=A.adaptArray(t.scenarios,this.stringAdapter),e=new mt(i,s);return $.isArray(t.variances)&&(e.variances=A.adaptArray(t.variances,this.stringAdapter)),$.isString(t.title)&&(e.title=t.title),$.isBoolean(t.hideCategories)&&(e.hideCategories=t.hideCategories),$.isNumber(t.pixelPerUnit)&&(e.pixelPerUnit=t.pixelPerUnit),$.isNumber(t.pixelPerPercentage)&&(e.pixelPerPercentage=t.pixelPerPercentage),$.isNumber(t.limit)&&(e.limit=t.limit),$.isExisting(t.sortOrder)&&(e.sortOrder=this.orderAdapter.adapt(t.sortOrder)),$.isExisting(t.level)&&(e.level=t.level),$.isString(t.filter)&&(e.filter=t.filter.trim()),$.isExisting(t.measureScale)&&(e.measureScale=j.calculateMeasureScale(this.dataSet,e.scenarios,t.measureScale)),$.isString(t.measureUnit)&&(e.measureUnit=t.measureUnit),$.isBoolean(t.showMeasureScale)&&(e.showMeasureScale=t.showMeasureScale),$.isExisting(t.dataFormatDigits)&&(e.dataFormatDigits=this.dataFormatDigitsAdapter.adapt(t.dataFormatDigits)),$.isExisting(t.stackConfig)&&(e.stackConfig=t.stackConfig),e}default(){return new mt([],[])}}class bt{constructor(t,i,s,e){this.value=t,this.scenario=i,this.pixelPerUnit=s||1,this.variance="neg"===e||e===ft.NEG?ft.NEG:"pos"===e||e===ft.POS?ft.POS:ft.NEU}isEmpty(){return null==this.value||null==this.scenario}getScaledUnit(){return null==this.value?0:this.value*this.pixelPerUnit}getScaledPercentUnit(){return null==this.value?0:Math.abs(this.value)>1.45?this.value>=0?1.45*this.pixelPerUnit:-1.45*this.pixelPerUnit:this.value*this.pixelPerUnit}getVarianceStyle(){return null==this.value||this.value>=0?this.variance:ft.NEU===this.variance?ft.NEU:ft.POS===this.variance?ft.NEG:ft.POS}isClipped(){return null!=this.value&&Math.abs(this.value)>1.45}getClippedValue(){return 145}getScenario(){var t;return null===(t=this.scenario)||void 0===t?void 0:t.slice(0,2)}}class yt{constructor(){this.operation="+"}addRowGroup(t,i){this.rowGroup=t,this.rowGroupIndex=i}addCategory(t,i){this.category=t,this.categoryIndex=i}addSubCategory(t,i){this.subCategory=t,this.subCategoryIndex=i}addColumnGroup(t,i){this.columnGroup=t,this.columnGroupIndex=i}addSubColumnGroup(t,i){this.columnSubGroup=t,this.columnSubGroupIndex=i}}class St{constructor(){}adapt(t){const i=new yt;return $.isOperator(t.operation)&&(i.operation=t.operation),$.isNumber(t.rowGroupIndex)&&$.isString(t.rowGroup)&&i.addRowGroup(t.rowGroup,t.rowGroupIndex),$.isNumber(t.categoryIndex)&&$.isString(t.category)&&i.addCategory(t.category,t.categoryIndex),$.isNumber(t.subCategoryIndex)&&$.isString(t.subCategory)&&i.addSubCategory(t.subCategory,t.subCategoryIndex),$.isNumber(t.columnGroupIndex)&&$.isString(t.columnGroup)&&i.addColumnGroup(t.columnGroup,t.columnGroupIndex),$.isNumber(t.columnSubGroupIndex)&&$.isString(t.columnSubGroup)&&i.addSubColumnGroup(t.columnSubGroup,t.columnSubGroupIndex),this.setActualValues(t,i),this.setPlanValues(t,i),this.setPreviousPeriodValues(t,i),this.setForecastValues(t,i),i}default(){return new yt}setActualValues(t,i){$.isNumber(t.ac1)&&(i.ac1=t.ac1),$.isNumber(t.ac2)&&(i.ac2=t.ac2),$.isNumber(t.ac3)&&(i.ac3=t.ac3),$.isNumber(t.ac4)&&(i.ac4=t.ac4)}setPlanValues(t,i){$.isNumber(t.pl1)&&(i.pl1=t.pl1),$.isNumber(t.pl2)&&(i.pl2=t.pl2),$.isNumber(t.pl3)&&(i.pl3=t.pl3),$.isNumber(t.pl4)&&(i.pl4=t.pl4)}setPreviousPeriodValues(t,i){$.isNumber(t.pp1)&&(i.pp1=t.pp1),$.isNumber(t.pp2)&&(i.pp2=t.pp2),$.isNumber(t.pp3)&&(i.pp3=t.pp3),$.isNumber(t.pp4)&&(i.pp4=t.pp4)}setForecastValues(t,i){$.isNumber(t.fc1)&&(i.fc1=t.fc1),$.isNumber(t.fc2)&&(i.fc2=t.fc2),$.isNumber(t.fc3)&&(i.fc3=t.fc3),$.isNumber(t.fc4)&&(i.fc4=t.fc4)}}class xt{constructor(t,i,s,e,h,n){this.scaleFactors=t,this.fontStyles=i,this.axisStyles=s,this.barStyles=e,this.varianceStyles=h,this.padding=n,this.pattern=new Map,this.stackColors=["#000000","#c0c0c0","#808080"]}}class Pt{constructor(t,i,s,e,h){this.scaleFactorsStructureChartAdapter=t,this.fontStyleAdapter=i,this.svgStyleGroupAdapter=s,this.svgVariancesStyleGroupAdapter=e,this.paddingadapter=h}adapt(t){const i=new xt(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default());return $.isExisting(t)&&($.isExisting(t.scaleFactors)&&(i.scaleFactors=this.scaleFactorsStructureChartAdapter.adapt(t.scaleFactors)),$.isExisting(t.fontStyles)&&(i.fontStyles=this.fontStyleAdapter.adapt(t.fontStyles)),$.isExisting(t.axisStyles)&&(i.axisStyles=this.svgStyleGroupAdapter.adapt(t.axisStyles)),$.isExisting(t.barStyles)&&(i.barStyles=this.svgStyleGroupAdapter.adapt(t.barStyles)),$.isExisting(t.varianceStyles)&&(i.varianceStyles=this.svgVariancesStyleGroupAdapter.adapt(t.varianceStyles)),$.isExisting(t.padding)&&(i.padding=this.paddingadapter.adapt(t.padding)),Array.isArray(t.stackColors)&&t.stackColors.length>0&&(i.stackColors=t.stackColors),i.pattern=new ct(i.fontStyles.size).createPatternMapForStructureBar()),i}default(){return new xt(this.scaleFactorsStructureChartAdapter.default(),this.fontStyleAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgStyleGroupAdapter.default(),this.svgVariancesStyleGroupAdapter.default(),this.paddingadapter.default())}}class kt{constructor(){this.scenarioOffset=.3,this.scenarioLabelToBar=.1,this.labelToBar=.3,this.labelToAxis=.3,this.needleWidth=.3,this.needleHeadWidth=.6,this.barWidth=1.2,this.varianceAxisLineWidth=.3,this.axisLineWidth=.1,this.auxiliaryLineWidth=.1,this.scenarioLineWidth=.2,this.markerWidth=.7,this.markerOffset=0,this.categoryWidth=1.9,this.axisTickLength=.3}}class Lt{adapt(t){const i=new kt;return $.isNumber(t.scenarioOffset)&&(i.scenarioOffset=t.scenarioOffset),$.isNumber(t.scenarioLabelToBar)&&(i.scenarioLabelToBar=t.scenarioLabelToBar),$.isNumber(t.labelToBar)&&(i.labelToBar=t.labelToBar),$.isNumber(t.labelToAxis)&&(i.labelToAxis=t.labelToAxis),$.isNumber(t.needleWidth)&&(i.needleWidth=t.needleWidth),$.isNumber(t.needleHeadWidth)&&(i.needleHeadWidth=t.needleHeadWidth),$.isNumber(t.barWidth)&&(i.barWidth=t.barWidth),$.isNumber(t.varianceAxisLineWidth)&&(i.varianceAxisLineWidth=t.varianceAxisLineWidth),$.isNumber(t.axisLineWidth)&&(i.axisLineWidth=t.axisLineWidth),$.isNumber(t.auxiliaryLineWidth)&&(i.auxiliaryLineWidth=t.auxiliaryLineWidth),$.isNumber(t.scenarioLineWidth)&&(i.scenarioLineWidth=t.scenarioLineWidth),$.isNumber(t.markerWidth)&&(i.markerWidth=t.markerWidth),$.isNumber(t.markerOffset)&&(i.markerOffset=t.markerOffset),$.isNumber(t.categoryWidth)&&(i.categoryWidth=t.categoryWidth),$.isNumber(t.axisTickLength)&&(i.axisTickLength=t.axisTickLength),i}default(){return new kt}}!function(t){t.AC1="ac1",t.PP1="pp1",t.FC1="fc1",t.PL1="pl1",t.AC2="ac2",t.PP2="pp2",t.FC2="fc2",t.PL2="pl2",t.AC3="ac3",t.PP3="pp3",t.FC3="fc3",t.PL3="pl3",t.AC4="ac4",t.PP4="pp4",t.FC4="fc4",t.PL4="pl4",t.POS="pos",t.NEG="neg",t.NEU="neu"}(ft||(ft={})),function(t){t.LIST="LIST",t.SUM="SUM",t.OPT="OPT"}(gt||(gt={})),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"}(vt||(vt={}));class Ot{constructor(t,i,s,e,h,n,r,a){this.group=null,this.segmentFillColor=null,this.ID_SCENARIOLABEL="Label",this.CSS_CATEGORIES="categories",this.x=i,this.y=s,this.value=h,null!=t&&(this.group=t.group().id(this.createElementID(t.toString(),e))),this.styles=n,this.isVarianceLabel=!1,this.isRelativeLabel=!1,this.verticalHookLocation=r||vt.Top,this.horizontalHookLocation=a||vt.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}createElementID(t,i){return t+"_"+i+"_"+this.ID_SCENARIOLABEL}draw(t={percent:2,decimal:1},i=new I){if(this.isEmpty())return this;const s=this.group;let e;const h=this.styles.fontStyles.background||"#ffffff";let n="",r="start";if(!1===Number.isNaN(Number(this.value))){let s=t.percent,h=t.percent,a=1,o="percent";!1===this.isRelativeLabel&&(s=t.decimal,h=t.decimal,a=i.value,o="decimal"),e=Q.number(Number(this.value),o,s,h,a),Number(this.value)<0&&(r="end"),this.isVarianceLabel&&Number(this.value)>=0&&(n="+")}else e=""+this.value,r="start";const a=s.text(n+e);a.move(this.x,this.y);const o=a.bbox().w,l=a.bbox().h;return this.horizontalHookLocation===vt.Right?(r="end",a.move(a.x()-a.length(),a.y())):this.horizontalHookLocation===vt.Center&&(r="middle",a.move(a.x()-a.length()/2,a.y())),this.verticalHookLocation===vt.Center?a.move(a.x(),a.y()-l/2):this.verticalHookLocation===vt.Bottom&&a.move(a.x(),a.y()-l),a.font({anchor:r}),null!=this.segmentFillColor?a.fill(B(this.segmentFillColor)):null==s||s.rect(o,.9*l).stroke(h).fill(h).opacity(.7).move(a.x(),a.y()+.1*l).insertBefore(a),this}isEmpty(){return null==this.value||""===this.value}setPos(t,i){return this.x=t,this.y=i,this}}class _t{constructor(t,i,s,e){this.height=0,this.ID_AXIS="axis",this.ID_AXIS_TITLE="axis-title",this.CSS_AXIS_TITLE="categories",this.scenarioType=t.scenarioType,this.labelText=t.labelText||null,this.position=i,this.style=e,this.label=new Ot(s,this.position.getAxisTitlePositionX(),this.position.getAxisTitlePositionY(),this.ID_AXIS_TITLE,this.labelText,this.style,vt.Bottom,vt.Center),this.svgGroup=s.group().id(this.ID_AXIS)}draw(){return this.labelText&&this.label.draw(),this.svgGroup.line(this.position.getAxisPositionX(),this.position.getAxisPositionY(),this.position.getAxisEndPositionX(),this.position.getAxisEndPositionY()).addClass(this.ID_AXIS+"-"+this.convertScenarioType()),this.height=this.svgGroup.height(),this}convertScenarioType(){return void 0===this.scenarioType||null==this.scenarioType?"default":`${this.scenarioType}`.slice(0,2)}}class Mt{constructor(t,i,s,e,h,n,r,a=null){if(this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.label=null,this.scenarioLabel=null,this.barGroup=null,this.isVarianceBar=!1,this.overflowConfig=null,this.isOverflowing=!1,this.overdriveWidth=0,this.dimensions={barLength:0,xPos:0,yPos:0,labelXPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=e,this.isPrimaryBar=h,this.position=t,this.barStyles=i.barStyles,this.overflowConfig=a,this.scenarioGroup=n,this.styles=i,null!=n&&(this.barGroup=n.group().id(n.toString()+"_"+this.ID_RECT)),!0!==(null==s?void 0:s.isEmpty())&&null!=s.value){this.hasData=!0;let i=vt.Left;s.value<0&&(i=vt.Right),this.dimensions=this.createDimensions(t,s,e,h),this.label=new Ot(this.scenarioGroup,this.dimensions.labelXPos,this.dimensions.yPos,this.ID_DATA_PREFIX,s.value,this.styles,vt.Center,i),this.scenarioLabel=this.getScenarioLabel(r)}}setAsVariance(){var t;return this.isVarianceBar=!0,null===(t=this.label)||void 0===t||t.setToVarianceLabel(),this}isRelativeVariance(){var t;return this.isVarianceBar=!0,null===(t=this.label)||void 0===t||t.setToRelativeVarianceLabel(),this}updateLabelGroup(t){var i;return this.isEmpty()||null==t||null===(i=this.label)||void 0===i||i.updateGroup(t),this}draw(t={percent:2,decimal:1},i=new I){if(this.isEmpty()||null==this.dataPoint.getScenario())return this;let s=this.barStyles.getSVGStyle(this.dataPoint.getScenario());this.isVarianceBar&&(s=this.styles.varianceStyles.getSVGStyle(this.dataPoint.getVarianceStyle()));const e=this.convertToSVGStyle(s,"stroke");let h=this.convertToSVGStyle(s,"fill");const n=this.barStyles.getSVGStyle(this.dataPoint.getScenario()).fillpattern;if(null!=n){const t=this.styles.pattern.get(n);null!=t&&(h=t.pattern)}null!=this.barGroup&&(this.isOverflowing&&this.overflowConfig?this.drawOverdriveBar(h,e):this.barGroup.rect(this.dimensions.barLength,this.position.getBarWidth()).fill(h).stroke(e).cy(this.dimensions.yPos).x(this.dimensions.xPos)),this.drawBarDataLabel(t,i),this.drawScenarioLabel()}drawOverdriveBar(t,i){if(!this.barGroup||!this.overflowConfig)return;const s=this.position.getBarPositionX(),e=this.position.getBarWidth(),h=this.dimensions.barLength,{breakGap:n}=this.overflowConfig;this.dataPoint.getScaledUnit()<0?(this.barGroup.rect(h,e).fill(t).stroke(i).x(s-h).cy(this.dimensions.yPos),this.barGroup.rect(this.overdriveWidth,e).fill(t).stroke(i).x(s-h-n-this.overdriveWidth).cy(this.dimensions.yPos),this.drawBreakIndicator(s-h-n,n)):(this.barGroup.rect(h,e).fill(t).stroke(i).x(s).cy(this.dimensions.yPos),this.barGroup.rect(this.overdriveWidth,e).fill(t).stroke(i).x(s+h+n).cy(this.dimensions.yPos),this.drawBreakIndicator(s+h,n))}drawBreakIndicator(t,i){if(!this.barGroup)return;const s=this.position.getBarWidth(),e=this.dimensions.yPos-s/2,h=t+i/2,n=.35*i,r=s/3;let a=`M ${h-n} ${e}`;for(let t=0;t<3;t++)a+=` L ${h-n-.3*i} ${e+r*(t+.5)} L ${h-n} ${e+r*(t+1)}`;let o=`M ${h+n} ${e}`;for(let t=0;t<3;t++)o+=` L ${h+n+.3*i} ${e+r*(t+.5)} L ${h+n} ${e+r*(t+1)}`;this.barGroup.rect(i,s+2).fill("#ffffff").stroke("none").x(t).cy(this.dimensions.yPos),this.barGroup.path(a).fill("none").stroke({color:"#000000",width:1}),this.barGroup.path(o).fill("none").stroke({color:"#000000",width:1})}createDimensions(t,i,s,e){const h=i.getScaledUnit(),n=Math.abs(h);if(this.overflowConfig&&n>0){const r="ac"===i.getScenario()?this.overflowConfig.cutWidth:this.overflowConfig.cutWidth-this.overflowConfig.scenarioCutOffset;if(n>r){this.isOverflowing=!0;const{breakGap:i,overdriveZoneWidth:a,maxOverflow:o}=this.overflowConfig;this.overdriveWidth=o>0?(n-r)/o*a:0;const l=r+i+this.overdriveWidth;return h<0?{clipped:!1,barLength:r,xPos:t.getBarPositionX()-r,yPos:t.getBarPositionY(s,e),labelXPos:t.getLabelPositionX(-l),scenarioLabelXPos:t.getBarPositionX()-.5*r,scenarioLabelYPos:t.getBarPositionY(s,e)+t.getScenarioLabelPositionOffsetY(e)}:{clipped:!1,barLength:r,xPos:t.getBarPositionX(),yPos:t.getBarPositionY(s,e),labelXPos:t.getLabelPositionX(l),scenarioLabelXPos:t.getBarPositionX()+.5*r,scenarioLabelYPos:t.getBarPositionY(s,e)+t.getScenarioLabelPositionOffsetY(e)}}}return h<0?{clipped:!1,barLength:n,xPos:t.getBarPositionX()+h,yPos:t.getBarPositionY(s,e),labelXPos:this.position.getLabelPositionX(h),scenarioLabelXPos:this.position.getBarPositionX()-.5*n,scenarioLabelYPos:this.position.getBarPositionY(s,e)+this.position.getScenarioLabelPositionOffsetY(e)}:{clipped:!1,barLength:h,xPos:t.getBarPositionX(),yPos:t.getBarPositionY(s,e),labelXPos:this.position.getLabelPositionX(h),scenarioLabelXPos:this.position.getBarPositionX()+.5*n,scenarioLabelYPos:this.position.getBarPositionY(s,e)+this.position.getScenarioLabelPositionOffsetY(e)}}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}drawScenarioLabel(){null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.isVarianceBar||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw()}drawBarDataLabel(t,i=new I){var s;this.isPrimaryBar&&(null===(s=this.label)||void 0===s||s.draw(t,i))}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}getScenarioLabel(t){return new Ot(this.scenarioGroup,-1,-1,this.ID_SCENARIO_PREFIX,t,this.styles,this.isPrimaryBar?vt.Top:vt.Bottom,vt.Center)}}class Tt{constructor(t,i,s,e,h,n,r,a,o){this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.FALLBACK_COLOUR="#000000",this.scenarioLabel=null,this._defaultMarkerPattern=null,this.dimensions={barLength:0,xPos:0,yPos:0,labelXPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.position=t,this.markerGroup=i||null,this.markerPattern=s||this._defaultMarkerPattern,this.styles=h,this.barStyles=h?h.barStyles:null,this.scenario=e,!0!==(null==n?void 0:n.isEmpty())&&(this.hasData=!0,this.dimensions=this.createMarkerDimensions(n,r,o),this.scenarioLabel=this.getScenarioLabel(a,h,o))}createMarkerDimensions(t,i,s){return t.getScaledUnit()<0?{clipped:!1,labelXPos:0,barLength:Math.abs(t.getScaledUnit()),xPos:this.position.getMarkerPositionX()-Math.abs(t.getScaledUnit()),yPos:this.position.getMarkerPositionY(i,s),scenarioLabelXPos:this.position.getMarkerPositionX()-Math.abs(t.getScaledUnit()),scenarioLabelYPos:this.position.getMarkerPositionY(i,s)+this.position.getMarkerScenarioLabelPositionOffsetY(s)}:{clipped:!1,labelXPos:0,barLength:t.getScaledUnit(),xPos:this.position.getMarkerPositionX()+t.getScaledUnit(),yPos:this.position.getMarkerPositionY(i,s),scenarioLabelXPos:this.position.getMarkerPositionX()+t.getScaledUnit(),scenarioLabelYPos:this.position.getMarkerPositionY(i,s)+this.position.getMarkerScenarioLabelPositionOffsetY(s)}}getScenarioLabel(t,i,s){return null==this.markerGroup?null:new Ot(this.markerGroup,-1,-1,this.ID_DATA_PREFIX,t,i,s?vt.Bottom:vt.Top,vt.Center)}convertToSVGStyle(t,i){return null==t&&(t=[]),t.color=t[i]||this.FALLBACK_COLOUR,Object.assign({},t)}draw(){if(this.isEmpty())return this;const t=this.convertToSVGStyle(this.barStyles[this.getScenario()],"stroke");let i=this.convertToSVGStyle(this.barStyles[this.getScenario()],"fill");const s=this.barStyles[this.getScenario()];if(null!=s&&s.fillpattern){const t=this.styles.pattern.get(s.fillpattern);null!=t&&(i=t.pattern)}return this.markerGroup.polygon(this.markerPattern.background).fill("#ffffff").cy(this.dimensions.yPos).cx(this.dimensions.xPos),this.markerGroup.polygon(this.markerPattern.foreground).fill(i).stroke(t).cy(this.dimensions.yPos).cx(this.dimensions.xPos),null==this.scenarioLabel||this.scenarioLabel.isEmpty()||this.scenarioLabel.setPos(this.dimensions.scenarioLabelXPos,this.dimensions.scenarioLabelYPos).draw(),this}isEmpty(){return!1===this.hasData}getScenario(){var t;return null===(t=this.scenario)||void 0===t?void 0:t.slice(0,2)}}class Rt{constructor(t,i,s,e,h){if(this.ID_DATA_PREFIX="DATA",this.ID_SCENARIO_PREFIX="SCENARIO",this.ID_RECT="RECT",this.FALLBACK_COLOUR="#000000",this.label=null,this.dimensions={barLength:0,xPos:0,yPos:0,labelXPos:0,scenarioLabelXPos:0,scenarioLabelYPos:0,clipped:!1},this.hasData=!1,this.dataPoint=s,this.index=e,this.position=t,this.barStyles=i.barStyles,this.scenarioGroup=h,this.styles=i,this.barGroup=h.group().id(h.toString()+"_"+this.ID_RECT),!0!==(null==s?void 0:s.isEmpty())&&null!=s.value){this.hasData=!0,this.dimensions=this.createDimensions(t,s,e);let i=vt.Left;s.value<0&&(i=vt.Right),this.label=new Ot(this.scenarioGroup,this.dimensions.labelXPos,this.dimensions.yPos,this.ID_DATA_PREFIX,s.value,this.styles,vt.Center,i),this.label.setToRelativeVarianceLabel()}}updateLabelGroup(t){var i;return this.isEmpty()||null==t||null===(i=this.label)||void 0===i||i.updateGroup(t),this}draw(){var t;if(this.isEmpty())return this;if(null==this.dimensions)return this;const i=this.styles.varianceStyles.getSVGStyle(this.dataPoint.getVarianceStyle()),s=i.stroke;let e=i.fill;const h=this.barStyles[this.dataPoint.getScenario()];if(null!=h&&h.fillpattern){const t=this.styles.pattern.get(h.fillpattern);null!=t&&null!=t.pattern&&(e=t.pattern)}this.drawNeedleHead(e,s),this.barGroup.rect(this.dimensions.barLength,this.position.getNeedleWidth()).fill(e).stroke(s).cy(this.dimensions.yPos).x(this.dimensions.xPos),null===(t=this.label)||void 0===t||t.draw()}createDimensions(t,i,s){return i.getScaledPercentUnit()<0?{barLength:Math.abs(i.getScaledPercentUnit()),xPos:t.getBarPositionX()+i.getScaledPercentUnit(),yPos:t.getBarCenterPositionY(s),labelXPos:this.position.getLabelPositionX(i.getScaledPercentUnit()-this.position.getNeedleWidth()),clipped:i.isClipped(),scenarioLabelXPos:0,scenarioLabelYPos:0}:{barLength:i.getScaledPercentUnit(),xPos:t.getBarPositionX(),yPos:t.getBarCenterPositionY(s),labelXPos:this.position.getLabelPositionX(i.getScaledPercentUnit()+this.position.getNeedleWidth()),clipped:i.isClipped(),scenarioLabelXPos:0,scenarioLabelYPos:0}}drawNeedleHead(t,i){if(null===this.dimensions)return;const s=this.styles.varianceStyles.needleHeadColour,e=this.styles.varianceStyles.needleHeadColour;if(this.dimensions.clipped){let s="13,0 4,-5 4,5 13,0 8,0 0,-5 0,5 8,0";null!=this.dataPoint.value&&this.dataPoint.value<0&&(s="0,0 9,-5 9,5 0,0 5,0 13,-5 13,5 5,0"),this.barGroup.polygon(s).fill(t).cx(this.getHeadXPosition()).cy(this.dimensions.yPos).fill(t).stroke(i)}else this.barGroup.rect(2*this.position.getNeedleWidth(),2*this.position.getNeedleWidth()).cx(this.getHeadXPosition()).cy(this.dimensions.yPos).fill(s).stroke(e)}isEmpty(){return!1===this.hasData||Number.isNaN(this.dataPoint.value)}getHeadXPosition(){let t=this.dimensions.xPos;return null!=this.dataPoint.value&&this.dataPoint.value>0&&(t+=this.dimensions.barLength),t}}class Ct{constructor(t,i,s,e,h,n,r,a,o,l,c){this.hasData=!1,this.position=t,this.styles=i,this.dataPoint=s,this.index=e,this.baselineValue=h,this.segmentIndex=r,this.stackMode=a,this.totalValue=o,this.group=c,this.barGroup=c.group().id(`stacked_bar_${e}_seg_${r}`),!0!==(null==s?void 0:s.isEmpty())&&null!=s.value&&(this.hasData=!0)}draw(t={percent:2,decimal:1},i=new I){if(!this.hasData||null==this.dataPoint.value)return;const s=this.dataPoint.value,e=this.dataPoint.pixelPerUnit,h=this.position.getBarPositionX(),n=this.position.getBarWidth();let r,a;if(this.stackMode===C.RELATIVE){const t=e;r=(0!==this.totalValue?Math.abs(s)/Math.abs(this.totalValue):0)*t,a=h+this.baselineValue/Math.abs(this.totalValue)*t}else r=Math.abs(s*e),a=h+this.baselineValue*e;const o=this.position.getBarPositionY(this.index,!0),l=this.styles.stackColors,c=l[this.segmentIndex%l.length],d={color:c},u={color:c,width:.5};if(this.barGroup.rect(Math.max(r,.5),n).fill(d).stroke(u).cy(o).x(a),r>=30){const e=a+r/2;if(this.stackMode===C.RELATIVE||this.stackMode===C.ABSOLUTE_RELATIVE){const i=(0!==this.totalValue?s/this.totalValue*100:0).toFixed(t.percent)+"%";new Ot(this.group,e,o,"STACK_SEG",i,this.styles,vt.Center,vt.Center).setSegmentFill(c).draw()}else new Ot(this.group,e,o,"STACK_SEG",s,this.styles,vt.Center,vt.Center).setSegmentFill(c).draw(t,i)}}drawTotalLabel(t={percent:2,decimal:1},i=new I){if(this.stackMode===C.RELATIVE)return;const s=this.position.getBarPositionX()+this.totalValue*this.dataPoint.pixelPerUnit+this.position.spacings.labelToBar,e=this.position.getBarPositionY(this.index,!0);new Ot(this.group,s,e,"STACK_TOTAL",this.totalValue,this.styles,vt.Center,vt.Left).draw(t,i)}}class At{constructor(t,i,s,e,h){this.overflowConfig=null,this.i18n=h;const n=i.group().id("Scenario1"),r=i.group().id("Scenario2").insertBefore(n);this.svgGroups={parent:i,scenario1:n,scenario2:r,scenario3:i.group().id("Scenario3"),scenario4:i.group().id("Scenario4"),scenario1Label:i.group().id("label")},this.styles=s,this.position=t,this.elementCnt=e}setOverflowConfig(t){this.overflowConfig=t}isLastDataPoint(t){return this.elementCnt-1===t}isFirsttDataPoint(t){return 0===t}createPrimaryBar(t,i){var s,e,h,n;const r=null===(e=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario1)||void 0===e?void 0:e.group().id(""+i),a=null===(n=null===(h=this.svgGroups)||void 0===h?void 0:h.scenario1Label)||void 0===n?void 0:n.group().id(""+i);let o=null;return this.isLastDataPoint(i)&&(o=`${this.i18n.get(t.scenario)||t.scenario}`),new Mt(this.position,this.styles,t,i,!0,r,o,this.overflowConfig).updateLabelGroup(a)}createVarianceBar(t,i){var s,e,h,n;const r=null===(e=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario1)||void 0===e?void 0:e.group().id(""+i),a=null===(n=null===(h=this.svgGroups)||void 0===h?void 0:h.scenario1Label)||void 0===n?void 0:n.group().id(""+i);let o=null;return this.isLastDataPoint(i)&&(o=`${this.i18n.get(t.scenario)||t.scenario}`),new Mt(this.position,this.styles,t,i,!0,r,o,this.overflowConfig).updateLabelGroup(a).setAsVariance()}createRelativeVarianceBar(t,i){var s,e,h,n;const r=null===(e=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario1)||void 0===e?void 0:e.group().id(""+i),a=null===(n=null===(h=this.svgGroups)||void 0===h?void 0:h.scenario1Label)||void 0===n?void 0:n.group().id(""+i);return new Rt(this.position,this.styles,t,i,r).updateLabelGroup(a)}createSecondaryBar(t,i){var s,e;const h=null===(e=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario2)||void 0===e?void 0:e.group().id(""+i);let n=null;return this.isFirsttDataPoint(i)&&(n=`${this.i18n.get(t.scenario)||t.scenario}`),new Mt(this.position,this.styles,t,i,!1,h,n,this.overflowConfig)}createPrimaryMarker(t,i){var s,e;const h=null===(e=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario3)||void 0===e?void 0:e.group().id(""+i),n=this.styles.pattern.get("marker-down")||{foreground:"0,0 1,0 1,1 0,1",background:"0,0 1,0 1,1 0,1",bgOffset:0};let r=null;return this.isFirstDataPoint(i)&&(r=`${this.i18n.get(t.scenario)||t.scenario}`),new Tt(this.position,h,n,t.scenario,this.styles,t,i,r,!0)}createSecondaryMarker(t,i){var s,e;const h=null===(e=null===(s=this.svgGroups)||void 0===s?void 0:s.scenario4)||void 0===e?void 0:e.group().id(""+i),n=this.styles.pattern.get("marker-up")||{foreground:"0,0 1,0 1,1 0,1",background:"0,0 1,0 1,1 0,1",bgOffset:0};let r=null;return this.isLastDataPoint(i)&&(r=`${this.i18n.get(t.scenario)||t.scenario}`),new Tt(this.position,h,n,t.scenario,this.styles,t,i,r,!1)}isFirstDataPoint(t){return 0===t}}class $t{constructor(t,i,s){this.dataModel=[],this.variancesDataModel=[],this.title="",this.smallestDataPointValue=new bt(0,ft.AC1,1,ft.NEU),this.highestDataPointValue=new bt(0,ft.AC1,1,ft.NEU),this.smallestVarianceDataPointValue=new bt(0,ft.AC1,1,ft.NEU),this.highestVarianceDataPointValue=new bt(0,ft.AC1,1,ft.NEU),this.pixelPerUnit=1,this.pixelPerPercentage=1,this.hideCategories=!1,this.axisScenario=ft.AC1,this.CSS_CATEGORIES="categories",this.preparedDataSet=[],this.state=ut.DIRTY,this.titleLength=0,this.leftSideOffsetForHorizontalSync=0,this.limit=0,this.measureScale=new I,this.measureUnit="",this.dataFormatDigits={percent:2,decimal:1},this.stackConfig=null,this.overflowConfig=null,this.highestStackedTotal=0,this.initSQLFunctions(),this.ruleSet=t||new it,this.i18n=this.createI18n(new Map),this.styles=s,this.setConfig(i),this.position=this.createElementPosition()}updatePosition(){this.position=this.createElementPosition()}createElementPosition(){this.titleLength=this.calculateTitleLength(0);let t=this.calculateLeftSideWidth(this.getVarianceType());const i=this.calculateCategoryWidth();return this.titleLength>t&&(t=this.titleLength),new ot(new lt(this.styles.padding),this.styles.scaleFactors,this.styles.fontStyles.size,this.dataModel.length,this.leftSideOffsetForHorizontalSync,this.titleLength,t,i)}initSQLFunctions(){q.fn.transformOperator=function(t){return"-"===t?-1:1}}setStyles(t){this.styles=t}setConfig(t){var i;this.state=ut.DIRTY,this.sortScenariosbyVisualisationRules(t),this.hideCategories=t.hideCategories||!1,this.limit=t.limit,this.pixelPerUnit=t.pixelPerUnit||1,this.pixelPerPercentage=t.pixelPerPercentage||100,this.setData([...t.data],t.filter),this.dataModel=this.populateModel(t.scenarios,t.level,t.sortOrder),t.stackConfig&&t.stackConfig.by!==T.SCENARIOS&&this.populateDimensionStackSegments(t.scenarios,t.stackConfig,t.level),this.variancesDataModel=this.populateVarianceModel(t.variances,this.dataModel),this.title=t.title||Q.translateScenarioLabel(null===(i=null==t?void 0:t.variances)||void 0===i?void 0:i.toString(),this.i18n),this.smallestDataPointValue=this.findSmallestDataPointValue(this.dataModel),this.smallestVarianceDataPointValue=this.findSmallestDataPointValue(this.variancesDataModel),this.highestDataPointValue=this.findHighestDataPointValue(this.dataModel),this.highestVarianceDataPointValue=this.findHighestDataPointValue(this.variancesDataModel),this.axisScenario=this.setAxisScenario(t.variances),this.measureScale=t.measureScale,this.measureUnit=t.measureUnit,this.dataFormatDigits=t.dataFormatDigits,this.stackConfig=t.stackConfig,this.highestStackedTotal=this.findHighestStackedRowTotal(this.dataModel),this.updatePosition()}sortScenariosbyVisualisationRules(t){const i=this;t.scenarios.sort(((t,s)=>i.ruleSet.getScenarioSorIndex(t)-i.ruleSet.getScenarioSorIndex(s))).reverse()}setI18n(t){this.i18n=this.createI18n(t)}createI18n(t){this.state=ut.DIRTY;const i=new Map([["SEPERATOR_WS",", "],["in","in"],["ORDER_asc","↑"],["ORDER_desc","↓"],["ac1","AC"],["pp1","PY"],["fc1","FC"],["pl1","PL"],["ac2","AC2"],["pp2","PY2"],["fc2","FC2"],["pl2","PL2"],["ac3","AC3"],["pp3","PY3"],["fc3","FC3"],["pl3","PL3"],["ac4","AC4"],["pp4","PY4"],["fc4","FC4"],["pl4","PL4"],["category"," "],["operation"," "],["there_of","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"]]);return new Map([...i,...t])}setData(t,i){if(null!=t)if(this.state=ut.DIRTY,this.preparedDataSet.length=0,null!=i&&i.length>0)try{this.preparedDataSet=q(`SELECT * FROM ? WHERE ${i}`,[t])}catch(s){console.error("StructureChart: filter query failed, using unfiltered data",i,s),this.preparedDataSet=t}else this.preparedDataSet=t}getMaxBarValue(){var t,i;if(null!=this.stackConfig&&this.highestStackedTotal>0)return this.stackConfig.mode===C.RELATIVE?1:this.highestStackedTotal;const s=this.getVarianceType();return s===pt.NONE&&null!=(null===(t=this.highestDataPointValue)||void 0===t?void 0:t.value)?Math.abs(this.highestDataPointValue.value):s===pt.ABSOLUTE&&null!=(null===(i=this.highestVarianceDataPointValue)||void 0===i?void 0:i.value)?Math.abs(this.highestVarianceDataPointValue.value):0}getAllocatedCanvasWidth(){const t=this.position.getAxisPositionX(),i=this.calculateRightSideWidth(this.getVarianceType());let s=t+i+ +this.styles.padding.left+this.styles.padding.right;return i<this.titleLength/2&&(s+=this.titleLength/2),t<this.titleLength/2&&(s+=this.titleLength/2),s}getAllocatedCanvasHeight(){return(this.dataModel.length+1)*this.position.spacings.categoryWidth+this.styles.padding.top+this.styles.padding.bottom}patternToString(){return"<svg></svg>"}toString(){const t=new U;return this.draw(t),t.id("drawCanvas"),t.width(this.getAllocatedCanvasWidth()),t.height(this.getAllocatedCanvasHeight()),t.svg()}draw(t){this.cleanSVGforRedraw(t),this.state===ut.DIRTY&&(this.state=ut.UP_TO_DATE),this.variancesDataModel&&this.variancesDataModel.length>0?(this.drawVarianceScenario(this.variancesDataModel,t),this.drawAxisAndLabels(this.variancesDataModel,t)):null!=this.stackConfig?(this.drawStackedScenarios(this.dataModel,t),this.drawStackedHeaders(this.dataModel,t),this.drawAxisAndLabels(this.dataModel,t)):(this.drawScenarios(this.dataModel,t),this.drawAxisAndLabels(this.dataModel,t))}setPattern(t,i){this.styles.pattern.set(t,i)}calculateTitleLength(t){const i=J(this.title.length>7?this.title:"_______",{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width;return i<t?t:i/2}getFooter(){return 1===this.measureScale.value&&""===this.measureUnit?" ":Q.translateScenarioLabel("in",this.i18n)+" "+this.measureScale.prefix+this.measureUnit}setAxisScenario(t){let i=ft.AC1;if(null!=t&&t.length>0){const s=new Z(t.toString());s.isValid&&(i=s.delta)}return null===i&&(i=ft.AC1),i}populateModel(t,i,s){var e;if(0===(null===(e=this.preparedDataSet)||void 0===e?void 0:e.length))return[];const h=[],n=this.createOrderStr(i,s),r=this.createSelectString(i,s),a=this.createGroupByStr(i,s),o=q(`SELECT ${r} ${t.length>0?","+t.map((t=>`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`)).join(","):""} \n FROM ?\n GROUP BY ${a}\n ORDER BY ${n}`,[this.preparedDataSet]);return this.detectNaNCells(t,o),this.createDataRows(o,h,t),this.crateRESTRow(o,t,h),h}detectNaNCells(t,i){i.forEach((i=>(t.forEach((t=>{const s=new Z(t);!0===s.isValid?0!==i[s.base+"_cnt"]&&0!==i[s.delta+"_cnt"]||(i[t]=Number.NaN):0===i[t+"_cnt"]&&(i[t]=Number.NaN)})),i)))}crateRESTRow(t,i,s){if(0===this.limit||this.limit>t.length)return;const e=[],h=t.slice(this.limit,t.length);this.createDataRows(h,e,i);const n=e.reduce((function(t,s){return{id:t.id,category:t.category,type:t.type,scenario1:new bt(t.scenario1.value+s.scenario1.value,i[0],t.scenario1.pixelPerUnit,ft.NEU),scenario2:new bt(t.scenario2.value+s.scenario2.value,i[1],t.scenario2.pixelPerUnit,ft.NEU),scenario3:new bt(t.scenario3.value+s.scenario3.value,i[2],t.scenario3.pixelPerUnit,ft.NEU),scenario4:new bt(t.scenario4.value+s.scenario4.value,i[3],t.scenario4.pixelPerUnit,ft.NEU)}}),{id:9999,category:"REST",type:pt.NONE,scenario1:new bt(0,i[0],this.pixelPerUnit,ft.NEU),scenario2:new bt(0,i[1],this.pixelPerUnit,ft.NEU),scenario3:new bt(0,i[2],this.pixelPerUnit,ft.NEU),scenario4:new bt(0,i[3],this.pixelPerUnit,ft.NEU)});s.push(n)}createDataRows(t,i,s){let e=t;this.limit>0&&(e=t.slice(0,this.limit)),e.forEach(((t,e)=>{i.push({id:e,category:t.category,type:pt.NONE,scenario1:new bt(t[s[0]],s[0],this.pixelPerUnit,ft.NEU),scenario2:new bt(t[s[1]],s[1],this.pixelPerUnit,ft.NEU),scenario3:new bt(t[s[2]],s[2],this.pixelPerUnit,ft.NEU),scenario4:new bt(t[s[3]],s[3],this.pixelPerUnit,ft.NEU)})}))}createOrderStr(t,i){let s=`${t.toLowerCase()}`;return i.hierarchy.length>=1&&(s=`${i.hierarchy.toString()} ${null==i?void 0:i.direction}`),s}createSelectString(t,i){return t===O.CATEGORY&&i.hierarchy.includes(M.CATEGORYINDEX)?`${M.CATEGORYINDEX}, ${O.CATEGORY} as category`:t===O.ROWGROUP&&i.hierarchy.includes(M.ROWGROUPINDEX)?`${M.ROWGROUPINDEX}, ${O.ROWGROUP} as category`:t===O.SUBCATEGORY&&i.hierarchy.includes(M.SUBCATEGORYINDEX)?`${M.SUBCATEGORYINDEX}, ${O.SUBCATEGORY} as category`:`${t.toString()} as category`}createGroupByStr(t,i){return t===O.CATEGORY&&i.hierarchy.includes(M.CATEGORYINDEX)?`${M.CATEGORYINDEX}, ${O.CATEGORY}`:t===O.ROWGROUP&&i.hierarchy.includes(M.ROWGROUPINDEX)?`${M.ROWGROUPINDEX}, ${O.ROWGROUP}`:t===O.SUBCATEGORY&&i.hierarchy.includes(M.SUBCATEGORYINDEX)?`${M.SUBCATEGORYINDEX}, ${O.SUBCATEGORY}`:`${t.toString()}`}calculateCategoryWidth(){if(this.hideCategories)return 5;let t=0;for(const i of this.dataModel){const s=J(i.category,{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"});s.width>t&&(t=s.width)}return 1.1125*t}findSmallestDataPointValue(t){let i=new bt(0,"default",this.pixelPerUnit,null);for(const s of t)for(const t of[s.scenario1,s.scenario2,s.scenario3,s.scenario4])null!=t&&null!=i.value&&t.value<i.value&&(i=t);return i}findHighestDataPointValue(t){let i=new bt(0,"default",this.pixelPerUnit,null);for(const s of t)for(const t of[s.scenario1,s.scenario2,s.scenario3,s.scenario4])null!=t&&null!=i.value&&t.value>i.value&&(i=t);return i}findHighestStackedRowTotal(t){if(!this.stackConfig||0===t.length)return 0;const i=this.stackConfig.by===T.SCENARIOS;let s=0;for(const e of t){let t=0;if(i){const i=["scenario1","scenario2","scenario3","scenario4"],s=[];for(const t of i){const i=e[t];i&&!i.isEmpty()&&null!=i.value&&s.push({value:i.value,scenario:i.scenario})}if(new Set(s.map((t=>Y(t.scenario)))).size>1){const i=new Map;for(const t of s){const s=Y(t.scenario);i.set(s,(i.get(s)||0)+Math.abs(t.value))}t=Math.max(...i.values())}else t=s.reduce(((t,i)=>t+Math.abs(i.value)),0)}else e.stackSegments&&e.stackSegments.length>0&&(t=e.stackSegments.reduce(((t,i)=>t+Math.abs(i.value)),0));t>s&&(s=t)}return s}populateVarianceModel(t,i){const s=[];if(0===t.length)return s;let e=null;null!=i&&i.length>0&&(e=i[0]);for(const h in t){const n=new Z(t[h]);if(n.isValid){const t=this.mapScenarios(n,e),h=n.direction;let r=this.pixelPerUnit;"dr"===n.type&&(r=this.pixelPerPercentage);for(const e in i)s.push({id:Number(e),category:i[e].category,type:"dr"===n.type?pt.RELATIVE:pt.ABSOLUTE,scenario1:new bt(this.calculateVariance(n,i[e],t),n.base,r,h),scenario2:new bt(null,null,null,null),scenario3:new bt(null,null,null,null),scenario4:new bt(null,null,null,null)})}}return s}calculateVariance(t,i,s){const e=s.get(t.base),h=s.get(t.delta);return null==e||null==h?null:t.type===pt.RELATIVE?(i[e].value-i[h].value)/i[h].value:i[e].value-i[h].value}mapScenarios(t,i){const s=new Map;return null==i||["scenario1","scenario2","scenario3","scenario4"].forEach((e=>{i[e].scenario===t.delta?s.set(t.delta,e):i[e].scenario===t.base&&s.set(t.base,e)})),s}calculateTextBoxWidth(t){return J(Q.number(t,"decimal",1,0),{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width}calculatePercentageTextBoxWidth(t){let i=0;return t>=0&&(i+=J("+",{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width),i+=J(" %",{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width,J(Q.number(t,"decimal",1,1),{font:this.styles.fontStyles.font,fontSize:this.styles.fontStyles.size+"px"}).width+i+i}cleanSVGforRedraw(t){t.clear()}drawAxisAndLabels(t,i){const s=i.group().id("AxisAndDateLables");let e=!1;this.hideCategories||t.forEach(((t,i)=>{t.type===pt.RELATIVE&&(e=!0);let h=vt.Right,n=!0;t.scenario1.value<0&&(h=vt.Left,n=!1),new Ot(s,this.position.getCategoryPositionX(n),this.position.getBarCenterPositionY(i),"",t.category,this.styles,vt.Center,h).draw()})),new _t({scenarioType:this.axisScenario,labelText:this.title,isRelative:e},this.position,s,this.styles).draw()}drawScenarios(t,i){const s=i.group().id("Scenarios"),e=new At(this.position,s,this.styles,t.length,this.i18n);e.setOverflowConfig(this.overflowConfig),t.forEach(((t,i)=>{e.createPrimaryBar(t.scenario1,i).draw(this.dataFormatDigits,this.measureScale),e.createSecondaryBar(t.scenario2,i).draw(),e.createPrimaryMarker(t.scenario3,i).draw(),e.createSecondaryMarker(t.scenario4,i).draw()}))}drawVarianceScenario(t,i){const s=i.group().id("Scenarios"),e=new At(this.position,s,this.styles,t.length,this.i18n);return e.setOverflowConfig(this.overflowConfig),t.forEach(((t,i)=>{t.type===pt.RELATIVE?e.createRelativeVarianceBar(t.scenario1,i).draw():e.createVarianceBar(t.scenario1,i).draw(this.dataFormatDigits,this.measureScale)})),s}drawStackedScenarios(t,i){if(!this.stackConfig)return;const s=i.group().id("StackedScenarios"),e=this.stackConfig.by===T.SCENARIOS;t.forEach(((t,i)=>{const h=["scenario1","scenario2","scenario3","scenario4"],n=[];if(e)for(const i of h){const s=t[i];s&&!s.isEmpty()&&null!=s.value&&n.push({value:s.value,scenario:s.scenario,dataPoint:s})}else{const i=t.scenario1;i&&!i.isEmpty()&&null!=i.value&&n.push({value:i.value,scenario:i.scenario,dataPoint:i})}if(0!==n.length)if((e?new Set(n.map((t=>Y(t.scenario)))):new Set).size>1){const t=new Map;for(const i of n){const s=Y(i.scenario);t.has(s)||t.set(s,[]),t.get(s).push(i)}const e=[];for(const i of H)t.has(i)&&(e.push({prefix:i,segments:t.get(i)}),t.delete(i));for(const[i,s]of t)e.push({prefix:i,segments:s});e.forEach(((t,h)=>{const n=t.segments.reduce(((t,i)=>t+Math.abs(i.value)),0),r=e.length-1-h;let a=0,o=null;t.segments.forEach((t=>{const e=new Ct(this.position,this.styles,t.dataPoint,i,a,t.scenario,r,this.stackConfig.mode,n,!0,s);e.draw(this.dataFormatDigits,this.measureScale),a+=Math.abs(t.value),o=e})),o&&o.drawTotalLabel(this.dataFormatDigits,this.measureScale)}))}else{let h=n;!e&&t.stackSegments&&t.stackSegments.length>0&&(h=t.stackSegments.map((t=>({value:t.value,scenario:t.label,dataPoint:t.dataPoint})))),"asc"===this.stackConfig.order?h.sort(((t,i)=>t.value-i.value)):"desc"===this.stackConfig.order&&h.sort(((t,i)=>i.value-t.value));const r=h.reduce(((t,i)=>t+Math.abs(i.value)),0);let a=0,o=null;h.forEach(((t,h)=>{const n=new Ct(this.position,this.styles,t.dataPoint,i,a,t.scenario,h,this.stackConfig.mode,r,e,s);n.draw(this.dataFormatDigits,this.measureScale),a+=Math.abs(t.value),o=n})),o&&o.drawTotalLabel(this.dataFormatDigits,this.measureScale)}}))}drawStackedHeaders(t,i){if(!this.stackConfig||0===t.length)return;const s=this.stackConfig.by===T.SCENARIOS,e=i.group().id("StackedHeaders"),h=t[0];if(!s){const t=h.stackSegments;if(!t||0===t.length)return;const i=[...t];"asc"===this.stackConfig.order?i.sort(((t,i)=>t.value-i.value)):"desc"===this.stackConfig.order&&i.sort(((t,i)=>i.value-t.value));const s=i.reduce(((t,i)=>t+Math.abs(i.value)),0),n=this.position.getBarPositionX(),r=this.position.getAxisTitlePositionY();let a=0;return void i.forEach((t=>{const i=t.dataPoint.pixelPerUnit;let h;h=this.stackConfig.mode===C.RELATIVE?(0!==s?Math.abs(t.value)/s:0)*i:Math.abs(t.value*i);const o=n+a+h/2,l=this.i18n.get(t.label)||t.label;new Ot(e,o,r,"STACK_HEADER",l,this.styles,vt.Bottom,vt.Center).draw(),a+=h}))}const n=["scenario1","scenario2","scenario3","scenario4"],r=[];for(const t of n){const i=h[t];i&&!i.isEmpty()&&null!=i.value&&r.push({value:i.value,scenario:i.scenario,dataPoint:i})}if(0===r.length)return;const a=new Set(r.map((t=>Y(t.scenario)))),o=this.position.getBarPositionX(),l=this.position.getAxisTitlePositionY();if(a.size>1){const t=new Map;for(const i of r){const s=Y(i.scenario);t.has(s)||t.set(s,[]),t.get(s).push(i)}const i=[];for(const s of H)t.has(s)&&(i.push({prefix:s,segments:t.get(s)}),t.delete(s));for(const[s,e]of t)i.push({prefix:s,segments:e});i.forEach((t=>{const i=t.segments.reduce(((t,i)=>t+Math.abs(i.value)),0),s=t.segments[0].dataPoint.pixelPerUnit,h=o+(this.stackConfig.mode===C.RELATIVE?s:i*s)/2,n=this.i18n.get(t.prefix+"1")||t.prefix.toUpperCase();new Ot(e,h,l,"STACK_HEADER",n,this.styles,vt.Bottom,vt.Center).draw()}))}else{"asc"===this.stackConfig.order?r.sort(((t,i)=>t.value-i.value)):"desc"===this.stackConfig.order&&r.sort(((t,i)=>i.value-t.value));const t=r.reduce(((t,i)=>t+Math.abs(i.value)),0);let i=0;r.forEach((s=>{const h=s.dataPoint.pixelPerUnit;let n;n=this.stackConfig.mode===C.RELATIVE?(0!==t?Math.abs(s.value)/t:0)*h:Math.abs(s.value*h);const r=o+i+n/2,a=this.i18n.get(s.scenario)||s.scenario;new Ot(e,r,l,"STACK_HEADER",a,this.styles,vt.Bottom,vt.Center).draw(),i+=n}))}}getVarianceType(){return this.variancesDataModel.length>0?this.variancesDataModel[0].type:pt.NONE}calculateLeftSideWidth(t){var i,s,e;let h=0;const n=this.styles.fontStyles.size*this.styles.scaleFactors.labelToBar;if(pt.NONE===t&&null!=(null===(i=this.smallestDataPointValue)||void 0===i?void 0:i.value)&&this.smallestDataPointValue.value<0){const t=this.calculateTextBoxWidth(this.smallestDataPointValue.value);h=Math.abs(this.smallestDataPointValue.getScaledUnit())+n+t}else if(pt.RELATIVE===t&&null!=(null===(s=this.smallestVarianceDataPointValue)||void 0===s?void 0:s.value)&&this.smallestVarianceDataPointValue.value<0){const t=this.calculatePercentageTextBoxWidth(this.smallestVarianceDataPointValue.value);h=Math.abs(this.smallestVarianceDataPointValue.getScaledPercentUnit())+n+t}else if(pt.ABSOLUTE===t&&null!=(null===(e=this.smallestVarianceDataPointValue)||void 0===e?void 0:e.value)&&this.smallestVarianceDataPointValue.value<0){const t=this.calculateTextBoxWidth(this.smallestVarianceDataPointValue.value);h=Math.abs(this.smallestVarianceDataPointValue.getScaledUnit())+n+t}return h<=this.titleLength?this.titleLength:h}calculateRightSideWidth(t){var i,s,e;if(null!=this.stackConfig&&this.highestStackedTotal>0){const t=this.styles.fontStyles.size*this.styles.scaleFactors.labelToBar;let i;i=this.stackConfig.mode===C.RELATIVE?this.pixelPerUnit:this.highestStackedTotal*this.pixelPerUnit;const s=this.calculateTextBoxWidth(this.highestStackedTotal);return Math.max(i+t+s,this.titleLength)}let h=0;const n=this.styles.fontStyles.size*this.styles.scaleFactors.labelToBar;if(pt.NONE===t&&null!=(null===(i=this.highestDataPointValue)||void 0===i?void 0:i.value)&&this.highestDataPointValue.value>=0){const t=this.calculateTextBoxWidth(this.highestDataPointValue.value);h=Math.abs(this.highestDataPointValue.getScaledUnit())+n+t}else if(pt.RELATIVE===t&&null!=(null===(s=this.highestVarianceDataPointValue)||void 0===s?void 0:s.value)&&this.highestVarianceDataPointValue.value>=0){const t=this.calculatePercentageTextBoxWidth(this.highestVarianceDataPointValue.value);h=Math.abs(this.highestVarianceDataPointValue.getScaledPercentUnit())+n+t}else if(pt.ABSOLUTE===t&&null!=(null===(e=this.highestVarianceDataPointValue)||void 0===e?void 0:e.value)&&this.highestVarianceDataPointValue.value>=0){const t=this.calculateTextBoxWidth(this.highestVarianceDataPointValue.value);h=Math.abs(this.highestVarianceDataPointValue.getScaledUnit())+n+t}return h<=this.titleLength?this.titleLength:h}populateDimensionStackSegments(t,i,s){var e;if(0===(null===(e=this.preparedDataSet)||void 0===e?void 0:e.length)||0===t.length)return;const h={[O.ROWGROUP]:"category",[O.ROWGROUPINDEX]:"category",[O.CATEGORY]:"subCategory",[O.CATEGORYINDEX]:"subCategory"}[s];if(!h)return;const n=s.toString(),r=t[0],a=q(`SELECT [${n}] as displayGroup, [${h}] as stackLabel, SUM([${r}] * transformOperator(operation)) as stackValue FROM ? GROUP BY [${n}], [${h}]`,[this.preparedDataSet]),o=new Map;for(const t of a){const i=t.displayGroup;o.has(i)||o.set(i,[]),null!=t.stackValue&&null!=t.stackLabel&&o.get(i).push({label:t.stackLabel,value:t.stackValue})}for(const t of this.dataModel){const i=o.get(t.category);t.stackSegments=i&&i.length>0?i.map((t=>({label:t.label,value:t.value,dataPoint:new bt(t.value,r,this.pixelPerUnit,ft.NEU)}))):[]}}hasNoData(){return 0===this.dataModel.length}setAvailableWidth(t){if(this.pixelPerUnit<=0||t<=0)this.overflowConfig=null;else if(null==this.stackConfig){if(this.overflowConfig=this.calculateOverflowConfig(t),this.overflowConfig){const{cutWidth:t,overdriveZoneWidth:i,breakGap:s}=this.overflowConfig,e=t+i+s;this.variancesDataModel&&this.variancesDataModel.length>0?(this.highestVarianceDataPointValue.getScaledUnit()>t&&(this.highestVarianceDataPointValue=new bt(e,this.highestVarianceDataPointValue.scenario,1,this.highestVarianceDataPointValue.variance)),null!=this.smallestVarianceDataPointValue.value&&Math.abs(this.smallestVarianceDataPointValue.getScaledUnit())>t&&(this.smallestVarianceDataPointValue=new bt(-e,this.smallestVarianceDataPointValue.scenario,1,this.smallestVarianceDataPointValue.variance))):(this.highestDataPointValue.getScaledUnit()>t&&(this.highestDataPointValue=new bt(e,this.highestDataPointValue.scenario,1,this.highestDataPointValue.variance)),null!=this.smallestDataPointValue.value&&Math.abs(this.smallestDataPointValue.getScaledUnit())>t&&(this.smallestDataPointValue=new bt(-e,this.smallestDataPointValue.scenario,1,this.smallestDataPointValue.variance))),this.updatePosition()}}else this.overflowConfig=null}calculateOverflowConfig(t){const i=this.variancesDataModel&&this.variancesDataModel.length>0;if(this.getVarianceType()===pt.RELATIVE)return null;const s=i?this.highestVarianceDataPointValue:this.highestDataPointValue,e=i?this.smallestVarianceDataPointValue:this.smallestDataPointValue,h=s.getScaledUnit(),n=null!=e.value?Math.abs(e.getScaledUnit()):0,r=Math.max(h,n);if(r<=0)return null;const a=this.styles.fontStyles.size,o=a*this.styles.scaleFactors.labelToBar,l=1.5*a,c=.3*a,d=.8*a,u=t-this.position.getAxisPositionX()-this.styles.padding.left-this.styles.padding.right-o-this.calculateTextBoxWidth(s.value||0)-l-c;if(u<=d)return null;const p=u-d;return r<=p?null:{cutWidth:u,overdriveZoneWidth:l,breakGap:c,maxOverflow:r-p,scenarioCutOffset:d}}}const Et=class{constructor(i){t(this,i),this.data=[],this.chartTitle="",this.scenarios=[],this.variances=[],this.hideCategories=!1,this.pixelPerUnit=10,this.pixelPerPercentage=50,this.limit=0,this.i18n=new Map,this.order={hierarchy:[],direction:_.ASC},this.level=O.CATEGORY,this.filter="",this.measureScale="_",this.measureUnit="",this.showMeasureScale=!0,this.dataFormatDigits={percent:2,decimal:1},this.stackConfig=null,this.parentDimensions={width:0,height:0}}render(){var t,e,h;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:null===(t=this.pattern)||void 0===t?void 0:t.toString(),class:"hidePatternContainer"}),i("div",{class:this.showMeasureScale?"footer":"footer-hide"},null===(e=this.chart)||void 0===e?void 0:e.getFooter()),i("div",{innerHTML:null===(h=this.chart)||void 0===h?void 0:h.toString()}))}async componentWillLoad(){var t;const i=this.prepareConfig(),s=this.prepareStyle();this.chart=new $t(new it,i,s),this.chart.setI18n(this.i18n),this.autoFitScaling(i,s),this.chart.setAvailableWidth((null===(t=this.parentDimensions)||void 0===t?void 0:t.width)||0),this.pattern=new dt(this.chart.styles),this.chart.setPattern("fc",this.pattern.getFCPolygonPattern())}async componentWillUpdate(){var t;if(null==this.chart)return;const i=this.prepareConfig(),s=this.prepareStyle();this.chart.setI18n(this.i18n),this.chart.setStyles(s),this.chart.setConfig(i),this.autoFitScaling(i,s),this.chart.setAvailableWidth((null===(t=this.parentDimensions)||void 0===t?void 0:t.width)||0),this.pattern=new dt(this.chart.styles),this.chart.setPattern("fc",this.pattern.getFCPolygonPattern())}autoFitScaling(t,i){var s;if(t.pixelPerUnit>0)return;const e=null===(s=this.parentDimensions)||void 0===s?void 0:s.width;if(!e||e<=0)return t.pixelPerUnit=1,this.chart=new $t(new it,t,i),void this.chart.setI18n(this.i18n);t.pixelPerUnit=1,this.chart=new $t(new it,t,i),this.chart.setI18n(this.i18n),this.chart.toString();const h=this.chart.getAllocatedCanvasWidth();if(h<=0)return;const n=this.chart.getMaxBarValue();t.pixelPerUnit=n>0?Math.max(.001,(e-(h-n))/n):.9*e/h,this.chart=new $t(new it,t,i),this.chart.setI18n(this.i18n)}async componentWillRender(){}componentDidLoad(){}componentDidUpdate(){}prepareConfig(){return new wt(new St,new E(new tt),new tt,new K,this.data).adapt({data:this.data,scenarios:this.scenarios,variances:this.variances,title:this.chartTitle,hideCategories:this.hideCategories,pixelPerUnit:this.pixelPerUnit,pixelPerPercentage:this.pixelPerPercentage,level:this.level,limit:this.limit,sortOrder:this.order,filter:this.filter,measureScale:this.measureScale,measureUnit:this.measureUnit,showMeasureScale:this.showMeasureScale,dataFormatDigits:this.dataFormatDigits,stackConfig:this.stackConfig})}prepareStyle(){return new Pt(new Lt,new V,new z(new X),new F(new X),new G).adapt(this.styles)}get element(){return e(this)}};Et.style=':host{display:inline-block;position:relative;overflow:hidden}.container{display:flex;flex-direction:row}.background-image{display:flex;flex-wrap:wrap;justify-content:flex-end}.categories{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.label-bg{fill:var(--bn-font-background, white);opacity:0.7}.label-text{text-align:right;font-size:var(--bn-font-size, 1em);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-title{text-align:center;font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);color:var(--bn-font-color, black)}.axis-ac{stroke:black;stroke-width:0.1em}.axis-pp{stroke:grey;stroke-width:0.1em}.axis-fc{stroke:black;stroke-dasharray:2;stroke-width:0.1em}.axis-pl{stroke:white;stroke-width:0.1em;outline-offset:0em;outline:0.1em solid black}canvas{image-rendering:-moz-crisp-edges;image-rendering:-webkit-crisp-edges;image-rendering:pixelated;image-rendering:crisp-edges}.measure{font-weight:bold}span{display:inline-block}.hidePatternContainer{height:0;width:0}div{float:left}.warning{font-size:0.8em;font-style:italic}.footer{margin:0.2em;font-size:0.6em}.footer-hide{margin:0.2em;font-size:0.6em;opacity:0}';export{st as bn_chart_structure,et as bn_context,ht as bn_datasource,at as bn_page,Et as ibcs_chart_structure}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as t,r as e,H as o,g as s}from"./p-JNHhIe7t.js";import{a as n,T as r,O as i,F as l}from"./p-DHezf8pZ.js";import{F as a,Q as c,V as h}from"./p-1jFf17Vj.js";import{I as u,d,g as p,f,l as m,T as $,M as v}from"./p-Bnhh02CF.js";import{a as g}from"./p-BYmPQYxx.js";import{I as R,S as w}from"./p-ChlK-T9I.js";import{D as b,S as O,a as S,b as y}from"./p-5KQYRQLK.js";import{w as E}from"./p-DvDDgmcV.js";import"./p-BFTU3MAI.js";import"./p-CL1RYuNU.js";import"./p-DvvwfRQG.js";class M{constructor(t,e,o,s,n,r,i,l,a){this.prefixStyle="prefix",this.isBarChart=!1,this.key=t,this.index=e,this.value=o,this.prefix=r||"",this.cssStyle=s||"",this.prefixStyle=i||"prefix",this.type=n,this.mark=void 0,this.colSpan=l||1,this.measureScale=a||1}getAsHeaderList(){if(null==this.value)return[""];const t=[];for(const e of this.value.toString().split("<br/>"))t.push(e);return t}draw(t){let e=this.value;if("undefined"===e||void 0===e||null==e)return"";if(Number.isNaN(Number(e)))return e;if(""===this.type||void 0===this.type||null==this.type)return e;let o=t.percent,s=t.percent;return"decimal"===this.type&&(e=+e/this.measureScale,o=t.decimal,s=t.decimal),a.number(Number(e),this.type,o,s)}drawPrefix(){return null==this.prefix?"":this.prefix}}class U{constructor(t,e,o){this.index=t,this.groupindex=e,this.type=o,this.cssStyle=this.initCssStyle(),this.elements=[]}initCssStyle(){switch(this.type){case n.HEADER:return"groupheader";case n.SEPERATORLINE:return"";case n.DRILLELEMENT:return"ofit";case n.PARTELEMENT:return"partof";case n.STANDARD:return"";case n.SUM:return"sum";default:return""}}getCells(){return this.elements}createElement(t,e,o,s,r,i,l,a,c,h=!1,u){let d=i;"category"===e&&null!=a&&(d=`category-${a.toString()}`),this.type===n.HEADER?d="headerlabel":this.type===n.SEPERATORLINE&&(d=e),this.type===n.PARTELEMENT&&("percent"===s&&(t="-"),"category"!==e&&"operation"!==e&&(s="percent",d="")),"-"===t&&(d="");let p="prefix-first";l&&(p="prefix-second"),o&&(d=`${d} ${o}`);const f=new M(e,this.elements.length,t,d,s,r,p,1,c);f.isBarChart=h,f.columnStats=u,this.elements.push(f)}}const G={positive:{stroke:"#008f96",fill:"#008f96",fillpattern:"solid"},negative:{stroke:"#ff0000",fill:"#ff0000",fillpattern:"solid"},neutral:{stroke:"#808080",fill:"#808080",fillpattern:"outlined"},scenarios:{ac:{stroke:"#404040",fill:"#404040",fillpattern:"solid"},pp:{stroke:"#A6A6A6",fill:"#A6A6A6",fillpattern:"solid"},fc:{stroke:"#404040",fill:"#ffffff",fillpattern:"hatched"},pl:{stroke:"#404040",fill:"#ffffff",fillpattern:"outlined"}},fontColor:"#000000",fontSize:11,fontFamily:"'Noto Sans', sans-serif",unitScaling:.01,percentageScaling:.5,scaleFactor:1},T="#666666";function C(t,e){return`pattern-${t}-${e.replace("#","")}`}const _=({styles:e})=>{const o=e.scaleFactor,s=6*o,n=[{id:C("pos",e.positive.stroke),stroke:e.positive.stroke,fill:e.positive.fill},{id:C("neg",e.negative.stroke),stroke:e.negative.stroke,fill:e.negative.fill},{id:C("neu",e.neutral.stroke),stroke:e.neutral.stroke,fill:e.neutral.fill}];return t("defs",null,n.map((e=>t("pattern",{id:e.id,patternUnits:"userSpaceOnUse",width:s,height:s},t("rect",{width:s,height:s,fill:"#ffffff"}),t("line",{x1:"0",y1:s,x2:s,y2:"0",stroke:e.stroke,"stroke-width":1.5*o})))))};function N(t,e,o=1){let s,n;const r=t>=0?"+":"";if(e)return s=100*t,r+Math.round(s).toString()+"%";{let e;return s=t/o,n=Math.abs(s),e=n>=1e9?(s/1e9).toFixed(n>=1e10?0:1)+"B":n>=1e6?(s/1e6).toFixed(n>=1e7?0:1)+"M":n>=1e3?(s/1e3).toFixed(n>=1e4?0:1)+"K":s.toFixed(n>=10?0:1),e=e.replace(/\.0([KMB]?)$/,"$1"),r+e}}function L(t){const e=t.slice(0,2).toLowerCase();return["ac","pp","fc","pl"].includes(e)}function P(t){const e=t.slice(0,2).toLowerCase();return"pp"===e?"pp":"fc"===e?"fc":"pl"===e?"pl":"ac"}function x(t,e,o,s){return L(t)?function(t,e){const o=P(t);return e.scenarios[o]}(t,s):function(t,e,o){const s=t>=0;return e?s?o.positive:o.negative:s?o.negative:o.positive}(e,o,s)}const k=e=>{const{value:o,scenario:s,columnStats:n,height:r,isPositiveGood:i,formattedValue:l,measureScale:a,maxBarWidth:c=10,styles:h=G}=e,u=h.scaleFactor,d=h.fontSize,p=38*u,f=c*d,m=4*u,$=.15*f,v=f-m-$,g=Math.abs(o)*h.unitScaling*d,R=g>v,w=Math.max(0,n.absMax*h.unitScaling*d-v),b=Math.max(0,g-v),O=w>0?b/w*$:0,S=n.min<0,y=n.max>0,E=S?f:0,M=(S?p:0)+(E+(y?f:0))+(y?p:0),U=2*u,k=r-2*U,A=(S?p:0)+E,D=U,B=o>=0,Y=x(s,o,i,h),F=function(t,e){const o=t.fillpattern;return"hatched"===o?`url(#${C(e,t.stroke)})`:"outlined"===o?"transparent":t.fill}(Y,L(s)?P(s):i?B?"pos":"neg":B?"neg":"pos"),{stroke:H,strokeWidth:W}="outlined"===(I=Y).fillpattern?{stroke:I.stroke,strokeWidth:1.5}:{stroke:"none",strokeWidth:0};var I;const j=l||N(o,!1,a),z=R?v:g,Q=R?v+m+O:g,V=B?A+Q+4*u:A-Q-4*u,K=B?"start":"end";return t("svg",{width:M,height:r,class:"cell-bar-chart absolute-variance",style:{overflow:"visible"}},t(_,{styles:h}),t("line",{x1:A,y1:0,x2:A,y2:r,stroke:T,"stroke-width":1*u}),z>0&&t("rect",{x:B?A:A-z,y:D,width:z,height:k,fill:F,stroke:H,"stroke-width":W*u}),R&&O>0&&t("rect",{x:B?A+v+m:A-v-m-O,y:D,width:O,height:k,fill:F,stroke:H,"stroke-width":W*u}),R&&function(e,o,s,n,r){const i=e+o/2,l=.35*o,a=n/3,c=.3*o;let h=`M ${i-l} ${s}`;for(let t=0;t<3;t++)h+=` L ${i-l-c} ${s+a*(t+.5)} L ${i-l} ${s+a*(t+1)}`;let u=`M ${i+l} ${s}`;for(let t=0;t<3;t++)u+=` L ${i+l+c} ${s+a*(t+.5)} L ${i+l} ${s+a*(t+1)}`;return[t("rect",{x:e,y:s-1,width:o,height:n+2,fill:"#ffffff"}),t("path",{d:h,fill:"none",stroke:"#000000","stroke-width":1*r}),t("path",{d:u,fill:"none",stroke:"#000000","stroke-width":1*r})]}(B?A+v:A-v-m,m,D,k,u),t("text",{x:V,y:r/2,dy:"0.35em","text-anchor":K,fill:h.fontColor,"font-size":d,"font-family":h.fontFamily},j))},A=e=>{const{value:o,scenario:s,columnStats:n,height:r,isPositiveGood:i,formattedValue:l,measureScale:a,maxBarWidth:c=10,styles:h=G}=e,u=h.scaleFactor,d=h.fontSize,p=Math.round(.67*c*d),f=5*u,m=n.min<0?p+f:0,$=m+(n.max>0?p+f:0),v=$+45*u,g=m,R=r/2,w=100*Math.abs(o)*h.percentageScaling*d,b=w>p,O=Math.min(w,p),S=o>=0,y=S?g+O:g-O,E=x(s,o,i,h),M=3*u,U=l||N(o,!0,a),C=$+4*u;return t("svg",{width:v,height:r,class:"cell-bar-chart relative-variance",style:{overflow:"visible"}},t("line",{x1:g,y1:0,x2:g,y2:r,stroke:T,"stroke-width":1*u}),!b&&t("circle",{cx:y,cy:R,r:M,fill:h.fontColor}),t("line",{x1:g,y1:R,x2:y,y2:R,stroke:E.fill,"stroke-width":2*u}),b&&S&&t("polygon",{points:`${g+p},${R} ${g+p-6*u},${R-3*u} ${g+p-6*u},${R+3*u}`,fill:E.fill}),b&&!S&&t("polygon",{points:`${g-p},${R} ${g-p+6*u},${R-3*u} ${g-p+6*u},${R+3*u}`,fill:E.fill}),t("text",{x:C,y:r/2,dy:"0.35em","text-anchor":"start",fill:h.fontColor,"font-size":d,"font-style":"italic","font-family":h.fontFamily},U))},D=e=>{const{value:o,columnStats:s,isRelative:n,styles:r=G}=e;return null==o||isNaN(o)||!s||0===s.absMax?t("span",{class:"bar-chart-empty",style:{color:r.fontColor,fontStyle:"italic"}},"-"):t(n?A:k,Object.assign({},e))};class B{constructor(t){g.fn.transformOperator=function(t){return"-"===t?-1:1},this.groups=[c.CATEGORY,c.CATEGORYINDEX],r.OPT!==t.type&&r.OPTNOTOTAL!==t.type||this.groups.unshift(c.OPERATION),t.grouped&&(this.groups.push(c.ROWGROUP),this.groups.push(c.ROWGROUPINDEX))}toString(){return this.groups.map((t=>`${t}`)).toString()}noCategory(){return this.groups.filter((t=>t!==c.CATEGORY))}toArray(){return this.groups}}class Y{constructor(t,e){this.hasPartOf=!1,this.config=t,this.i18n=e}execute(t){if(0===t.length)return[];const e=[],o=[],s=[],n=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!1,this.config.type))).toString(),r=this.config.scenarios.map((t=>this.translateScenarioSQL(t,!0,this.config.type))).toString(),i=this.getRelativeScenarios(),l=new B(this.config),a=this.config.grouped?[c.ROWGROUP,c.ROWGROUPINDEX]:[];let h=["",""];return this.config.sortOrder.hierarchy.length>0&&(h=this.createOrderString(this.config.sortOrder)),this.hasPartOf=this.checkConfigForPartOf(),g(`SELECT COUNT(DISTINCT ${c.CATEGORY}) as ${c.TOTALROWCOUNT} ${a.length>0?","+a:""}\n FROM ? ${a.length>0?"GROUP BY "+a:""} \n ORDER BY ${h[0]}`,[t]).forEach((t=>{const s=t.rowGroup&&t.rowGroup.length>0?`WHERE ${c.ROWGROUP} = '${t.rowGroup}'`:"";let i="";this.config.limit&&(i=`LIMIT ${this.config.limit}`),this.createGroupHeaderRow(t,e),this.createDataRow(e,t,l,n,s,h,i),this.createRestRow(t,e,l,n,s,h),this.createGroupSumRow(e,o,t,r,h)})),this.createTotalSumRow(e,o,r),e.forEach((e=>{try{s.push(g(e,[t]))}catch(t){console.error("DataQuery: SQL query execution failed",e,t)}})),this.detectNaNCells(this.config.scenarios,s),this.createThereOfDrillRows(n,h,t,s),this.createPartOfDrillRows(n,h,o,t,s),this.createThereOfDrillColumns(this.config.categoryThereOf,t,s),this.calculateColumnGroupRest(s,this.config.categoryThereOf),this.calculateRelativeVariances(s,i),s}detectNaNCells(t,e){e.forEach((e=>{e.map((e=>(t.forEach((t=>{const o=new h(t);!0===o.isValid?0!==e[o.base+"_cnt"]&&0!==e[o.delta+"_cnt"]||(e[t]=Number.NaN):0===e[t+"_cnt"]&&(e[t]=Number.NaN)})),e)))}))}createPartOfDrillRows(t,e,o,s,n){if(null==this.config.partOf||0===this.config.partOf.length||this.config.type===r.LIST||null==s||0===s.length)return;const i=this.createPartOfQuery(t,e);let l=[];i.forEach((function(t){l.push(...g(t,[s]))}));const a=this.exctractScenarioNames(t),h=[];o.forEach((function(t){h.push(...g(t,[s]))}));const u=new Map;h.forEach((t=>u.set(t[c.ROWGROUP],t))),l=this.reduceResDrillByCategoryGroups(l,a),l.forEach((function(t){a.forEach((e=>{try{t[e]=t[e]/u.get(t[c.ROWGROUP])[e]}catch(o){console.error("DataQuery: partOf drill row calculation failed",e,o),t[e]=Number.NaN}}))})),this.injectDrillRowsToResultRows(l,n)}createRestRow(t,e,o,s,n,r){t.totalRowCnt-this.config.limit>0&&0!==this.config.limit&&e.push(`SELECT ${c.ROWNR}, 1 as ${c.ROWGROUPINDEX} , 'ENTRY' as ${c.TYPE}, 'NO_GROUP' as ${c.ROWGROUP}, 'REST' as ${c.CATEGORY} , SUM(ac1) as ac1, SUM(pp1) as pp1, SUM(dpp1_ac1_pos) as dpp1_ac1_pos, SUM(drpp1_ac1_pos) as drpp1_ac1_pos, SUM(dr_pp1) as dr_pp1 FROM (SELECT ROWNUM() AS ${c.ROWNR}, ${e.length} as ${c.ROWGROUPINDEX} , 'ENTRY' as ${c.TYPE}, '${t.rowGroup||"NO_GROUP"}' as ${c.ROWGROUP}, ${o} ${s.length>0?",".concat(s):""} FROM ? ${n} GROUP BY ${o} ORDER BY ${r[0]}) t WHERE t.rowNr > ${this.config.limit}`)}createDataRow(t,e,o,s,n,r,i){t.push(`SELECT ROWNUM() AS ${c.ROWNR},\n ${t.length} as ${c.ROWGROUPINDEX},\n 'ENTRY' as ${c.TYPE},\n '${e.rowGroup||"NO_GROUP"}' as ${c.ROWGROUP},\n '${c.CATEGORYINDEX}',\n ${o} ${s.length>0?",".concat(s):""}\n FROM ? ${n}\n GROUP BY ${o}\n ORDER BY ${r[0]} ${i}`)}createGroupHeaderRow(t,e){!0===this.config.grouped&&e.push(`SELECT ROWNUM() AS ${c.ROWNR},\n ${e.length} as ${c.ROWGROUPINDEX},\n 'GROUPHEAD' as ${c.TYPE},\n '${t.rowGroup}' as ${c.ROWGROUP} ${this.config.showGroupTitle?`,'${t.rowGroup}' as ${c.CATEGORY}`:""}\n FROM ?\n GROUP BY '1'`)}createGroupSumRow(t,e,o,s,n){!0!==this.config.grouped||r.SUM!==this.config.type&&r.SUMNOTOTAL!==this.config.type&&r.OPT!==this.config.type&&r.OPTNOTOTAL!==this.config.type||(t.push(`SELECT ${t.length} as ${c.ROWGROUPINDEX},\n '=' as ${c.OPERATION},\n '${o.rowGroup}' as ${c.ROWGROUP},\n ROWNUM() AS ${c.ROWNR},\n 'GROUP_SUM' as ${c.TYPE} ${s.length>0?",".concat(s):""}\n FROM ?\n WHERE ${c.ROWGROUP} = '${o.rowGroup}'\n ORDER BY ${n[0]} `),e.push(`SELECT ${t.length} as ${c.ROWGROUPINDEX},\n '=' as ${c.OPERATION},\n '${o.rowGroup}' as ${c.ROWGROUP},\n ROWNUM() AS ${c.ROWNR},\n 'GROUP_SUM' as ${c.TYPE} ${s.length>0?",".concat(s):""}\n FROM ?\n WHERE ${c.ROWGROUP} = '${o.rowGroup}'\n ORDER BY ${n[0]} `))}createTotalSumRow(t,e,o){if(r.SUM===this.config.type||r.OPT===this.config.type){const e=`${this.hasPartOf&&!1===this.config.grouped?`${this.i18n.get("SUM_TOTAL")||"SUM_TOTAL"} `:""}${this.config.title}`;t.push(`SELECT ${t.length} as ${c.ROWGROUPINDEX},\n '${e}' as ${c.ROWGROUP},\n '=' as ${c.OPERATION},\n 'SUM' as ${c.TYPE} ${o.length>0?",".concat(o):""}\n FROM ? `)}e.push(`SELECT ${t.length} as ${c.ROWGROUPINDEX},\n 'SUM_TOTAL' as ${c.ROWGROUP},\n '=' as ${c.OPERATION},\n 'SUM' as ${c.TYPE} ${o.length>0?",".concat(o):""}\n FROM ? `)}reduceResDrillByCategoryGroups(t,e){const o=new Map;return t.forEach((function(t){const s=t.rowNr+t.rowGroup+t.type+t.category;if(o.has(s)){const n=o.get(s);e.forEach((e=>{try{n[e]+=t[e]}catch(t){console.error("DataQuery: drill row aggregation failed",e,t)}}))}else o.set(s,t)})),[...o.values()]}injectDrillRowsToResultRows(t,e){const o=new Map;if(!0===this.config.grouped)t.forEach((function(t){e.forEach((function(e){const s=e.findIndex((e=>e.category===t.category&&e.rowGroup===t.rowGroup));if(s>=0){if(o.has(`${t.category}_${t.rowGroup}`)){const e=o.get(`${t.category}_${t.rowGroup}`)||0;o.set(`${t.category}_${t.rowGroup}`,e+1)}else o.set(`${t.category}_${t.rowGroup}`,1);t[c.ROWNR]=o.get(`${t.category}_${t.rowGroup}`),e.splice(s+t[c.ROWNR],0,t)}}))}));else{const s=this.findDuplicateSubCategories(t);t.forEach((function(t){e.forEach((function(e){const n=e.findIndex((e=>null!=e.category&&e.category===t.category));if(n>=0){if(o.has(`${t.category}`)){const e=o.get(`${t.category}`)||0;o.set(`${t.category}`,e+1)}else o.set(`${t.category}`,1);(1===t[c.ROWNR]||s.includes(t.subCategory))&&(t.subCategory=`${t.subCategory} (${t.rowGroup})`),e.splice(n+t[c.ROWNR],0,t)}}))}))}}createThereOfDrillRows(t,e,o,s){if(void 0===this.config.thereOf||0===this.config.thereOf.length)return;const n=[],r=[];this.config.thereOf.forEach((o=>{let s=!0,r="1 <> 1 OR ( ";null!=o.category&&0!==o.category.length&&o.category.trim()&&(r+=` ${c.CATEGORY} = '${o.category}'`,s=!1),null!=o.rowGroup&&0!==o.rowGroup.length&&o.rowGroup.trim()&&(r+=` ${s?"":"AND"} ${c.ROWGROUP} = '${o.rowGroup}'`,s=!1),null!=o.subCategory&&0!==o.subCategory.length&&o.subCategory.trim()&&(r+=` ${s?"":"AND"} ${c.SUBCATEGORY} = '${o.subCategory}'`),r+=")",n.push(`SELECT ROWNUM() AS ${c.ROWNR},\n null as operation,\n 'DRILLELEMENT' as ${c.TYPE},\n ${c.CATEGORY},\n ${c.SUBCATEGORY},\n ${c.ROWGROUP} as ${c.ROWGROUP},\n ${t}\n FROM ?\n WHERE ${r}\n GROUP BY ${c.ROWGROUP}, ${c.CATEGORY}, ${c.SUBCATEGORY}\n ORDER BY ${e[1]}`)})),n.forEach((function(t){r.push(...g(t,[o]))})),this.injectDrillRowsToResultRows(r,s)}calculateRelativeVariances(t,e){t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[c.TYPE]&&e.forEach(((e,o)=>{t[o]=t[o]/t[e]}))}))}))}calculateColumnGroupRest(t,e){if(null==e||0===e.size)return;const o=new Map,s=new Map;e.forEach(((t,e)=>{const n=t,r=[];for(const t of n)r.push(`${e}##${t.name}`);o.set(e,r),s.set(`${e}##REST`,!1)})),t.forEach((t=>{t.forEach((t=>{"GROUPHEAD"!==t[c.TYPE]&&o.forEach(((e,o)=>{let n=0;e.forEach((e=>{void 0!==t[e]&&(n+=t[e])})),t[`${o}##REST`]=t[o]-n,0!==t[`${o}##REST`]&&s.set(`${o}##REST`,!0)}))}))}));const n=Array.from(s.entries()).filter((([t,e])=>!e)).map((([t])=>t));t.forEach((t=>{t.forEach((t=>{for(const e of n)delete t[e]}))}))}getRelativeScenarios(){const t=new Map;return this.config.scenarios.forEach((e=>{const o=this.createRelativeScenario(e);null!=o&&t.set(o.key,o.value)})),t}translateScenarioSQL(t,e,o){const s=new h(t);return r.OPT===o||r.OPTNOTOTAL===o?s.isValid?"dr"===s.type?`SUM(${s.base} - ${s.delta}) as ${t}, SUM(${s.delta}) as dr_${s.delta}`:`SUM(${s.base} - ${s.delta}) as ${t}`:e?`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:`SUM(${t}) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`:s.isValid?"dr"===s.type?`SUM((${s.base} * transformOperator(operation)) - (${s.delta} * transformOperator(operation))) as ${t}, SUM(${s.delta} * transformOperator(operation)) as dr_${s.delta}`:`SUM((${s.base} * transformOperator(operation))- (${s.delta} * transformOperator(operation))) as ${t}`:`SUM(${t} * transformOperator(operation)) as ${t}, COUNT(ISNULL(${t})) as ${t}_cnt`}createOrderString(t){return[`${t.hierarchy.toString()} ${t.direction}`,`${t.hierarchy.toString()} ${i.ASC===t.direction?i.DESC:i.ASC}`]}createRelativeScenario(t){const e=new h(t);return e.isValid&&"dr"===e.type?{key:`${t}`,value:`dr_${e.delta}`}:null}exctractScenarioNames(t){const e=[];return t.split(",").forEach((t=>t.length>=2?e.push(t.split("as")[1].trim()):null)),e}findDuplicateSubCategories(t){const e=t.map((t=>({count:1,subCategory:t.subCategory}))).reduce(((t,e)=>(t[e.subCategory]=(t[e.subCategory]||0)+e.count,t)),{});return Object.keys(e).filter((t=>e[t]>1))}createPartOfQuery(t,e){var o;const s=[];let n="1 <> 1 ",r=` ${c.ROWGROUP}`,i="ROWNUM()";return null===(o=this.config.partOf)||void 0===o||o.forEach((t=>{n+=`OR (${c.CATEGORY} = '${t.category}'`,null!=t.rowGroup&&0!==t.rowGroup.length&&t.rowGroup.trim()&&(n+=`and ${c.ROWGROUP} = '${t.rowGroup}'`),!1===this.config.grouped&&(r=` 'SUM_TOTAL' as ${c.ROWGROUP} `,i="1"),n+=")"})),s.push(`SELECT ${i} AS ${c.ROWNR},\n 'PARTELEMENT' as ${c.TYPE},\n ${c.CATEGORY},\n ${r},\n ${t}\n FROM ?\n WHERE ${n}\n GROUP BY ${c.ROWGROUP}, ${c.CATEGORY}, ${c.TYPE}\n ORDER BY ${e[1]}`),s}checkConfigForPartOf(){return null!=this.config.partOf&&0!==this.config.partOf.length}createThereOfDrillColumns(t,e,o){if(null==t||0===t.size)return;const s=[],n=[];t.forEach(((t,e)=>{let o="1 <> 1 ";t.forEach((t=>{o+=` or columnGroup = '${t.name}' `})),s.push(`SELECT 'ENTRY' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, columnGroup, scenario`),s.push(`SELECT 'ENTRY' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, columnGroup, columnSubGroup, scenario`),s.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, scenario`),s.push(`SELECT 'DRILLELEMENT' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n category,\n subCategory,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, category, subCategory, columnGroup, columnSubGroup, scenario`),s.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, columnGroup, scenario`),s.push(`SELECT 'GROUP_SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n rowGroup,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, rowGroup, columnGroup, columnSubGroup, scenario`),s.push(`SELECT 'SUM' as rowlevel,\n 'COLUMNGROUP' as columnlevel,\n columnGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, columnGroup, scenario`),s.push(`SELECT 'SUM' as rowlevel,\n 'SUBGROUP' as columnlevel,\n columnGroup,\n columnSubGroup,\n '${e}' as scenario,\n sum(${e} * transformOperator(operation)) as val\n FROM ?\n WHERE ${o}\n GROUP BY rowlevel, columnGroup, columnSubGroup, scenario`)}));for(const t of s)n.push(...g(t,[e]));this.injectDrillColumnsToResultRows(n,o)}injectDrillColumnsToResultRows(t,e){const o="##";for(const s of t)for(const t of e)for(const e of t)e.type===s.rowlevel&&("ENTRY"===s.rowlevel?"COLUMNGROUP"===s.columnlevel&&e.category===s.category?e[s.scenario+o+s.columnGroup]=s.val:"SUBGROUP"===s.columnlevel&&e.category===s.category&&(e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val):"DRILLELEMENT"===s.rowlevel?"COLUMNGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory?e[s.scenario+o+s.columnGroup]=s.val:"SUBGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory?e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val:"COLUMNGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===`${s.subCategory} (${s.rowGroup})`?e[s.scenario+o+s.columnGroup]=s.val:"SUBGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===`${s.subCategory} (${s.rowGroup})`&&(e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val):("SUM"===s.rowlevel||"GROUP_SUM"===s.rowlevel)&&("COLUMNGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory&&(e[s.scenario+o+s.columnGroup]=s.val),"SUBGROUP"===s.columnlevel&&e.category===s.category&&e.subCategory===s.subCategory&&(e[s.scenario+o+s.columnGroup+o+s.columnSubGroup]=s.val)))}}class F{constructor(){this.normalizedHeader=[]}createHeader(t,e,o,s,r,i){const l=[];this.normalizedHeader=this.normalizeHeader(t,e);const c=new U(0,0,n.HEADER),h=new U(1,0,n.SEPERATORLINE);for(const t of this.normalizedHeader)c.createElement(a.translateScenarioLabel(t.name,o),t.type,this.createColumnType(t),null,this.setHeaderPrefix(t,o,s,r,i),null,null,null,null),h.createElement(null,t.type,this.createColumnType(t),null,null,null,null,null,null);return l.push(c),l.push(h),l}setHeaderPrefix(t,e,o,s,n){let r="";return"category"===t.name&&n&&(0===o.prefix.length&&0===s.length||(r=a.translateScenarioLabel("in",e)+" "+o.prefix+s)),t.order&&(r+=a.translateScenarioLabel("ORDER_"+t.order,e)),r}normalizeHeader(t,e){let o=[{name:c.CATEGORY,group:c.CATEGORY,type:c.CATEGORY,order:void 0}];return r.OPT!==t&&r.OPTNOTOTAL!==t||(o=[{name:c.OPERATION,group:c.OPERATION,type:c.OPERATION,order:void 0},{name:c.CATEGORY,group:c.CATEGORY,type:c.CATEGORY,order:void 0}]),[...o,...e]}createBodyRows(t,e,o){const s=[];let n=-1;const r=new Y(t,e).execute(o),i=this.calculateColumnStatistics(r,t.barColumns);for(const o of r)n+=1,s.push(...this.createRow(t.i18n,e,t.scenariosUnitType,o,n,-1,t.categoryWidth,t.measureScale,t.barColumns,i));return s}calculateColumnStatistics(t,e){const o=new Map;if(!e||0===e.length)return o;const s=new Map;for(const t of e)o.set(t,{min:1/0,max:-1/0,absMax:0,median:0}),s.set(t,[]);for(const n of t)for(const t of n)for(const n of e){const e=this.extractColumnValue(t,n);if(null!==e&&!isNaN(e)){const t=o.get(n);t.min=Math.min(t.min,e),t.max=Math.max(t.max,e),s.get(n).push(Math.abs(e))}}for(const[t,e]of o){e.min!==1/0&&e.max!==-1/0||(e.min=0,e.max=0),e.absMax=Math.max(Math.abs(e.min),Math.abs(e.max));const n=s.get(t);if(n.length>0){n.sort(((t,e)=>t-e));const t=Math.floor(n.length/2);e.median=n.length%2==0?(n[t-1]+n[t])/2:n[t]}o.set(t,e)}return o}extractColumnValue(t,e){if(void 0!==t[e]){const o=Number(t[e]);return isNaN(o)?null:o}for(const o of Object.keys(t))if(o===e||o.endsWith("##"+e)||o===e+"##"+e){const e=Number(t[o]);if(!isNaN(e))return e}return null}createRow(t,e,o,s,n,r,i,l,a,h){var u;const d=[];for(const p of s){const f=p[c.ROWGROUP],m=p[c.SUBCATEGORY],$=p[c.TYPE],v=p[c.ROWNR]>=2,g=this.createDetailRow($,r+=1,n,s.length);for(const s of this.normalizedHeader){const n=this.getRawDataRowElement(p,s),r=null!==(u=null==a?void 0:a.includes(s.type))&&void 0!==u&&u,c=r?null==h?void 0:h.get(s.type):void 0;g.createElement(this.translateSumCellLabel(t,e,n,f,m,$,s.type),s.type,this.createColumnType(s),this.setCellType(s.type,o),this.translateCellPrefix(e,$,s.type),this.translateScenarioCSS(s.type,n),v,i,null==l?void 0:l.value,r,c)}d.push(g)}return d}getRawDataRowElement(t,e){return e.name===e.group&&e.name===e.type?t[e.name]:e.name===e.group&&e.name!==e.type?t[e.type+"##"+e.name]:t[e.type+"##"+e.group+"##"+e.name]}createDetailRow(t,e,o,s){switch(t){case n.GROUPHEAD:return new U(e,o,n.HEADER);case n.SUM:case n.GROUPSUM:return new U(s+2,o,n.SUM);case n.DRILLELEMENT:return new U(s+2,o,n.DRILLELEMENT);case n.PARTELEMENT:return new U(s+2,o,n.PARTELEMENT);default:return new U(e,o,n.STANDARD)}}translateSumCellLabel(t,e,o,s,n,r,i){return!1===Number.isNaN(Number(o))||this.isOperationColumn(i)?o:this.isGroupHeadCategory(r,i)||this.isEntryCategory(r,i)?t===u.ALL?`${e.get(o)||o}`:o:this.isDrillElementCategory(r,i)?t===u.ALL?`${e.get(n)||n}`:`${n}`:this.isPartElementCategory(r,i)?t===u.ALL||"SUM_TOTAL"===s?`${e.get(s)||s}`:`${s}`:this.isSumElementCategory(r,i)?t===u.ALL||"SUM_TOTAL"===s?`${e.get(s)||s}`:s:"GROUPHEAD"===r&&null==o?o:Number.isNaN(Number(o))?"-":Number(o)}isOperationColumn(t){return"operation"===t}translateScenarioCSS(t,e){const o=new h(t);let s="pos";return e<0&&(s="neg"),o.isValid?s+"_"+o.direction+("dr"===o.type?" relative_variance":""):t}setCellType(t,e){if("category"===t)return"";let o;const s=new h(t);return e===d.PERCENT?(o="percent",s.isValid&&"d"===s.type&&(o="decimal")):(o="decimal",s.isValid&&"dr"===s.type&&(o="percent")),o}isDrillElementCategory(t,e){return"DRILLELEMENT"===t&&"category"===e}isPartElementCategory(t,e){return"PARTELEMENT"===t&&"category"===e}isSumElementCategory(t,e){return("GROUP_SUM"===t||"SUM"===t)&&"category"===e}isEntryCategory(t,e){return"ENTRY"===t&&"category"===e}isGroupHeadCategory(t,e){return"GROUPHEAD"===t&&"category"===e}translateCellPrefix(t,e,o){return this.isOperationColumn(o)||this.isGroupHeadCategory(e,o)||this.isEntryCategory(e,o)?null:this.isDrillElementCategory(e,o)?`${t.get("there_of")} `:this.isPartElementCategory(e,o)?`${t.get("part_of")} `:null}createColumnType(t){return t.name===t.group&&t.name===t.type?"base":t.name===t.group?"columnGroup":"columnSubGroup"}}class H{constructor(t,e,o){this.data=[],this.headerRows=[],this.bodyRows=[],this.ruleSet=t||new R,this.dataSetFactory=new F,this.config=this.initConfig(o),this.i18n=this.initI18n(new Map),this.setData(e,o.filter),this.state=l.DIRTY}setI18n(t){this.i18n=this.initI18n(t)}initI18n(t){const e=new Map([["",""],["SEPERATOR_WS",", "],["in","in"],["ORDER_asc","↑"],["ORDER_desc","↓"],["ac1","AC"],["pp1","PY"],["fc1","FC"],["pl1","PL"],["ac2","AC2"],["pp2","PY2"],["fc2","FC2"],["pl2","PL2"],["ac3","AC3"],["pp3","PY3"],["fc3","FC3"],["pl3","PL3"],["ac4","AC4"],["pp4","PY4"],["fc4","FC4"],["pl4","PL4"],["in","in"],["category"," "],["operation"," "],["there_of","davon"],["part_of","in % von"],["ibcssymbol_delta_ac","Δ{%}"],["ibcssymbol_delta_generic","Δ({%})"],["ibcssymbol_delta_ac_relative","Δ{%}%"],["ibcssymbol_delta_generic_relative","Δ({%})%"],["SUM_TOTAL","❖"]]);return this.state=l.DIRTY,new Map([...e,...t||new Map])}initConfig(t){this.state=l.DIRTY;const e=t,o=this;return t.scenarios.sort(((t,e)=>o.ruleSet.getScenarioSorIndex(t)-o.ruleSet.getScenarioSorIndex(e))),e}setConfig(t){this.config=this.initConfig(t)}setData(t,e){if(null==t)return;if(null!=e&&e.length>0)try{this.data=g(`SELECT * FROM ? WHERE ${e}`,[t])}catch(o){console.error("Table: filter query failed, using unfiltered data",e,o),this.data=t}else this.data=t;const o=this.normalizeScenarios(this.config.scenarios,this.config.categoryThereOf,this.config.sortOrder);this.headerRows=this.dataSetFactory.createHeader(this.config.type,o,this.i18n,this.config.measureScale,this.config.measureUnit,this.config.showMeasureScale),this.bodyRows=this.dataSetFactory.createBodyRows(this.config,this.i18n,this.data),this.state=l.UP_TO_DATE}update(){const t=this.normalizeScenarios(this.config.scenarios,this.config.categoryThereOf,this.config.sortOrder);this.headerRows=this.dataSetFactory.createHeader(this.config.type,t,this.i18n,this.config.measureScale,this.config.measureUnit,this.config.showMeasureScale),this.bodyRows=this.dataSetFactory.createBodyRows(this.config,this.i18n,this.data),this.state=l.UP_TO_DATE}getHeader(){return this.state===l.DIRTY&&this.update(),this.headerRows}getBody(){return this.state===l.DIRTY&&this.update(),this.bodyRows}normalizeScenarios(t,e,o){var s;const n=[];for(const r of t){if(null==e?void 0:e.has(r)){const t=e.get(r);for(const e of t){n.push({name:e.name,group:e.name,type:r,order:void 0});for(const t of e.subGroups)n.push({name:t,group:e.name,type:r,order:void 0})}n.push({name:"REST",group:"REST",type:r,order:void 0})}let t;(null===(s=null==o?void 0:o.hierarchy)||void 0===s?void 0:s.at(0))===r&&(t=o.direction),n.push({name:r,group:r,type:r,order:t})}return n}hasNoData(){return 0===this.data.length}}class W{constructor(){this.title="",this.scenarios=[],this.scenariosUnitType=d.DECIMAL,this.grouped=!1,this.showGroupTitle=!0,this.thereOf=[],this.categoryThereOf=new Map,this.partOf=[],this.sortOrder=new m(new w).default(),this.type=r.LIST,this.limit=0,this.i18n=u.ALL,this.categoryWidth=$.W25,this.measureScale=new O,this.measureUnit="",this.measureType=v.VOLUME,this.showMeasureScale=!0,this.filter="",this.barColumns=[]}}class I{constructor(t,e,o,s){this.tableDrillGroupAdapter=t,this.stringAdapter=e,this.orderAdapter=o,this.dataSet=s}adapt(t){const e=new W;return p.isString(t.title)&&(e.title=t.title),p.isArray(t.scenarios)&&(e.scenarios=f.adaptArray(t.scenarios,this.stringAdapter)),p.isExisting(t.scenariosUnitType)&&(e.scenariosUnitType=t.scenariosUnitType),p.isBoolean(t.grouped)&&(e.grouped=t.grouped),p.isBoolean(t.showGroupTitle)&&(e.showGroupTitle=t.showGroupTitle),p.isBoolean(t.showMeasureScale)&&(e.showMeasureScale=t.showMeasureScale),p.isArray(t.thereOf)&&(e.thereOf=f.adaptArray(t.thereOf,this.tableDrillGroupAdapter)),p.isExisting(t.categoryThereOf)&&(e.categoryThereOf=t.categoryThereOf),p.isArray(t.partOf)&&(e.partOf=f.adaptArray(t.partOf,this.tableDrillGroupAdapter)),p.isExisting(t.order)&&(e.sortOrder=this.orderAdapter.adapt(t.order)),p.isExisting(t.type)&&(e.type=t.type),p.isNumber(t.limit)&&(e.limit=t.limit),p.isExisting(t.i18n)&&(e.i18n=t.i18n),p.isExisting(t.categoryWidth)&&(e.categoryWidth=t.categoryWidth),p.isExisting(t.measureScale)&&(e.measureScale=b.calculateMeasureScale(this.dataSet,e.scenarios,t.measureScale)),p.isExisting(t.measureType)&&(e.measureType=t.measureType),p.isString(t.measureUnit)&&(e.measureUnit=t.measureUnit),p.isString(t.filter)&&(e.filter=t.filter.trim()),p.isArray(t.barColumns)&&(e.barColumns=t.barColumns),e}default(){return new W}}class j{constructor(){this.rowGroup="",this.category="",this.subCategory="",this.partOf=""}}class z{constructor(){}adapt(t){const e=new j;return p.isString(t.rowGroup)&&(e.rowGroup=t.rowGroup),p.isString(t.category)&&(e.category=t.category),p.isString(t.subCategory)&&(e.subCategory=t.subCategory),p.isString(t.partOf)&&(e.partOf=t.partOf),e}default(){return new j}}class Q{constructor(){this.operation="+"}addRowGroup(t,e){this.rowGroup=t,this.rowGroupIndex=e}addCategory(t,e){this.category=t,this.categoryIndex=e}addSubCategory(t,e){this.subCategory=t,this.subCategoryIndex=e}addColumnGroup(t,e){this.columnGroup=t,this.columnGroupIndex=e}addSubColumnGroup(t,e){this.columnSubGroup=t,this.columnSubGroupIndex=e}}class V{constructor(){}adapt(t){const e=new Q;return p.isOperator(t.operation)&&(e.operation=t.operation),p.isNumber(t.rowGroupIndex)&&p.isString(t.rowGroup)&&e.addRowGroup(t.rowGroup,t.rowGroupIndex),p.isNumber(t.categoryIndex)&&p.isString(t.category)&&e.addCategory(t.category,t.categoryIndex),p.isNumber(t.subCategoryIndex)&&p.isString(t.subCategory)&&e.addSubCategory(t.subCategory,t.subCategoryIndex),p.isNumber(t.columnGroupIndex)&&p.isString(t.columnGroup)&&e.addColumnGroup(t.columnGroup,t.columnGroupIndex),p.isNumber(t.columnSubGroupIndex)&&p.isString(t.columnSubGroup)&&e.addSubColumnGroup(t.columnSubGroup,t.columnSubGroupIndex),this.setActualValues(t,e),this.setPlanValues(t,e),this.setPreviousPeriodValues(t,e),this.setForecastValues(t,e),e}default(){return new Q}setActualValues(t,e){p.isNumber(t.ac1)&&(e.ac1=t.ac1),p.isNumber(t.ac2)&&(e.ac2=t.ac2),p.isNumber(t.ac3)&&(e.ac3=t.ac3),p.isNumber(t.ac4)&&(e.ac4=t.ac4)}setPlanValues(t,e){p.isNumber(t.pp1)&&(e.pp1=t.pp1),p.isNumber(t.pp2)&&(e.pp2=t.pp2),p.isNumber(t.pp3)&&(e.pp3=t.pp3),p.isNumber(t.pp4)&&(e.pp4=t.pp4)}setPreviousPeriodValues(t,e){p.isNumber(t.pl1)&&(e.pl1=t.pl1),p.isNumber(t.pl2)&&(e.pl2=t.pl2),p.isNumber(t.pl3)&&(e.pl3=t.pl3),p.isNumber(t.pl4)&&(e.pl4=t.pl4)}setForecastValues(t,e){p.isNumber(t.fc1)&&(e.fc1=t.fc1),p.isNumber(t.fc2)&&(e.fc2=t.fc2),p.isNumber(t.fc3)&&(e.fc3=t.fc3),p.isNumber(t.fc4)&&(e.fc4=t.fc4)}}const K=class{constructor(t){e(this,t),this.data=[],this.tableTitle="SUM_TOTAL",this.scenarios=[],this.scenariosDataFormat=d.DECIMAL,this.grouped=!1,this.limit=0,this.showGroupTitle=!0,this.thereof=[],this.partof=[],this.order={hierarchy:[],direction:i.ASC},this.categorythereof=new Map,this.type=r.LIST,this.categoryWidth=$.INF,this.dataFormatDigits={percent:2,decimal:1},this.i18n=new Map,this.i18nMode=u.ALL,this.measureScale="_",this.measureUnit="",this.showMeasureScale=!0,this.measureType=v.VOLUME,this.filter="",this.barColumns=[],this.barColumnMaxWidth=30,this.unitScaling=.01,this.percentageScaling=.5,this.scaleFactor=1,this.componentDataFormatDigits=new S,this.componentStyle=E(this)}render(){return t(o,null,(()=>{if(void 0!==this.table){if(this.table.hasNoData()){const e=this.i18n.get("NO_DATA")||"==No Data==";return t("p",{class:"warning"},e)}return t("table",null,t("thead",null,this.table.getHeader().map((e=>t("tr",{class:e.cssStyle},e.getCells().map((e=>t("th",{colSpan:e.colSpan,class:e.cssStyle},e.getAsHeaderList().map(((o,s,n)=>t("span",null,s===n.length-1?t("span",{class:" "===o?"table-footer":""},o,e.drawPrefix()," "):t("span",null,o,e.drawPrefix(),t("br",null)))))))))))),t("tbody",null,this.table.getBody().map((e=>t("tr",{class:e.cssStyle},null==e?void 0:e.getCells().map((e=>t("td",{colSpan:e.colSpan,class:e.type?`${e.cssStyle} ${e.type}`:e.cssStyle},null!=e.prefix?t("span",{class:e.cssStyle+" "+e.prefixStyle},e.drawPrefix()):"",e.isBarChart&&e.columnStats?t(D,{value:e.value,scenario:e.key,columnStats:e.columnStats,height:18*this.scaleFactor,isRelative:e.key.startsWith("dr"),isPositiveGood:e.key.endsWith("_pos"),measureScale:e.measureScale,maxBarWidth:this.barColumnMaxWidth,styles:this.barChartStyles}):e.draw(this.componentDataFormatDigits)))))))))}})())}componentWillRender(){const t=this.prepareConfig(),e=this.prepareData();this.componentDataFormatDigits=(new y).adapt(this.dataFormatDigits),this.barChartStyles=this.prepareBarChartStyles(),this.table=new H(new R,e,t),this.table.setI18n(this.i18n)}prepareConfig(){return new I(new z,new w,new m(new w),this.data).adapt({title:this.tableTitle,scenarios:this.scenarios,scenariosUnitType:this.scenariosDataFormat,grouped:this.grouped,showGroupTitle:this.showGroupTitle,thereOf:this.thereof,partOf:this.partof,categoryThereOf:this.categorythereof,order:this.order,type:this.type,limit:this.limit,i18n:this.i18nMode,categoryWidth:this.categoryWidth,measureScale:this.measureScale,measureUnit:this.measureUnit,measureType:this.measureType,showMeasureScale:this.showMeasureScale,filter:this.filter,barColumns:this.barColumns})}prepareData(){return f.adaptArray(this.data,new V)}prepareBarChartStyles(){return this.componentStyle((t=>{var e,o,s,n,r,i,l,a,c,h,u,d,p,f,m,$,v,g,R,w,b,O,S,y,E,M;const U=null===(e=t["bn-chart-time"])||void 0===e?void 0:e.varianceStyles,G=null===(o=t["bn-chart-time"])||void 0===o?void 0:o.barStyles;return{positive:{stroke:(null===(s=null==U?void 0:U.pos)||void 0===s?void 0:s.stroke)||"#008f96",fill:(null===(n=null==U?void 0:U.pos)||void 0===n?void 0:n.fill)||"#008f96",fillpattern:(null===(r=null==U?void 0:U.pos)||void 0===r?void 0:r.fillpattern)||"solid"},negative:{stroke:(null===(i=null==U?void 0:U.neg)||void 0===i?void 0:i.stroke)||"#ff0000",fill:(null===(l=null==U?void 0:U.neg)||void 0===l?void 0:l.fill)||"#ff0000",fillpattern:(null===(a=null==U?void 0:U.neg)||void 0===a?void 0:a.fillpattern)||"solid"},neutral:{stroke:(null===(c=null==U?void 0:U.neu)||void 0===c?void 0:c.stroke)||"#808080",fill:(null===(h=null==U?void 0:U.neu)||void 0===h?void 0:h.fill)||"#808080",fillpattern:(null===(u=null==U?void 0:U.neu)||void 0===u?void 0:u.fillpattern)||"outlined"},scenarios:{ac:{stroke:(null===(d=null==G?void 0:G.ac)||void 0===d?void 0:d.stroke)||"#404040",fill:(null===(p=null==G?void 0:G.ac)||void 0===p?void 0:p.fill)||"#404040",fillpattern:(null===(f=null==G?void 0:G.ac)||void 0===f?void 0:f.fillpattern)||"solid"},pp:{stroke:(null===(m=null==G?void 0:G.pp)||void 0===m?void 0:m.stroke)||"#A6A6A6",fill:(null===($=null==G?void 0:G.pp)||void 0===$?void 0:$.fill)||"#A6A6A6",fillpattern:(null===(v=null==G?void 0:G.pp)||void 0===v?void 0:v.fillpattern)||"solid"},fc:{stroke:(null===(g=null==G?void 0:G.fc)||void 0===g?void 0:g.stroke)||"#404040",fill:(null===(R=null==G?void 0:G.fc)||void 0===R?void 0:R.fill)||"#ffffff",fillpattern:(null===(w=null==G?void 0:G.fc)||void 0===w?void 0:w.fillpattern)||"hatched"},pl:{stroke:(null===(b=null==G?void 0:G.pl)||void 0===b?void 0:b.stroke)||"#404040",fill:(null===(O=null==G?void 0:G.pl)||void 0===O?void 0:O.fill)||"#ffffff",fillpattern:(null===(S=null==G?void 0:G.pl)||void 0===S?void 0:S.fillpattern)||"outlined"}},fontColor:(null===(y=t.global)||void 0===y?void 0:y.fontColor)||"#000000",fontSize:.85*((null===(E=t.global)||void 0===E?void 0:E.fontSizePx)||13.3333)*this.scaleFactor,fontFamily:(null===(M=t.global)||void 0===M?void 0:M.fontFamily)||"'Noto Sans', sans-serif",unitScaling:this.unitScaling,percentageScaling:this.percentageScaling,scaleFactor:this.scaleFactor}}))}get element(){return s(this)}};K.style=':host{position:relative;display:inline-block}table{background-color:var(--bn-font-background, white);font-size:var(--bn-font-size, 1em);color:var(--bn-font-color, black);font-family:var(--bn-font-family, "Noto Sans", "Helvetica Neue", Helvetica, sans-serif);border-spacing:0.3em 0}thead{border-style:none}tr:first-child td{border-top:none;padding-top:0.5em}td.ac1,td.ac2,td.ac3,td.ac4,td.pp1,td.pp2,td.pp3,td.pp4,td.pl1,td.pl2,td.pl3,td.pl4,td.fc1,td.fc2,td.fc3,td.fc4,td.share,td.variance,td.pos_pos,td.pos_neg,td.neg_pos,td.neg_neg,td.pos_neutral,td.neg_neutral{text-align:right}.category-w100{min-width:100em;max-width:100em}.category-w50{min-width:50em;max-width:50em}.category-w25{min-width:25em;max-width:25em}.category-w20{min-width:20em;max-width:20em}.category-w15{min-width:15em;max-width:15em}.category-w10{min-width:10em;max-width:10em}.category-w5{min-width:5em;max-width:5em}.prefix-second{color:transparent;font-style:normal}.prefix-first{font-style:normal}th{border-bottom:0.1em solid black;text-align:right;font-weight:normal;vertical-align:text-top}td.columnGroup,th.columnGroup{font-size:0.6em}td.columnSubGroup,th.columnSubGroup{font-size:0.6em;border-spacing:0em 0;font-style:italic}td.base,th.base{font-style:normal}th.ofit,td.ofit,tr.ofit,th.partof,td.partof,tr.partof{font-size:0.6em;font-style:italic}td.ofit,td.partof{font-size:0.6em;font-style:italic}th.ofit td,tr.ofit td,th.partof td,tr.partof td{border-top:0em solid black;padding-left:1em}th.ofit share,th.partof share,tr.share td{border-top:0em solid black}th.share,tr.share,td.share{font-size:0.6em;font-style:italic}th.filler{border-bottom:0em solid black;text-align:right}td.filler{border-top:0em none !important;border-bottom:0em none;text-align:right}th.group{text-align:center;border-spacing:1em 0}th.headerlabel{border-bottom:0em none black;padding-bottom:0em}td.variance:after{content:"%"}td.relative_variance{font-style:italic}td.percent{font-style:italic;text-align:right}td.decimal{text-align:right}td.pos_pos{color:#008f96}td.neg_pos{color:#ff0000}td.pos_neg{color:#ff0000}td.neg_neg{color:#008f96}td.pos_pos:before{content:"+"}td.pos_neg:before{content:"+"}td.pos_neu:before{content:"+"}th.ac1,th.ac2,th.ac3,th.ac4{padding-top:0em;border-bottom:0.3em solid black}th.pp1,th.pp2,th.pp3,th.pp4{padding-top:0em;border-bottom:0.3em solid grey}th.pl1,th.pl2,th.pl3,th.pl4{padding-top:0em;border-bottom:0.3em double black}th.fc1,th.fc2,th.fc3,th.fc4{border-bottom:0.3em solid;border-image:repeating-linear-gradient(-45deg, white, white, black, white, white 0.3em) 2}td.colsum{font-weight:bold}th.colsum{padding-top:0em;font-weight:bold}tr.sum td{border-top:0.1em solid black;font-weight:bold;padding-bottom:0.5em}tr.groupheader td{border-top:0em dotted #ddd;padding-top:0.5em;font-weight:bold;font-style:italic}tr.begingroup td{border-top:0em dotted #ddd;padding-top:0.5em}th.begin-group{padding-left:0.75em}th.end-group{padding-left:0.75em}td{box-sizing:border-box;-webkit-box-sizing:border-box;border-top:0.1em dashed #ddd;padding-left:0.5em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.table-footer{font-size:0.6em}.cell-bar-chart{display:inline-block;vertical-align:middle}.bar-chart-empty{color:#999}td:has(.cell-bar-chart){padding:0 0.25em;vertical-align:middle}td:has(.cell-bar-chart).pos_pos:before,td:has(.cell-bar-chart).pos_neg:before,td:has(.cell-bar-chart).pos_neu:before{content:none}td:has(.cell-bar-chart).variance:after{content:none}';export{K as ibcs_table}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}export{e as c,n as g}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function a(a){for(var c,e=0,r=0,s=a.length;s>=4;++r,s-=4)c=1540483477*(65535&(c=255&a.charCodeAt(r)|(255&a.charCodeAt(++r))<<8|(255&a.charCodeAt(++r))<<16|(255&a.charCodeAt(++r))<<24))+(59797*(c>>>16)<<16),e=1540483477*(65535&(c^=c>>>24))+(59797*(c>>>16)<<16)^1540483477*(65535&e)+(59797*(e>>>16)<<16);switch(s){case 3:e^=(255&a.charCodeAt(r+2))<<16;case 2:e^=(255&a.charCodeAt(r+1))<<8;case 1:e=1540483477*(65535&(e^=255&a.charCodeAt(r)))+(59797*(e>>>16)<<16)}return(((e=1540483477*(65535&(e^=e>>>13))+(59797*(e>>>16)<<16))^e>>>15)>>>0).toString(36)}export{a as m}
|