@bino-bi/bn-template-engine 1.0.0-alpha.10 → 1.0.0-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/LICENSE +203 -21
  2. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  3. package/dist/bn-template-engine/p-230095a5.entry.js +1 -0
  4. package/dist/bn-template-engine/{p-fdb3e99a.entry.js → p-3b73ffc7.entry.js} +1 -1
  5. package/dist/bn-template-engine/p-46699464.entry.js +1 -0
  6. package/dist/bn-template-engine/{p-e783733e.entry.js → p-52097456.entry.js} +1 -1
  7. package/dist/bn-template-engine/p-637e3b8f.entry.js +1 -0
  8. package/dist/bn-template-engine/{p-c2cbb8ea.entry.js → p-67eae33e.entry.js} +1 -1
  9. package/dist/bn-template-engine/p-BVFHvEXF.js +1 -0
  10. package/dist/bn-template-engine/p-CQnZV3JG.js +1 -0
  11. package/dist/bn-template-engine/p-DHheVOfP.js +1 -0
  12. package/dist/bn-template-engine/{p-e94b4e31.entry.js → p-ab3ea8cf.entry.js} +1 -1
  13. package/dist/cjs/bn-asset_21.cjs.entry.js +640 -732
  14. package/dist/cjs/bn-grid.cjs.entry.js +2 -2
  15. package/dist/cjs/bn-image.cjs.entry.js +2 -2
  16. package/dist/cjs/bn-internationalization.cjs.entry.js +1 -1
  17. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  18. package/dist/cjs/bn-text.cjs.entry.js +3 -3
  19. package/dist/cjs/bn-tree.cjs.entry.js +2 -2
  20. package/dist/cjs/context-protocol-Op7uUwN3.js +9214 -0
  21. package/dist/cjs/editor-companion.cjs.entry.js +13 -6
  22. package/dist/cjs/loader.cjs.js +1 -1
  23. package/dist/cjs/{scaling-eyzCrFB8.js → scaling-57N4Cxb_.js} +44 -40
  24. package/dist/cjs/withStyled-C2kmGAK3.js +1405 -0
  25. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +11 -6
  26. package/dist/collection/components/bn-chart-structure/ibcs-chart-structure.js +50 -22
  27. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +51 -48
  28. package/dist/collection/components/bn-chart-structure/utils/model/StructureChartComponentConfig.js +5 -4
  29. package/dist/collection/components/bn-chart-time/bn-chart-time.js +11 -6
  30. package/dist/collection/components/bn-chart-time/ibcs-chart-time.js +47 -22
  31. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +76 -60
  32. package/dist/collection/components/bn-chart-time/utils/model/TimeChartComponentConfig.js +5 -4
  33. package/dist/collection/components/bn-chart-time/utils/model/TimeChartDataRow.js +2 -0
  34. package/dist/collection/components/bn-dataset/bn-dataset.js +195 -23
  35. package/dist/collection/components/bn-datasource/bn-datasource.js +144 -12
  36. package/dist/collection/components/bn-table/bn-table.js +13 -8
  37. package/dist/collection/components/bn-table/ibcs-table.js +52 -25
  38. package/dist/collection/components/bn-table/utils/Table.js +27 -21
  39. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +2 -2
  40. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +52 -43
  41. package/dist/collection/components/bn-table/utils/helper/QueryGroup.js +4 -9
  42. package/dist/collection/components/bn-table/utils/model/TableComponentConfig.js +5 -4
  43. package/dist/collection/components/bn-title/ibcs-title/ibcs-title.js +1 -4
  44. package/dist/collection/components/editor-companion/editor-companion.js +12 -5
  45. package/dist/collection/context/scopedDb.js +113 -0
  46. package/dist/collection/stores/createScopedStores.js +3 -4
  47. package/dist/collection/utils/dataAnalyzer.js +14 -8
  48. package/dist/collection/utils/withDataset.js +43 -39
  49. package/dist/collection/utils/withDatasource.js +28 -18
  50. package/dist/components/DataFormatDigits.js +1 -1
  51. package/dist/components/DateStringFactory.js +1 -1
  52. package/dist/components/Order.js +1 -1
  53. package/dist/components/SVGVariancesStyleGroup.js +1 -1
  54. package/dist/components/bn-chart-structure.js +1 -1
  55. package/dist/components/bn-chart-time.js +1 -1
  56. package/dist/components/bn-dataset.js +1 -1
  57. package/dist/components/bn-datasource.js +1 -1
  58. package/dist/components/bn-table.js +1 -1
  59. package/dist/components/bn-title2.js +1 -1
  60. package/dist/components/context-protocol.js +1 -1
  61. package/dist/components/editor-companion.js +1 -1
  62. package/dist/components/ibcs-chart-structure2.js +1 -1
  63. package/dist/components/ibcs-chart-time2.js +1 -1
  64. package/dist/components/ibcs-table2.js +1 -1
  65. package/dist/components/ibcs-title2.js +1 -1
  66. package/dist/components/ibcsRuleSet.js +1 -1
  67. package/dist/components/luxon.js +1 -0
  68. package/dist/components/scaling.js +1 -1
  69. package/dist/esm/bn-asset_21.entry.js +635 -727
  70. package/dist/esm/bn-grid.entry.js +2 -2
  71. package/dist/esm/bn-image.entry.js +2 -2
  72. package/dist/esm/bn-internationalization.entry.js +1 -1
  73. package/dist/esm/bn-template-engine.js +1 -1
  74. package/dist/esm/bn-text.entry.js +3 -3
  75. package/dist/esm/bn-tree.entry.js +2 -2
  76. package/dist/esm/context-protocol-BDhzNbeD.js +9204 -0
  77. package/dist/esm/editor-companion.entry.js +13 -6
  78. package/dist/esm/loader.js +1 -1
  79. package/dist/esm/{scaling-BzbiBnuN.js → scaling-La1Ow72h.js} +44 -40
  80. package/dist/esm/withStyled-Bl9cSoRW.js +1372 -0
  81. package/dist/types/components/bn-chart-structure/bn-chart-structure.d.ts +4 -2
  82. package/dist/types/components/bn-chart-structure/ibcs-chart-structure.d.ts +7 -3
  83. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +11 -12
  84. package/dist/types/components/bn-chart-structure/utils/model/StructureChartComponentConfig.d.ts +5 -3
  85. package/dist/types/components/bn-chart-time/bn-chart-time.d.ts +4 -2
  86. package/dist/types/components/bn-chart-time/ibcs-chart-time.d.ts +7 -3
  87. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +11 -12
  88. package/dist/types/components/bn-chart-time/utils/model/TimeChartComponentConfig.d.ts +5 -3
  89. package/dist/types/components/bn-dataset/bn-dataset.d.ts +39 -5
  90. package/dist/types/components/bn-datasource/bn-datasource.d.ts +46 -6
  91. package/dist/types/components/bn-table/bn-table.d.ts +4 -3
  92. package/dist/types/components/bn-table/ibcs-table.d.ts +11 -3
  93. package/dist/types/components/bn-table/utils/Table.d.ts +8 -6
  94. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +2 -2
  95. package/dist/types/components/bn-table/utils/helper/DataQuery.d.ts +7 -3
  96. package/dist/types/components/bn-table/utils/helper/QueryGroup.d.ts +4 -5
  97. package/dist/types/components/bn-table/utils/model/TableComponentConfig.d.ts +5 -3
  98. package/dist/types/components/editor-companion/editor-companion.d.ts +2 -0
  99. package/dist/types/components.d.ts +160 -70
  100. package/dist/types/context/context-protocol.d.ts +4 -3
  101. package/dist/types/context/scopedDb.d.ts +37 -0
  102. package/dist/types/stores/createScopedStores.d.ts +1 -2
  103. package/dist/types/utils/DateStringFactory.d.ts +1 -1
  104. package/dist/types/utils/dataAnalyzer.d.ts +2 -1
  105. package/dist/types/utils/withDataset.d.ts +6 -2
  106. package/dist/types/utils/withDatasource.d.ts +3 -3
  107. package/package.json +3 -2
  108. package/readme.md +2 -2
  109. package/dist/bn-template-engine/p-14318b0d.entry.js +0 -1
  110. package/dist/bn-template-engine/p-2133e02b.entry.js +0 -1
  111. package/dist/bn-template-engine/p-7HSTE79g.js +0 -1
  112. package/dist/bn-template-engine/p-9b1288df.entry.js +0 -1
  113. package/dist/bn-template-engine/p-Bi2wx-el.js +0 -1
  114. package/dist/bn-template-engine/p-CWiZks2h.js +0 -1
  115. package/dist/cjs/context-protocol-B_jipZpJ.js +0 -665
  116. package/dist/cjs/withStyled-V7xz_x1c.js +0 -9535
  117. package/dist/collection/stores/datasets.js +0 -14
  118. package/dist/collection/stores/datasources.js +0 -14
  119. package/dist/components/_commonjsHelpers.js +0 -1
  120. package/dist/components/alasql.min.js +0 -1
  121. package/dist/esm/context-protocol-D-o_UZ33.js +0 -658
  122. package/dist/esm/withStyled-5RqF8WBL.js +0 -9501
  123. package/dist/types/stores/datasets.d.ts +0 -14
  124. package/dist/types/stores/datasources.d.ts +0 -14
@@ -1 +1 @@
1
- import{r as t,h as s,H as i,g as a}from"./p-B_d-jp99.js";import{w as r}from"./p-DSXNgKLa.js";import{g as e,f as n}from"./p-Bi2wx-el.js";import{w as o,a as h}from"./p-B4JfKvVT.js";const c=class{constructor(s){t(this,s),o(this),this.errors=h(this),r(this,(t=>{this.stores||(this.stores=e(this.element));try{const s=n(JSON.parse(t)),i=Object.assign({},this.stores.internationalization.get(this.namespace));i[this.code]=s,this.stores.internationalization.set(this.namespace,i)}catch(t){console.error(t)}}))}render(){return s(i,{key:"dd384ecf77e4fd5d46ed04b04c4395fba8bac4e1"})}get element(){return a(this)}};c.style="bn-internationalization{display:none}";export{c as bn_internationalization}
1
+ import{r as t,h as s,H as i,g as a}from"./p-B_d-jp99.js";import{w as r}from"./p-DSXNgKLa.js";import{g as e,f as n}from"./p-DHheVOfP.js";import{w as o,a as h}from"./p-B4JfKvVT.js";const c=class{constructor(s){t(this,s),o(this),this.errors=h(this),r(this,(t=>{this.stores||(this.stores=e(this.element));try{const s=n(JSON.parse(t)),i=Object.assign({},this.stores.internationalization.get(this.namespace));i[this.code]=s,this.stores.internationalization.set(this.namespace,i)}catch(t){console.error(t)}}))}render(){return s(i,{key:"dd384ecf77e4fd5d46ed04b04c4395fba8bac4e1"})}get element(){return a(this)}};c.style="bn-internationalization{display:none}";export{c as bn_internationalization}
@@ -0,0 +1 @@
1
+ import{r as t,h as s,F as r,g as e}from"./p-B_d-jp99.js";import{g as i,B as n}from"./p-DHheVOfP.js";const o=class{constructor(s){t(this,s),this.distinctCache=new Map}connectedCallback(){this.stores=i(this.element)}internationalizationKeys(){return Promise.resolve(n)}getDistinctFromDataSource(t,s){const r=`datasource:${t}:${s}`;if(this.distinctCache.has(r))return Promise.resolve(this.distinctCache.get(r));const e=this.distinct(this.queryRows(t),s);return this.distinctCache.set(r,e),Promise.resolve(e)}getDistinctFromDataset(t,s){const r=`dataset:${t}:${s}`;if(this.distinctCache.has(r))return Promise.resolve(this.distinctCache.get(r));const e=this.distinct(this.queryRows(t),s);return this.distinctCache.set(r,e),Promise.resolve(e)}render(){return s(r,{key:"d6eb8ea68a4d507142547f4014f1dd3db58dcfd4"})}queryRows(t){try{return this.stores.db.db.exec(`SELECT * FROM \`${t}\``)}catch(t){return[]}}distinct(t,s){return[...new Set(t.map((t=>t[s])))].filter((t=>null!=t))}get element(){return e(this)}};o.style="editor-companion{display:none}";export{o as editor_companion}
@@ -1 +1 @@
1
- import{r as t,h as s,H as i,g as o}from"./p-B_d-jp99.js";import{w as e,a as n}from"./p-CWiZks2h.js";import{w as r,a}from"./p-B4JfKvVT.js";import{g as l}from"./p-Bi2wx-el.js";const f=class{constructor(s){t(this,s),e(this),r(this),this.errors=a(this),this.componentStyle=n(this)}connectedCallback(){this.stores=l(this.element)}getFontStyles(){return this.componentStyle((t=>{var s,i,o,e;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(o=t.global)||void 0===o?void 0:o.fontColor)||"#000000","--bn-font-background":(null===(e=t.global)||void 0===e?void 0:e.fontBackgroundColor)||"#ffffff"}}))}prepareAssetUrl(t){if(null==t||""===t)return"";const s=this.stores.assets.state;return t.startsWith("asset:")?s[t.substring(6)]:s[t]||t}render(){return s(i,{key:"656f301d5fb1a7650f4c7d0cbb3fe1ef15b8ae92",style:this.getFontStyles()},null!=this.source&&""!==this.source?s("img",{src:this.prepareAssetUrl(this.source)}):"")}get element(){return o(this)}};f.style=":host{display:inline-block;position:relative;overflow:hidden}img{max-width:100%;height:auto}";export{f as bn_image}
1
+ import{r as t,h as s,H as i,g as o}from"./p-B_d-jp99.js";import{w as e,a as n}from"./p-BVFHvEXF.js";import{w as r,a}from"./p-B4JfKvVT.js";import{g as l}from"./p-DHheVOfP.js";const f=class{constructor(s){t(this,s),e(this),r(this),this.errors=a(this),this.componentStyle=n(this)}connectedCallback(){this.stores=l(this.element)}getFontStyles(){return this.componentStyle((t=>{var s,i,o,e;return{"--bn-font-family":(null===(s=t.global)||void 0===s?void 0:s.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(i=t.global)||void 0===i?void 0:i.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(o=t.global)||void 0===o?void 0:o.fontColor)||"#000000","--bn-font-background":(null===(e=t.global)||void 0===e?void 0:e.fontBackgroundColor)||"#ffffff"}}))}prepareAssetUrl(t){if(null==t||""===t)return"";const s=this.stores.assets.state;return t.startsWith("asset:")?s[t.substring(6)]:s[t]||t}render(){return s(i,{key:"656f301d5fb1a7650f4c7d0cbb3fe1ef15b8ae92",style:this.getFontStyles()},null!=this.source&&""!==this.source?s("img",{src:this.prepareAssetUrl(this.source)}):"")}get element(){return o(this)}};f.style=":host{display:inline-block;position:relative;overflow:hidden}img{max-width:100%;height:auto}";export{f as bn_image}
@@ -0,0 +1 @@
1
+ import{r as t,h as e,H as n,g as s}from"./p-B_d-jp99.js";import{b as r,i,w as o,a}from"./p-BVFHvEXF.js";import{w as l,a as c}from"./p-B4JfKvVT.js";import"./p-DHheVOfP.js";const d=["*","/","+","-","x","÷","none"];function u(t){switch(t){case"*":case"x":return"×";case"/":case"÷":return"÷";case"+":return"+";case"-":return"−";default:return""}}function h(t,e,n){return t.find((t=>t.from===e&&t.to===n))}function f(t){return 2*(t-1)+1}function p(t){return 2*(t-1)+1}function g(t,e){const n=t.getBoundingClientRect(),s=n.left-e.left,r=n.top-e.top;return{left:s,top:r,width:n.width,height:n.height,centerX:s+n.width/2,centerY:r+n.height/2}}function v(t,e,n){switch(n){case"ltr":return e?{x:t.left+t.width,y:t.centerY}:{x:t.left,y:t.centerY};case"rtl":return e?{x:t.left,y:t.centerY}:{x:t.left+t.width,y:t.centerY};case"ttb":return e?{x:t.centerX,y:t.top+t.height}:{x:t.centerX,y:t.top};case"btt":return e?{x:t.centerX,y:t.top}:{x:t.centerX,y:t.top+t.height}}}function y(t,e,n,s,r=8){const i=-(s-1)*r/2+n*r;switch(e){case"ltr":return{x:t.left,y:t.centerY+i};case"rtl":return{x:t.left+t.width,y:t.centerY+i};case"ttb":return{x:t.centerX+i,y:t.top};case"btt":return{x:t.centerX+i,y:t.top+t.height}}}function m(t,e,n,s){switch(n){case"straight":return function(t,e){return{path:`M ${t.x} ${t.y} L ${e.x} ${e.y}`,midpoint:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}(t,e);case"curved":return function(t,e,n){let s,r;if("ltr"===n||"rtl"===n){const n=(t.x+e.x)/2;s={x:n,y:t.y},r={x:n,y:e.y}}else{const n=(t.y+e.y)/2;s={x:t.x,y:n},r={x:e.x,y:n}}return{path:`M ${t.x} ${t.y} C ${s.x} ${s.y}, ${r.x} ${r.y}, ${e.x} ${e.y}`,midpoint:{x:.125*t.x+.375*s.x+.375*r.x+.125*e.x,y:.125*t.y+.375*s.y+.375*r.y+.125*e.y}}}(t,e,s);default:return function(t,e,n){let s,r;if("ltr"===n||"rtl"===n){const n=t.x+.7*(e.x-t.x);s=`M ${t.x} ${t.y} L ${n} ${t.y} L ${n} ${e.y} L ${e.x} ${e.y}`,r={x:n,y:(t.y+e.y)/2}}else{const n=t.y+.7*(e.y-t.y);s=`M ${t.x} ${t.y} L ${t.x} ${n} L ${e.x} ${n} L ${e.x} ${e.y}`,r={x:(t.x+e.x)/2,y:n}}return{path:s,midpoint:r}}(t,e,s)}}function b(t,e,n,s){const r=.7;switch(s){case"ltr":{const s=t.left+t.width;return{x:s+(Math.min(e.left,n.left)-s)*r,y:t.centerY}}case"rtl":{const s=t.left,i=Math.max(e.left+e.width,n.left+n.width);return{x:i+(s-i)*r,y:t.centerY}}case"ttb":{const s=t.top+t.height,i=Math.min(e.top,n.top);return{x:t.centerX,y:s+(i-s)*r}}case"btt":{const s=t.top,i=Math.max(e.top+e.height,n.top+n.height);return{x:t.centerX,y:i+(s-i)*r}}}}function $(t,e,n){var s,r;return Object.assign({stroke:null!==(s=null==n?void 0:n.color)&&void 0!==s?s:t,strokeWidth:null!==(r=null==n?void 0:n.width)&&void 0!==r?r:e},(null==n?void 0:n.dasharray)?{strokeDasharray:n.dasharray}:{})}const x=class{validateEdgesProp(t){const e="ERR_edges",n=function(t){const e=[];if(!t||""===t.trim())return e.push("edges: value is required"),e;let n;try{n=JSON.parse(t)}catch(t){return e.push("edges: invalid JSON structure"),e}if(!Array.isArray(n))return e.push("edges: must be an array"),e;if(0===n.length)return e.push("edges: array must not be empty"),e;const s=new Set,r=new Set;n.forEach(((t,n)=>{if("object"!=typeof t||null===t)return void e.push(`edges[${n}]: must be an object`);const i=t;if("string"!=typeof i.from||""===i.from.trim()?e.push(`edges[${n}]: 'from' is required and must be a non-empty string`):s.add(i.from),"string"!=typeof i.to||""===i.to.trim()?e.push(`edges[${n}]: 'to' is required and must be a non-empty string`):(s.add(i.to),r.add(i.to)),void 0!==i.operator&&("string"==typeof i.operator&&d.includes(i.operator)||e.push(`edges[${n}]: 'operator' must be one of: ${d.join(", ")}`)),void 0!==i.label&&"string"!=typeof i.label&&e.push(`edges[${n}]: 'label' must be a string`),void 0!==i.style)if("object"!=typeof i.style||null===i.style)e.push(`edges[${n}]: 'style' must be an object`);else{const t=i.style;void 0!==t.color&&"string"!=typeof t.color&&e.push(`edges[${n}]: 'style.color' must be a string`),void 0!==t.width&&"number"!=typeof t.width&&e.push(`edges[${n}]: 'style.width' must be a number`),void 0!==t.dasharray&&"string"!=typeof t.dasharray&&e.push(`edges[${n}]: 'style.dasharray' must be a string`)}}));const i=Array.from(s).filter((t=>!r.has(t)));return 0===i.length?e.push("edges: tree has no root node (circular reference detected)"):i.length>1&&e.push(`edges: tree has multiple root nodes: ${i.join(", ")}`),e}(t);n.length>0?(this.errors.addOrReplace({id:e,type:"error",message:`edges: ${n.join("; ")}`}),this.treeConfig=null):(this.errors.remove(e),this.treeConfig=function(t){if(!t||""===t.trim())return null;try{const e=JSON.parse(t);if(!Array.isArray(e))return null;const n=e,s=function(t){const e=new Map;for(const n of t){const t=e.get(n.from)||[];t.push(n.to),e.set(n.from,t)}return e}(n),r=function(t){const e=new Set;for(const n of t)e.add(n.from),e.add(n.to);return e}(n),i=function(t,e){const n=new Set;for(const e of t)n.add(e.to);const s=Array.from(e).filter((t=>!n.has(t)));return 1===s.length?s[0]:null}(n,r);return{edges:n,adjacencyList:s,rootNode:i,allNodes:r}}catch(t){return console.error("parseTreeConfig: failed to parse tree configuration",t),null}}(t)),this.recalculateLayout()}validateDirection(t){const e="ERR_direction",n=["ltr","rtl","ttb","btt"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`direction: invalid value '${t}', must be one of: ${n.join(", ")}`}),this.recalculateLayout()}validateLevelSpacing(t){const e="ERR_levelSpacing";!r(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`level-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateNodeSpacing(t){const e="ERR_nodeSpacing";!r(t)||t<0?this.errors.addOrReplace({id:e,type:"warning",message:`node-spacing: invalid value '${t}', must be a non-negative number`}):this.errors.remove(e),this.recalculateLayout()}validateEdgeStyle(t){const e="ERR_edgeStyle",n=["straight","orthogonal","curved"];n.includes(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`edge-style: invalid value '${t}', must be one of: ${n.join(", ")}`})}validateShowOperators(t){const e="ERR_showOperators";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-operators: invalid value '${t}', must be 'true' or 'false'`})}constructor(e){t(this,e),this.treeConfig=null,this.layout=null,this.nodeRects=new Map,this.svgWidth=0,this.svgHeight=0,this.resizeObserver=null,this.gridContainer=null,this.direction="ltr",this.levelSpacing=60,this.nodeSpacing=20,this.edgeStyle="orthogonal",this.showOperators="true",o(this),l(this),this.errors=c(this),this.componentStyle=a(this)}getTreeStyle(){return this.componentStyle((t=>({edgeColor:t["bn-tree"].edgeColor,edgeWidth:t["bn-tree"].edgeWidth,operatorCircleRadius:t["bn-tree"].operatorCircleRadius,operatorFontSize:t.global.fontSizePx*t["bn-tree"].operatorFontSizeScale,operatorColor:t["bn-tree"].operatorColor})))}componentWillLoad(){this.validateEdgesProp(this.edges),this.validateDirection(this.direction),this.validateLevelSpacing(this.levelSpacing),this.validateNodeSpacing(this.nodeSpacing),this.validateEdgeStyle(this.edgeStyle),this.validateShowOperators(this.showOperators)}componentDidLoad(){this.setupResizeObserver(),requestAnimationFrame((()=>{this.updateNodeRects()}))}disconnectedCallback(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}setupResizeObserver(){var t;this.gridContainer=null===(t=this.element.shadowRoot)||void 0===t?void 0:t.querySelector(".tree-grid"),this.gridContainer&&(this.resizeObserver=new ResizeObserver((()=>{this.updateNodeRects()})),this.resizeObserver.observe(this.gridContainer),this.element.querySelectorAll("[slot]").forEach((t=>{this.resizeObserver.observe(t)})))}recalculateLayout(){this.layout=this.treeConfig?function(t,e,n,s){if(!t.rootNode)return{positions:new Map,gridTemplateColumns:"",gridTemplateRows:"",maxLevel:0,maxIndex:0};const r=function(t){const e=new Map;if(!t.rootNode)return e;const n=[{node:t.rootNode,level:0}],s=new Set;for(;n.length>0;){const{node:r,level:i}=n.shift();if(s.has(r))continue;s.add(r),e.set(r,i);const o=t.adjacencyList.get(r)||[];for(const t of o)s.has(t)||n.push({node:t,level:i+1})}return e}(t),i=function(t){const e=new Map;if(!t.rootNode)return e;let n=0;return function s(r){const i=e.get(r);if(i)return i;const o=t.adjacencyList.get(r)||[];if(0===o.length){const t={startIndex:n,endIndex:n};return e.set(r,t),n++,t}let a=1/0,l=-1/0;for(const t of o){const e=s(t);a=Math.min(a,e.startIndex),l=Math.max(l,e.endIndex)}const c={startIndex:a,endIndex:l};return e.set(r,c),c}(t.rootNode),e}(t),o=function(t,e,n,s){var r,i;const o=new Map,a=Math.max(...Array.from(e.values()));for(const l of t.allNodes){const t=null!==(r=e.get(l))&&void 0!==r?r:0,c=null!==(i=n.get(l))&&void 0!==i?i:{startIndex:0,endIndex:0};let d,u,h;switch(s){case"ltr":d=t+1,u=c.startIndex+1,h=c.endIndex-c.startIndex+1;break;case"rtl":d=a-t+1,u=c.startIndex+1,h=c.endIndex-c.startIndex+1;break;case"ttb":u=t+1,d=c.startIndex+1,h=1;break;case"btt":u=a-t+1,d=c.startIndex+1,h=1}o.set(l,{nodeId:l,level:t,index:c.startIndex,gridColumn:d,gridRow:u,gridRowSpan:h})}return o}(t,r,i,e),a=Math.max(...Array.from(r.values())),l=Math.max(...Array.from(i.values()).map((t=>t.endIndex))),{gridTemplateColumns:c,gridTemplateRows:d}=function(t,e,n,s,r){const i=t+1,o=e+1;if("ltr"===n||"rtl"===n){const t=[];for(let e=0;e<i;e++)t.push("auto"),e<i-1&&t.push(`${s}px`);const e=[];for(let t=0;t<o;t++)e.push("auto"),t<o-1&&e.push(`${r}px`);return{gridTemplateColumns:t.join(" "),gridTemplateRows:e.join(" ")}}{const t=[];for(let e=0;e<i;e++)t.push("auto"),e<i-1&&t.push(`${s}px`);const e=[];for(let t=0;t<o;t++)e.push("auto"),t<o-1&&e.push(`${r}px`);return{gridTemplateColumns:e.join(" "),gridTemplateRows:t.join(" ")}}}(a,l,e,n,s);return{positions:o,gridTemplateColumns:c,gridTemplateRows:d,maxLevel:a,maxIndex:l}}(this.treeConfig,this.direction,this.levelSpacing,this.nodeSpacing):null}updateNodeRects(){if(!this.treeConfig||!this.gridContainer)return;const t=this.gridContainer.getBoundingClientRect(),e=new Map;for(const n of this.treeConfig.allNodes){const s=this.element.querySelector(`[slot="${n}"]`);s&&e.set(n,g(s,t))}this.nodeRects=e,this.svgWidth=t.width,this.svgHeight=t.height}getSlotStyle(t){if(!this.layout)return{};const e=this.layout.positions.get(t);return e?"ltr"===this.direction||"rtl"===this.direction?{"grid-column":String(f(e.gridColumn)),"grid-row":`${p(e.gridRow)} / span ${n=e.gridRowSpan,n<=1?1:2*(n-1)+1}`,"align-self":"center"}:{"grid-row":String(p(e.gridRow)),"grid-column":String(f(e.gridColumn)),"justify-self":"center"}:{};var n}renderEdges(){var t;if(!this.treeConfig||0===this.nodeRects.size)return null;const n=this.getTreeStyle(),s=[],r=[],i=new Map;for(const t of this.treeConfig.edges){const e=i.get(t.to)||[];e.push(t.from),i.set(t.to,e)}for(const t of this.treeConfig.edges){const r=this.nodeRects.get(t.from),o=this.nodeRects.get(t.to);if(!r||!o)continue;const a=v(r,!0,this.direction),l=i.get(t.to)||[];let c;if(l.length>1){const e=l.indexOf(t.from);c=y(o,this.direction,e,l.length)}else c=v(o,!1,this.direction);const{path:d}=m(a,c,this.edgeStyle,this.direction),u=$(n.edgeColor,n.edgeWidth,t.style);s.push(e("path",{key:`edge-${t.from}-${t.to}`,d,fill:"none",stroke:u.stroke,"stroke-width":u.strokeWidth,"stroke-dasharray":u.strokeDasharray}))}if("true"===this.showOperators)for(const[s,i]of this.treeConfig.adjacencyList.entries()){const o=this.nodeRects.get(s);if(o)for(let a=0;a<i.length-1;a++){const l=i[a],c=i[a+1],d=h(this.treeConfig.edges,s,l);if(!(null==d?void 0:d.operator)||"none"===d.operator)continue;const f=this.nodeRects.get(l),p=this.nodeRects.get(c);if(!f||!p)continue;const g=null!==(t=d.label)&&void 0!==t?t:u(d.operator),v=b(o,f,p,this.direction);r.push(e("g",{key:`operator-${s}-${l}`,class:"operator-group"},e("circle",{cx:v.x,cy:v.y,r:n.operatorCircleRadius,fill:"white",stroke:n.edgeColor,"stroke-width":n.edgeWidth}),e("text",{x:v.x,y:v.y,"text-anchor":"middle","dominant-baseline":"central",style:{fontSize:`${n.operatorFontSize}px`,fill:n.operatorColor,fontWeight:"bold"}},g)))}}return e("svg",{class:"edge-layer",width:this.svgWidth,height:this.svgHeight,style:{position:"absolute",top:"0",left:"0",pointerEvents:"none"}},s,r)}renderSlots(){return this.treeConfig&&this.layout?Array.from(this.treeConfig.allNodes).map((t=>e("div",{key:t,class:"tree-node",style:this.getSlotStyle(t)},e("slot",{name:t})))):null}getFontStyles(){return this.componentStyle((t=>{var e,n,s,r;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(n=t.global)||void 0===n?void 0:n.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(s=t.global)||void 0===s?void 0:s.fontColor)||"#000000","--bn-font-background":(null===(r=t.global)||void 0===r?void 0:r.fontBackgroundColor)||"#ffffff"}}))}render(){const t=this.getFontStyles();return e(n,{style:t},this.treeConfig&&this.layout?e("div",{class:"tree-container"},e("div",{class:"tree-grid",style:{display:"grid","grid-template-columns":this.layout.gridTemplateColumns,"grid-template-rows":this.layout.gridTemplateRows,position:"relative"}},this.renderEdges(),this.renderSlots())):e("div",{class:"tree-container tree-error"},e("slot",null)))}get element(){return s(this)}static get watchers(){return{edges:[{validateEdgesProp:0}],direction:[{validateDirection:0}],levelSpacing:[{validateLevelSpacing:0}],nodeSpacing:[{validateNodeSpacing:0}],edgeStyle:[{validateEdgeStyle:0}],showOperators:[{validateShowOperators:0}]}}};x.style=':host{display:inline-block;position:relative;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.tree-container{position:relative;display:inline-block}.tree-grid{position:relative;display:grid;align-items:center}.tree-node{position:relative;z-index:1;border:1px solid #404040;background:var(--bn-font-background, white)}.edge-layer{position:absolute;top:0;left:0;z-index:0;pointer-events:none;overflow:visible}.tree-error{display:flex;flex-wrap:wrap;gap:20px}';export{x as bn_tree}
@@ -1 +1 @@
1
- import{r as t,h as e,H as s,g as r}from"./p-B_d-jp99.js";import{i,w as o,a as n}from"./p-CWiZks2h.js";import{w as a,a as d}from"./p-B4JfKvVT.js";import"./p-Bi2wx-el.js";function l(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e.map(((t,e)=>{var s,r,i;return"string"==typeof t?{label:t,id:String(e)}:"object"==typeof t&&null!==t?{label:null!==(r=null!==(s=t.label)&&void 0!==s?s:t.name)&&void 0!==r?r:String(e),id:null!==(i=t.id)&&void 0!==i?i:String(e)}:{label:String(t),id:String(e)}})):[]}catch(t){return console.error("parseHeaders: failed to parse JSON",t),[]}}function h(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);if(!Array.isArray(e))return["Headers must be an array"];const s=[],r=new Set;return e.forEach(((t,e)=>{"object"==typeof t&&null!==t&&void 0!==t.id&&("string"!=typeof t.id?s.push(`Header[${e}]: 'id' must be a string`):r.has(t.id)?s.push(`Header[${e}]: duplicate id '${t.id}'`):r.add(t.id),void 0!==t.label&&"string"!=typeof t.label&&s.push(`Header[${e}]: 'label' must be a string`))})),s}catch(t){return console.error("validateHeadersJson: failed to parse JSON",t),["Invalid JSON structure"]}}const u=class{validateRowHeaders(t){const e="ERR_rowHeaders",s=h(t);s.length>0?this.errors.addOrReplace({id:e,type:"error",message:`row-headers: ${s.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateColumnHeaders(t){const e="ERR_columnHeaders",s=h(t);s.length>0?this.errors.addOrReplace({id:e,type:"error",message:`column-headers: ${s.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateShowRowHeaders(t){const e="ERR_showRowHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-row-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowColumnHeaders(t){const e="ERR_showColumnHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-column-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowBorders(t){const e="ERR_showBorders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-borders: invalid value '${t}', must be 'true' or 'false'`})}constructor(e){t(this,e),this.gridConfig={rows:[],columns:[]},this.chartTitle="",this.rowHeaders="[]",this.columnHeaders="[]",this.showRowHeaders="true",this.showColumnHeaders="true",this.showBorders="true",this.rowHeaderWidth="auto",this.cellGap="0px",o(this),a(this),this.errors=d(this),this.componentStyle=n(this)}getGridStyle(){return this.componentStyle((t=>t["bn-grid"]))}componentWillLoad(){this.validateRowHeaders(this.rowHeaders),this.validateColumnHeaders(this.columnHeaders),this.validateShowRowHeaders(this.showRowHeaders),this.validateShowColumnHeaders(this.showColumnHeaders),this.validateShowBorders(this.showBorders)}updateGridConfig(){var t;this.gridConfig=(t=this.columnHeaders,{rows:l(this.rowHeaders),columns:l(t)})}shouldShowRowHeaders(){return"true"===this.showRowHeaders&&this.gridConfig.rows.length>0}shouldShowColumnHeaders(){return"true"===this.showColumnHeaders&&this.gridConfig.columns.length>0}shouldShowBorders(){return"true"===this.showBorders}getGridTemplateColumns(){const t=[];this.shouldShowRowHeaders()&&t.push(this.rowHeaderWidth);const e=this.gridConfig.columns.length||1;for(let s=0;s<e;s++)t.push("auto");return t.join(" ")}getGridTemplateRows(){const t=[];this.chartTitle&&t.push("auto"),this.shouldShowColumnHeaders()&&t.push("auto");const e=this.gridConfig.rows.length||1;for(let s=0;s<e;s++)t.push("auto");return t.join(" ")}renderTitle(){if(!this.chartTitle)return null;const t=(this.shouldShowRowHeaders()?1:0)+this.gridConfig.columns.length;return e("div",{class:"grid-title",style:{"grid-column":`1 / span ${t}`,"grid-row":"1"}},this.chartTitle)}renderColumnHeaders(){if(!this.shouldShowColumnHeaders())return null;const t=this.getGridStyle(),s=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,i=this.chartTitle?2:1;return this.gridConfig.columns.map(((o,n)=>{const a=n>0;return e("div",{key:`col-header-${o.id}`,class:"grid-header grid-header-col",style:{"grid-column":String(r+n),"grid-row":String(i),"border-left":a?s:"none",padding:`${t.cellPadding}px`,"padding-left":a?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},o.label)}))}renderDataCells(){const t=this.getGridStyle(),s=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,i=(this.chartTitle?1:0)+(this.shouldShowColumnHeaders()?1:0)+1,o=[];return this.gridConfig.rows.length>0&&this.gridConfig.columns.length>0&&this.gridConfig.rows.forEach(((n,a)=>{if(this.shouldShowRowHeaders()){const r=a>0;o.push(e("div",{key:`row-header-${n.id}`,class:"grid-header grid-header-row",style:{"grid-column":"1","grid-row":String(i+a),"border-top":r?s:"none",padding:`${t.cellPadding}px`,"padding-top":r?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},n.label))}this.gridConfig.columns.forEach(((d,l)=>{const h=function(t,e){return`${t.id}-${e.id}`}(n,d),u=l>0,c=a>0;o.push(e("div",{key:`cell-${h}`,class:"grid-cell",style:{"grid-column":String(r+l),"grid-row":String(i+a),"border-left":u?s:"none","border-top":c?s:"none","padding-left":u?`${t.cellPadding+4}px`:"0","padding-top":c?`${t.cellPadding+4}px`:"0"}},e("slot",{name:h})))}))})),o}getFontStyles(){return this.componentStyle((t=>{var e,s,r,i;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(s=t.global)||void 0===s?void 0:s.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(r=t.global)||void 0===r?void 0:r.fontColor)||"#000000","--bn-font-background":(null===(i=t.global)||void 0===i?void 0:i.fontBackgroundColor)||"#ffffff"}}))}render(){const t={display:"inline-grid","grid-template-columns":this.getGridTemplateColumns(),"grid-template-rows":this.getGridTemplateRows(),gap:this.cellGap};return e(s,{key:"e84402bafd778e7069cd17bd86687a6648dbafe0",style:this.getFontStyles()},e("div",{key:"91941a42bc41fbbaf53c66551035bf97765a9f88",class:"grid-container",style:t},this.renderTitle(),this.renderColumnHeaders(),this.renderDataCells()),e("slot",{key:"349958090f4bf35b9ec768c8994bdf5a96636a36"}))}get element(){return r(this)}static get watchers(){return{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],showRowHeaders:[{validateShowRowHeaders:0}],showColumnHeaders:[{validateShowColumnHeaders:0}],showBorders:[{validateShowBorders:0}]}}};u.style=':host{display:inline-block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.grid-container{display:inline-grid;box-sizing:border-box}.grid-title{font-weight:normal;padding-bottom:8px}.grid-header{display:flex;align-items:flex-end;box-sizing:border-box}.grid-header-row{justify-content:flex-end;padding-right:8px}.grid-header-col{white-space:nowrap;justify-content:flex-start}.grid-cell{position:relative;box-sizing:border-box}';export{u as bn_grid}
1
+ import{r as t,h as e,H as s,g as r}from"./p-B_d-jp99.js";import{i,w as o,a as n}from"./p-BVFHvEXF.js";import{w as a,a as d}from"./p-B4JfKvVT.js";import"./p-DHheVOfP.js";function l(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e.map(((t,e)=>{var s,r,i;return"string"==typeof t?{label:t,id:String(e)}:"object"==typeof t&&null!==t?{label:null!==(r=null!==(s=t.label)&&void 0!==s?s:t.name)&&void 0!==r?r:String(e),id:null!==(i=t.id)&&void 0!==i?i:String(e)}:{label:String(t),id:String(e)}})):[]}catch(t){return console.error("parseHeaders: failed to parse JSON",t),[]}}function h(t){if(!t||""===t.trim()||"[]"===t)return[];try{const e=JSON.parse(t);if(!Array.isArray(e))return["Headers must be an array"];const s=[],r=new Set;return e.forEach(((t,e)=>{"object"==typeof t&&null!==t&&void 0!==t.id&&("string"!=typeof t.id?s.push(`Header[${e}]: 'id' must be a string`):r.has(t.id)?s.push(`Header[${e}]: duplicate id '${t.id}'`):r.add(t.id),void 0!==t.label&&"string"!=typeof t.label&&s.push(`Header[${e}]: 'label' must be a string`))})),s}catch(t){return console.error("validateHeadersJson: failed to parse JSON",t),["Invalid JSON structure"]}}const u=class{validateRowHeaders(t){const e="ERR_rowHeaders",s=h(t);s.length>0?this.errors.addOrReplace({id:e,type:"error",message:`row-headers: ${s.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateColumnHeaders(t){const e="ERR_columnHeaders",s=h(t);s.length>0?this.errors.addOrReplace({id:e,type:"error",message:`column-headers: ${s.join("; ")}`}):this.errors.remove(e),this.updateGridConfig()}validateShowRowHeaders(t){const e="ERR_showRowHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-row-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowColumnHeaders(t){const e="ERR_showColumnHeaders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-column-headers: invalid value '${t}', must be 'true' or 'false'`})}validateShowBorders(t){const e="ERR_showBorders";i(t)?this.errors.remove(e):this.errors.addOrReplace({id:e,type:"warning",message:`show-borders: invalid value '${t}', must be 'true' or 'false'`})}constructor(e){t(this,e),this.gridConfig={rows:[],columns:[]},this.chartTitle="",this.rowHeaders="[]",this.columnHeaders="[]",this.showRowHeaders="true",this.showColumnHeaders="true",this.showBorders="true",this.rowHeaderWidth="auto",this.cellGap="0px",o(this),a(this),this.errors=d(this),this.componentStyle=n(this)}getGridStyle(){return this.componentStyle((t=>t["bn-grid"]))}componentWillLoad(){this.validateRowHeaders(this.rowHeaders),this.validateColumnHeaders(this.columnHeaders),this.validateShowRowHeaders(this.showRowHeaders),this.validateShowColumnHeaders(this.showColumnHeaders),this.validateShowBorders(this.showBorders)}updateGridConfig(){var t;this.gridConfig=(t=this.columnHeaders,{rows:l(this.rowHeaders),columns:l(t)})}shouldShowRowHeaders(){return"true"===this.showRowHeaders&&this.gridConfig.rows.length>0}shouldShowColumnHeaders(){return"true"===this.showColumnHeaders&&this.gridConfig.columns.length>0}shouldShowBorders(){return"true"===this.showBorders}getGridTemplateColumns(){const t=[];this.shouldShowRowHeaders()&&t.push(this.rowHeaderWidth);const e=this.gridConfig.columns.length||1;for(let s=0;s<e;s++)t.push("auto");return t.join(" ")}getGridTemplateRows(){const t=[];this.chartTitle&&t.push("auto"),this.shouldShowColumnHeaders()&&t.push("auto");const e=this.gridConfig.rows.length||1;for(let s=0;s<e;s++)t.push("auto");return t.join(" ")}renderTitle(){if(!this.chartTitle)return null;const t=(this.shouldShowRowHeaders()?1:0)+this.gridConfig.columns.length;return e("div",{class:"grid-title",style:{"grid-column":`1 / span ${t}`,"grid-row":"1"}},this.chartTitle)}renderColumnHeaders(){if(!this.shouldShowColumnHeaders())return null;const t=this.getGridStyle(),s=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,i=this.chartTitle?2:1;return this.gridConfig.columns.map(((o,n)=>{const a=n>0;return e("div",{key:`col-header-${o.id}`,class:"grid-header grid-header-col",style:{"grid-column":String(r+n),"grid-row":String(i),"border-left":a?s:"none",padding:`${t.cellPadding}px`,"padding-left":a?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},o.label)}))}renderDataCells(){const t=this.getGridStyle(),s=this.shouldShowBorders()?`${t.borderWidth}px solid ${t.borderColor}`:"none",r=this.shouldShowRowHeaders()?2:1,i=(this.chartTitle?1:0)+(this.shouldShowColumnHeaders()?1:0)+1,o=[];return this.gridConfig.rows.length>0&&this.gridConfig.columns.length>0&&this.gridConfig.rows.forEach(((n,a)=>{if(this.shouldShowRowHeaders()){const r=a>0;o.push(e("div",{key:`row-header-${n.id}`,class:"grid-header grid-header-row",style:{"grid-column":"1","grid-row":String(i+a),"border-top":r?s:"none",padding:`${t.cellPadding}px`,"padding-top":r?`${t.cellPadding+4}px`:`${t.cellPadding}px`}},n.label))}this.gridConfig.columns.forEach(((d,l)=>{const h=function(t,e){return`${t.id}-${e.id}`}(n,d),u=l>0,c=a>0;o.push(e("div",{key:`cell-${h}`,class:"grid-cell",style:{"grid-column":String(r+l),"grid-row":String(i+a),"border-left":u?s:"none","border-top":c?s:"none","padding-left":u?`${t.cellPadding+4}px`:"0","padding-top":c?`${t.cellPadding+4}px`:"0"}},e("slot",{name:h})))}))})),o}getFontStyles(){return this.componentStyle((t=>{var e,s,r,i;return{"--bn-font-family":(null===(e=t.global)||void 0===e?void 0:e.fontFamily)||"'Noto Sans', sans-serif","--bn-font-size":`${(null===(s=t.global)||void 0===s?void 0:s.fontSizePx)||13.3333}px`,"--bn-font-color":(null===(r=t.global)||void 0===r?void 0:r.fontColor)||"#000000","--bn-font-background":(null===(i=t.global)||void 0===i?void 0:i.fontBackgroundColor)||"#ffffff"}}))}render(){const t={display:"inline-grid","grid-template-columns":this.getGridTemplateColumns(),"grid-template-rows":this.getGridTemplateRows(),gap:this.cellGap};return e(s,{key:"e84402bafd778e7069cd17bd86687a6648dbafe0",style:this.getFontStyles()},e("div",{key:"91941a42bc41fbbaf53c66551035bf97765a9f88",class:"grid-container",style:t},this.renderTitle(),this.renderColumnHeaders(),this.renderDataCells()),e("slot",{key:"349958090f4bf35b9ec768c8994bdf5a96636a36"}))}get element(){return r(this)}static get watchers(){return{rowHeaders:[{validateRowHeaders:0}],columnHeaders:[{validateColumnHeaders:0}],showRowHeaders:[{validateShowRowHeaders:0}],showColumnHeaders:[{validateShowColumnHeaders:0}],showBorders:[{validateShowBorders:0}]}}};u.style=':host{display:inline-block;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000)}.grid-container{display:inline-grid;box-sizing:border-box}.grid-title{font-weight:normal;padding-bottom:8px}.grid-header{display:flex;align-items:flex-end;box-sizing:border-box}.grid-header-row{justify-content:flex-end;padding-right:8px}.grid-header-col{white-space:nowrap;justify-content:flex-start}.grid-cell{position:relative;box-sizing:border-box}';export{u as bn_grid}
@@ -0,0 +1 @@
1
+ import{g as t,f as e}from"./p-B_d-jp99.js";import{g as r,c as n,D as s}from"./p-DHheVOfP.js";import{r as a}from"./p-B4JfKvVT.js";const i=t=>{if("object"==typeof t&&null!==t){if("function"==typeof Object.getPrototypeOf){const e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}return"[object Object]"===Object.prototype.toString.call(t)}return!1},o=(t,e)=>e,c=(t,e)=>[...new Set([...t,...e])],u=(t,e)=>{const r=(t=>{return{arrayMergeType:"combine",arrayMerge:(e=t?t.arrayMergeType:"combine","overwrite"===e?o:c),...t};var e})(e);return t.reduce(((t,e)=>(Object.keys(e).forEach((n=>{Array.isArray(t[n])&&Array.isArray(e[n])?r&&r.arrayMerge&&(t[n]=r.arrayMerge(t[n],e[n])):t[n]=i(t[n])&&i(e[n])?u([t[n],e[n]],r):e[n]})),t)),{})},l=s=>{let i,o,c,l;const d=()=>{const t=o.componentStyles.state;l=u([t._system||{},t._default||{},t[c]||{}])},f=new MutationObserver((r=>{r.forEach((r=>{"selected-style"===r.attributeName&&(c=t(s).getAttribute("selected-style"),d(),e(s))}))})),m=s.connectedCallback;s.connectedCallback=()=>{const n=t(s);o=r(n),l=o.componentStyles.state._system,f.observe(n,{attributes:!0,attributeFilter:["selected-style"]}),c=t(s).getAttribute("selected-style"),d(),i=o.componentStyles.on("set",(r=>{r===c&&(c=t(s).getAttribute("selected-style"),d(),e(t(s)))})),a(m,s)};const h=s.disconnectedCallback;return s.disconnectedCallback=()=>{f.disconnect(),a(i),n(t(s)),a(h,s)},t=>t(l)};var d,f,m,h,y,p,b,g;!function(t){t.ALL="all",t.META="meta"}(d||(d={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(f||(f={})),function(t){t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(m||(m={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu"}(h||(h={})),function(t){t.DECIMAL="decimal",t.PERCENT="percent"}(y||(y={})),function(t){t.LIST="list",t.SUM="sum",t.SUMNOTOTAL="sumnototal",t.OPT="opt",t.OPTNOTOTAL="optnototal"}(p||(p={})),function(t){t.INF="inf",t.W100="w100",t.W50="w50",t.W25="w25",t.W20="w20",t.W15="w15",t.W10="w10",t.W5="w5"}(b||(b={})),function(t){t.W5="w5",t.W10="w10",t.W15="w15",t.W20="w20",t.W25="w25",t.W30="w30",t.W40="w40",t.W60="w60",t.W80="w80",t.W100="w100"}(g||(g={}));const w={[g.W5]:5,[g.W10]:10,[g.W15]:15,[g.W20]:20,[g.W25]:25,[g.W30]:30,[g.W40]:40,[g.W60]:60,[g.W80]:80,[g.W100]:100};var N,v,S,D,k,T,O,A,M,F,J;!function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex"}(N||(N={})),function(t){t.SMART="smart",t.LONG="long",t.SHORT="short"}(v||(v={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(S||(S={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(D||(D={})),function(t){t.SCENARIOS="scenarios",t.DIMENSIONS="dimensions"}(k||(k={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(T||(T={})),function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(O||(O={})),function(t){t.YEAR="year",t.QUARTER="quarter",t.MONTH="month",t.WEEK="week",t.DAY="day",t.HOUR="hour",t.MINUTE="minute",t.SECOND="second",t.MILLISECOND="millisecond",t.NONE="fallback",t.AUTO="auto"}(A||(A={})),function(t){t.AVG="avg",t.INTERVAL="interval",t.START="start",t.END="end",t.YTD="ytd",t.YTG="ytg",t.CUM="cum",t.MAT="mat",t.NONE="none",t.AUTO="auto"}(M||(M={}));class E{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW yyyy",day:"dd.MM.yyyy",hour:"TT",minute:"TT",second:"TT",millisecond:"TT:SSS",fallback:"dd.MM.yyyy"},this._dateFormatShort={year:"yy",quarter:"q'Q'",month:"LLL",week:"'KW'WW",day:"dd",hour:"hh'h'",minute:"mm'm'",second:"ss's'",millisecond:"SSS'ms'",fallback:"dd.MM.yyyy"},this._dateLinkFormat={avg:"Ø[LINK]",interval:"[DATE]..[DATE2]",start:".[DATE]",end:"[DATE].",ytd:"_[DATE]",ytg:"[DATE]_",cum:"[DATE]_[DATE2]",mat:"~[DATE]",none:"[DATE]"},this.locale="de",this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t}setDateFormatShort(t){this.dateFormatShort=t}setLocale(t){this.locale=t}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,e){switch(e){case A.DAY:return this.getFormatedDayDate(t);case A.MONTH:return this.getFormatedMonthDate(t);case A.QUARTER:return this.getFormatedQuarterDate(t);case A.WEEK:return this.getFormatedWeekDate(t);case A.HOUR:return this.getFormatedHourDate(t);case A.MINUTE:return this.getFormatedMinuteDate(t);case A.SECOND:return this.getFormatedSecondDate(t);case A.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,e)}}calculateDistanceType(t,e,r=32){if(null==e)return A.DAY;const n="number"==typeof t?s.fromMillis(t):t,a="number"==typeof e?s.fromMillis(e):e;return 0===a.diff(n).as("milliseconds")?A.DAY:a.diff(n).as("milliseconds")<r?A.MILLISECOND:a.diff(n).as("seconds")<r?A.SECOND:a.diff(n).as("minutes")<r?A.MINUTE:a.diff(n).as("hours")<r?A.HOUR:a.diff(n).as("days")<r?A.DAY:a.diff(n).as("weeks")<r?A.WEEK:a.diff(n).as("months")<r?A.MONTH:a.diff(n).as("quarters")<r?A.QUARTER:A.YEAR}datesBetween(t,e,r,n){const s=this.convertDateDistanceToMomentunitOfTime(r),a=t.startOf(s),i=e.endOf(s);let o=i.diff(a).as(s);const c=[];o>=n&&(o=n);let u=a;do{c.push(u),u=u.plus(this.createDiratonLike(s,1))}while(u<=i&&c.length<o);return c}getDateLinkString(t,e,r,n,a){if(null==t&&null==e)return"";if(null==t&&r!==M.END&&r!==M.YTD)return"";if(null==e&&(M.INTERVAL===r||M.CUM===r||M.END===r||M.YTD===r))return"";const i=t||s.now(),o=e;n===A.AUTO&&(n=this.calculateDistanceType(i,o,a));let c=this.getDateString(i,n),u="",l=M.NONE;return null!=o&&(u=this.getDateString(o,n),l=M.INTERVAL,c===u&&r===M.INTERVAL&&(r=M.NONE),c===u&&r===M.AVG&&(l=M.NONE),M.END!==r&&M.YTD!==r||(c=u),(r===M.INTERVAL||r===M.CUM||M.AVG)&&(n===A.QUARTER?i.quarter===o.quarter&&i.year===o.year?u=u.replace(" "+o.year,""):i.year===o.year&&(c=c.replace(" "+i.year,"")):n===A.MONTH?i.month===o.month&&i.year===o.year?u=u.replace(" "+o.year,""):i.year===o.year&&(c=c.replace(" "+i.year,"")):n===A.WEEK&&(i.weekNumber===o.weekNumber&&i.year===o.year?u=u.replace(" "+o.year,""):i.year===o.year&&(c=c.replace(" "+i.year,""))))),this.dateLinkFormat[r].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",c).replace("[DATE2]",u)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedHourDate(t){let e=this.dateFormatShort.hour;return this.isFirstHour(t)&&(e+=" "+this.dateFormatShort.day),t.setLocale(this.locale).toFormat(e)}getFormatedMinuteDate(t){let e=this.dateFormatShort.minute;return this.isFirstMinute(t)&&(e=this.dateFormatShort.hour+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedSecondDate(t){let e=this.dateFormatShort.second;return this.isFirstSecond(t)&&(e=this.dateFormatShort.minute+":"+e),t.setLocale(this.locale).toFormat(e)}getFormatedMilliSecondDate(t){let e=this.dateFormatShort.millisecond;return this.isFirstMilliSecond(t)&&(e=this.dateFormatShort.second+":"+e),t.setLocale(this.locale).toFormat(e)}isFirstInMonth(t){return 1===t.day}isJanuary(t){return 1===t.month}isFirstQuarter(t){return 1===t.quarter}isFirstWeek(t){return 1===t.weekNumber}isFirstHour(t){return 0===t.hour}isFirstMinute(t){return 0===t.minute}isFirstSecond(t){return 0===t.second}isFirstMilliSecond(t){return 0===t.millisecond}convertDateDistanceToMomentunitOfTime(t){let e;switch(t){case A.YEAR:e="year";break;case A.MONTH:e="month";break;case A.QUARTER:e="quarter";break;case A.WEEK:e="week";break;case A.DAY:e="day";break;case A.HOUR:e="hour";break;case A.MINUTE:e="minute";break;case A.SECOND:e="second";break;case A.MILLISECOND:e="millisecond";break;default:e="day"}return e}createDiratonLike(t,e){switch(t){case"year":return{years:e};case"month":return{months:e};case"quarter":return{quarters:e};case"week":return{weeks:e};case"day":default:return{days:e};case"hour":return{hours:e};case"minute":return{minutes:e};case"second":return{seconds:e};case"millisecond":return{milliseconds:e}}}}class j{static isExisting(t){return null!=t}static isString(t){return"string"==typeof t}static isNumber(t){return"number"==typeof t&&!Number.isNaN(t)}static isBoolean(t){return"boolean"==typeof t}static isArray(t){return Array.isArray(t)}static isObject(t){return"object"==typeof t&&null!==t}static isOperator(t){return"+"===t||"-"===t}static isDate(t){return t instanceof s&&t.isValid}}class L{static adaptDefaultString(t){return j.isString(t)?t.trim():""}static adaptArray(t,e){const r=[];return j.isArray(t)&&t.forEach((t=>{r.push(e.adapt(t))})),r}}!function(t){t.ASC="asc",t.DESC="desc"}(F||(F={})),function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex",t.AC1="ac1",t.AC2="ac2",t.AC3="ac3",t.AC4="ac4",t.PP1="pp1",t.PP2="pp2",t.PP3="pp3",t.PP4="pp4",t.FC1="fc1",t.FC2="fc2",t.FC3="fc3",t.FC4="fc4",t.PL1="pl1",t.PL2="pl2",t.PL3="pl3",t.PL4="pl4"}(J||(J={}));class I{constructor(t=["category"],e=F.ASC){this.hierarchy=t,this.direction=e}}class q{constructor(t){this.stringAdapter=t}adapt(t){var e;const r=L.adaptArray(t.hierarchy,this.stringAdapter),n=F[null===(e=t.direction)||void 0===e?void 0:e.toUpperCase()]||F.ASC;return new I(r.map((t=>J[t.toUpperCase()]||J.CATEGORY)),n)}default(){return new I(["category"],F.ASC)}}function x(t){return null==t||""===t||"null"===t}function G(t){return x(t)||"auto"===t.trim().toLowerCase()?[]:$((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in m)))).toString())}function $(t){return x(t)?[]:t.replace(";",",").split(",").filter((t=>{var e,r,n;const s=t.split("_"),a=null===(e=s[0])||void 0===e?void 0:e.replace(/^dr|^d/,"").toUpperCase().trim(),i=null===(r=s[1])||void 0===r?void 0:r.toUpperCase().trim(),o=null===(n=s[2])||void 0===n?void 0:n.toUpperCase().trim();return 3!==s.length||!(a in m)||!(i in m)||!(o in h)}))}function C(t){return x(t)||"auto"===t.trim().toLowerCase()?[]:$(t.split(",").filter((t=>!(t.toUpperCase()in J))).toString())}function W(t){return!x(t)&&Number.isInteger(Number(t))}function _(t){return!x(t)&&!Number.isNaN(Number(t))}function K(t){return!x(t)&&(null==t?void 0:t.toUpperCase())in F}function z(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in N}function B(t){if(x(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("name")&&t.hasOwnProperty("unit"))))}catch(t){console.error("validateMeasureList: failed to parse JSON",t)}return["Invalid JSON structure"]}function P(t){const e=Date.parse(t);return Number.isInteger(e)}function Q(t){return(null==t?void 0:t.toUpperCase())in M}function H(t){return(null==t?void 0:t.toUpperCase())in A}function R(t){return(null==t?void 0:t.toUpperCase())in v}function V(t){return!x(t)&&(null==t?void 0:t.toUpperCase())in y}function U(t){return!x(t)&&["true","false",!0,!1].some((e=>e===t))}function Y(t){return!x(t)&&(null==t?void 0:t.toUpperCase())in p}function Z(t){if(x(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category")&&t.hasOwnProperty("subCategory"))))}catch(t){console.error("validateThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function X(t){if(x(t))return[];try{const e=JSON.parse(t);if(e instanceof Array)return e.filter((t=>!(t.hasOwnProperty("rowGroup")&&t.hasOwnProperty("category"))))}catch(t){console.error("validatePartOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function tt(t){return(null==t?void 0:t.trim().toUpperCase())in f}function et(t){return["_","k","M","G","T","P","E","Z","Y","m","μ","n","p","P","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function rt(t){return(null==t?void 0:t.toUpperCase().trim())in b}function nt(t){return(null==t?void 0:t.toUpperCase().trim())in g}function st(t){if(x(t))return[];try{return JSON.parse(t).filter((t=>!(t.hasOwnProperty("scenario")&&t.hasOwnProperty("name")&&t.hasOwnProperty("subGroups"))))}catch(t){console.error("validateColumnThereOfJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function at(t){if(x(t))return[];try{const e=JSON.parse(t);if("object"!=typeof e||null===e||Array.isArray(e))return["stack: must be a JSON object"];const r=[];if(e.hasOwnProperty("by")){const t=["scenarios","dimensions"];t.includes(e.by)||r.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else r.push("stack: 'by' is required");if(e.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(e.mode)||r.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(e.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(e.order)||r.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return r}catch(t){return["stack: invalid JSON"]}}class it{constructor(){this.cache=new Map,this.tag=it.makeStyleTag()}static makeStyleTag(){const t=document.createElement("style");return t.type="text/css",t.setAttribute("data-bn-computed-style",""),t.append(document.createTextNode("")),(document.head||document.querySelector("head")).append(t),t}apply(t){t.forEach((t=>this.cache.set(t.className,t.style))),this.tag.innerHTML=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const ot=new it;function ct(t){for(var e,r=0,n=0,s=t.length;s>=4;++n,s-=4)e=1540483477*(65535&(e=255&t.charCodeAt(n)|(255&t.charCodeAt(++n))<<8|(255&t.charCodeAt(++n))<<16|(255&t.charCodeAt(++n))<<24))+(59797*(e>>>16)<<16),r=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(s){case 3:r^=(255&t.charCodeAt(n+2))<<16;case 2:r^=(255&t.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}const ut=t=>_(t)?`${t}px`:t,lt={width:{className:"w",cssName:"width",attrName:"width",transform:ut},height:{className:"h",cssName:"height",attrName:"height",transform:ut},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:ut},right:{className:"rgt",cssName:"right",attrName:"right",transform:ut},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:ut},left:{className:"lft",cssName:"left",attrName:"left",transform:ut},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:ut},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},dt=Object.keys(lt);function ft(t,e){const r=function(t,e){const r=ct(e);return`bn-c-${t.className}_${r}`}(t,e),n=function(t,e,r){return`.${e} {${t.cssName}: ${r};}`}(t,r,e);return{className:r,style:n}}const mt=t=>{const e=new Map;return dt.forEach((r=>{const n=t.getAttribute(r);n&&(["top","left","right","bottom"].includes(r)&&e.set("position",ft(lt.position,"absolute")),e.set(r,ft(lt[r],(lt[r].transform||function(t){return t})(n))))})),e},ht=new MutationObserver((t=>{for(const r of t){const t=r.target,n=mt(t);ot.apply(n);const s=Array.from(n.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...s).join(" "),e(t)}})),yt=e=>{const r=e.connectedCallback,n=e.disconnectedCallback;e.connectedCallback=()=>{const n=t(e);if(!n)throw new Error("Can't find element field in component undefined");(t=>{const e=mt(t);ot.apply(e);const r=Array.from(e.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...r).join(" "),ht.observe(t,{attributes:!0,attributeFilter:dt,childList:!1,subtree:!1})})(n),a(r,e)},e.disconnectedCallback=()=>{a(n,e)}};export{N as A,rt as B,D as C,A as D,st as E,y as F,w as G,g as H,d as I,B as J,P as K,Q as L,f as M,M as N,F as O,L as P,j as Q,q as R,k as S,b as T,E as U,l as a,_ as b,$ as c,z as d,C as e,K as f,W as g,et as h,U as i,at as j,x as k,J as l,O as m,T as n,H as o,R as p,v as q,ct as r,nt as s,V as t,Y as u,G as v,yt as w,Z as x,X as y,tt as z}
@@ -0,0 +1 @@
1
+ import{g as t,c as e}from"./p-DHheVOfP.js";import{r as o}from"./p-B4JfKvVT.js";import{g as n,f as a}from"./p-B_d-jp99.js";const s=(t,e)=>{const o=[],n=[];for(const a of e)(t(a)?o:n).push(a);return[o,n]},r="WARN_use_dataset",i=(t,e)=>{const o=t.errors;if(o)if(e.length>0){const t=e.map((t=>t.substring(1))).join(", ");o.addOrReplace({id:r,type:"warning",message:`Using datasource(s) "${t}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`})}else o.remove(r)},l=(a,r,l)=>{let c,u,d=[],f=[],p=[];const m=(t,e)=>{const o=e?t.substring(1):t;let n;try{n=u.db.db.exec(`SELECT * FROM \`${o}\``)}catch(t){n=[]}r(t,n)},h=()=>{d.forEach((t=>t())),d=[],f.forEach((t=>{t&&(d.push(u.db.subscribe(t,(()=>m(t,!1)))),m(t,!1),(t=>{if(l){const e=u.datasetsMeta.get(t);e&&l(t,e)}})(t))})),p.forEach((t=>{t&&(d.push(u.db.subscribe(t.substring(1),(()=>m(t,!0)))),m(t,!0))}))},v=new MutationObserver((t=>{t.forEach((t=>{"datasets"===t.attributeName&&([p,f]=s((t=>t.startsWith("$")),n(a).getAttribute("datasets").split(",")),i(a,p),h())}))})),g=a.connectedCallback;a.connectedCallback=()=>{const e=n(a);u=t(e),[p,f]=s((t=>t.startsWith("$")),(e.getAttribute("datasets")||"").split(",")),i(a,p),h(),v.observe(e,{attributes:!0,attributeFilter:["datasets"]}),l&&(c=u.datasetsMeta.on("set",((t,e)=>{f.includes(t)&&l(t,e)}))),o(g,a)};const w=a.disconnectedCallback;return a.disconnectedCallback=()=>{v.disconnect(),d.forEach((t=>t())),d=[],o(c),e(n(a)),o(w,a)},t=>{f=t,h()}},c=s=>{let r,i,l;const c=new MutationObserver((t=>{t.forEach((t=>{"namespace"===t.attributeName&&(i=n(s).getAttribute("namespace"),a(s))}))})),u=s.connectedCallback;s.connectedCallback=()=>{const e=n(s);l=t(e),c.observe(e,{attributes:!0,attributeFilter:["namespace"]}),i=n(s).getAttribute("namespace"),r=l.internationalization.on("set",(t=>{t===i&&a(s)})),o(u,s)};const d=s.disconnectedCallback;return s.disconnectedCallback=()=>{c.disconnect(),o(r),e(n(s)),o(d,s)},{t:(t,e)=>{var o,a;t.startsWith(".")&&(t=n(s).localName+t);const r=l.internationalization.state,c=l.context.state.locale;let u=i;return null==(null===(a=null===(o=r[u])||void 0===o?void 0:o[c])||void 0===a?void 0:a[t])&&(u="_system"),r[u][c][t].replace(/{{([\s\S]+?)}}/g,((t,o)=>{var n;return null!==(n=null==e?void 0:e[o.trim()])&&void 0!==n?n:""}))}}};function u(t,e=!1){const o=d(t);if(!o)return e&&console.log("[parentDims] no layout parent found for",t.tagName),{width:0,height:0};const n=getComputedStyle(o),a=o.clientWidth-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight),s=function(t,e=!1){let o=d(t),n=0;for(;o;){const t=getComputedStyle(o),a=t.overflowY;if(e&&console.log(`[height:${n}]`,o.tagName,o.className||"(no class)",`overflow=${a} clientH=${o.clientHeight} h=${t.height}`),"hidden"===a||"scroll"===a||"auto"===a){const a=o.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom);return e&&console.log(`[height] FOUND constrained at depth ${n}: ${Math.round(a)}px`),a}if("none"!==t.maxHeight){const e=parseFloat(t.maxHeight);if(!isNaN(e)&&e>0)return Math.min(e,o.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom))}o=f(o),n++}return e&&console.log("[height] NO constrained ancestor → viewport fallback"),"undefined"!=typeof window?window.innerHeight:0}(t,e);return e&&console.log("[parentDims]",t.tagName,"→ layoutParent:",o.tagName,o.className||"(no class)",`clientW=${o.clientWidth} → w=${Math.round(a)}, h=${Math.round(s)}`,"overflow:",n.overflow),{width:Math.max(0,a),height:Math.max(0,s)}}function d(t){var e;const o=t.parentElement;return(null===(e=null==o?void 0:o.assignedSlot)||void 0===e?void 0:e.parentElement)?o.assignedSlot.parentElement:o}function f(t){var e;return(null===(e=t.assignedSlot)||void 0===e?void 0:e.parentElement)?t.assignedSlot.parentElement:t.parentElement}function p(t){if(null==t||""===t)return{mode:"empty"};if("none"===t)return{mode:"none"};if("auto"===t)return{mode:"auto"};const e=Number(t);return!isNaN(e)&&e>0?{mode:"factor",factor:e}:{mode:"empty"}}export{l as a,u as g,p,c as w}