@umriss-ui/calculation 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/calculation.css +1 -1
- package/dist/calculation.js +72 -72
- package/docs/llms-full.md +1360 -1870
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,14 @@ under a heading "Changed" of its own, no matter which digit rose.
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
+
## 0.4.5 – Core 0.21.0 (Oct. 2026)
|
|
15
|
+
|
|
16
|
+
Needs `@umriss-ui/core` 0.21; the peer range moves to `^0.21.0`. Its record
|
|
17
|
+
picker in the scenarios is a `Select` at its natural width now, beside its
|
|
18
|
+
line of text instead of before it. Nothing else changes for a caller.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
14
22
|
## 0.4.4 – Core 0.20.0 (Oct. 2026)
|
|
15
23
|
|
|
16
24
|
Needs `@umriss-ui/core` 0.20; the peer range moves to `^0.20.0`. Nothing else changes for a caller.
|
package/dist/calculation.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.base{._text_ocaqi_23{font-family:var(--u-font-sans);font-size:var(--u-text-md);line-height:var(--u-leading-normal);color:var(--u-color-text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}@media(pointer:fine){._dense_ocaqi_39{--u-control-height-sm: var(--u-control-height-xs)}}._field_ocaqi_46{caret-color:var(--u-color-accent)}._scroll_ocaqi_52{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--u-color-text) 25%,transparent) transparent}._scroll_ocaqi_52::-webkit-scrollbar{width:10px;height:10px}._scroll_ocaqi_52::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--u-color-text) 22%,transparent);border-radius:var(--u-radius-full);border:3px solid transparent;background-clip:content-box}._scroll_ocaqi_52::-webkit-scrollbar-track{background:transparent}}@layer umriss.components{._ring_ocaqi_81:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}@media(pointer:coarse){._field_ocaqi_46._field_ocaqi_46{font-size:16px}}._field_ocaqi_46:-webkit-autofill,._field_ocaqi_46:-webkit-autofill:hover,._field_ocaqi_46:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 1000px var(--u-color-surface),0 0 0 1px var(--u-edge-color-strong);-webkit-text-fill-color:var(--u-color-text);caret-color:var(--u-color-accent)}}@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.components{._frame_c4ne1_24,._frame_c4ne1_24:before,._frame_c4ne1_24:after{box-sizing:border-box}._calculation_c4ne1_46,._calculation_c4ne1_46:before,._calculation_c4ne1_46:after{box-sizing:border-box}._disclosure_c4ne1_60,._disclosure_c4ne1_60:before,._disclosure_c4ne1_60:after{box-sizing:border-box}._list_c4ne1_64,._list_c4ne1_64:before,._list_c4ne1_64:after{box-sizing:border-box}._item_c4ne1_65,._item_c4ne1_65:before,._item_c4ne1_65:after{box-sizing:border-box}._derivation_c4ne1_66,._derivation_c4ne1_66:before,._derivation_c4ne1_66:after{box-sizing:border-box}._line_c4ne1_116,._line_c4ne1_116:before,._line_c4ne1_116:after{box-sizing:border-box}._labelCell_c4ne1_158,._labelCell_c4ne1_158:before,._labelCell_c4ne1_158:after{box-sizing:border-box}._names_c4ne1_159,._names_c4ne1_159:before,._names_c4ne1_159:after{box-sizing:border-box}._operator_c4ne1_160,._operator_c4ne1_160:before,._operator_c4ne1_160:after{box-sizing:border-box}._amount_c4ne1_161,._amount_c4ne1_161:before,._amount_c4ne1_161:after{box-sizing:border-box}._unit_c4ne1_162,._unit_c4ne1_162:before,._unit_c4ne1_162:after{box-sizing:border-box}._assessment_c4ne1_163,._assessment_c4ne1_163:before,._assessment_c4ne1_163:after{box-sizing:border-box}._label_c4ne1_158,._label_c4ne1_158:before,._label_c4ne1_158:after{box-sizing:border-box}._approximate_c4ne1_281,._approximate_c4ne1_281:before,._approximate_c4ne1_281:after{box-sizing:border-box}._target_c4ne1_309,._target_c4ne1_309:before,._target_c4ne1_309:after{box-sizing:border-box}._worst_c4ne1_310,._worst_c4ne1_310:before,._worst_c4ne1_310:after{box-sizing:border-box}._head_c4ne1_407,._head_c4ne1_407:before,._head_c4ne1_407:after{box-sizing:border-box}._headCell_c4ne1_414,._headCell_c4ne1_414:before,._headCell_c4ne1_414:after{box-sizing:border-box}._headUnit_c4ne1_427,._headUnit_c4ne1_427:before,._headUnit_c4ne1_427:after{box-sizing:border-box}._notes_c4ne1_434,._notes_c4ne1_434:before,._notes_c4ne1_434:after{box-sizing:border-box}._freshness_c4ne1_448,._freshness_c4ne1_448:before,._freshness_c4ne1_448:after{box-sizing:border-box}._headLabel_c4ne1_478,._headLabel_c4ne1_478:before,._headLabel_c4ne1_478:after{box-sizing:border-box}._frame_c4ne1_24{font-size:var(--u-text-sm);border-radius:var(--u-radius-md);corner-shape:squircle;background:var(--u-color-surface);outline:1px solid transparent;box-shadow:var(--u-edge);overflow-x:auto;overflow-y:hidden;--disclosure-size: 20px;--disclosure-gap: var(--u-space-2);container-type:inline-size;width:100%}._calculation_c4ne1_46{display:grid;grid-template-columns:fit-content(22rem) minmax(0,1fr) auto var(--figure-tracks, auto auto) auto;margin:0;padding:0;list-style:none}._frame_c4ne1_24[data-still]{--disclosure-size: 0px;--disclosure-gap: 0px}._frame_c4ne1_24[data-still] ._disclosure_c4ne1_60{display:none}._list_c4ne1_64,._item_c4ne1_65,._derivation_c4ne1_66{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;margin:0;padding:0;list-style:none}._derivation_c4ne1_66[hidden]{display:none}._derivation_c4ne1_66:not([hidden]){animation:_derivationIn_c4ne1_1 var(--u-duration-fast) var(--u-ease-out)}@keyframes _derivationIn_c4ne1_1{0%{opacity:0}}._item_c4ne1_65{--fall: calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) / 2 - 1px)}._derivation_c4ne1_66{position:relative}._derivation_c4ne1_66:before{content:"";position:absolute;top:0;bottom:0;left:var(--fall);z-index:1;width:2px;background:var(--u-color-accent);pointer-events:none}:not(._derivation_c4ne1_66)>._item_c4ne1_65[data-open]>._line_c4ne1_116:not([data-mark]),:not(._derivation_c4ne1_66)>._item_c4ne1_65>._derivation_c4ne1_66{background-color:var(--u-color-surface-sunken)}._derivation_c4ne1_66 ._line_c4ne1_116{border-top-color:transparent}._line_c4ne1_116{position:relative;display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;border-top:1px solid var(--u-hairline)}._calculation_c4ne1_46>._item_c4ne1_65:first-child>._line_c4ne1_116:first-child,._calculation_c4ne1_46>._item_c4ne1_65:first-child>._list_c4ne1_64>._item_c4ne1_65:first-child>._line_c4ne1_116{border-top-color:transparent}._line_c4ne1_116[data-foldable]{cursor:pointer}._line_c4ne1_116[data-mark]{background:color-mix(in srgb,var(--u-color-accent-subtle) 50%,transparent)}._line_c4ne1_116[data-mark=use]{background:var(--u-color-accent-subtle)}._labelCell_c4ne1_158,._names_c4ne1_159,._operator_c4ne1_160,._amount_c4ne1_161,._unit_c4ne1_162,._assessment_c4ne1_163{grid-row:1;padding-top:var(--u-space-2);padding-bottom:var(--u-space-2)}._labelCell_c4ne1_158{grid-column:1;display:flex;align-items:baseline;gap:var(--disclosure-gap);min-width:0;padding-left:calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5));padding-right:var(--u-space-5)}._label_c4ne1_158{min-width:0;color:var(--u-color-text)}._line_c4ne1_116[data-reference] ._label_c4ne1_158{font-style:italic;color:var(--u-color-text-secondary)}._disclosure_c4ne1_60{flex:none;align-self:center;display:inline-flex;align-items:center;justify-content:center;width:var(--disclosure-size);height:var(--disclosure-size);padding:0;border:none;border-radius:var(--u-radius-xs);corner-shape:squircle;background:none;color:var(--u-color-text-muted)}button._disclosure_c4ne1_60{box-sizing:border-box}button._disclosure_c4ne1_60{cursor:pointer}button._disclosure_c4ne1_60:hover,._line_c4ne1_116[data-foldable]:hover button._disclosure_c4ne1_60{box-sizing:border-box}button._disclosure_c4ne1_60:hover,._line_c4ne1_116[data-foldable]:hover button._disclosure_c4ne1_60{background:var(--u-color-surface-sunken);color:var(--u-color-text)}button._disclosure_c4ne1_60:active,._line_c4ne1_116[data-foldable]:active button._disclosure_c4ne1_60{box-sizing:border-box}button._disclosure_c4ne1_60:active,._line_c4ne1_116[data-foldable]:active button._disclosure_c4ne1_60{background:var(--u-color-surface-pressed)}._item_c4ne1_65[data-open]>._line_c4ne1_116 button._disclosure_c4ne1_60{box-sizing:border-box}._item_c4ne1_65[data-open]>._line_c4ne1_116 button._disclosure_c4ne1_60{color:var(--u-color-accent)}button._disclosure_c4ne1_60:focus-visible{box-sizing:border-box}button._disclosure_c4ne1_60:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}._disclosure_c4ne1_60 svg{box-sizing:border-box}._disclosure_c4ne1_60 svg{transition:transform var(--u-transition-path)}._disclosure_c4ne1_60 svg[data-open]{box-sizing:border-box}._disclosure_c4ne1_60 svg[data-open]{transform:rotate(90deg)}._names_c4ne1_159{grid-column:2;min-width:0;overflow:hidden;padding-right:var(--u-space-4);white-space:nowrap;text-overflow:ellipsis;color:var(--u-color-text-secondary)}._operator_c4ne1_160,._amount_c4ne1_161,._unit_c4ne1_162{font-family:var(--u-font-mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}._operator_c4ne1_160{grid-column:3;padding-right:var(--u-space-3);text-align:right;color:var(--u-color-text-secondary)}._amount_c4ne1_161{grid-column:var(--column, 4);text-align:right;color:var(--u-color-text)}._amount_c4ne1_161[data-verdict=unknown]{color:var(--u-color-text-secondary)}._approximate_c4ne1_281{display:inline-block;margin-right:var(--u-space-1);color:var(--u-color-text-secondary);cursor:help}._unit_c4ne1_162{grid-column:var(--column, 5);padding-left:var(--u-space-1);padding-right:var(--u-space-3);color:var(--u-color-text-secondary)}._assessment_c4ne1_163{grid-column:var(--assessment-column, 6);display:flex;align-items:baseline;justify-content:flex-end;gap:var(--u-space-2);padding-right:var(--u-space-3);white-space:nowrap}._assessment_c4ne1_163:empty{padding-right:0}._target_c4ne1_309,._worst_c4ne1_310{font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._worst_c4ne1_310:before{content:"● "}._worst_c4ne1_310[data-verdict=unknown]:before{color:var(--u-color-text-muted)}._worst_c4ne1_310[data-verdict=warning]:before{color:var(--u-color-warning)}._worst_c4ne1_310[data-verdict=alarm]:before{color:var(--u-color-danger-text)}._line_c4ne1_116[data-inner]>._amount_c4ne1_161{color:var(--u-color-text-secondary)}._line_c4ne1_116[data-kind=interim] ._label_c4ne1_158,._line_c4ne1_116[data-kind=interim]>._amount_c4ne1_161{font-weight:var(--u-weight-medium)}._line_c4ne1_116[data-kind=interim]:before{content:"";grid-row:1;grid-column:3 / var(--figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-secondary);pointer-events:none}._line_c4ne1_116[data-closing] ._label_c4ne1_158{font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary)}._line_c4ne1_116[data-closing]:before{content:"";grid-row:1;grid-column:3 / var(--figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-muted);pointer-events:none}._line_c4ne1_116[data-kind=result]{border-top:1px solid var(--u-edge-color-strong)}._line_c4ne1_116[data-kind=result]:not([data-mark]){background:var(--u-color-surface-sunken)}._line_c4ne1_116[data-kind=result] ._label_c4ne1_158{font-weight:var(--u-weight-semibold)}._line_c4ne1_116[data-kind=result]>._amount_c4ne1_161{font-size:var(--u-text-md);font-weight:var(--u-weight-semibold)}._line_c4ne1_116[data-kind=result]>._amount_c4ne1_161:not([data-verdict=unknown]){text-decoration-line:underline;text-decoration-style:double;text-underline-offset:5px}._amount_c4ne1_161[data-later]{padding-left:var(--u-space-6)}._head_c4ne1_407{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:end}._headCell_c4ne1_414{grid-row:1;grid-column:var(--column);display:flex;flex-direction:column;align-items:flex-end;padding:var(--u-space-2) 0 var(--u-space-1);font-size:var(--u-text-xs);font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary);white-space:nowrap}._headUnit_c4ne1_427{font-family:var(--u-font-mono);font-weight:var(--u-weight-regular)}._notes_c4ne1_434{grid-row:2;grid-column:1 / 3;display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--u-space-3);margin-top:calc(-1 * var(--u-space-1));padding:0 var(--u-space-4) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._freshness_c4ne1_448[data-freshness=stale]{color:var(--u-color-warning)}._freshness_c4ne1_448[data-freshness=lost]{color:var(--u-color-danger-text);font-weight:var(--u-weight-medium)}@container (max-width: 34rem){._calculation_c4ne1_46{grid-template-columns:minmax(0,1fr) 0 auto var(--figure-tracks, auto auto) 0}._amount_c4ne1_161[data-later]{padding-left:var(--u-space-2)}._frame_c4ne1_24[data-metrics] ._unit_c4ne1_162:not([data-last]){padding-right:var(--u-space-2)}._headCell_c4ne1_414[data-unit] ._headLabel_c4ne1_478,._names_c4ne1_159{display:none}._labelCell_c4ne1_158{padding-right:var(--u-space-3)}._assessment_c4ne1_163:not(:empty){grid-area:2 / 1 / 3 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._notes_c4ne1_434{grid-row:3;grid-column:1 / -1}}._frame_c4ne1_24[data-two-lines] ._labelCell_c4ne1_158{grid-column:1 / -1;padding-bottom:0}._frame_c4ne1_24[data-two-lines] ._names_c4ne1_159{display:none}._frame_c4ne1_24[data-two-lines] ._line_c4ne1_116>._operator_c4ne1_160,._frame_c4ne1_24[data-two-lines] ._line_c4ne1_116>._amount_c4ne1_161,._frame_c4ne1_24[data-two-lines] ._line_c4ne1_116>._unit_c4ne1_162{grid-row:2;padding-top:var(--u-space-1)}._frame_c4ne1_24[data-two-lines] ._line_c4ne1_116[data-kind=interim]:before,._frame_c4ne1_24[data-two-lines] ._line_c4ne1_116[data-closing]:before{grid-row:2}._frame_c4ne1_24[data-two-lines] ._assessment_c4ne1_163:not(:empty){grid-area:3 / 1 / 4 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._frame_c4ne1_24[data-two-lines] ._notes_c4ne1_434{grid-row:4;grid-column:1 / -1}@media(prefers-reduced-motion:reduce){._disclosure_c4ne1_60 svg{transition:none}._derivation_c4ne1_66:not([hidden]){animation:none}}@media(forced-colors:active){._line_c4ne1_116[data-mark]{outline:1px solid Highlight;outline-offset:-1px}._line_c4ne1_116[data-mark=use]{outline-width:2px;outline-offset:-2px}._derivation_c4ne1_66:before{background:CanvasText}}}
|
|
1
|
+
@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.base{._text_12fqh_23{font-family:var(--u-font-sans);font-size:var(--u-text-md);line-height:var(--u-leading-normal);color:var(--u-color-text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}@media(pointer:fine){._dense_12fqh_39{--u-control-height-sm: var(--u-control-height-xs)}}._extent_12fqh_63{--_chars: 16;--_extra: 0;--_tracking: 0px;--_chrome: 0px;min-inline-size:0;max-inline-size:100%;contain:inline-size;contain-intrinsic-inline-size:calc((var(--_chars) + var(--_extra)) * (1ch + var(--_tracking)) + var(--_chrome))}._field_12fqh_78{caret-color:var(--u-color-accent)}._scroll_12fqh_84{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--u-color-text) 25%,transparent) transparent}._scroll_12fqh_84::-webkit-scrollbar{width:10px;height:10px}._scroll_12fqh_84::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--u-color-text) 22%,transparent);border-radius:var(--u-radius-full);border:3px solid transparent;background-clip:content-box}._scroll_12fqh_84::-webkit-scrollbar-track{background:transparent}}@layer umriss.components{._ring_12fqh_113:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}@media(pointer:coarse){._field_12fqh_78._field_12fqh_78,._fieldRoot_12fqh_133._fieldRoot_12fqh_133{font-size:16px}}._field_12fqh_78:-webkit-autofill,._field_12fqh_78:-webkit-autofill:hover,._field_12fqh_78:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 1000px var(--u-color-surface),0 0 0 1px var(--u-edge-color-strong);-webkit-text-fill-color:var(--u-color-text);caret-color:var(--u-color-accent)}}@layer umriss.tokens,umriss.base,umriss.components;@layer umriss.components{._frame_c4ne1_24,._frame_c4ne1_24:before,._frame_c4ne1_24:after{box-sizing:border-box}._calculation_c4ne1_46,._calculation_c4ne1_46:before,._calculation_c4ne1_46:after{box-sizing:border-box}._disclosure_c4ne1_60,._disclosure_c4ne1_60:before,._disclosure_c4ne1_60:after{box-sizing:border-box}._list_c4ne1_64,._list_c4ne1_64:before,._list_c4ne1_64:after{box-sizing:border-box}._item_c4ne1_65,._item_c4ne1_65:before,._item_c4ne1_65:after{box-sizing:border-box}._derivation_c4ne1_66,._derivation_c4ne1_66:before,._derivation_c4ne1_66:after{box-sizing:border-box}._line_c4ne1_116,._line_c4ne1_116:before,._line_c4ne1_116:after{box-sizing:border-box}._labelCell_c4ne1_158,._labelCell_c4ne1_158:before,._labelCell_c4ne1_158:after{box-sizing:border-box}._names_c4ne1_159,._names_c4ne1_159:before,._names_c4ne1_159:after{box-sizing:border-box}._operator_c4ne1_160,._operator_c4ne1_160:before,._operator_c4ne1_160:after{box-sizing:border-box}._amount_c4ne1_161,._amount_c4ne1_161:before,._amount_c4ne1_161:after{box-sizing:border-box}._unit_c4ne1_162,._unit_c4ne1_162:before,._unit_c4ne1_162:after{box-sizing:border-box}._assessment_c4ne1_163,._assessment_c4ne1_163:before,._assessment_c4ne1_163:after{box-sizing:border-box}._label_c4ne1_158,._label_c4ne1_158:before,._label_c4ne1_158:after{box-sizing:border-box}._approximate_c4ne1_281,._approximate_c4ne1_281:before,._approximate_c4ne1_281:after{box-sizing:border-box}._target_c4ne1_309,._target_c4ne1_309:before,._target_c4ne1_309:after{box-sizing:border-box}._worst_c4ne1_310,._worst_c4ne1_310:before,._worst_c4ne1_310:after{box-sizing:border-box}._head_c4ne1_407,._head_c4ne1_407:before,._head_c4ne1_407:after{box-sizing:border-box}._headCell_c4ne1_414,._headCell_c4ne1_414:before,._headCell_c4ne1_414:after{box-sizing:border-box}._headUnit_c4ne1_427,._headUnit_c4ne1_427:before,._headUnit_c4ne1_427:after{box-sizing:border-box}._notes_c4ne1_434,._notes_c4ne1_434:before,._notes_c4ne1_434:after{box-sizing:border-box}._freshness_c4ne1_448,._freshness_c4ne1_448:before,._freshness_c4ne1_448:after{box-sizing:border-box}._headLabel_c4ne1_478,._headLabel_c4ne1_478:before,._headLabel_c4ne1_478:after{box-sizing:border-box}._frame_c4ne1_24{font-size:var(--u-text-sm);border-radius:var(--u-radius-md);corner-shape:squircle;background:var(--u-color-surface);outline:1px solid transparent;box-shadow:var(--u-edge);overflow-x:auto;overflow-y:hidden;--disclosure-size: 20px;--disclosure-gap: var(--u-space-2);container-type:inline-size;width:100%}._calculation_c4ne1_46{display:grid;grid-template-columns:fit-content(22rem) minmax(0,1fr) auto var(--figure-tracks, auto auto) auto;margin:0;padding:0;list-style:none}._frame_c4ne1_24[data-still]{--disclosure-size: 0px;--disclosure-gap: 0px}._frame_c4ne1_24[data-still] ._disclosure_c4ne1_60{display:none}._list_c4ne1_64,._item_c4ne1_65,._derivation_c4ne1_66{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;margin:0;padding:0;list-style:none}._derivation_c4ne1_66[hidden]{display:none}._derivation_c4ne1_66:not([hidden]){animation:_derivationIn_c4ne1_1 var(--u-duration-fast) var(--u-ease-out)}@keyframes _derivationIn_c4ne1_1{0%{opacity:0}}._item_c4ne1_65{--fall: calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) / 2 - 1px)}._derivation_c4ne1_66{position:relative}._derivation_c4ne1_66:before{content:"";position:absolute;top:0;bottom:0;left:var(--fall);z-index:1;width:2px;background:var(--u-color-accent);pointer-events:none}:not(._derivation_c4ne1_66)>._item_c4ne1_65[data-open]>._line_c4ne1_116:not([data-mark]),:not(._derivation_c4ne1_66)>._item_c4ne1_65>._derivation_c4ne1_66{background-color:var(--u-color-surface-sunken)}._derivation_c4ne1_66 ._line_c4ne1_116{border-top-color:transparent}._line_c4ne1_116{position:relative;display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;border-top:1px solid var(--u-hairline)}._calculation_c4ne1_46>._item_c4ne1_65:first-child>._line_c4ne1_116:first-child,._calculation_c4ne1_46>._item_c4ne1_65:first-child>._list_c4ne1_64>._item_c4ne1_65:first-child>._line_c4ne1_116{border-top-color:transparent}._line_c4ne1_116[data-foldable]{cursor:pointer}._line_c4ne1_116[data-mark]{background:color-mix(in srgb,var(--u-color-accent-subtle) 50%,transparent)}._line_c4ne1_116[data-mark=use]{background:var(--u-color-accent-subtle)}._labelCell_c4ne1_158,._names_c4ne1_159,._operator_c4ne1_160,._amount_c4ne1_161,._unit_c4ne1_162,._assessment_c4ne1_163{grid-row:1;padding-top:var(--u-space-2);padding-bottom:var(--u-space-2)}._labelCell_c4ne1_158{grid-column:1;display:flex;align-items:baseline;gap:var(--disclosure-gap);min-width:0;padding-left:calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5));padding-right:var(--u-space-5)}._label_c4ne1_158{min-width:0;color:var(--u-color-text)}._line_c4ne1_116[data-reference] ._label_c4ne1_158{font-style:italic;color:var(--u-color-text-secondary)}._disclosure_c4ne1_60{flex:none;align-self:center;display:inline-flex;align-items:center;justify-content:center;width:var(--disclosure-size);height:var(--disclosure-size);padding:0;border:none;border-radius:var(--u-radius-xs);corner-shape:squircle;background:none;color:var(--u-color-text-muted)}button._disclosure_c4ne1_60{box-sizing:border-box}button._disclosure_c4ne1_60{cursor:pointer}button._disclosure_c4ne1_60:hover,._line_c4ne1_116[data-foldable]:hover button._disclosure_c4ne1_60{box-sizing:border-box}button._disclosure_c4ne1_60:hover,._line_c4ne1_116[data-foldable]:hover button._disclosure_c4ne1_60{background:var(--u-color-surface-sunken);color:var(--u-color-text)}button._disclosure_c4ne1_60:active,._line_c4ne1_116[data-foldable]:active button._disclosure_c4ne1_60{box-sizing:border-box}button._disclosure_c4ne1_60:active,._line_c4ne1_116[data-foldable]:active button._disclosure_c4ne1_60{background:var(--u-color-surface-pressed)}._item_c4ne1_65[data-open]>._line_c4ne1_116 button._disclosure_c4ne1_60{box-sizing:border-box}._item_c4ne1_65[data-open]>._line_c4ne1_116 button._disclosure_c4ne1_60{color:var(--u-color-accent)}button._disclosure_c4ne1_60:focus-visible{box-sizing:border-box}button._disclosure_c4ne1_60:focus-visible{outline:2px solid transparent;box-shadow:var(--u-focus-ring)}._disclosure_c4ne1_60 svg{box-sizing:border-box}._disclosure_c4ne1_60 svg{transition:transform var(--u-transition-path)}._disclosure_c4ne1_60 svg[data-open]{box-sizing:border-box}._disclosure_c4ne1_60 svg[data-open]{transform:rotate(90deg)}._names_c4ne1_159{grid-column:2;min-width:0;overflow:hidden;padding-right:var(--u-space-4);white-space:nowrap;text-overflow:ellipsis;color:var(--u-color-text-secondary)}._operator_c4ne1_160,._amount_c4ne1_161,._unit_c4ne1_162{font-family:var(--u-font-mono);font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;white-space:nowrap}._operator_c4ne1_160{grid-column:3;padding-right:var(--u-space-3);text-align:right;color:var(--u-color-text-secondary)}._amount_c4ne1_161{grid-column:var(--column, 4);text-align:right;color:var(--u-color-text)}._amount_c4ne1_161[data-verdict=unknown]{color:var(--u-color-text-secondary)}._approximate_c4ne1_281{display:inline-block;margin-right:var(--u-space-1);color:var(--u-color-text-secondary);cursor:help}._unit_c4ne1_162{grid-column:var(--column, 5);padding-left:var(--u-space-1);padding-right:var(--u-space-3);color:var(--u-color-text-secondary)}._assessment_c4ne1_163{grid-column:var(--assessment-column, 6);display:flex;align-items:baseline;justify-content:flex-end;gap:var(--u-space-2);padding-right:var(--u-space-3);white-space:nowrap}._assessment_c4ne1_163:empty{padding-right:0}._target_c4ne1_309,._worst_c4ne1_310{font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._worst_c4ne1_310:before{content:"● "}._worst_c4ne1_310[data-verdict=unknown]:before{color:var(--u-color-text-muted)}._worst_c4ne1_310[data-verdict=warning]:before{color:var(--u-color-warning)}._worst_c4ne1_310[data-verdict=alarm]:before{color:var(--u-color-danger-text)}._line_c4ne1_116[data-inner]>._amount_c4ne1_161{color:var(--u-color-text-secondary)}._line_c4ne1_116[data-kind=interim] ._label_c4ne1_158,._line_c4ne1_116[data-kind=interim]>._amount_c4ne1_161{font-weight:var(--u-weight-medium)}._line_c4ne1_116[data-kind=interim]:before{content:"";grid-row:1;grid-column:3 / var(--figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-secondary);pointer-events:none}._line_c4ne1_116[data-closing] ._label_c4ne1_158{font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary)}._line_c4ne1_116[data-closing]:before{content:"";grid-row:1;grid-column:3 / var(--figures-end, 6);align-self:start;border-top:1px solid var(--u-color-text-muted);pointer-events:none}._line_c4ne1_116[data-kind=result]{border-top:1px solid var(--u-edge-color-strong)}._line_c4ne1_116[data-kind=result]:not([data-mark]){background:var(--u-color-surface-sunken)}._line_c4ne1_116[data-kind=result] ._label_c4ne1_158{font-weight:var(--u-weight-semibold)}._line_c4ne1_116[data-kind=result]>._amount_c4ne1_161{font-size:var(--u-text-md);font-weight:var(--u-weight-semibold)}._line_c4ne1_116[data-kind=result]>._amount_c4ne1_161:not([data-verdict=unknown]){text-decoration-line:underline;text-decoration-style:double;text-underline-offset:5px}._amount_c4ne1_161[data-later]{padding-left:var(--u-space-6)}._head_c4ne1_407{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:end}._headCell_c4ne1_414{grid-row:1;grid-column:var(--column);display:flex;flex-direction:column;align-items:flex-end;padding:var(--u-space-2) 0 var(--u-space-1);font-size:var(--u-text-xs);font-weight:var(--u-weight-medium);color:var(--u-color-text-secondary);white-space:nowrap}._headUnit_c4ne1_427{font-family:var(--u-font-mono);font-weight:var(--u-weight-regular)}._notes_c4ne1_434{grid-row:2;grid-column:1 / 3;display:flex;flex-wrap:wrap;align-items:center;column-gap:var(--u-space-3);margin-top:calc(-1 * var(--u-space-1));padding:0 var(--u-space-4) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));font-size:var(--u-text-xs);color:var(--u-color-text-secondary)}._freshness_c4ne1_448[data-freshness=stale]{color:var(--u-color-warning)}._freshness_c4ne1_448[data-freshness=lost]{color:var(--u-color-danger-text);font-weight:var(--u-weight-medium)}@container (max-width: 34rem){._calculation_c4ne1_46{grid-template-columns:minmax(0,1fr) 0 auto var(--figure-tracks, auto auto) 0}._amount_c4ne1_161[data-later]{padding-left:var(--u-space-2)}._frame_c4ne1_24[data-metrics] ._unit_c4ne1_162:not([data-last]){padding-right:var(--u-space-2)}._headCell_c4ne1_414[data-unit] ._headLabel_c4ne1_478,._names_c4ne1_159{display:none}._labelCell_c4ne1_158{padding-right:var(--u-space-3)}._assessment_c4ne1_163:not(:empty){grid-area:2 / 1 / 3 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._notes_c4ne1_434{grid-row:3;grid-column:1 / -1}}._frame_c4ne1_24[data-two-lines] ._labelCell_c4ne1_158{grid-column:1 / -1;padding-bottom:0}._frame_c4ne1_24[data-two-lines] ._names_c4ne1_159{display:none}._frame_c4ne1_24[data-two-lines] ._line_c4ne1_116>._operator_c4ne1_160,._frame_c4ne1_24[data-two-lines] ._line_c4ne1_116>._amount_c4ne1_161,._frame_c4ne1_24[data-two-lines] ._line_c4ne1_116>._unit_c4ne1_162{grid-row:2;padding-top:var(--u-space-1)}._frame_c4ne1_24[data-two-lines] ._line_c4ne1_116[data-kind=interim]:before,._frame_c4ne1_24[data-two-lines] ._line_c4ne1_116[data-closing]:before{grid-row:2}._frame_c4ne1_24[data-two-lines] ._assessment_c4ne1_163:not(:empty){grid-area:3 / 1 / 4 / -1;justify-content:flex-start;flex-wrap:wrap;min-width:0;overflow:hidden;padding:0 var(--u-space-3) var(--u-space-2) calc(var(--u-space-3) + var(--depth, 0) * var(--u-space-5) + var(--disclosure-size) + var(--disclosure-gap));white-space:normal}._frame_c4ne1_24[data-two-lines] ._notes_c4ne1_434{grid-row:4;grid-column:1 / -1}@media(prefers-reduced-motion:reduce){._disclosure_c4ne1_60 svg{transition:none}._derivation_c4ne1_66:not([hidden]){animation:none}}@media(forced-colors:active){._line_c4ne1_116[data-mark]{outline:1px solid Highlight;outline-offset:-1px}._line_c4ne1_116[data-mark=use]{outline-width:2px;outline-offset:-2px}._derivation_c4ne1_66:before{background:CanvasText}}}
|
package/dist/calculation.js
CHANGED
|
@@ -13,43 +13,43 @@ function te(t, e) {
|
|
|
13
13
|
}
|
|
14
14
|
const Le = (t, e) => t.format === "percent" ? e / 100 : e;
|
|
15
15
|
function ve(t, e, h) {
|
|
16
|
-
const [o, ...
|
|
16
|
+
const [o, ...l] = e;
|
|
17
17
|
switch (t) {
|
|
18
18
|
case "sum":
|
|
19
|
-
return
|
|
19
|
+
return l.reduce((n, i, d) => h[d + 1] ? n - i : n + i, o);
|
|
20
20
|
case "difference":
|
|
21
|
-
return
|
|
21
|
+
return l.reduce((n, i) => n - i, o);
|
|
22
22
|
case "product":
|
|
23
|
-
return
|
|
23
|
+
return l.reduce((n, i) => n * i, o);
|
|
24
24
|
case "quotient":
|
|
25
|
-
return o /
|
|
25
|
+
return o / l[0];
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
const ge = (t, e) => e === void 0 || t !== void 0 && ae(t) >= ae(e) ? t : e;
|
|
29
29
|
function We(t) {
|
|
30
30
|
const e = /* @__PURE__ */ new Map(), h = (o) => {
|
|
31
31
|
var u, $, s;
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
32
|
+
const l = e.get(o);
|
|
33
|
+
if (l) return l;
|
|
34
34
|
const n = t.quantities.get(o);
|
|
35
35
|
let i = null, d, b = !1, M;
|
|
36
36
|
if (n.given) {
|
|
37
|
-
const
|
|
38
|
-
typeof
|
|
37
|
+
const c = n.given.value;
|
|
38
|
+
typeof c == "number" && Number.isFinite(c) ? i = c : d = { kind: "missing", label: n.label };
|
|
39
39
|
} else {
|
|
40
|
-
const
|
|
41
|
-
for (const { operand: S, verdict: T, worst: N } of
|
|
40
|
+
const c = n.operands.map((S) => ({ operand: S, ...h(S.key) }));
|
|
41
|
+
for (const { operand: S, verdict: T, worst: N } of c) {
|
|
42
42
|
const C = S.reference ? T : ge(T, N);
|
|
43
43
|
M = ge(M, C);
|
|
44
44
|
}
|
|
45
|
-
d = (u =
|
|
46
|
-
const O =
|
|
45
|
+
d = (u = c.find((S) => S.absence)) == null ? void 0 : u.absence;
|
|
46
|
+
const O = c[1];
|
|
47
47
|
if (!d && n.operator === "quotient" && O.value === 0 && (d = { kind: "zero", label: t.quantities.get(O.operand.key).label }), !d) {
|
|
48
48
|
const S = n.operands.map((N) => N.negated === !0);
|
|
49
|
-
i = ve(n.operator,
|
|
49
|
+
i = ve(n.operator, c.map((N) => N.value), S);
|
|
50
50
|
const T = ve(
|
|
51
51
|
n.operator,
|
|
52
|
-
|
|
52
|
+
c.map((N) => Le(t.quantities.get(N.operand.key), N.shown)),
|
|
53
53
|
S
|
|
54
54
|
);
|
|
55
55
|
b = te(n, T) !== te(n, i);
|
|
@@ -69,7 +69,7 @@ function We(t) {
|
|
|
69
69
|
for (const o of t.quantities.keys()) h(o);
|
|
70
70
|
return e;
|
|
71
71
|
}
|
|
72
|
-
const Fe = () => null, Ue = () => null, Qe = () => null, Ve = () => null, ze = () => null, be = () => null, Ge = () => null, He = () => null, Ke = () => null, Ye = () => null, Je = () => null,
|
|
72
|
+
const Fe = () => null, Ue = () => null, Qe = () => null, Ve = () => null, ze = () => null, be = () => null, Ge = () => null, He = () => null, Ke = () => null, Ye = () => null, Je = () => null, le = () => null, Ze = /* @__PURE__ */ new Map([
|
|
73
73
|
[Ue, "sum"],
|
|
74
74
|
[Qe, "difference"],
|
|
75
75
|
[Ve, "product"],
|
|
@@ -79,7 +79,7 @@ const Fe = () => null, Ue = () => null, Qe = () => null, Ve = () => null, ze = (
|
|
|
79
79
|
difference: "Difference",
|
|
80
80
|
product: "Product",
|
|
81
81
|
quotient: "Quotient"
|
|
82
|
-
},
|
|
82
|
+
}, ce = /* @__PURE__ */ new Map([
|
|
83
83
|
[He, { name: "Plus", operator: "sum" }],
|
|
84
84
|
[Ke, { name: "Minus", operator: "sum", negated: !0 }],
|
|
85
85
|
[Ye, { name: "Times", operator: "product" }],
|
|
@@ -107,7 +107,7 @@ function et(t, e) {
|
|
|
107
107
|
for (const { id: u } of e)
|
|
108
108
|
r.has(u) && w(`<Calculation>: the metric id "${u}" is used twice.`), r.add(u);
|
|
109
109
|
}
|
|
110
|
-
const o = e == null ? void 0 : e.map((r) => `"${r.id}"`).join(", "),
|
|
110
|
+
const o = e == null ? void 0 : e.map((r) => `"${r.id}"`).join(", "), l = (r, u) => {
|
|
111
111
|
const $ = typeof r == "object" && r !== null;
|
|
112
112
|
if (e === void 0) {
|
|
113
113
|
$ && w(`${u}: value is an object by metric, but the calculation has no metrics.`);
|
|
@@ -117,16 +117,16 @@ function et(t, e) {
|
|
|
117
117
|
for (const { id: s } of e)
|
|
118
118
|
s in r || w(`${u}: value has no number for the metric "${s}"; write null where it is absent. The metrics: ${o}.`);
|
|
119
119
|
for (const s of Object.keys(r))
|
|
120
|
-
e.some((
|
|
120
|
+
e.some((c) => c.id === s) || w(`${u}: value has a number for "${s}", which is no metric. The metrics: ${o}.`);
|
|
121
121
|
}, n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = [], b = (r, u, $) => {
|
|
122
|
-
const { id: s, ...
|
|
122
|
+
const { id: s, ...c } = u;
|
|
123
123
|
if (e !== void 0) {
|
|
124
124
|
for (const S of Xe)
|
|
125
125
|
u[S] !== void 0 && w(`${$}: ${S} belongs to the metric once the calculation has metrics, not to a quantity.`);
|
|
126
126
|
(u.target !== void 0 || u.limits !== void 0) && w(`${$}: target and limits are not assessed in a calculation with metrics.`);
|
|
127
127
|
}
|
|
128
128
|
s !== void 0 && (i.has(s) && w(`${$}: the id "${s}" is used twice.`), i.set(s, r));
|
|
129
|
-
const O = { ...
|
|
129
|
+
const O = { ...c, key: r, id: s, operands: [] };
|
|
130
130
|
return n.set(r, O), O;
|
|
131
131
|
}, M = (r, u, $) => {
|
|
132
132
|
if (V(r) && r.type === be) {
|
|
@@ -135,35 +135,35 @@ function et(t, e) {
|
|
|
135
135
|
}
|
|
136
136
|
return { key: A(r, u, $), reference: !1 };
|
|
137
137
|
}, A = (r, u, $) => {
|
|
138
|
-
if ((!V(r) || r.type === be ||
|
|
138
|
+
if ((!V(r) || r.type === be || ce.has(r.type) || r.type === le) && w(`${$}: ${ee(r)} cannot stand here; a quantity must be ${ue}.`), r.type === Ge) return U(r.props.children, u, $);
|
|
139
139
|
const s = Ze.get(r.type);
|
|
140
140
|
r.type !== Fe && s === void 0 && w(
|
|
141
141
|
`${$}: ${ee(r)} is not an element of the calculation. A calculation reads its children's props and cannot look inside a component of your own; write ${ue} or <Ref> directly, or return them from .map.`
|
|
142
142
|
);
|
|
143
|
-
const { children:
|
|
143
|
+
const { children: c, value: O, source: S, asOf: T, ages: N, ...C } = r.props, _ = `${$} › ${C.label}`;
|
|
144
144
|
e !== void 0 && (s === "product" || s === "quotient") && w(`${_}: <${$e[s]}> - ${_e}`);
|
|
145
145
|
const y = b(u, C, _);
|
|
146
146
|
if (s === void 0)
|
|
147
|
-
return
|
|
147
|
+
return l(O, _), y.given = { value: O, source: S, asOf: T, ages: N }, u;
|
|
148
148
|
y.operator = s;
|
|
149
|
-
const q = Z(
|
|
149
|
+
const q = Z(c), a = q.length;
|
|
150
150
|
return (s === "quotient" ? a !== 2 : a < 2) && w(
|
|
151
151
|
`${_}: <${$e[s]}> takes ${s === "quotient" ? "exactly two operands" : "two or more operands"}; it was given ${a}.`
|
|
152
152
|
), y.operands = q.map((f, m) => M(f, de(u, f, m), _)), u;
|
|
153
153
|
}, U = (r, u, $) => {
|
|
154
|
-
const s = `${$} › <Chain>`, [
|
|
155
|
-
(
|
|
156
|
-
let S = M(
|
|
154
|
+
const s = `${$} › <Chain>`, [c, ...O] = Z(r);
|
|
155
|
+
(c === void 0 || V(c) && (ce.has(c.type) || c.type === le)) && w(`${s}: a chain starts with a quantity that has no operator - ${ue} or <Ref>.`);
|
|
156
|
+
let S = M(c, de(u, c, 0), s), T = ee(c), N = [], C;
|
|
157
157
|
return O.forEach((_, y) => {
|
|
158
158
|
const q = de(u, _, y + 1);
|
|
159
|
-
if (V(_) && _.type ===
|
|
159
|
+
if (V(_) && _.type === le) {
|
|
160
160
|
const L = _.props, Q = `${s} › ${L.label}`;
|
|
161
161
|
N.length === 0 && w(`${Q}: an <Interim> needs an operand since the named value before it, ${T}.`);
|
|
162
162
|
const K = b(q, L, Q);
|
|
163
163
|
K.interim = !0, K.operator = N[0].line.operator, K.operands = [S, ...N.map((se) => se.operand)], S = { key: q, reference: !1, previous: !0 }, T = `<Interim label="${L.label}">`, N = [], C = q;
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
const a = V(_) ?
|
|
166
|
+
const a = V(_) ? ce.get(_.type) : void 0;
|
|
167
167
|
a === void 0 && w(`${s}: ${ee(_)} needs an operator in a chain - <Plus>, <Minus>, <Times> or <DividedBy> - or is an <Interim>.`), e !== void 0 && a.operator !== "sum" && w(`${s}: <${a.name}> - ${_e}`);
|
|
168
168
|
const f = a.operator !== "sum", m = N.find((L) => L.line.operator !== "sum");
|
|
169
169
|
(f && N.length > 0 || m) && w(
|
|
@@ -178,14 +178,14 @@ function et(t, e) {
|
|
|
178
178
|
}
|
|
179
179
|
v.label === void 0 && j();
|
|
180
180
|
const { value: k, source: W, asOf: z, ages: G, ...D } = v, B = `${s} › ${v.label}`, X = b(q, { ...D, label: v.label }, B);
|
|
181
|
-
|
|
181
|
+
l(k, B), X.given = { value: k, source: W, asOf: z, ages: G }, N.push({ operand: { key: q, reference: !1, negated: a.negated }, line: a });
|
|
182
182
|
}), (N.length > 0 || C === void 0) && w(`${s}: a chain ends with an <Interim>, which names its value.`), C;
|
|
183
183
|
}, I = A(h[0], "0", "<Calculation>");
|
|
184
184
|
for (const { operand: r, to: u, where: $ } of d) {
|
|
185
185
|
const s = i.get(u);
|
|
186
186
|
if (s === void 0) {
|
|
187
|
-
const
|
|
188
|
-
w(`${$}: <Ref to="${u}"> names no quantity. ${
|
|
187
|
+
const c = [...i.keys()].map((O) => `"${O}"`).join(", ");
|
|
188
|
+
w(`${$}: <Ref to="${u}"> names no quantity. ${c ? `The ids that exist: ${c}.` : "No quantity has an id."}`);
|
|
189
189
|
}
|
|
190
190
|
r.key = s;
|
|
191
191
|
}
|
|
@@ -194,26 +194,26 @@ function et(t, e) {
|
|
|
194
194
|
function tt(t) {
|
|
195
195
|
return t.metrics ? t.metrics.map((e) => {
|
|
196
196
|
const h = /* @__PURE__ */ new Map();
|
|
197
|
-
for (const [o,
|
|
198
|
-
const n =
|
|
199
|
-
h.set(o, { ...
|
|
197
|
+
for (const [o, l] of t.quantities) {
|
|
198
|
+
const n = l.given && { ...l.given, value: l.given.value[e.id] };
|
|
199
|
+
h.set(o, { ...l, unit: e.unit, decimals: e.decimals, given: n });
|
|
200
200
|
}
|
|
201
201
|
return { result: t.result, quantities: h };
|
|
202
202
|
}) : [t];
|
|
203
203
|
}
|
|
204
204
|
function nt(t) {
|
|
205
|
-
const e = /* @__PURE__ */ new Set(), h = [], o = (
|
|
206
|
-
if (e.has(
|
|
207
|
-
const n = h.indexOf(
|
|
205
|
+
const e = /* @__PURE__ */ new Set(), h = [], o = (l) => {
|
|
206
|
+
if (e.has(l)) return;
|
|
207
|
+
const n = h.indexOf(l);
|
|
208
208
|
if (n !== -1) {
|
|
209
|
-
const i = [...h.slice(n),
|
|
209
|
+
const i = [...h.slice(n), l].map((d) => t.get(d).label);
|
|
210
210
|
w(`the calculation goes round in a circle through references: ${i.join(" → ")}.`);
|
|
211
211
|
}
|
|
212
|
-
h.push(
|
|
213
|
-
for (const i of t.get(
|
|
214
|
-
h.pop(), e.add(
|
|
212
|
+
h.push(l);
|
|
213
|
+
for (const i of t.get(l).operands) o(i.key);
|
|
214
|
+
h.pop(), e.add(l);
|
|
215
215
|
};
|
|
216
|
-
for (const
|
|
216
|
+
for (const l of t.keys()) o(l);
|
|
217
217
|
}
|
|
218
218
|
const ye = 4, at = {
|
|
219
219
|
sum: "calculationSumSymbol",
|
|
@@ -246,11 +246,11 @@ function st(t, e) {
|
|
|
246
246
|
return t.kind === "missing" ? e.calculationMissing(t.label) : e.calculationDivisionByZero(t.label);
|
|
247
247
|
}
|
|
248
248
|
function Ne(t, e, h, o) {
|
|
249
|
-
const
|
|
250
|
-
return
|
|
249
|
+
const l = t.format === "percent" ? o : t.unit, n = h.number(e, t.decimals);
|
|
250
|
+
return l ? `${n} ${l}` : n;
|
|
251
251
|
}
|
|
252
|
-
function it(t, e, h, o,
|
|
253
|
-
const d = t.quantities.get(h), b = e.get(h), M = (C, _, y) => _.shown === null ? y ? n.verdictUnknown : n.statAbsentValue : Ne(C, _.shown,
|
|
252
|
+
function it(t, e, h, o, l, n, i) {
|
|
253
|
+
const d = t.quantities.get(h), b = e.get(h), M = (C, _, y) => _.shown === null ? y ? n.verdictUnknown : n.statAbsentValue : Ne(C, _.shown, l, y ? n.calculationPercent : "%"), A = (C) => {
|
|
254
254
|
if (o || !d.operator) return {};
|
|
255
255
|
if (!C && d.operands.length > ye)
|
|
256
256
|
return { names: n.calculationOperandCount(d.operands.length) };
|
|
@@ -266,25 +266,25 @@ function it(t, e, h, o, c, n, i) {
|
|
|
266
266
|
var q;
|
|
267
267
|
const _ = (q = b.assessment) == null ? void 0 : q.deviation;
|
|
268
268
|
if (_ === void 0 || d.target === void 0) return;
|
|
269
|
-
const y = Ne(d, te(d, d.target),
|
|
269
|
+
const y = Ne(d, te(d, d.target), l, C ? n.calculationPercent : "%");
|
|
270
270
|
return _ > 0 ? n.calculationAboveTarget(y) : _ < 0 ? n.calculationBelowTarget(y) : n.calculationOnTarget(y);
|
|
271
|
-
}, I = A(!1).names, r = I === void 0 || d.operands.length > ye ? I : `= ${I}`, u = A(!0), $ = b.absence ? st(b.absence, n) : void 0, s = ` ${n.calculationEquals} `,
|
|
272
|
-
(i ? `${oe(i, !0, n)} ` : "") + d.label + s + [u.names, u.numbers,
|
|
271
|
+
}, I = A(!1).names, r = I === void 0 || d.operands.length > ye ? I : `= ${I}`, u = A(!0), $ = b.absence ? st(b.absence, n) : void 0, s = ` ${n.calculationEquals} `, c = b.approximate ? `${n.calculationApproximately} ${M(d, b, !0)}` : M(d, b, !0), S = [
|
|
272
|
+
(i ? `${oe(i, !0, n)} ` : "") + d.label + s + [u.names, u.numbers, c].filter(Boolean).join(`,${s}`),
|
|
273
273
|
b.verdict !== void 0 && b.verdict !== "unknown" ? ne(b.verdict, n) : void 0,
|
|
274
274
|
U(!0),
|
|
275
275
|
$
|
|
276
276
|
].filter(Boolean).join(", "), T = b.shown === null ? void 0 : d.format === "percent" ? "%" : d.unit;
|
|
277
|
-
return { amount: b.shown === null ? n.statAbsentValue :
|
|
277
|
+
return { amount: b.shown === null ? n.statAbsentValue : l.number(b.shown, d.decimals), unit: T, names: r, target: U(!1), reason: $, sentence: S, spokenNames: u.names, spokenNumber: c };
|
|
278
278
|
}
|
|
279
|
-
function rt(t, e, h, o,
|
|
280
|
-
const n =
|
|
279
|
+
function rt(t, e, h, o, l) {
|
|
280
|
+
const n = l ? `${oe(l, !0, o)} ` : "", i = e[0].spokenNames, d = n + t + (i === void 0 ? "" : ` ${o.calculationEquals} ${i}`), b = h.map(
|
|
281
281
|
(M, A) => [`${M.label} ${e[A].spokenNumber}`, e[A].reason].filter(Boolean).join(", ")
|
|
282
282
|
);
|
|
283
283
|
return `${d}: ${b.join("; ")}`;
|
|
284
284
|
}
|
|
285
|
-
const
|
|
286
|
-
frame:
|
|
287
|
-
calculation:
|
|
285
|
+
const lt = "_frame_c4ne1_24 _text_12fqh_23", ct = "_calculation_c4ne1_46", ut = "_disclosure_c4ne1_60", dt = "_list_c4ne1_64", ft = "_item_c4ne1_65", pt = "_derivation_c4ne1_66", mt = "_line_c4ne1_116", ht = "_labelCell_c4ne1_158", vt = "_names_c4ne1_159", gt = "_operator_c4ne1_160", bt = "_amount_c4ne1_161", $t = "_unit_c4ne1_162", _t = "_assessment_c4ne1_163", yt = "_label_c4ne1_158", Nt = "_approximate_c4ne1_281", wt = "_target_c4ne1_309", St = "_worst_c4ne1_310", xt = "_head_c4ne1_407", Ct = "_headCell_c4ne1_414", Ot = "_headUnit_c4ne1_427", qt = "_notes_c4ne1_434", kt = "_freshness_c4ne1_448", Mt = "_headLabel_c4ne1_478", p = {
|
|
286
|
+
frame: lt,
|
|
287
|
+
calculation: ct,
|
|
288
288
|
disclosure: ut,
|
|
289
289
|
list: dt,
|
|
290
290
|
item: ft,
|
|
@@ -308,15 +308,15 @@ const ct = "_frame_c4ne1_24 _text_ocaqi_23", lt = "_calculation_c4ne1_46", ut =
|
|
|
308
308
|
headLabel: Mt
|
|
309
309
|
}, Tt = 10, J = (t) => 4 + 2 * t, Et = (t) => 5 + 2 * t, Rt = { ok: "success", unknown: "neutral", warning: "warning", alarm: "danger" }, At = (...t) => t.filter(Boolean).join(" ");
|
|
310
310
|
function It({ asOf: t, ages: e }) {
|
|
311
|
-
const h = we(), o = Se(),
|
|
312
|
-
return /* @__PURE__ */ R("span", { className: p.freshness, "data-freshness":
|
|
311
|
+
const h = we(), o = Se(), l = Pe(t, e), n = l.freshness === "lost" ? o.freshnessDisconnected : l.freshness === "stale" ? o.freshnessStale : o.freshnessFresh;
|
|
312
|
+
return /* @__PURE__ */ R("span", { className: p.freshness, "data-freshness": l.freshness, children: [
|
|
313
313
|
n,
|
|
314
|
-
|
|
314
|
+
l.age !== null && ` · ${h.relative(l.age)}`
|
|
315
315
|
] });
|
|
316
316
|
}
|
|
317
|
-
function Bt({ children: t, className: e, style: h, metrics: o, ...
|
|
318
|
-
const n = we(), i = Se(), d = qe(), b = et(t, o), M = tt(b).map((a) => ({ view: a, results: We(a) })), [A, U] = ie(() => /* @__PURE__ */ new Set()), [I, r] = ie(null), u = ke(null), [$, s] = ie(!1),
|
|
319
|
-
const a = u.current, f = a &&
|
|
317
|
+
function Bt({ children: t, className: e, style: h, metrics: o, ...l }) {
|
|
318
|
+
const n = we(), i = Se(), d = qe(), b = et(t, o), M = tt(b).map((a) => ({ view: a, results: We(a) })), [A, U] = ie(() => /* @__PURE__ */ new Set()), [I, r] = ie(null), u = ke(null), [$, s] = ie(!1), c = (o == null ? void 0 : o.length) ?? 0, O = Me(() => {
|
|
319
|
+
const a = u.current, f = a && c > 0 ? getComputedStyle(a.firstElementChild).gridTemplateColumns.split(" ").map(parseFloat) : [], m = J(c) - 1;
|
|
320
320
|
if (!a || f.length <= m || f.some((k) => !Number.isFinite(k))) {
|
|
321
321
|
s(!1);
|
|
322
322
|
return;
|
|
@@ -333,13 +333,13 @@ function Bt({ children: t, className: e, style: h, metrics: o, ...c }) {
|
|
|
333
333
|
}
|
|
334
334
|
const j = parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
335
335
|
s(a.clientWidth - P < Math.min(v, Tt * j));
|
|
336
|
-
}, [
|
|
336
|
+
}, [c]);
|
|
337
337
|
Te(() => O()), Ee(() => {
|
|
338
338
|
const a = u.current;
|
|
339
|
-
if (!a ||
|
|
339
|
+
if (!a || c === 0) return;
|
|
340
340
|
const f = new ResizeObserver(() => O());
|
|
341
341
|
return f.observe(a), () => f.disconnect();
|
|
342
|
-
}, [O,
|
|
342
|
+
}, [O, c]);
|
|
343
343
|
const S = (a) => U((f) => {
|
|
344
344
|
const m = new Set(f);
|
|
345
345
|
return m.delete(a) || m.add(a), m;
|
|
@@ -490,15 +490,15 @@ function Bt({ children: t, className: e, style: h, metrics: o, ...c }) {
|
|
|
490
490
|
ref: u,
|
|
491
491
|
className: At(p.frame, e),
|
|
492
492
|
style: o ? {
|
|
493
|
-
"--figure-tracks": Array(
|
|
494
|
-
"--figures-end": J(
|
|
495
|
-
"--assessment-column": J(
|
|
493
|
+
"--figure-tracks": Array(c * 2).fill("auto").join(" "),
|
|
494
|
+
"--figures-end": J(c),
|
|
495
|
+
"--assessment-column": J(c),
|
|
496
496
|
...h
|
|
497
497
|
} : h,
|
|
498
498
|
"data-still": N ? void 0 : "",
|
|
499
|
-
"data-metrics": o ?
|
|
499
|
+
"data-metrics": o ? c : void 0,
|
|
500
500
|
"data-two-lines": $ ? "" : void 0,
|
|
501
|
-
children: /* @__PURE__ */ R("ul", { className: p.calculation, ...
|
|
501
|
+
children: /* @__PURE__ */ R("ul", { className: p.calculation, ...l, children: [
|
|
502
502
|
o && /* The head names each metric and its unit above its column. Every
|
|
503
503
|
row's sentence names them too, so the head is for the eye. */
|
|
504
504
|
/* @__PURE__ */ g("li", { className: p.item, "aria-hidden": "true", children: /* @__PURE__ */ g("div", { className: p.head, children: o.map((a, f) => /* @__PURE__ */ R(
|
|
@@ -526,7 +526,7 @@ export {
|
|
|
526
526
|
Qe as Difference,
|
|
527
527
|
Je as DividedBy,
|
|
528
528
|
Fe as Given,
|
|
529
|
-
|
|
529
|
+
le as Interim,
|
|
530
530
|
Ke as Minus,
|
|
531
531
|
He as Plus,
|
|
532
532
|
Ve as Product,
|