@djangocfg/ui-tools 2.1.385 → 2.1.387

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +25 -11
  2. package/dist/ChatRoot-4KM2JMGA.mjs +6 -0
  3. package/dist/{ChatRoot-JVR3M3H2.mjs.map → ChatRoot-4KM2JMGA.mjs.map} +1 -1
  4. package/dist/ChatRoot-OILWMMZ6.cjs +15 -0
  5. package/dist/{ChatRoot-LXIUBOXF.cjs.map → ChatRoot-OILWMMZ6.cjs.map} +1 -1
  6. package/dist/MapContainer-AKIPABJK.mjs +4 -0
  7. package/dist/MapContainer-AKIPABJK.mjs.map +1 -0
  8. package/dist/MapContainer-STVDMC36.cjs +17 -0
  9. package/dist/MapContainer-STVDMC36.cjs.map +1 -0
  10. package/dist/{MapContainer-76YL2JXL.cjs → chunk-5D2OCOPQ.cjs} +3 -2
  11. package/dist/chunk-5D2OCOPQ.cjs.map +1 -0
  12. package/dist/{MapContainer-7HXBI3OH.mjs → chunk-7CWGZPO3.mjs} +3 -3
  13. package/dist/chunk-7CWGZPO3.mjs.map +1 -0
  14. package/dist/chunk-BVESQTBM.mjs +1439 -0
  15. package/dist/chunk-BVESQTBM.mjs.map +1 -0
  16. package/dist/{chunk-PEKBT75W.mjs → chunk-DMX7W4XZ.mjs} +53 -1387
  17. package/dist/chunk-DMX7W4XZ.mjs.map +1 -0
  18. package/dist/chunk-HNIMIIFR.mjs +1361 -0
  19. package/dist/chunk-HNIMIIFR.mjs.map +1 -0
  20. package/dist/chunk-L25HA3TM.cjs +1478 -0
  21. package/dist/chunk-L25HA3TM.cjs.map +1 -0
  22. package/dist/{chunk-HPK3EWBF.cjs → chunk-TBSHZO5R.cjs} +50 -1409
  23. package/dist/chunk-TBSHZO5R.cjs.map +1 -0
  24. package/dist/chunk-TSNRU3UO.cjs +1387 -0
  25. package/dist/chunk-TSNRU3UO.cjs.map +1 -0
  26. package/dist/index.cjs +1236 -1769
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +780 -780
  29. package/dist/index.d.ts +780 -780
  30. package/dist/index.mjs +853 -1424
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/launcher-5WYPDPEP.mjs +7 -0
  33. package/dist/launcher-5WYPDPEP.mjs.map +1 -0
  34. package/dist/launcher-FCI3LTDY.css +7 -0
  35. package/dist/launcher-FCI3LTDY.css.map +1 -0
  36. package/dist/launcher-QAOG2NUI.cjs +60 -0
  37. package/dist/launcher-QAOG2NUI.cjs.map +1 -0
  38. package/package.json +23 -18
  39. package/src/tools/AudioPlayer/lazy.tsx +100 -0
  40. package/src/tools/Chat/README.md +85 -1
  41. package/src/tools/Chat/context/ChatProvider.tsx +42 -0
  42. package/src/tools/Chat/lazy.tsx +213 -1
  43. package/src/tools/CodeEditor/lazy.tsx +70 -0
  44. package/src/tools/Map/lazy.tsx +38 -1
  45. package/src/tools/MarkdownEditor/lazy.tsx +42 -0
  46. package/src/tools/SpeechRecognition/README.md +48 -0
  47. package/dist/ChatRoot-JVR3M3H2.mjs +0 -5
  48. package/dist/ChatRoot-LXIUBOXF.cjs +0 -14
  49. package/dist/MapContainer-76YL2JXL.cjs.map +0 -1
  50. package/dist/MapContainer-7HXBI3OH.mjs.map +0 -1
  51. package/dist/chunk-HPK3EWBF.cjs.map +0 -1
  52. package/dist/chunk-PEKBT75W.mjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkADEN3UA4_cjs = require('./chunk-ADEN3UA4.cjs');
3
+ var chunkL25HA3TM_cjs = require('./chunk-L25HA3TM.cjs');
4
+ require('./chunk-ADEN3UA4.cjs');
4
5
  var chunkFEN5S772_cjs = require('./chunk-FEN5S772.cjs');
5
6
  var chunkQJ6GTUCO_cjs = require('./chunk-QJ6GTUCO.cjs');
6
7
  var chunkYDPDTOSP_cjs = require('./chunk-YDPDTOSP.cjs');
@@ -8,22 +9,25 @@ var chunkKNDLV4PI_cjs = require('./chunk-KNDLV4PI.cjs');
8
9
  var chunk5I5QNGUG_cjs = require('./chunk-5I5QNGUG.cjs');
9
10
  var chunkYW5IVWHQ_cjs = require('./chunk-YW5IVWHQ.cjs');
10
11
  var chunk76NNDZH6_cjs = require('./chunk-76NNDZH6.cjs');
11
- var chunkHPK3EWBF_cjs = require('./chunk-HPK3EWBF.cjs');
12
+ var chunkTSNRU3UO_cjs = require('./chunk-TSNRU3UO.cjs');
13
+ var chunkTBSHZO5R_cjs = require('./chunk-TBSHZO5R.cjs');
12
14
  var chunkYXZ6GU7H_cjs = require('./chunk-YXZ6GU7H.cjs');
13
15
  var chunkFVVF7VCD_cjs = require('./chunk-FVVF7VCD.cjs');
16
+ var chunk5D2OCOPQ_cjs = require('./chunk-5D2OCOPQ.cjs');
14
17
  var chunk7EYHNP3E_cjs = require('./chunk-7EYHNP3E.cjs');
15
18
  var chunkFIRK5CEH_cjs = require('./chunk-FIRK5CEH.cjs');
16
19
  var chunkT3MWM23F_cjs = require('./chunk-T3MWM23F.cjs');
17
20
  require('./chunk-FP2RLYQZ.cjs');
18
21
  var chunkOLISEQHS_cjs = require('./chunk-OLISEQHS.cjs');
19
- var React = require('react');
20
- var lib = require('@djangocfg/ui-core/lib');
21
- var i18n = require('@djangocfg/i18n');
22
+ var maplibre = require('react-map-gl/maplibre');
22
23
  var jsxRuntime = require('react/jsx-runtime');
23
- var lucideReact = require('lucide-react');
24
+ var react = require('react');
25
+ var reactDom = require('react-dom');
24
26
  var hooks = require('@djangocfg/ui-core/hooks');
27
+ var lucideReact = require('lucide-react');
25
28
  var components = require('@djangocfg/ui-core/components');
26
- var react = require('@tiptap/react');
29
+ var lib = require('@djangocfg/ui-core/lib');
30
+ var react$1 = require('@tiptap/react');
27
31
  var StarterKit = require('@tiptap/starter-kit');
28
32
  var Placeholder = require('@tiptap/extension-placeholder');
29
33
  var Mention = require('@tiptap/extension-mention');
@@ -33,212 +37,871 @@ var core = require('@tiptap/core');
33
37
 
34
38
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
35
39
 
36
- function _interopNamespace(e) {
37
- if (e && e.__esModule) return e;
38
- var n = Object.create(null);
39
- if (e) {
40
- Object.keys(e).forEach(function (k) {
41
- if (k !== 'default') {
42
- var d = Object.getOwnPropertyDescriptor(e, k);
43
- Object.defineProperty(n, k, d.get ? d : {
44
- enumerable: true,
45
- get: function () { return e[k]; }
46
- });
47
- }
48
- });
49
- }
50
- n.default = e;
51
- return Object.freeze(n);
52
- }
53
-
54
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
55
40
  var StarterKit__default = /*#__PURE__*/_interopDefault(StarterKit);
56
41
  var Placeholder__default = /*#__PURE__*/_interopDefault(Placeholder);
57
42
  var Mention__default = /*#__PURE__*/_interopDefault(Mention);
58
43
 
59
- function Spinner({ className }) {
60
- const t = i18n.useAppT();
61
- const loadingLabel = t("ui.states.loading");
62
- return /* @__PURE__ */ jsxRuntime.jsx(
63
- "div",
64
- {
65
- className: lib.cn(
66
- "inline-block h-8 w-8 animate-spin rounded-full",
67
- "border-4 border-solid border-current border-r-transparent",
68
- "align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",
69
- className
70
- ),
71
- role: "status",
72
- "aria-label": loadingLabel
73
- }
74
- );
75
- }
76
- chunkOLISEQHS_cjs.__name(Spinner, "Spinner");
77
- function LoadingFallback({
78
- minHeight = 200,
79
- showText = true,
80
- text,
81
- className
82
- }) {
83
- const t = i18n.useAppT();
84
- const loadingText = text ?? t("ui.form.loading");
85
- const height = typeof minHeight === "number" ? `${minHeight}px` : minHeight;
86
- return /* @__PURE__ */ jsxRuntime.jsx(
87
- "div",
88
- {
89
- className: lib.cn(
90
- "flex items-center justify-center bg-muted/30 rounded-lg",
91
- className
92
- ),
93
- style: { minHeight: height },
94
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
95
- /* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: "text-primary" }),
96
- showText && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: loadingText })
97
- ] })
98
- }
99
- );
100
- }
101
- chunkOLISEQHS_cjs.__name(LoadingFallback, "LoadingFallback");
102
- function CardLoadingFallback({
103
- title,
104
- description,
105
- minHeight = 200,
106
- className
44
+ var DefaultPin = react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function DefaultPin2({
45
+ size = 24,
46
+ color = "#ef4444"
107
47
  }) {
108
- const t = i18n.useAppT();
109
- const cardTitle = title ?? t("ui.states.loading");
110
- const height = typeof minHeight === "number" ? `${minHeight}px` : minHeight;
111
48
  return /* @__PURE__ */ jsxRuntime.jsxs(
112
- "div",
49
+ "svg",
113
50
  {
114
- className: lib.cn(
115
- "relative bg-card rounded-lg border border-border overflow-hidden",
116
- className
117
- ),
51
+ width: size,
52
+ height: size,
53
+ viewBox: "0 0 24 24",
54
+ fill: "none",
55
+ style: { cursor: "pointer" },
118
56
  children: [
119
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 border-b border-border bg-muted/50", children: [
120
- /* @__PURE__ */ jsxRuntime.jsx("h6", { className: "text-sm font-semibold text-foreground", children: cardTitle }),
121
- description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: description })
122
- ] }),
123
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsx(
124
- "div",
57
+ /* @__PURE__ */ jsxRuntime.jsx(
58
+ "path",
125
59
  {
126
- className: "flex justify-center items-center",
127
- style: { minHeight: height },
128
- children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: "text-primary" })
60
+ d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z",
61
+ fill: color,
62
+ stroke: "#fff",
63
+ strokeWidth: "1.5"
129
64
  }
130
- ) })
65
+ ),
66
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "9", r: "2.5", fill: "#fff" })
131
67
  ]
132
68
  }
133
69
  );
134
- }
135
- chunkOLISEQHS_cjs.__name(CardLoadingFallback, "CardLoadingFallback");
136
- function MapLoadingFallback({
137
- minHeight = 400,
138
- className
70
+ }, "DefaultPin"));
71
+ react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MapMarker2({
72
+ marker,
73
+ onClick,
74
+ children,
75
+ anchor = "bottom",
76
+ draggable = false,
77
+ onDragStart,
78
+ onDrag,
79
+ onDragEnd,
80
+ color,
81
+ size
139
82
  }) {
140
- const t = i18n.useAppT();
141
- const loadingText = t("ui.form.loading");
142
- const height = typeof minHeight === "number" ? `${minHeight}px` : minHeight;
83
+ const handleClick = react.useCallback(
84
+ (e) => {
85
+ e.originalEvent.stopPropagation();
86
+ onClick?.(marker);
87
+ },
88
+ [onClick, marker]
89
+ );
90
+ const handleDragStart = react.useCallback(
91
+ (e) => {
92
+ onDragStart?.(marker);
93
+ },
94
+ [onDragStart, marker]
95
+ );
96
+ const handleDrag = react.useCallback(
97
+ (e) => {
98
+ onDrag?.(marker, e.lngLat);
99
+ },
100
+ [onDrag, marker]
101
+ );
102
+ const handleDragEnd = react.useCallback(
103
+ (e) => {
104
+ onDragEnd?.(marker, e.lngLat);
105
+ },
106
+ [onDragEnd, marker]
107
+ );
143
108
  return /* @__PURE__ */ jsxRuntime.jsx(
144
- "div",
109
+ maplibre.Marker,
145
110
  {
146
- className: lib.cn(
147
- "relative bg-muted/50 rounded-lg overflow-hidden",
148
- "flex items-center justify-center",
149
- className
150
- ),
151
- style: { minHeight: height },
152
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
153
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
154
- /* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: "text-primary h-10 w-10" }),
155
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
156
- "svg",
157
- {
158
- className: "h-5 w-5 text-muted-foreground",
159
- fill: "none",
160
- viewBox: "0 0 24 24",
161
- stroke: "currentColor",
162
- children: [
163
- /* @__PURE__ */ jsxRuntime.jsx(
164
- "path",
165
- {
166
- strokeLinecap: "round",
167
- strokeLinejoin: "round",
168
- strokeWidth: 2,
169
- d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
170
- }
171
- ),
172
- /* @__PURE__ */ jsxRuntime.jsx(
173
- "path",
174
- {
175
- strokeLinecap: "round",
176
- strokeLinejoin: "round",
177
- strokeWidth: 2,
178
- d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
179
- }
180
- )
181
- ]
182
- }
183
- ) })
184
- ] }),
185
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: loadingText })
186
- ] })
111
+ longitude: marker.longitude,
112
+ latitude: marker.latitude,
113
+ anchor,
114
+ draggable,
115
+ onClick: handleClick,
116
+ onDragStart: handleDragStart,
117
+ onDrag: handleDrag,
118
+ onDragEnd: handleDragEnd,
119
+ children: children ?? /* @__PURE__ */ jsxRuntime.jsx(DefaultPin, { color, size })
187
120
  }
188
121
  );
189
- }
190
- chunkOLISEQHS_cjs.__name(MapLoadingFallback, "MapLoadingFallback");
191
- function LazyWrapper({
122
+ }, "MapMarker"));
123
+ react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MapPopup2({
124
+ longitude,
125
+ latitude,
126
+ onClose,
192
127
  children,
193
- fallback,
194
- card = false,
195
- cardTitle,
196
- cardDescription,
197
- minHeight = 200,
198
- className
128
+ anchor = "bottom",
129
+ closeOnClick = true,
130
+ closeButton = true,
131
+ className,
132
+ maxWidth = "300px",
133
+ offset: offset2 = 15
199
134
  }) {
200
- const defaultFallback = card ? /* @__PURE__ */ jsxRuntime.jsx(
201
- CardLoadingFallback,
135
+ return /* @__PURE__ */ jsxRuntime.jsx(
136
+ maplibre.Popup,
202
137
  {
203
- title: cardTitle,
204
- description: cardDescription,
205
- minHeight,
206
- className
138
+ longitude,
139
+ latitude,
140
+ anchor,
141
+ onClose,
142
+ closeOnClick,
143
+ closeButton,
144
+ className,
145
+ maxWidth,
146
+ offset: offset2,
147
+ children
148
+ }
149
+ );
150
+ }, "MapPopup"));
151
+
152
+ // src/tools/Map/layers/cluster.ts
153
+ var DEFAULT_COLORS = ["#51bbd6", "#f1f075", "#f28cb1"];
154
+ var DEFAULT_RADII = [20, 30, 40];
155
+ var DEFAULT_THRESHOLDS = [100, 750];
156
+ var DEFAULT_HOVER_COLOR = "#3b82f6";
157
+ function createClusterLayers(options) {
158
+ const {
159
+ sourceId,
160
+ colors = DEFAULT_COLORS,
161
+ radii = DEFAULT_RADII,
162
+ thresholds = DEFAULT_THRESHOLDS,
163
+ hoverColor = DEFAULT_HOVER_COLOR
164
+ } = options;
165
+ const cluster = {
166
+ id: `${sourceId}-clusters`,
167
+ type: "circle",
168
+ source: sourceId,
169
+ filter: ["has", "point_count"],
170
+ paint: {
171
+ "circle-color": [
172
+ "case",
173
+ ["boolean", ["feature-state", "hover"], false],
174
+ hoverColor,
175
+ [
176
+ "step",
177
+ ["get", "point_count"],
178
+ colors[0],
179
+ thresholds[0],
180
+ colors[1],
181
+ thresholds[1],
182
+ colors[2]
183
+ ]
184
+ ],
185
+ "circle-radius": [
186
+ "step",
187
+ ["get", "point_count"],
188
+ radii[0],
189
+ thresholds[0],
190
+ radii[1],
191
+ thresholds[1],
192
+ radii[2]
193
+ ],
194
+ "circle-stroke-width": 2,
195
+ "circle-stroke-color": "#fff"
196
+ }
197
+ };
198
+ const clusterCount = {
199
+ id: `${sourceId}-cluster-count`,
200
+ type: "symbol",
201
+ source: sourceId,
202
+ filter: ["has", "point_count"],
203
+ layout: {
204
+ "text-field": ["get", "point_count_abbreviated"],
205
+ "text-size": 12
206
+ },
207
+ paint: {
208
+ "text-color": "#000"
209
+ }
210
+ };
211
+ const unclusteredPoint = {
212
+ id: `${sourceId}-unclustered-point`,
213
+ type: "circle",
214
+ source: sourceId,
215
+ filter: ["!", ["has", "point_count"]],
216
+ paint: {
217
+ "circle-color": [
218
+ "case",
219
+ ["boolean", ["feature-state", "hover"], false],
220
+ hoverColor,
221
+ colors[0]
222
+ ],
223
+ "circle-radius": [
224
+ "case",
225
+ ["boolean", ["feature-state", "hover"], false],
226
+ 10,
227
+ 8
228
+ ],
229
+ "circle-stroke-width": 2,
230
+ "circle-stroke-color": "#fff"
207
231
  }
208
- ) : /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight, className });
209
- return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: fallback ?? defaultFallback, children });
232
+ };
233
+ return { cluster, clusterCount, unclusteredPoint };
234
+ }
235
+ chunkOLISEQHS_cjs.__name(createClusterLayers, "createClusterLayers");
236
+ var POPUP_STYLE_ID = "map-cluster-popup-styles";
237
+ function injectPopupStyles() {
238
+ if (typeof document === "undefined") return;
239
+ if (document.getElementById(POPUP_STYLE_ID)) return;
240
+ const style = document.createElement("style");
241
+ style.id = POPUP_STYLE_ID;
242
+ style.textContent = `
243
+ .maplibregl-popup.map-popup-clean .maplibregl-popup-content {
244
+ padding: 0 !important;
245
+ background: transparent !important;
246
+ box-shadow: none !important;
247
+ border-radius: 0 !important;
248
+ }
249
+ .maplibregl-popup.map-popup-clean .maplibregl-popup-tip {
250
+ display: none !important;
251
+ }
252
+ `;
253
+ document.head.appendChild(style);
254
+ }
255
+ chunkOLISEQHS_cjs.__name(injectPopupStyles, "injectPopupStyles");
256
+ react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MapCluster2({
257
+ sourceId,
258
+ data,
259
+ clusterRadius = 50,
260
+ clusterMaxZoom = 14,
261
+ onClusterClick,
262
+ onPointClick,
263
+ renderPopup,
264
+ popupAnchor = "bottom",
265
+ popupOffset = 15,
266
+ panOffsetX = 0,
267
+ panOffsetY = 150,
268
+ colors,
269
+ radii,
270
+ thresholds,
271
+ hoverColor
272
+ }) {
273
+ const { current: map } = maplibre.useMap();
274
+ const [selectedFeature, setSelectedFeature] = react.useState(null);
275
+ const [popupCoords, setPopupCoords] = react.useState(null);
276
+ react.useEffect(() => {
277
+ injectPopupStyles();
278
+ }, []);
279
+ const layerOptions = {
280
+ sourceId,
281
+ colors,
282
+ radii,
283
+ thresholds,
284
+ hoverColor
285
+ };
286
+ const { cluster, clusterCount, unclusteredPoint } = createClusterLayers(layerOptions);
287
+ const handleClosePopup = react.useCallback(() => {
288
+ setSelectedFeature(null);
289
+ setPopupCoords(null);
290
+ }, []);
291
+ const handleClick = react.useCallback(
292
+ async (event) => {
293
+ if (!map) return;
294
+ const features = map.queryRenderedFeatures(event.point, {
295
+ layers: [cluster.id, unclusteredPoint.id]
296
+ });
297
+ if (!features || features.length === 0) return;
298
+ const feature = features[0];
299
+ const geometry = feature.geometry;
300
+ if (geometry.type !== "Point") return;
301
+ const coordinates = geometry.coordinates;
302
+ const clusterId = feature.properties?.cluster_id;
303
+ if (clusterId) {
304
+ const source = map.getSource(sourceId);
305
+ if (!source) return;
306
+ try {
307
+ const zoom = await source.getClusterExpansionZoom(clusterId);
308
+ map.easeTo({
309
+ center: coordinates,
310
+ zoom,
311
+ duration: 500
312
+ });
313
+ onClusterClick?.(clusterId, coordinates);
314
+ } catch (error) {
315
+ console.error("Error expanding cluster:", error);
316
+ }
317
+ } else {
318
+ onPointClick?.(feature);
319
+ if (renderPopup) {
320
+ map.easeTo({
321
+ center: coordinates,
322
+ duration: 300,
323
+ offset: [panOffsetX, panOffsetY]
324
+ });
325
+ setSelectedFeature(feature);
326
+ setPopupCoords(coordinates);
327
+ }
328
+ }
329
+ },
330
+ [map, sourceId, cluster.id, unclusteredPoint.id, onClusterClick, onPointClick, renderPopup, panOffsetX, panOffsetY]
331
+ );
332
+ const handleMapClick = react.useCallback(
333
+ (event) => {
334
+ if (!map) return;
335
+ const features = map.queryRenderedFeatures(event.point, {
336
+ layers: [cluster.id, unclusteredPoint.id]
337
+ });
338
+ if (!features || features.length === 0) {
339
+ handleClosePopup();
340
+ }
341
+ },
342
+ [map, cluster.id, unclusteredPoint.id, handleClosePopup]
343
+ );
344
+ react.useEffect(() => {
345
+ if (!map) return;
346
+ const clusterLayerId = cluster.id;
347
+ const pointLayerId = unclusteredPoint.id;
348
+ let currentHoveredId = null;
349
+ const clearHoverState = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
350
+ if (currentHoveredId !== null) {
351
+ map.setFeatureState(
352
+ { source: sourceId, id: currentHoveredId },
353
+ { hover: false }
354
+ );
355
+ currentHoveredId = null;
356
+ }
357
+ }, "clearHoverState");
358
+ const handleMouseMove = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((e) => {
359
+ const features = map.queryRenderedFeatures(e.point, {
360
+ layers: [clusterLayerId, pointLayerId]
361
+ });
362
+ if (features.length > 0) {
363
+ map.getCanvas().style.cursor = "pointer";
364
+ const feature = features[0];
365
+ const featureId = feature.id;
366
+ if (featureId !== void 0 && featureId !== currentHoveredId) {
367
+ clearHoverState();
368
+ currentHoveredId = featureId;
369
+ map.setFeatureState(
370
+ { source: sourceId, id: featureId },
371
+ { hover: true }
372
+ );
373
+ }
374
+ } else {
375
+ map.getCanvas().style.cursor = "";
376
+ clearHoverState();
377
+ }
378
+ }, "handleMouseMove");
379
+ const handleMouseLeave = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
380
+ map.getCanvas().style.cursor = "";
381
+ clearHoverState();
382
+ }, "handleMouseLeave");
383
+ map.on("click", clusterLayerId, handleClick);
384
+ map.on("click", pointLayerId, handleClick);
385
+ map.on("click", handleMapClick);
386
+ map.on("mousemove", clusterLayerId, handleMouseMove);
387
+ map.on("mousemove", pointLayerId, handleMouseMove);
388
+ map.on("mouseleave", clusterLayerId, handleMouseLeave);
389
+ map.on("mouseleave", pointLayerId, handleMouseLeave);
390
+ return () => {
391
+ clearHoverState();
392
+ map.off("click", clusterLayerId, handleClick);
393
+ map.off("click", pointLayerId, handleClick);
394
+ map.off("click", handleMapClick);
395
+ map.off("mousemove", clusterLayerId, handleMouseMove);
396
+ map.off("mousemove", pointLayerId, handleMouseMove);
397
+ map.off("mouseleave", clusterLayerId, handleMouseLeave);
398
+ map.off("mouseleave", pointLayerId, handleMouseLeave);
399
+ };
400
+ }, [map, sourceId, cluster.id, unclusteredPoint.id, handleClick, handleMapClick]);
401
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
402
+ /* @__PURE__ */ jsxRuntime.jsxs(
403
+ maplibre.Source,
404
+ {
405
+ id: sourceId,
406
+ type: "geojson",
407
+ data,
408
+ cluster: true,
409
+ clusterMaxZoom,
410
+ clusterRadius,
411
+ generateId: true,
412
+ children: [
413
+ /* @__PURE__ */ jsxRuntime.jsx(maplibre.Layer, { ...cluster }),
414
+ /* @__PURE__ */ jsxRuntime.jsx(maplibre.Layer, { ...clusterCount }),
415
+ /* @__PURE__ */ jsxRuntime.jsx(maplibre.Layer, { ...unclusteredPoint })
416
+ ]
417
+ }
418
+ ),
419
+ renderPopup && selectedFeature && popupCoords && /* @__PURE__ */ jsxRuntime.jsx(
420
+ maplibre.Popup,
421
+ {
422
+ longitude: popupCoords[0],
423
+ latitude: popupCoords[1],
424
+ anchor: popupAnchor,
425
+ onClose: handleClosePopup,
426
+ closeOnClick: false,
427
+ closeButton: false,
428
+ offset: popupOffset,
429
+ maxWidth: "none",
430
+ className: "map-popup-clean",
431
+ children: renderPopup(selectedFeature, handleClosePopup)
432
+ }
433
+ )
434
+ ] });
435
+ }, "MapCluster"));
436
+ react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MapSource2({
437
+ id,
438
+ data,
439
+ type = "geojson",
440
+ children
441
+ }) {
442
+ return /* @__PURE__ */ jsxRuntime.jsx(maplibre.Source, { id, type, data, children });
443
+ }, "MapSource"));
444
+ react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MapLayer2(props) {
445
+ return /* @__PURE__ */ jsxRuntime.jsx(maplibre.Layer, { ...props });
446
+ }, "MapLayer"));
447
+ var _OverlayControl = class _OverlayControl {
448
+ constructor(redraw) {
449
+ chunkOLISEQHS_cjs.__publicField(this, "_map", null);
450
+ chunkOLISEQHS_cjs.__publicField(this, "_container", null);
451
+ chunkOLISEQHS_cjs.__publicField(this, "_redraw");
452
+ this._redraw = redraw;
453
+ }
454
+ onAdd(map) {
455
+ this._map = map;
456
+ map.on("move", this._redraw);
457
+ this._container = document.createElement("div");
458
+ this._redraw();
459
+ return this._container;
460
+ }
461
+ onRemove() {
462
+ this._container?.remove();
463
+ this._map?.off("move", this._redraw);
464
+ this._map = null;
465
+ }
466
+ getElement() {
467
+ return this._container;
468
+ }
469
+ };
470
+ chunkOLISEQHS_cjs.__name(_OverlayControl, "OverlayControl");
471
+ var OverlayControl = _OverlayControl;
472
+ function CustomOverlayComponent({ children }) {
473
+ const [, setVersion] = react.useState(0);
474
+ const ctrl = maplibre.useControl(() => {
475
+ const forceUpdate = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => setVersion((v) => v + 1), "forceUpdate");
476
+ return new OverlayControl(forceUpdate);
477
+ });
478
+ const element = ctrl.getElement();
479
+ if (!element) return null;
480
+ return reactDom.createPortal(children, element);
481
+ }
482
+ chunkOLISEQHS_cjs.__name(CustomOverlayComponent, "CustomOverlayComponent");
483
+ react.memo(CustomOverlayComponent);
484
+ var positionStyles = {
485
+ "top-left": { top: 10, left: 10 },
486
+ "top-right": { top: 10, right: 10 },
487
+ "bottom-left": { bottom: 10, left: 10 },
488
+ "bottom-right": { bottom: 10, right: 10 }
489
+ };
490
+ function LegendIcon({
491
+ type,
492
+ color
493
+ }) {
494
+ const fill = color || "#888";
495
+ switch (type) {
496
+ case "circle":
497
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "6", fill }) });
498
+ case "line":
499
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsxRuntime.jsx(
500
+ "line",
501
+ {
502
+ x1: "0",
503
+ y1: "8",
504
+ x2: "16",
505
+ y2: "8",
506
+ stroke: fill,
507
+ strokeWidth: "3",
508
+ strokeLinecap: "round"
509
+ }
510
+ ) });
511
+ case "fill":
512
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "1", y: "1", width: "14", height: "14", fill, rx: "2" }) });
513
+ case "symbol":
514
+ default:
515
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", children: /* @__PURE__ */ jsxRuntime.jsx(
516
+ "path",
517
+ {
518
+ d: "M8 1l2.5 5 5.5.8-4 3.9.9 5.3L8 13.5l-4.9 2.5.9-5.3-4-3.9 5.5-.8z",
519
+ fill
520
+ }
521
+ ) });
522
+ }
523
+ }
524
+ chunkOLISEQHS_cjs.__name(LegendIcon, "LegendIcon");
525
+ function MapLegendComponent({
526
+ items,
527
+ position = "bottom-right",
528
+ title,
529
+ collapsible = false,
530
+ defaultCollapsed = false,
531
+ className = "",
532
+ style,
533
+ onItemClick
534
+ }) {
535
+ const [collapsed, setCollapsed] = react.useState(defaultCollapsed);
536
+ const containerStyle = react.useMemo(
537
+ () => ({
538
+ position: "absolute",
539
+ ...positionStyles[position],
540
+ backgroundColor: "white",
541
+ borderRadius: 8,
542
+ boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
543
+ padding: collapsed ? 8 : 12,
544
+ minWidth: collapsed ? "auto" : 120,
545
+ zIndex: 1,
546
+ ...style
547
+ }),
548
+ [position, collapsed, style]
549
+ );
550
+ const headerStyle = react.useMemo(
551
+ () => ({
552
+ display: "flex",
553
+ alignItems: "center",
554
+ justifyContent: "space-between",
555
+ gap: 8,
556
+ cursor: collapsible ? "pointer" : "default",
557
+ fontWeight: 600,
558
+ fontSize: 12,
559
+ color: "#333",
560
+ marginBottom: collapsed ? 0 : 8
561
+ }),
562
+ [collapsible, collapsed]
563
+ );
564
+ const itemStyle = react.useMemo(
565
+ () => ({
566
+ display: "flex",
567
+ alignItems: "center",
568
+ gap: 8,
569
+ padding: "4px 0",
570
+ fontSize: 12,
571
+ color: "#666",
572
+ cursor: onItemClick ? "pointer" : "default"
573
+ }),
574
+ [onItemClick]
575
+ );
576
+ const handleHeaderClick = collapsible ? () => setCollapsed(!collapsed) : void 0;
577
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: containerStyle, children: [
578
+ (title || collapsible) && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: headerStyle, onClick: handleHeaderClick, children: [
579
+ title && /* @__PURE__ */ jsxRuntime.jsx("span", { children: title }),
580
+ collapsible && /* @__PURE__ */ jsxRuntime.jsx(
581
+ "svg",
582
+ {
583
+ width: "12",
584
+ height: "12",
585
+ viewBox: "0 0 12 12",
586
+ style: {
587
+ transform: collapsed ? "rotate(-90deg)" : "rotate(0deg)",
588
+ transition: "transform 0.2s"
589
+ },
590
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "#666", fill: "none" })
591
+ }
592
+ )
593
+ ] }),
594
+ !collapsed && /* @__PURE__ */ jsxRuntime.jsx("div", { children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
595
+ "div",
596
+ {
597
+ style: {
598
+ ...itemStyle,
599
+ opacity: item.visible === false ? 0.5 : 1
600
+ },
601
+ onClick: onItemClick ? () => onItemClick(item) : void 0,
602
+ children: [
603
+ item.icon || /* @__PURE__ */ jsxRuntime.jsx(LegendIcon, { type: item.type, color: item.color }),
604
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label })
605
+ ]
606
+ },
607
+ item.id
608
+ )) })
609
+ ] });
610
+ }
611
+ chunkOLISEQHS_cjs.__name(MapLegendComponent, "MapLegendComponent");
612
+ react.memo(MapLegendComponent);
613
+ function useMapLayers() {
614
+ const { mapRef, isLoaded } = chunk5D2OCOPQ_cjs.useMapContext();
615
+ const addLayer = react.useCallback(
616
+ (layer, beforeId) => {
617
+ const map = mapRef.current?.getMap();
618
+ if (!map || !isLoaded) return;
619
+ if (layer.id && map.getLayer(layer.id)) {
620
+ map.removeLayer(layer.id);
621
+ }
622
+ map.addLayer(layer, beforeId);
623
+ },
624
+ [mapRef, isLoaded]
625
+ );
626
+ const removeLayer = react.useCallback(
627
+ (id) => {
628
+ const map = mapRef.current?.getMap();
629
+ if (!map || !isLoaded) return;
630
+ if (map.getLayer(id)) {
631
+ map.removeLayer(id);
632
+ }
633
+ },
634
+ [mapRef, isLoaded]
635
+ );
636
+ const setLayerVisibility = react.useCallback(
637
+ (id, visible) => {
638
+ const map = mapRef.current?.getMap();
639
+ if (!map || !isLoaded) return;
640
+ if (map.getLayer(id)) {
641
+ map.setLayoutProperty(id, "visibility", visible ? "visible" : "none");
642
+ }
643
+ },
644
+ [mapRef, isLoaded]
645
+ );
646
+ const setLayerFilter = react.useCallback(
647
+ (id, filter) => {
648
+ const map = mapRef.current?.getMap();
649
+ if (!map || !isLoaded) return;
650
+ if (map.getLayer(id)) {
651
+ map.setFilter(id, filter);
652
+ }
653
+ },
654
+ [mapRef, isLoaded]
655
+ );
656
+ const setLayerPaint = react.useCallback(
657
+ (id, property, value) => {
658
+ const map = mapRef.current?.getMap();
659
+ if (!map || !isLoaded) return;
660
+ if (map.getLayer(id)) {
661
+ map.setPaintProperty(id, property, value);
662
+ }
663
+ },
664
+ [mapRef, isLoaded]
665
+ );
666
+ return {
667
+ addLayer,
668
+ removeLayer,
669
+ setLayerVisibility,
670
+ setLayerFilter,
671
+ setLayerPaint
672
+ };
210
673
  }
211
- chunkOLISEQHS_cjs.__name(LazyWrapper, "LazyWrapper");
212
- function createLazyComponent(loader, options = {}) {
213
- const LazyComponent = React__namespace.lazy(loader);
214
- const WrappedComponent = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((props) => {
215
- const fallback = typeof options.fallback === "function" ? options.fallback(props) : options.fallback ?? /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, {});
216
- return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback, children: /* @__PURE__ */ jsxRuntime.jsx(LazyComponent, { ...props }) });
217
- }, "WrappedComponent");
218
- WrappedComponent.displayName = options.displayName ?? "LazyComponent";
219
- return WrappedComponent;
674
+ chunkOLISEQHS_cjs.__name(useMapLayers, "useMapLayers");
675
+ var positionStyles2 = {
676
+ "top-left": { top: 10, left: 10 },
677
+ "top-right": { top: 10, right: 10 },
678
+ "bottom-left": { bottom: 10, left: 10 },
679
+ "bottom-right": { bottom: 10, right: 10 }
680
+ };
681
+ function LayerSwitcherComponent({
682
+ layers,
683
+ position = "top-right",
684
+ title = "Layers",
685
+ collapsible = true,
686
+ defaultCollapsed = false,
687
+ showToggleAll = false,
688
+ className = "",
689
+ style,
690
+ onChange
691
+ }) {
692
+ const { setLayerVisibility } = useMapLayers();
693
+ const [collapsed, setCollapsed] = react.useState(defaultCollapsed);
694
+ const initialVisibility = react.useMemo(() => {
695
+ const initial = {};
696
+ layers.forEach((layer) => {
697
+ initial[layer.id] = layer.defaultVisible !== false;
698
+ });
699
+ return initial;
700
+ }, [layers]);
701
+ const [visibility, setVisibility] = react.useState(initialVisibility);
702
+ const handleToggle = react.useCallback(
703
+ (layerId) => {
704
+ const newVisible = !visibility[layerId];
705
+ setVisibility((prev) => ({ ...prev, [layerId]: newVisible }));
706
+ setLayerVisibility(layerId, newVisible);
707
+ onChange?.(layerId, newVisible);
708
+ },
709
+ [visibility, setLayerVisibility, onChange]
710
+ );
711
+ const handleToggleAll = react.useCallback(
712
+ (visible) => {
713
+ const newVisibility = {};
714
+ layers.forEach((layer) => {
715
+ newVisibility[layer.id] = visible;
716
+ setLayerVisibility(layer.id, visible);
717
+ onChange?.(layer.id, visible);
718
+ });
719
+ setVisibility(newVisibility);
720
+ },
721
+ [layers, setLayerVisibility, onChange]
722
+ );
723
+ const allVisible = react.useMemo(() => Object.values(visibility).every(Boolean), [visibility]);
724
+ const noneVisible = react.useMemo(() => Object.values(visibility).every((v) => !v), [visibility]);
725
+ const containerStyle = react.useMemo(
726
+ () => ({
727
+ position: "absolute",
728
+ ...positionStyles2[position],
729
+ backgroundColor: "white",
730
+ borderRadius: 8,
731
+ boxShadow: "0 2px 8px rgba(0,0,0,0.15)",
732
+ padding: collapsed ? 8 : 12,
733
+ minWidth: collapsed ? "auto" : 150,
734
+ zIndex: 1,
735
+ ...style
736
+ }),
737
+ [position, collapsed, style]
738
+ );
739
+ const headerStyle = react.useMemo(
740
+ () => ({
741
+ display: "flex",
742
+ alignItems: "center",
743
+ justifyContent: "space-between",
744
+ gap: 8,
745
+ cursor: collapsible ? "pointer" : "default",
746
+ fontWeight: 600,
747
+ fontSize: 12,
748
+ color: "#333",
749
+ marginBottom: collapsed ? 0 : 8
750
+ }),
751
+ [collapsible, collapsed]
752
+ );
753
+ const itemStyle = react.useMemo(
754
+ () => ({
755
+ display: "flex",
756
+ alignItems: "center",
757
+ gap: 8,
758
+ padding: "4px 0",
759
+ fontSize: 12,
760
+ color: "#666",
761
+ cursor: "pointer"
762
+ }),
763
+ []
764
+ );
765
+ const checkboxStyle = react.useMemo(
766
+ () => ({
767
+ width: 14,
768
+ height: 14,
769
+ cursor: "pointer"
770
+ }),
771
+ []
772
+ );
773
+ const groups = react.useMemo(() => {
774
+ return layers.reduce(
775
+ (acc, layer) => {
776
+ const group = layer.group || "";
777
+ if (!acc[group]) acc[group] = [];
778
+ acc[group].push(layer);
779
+ return acc;
780
+ },
781
+ {}
782
+ );
783
+ }, [layers]);
784
+ const handleHeaderClick = collapsible ? () => setCollapsed(!collapsed) : void 0;
785
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: containerStyle, children: [
786
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: headerStyle, onClick: handleHeaderClick, children: [
787
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: title }),
788
+ collapsible && /* @__PURE__ */ jsxRuntime.jsx(
789
+ "svg",
790
+ {
791
+ width: "12",
792
+ height: "12",
793
+ viewBox: "0 0 12 12",
794
+ style: {
795
+ transform: collapsed ? "rotate(-90deg)" : "rotate(0deg)",
796
+ transition: "transform 0.2s"
797
+ },
798
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "#666", fill: "none" })
799
+ }
800
+ )
801
+ ] }),
802
+ !collapsed && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
803
+ showToggleAll && /* @__PURE__ */ jsxRuntime.jsxs(
804
+ "div",
805
+ {
806
+ style: {
807
+ ...itemStyle,
808
+ borderBottom: "1px solid #eee",
809
+ marginBottom: 4,
810
+ paddingBottom: 8
811
+ },
812
+ children: [
813
+ /* @__PURE__ */ jsxRuntime.jsx(
814
+ "button",
815
+ {
816
+ onClick: () => handleToggleAll(true),
817
+ disabled: allVisible,
818
+ style: {
819
+ fontSize: 10,
820
+ padding: "2px 6px",
821
+ cursor: allVisible ? "default" : "pointer",
822
+ opacity: allVisible ? 0.5 : 1
823
+ },
824
+ children: "All"
825
+ }
826
+ ),
827
+ /* @__PURE__ */ jsxRuntime.jsx(
828
+ "button",
829
+ {
830
+ onClick: () => handleToggleAll(false),
831
+ disabled: noneVisible,
832
+ style: {
833
+ fontSize: 10,
834
+ padding: "2px 6px",
835
+ cursor: noneVisible ? "default" : "pointer",
836
+ opacity: noneVisible ? 0.5 : 1
837
+ },
838
+ children: "None"
839
+ }
840
+ )
841
+ ]
842
+ }
843
+ ),
844
+ Object.entries(groups).map(([group, groupLayers]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
845
+ group && /* @__PURE__ */ jsxRuntime.jsx(
846
+ "div",
847
+ {
848
+ style: {
849
+ fontSize: 10,
850
+ fontWeight: 600,
851
+ color: "#999",
852
+ marginTop: 8,
853
+ marginBottom: 4,
854
+ textTransform: "uppercase"
855
+ },
856
+ children: group
857
+ }
858
+ ),
859
+ groupLayers.map((layer) => /* @__PURE__ */ jsxRuntime.jsxs(
860
+ "div",
861
+ {
862
+ style: itemStyle,
863
+ onClick: () => handleToggle(layer.id),
864
+ children: [
865
+ /* @__PURE__ */ jsxRuntime.jsx(
866
+ "input",
867
+ {
868
+ type: "checkbox",
869
+ checked: visibility[layer.id],
870
+ onChange: () => handleToggle(layer.id),
871
+ style: checkboxStyle
872
+ }
873
+ ),
874
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: layer.label })
875
+ ]
876
+ },
877
+ layer.id
878
+ ))
879
+ ] }, group || "default"))
880
+ ] })
881
+ ] });
220
882
  }
221
- chunkOLISEQHS_cjs.__name(createLazyComponent, "createLazyComponent");
222
- var LazyMapContainer = createLazyComponent(
223
- () => import('./MapContainer-76YL2JXL.cjs').then((mod) => ({ default: mod.MapContainer })),
883
+ chunkOLISEQHS_cjs.__name(LayerSwitcherComponent, "LayerSwitcherComponent");
884
+ react.memo(LayerSwitcherComponent);
885
+ var LazyMapContainer = chunkL25HA3TM_cjs.createLazyComponent(
886
+ () => import('./MapContainer-STVDMC36.cjs').then((mod) => ({ default: mod.MapContainer })),
224
887
  {
225
888
  displayName: "LazyMapContainer",
226
- fallback: /* @__PURE__ */ jsxRuntime.jsx(MapLoadingFallback, { minHeight: 400 })
889
+ fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.MapLoadingFallback, { minHeight: 400 })
227
890
  }
228
891
  );
229
- var LazyMapView = createLazyComponent(
230
- () => import('./MapContainer-76YL2JXL.cjs').then((mod) => ({ default: mod.MapView })),
892
+ var LazyMapView = chunkL25HA3TM_cjs.createLazyComponent(
893
+ () => import('./MapContainer-STVDMC36.cjs').then((mod) => ({ default: mod.MapView })),
231
894
  {
232
895
  displayName: "LazyMapView",
233
- fallback: /* @__PURE__ */ jsxRuntime.jsx(MapLoadingFallback, { minHeight: 400 })
896
+ fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.MapLoadingFallback, { minHeight: 400 })
234
897
  }
235
898
  );
236
- var LazyMermaid = createLazyComponent(
899
+ var LazyMermaid = chunkL25HA3TM_cjs.createLazyComponent(
237
900
  () => import('./Mermaid.client-NNTI6DFX.cjs'),
238
901
  {
239
902
  displayName: "LazyMermaid",
240
903
  fallback: /* @__PURE__ */ jsxRuntime.jsx(
241
- CardLoadingFallback,
904
+ chunkL25HA3TM_cjs.CardLoadingFallback,
242
905
  {
243
906
  title: "Diagram",
244
907
  description: "Loading...",
@@ -254,7 +917,7 @@ function CodeLoadingFallback() {
254
917
  ] }) }) });
255
918
  }
256
919
  chunkOLISEQHS_cjs.__name(CodeLoadingFallback, "CodeLoadingFallback");
257
- var LazyPrettyCode = createLazyComponent(
920
+ var LazyPrettyCode = chunkL25HA3TM_cjs.createLazyComponent(
258
921
  () => import('./PrettyCode.client-KOHDVPPN.cjs'),
259
922
  {
260
923
  displayName: "LazyPrettyCode",
@@ -268,7 +931,7 @@ function OpenapiLoadingFallback() {
268
931
  ] }) });
269
932
  }
270
933
  chunkOLISEQHS_cjs.__name(OpenapiLoadingFallback, "OpenapiLoadingFallback");
271
- var LazyDocsLayout = createLazyComponent(
934
+ var LazyDocsLayout = chunkL25HA3TM_cjs.createLazyComponent(
272
935
  () => import('./DocsLayout-2YZNS5VK.cjs').then((mod) => ({ default: mod.DocsLayout })),
273
936
  {
274
937
  displayName: "LazyDocsLayout",
@@ -279,12 +942,12 @@ var LazyOpenapiViewer = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ config }) =>
279
942
  return /* @__PURE__ */ jsxRuntime.jsx(chunk7EYHNP3E_cjs.PlaygroundProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(LazyDocsLayout, {}) });
280
943
  }, "LazyOpenapiViewer");
281
944
  LazyOpenapiViewer.displayName = "LazyOpenapiViewer";
282
- var LazyJsonSchemaForm = createLazyComponent(
945
+ var LazyJsonSchemaForm = chunkL25HA3TM_cjs.createLazyComponent(
283
946
  () => import('./JsonSchemaForm-DD7CLRIG.cjs').then((mod) => ({ default: mod.JsonSchemaForm })),
284
947
  {
285
948
  displayName: "LazyJsonSchemaForm",
286
949
  fallback: /* @__PURE__ */ jsxRuntime.jsx(
287
- CardLoadingFallback,
950
+ chunkL25HA3TM_cjs.CardLoadingFallback,
288
951
  {
289
952
  title: "Form",
290
953
  description: "Loading form schema...",
@@ -300,14 +963,14 @@ function LottieLoadingFallback() {
300
963
  ] }) });
301
964
  }
302
965
  chunkOLISEQHS_cjs.__name(LottieLoadingFallback, "LottieLoadingFallback");
303
- var LazyLottiePlayer = createLazyComponent(
966
+ var LazyLottiePlayer = chunkL25HA3TM_cjs.createLazyComponent(
304
967
  () => import('./LottiePlayer.client-2S7ISJ2S.cjs').then((mod) => ({ default: mod.LottiePlayer })),
305
968
  {
306
969
  displayName: "LazyLottiePlayer",
307
970
  fallback: /* @__PURE__ */ jsxRuntime.jsx(LottieLoadingFallback, {})
308
971
  }
309
972
  );
310
- var LazyPlayer = createLazyComponent(
973
+ var LazyPlayer = chunkL25HA3TM_cjs.createLazyComponent(
311
974
  () => import('./Player-PM7F7DD7.cjs').then((mod) => ({ default: mod.Player })),
312
975
  {
313
976
  displayName: "LazyAudioPlayer",
@@ -332,33 +995,33 @@ function VideoLoadingFallback() {
332
995
  ] }) });
333
996
  }
334
997
  chunkOLISEQHS_cjs.__name(VideoLoadingFallback, "VideoLoadingFallback");
335
- var LazyVideoPlayer = createLazyComponent(
998
+ var LazyVideoPlayer = chunkL25HA3TM_cjs.createLazyComponent(
336
999
  () => import('./components-MQ6DR7TX.cjs').then((mod) => ({ default: mod.VideoPlayer })),
337
1000
  {
338
1001
  displayName: "LazyVideoPlayer",
339
1002
  fallback: /* @__PURE__ */ jsxRuntime.jsx(VideoLoadingFallback, {})
340
1003
  }
341
1004
  );
342
- var LazyJsonTree = createLazyComponent(
1005
+ var LazyJsonTree = chunkL25HA3TM_cjs.createLazyComponent(
343
1006
  () => import('./JsonTree-X6W5YEVY.cjs'),
344
1007
  {
345
1008
  displayName: "LazyJsonTree",
346
- fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 100, text: "Loading JSON viewer..." })
1009
+ fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.LoadingFallback, { minHeight: 100, text: "Loading JSON viewer..." })
347
1010
  }
348
1011
  );
349
- var LazyImageViewer = createLazyComponent(
1012
+ var LazyImageViewer = chunkL25HA3TM_cjs.createLazyComponent(
350
1013
  () => import('./components-EHOGXATG.cjs').then((mod) => ({ default: mod.ImageViewer })),
351
1014
  {
352
1015
  displayName: "LazyImageViewer",
353
- fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 200, text: "Loading image viewer..." })
1016
+ fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.LoadingFallback, { minHeight: 200, text: "Loading image viewer..." })
354
1017
  }
355
1018
  );
356
- var LazyCronScheduler = createLazyComponent(
1019
+ var LazyCronScheduler = chunkL25HA3TM_cjs.createLazyComponent(
357
1020
  () => import('./CronScheduler.client-WEJF4PWQ.cjs'),
358
1021
  {
359
1022
  displayName: "LazyCronScheduler",
360
1023
  fallback: /* @__PURE__ */ jsxRuntime.jsx(
361
- LoadingFallback,
1024
+ chunkL25HA3TM_cjs.LoadingFallback,
362
1025
  {
363
1026
  minHeight: 120,
364
1027
  showText: false,
@@ -367,18 +1030,11 @@ var LazyCronScheduler = createLazyComponent(
367
1030
  )
368
1031
  }
369
1032
  );
370
- var LazyTree = createLazyComponent(
1033
+ var LazyTree = chunkL25HA3TM_cjs.createLazyComponent(
371
1034
  () => import('./TreeRoot-AABP2J6Y.cjs'),
372
1035
  {
373
1036
  displayName: "LazyTree",
374
- fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 200, text: "Loading tree\u2026" })
375
- }
376
- );
377
- var LazyChat = createLazyComponent(
378
- () => import('./ChatRoot-LXIUBOXF.cjs').then((m) => ({ default: m.ChatRoot })),
379
- {
380
- displayName: "LazyChat",
381
- fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback, { minHeight: 320, text: "Loading chat\u2026" })
1037
+ fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.LoadingFallback, { minHeight: 200, text: "Loading tree\u2026" })
382
1038
  }
383
1039
  );
384
1040
 
@@ -412,7 +1068,7 @@ async function* parseSSE(response, options = {}) {
412
1068
  throw new Error("SSE response has no body");
413
1069
  }
414
1070
  const map = options.map ?? DEFAULT_MAP;
415
- const idleMs = options.idleTimeoutMs ?? chunkHPK3EWBF_cjs.LIMITS.sseIdleMs;
1071
+ const idleMs = options.idleTimeoutMs ?? chunkTBSHZO5R_cjs.LIMITS.sseIdleMs;
416
1072
  const reader = response.body.getReader();
417
1073
  const decoder = new TextDecoder();
418
1074
  let buffer = "";
@@ -627,7 +1283,7 @@ function createMockTransport(opts = {}) {
627
1283
  async createSession(_opts) {
628
1284
  await sleep(latency);
629
1285
  return {
630
- sessionId: chunkHPK3EWBF_cjs.createId("s"),
1286
+ sessionId: chunkTBSHZO5R_cjs.createId("s"),
631
1287
  messages: history.length ? [...history] : void 0,
632
1288
  hasMore: false,
633
1289
  cursor: null,
@@ -644,12 +1300,12 @@ function createMockTransport(opts = {}) {
644
1300
  throw new Error("mock transport scripted failure");
645
1301
  }
646
1302
  history.push({
647
- id: chunkHPK3EWBF_cjs.createId("u"),
1303
+ id: chunkTBSHZO5R_cjs.createId("u"),
648
1304
  role: "user",
649
1305
  content,
650
1306
  createdAt: Date.now()
651
1307
  });
652
- const messageId = chunkHPK3EWBF_cjs.createId("a");
1308
+ const messageId = chunkTBSHZO5R_cjs.createId("a");
653
1309
  yield { type: "message_start", messageId, sessionId: _sid };
654
1310
  const reply = replies[turn % replies.length];
655
1311
  turn += 1;
@@ -678,7 +1334,7 @@ function createMockTransport(opts = {}) {
678
1334
  turn += 1;
679
1335
  const text = typeof reply === "string" ? reply : reply.filter((e) => e.type === "chunk").map((e) => e.delta).join("");
680
1336
  return {
681
- id: chunkHPK3EWBF_cjs.createId("a"),
1337
+ id: chunkTBSHZO5R_cjs.createId("a"),
682
1338
  role: "assistant",
683
1339
  content: text || DEFAULT_REPLY,
684
1340
  createdAt: Date.now()
@@ -748,1382 +1404,121 @@ function createPydanticAISSEMap() {
748
1404
  try {
749
1405
  parsed = JSON.parse(raw.data);
750
1406
  } catch {
751
- return null;
752
- }
753
- const out = [];
754
- for (const evt of mapPydanticAIEvent(parsed, toolIds)) {
755
- out.push(evt);
756
- }
757
- if (out.length === 0) return null;
758
- if (out.length === 1) return out[0];
759
- return out;
760
- };
761
- }
762
- chunkOLISEQHS_cjs.__name(createPydanticAISSEMap, "createPydanticAISSEMap");
763
-
764
- // src/tools/Chat/core/transport/pydantic-ai-transport.ts
765
- var DEFAULT_SESSION_ID = "default";
766
- function mapStatusToCode2(status) {
767
- if (status === 401 || status === 403) return "unauthorized";
768
- if (status === 404) return "not_found";
769
- if (status === 408) return "timeout";
770
- if (status === 429) return "rate_limited";
771
- if (status >= 500) return "server_error";
772
- return "error";
773
- }
774
- chunkOLISEQHS_cjs.__name(mapStatusToCode2, "mapStatusToCode");
775
- function createPydanticAIChatTransport(opts) {
776
- const fetchImpl = opts.fetchImpl ?? fetch.bind(globalThis);
777
- const streamMethod = opts.streamMethod ?? "POST";
778
- async function resolvedHeaders(extra) {
779
- const base = opts.buildHeaders ? await opts.buildHeaders() : {};
780
- const headers = new Headers(base);
781
- if (extra) {
782
- for (const [k, v] of Object.entries(extra)) headers.set(k, v);
783
- }
784
- return headers;
785
- }
786
- chunkOLISEQHS_cjs.__name(resolvedHeaders, "resolvedHeaders");
787
- return {
788
- async createSession(createOpts) {
789
- if (opts.bootstrapSession) return opts.bootstrapSession(createOpts);
790
- return { sessionId: DEFAULT_SESSION_ID };
791
- },
792
- async loadHistory(sessionId, cursor) {
793
- if (opts.loadHistory) return opts.loadHistory(sessionId, cursor);
794
- return { messages: [], hasMore: false, nextCursor: null };
795
- },
796
- async *stream(sessionId, content, options) {
797
- const url = opts.buildStreamUrl(sessionId, content);
798
- const headers = await resolvedHeaders({ Accept: "text/event-stream" });
799
- const init = {
800
- method: streamMethod,
801
- headers,
802
- signal: options.signal
803
- };
804
- if (streamMethod === "POST") {
805
- headers.set("Content-Type", "application/json");
806
- init.body = JSON.stringify({
807
- content,
808
- attachments: options.attachments ?? [],
809
- metadata: options.metadata ?? {}
810
- });
811
- }
812
- const res = await fetchImpl(typeof url === "string" ? url : url.toString(), init);
813
- if (!res.ok) {
814
- const text = await res.text().catch(() => "");
815
- throw new TransportError(
816
- `stream failed (${res.status}): ${text || res.statusText}`,
817
- mapStatusToCode2(res.status)
818
- );
819
- }
820
- const sideChannel = opts.onPydanticEvent;
821
- if (!sideChannel) {
822
- yield* parseSSE(res, {
823
- signal: options.signal,
824
- idleTimeoutMs: opts.idleTimeoutMs,
825
- map: createPydanticAISSEMap()
826
- });
827
- return;
828
- }
829
- const toolIds = createToolIdQueue();
830
- yield* parseSSE(res, {
831
- signal: options.signal,
832
- idleTimeoutMs: opts.idleTimeoutMs,
833
- map: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((raw) => {
834
- if (!raw.data) return null;
835
- let parsed;
836
- try {
837
- parsed = JSON.parse(raw.data);
838
- } catch {
839
- return null;
840
- }
841
- try {
842
- sideChannel(parsed);
843
- } catch {
844
- }
845
- const out = [];
846
- for (const evt of mapPydanticAIEvent(parsed, toolIds)) out.push(evt);
847
- if (out.length === 0) return null;
848
- if (out.length === 1) return out[0];
849
- return out;
850
- }, "map")
851
- });
852
- },
853
- async send(sessionId, content, sendOpts) {
854
- if (opts.send) return opts.send(sessionId, content, sendOpts);
855
- throw new TransportError(
856
- "Buffered send is not supported by this transport",
857
- "unsupported"
858
- );
859
- },
860
- async closeSession(sessionId) {
861
- if (opts.closeSession) await opts.closeSession(sessionId);
862
- }
863
- };
864
- }
865
- chunkOLISEQHS_cjs.__name(createPydanticAIChatTransport, "createPydanticAIChatTransport");
866
- var SIZE_PX = { sm: 44, md: 56, lg: 64 };
867
- var ICON_PX = { sm: 18, md: 22, lg: 26 };
868
- function useEffectiveFABSize(size, inline) {
869
- const isPhone = hooks.useIsPhone();
870
- const isBelowDesktop = hooks.useIsTabletOrBelow();
871
- if (size !== "responsive") return size;
872
- if (inline) return "md";
873
- if (isPhone) return "sm";
874
- if (isBelowDesktop) return "md";
875
- return "lg";
876
- }
877
- chunkOLISEQHS_cjs.__name(useEffectiveFABSize, "useEffectiveFABSize");
878
- function positionStyle(position, offset2) {
879
- const [vert, horiz] = position.split("-");
880
- return { [vert]: offset2, [horiz]: offset2 };
881
- }
882
- chunkOLISEQHS_cjs.__name(positionStyle, "positionStyle");
883
- function tooltipSideClasses(position) {
884
- return position.endsWith("right") ? "right-full mr-3 origin-right" : "left-full ml-3 origin-left";
885
- }
886
- chunkOLISEQHS_cjs.__name(tooltipSideClasses, "tooltipSideClasses");
887
- function Badge({ value }) {
888
- const display = value > 9 ? "9+" : String(value);
889
- return /* @__PURE__ */ jsxRuntime.jsx(
890
- "span",
891
- {
892
- "aria-hidden": "true",
893
- className: lib.cn(
894
- "absolute -right-1 -top-1 inline-flex min-w-[18px] h-[18px] items-center justify-center",
895
- "rounded-full bg-destructive px-1 text-[10px] font-semibold leading-none text-destructive-foreground",
896
- "ring-2 ring-background"
897
- ),
898
- children: display
899
- }
900
- );
901
- }
902
- chunkOLISEQHS_cjs.__name(Badge, "Badge");
903
- function PulseDot() {
904
- return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "absolute right-1 top-1", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative inline-flex h-2.5 w-2.5", children: [
905
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inset-0 rounded-full bg-destructive opacity-75 animate-ping" }),
906
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative inline-flex h-2.5 w-2.5 rounded-full bg-destructive ring-2 ring-background" })
907
- ] }) });
908
- }
909
- chunkOLISEQHS_cjs.__name(PulseDot, "PulseDot");
910
- function Tooltip({ text, side }) {
911
- return /* @__PURE__ */ jsxRuntime.jsx(
912
- "span",
913
- {
914
- role: "tooltip",
915
- className: lib.cn(
916
- "pointer-events-none absolute top-1/2 -translate-y-1/2 whitespace-nowrap",
917
- "rounded-md bg-popover px-2.5 py-1 text-xs font-medium text-popover-foreground shadow-md",
918
- "border border-border opacity-0 scale-95 transition-all duration-150",
919
- "group-hover:opacity-100 group-hover:scale-100",
920
- "group-focus-within:opacity-100 group-focus-within:scale-100",
921
- side
922
- ),
923
- children: text
924
- }
925
- );
926
- }
927
- chunkOLISEQHS_cjs.__name(Tooltip, "Tooltip");
928
- function ChatFAB({
929
- onClick,
930
- ariaLabel = "Open chat",
931
- icon,
932
- variant = "simple",
933
- size = "responsive",
934
- position = "bottom-right",
935
- offset: offset2 = 24,
936
- zIndex = 9999,
937
- pulse = false,
938
- badge,
939
- tooltip,
940
- inline = false,
941
- className,
942
- style
943
- }) {
944
- const effectiveSize = useEffectiveFABSize(size, inline);
945
- const px = SIZE_PX[effectiveSize];
946
- const iconPx = ICON_PX[effectiveSize];
947
- const renderedIcon = icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { size: iconPx });
948
- const baseButton = lib.cn(
949
- "relative grid place-items-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
950
- "transition-transform hover:scale-105"
951
- );
952
- return /* @__PURE__ */ jsxRuntime.jsxs(
953
- "div",
954
- {
955
- className: lib.cn("group", inline ? "relative inline-flex" : "fixed"),
956
- style: inline ? void 0 : { ...positionStyle(position, offset2), zIndex },
957
- children: [
958
- variant === "animated" && /* @__PURE__ */ jsxRuntime.jsx(
959
- AnimatedFAB,
960
- {
961
- ariaLabel,
962
- onClick,
963
- size: px,
964
- className,
965
- style,
966
- children: renderedIcon
967
- }
968
- ),
969
- variant === "glass" && /* @__PURE__ */ jsxRuntime.jsxs(
970
- "button",
971
- {
972
- type: "button",
973
- "aria-label": ariaLabel,
974
- onClick,
975
- className: lib.cn(
976
- baseButton,
977
- "border border-border/40 bg-background/60 text-foreground shadow-lg backdrop-blur-xl",
978
- "hover:bg-background/80",
979
- className
980
- ),
981
- style: { width: px, height: px, ...style },
982
- children: [
983
- renderedIcon,
984
- badge !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { value: badge }) : pulse ? /* @__PURE__ */ jsxRuntime.jsx(PulseDot, {}) : null
985
- ]
986
- }
987
- ),
988
- variant === "simple" && /* @__PURE__ */ jsxRuntime.jsxs(
989
- "button",
990
- {
991
- type: "button",
992
- "aria-label": ariaLabel,
993
- onClick,
994
- className: lib.cn(
995
- baseButton,
996
- "bg-primary text-primary-foreground hover:bg-primary/90 shadow-2xl",
997
- className
998
- ),
999
- style: { width: px, height: px, ...style },
1000
- children: [
1001
- renderedIcon,
1002
- badge !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { value: badge }) : pulse ? /* @__PURE__ */ jsxRuntime.jsx(PulseDot, {}) : null
1003
- ]
1004
- }
1005
- ),
1006
- tooltip && /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { text: tooltip, side: tooltipSideClasses(position) })
1007
- ]
1008
- }
1009
- );
1010
- }
1011
- chunkOLISEQHS_cjs.__name(ChatFAB, "ChatFAB");
1012
- function AnimatedFAB({ ariaLabel, onClick, size, className, style, children }) {
1013
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1014
- /* @__PURE__ */ jsxRuntime.jsx("style", { children: ANIMATED_CSS }),
1015
- /* @__PURE__ */ jsxRuntime.jsx(
1016
- "div",
1017
- {
1018
- className: lib.cn("cmdop-fab-anim", className),
1019
- style: { width: size, height: size, ...style },
1020
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cmdop-fab-anim-glow", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "cmdop-fab-anim-wrap", children: [
1021
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cmdop-fab-anim-grad cmdop-fab-anim-grad-1" }),
1022
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cmdop-fab-anim-grad cmdop-fab-anim-grad-2" }),
1023
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "cmdop-fab-anim-inner" }),
1024
- /* @__PURE__ */ jsxRuntime.jsx(
1025
- "button",
1026
- {
1027
- type: "button",
1028
- "aria-label": ariaLabel,
1029
- onClick,
1030
- className: "cmdop-fab-anim-btn",
1031
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "cmdop-fab-anim-icon", children })
1032
- }
1033
- )
1034
- ] }) })
1035
- }
1036
- )
1037
- ] });
1038
- }
1039
- chunkOLISEQHS_cjs.__name(AnimatedFAB, "AnimatedFAB");
1040
- var ANIMATED_CSS = `
1041
- .cmdop-fab-anim {
1042
- position: relative;
1043
- pointer-events: auto;
1044
- }
1045
- .cmdop-fab-anim-glow {
1046
- width: 100%; height: 100%;
1047
- border-radius: 50%;
1048
- overflow: hidden;
1049
- animation:
1050
- cmdop-fab-entrance 0.6s cubic-bezier(0.34, 1.45, 0.64, 1) forwards,
1051
- cmdop-fab-glow-shift 8s ease-in-out 0.6s infinite;
1052
- }
1053
- .cmdop-fab-anim-wrap {
1054
- position: relative; width: 100%; height: 100%;
1055
- border-radius: 50%; overflow: hidden;
1056
- }
1057
- .cmdop-fab-anim-grad { position: absolute; inset: 0; border-radius: 50%; }
1058
- .cmdop-fab-anim-grad-1 {
1059
- background: conic-gradient(
1060
- from 0deg,
1061
- #fbbf24 0%, rgba(251,191,36,0) 15%,
1062
- rgba(168,85,247,0) 20%, #a855f7 35%, rgba(168,85,247,0) 50%,
1063
- rgba(20,184,166,0) 55%, #14b8a6 70%, rgba(20,184,166,0) 85%,
1064
- rgba(236,72,153,0) 88%, #ec4899 97%, #fbbf24 100%
1065
- );
1066
- animation: cmdop-fab-rotate 7s linear infinite;
1067
- filter: blur(1px); opacity: 0.95;
1068
- }
1069
- .cmdop-fab-anim-grad-2 {
1070
- inset: 1px;
1071
- background: conic-gradient(
1072
- from 180deg,
1073
- #a855f7 0%, rgba(168,85,247,0) 20%,
1074
- rgba(20,184,166,0) 30%, #14b8a6 50%, rgba(20,184,166,0) 70%,
1075
- rgba(251,191,36,0) 75%, #fbbf24 95%, #a855f7 100%
1076
- );
1077
- animation: cmdop-fab-rotate-rev 9s linear infinite;
1078
- filter: blur(0.75px); opacity: 0.7;
1079
- }
1080
- .cmdop-fab-anim-inner {
1081
- position: absolute; inset: 3px; border-radius: 50%;
1082
- background: rgba(10, 10, 10, 0.65);
1083
- backdrop-filter: blur(12px) saturate(1.8);
1084
- -webkit-backdrop-filter: blur(12px) saturate(1.8);
1085
- animation: cmdop-fab-inner-glow 5s ease-in-out infinite;
1086
- }
1087
- .cmdop-fab-anim-btn {
1088
- position: absolute; inset: 2px;
1089
- border-radius: 50%; border: none; background: transparent;
1090
- cursor: pointer; display: flex; align-items: center; justify-content: center;
1091
- transition: transform 0.2s;
1092
- }
1093
- .cmdop-fab-anim-btn:hover { transform: scale(1.06); }
1094
- .cmdop-fab-anim-icon {
1095
- color: #fbbf24; display: flex;
1096
- filter: drop-shadow(0 0 6px rgba(251,191,36,0.8));
1097
- animation: cmdop-fab-icon-pulse 2.5s ease-in-out infinite;
1098
- }
1099
- @keyframes cmdop-fab-rotate { to { transform: rotate(360deg); } }
1100
- @keyframes cmdop-fab-rotate-rev { to { transform: rotate(-360deg); } }
1101
- @keyframes cmdop-fab-entrance {
1102
- 0% { transform: scale(0); }
1103
- 50% { transform: scale(1.08); }
1104
- 70% { transform: scale(0.98); }
1105
- 100% { transform: scale(1); }
1106
- }
1107
- @keyframes cmdop-fab-glow-shift {
1108
- 0%, 100% { box-shadow: 0 0 20px rgba(251,191,36,0.5), 0 0 40px rgba(168,85,247,0.3); }
1109
- 33% { box-shadow: 0 0 20px rgba(168,85,247,0.5), 0 0 40px rgba(20,184,166,0.3); }
1110
- 66% { box-shadow: 0 0 20px rgba(20,184,166,0.5), 0 0 40px rgba(236,72,153,0.3); }
1111
- }
1112
- @keyframes cmdop-fab-icon-pulse {
1113
- 0%, 100% { opacity: 1; transform: scale(1); }
1114
- 50% { opacity: 0.85; transform: scale(1.15); }
1115
- }
1116
- @keyframes cmdop-fab-inner-glow {
1117
- 0%, 100% { box-shadow: inset 0 0 20px rgba(251,191,36,0.25), inset 0 0 40px rgba(168,85,247,0.15); }
1118
- 50% { box-shadow: inset 0 0 25px rgba(168,85,247,0.3), inset 0 0 45px rgba(20,184,166,0.2); }
1119
- }
1120
- `;
1121
- function ChatHeader({
1122
- title,
1123
- icon,
1124
- actions,
1125
- showClose = true,
1126
- onClose,
1127
- closeLabel = "Close",
1128
- closeSlot,
1129
- className
1130
- }) {
1131
- return /* @__PURE__ */ jsxRuntime.jsxs(
1132
- "header",
1133
- {
1134
- className: lib.cn(
1135
- "border-border bg-muted/30 flex shrink-0 items-center justify-between border-b px-4 py-2.5",
1136
- className
1137
- ),
1138
- children: [
1139
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2 text-sm font-semibold", children: [
1140
- icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "text-primary h-4 w-4 shrink-0" }),
1141
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: title })
1142
- ] }),
1143
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5", children: [
1144
- actions,
1145
- closeSlot ?? (showClose && onClose && /* @__PURE__ */ jsxRuntime.jsx(
1146
- components.Button,
1147
- {
1148
- variant: "ghost",
1149
- size: "sm",
1150
- onClick: onClose,
1151
- "aria-label": closeLabel,
1152
- className: "-mr-1 h-7 w-7 p-0",
1153
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
1154
- }
1155
- ))
1156
- ] })
1157
- ]
1158
- }
1159
- );
1160
- }
1161
- chunkOLISEQHS_cjs.__name(ChatHeader, "ChatHeader");
1162
- function useChatPresence(open, exitDurationMs = 200) {
1163
- const [phase, setPhase] = React.useState("hidden");
1164
- const timerRef = React.useRef(null);
1165
- React.useEffect(() => {
1166
- if (timerRef.current) clearTimeout(timerRef.current);
1167
- if (open) {
1168
- setPhase("entering");
1169
- timerRef.current = setTimeout(() => setPhase("visible"), 16);
1170
- } else {
1171
- setPhase("leaving");
1172
- timerRef.current = setTimeout(() => setPhase("hidden"), exitDurationMs);
1173
- }
1174
- return () => {
1175
- if (timerRef.current) clearTimeout(timerRef.current);
1176
- };
1177
- }, [open, exitDurationMs]);
1178
- return phase;
1179
- }
1180
- chunkOLISEQHS_cjs.__name(useChatPresence, "useChatPresence");
1181
- function dockPositionStyle(position, horizontal, vertical) {
1182
- const [vert, horiz] = position.split("-");
1183
- return { [vert]: vertical, [horiz]: horizontal };
1184
- }
1185
- chunkOLISEQHS_cjs.__name(dockPositionStyle, "dockPositionStyle");
1186
- function ChatDock({
1187
- open,
1188
- onClose,
1189
- children,
1190
- mode = "popover",
1191
- side = "right",
1192
- title = "Chat",
1193
- icon,
1194
- headerActions,
1195
- hideHeader = false,
1196
- closeLabel,
1197
- width,
1198
- height = 720,
1199
- position = "bottom-right",
1200
- offset: offset2,
1201
- exitDurationMs = 200,
1202
- zIndex = 1e4,
1203
- ariaLabel,
1204
- className,
1205
- mobileFullscreen = true,
1206
- disablePortal = false,
1207
- inline = false,
1208
- reserveBodySpace
1209
- }) {
1210
- const phase = useChatPresence(open, exitDurationMs);
1211
- const isMobile = hooks.useIsMobile();
1212
- const isBelowDesktop = hooks.useIsTabletOrBelow();
1213
- const effectiveMode = mode === "side" && !isBelowDesktop ? "side" : "popover";
1214
- const fullscreen = mobileFullscreen && isMobile;
1215
- const wantsReserve = !inline && !fullscreen && effectiveMode === "side" && (reserveBodySpace ?? true);
1216
- const resolvedSideWidth = width ?? 420;
1217
- React.useEffect(() => {
1218
- if (!wantsReserve || phase === "hidden") return;
1219
- const body = document.body;
1220
- if (!body) return;
1221
- const cssVar = `${resolvedSideWidth}px`;
1222
- const padKey = side === "right" ? "paddingRight" : "paddingLeft";
1223
- const prevPad = body.style[padKey];
1224
- const prevVar = body.style.getPropertyValue("--chat-dock-reserve");
1225
- body.style[padKey] = cssVar;
1226
- body.style.setProperty("--chat-dock-reserve", cssVar);
1227
- return () => {
1228
- body.style[padKey] = prevPad;
1229
- if (prevVar) body.style.setProperty("--chat-dock-reserve", prevVar);
1230
- else body.style.removeProperty("--chat-dock-reserve");
1231
- };
1232
- }, [wantsReserve, phase, side, resolvedSideWidth]);
1233
- if (phase === "hidden") return null;
1234
- const animating = phase === "entering" || phase === "leaving";
1235
- const horizontal = offset2?.horizontal ?? 24;
1236
- const vertical = offset2?.vertical ?? 96;
1237
- const resolvedWidth = width ?? (effectiveMode === "side" ? resolvedSideWidth : 480);
1238
- let containerStyle;
1239
- let cornerClass;
1240
- const dynVH = "100dvh";
1241
- if (inline) {
1242
- containerStyle = {
1243
- position: "relative",
1244
- width: resolvedWidth,
1245
- height,
1246
- maxHeight: `calc(${dynVH} - 16px)`,
1247
- pointerEvents: phase === "visible" ? "auto" : "none"
1248
- };
1249
- cornerClass = "rounded-xl border";
1250
- } else if (fullscreen) {
1251
- containerStyle = {
1252
- position: "fixed",
1253
- top: 0,
1254
- [side === "left" ? "left" : "right"]: 0,
1255
- width: "100vw",
1256
- height: dynVH,
1257
- zIndex,
1258
- pointerEvents: phase === "visible" ? "auto" : "none"
1259
- };
1260
- cornerClass = "rounded-none border-0";
1261
- } else if (effectiveMode === "side") {
1262
- containerStyle = {
1263
- position: "fixed",
1264
- top: 0,
1265
- [side]: 0,
1266
- height: dynVH,
1267
- zIndex,
1268
- width: `min(${resolvedWidth}px, 100vw)`,
1269
- pointerEvents: phase === "visible" ? "auto" : "none"
1270
- };
1271
- cornerClass = side === "right" ? "rounded-none border-l" : "rounded-none border-r";
1272
- } else {
1273
- const heightCap = `calc(${dynVH} - ${vertical + 24}px)`;
1274
- containerStyle = {
1275
- position: "fixed",
1276
- ...dockPositionStyle(position, horizontal, vertical),
1277
- zIndex,
1278
- width: `min(${resolvedWidth}px, calc(100vw - 32px))`,
1279
- height: `min(${height}px, ${heightCap})`,
1280
- minHeight: `min(320px, ${heightCap})`,
1281
- pointerEvents: phase === "visible" ? "auto" : "none"
1282
- };
1283
- cornerClass = "rounded-xl border";
1284
- }
1285
- const enterClass = (() => {
1286
- if (fullscreen) return "opacity-0";
1287
- if (effectiveMode === "side") {
1288
- return side === "right" ? "opacity-0 translate-x-4" : "opacity-0 -translate-x-4";
1289
- }
1290
- return "opacity-0 scale-95 translate-y-2";
1291
- })();
1292
- const visibleClass = "opacity-100 scale-100 translate-y-0 translate-x-0";
1293
- return /* @__PURE__ */ jsxRuntime.jsx(components.Portal, { disablePortal: disablePortal || inline, children: /* @__PURE__ */ jsxRuntime.jsxs(
1294
- "div",
1295
- {
1296
- role: "dialog",
1297
- "aria-label": ariaLabel ?? (typeof title === "string" ? title : "Chat"),
1298
- "aria-hidden": phase === "leaving",
1299
- className: lib.cn(
1300
- "bg-popover text-popover-foreground border-border",
1301
- "flex flex-col overflow-hidden shadow-2xl",
1302
- cornerClass,
1303
- "transition-all duration-200 ease-out",
1304
- animating ? enterClass : visibleClass,
1305
- className
1306
- ),
1307
- style: containerStyle,
1308
- children: [
1309
- !hideHeader && /* @__PURE__ */ jsxRuntime.jsx(
1310
- ChatHeader,
1311
- {
1312
- title,
1313
- icon,
1314
- actions: headerActions,
1315
- onClose,
1316
- closeLabel
1317
- }
1318
- ),
1319
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 min-w-0 flex-1 overflow-hidden", children })
1320
- ]
1321
- }
1322
- ) });
1323
- }
1324
- chunkOLISEQHS_cjs.__name(ChatDock, "ChatDock");
1325
- var ChatHeaderActionButton = React.forwardRef(
1326
- /* @__PURE__ */ chunkOLISEQHS_cjs.__name(function ChatHeaderActionButton2({ icon, ariaLabel, badge, destructive, loading, disabled, className, ...rest }, ref) {
1327
- return /* @__PURE__ */ jsxRuntime.jsxs(
1328
- "button",
1329
- {
1330
- ref,
1331
- type: "button",
1332
- "aria-label": ariaLabel,
1333
- title: ariaLabel,
1334
- disabled: disabled || loading,
1335
- className: lib.cn(
1336
- "relative inline-flex h-7 w-7 items-center justify-center rounded-md",
1337
- "text-muted-foreground transition-colors",
1338
- "hover:bg-accent hover:text-foreground",
1339
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1340
- "disabled:opacity-50 disabled:cursor-not-allowed",
1341
- destructive && "hover:bg-destructive/15 hover:text-destructive",
1342
- loading && "animate-pulse",
1343
- className
1344
- ),
1345
- ...rest,
1346
- children: [
1347
- icon,
1348
- badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
1349
- "span",
1350
- {
1351
- "aria-hidden": "true",
1352
- className: "absolute -right-0.5 -top-0.5 inline-flex min-w-[14px] h-[14px] items-center justify-center rounded-full bg-destructive px-1 text-[9px] font-semibold leading-none text-destructive-foreground ring-2 ring-background",
1353
- children: badge > 9 ? "9+" : badge
1354
- }
1355
- )
1356
- ]
1357
- }
1358
- );
1359
- }, "ChatHeaderActionButton")
1360
- );
1361
- function ChatHeaderModeToggle({
1362
- mode,
1363
- onToggle,
1364
- expandLabel = "Dock to side",
1365
- collapseLabel = "Back to popover",
1366
- forceVisible = false
1367
- }) {
1368
- const isBelowDesktop = hooks.useIsTabletOrBelow();
1369
- if (isBelowDesktop && !forceVisible) return null;
1370
- const isSide = mode === "side";
1371
- return /* @__PURE__ */ jsxRuntime.jsx(
1372
- ChatHeaderActionButton,
1373
- {
1374
- icon: isSide ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelRightClose, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelRightOpen, { className: "h-3.5 w-3.5" }),
1375
- ariaLabel: isSide ? collapseLabel : expandLabel,
1376
- onClick: onToggle
1377
- }
1378
- );
1379
- }
1380
- chunkOLISEQHS_cjs.__name(ChatHeaderModeToggle, "ChatHeaderModeToggle");
1381
- function ChatHeaderAudioToggle({
1382
- muted,
1383
- onToggle,
1384
- unmuteLabel = "Unmute notifications",
1385
- muteLabel = "Mute notifications"
1386
- }) {
1387
- return /* @__PURE__ */ jsxRuntime.jsx(
1388
- ChatHeaderActionButton,
1389
- {
1390
- icon: muted ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.VolumeX, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Volume2, { className: "h-3.5 w-3.5" }),
1391
- ariaLabel: muted ? unmuteLabel : muteLabel,
1392
- onClick: onToggle
1393
- }
1394
- );
1395
- }
1396
- chunkOLISEQHS_cjs.__name(ChatHeaderAudioToggle, "ChatHeaderAudioToggle");
1397
- function useChatReset(opts) {
1398
- const { onReset, onSuccess, onError } = opts;
1399
- const [isResetting, setIsResetting] = React.useState(false);
1400
- const reset = React.useCallback(async () => {
1401
- if (isResetting) return false;
1402
- setIsResetting(true);
1403
- try {
1404
- const ok = await onReset();
1405
- if (ok) onSuccess?.();
1406
- else onError?.();
1407
- return ok;
1408
- } catch (err) {
1409
- onError?.(err);
1410
- return false;
1411
- } finally {
1412
- setIsResetting(false);
1413
- }
1414
- }, [isResetting, onReset, onSuccess, onError]);
1415
- return { reset, isResetting };
1416
- }
1417
- chunkOLISEQHS_cjs.__name(useChatReset, "useChatReset");
1418
- var DEFAULT_TITLE = "Clear conversation?";
1419
- var DEFAULT_MESSAGE = "The assistant will forget this session and start a new one. This cannot be undone.";
1420
- var DEFAULT_LABEL = "Clear conversation";
1421
- function ChatHeaderResetButton({
1422
- onReset,
1423
- onSuccess,
1424
- onError,
1425
- confirm = true,
1426
- confirmTitle = DEFAULT_TITLE,
1427
- confirmMessage = DEFAULT_MESSAGE,
1428
- ariaLabel = DEFAULT_LABEL
1429
- }) {
1430
- const { reset, isResetting } = useChatReset({ onReset, onSuccess, onError });
1431
- const handleClick = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(async () => {
1432
- if (confirm) {
1433
- const api = typeof window !== "undefined" ? window.dialog : void 0;
1434
- if (api?.confirm) {
1435
- const ok = await api.confirm({
1436
- title: confirmTitle,
1437
- message: confirmMessage,
1438
- variant: "destructive",
1439
- confirmText: "Clear",
1440
- cancelText: "Cancel"
1441
- });
1442
- if (!ok) return;
1443
- } else if (typeof window !== "undefined" && typeof window.confirm === "function") {
1444
- const ok = window.confirm(`${confirmTitle}
1445
-
1446
- ${confirmMessage}`);
1447
- if (!ok) return;
1448
- }
1449
- }
1450
- await reset();
1451
- }, "handleClick");
1452
- return /* @__PURE__ */ jsxRuntime.jsx(
1453
- ChatHeaderActionButton,
1454
- {
1455
- icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { className: "h-3.5 w-3.5" }),
1456
- ariaLabel,
1457
- onClick: handleClick,
1458
- loading: isResetting,
1459
- destructive: true
1460
- }
1461
- );
1462
- }
1463
- chunkOLISEQHS_cjs.__name(ChatHeaderResetButton, "ChatHeaderResetButton");
1464
-
1465
- // src/tools/SpeechRecognition/core/languages-catalog.ts
1466
- var WEB_SPEECH_LANGUAGES = [
1467
- { name: "Afrikaans", iso: "af", englishName: "afrikaans", dialects: [{ code: "af-ZA", region: "South Africa" }] },
1468
- { name: "\u12A0\u121B\u122D\u129B", iso: "am", englishName: "amharic", dialects: [{ code: "am-ET", region: "Ethiopia" }] },
1469
- { name: "Az\u0259rbaycanca", iso: "az", englishName: "azerbaijani", dialects: [{ code: "az-AZ", region: "Azerbaijan" }] },
1470
- {
1471
- name: "\u09AC\u09BE\u0982\u09B2\u09BE",
1472
- iso: "bn",
1473
- englishName: "bengali",
1474
- dialects: [
1475
- { code: "bn-BD", region: "Bangladesh" },
1476
- { code: "bn-IN", region: "India" }
1477
- ]
1478
- },
1479
- { name: "Bahasa Indonesia", iso: "id", englishName: "indonesian", dialects: [{ code: "id-ID", region: "Indonesia" }] },
1480
- { name: "Bahasa Melayu", iso: "ms", englishName: "malay", dialects: [{ code: "ms-MY", region: "Malaysia" }] },
1481
- { name: "Catal\xE0", iso: "ca", englishName: "catalan", dialects: [{ code: "ca-ES", region: "Spain" }] },
1482
- { name: "\u010Ce\u0161tina", iso: "cs", englishName: "czech", dialects: [{ code: "cs-CZ", region: "Czechia" }] },
1483
- { name: "Dansk", iso: "da", englishName: "danish", dialects: [{ code: "da-DK", region: "Denmark" }] },
1484
- { name: "Deutsch", iso: "de", englishName: "german", dialects: [{ code: "de-DE", region: "Germany" }] },
1485
- {
1486
- name: "English",
1487
- iso: "en",
1488
- englishName: "english",
1489
- dialects: [
1490
- { code: "en-US", region: "United States" },
1491
- { code: "en-GB", region: "United Kingdom" },
1492
- { code: "en-AU", region: "Australia" },
1493
- { code: "en-CA", region: "Canada" },
1494
- { code: "en-IN", region: "India" },
1495
- { code: "en-NZ", region: "New Zealand" },
1496
- { code: "en-PH", region: "Philippines" },
1497
- { code: "en-ZA", region: "South Africa" },
1498
- { code: "en-NG", region: "Nigeria" },
1499
- { code: "en-GH", region: "Ghana" },
1500
- { code: "en-KE", region: "Kenya" },
1501
- { code: "en-TZ", region: "Tanzania" }
1502
- ]
1503
- },
1504
- {
1505
- name: "Espa\xF1ol",
1506
- iso: "es",
1507
- englishName: "spanish",
1508
- dialects: [
1509
- { code: "es-ES", region: "Espa\xF1a" },
1510
- { code: "es-MX", region: "M\xE9xico" },
1511
- { code: "es-US", region: "Estados Unidos" },
1512
- { code: "es-AR", region: "Argentina" },
1513
- { code: "es-CL", region: "Chile" },
1514
- { code: "es-CO", region: "Colombia" },
1515
- { code: "es-PE", region: "Per\xFA" },
1516
- { code: "es-VE", region: "Venezuela" },
1517
- { code: "es-EC", region: "Ecuador" },
1518
- { code: "es-GT", region: "Guatemala" },
1519
- { code: "es-CR", region: "Costa Rica" },
1520
- { code: "es-PA", region: "Panam\xE1" },
1521
- { code: "es-DO", region: "Rep. Dominicana" },
1522
- { code: "es-UY", region: "Uruguay" },
1523
- { code: "es-PY", region: "Paraguay" },
1524
- { code: "es-BO", region: "Bolivia" },
1525
- { code: "es-SV", region: "El Salvador" },
1526
- { code: "es-HN", region: "Honduras" },
1527
- { code: "es-NI", region: "Nicaragua" },
1528
- { code: "es-PR", region: "Puerto Rico" }
1529
- ]
1530
- },
1531
- { name: "Euskara", iso: "eu", englishName: "basque", dialects: [{ code: "eu-ES", region: "Spain" }] },
1532
- { name: "Filipino", iso: "fil", englishName: "filipino tagalog", dialects: [{ code: "fil-PH", region: "Philippines" }] },
1533
- { name: "Fran\xE7ais", iso: "fr", englishName: "french", dialects: [{ code: "fr-FR", region: "France" }] },
1534
- { name: "Basa Jawa", iso: "jv", englishName: "javanese", dialects: [{ code: "jv-ID", region: "Indonesia" }] },
1535
- { name: "Galego", iso: "gl", englishName: "galician", dialects: [{ code: "gl-ES", region: "Spain" }] },
1536
- { name: "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0", iso: "gu", englishName: "gujarati", dialects: [{ code: "gu-IN", region: "India" }] },
1537
- { name: "Hrvatski", iso: "hr", englishName: "croatian", dialects: [{ code: "hr-HR", region: "Croatia" }] },
1538
- { name: "IsiZulu", iso: "zu", englishName: "zulu", dialects: [{ code: "zu-ZA", region: "South Africa" }] },
1539
- { name: "\xCDslenska", iso: "is", englishName: "icelandic", dialects: [{ code: "is-IS", region: "Iceland" }] },
1540
- {
1541
- name: "Italiano",
1542
- iso: "it",
1543
- englishName: "italian",
1544
- dialects: [
1545
- { code: "it-IT", region: "Italia" },
1546
- { code: "it-CH", region: "Svizzera" }
1547
- ]
1548
- },
1549
- { name: "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1", iso: "kn", englishName: "kannada", dialects: [{ code: "kn-IN", region: "India" }] },
1550
- { name: "\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A", iso: "km", englishName: "khmer cambodian", dialects: [{ code: "km-KH", region: "Cambodia" }] },
1551
- { name: "Latvie\u0161u", iso: "lv", englishName: "latvian", dialects: [{ code: "lv-LV", region: "Latvia" }] },
1552
- { name: "Lietuvi\u0173", iso: "lt", englishName: "lithuanian", dialects: [{ code: "lt-LT", region: "Lithuania" }] },
1553
- { name: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02", iso: "ml", englishName: "malayalam", dialects: [{ code: "ml-IN", region: "India" }] },
1554
- { name: "\u092E\u0930\u093E\u0920\u0940", iso: "mr", englishName: "marathi", dialects: [{ code: "mr-IN", region: "India" }] },
1555
- { name: "Magyar", iso: "hu", englishName: "hungarian", dialects: [{ code: "hu-HU", region: "Hungary" }] },
1556
- { name: "\u0EA5\u0EB2\u0EA7", iso: "lo", englishName: "lao laotian", dialects: [{ code: "lo-LA", region: "Laos" }] },
1557
- { name: "Nederlands", iso: "nl", englishName: "dutch", dialects: [{ code: "nl-NL", region: "Netherlands" }] },
1558
- { name: "\u0928\u0947\u092A\u093E\u0932\u0940 \u092D\u093E\u0937\u093E", iso: "ne", englishName: "nepali", dialects: [{ code: "ne-NP", region: "Nepal" }] },
1559
- { name: "Norsk bokm\xE5l", iso: "nb", englishName: "norwegian bokmal", dialects: [{ code: "nb-NO", region: "Norway" }] },
1560
- { name: "Polski", iso: "pl", englishName: "polish", dialects: [{ code: "pl-PL", region: "Poland" }] },
1561
- {
1562
- name: "Portugu\xEAs",
1563
- iso: "pt",
1564
- englishName: "portuguese",
1565
- dialects: [
1566
- { code: "pt-BR", region: "Brasil" },
1567
- { code: "pt-PT", region: "Portugal" }
1568
- ]
1569
- },
1570
- { name: "Rom\xE2n\u0103", iso: "ro", englishName: "romanian", dialects: [{ code: "ro-RO", region: "Romania" }] },
1571
- { name: "\u0DC3\u0DD2\u0D82\u0DC4\u0DBD", iso: "si", englishName: "sinhala sinhalese", dialects: [{ code: "si-LK", region: "Sri Lanka" }] },
1572
- { name: "Sloven\u0161\u010Dina", iso: "sl", englishName: "slovenian", dialects: [{ code: "sl-SI", region: "Slovenia" }] },
1573
- { name: "Basa Sunda", iso: "su", englishName: "sundanese", dialects: [{ code: "su-ID", region: "Indonesia" }] },
1574
- { name: "Sloven\u010Dina", iso: "sk", englishName: "slovak", dialects: [{ code: "sk-SK", region: "Slovakia" }] },
1575
- { name: "Suomi", iso: "fi", englishName: "finnish", dialects: [{ code: "fi-FI", region: "Finland" }] },
1576
- { name: "Svenska", iso: "sv", englishName: "swedish", dialects: [{ code: "sv-SE", region: "Sweden" }] },
1577
- {
1578
- name: "Kiswahili",
1579
- iso: "sw",
1580
- englishName: "swahili",
1581
- dialects: [
1582
- { code: "sw-TZ", region: "Tanzania" },
1583
- { code: "sw-KE", region: "Kenya" }
1584
- ]
1585
- },
1586
- { name: "\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8", iso: "ka", englishName: "georgian", dialects: [{ code: "ka-GE", region: "Georgia" }] },
1587
- { name: "\u0540\u0561\u0575\u0565\u0580\u0565\u0576", iso: "hy", englishName: "armenian", dialects: [{ code: "hy-AM", region: "Armenia" }] },
1588
- {
1589
- name: "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",
1590
- iso: "ta",
1591
- englishName: "tamil",
1592
- dialects: [
1593
- { code: "ta-IN", region: "\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE" },
1594
- { code: "ta-SG", region: "\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD" },
1595
- { code: "ta-LK", region: "\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8" },
1596
- { code: "ta-MY", region: "\u0BAE\u0BB2\u0BC7\u0B9A\u0BBF\u0BAF\u0BBE" }
1597
- ]
1598
- },
1599
- { name: "\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41", iso: "te", englishName: "telugu", dialects: [{ code: "te-IN", region: "India" }] },
1600
- { name: "Ti\u1EBFng Vi\u1EC7t", iso: "vi", englishName: "vietnamese", dialects: [{ code: "vi-VN", region: "Vietnam" }] },
1601
- { name: "T\xFCrk\xE7e", iso: "tr", englishName: "turkish", dialects: [{ code: "tr-TR", region: "T\xFCrkiye" }] },
1602
- {
1603
- name: "\u0627\u064F\u0631\u062F\u064F\u0648",
1604
- iso: "ur",
1605
- englishName: "urdu",
1606
- dialects: [
1607
- { code: "ur-PK", region: "\u067E\u0627\u06A9\u0633\u062A\u0627\u0646" },
1608
- { code: "ur-IN", region: "\u0628\u06BE\u0627\u0631\u062A" }
1609
- ]
1610
- },
1611
- { name: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC", iso: "el", englishName: "greek", dialects: [{ code: "el-GR", region: "Greece" }] },
1612
- { name: "\u0431\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438", iso: "bg", englishName: "bulgarian", dialects: [{ code: "bg-BG", region: "Bulgaria" }] },
1613
- { name: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439", iso: "ru", englishName: "russian", dialects: [{ code: "ru-RU", region: "Russia" }] },
1614
- { name: "\u0421\u0440\u043F\u0441\u043A\u0438", iso: "sr", englishName: "serbian", dialects: [{ code: "sr-RS", region: "Serbia" }] },
1615
- { name: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430", iso: "uk", englishName: "ukrainian", dialects: [{ code: "uk-UA", region: "Ukraine" }] },
1616
- { name: "\uD55C\uAD6D\uC5B4", iso: "ko", englishName: "korean", dialects: [{ code: "ko-KR", region: "Korea" }] },
1617
- {
1618
- name: "\u4E2D\u6587",
1619
- iso: "cmn",
1620
- englishName: "chinese mandarin cantonese",
1621
- dialects: [
1622
- { code: "cmn-Hans-CN", region: "\u666E\u901A\u8BDD (\u4E2D\u56FD\u5927\u9646)" },
1623
- { code: "cmn-Hans-HK", region: "\u666E\u901A\u8BDD (\u9999\u6E2F)" },
1624
- { code: "cmn-Hant-TW", region: "\u4E2D\u6587 (\u53F0\u7063)" },
1625
- { code: "yue-Hant-HK", region: "\u7CB5\u8A9E (\u9999\u6E2F)" }
1626
- ]
1627
- },
1628
- { name: "\u65E5\u672C\u8A9E", iso: "ja", englishName: "japanese", dialects: [{ code: "ja-JP", region: "Japan" }] },
1629
- { name: "\u0939\u093F\u0928\u094D\u0926\u0940", iso: "hi", englishName: "hindi", dialects: [{ code: "hi-IN", region: "India" }] },
1630
- { name: "\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22", iso: "th", englishName: "thai", dialects: [{ code: "th-TH", region: "Thailand" }] }
1631
- ];
1632
- WEB_SPEECH_LANGUAGES.flatMap(
1633
- (l) => l.dialects.map((d) => d.code)
1634
- );
1635
- function findSpeechLanguage(tag) {
1636
- if (!tag) return null;
1637
- const lower = tag.toLowerCase();
1638
- for (const language of WEB_SPEECH_LANGUAGES) {
1639
- for (const dialect of language.dialects) {
1640
- if (dialect.code.toLowerCase() === lower) return { language, dialect };
1641
- }
1642
- }
1643
- return null;
1644
- }
1645
- chunkOLISEQHS_cjs.__name(findSpeechLanguage, "findSpeechLanguage");
1646
- function countryFromTag(tag) {
1647
- if (!tag) return null;
1648
- const parts = tag.split("-");
1649
- for (let i = parts.length - 1; i >= 0; i -= 1) {
1650
- const p = parts[i];
1651
- if (p.length === 2 && /^[A-Za-z]{2}$/.test(p)) return p.toUpperCase();
1652
- }
1653
- return null;
1654
- }
1655
- chunkOLISEQHS_cjs.__name(countryFromTag, "countryFromTag");
1656
- chunkADEN3UA4_cjs.getSpeechLogger();
1657
- React.createContext(null);
1658
- createLazyComponent(
1659
- () => import('./DictationField-AS2F33WI.cjs').then((mod) => ({
1660
- default: mod.DictationField
1661
- })),
1662
- {
1663
- displayName: "LazyDictationField",
1664
- fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-border/60 bg-card px-3 py-2 text-xs text-muted-foreground", children: "Loading dictation\u2026" })
1665
- }
1666
- );
1667
- function ChatHeaderLanguageButton({
1668
- ariaLabel = "Speech language",
1669
- allowedTags,
1670
- hideFallbackIcon,
1671
- className
1672
- }) {
1673
- const prefs = chunkADEN3UA4_cjs.useSpeechPrefs();
1674
- const active = chunkADEN3UA4_cjs.useResolvedLanguage();
1675
- const options = React.useMemo(() => {
1676
- const allow = allowedTags ? new Set(allowedTags) : null;
1677
- const out = [];
1678
- for (const lang of WEB_SPEECH_LANGUAGES) {
1679
- for (const d of lang.dialects) {
1680
- if (allow && !allow.has(d.code)) continue;
1681
- out.push({
1682
- value: d.code,
1683
- // "Русский" / "Español — Argentina" / "English — United States"
1684
- label: lang.dialects.length === 1 ? lang.name : `${lang.name} \u2014 ${d.region}`,
1685
- // Search-only index: English name, BCP-47 tag, ISO, region.
1686
- // Lets users type "russian" / "ru-RU" / "ru" / "argentina"
1687
- // and still find the row regardless of native script.
1688
- description: `${lang.englishName} ${d.code} ${lang.iso} ${d.region}`.toLowerCase()
1689
- });
1690
- }
1691
- }
1692
- return out;
1693
- }, [allowedTags]);
1694
- return /* @__PURE__ */ jsxRuntime.jsx(
1695
- components.Combobox,
1696
- {
1697
- options,
1698
- value: prefs.language ?? active,
1699
- onValueChange: (v) => prefs.setLanguage(v || null),
1700
- placeholder: ariaLabel,
1701
- searchPlaceholder: "Search language\u2026",
1702
- filterFunction: (opt, search) => {
1703
- const s = search.toLowerCase();
1704
- return opt.label.toLowerCase().includes(s) || opt.value.toLowerCase().includes(s) || (opt.description?.includes(s) ?? false);
1705
- },
1706
- contentClassName: "w-[280px]",
1707
- contentStyle: { zIndex: 10001 },
1708
- renderOption: (option) => {
1709
- const country = countryFromTag(option.value);
1710
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
1711
- country ? /* @__PURE__ */ jsxRuntime.jsx(
1712
- components.Flag,
1713
- {
1714
- countryCode: country,
1715
- className: "h-4 w-5 shrink-0 overflow-hidden rounded-[2px] border border-border/60 ring-1 ring-black/5"
1716
- }
1717
- ) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { className: "h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": true }),
1718
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm", children: option.label })
1719
- ] });
1720
- },
1721
- renderTrigger: (selected, open) => {
1722
- const tag = selected?.value ?? active;
1723
- const country = countryFromTag(tag);
1724
- const found = findSpeechLanguage(tag);
1725
- const tooltipLabel = found ? `${found.language.name}${found.language.dialects.length > 1 ? ` \u2014 ${found.dialect.region}` : ""} \xB7 ${tag}` : tag;
1726
- return /* @__PURE__ */ jsxRuntime.jsx(
1727
- "button",
1728
- {
1729
- type: "button",
1730
- "aria-label": `${ariaLabel}: ${tooltipLabel}`,
1731
- "aria-expanded": open,
1732
- title: tooltipLabel,
1733
- className: lib.cn(
1734
- "inline-flex h-7 w-7 items-center justify-center rounded-md",
1735
- "text-muted-foreground transition-colors",
1736
- "hover:bg-accent hover:text-foreground",
1737
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1738
- className
1739
- ),
1740
- children: country ? /* @__PURE__ */ jsxRuntime.jsx(
1741
- components.Flag,
1742
- {
1743
- countryCode: country,
1744
- className: "h-4 w-5 overflow-hidden rounded-[2px] border border-border/60 ring-1 ring-black/5"
1745
- }
1746
- ) : hideFallbackIcon ? null : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, { className: "h-3.5 w-3.5", "aria-hidden": true })
1747
- }
1748
- );
1749
- }
1750
- }
1751
- );
1752
- }
1753
- chunkOLISEQHS_cjs.__name(ChatHeaderLanguageButton, "ChatHeaderLanguageButton");
1754
- function anchorStyle(position, fabOffset, fabClearance) {
1755
- const [vert, horiz] = position.split("-");
1756
- return { [vert]: fabClearance, [horiz]: fabOffset };
1757
- }
1758
- chunkOLISEQHS_cjs.__name(anchorStyle, "anchorStyle");
1759
- function originClass(position) {
1760
- if (position === "bottom-right") return "origin-bottom-right";
1761
- if (position === "bottom-left") return "origin-bottom-left";
1762
- if (position === "top-right") return "origin-top-right";
1763
- return "origin-top-left";
1764
- }
1765
- chunkOLISEQHS_cjs.__name(originClass, "originClass");
1766
- function ChatGreeting({
1767
- open,
1768
- children,
1769
- onClick,
1770
- onDismiss,
1771
- position = "bottom-right",
1772
- fabOffset = 24,
1773
- fabClearance = 96,
1774
- delayMs = 1500,
1775
- zIndex = 9998,
1776
- className,
1777
- style,
1778
- avatar,
1779
- senderName,
1780
- dismissLabel = "Dismiss",
1781
- inline = false
1782
- }) {
1783
- const [delayed, setDelayed] = React.useState(delayMs <= 0);
1784
- React.useEffect(() => {
1785
- if (!open || delayMs <= 0) return;
1786
- const t = setTimeout(() => setDelayed(true), delayMs);
1787
- return () => clearTimeout(t);
1788
- }, [open, delayMs]);
1789
- const shouldShow = open && delayed;
1790
- const phase = useChatPresence(shouldShow, 220);
1791
- if (phase === "hidden") return null;
1792
- const animating = phase === "entering" || phase === "leaving";
1793
- const clickable = !!onClick;
1794
- return /* @__PURE__ */ jsxRuntime.jsxs(
1795
- "div",
1796
- {
1797
- role: clickable ? "button" : "status",
1798
- "aria-live": "polite",
1799
- tabIndex: clickable ? 0 : -1,
1800
- onClick: clickable ? onClick : void 0,
1801
- onKeyDown: clickable ? (e) => {
1802
- if (e.key === "Enter" || e.key === " ") {
1803
- e.preventDefault();
1804
- onClick?.();
1805
- }
1806
- } : void 0,
1807
- className: lib.cn(
1808
- inline ? "relative inline-flex" : "fixed",
1809
- "flex items-start gap-2.5 max-w-[280px]",
1810
- "rounded-2xl border border-border bg-popover text-popover-foreground",
1811
- "px-3.5 py-2.5 shadow-2xl transition-all duration-200 ease-out",
1812
- clickable && "cursor-pointer hover:bg-accent/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1813
- originClass(position),
1814
- animating ? "opacity-0 scale-95 translate-y-1" : "opacity-100 scale-100 translate-y-0",
1815
- className
1816
- ),
1817
- style: {
1818
- ...inline ? {} : anchorStyle(position, fabOffset, fabClearance),
1819
- ...inline ? {} : { zIndex },
1820
- pointerEvents: phase === "visible" ? "auto" : "none",
1821
- ...style
1822
- },
1823
- children: [
1824
- avatar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 shrink-0", children: avatar }),
1825
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 text-sm leading-snug", children: [
1826
- senderName && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-0.5 text-[11px] font-medium text-muted-foreground", children: senderName }),
1827
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-foreground", children })
1828
- ] }),
1829
- onDismiss && /* @__PURE__ */ jsxRuntime.jsx(
1830
- "button",
1831
- {
1832
- type: "button",
1833
- "aria-label": dismissLabel,
1834
- onClick: (e) => {
1835
- e.stopPropagation();
1836
- onDismiss();
1837
- },
1838
- className: lib.cn(
1839
- "-mr-1 -mt-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
1840
- "text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
1841
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
1842
- ),
1843
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3.5 w-3.5" })
1844
- }
1845
- )
1846
- ]
1847
- }
1848
- );
1849
- }
1850
- chunkOLISEQHS_cjs.__name(ChatGreeting, "ChatGreeting");
1851
- var TIME_FORMAT = new Intl.DateTimeFormat(void 0, {
1852
- hour: "2-digit",
1853
- minute: "2-digit"
1854
- });
1855
- function anchorStyle2(position, fabOffset, fabClearance) {
1856
- const [vert, horiz] = position.split("-");
1857
- return { [vert]: fabClearance, [horiz]: fabOffset };
1858
- }
1859
- chunkOLISEQHS_cjs.__name(anchorStyle2, "anchorStyle");
1860
- function originClass2(position) {
1861
- if (position === "bottom-right") return "origin-bottom-right";
1862
- if (position === "bottom-left") return "origin-bottom-left";
1863
- if (position === "top-right") return "origin-top-right";
1864
- return "origin-top-left";
1865
- }
1866
- chunkOLISEQHS_cjs.__name(originClass2, "originClass");
1867
- function deriveAvatar(persona, name) {
1868
- const initials = persona?.initials ?? (name ?? persona?.name ?? "?").split(/\s+/).map((p) => p[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
1869
- return /* @__PURE__ */ jsxRuntime.jsxs(components.Avatar, { className: "h-9 w-9", children: [
1870
- persona?.avatarUrl ? /* @__PURE__ */ jsxRuntime.jsx(components.AvatarImage, { src: persona.avatarUrl }) : null,
1871
- /* @__PURE__ */ jsxRuntime.jsx(components.AvatarFallback, { children: initials || "?" })
1872
- ] });
1873
- }
1874
- chunkOLISEQHS_cjs.__name(deriveAvatar, "deriveAvatar");
1875
- function ChatUnreadPreview({
1876
- open,
1877
- message,
1878
- onClick,
1879
- onDismiss,
1880
- position = "bottom-right",
1881
- fabOffset = 24,
1882
- fabClearance = 96,
1883
- truncate = 2,
1884
- zIndex = 9998,
1885
- inline = false,
1886
- className,
1887
- style,
1888
- dismissLabel = "Mark as read",
1889
- avatar,
1890
- senderName
1891
- }) {
1892
- const shouldShow = open && !!message;
1893
- const phase = useChatPresence(shouldShow, 200);
1894
- if (phase === "hidden" || !message) return null;
1895
- const animating = phase === "entering" || phase === "leaving";
1896
- const clickable = !!onClick;
1897
- const displayName = senderName ?? message.sender?.name ?? "New message";
1898
- const stamp = TIME_FORMAT.format(new Date(message.createdAt));
1899
- return /* @__PURE__ */ jsxRuntime.jsxs(
1900
- "div",
1901
- {
1902
- role: clickable ? "button" : "status",
1903
- "aria-live": "polite",
1904
- tabIndex: clickable ? 0 : -1,
1905
- onClick: clickable ? onClick : void 0,
1906
- onKeyDown: clickable ? (e) => {
1907
- if (e.key === "Enter" || e.key === " ") {
1908
- e.preventDefault();
1909
- onClick?.();
1910
- }
1911
- } : void 0,
1912
- className: lib.cn(
1913
- inline ? "relative inline-flex" : "fixed",
1914
- "flex items-start gap-2.5 max-w-[300px]",
1915
- "rounded-2xl border border-border bg-popover text-popover-foreground",
1916
- "px-3.5 py-2.5 shadow-2xl transition-all duration-200 ease-out",
1917
- clickable && "cursor-pointer hover:bg-accent/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
1918
- originClass2(position),
1919
- animating ? "opacity-0 scale-95 translate-y-1" : "opacity-100 scale-100 translate-y-0",
1920
- className
1921
- ),
1922
- style: {
1923
- ...inline ? {} : anchorStyle2(position, fabOffset, fabClearance),
1924
- ...inline ? {} : { zIndex },
1925
- pointerEvents: phase === "visible" ? "auto" : "none",
1926
- ...style
1927
- },
1928
- children: [
1929
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 shrink-0", children: avatar ?? deriveAvatar(message.sender, displayName) }),
1930
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 text-sm leading-snug", children: [
1931
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [
1932
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate text-[12px] font-semibold text-foreground", children: displayName }),
1933
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 text-[10px] text-muted-foreground", children: stamp })
1934
- ] }),
1935
- /* @__PURE__ */ jsxRuntime.jsx(
1936
- "div",
1937
- {
1938
- className: "text-foreground/90 mt-0.5 break-words",
1939
- style: {
1940
- display: "-webkit-box",
1941
- WebkitLineClamp: truncate,
1942
- WebkitBoxOrient: "vertical",
1943
- overflow: "hidden"
1944
- },
1945
- children: message.content
1946
- }
1947
- )
1948
- ] }),
1949
- onDismiss ? /* @__PURE__ */ jsxRuntime.jsx(
1950
- "button",
1951
- {
1952
- type: "button",
1953
- "aria-label": dismissLabel,
1954
- onClick: (e) => {
1955
- e.stopPropagation();
1956
- onDismiss();
1957
- },
1958
- className: lib.cn(
1959
- "-mr-1 -mt-1 flex h-6 w-6 shrink-0 items-center justify-center rounded-full",
1960
- "text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
1961
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring"
1962
- ),
1963
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3.5 w-3.5" })
1964
- }
1965
- ) : null
1966
- ]
1407
+ return null;
1967
1408
  }
1968
- );
1409
+ const out = [];
1410
+ for (const evt of mapPydanticAIEvent(parsed, toolIds)) {
1411
+ out.push(evt);
1412
+ }
1413
+ if (out.length === 0) return null;
1414
+ if (out.length === 1) return out[0];
1415
+ return out;
1416
+ };
1969
1417
  }
1970
- chunkOLISEQHS_cjs.__name(ChatUnreadPreview, "ChatUnreadPreview");
1971
- function readDismissed(storageKey) {
1972
- if (!storageKey) return false;
1973
- if (typeof window === "undefined") return false;
1974
- try {
1975
- return window.localStorage.getItem(storageKey) === "1";
1976
- } catch {
1977
- return false;
1978
- }
1418
+ chunkOLISEQHS_cjs.__name(createPydanticAISSEMap, "createPydanticAISSEMap");
1419
+
1420
+ // src/tools/Chat/core/transport/pydantic-ai-transport.ts
1421
+ var DEFAULT_SESSION_ID = "default";
1422
+ function mapStatusToCode2(status) {
1423
+ if (status === 401 || status === 403) return "unauthorized";
1424
+ if (status === 404) return "not_found";
1425
+ if (status === 408) return "timeout";
1426
+ if (status === 429) return "rate_limited";
1427
+ if (status >= 500) return "server_error";
1428
+ return "error";
1979
1429
  }
1980
- chunkOLISEQHS_cjs.__name(readDismissed, "readDismissed");
1981
- function writeDismissed(storageKey) {
1982
- if (!storageKey) return;
1983
- if (typeof window === "undefined") return;
1984
- try {
1985
- window.localStorage.setItem(storageKey, "1");
1986
- } catch {
1430
+ chunkOLISEQHS_cjs.__name(mapStatusToCode2, "mapStatusToCode");
1431
+ function createPydanticAIChatTransport(opts) {
1432
+ const fetchImpl = opts.fetchImpl ?? fetch.bind(globalThis);
1433
+ const streamMethod = opts.streamMethod ?? "POST";
1434
+ async function resolvedHeaders(extra) {
1435
+ const base = opts.buildHeaders ? await opts.buildHeaders() : {};
1436
+ const headers = new Headers(base);
1437
+ if (extra) {
1438
+ for (const [k, v] of Object.entries(extra)) headers.set(k, v);
1439
+ }
1440
+ return headers;
1987
1441
  }
1988
- }
1989
- chunkOLISEQHS_cjs.__name(writeDismissed, "writeDismissed");
1990
- function ChatLauncher({
1991
- children,
1992
- fab,
1993
- dock,
1994
- greeting,
1995
- hotkey,
1996
- defaultOpen = false,
1997
- open: controlledOpen,
1998
- onOpenChange,
1999
- autoFocusComposerOnOpen = true,
2000
- closeOnEscape = true,
2001
- unreadMessage,
2002
- onMarkRead,
2003
- unreadPreview,
2004
- audio,
2005
- hideAudioToggle = false
2006
- }) {
2007
- const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);
2008
- const isControlled = controlledOpen !== void 0;
2009
- const open = isControlled ? controlledOpen : uncontrolledOpen;
2010
- const dockContentRef = React.useRef(null);
2011
- React.useEffect(() => {
2012
- if (!autoFocusComposerOnOpen || !open) return;
2013
- const t = setTimeout(() => {
2014
- const root = dockContentRef.current;
2015
- if (!root) return;
2016
- const target = root.querySelector(
2017
- 'textarea:not([disabled]):not([readonly]), input[type="text"]:not([disabled]):not([readonly])'
2018
- );
2019
- target?.focus();
2020
- }, 120);
2021
- return () => clearTimeout(t);
2022
- }, [open, autoFocusComposerOnOpen]);
2023
- const setOpen = React.useCallback(
2024
- (next) => {
2025
- if (!isControlled) setUncontrolledOpen(next);
2026
- onOpenChange?.(next);
1442
+ chunkOLISEQHS_cjs.__name(resolvedHeaders, "resolvedHeaders");
1443
+ return {
1444
+ async createSession(createOpts) {
1445
+ if (opts.bootstrapSession) return opts.bootstrapSession(createOpts);
1446
+ return { sessionId: DEFAULT_SESSION_ID };
2027
1447
  },
2028
- [isControlled, onOpenChange]
2029
- );
2030
- const toggleOpen = React.useCallback(() => setOpen(!open), [open, setOpen]);
2031
- hooks.useHotkey(
2032
- "escape",
2033
- (e) => {
2034
- const target = e?.target ?? null;
2035
- const inEditable = !!target && (target.matches?.('input, textarea, [contenteditable="true"]') ?? false);
2036
- if (inEditable) {
2037
- target.blur();
2038
- return;
2039
- }
2040
- setOpen(false);
1448
+ async loadHistory(sessionId, cursor) {
1449
+ if (opts.loadHistory) return opts.loadHistory(sessionId, cursor);
1450
+ return { messages: [], hasMore: false, nextCursor: null };
2041
1451
  },
2042
- { enabled: closeOnEscape && open }
2043
- );
2044
- const greetingConfig = greeting === void 0 ? null : typeof greeting === "string" ? { content: greeting } : greeting;
2045
- const [dismissed, setDismissed] = React.useState(
2046
- () => readDismissed(greetingConfig?.dismissStorageKey)
2047
- );
2048
- React.useEffect(() => {
2049
- if (!hotkey) return;
2050
- const handler = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((e) => {
2051
- const metaOk = hotkey.meta ? e.metaKey || e.ctrlKey : !e.metaKey && !e.ctrlKey;
2052
- const shiftOk = hotkey.shift ? e.shiftKey : !e.shiftKey;
2053
- const altOk = hotkey.alt ? e.altKey : !e.altKey;
2054
- if (!metaOk || !shiftOk || !altOk) return;
2055
- if (e.key !== hotkey.key) return;
2056
- e.preventDefault();
2057
- setOpen(!open);
2058
- }, "handler");
2059
- window.addEventListener("keydown", handler);
2060
- return () => window.removeEventListener("keydown", handler);
2061
- }, [hotkey?.key, hotkey?.meta, hotkey?.shift, hotkey?.alt, open, setOpen, hotkey]);
2062
- const greetingOpen = !!greetingConfig && !dismissed && (greetingConfig.hideOnOpen === false || !open);
2063
- const fabPosition = fab?.position ?? "bottom-right";
2064
- const fabOffset = fab?.offset ?? 24;
2065
- const handleGreetingDismiss = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2066
- setDismissed(true);
2067
- writeDismissed(greetingConfig?.dismissStorageKey);
2068
- }, "handleGreetingDismiss");
2069
- const handleGreetingClick = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2070
- setOpen(true);
2071
- setDismissed(true);
2072
- writeDismissed(greetingConfig?.dismissStorageKey);
2073
- }, "handleGreetingClick");
2074
- React.useEffect(() => {
2075
- if (open && unreadMessage) onMarkRead?.();
2076
- }, [open, unreadMessage, onMarkRead]);
2077
- const unreadOpen = !open && !!unreadMessage;
2078
- const handleUnreadClick = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2079
- setOpen(true);
2080
- onMarkRead?.();
2081
- }, "handleUnreadClick");
2082
- const handleUnreadDismiss = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2083
- onMarkRead?.();
2084
- }, "handleUnreadDismiss");
2085
- const resolvedFab = unreadMessage && fab?.badge === void 0 ? { ...fab, badge: 1 } : fab;
2086
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2087
- /* @__PURE__ */ jsxRuntime.jsx(ChatFAB, { ...resolvedFab, onClick: toggleOpen }),
2088
- unreadMessage ? /* @__PURE__ */ jsxRuntime.jsx(
2089
- ChatUnreadPreview,
2090
- {
2091
- ...unreadPreview,
2092
- open: unreadOpen,
2093
- message: unreadMessage,
2094
- onClick: handleUnreadClick,
2095
- onDismiss: handleUnreadDismiss,
2096
- position: fabPosition,
2097
- fabOffset
1452
+ async *stream(sessionId, content, options) {
1453
+ const url = opts.buildStreamUrl(sessionId, content);
1454
+ const headers = await resolvedHeaders({ Accept: "text/event-stream" });
1455
+ const init = {
1456
+ method: streamMethod,
1457
+ headers,
1458
+ signal: options.signal
1459
+ };
1460
+ if (streamMethod === "POST") {
1461
+ headers.set("Content-Type", "application/json");
1462
+ init.body = JSON.stringify({
1463
+ content,
1464
+ attachments: options.attachments ?? [],
1465
+ metadata: options.metadata ?? {}
1466
+ });
2098
1467
  }
2099
- ) : greetingConfig ? /* @__PURE__ */ jsxRuntime.jsx(
2100
- ChatGreeting,
2101
- {
2102
- ...greetingConfig,
2103
- open: greetingOpen,
2104
- onClick: handleGreetingClick,
2105
- onDismiss: handleGreetingDismiss,
2106
- position: fabPosition,
2107
- fabOffset,
2108
- children: greetingConfig.content
1468
+ const res = await fetchImpl(typeof url === "string" ? url : url.toString(), init);
1469
+ if (!res.ok) {
1470
+ const text = await res.text().catch(() => "");
1471
+ throw new TransportError(
1472
+ `stream failed (${res.status}): ${text || res.statusText}`,
1473
+ mapStatusToCode2(res.status)
1474
+ );
2109
1475
  }
2110
- ) : null,
2111
- /* @__PURE__ */ jsxRuntime.jsx(
2112
- ChatDock,
2113
- {
2114
- ...dock,
2115
- open,
2116
- onClose: () => setOpen(false),
2117
- headerActions: audio && !audio.isSilent && !hideAudioToggle || dock?.headerActions ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2118
- dock?.headerActions,
2119
- audio && !audio.isSilent && !hideAudioToggle ? /* @__PURE__ */ jsxRuntime.jsx(ChatHeaderAudioToggle, { muted: audio.muted, onToggle: audio.toggleMute }) : null
2120
- ] }) : void 0,
2121
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: dockContentRef, className: "flex h-full min-h-0 min-w-0 flex-col", children })
1476
+ const sideChannel = opts.onPydanticEvent;
1477
+ if (!sideChannel) {
1478
+ yield* parseSSE(res, {
1479
+ signal: options.signal,
1480
+ idleTimeoutMs: opts.idleTimeoutMs,
1481
+ map: createPydanticAISSEMap()
1482
+ });
1483
+ return;
2122
1484
  }
2123
- )
2124
- ] });
1485
+ const toolIds = createToolIdQueue();
1486
+ yield* parseSSE(res, {
1487
+ signal: options.signal,
1488
+ idleTimeoutMs: opts.idleTimeoutMs,
1489
+ map: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((raw) => {
1490
+ if (!raw.data) return null;
1491
+ let parsed;
1492
+ try {
1493
+ parsed = JSON.parse(raw.data);
1494
+ } catch {
1495
+ return null;
1496
+ }
1497
+ try {
1498
+ sideChannel(parsed);
1499
+ } catch {
1500
+ }
1501
+ const out = [];
1502
+ for (const evt of mapPydanticAIEvent(parsed, toolIds)) out.push(evt);
1503
+ if (out.length === 0) return null;
1504
+ if (out.length === 1) return out[0];
1505
+ return out;
1506
+ }, "map")
1507
+ });
1508
+ },
1509
+ async send(sessionId, content, sendOpts) {
1510
+ if (opts.send) return opts.send(sessionId, content, sendOpts);
1511
+ throw new TransportError(
1512
+ "Buffered send is not supported by this transport",
1513
+ "unsupported"
1514
+ );
1515
+ },
1516
+ async closeSession(sessionId) {
1517
+ if (opts.closeSession) await opts.closeSession(sessionId);
1518
+ }
1519
+ };
2125
1520
  }
2126
- chunkOLISEQHS_cjs.__name(ChatLauncher, "ChatLauncher");
1521
+ chunkOLISEQHS_cjs.__name(createPydanticAIChatTransport, "createPydanticAIChatTransport");
2127
1522
  function useChatScroll(options) {
2128
1523
  const {
2129
1524
  containerRef,
@@ -2132,12 +1527,12 @@ function useChatScroll(options) {
2132
1527
  bottomThresholdPx = 80,
2133
1528
  messagesCount = 0
2134
1529
  } = options;
2135
- const [isAtBottom, setIsAtBottom] = React.useState(true);
2136
- const [unreadCount, setUnreadCount] = React.useState(0);
2137
- const lastCountRef = React.useRef(messagesCount);
2138
- const stickyRef = React.useRef(true);
2139
- const wasStreamingRef = React.useRef(isStreaming);
2140
- const scrollToBottom = React.useCallback(
1530
+ const [isAtBottom, setIsAtBottom] = react.useState(true);
1531
+ const [unreadCount, setUnreadCount] = react.useState(0);
1532
+ const lastCountRef = react.useRef(messagesCount);
1533
+ const stickyRef = react.useRef(true);
1534
+ const wasStreamingRef = react.useRef(isStreaming);
1535
+ const scrollToBottom = react.useCallback(
2141
1536
  (smooth = false) => {
2142
1537
  const el = containerRef.current;
2143
1538
  if (!el) return;
@@ -2151,8 +1546,8 @@ function useChatScroll(options) {
2151
1546
  },
2152
1547
  [containerRef]
2153
1548
  );
2154
- const resetUnread = React.useCallback(() => setUnreadCount(0), []);
2155
- React.useEffect(() => {
1549
+ const resetUnread = react.useCallback(() => setUnreadCount(0), []);
1550
+ react.useEffect(() => {
2156
1551
  const el = containerRef.current;
2157
1552
  if (!el) return;
2158
1553
  const onScroll = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
@@ -2168,7 +1563,7 @@ function useChatScroll(options) {
2168
1563
  el.removeEventListener("scroll", onScroll);
2169
1564
  };
2170
1565
  }, [containerRef, bottomThresholdPx]);
2171
- React.useEffect(() => {
1566
+ react.useEffect(() => {
2172
1567
  const el = containerRef.current;
2173
1568
  if (!el) return;
2174
1569
  if (isStreaming) {
@@ -2201,7 +1596,7 @@ function useChatScroll(options) {
2201
1596
  wasStreamingRef.current = false;
2202
1597
  return;
2203
1598
  }, [containerRef, isStreaming]);
2204
- React.useEffect(() => {
1599
+ react.useEffect(() => {
2205
1600
  if (messagesCount > lastCountRef.current) {
2206
1601
  if (stickyRef.current) {
2207
1602
  const el = containerRef.current;
@@ -2212,15 +1607,15 @@ function useChatScroll(options) {
2212
1607
  }
2213
1608
  lastCountRef.current = messagesCount;
2214
1609
  }, [containerRef, messagesCount]);
2215
- React.useEffect(() => {
1610
+ react.useEffect(() => {
2216
1611
  }, [bottomRef]);
2217
1612
  return { isAtBottom, unreadCount, scrollToBottom, resetUnread };
2218
1613
  }
2219
1614
  chunkOLISEQHS_cjs.__name(useChatScroll, "useChatScroll");
2220
1615
  function useChatHistory(options) {
2221
1616
  const { enabled = true, containerRef, topSentinelRef, hasMore, isLoadingMore, loadMore } = options;
2222
- const heightBeforeRef = React.useRef(null);
2223
- React.useEffect(() => {
1617
+ const heightBeforeRef = react.useRef(null);
1618
+ react.useEffect(() => {
2224
1619
  if (heightBeforeRef.current == null) return;
2225
1620
  const el = containerRef.current;
2226
1621
  if (!el) {
@@ -2235,7 +1630,7 @@ function useChatHistory(options) {
2235
1630
  heightBeforeRef.current = null;
2236
1631
  }
2237
1632
  }, [containerRef, isLoadingMore]);
2238
- React.useEffect(() => {
1633
+ react.useEffect(() => {
2239
1634
  if (!enabled || !hasMore) return;
2240
1635
  const sentinel = topSentinelRef.current;
2241
1636
  const root = containerRef.current;
@@ -2257,13 +1652,13 @@ function useChatHistory(options) {
2257
1652
  }
2258
1653
  chunkOLISEQHS_cjs.__name(useChatHistory, "useChatHistory");
2259
1654
  function useChatLightbox() {
2260
- const [state, setState] = React.useState(null);
2261
- const open = React.useCallback((att, gallery) => {
1655
+ const [state, setState] = react.useState(null);
1656
+ const open = react.useCallback((att, gallery) => {
2262
1657
  const list = gallery && gallery.length ? gallery : [att];
2263
1658
  const idx = list.findIndex((a) => a.id === att.id);
2264
1659
  setState({ gallery: list, index: idx === -1 ? 0 : idx });
2265
1660
  }, []);
2266
- const close = React.useCallback(() => setState(null), []);
1661
+ const close = react.useCallback(() => setState(null), []);
2267
1662
  return { state, open, close };
2268
1663
  }
2269
1664
  chunkOLISEQHS_cjs.__name(useChatLightbox, "useChatLightbox");
@@ -2277,8 +1672,8 @@ function generate() {
2277
1672
  chunkOLISEQHS_cjs.__name(generate, "generate");
2278
1673
  function useVisitorFingerprint(opts = {}) {
2279
1674
  const storageKey = opts.storageKey ?? DEFAULT_STORAGE_KEY;
2280
- const [fp, setFp] = React.useState(null);
2281
- React.useEffect(() => {
1675
+ const [fp, setFp] = react.useState(null);
1676
+ react.useEffect(() => {
2282
1677
  let value = null;
2283
1678
  try {
2284
1679
  value = window.localStorage.getItem(storageKey);
@@ -2304,34 +1699,34 @@ function useChatDockPrefs(opts = {}) {
2304
1699
  const key = opts.storageKey ?? DEFAULT_KEY;
2305
1700
  const initial = { ...DEFAULT_DOCK_PREFS, ...opts.defaults };
2306
1701
  const [prefs, setStored] = hooks.useLocalStorage(key, initial);
2307
- const setPrefs = React.useCallback(
1702
+ const setPrefs = react.useCallback(
2308
1703
  (patch) => {
2309
1704
  setStored((prev) => ({ ...prev, ...patch }));
2310
1705
  },
2311
1706
  [setStored]
2312
1707
  );
2313
- const toggleMode = React.useCallback(() => {
1708
+ const toggleMode = react.useCallback(() => {
2314
1709
  setStored((prev) => ({ ...prev, mode: prev.mode === "side" ? "popover" : "side" }));
2315
1710
  }, [setStored]);
2316
- const toggleSide = React.useCallback(() => {
1711
+ const toggleSide = react.useCallback(() => {
2317
1712
  setStored((prev) => ({ ...prev, side: prev.side === "right" ? "left" : "right" }));
2318
1713
  }, [setStored]);
2319
- const reset = React.useCallback(() => setStored(initial), [setStored, initial]);
1714
+ const reset = react.useCallback(() => setStored(initial), [setStored, initial]);
2320
1715
  return { ...prefs, setPrefs, toggleMode, toggleSide, reset };
2321
1716
  }
2322
1717
  chunkOLISEQHS_cjs.__name(useChatDockPrefs, "useChatDockPrefs");
2323
1718
  function useChatUnread(opts = {}) {
2324
1719
  const { open = false, countRoles = ["assistant"] } = opts;
2325
- const ctx = chunkHPK3EWBF_cjs.useChatContext();
2326
- const [lastSeenId, setLastSeenId] = React.useState(null);
2327
- const initialized = React.useRef(false);
2328
- React.useEffect(() => {
1720
+ const ctx = chunkTBSHZO5R_cjs.useChatContext();
1721
+ const [lastSeenId, setLastSeenId] = react.useState(null);
1722
+ const initialized = react.useRef(false);
1723
+ react.useEffect(() => {
2329
1724
  if (initialized.current) return;
2330
1725
  initialized.current = true;
2331
1726
  const tail = ctx.messages[ctx.messages.length - 1];
2332
1727
  setLastSeenId(tail?.id ?? null);
2333
1728
  }, [ctx.messages]);
2334
- React.useEffect(() => {
1729
+ react.useEffect(() => {
2335
1730
  if (!open) return;
2336
1731
  const tail = ctx.messages[ctx.messages.length - 1];
2337
1732
  setLastSeenId(tail?.id ?? null);
@@ -2340,7 +1735,7 @@ function useChatUnread(opts = {}) {
2340
1735
  const after = seenIdx === -1 ? ctx.messages : ctx.messages.slice(seenIdx + 1);
2341
1736
  const inbound = after.filter((m) => countRoles.includes(m.role));
2342
1737
  const unread = inbound.length > 0 ? inbound[inbound.length - 1] : null;
2343
- const markRead = React.useCallback(() => {
1738
+ const markRead = react.useCallback(() => {
2344
1739
  const tail = ctx.messages[ctx.messages.length - 1];
2345
1740
  setLastSeenId(tail?.id ?? null);
2346
1741
  }, [ctx.messages]);
@@ -2389,6 +1784,21 @@ function collectImageAttachments(messages) {
2389
1784
  return out;
2390
1785
  }
2391
1786
  chunkOLISEQHS_cjs.__name(collectImageAttachments, "collectImageAttachments");
1787
+ var LazyChat = chunkL25HA3TM_cjs.createLazyComponent(
1788
+ () => import('./ChatRoot-OILWMMZ6.cjs').then((m) => ({ default: m.ChatRoot })),
1789
+ {
1790
+ displayName: "LazyChat",
1791
+ fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkL25HA3TM_cjs.LoadingFallback, { minHeight: 320, text: "Loading chat\u2026" })
1792
+ }
1793
+ );
1794
+ chunkL25HA3TM_cjs.createLazyComponent(
1795
+ () => import('./launcher-QAOG2NUI.cjs').then((m) => ({ default: m.ChatLauncher })),
1796
+ {
1797
+ displayName: "LazyChatLauncher",
1798
+ // Launcher renders a floating FAB by default — no inline placeholder.
1799
+ fallback: null
1800
+ }
1801
+ );
2392
1802
  function AudioToggle({
2393
1803
  size = "icon",
2394
1804
  variant = "ghost",
@@ -2397,7 +1807,7 @@ function AudioToggle({
2397
1807
  }) {
2398
1808
  const muted = useChatAudioPrefs((s) => s.muted);
2399
1809
  const setMuted = useChatAudioPrefs((s) => s.setMuted);
2400
- const ctx = chunkHPK3EWBF_cjs.useChatContextOptional();
1810
+ const ctx = chunkTBSHZO5R_cjs.useChatContextOptional();
2401
1811
  if (ctx && !ctx.hasAudio && !alwaysShow) return null;
2402
1812
  const Icon = muted ? lucideReact.VolumeX : lucideReact.Volume2;
2403
1813
  const label = muted ? "Unmute chat sounds" : "Mute chat sounds";
@@ -2417,7 +1827,7 @@ function AudioToggle({
2417
1827
  );
2418
1828
  }
2419
1829
  chunkOLISEQHS_cjs.__name(AudioToggle, "AudioToggle");
2420
- var LottiePlayerClient = React.lazy(
1830
+ var LottiePlayerClient = react.lazy(
2421
1831
  () => import('./LottiePlayer.client-2S7ISJ2S.cjs').then((mod) => ({ default: mod.LottiePlayer }))
2422
1832
  );
2423
1833
  var LoadingFallback5 = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
@@ -2425,25 +1835,25 @@ var LoadingFallback5 = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => /* @__PURE
2425
1835
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-500", children: "Loading player..." })
2426
1836
  ] }) }), "LoadingFallback");
2427
1837
  function LottiePlayer(props) {
2428
- return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback5, {}), children: /* @__PURE__ */ jsxRuntime.jsx(LottiePlayerClient, { ...props }) });
1838
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback5, {}), children: /* @__PURE__ */ jsxRuntime.jsx(LottiePlayerClient, { ...props }) });
2429
1839
  }
2430
1840
  chunkOLISEQHS_cjs.__name(LottiePlayer, "LottiePlayer");
2431
- var DocsLayout = React.lazy(
1841
+ var DocsLayout = react.lazy(
2432
1842
  () => import('./DocsLayout-2YZNS5VK.cjs').then((mod) => ({ default: mod.DocsLayout }))
2433
1843
  );
2434
1844
  var LoadingFallback6 = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground", children: "Loading API Playground..." }) }), "LoadingFallback");
2435
1845
  var Playground = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ config }) => {
2436
- return /* @__PURE__ */ jsxRuntime.jsx(chunk7EYHNP3E_cjs.PlaygroundProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback6, {}), children: /* @__PURE__ */ jsxRuntime.jsx(DocsLayout, {}) }) });
1846
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk7EYHNP3E_cjs.PlaygroundProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback6, {}), children: /* @__PURE__ */ jsxRuntime.jsx(DocsLayout, {}) }) });
2437
1847
  }, "Playground");
2438
1848
  var OpenapiViewer_default = Playground;
2439
- var CronSchedulerClient = React.lazy(() => import('./CronScheduler.client-WEJF4PWQ.cjs'));
1849
+ var CronSchedulerClient = react.lazy(() => import('./CronScheduler.client-WEJF4PWQ.cjs'));
2440
1850
  function CronScheduler(props) {
2441
- return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerFallback, {}), children: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerClient, { ...props }) });
1851
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerFallback, {}), children: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerClient, { ...props }) });
2442
1852
  }
2443
1853
  chunkOLISEQHS_cjs.__name(CronScheduler, "CronScheduler");
2444
1854
  function CronSchedulerFallback() {
2445
1855
  return /* @__PURE__ */ jsxRuntime.jsx(
2446
- LoadingFallback,
1856
+ chunkL25HA3TM_cjs.LoadingFallback,
2447
1857
  {
2448
1858
  minHeight: 120,
2449
1859
  showText: false,
@@ -2468,10 +1878,10 @@ chunkOLISEQHS_cjs.__name(setupMonacoWorkers, "setupMonacoWorkers");
2468
1878
 
2469
1879
  // src/tools/CodeEditor/hooks/useMonaco.ts
2470
1880
  function useMonaco() {
2471
- const [monaco, setMonaco] = React.useState(null);
2472
- const [isLoading, setIsLoading] = React.useState(true);
2473
- const [error, setError] = React.useState(null);
2474
- React.useEffect(() => {
1881
+ const [monaco, setMonaco] = react.useState(null);
1882
+ const [isLoading, setIsLoading] = react.useState(true);
1883
+ const [error, setError] = react.useState(null);
1884
+ react.useEffect(() => {
2475
1885
  let mounted = true;
2476
1886
  async function loadMonaco() {
2477
1887
  try {
@@ -2499,8 +1909,8 @@ function useMonaco() {
2499
1909
  chunkOLISEQHS_cjs.__name(useMonaco, "useMonaco");
2500
1910
  function useEditorTheme(monaco, themeOverride) {
2501
1911
  const appTheme = hooks.useResolvedTheme();
2502
- const registered = React.useRef(false);
2503
- React.useEffect(() => {
1912
+ const registered = react.useRef(false);
1913
+ react.useEffect(() => {
2504
1914
  if (!monaco || registered.current) return;
2505
1915
  try {
2506
1916
  const colors = _readCSSColors();
@@ -2615,7 +2025,7 @@ function _adjustBrightness(hex, amount) {
2615
2025
  return `#${(r << 16 | g << 8 | b).toString(16).padStart(6, "0")}`;
2616
2026
  }
2617
2027
  chunkOLISEQHS_cjs.__name(_adjustBrightness, "_adjustBrightness");
2618
- var Editor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function Editor2({
2028
+ var Editor = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function Editor2({
2619
2029
  value = "",
2620
2030
  language = "plaintext",
2621
2031
  onChange,
@@ -2628,24 +2038,24 @@ var Editor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function
2628
2038
  minHeight = 100,
2629
2039
  maxHeight = 600
2630
2040
  }, ref) {
2631
- const containerRef = React.useRef(null);
2632
- const editorRef = React.useRef(null);
2041
+ const containerRef = react.useRef(null);
2042
+ const editorRef = react.useRef(null);
2633
2043
  const { monaco, isLoading } = useMonaco();
2634
2044
  const resolvedTheme = useEditorTheme(monaco, options.theme);
2635
- const [contentHeight, setContentHeight] = React.useState(null);
2636
- const updateContentHeight = React.useCallback((editor) => {
2045
+ const [contentHeight, setContentHeight] = react.useState(null);
2046
+ const updateContentHeight = react.useCallback((editor) => {
2637
2047
  if (!autoHeight) return;
2638
2048
  const h = editor.getContentHeight();
2639
2049
  setContentHeight(Math.min(Math.max(h, minHeight), maxHeight));
2640
2050
  }, [autoHeight, minHeight, maxHeight]);
2641
- const isInternalChangeRef = React.useRef(false);
2642
- React.useImperativeHandle(ref, () => ({
2051
+ const isInternalChangeRef = react.useRef(false);
2052
+ react.useImperativeHandle(ref, () => ({
2643
2053
  getEditor: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current, "getEditor"),
2644
2054
  getValue: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current?.getValue() || "", "getValue"),
2645
2055
  setValue: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((val) => editorRef.current?.setValue(val), "setValue"),
2646
2056
  focus: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current?.focus(), "focus")
2647
2057
  }));
2648
- React.useEffect(() => {
2058
+ react.useEffect(() => {
2649
2059
  if (!monaco || !containerRef.current || editorRef.current) return;
2650
2060
  const editor = monaco.editor.create(containerRef.current, {
2651
2061
  value,
@@ -2691,7 +2101,7 @@ var Editor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function
2691
2101
  editorRef.current = null;
2692
2102
  };
2693
2103
  }, [monaco]);
2694
- React.useEffect(() => {
2104
+ react.useEffect(() => {
2695
2105
  const editor = editorRef.current;
2696
2106
  if (!editor) return;
2697
2107
  if (isInternalChangeRef.current) {
@@ -2711,7 +2121,7 @@ var Editor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function
2711
2121
  }
2712
2122
  }
2713
2123
  }, [value]);
2714
- React.useEffect(() => {
2124
+ react.useEffect(() => {
2715
2125
  const editor = editorRef.current;
2716
2126
  if (!editor || !monaco) return;
2717
2127
  const model = editor.getModel();
@@ -2719,7 +2129,7 @@ var Editor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function
2719
2129
  monaco.editor.setModelLanguage(model, language);
2720
2130
  }
2721
2131
  }, [language, monaco]);
2722
- React.useEffect(() => {
2132
+ react.useEffect(() => {
2723
2133
  const editor = editorRef.current;
2724
2134
  if (!editor) return;
2725
2135
  editor.updateOptions({
@@ -2771,11 +2181,11 @@ function DiffEditor({
2771
2181
  className = "",
2772
2182
  height = "100%"
2773
2183
  }) {
2774
- const containerRef = React.useRef(null);
2775
- const editorRef = React.useRef(null);
2184
+ const containerRef = react.useRef(null);
2185
+ const editorRef = react.useRef(null);
2776
2186
  const { monaco, isLoading } = useMonaco();
2777
2187
  const resolvedTheme = useEditorTheme(monaco, options.theme);
2778
- React.useEffect(() => {
2188
+ react.useEffect(() => {
2779
2189
  if (!monaco || !containerRef.current || editorRef.current) return;
2780
2190
  const editor = monaco.editor.createDiffEditor(containerRef.current, {
2781
2191
  theme: resolvedTheme,
@@ -2801,7 +2211,7 @@ function DiffEditor({
2801
2211
  editorRef.current = null;
2802
2212
  };
2803
2213
  }, [monaco]);
2804
- React.useEffect(() => {
2214
+ react.useEffect(() => {
2805
2215
  const editor = editorRef.current;
2806
2216
  if (!editor || !monaco) return;
2807
2217
  const model = editor.getModel();
@@ -2810,7 +2220,7 @@ function DiffEditor({
2810
2220
  model.modified.setValue(modified);
2811
2221
  }
2812
2222
  }, [original, modified, monaco]);
2813
- React.useEffect(() => {
2223
+ react.useEffect(() => {
2814
2224
  const editor = editorRef.current;
2815
2225
  if (!editor || !monaco) return;
2816
2226
  const model = editor.getModel();
@@ -3037,9 +2447,9 @@ function getLanguageByFilename(filename) {
3037
2447
  return LANGUAGE_MAP[extension] || "plaintext";
3038
2448
  }
3039
2449
  chunkOLISEQHS_cjs.__name(getLanguageByFilename, "getLanguageByFilename");
3040
- var EditorContext = React.createContext(null);
2450
+ var EditorContext = react.createContext(null);
3041
2451
  function useEditorContext() {
3042
- const context = React.useContext(EditorContext);
2452
+ const context = react.useContext(EditorContext);
3043
2453
  if (!context) {
3044
2454
  throw new Error("useEditorContext must be used within EditorProvider");
3045
2455
  }
@@ -3048,14 +2458,14 @@ function useEditorContext() {
3048
2458
  chunkOLISEQHS_cjs.__name(useEditorContext, "useEditorContext");
3049
2459
  function EditorProvider({ children, onSave }) {
3050
2460
  const { monaco } = useMonaco();
3051
- const [editor, setEditor] = React.useState(null);
3052
- const [openFiles, setOpenFiles] = React.useState([]);
3053
- const [activeFilePath, setActiveFilePath] = React.useState(null);
3054
- const activeFile = React.useMemo(
2461
+ const [editor, setEditor] = react.useState(null);
2462
+ const [openFiles, setOpenFiles] = react.useState([]);
2463
+ const [activeFilePath, setActiveFilePath] = react.useState(null);
2464
+ const activeFile = react.useMemo(
3055
2465
  () => openFiles.find((f) => f.path === activeFilePath) || null,
3056
2466
  [openFiles, activeFilePath]
3057
2467
  );
3058
- const openFile = React.useCallback(
2468
+ const openFile = react.useCallback(
3059
2469
  (path, content, language) => {
3060
2470
  setOpenFiles((files) => {
3061
2471
  const existing = files.find((f) => f.path === path);
@@ -3076,7 +2486,7 @@ function EditorProvider({ children, onSave }) {
3076
2486
  },
3077
2487
  []
3078
2488
  );
3079
- const closeFile = React.useCallback(
2489
+ const closeFile = react.useCallback(
3080
2490
  (path) => {
3081
2491
  setOpenFiles((files) => {
3082
2492
  const index = files.findIndex((f) => f.path === path);
@@ -3093,17 +2503,17 @@ function EditorProvider({ children, onSave }) {
3093
2503
  },
3094
2504
  [activeFilePath]
3095
2505
  );
3096
- const setActiveFile = React.useCallback((path) => {
2506
+ const setActiveFile = react.useCallback((path) => {
3097
2507
  setActiveFilePath(path);
3098
2508
  }, []);
3099
- const updateContent = React.useCallback((path, content) => {
2509
+ const updateContent = react.useCallback((path, content) => {
3100
2510
  setOpenFiles(
3101
2511
  (files) => files.map(
3102
2512
  (f) => f.path === path ? { ...f, content, isDirty: true } : f
3103
2513
  )
3104
2514
  );
3105
2515
  }, []);
3106
- const saveFile = React.useCallback(
2516
+ const saveFile = react.useCallback(
3107
2517
  async (path) => {
3108
2518
  const file = openFiles.find((f) => f.path === path);
3109
2519
  if (!file) return;
@@ -3118,21 +2528,21 @@ function EditorProvider({ children, onSave }) {
3118
2528
  },
3119
2529
  [openFiles, onSave]
3120
2530
  );
3121
- const isDirty = React.useCallback(
2531
+ const isDirty = react.useCallback(
3122
2532
  (path) => {
3123
2533
  const file = openFiles.find((f) => f.path === path);
3124
2534
  return file?.isDirty || false;
3125
2535
  },
3126
2536
  [openFiles]
3127
2537
  );
3128
- const getContent = React.useCallback(
2538
+ const getContent = react.useCallback(
3129
2539
  (path) => {
3130
2540
  const file = openFiles.find((f) => f.path === path);
3131
2541
  return file?.content || null;
3132
2542
  },
3133
2543
  [openFiles]
3134
2544
  );
3135
- const getFile = React.useCallback(
2545
+ const getFile = react.useCallback(
3136
2546
  (path) => {
3137
2547
  return openFiles.find((f) => f.path === path) || null;
3138
2548
  },
@@ -3157,8 +2567,8 @@ function EditorProvider({ children, onSave }) {
3157
2567
  }
3158
2568
  chunkOLISEQHS_cjs.__name(EditorProvider, "EditorProvider");
3159
2569
  function useEditor() {
3160
- const [editor, setEditorState] = React.useState(null);
3161
- const setEditor = React.useCallback((editorInstance) => {
2570
+ const [editor, setEditorState] = react.useState(null);
2571
+ const setEditor = react.useCallback((editorInstance) => {
3162
2572
  setEditorState(editorInstance);
3163
2573
  }, []);
3164
2574
  return {
@@ -3169,25 +2579,25 @@ function useEditor() {
3169
2579
  }
3170
2580
  chunkOLISEQHS_cjs.__name(useEditor, "useEditor");
3171
2581
  function useLanguage(filename) {
3172
- return React.useMemo(() => {
2582
+ return react.useMemo(() => {
3173
2583
  if (!filename) return "plaintext";
3174
2584
  const basename = filename.split("/").pop() || filename;
3175
2585
  return getLanguageByFilename(basename);
3176
2586
  }, [filename]);
3177
2587
  }
3178
2588
  chunkOLISEQHS_cjs.__name(useLanguage, "useLanguage");
3179
- var MentionList = React.forwardRef(
2589
+ var MentionList = react.forwardRef(
3180
2590
  ({ items, command }, ref) => {
3181
- const [selectedIndex, setSelectedIndex] = React.useState(0);
3182
- React.useEffect(() => setSelectedIndex(0), [items]);
3183
- const select = React.useCallback(
2591
+ const [selectedIndex, setSelectedIndex] = react.useState(0);
2592
+ react.useEffect(() => setSelectedIndex(0), [items]);
2593
+ const select = react.useCallback(
3184
2594
  (index) => {
3185
2595
  const item = items[index];
3186
2596
  if (item) command(item);
3187
2597
  },
3188
2598
  [items, command]
3189
2599
  );
3190
- React.useImperativeHandle(ref, () => ({
2600
+ react.useImperativeHandle(ref, () => ({
3191
2601
  onKeyDown: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((event) => {
3192
2602
  if (event.key === "ArrowUp") {
3193
2603
  setSelectedIndex((i) => (i + items.length - 1) % items.length);
@@ -3266,7 +2676,7 @@ function createMentionSuggestion(config) {
3266
2676
  }, "teardown");
3267
2677
  return {
3268
2678
  onStart: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((props) => {
3269
- component = new react.ReactRenderer(MentionList, {
2679
+ component = new react$1.ReactRenderer(MentionList, {
3270
2680
  props: {
3271
2681
  items: props.items,
3272
2682
  command: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((item) => {
@@ -3368,7 +2778,7 @@ function extractMentionIds(editor) {
3368
2778
  return [...new Set(ids)];
3369
2779
  }
3370
2780
  chunkOLISEQHS_cjs.__name(extractMentionIds, "extractMentionIds");
3371
- var MarkdownEditor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MarkdownEditor2({
2781
+ var MarkdownEditor = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MarkdownEditor2({
3372
2782
  value,
3373
2783
  onChange,
3374
2784
  placeholder = "Write markdown...",
@@ -3380,18 +2790,18 @@ var MarkdownEditor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(f
3380
2790
  onMentionIdsChange,
3381
2791
  onSubmit
3382
2792
  }, ref) {
3383
- const onSubmitRef = React.useRef(onSubmit);
2793
+ const onSubmitRef = react.useRef(onSubmit);
3384
2794
  onSubmitRef.current = onSubmit;
3385
- const isExternalUpdate = React.useRef(false);
3386
- const initialMentionsDefinedRef = React.useRef(mentions !== void 0);
3387
- const warnedRef = React.useRef(false);
2795
+ const isExternalUpdate = react.useRef(false);
2796
+ const initialMentionsDefinedRef = react.useRef(mentions !== void 0);
2797
+ const warnedRef = react.useRef(false);
3388
2798
  if (process.env.NODE_ENV !== "production" && !initialMentionsDefinedRef.current && mentions !== void 0 && !warnedRef.current) {
3389
2799
  warnedRef.current = true;
3390
2800
  console.warn(
3391
2801
  "[MarkdownEditor] `mentions` flipped from undefined to a config after mount. Tiptap only installs the Mention extension on first render \u2014 the @-popover will NOT work for this editor instance. Pass `{ items: [] }` from the very first render and mutate `.items` in place instead."
3392
2802
  );
3393
2803
  }
3394
- const extensions = React.useMemo(() => {
2804
+ const extensions = react.useMemo(() => {
3395
2805
  const exts = [
3396
2806
  StarterKit__default.default.configure({ heading: { levels: [1, 2, 3] } }),
3397
2807
  Placeholder__default.default.configure({ placeholder }),
@@ -3431,7 +2841,7 @@ var MarkdownEditor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(f
3431
2841
  }
3432
2842
  return exts;
3433
2843
  }, [placeholder, mentions]);
3434
- const editor = react.useEditor({
2844
+ const editor = react$1.useEditor({
3435
2845
  immediatelyRender: false,
3436
2846
  editable: !disabled,
3437
2847
  extensions,
@@ -3450,7 +2860,7 @@ var MarkdownEditor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(f
3450
2860
  }
3451
2861
  }
3452
2862
  });
3453
- React.useEffect(() => {
2863
+ react.useEffect(() => {
3454
2864
  if (!editor) return;
3455
2865
  const current = getMarkdown(editor);
3456
2866
  if (current !== value) {
@@ -3459,7 +2869,7 @@ var MarkdownEditor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(f
3459
2869
  isExternalUpdate.current = false;
3460
2870
  }
3461
2871
  }, [value, editor]);
3462
- React.useImperativeHandle(
2872
+ react.useImperativeHandle(
3463
2873
  ref,
3464
2874
  () => ({
3465
2875
  focus: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
@@ -3475,11 +2885,11 @@ var MarkdownEditor = React.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(f
3475
2885
  const wrapperClass = `markdown-editor rounded-md border border-input bg-background ${disabled ? "opacity-60" : ""} ${className}`.trim();
3476
2886
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperClass, children: [
3477
2887
  showToolbar && editor && /* @__PURE__ */ jsxRuntime.jsx(MarkdownToolbar, { editor }),
3478
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(react.EditorContent, { editor }) })
2888
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.EditorContent, { editor }) })
3479
2889
  ] });
3480
2890
  }, "MarkdownEditor"));
3481
2891
  function MarkdownToolbar({ editor }) {
3482
- const items = React.useMemo(() => [
2892
+ const items = react.useMemo(() => [
3483
2893
  { icon: lucideReact.Bold, title: "Bold", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleBold().run(), "action"), active: editor.isActive("bold") },
3484
2894
  { icon: lucideReact.Italic, title: "Italic", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleItalic().run(), "action"), active: editor.isActive("italic") },
3485
2895
  { icon: lucideReact.Strikethrough, title: "Strike", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleStrike().run(), "action"), active: editor.isActive("strike") },
@@ -3503,6 +2913,82 @@ function MarkdownToolbar({ editor }) {
3503
2913
  }
3504
2914
  chunkOLISEQHS_cjs.__name(MarkdownToolbar, "MarkdownToolbar");
3505
2915
 
2916
+ Object.defineProperty(exports, "CardLoadingFallback", {
2917
+ enumerable: true,
2918
+ get: function () { return chunkL25HA3TM_cjs.CardLoadingFallback; }
2919
+ });
2920
+ Object.defineProperty(exports, "ChatDock", {
2921
+ enumerable: true,
2922
+ get: function () { return chunkL25HA3TM_cjs.ChatDock; }
2923
+ });
2924
+ Object.defineProperty(exports, "ChatFAB", {
2925
+ enumerable: true,
2926
+ get: function () { return chunkL25HA3TM_cjs.ChatFAB; }
2927
+ });
2928
+ Object.defineProperty(exports, "ChatGreeting", {
2929
+ enumerable: true,
2930
+ get: function () { return chunkL25HA3TM_cjs.ChatGreeting; }
2931
+ });
2932
+ Object.defineProperty(exports, "ChatHeader", {
2933
+ enumerable: true,
2934
+ get: function () { return chunkL25HA3TM_cjs.ChatHeader; }
2935
+ });
2936
+ Object.defineProperty(exports, "ChatHeaderActionButton", {
2937
+ enumerable: true,
2938
+ get: function () { return chunkL25HA3TM_cjs.ChatHeaderActionButton; }
2939
+ });
2940
+ Object.defineProperty(exports, "ChatHeaderAudioToggle", {
2941
+ enumerable: true,
2942
+ get: function () { return chunkL25HA3TM_cjs.ChatHeaderAudioToggle; }
2943
+ });
2944
+ Object.defineProperty(exports, "ChatHeaderLanguageButton", {
2945
+ enumerable: true,
2946
+ get: function () { return chunkL25HA3TM_cjs.ChatHeaderLanguageButton; }
2947
+ });
2948
+ Object.defineProperty(exports, "ChatHeaderModeToggle", {
2949
+ enumerable: true,
2950
+ get: function () { return chunkL25HA3TM_cjs.ChatHeaderModeToggle; }
2951
+ });
2952
+ Object.defineProperty(exports, "ChatHeaderResetButton", {
2953
+ enumerable: true,
2954
+ get: function () { return chunkL25HA3TM_cjs.ChatHeaderResetButton; }
2955
+ });
2956
+ Object.defineProperty(exports, "ChatLauncher", {
2957
+ enumerable: true,
2958
+ get: function () { return chunkL25HA3TM_cjs.ChatLauncher; }
2959
+ });
2960
+ Object.defineProperty(exports, "ChatUnreadPreview", {
2961
+ enumerable: true,
2962
+ get: function () { return chunkL25HA3TM_cjs.ChatUnreadPreview; }
2963
+ });
2964
+ Object.defineProperty(exports, "LazyWrapper", {
2965
+ enumerable: true,
2966
+ get: function () { return chunkL25HA3TM_cjs.LazyWrapper; }
2967
+ });
2968
+ Object.defineProperty(exports, "LoadingFallback", {
2969
+ enumerable: true,
2970
+ get: function () { return chunkL25HA3TM_cjs.LoadingFallback; }
2971
+ });
2972
+ Object.defineProperty(exports, "MapLoadingFallback", {
2973
+ enumerable: true,
2974
+ get: function () { return chunkL25HA3TM_cjs.MapLoadingFallback; }
2975
+ });
2976
+ Object.defineProperty(exports, "Spinner", {
2977
+ enumerable: true,
2978
+ get: function () { return chunkL25HA3TM_cjs.Spinner; }
2979
+ });
2980
+ Object.defineProperty(exports, "createLazyComponent", {
2981
+ enumerable: true,
2982
+ get: function () { return chunkL25HA3TM_cjs.createLazyComponent; }
2983
+ });
2984
+ Object.defineProperty(exports, "useChatPresence", {
2985
+ enumerable: true,
2986
+ get: function () { return chunkL25HA3TM_cjs.useChatPresence; }
2987
+ });
2988
+ Object.defineProperty(exports, "useChatReset", {
2989
+ enumerable: true,
2990
+ get: function () { return chunkL25HA3TM_cjs.useChatReset; }
2991
+ });
3506
2992
  Object.defineProperty(exports, "ArrayFieldItemTemplate", {
3507
2993
  enumerable: true,
3508
2994
  get: function () { return chunkFEN5S772_cjs.ArrayFieldItemTemplate; }
@@ -3765,183 +3251,183 @@ Object.defineProperty(exports, "useCronWeekDays", {
3765
3251
  });
3766
3252
  Object.defineProperty(exports, "Attachments", {
3767
3253
  enumerable: true,
3768
- get: function () { return chunkHPK3EWBF_cjs.Attachments; }
3254
+ get: function () { return chunkTSNRU3UO_cjs.Attachments; }
3769
3255
  });
3770
3256
  Object.defineProperty(exports, "AttachmentsGrid", {
3771
3257
  enumerable: true,
3772
- get: function () { return chunkHPK3EWBF_cjs.AttachmentsGrid; }
3258
+ get: function () { return chunkTSNRU3UO_cjs.AttachmentsGrid; }
3773
3259
  });
3774
3260
  Object.defineProperty(exports, "AttachmentsList", {
3775
3261
  enumerable: true,
3776
- get: function () { return chunkHPK3EWBF_cjs.AttachmentsList; }
3262
+ get: function () { return chunkTSNRU3UO_cjs.AttachmentsList; }
3777
3263
  });
3778
- Object.defineProperty(exports, "CHAT_EVENT_NAME", {
3264
+ Object.defineProperty(exports, "ChatRoot", {
3779
3265
  enumerable: true,
3780
- get: function () { return chunkHPK3EWBF_cjs.CHAT_EVENT_NAME; }
3266
+ get: function () { return chunkTSNRU3UO_cjs.ChatRoot; }
3781
3267
  });
3782
- Object.defineProperty(exports, "CSS_VARS", {
3268
+ Object.defineProperty(exports, "Composer", {
3783
3269
  enumerable: true,
3784
- get: function () { return chunkHPK3EWBF_cjs.CSS_VARS; }
3270
+ get: function () { return chunkTSNRU3UO_cjs.Composer; }
3785
3271
  });
3786
- Object.defineProperty(exports, "ChatProvider", {
3272
+ Object.defineProperty(exports, "EmptyState", {
3787
3273
  enumerable: true,
3788
- get: function () { return chunkHPK3EWBF_cjs.ChatProvider; }
3274
+ get: function () { return chunkTSNRU3UO_cjs.EmptyState; }
3789
3275
  });
3790
- Object.defineProperty(exports, "ChatRoot", {
3276
+ Object.defineProperty(exports, "ErrorBanner", {
3791
3277
  enumerable: true,
3792
- get: function () { return chunkHPK3EWBF_cjs.ChatRoot; }
3278
+ get: function () { return chunkTSNRU3UO_cjs.ErrorBanner; }
3793
3279
  });
3794
- Object.defineProperty(exports, "Composer", {
3280
+ Object.defineProperty(exports, "JumpToLatest", {
3795
3281
  enumerable: true,
3796
- get: function () { return chunkHPK3EWBF_cjs.Composer; }
3282
+ get: function () { return chunkTSNRU3UO_cjs.JumpToLatest; }
3797
3283
  });
3798
- Object.defineProperty(exports, "DEFAULT_CHAT_SOUNDS", {
3284
+ Object.defineProperty(exports, "MessageActions", {
3799
3285
  enumerable: true,
3800
- get: function () { return chunkHPK3EWBF_cjs.DEFAULT_CHAT_SOUNDS; }
3286
+ get: function () { return chunkTSNRU3UO_cjs.MessageActions; }
3801
3287
  });
3802
- Object.defineProperty(exports, "DEFAULT_LABELS", {
3288
+ Object.defineProperty(exports, "MessageBubble", {
3803
3289
  enumerable: true,
3804
- get: function () { return chunkHPK3EWBF_cjs.DEFAULT_LABELS; }
3290
+ get: function () { return chunkTSNRU3UO_cjs.MessageBubble; }
3805
3291
  });
3806
- Object.defineProperty(exports, "DEFAULT_SIDEBAR", {
3292
+ Object.defineProperty(exports, "MessageList", {
3807
3293
  enumerable: true,
3808
- get: function () { return chunkHPK3EWBF_cjs.DEFAULT_SIDEBAR; }
3294
+ get: function () { return chunkTSNRU3UO_cjs.MessageList; }
3809
3295
  });
3810
- Object.defineProperty(exports, "DEFAULT_Z_INDEX", {
3296
+ Object.defineProperty(exports, "Sources", {
3811
3297
  enumerable: true,
3812
- get: function () { return chunkHPK3EWBF_cjs.DEFAULT_Z_INDEX; }
3298
+ get: function () { return chunkTSNRU3UO_cjs.Sources; }
3813
3299
  });
3814
- Object.defineProperty(exports, "EmptyState", {
3300
+ Object.defineProperty(exports, "StreamingIndicator", {
3815
3301
  enumerable: true,
3816
- get: function () { return chunkHPK3EWBF_cjs.EmptyState; }
3302
+ get: function () { return chunkTSNRU3UO_cjs.StreamingIndicator; }
3817
3303
  });
3818
- Object.defineProperty(exports, "ErrorBanner", {
3304
+ Object.defineProperty(exports, "ToolCalls", {
3819
3305
  enumerable: true,
3820
- get: function () { return chunkHPK3EWBF_cjs.ErrorBanner; }
3306
+ get: function () { return chunkTSNRU3UO_cjs.ToolCalls; }
3821
3307
  });
3822
- Object.defineProperty(exports, "HOTKEYS", {
3308
+ Object.defineProperty(exports, "deriveInitials", {
3823
3309
  enumerable: true,
3824
- get: function () { return chunkHPK3EWBF_cjs.HOTKEYS; }
3310
+ get: function () { return chunkTSNRU3UO_cjs.deriveInitials; }
3825
3311
  });
3826
- Object.defineProperty(exports, "JumpToLatest", {
3312
+ Object.defineProperty(exports, "isSubmittableDraft", {
3827
3313
  enumerable: true,
3828
- get: function () { return chunkHPK3EWBF_cjs.JumpToLatest; }
3314
+ get: function () { return chunkTSNRU3UO_cjs.isSubmittableDraft; }
3829
3315
  });
3830
- Object.defineProperty(exports, "LIMITS", {
3316
+ Object.defineProperty(exports, "resolvePersona", {
3831
3317
  enumerable: true,
3832
- get: function () { return chunkHPK3EWBF_cjs.LIMITS; }
3318
+ get: function () { return chunkTSNRU3UO_cjs.resolvePersona; }
3833
3319
  });
3834
- Object.defineProperty(exports, "MessageActions", {
3320
+ Object.defineProperty(exports, "sanitizeDraft", {
3835
3321
  enumerable: true,
3836
- get: function () { return chunkHPK3EWBF_cjs.MessageActions; }
3322
+ get: function () { return chunkTSNRU3UO_cjs.sanitizeDraft; }
3837
3323
  });
3838
- Object.defineProperty(exports, "MessageBubble", {
3324
+ Object.defineProperty(exports, "useAutoFocusOnStreamEnd", {
3839
3325
  enumerable: true,
3840
- get: function () { return chunkHPK3EWBF_cjs.MessageBubble; }
3326
+ get: function () { return chunkTSNRU3UO_cjs.useAutoFocusOnStreamEnd; }
3841
3327
  });
3842
- Object.defineProperty(exports, "MessageList", {
3328
+ Object.defineProperty(exports, "useChatBubbleStyles", {
3843
3329
  enumerable: true,
3844
- get: function () { return chunkHPK3EWBF_cjs.MessageList; }
3330
+ get: function () { return chunkTSNRU3UO_cjs.useChatBubbleStyles; }
3845
3331
  });
3846
- Object.defineProperty(exports, "STORAGE_KEYS", {
3332
+ Object.defineProperty(exports, "useChatComposer", {
3847
3333
  enumerable: true,
3848
- get: function () { return chunkHPK3EWBF_cjs.STORAGE_KEYS; }
3334
+ get: function () { return chunkTSNRU3UO_cjs.useChatComposer; }
3849
3335
  });
3850
- Object.defineProperty(exports, "Sources", {
3336
+ Object.defineProperty(exports, "useChatDestructiveStyles", {
3851
3337
  enumerable: true,
3852
- get: function () { return chunkHPK3EWBF_cjs.Sources; }
3338
+ get: function () { return chunkTSNRU3UO_cjs.useChatDestructiveStyles; }
3853
3339
  });
3854
- Object.defineProperty(exports, "StreamingIndicator", {
3340
+ Object.defineProperty(exports, "useChatRoleStyles", {
3855
3341
  enumerable: true,
3856
- get: function () { return chunkHPK3EWBF_cjs.StreamingIndicator; }
3342
+ get: function () { return chunkTSNRU3UO_cjs.useChatRoleStyles; }
3857
3343
  });
3858
- Object.defineProperty(exports, "ToolCalls", {
3344
+ Object.defineProperty(exports, "useFocusOnEmptyClick", {
3859
3345
  enumerable: true,
3860
- get: function () { return chunkHPK3EWBF_cjs.ToolCalls; }
3346
+ get: function () { return chunkTSNRU3UO_cjs.useFocusOnEmptyClick; }
3861
3347
  });
3862
- Object.defineProperty(exports, "createId", {
3348
+ Object.defineProperty(exports, "useRegisterComposer", {
3863
3349
  enumerable: true,
3864
- get: function () { return chunkHPK3EWBF_cjs.createId; }
3350
+ get: function () { return chunkTSNRU3UO_cjs.useRegisterComposer; }
3865
3351
  });
3866
- Object.defineProperty(exports, "createTokenBuffer", {
3352
+ Object.defineProperty(exports, "CHAT_EVENT_NAME", {
3867
3353
  enumerable: true,
3868
- get: function () { return chunkHPK3EWBF_cjs.createTokenBuffer; }
3354
+ get: function () { return chunkTBSHZO5R_cjs.CHAT_EVENT_NAME; }
3869
3355
  });
3870
- Object.defineProperty(exports, "deriveInitials", {
3356
+ Object.defineProperty(exports, "CSS_VARS", {
3871
3357
  enumerable: true,
3872
- get: function () { return chunkHPK3EWBF_cjs.deriveInitials; }
3358
+ get: function () { return chunkTBSHZO5R_cjs.CSS_VARS; }
3873
3359
  });
3874
- Object.defineProperty(exports, "getChatLogger", {
3360
+ Object.defineProperty(exports, "ChatProvider", {
3875
3361
  enumerable: true,
3876
- get: function () { return chunkHPK3EWBF_cjs.getChatLogger; }
3362
+ get: function () { return chunkTBSHZO5R_cjs.ChatProvider; }
3877
3363
  });
3878
- Object.defineProperty(exports, "initialState", {
3364
+ Object.defineProperty(exports, "DEFAULT_CHAT_SOUNDS", {
3879
3365
  enumerable: true,
3880
- get: function () { return chunkHPK3EWBF_cjs.initialState; }
3366
+ get: function () { return chunkTBSHZO5R_cjs.DEFAULT_CHAT_SOUNDS; }
3881
3367
  });
3882
- Object.defineProperty(exports, "isSubmittableDraft", {
3368
+ Object.defineProperty(exports, "DEFAULT_LABELS", {
3883
3369
  enumerable: true,
3884
- get: function () { return chunkHPK3EWBF_cjs.isSubmittableDraft; }
3370
+ get: function () { return chunkTBSHZO5R_cjs.DEFAULT_LABELS; }
3885
3371
  });
3886
- Object.defineProperty(exports, "reducer", {
3372
+ Object.defineProperty(exports, "DEFAULT_SIDEBAR", {
3887
3373
  enumerable: true,
3888
- get: function () { return chunkHPK3EWBF_cjs.reducer; }
3374
+ get: function () { return chunkTBSHZO5R_cjs.DEFAULT_SIDEBAR; }
3889
3375
  });
3890
- Object.defineProperty(exports, "resolvePersona", {
3376
+ Object.defineProperty(exports, "DEFAULT_Z_INDEX", {
3891
3377
  enumerable: true,
3892
- get: function () { return chunkHPK3EWBF_cjs.resolvePersona; }
3378
+ get: function () { return chunkTBSHZO5R_cjs.DEFAULT_Z_INDEX; }
3893
3379
  });
3894
- Object.defineProperty(exports, "sanitizeDraft", {
3380
+ Object.defineProperty(exports, "HOTKEYS", {
3895
3381
  enumerable: true,
3896
- get: function () { return chunkHPK3EWBF_cjs.sanitizeDraft; }
3382
+ get: function () { return chunkTBSHZO5R_cjs.HOTKEYS; }
3897
3383
  });
3898
- Object.defineProperty(exports, "useAutoFocusOnStreamEnd", {
3384
+ Object.defineProperty(exports, "LIMITS", {
3899
3385
  enumerable: true,
3900
- get: function () { return chunkHPK3EWBF_cjs.useAutoFocusOnStreamEnd; }
3386
+ get: function () { return chunkTBSHZO5R_cjs.LIMITS; }
3901
3387
  });
3902
- Object.defineProperty(exports, "useChat", {
3388
+ Object.defineProperty(exports, "STORAGE_KEYS", {
3903
3389
  enumerable: true,
3904
- get: function () { return chunkHPK3EWBF_cjs.useChat; }
3390
+ get: function () { return chunkTBSHZO5R_cjs.STORAGE_KEYS; }
3905
3391
  });
3906
- Object.defineProperty(exports, "useChatAudio", {
3392
+ Object.defineProperty(exports, "createId", {
3907
3393
  enumerable: true,
3908
- get: function () { return chunkHPK3EWBF_cjs.useChatAudio; }
3394
+ get: function () { return chunkTBSHZO5R_cjs.createId; }
3909
3395
  });
3910
- Object.defineProperty(exports, "useChatBubbleStyles", {
3396
+ Object.defineProperty(exports, "createTokenBuffer", {
3911
3397
  enumerable: true,
3912
- get: function () { return chunkHPK3EWBF_cjs.useChatBubbleStyles; }
3398
+ get: function () { return chunkTBSHZO5R_cjs.createTokenBuffer; }
3913
3399
  });
3914
- Object.defineProperty(exports, "useChatComposer", {
3400
+ Object.defineProperty(exports, "getChatLogger", {
3915
3401
  enumerable: true,
3916
- get: function () { return chunkHPK3EWBF_cjs.useChatComposer; }
3402
+ get: function () { return chunkTBSHZO5R_cjs.getChatLogger; }
3917
3403
  });
3918
- Object.defineProperty(exports, "useChatContext", {
3404
+ Object.defineProperty(exports, "initialState", {
3919
3405
  enumerable: true,
3920
- get: function () { return chunkHPK3EWBF_cjs.useChatContext; }
3406
+ get: function () { return chunkTBSHZO5R_cjs.initialState; }
3921
3407
  });
3922
- Object.defineProperty(exports, "useChatContextOptional", {
3408
+ Object.defineProperty(exports, "reducer", {
3923
3409
  enumerable: true,
3924
- get: function () { return chunkHPK3EWBF_cjs.useChatContextOptional; }
3410
+ get: function () { return chunkTBSHZO5R_cjs.reducer; }
3925
3411
  });
3926
- Object.defineProperty(exports, "useChatDestructiveStyles", {
3412
+ Object.defineProperty(exports, "useChat", {
3927
3413
  enumerable: true,
3928
- get: function () { return chunkHPK3EWBF_cjs.useChatDestructiveStyles; }
3414
+ get: function () { return chunkTBSHZO5R_cjs.useChat; }
3929
3415
  });
3930
- Object.defineProperty(exports, "useChatLayout", {
3416
+ Object.defineProperty(exports, "useChatAudio", {
3931
3417
  enumerable: true,
3932
- get: function () { return chunkHPK3EWBF_cjs.useChatLayout; }
3418
+ get: function () { return chunkTBSHZO5R_cjs.useChatAudio; }
3933
3419
  });
3934
- Object.defineProperty(exports, "useChatRoleStyles", {
3420
+ Object.defineProperty(exports, "useChatContext", {
3935
3421
  enumerable: true,
3936
- get: function () { return chunkHPK3EWBF_cjs.useChatRoleStyles; }
3422
+ get: function () { return chunkTBSHZO5R_cjs.useChatContext; }
3937
3423
  });
3938
- Object.defineProperty(exports, "useFocusOnEmptyClick", {
3424
+ Object.defineProperty(exports, "useChatContextOptional", {
3939
3425
  enumerable: true,
3940
- get: function () { return chunkHPK3EWBF_cjs.useFocusOnEmptyClick; }
3426
+ get: function () { return chunkTBSHZO5R_cjs.useChatContextOptional; }
3941
3427
  });
3942
- Object.defineProperty(exports, "useRegisterComposer", {
3428
+ Object.defineProperty(exports, "useChatLayout", {
3943
3429
  enumerable: true,
3944
- get: function () { return chunkHPK3EWBF_cjs.useRegisterComposer; }
3430
+ get: function () { return chunkTBSHZO5R_cjs.useChatLayout; }
3945
3431
  });
3946
3432
  Object.defineProperty(exports, "TreeError", {
3947
3433
  enumerable: true,
@@ -4124,18 +3610,6 @@ Object.defineProperty(exports, "JsonTree", {
4124
3610
  get: function () { return chunkT3MWM23F_cjs.JsonTree_default; }
4125
3611
  });
4126
3612
  exports.AudioToggle = AudioToggle;
4127
- exports.CardLoadingFallback = CardLoadingFallback;
4128
- exports.ChatDock = ChatDock;
4129
- exports.ChatFAB = ChatFAB;
4130
- exports.ChatGreeting = ChatGreeting;
4131
- exports.ChatHeader = ChatHeader;
4132
- exports.ChatHeaderActionButton = ChatHeaderActionButton;
4133
- exports.ChatHeaderAudioToggle = ChatHeaderAudioToggle;
4134
- exports.ChatHeaderLanguageButton = ChatHeaderLanguageButton;
4135
- exports.ChatHeaderModeToggle = ChatHeaderModeToggle;
4136
- exports.ChatHeaderResetButton = ChatHeaderResetButton;
4137
- exports.ChatLauncher = ChatLauncher;
4138
- exports.ChatUnreadPreview = ChatUnreadPreview;
4139
3613
  exports.CronScheduler = CronScheduler;
4140
3614
  exports.DEFAULT_DOCK_PREFS = DEFAULT_DOCK_PREFS;
4141
3615
  exports.DiffEditor = DiffEditor;
@@ -4155,17 +3629,12 @@ exports.LazyOpenapiViewer = LazyOpenapiViewer;
4155
3629
  exports.LazyPrettyCode = LazyPrettyCode;
4156
3630
  exports.LazyTree = LazyTree;
4157
3631
  exports.LazyVideoPlayer = LazyVideoPlayer;
4158
- exports.LazyWrapper = LazyWrapper;
4159
- exports.LoadingFallback = LoadingFallback;
4160
3632
  exports.LottiePlayer = LottiePlayer;
4161
- exports.MapLoadingFallback = MapLoadingFallback;
4162
3633
  exports.MarkdownEditor = MarkdownEditor;
4163
3634
  exports.OpenapiViewer = OpenapiViewer_default;
4164
- exports.Spinner = Spinner;
4165
3635
  exports.TransportError = TransportError;
4166
3636
  exports.collectImageAttachments = collectImageAttachments;
4167
3637
  exports.createHttpTransport = createHttpTransport;
4168
- exports.createLazyComponent = createLazyComponent;
4169
3638
  exports.createMockTransport = createMockTransport;
4170
3639
  exports.createPydanticAIChatTransport = createPydanticAIChatTransport;
4171
3640
  exports.createPydanticAISSEMap = createPydanticAISSEMap;
@@ -4182,8 +3651,6 @@ exports.useChatAudioPrefs = useChatAudioPrefs;
4182
3651
  exports.useChatDockPrefs = useChatDockPrefs;
4183
3652
  exports.useChatHistory = useChatHistory;
4184
3653
  exports.useChatLightbox = useChatLightbox;
4185
- exports.useChatPresence = useChatPresence;
4186
- exports.useChatReset = useChatReset;
4187
3654
  exports.useChatScroll = useChatScroll;
4188
3655
  exports.useChatUnread = useChatUnread;
4189
3656
  exports.useEditor = useEditor;