@bino-bi/bn-template-engine 1.0.0-next.29 → 1.0.0-next.30

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 (238) hide show
  1. package/dist/bn-template-engine/bn-template-engine.esm.js +1 -1
  2. package/dist/bn-template-engine/{p-69dfa165.entry.js → p-132ad556.entry.js} +1 -1
  3. package/dist/bn-template-engine/{p-5e66d1d0.entry.js → p-17d71782.entry.js} +1 -1
  4. package/dist/bn-template-engine/{p-f10950e8.entry.js → p-40ba7f43.entry.js} +1 -1
  5. package/dist/bn-template-engine/p-467871f3.entry.js +1 -0
  6. package/dist/bn-template-engine/p-64803a42.entry.js +1 -0
  7. package/dist/bn-template-engine/p-B8AjeKja.js +1 -0
  8. package/dist/bn-template-engine/p-CrT83eO4.js +1 -0
  9. package/dist/bn-template-engine/p-D_DzKxRV.js +1 -0
  10. package/dist/bn-template-engine/p-Z2rUaSh_.js +1 -0
  11. package/dist/bn-template-engine/{p-12c8c444.entry.js → p-c41c0a1b.entry.js} +1 -1
  12. package/dist/bn-template-engine/p-yc69rwuH.js +1 -0
  13. package/dist/cjs/{bn-asset_28.cjs.entry.js → bn-annotation-layer_30.cjs.entry.js} +1200 -233
  14. package/dist/cjs/bn-grid.cjs.entry.js +4 -4
  15. package/dist/cjs/bn-image.cjs.entry.js +3 -3
  16. package/dist/cjs/bn-internationalization.cjs.entry.js +3 -3
  17. package/dist/cjs/bn-ruleset.cjs.entry.js +3 -3
  18. package/dist/cjs/bn-template-engine.cjs.js +1 -1
  19. package/dist/cjs/bn-text.cjs.entry.js +10 -10
  20. package/dist/cjs/{diagnostics-DMmUPOsm.js → diagnostics-C4Ggts3w.js} +49 -1
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/cjs/{withBodyObserver-CrSp_FfF.js → withBodyObserver-BK4idxqG.js} +1 -1
  23. package/dist/cjs/{withHasError-DpogV-4f.js → withHasError-CqvcS23z.js} +513 -507
  24. package/dist/cjs/{withStyled-TQ67jCAV.js → withStyled-70D4Isgt.js} +3 -2
  25. package/dist/cjs/{sanitizeHtml-Cr0jVSJ_.js → withTranslation-C6Pye2CM.js} +98 -98
  26. package/dist/collection/collection-manifest.json +2 -0
  27. package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.css +24 -0
  28. package/dist/collection/components/bn-annotation-layer/bn-annotation-layer.js +430 -0
  29. package/dist/collection/components/bn-annotation-layer/utils/marks.js +161 -0
  30. package/dist/collection/components/bn-annotation-layer/utils/matchPoint.js +25 -0
  31. package/dist/collection/components/bn-annotation-list/bn-annotation-list.css +46 -0
  32. package/dist/collection/components/bn-annotation-list/bn-annotation-list.js +112 -0
  33. package/dist/collection/components/bn-asset/bn-asset.js +1 -1
  34. package/dist/collection/components/bn-body/bn-body.js +1 -1
  35. package/dist/collection/components/bn-card/bn-card.js +1 -1
  36. package/dist/collection/components/bn-chart-bubble/bn-chart-bubble.js +1 -1
  37. package/dist/collection/components/bn-chart-bubble/utils/BubbleChart.js +29 -21
  38. package/dist/collection/components/bn-chart-bullet/bn-chart-bullet.js +1 -1
  39. package/dist/collection/components/bn-chart-bullet/utils/BulletChart.js +18 -9
  40. package/dist/collection/components/bn-chart-scatter/bn-chart-scatter.js +1 -1
  41. package/dist/collection/components/bn-chart-scatter/utils/ScatterChart.js +21 -13
  42. package/dist/collection/components/bn-chart-structure/bn-chart-structure.js +1 -1
  43. package/dist/collection/components/bn-chart-structure/utils/StructureChart.js +26 -9
  44. package/dist/collection/components/bn-chart-structure/utils/elements/Bar.js +5 -1
  45. package/dist/collection/components/bn-chart-structure/utils/elements/Label.js +11 -0
  46. package/dist/collection/components/bn-chart-structure/utils/elements/Marker.js +5 -1
  47. package/dist/collection/components/bn-chart-structure/utils/elements/Needle.js +4 -1
  48. package/dist/collection/components/bn-chart-structure/utils/elements/StackedBar.js +6 -2
  49. package/dist/collection/components/bn-chart-time/bn-chart-time.js +1 -1
  50. package/dist/collection/components/bn-chart-time/utils/TimeChart.js +28 -2
  51. package/dist/collection/components/bn-chart-time/utils/elements/Column.js +5 -1
  52. package/dist/collection/components/bn-chart-time/utils/elements/Label.js +14 -0
  53. package/dist/collection/components/bn-chart-time/utils/elements/LineSeries.js +12 -9
  54. package/dist/collection/components/bn-chart-time/utils/elements/Marker.js +5 -1
  55. package/dist/collection/components/bn-chart-time/utils/elements/Needle.js +4 -1
  56. package/dist/collection/components/bn-chart-time/utils/elements/StackedColumn.js +6 -2
  57. package/dist/collection/components/bn-component-style/bn-component-style.js +1 -1
  58. package/dist/collection/components/bn-context/bn-context.js +2 -2
  59. package/dist/collection/components/bn-dataset/bn-dataset.js +1 -1
  60. package/dist/collection/components/bn-datasource/bn-datasource.js +1 -1
  61. package/dist/collection/components/bn-footer/bn-footer.js +1 -1
  62. package/dist/collection/components/bn-grid/bn-grid.js +1 -1
  63. package/dist/collection/components/bn-image/bn-image.js +1 -1
  64. package/dist/collection/components/bn-internationalization/bn-internationalization.js +1 -1
  65. package/dist/collection/components/bn-layout-card/bn-layout-card.js +1 -1
  66. package/dist/collection/components/bn-layout-page/bn-layout-page.js +1 -1
  67. package/dist/collection/components/bn-message/bn-message.js +1 -1
  68. package/dist/collection/components/bn-page/bn-page.js +1 -1
  69. package/dist/collection/components/bn-ruleset/bn-ruleset.js +1 -1
  70. package/dist/collection/components/bn-scaling-group/bn-scaling-group.js +1 -1
  71. package/dist/collection/components/bn-table/bn-table-renderer/bn-table-renderer.js +16 -3
  72. package/dist/collection/components/bn-table/bn-table.js +1 -1
  73. package/dist/collection/components/bn-table/utils/factories/tableDataSetFactory.js +26 -1
  74. package/dist/collection/components/bn-table/utils/helper/DataQuery.js +3 -1
  75. package/dist/collection/components/bn-text/bn-text.js +1 -1
  76. package/dist/collection/components/bn-title/bn-title-renderer/bn-title-renderer.js +1 -1
  77. package/dist/collection/components/bn-title/bn-title.js +1 -1
  78. package/dist/collection/stores/componentStyles.js +4 -0
  79. package/dist/collection/stores/createScopedStores.js +3 -1
  80. package/dist/collection/utils/annotations.js +66 -0
  81. package/dist/collection/utils/layoutState/dataPoint.js +59 -0
  82. package/dist/collection/utils/layoutState/geometry.js +46 -0
  83. package/dist/collection/utils/layoutState/index.js +1 -0
  84. package/dist/collection/utils/layoutState/svgChartElements.js +113 -11
  85. package/dist/collection/utils/withComponentStyle.js +2 -1
  86. package/dist/collection/utils/xy/pointKey.js +10 -0
  87. package/dist/components/bn-annotation-layer.d.ts +11 -0
  88. package/dist/components/bn-annotation-layer.js +1 -0
  89. package/dist/components/bn-annotation-list.d.ts +11 -0
  90. package/dist/components/bn-annotation-list.js +1 -0
  91. package/dist/components/bn-asset.js +1 -1
  92. package/dist/components/bn-body.js +1 -1
  93. package/dist/components/bn-card.js +1 -1
  94. package/dist/components/bn-chart-bubble-renderer.js +1 -1
  95. package/dist/components/bn-chart-bubble.js +1 -1
  96. package/dist/components/bn-chart-bullet-renderer.js +1 -1
  97. package/dist/components/bn-chart-bullet.js +1 -1
  98. package/dist/components/bn-chart-scatter-renderer.js +1 -1
  99. package/dist/components/bn-chart-scatter.js +1 -1
  100. package/dist/components/bn-chart-structure-renderer.js +1 -1
  101. package/dist/components/bn-chart-structure.js +1 -1
  102. package/dist/components/bn-chart-time-renderer.js +1 -1
  103. package/dist/components/bn-chart-time.js +1 -1
  104. package/dist/components/bn-component-style.js +1 -1
  105. package/dist/components/bn-context.js +1 -1
  106. package/dist/components/bn-dataset.js +1 -1
  107. package/dist/components/bn-datasource.js +1 -1
  108. package/dist/components/bn-footer.js +1 -1
  109. package/dist/components/bn-grid.js +1 -1
  110. package/dist/components/bn-image.js +1 -1
  111. package/dist/components/bn-internationalization.js +1 -1
  112. package/dist/components/bn-layout-card.js +1 -1
  113. package/dist/components/bn-layout-page.js +1 -1
  114. package/dist/components/bn-message.js +1 -1
  115. package/dist/components/bn-page.js +1 -1
  116. package/dist/components/bn-ruleset.js +1 -1
  117. package/dist/components/bn-scaling-group.js +1 -1
  118. package/dist/components/bn-table-renderer.js +1 -1
  119. package/dist/components/bn-table.js +1 -1
  120. package/dist/components/bn-text.js +1 -1
  121. package/dist/components/bn-title-renderer.js +1 -1
  122. package/dist/components/bn-title.js +1 -1
  123. package/dist/components/bn-tree.js +1 -1
  124. package/dist/components/p-B1nL0yOa.js +1 -0
  125. package/dist/components/p-B7uwck1J.js +1 -0
  126. package/dist/components/{p-Dd6b8E_1.js → p-BDS_jiow.js} +1 -1
  127. package/dist/components/p-BIIDTtcR.js +1 -0
  128. package/dist/components/{p-DCja-Yov.js → p-BQMKgvEC.js} +1 -1
  129. package/dist/components/{p-DynTmVfI.js → p-BSV_vyqs.js} +1 -1
  130. package/dist/components/p-BVKLCz2k.js +1 -0
  131. package/dist/components/{p-BN7PtJVV.js → p-BWBHlztH.js} +1 -1
  132. package/dist/components/{p-BI5orga2.js → p-BXrPfAvP.js} +1 -1
  133. package/dist/components/p-Ba9PUiBp.js +1 -0
  134. package/dist/components/{p-iJCxRAmO.js → p-BpCL2bfw.js} +1 -1
  135. package/dist/components/p-BpsXOtoW.js +1 -0
  136. package/dist/components/{p-DcfgLtdU.js → p-Bs-YxJEt.js} +1 -1
  137. package/dist/components/p-CGI6XIaK.js +1 -0
  138. package/dist/components/{p-Igh8PJUo.js → p-CMM8vtHW.js} +1 -1
  139. package/dist/components/p-COqIkH1M.js +1 -0
  140. package/dist/components/p-CkW23yp2.js +1 -0
  141. package/dist/components/{p-BgWfMdDE.js → p-CtBM3KFY.js} +1 -1
  142. package/dist/components/p-CurWSJkH.js +1 -0
  143. package/dist/components/{p-BhOssNAI.js → p-CxPSvrcF.js} +1 -1
  144. package/dist/components/{p-B7GzUuM1.js → p-D5-dYgK_.js} +1 -1
  145. package/dist/components/p-DEHnizot.js +1 -0
  146. package/dist/components/p-DIyUaSBg.js +1 -0
  147. package/dist/components/p-DPLcGhVt.js +1 -0
  148. package/dist/components/p-DUHp_9X-.js +1 -0
  149. package/dist/components/p-DYG9FH_u.js +1 -0
  150. package/dist/components/{p-DrN6R99a.js → p-DdGnuNtc.js} +1 -1
  151. package/dist/components/{p-C3Lz_w4H.js → p-Dlb4ncGF.js} +1 -1
  152. package/dist/components/p-Dm55bMs2.js +1 -0
  153. package/dist/components/p-Dq1AzGKX.js +1 -0
  154. package/dist/components/{p-BZe4T2ta.js → p-DsOaqeTN.js} +1 -1
  155. package/dist/components/p-Ds_BSK8v.js +1 -0
  156. package/dist/components/{p--cxUP_so.js → p-LZ9lAY8T.js} +1 -1
  157. package/dist/components/{p-DJijh10F.js → p-U3zkcEJZ.js} +1 -1
  158. package/dist/components/p-WzaayhTX.js +1 -0
  159. package/dist/components/p-X9hpquOX.js +1 -0
  160. package/dist/components/p-ey23VlID.js +1 -0
  161. package/dist/components/p-jbp6YiHf.js +1 -0
  162. package/dist/components/p-oJjMz8JF.js +1 -0
  163. package/dist/components/{p-CwzAQJSz.js → p-xhiPDAZa.js} +1 -1
  164. package/dist/components/{p-BcQv74MZ.js → p-xpguaboj.js} +1 -1
  165. package/dist/esm/{bn-asset_28.entry.js → bn-annotation-layer_30.entry.js} +1080 -115
  166. package/dist/esm/bn-grid.entry.js +4 -4
  167. package/dist/esm/bn-image.entry.js +3 -3
  168. package/dist/esm/bn-internationalization.entry.js +3 -3
  169. package/dist/esm/bn-ruleset.entry.js +3 -3
  170. package/dist/esm/bn-template-engine.js +1 -1
  171. package/dist/esm/bn-text.entry.js +4 -4
  172. package/dist/esm/{diagnostics-BaXhpaAg.js → diagnostics-Cyqy1zDT.js} +48 -2
  173. package/dist/esm/loader.js +1 -1
  174. package/dist/esm/{withBodyObserver-1IBghfa8.js → withBodyObserver-JcRB9OPQ.js} +1 -1
  175. package/dist/esm/{withHasError-C8f_AGmT.js → withHasError-l3cMN-oP.js} +915 -909
  176. package/dist/esm/{withStyled-DS6G7yrL.js → withStyled-DGOiR00Q.js} +3 -2
  177. package/dist/esm/{sanitizeHtml-BpBu47OE.js → withTranslation-BpO8BC5B.js} +98 -98
  178. package/dist/schemas/theme.schema.json +21 -0
  179. package/dist/types/components/bn-annotation-layer/bn-annotation-layer.d.ts +81 -0
  180. package/dist/types/components/bn-annotation-layer/utils/marks.d.ts +69 -0
  181. package/dist/types/components/bn-annotation-layer/utils/matchPoint.d.ts +17 -0
  182. package/dist/types/components/bn-annotation-list/bn-annotation-list.d.ts +35 -0
  183. package/dist/types/components/bn-chart-bullet/utils/BulletChart.d.ts +2 -0
  184. package/dist/types/components/bn-chart-structure/utils/StructureChart.d.ts +2 -0
  185. package/dist/types/components/bn-chart-structure/utils/elements/Label.d.ts +5 -0
  186. package/dist/types/components/bn-chart-structure/utils/elements/Marker.d.ts +1 -0
  187. package/dist/types/components/bn-chart-structure/utils/elements/StackedBar.d.ts +2 -1
  188. package/dist/types/components/bn-chart-structure/utils/model/DataPoint.d.ts +3 -0
  189. package/dist/types/components/bn-chart-time/utils/TimeChart.d.ts +2 -0
  190. package/dist/types/components/bn-chart-time/utils/elements/Label.d.ts +5 -0
  191. package/dist/types/components/bn-chart-time/utils/elements/Marker.d.ts +1 -0
  192. package/dist/types/components/bn-chart-time/utils/elements/StackedColumn.d.ts +2 -1
  193. package/dist/types/components/bn-chart-time/utils/model/DataPoint.d.ts +3 -0
  194. package/dist/types/components/bn-table/utils/elements/Cell.d.ts +2 -0
  195. package/dist/types/components/bn-table/utils/elements/TableRow.d.ts +3 -0
  196. package/dist/types/components/bn-table/utils/factories/tableDataSetFactory.d.ts +4 -0
  197. package/dist/types/components.d.ts +174 -0
  198. package/dist/types/context/context-protocol.d.ts +2 -0
  199. package/dist/types/stores/componentStyles.d.ts +8 -0
  200. package/dist/types/stores/createScopedStores.d.ts +1 -0
  201. package/dist/types/utils/annotations.d.ts +45 -0
  202. package/dist/types/utils/layoutState/dataPoint.d.ts +13 -0
  203. package/dist/types/utils/layoutState/geometry.d.ts +12 -0
  204. package/dist/types/utils/layoutState/index.d.ts +1 -0
  205. package/dist/types/utils/layoutState/svgChartElements.d.ts +9 -6
  206. package/dist/types/utils/layoutState/types.d.ts +29 -0
  207. package/dist/types/utils/xy/pointKey.d.ts +9 -0
  208. package/package.json +2 -2
  209. package/readme.md +2 -0
  210. package/dist/bn-template-engine/p-2cbccbe7.entry.js +0 -1
  211. package/dist/bn-template-engine/p-Bo7_IopT.js +0 -1
  212. package/dist/bn-template-engine/p-ByoAF_Qe.js +0 -1
  213. package/dist/bn-template-engine/p-CsupHyLQ.js +0 -1
  214. package/dist/bn-template-engine/p-D0qTf1_a.js +0 -1
  215. package/dist/bn-template-engine/p-b09430b6.entry.js +0 -1
  216. package/dist/bn-template-engine/p-qcLonXCz.js +0 -1
  217. package/dist/components/p-BFUNrRAN.js +0 -1
  218. package/dist/components/p-BN8vBcMD.js +0 -1
  219. package/dist/components/p-BbS6qL8Z.js +0 -1
  220. package/dist/components/p-BvuJFY7b.js +0 -1
  221. package/dist/components/p-CD39zcHF.js +0 -1
  222. package/dist/components/p-CYurh604.js +0 -1
  223. package/dist/components/p-CfBqQljd.js +0 -1
  224. package/dist/components/p-Ci4wYt6s.js +0 -1
  225. package/dist/components/p-ClvHVwGH.js +0 -1
  226. package/dist/components/p-Co1dDaxy.js +0 -1
  227. package/dist/components/p-Cq5MNEMN.js +0 -1
  228. package/dist/components/p-CtiP8VJ_.js +0 -1
  229. package/dist/components/p-D413xjVu.js +0 -1
  230. package/dist/components/p-D4lSYFwX.js +0 -1
  231. package/dist/components/p-DZ3ub5DV.js +0 -1
  232. package/dist/components/p-Di57x1j-.js +0 -1
  233. package/dist/components/p-DtBFwIVs.js +0 -1
  234. package/dist/components/p-e6lZYVYf.js +0 -1
  235. package/dist/components/p-g4dh_F-M.js +0 -1
  236. package/dist/components/p-kGB4WKet.js +0 -1
  237. package/dist/components/p-pH6_06qq.js +0 -1
  238. package/dist/components/p-xJ1DeaDY.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as s,h as t,a as e,g as r}from"./p-CCZcKl0Q.js";import{w as i}from"./p-CrT83eO4.js";import{w as o,a,g as c}from"./p-yc69rwuH.js";const h=class{constructor(t){s(this,t),this.name="_default",o(this),this.errors=a(this),i(this,(s=>{this.stores||(this.stores=c(this.element));try{const t=JSON.parse(s);this.stores.ruleSets.set(this.name,t),this.errors.remove("ERR_body")}catch(s){this.errors.addOrReplace({id:"ERR_body",type:"error",message:`bn-ruleset: Failed to parse JSON body - ${s.message}`}),console.error(s)}}))}render(){return t(e,{key:"de03c25692178ed0f97c1e0d914396cba7c53cc3"})}get element(){return r(this)}};h.style="bn-ruleset{display:none}";export{h as bn_ruleset}
@@ -0,0 +1 @@
1
+ import{g as t,r as n,c as e,R as o}from"./p-yc69rwuH.js";import{g as r,f as i}from"./p-CCZcKl0Q.js";import{i as s}from"./p-Z2rUaSh_.js";const a=new Set(["br","b","i","strong","em","span","p","div","table","tr","td","th","thead","tbody","tfoot","ul","ol","li","h1","h2","h3","h4","h5","h6","sub","sup","small","hr","a","img","code","pre","blockquote","del"]),l=new Set(["class","style","colspan","rowspan","href","title","src","alt","width","height"]),u=new Set(["http:","https:","mailto:"]),c=/^\s*text-align:\s*(left|center|right)\s*;?\s*$/i;function d(t){if(!t)return"";const n=(new DOMParser).parseFromString(t,"text/html").body;return f(n),n.innerHTML}function f(t){for(const n of Array.from(t.childNodes)){if(n.nodeType===Node.TEXT_NODE)continue;const e=n;if(n.nodeType!==Node.ELEMENT_NODE||!a.has(e.localName)){t.removeChild(n);continue}for(const t of Array.from(e.attributes)){const n=t.name.toLowerCase();l.has(n)&&("href"!==n&&"src"!==n||v(n,t.value))||e.removeAttribute(t.name)}const o=e.getAttribute("style");null===o||c.test(o)||e.removeAttribute("style"),f(e)}}function v(t,n){try{const{protocol:e}=new URL(n,"http://a");return u.has(e)||"src"===t&&"data:"===e}catch(t){return!1}}function h(t,n=!1){const e=p(t);if(!e)return n&&console.log("[parentDims] no layout parent found for",t.tagName),{width:0,height:0};const o=getComputedStyle(e),r=e.clientWidth-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight),i=function(t,n=!1){let e=p(t),o=0,r=null,i=1;for(;e;){if(e.hasAttribute("data-bn-fit-content")){n&&console.log(`[height:${o}]`,e.tagName,"fit-content region → discarding inner candidate"),r=null;const t=parseInt(e.getAttribute("data-bn-fit-content"),10);!isNaN(t)&&t>1&&(i*=t),e=m(e),o++;continue}const t=getComputedStyle(e),s=t.overflowY;if(n&&console.log(`[height:${o}]`,e.tagName,e.className||"(no class)",`overflow=${s} clientH=${e.clientHeight} h=${t.height}`),null===r)if("hidden"===s||"scroll"===s||"auto"===s)r=e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom),n&&console.log(`[height] candidate at depth ${o}: ${Math.round(r)}px`);else if("none"!==t.maxHeight){const n=parseFloat(t.maxHeight);!isNaN(n)&&n>0&&(r=Math.min(n,e.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)))}e=m(e),o++}return null!==r?r/i:(n&&console.log("[height] NO constrained ancestor → viewport fallback"),"undefined"!=typeof window?window.innerHeight/i:0)}(t,n);return n&&console.log("[parentDims]",t.tagName,"→ layoutParent:",e.tagName,e.className||"(no class)",`clientW=${e.clientWidth} → w=${Math.round(r)}, h=${Math.round(i)}`,"overflow:",o.overflow),{width:Math.max(0,r),height:Math.max(0,i)}}function p(t){var n;const e=t.parentElement;return(null===(n=null==e?void 0:e.assignedSlot)||void 0===n?void 0:n.parentElement)?e.assignedSlot.parentElement:e}function m(t){var n;if(null===(n=t.assignedSlot)||void 0===n?void 0:n.parentElement)return t.assignedSlot.parentElement;if(t.parentElement)return t.parentElement;const e=t.getRootNode();return e instanceof ShadowRoot?e.host:null}function b(t,n){const e=t.getBoundingClientRect(),o=t.offsetHeight>0?e.height/t.offsetHeight:0;if(!(o>0)||Math.abs(o-(t.offsetWidth>0?e.width/t.offsetWidth:0))>.01*o)return 0;const r=e.top+n*o;let i=0;for(let n=t;n;n=m(n)){const t=getComputedStyle(n).overflowY;if("hidden"===t||"clip"===t)i=Math.max(i,r-n.getBoundingClientRect().bottom);else if(("auto"===t||"scroll"===t)&&n.scrollHeight>n.clientHeight+1)break}return i/o}const g=(t,n)=>Math.round(t*n*100)/100;function w(t){if(null==t||""===t)return{mode:"empty"};if("none"===t)return{mode:"none"};if("auto"===t)return{mode:"auto"};const n=Number(t);return!isNaN(n)&&n>0?{mode:"factor",factor:n}:{mode:"empty"}}const y={k:1e3,K:1e3,M:1e6,G:1e9,T:1e12},$=/^(\d+(?:\.\d+)?|\.\d+)\s*([kKMGT])?$/;function M(t){var n;if("number"==typeof t)return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"invalid",raw:String(t)};const e=null!==(n=null==t?void 0:t.toString().trim())&&void 0!==n?n:"";if("auto"===e.toLowerCase())return{kind:"auto"};const o=$.exec(e);if(o){const t=Number(o[1])*(o[2]?y[o[2]]:1);if(Number.isFinite(t)&&t>0)return{kind:"number",value:t}}return{kind:"invalid",raw:e}}function k(t,n){const e=M(t);if("auto"===e.kind)return{kind:"auto"};if("string"==typeof t){const e=t.trim();if(n.has(e))return{kind:"value",value:n.get(e)}}return"number"===e.kind?{kind:"value",value:e.value}:{kind:"invalid",raw:e.raw}}const N=[[1e12,"T"],[1e9,"G"],[1e6,"M"],[1e3,"k"]];function S(t){if(!Number.isFinite(t)||t<=0)return String(t);const n=t=>String(Number(t.toPrecision(3)));for(const[e,o]of N)if(t>=e)return`${n(t/e)}${o}`;return n(t)}const F="WARN_datasets",R=(o,i,s)=>{let a,l,u=[],c=[],d=[],f="";const v=()=>{const t=f;f=o.datasets||"",""!==t&&t!==f&&i("",[]),[d,c]=((t,n)=>{const e=[],o=[];for(const t of n)(r=t,r.startsWith("$")?e:o).push(t);var r;return[e,o]})(0,f.split(",")),((t,n)=>{const e=t.errors;if(e)if(n.length>0){const t=n.map((t=>t.substring(1))).join(", ");e.addOrReplace({id:F,type:"warning",message:`Using datasource(s) "${t}" directly. Prefer using a dataset (bn-dataset) for query support and metadata.`})}else e.remove(F)})(o,d),p()},h=(t,n)=>{const e=n?t.substring(1):t;let o;try{o=l.db.db.exec(`SELECT * FROM \`${e}\``)}catch(t){o=[]}i(t,o)},p=()=>{u.forEach((t=>t())),u=[],c.forEach((t=>{t&&(u.push(l.db.subscribe(t,(()=>h(t,!1)))),h(t,!1),(t=>{if(s){const n=l.datasetsMeta.get(t);n&&s(t,n)}})(t))})),d.forEach((t=>{t&&(u.push(l.db.subscribe(t.substring(1),(()=>h(t,!0)))),h(t,!0))}))},m=new MutationObserver((t=>{t.forEach((t=>{"datasets"===t.attributeName&&(o.datasets||"")!==f&&v()}))})),b=o.connectedCallback;o.connectedCallback=()=>{const e=r(o);l=t(e),v(),m.observe(e,{attributes:!0,attributeFilter:["datasets"]}),s&&(a=l.datasetsMeta.on("set",((t,n)=>{c.includes(t)&&s(t,n)}))),n(b,o)};const g=o.disconnectedCallback;return o.disconnectedCallback=()=>{m.disconnect(),u.forEach((t=>t())),u=[],n(a),e(r(o)),n(g,o)},t=>{c=t,p()}},O="inherited-page",C="bn-layout-page";function j(t){return"inherited-closest"===t||t===O}function T(t,n){const e=[];let o=t.parentNode;for(;o;){const t=o.nodeName.toLowerCase();if(t===C){e.push(o);break}if("bn-layout-card"===t&&n!==O&&e.push(o),o.parentNode)o=o.parentNode;else{if(!(o instanceof ShadowRoot))break;o=o.host}}return e}function _(t,n){var e;const o=t=>{const e=t.getAttribute(n),o=null==e?void 0:e.trim();return s(o)||j(o)?void 0:e};for(const r of t){if((null===(e=r.getAttribute(n))||void 0===e?void 0:e.trim())===O){const n=t.find((t=>t.nodeName.toLowerCase()===C)),e=n&&o(n);if(void 0!==e)return e;continue}const i=o(r);if(void 0!==i)return i}}const x=(t,e,o)=>{const s=new Map,a=new Map;let l=null;const u=()=>{var n;const o=r(t);s.clear(),a.clear(),l&&(l.disconnect(),l=null);const c=new Map;for(const r of e){const e=t[r.propName];if("string"!=typeof e||!j(e))continue;a.set(r.propName,e);const i=T(o,e),l=_(i,r.ancestorAttr);void 0!==l&&s.set(r.propName,l);for(const t of i)c.set(t,[...null!==(n=c.get(t))&&void 0!==n?n:[],r.ancestorAttr])}if(c.size>0){l=new MutationObserver((()=>{u(),i(t)}));for(const[t,n]of c)l.observe(t,{attributes:!0,attributeFilter:n})}},c=t.connectedCallback;t.connectedCallback=()=>{u(),n(c,t)};const d=t.disconnectedCallback;t.disconnectedCallback=()=>{l&&(l.disconnect(),l=null),s.clear(),a.clear(),n(d,t)};const f=t=>{var n;return null===(n=e.find((n=>n.propName===t)))||void 0===n?void 0:n.ancestorAttr.replace(/-(\w)/g,((t,n)=>n.toUpperCase()))};return(t,n,e)=>{const r=`WARN_inherited_${t}`,i=j(n);i&&a.get(t)!==n&&u();const l=i?s.get(t):void 0;return i&&void 0===l?(null==o||o.addOrReplace({id:r,type:"warning",message:`${t}: '${n}' could not be resolved, no surrounding ${n===O?"page":"card or page"} sets ${f(t)}`}),{value:e,inherited:!1,unresolved:!0}):(null==o||o.remove(r),{value:null!=l?l:n,inherited:void 0!==l,unresolved:!1})}},A=s=>{let a,l,u,c,d=null;const f=()=>{const t=r(s);if(d&&(d.disconnect(),d=null),u=s.i18nNamespace,l=u,null!=l)return;const n=function(t){let n=t.parentNode;for(;n;){if(n instanceof HTMLElement&&n.hasAttribute("i18n-namespace"))return n;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof ShadowRoot))break;n=n.host}}}(t);n&&(l=n.getAttribute("i18n-namespace"),d=new MutationObserver((()=>{f(),i(s)})),d.observe(n,{attributes:!0,attributeFilter:["i18n-namespace"]}))},v=s.connectedCallback;s.connectedCallback=()=>{const e=r(s);c=t(e),f(),a=c.internationalization.on("set",(t=>{t!==l&&"_system"!==t||i(s)})),n(v,s)};const h=s.disconnectedCallback;return s.disconnectedCallback=()=>{d&&(d.disconnect(),d=null),n(a),e(r(s)),n(h,s)},{t:(t,n)=>{var e,i,a,d,v;void 0!==c&&s.i18nNamespace!==u&&f(),t.startsWith(".")&&(t=r(s).localName+t),Object.prototype.hasOwnProperty.call(o,t)&&(t=o[t]);const h=c.internationalization.state,p=c.context.state.locale,m=null!==(a=null===(i=null===(e=h[l])||void 0===e?void 0:e[p])||void 0===i?void 0:i[t])&&void 0!==a?a:null===(v=null===(d=h._system)||void 0===d?void 0:d[p])||void 0===v?void 0:v[t];return null==m?t:m.replace(/{{([\s\S]+?)}}/g,((t,e)=>{var o;return null!==(o=null==n?void 0:n[e.trim()])&&void 0!==o?o:""}))}}};export{R as a,b,g as c,k as d,S as e,T as f,h as g,x as h,j as i,M as j,w as p,_ as r,d as s,A as w}
@@ -0,0 +1 @@
1
+ import{g as r}from"./p-CCZcKl0Q.js";import{r as t}from"./p-yc69rwuH.js";const o=(o,s)=>{let a;const c=new MutationObserver((()=>{var r;a&&s(null!==(r=a.textContent)&&void 0!==r?r:"")})),e=o.connectedCallback;o.connectedCallback=()=>{var i;a=r(o),c.observe(a,{childList:!0,subtree:!0,characterData:!0}),s(null!==(i=a.textContent)&&void 0!==i?i:""),t(e,o)};const i=o.disconnectedCallback;o.disconnectedCallback=()=>{c.disconnect(),t(i,o)}};export{o as w}
@@ -0,0 +1 @@
1
+ import{b as t}from"./p-yc69rwuH.js";const n=t=>Math.round(100*t)/100;function o(t){return{x:n(t.left),y:n(t.top),width:n(t.width),height:n(t.height)}}function r(t,o){const r=n(t.width),e=n(t.height);return{context:{x:n(t.left-o.context.x),y:n(t.top-o.context.y),width:r,height:e},component:{x:n(t.left-o.component.x),y:n(t.top-o.component.y),width:r,height:e}}}function e(t,n){return r(t.getBoundingClientRect(),n)}function i(t){const n=getComputedStyle(t,"::before").content;if(!n||"none"===n||"normal"===n)return 0;const o=t.ownerDocument.createElement("canvas").getContext("2d");if(!o)return 0;const{fontStyle:r,fontWeight:e,fontSize:i,fontFamily:u}=getComputedStyle(t);return o.font=`${r} ${e} ${i} ${u}`,o.measureText(n.replace(/^"|"$/g,"")).width}function u(t,n){var o,e;const i=null===(e=null===(o=t.ownerDocument)||void 0===o?void 0:o.createRange)||void 0===e?void 0:e.call(o);if(!i)return;const u=t.getBoundingClientRect(),c=t.querySelector("svg text");let a;if(c)a=c.getBoundingClientRect();else{i.selectNodeContents(t);const n=t.querySelector(".prefix-second");n&&i.setStartAfter(n),a=i.getBoundingClientRect()}const s=Math.max(a.left,u.left),f=Math.max(a.top,u.top),l=Math.min(a.right,u.right)-s,d=Math.min(a.bottom,u.bottom)-f;return l>0&&d>0?r({left:s,top:f,width:l,height:d},n):void 0}function c(n){const o=n.getBoundingClientRect(),r=t(n),e=r?r.getBoundingClientRect():o;return{context:{x:e.left,y:e.top},component:{x:o.left,y:o.top}}}function a(t){var n,o;return null!==(o=null!==(n=t.getAttribute("id"))&&void 0!==n?n:t.getAttribute("name"))&&void 0!==o?o:void 0}function s(t){var n;return null!==(n=a(t))&&void 0!==n?n:t.localName}function f(t){const n=new Map;return t.map((({tag:t,explicitId:o})=>{var r;const e=null!==(r=n.get(t))&&void 0!==r?r:0;return n.set(t,e+1),null!=o?o:`${t}[${e}]`}))}function l(t){const n=t.getAttribute("has-error");if(!n)return[];try{const t=JSON.parse(n);return Array.isArray(t)?t:[]}catch(t){return[]}}export{s as a,f as b,a as c,u as d,i as e,e as m,c as o,l as r,o as t}
@@ -0,0 +1 @@
1
+ import{g as t,f as e}from"./p-CCZcKl0Q.js";import{g as n,r,c as s,D as a}from"./p-yc69rwuH.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,u=(t,e)=>[...new Set([...t,...e])],c=(t,e)=>{const n=(t=>{return{arrayMergeType:"combine",arrayMerge:(e=t?t.arrayMergeType:"combine","overwrite"===e?o:u),...t};var e})(e);return t.reduce(((t,e)=>(Object.keys(e).forEach((r=>{Array.isArray(t[r])&&Array.isArray(e[r])?n&&n.arrayMerge&&(t[r]=n.arrayMerge(t[r],e[r])):t[r]=i(t[r])&&i(e[r])?c([t[r],e[r]],n):e[r]})),t)),{})},l=a=>{let i,o,u,l;const f=()=>{const t=o.componentStyles.state;l=c([t._system||{},t._default||{},t[u]||{}],{arrayMergeType:"overwrite"})},d=a.connectedCallback;a.connectedCallback=()=>{const s=t(a);o=n(s),l=o.componentStyles.state._system,u=a.selectedStyle,f(),i=o.componentStyles.on("set",(n=>{n!==u&&"_default"!==n||(u=a.selectedStyle,f(),e(t(a)))})),r(d,a)};const h=a.disconnectedCallback;return a.disconnectedCallback=()=>{r(i),s(t(a)),r(h,a)},t=>(void 0!==o&&a.selectedStyle!==u&&(u=a.selectedStyle,f()),t(l))};var f,d,h,m,y,p,b,g;!function(t){t.ALL="all",t.META="meta"}(f||(f={})),function(t){t.CURRENCY="currency",t.VOLUME="volume"}(d||(d={})),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"}(h||(h={})),function(t){t.POS="pos",t.NEG="neg",t.NEU="neu"}(m||(m={})),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 v={[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 w,N,k,S,O,D;!function(t){t.ROWGROUP="rowGroup",t.ROWGROUPINDEX="rowGroupIndex",t.CATEGORY="category",t.CATEGORYINDEX="categoryIndex",t.SUBCATEGORY="subCategory",t.SUBCATEGORYINDEX="subCategoryIndex"}(w||(w={})),function(t){t.SMART="smart",t.LONG="long",t.SHORT="short"}(N||(N={})),function(t){t.COLUMN="column",t.LINE="line",t.WATERFALL="waterfall"}(k||(k={})),function(t){t.BAR="bar",t.LINE="line",t.AUTO="auto"}(S||(S={})),function(t){t.SCENARIOS="scenarios",t.DIMENSIONS="dimensions"}(O||(O={})),function(t){t.ABSOLUTE="absolute",t.RELATIVE="relative",t.ABSOLUTE_RELATIVE="absolute-relative"}(D||(D={}));const T=100;var M;!function(t){t.ASC="asc",t.DESC="desc",t.DATASET="dataset"}(M||(M={}));const A=/^\s*(set|first|last|min|max|avg|sum|lit)\(\s*(.*?)\s*\)\s*$/,j=/^[A-Za-z_][A-Za-z0-9_]*$/,J=["min","max","avg","sum"];class F{constructor(t,e,n,r){this.label=t,this.alias=e,this.fn=n,this.arg=r}get isNumeric(){return J.includes(this.fn)}}function E(t){if("string"!=typeof t)return!1;const e=A.exec(t);if(!e)return!1;const[,n,r]=e;return"lit"===n?r.length>0:j.test(r)}function $(t,e,n){if(!E(n))return null;const[,r,s]=A.exec(n);return new F(t,e,r,s)}var L,I,W,x;!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"}(L||(L={})),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"}(I||(I={}));class _{constructor(){this._dateFormat={year:"yyyy",quarter:"q'Q' yyyy",month:"LLL yyyy",week:"'KW'WW kkkk",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.dateFormatPinned=!1,this.dateFormatShortPinned=!1,this.dateFormat=this._dateFormat,this.dateLinkFormat=this._dateLinkFormat,this.dateFormatShort=this._dateFormatShort}setDateLinkFormat(t){this.dateLinkFormat=t}setDateFormat(t){this.dateFormat=t,this.dateFormatPinned=!0}setDateFormatShort(t){this.dateFormatShort=t,this.dateFormatShortPinned=!0}setLocale(t){this.locale=t,this.dateFormatPinned||(this.dateFormat=Object.assign(Object.assign({},this._dateFormat),_.LOCALE_DATE_FORMAT[t]||{})),this.dateFormatShortPinned||(this.dateFormatShort=Object.assign(Object.assign({},this._dateFormatShort),_.LOCALE_DATE_FORMAT_SHORT[t]||{}))}getDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormat[e]||this.dateFormat.fallback)}getSmartDateString(t,e){switch(e){case L.DAY:return this.getFormatedDayDate(t);case L.MONTH:return this.getFormatedMonthDate(t);case L.QUARTER:return this.getFormatedQuarterDate(t);case L.WEEK:return this.getFormatedWeekDate(t);case L.HOUR:return this.getFormatedHourDate(t);case L.MINUTE:return this.getFormatedMinuteDate(t);case L.SECOND:return this.getFormatedSecondDate(t);case L.MILLISECOND:return this.getFormatedMilliSecondDate(t);default:return this.getDateString(t,e)}}calculateDistanceType(t,e,n=32){if(null==e)return L.DAY;const r="number"==typeof t?a.fromMillis(t):t,s="number"==typeof e?a.fromMillis(e):e;return 0===s.diff(r).as("milliseconds")?L.DAY:s.diff(r).as("milliseconds")<n?L.MILLISECOND:s.diff(r).as("seconds")<n?L.SECOND:s.diff(r).as("minutes")<n?L.MINUTE:s.diff(r).as("hours")<n?L.HOUR:s.diff(r).as("days")<n?L.DAY:s.diff(r).as("weeks")<n?L.WEEK:s.diff(r).as("months")<n?L.MONTH:s.diff(r).as("quarters")<n?L.QUARTER:L.YEAR}datesBetween(t,e,n){const r=this.convertDateDistanceToMomentunitOfTime(n),s=t.startOf(r),a=e.endOf(r),i=[];let o=s;do{i.push(o),o=o.plus(this.createDiratonLike(r,1))}while(o<=a);return i}countBetween(t,e,n){const r=this.convertDateDistanceToMomentunitOfTime(n);return Math.floor(e.startOf(r).diff(t.startOf(r),r).as(r))+1}getDateLinkString(t,e,n,r,s){if(null==t&&null==e)return"";if(null==t&&n!==I.END&&n!==I.YTD)return"";if(null==e&&(I.INTERVAL===n||I.CUM===n||I.END===n||I.YTD===n))return"";const i=t||a.now(),o=e;r===L.AUTO&&(r=this.calculateDistanceType(i,o,s));let u=this.getDateString(i,r),c="",l=I.NONE;return null!=o&&(c=this.getDateString(o,r),l=I.INTERVAL,u===c&&n===I.INTERVAL&&(n=I.NONE),u===c&&n===I.AVG&&(l=I.NONE),I.END!==n&&I.YTD!==n||(u=c),n!==I.INTERVAL&&n!==I.CUM&&n!==I.AVG||(r===L.QUARTER?i.quarter===o.quarter&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===L.MONTH?i.month===o.month&&i.year===o.year?c=c.replace(" "+o.year,""):i.year===o.year&&(u=u.replace(" "+i.year,"")):r===L.WEEK&&(i.weekNumber===o.weekNumber&&i.weekYear===o.weekYear?c=c.replace(" "+o.weekYear,""):i.weekYear===o.weekYear&&(u=u.replace(" "+i.weekYear,""))))),this.dateLinkFormat[n].replace("[LINK]",this.dateLinkFormat[l]).replace("[DATE]",u).replace("[DATE2]",c)}getShortDateString(t,e){return t.setLocale(this.locale).toFormat(this.dateFormatShort[e]||this.dateFormatShort.fallback)}getFormatedDayDate(t){let e=this.dateFormatShort.day;return this.isFirstInMonth(t)&&(e+=" "+this.dateFormatShort.month),this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedMonthDate(t){let e=this.dateFormatShort.month;return this.isJanuary(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedQuarterDate(t){let e=this.dateFormatShort.quarter;return this.isFirstQuarter(t)&&(e+=" "+this.dateFormatShort.year),t.setLocale(this.locale).toFormat(e)}getFormatedWeekDate(t){let e=this.dateFormatShort.week;return this.isFirstWeek(t)&&(e+=" kk"),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 L.YEAR:e="year";break;case L.MONTH:e="month";break;case L.QUARTER:e="quarter";break;case L.WEEK:e="week";break;case L.DAY:e="day";break;case L.HOUR:e="hour";break;case L.MINUTE:e="minute";break;case L.SECOND:e="second";break;case L.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}}}}_.LOCALE_DATE_FORMAT={en:{week:"'W'WW kkkk",day:"MM/dd/yyyy",fallback:"MM/dd/yyyy"}},_.LOCALE_DATE_FORMAT_SHORT={en:{week:"'W'WW",fallback:"MM/dd/yyyy"}};class q{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 a&&t.isValid}}class C{static adaptDefaultString(t){return q.isString(t)?t.trim():""}static adaptArray(t,e){const n=[];return q.isArray(t)&&t.forEach((t=>{n.push(e.adapt(t))})),n}}!function(t){t.ASC="asc",t.DESC="desc"}(W||(W={})),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"}(x||(x={}));class G{constructor(t=["category"],e=W.ASC){this.hierarchy=t,this.direction=e}}class z{constructor(t){this.stringAdapter=t}adapt(t){var e;const n=C.adaptArray(t.hierarchy,this.stringAdapter),r=W[null===(e=t.direction)||void 0===e?void 0:e.toUpperCase()]||W.ASC;return new G(n.map((t=>x[t.toUpperCase()]||x.CATEGORY)),r)}default(){return new G(["category"],W.ASC)}}const K="n/a";function Q(t,e){if(!(Math.abs(e)<=1e-9*Math.abs(t)))return t/Math.abs(e)}const Z=/^(dr|d)((?:ac|pp|fc|pl)[1-4])_((?:ac|pp|fc|pl)[1-4])(?:_(pos|neg|neu))?$/;class B{constructor(t,e,n){this.type=t,this.base=e,this.delta=n}static parse(t){const e=Z.exec(t);return null===e?null:new B(e[1],e[2],e[3])}compute(t,e){var n;return null==t||null==e?null:"dr"===this.type?0===e?null:null!==(n=Q(t-e,e))&&void 0!==n?n:null:t-e}}function H(t){const e=t.trim();if(Object.values(h).includes(e))return{kind:"scenario",slot:e};const n=B.parse(e);return null!==n?{kind:"variance",measure:n}:null}function P(t){return t.replace(/\d+$/,"")}function R(t){return t.replace(/^[a-z]+/,"")}function Y(t){var e;return"dr"===(null===(e=B.parse(t.trim()))||void 0===e?void 0:e.type)}function U(t){if(!Y(t.measure))return t;const e=t=>void 0===t?void 0:t/100;return Object.assign(Object.assign({},t),{min:e(t.min),max:e(t.max),refLine:e(t.refLine),highlight:t.highlight&&{from:e(t.highlight.from),to:e(t.highlight.to)}})}function V(t){return null==t||""===t||"null"===t}function X(t){return V(t)||"auto"===t.trim().toLowerCase()?[]:tt((null==t?void 0:t.split(",").filter((t=>!(t.toUpperCase().trim()in h)))).toString())}function tt(t){return V(t)?[]:t.replace(";",",").split(",").filter((t=>{var e,n,r;const s=t.split("_"),a=null===(e=s[0])||void 0===e?void 0:e.replace(/^dr|^d/,"").toUpperCase().trim(),i=null===(n=s[1])||void 0===n?void 0:n.toUpperCase().trim(),o=null===(r=s[2])||void 0===r?void 0:r.toUpperCase().trim();return 3!==s.length||!(a in h)||!(i in h)||!(o in m)}))}function et(t){return V(t)?[]:tt(t.split(",").filter((t=>!(t.toUpperCase().trim()in h))).toString())}function nt(t){return V(t)||"auto"===t.trim().toLowerCase()?[]:tt(t.split(",").filter((t=>!(t.toUpperCase()in x))).toString())}function rt(t){return!V(t)&&Number.isInteger(Number(t))}function st(t){return!V(t)&&!Number.isNaN(Number(t))}function at(t){return!V(t)&&(null==t?void 0:t.toUpperCase())in W}function it(t){return"auto"===(null==t?void 0:t.toLowerCase())||(null==t?void 0:t.toUpperCase())in w}function ot(t){if(V(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 ut(t){const e=Date.parse(t);return Number.isInteger(e)}function ct(t){return(null==t?void 0:t.toUpperCase())in I}function lt(t){return(null==t?void 0:t.toUpperCase())in L}function ft(t){return(null==t?void 0:t.toUpperCase())in N}function dt(t){return!V(t)&&(null==t?void 0:t.toUpperCase())in y}function ht(t){return!V(t)&&(null==t?void 0:t.toUpperCase())in p}function mt(t){if(V(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 yt(t){if(V(t))return[];try{const e=JSON.parse(t);if(null!==e&&"object"==typeof e&&!(e instanceof Array))return Object.entries(e).filter((([,t])=>"string"!=typeof t||!E(t))).map((([t,e])=>`${t}: ${e}`))}catch(t){console.error("validateAttributesJsonStr: failed to parse JSON",t)}return["Invalid JSON structure"]}function pt(t){if(V(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 bt(t){return(null==t?void 0:t.trim().toUpperCase())in d}function gt(t){return["_","k","M","G","T","P","E","Z","Y","m","my","μ","n","p","f","a","z","y"].includes(null==t?void 0:t.trim())||["GREATEST","LEAST"].includes(null==t?void 0:t.trim().toUpperCase())}function vt(t){return(null==t?void 0:t.toUpperCase().trim())in b}function wt(t){return(null==t?void 0:t.toUpperCase().trim())in g}function Nt(t){if(V(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 kt(t){if(V(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 n=[];if(e.hasOwnProperty("by")){const t=["scenarios","dimensions"];t.includes(e.by)||n.push(`stack: 'by' must be one of: ${t.join(", ")}`)}else n.push("stack: 'by' is required");if(e.hasOwnProperty("mode")){const t=["absolute","relative","absolute-relative"];t.includes(e.mode)||n.push(`stack: 'mode' must be one of: ${t.join(", ")}`)}if(e.hasOwnProperty("order")){const t=["asc","desc","dataset"];t.includes(e.order)||n.push(`stack: 'order' must be one of: ${t.join(", ")}`)}return n}catch(t){return["stack: invalid JSON"]}}function St(t){return!V(t)&&null!==H(t)}class Ot{constructor(){this.cache=new Map,this.tag=Ot.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.textContent=Array.from(this.cache.values()).map((t=>t)).join("\n")}}const Dt=new Ot;function Tt(t){for(var e,n=0,r=0,s=t.length;s>=4;++r,s-=4)e=1540483477*(65535&(e=255&t.charCodeAt(r)|(255&t.charCodeAt(++r))<<8|(255&t.charCodeAt(++r))<<16|(255&t.charCodeAt(++r))<<24))+(59797*(e>>>16)<<16),n=1540483477*(65535&(e^=e>>>24))+(59797*(e>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(s){case 3:n^=(255&t.charCodeAt(r+2))<<16;case 2:n^=(255&t.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}const Mt=t=>st(t)?`${t}px`:t,At={width:{className:"w",cssName:"width",attrName:"width",transform:Mt},height:{className:"h",cssName:"height",attrName:"height",transform:Mt},position:{className:"pst",cssName:"position",attrName:"position"},top:{className:"top",cssName:"top",attrName:"top",transform:Mt},right:{className:"rgt",cssName:"right",attrName:"right",transform:Mt},bottom:{className:"btm",cssName:"bottom",attrName:"bottom",transform:Mt},left:{className:"lft",cssName:"left",attrName:"left",transform:Mt},"font-size":{className:"fts",cssName:"font-size",attrName:"font-size",transform:Mt},"grid-column":{className:"gdc",cssName:"grid-column",attrName:"grid-column"},"grid-row":{className:"gdr",cssName:"grid-row",attrName:"grid-row"}},jt=Object.keys(At);function Jt(t,e,n){return`.${e} {${t.cssName}: ${n};}`}function Ft(t,e){const n=document.createElement("div").style;n.setProperty(t.cssName,e);const r=n.getPropertyValue(t.cssName);if(n.cssText=`${t.cssName}:${r};--bn-end:1`,!r||r.includes("<")||"1"!==n.getPropertyValue("--bn-end"))return;const s=function(t,e){const n=Tt(e);return`bn-c-${t.className}_${n}`}(t,e);return{className:s,style:Jt(t,s,r)}}const Et=t=>{const e=new Map;return jt.forEach((n=>{const r=t.getAttribute(n);if(r){["top","left","right","bottom"].includes(n)&&e.set("position",Ft(At.position,"absolute"));const t=Ft(At[n],(At[n].transform||function(t){return t})(r));t&&e.set(n,t)}})),e},$t=new MutationObserver((t=>{for(const n of t){const t=n.target,r=Et(t);Dt.apply(r);const s=Array.from(r.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...s).join(" "),e(t)}})),Lt=e=>{const n=e.connectedCallback,s=e.disconnectedCallback;e.connectedCallback=()=>{const s=t(e);if(!s)throw new Error("Can't find element field in component undefined");(t=>{const e=Et(t);Dt.apply(e);const n=Array.from(e.values()).map((t=>t.className));t.className=t.className.split(" ").filter((t=>!t.startsWith("bn-c-"))).concat(...n).join(" "),$t.observe(t,{attributes:!0,attributeFilter:jt,childList:!1,subtree:!1})})(s),r(n,e)},e.disconnectedCallback=()=>{r(s,e)}};export{$,w as A,lt as B,q as C,ft as D,L as E,N as F,S as G,_ as H,Tt as I,et as J,wt as K,dt as L,ht as M,K as N,W as O,mt as P,pt as Q,T as R,O as S,bt as T,vt as U,Nt as V,yt as W,y as X,f as Y,b as Z,d as _,l as a,v as a0,g as a1,j as a2,h as a3,ot as a4,ut as a5,ct as a6,I as a7,rt as b,St as c,R as d,U as e,Y as f,at as g,G as h,V as i,x as j,X as k,tt as l,c as m,it as n,gt as o,kt as p,M as q,H as r,P as s,D as t,C as u,nt as v,Lt as w,z as x,Q as y,st as z}
@@ -1 +1 @@
1
- import{r as t,f as n,h as o,a as i,g as s}from"./p-CCZcKl0Q.js";import{w as e,a,g as l,p as r,s as d}from"./p-ByoAF_Qe.js";import{w as c,a as u}from"./p-D0qTf1_a.js";import{w as v,a as h}from"./p-qcLonXCz.js";const f="[A-Za-z_$\\u00C0-\\uFFFF][\\w$\\u00C0-\\uFFFF]*",p="'[^'\\\\]*'|\"[^\"\\\\]*\"",g=`(?:this\\.)?data(?:\\.(${f})|\\[\\s*(${p})\\s*\\])\\[\\s*(\\d+)\\s*\\]\\.(${f})`,m=new RegExp(`\\$\\{\\s*(?:${g}|t\\(\\s*(${p})\\s*(?:,\\s*\\{([^{}]*)\\}\\s*)?\\))\\s*\\}`,"g"),b=new RegExp(`\\s*(?:(${f})|(${p}))\\s*:\\s*(?:(${p})|(-?\\d+(?:\\.\\d+)?)|(${g}))\\s*(?:,|$)`,"y"),$=t=>String(t).replace(/[&<>"'\t\n\f\r ]/g,(t=>`&#${t.charCodeAt(0)};`)),w=(t,n)=>"object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0,y=t=>t.slice(1,-1);const _=class{constructor(o){t(this,o),this.refit=()=>{n(this)},this.data={},v(this),c(this),this.errors=u(this),this.t=e(this).t,a(this,((t,n)=>{this.data=""===t?{}:Object.assign(Object.assign({},this.data),{[t]:n})})),this.componentStyle=h(this)}connectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.refit)}disconnectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.removeEventListener("loadingdone",this.refit)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"WARN_value",type:"warning",message:"Empty value"}):this.errors.remove("WARN_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const n=Number(t);isNaN(n)||n<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}prepareStyle(){return this.componentStyle((t=>{var n,o,i,s,e,a,l,r,d,c,u,v,h,f,p,g,m,b,$,w,y,_;return{fontStyles:{font:`${null!==(s=null!==(o=null===(n=t["bn-text"])||void 0===n?void 0:n.fontSizePx)&&void 0!==o?o:null===(i=t.global)||void 0===i?void 0:i.fontSizePx)&&void 0!==s?s:13.3333}px ${null!==(r=null!==(a=null===(e=t["bn-text"])||void 0===e?void 0:e.fontFamily)&&void 0!==a?a:null===(l=t.global)||void 0===l?void 0:l.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(v=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(u=t.global)||void 0===u?void 0:u.fontSizePx)&&void 0!==v?v:13.3333,color:null!==(g=null!==(f=null===(h=t["bn-text"])||void 0===h?void 0:h.fontColor)&&void 0!==f?f:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==g?g:"#000000",background:null!==(w=null!==(b=null===(m=t["bn-text"])||void 0===m?void 0:m.fontBackgroundColor)&&void 0!==b?b:null===($=t.global)||void 0===$?void 0:$.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==(_=null===(y=t["bn-text"])||void 0===y?void 0:y.leading)&&void 0!==_?_:1.8}}}))}applyScaling(t){const n=this.element,{mode:o,factor:i}=r(this.scale),{width:s,height:e}=l(n),a=n.scrollHeight>n.clientHeight+1?n.clientHeight:e,d=s,c=d>0&&n.scrollWidth>d+1,u=a>0&&n.scrollHeight>a+1,v=c||u;if(d<=0&&a<=0)return;if("none"===o){if(v){const t=[];c&&t.push(`w:${n.scrollWidth}>${Math.round(d)}`),u&&t.push(`h:${n.scrollHeight}>${Math.round(a)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===o){if(v){const t=[];c&&t.push(`w:${n.scrollWidth}>${Math.round(d)}`),u&&t.push(`h:${n.scrollHeight}>${Math.round(a)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${i} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}n.style.setProperty("--bn-font-size",`${t}px`);const h=n.scrollWidth,f=n.scrollHeight,p=n.clientHeight,g=f>p+1?p:e,m=d<=0||h<=d+1,b=g<=0||f<=g+1;if(m&&b)return void this.errors.remove("AUTO_scale");const $=Math.min(1,!m&&d>0?d/h:1,!b&&g>0?g/f:1);n.style.setProperty("--bn-font-size",t*$+"px"),"empty"===o?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled font by factor ${$.toFixed(3)}`}):this.errors.remove("AUTO_scale")}componentDidRender(){var t;const{html:n,unknown:o}=function(t,n,o){const i=[],s=t=>{i.includes(t)||i.push(t)},e=(t,o,i,e,a)=>{const l=w(w(w(n,null!=o?o:y(i)),String(Number(e))),a);return void 0===l&&s(t),l};return{html:t.replace(m,((t,n,i,a,l,r,d)=>{const c=t.slice(2,-1).trim();try{if(void 0===r){const t=e(c,n,i,a,l);return null==t?"":$(t)}const s=void 0===d?void 0:(t=>{const n={};for(b.lastIndex=0;""!==t.slice(b.lastIndex).trim();){const o=b.exec(t);if(!o)return null;const[,i,s,a,l,r,d,c,u,v]=o;n[null!=i?i:y(s)]=void 0!==a?y(a):void 0!==l?Number(l):e(r,d,c,u,v)}return n})(d);return null===s?t:$(o(y(r),s))}catch(t){return s(c),""}})),unknown:i}}(null!==(t=this.value)&&void 0!==t?t:"",this.data,this.t);o.length>0?this.errors.addOrReplace({id:"WARN_value_path",type:"warning",message:`Unknown template path: ${o.join(", ")}`}):this.errors.remove("WARN_value_path"),this.container.innerHTML=d(n),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:n,factor:s}=r(this.scale),e="factor"===n?t.size*s+"px":`${t.size}px`,a={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":e,"--bn-font-color":t.color,"--bn-font-background":t.background};return o(i,{key:"b679839cdae3989d23ac92c2bd483f48fc078105",style:a},o("div",{key:"96b880775434f24c3cf4967d248e36566a057c7a"},o("span",{key:"cf90b893c0b2d0e54f52ae51f08ef922ada22b36",class:"container",ref:t=>{this.container=t}})))}get element(){return s(this)}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}};_.style=':host{padding:0.5em;display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000);background-color:var(--bn-font-background, white)}span.container p{margin:0}';export{_ as bn_text}
1
+ import{r as t,f as n,h as i,a as o,g as s}from"./p-CCZcKl0Q.js";import{w as e,a,g as l,p as r,s as d}from"./p-B8AjeKja.js";import{w as c,a as u}from"./p-yc69rwuH.js";import{w as f,a as v}from"./p-Z2rUaSh_.js";const h="[A-Za-z_$\\u00C0-\\uFFFF][\\w$\\u00C0-\\uFFFF]*",p="'[^'\\\\]*'|\"[^\"\\\\]*\"",g=`(?:this\\.)?data(?:\\.(${h})|\\[\\s*(${p})\\s*\\])\\[\\s*(\\d+)\\s*\\]\\.(${h})`,b=new RegExp(`\\$\\{\\s*(?:${g}|t\\(\\s*(${p})\\s*(?:,\\s*\\{([^{}]*)\\}\\s*)?\\))\\s*\\}`,"g"),m=new RegExp(`\\s*(?:(${h})|(${p}))\\s*:\\s*(?:(${p})|(-?\\d+(?:\\.\\d+)?)|(${g}))\\s*(?:,|$)`,"y"),$=t=>String(t).replace(/[&<>"'\t\n\f\r ]/g,(t=>`&#${t.charCodeAt(0)};`)),w=(t,n)=>"object"==typeof t&&null!==t&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:void 0,y=t=>t.slice(1,-1);const _=class{constructor(i){t(this,i),this.refit=()=>{n(this)},this.data={},f(this),c(this),this.errors=u(this),this.t=e(this).t,a(this,((t,n)=>{this.data=""===t?{}:Object.assign(Object.assign({},this.data),{[t]:n})})),this.componentStyle=v(this)}connectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.addEventListener("loadingdone",this.refit)}disconnectedCallback(){var t;null===(t=document.fonts)||void 0===t||t.removeEventListener("loadingdone",this.refit)}validateValue(t){"string"!=typeof t||""===t?this.errors.addOrReplace({id:"WARN_value",type:"warning",message:"Empty value"}):this.errors.remove("WARN_value")}validateScaling(t){if(null==t||""===t||"none"===t||"auto"===t)return void this.errors.remove("WARN_scale");const n=Number(t);isNaN(n)||n<=0?this.errors.addOrReplace({id:"WARN_scale",type:"warning",message:`Invalid scale value: "${t}". Use "none", "auto", or a positive number.`}):this.errors.remove("WARN_scale")}componentWillLoad(){this.validateValue(this.value),this.validateScaling(this.scale)}prepareStyle(){return this.componentStyle((t=>{var n,i,o,s,e,a,l,r,d,c,u,f,v,h,p,g,b,m,$,w,y,_;return{fontStyles:{font:`${null!==(s=null!==(i=null===(n=t["bn-text"])||void 0===n?void 0:n.fontSizePx)&&void 0!==i?i:null===(o=t.global)||void 0===o?void 0:o.fontSizePx)&&void 0!==s?s:13.3333}px ${null!==(r=null!==(a=null===(e=t["bn-text"])||void 0===e?void 0:e.fontFamily)&&void 0!==a?a:null===(l=t.global)||void 0===l?void 0:l.fontFamily)&&void 0!==r?r:"'Noto Sans', sans-serif"}`,size:null!==(f=null!==(c=null===(d=t["bn-text"])||void 0===d?void 0:d.fontSizePx)&&void 0!==c?c:null===(u=t.global)||void 0===u?void 0:u.fontSizePx)&&void 0!==f?f:13.3333,color:null!==(g=null!==(h=null===(v=t["bn-text"])||void 0===v?void 0:v.fontColor)&&void 0!==h?h:null===(p=t.global)||void 0===p?void 0:p.fontColor)&&void 0!==g?g:"#000000",background:null!==(w=null!==(m=null===(b=t["bn-text"])||void 0===b?void 0:b.fontBackgroundColor)&&void 0!==m?m:null===($=t.global)||void 0===$?void 0:$.fontBackgroundColor)&&void 0!==w?w:"#ffffff",leading:null!==(_=null===(y=t["bn-text"])||void 0===y?void 0:y.leading)&&void 0!==_?_:1.8}}}))}applyScaling(t){const n=this.element,{mode:i,factor:o}=r(this.scale),{width:s,height:e}=l(n),a=n.scrollHeight>n.clientHeight+1?n.clientHeight:e,d=s,c=d>0&&n.scrollWidth>d+1,u=a>0&&n.scrollHeight>a+1,f=c||u;if(d<=0&&a<=0)return;if("none"===i){if(f){const t=[];c&&t.push(`w:${n.scrollWidth}>${Math.round(d)}`),u&&t.push(`h:${n.scrollHeight}>${Math.round(a)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows container (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}if("factor"===i){if(f){const t=[];c&&t.push(`w:${n.scrollWidth}>${Math.round(d)}`),u&&t.push(`h:${n.scrollHeight}>${Math.round(a)}`),this.errors.addOrReplace({id:"WARN_overflow",type:"warning",message:`Content overflows with factor ${o} (${t.join(", ")})`})}else this.errors.remove("WARN_overflow");return}n.style.setProperty("--bn-font-size",`${t}px`);const v=n.scrollWidth,h=n.scrollHeight,p=n.clientHeight,g=h>p+1?p:e,b=d<=0||v<=d+1,m=g<=0||h<=g+1;if(b&&m)return void this.errors.remove("AUTO_scale");const $=Math.min(1,!b&&d>0?d/v:1,!m&&g>0?g/h:1);n.style.setProperty("--bn-font-size",t*$+"px"),"empty"===i?this.errors.addOrReplace({id:"AUTO_scale",type:"warning",message:`Auto-scaled font by factor ${$.toFixed(3)}`}):this.errors.remove("AUTO_scale")}componentDidRender(){var t;const{html:n,unknown:i}=function(t,n,i){const o=[],s=t=>{o.includes(t)||o.push(t)},e=(t,i,o,e,a)=>{const l=w(w(w(n,null!=i?i:y(o)),String(Number(e))),a);return void 0===l&&s(t),l};return{html:t.replace(b,((t,n,o,a,l,r,d)=>{const c=t.slice(2,-1).trim();try{if(void 0===r){const t=e(c,n,o,a,l);return null==t?"":$(t)}const s=void 0===d?void 0:(t=>{const n={};for(m.lastIndex=0;""!==t.slice(m.lastIndex).trim();){const i=m.exec(t);if(!i)return null;const[,o,s,a,l,r,d,c,u,f]=i;n[null!=o?o:y(s)]=void 0!==a?y(a):void 0!==l?Number(l):e(r,d,c,u,f)}return n})(d);return null===s?t:$(i(y(r),s))}catch(t){return s(c),""}})),unknown:o}}(null!==(t=this.value)&&void 0!==t?t:"",this.data,this.t);i.length>0?this.errors.addOrReplace({id:"WARN_value_path",type:"warning",message:`Unknown template path: ${i.join(", ")}`}):this.errors.remove("WARN_value_path"),this.container.innerHTML=d(n),this.applyScaling(this.prepareStyle().fontStyles.size)}render(){const{fontStyles:t}=this.prepareStyle(),{mode:n,factor:s}=r(this.scale),e="factor"===n?t.size*s+"px":`${t.size}px`,a={"--bn-font-family":t.font.substring(t.font.indexOf("px ")+3),"--bn-font-size":e,"--bn-font-color":t.color,"--bn-font-background":t.background};return i(o,{key:"47eaf1468ffc8b8de7e77f2b0aff4b927f8b0471",style:a},i("div",{key:"1f592c2fd0a4af77047c56ee043f6bdd84dfb2d2"},i("span",{key:"ecad3e6ea36dfa495ef78183fc6c3979eb9d5be2",class:"container",ref:t=>{this.container=t}})))}get element(){return s(this)}static get watchers(){return{value:[{validateValue:0}],scale:[{validateScaling:0}]}}};_.style=':host{padding:0.5em;display:inline-block;position:relative;overflow:hidden;font-family:var(--bn-font-family, "Noto Sans", sans-serif);font-size:var(--bn-font-size, 13.3333px);color:var(--bn-font-color, #000000);background-color:var(--bn-font-background, white)}span.container p{margin:0}';export{_ as bn_text}