@eshal-bot/chat-widget 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chat-widget-MarkdownRenderer-BIGXHUYK.esm.js → chat-widget-MarkdownRenderer-D6iu9Rxh.esm.js} +6 -6
- package/dist/chat-widget-index-tyE4Gtzl.esm.js +20 -0
- package/dist/chat-widget-markdown-chunk.js +926 -690
- package/dist/chat-widget-markdown-chunk.min.js +9 -9
- package/dist/chat-widget.esm.js +1 -1
- package/dist/chat-widget.js +7254 -6765
- package/dist/chat-widget.min.js +6 -6
- package/dist/chat-widget.umd.js +8 -8
- package/package.json +1 -1
- package/dist/chat-widget-index-CBTM7rwy.esm.js +0 -20
|
@@ -20,70 +20,6 @@
|
|
|
20
20
|
|
|
21
21
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
22
22
|
|
|
23
|
-
function _defineProperty$L(e, r, t) {
|
|
24
|
-
return (r = _toPropertyKey$K(r)) in e ? Object.defineProperty(e, r, {
|
|
25
|
-
value: t,
|
|
26
|
-
enumerable: true,
|
|
27
|
-
configurable: true,
|
|
28
|
-
writable: true
|
|
29
|
-
}) : e[r] = t, e;
|
|
30
|
-
}
|
|
31
|
-
function ownKeys$G(e, r) {
|
|
32
|
-
var t = Object.keys(e);
|
|
33
|
-
if (Object.getOwnPropertySymbols) {
|
|
34
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
35
|
-
r && (o = o.filter(function (r) {
|
|
36
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
37
|
-
})), t.push.apply(t, o);
|
|
38
|
-
}
|
|
39
|
-
return t;
|
|
40
|
-
}
|
|
41
|
-
function _objectSpread2(e) {
|
|
42
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
43
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
44
|
-
r % 2 ? ownKeys$G(Object(t), true).forEach(function (r) {
|
|
45
|
-
_defineProperty$L(e, r, t[r]);
|
|
46
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$G(Object(t)).forEach(function (r) {
|
|
47
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
return e;
|
|
51
|
-
}
|
|
52
|
-
function _objectWithoutProperties$m(e, t) {
|
|
53
|
-
if (null == e) return {};
|
|
54
|
-
var o,
|
|
55
|
-
r,
|
|
56
|
-
i = _objectWithoutPropertiesLoose$m(e, t);
|
|
57
|
-
if (Object.getOwnPropertySymbols) {
|
|
58
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
59
|
-
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
60
|
-
}
|
|
61
|
-
return i;
|
|
62
|
-
}
|
|
63
|
-
function _objectWithoutPropertiesLoose$m(r, e) {
|
|
64
|
-
if (null == r) return {};
|
|
65
|
-
var t = {};
|
|
66
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
67
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
68
|
-
t[n] = r[n];
|
|
69
|
-
}
|
|
70
|
-
return t;
|
|
71
|
-
}
|
|
72
|
-
function _toPrimitive$K(t, r) {
|
|
73
|
-
if ("object" != typeof t || !t) return t;
|
|
74
|
-
var e = t[Symbol.toPrimitive];
|
|
75
|
-
if (void 0 !== e) {
|
|
76
|
-
var i = e.call(t, r);
|
|
77
|
-
if ("object" != typeof i) return i;
|
|
78
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
79
|
-
}
|
|
80
|
-
return ("string" === r ? String : Number)(t);
|
|
81
|
-
}
|
|
82
|
-
function _toPropertyKey$K(t) {
|
|
83
|
-
var i = _toPrimitive$K(t, "string");
|
|
84
|
-
return "symbol" == typeof i ? i : i + "";
|
|
85
|
-
}
|
|
86
|
-
|
|
87
23
|
function ok$2() {}
|
|
88
24
|
function unreachable() {}
|
|
89
25
|
|
|
@@ -24141,7 +24077,7 @@
|
|
|
24141
24077
|
return langs.indexOf(language) !== -1;
|
|
24142
24078
|
});
|
|
24143
24079
|
|
|
24144
|
-
var _excluded$
|
|
24080
|
+
var _excluded$l = ["language", "children", "style", "customStyle", "codeTagProps", "useInlineStyles", "showLineNumbers", "showInlineLineNumbers", "startingLineNumber", "lineNumberContainerStyle", "lineNumberStyle", "wrapLines", "wrapLongLines", "lineProps", "renderer", "PreTag", "CodeTag", "code", "astGenerator"];
|
|
24145
24081
|
function ownKeys$E(e, r) {
|
|
24146
24082
|
var t = Object.keys(e);
|
|
24147
24083
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -24472,7 +24408,7 @@
|
|
|
24472
24408
|
_ref7$code = _ref7.code,
|
|
24473
24409
|
code = _ref7$code === void 0 ? (Array.isArray(children) ? children[0] : children) || '' : _ref7$code,
|
|
24474
24410
|
astGenerator = _ref7.astGenerator,
|
|
24475
|
-
rest = _objectWithoutProperties$l(_ref7, _excluded$
|
|
24411
|
+
rest = _objectWithoutProperties$l(_ref7, _excluded$l);
|
|
24476
24412
|
astGenerator = astGenerator || defaultAstGenerator;
|
|
24477
24413
|
var allLineNumbers = showLineNumbers ? /*#__PURE__*/React.createElement(AllLineNumbers, {
|
|
24478
24414
|
containerStyle: lineNumberContainerStyle,
|
|
@@ -50483,8 +50419,8 @@
|
|
|
50483
50419
|
return out;
|
|
50484
50420
|
};
|
|
50485
50421
|
|
|
50486
|
-
var _excluded$
|
|
50487
|
-
_excluded2$
|
|
50422
|
+
var _excluded$k = ["children"],
|
|
50423
|
+
_excluded2$8 = ["children"];
|
|
50488
50424
|
function _objectWithoutProperties$k(source, excluded) {
|
|
50489
50425
|
if (source == null) return {};
|
|
50490
50426
|
var target = _objectWithoutPropertiesLoose$k(source, excluded);
|
|
@@ -50721,10 +50657,10 @@
|
|
|
50721
50657
|
if (!isNil_1(nextChild) && !isNil_1(prevChild)) {
|
|
50722
50658
|
var _ref = nextChild.props || {},
|
|
50723
50659
|
nextChildren = _ref.children,
|
|
50724
|
-
nextProps = _objectWithoutProperties$k(_ref, _excluded$
|
|
50660
|
+
nextProps = _objectWithoutProperties$k(_ref, _excluded$k);
|
|
50725
50661
|
var _ref2 = prevChild.props || {},
|
|
50726
50662
|
prevChildren = _ref2.children,
|
|
50727
|
-
prevProps = _objectWithoutProperties$k(_ref2, _excluded2$
|
|
50663
|
+
prevProps = _objectWithoutProperties$k(_ref2, _excluded2$8);
|
|
50728
50664
|
if (nextChildren && prevChildren) {
|
|
50729
50665
|
return shallowEqual(nextProps, prevProps) && isChildrenEqual(nextChildren, prevChildren);
|
|
50730
50666
|
}
|
|
@@ -50766,7 +50702,7 @@
|
|
|
50766
50702
|
return toArray(children).indexOf(child);
|
|
50767
50703
|
};
|
|
50768
50704
|
|
|
50769
|
-
var _excluded$
|
|
50705
|
+
var _excluded$j = ["children", "width", "height", "viewBox", "className", "style", "title", "desc"];
|
|
50770
50706
|
function _extends$v() {
|
|
50771
50707
|
_extends$v = Object.assign ? Object.assign.bind() : function (target) {
|
|
50772
50708
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -50816,7 +50752,7 @@
|
|
|
50816
50752
|
style = props.style,
|
|
50817
50753
|
title = props.title,
|
|
50818
50754
|
desc = props.desc,
|
|
50819
|
-
others = _objectWithoutProperties$j(props, _excluded$
|
|
50755
|
+
others = _objectWithoutProperties$j(props, _excluded$j);
|
|
50820
50756
|
var svgView = viewBox || {
|
|
50821
50757
|
width: width,
|
|
50822
50758
|
height: height,
|
|
@@ -50833,7 +50769,7 @@
|
|
|
50833
50769
|
}), /*#__PURE__*/React.createElement("title", null, title), /*#__PURE__*/React.createElement("desc", null, desc), children);
|
|
50834
50770
|
}
|
|
50835
50771
|
|
|
50836
|
-
var _excluded$
|
|
50772
|
+
var _excluded$i = ["children", "className"];
|
|
50837
50773
|
function _extends$u() {
|
|
50838
50774
|
_extends$u = Object.assign ? Object.assign.bind() : function (target) {
|
|
50839
50775
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -50877,7 +50813,7 @@
|
|
|
50877
50813
|
var Layer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
50878
50814
|
var children = props.children,
|
|
50879
50815
|
className = props.className,
|
|
50880
|
-
others = _objectWithoutProperties$i(props, _excluded$
|
|
50816
|
+
others = _objectWithoutProperties$i(props, _excluded$i);
|
|
50881
50817
|
var layerClass = clsx('recharts-layer', className);
|
|
50882
50818
|
return /*#__PURE__*/React.createElement("g", _extends$u({
|
|
50883
50819
|
className: layerClass
|
|
@@ -52134,7 +52070,7 @@
|
|
|
52134
52070
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
52135
52071
|
}, _typeof$K(o);
|
|
52136
52072
|
}
|
|
52137
|
-
var _excluded$
|
|
52073
|
+
var _excluded$h = ["type", "size", "sizeType"];
|
|
52138
52074
|
function _extends$t() {
|
|
52139
52075
|
_extends$t = Object.assign ? Object.assign.bind() : function (target) {
|
|
52140
52076
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -52272,7 +52208,7 @@
|
|
|
52272
52208
|
size = _ref$size === void 0 ? 64 : _ref$size,
|
|
52273
52209
|
_ref$sizeType = _ref.sizeType,
|
|
52274
52210
|
sizeType = _ref$sizeType === void 0 ? 'area' : _ref$sizeType,
|
|
52275
|
-
rest = _objectWithoutProperties$h(_ref, _excluded$
|
|
52211
|
+
rest = _objectWithoutProperties$h(_ref, _excluded$h);
|
|
52276
52212
|
var props = _objectSpread$D(_objectSpread$D({}, rest), {}, {
|
|
52277
52213
|
type: type,
|
|
52278
52214
|
size: size,
|
|
@@ -54570,7 +54506,7 @@
|
|
|
54570
54506
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
54571
54507
|
}, _typeof$I(o);
|
|
54572
54508
|
}
|
|
54573
|
-
var _excluded$
|
|
54509
|
+
var _excluded$g = ["ref"];
|
|
54574
54510
|
function ownKeys$B(e, r) {
|
|
54575
54511
|
var t = Object.keys(e);
|
|
54576
54512
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -54733,7 +54669,7 @@
|
|
|
54733
54669
|
return /*#__PURE__*/React.createElement(content, props);
|
|
54734
54670
|
}
|
|
54735
54671
|
props.ref;
|
|
54736
|
-
var otherProps = _objectWithoutProperties$g(props, _excluded$
|
|
54672
|
+
var otherProps = _objectWithoutProperties$g(props, _excluded$g);
|
|
54737
54673
|
return /*#__PURE__*/React.createElement(DefaultLegendContent, otherProps);
|
|
54738
54674
|
}
|
|
54739
54675
|
var EPS$1 = 1;
|
|
@@ -57361,8 +57297,8 @@
|
|
|
57361
57297
|
return result;
|
|
57362
57298
|
}
|
|
57363
57299
|
|
|
57364
|
-
var _excluded$
|
|
57365
|
-
_excluded2$
|
|
57300
|
+
var _excluded$f = ["x", "y", "lineHeight", "capHeight", "scaleToFit", "textAnchor", "verticalAnchor", "fill"],
|
|
57301
|
+
_excluded2$7 = ["dx", "dy", "angle", "className", "breakAll"];
|
|
57366
57302
|
function _extends$q() {
|
|
57367
57303
|
_extends$q = Object.assign ? Object.assign.bind() : function (target) {
|
|
57368
57304
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -57617,7 +57553,7 @@
|
|
|
57617
57553
|
verticalAnchor = _ref5$verticalAnchor === void 0 ? 'end' : _ref5$verticalAnchor,
|
|
57618
57554
|
_ref5$fill = _ref5.fill,
|
|
57619
57555
|
fill = _ref5$fill === void 0 ? DEFAULT_FILL : _ref5$fill,
|
|
57620
|
-
props = _objectWithoutProperties$f(_ref5, _excluded$
|
|
57556
|
+
props = _objectWithoutProperties$f(_ref5, _excluded$f);
|
|
57621
57557
|
var wordsByLines = React.useMemo(function () {
|
|
57622
57558
|
return getWordsByLines({
|
|
57623
57559
|
breakAll: props.breakAll,
|
|
@@ -57633,7 +57569,7 @@
|
|
|
57633
57569
|
angle = props.angle,
|
|
57634
57570
|
className = props.className,
|
|
57635
57571
|
breakAll = props.breakAll,
|
|
57636
|
-
textProps = _objectWithoutProperties$f(props, _excluded2$
|
|
57572
|
+
textProps = _objectWithoutProperties$f(props, _excluded2$7);
|
|
57637
57573
|
if (!isNumOrStr(propsX) || !isNumOrStr(propsY)) {
|
|
57638
57574
|
return null;
|
|
57639
57575
|
}
|
|
@@ -63296,7 +63232,7 @@
|
|
|
63296
63232
|
}
|
|
63297
63233
|
}
|
|
63298
63234
|
|
|
63299
|
-
var _excluded$
|
|
63235
|
+
var _excluded$e = ["offset", "layout", "width", "dataKey", "data", "dataPointFormatter", "xAxis", "yAxis"];
|
|
63300
63236
|
function _typeof$A(o) {
|
|
63301
63237
|
"@babel/helpers - typeof";
|
|
63302
63238
|
|
|
@@ -63514,7 +63450,7 @@
|
|
|
63514
63450
|
dataPointFormatter = _this$props.dataPointFormatter,
|
|
63515
63451
|
xAxis = _this$props.xAxis,
|
|
63516
63452
|
yAxis = _this$props.yAxis,
|
|
63517
|
-
others = _objectWithoutProperties$e(_this$props, _excluded$
|
|
63453
|
+
others = _objectWithoutProperties$e(_this$props, _excluded$e);
|
|
63518
63454
|
var svgProps = filterProps(others, false);
|
|
63519
63455
|
!!(this.props.direction === 'x' && xAxis.type !== 'number') ? invariant() : void 0;
|
|
63520
63456
|
var errorBars = data.map(function (entry) {
|
|
@@ -65145,7 +65081,7 @@
|
|
|
65145
65081
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
65146
65082
|
}, _typeof$w(o);
|
|
65147
65083
|
}
|
|
65148
|
-
var _excluded$
|
|
65084
|
+
var _excluded$d = ["offset"];
|
|
65149
65085
|
function _toConsumableArray$8(arr) {
|
|
65150
65086
|
return _arrayWithoutHoles$8(arr) || _iterableToArray$9(arr) || _unsupportedIterableToArray$c(arr) || _nonIterableSpread$8();
|
|
65151
65087
|
}
|
|
@@ -65533,7 +65469,7 @@
|
|
|
65533
65469
|
function Label(_ref4) {
|
|
65534
65470
|
var _ref4$offset = _ref4.offset,
|
|
65535
65471
|
offset = _ref4$offset === void 0 ? 5 : _ref4$offset,
|
|
65536
|
-
restProps = _objectWithoutProperties$d(_ref4, _excluded$
|
|
65472
|
+
restProps = _objectWithoutProperties$d(_ref4, _excluded$d);
|
|
65537
65473
|
var props = _objectSpread$s({
|
|
65538
65474
|
offset: offset
|
|
65539
65475
|
}, restProps);
|
|
@@ -65734,8 +65670,8 @@
|
|
|
65734
65670
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
65735
65671
|
}, _typeof$v(o);
|
|
65736
65672
|
}
|
|
65737
|
-
var _excluded$
|
|
65738
|
-
_excluded2$
|
|
65673
|
+
var _excluded$c = ["valueAccessor"],
|
|
65674
|
+
_excluded2$6 = ["data", "dataKey", "clockWise", "id", "textBreakAll"];
|
|
65739
65675
|
function _toConsumableArray$7(arr) {
|
|
65740
65676
|
return _arrayWithoutHoles$7(arr) || _iterableToArray$8(arr) || _unsupportedIterableToArray$b(arr) || _nonIterableSpread$7();
|
|
65741
65677
|
}
|
|
@@ -65856,13 +65792,13 @@
|
|
|
65856
65792
|
function LabelList(_ref) {
|
|
65857
65793
|
var _ref$valueAccessor = _ref.valueAccessor,
|
|
65858
65794
|
valueAccessor = _ref$valueAccessor === void 0 ? defaultAccessor : _ref$valueAccessor,
|
|
65859
|
-
restProps = _objectWithoutProperties$c(_ref, _excluded$
|
|
65795
|
+
restProps = _objectWithoutProperties$c(_ref, _excluded$c);
|
|
65860
65796
|
var data = restProps.data,
|
|
65861
65797
|
dataKey = restProps.dataKey,
|
|
65862
65798
|
clockWise = restProps.clockWise,
|
|
65863
65799
|
id = restProps.id,
|
|
65864
65800
|
textBreakAll = restProps.textBreakAll,
|
|
65865
|
-
others = _objectWithoutProperties$c(restProps, _excluded2$
|
|
65801
|
+
others = _objectWithoutProperties$c(restProps, _excluded2$6);
|
|
65866
65802
|
if (!data || !data.length) {
|
|
65867
65803
|
return null;
|
|
65868
65804
|
}
|
|
@@ -67760,7 +67696,7 @@
|
|
|
67760
67696
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
67761
67697
|
}, _typeof$p(o);
|
|
67762
67698
|
}
|
|
67763
|
-
var _excluded$
|
|
67699
|
+
var _excluded$b = ["children", "begin", "duration", "attributeName", "easing", "isActive", "steps", "from", "to", "canBegin", "onAnimationEnd", "shouldReAnimate", "onAnimationReStart"];
|
|
67764
67700
|
function _objectWithoutProperties$b(source, excluded) {
|
|
67765
67701
|
if (source == null) return {};
|
|
67766
67702
|
var target = _objectWithoutPropertiesLoose$b(source, excluded);
|
|
@@ -68202,7 +68138,7 @@
|
|
|
68202
68138
|
_this$props4.onAnimationEnd;
|
|
68203
68139
|
_this$props4.shouldReAnimate;
|
|
68204
68140
|
_this$props4.onAnimationReStart;
|
|
68205
|
-
var others = _objectWithoutProperties$b(_this$props4, _excluded$
|
|
68141
|
+
var others = _objectWithoutProperties$b(_this$props4, _excluded$b);
|
|
68206
68142
|
var count = React.Children.count(children);
|
|
68207
68143
|
// eslint-disable-next-line react/destructuring-assignment
|
|
68208
68144
|
var stateStyle = this.state.style;
|
|
@@ -75960,7 +75896,7 @@
|
|
|
75960
75896
|
});
|
|
75961
75897
|
};
|
|
75962
75898
|
|
|
75963
|
-
var _excluded$
|
|
75899
|
+
var _excluded$a = ["points", "className", "baseLinePoints", "connectNulls"];
|
|
75964
75900
|
function _extends$j() {
|
|
75965
75901
|
_extends$j = Object.assign ? Object.assign.bind() : function (target) {
|
|
75966
75902
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -76071,7 +76007,7 @@
|
|
|
76071
76007
|
className = props.className,
|
|
76072
76008
|
baseLinePoints = props.baseLinePoints,
|
|
76073
76009
|
connectNulls = props.connectNulls,
|
|
76074
|
-
others = _objectWithoutProperties$a(props, _excluded$
|
|
76010
|
+
others = _objectWithoutProperties$a(props, _excluded$a);
|
|
76075
76011
|
if (!points || !points.length) {
|
|
76076
76012
|
return null;
|
|
76077
76013
|
}
|
|
@@ -76141,7 +76077,7 @@
|
|
|
76141
76077
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
76142
76078
|
}, _typeof$n(o);
|
|
76143
76079
|
}
|
|
76144
|
-
var _excluded$
|
|
76080
|
+
var _excluded$9 = ["x", "y", "top", "left", "width", "height", "className"];
|
|
76145
76081
|
function _extends$h() {
|
|
76146
76082
|
_extends$h = Object.assign ? Object.assign.bind() : function (target) {
|
|
76147
76083
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -76248,7 +76184,7 @@
|
|
|
76248
76184
|
_ref$height = _ref.height,
|
|
76249
76185
|
height = _ref$height === void 0 ? 0 : _ref$height,
|
|
76250
76186
|
className = _ref.className,
|
|
76251
|
-
rest = _objectWithoutProperties$9(_ref, _excluded$
|
|
76187
|
+
rest = _objectWithoutProperties$9(_ref, _excluded$9);
|
|
76252
76188
|
var props = _objectSpread$k({
|
|
76253
76189
|
x: x,
|
|
76254
76190
|
y: y,
|
|
@@ -76330,8 +76266,8 @@
|
|
|
76330
76266
|
}
|
|
76331
76267
|
var minBy_1 = minBy;
|
|
76332
76268
|
|
|
76333
|
-
var _excluded$
|
|
76334
|
-
_excluded2$
|
|
76269
|
+
var _excluded$8 = ["cx", "cy", "angle", "ticks", "axisLine"],
|
|
76270
|
+
_excluded2$5 = ["ticks", "tick", "angle", "tickFormatter", "stroke"];
|
|
76335
76271
|
function _typeof$m(o) {
|
|
76336
76272
|
"@babel/helpers - typeof";
|
|
76337
76273
|
|
|
@@ -76578,7 +76514,7 @@
|
|
|
76578
76514
|
angle = _this$props3.angle,
|
|
76579
76515
|
ticks = _this$props3.ticks,
|
|
76580
76516
|
axisLine = _this$props3.axisLine,
|
|
76581
|
-
others = _objectWithoutProperties$8(_this$props3, _excluded$
|
|
76517
|
+
others = _objectWithoutProperties$8(_this$props3, _excluded$8);
|
|
76582
76518
|
var extent = ticks.reduce(function (result, entry) {
|
|
76583
76519
|
return [Math.min(result[0], entry.coordinate), Math.max(result[1], entry.coordinate)];
|
|
76584
76520
|
}, [Infinity, -Infinity]);
|
|
@@ -76606,7 +76542,7 @@
|
|
|
76606
76542
|
angle = _this$props4.angle,
|
|
76607
76543
|
tickFormatter = _this$props4.tickFormatter,
|
|
76608
76544
|
stroke = _this$props4.stroke,
|
|
76609
|
-
others = _objectWithoutProperties$8(_this$props4, _excluded2$
|
|
76545
|
+
others = _objectWithoutProperties$8(_this$props4, _excluded2$5);
|
|
76610
76546
|
var textAnchor = this.getTickTextAnchor();
|
|
76611
76547
|
var axisProps = filterProps(others, false);
|
|
76612
76548
|
var customTickProps = filterProps(tick, false);
|
|
@@ -77318,7 +77254,7 @@
|
|
|
77318
77254
|
});
|
|
77319
77255
|
};
|
|
77320
77256
|
|
|
77321
|
-
var _excluded$
|
|
77257
|
+
var _excluded$7 = ["option", "shapeType", "propTransformer", "activeClassName", "isActive"];
|
|
77322
77258
|
function _typeof$j(o) {
|
|
77323
77259
|
"@babel/helpers - typeof";
|
|
77324
77260
|
|
|
@@ -77457,7 +77393,7 @@
|
|
|
77457
77393
|
_ref2$activeClassName = _ref2.activeClassName,
|
|
77458
77394
|
activeClassName = _ref2$activeClassName === void 0 ? 'recharts-active-shape' : _ref2$activeClassName,
|
|
77459
77395
|
isActive = _ref2.isActive,
|
|
77460
|
-
props = _objectWithoutProperties$7(_ref2, _excluded$
|
|
77396
|
+
props = _objectWithoutProperties$7(_ref2, _excluded$7);
|
|
77461
77397
|
var shape;
|
|
77462
77398
|
if (/*#__PURE__*/React.isValidElement(option)) {
|
|
77463
77399
|
shape = /*#__PURE__*/React.cloneElement(option, _objectSpread$g(_objectSpread$g({}, props), getPropsFromShapeOption(option)));
|
|
@@ -79441,7 +79377,7 @@
|
|
|
79441
79377
|
}
|
|
79442
79378
|
var every_1 = every;
|
|
79443
79379
|
|
|
79444
|
-
var _excluded$
|
|
79380
|
+
var _excluded$6 = ["x", "y"];
|
|
79445
79381
|
function _typeof$f(o) {
|
|
79446
79382
|
"@babel/helpers - typeof";
|
|
79447
79383
|
|
|
@@ -79549,7 +79485,7 @@
|
|
|
79549
79485
|
function typeguardBarRectangleProps(_ref, props) {
|
|
79550
79486
|
var xProp = _ref.x,
|
|
79551
79487
|
yProp = _ref.y,
|
|
79552
|
-
option = _objectWithoutProperties$6(_ref, _excluded$
|
|
79488
|
+
option = _objectWithoutProperties$6(_ref, _excluded$6);
|
|
79553
79489
|
var xValue = "".concat(xProp);
|
|
79554
79490
|
var x = parseInt(xValue, 10);
|
|
79555
79491
|
var yValue = "".concat(yProp);
|
|
@@ -79595,7 +79531,7 @@
|
|
|
79595
79531
|
};
|
|
79596
79532
|
};
|
|
79597
79533
|
|
|
79598
|
-
var _excluded$
|
|
79534
|
+
var _excluded$5 = ["value", "background"];
|
|
79599
79535
|
var _Bar;
|
|
79600
79536
|
function _typeof$e(o) {
|
|
79601
79537
|
"@babel/helpers - typeof";
|
|
@@ -79918,7 +79854,7 @@
|
|
|
79918
79854
|
return data.map(function (entry, i) {
|
|
79919
79855
|
entry.value;
|
|
79920
79856
|
var background = entry.background,
|
|
79921
|
-
rest = _objectWithoutProperties$5(entry, _excluded$
|
|
79857
|
+
rest = _objectWithoutProperties$5(entry, _excluded$5);
|
|
79922
79858
|
if (!background) {
|
|
79923
79859
|
return null;
|
|
79924
79860
|
}
|
|
@@ -82005,9 +81941,9 @@
|
|
|
82005
81941
|
});
|
|
82006
81942
|
}
|
|
82007
81943
|
|
|
82008
|
-
var _excluded$
|
|
82009
|
-
_excluded2$
|
|
82010
|
-
_excluded3
|
|
81944
|
+
var _excluded$4 = ["viewBox"],
|
|
81945
|
+
_excluded2$4 = ["viewBox"],
|
|
81946
|
+
_excluded3 = ["ticks"];
|
|
82011
81947
|
function _typeof$8(o) {
|
|
82012
81948
|
"@babel/helpers - typeof";
|
|
82013
81949
|
|
|
@@ -82205,12 +82141,12 @@
|
|
|
82205
82141
|
key: "shouldComponentUpdate",
|
|
82206
82142
|
value: function shouldComponentUpdate(_ref, nextState) {
|
|
82207
82143
|
var viewBox = _ref.viewBox,
|
|
82208
|
-
restProps = _objectWithoutProperties$4(_ref, _excluded$
|
|
82144
|
+
restProps = _objectWithoutProperties$4(_ref, _excluded$4);
|
|
82209
82145
|
// props.viewBox is sometimes generated every time -
|
|
82210
82146
|
// check that specially as object equality is likely to fail
|
|
82211
82147
|
var _this$props = this.props,
|
|
82212
82148
|
viewBoxOld = _this$props.viewBox,
|
|
82213
|
-
restPropsOld = _objectWithoutProperties$4(_this$props, _excluded2$
|
|
82149
|
+
restPropsOld = _objectWithoutProperties$4(_this$props, _excluded2$4);
|
|
82214
82150
|
return !shallowEqual(viewBox, viewBoxOld) || !shallowEqual(restProps, restPropsOld) || !shallowEqual(nextState, this.state);
|
|
82215
82151
|
}
|
|
82216
82152
|
}, {
|
|
@@ -82439,7 +82375,7 @@
|
|
|
82439
82375
|
}
|
|
82440
82376
|
var _this$props8 = this.props,
|
|
82441
82377
|
ticks = _this$props8.ticks,
|
|
82442
|
-
noTicksProps = _objectWithoutProperties$4(_this$props8, _excluded3
|
|
82378
|
+
noTicksProps = _objectWithoutProperties$4(_this$props8, _excluded3);
|
|
82443
82379
|
var finalTicks = ticks;
|
|
82444
82380
|
if (isFunction_1(ticksGenerator)) {
|
|
82445
82381
|
finalTicks = ticks && ticks.length > 0 ? ticksGenerator(this.props) : ticksGenerator(noTicksProps);
|
|
@@ -82504,8 +82440,8 @@
|
|
|
82504
82440
|
interval: 'preserveEnd'
|
|
82505
82441
|
});
|
|
82506
82442
|
|
|
82507
|
-
var _excluded$
|
|
82508
|
-
_excluded2$
|
|
82443
|
+
var _excluded$3 = ["x1", "y1", "x2", "y2", "key"],
|
|
82444
|
+
_excluded2$3 = ["offset"];
|
|
82509
82445
|
function _typeof$7(o) {
|
|
82510
82446
|
"@babel/helpers - typeof";
|
|
82511
82447
|
|
|
@@ -82645,10 +82581,10 @@
|
|
|
82645
82581
|
x2 = props.x2,
|
|
82646
82582
|
y2 = props.y2,
|
|
82647
82583
|
key = props.key,
|
|
82648
|
-
others = _objectWithoutProperties$3(props, _excluded$
|
|
82584
|
+
others = _objectWithoutProperties$3(props, _excluded$3);
|
|
82649
82585
|
var _filterProps = filterProps(others, false);
|
|
82650
82586
|
_filterProps.offset;
|
|
82651
|
-
var restOfFilteredProps = _objectWithoutProperties$3(_filterProps, _excluded2$
|
|
82587
|
+
var restOfFilteredProps = _objectWithoutProperties$3(_filterProps, _excluded2$3);
|
|
82652
82588
|
lineItem = /*#__PURE__*/React.createElement("line", _extends$5({}, restOfFilteredProps, {
|
|
82653
82589
|
x1: x1,
|
|
82654
82590
|
y1: y1,
|
|
@@ -82949,8 +82885,8 @@
|
|
|
82949
82885
|
}
|
|
82950
82886
|
CartesianGrid.displayName = 'CartesianGrid';
|
|
82951
82887
|
|
|
82952
|
-
var _excluded$
|
|
82953
|
-
_excluded2$
|
|
82888
|
+
var _excluded$2 = ["type", "layout", "connectNulls", "ref"],
|
|
82889
|
+
_excluded2$2 = ["key"];
|
|
82954
82890
|
function _typeof$6(o) {
|
|
82955
82891
|
"@babel/helpers - typeof";
|
|
82956
82892
|
|
|
@@ -83328,7 +83264,7 @@
|
|
|
83328
83264
|
layout = _this$props3.layout,
|
|
83329
83265
|
connectNulls = _this$props3.connectNulls;
|
|
83330
83266
|
_this$props3.ref;
|
|
83331
|
-
var others = _objectWithoutProperties$2(_this$props3, _excluded$
|
|
83267
|
+
var others = _objectWithoutProperties$2(_this$props3, _excluded$2);
|
|
83332
83268
|
var curveProps = _objectSpread$3(_objectSpread$3(_objectSpread$3({}, filterProps(others, true)), {}, {
|
|
83333
83269
|
fill: 'none',
|
|
83334
83270
|
className: 'recharts-line-curve',
|
|
@@ -83531,7 +83467,7 @@
|
|
|
83531
83467
|
dotItem = option(props);
|
|
83532
83468
|
} else {
|
|
83533
83469
|
var key = props.key,
|
|
83534
|
-
dotProps = _objectWithoutProperties$2(props, _excluded2$
|
|
83470
|
+
dotProps = _objectWithoutProperties$2(props, _excluded2$2);
|
|
83535
83471
|
var className = clsx('recharts-line-dot', typeof option !== 'boolean' ? option.className : '');
|
|
83536
83472
|
dotItem = /*#__PURE__*/React.createElement(Dot, _extends$4({
|
|
83537
83473
|
key: key
|
|
@@ -83617,8 +83553,8 @@
|
|
|
83617
83553
|
}, offset);
|
|
83618
83554
|
});
|
|
83619
83555
|
|
|
83620
|
-
var _excluded$
|
|
83621
|
-
_excluded2$
|
|
83556
|
+
var _excluded$1 = ["layout", "type", "stroke", "connectNulls", "isRange", "ref"],
|
|
83557
|
+
_excluded2$1 = ["key"];
|
|
83622
83558
|
var _Area;
|
|
83623
83559
|
function _typeof$5(o) {
|
|
83624
83560
|
"@babel/helpers - typeof";
|
|
@@ -83942,7 +83878,7 @@
|
|
|
83942
83878
|
connectNulls = _this$props4.connectNulls,
|
|
83943
83879
|
isRange = _this$props4.isRange;
|
|
83944
83880
|
_this$props4.ref;
|
|
83945
|
-
var others = _objectWithoutProperties$1(_this$props4, _excluded$
|
|
83881
|
+
var others = _objectWithoutProperties$1(_this$props4, _excluded$1);
|
|
83946
83882
|
return /*#__PURE__*/React.createElement(Layer, {
|
|
83947
83883
|
clipPath: needClip ? "url(#clipPath-".concat(clipPathId, ")") : null
|
|
83948
83884
|
}, /*#__PURE__*/React.createElement(Curve, _extends$3({}, filterProps(others, true), {
|
|
@@ -84288,7 +84224,7 @@
|
|
|
84288
84224
|
} else {
|
|
84289
84225
|
var className = clsx('recharts-area-dot', typeof option !== 'boolean' ? option.className : '');
|
|
84290
84226
|
var key = props.key,
|
|
84291
|
-
rest = _objectWithoutProperties$1(props, _excluded2$
|
|
84227
|
+
rest = _objectWithoutProperties$1(props, _excluded2$1);
|
|
84292
84228
|
dotItem = /*#__PURE__*/React.createElement(Dot, _extends$3({}, rest, {
|
|
84293
84229
|
key: key,
|
|
84294
84230
|
className: className
|
|
@@ -85433,8 +85369,8 @@
|
|
|
85433
85369
|
return /*#__PURE__*/React.isValidElement(elementPropsCursor) ? /*#__PURE__*/React.cloneElement(elementPropsCursor, cursorProps) : /*#__PURE__*/React.createElement(cursorComp, cursorProps);
|
|
85434
85370
|
}
|
|
85435
85371
|
|
|
85436
|
-
var _excluded
|
|
85437
|
-
_excluded2
|
|
85372
|
+
var _excluded = ["item"],
|
|
85373
|
+
_excluded2 = ["children", "className", "width", "height", "style", "compact", "title", "desc"];
|
|
85438
85374
|
function _typeof(o) {
|
|
85439
85375
|
"@babel/helpers - typeof";
|
|
85440
85376
|
|
|
@@ -86838,7 +86774,7 @@
|
|
|
86838
86774
|
return null;
|
|
86839
86775
|
}
|
|
86840
86776
|
var item = props.item,
|
|
86841
|
-
otherProps = _objectWithoutProperties(props, _excluded
|
|
86777
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
86842
86778
|
return /*#__PURE__*/React.cloneElement(item, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
86843
86779
|
chartWidth: width,
|
|
86844
86780
|
chartHeight: height,
|
|
@@ -87512,7 +87448,7 @@
|
|
|
87512
87448
|
compact = _this$props6.compact,
|
|
87513
87449
|
title = _this$props6.title,
|
|
87514
87450
|
desc = _this$props6.desc,
|
|
87515
|
-
others = _objectWithoutProperties(_this$props6, _excluded2
|
|
87451
|
+
others = _objectWithoutProperties(_this$props6, _excluded2);
|
|
87516
87452
|
var attrs = filterProps(others, false);
|
|
87517
87453
|
|
|
87518
87454
|
// The "compact" mode is mainly used as the panorama within Brush
|
|
@@ -87791,8 +87727,8 @@
|
|
|
87791
87727
|
*/
|
|
87792
87728
|
|
|
87793
87729
|
function formatCompactNumber(n) {
|
|
87794
|
-
if (n >=
|
|
87795
|
-
if (n >=
|
|
87730
|
+
if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1)}M`;
|
|
87731
|
+
if (n >= 1_000) return `${(n / 1_000).toFixed(1)}k`;
|
|
87796
87732
|
return String(n);
|
|
87797
87733
|
}
|
|
87798
87734
|
|
|
@@ -87813,12 +87749,12 @@
|
|
|
87813
87749
|
// "$87,600" (comma-grouped, up to 2 decimals, no forced trailing zeros so a
|
|
87814
87750
|
// whole-dollar salary reads "$81,200" not "$81,200.00").
|
|
87815
87751
|
function formatCurrencyCompact(v) {
|
|
87816
|
-
return
|
|
87752
|
+
return `$${formatCompactNumber(v)}`;
|
|
87817
87753
|
}
|
|
87818
87754
|
function formatCurrencyFull(v) {
|
|
87819
|
-
return
|
|
87820
|
-
|
|
87821
|
-
|
|
87755
|
+
return `$${Number(v).toLocaleString('en-US', {
|
|
87756
|
+
maximumFractionDigits: 2
|
|
87757
|
+
})}`;
|
|
87822
87758
|
}
|
|
87823
87759
|
|
|
87824
87760
|
/**
|
|
@@ -87827,11 +87763,10 @@
|
|
|
87827
87763
|
* Expects `props.data` to be an array of `{ label, value }` objects
|
|
87828
87764
|
* (already normalized by A2uiBlock's numericData helper).
|
|
87829
87765
|
*/
|
|
87830
|
-
function BarChartRenderer(
|
|
87831
|
-
|
|
87832
|
-
|
|
87833
|
-
|
|
87834
|
-
} = _ref;
|
|
87766
|
+
function BarChartRenderer({
|
|
87767
|
+
props,
|
|
87768
|
+
isDark = false
|
|
87769
|
+
}) {
|
|
87835
87770
|
const data = Array.isArray(props.data) ? props.data : [];
|
|
87836
87771
|
// Whether the Y values are money - drives the `$` on axis ticks + tooltip.
|
|
87837
87772
|
const currency = isCurrencyKey$1(props.yKey);
|
|
@@ -87848,7 +87783,7 @@
|
|
|
87848
87783
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
87849
87784
|
style: {
|
|
87850
87785
|
borderRadius: 8,
|
|
87851
|
-
border:
|
|
87786
|
+
border: `1px solid ${borderColor}`,
|
|
87852
87787
|
background: bgColor,
|
|
87853
87788
|
padding: 12,
|
|
87854
87789
|
margin: '8px 0'
|
|
@@ -87870,10 +87805,7 @@
|
|
|
87870
87805
|
})]
|
|
87871
87806
|
});
|
|
87872
87807
|
}
|
|
87873
|
-
const hasLongLabels = data.some(d =>
|
|
87874
|
-
var _d$label;
|
|
87875
|
-
return String((_d$label = d.label) !== null && _d$label !== void 0 ? _d$label : '').length > 10;
|
|
87876
|
-
});
|
|
87808
|
+
const hasLongLabels = data.some(d => String(d.label ?? '').length > 10);
|
|
87877
87809
|
const xAngle = hasLongLabels ? -35 : 0;
|
|
87878
87810
|
const xAnchor = hasLongLabels ? 'end' : 'middle';
|
|
87879
87811
|
const bottomMargin = hasLongLabels ? 48 : 20;
|
|
@@ -87881,7 +87813,7 @@
|
|
|
87881
87813
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
87882
87814
|
style: {
|
|
87883
87815
|
borderRadius: 8,
|
|
87884
|
-
border:
|
|
87816
|
+
border: `1px solid ${borderColor}`,
|
|
87885
87817
|
background: bgColor,
|
|
87886
87818
|
padding: 12,
|
|
87887
87819
|
margin: '8px 0'
|
|
@@ -87926,7 +87858,7 @@
|
|
|
87926
87858
|
textAnchor: xAnchor,
|
|
87927
87859
|
interval: 0,
|
|
87928
87860
|
tickFormatter: v => {
|
|
87929
|
-
const s = String(v
|
|
87861
|
+
const s = String(v ?? '');
|
|
87930
87862
|
return s.replace(/[_\-]+/g, ' ').replace(/\b\w/g, c => c.toUpperCase());
|
|
87931
87863
|
},
|
|
87932
87864
|
label: props.xAxisLabel ? {
|
|
@@ -87949,12 +87881,12 @@
|
|
|
87949
87881
|
fontSize: 11,
|
|
87950
87882
|
fill: labelColor
|
|
87951
87883
|
} : undefined,
|
|
87952
|
-
tickFormatter: v => currency ? formatCurrencyCompact(v) : props.unit ?
|
|
87884
|
+
tickFormatter: v => currency ? formatCurrencyCompact(v) : props.unit ? `${formatCompactNumber(v)} ${props.unit}` : formatCompactNumber(v)
|
|
87953
87885
|
}), /*#__PURE__*/jsxRuntimeExports.jsx(Tooltip, {
|
|
87954
|
-
formatter: v => currency ? formatCurrencyFull(v) : props.unit ?
|
|
87886
|
+
formatter: v => currency ? formatCurrencyFull(v) : props.unit ? `${Number(v).toLocaleString()} ${props.unit}` : Number(v).toLocaleString(),
|
|
87955
87887
|
contentStyle: {
|
|
87956
87888
|
background: tooltipBg,
|
|
87957
|
-
border:
|
|
87889
|
+
border: `1px solid ${borderColor}`,
|
|
87958
87890
|
borderRadius: 6,
|
|
87959
87891
|
fontSize: 12,
|
|
87960
87892
|
color: titleColor
|
|
@@ -87981,11 +87913,10 @@
|
|
|
87981
87913
|
* KPI card - mirrors agent-sdk's eshalRenderers.KPICard.
|
|
87982
87914
|
* Dark-mode aware.
|
|
87983
87915
|
*/
|
|
87984
|
-
function KPICardRenderer(
|
|
87985
|
-
|
|
87986
|
-
|
|
87987
|
-
|
|
87988
|
-
} = _ref2;
|
|
87916
|
+
function KPICardRenderer({
|
|
87917
|
+
props,
|
|
87918
|
+
isDark = false
|
|
87919
|
+
}) {
|
|
87989
87920
|
const trend = props.trend;
|
|
87990
87921
|
const trendColor = trend === 'up' ? '#059669' : trend === 'down' ? '#e11d48' : '#64748b';
|
|
87991
87922
|
const trendArrow = trend === 'up' ? '↑' : trend === 'down' ? '↓' : trend === 'flat' ? '→' : null;
|
|
@@ -87996,7 +87927,7 @@
|
|
|
87996
87927
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
87997
87928
|
style: {
|
|
87998
87929
|
borderRadius: 8,
|
|
87999
|
-
border:
|
|
87930
|
+
border: `1px solid ${borderColor}`,
|
|
88000
87931
|
background: bgColor,
|
|
88001
87932
|
padding: 12,
|
|
88002
87933
|
margin: '8px 0'
|
|
@@ -88067,12 +87998,11 @@
|
|
|
88067
87998
|
if (!Number.isFinite(percent)) return 'inside';
|
|
88068
87999
|
return percent < PIE_LABEL_MIN_SHARE ? 'outside' : 'inside';
|
|
88069
88000
|
}
|
|
88070
|
-
function PieChartRenderer(
|
|
88071
|
-
|
|
88072
|
-
|
|
88073
|
-
|
|
88074
|
-
|
|
88075
|
-
} = _ref3;
|
|
88001
|
+
function PieChartRenderer({
|
|
88002
|
+
props,
|
|
88003
|
+
isDark = false,
|
|
88004
|
+
donut = false
|
|
88005
|
+
}) {
|
|
88076
88006
|
const data = Array.isArray(props.data) ? props.data : [];
|
|
88077
88007
|
const currency = isCurrencyKey$1(props.yKey);
|
|
88078
88008
|
const borderColor = isDark ? '#374151' : '#e2e8f0';
|
|
@@ -88138,7 +88068,7 @@
|
|
|
88138
88068
|
pointerEvents: 'none'
|
|
88139
88069
|
},
|
|
88140
88070
|
children: [/*#__PURE__*/jsxRuntimeExports.jsx("polyline", {
|
|
88141
|
-
points:
|
|
88071
|
+
points: `${cx + rOut * cos},${cy + rOut * sin} ${ex},${ey} ${tx},${ey}`,
|
|
88142
88072
|
stroke: sliceColor,
|
|
88143
88073
|
strokeWidth: 1,
|
|
88144
88074
|
fill: "none"
|
|
@@ -88159,7 +88089,7 @@
|
|
|
88159
88089
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
88160
88090
|
style: {
|
|
88161
88091
|
borderRadius: 8,
|
|
88162
|
-
border:
|
|
88092
|
+
border: `1px solid ${borderColor}`,
|
|
88163
88093
|
background: bgColor,
|
|
88164
88094
|
padding: 12,
|
|
88165
88095
|
margin: '8px 0'
|
|
@@ -88209,7 +88139,7 @@
|
|
|
88209
88139
|
formatter: v => currency ? formatCurrencyFull(v) : Number(v).toLocaleString(),
|
|
88210
88140
|
contentStyle: {
|
|
88211
88141
|
background: tooltipBg,
|
|
88212
|
-
border:
|
|
88142
|
+
border: `1px solid ${borderColor}`,
|
|
88213
88143
|
borderRadius: 6,
|
|
88214
88144
|
fontSize: 12,
|
|
88215
88145
|
color: titleColor
|
|
@@ -88233,12 +88163,11 @@
|
|
|
88233
88163
|
* `props.data` must be an array of `{ label, value }` objects.
|
|
88234
88164
|
* Set `area={true}` to fill under the line.
|
|
88235
88165
|
*/
|
|
88236
|
-
function LineChartRenderer(
|
|
88237
|
-
|
|
88238
|
-
|
|
88239
|
-
|
|
88240
|
-
|
|
88241
|
-
} = _ref4;
|
|
88166
|
+
function LineChartRenderer({
|
|
88167
|
+
props,
|
|
88168
|
+
isDark = false,
|
|
88169
|
+
area = false
|
|
88170
|
+
}) {
|
|
88242
88171
|
const data = Array.isArray(props.data) ? props.data : [];
|
|
88243
88172
|
const currency = isCurrencyKey$1(props.yKey);
|
|
88244
88173
|
const seriesName = props.valueLabel || undefined;
|
|
@@ -88252,7 +88181,7 @@
|
|
|
88252
88181
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
88253
88182
|
style: {
|
|
88254
88183
|
borderRadius: 8,
|
|
88255
|
-
border:
|
|
88184
|
+
border: `1px solid ${borderColor}`,
|
|
88256
88185
|
background: bgColor,
|
|
88257
88186
|
padding: 12,
|
|
88258
88187
|
margin: '8px 0'
|
|
@@ -88278,7 +88207,7 @@
|
|
|
88278
88207
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
88279
88208
|
style: {
|
|
88280
88209
|
borderRadius: 8,
|
|
88281
|
-
border:
|
|
88210
|
+
border: `1px solid ${borderColor}`,
|
|
88282
88211
|
background: bgColor,
|
|
88283
88212
|
padding: 12,
|
|
88284
88213
|
margin: '8px 0'
|
|
@@ -88335,12 +88264,12 @@
|
|
|
88335
88264
|
fontSize: 11,
|
|
88336
88265
|
fill: labelColor
|
|
88337
88266
|
},
|
|
88338
|
-
tickFormatter: v => currency ? formatCurrencyCompact(v) : props.unit ?
|
|
88267
|
+
tickFormatter: v => currency ? formatCurrencyCompact(v) : props.unit ? `${formatCompactNumber(v)} ${props.unit}` : formatCompactNumber(v)
|
|
88339
88268
|
}), /*#__PURE__*/jsxRuntimeExports.jsx(Tooltip, {
|
|
88340
|
-
formatter: v => currency ? formatCurrencyFull(v) : props.unit ?
|
|
88269
|
+
formatter: v => currency ? formatCurrencyFull(v) : props.unit ? `${Number(v).toLocaleString()} ${props.unit}` : Number(v).toLocaleString(),
|
|
88341
88270
|
contentStyle: {
|
|
88342
88271
|
background: tooltipBg,
|
|
88343
|
-
border:
|
|
88272
|
+
border: `1px solid ${borderColor}`,
|
|
88344
88273
|
borderRadius: 6,
|
|
88345
88274
|
fontSize: 12,
|
|
88346
88275
|
color: titleColor
|
|
@@ -88416,24 +88345,57 @@
|
|
|
88416
88345
|
* Every `href`/`src` sink in A2uiBlock must go through this first. Only
|
|
88417
88346
|
* absolute http(s) URLs pass; anything else (javascript:, data:, vbscript:,
|
|
88418
88347
|
* a bare relative path, non-string) is dropped rather than rendered.
|
|
88348
|
+
*
|
|
88349
|
+
* EV-3956: the canonical copy lives in `@eshal/shared`
|
|
88350
|
+
* (`src/a2ui/safeUrl.ts`). This package is published to npm while
|
|
88351
|
+
* @eshal/shared is private, so it keeps its own copy rather than declaring
|
|
88352
|
+
* a dependency consumers cannot resolve. Parity with the canonical version
|
|
88353
|
+
* is enforced by packages/shared/src/__tests__/safeUrlParity.test.ts - if
|
|
88354
|
+
* you change the logic here, change it there too or the build fails.
|
|
88419
88355
|
*/
|
|
88420
88356
|
function safeUrl(u) {
|
|
88421
88357
|
return typeof u === 'string' && /^https?:\/\//i.test(u) ? u : undefined;
|
|
88422
88358
|
}
|
|
88423
88359
|
|
|
88424
|
-
|
|
88425
|
-
|
|
88426
|
-
|
|
88427
|
-
|
|
88428
|
-
|
|
88429
|
-
|
|
88360
|
+
/**
|
|
88361
|
+
* A2uiBlock - render `eshal-ui` / `eshal-chart` / `chart` fence JSON as a
|
|
88362
|
+
* real visual block inside the embedded chat widget.
|
|
88363
|
+
*
|
|
88364
|
+
* Mirrors `packages/frontend/src/components/charts/A2uiBlock.tsx` (used by
|
|
88365
|
+
* the frontend app's inbox, agent-builder TestPanel, and preview AssistantMessage)
|
|
88366
|
+
* but is self-contained - no `recharts` / `d3` dependency, because every byte
|
|
88367
|
+
* counts on a widget the customer loads on EVERY page of their site. Charts
|
|
88368
|
+
* are hand-rolled SVG (bar / line / pie / donut). Tables / alerts / cards /
|
|
88369
|
+
* KPIs / button-groups render as plain HTML.
|
|
88370
|
+
*
|
|
88371
|
+
* Protocol (must stay in sync with the agent-side fence emitter):
|
|
88372
|
+
*
|
|
88373
|
+
* ```eshal-ui
|
|
88374
|
+
* {"type":"line","title":"Avg salary","x":"name","y":"salary",
|
|
88375
|
+
* "data":[{"name":"Eng","salary":105000},{"name":"Finance","salary":106500}]}
|
|
88376
|
+
* ```
|
|
88377
|
+
*
|
|
88378
|
+
* Supported `type` values: bar, line, area, pie, donut, table, alert, card,
|
|
88379
|
+
* kpi, button-group, form, confirmation, menu, profile, timeline, rating,
|
|
88380
|
+
* comparison, gallery. Anything else (waterfall, heatmap, sankey, etc.)
|
|
88381
|
+
* falls back to a bar chart if a `data[]` array is present, or a clean
|
|
88382
|
+
* labeled value list if not - NEVER raw JSON in a code block, which is the
|
|
88383
|
+
* bug this file fixes (12-06-2026).
|
|
88384
|
+
*/
|
|
88385
|
+
|
|
88386
|
+
function A2uiBlock({
|
|
88387
|
+
spec,
|
|
88388
|
+
isDark = false,
|
|
88389
|
+
onButtonClick
|
|
88390
|
+
}) {
|
|
88430
88391
|
if (!spec || typeof spec !== 'object') return null;
|
|
88431
88392
|
// Issue 1: scrub any leaked DB field/column name from the title once, so every
|
|
88432
88393
|
// block type below (chart / KPI / table / card / button group) renders a clean
|
|
88433
88394
|
// user-facing heading - e.g. drop "(summed from the employees.salary field)".
|
|
88434
|
-
spec =
|
|
88395
|
+
spec = {
|
|
88396
|
+
...spec,
|
|
88435
88397
|
title: sanitizeChartTitle(spec.title)
|
|
88436
|
-
}
|
|
88398
|
+
};
|
|
88437
88399
|
// Normalize underscore_case → kebab-case so the agent can emit either
|
|
88438
88400
|
// form. Both `key_observations` and `key-observations` route here.
|
|
88439
88401
|
const t = String(spec.type || '').trim().toLowerCase().replace(/_/g, '-');
|
|
@@ -88470,11 +88432,10 @@
|
|
|
88470
88432
|
isDark: isDark
|
|
88471
88433
|
});
|
|
88472
88434
|
if (t === 'kpi') {
|
|
88473
|
-
|
|
88474
|
-
const value = (_ref2 = (_ref3 = (_spec$value = spec.value) !== null && _spec$value !== void 0 ? _spec$value : spec.amount) !== null && _ref3 !== void 0 ? _ref3 : spec.metric) !== null && _ref2 !== void 0 ? _ref2 : spec.kpi;
|
|
88435
|
+
const value = spec.value ?? spec.amount ?? spec.metric ?? spec.kpi;
|
|
88475
88436
|
const delta = spec.delta != null ? Number(spec.delta) : null;
|
|
88476
|
-
const change =
|
|
88477
|
-
const trend =
|
|
88437
|
+
const change = spec.change ?? (delta != null && Number.isFinite(delta) ? delta >= 0 ? `+${delta}` : String(delta) : undefined);
|
|
88438
|
+
const trend = spec.trend ?? (delta != null && Number.isFinite(delta) ? delta > 0 ? 'up' : delta < 0 ? 'down' : 'flat' : undefined);
|
|
88478
88439
|
return /*#__PURE__*/jsxRuntimeExports.jsx(KPICardRenderer, {
|
|
88479
88440
|
props: {
|
|
88480
88441
|
label: spec.label || spec.title || '',
|
|
@@ -88515,9 +88476,10 @@
|
|
|
88515
88476
|
isDark: isDark,
|
|
88516
88477
|
onButtonClick: onButtonClick
|
|
88517
88478
|
});
|
|
88518
|
-
if (t === 'form') return /*#__PURE__*/jsxRuntimeExports.jsx(
|
|
88479
|
+
if (t === 'form') return /*#__PURE__*/jsxRuntimeExports.jsx(Form, {
|
|
88519
88480
|
spec: spec,
|
|
88520
|
-
isDark: isDark
|
|
88481
|
+
isDark: isDark,
|
|
88482
|
+
onButtonClick: onButtonClick
|
|
88521
88483
|
});
|
|
88522
88484
|
if (t === 'confirmation') return /*#__PURE__*/jsxRuntimeExports.jsx(Confirmation, {
|
|
88523
88485
|
spec: spec,
|
|
@@ -88606,7 +88568,7 @@
|
|
|
88606
88568
|
}
|
|
88607
88569
|
function numericData(data, xKey, yKey) {
|
|
88608
88570
|
return (data || []).map(row => {
|
|
88609
|
-
const raw = row
|
|
88571
|
+
const raw = row?.[xKey];
|
|
88610
88572
|
return {
|
|
88611
88573
|
// Pre-format the label so bar/line ticks read "Jan" instead
|
|
88612
88574
|
// of "1" and "Office Supplies" instead of "office_supplies".
|
|
@@ -88617,19 +88579,18 @@
|
|
|
88617
88579
|
label: formatAxisTick(raw, xKey),
|
|
88618
88580
|
// Raw value preserved - value formatting (currency etc.) is
|
|
88619
88581
|
// applied at render-time by BarSvg/LineSvg using yKey.
|
|
88620
|
-
value: Number(row
|
|
88582
|
+
value: Number(row?.[yKey])
|
|
88621
88583
|
};
|
|
88622
88584
|
}).filter(d => Number.isFinite(d.value));
|
|
88623
88585
|
}
|
|
88624
88586
|
|
|
88625
88587
|
// ── Chart (SVG: line / bar / pie / donut + everything-else fallback) ─────
|
|
88626
88588
|
|
|
88627
|
-
function Chart(
|
|
88628
|
-
|
|
88629
|
-
|
|
88630
|
-
|
|
88631
|
-
|
|
88632
|
-
} = _ref4;
|
|
88589
|
+
function Chart({
|
|
88590
|
+
spec,
|
|
88591
|
+
type,
|
|
88592
|
+
isDark
|
|
88593
|
+
}) {
|
|
88633
88594
|
const {
|
|
88634
88595
|
x,
|
|
88635
88596
|
y
|
|
@@ -88677,11 +88638,10 @@
|
|
|
88677
88638
|
isDark: isDark
|
|
88678
88639
|
});
|
|
88679
88640
|
}
|
|
88680
|
-
function Table(
|
|
88681
|
-
|
|
88682
|
-
|
|
88683
|
-
|
|
88684
|
-
} = _ref1;
|
|
88641
|
+
function Table({
|
|
88642
|
+
spec,
|
|
88643
|
+
isDark
|
|
88644
|
+
}) {
|
|
88685
88645
|
const cols = Array.isArray(spec.columns) && spec.columns.length > 0 ? spec.columns : Array.isArray(spec.data) && spec.data[0] ? Object.keys(spec.data[0]) : [];
|
|
88686
88646
|
const rows = Array.isArray(spec.data) ? spec.data : Array.isArray(spec.rows) ? spec.rows : [];
|
|
88687
88647
|
if (cols.length === 0 || rows.length === 0) {
|
|
@@ -88730,12 +88690,12 @@
|
|
|
88730
88690
|
})
|
|
88731
88691
|
}), /*#__PURE__*/jsxRuntimeExports.jsx("tbody", {
|
|
88732
88692
|
children: rows.map((row, i) => /*#__PURE__*/jsxRuntimeExports.jsx("tr", {
|
|
88733
|
-
children: cols.map(c => /*#__PURE__*/jsxRuntimeExports.jsx("td", {
|
|
88693
|
+
children: cols.map((c, ci) => /*#__PURE__*/jsxRuntimeExports.jsx("td", {
|
|
88734
88694
|
style: {
|
|
88735
88695
|
border,
|
|
88736
88696
|
padding: '6px 8px'
|
|
88737
88697
|
},
|
|
88738
|
-
children: row && typeof row === 'object' ? formatCell(row[c], c) : ''
|
|
88698
|
+
children: Array.isArray(row) ? formatCell(row[ci], c) : row && typeof row === 'object' ? formatCell(row[c], c) : ''
|
|
88739
88699
|
}, c))
|
|
88740
88700
|
}, i))
|
|
88741
88701
|
})]
|
|
@@ -88743,11 +88703,10 @@
|
|
|
88743
88703
|
})]
|
|
88744
88704
|
});
|
|
88745
88705
|
}
|
|
88746
|
-
function Alert(
|
|
88747
|
-
|
|
88748
|
-
|
|
88749
|
-
|
|
88750
|
-
} = _ref10;
|
|
88706
|
+
function Alert({
|
|
88707
|
+
spec,
|
|
88708
|
+
isDark
|
|
88709
|
+
}) {
|
|
88751
88710
|
const lvl = String(spec.level || 'info').toLowerCase();
|
|
88752
88711
|
// EV-2258 Status Message Spec v1 - same --status-success/warning/error/info
|
|
88753
88712
|
// tokens as packages/frontend/src/app/globals.css. This file styles via JS
|
|
@@ -88778,11 +88737,12 @@
|
|
|
88778
88737
|
palette.warning = palette.warn;
|
|
88779
88738
|
const p = palette[lvl] || palette.info;
|
|
88780
88739
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
88781
|
-
style:
|
|
88740
|
+
style: {
|
|
88741
|
+
...card(isDark),
|
|
88782
88742
|
background: p.bg,
|
|
88783
|
-
borderLeft:
|
|
88743
|
+
borderLeft: `4px solid ${p.border}`,
|
|
88784
88744
|
color: p.text
|
|
88785
|
-
}
|
|
88745
|
+
},
|
|
88786
88746
|
children: [spec.title && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
88787
88747
|
style: {
|
|
88788
88748
|
fontWeight: 600,
|
|
@@ -88842,12 +88802,11 @@
|
|
|
88842
88802
|
ticket: Ticket,
|
|
88843
88803
|
check: CircleCheck
|
|
88844
88804
|
};
|
|
88845
|
-
function Card(
|
|
88846
|
-
|
|
88847
|
-
|
|
88848
|
-
|
|
88849
|
-
|
|
88850
|
-
} = _ref11;
|
|
88805
|
+
function Card({
|
|
88806
|
+
spec,
|
|
88807
|
+
isDark,
|
|
88808
|
+
onButtonClick
|
|
88809
|
+
}) {
|
|
88851
88810
|
const fields = Array.isArray(spec.fields) ? spec.fields : [];
|
|
88852
88811
|
const actions = Array.isArray(spec.actions) ? spec.actions : [];
|
|
88853
88812
|
const status = spec.status;
|
|
@@ -88861,10 +88820,11 @@
|
|
|
88861
88820
|
const imageUrl = safeUrl(spec.image);
|
|
88862
88821
|
const pill = status && status.label ? _STATUS_PILL(isDark)[status.variant || 'success'] : null;
|
|
88863
88822
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
88864
|
-
style:
|
|
88823
|
+
style: {
|
|
88824
|
+
...card(isDark),
|
|
88865
88825
|
minWidth: 0,
|
|
88866
88826
|
overflow: 'hidden'
|
|
88867
|
-
}
|
|
88827
|
+
},
|
|
88868
88828
|
children: [imageUrl && /*#__PURE__*/jsxRuntimeExports.jsx("img", {
|
|
88869
88829
|
src: imageUrl,
|
|
88870
88830
|
alt: spec.title || '',
|
|
@@ -89007,28 +88967,25 @@
|
|
|
89007
88967
|
const value = a.value || a.label;
|
|
89008
88968
|
return /*#__PURE__*/jsxRuntimeExports.jsx("button", {
|
|
89009
88969
|
type: "button",
|
|
89010
|
-
onClick: onButtonClick ? () =>
|
|
89011
|
-
var _a$label;
|
|
89012
|
-
return onButtonClick(String(value !== null && value !== void 0 ? value : ''), String((_a$label = a.label) !== null && _a$label !== void 0 ? _a$label : ''));
|
|
89013
|
-
} : undefined,
|
|
88970
|
+
onClick: onButtonClick ? () => onButtonClick(String(value ?? ''), String(a.label ?? '')) : undefined,
|
|
89014
88971
|
disabled: !onButtonClick,
|
|
89015
88972
|
title: !onButtonClick ? 'Action (no handler wired)' : undefined,
|
|
89016
|
-
style:
|
|
88973
|
+
style: {
|
|
88974
|
+
...base,
|
|
89017
88975
|
cursor: onButtonClick ? 'pointer' : 'default',
|
|
89018
88976
|
opacity: onButtonClick ? 1 : 0.5
|
|
89019
|
-
}
|
|
88977
|
+
},
|
|
89020
88978
|
children: a.label
|
|
89021
88979
|
}, i);
|
|
89022
88980
|
})
|
|
89023
88981
|
})]
|
|
89024
88982
|
});
|
|
89025
88983
|
}
|
|
89026
|
-
function ButtonGroup(
|
|
89027
|
-
|
|
89028
|
-
|
|
89029
|
-
|
|
89030
|
-
|
|
89031
|
-
} = _ref12;
|
|
88984
|
+
function ButtonGroup({
|
|
88985
|
+
spec,
|
|
88986
|
+
isDark,
|
|
88987
|
+
onButtonClick
|
|
88988
|
+
}) {
|
|
89032
88989
|
const buttons = Array.isArray(spec.buttons) ? spec.buttons : [];
|
|
89033
88990
|
if (buttons.length === 0) return null;
|
|
89034
88991
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
@@ -89050,52 +89007,326 @@
|
|
|
89050
89007
|
flexWrap: 'wrap',
|
|
89051
89008
|
gap: 6
|
|
89052
89009
|
},
|
|
89053
|
-
children: buttons.map((b, i) => {
|
|
89054
|
-
|
|
89055
|
-
|
|
89056
|
-
|
|
89057
|
-
|
|
89058
|
-
|
|
89059
|
-
|
|
89060
|
-
|
|
89061
|
-
|
|
89062
|
-
|
|
89063
|
-
|
|
89064
|
-
|
|
89065
|
-
|
|
89066
|
-
|
|
89067
|
-
|
|
89068
|
-
|
|
89069
|
-
cursor: onButtonClick ? 'pointer' : 'default',
|
|
89070
|
-
opacity: onButtonClick ? 1 : 0.6
|
|
89071
|
-
},
|
|
89072
|
-
children: String((_ref15 = (_b$label2 = b.label) !== null && _b$label2 !== void 0 ? _b$label2 : b.value) !== null && _ref15 !== void 0 ? _ref15 : '')
|
|
89073
|
-
}, i);
|
|
89074
|
-
})
|
|
89010
|
+
children: buttons.map((b, i) => /*#__PURE__*/jsxRuntimeExports.jsx("button", {
|
|
89011
|
+
type: "button",
|
|
89012
|
+
onClick: onButtonClick ? () => onButtonClick(String(b.value ?? b.label ?? ''), String(b.label ?? b.value ?? '')) : undefined,
|
|
89013
|
+
disabled: !onButtonClick,
|
|
89014
|
+
style: {
|
|
89015
|
+
border: '1px solid ' + (isDark ? '#374151' : '#d1d5db'),
|
|
89016
|
+
background: isDark ? '#1f2937' : '#ffffff',
|
|
89017
|
+
color: isDark ? '#f3f4f6' : '#111827',
|
|
89018
|
+
padding: '6px 12px',
|
|
89019
|
+
borderRadius: 6,
|
|
89020
|
+
fontSize: 12,
|
|
89021
|
+
cursor: onButtonClick ? 'pointer' : 'default',
|
|
89022
|
+
opacity: onButtonClick ? 1 : 0.6
|
|
89023
|
+
},
|
|
89024
|
+
children: String(b.label ?? b.value ?? '')
|
|
89025
|
+
}, i))
|
|
89075
89026
|
})]
|
|
89076
89027
|
});
|
|
89077
89028
|
}
|
|
89078
|
-
|
|
89079
|
-
|
|
89080
|
-
|
|
89081
|
-
|
|
89082
|
-
|
|
89083
|
-
|
|
89084
|
-
|
|
89085
|
-
|
|
89086
|
-
|
|
89087
|
-
|
|
89029
|
+
|
|
89030
|
+
// WP-08: the widget's form used to be read-only - "the chat surface
|
|
89031
|
+
// doesn't have a form-submit channel" - even though every other A2UI
|
|
89032
|
+
// primitive already posts through `onButtonClick`, and the SDK
|
|
89033
|
+
// (packages/agent-sdk/src/markdown/A2uiBlock.tsx) already submits real
|
|
89034
|
+
// forms the same way. Ported here (plain JS/inline styles, no Tailwind -
|
|
89035
|
+
// matches this file's own convention) rather than duplicated by accident:
|
|
89036
|
+
// same field kinds, same validation rules, same submitted-value shape
|
|
89037
|
+
// (JSON via the existing onButtonClick channel - `_submitted_form_data` in
|
|
89038
|
+
// agent-builder's a2ui_synth.py already documents JSON as a first-class
|
|
89039
|
+
// wire format, "widget / SDK send JSON.stringify(data)").
|
|
89040
|
+
//
|
|
89041
|
+
// `time` is a new field kind (none of the three renderers had one before -
|
|
89042
|
+
// pickup/delivery slots had to be faked as a select).
|
|
89043
|
+
function _validateFormField(field, value) {
|
|
89044
|
+
const isEmpty = value === undefined || value === null || typeof value === 'string' && value.trim() === '';
|
|
89045
|
+
if (field.required && isEmpty) return `${field.label} is required`;
|
|
89046
|
+
if (isEmpty) return null;
|
|
89047
|
+
if (field.type === 'email' && typeof value === 'string') {
|
|
89048
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
89049
|
+
return `${field.label} must be a valid email`;
|
|
89050
|
+
}
|
|
89051
|
+
}
|
|
89052
|
+
if (field.type === 'url' && typeof value === 'string') {
|
|
89053
|
+
try {
|
|
89054
|
+
// eslint-disable-next-line no-new
|
|
89055
|
+
new URL(value);
|
|
89056
|
+
} catch {
|
|
89057
|
+
return `${field.label} must be a valid URL`;
|
|
89058
|
+
}
|
|
89059
|
+
}
|
|
89060
|
+
if (field.type === 'number' && typeof value === 'string' && value !== '') {
|
|
89061
|
+
const n = Number(value);
|
|
89062
|
+
if (!Number.isFinite(n)) return `${field.label} must be a number`;
|
|
89063
|
+
if (typeof field.min === 'number' && n < field.min) {
|
|
89064
|
+
return `${field.label} must be \u2265 ${field.min}`;
|
|
89065
|
+
}
|
|
89066
|
+
if (typeof field.max === 'number' && n > field.max) {
|
|
89067
|
+
return `${field.label} must be \u2264 ${field.max}`;
|
|
89068
|
+
}
|
|
89069
|
+
}
|
|
89070
|
+
if (typeof value === 'string') {
|
|
89071
|
+
if (field.minLength != null && value.length < field.minLength) {
|
|
89072
|
+
return `${field.label} must be at least ${field.minLength} characters`;
|
|
89073
|
+
}
|
|
89074
|
+
if (field.maxLength != null && value.length > field.maxLength) {
|
|
89075
|
+
return `${field.label} must be at most ${field.maxLength} characters`;
|
|
89076
|
+
}
|
|
89077
|
+
if (field.pattern) {
|
|
89078
|
+
try {
|
|
89079
|
+
const re = new RegExp(field.pattern);
|
|
89080
|
+
if (!re.test(value)) return `${field.label} format is invalid`;
|
|
89081
|
+
} catch {
|
|
89082
|
+
// A malformed pattern is the agent's bug, not the user's - never
|
|
89083
|
+
// block submission on it.
|
|
89084
|
+
}
|
|
89085
|
+
}
|
|
89086
|
+
}
|
|
89087
|
+
return null;
|
|
89088
|
+
}
|
|
89089
|
+
const _TEXTUAL_INPUT_TYPES = new Set(['text', 'email', 'tel', 'url', 'date', 'time']);
|
|
89090
|
+
function FormField({
|
|
89091
|
+
field,
|
|
89092
|
+
value,
|
|
89093
|
+
error,
|
|
89094
|
+
onChange,
|
|
89095
|
+
isDark,
|
|
89096
|
+
autoId
|
|
89097
|
+
}) {
|
|
89098
|
+
const inputStyle = {
|
|
89099
|
+
width: '100%',
|
|
89100
|
+
boxSizing: 'border-box',
|
|
89101
|
+
border: '1px solid ' + (isDark ? error ? '#f87171' : '#374151' : error ? '#ef4444' : '#d1d5db'),
|
|
89102
|
+
background: isDark ? '#111827' : '#ffffff',
|
|
89103
|
+
color: isDark ? '#f3f4f6' : '#111827',
|
|
89104
|
+
borderRadius: 6,
|
|
89105
|
+
padding: '6px 8px',
|
|
89106
|
+
fontSize: 12
|
|
89107
|
+
};
|
|
89108
|
+
const labelStyle = {
|
|
89109
|
+
display: 'block',
|
|
89110
|
+
fontSize: 12,
|
|
89111
|
+
fontWeight: 600,
|
|
89112
|
+
marginBottom: 4
|
|
89113
|
+
};
|
|
89114
|
+
if (field.type === 'hidden') return null;
|
|
89115
|
+
if (field.type === 'checkbox') {
|
|
89116
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
89117
|
+
style: {
|
|
89118
|
+
marginBottom: 10
|
|
89119
|
+
},
|
|
89120
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs("label", {
|
|
89121
|
+
style: {
|
|
89122
|
+
display: 'flex',
|
|
89123
|
+
alignItems: 'center',
|
|
89124
|
+
gap: 6,
|
|
89125
|
+
fontSize: 12
|
|
89126
|
+
},
|
|
89127
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsx("input", {
|
|
89128
|
+
id: autoId,
|
|
89129
|
+
type: "checkbox",
|
|
89130
|
+
checked: Boolean(value),
|
|
89131
|
+
onChange: e => onChange(e.target.checked)
|
|
89132
|
+
}), field.label, field.required ? ' *' : '']
|
|
89133
|
+
}), error && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
89134
|
+
style: {
|
|
89135
|
+
fontSize: 11,
|
|
89136
|
+
color: '#ef4444',
|
|
89137
|
+
marginTop: 2
|
|
89138
|
+
},
|
|
89139
|
+
children: error
|
|
89140
|
+
})]
|
|
89141
|
+
});
|
|
89142
|
+
}
|
|
89143
|
+
if (field.type === 'select') {
|
|
89144
|
+
const opts = Array.isArray(field.options) ? field.options : [];
|
|
89145
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
89146
|
+
style: {
|
|
89147
|
+
marginBottom: 10
|
|
89148
|
+
},
|
|
89149
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs("label", {
|
|
89150
|
+
htmlFor: autoId,
|
|
89151
|
+
style: labelStyle,
|
|
89152
|
+
children: [field.label, field.required ? ' *' : '']
|
|
89153
|
+
}), /*#__PURE__*/jsxRuntimeExports.jsxs("select", {
|
|
89154
|
+
id: autoId,
|
|
89155
|
+
style: inputStyle,
|
|
89156
|
+
value: value ?? '',
|
|
89157
|
+
onChange: e => onChange(e.target.value),
|
|
89158
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsx("option", {
|
|
89159
|
+
value: "",
|
|
89160
|
+
disabled: true,
|
|
89161
|
+
children: field.placeholder || 'Select…'
|
|
89162
|
+
}), opts.map(o => /*#__PURE__*/jsxRuntimeExports.jsx("option", {
|
|
89163
|
+
value: o.value,
|
|
89164
|
+
children: o.label
|
|
89165
|
+
}, o.value))]
|
|
89166
|
+
}), error && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
89167
|
+
style: {
|
|
89168
|
+
fontSize: 11,
|
|
89169
|
+
color: '#ef4444',
|
|
89170
|
+
marginTop: 2
|
|
89171
|
+
},
|
|
89172
|
+
children: error
|
|
89173
|
+
})]
|
|
89174
|
+
});
|
|
89175
|
+
}
|
|
89176
|
+
if (field.type === 'radio') {
|
|
89177
|
+
const opts = Array.isArray(field.options) ? field.options : [];
|
|
89178
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
89179
|
+
style: {
|
|
89180
|
+
marginBottom: 10
|
|
89181
|
+
},
|
|
89182
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
89183
|
+
style: labelStyle,
|
|
89184
|
+
children: [field.label, field.required ? ' *' : '']
|
|
89185
|
+
}), opts.map(o => /*#__PURE__*/jsxRuntimeExports.jsxs("label", {
|
|
89186
|
+
style: {
|
|
89187
|
+
display: 'flex',
|
|
89188
|
+
alignItems: 'center',
|
|
89189
|
+
gap: 6,
|
|
89190
|
+
fontSize: 12,
|
|
89191
|
+
marginBottom: 2
|
|
89192
|
+
},
|
|
89193
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsx("input", {
|
|
89194
|
+
type: "radio",
|
|
89195
|
+
name: autoId,
|
|
89196
|
+
checked: value === o.value,
|
|
89197
|
+
onChange: () => onChange(o.value)
|
|
89198
|
+
}), o.label]
|
|
89199
|
+
}, o.value)), error && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
89200
|
+
style: {
|
|
89201
|
+
fontSize: 11,
|
|
89202
|
+
color: '#ef4444',
|
|
89203
|
+
marginTop: 2
|
|
89204
|
+
},
|
|
89205
|
+
children: error
|
|
89206
|
+
})]
|
|
89207
|
+
});
|
|
89208
|
+
}
|
|
89209
|
+
if (field.type === 'textarea') {
|
|
89210
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
89211
|
+
style: {
|
|
89212
|
+
marginBottom: 10
|
|
89213
|
+
},
|
|
89214
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs("label", {
|
|
89215
|
+
htmlFor: autoId,
|
|
89216
|
+
style: labelStyle,
|
|
89217
|
+
children: [field.label, field.required ? ' *' : '']
|
|
89218
|
+
}), /*#__PURE__*/jsxRuntimeExports.jsx("textarea", {
|
|
89219
|
+
id: autoId,
|
|
89220
|
+
style: {
|
|
89221
|
+
...inputStyle,
|
|
89222
|
+
minHeight: 60,
|
|
89223
|
+
resize: 'vertical'
|
|
89224
|
+
},
|
|
89225
|
+
value: value ?? '',
|
|
89226
|
+
placeholder: field.placeholder,
|
|
89227
|
+
onChange: e => onChange(e.target.value)
|
|
89228
|
+
}), error && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
89229
|
+
style: {
|
|
89230
|
+
fontSize: 11,
|
|
89231
|
+
color: '#ef4444',
|
|
89232
|
+
marginTop: 2
|
|
89233
|
+
},
|
|
89234
|
+
children: error
|
|
89235
|
+
})]
|
|
89236
|
+
});
|
|
89237
|
+
}
|
|
89238
|
+
const htmlType = _TEXTUAL_INPUT_TYPES.has(field.type) ? field.type : field.type === 'number' ? 'number' : 'text';
|
|
89088
89239
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
89089
|
-
style:
|
|
89090
|
-
|
|
89240
|
+
style: {
|
|
89241
|
+
marginBottom: 10
|
|
89242
|
+
},
|
|
89243
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsxs("label", {
|
|
89244
|
+
htmlFor: autoId,
|
|
89245
|
+
style: labelStyle,
|
|
89246
|
+
children: [field.label, field.required ? ' *' : '']
|
|
89247
|
+
}), /*#__PURE__*/jsxRuntimeExports.jsx("input", {
|
|
89248
|
+
id: autoId,
|
|
89249
|
+
type: htmlType,
|
|
89250
|
+
style: inputStyle,
|
|
89251
|
+
value: value ?? '',
|
|
89252
|
+
placeholder: field.placeholder,
|
|
89253
|
+
onChange: e => onChange(e.target.value)
|
|
89254
|
+
}), field.helpText && !error && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
89091
89255
|
style: {
|
|
89092
|
-
|
|
89093
|
-
|
|
89256
|
+
fontSize: 11,
|
|
89257
|
+
color: isDark ? '#9ca3af' : '#6b7280',
|
|
89258
|
+
marginTop: 2
|
|
89094
89259
|
},
|
|
89095
|
-
children:
|
|
89096
|
-
}),
|
|
89097
|
-
|
|
89098
|
-
|
|
89260
|
+
children: field.helpText
|
|
89261
|
+
}), error && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
89262
|
+
style: {
|
|
89263
|
+
fontSize: 11,
|
|
89264
|
+
color: '#ef4444',
|
|
89265
|
+
marginTop: 2
|
|
89266
|
+
},
|
|
89267
|
+
children: error
|
|
89268
|
+
})]
|
|
89269
|
+
});
|
|
89270
|
+
}
|
|
89271
|
+
function Form({
|
|
89272
|
+
spec,
|
|
89273
|
+
isDark,
|
|
89274
|
+
onButtonClick
|
|
89275
|
+
}) {
|
|
89276
|
+
const fields = Array.isArray(spec.fields) ? spec.fields : [];
|
|
89277
|
+
const initialValues = React.useMemo(() => {
|
|
89278
|
+
const obj = {};
|
|
89279
|
+
for (const f of fields) {
|
|
89280
|
+
if (f.defaultValue !== undefined) obj[f.name] = f.defaultValue;else if (f.type === 'checkbox') obj[f.name] = false;else obj[f.name] = '';
|
|
89281
|
+
}
|
|
89282
|
+
return obj;
|
|
89283
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
89284
|
+
}, []);
|
|
89285
|
+
const [values, setValues] = React.useState(initialValues);
|
|
89286
|
+
const [errors, setErrors] = React.useState({});
|
|
89287
|
+
const [submitted, setSubmitted] = React.useState(false);
|
|
89288
|
+
if (fields.length === 0) return null;
|
|
89289
|
+
const handleChange = (name, value) => {
|
|
89290
|
+
setValues(prev => ({
|
|
89291
|
+
...prev,
|
|
89292
|
+
[name]: value
|
|
89293
|
+
}));
|
|
89294
|
+
setErrors(prev => prev[name] ? {
|
|
89295
|
+
...prev,
|
|
89296
|
+
[name]: null
|
|
89297
|
+
} : prev);
|
|
89298
|
+
};
|
|
89299
|
+
const handleSubmit = e => {
|
|
89300
|
+
e.preventDefault();
|
|
89301
|
+
if (submitted || !onButtonClick) return;
|
|
89302
|
+
const next = {};
|
|
89303
|
+
let firstError = false;
|
|
89304
|
+
for (const f of fields) {
|
|
89305
|
+
const err = _validateFormField(f, values[f.name]);
|
|
89306
|
+
next[f.name] = err;
|
|
89307
|
+
if (err) firstError = true;
|
|
89308
|
+
}
|
|
89309
|
+
setErrors(next);
|
|
89310
|
+
if (firstError) return;
|
|
89311
|
+
setSubmitted(true);
|
|
89312
|
+
let payload = '';
|
|
89313
|
+
try {
|
|
89314
|
+
payload = JSON.stringify(values);
|
|
89315
|
+
} catch {
|
|
89316
|
+
return;
|
|
89317
|
+
}
|
|
89318
|
+
onButtonClick(payload, spec.title || 'Form');
|
|
89319
|
+
};
|
|
89320
|
+
if (submitted) {
|
|
89321
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
89322
|
+
style: card(isDark),
|
|
89323
|
+
children: [spec.title && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
89324
|
+
style: {
|
|
89325
|
+
fontWeight: 600,
|
|
89326
|
+
marginBottom: 8
|
|
89327
|
+
},
|
|
89328
|
+
children: spec.title
|
|
89329
|
+
}), fields.filter(f => f.type !== 'hidden').map((f, i) => /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
89099
89330
|
style: {
|
|
89100
89331
|
marginBottom: 4,
|
|
89101
89332
|
fontSize: 12
|
|
@@ -89104,28 +89335,80 @@
|
|
|
89104
89335
|
style: {
|
|
89105
89336
|
color: isDark ? '#9ca3af' : '#6b7280'
|
|
89106
89337
|
},
|
|
89107
|
-
children: [f.label
|
|
89338
|
+
children: [f.label, ": "]
|
|
89108
89339
|
}), /*#__PURE__*/jsxRuntimeExports.jsx("span", {
|
|
89109
|
-
children: String(
|
|
89340
|
+
children: String(values[f.name] ?? '')
|
|
89110
89341
|
})]
|
|
89111
|
-
}, i)
|
|
89112
|
-
})
|
|
89113
|
-
}
|
|
89342
|
+
}, i))]
|
|
89343
|
+
});
|
|
89344
|
+
}
|
|
89345
|
+
return (
|
|
89346
|
+
/*#__PURE__*/
|
|
89347
|
+
// noValidate: `_validateFormField` above is the single, themed authority
|
|
89348
|
+
// (matches the SDK/frontend renderers) - without it a native constraint
|
|
89349
|
+
// (e.g. type="email" with an invalid value) silently blocks the submit
|
|
89350
|
+
// event before this component's own onSubmit ever runs, so the styled
|
|
89351
|
+
// inline error never renders and the browser's own tooltip does instead.
|
|
89352
|
+
jsxRuntimeExports.jsxs("form", {
|
|
89353
|
+
style: card(isDark),
|
|
89354
|
+
onSubmit: handleSubmit,
|
|
89355
|
+
noValidate: true,
|
|
89356
|
+
children: [spec.title && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
89357
|
+
style: {
|
|
89358
|
+
fontWeight: 600,
|
|
89359
|
+
marginBottom: 4
|
|
89360
|
+
},
|
|
89361
|
+
children: spec.title
|
|
89362
|
+
}), spec.description && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
89363
|
+
style: {
|
|
89364
|
+
fontSize: 12,
|
|
89365
|
+
color: isDark ? '#9ca3af' : '#6b7280',
|
|
89366
|
+
marginBottom: 8
|
|
89367
|
+
},
|
|
89368
|
+
children: spec.description
|
|
89369
|
+
}), fields.map((f, i) => /*#__PURE__*/jsxRuntimeExports.jsx(FormField, {
|
|
89370
|
+
field: f,
|
|
89371
|
+
value: values[f.name],
|
|
89372
|
+
error: errors[f.name],
|
|
89373
|
+
onChange: v => handleChange(f.name, v),
|
|
89374
|
+
isDark: isDark,
|
|
89375
|
+
autoId: `a2ui-form-${f.name || i}`
|
|
89376
|
+
}, f.name || i)), /*#__PURE__*/jsxRuntimeExports.jsx("button", {
|
|
89377
|
+
type: "submit",
|
|
89378
|
+
disabled: !onButtonClick,
|
|
89379
|
+
style: {
|
|
89380
|
+
border: '1px solid ' + (isDark ? '#374151' : '#d1d5db'),
|
|
89381
|
+
background: onButtonClick ? '#2563eb' : isDark ? '#1f2937' : '#f3f4f6',
|
|
89382
|
+
color: onButtonClick ? '#ffffff' : isDark ? '#6b7280' : '#9ca3af',
|
|
89383
|
+
padding: '6px 14px',
|
|
89384
|
+
borderRadius: 6,
|
|
89385
|
+
fontSize: 12,
|
|
89386
|
+
cursor: onButtonClick ? 'pointer' : 'default'
|
|
89387
|
+
},
|
|
89388
|
+
children: spec.submitLabel || 'Submit'
|
|
89389
|
+
})]
|
|
89390
|
+
})
|
|
89391
|
+
);
|
|
89114
89392
|
}
|
|
89115
|
-
function Confirmation(
|
|
89116
|
-
|
|
89117
|
-
|
|
89118
|
-
|
|
89119
|
-
|
|
89120
|
-
|
|
89121
|
-
|
|
89393
|
+
function Confirmation({
|
|
89394
|
+
spec,
|
|
89395
|
+
isDark,
|
|
89396
|
+
onButtonClick
|
|
89397
|
+
}) {
|
|
89398
|
+
// WP-08: every emitter (runner_kernel.py, runner_service.py) and every
|
|
89399
|
+
// other renderer (SDK, Testing Lab) reads/writes `choices[]` - this was
|
|
89400
|
+
// the only surface still reading `spec.yes` / `spec.no`, which meant a
|
|
89401
|
+
// real confirmation fence rendered the hardcoded words "Yes"/"No" and
|
|
89402
|
+
// posted back "yes"/"no", discarding the agent's own labels and values
|
|
89403
|
+
// (e.g. "Confirm booking" / "confirm-EK001"). `yes`/`no` kept as a
|
|
89404
|
+
// back-compat fallback for anything still emitting the old shape.
|
|
89405
|
+
const buttons = Array.isArray(spec.choices) && spec.choices.length > 0 ? spec.choices : [spec.yes || {
|
|
89122
89406
|
label: 'Yes',
|
|
89123
89407
|
value: 'yes'
|
|
89124
|
-
}
|
|
89125
|
-
const no = spec.no || {
|
|
89408
|
+
}, spec.no || {
|
|
89126
89409
|
label: 'No',
|
|
89127
89410
|
value: 'no'
|
|
89128
|
-
};
|
|
89411
|
+
}];
|
|
89129
89412
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
89130
89413
|
style: card(isDark),
|
|
89131
89414
|
children: [spec.title && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
@@ -89145,7 +89428,7 @@
|
|
|
89145
89428
|
children: String(spec.body)
|
|
89146
89429
|
}), /*#__PURE__*/jsxRuntimeExports.jsx(ButtonGroup, {
|
|
89147
89430
|
spec: {
|
|
89148
|
-
buttons
|
|
89431
|
+
buttons
|
|
89149
89432
|
},
|
|
89150
89433
|
isDark: isDark,
|
|
89151
89434
|
onButtonClick: onButtonClick
|
|
@@ -89206,13 +89489,12 @@
|
|
|
89206
89489
|
opacity: disabled ? 0.5 : 1
|
|
89207
89490
|
};
|
|
89208
89491
|
}
|
|
89209
|
-
function StarRow(
|
|
89210
|
-
|
|
89211
|
-
|
|
89212
|
-
|
|
89213
|
-
|
|
89214
|
-
|
|
89215
|
-
} = _ref19;
|
|
89492
|
+
function StarRow({
|
|
89493
|
+
score,
|
|
89494
|
+
maxScore = 5,
|
|
89495
|
+
size = 14,
|
|
89496
|
+
isDark
|
|
89497
|
+
}) {
|
|
89216
89498
|
const stars = [];
|
|
89217
89499
|
for (let i = 0; i < maxScore; i += 1) {
|
|
89218
89500
|
const filled = score >= i + 1;
|
|
@@ -89221,12 +89503,12 @@
|
|
|
89221
89503
|
width: size,
|
|
89222
89504
|
height: size,
|
|
89223
89505
|
viewBox: "0 0 24 24",
|
|
89224
|
-
fill: filled ? '#fbbf24' : half ?
|
|
89506
|
+
fill: filled ? '#fbbf24' : half ? `url(#a2ui-half-star-${i})` : 'none',
|
|
89225
89507
|
stroke: filled || half ? '#fbbf24' : isDark ? '#4b5563' : '#d1d5db',
|
|
89226
89508
|
strokeWidth: "1.5",
|
|
89227
89509
|
children: [half && /*#__PURE__*/jsxRuntimeExports.jsx("defs", {
|
|
89228
89510
|
children: /*#__PURE__*/jsxRuntimeExports.jsxs("linearGradient", {
|
|
89229
|
-
id:
|
|
89511
|
+
id: `a2ui-half-star-${i}`,
|
|
89230
89512
|
children: [/*#__PURE__*/jsxRuntimeExports.jsx("stop", {
|
|
89231
89513
|
offset: "50%",
|
|
89232
89514
|
stopColor: "#fbbf24"
|
|
@@ -89252,12 +89534,11 @@
|
|
|
89252
89534
|
|
|
89253
89535
|
// ── 1. Menu (catalog / product / service list) ──
|
|
89254
89536
|
|
|
89255
|
-
function Menu(
|
|
89256
|
-
|
|
89257
|
-
|
|
89258
|
-
|
|
89259
|
-
|
|
89260
|
-
} = _ref20;
|
|
89537
|
+
function Menu({
|
|
89538
|
+
spec,
|
|
89539
|
+
isDark,
|
|
89540
|
+
onButtonClick
|
|
89541
|
+
}) {
|
|
89261
89542
|
const items = Array.isArray(spec.items) ? spec.items : [];
|
|
89262
89543
|
if (items.length === 0) return null;
|
|
89263
89544
|
const border = isDark ? '1px solid #374151' : '1px solid #e5e7eb';
|
|
@@ -89365,15 +89646,13 @@
|
|
|
89365
89646
|
}
|
|
89366
89647
|
}), item.actionLabel && /*#__PURE__*/jsxRuntimeExports.jsx("button", {
|
|
89367
89648
|
type: "button",
|
|
89368
|
-
onClick: onButtonClick ? () =>
|
|
89369
|
-
var _item$value;
|
|
89370
|
-
return onButtonClick(String((_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : item.actionLabel), String(item.actionLabel));
|
|
89371
|
-
} : undefined,
|
|
89649
|
+
onClick: onButtonClick ? () => onButtonClick(String(item.value ?? item.actionLabel), String(item.actionLabel)) : undefined,
|
|
89372
89650
|
disabled: !onButtonClick,
|
|
89373
|
-
style:
|
|
89651
|
+
style: {
|
|
89652
|
+
...primaryButtonStyle(isDark, !onButtonClick),
|
|
89374
89653
|
alignSelf: 'flex-start',
|
|
89375
89654
|
marginTop: 4
|
|
89376
|
-
}
|
|
89655
|
+
},
|
|
89377
89656
|
children: item.actionLabel
|
|
89378
89657
|
})]
|
|
89379
89658
|
})]
|
|
@@ -89384,12 +89663,11 @@
|
|
|
89384
89663
|
|
|
89385
89664
|
// ── 2. Profile (person card: doctor / agent / seller) ──
|
|
89386
89665
|
|
|
89387
|
-
function Profile(
|
|
89388
|
-
|
|
89389
|
-
|
|
89390
|
-
|
|
89391
|
-
|
|
89392
|
-
} = _ref21;
|
|
89666
|
+
function Profile({
|
|
89667
|
+
spec,
|
|
89668
|
+
isDark,
|
|
89669
|
+
onButtonClick
|
|
89670
|
+
}) {
|
|
89393
89671
|
const tags = Array.isArray(spec.tags) ? spec.tags : [];
|
|
89394
89672
|
const actions = Array.isArray(spec.actions) ? spec.actions : [];
|
|
89395
89673
|
const subColor = isDark ? '#9ca3af' : '#6b7280';
|
|
@@ -89462,7 +89740,7 @@
|
|
|
89462
89740
|
fontSize: 10,
|
|
89463
89741
|
color: subColor
|
|
89464
89742
|
},
|
|
89465
|
-
children: [spec.rating.toFixed(1), typeof spec.reviewCount === 'number' ?
|
|
89743
|
+
children: [spec.rating.toFixed(1), typeof spec.reviewCount === 'number' ? ` (${spec.reviewCount})` : '']
|
|
89466
89744
|
})]
|
|
89467
89745
|
})]
|
|
89468
89746
|
})]
|
|
@@ -89518,11 +89796,10 @@
|
|
|
89518
89796
|
|
|
89519
89797
|
// ── 3. Timeline (status stepper: order tracking, appointment stages) ──
|
|
89520
89798
|
|
|
89521
|
-
function Timeline(
|
|
89522
|
-
|
|
89523
|
-
|
|
89524
|
-
|
|
89525
|
-
} = _ref22;
|
|
89799
|
+
function Timeline({
|
|
89800
|
+
spec,
|
|
89801
|
+
isDark
|
|
89802
|
+
}) {
|
|
89526
89803
|
const steps = Array.isArray(spec.steps) ? spec.steps : [];
|
|
89527
89804
|
if (steps.length === 0) return null;
|
|
89528
89805
|
const lineColor = isDark ? '#374151' : '#e5e7eb';
|
|
@@ -89534,7 +89811,7 @@
|
|
|
89534
89811
|
};
|
|
89535
89812
|
if (status === 'active') return {
|
|
89536
89813
|
background: BRAND_BLUE,
|
|
89537
|
-
border:
|
|
89814
|
+
border: `2px solid ${BRAND_BLUE}`,
|
|
89538
89815
|
boxShadow: isDark ? '0 0 0 4px rgba(37,99,235,0.25)' : '0 0 0 4px #dbeafe'
|
|
89539
89816
|
};
|
|
89540
89817
|
return {
|
|
@@ -89567,12 +89844,13 @@
|
|
|
89567
89844
|
alignItems: 'center'
|
|
89568
89845
|
},
|
|
89569
89846
|
children: [/*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
89570
|
-
style:
|
|
89847
|
+
style: {
|
|
89571
89848
|
height: 12,
|
|
89572
89849
|
width: 12,
|
|
89573
89850
|
borderRadius: '50%',
|
|
89574
|
-
flexShrink: 0
|
|
89575
|
-
|
|
89851
|
+
flexShrink: 0,
|
|
89852
|
+
...dotStyle(status)
|
|
89853
|
+
}
|
|
89576
89854
|
}), !isLast && /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
89577
89855
|
style: {
|
|
89578
89856
|
width: 1,
|
|
@@ -89626,11 +89904,10 @@
|
|
|
89626
89904
|
|
|
89627
89905
|
// ── 4. Rating (score + review) ──
|
|
89628
89906
|
|
|
89629
|
-
function Rating(
|
|
89630
|
-
|
|
89631
|
-
|
|
89632
|
-
|
|
89633
|
-
} = _ref23;
|
|
89907
|
+
function Rating({
|
|
89908
|
+
spec,
|
|
89909
|
+
isDark
|
|
89910
|
+
}) {
|
|
89634
89911
|
const maxScore = spec.maxScore || 5;
|
|
89635
89912
|
const subColor = isDark ? '#9ca3af' : '#6b7280';
|
|
89636
89913
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
@@ -89693,12 +89970,11 @@
|
|
|
89693
89970
|
|
|
89694
89971
|
// ── 5. Comparison (pricing tiers / plan comparison) ──
|
|
89695
89972
|
|
|
89696
|
-
function Comparison(
|
|
89697
|
-
|
|
89698
|
-
|
|
89699
|
-
|
|
89700
|
-
|
|
89701
|
-
} = _ref24;
|
|
89973
|
+
function Comparison({
|
|
89974
|
+
spec,
|
|
89975
|
+
isDark,
|
|
89976
|
+
onButtonClick
|
|
89977
|
+
}) {
|
|
89702
89978
|
const plans = Array.isArray(spec.plans) ? spec.plans : [];
|
|
89703
89979
|
if (plans.length === 0) return null;
|
|
89704
89980
|
const subColor = isDark ? '#9ca3af' : '#6b7280';
|
|
@@ -89721,7 +89997,7 @@
|
|
|
89721
89997
|
},
|
|
89722
89998
|
children: plans.map((p, i) => /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
89723
89999
|
style: {
|
|
89724
|
-
border: p.highlight ?
|
|
90000
|
+
border: p.highlight ? `1px solid ${BRAND_BLUE}` : '1px solid ' + (isDark ? '#374151' : '#e5e7eb'),
|
|
89725
90001
|
background: p.highlight ? isDark ? 'rgba(37,99,235,0.10)' : '#eff6ff' : isDark ? '#1f2937' : '#ffffff',
|
|
89726
90002
|
borderRadius: 10,
|
|
89727
90003
|
padding: 12,
|
|
@@ -89806,14 +90082,12 @@
|
|
|
89806
90082
|
}, fi))
|
|
89807
90083
|
}), p.actionLabel && /*#__PURE__*/jsxRuntimeExports.jsx("button", {
|
|
89808
90084
|
type: "button",
|
|
89809
|
-
onClick: onButtonClick ? () =>
|
|
89810
|
-
var _p$value;
|
|
89811
|
-
return onButtonClick(String((_p$value = p.value) !== null && _p$value !== void 0 ? _p$value : p.actionLabel), String(p.actionLabel));
|
|
89812
|
-
} : undefined,
|
|
90085
|
+
onClick: onButtonClick ? () => onButtonClick(String(p.value ?? p.actionLabel), String(p.actionLabel)) : undefined,
|
|
89813
90086
|
disabled: !onButtonClick,
|
|
89814
|
-
style:
|
|
90087
|
+
style: {
|
|
90088
|
+
...(p.highlight ? primaryButtonStyle(isDark, !onButtonClick) : secondaryButtonStyle(isDark, !onButtonClick)),
|
|
89815
90089
|
marginTop: 10
|
|
89816
|
-
}
|
|
90090
|
+
},
|
|
89817
90091
|
children: p.actionLabel
|
|
89818
90092
|
})]
|
|
89819
90093
|
}, i))
|
|
@@ -89823,11 +90097,10 @@
|
|
|
89823
90097
|
|
|
89824
90098
|
// ── 6. Gallery (horizontal image strip) ──
|
|
89825
90099
|
|
|
89826
|
-
function Gallery(
|
|
89827
|
-
|
|
89828
|
-
|
|
89829
|
-
|
|
89830
|
-
} = _ref25;
|
|
90100
|
+
function Gallery({
|
|
90101
|
+
spec,
|
|
90102
|
+
isDark
|
|
90103
|
+
}) {
|
|
89831
90104
|
const images = Array.isArray(spec.images) ? spec.images : [];
|
|
89832
90105
|
if (images.length === 0) return null;
|
|
89833
90106
|
const subColor = isDark ? '#9ca3af' : '#6b7280';
|
|
@@ -89862,7 +90135,7 @@
|
|
|
89862
90135
|
},
|
|
89863
90136
|
children: [/*#__PURE__*/jsxRuntimeExports.jsx("img", {
|
|
89864
90137
|
src: safeUrl(img.url),
|
|
89865
|
-
alt: img.caption ||
|
|
90138
|
+
alt: img.caption || `Image ${i + 1}`,
|
|
89866
90139
|
referrerPolicy: "no-referrer",
|
|
89867
90140
|
onError: e => {
|
|
89868
90141
|
e.currentTarget.style.display = 'none';
|
|
@@ -89927,7 +90200,7 @@
|
|
|
89927
90200
|
const year = parseInt(m[1], 10);
|
|
89928
90201
|
const month = parseInt(m[2], 10);
|
|
89929
90202
|
if (!Number.isInteger(month) || month < 1 || month > 12) return null;
|
|
89930
|
-
return
|
|
90203
|
+
return `${MONTH_NAMES[month - 1]} '${String(year).slice(-2)}`;
|
|
89931
90204
|
}
|
|
89932
90205
|
|
|
89933
90206
|
// Axis-tick formatter: month-number columns (column matches /month/i,
|
|
@@ -89957,7 +90230,7 @@
|
|
|
89957
90230
|
// slugs/camelCase pass through verbatim.
|
|
89958
90231
|
const SNAKE_CASE_CATEGORY_RE = /^[a-z]+(_[a-z]+)+$/;
|
|
89959
90232
|
function prettifyCategoryCell(value) {
|
|
89960
|
-
if (typeof value !== 'string') return String(value
|
|
90233
|
+
if (typeof value !== 'string') return String(value ?? '');
|
|
89961
90234
|
if (value.length > 40) return value;
|
|
89962
90235
|
if (!SNAKE_CASE_CATEGORY_RE.test(value)) return value;
|
|
89963
90236
|
return prettifyLabel(value);
|
|
@@ -89987,17 +90260,17 @@
|
|
|
89987
90260
|
// UTC midnight per spec and need no change.
|
|
89988
90261
|
const hasTime = /[T ]\d{2}:\d{2}/.test(trimmed);
|
|
89989
90262
|
const hasTz = /(Z|[+-]\d{2}:?\d{2})$/.test(trimmed);
|
|
89990
|
-
const parseable = hasTime && !hasTz ?
|
|
90263
|
+
const parseable = hasTime && !hasTz ? `${trimmed.replace(' ', 'T')}Z` : trimmed;
|
|
89991
90264
|
const d = new Date(parseable);
|
|
89992
90265
|
if (isNaN(d.getTime())) return null;
|
|
89993
90266
|
const hasNonMidnightTime = hasTime && (d.getUTCHours() !== 0 || d.getUTCMinutes() !== 0 || d.getUTCSeconds() !== 0);
|
|
89994
|
-
const dateStr =
|
|
90267
|
+
const dateStr = `${_MONTH_NAMES[d.getUTCMonth()]} ${d.getUTCDate()}, ${d.getUTCFullYear()}`;
|
|
89995
90268
|
if (!hasNonMidnightTime) return dateStr;
|
|
89996
90269
|
const h = d.getUTCHours();
|
|
89997
90270
|
const ampm = h >= 12 ? 'PM' : 'AM';
|
|
89998
90271
|
const h12 = h % 12 || 12;
|
|
89999
90272
|
const mm = String(d.getUTCMinutes()).padStart(2, '0');
|
|
90000
|
-
return
|
|
90273
|
+
return `${dateStr}, ${h12}:${mm} ${ampm}`;
|
|
90001
90274
|
}
|
|
90002
90275
|
function _commaGroup(n) {
|
|
90003
90276
|
return Number.isInteger(n) ? n.toLocaleString('en-US') : Number(n.toFixed(2)).toLocaleString('en-US');
|
|
@@ -90034,10 +90307,9 @@
|
|
|
90034
90307
|
|
|
90035
90308
|
// ── Lucide-style SVG icons (sharp, monoline, inherit color via currentColor)
|
|
90036
90309
|
|
|
90037
|
-
function IconTrendingUp(
|
|
90038
|
-
|
|
90039
|
-
|
|
90040
|
-
} = _ref26;
|
|
90310
|
+
function IconTrendingUp({
|
|
90311
|
+
size = 14
|
|
90312
|
+
}) {
|
|
90041
90313
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("svg", {
|
|
90042
90314
|
width: size,
|
|
90043
90315
|
height: size,
|
|
@@ -90055,10 +90327,9 @@
|
|
|
90055
90327
|
})]
|
|
90056
90328
|
});
|
|
90057
90329
|
}
|
|
90058
|
-
function IconScale(
|
|
90059
|
-
|
|
90060
|
-
|
|
90061
|
-
} = _ref27;
|
|
90330
|
+
function IconScale({
|
|
90331
|
+
size = 14
|
|
90332
|
+
}) {
|
|
90062
90333
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("svg", {
|
|
90063
90334
|
width: size,
|
|
90064
90335
|
height: size,
|
|
@@ -90084,10 +90355,9 @@
|
|
|
90084
90355
|
})]
|
|
90085
90356
|
});
|
|
90086
90357
|
}
|
|
90087
|
-
function IconGitCompare(
|
|
90088
|
-
|
|
90089
|
-
|
|
90090
|
-
} = _ref28;
|
|
90358
|
+
function IconGitCompare({
|
|
90359
|
+
size = 14
|
|
90360
|
+
}) {
|
|
90091
90361
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("svg", {
|
|
90092
90362
|
width: size,
|
|
90093
90363
|
height: size,
|
|
@@ -90113,10 +90383,9 @@
|
|
|
90113
90383
|
})]
|
|
90114
90384
|
});
|
|
90115
90385
|
}
|
|
90116
|
-
function IconZap(
|
|
90117
|
-
|
|
90118
|
-
|
|
90119
|
-
} = _ref29;
|
|
90386
|
+
function IconZap({
|
|
90387
|
+
size = 14
|
|
90388
|
+
}) {
|
|
90120
90389
|
return /*#__PURE__*/jsxRuntimeExports.jsx("svg", {
|
|
90121
90390
|
width: size,
|
|
90122
90391
|
height: size,
|
|
@@ -90132,10 +90401,9 @@
|
|
|
90132
90401
|
})
|
|
90133
90402
|
});
|
|
90134
90403
|
}
|
|
90135
|
-
function IconLightbulb(
|
|
90136
|
-
|
|
90137
|
-
|
|
90138
|
-
} = _ref30;
|
|
90404
|
+
function IconLightbulb({
|
|
90405
|
+
size = 14
|
|
90406
|
+
}) {
|
|
90139
90407
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("svg", {
|
|
90140
90408
|
width: size,
|
|
90141
90409
|
height: size,
|
|
@@ -90155,10 +90423,9 @@
|
|
|
90155
90423
|
})]
|
|
90156
90424
|
});
|
|
90157
90425
|
}
|
|
90158
|
-
function IconTarget(
|
|
90159
|
-
|
|
90160
|
-
|
|
90161
|
-
} = _ref31;
|
|
90426
|
+
function IconTarget({
|
|
90427
|
+
size = 14
|
|
90428
|
+
}) {
|
|
90162
90429
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("svg", {
|
|
90163
90430
|
width: size,
|
|
90164
90431
|
height: size,
|
|
@@ -90207,15 +90474,14 @@
|
|
|
90207
90474
|
|
|
90208
90475
|
// ── Shared shell for all six insight cards ──
|
|
90209
90476
|
|
|
90210
|
-
function InsightShell(
|
|
90211
|
-
|
|
90212
|
-
|
|
90213
|
-
|
|
90214
|
-
|
|
90215
|
-
|
|
90216
|
-
|
|
90217
|
-
|
|
90218
|
-
} = _ref32;
|
|
90477
|
+
function InsightShell({
|
|
90478
|
+
type,
|
|
90479
|
+
icon,
|
|
90480
|
+
title,
|
|
90481
|
+
count,
|
|
90482
|
+
isDark,
|
|
90483
|
+
children
|
|
90484
|
+
}) {
|
|
90219
90485
|
const {
|
|
90220
90486
|
accent,
|
|
90221
90487
|
iconBg,
|
|
@@ -90294,11 +90560,10 @@
|
|
|
90294
90560
|
if (s.startsWith('-') || s.startsWith('−')) return 'dn';
|
|
90295
90561
|
return 'flat';
|
|
90296
90562
|
}
|
|
90297
|
-
function DeltaTag(
|
|
90298
|
-
|
|
90299
|
-
|
|
90300
|
-
|
|
90301
|
-
} = _ref33;
|
|
90563
|
+
function DeltaTag({
|
|
90564
|
+
delta,
|
|
90565
|
+
isDark
|
|
90566
|
+
}) {
|
|
90302
90567
|
if (!delta) return null;
|
|
90303
90568
|
const tone = deltaToneInsights(delta);
|
|
90304
90569
|
const map = isDark ? {
|
|
@@ -90342,11 +90607,10 @@
|
|
|
90342
90607
|
children: delta
|
|
90343
90608
|
});
|
|
90344
90609
|
}
|
|
90345
|
-
function MetricChipsInsights(
|
|
90346
|
-
|
|
90347
|
-
|
|
90348
|
-
|
|
90349
|
-
} = _ref34;
|
|
90610
|
+
function MetricChipsInsights({
|
|
90611
|
+
items,
|
|
90612
|
+
isDark
|
|
90613
|
+
}) {
|
|
90350
90614
|
if (!items || !items.length) return null;
|
|
90351
90615
|
const border = isDark ? '1px solid #374151' : '1px solid #e5e7eb';
|
|
90352
90616
|
const labelCol = isDark ? '#9ca3af' : '#64748b';
|
|
@@ -90393,11 +90657,10 @@
|
|
|
90393
90657
|
|
|
90394
90658
|
// ── 1. Revenue Insights ──
|
|
90395
90659
|
|
|
90396
|
-
function RevenueInsightsCard(
|
|
90397
|
-
|
|
90398
|
-
|
|
90399
|
-
|
|
90400
|
-
} = _ref35;
|
|
90660
|
+
function RevenueInsightsCard({
|
|
90661
|
+
spec,
|
|
90662
|
+
isDark
|
|
90663
|
+
}) {
|
|
90401
90664
|
const totals = Array.isArray(spec.totals) ? spec.totals : [];
|
|
90402
90665
|
const narrCol = isDark ? '#9ca3af' : '#64748b';
|
|
90403
90666
|
return /*#__PURE__*/jsxRuntimeExports.jsxs(InsightShell, {
|
|
@@ -90457,12 +90720,11 @@
|
|
|
90457
90720
|
|
|
90458
90721
|
// ── 2. Impact Analysis ──
|
|
90459
90722
|
|
|
90460
|
-
function ImpactGroupBlock(
|
|
90461
|
-
|
|
90462
|
-
|
|
90463
|
-
|
|
90464
|
-
|
|
90465
|
-
} = _ref36;
|
|
90723
|
+
function ImpactGroupBlock({
|
|
90724
|
+
items,
|
|
90725
|
+
sentiment,
|
|
90726
|
+
isDark
|
|
90727
|
+
}) {
|
|
90466
90728
|
if (!items || items.length === 0) return null;
|
|
90467
90729
|
const label = sentiment === 'positive' ? 'Positive impact' : sentiment === 'negative' ? 'Negative impact' : 'Neutral';
|
|
90468
90730
|
const subColor = isDark ? '#9ca3af' : '#64748b';
|
|
@@ -90496,7 +90758,7 @@
|
|
|
90496
90758
|
}), items.map((it, i) => /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
90497
90759
|
style: {
|
|
90498
90760
|
background: blockStyle.bg,
|
|
90499
|
-
border:
|
|
90761
|
+
border: `1px solid ${blockStyle.bd}`,
|
|
90500
90762
|
borderRadius: 8,
|
|
90501
90763
|
padding: '8px 10px',
|
|
90502
90764
|
margin: '4px 0',
|
|
@@ -90528,11 +90790,10 @@
|
|
|
90528
90790
|
}, i))]
|
|
90529
90791
|
});
|
|
90530
90792
|
}
|
|
90531
|
-
function ImpactAnalysisCard(
|
|
90532
|
-
|
|
90533
|
-
|
|
90534
|
-
|
|
90535
|
-
} = _ref37;
|
|
90793
|
+
function ImpactAnalysisCard({
|
|
90794
|
+
spec,
|
|
90795
|
+
isDark
|
|
90796
|
+
}) {
|
|
90536
90797
|
return /*#__PURE__*/jsxRuntimeExports.jsxs(InsightShell, {
|
|
90537
90798
|
type: "impact-analysis",
|
|
90538
90799
|
icon: /*#__PURE__*/jsxRuntimeExports.jsx(IconScale, {}),
|
|
@@ -90557,11 +90818,10 @@
|
|
|
90557
90818
|
|
|
90558
90819
|
// ── 3. Deviation Analysis ──
|
|
90559
90820
|
|
|
90560
|
-
function DeviationAnalysisCard(
|
|
90561
|
-
|
|
90562
|
-
|
|
90563
|
-
|
|
90564
|
-
} = _ref38;
|
|
90821
|
+
function DeviationAnalysisCard({
|
|
90822
|
+
spec,
|
|
90823
|
+
isDark
|
|
90824
|
+
}) {
|
|
90565
90825
|
const rows = Array.isArray(spec.deviations) ? spec.deviations : [];
|
|
90566
90826
|
const border = isDark ? '1px solid #374151' : '1px solid #e5e7eb';
|
|
90567
90827
|
const headColor = isDark ? '#9ca3af' : '#64748b';
|
|
@@ -90673,11 +90933,10 @@
|
|
|
90673
90933
|
|
|
90674
90934
|
// ── 4. Main Drivers ──
|
|
90675
90935
|
|
|
90676
|
-
function MainDriversCard(
|
|
90677
|
-
|
|
90678
|
-
|
|
90679
|
-
|
|
90680
|
-
} = _ref39;
|
|
90936
|
+
function MainDriversCard({
|
|
90937
|
+
spec,
|
|
90938
|
+
isDark
|
|
90939
|
+
}) {
|
|
90681
90940
|
const sec = Array.isArray(spec.secondary) ? spec.secondary : [];
|
|
90682
90941
|
const evidenceColor = isDark ? '#9ca3af' : '#64748b';
|
|
90683
90942
|
const subColor = isDark ? '#9ca3af' : '#64748b';
|
|
@@ -90772,17 +91031,16 @@
|
|
|
90772
91031
|
|
|
90773
91032
|
// ── Shared item-row for Observations & Recommendations ──
|
|
90774
91033
|
|
|
90775
|
-
function InsightItem(
|
|
90776
|
-
|
|
90777
|
-
|
|
90778
|
-
|
|
90779
|
-
|
|
90780
|
-
|
|
90781
|
-
|
|
90782
|
-
|
|
90783
|
-
|
|
90784
|
-
|
|
90785
|
-
} = _ref40;
|
|
91034
|
+
function InsightItem({
|
|
91035
|
+
rankBgFg,
|
|
91036
|
+
rank,
|
|
91037
|
+
chips,
|
|
91038
|
+
text,
|
|
91039
|
+
narrative,
|
|
91040
|
+
metrics,
|
|
91041
|
+
impactPill,
|
|
91042
|
+
isDark
|
|
91043
|
+
}) {
|
|
90786
91044
|
const narrCol = isDark ? '#9ca3af' : '#64748b';
|
|
90787
91045
|
const dashedBorder = isDark ? '1px dashed #374151' : '1px dashed #e5e7eb';
|
|
90788
91046
|
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
@@ -90839,11 +91097,10 @@
|
|
|
90839
91097
|
|
|
90840
91098
|
// ── 5. Key Observations ──
|
|
90841
91099
|
|
|
90842
|
-
function KeyObservationsCard(
|
|
90843
|
-
|
|
90844
|
-
|
|
90845
|
-
|
|
90846
|
-
} = _ref41;
|
|
91100
|
+
function KeyObservationsCard({
|
|
91101
|
+
spec,
|
|
91102
|
+
isDark
|
|
91103
|
+
}) {
|
|
90847
91104
|
const items = Array.isArray(spec.items) ? [...spec.items].sort((a, b) => (a.rank || 0) - (b.rank || 0)) : [];
|
|
90848
91105
|
const rankBgFg = isDark ? {
|
|
90849
91106
|
bg: '#064e3b',
|
|
@@ -90856,7 +91113,7 @@
|
|
|
90856
91113
|
type: "key-observations",
|
|
90857
91114
|
icon: /*#__PURE__*/jsxRuntimeExports.jsx(IconLightbulb, {}),
|
|
90858
91115
|
title: spec.title || 'Key observations',
|
|
90859
|
-
count: items.length ?
|
|
91116
|
+
count: items.length ? `${items.length} item${items.length === 1 ? '' : 's'}` : null,
|
|
90860
91117
|
isDark: isDark,
|
|
90861
91118
|
children: items.length === 0 ? /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
90862
91119
|
style: {
|
|
@@ -90899,11 +91156,10 @@
|
|
|
90899
91156
|
|
|
90900
91157
|
// ── 6. Recommendations ──
|
|
90901
91158
|
|
|
90902
|
-
function RecommendationsCard(
|
|
90903
|
-
|
|
90904
|
-
|
|
90905
|
-
|
|
90906
|
-
} = _ref42;
|
|
91159
|
+
function RecommendationsCard({
|
|
91160
|
+
spec,
|
|
91161
|
+
isDark
|
|
91162
|
+
}) {
|
|
90907
91163
|
const items = Array.isArray(spec.items) ? [...spec.items].sort((a, b) => (a.rank || 0) - (b.rank || 0)) : [];
|
|
90908
91164
|
const rankBgFg = isDark ? {
|
|
90909
91165
|
bg: '#312e81',
|
|
@@ -90916,7 +91172,7 @@
|
|
|
90916
91172
|
type: "recommendations",
|
|
90917
91173
|
icon: /*#__PURE__*/jsxRuntimeExports.jsx(IconTarget, {}),
|
|
90918
91174
|
title: spec.title || 'Recommendations',
|
|
90919
|
-
count: items.length ?
|
|
91175
|
+
count: items.length ? `${items.length} item${items.length === 1 ? '' : 's'}` : null,
|
|
90920
91176
|
isDark: isDark,
|
|
90921
91177
|
children: items.length === 0 ? /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
90922
91178
|
style: {
|
|
@@ -90984,25 +91240,29 @@
|
|
|
90984
91240
|
background: isDark ? '#111827' : '#f8fafc',
|
|
90985
91241
|
color: isDark ? '#9ca3af' : '#64748b'
|
|
90986
91242
|
};
|
|
90987
|
-
if (kind === 'cat') return
|
|
91243
|
+
if (kind === 'cat') return {
|
|
91244
|
+
...base,
|
|
90988
91245
|
background: isDark ? 'rgba(99,102,241,0.20)' : '#eef2ff',
|
|
90989
91246
|
color: isDark ? '#c7d2fe' : '#4f46e5',
|
|
90990
91247
|
border: '1px solid transparent'
|
|
90991
|
-
}
|
|
90992
|
-
if (kind === 'seg') return
|
|
91248
|
+
};
|
|
91249
|
+
if (kind === 'seg') return {
|
|
91250
|
+
...base,
|
|
90993
91251
|
background: isDark ? '#1f2937' : '#f1f5f9',
|
|
90994
91252
|
color: isDark ? '#f3f4f6' : '#0f172a'
|
|
90995
|
-
}
|
|
90996
|
-
if (kind === 'prio-high') return
|
|
91253
|
+
};
|
|
91254
|
+
if (kind === 'prio-high') return {
|
|
91255
|
+
...base,
|
|
90997
91256
|
background: isDark ? 'rgba(239,68,68,0.18)' : '#fef2f2',
|
|
90998
91257
|
color: isDark ? '#fecaca' : '#7f1d1d',
|
|
90999
91258
|
border: isDark ? '1px solid rgba(248,113,113,0.30)' : '1px solid #fecaca'
|
|
91000
|
-
}
|
|
91001
|
-
if (kind === 'prio-medium') return
|
|
91259
|
+
};
|
|
91260
|
+
if (kind === 'prio-medium') return {
|
|
91261
|
+
...base,
|
|
91002
91262
|
background: isDark ? 'rgba(99,102,241,0.20)' : '#eef2ff',
|
|
91003
91263
|
color: isDark ? '#c7d2fe' : '#4f46e5',
|
|
91004
91264
|
border: '1px solid transparent'
|
|
91005
|
-
}
|
|
91265
|
+
};
|
|
91006
91266
|
if (kind === 'prio-low') return base;
|
|
91007
91267
|
return base;
|
|
91008
91268
|
}
|
|
@@ -91044,10 +91304,7 @@
|
|
|
91044
91304
|
"९": "9"
|
|
91045
91305
|
};
|
|
91046
91306
|
function normalizeDigits(s) {
|
|
91047
|
-
return s.replace(/[०-९]/g, d =>
|
|
91048
|
-
var _DEV_DIGIT_MAP$d;
|
|
91049
|
-
return (_DEV_DIGIT_MAP$d = DEV_DIGIT_MAP[d]) !== null && _DEV_DIGIT_MAP$d !== void 0 ? _DEV_DIGIT_MAP$d : d;
|
|
91050
|
-
});
|
|
91307
|
+
return s.replace(/[०-९]/g, d => DEV_DIGIT_MAP[d] ?? d);
|
|
91051
91308
|
}
|
|
91052
91309
|
function parseIndicesInside(inner) {
|
|
91053
91310
|
const out = [];
|
|
@@ -91071,8 +91328,19 @@
|
|
|
91071
91328
|
}
|
|
91072
91329
|
return out;
|
|
91073
91330
|
}
|
|
91331
|
+
|
|
91332
|
+
// Place the sentence-ending mark BEFORE the citation cluster, not after it.
|
|
91333
|
+
// Models emit "... menu [1] ." (marker before the full stop), which renders as
|
|
91334
|
+
// "... menu [pill] ." Reorder to "... menu. [pill]". Only sentence-enders
|
|
91335
|
+
// (. ! ?) move - never commas/colons - and the digit-required brackets leave
|
|
91336
|
+
// Markdown links `[label](url)` untouched.
|
|
91337
|
+
const CITE_PUNCT_RE = /(\s*)((?:\[[\d०-९][\d०-९\s,]*\](?!\()\s*)+)([.!?])/g;
|
|
91338
|
+
function reorderCitationPunctuation(text) {
|
|
91339
|
+
return text.replace(CITE_PUNCT_RE, (_all, _lead, cluster, punct) => punct + " " + cluster.replace(/\s+$/, ""));
|
|
91340
|
+
}
|
|
91074
91341
|
function parseCitationClusters(text) {
|
|
91075
91342
|
if (!text) return [];
|
|
91343
|
+
text = reorderCitationPunctuation(text);
|
|
91076
91344
|
const markers = [];
|
|
91077
91345
|
MARKER_RE.lastIndex = 0;
|
|
91078
91346
|
let m;
|
|
@@ -91244,7 +91512,7 @@
|
|
|
91244
91512
|
if (!name) return "";
|
|
91245
91513
|
try {
|
|
91246
91514
|
return decodeURIComponent(String(name));
|
|
91247
|
-
} catch
|
|
91515
|
+
} catch {
|
|
91248
91516
|
return String(name);
|
|
91249
91517
|
}
|
|
91250
91518
|
}
|
|
@@ -91255,15 +91523,14 @@
|
|
|
91255
91523
|
return src_type === "file" || typeof url === "string" && url.includes("/api/v1/sharepoint/file/") || !!s.source_id && !url;
|
|
91256
91524
|
}
|
|
91257
91525
|
function displayLabel(s, fallbackIndex) {
|
|
91258
|
-
return decodeName(s.source_name) || s.url || s.source_type ||
|
|
91526
|
+
return decodeName(s.source_name) || s.url || s.source_type || `Source ${fallbackIndex}`;
|
|
91259
91527
|
}
|
|
91260
91528
|
function pillKey(s) {
|
|
91261
91529
|
return s.url || s.source_id || s.sourceid || s.source_name || "";
|
|
91262
91530
|
}
|
|
91263
|
-
function CitationPill(
|
|
91264
|
-
|
|
91265
|
-
|
|
91266
|
-
} = _ref;
|
|
91531
|
+
function CitationPill({
|
|
91532
|
+
indices
|
|
91533
|
+
}) {
|
|
91267
91534
|
const ctx = React.useContext(WidgetCitationContext);
|
|
91268
91535
|
const anchorRef = React.useRef(null);
|
|
91269
91536
|
// 2026-07-14 - popover is portaled to document.body, not inside
|
|
@@ -91294,16 +91561,15 @@
|
|
|
91294
91561
|
const out = [];
|
|
91295
91562
|
const seen = new Set();
|
|
91296
91563
|
for (const n of indices) {
|
|
91297
|
-
|
|
91298
|
-
const
|
|
91299
|
-
const src = byCitationIndex !== null && byCitationIndex !== void 0 ? byCitationIndex : ctx.sources[n - 1];
|
|
91564
|
+
const byCitationIndex = ctx.sources.find(s => Array.isArray(s?.citation_indices) && s.citation_indices.includes(n));
|
|
91565
|
+
const src = byCitationIndex ?? ctx.sources[n - 1];
|
|
91300
91566
|
if (!src) continue;
|
|
91301
91567
|
// 2026-07-15 - prioritise URL (unique per web page) over
|
|
91302
91568
|
// sourceid (shared across every page of the same Knowledge row).
|
|
91303
91569
|
// Website-connector sources emit distinct URLs for distinct
|
|
91304
91570
|
// pages but a single Knowledge row id - dedupping on sourceid
|
|
91305
91571
|
// first collapsed them to one row in the popover.
|
|
91306
|
-
const key = String(
|
|
91572
|
+
const key = String(src.url ?? src.source_id ?? src.sourceid ?? src.source_name ?? "").toLowerCase();
|
|
91307
91573
|
if (key && seen.has(key)) continue;
|
|
91308
91574
|
if (key) seen.add(key);
|
|
91309
91575
|
out.push({
|
|
@@ -91382,14 +91648,12 @@
|
|
|
91382
91648
|
const wasOpenRef = React.useRef(false);
|
|
91383
91649
|
React.useEffect(() => {
|
|
91384
91650
|
if (open) {
|
|
91385
|
-
var _popoverRef$current;
|
|
91386
91651
|
wasOpenRef.current = true;
|
|
91387
|
-
const firstFocusable =
|
|
91388
|
-
firstFocusable
|
|
91652
|
+
const firstFocusable = popoverRef.current?.querySelector('a[href], button:not([disabled])');
|
|
91653
|
+
firstFocusable?.focus();
|
|
91389
91654
|
} else if (wasOpenRef.current) {
|
|
91390
|
-
var _anchorRef$current;
|
|
91391
91655
|
wasOpenRef.current = false;
|
|
91392
|
-
|
|
91656
|
+
anchorRef.current?.focus();
|
|
91393
91657
|
}
|
|
91394
91658
|
}, [open]);
|
|
91395
91659
|
|
|
@@ -91457,8 +91721,8 @@
|
|
|
91457
91721
|
role: "button",
|
|
91458
91722
|
tabIndex: 0,
|
|
91459
91723
|
dir: "ltr",
|
|
91460
|
-
title: firstLabel + (extraCount ?
|
|
91461
|
-
"aria-label": firstLabel + (extraCount ?
|
|
91724
|
+
title: firstLabel + (extraCount ? ` (+${extraCount} more)` : ""),
|
|
91725
|
+
"aria-label": firstLabel + (extraCount ? ` (+${extraCount} more)` : ""),
|
|
91462
91726
|
onClick: onPillClick,
|
|
91463
91727
|
onKeyDown: e => {
|
|
91464
91728
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -91484,9 +91748,9 @@
|
|
|
91484
91748
|
fontSize: 11,
|
|
91485
91749
|
lineHeight: 1,
|
|
91486
91750
|
borderRadius: 5,
|
|
91487
|
-
background: ctx
|
|
91488
|
-
color:
|
|
91489
|
-
border: ctx
|
|
91751
|
+
background: ctx?.textColor ? "rgba(128,128,128,0.08)" : "rgba(59, 130, 246, 0.10)",
|
|
91752
|
+
color: ctx?.textColor || "rgb(37, 99, 235)",
|
|
91753
|
+
border: ctx?.textColor ? `0.5px solid ${ctx.textColor}` : "0.5px solid rgba(59, 130, 246, 0.35)",
|
|
91490
91754
|
cursor: "pointer",
|
|
91491
91755
|
userSelect: "none",
|
|
91492
91756
|
maxWidth: 180,
|
|
@@ -91520,9 +91784,9 @@
|
|
|
91520
91784
|
children: firstLabel
|
|
91521
91785
|
}), extraCount > 0 && /*#__PURE__*/jsxRuntimeExports.jsxs("span", {
|
|
91522
91786
|
style: {
|
|
91523
|
-
background: ctx
|
|
91524
|
-
color:
|
|
91525
|
-
border: ctx
|
|
91787
|
+
background: ctx?.textColor ? "transparent" : "rgb(37, 99, 235)",
|
|
91788
|
+
color: ctx?.textColor || "white",
|
|
91789
|
+
border: ctx?.textColor ? `1px solid ${ctx.textColor}` : "none",
|
|
91526
91790
|
borderRadius: 3,
|
|
91527
91791
|
padding: "1px 4px",
|
|
91528
91792
|
fontSize: 9,
|
|
@@ -91538,7 +91802,7 @@
|
|
|
91538
91802
|
justifyContent: "center",
|
|
91539
91803
|
flexShrink: 0,
|
|
91540
91804
|
paddingLeft: 3,
|
|
91541
|
-
borderLeft: ctx
|
|
91805
|
+
borderLeft: ctx?.textColor ? `0.5px solid ${ctx.textColor}` : "0.5px solid rgba(59, 130, 246, 0.35)",
|
|
91542
91806
|
marginLeft: 2
|
|
91543
91807
|
},
|
|
91544
91808
|
children: busy ? /*#__PURE__*/jsxRuntimeExports.jsx(LoaderCircle, {
|
|
@@ -91557,7 +91821,7 @@
|
|
|
91557
91821
|
ref: popoverRef,
|
|
91558
91822
|
role: "dialog",
|
|
91559
91823
|
dir: "ltr",
|
|
91560
|
-
"aria-label":
|
|
91824
|
+
"aria-label": `${referenced.length} sources cited`,
|
|
91561
91825
|
style: {
|
|
91562
91826
|
position: "absolute",
|
|
91563
91827
|
top: pos.top,
|
|
@@ -91588,11 +91852,10 @@
|
|
|
91588
91852
|
padding: "4px 6px 6px"
|
|
91589
91853
|
},
|
|
91590
91854
|
children: [referenced.length, " source", referenced.length === 1 ? "" : "s"]
|
|
91591
|
-
}), referenced.map(
|
|
91592
|
-
|
|
91593
|
-
|
|
91594
|
-
|
|
91595
|
-
} = _ref5;
|
|
91855
|
+
}), referenced.map(({
|
|
91856
|
+
src,
|
|
91857
|
+
index
|
|
91858
|
+
}) => {
|
|
91596
91859
|
const label = displayLabel(src, index);
|
|
91597
91860
|
const rowIsFile = isFileLikeSource(src);
|
|
91598
91861
|
const kBusy = ctx.downloadingKey && ctx.downloadingKey === pillKey(src);
|
|
@@ -91663,27 +91926,21 @@
|
|
|
91663
91926
|
strokeWidth: 2
|
|
91664
91927
|
})
|
|
91665
91928
|
})]
|
|
91666
|
-
},
|
|
91929
|
+
}, `${index}-${pillKey(src) || index}`);
|
|
91667
91930
|
})]
|
|
91668
91931
|
}), document.body)]
|
|
91669
91932
|
});
|
|
91670
91933
|
}
|
|
91671
91934
|
|
|
91672
|
-
|
|
91673
|
-
|
|
91674
|
-
|
|
91675
|
-
|
|
91676
|
-
|
|
91677
|
-
|
|
91678
|
-
|
|
91679
|
-
|
|
91680
|
-
|
|
91681
|
-
_excluded0 = ["node", "children"],
|
|
91682
|
-
_excluded1 = ["node", "children"],
|
|
91683
|
-
_excluded10 = ["node", "children"],
|
|
91684
|
-
_excluded11 = ["node", "children"],
|
|
91685
|
-
_excluded12 = ["node", "children"],
|
|
91686
|
-
_excluded13 = ["className", "children"];
|
|
91935
|
+
// Heavy markdown rendering path - split out of MessageBubble.jsx so the
|
|
91936
|
+
// ~1MB react-markdown + Prism syntax-highlighter payload is only pulled in
|
|
91937
|
+
// (via a dynamic import / React.lazy from MessageBubble) when a message
|
|
91938
|
+
// actually contains markdown or a code block. Plain-text messages - the
|
|
91939
|
+
// common case - render without ever loading these modules. (EV-2023)
|
|
91940
|
+
//
|
|
91941
|
+
// Behaviour for messages that DO have markdown/code is identical to the
|
|
91942
|
+
// previous inline implementation; this file is a straight lift of the
|
|
91943
|
+
// ReactMarkdown block and its helpers.
|
|
91687
91944
|
const A2UI_FENCE_LANGS = new Set(["eshal-ui", "eshal-chart", "chart"]);
|
|
91688
91945
|
|
|
91689
91946
|
// Returns true when a ReactMarkdown `pre` node's only child is a `code` block
|
|
@@ -91693,9 +91950,8 @@
|
|
|
91693
91950
|
function preWrapsKnownFence(children) {
|
|
91694
91951
|
const items = React.Children.toArray(children);
|
|
91695
91952
|
return items.some(c => {
|
|
91696
|
-
var _c$props;
|
|
91697
91953
|
if (! /*#__PURE__*/React.isValidElement(c)) return false;
|
|
91698
|
-
const cls =
|
|
91954
|
+
const cls = c.props?.className;
|
|
91699
91955
|
if (typeof cls !== "string") return false;
|
|
91700
91956
|
const m = cls.match(/language-([\w-]+)/);
|
|
91701
91957
|
return !!m && A2UI_FENCE_LANGS.has(m[1]);
|
|
@@ -91769,18 +92025,17 @@
|
|
|
91769
92025
|
// the ReactMarkdown tree - the outer wrapper <div> and the streaming cursor
|
|
91770
92026
|
// stay in StreamingMarkdown so the animation runs regardless of whether the
|
|
91771
92027
|
// markdown module has finished loading.
|
|
91772
|
-
function MarkdownRenderer(
|
|
91773
|
-
|
|
91774
|
-
|
|
91775
|
-
|
|
91776
|
-
|
|
91777
|
-
|
|
91778
|
-
|
|
91779
|
-
|
|
91780
|
-
|
|
91781
|
-
|
|
91782
|
-
|
|
91783
|
-
} = _ref;
|
|
92028
|
+
function MarkdownRenderer({
|
|
92029
|
+
content,
|
|
92030
|
+
isStreaming,
|
|
92031
|
+
isDark = false,
|
|
92032
|
+
isRtl = false,
|
|
92033
|
+
textColor,
|
|
92034
|
+
fontFamily,
|
|
92035
|
+
fontSize,
|
|
92036
|
+
onButtonClick,
|
|
92037
|
+
provideCitations = true
|
|
92038
|
+
}) {
|
|
91784
92039
|
return /*#__PURE__*/jsxRuntimeExports.jsx(Markdown, {
|
|
91785
92040
|
className: "max-w-none [&>*:last-child]:!mb-0 [&>*:first-child]:!mt-0"
|
|
91786
92041
|
// remarkBreaks turns single `\n` line breaks into <br> instead of a
|
|
@@ -91797,14 +92052,12 @@
|
|
|
91797
92052
|
// Citation-marker → pill swap. Every `<span>` normally passes
|
|
91798
92053
|
// through unchanged; when the HAST plugin has tagged it as a
|
|
91799
92054
|
// citation, swap for `<CitationPill>`.
|
|
91800
|
-
span(
|
|
91801
|
-
|
|
91802
|
-
|
|
91803
|
-
|
|
91804
|
-
|
|
91805
|
-
|
|
91806
|
-
props = _objectWithoutProperties$m(_ref2, _excluded);
|
|
91807
|
-
const attr = (_props$dataEshalCit = props["data-eshal-citation"]) !== null && _props$dataEshalCit !== void 0 ? _props$dataEshalCit : props.dataEshalCitation;
|
|
92055
|
+
span({
|
|
92056
|
+
node,
|
|
92057
|
+
children,
|
|
92058
|
+
...props
|
|
92059
|
+
}) {
|
|
92060
|
+
const attr = props["data-eshal-citation"] ?? props.dataEshalCitation;
|
|
91808
92061
|
if (typeof attr === "string" && attr.length > 0) {
|
|
91809
92062
|
const indices = parseCitationIndicesFromAttr(attr);
|
|
91810
92063
|
if (indices.length > 0) {
|
|
@@ -91813,33 +92066,33 @@
|
|
|
91813
92066
|
});
|
|
91814
92067
|
}
|
|
91815
92068
|
}
|
|
91816
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx("span",
|
|
92069
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("span", {
|
|
92070
|
+
...props,
|
|
91817
92071
|
children: children
|
|
91818
|
-
})
|
|
92072
|
+
});
|
|
91819
92073
|
},
|
|
91820
92074
|
// Unwrap the <pre> shell when its child is an A2UI fence so the
|
|
91821
92075
|
// chart card sits directly in the bubble flow, not inside a <pre>
|
|
91822
92076
|
// (which forces monospace font and defeats the card border-radius).
|
|
91823
92077
|
// Ordinary code blocks (```python```, ```sql```) keep their <pre>.
|
|
91824
|
-
pre(
|
|
91825
|
-
|
|
91826
|
-
|
|
91827
|
-
|
|
91828
|
-
props = _objectWithoutProperties$m(_ref3, _excluded2);
|
|
92078
|
+
pre({
|
|
92079
|
+
children,
|
|
92080
|
+
...props
|
|
92081
|
+
}) {
|
|
91829
92082
|
if (preWrapsKnownFence(children)) return /*#__PURE__*/jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
|
|
91830
92083
|
children: children
|
|
91831
92084
|
});
|
|
91832
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx("pre",
|
|
92085
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("pre", {
|
|
92086
|
+
...props,
|
|
91833
92087
|
children: children
|
|
91834
|
-
})
|
|
92088
|
+
});
|
|
91835
92089
|
},
|
|
91836
|
-
a(
|
|
91837
|
-
|
|
91838
|
-
|
|
91839
|
-
|
|
91840
|
-
|
|
91841
|
-
|
|
91842
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx("a", _objectSpread2(_objectSpread2({
|
|
92090
|
+
a({
|
|
92091
|
+
node,
|
|
92092
|
+
children,
|
|
92093
|
+
...props
|
|
92094
|
+
}) {
|
|
92095
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("a", {
|
|
91843
92096
|
className: "underline hover:opacity-80",
|
|
91844
92097
|
dir: "ltr",
|
|
91845
92098
|
style: {
|
|
@@ -91847,20 +92100,18 @@
|
|
|
91847
92100
|
unicodeBidi: "isolate"
|
|
91848
92101
|
},
|
|
91849
92102
|
target: "_blank",
|
|
91850
|
-
rel: "noopener noreferrer"
|
|
91851
|
-
|
|
92103
|
+
rel: "noopener noreferrer",
|
|
92104
|
+
...props,
|
|
91852
92105
|
children: children
|
|
91853
|
-
})
|
|
92106
|
+
});
|
|
91854
92107
|
},
|
|
91855
|
-
p(
|
|
91856
|
-
|
|
91857
|
-
|
|
91858
|
-
|
|
91859
|
-
|
|
91860
|
-
|
|
91861
|
-
|
|
91862
|
-
const isInsideListItem = (node === null || node === void 0 || (_node$parent = node.parent) === null || _node$parent === void 0 ? void 0 : _node$parent.tagName) === "li";
|
|
91863
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx("p", _objectSpread2(_objectSpread2({
|
|
92108
|
+
p({
|
|
92109
|
+
node,
|
|
92110
|
+
children,
|
|
92111
|
+
...props
|
|
92112
|
+
}) {
|
|
92113
|
+
const isInsideListItem = node?.parent?.tagName === "li";
|
|
92114
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("p", {
|
|
91864
92115
|
className: "leading-relaxed [&:first-child]:!mt-0",
|
|
91865
92116
|
style: {
|
|
91866
92117
|
color: textColor || (isDark ? "#f3f4f6" : "#1A1A1A"),
|
|
@@ -91875,35 +92126,33 @@
|
|
|
91875
92126
|
marginBottom: isInsideListItem ? "0.125rem" : "0.85rem",
|
|
91876
92127
|
lineHeight: "1.6",
|
|
91877
92128
|
padding: 0
|
|
91878
|
-
}
|
|
91879
|
-
|
|
92129
|
+
},
|
|
92130
|
+
...props,
|
|
91880
92131
|
children: children
|
|
91881
|
-
})
|
|
92132
|
+
});
|
|
91882
92133
|
},
|
|
91883
|
-
ul(
|
|
91884
|
-
|
|
91885
|
-
|
|
91886
|
-
|
|
91887
|
-
|
|
91888
|
-
|
|
91889
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx("ul", _objectSpread2(_objectSpread2({
|
|
92134
|
+
ul({
|
|
92135
|
+
node,
|
|
92136
|
+
children,
|
|
92137
|
+
...props
|
|
92138
|
+
}) {
|
|
92139
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("ul", {
|
|
91890
92140
|
className: "list-disc [&:first-child]:!mt-0",
|
|
91891
92141
|
style: {
|
|
91892
92142
|
marginTop: 0,
|
|
91893
92143
|
marginBottom: "0.6rem",
|
|
91894
92144
|
paddingInlineStart: "1.2rem"
|
|
91895
|
-
}
|
|
91896
|
-
|
|
92145
|
+
},
|
|
92146
|
+
...props,
|
|
91897
92147
|
children: children
|
|
91898
|
-
})
|
|
92148
|
+
});
|
|
91899
92149
|
},
|
|
91900
|
-
ol(
|
|
91901
|
-
|
|
91902
|
-
|
|
91903
|
-
|
|
91904
|
-
|
|
91905
|
-
|
|
91906
|
-
props = _objectWithoutProperties$m(_ref7, _excluded6);
|
|
92150
|
+
ol({
|
|
92151
|
+
node,
|
|
92152
|
+
children,
|
|
92153
|
+
start = 1,
|
|
92154
|
+
...props
|
|
92155
|
+
}) {
|
|
91907
92156
|
// Why we DON'T use `list-decimal` here:
|
|
91908
92157
|
//
|
|
91909
92158
|
// `list-decimal` renders the "1.", "2.", … markers via
|
|
@@ -91928,15 +92177,15 @@
|
|
|
91928
92177
|
// 8. instead of 1., 2., 3., 4.). Caught by the
|
|
91929
92178
|
// chat-preview MarkdownRenderer test 2026-05-19.
|
|
91930
92179
|
let liCounter = 0;
|
|
91931
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx("ol",
|
|
92180
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("ol", {
|
|
91932
92181
|
className: "[&:first-child]:!mt-0",
|
|
91933
92182
|
style: {
|
|
91934
92183
|
listStyle: "none",
|
|
91935
92184
|
marginTop: 0,
|
|
91936
92185
|
marginBottom: "0.6rem",
|
|
91937
92186
|
paddingInlineStart: 0
|
|
91938
|
-
}
|
|
91939
|
-
|
|
92187
|
+
},
|
|
92188
|
+
...props,
|
|
91940
92189
|
children: React.Children.map(children, child => {
|
|
91941
92190
|
if (! /*#__PURE__*/React.isValidElement(child)) return child;
|
|
91942
92191
|
const idx = startIndex + liCounter;
|
|
@@ -91945,15 +92194,14 @@
|
|
|
91945
92194
|
"data-ol-index": idx
|
|
91946
92195
|
});
|
|
91947
92196
|
})
|
|
91948
|
-
})
|
|
92197
|
+
});
|
|
91949
92198
|
},
|
|
91950
|
-
li(
|
|
91951
|
-
|
|
91952
|
-
|
|
91953
|
-
|
|
91954
|
-
|
|
91955
|
-
|
|
91956
|
-
props = _objectWithoutProperties$m(_ref8, _excluded7);
|
|
92199
|
+
li({
|
|
92200
|
+
node,
|
|
92201
|
+
children,
|
|
92202
|
+
"data-ol-index": dataOlIndex,
|
|
92203
|
+
...props
|
|
92204
|
+
}) {
|
|
91957
92205
|
// Inline-marker rendering (see <ol> comment above for the
|
|
91958
92206
|
// ::marker font bug this works around). When `dataOlIndex`
|
|
91959
92207
|
// is present, we're inside a custom-numbered <ol>; render
|
|
@@ -91968,14 +92216,15 @@
|
|
|
91968
92216
|
lineHeight: "1.5"
|
|
91969
92217
|
};
|
|
91970
92218
|
if (dataOlIndex != null) {
|
|
91971
|
-
return /*#__PURE__*/jsxRuntimeExports.jsxs("li",
|
|
91972
|
-
style:
|
|
92219
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs("li", {
|
|
92220
|
+
style: {
|
|
92221
|
+
...baseLiStyle,
|
|
91973
92222
|
listStyle: "none",
|
|
91974
92223
|
display: "flex",
|
|
91975
92224
|
alignItems: "baseline",
|
|
91976
92225
|
gap: "0.4em"
|
|
91977
|
-
}
|
|
91978
|
-
|
|
92226
|
+
},
|
|
92227
|
+
...props,
|
|
91979
92228
|
children: [/*#__PURE__*/jsxRuntimeExports.jsxs("span", {
|
|
91980
92229
|
style: {
|
|
91981
92230
|
flexShrink: 0,
|
|
@@ -91997,22 +92246,21 @@
|
|
|
91997
92246
|
},
|
|
91998
92247
|
children: children
|
|
91999
92248
|
})]
|
|
92000
|
-
})
|
|
92249
|
+
});
|
|
92001
92250
|
}
|
|
92002
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx("li",
|
|
92251
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("li", {
|
|
92003
92252
|
className: "",
|
|
92004
|
-
style: baseLiStyle
|
|
92005
|
-
|
|
92253
|
+
style: baseLiStyle,
|
|
92254
|
+
...props,
|
|
92006
92255
|
children: children
|
|
92007
|
-
})
|
|
92256
|
+
});
|
|
92008
92257
|
},
|
|
92009
|
-
h1(
|
|
92010
|
-
|
|
92011
|
-
|
|
92012
|
-
|
|
92013
|
-
|
|
92014
|
-
|
|
92015
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx("h1", _objectSpread2(_objectSpread2({
|
|
92258
|
+
h1({
|
|
92259
|
+
node,
|
|
92260
|
+
children,
|
|
92261
|
+
...props
|
|
92262
|
+
}) {
|
|
92263
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("h1", {
|
|
92016
92264
|
className: "text-xl font-bold [&:first-child]:!mt-0",
|
|
92017
92265
|
style: {
|
|
92018
92266
|
color: textColor || (isDark ? "#f3f4f6" : "#1A1A1A"),
|
|
@@ -92020,18 +92268,17 @@
|
|
|
92020
92268
|
marginTop: "0.7rem",
|
|
92021
92269
|
marginBottom: "0.45rem",
|
|
92022
92270
|
lineHeight: "1.35"
|
|
92023
|
-
}
|
|
92024
|
-
|
|
92271
|
+
},
|
|
92272
|
+
...props,
|
|
92025
92273
|
children: children
|
|
92026
|
-
})
|
|
92274
|
+
});
|
|
92027
92275
|
},
|
|
92028
|
-
h2(
|
|
92029
|
-
|
|
92030
|
-
|
|
92031
|
-
|
|
92032
|
-
|
|
92033
|
-
|
|
92034
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx("h2", _objectSpread2(_objectSpread2({
|
|
92276
|
+
h2({
|
|
92277
|
+
node,
|
|
92278
|
+
children,
|
|
92279
|
+
...props
|
|
92280
|
+
}) {
|
|
92281
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("h2", {
|
|
92035
92282
|
className: "text-lg font-semibold [&:first-child]:!mt-0",
|
|
92036
92283
|
style: {
|
|
92037
92284
|
color: textColor || (isDark ? "#f3f4f6" : "#1A1A1A"),
|
|
@@ -92039,18 +92286,17 @@
|
|
|
92039
92286
|
marginTop: "0.65rem",
|
|
92040
92287
|
marginBottom: "0.4rem",
|
|
92041
92288
|
lineHeight: "1.35"
|
|
92042
|
-
}
|
|
92043
|
-
|
|
92289
|
+
},
|
|
92290
|
+
...props,
|
|
92044
92291
|
children: children
|
|
92045
|
-
})
|
|
92292
|
+
});
|
|
92046
92293
|
},
|
|
92047
|
-
h3(
|
|
92048
|
-
|
|
92049
|
-
|
|
92050
|
-
|
|
92051
|
-
|
|
92052
|
-
|
|
92053
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx("h3", _objectSpread2(_objectSpread2({
|
|
92294
|
+
h3({
|
|
92295
|
+
node,
|
|
92296
|
+
children,
|
|
92297
|
+
...props
|
|
92298
|
+
}) {
|
|
92299
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("h3", {
|
|
92054
92300
|
className: "text-base font-semibold [&:first-child]:!mt-0",
|
|
92055
92301
|
style: {
|
|
92056
92302
|
color: textColor || (isDark ? "#f3f4f6" : "#1A1A1A"),
|
|
@@ -92058,38 +92304,34 @@
|
|
|
92058
92304
|
marginTop: "0.6rem",
|
|
92059
92305
|
marginBottom: "0.35rem",
|
|
92060
92306
|
lineHeight: "1.35"
|
|
92061
|
-
}
|
|
92062
|
-
|
|
92307
|
+
},
|
|
92308
|
+
...props,
|
|
92063
92309
|
children: children
|
|
92064
|
-
})
|
|
92310
|
+
});
|
|
92065
92311
|
},
|
|
92066
|
-
blockquote(
|
|
92067
|
-
|
|
92068
|
-
|
|
92069
|
-
|
|
92070
|
-
|
|
92071
|
-
|
|
92072
|
-
|
|
92073
|
-
|
|
92074
|
-
}, props), {}, {
|
|
92312
|
+
blockquote({
|
|
92313
|
+
node,
|
|
92314
|
+
children,
|
|
92315
|
+
...props
|
|
92316
|
+
}) {
|
|
92317
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("blockquote", {
|
|
92318
|
+
className: `border-l-4 pl-4 italic ${isDark ? "border-gray-600 text-gray-300" : "border-gray-300 text-gray-700"}`,
|
|
92319
|
+
...props,
|
|
92075
92320
|
children: children
|
|
92076
|
-
})
|
|
92321
|
+
});
|
|
92077
92322
|
},
|
|
92078
|
-
table(
|
|
92079
|
-
|
|
92080
|
-
|
|
92081
|
-
|
|
92082
|
-
|
|
92083
|
-
} = _ref11,
|
|
92084
|
-
props = _objectWithoutProperties$m(_ref11, _excluded10);
|
|
92323
|
+
table({
|
|
92324
|
+
node,
|
|
92325
|
+
children,
|
|
92326
|
+
...props
|
|
92327
|
+
}) {
|
|
92085
92328
|
// react-markdown v9 passes HAST nodes (not MDAST), so the
|
|
92086
92329
|
// table's children are <thead> / <tbody> elements, not
|
|
92087
92330
|
// tableRow nodes. Traverse accordingly to extract columns
|
|
92088
92331
|
// and rows, then render as A2UI Table component - mirrors
|
|
92089
92332
|
// how chartMarkdownComponents handles eshal-ui fences in the
|
|
92090
92333
|
// agent-sdk / frontend.
|
|
92091
|
-
if (
|
|
92092
|
-
var _thead$children;
|
|
92334
|
+
if (node?.children?.length > 0) {
|
|
92093
92335
|
function getText(n) {
|
|
92094
92336
|
if (!n) return '';
|
|
92095
92337
|
if (typeof n.value === 'string') return n.value;
|
|
@@ -92098,17 +92340,14 @@
|
|
|
92098
92340
|
}
|
|
92099
92341
|
const thead = node.children.find(c => c.tagName === 'thead');
|
|
92100
92342
|
const tbody = node.children.find(c => c.tagName === 'tbody');
|
|
92101
|
-
const headerTr = thead
|
|
92102
|
-
const columns = (
|
|
92103
|
-
const bodyTrs = (
|
|
92343
|
+
const headerTr = thead?.children?.find(c => c.tagName === 'tr');
|
|
92344
|
+
const columns = (headerTr?.children || []).filter(c => c.tagName === 'th').map(cell => getText(cell));
|
|
92345
|
+
const bodyTrs = (tbody?.children || []).filter(c => c.tagName === 'tr');
|
|
92104
92346
|
const rows = bodyTrs.map(tr => (tr.children || []).filter(c => c.tagName === 'td').map(cell => getText(cell)));
|
|
92105
92347
|
if (columns.length > 0 && rows.length > 0) {
|
|
92106
92348
|
// A2uiBlock's Table renders via row[colName] lookups, so
|
|
92107
92349
|
// convert array-of-arrays to array-of-objects keyed by column.
|
|
92108
|
-
const data = rows.map(row => Object.fromEntries(columns.map((col, i) =>
|
|
92109
|
-
var _row$i;
|
|
92110
|
-
return [col, (_row$i = row[i]) !== null && _row$i !== void 0 ? _row$i : ''];
|
|
92111
|
-
})));
|
|
92350
|
+
const data = rows.map(row => Object.fromEntries(columns.map((col, i) => [col, row[i] ?? ''])));
|
|
92112
92351
|
return /*#__PURE__*/jsxRuntimeExports.jsx(A2uiBlock, {
|
|
92113
92352
|
spec: {
|
|
92114
92353
|
type: 'table',
|
|
@@ -92127,44 +92366,41 @@
|
|
|
92127
92366
|
// this bundle doesn't configure) to match every other themed
|
|
92128
92367
|
// element in this file.
|
|
92129
92368
|
return /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
92130
|
-
className:
|
|
92131
|
-
children: /*#__PURE__*/jsxRuntimeExports.jsx("table",
|
|
92132
|
-
className:
|
|
92133
|
-
|
|
92369
|
+
className: `overflow-x-auto my-3 rounded-lg border ${isDark ? "border-gray-700 bg-gray-900" : "border-gray-200 bg-white"}`,
|
|
92370
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx("table", {
|
|
92371
|
+
className: `min-w-full border-collapse ${isDark ? "text-gray-100" : "text-gray-900"}`,
|
|
92372
|
+
...props,
|
|
92134
92373
|
children: children
|
|
92135
|
-
})
|
|
92374
|
+
})
|
|
92136
92375
|
});
|
|
92137
92376
|
},
|
|
92138
|
-
th(
|
|
92139
|
-
|
|
92140
|
-
|
|
92141
|
-
|
|
92142
|
-
|
|
92143
|
-
|
|
92144
|
-
|
|
92145
|
-
|
|
92146
|
-
}, props), {}, {
|
|
92377
|
+
th({
|
|
92378
|
+
node,
|
|
92379
|
+
children,
|
|
92380
|
+
...props
|
|
92381
|
+
}) {
|
|
92382
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("th", {
|
|
92383
|
+
className: `border px-3 py-2 text-left font-medium ${isDark ? "border-gray-700 bg-gray-800/50 text-gray-300" : "border-gray-200 bg-gray-50 text-gray-700"}`,
|
|
92384
|
+
...props,
|
|
92147
92385
|
children: children
|
|
92148
|
-
})
|
|
92386
|
+
});
|
|
92149
92387
|
},
|
|
92150
|
-
td(
|
|
92151
|
-
|
|
92152
|
-
|
|
92153
|
-
|
|
92154
|
-
|
|
92155
|
-
|
|
92156
|
-
|
|
92157
|
-
|
|
92158
|
-
}, props), {}, {
|
|
92388
|
+
td({
|
|
92389
|
+
node,
|
|
92390
|
+
children,
|
|
92391
|
+
...props
|
|
92392
|
+
}) {
|
|
92393
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("td", {
|
|
92394
|
+
className: `border px-3 py-2 ${isDark ? "border-gray-700" : "border-gray-200"}`,
|
|
92395
|
+
...props,
|
|
92159
92396
|
children: children
|
|
92160
|
-
})
|
|
92397
|
+
});
|
|
92161
92398
|
},
|
|
92162
|
-
code(
|
|
92163
|
-
|
|
92164
|
-
|
|
92165
|
-
|
|
92166
|
-
|
|
92167
|
-
props = _objectWithoutProperties$m(_ref14, _excluded13);
|
|
92399
|
+
code({
|
|
92400
|
+
className,
|
|
92401
|
+
children,
|
|
92402
|
+
...props
|
|
92403
|
+
}) {
|
|
92168
92404
|
const match = /language-([\w-]+)/.exec(className || "");
|
|
92169
92405
|
const lang = match ? match[1] : null;
|
|
92170
92406
|
|
|
@@ -92195,20 +92431,20 @@
|
|
|
92195
92431
|
return null;
|
|
92196
92432
|
}
|
|
92197
92433
|
if (match) {
|
|
92198
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx(highlighter,
|
|
92434
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(highlighter, {
|
|
92199
92435
|
style: oneDark,
|
|
92200
92436
|
language: lang,
|
|
92201
92437
|
PreTag: "div",
|
|
92202
|
-
wrapLines: true
|
|
92203
|
-
|
|
92438
|
+
wrapLines: true,
|
|
92439
|
+
...props,
|
|
92204
92440
|
children: String(children).replace(/\n$/, "")
|
|
92205
|
-
})
|
|
92441
|
+
});
|
|
92206
92442
|
}
|
|
92207
|
-
return /*#__PURE__*/jsxRuntimeExports.jsx("code",
|
|
92208
|
-
className: className
|
|
92209
|
-
|
|
92443
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("code", {
|
|
92444
|
+
className: className,
|
|
92445
|
+
...props,
|
|
92210
92446
|
children: children
|
|
92211
|
-
})
|
|
92447
|
+
});
|
|
92212
92448
|
}
|
|
92213
92449
|
},
|
|
92214
92450
|
children: sanitizeExcessDecimalPrecision(sanitizeStreamingContent(content, isStreaming))
|