@djangocfg/ui-tools 2.1.390 → 2.1.393

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 (183) hide show
  1. package/README.md +7 -10
  2. package/dist/chunk-PAWJFY3S.mjs +6 -0
  3. package/dist/{chunk-N2XQF2OL.mjs.map → chunk-PAWJFY3S.mjs.map} +1 -1
  4. package/dist/chunk-PK6SKIKE.cjs +8 -0
  5. package/dist/{chunk-OLISEQHS.cjs.map → chunk-PK6SKIKE.cjs.map} +1 -1
  6. package/dist/file-icon/index.cjs +6 -6
  7. package/dist/file-icon/index.d.cts +1 -1
  8. package/dist/file-icon/index.d.ts +1 -1
  9. package/dist/file-icon/index.mjs +1 -1
  10. package/dist/tree/index.cjs +1372 -143
  11. package/dist/tree/index.cjs.map +1 -1
  12. package/dist/tree/index.d.cts +2 -2
  13. package/dist/tree/index.d.ts +2 -2
  14. package/dist/tree/index.mjs +1322 -3
  15. package/dist/tree/index.mjs.map +1 -1
  16. package/dist/{types-CevSbyfD.d.cts → types-B_zhyAqR.d.cts} +1 -1
  17. package/dist/{types-CevSbyfD.d.ts → types-B_zhyAqR.d.ts} +1 -1
  18. package/package.json +6 -14
  19. package/src/tools/AudioPlayer/README.md +4 -4
  20. package/src/tools/Chat/README.md +6 -6
  21. package/src/tools/CronScheduler/index.tsx +1 -1
  22. package/src/tools/CronScheduler/lazy.tsx +1 -1
  23. package/src/tools/ImageViewer/README.md +1 -1
  24. package/src/tools/JsonForm/README.md +2 -2
  25. package/src/tools/MarkdownEditor/README.md +3 -3
  26. package/src/tools/MarkdownMessage/README.md +2 -2
  27. package/src/tools/OpenapiViewer/components/DocsLayout/grouping.ts +5 -1
  28. package/src/tools/SpeechRecognition/README.md +1 -1
  29. package/dist/ChatRoot-EFNXQXXN.cjs +0 -15
  30. package/dist/ChatRoot-EFNXQXXN.cjs.map +0 -1
  31. package/dist/ChatRoot-FITF5RVP.mjs +0 -6
  32. package/dist/ChatRoot-FITF5RVP.mjs.map +0 -1
  33. package/dist/ChatRoot-PNNGQCYF.css +0 -7
  34. package/dist/ChatRoot-PNNGQCYF.css.map +0 -1
  35. package/dist/CronScheduler.client-DLMXCPAJ.mjs +0 -67
  36. package/dist/CronScheduler.client-DLMXCPAJ.mjs.map +0 -1
  37. package/dist/CronScheduler.client-WEJF4PWQ.cjs +0 -72
  38. package/dist/CronScheduler.client-WEJF4PWQ.cjs.map +0 -1
  39. package/dist/DictationField-AS2F33WI.cjs +0 -13
  40. package/dist/DictationField-AS2F33WI.cjs.map +0 -1
  41. package/dist/DictationField-WPONUCYE.mjs +0 -4
  42. package/dist/DictationField-WPONUCYE.mjs.map +0 -1
  43. package/dist/DocsLayout-EKASBSP7.mjs +0 -3448
  44. package/dist/DocsLayout-EKASBSP7.mjs.map +0 -1
  45. package/dist/DocsLayout-MBFIB4NO.css +0 -7
  46. package/dist/DocsLayout-MBFIB4NO.css.map +0 -1
  47. package/dist/DocsLayout-OURFYWQE.cjs +0 -3455
  48. package/dist/DocsLayout-OURFYWQE.cjs.map +0 -1
  49. package/dist/JsonSchemaForm-DD7CLRIG.cjs +0 -13
  50. package/dist/JsonSchemaForm-DD7CLRIG.cjs.map +0 -1
  51. package/dist/JsonSchemaForm-XKUIVELK.mjs +0 -4
  52. package/dist/JsonSchemaForm-XKUIVELK.mjs.map +0 -1
  53. package/dist/JsonTree-43PQAJKY.mjs +0 -5
  54. package/dist/JsonTree-43PQAJKY.mjs.map +0 -1
  55. package/dist/JsonTree-MLET23ZA.css +0 -7
  56. package/dist/JsonTree-MLET23ZA.css.map +0 -1
  57. package/dist/JsonTree-X6W5YEVY.cjs +0 -11
  58. package/dist/JsonTree-X6W5YEVY.cjs.map +0 -1
  59. package/dist/LottiePlayer.client-2S7ISJ2S.cjs +0 -168
  60. package/dist/LottiePlayer.client-2S7ISJ2S.cjs.map +0 -1
  61. package/dist/LottiePlayer.client-5LDSSJWS.mjs +0 -161
  62. package/dist/LottiePlayer.client-5LDSSJWS.mjs.map +0 -1
  63. package/dist/MapContainer-AKIPABJK.mjs +0 -4
  64. package/dist/MapContainer-AKIPABJK.mjs.map +0 -1
  65. package/dist/MapContainer-STVDMC36.cjs +0 -17
  66. package/dist/MapContainer-STVDMC36.cjs.map +0 -1
  67. package/dist/Mermaid.client-DDXWXZXY.css +0 -7
  68. package/dist/Mermaid.client-DDXWXZXY.css.map +0 -1
  69. package/dist/Mermaid.client-NL4SVR7F.mjs +0 -481
  70. package/dist/Mermaid.client-NL4SVR7F.mjs.map +0 -1
  71. package/dist/Mermaid.client-NNTI6DFX.cjs +0 -487
  72. package/dist/Mermaid.client-NNTI6DFX.cjs.map +0 -1
  73. package/dist/Player-BRV7XTWR.mjs +0 -4
  74. package/dist/Player-BRV7XTWR.mjs.map +0 -1
  75. package/dist/Player-PM7F7DD7.cjs +0 -13
  76. package/dist/Player-PM7F7DD7.cjs.map +0 -1
  77. package/dist/Player-ZGQKKOWI.css +0 -66
  78. package/dist/Player-ZGQKKOWI.css.map +0 -1
  79. package/dist/PrettyCode.client-GWFAIVFN.css +0 -7
  80. package/dist/PrettyCode.client-GWFAIVFN.css.map +0 -1
  81. package/dist/PrettyCode.client-KOHDVPPN.cjs +0 -285
  82. package/dist/PrettyCode.client-KOHDVPPN.cjs.map +0 -1
  83. package/dist/PrettyCode.client-ZGYGKE7G.mjs +0 -283
  84. package/dist/PrettyCode.client-ZGYGKE7G.mjs.map +0 -1
  85. package/dist/TreeRoot-5COOOSWG.mjs +0 -4
  86. package/dist/TreeRoot-5COOOSWG.mjs.map +0 -1
  87. package/dist/TreeRoot-AABP2J6Y.cjs +0 -19
  88. package/dist/TreeRoot-AABP2J6Y.cjs.map +0 -1
  89. package/dist/chunk-2NG4SXEP.mjs +0 -743
  90. package/dist/chunk-2NG4SXEP.mjs.map +0 -1
  91. package/dist/chunk-4LFB7I5K.cjs +0 -1387
  92. package/dist/chunk-4LFB7I5K.cjs.map +0 -1
  93. package/dist/chunk-5D2OCOPQ.cjs +0 -222
  94. package/dist/chunk-5D2OCOPQ.cjs.map +0 -1
  95. package/dist/chunk-5I5QNGUG.cjs +0 -611
  96. package/dist/chunk-5I5QNGUG.cjs.map +0 -1
  97. package/dist/chunk-6ZX2G25W.mjs +0 -1361
  98. package/dist/chunk-6ZX2G25W.mjs.map +0 -1
  99. package/dist/chunk-76NNDZH6.cjs +0 -1061
  100. package/dist/chunk-76NNDZH6.cjs.map +0 -1
  101. package/dist/chunk-7CWGZPO3.mjs +0 -214
  102. package/dist/chunk-7CWGZPO3.mjs.map +0 -1
  103. package/dist/chunk-7EYHNP3E.cjs +0 -965
  104. package/dist/chunk-7EYHNP3E.cjs.map +0 -1
  105. package/dist/chunk-7IYXZUJO.cjs +0 -769
  106. package/dist/chunk-7IYXZUJO.cjs.map +0 -1
  107. package/dist/chunk-ADEN3UA4.cjs +0 -892
  108. package/dist/chunk-ADEN3UA4.cjs.map +0 -1
  109. package/dist/chunk-B6IR5KSC.mjs +0 -59
  110. package/dist/chunk-B6IR5KSC.mjs.map +0 -1
  111. package/dist/chunk-C6GXVH5J.mjs +0 -338
  112. package/dist/chunk-C6GXVH5J.mjs.map +0 -1
  113. package/dist/chunk-DMX7W4XZ.mjs +0 -1113
  114. package/dist/chunk-DMX7W4XZ.mjs.map +0 -1
  115. package/dist/chunk-ECONRHIG.mjs +0 -212
  116. package/dist/chunk-ECONRHIG.mjs.map +0 -1
  117. package/dist/chunk-FEN5S772.cjs +0 -1227
  118. package/dist/chunk-FEN5S772.cjs.map +0 -1
  119. package/dist/chunk-FP2RLYQZ.cjs +0 -187
  120. package/dist/chunk-FP2RLYQZ.cjs.map +0 -1
  121. package/dist/chunk-FVVF7VCD.cjs +0 -1325
  122. package/dist/chunk-FVVF7VCD.cjs.map +0 -1
  123. package/dist/chunk-GYIO7W7M.mjs +0 -1197
  124. package/dist/chunk-GYIO7W7M.mjs.map +0 -1
  125. package/dist/chunk-KNDLV4PI.cjs +0 -1356
  126. package/dist/chunk-KNDLV4PI.cjs.map +0 -1
  127. package/dist/chunk-KNEQRUBA.mjs +0 -181
  128. package/dist/chunk-KNEQRUBA.mjs.map +0 -1
  129. package/dist/chunk-N2XQF2OL.mjs +0 -14
  130. package/dist/chunk-N4MZYNR4.mjs +0 -1342
  131. package/dist/chunk-N4MZYNR4.mjs.map +0 -1
  132. package/dist/chunk-NTVBIIUD.mjs +0 -1439
  133. package/dist/chunk-NTVBIIUD.mjs.map +0 -1
  134. package/dist/chunk-OBRSGM64.mjs +0 -607
  135. package/dist/chunk-OBRSGM64.mjs.map +0 -1
  136. package/dist/chunk-ODO4GMW7.mjs +0 -79
  137. package/dist/chunk-ODO4GMW7.mjs.map +0 -1
  138. package/dist/chunk-OLISEQHS.cjs +0 -18
  139. package/dist/chunk-PVAX67JG.mjs +0 -1041
  140. package/dist/chunk-PVAX67JG.mjs.map +0 -1
  141. package/dist/chunk-QJ6GTUCO.cjs +0 -81
  142. package/dist/chunk-QJ6GTUCO.cjs.map +0 -1
  143. package/dist/chunk-T3MWM23F.cjs +0 -214
  144. package/dist/chunk-T3MWM23F.cjs.map +0 -1
  145. package/dist/chunk-TBSHZO5R.cjs +0 -1134
  146. package/dist/chunk-TBSHZO5R.cjs.map +0 -1
  147. package/dist/chunk-UNCS5V5F.mjs +0 -887
  148. package/dist/chunk-UNCS5V5F.mjs.map +0 -1
  149. package/dist/chunk-VWQ5WOIL.mjs +0 -2059
  150. package/dist/chunk-VWQ5WOIL.mjs.map +0 -1
  151. package/dist/chunk-W75B7Y6C.cjs +0 -1478
  152. package/dist/chunk-W75B7Y6C.cjs.map +0 -1
  153. package/dist/chunk-Y6UTOBF6.mjs +0 -938
  154. package/dist/chunk-Y6UTOBF6.mjs.map +0 -1
  155. package/dist/chunk-YDPDTOSP.cjs +0 -2061
  156. package/dist/chunk-YDPDTOSP.cjs.map +0 -1
  157. package/dist/chunk-YW5IVWHQ.cjs +0 -346
  158. package/dist/chunk-YW5IVWHQ.cjs.map +0 -1
  159. package/dist/chunk-YXZ6GU7H.cjs +0 -63
  160. package/dist/chunk-YXZ6GU7H.cjs.map +0 -1
  161. package/dist/chunk-ZL7FH4NW.mjs +0 -1274
  162. package/dist/chunk-ZL7FH4NW.mjs.map +0 -1
  163. package/dist/components-EHOGXATG.cjs +0 -22
  164. package/dist/components-EHOGXATG.cjs.map +0 -1
  165. package/dist/components-MQ6DR7TX.cjs +0 -26
  166. package/dist/components-MQ6DR7TX.cjs.map +0 -1
  167. package/dist/components-XRX7QGLB.mjs +0 -5
  168. package/dist/components-XRX7QGLB.mjs.map +0 -1
  169. package/dist/components-YATKRWLH.mjs +0 -5
  170. package/dist/components-YATKRWLH.mjs.map +0 -1
  171. package/dist/index.cjs +0 -3674
  172. package/dist/index.cjs.map +0 -1
  173. package/dist/index.css +0 -234
  174. package/dist/index.css.map +0 -1
  175. package/dist/index.d.cts +0 -4929
  176. package/dist/index.d.ts +0 -4929
  177. package/dist/index.mjs +0 -2912
  178. package/dist/index.mjs.map +0 -1
  179. package/dist/launcher-5Y42OBSN.mjs +0 -6
  180. package/dist/launcher-5Y42OBSN.mjs.map +0 -1
  181. package/dist/launcher-PMW2YB24.cjs +0 -59
  182. package/dist/launcher-PMW2YB24.cjs.map +0 -1
  183. package/src/index.ts +0 -157
package/dist/index.cjs DELETED
@@ -1,3674 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkW75B7Y6C_cjs = require('./chunk-W75B7Y6C.cjs');
4
- var chunk4LFB7I5K_cjs = require('./chunk-4LFB7I5K.cjs');
5
- var chunkTBSHZO5R_cjs = require('./chunk-TBSHZO5R.cjs');
6
- var chunkFEN5S772_cjs = require('./chunk-FEN5S772.cjs');
7
- var chunkQJ6GTUCO_cjs = require('./chunk-QJ6GTUCO.cjs');
8
- var chunkYDPDTOSP_cjs = require('./chunk-YDPDTOSP.cjs');
9
- var chunkKNDLV4PI_cjs = require('./chunk-KNDLV4PI.cjs');
10
- var chunk5I5QNGUG_cjs = require('./chunk-5I5QNGUG.cjs');
11
- var chunkYW5IVWHQ_cjs = require('./chunk-YW5IVWHQ.cjs');
12
- var chunk76NNDZH6_cjs = require('./chunk-76NNDZH6.cjs');
13
- require('./chunk-ADEN3UA4.cjs');
14
- var chunkYXZ6GU7H_cjs = require('./chunk-YXZ6GU7H.cjs');
15
- var chunkFVVF7VCD_cjs = require('./chunk-FVVF7VCD.cjs');
16
- var chunk5D2OCOPQ_cjs = require('./chunk-5D2OCOPQ.cjs');
17
- var chunk7EYHNP3E_cjs = require('./chunk-7EYHNP3E.cjs');
18
- var chunk7IYXZUJO_cjs = require('./chunk-7IYXZUJO.cjs');
19
- var chunkT3MWM23F_cjs = require('./chunk-T3MWM23F.cjs');
20
- require('./chunk-FP2RLYQZ.cjs');
21
- var chunkOLISEQHS_cjs = require('./chunk-OLISEQHS.cjs');
22
- var maplibre = require('react-map-gl/maplibre');
23
- var jsxRuntime = require('react/jsx-runtime');
24
- var react = require('react');
25
- var reactDom = require('react-dom');
26
- var hooks = require('@djangocfg/ui-core/hooks');
27
- var lucideReact = require('lucide-react');
28
- var components = require('@djangocfg/ui-core/components');
29
- var lib = require('@djangocfg/ui-core/lib');
30
- var react$1 = require('@tiptap/react');
31
- var StarterKit = require('@tiptap/starter-kit');
32
- var Placeholder = require('@tiptap/extension-placeholder');
33
- var Mention = require('@tiptap/extension-mention');
34
- var markdown = require('@tiptap/markdown');
35
- var dom = require('@floating-ui/dom');
36
- var core = require('@tiptap/core');
37
-
38
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
39
-
40
- var StarterKit__default = /*#__PURE__*/_interopDefault(StarterKit);
41
- var Placeholder__default = /*#__PURE__*/_interopDefault(Placeholder);
42
- var Mention__default = /*#__PURE__*/_interopDefault(Mention);
43
-
44
- var DefaultPin = react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function DefaultPin2({
45
- size = 24,
46
- color = "#ef4444"
47
- }) {
48
- return /* @__PURE__ */ jsxRuntime.jsxs(
49
- "svg",
50
- {
51
- width: size,
52
- height: size,
53
- viewBox: "0 0 24 24",
54
- fill: "none",
55
- style: { cursor: "pointer" },
56
- children: [
57
- /* @__PURE__ */ jsxRuntime.jsx(
58
- "path",
59
- {
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"
64
- }
65
- ),
66
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "9", r: "2.5", fill: "#fff" })
67
- ]
68
- }
69
- );
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
82
- }) {
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
- );
108
- return /* @__PURE__ */ jsxRuntime.jsx(
109
- maplibre.Marker,
110
- {
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 })
120
- }
121
- );
122
- }, "MapMarker"));
123
- react.memo(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MapPopup2({
124
- longitude,
125
- latitude,
126
- onClose,
127
- children,
128
- anchor = "bottom",
129
- closeOnClick = true,
130
- closeButton = true,
131
- className,
132
- maxWidth = "300px",
133
- offset: offset2 = 15
134
- }) {
135
- return /* @__PURE__ */ jsxRuntime.jsx(
136
- maplibre.Popup,
137
- {
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"
231
- }
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
- };
673
- }
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
- ] });
882
- }
883
- chunkOLISEQHS_cjs.__name(LayerSwitcherComponent, "LayerSwitcherComponent");
884
- react.memo(LayerSwitcherComponent);
885
- var LazyMapContainer = chunkW75B7Y6C_cjs.createLazyComponent(
886
- () => import('./MapContainer-STVDMC36.cjs').then((mod) => ({ default: mod.MapContainer })),
887
- {
888
- displayName: "LazyMapContainer",
889
- fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkW75B7Y6C_cjs.MapLoadingFallback, { minHeight: 400 })
890
- }
891
- );
892
- var LazyMapView = chunkW75B7Y6C_cjs.createLazyComponent(
893
- () => import('./MapContainer-STVDMC36.cjs').then((mod) => ({ default: mod.MapView })),
894
- {
895
- displayName: "LazyMapView",
896
- fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkW75B7Y6C_cjs.MapLoadingFallback, { minHeight: 400 })
897
- }
898
- );
899
- var LazyMermaid = chunkW75B7Y6C_cjs.createLazyComponent(
900
- () => import('./Mermaid.client-NNTI6DFX.cjs'),
901
- {
902
- displayName: "LazyMermaid",
903
- fallback: /* @__PURE__ */ jsxRuntime.jsx(
904
- chunkW75B7Y6C_cjs.CardLoadingFallback,
905
- {
906
- title: "Diagram",
907
- description: "Loading...",
908
- minHeight: 200
909
- }
910
- )
911
- }
912
- );
913
- function CodeLoadingFallback() {
914
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative rounded-sm border border-border overflow-hidden bg-muted dark:bg-zinc-900", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
915
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-pulse h-4 w-4 rounded-full bg-muted-foreground/20" }),
916
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "Loading code..." })
917
- ] }) }) });
918
- }
919
- chunkOLISEQHS_cjs.__name(CodeLoadingFallback, "CodeLoadingFallback");
920
- var LazyPrettyCode = chunkW75B7Y6C_cjs.createLazyComponent(
921
- () => import('./PrettyCode.client-KOHDVPPN.cjs'),
922
- {
923
- displayName: "LazyPrettyCode",
924
- fallback: /* @__PURE__ */ jsxRuntime.jsx(CodeLoadingFallback, {})
925
- }
926
- );
927
- function OpenapiLoadingFallback() {
928
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center min-h-[400px] bg-muted/30 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
929
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-primary border-r-transparent" }),
930
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: "Loading API Playground..." })
931
- ] }) });
932
- }
933
- chunkOLISEQHS_cjs.__name(OpenapiLoadingFallback, "OpenapiLoadingFallback");
934
- var LazyDocsLayout = chunkW75B7Y6C_cjs.createLazyComponent(
935
- () => import('./DocsLayout-OURFYWQE.cjs').then((mod) => ({ default: mod.DocsLayout })),
936
- {
937
- displayName: "LazyDocsLayout",
938
- fallback: /* @__PURE__ */ jsxRuntime.jsx(OpenapiLoadingFallback, {})
939
- }
940
- );
941
- var LazyOpenapiViewer = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ config }) => {
942
- return /* @__PURE__ */ jsxRuntime.jsx(chunk7EYHNP3E_cjs.PlaygroundProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(LazyDocsLayout, {}) });
943
- }, "LazyOpenapiViewer");
944
- LazyOpenapiViewer.displayName = "LazyOpenapiViewer";
945
- var LazyJsonSchemaForm = chunkW75B7Y6C_cjs.createLazyComponent(
946
- () => import('./JsonSchemaForm-DD7CLRIG.cjs').then((mod) => ({ default: mod.JsonSchemaForm })),
947
- {
948
- displayName: "LazyJsonSchemaForm",
949
- fallback: /* @__PURE__ */ jsxRuntime.jsx(
950
- chunkW75B7Y6C_cjs.CardLoadingFallback,
951
- {
952
- title: "Form",
953
- description: "Loading form schema...",
954
- minHeight: 200
955
- }
956
- )
957
- }
958
- );
959
- function LottieLoadingFallback() {
960
- return /* @__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: [
961
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-muted border-t-primary" }),
962
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: "Loading animation..." })
963
- ] }) });
964
- }
965
- chunkOLISEQHS_cjs.__name(LottieLoadingFallback, "LottieLoadingFallback");
966
- var LazyLottiePlayer = chunkW75B7Y6C_cjs.createLazyComponent(
967
- () => import('./LottiePlayer.client-2S7ISJ2S.cjs').then((mod) => ({ default: mod.LottiePlayer })),
968
- {
969
- displayName: "LazyLottiePlayer",
970
- fallback: /* @__PURE__ */ jsxRuntime.jsx(LottieLoadingFallback, {})
971
- }
972
- );
973
- var LazyPlayer = chunkW75B7Y6C_cjs.createLazyComponent(
974
- () => import('./Player-PM7F7DD7.cjs').then((mod) => ({ default: mod.Player })),
975
- {
976
- displayName: "LazyAudioPlayer",
977
- fallback: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-border/60 bg-card px-4 py-6 text-sm text-muted-foreground", children: "Loading audio player\u2026" })
978
- }
979
- );
980
- function VideoLoadingFallback() {
981
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center bg-black/90 rounded-lg aspect-video", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
982
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
983
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-10 w-10 animate-spin rounded-full border-4 border-white/20 border-t-white" }),
984
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(
985
- "svg",
986
- {
987
- className: "h-5 w-5 text-white/60",
988
- fill: "currentColor",
989
- viewBox: "0 0 24 24",
990
- children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 5v14l11-7z" })
991
- }
992
- ) })
993
- ] }),
994
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-white/60", children: "Loading video player..." })
995
- ] }) });
996
- }
997
- chunkOLISEQHS_cjs.__name(VideoLoadingFallback, "VideoLoadingFallback");
998
- var LazyVideoPlayer = chunkW75B7Y6C_cjs.createLazyComponent(
999
- () => import('./components-MQ6DR7TX.cjs').then((mod) => ({ default: mod.VideoPlayer })),
1000
- {
1001
- displayName: "LazyVideoPlayer",
1002
- fallback: /* @__PURE__ */ jsxRuntime.jsx(VideoLoadingFallback, {})
1003
- }
1004
- );
1005
- var LazyJsonTree = chunkW75B7Y6C_cjs.createLazyComponent(
1006
- () => import('./JsonTree-X6W5YEVY.cjs'),
1007
- {
1008
- displayName: "LazyJsonTree",
1009
- fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkW75B7Y6C_cjs.LoadingFallback, { minHeight: 100, text: "Loading JSON viewer..." })
1010
- }
1011
- );
1012
- var LazyImageViewer = chunkW75B7Y6C_cjs.createLazyComponent(
1013
- () => import('./components-EHOGXATG.cjs').then((mod) => ({ default: mod.ImageViewer })),
1014
- {
1015
- displayName: "LazyImageViewer",
1016
- fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkW75B7Y6C_cjs.LoadingFallback, { minHeight: 200, text: "Loading image viewer..." })
1017
- }
1018
- );
1019
- var LazyCronScheduler = chunkW75B7Y6C_cjs.createLazyComponent(
1020
- () => import('./CronScheduler.client-WEJF4PWQ.cjs'),
1021
- {
1022
- displayName: "LazyCronScheduler",
1023
- fallback: /* @__PURE__ */ jsxRuntime.jsx(
1024
- chunkW75B7Y6C_cjs.LoadingFallback,
1025
- {
1026
- minHeight: 120,
1027
- showText: false,
1028
- className: "rounded-lg"
1029
- }
1030
- )
1031
- }
1032
- );
1033
- var LazyTree = chunkW75B7Y6C_cjs.createLazyComponent(
1034
- () => import('./TreeRoot-AABP2J6Y.cjs'),
1035
- {
1036
- displayName: "LazyTree",
1037
- fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkW75B7Y6C_cjs.LoadingFallback, { minHeight: 200, text: "Loading tree\u2026" })
1038
- }
1039
- );
1040
-
1041
- // src/tools/Chat/core/transport/types.ts
1042
- var _TransportError = class _TransportError extends Error {
1043
- constructor(message, code = "transport_error") {
1044
- super(message);
1045
- chunkOLISEQHS_cjs.__publicField(this, "code");
1046
- this.name = "TransportError";
1047
- this.code = code;
1048
- }
1049
- };
1050
- chunkOLISEQHS_cjs.__name(_TransportError, "TransportError");
1051
- var TransportError = _TransportError;
1052
-
1053
- // src/tools/Chat/core/transport/sse.ts
1054
- var DEFAULT_MAP = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((raw) => {
1055
- if (!raw.data) return null;
1056
- try {
1057
- const parsed = JSON.parse(raw.data);
1058
- if (raw.event && !("type" in parsed)) {
1059
- return { ...parsed, type: raw.event };
1060
- }
1061
- return parsed;
1062
- } catch {
1063
- return null;
1064
- }
1065
- }, "DEFAULT_MAP");
1066
- async function* parseSSE(response, options = {}) {
1067
- if (!response.body) {
1068
- throw new Error("SSE response has no body");
1069
- }
1070
- const map = options.map ?? DEFAULT_MAP;
1071
- const idleMs = options.idleTimeoutMs ?? chunkTBSHZO5R_cjs.LIMITS.sseIdleMs;
1072
- const reader = response.body.getReader();
1073
- const decoder = new TextDecoder();
1074
- let buffer = "";
1075
- let lastChunkAt = Date.now();
1076
- const idleCheck = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
1077
- if (Date.now() - lastChunkAt > idleMs) {
1078
- throw new Error(`SSE idle timeout (${idleMs}ms)`);
1079
- }
1080
- }, "idleCheck");
1081
- try {
1082
- while (true) {
1083
- if (options.signal?.aborted) {
1084
- return;
1085
- }
1086
- const { value, done } = await reader.read();
1087
- if (done) break;
1088
- lastChunkAt = Date.now();
1089
- buffer += decoder.decode(value, { stream: true });
1090
- let separator = buffer.indexOf("\n\n");
1091
- while (separator !== -1) {
1092
- const rawBlock = buffer.slice(0, separator);
1093
- buffer = buffer.slice(separator + 2);
1094
- const raw = parseEventBlock(rawBlock);
1095
- const evt = map(raw);
1096
- if (evt) {
1097
- if (Array.isArray(evt)) {
1098
- for (const e of evt) yield e;
1099
- } else {
1100
- yield evt;
1101
- }
1102
- }
1103
- separator = buffer.indexOf("\n\n");
1104
- }
1105
- idleCheck();
1106
- }
1107
- if (buffer.trim()) {
1108
- const raw = parseEventBlock(buffer);
1109
- const evt = map(raw);
1110
- if (evt) {
1111
- if (Array.isArray(evt)) {
1112
- for (const e of evt) yield e;
1113
- } else {
1114
- yield evt;
1115
- }
1116
- }
1117
- }
1118
- } finally {
1119
- try {
1120
- reader.releaseLock();
1121
- } catch {
1122
- }
1123
- }
1124
- }
1125
- chunkOLISEQHS_cjs.__name(parseSSE, "parseSSE");
1126
- function parseEventBlock(block) {
1127
- const out = {};
1128
- const lines = block.split(/\r?\n/);
1129
- const dataLines = [];
1130
- for (const line of lines) {
1131
- if (!line || line.startsWith(":")) continue;
1132
- const colon = line.indexOf(":");
1133
- if (colon === -1) continue;
1134
- const field = line.slice(0, colon).trim();
1135
- const value = line.slice(colon + 1).replace(/^ /, "");
1136
- if (field === "event") out.event = value;
1137
- else if (field === "data") dataLines.push(value);
1138
- }
1139
- if (dataLines.length) out.data = dataLines.join("\n");
1140
- return out;
1141
- }
1142
- chunkOLISEQHS_cjs.__name(parseEventBlock, "parseEventBlock");
1143
-
1144
- // src/tools/Chat/core/transport/http.ts
1145
- var DEFAULT_TIMEOUT = 2e4;
1146
- async function jsonOrThrow(res, label) {
1147
- if (!res.ok) {
1148
- const text = await res.text().catch(() => "");
1149
- throw new TransportError(
1150
- `${label} failed (${res.status}): ${text || res.statusText}`,
1151
- mapStatusToCode(res.status)
1152
- );
1153
- }
1154
- try {
1155
- return await res.json();
1156
- } catch {
1157
- throw new TransportError(`${label} returned invalid JSON`, "invalid_response");
1158
- }
1159
- }
1160
- chunkOLISEQHS_cjs.__name(jsonOrThrow, "jsonOrThrow");
1161
- function mapStatusToCode(status) {
1162
- if (status === 401) return "unauthorized";
1163
- if (status === 403) return "forbidden";
1164
- if (status === 404) return "not_found";
1165
- if (status === 429) return "rate_limited";
1166
- if (status >= 500) return "server_error";
1167
- return "http_error";
1168
- }
1169
- chunkOLISEQHS_cjs.__name(mapStatusToCode, "mapStatusToCode");
1170
- function withTimeout(signal, timeoutMs) {
1171
- const ctrl = new AbortController();
1172
- const onAbort = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => ctrl.abort(), "onAbort");
1173
- signal?.addEventListener("abort", onAbort, { once: true });
1174
- setTimeout(() => ctrl.abort(), timeoutMs);
1175
- return ctrl.signal;
1176
- }
1177
- chunkOLISEQHS_cjs.__name(withTimeout, "withTimeout");
1178
- function createHttpTransport(config) {
1179
- const fetchImpl = config.fetchImpl ?? fetch;
1180
- const timeout = config.timeoutMs ?? DEFAULT_TIMEOUT;
1181
- const base = config.baseUrl.replace(/\/$/, "");
1182
- async function buildHeaders(extra) {
1183
- const auth = await config.getAuthHeader?.() ?? {};
1184
- return {
1185
- "Content-Type": "application/json",
1186
- ...auth,
1187
- ...extra ?? {}
1188
- };
1189
- }
1190
- chunkOLISEQHS_cjs.__name(buildHeaders, "buildHeaders");
1191
- return {
1192
- async createSession(opts) {
1193
- const res = await fetchImpl(`${base}/sessions`, {
1194
- method: "POST",
1195
- headers: await buildHeaders(),
1196
- body: JSON.stringify({ slug: config.slug, metadata: opts?.metadata ?? {} }),
1197
- signal: withTimeout(void 0, timeout)
1198
- });
1199
- return jsonOrThrow(res, "createSession");
1200
- },
1201
- async loadHistory(sessionId, cursor, limit) {
1202
- const params = new URLSearchParams();
1203
- if (cursor) params.set("cursor", cursor);
1204
- if (limit) params.set("limit", String(limit));
1205
- const url = `${base}/sessions/${encodeURIComponent(sessionId)}/history${params.toString() ? `?${params.toString()}` : ""}`;
1206
- const res = await fetchImpl(url, {
1207
- method: "GET",
1208
- headers: await buildHeaders(),
1209
- signal: withTimeout(void 0, timeout)
1210
- });
1211
- return jsonOrThrow(res, "loadHistory");
1212
- },
1213
- async *stream(sessionId, content, options) {
1214
- const url = `${base}/sessions/${encodeURIComponent(sessionId)}/messages`;
1215
- const res = await fetchImpl(url, {
1216
- method: "POST",
1217
- headers: await buildHeaders({ Accept: "text/event-stream" }),
1218
- body: JSON.stringify({
1219
- content,
1220
- attachments: options.attachments ?? [],
1221
- metadata: options.metadata ?? {}
1222
- }),
1223
- signal: options.signal
1224
- });
1225
- if (!res.ok) {
1226
- const text = await res.text().catch(() => "");
1227
- throw new TransportError(
1228
- `stream failed (${res.status}): ${text || res.statusText}`,
1229
- mapStatusToCode(res.status)
1230
- );
1231
- }
1232
- yield* parseSSE(res, { signal: options.signal });
1233
- },
1234
- async send(sessionId, content, options) {
1235
- const url = `${base}/sessions/${encodeURIComponent(sessionId)}/messages/buffered`;
1236
- const res = await fetchImpl(url, {
1237
- method: "POST",
1238
- headers: await buildHeaders(),
1239
- body: JSON.stringify({
1240
- content,
1241
- attachments: options?.attachments ?? [],
1242
- metadata: options?.metadata ?? {}
1243
- }),
1244
- signal: options?.signal ?? withTimeout(void 0, timeout)
1245
- });
1246
- return jsonOrThrow(res, "send");
1247
- },
1248
- async closeSession(sessionId) {
1249
- const url = `${base}/sessions/${encodeURIComponent(sessionId)}`;
1250
- const res = await fetchImpl(url, {
1251
- method: "DELETE",
1252
- headers: await buildHeaders(),
1253
- signal: withTimeout(void 0, timeout)
1254
- });
1255
- if (!res.ok && res.status !== 404) {
1256
- throw new TransportError(`closeSession failed (${res.status})`, mapStatusToCode(res.status));
1257
- }
1258
- }
1259
- };
1260
- }
1261
- chunkOLISEQHS_cjs.__name(createHttpTransport, "createHttpTransport");
1262
-
1263
- // src/tools/Chat/core/transport/mock.ts
1264
- var DEFAULT_REPLY = "Hi there!";
1265
- function splitForStream(text, parts = 4) {
1266
- if (!text) return [];
1267
- const chunkSize = Math.max(1, Math.ceil(text.length / parts));
1268
- const out = [];
1269
- for (let i = 0; i < text.length; i += chunkSize) {
1270
- out.push(text.slice(i, i + chunkSize));
1271
- }
1272
- return out;
1273
- }
1274
- chunkOLISEQHS_cjs.__name(splitForStream, "splitForStream");
1275
- var sleep = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((ms) => new Promise((r) => setTimeout(r, ms)), "sleep");
1276
- function createMockTransport(opts = {}) {
1277
- const replies = opts.replies?.length ? opts.replies : [DEFAULT_REPLY];
1278
- const latency = opts.latencyMs ?? 30;
1279
- const history = [...opts.initialMessages ?? []];
1280
- let turn = 0;
1281
- let attempt = 0;
1282
- return {
1283
- async createSession(_opts) {
1284
- await sleep(latency);
1285
- return {
1286
- sessionId: chunkTBSHZO5R_cjs.createId("s"),
1287
- messages: history.length ? [...history] : void 0,
1288
- hasMore: false,
1289
- cursor: null,
1290
- resumed: history.length > 0
1291
- };
1292
- },
1293
- async loadHistory(_sid, _cursor, _limit) {
1294
- await sleep(latency);
1295
- return { messages: [], hasMore: false, nextCursor: null };
1296
- },
1297
- async *stream(_sid, content, options) {
1298
- attempt += 1;
1299
- if (opts.shouldFail?.(attempt)) {
1300
- throw new Error("mock transport scripted failure");
1301
- }
1302
- history.push({
1303
- id: chunkTBSHZO5R_cjs.createId("u"),
1304
- role: "user",
1305
- content,
1306
- createdAt: Date.now()
1307
- });
1308
- const messageId = chunkTBSHZO5R_cjs.createId("a");
1309
- yield { type: "message_start", messageId, sessionId: _sid };
1310
- const reply = replies[turn % replies.length];
1311
- turn += 1;
1312
- if (typeof reply === "string") {
1313
- for (const piece of splitForStream(reply)) {
1314
- if (options.signal.aborted) return;
1315
- await sleep(latency);
1316
- yield { type: "chunk", delta: piece };
1317
- }
1318
- yield { type: "message_end", tokensIn: content.length, tokensOut: reply.length };
1319
- } else {
1320
- for (const ev of reply) {
1321
- if (options.signal.aborted) return;
1322
- await sleep(latency);
1323
- yield ev;
1324
- }
1325
- const lastType = reply[reply.length - 1]?.type;
1326
- if (lastType !== "message_end" && lastType !== "error") {
1327
- yield { type: "message_end" };
1328
- }
1329
- }
1330
- },
1331
- async send(_sid, content, _options) {
1332
- await sleep(latency);
1333
- const reply = replies[turn % replies.length];
1334
- turn += 1;
1335
- const text = typeof reply === "string" ? reply : reply.filter((e) => e.type === "chunk").map((e) => e.delta).join("");
1336
- return {
1337
- id: chunkTBSHZO5R_cjs.createId("a"),
1338
- role: "assistant",
1339
- content: text || DEFAULT_REPLY,
1340
- createdAt: Date.now()
1341
- };
1342
- },
1343
- async closeSession(_sid) {
1344
- }
1345
- };
1346
- }
1347
- chunkOLISEQHS_cjs.__name(createMockTransport, "createMockTransport");
1348
-
1349
- // src/tools/Chat/core/transport/mappers/pydantic-ai.ts
1350
- function createToolIdQueue() {
1351
- const queues = /* @__PURE__ */ new Map();
1352
- let counter = 0;
1353
- return {
1354
- push(name) {
1355
- const id = `${name}-${counter++}-${Date.now()}`;
1356
- const q = queues.get(name) ?? [];
1357
- q.push(id);
1358
- queues.set(name, q);
1359
- return id;
1360
- },
1361
- shift(name) {
1362
- return queues.get(name)?.shift() ?? `${name}-orphan-${counter++}`;
1363
- },
1364
- clear() {
1365
- queues.clear();
1366
- }
1367
- };
1368
- }
1369
- chunkOLISEQHS_cjs.__name(createToolIdQueue, "createToolIdQueue");
1370
- function* mapPydanticAIEvent(ev, toolIds) {
1371
- switch (ev.type) {
1372
- case "text_delta":
1373
- if (ev.delta) yield { type: "chunk", delta: ev.delta };
1374
- return;
1375
- case "tool_call": {
1376
- const name = ev.tool ?? "tool";
1377
- const toolId = toolIds.push(name);
1378
- yield { type: "tool_call_start", toolId, name, input: ev.args };
1379
- return;
1380
- }
1381
- case "tool_result": {
1382
- const name = ev.tool ?? "tool";
1383
- const toolId = toolIds.shift(name);
1384
- const output = ev.data !== void 0 ? ev.data : ev.result;
1385
- yield { type: "tool_call_end", toolId, output, status: "success" };
1386
- return;
1387
- }
1388
- case "done":
1389
- yield { type: "message_end", tokensOut: ev.total_tokens };
1390
- return;
1391
- case "error":
1392
- yield { type: "error", code: "backend_error", message: ev.error ?? "Unknown error" };
1393
- return;
1394
- case "approval_required":
1395
- return;
1396
- }
1397
- }
1398
- chunkOLISEQHS_cjs.__name(mapPydanticAIEvent, "mapPydanticAIEvent");
1399
- function createPydanticAISSEMap() {
1400
- const toolIds = createToolIdQueue();
1401
- return (raw) => {
1402
- if (!raw.data) return null;
1403
- let parsed;
1404
- try {
1405
- parsed = JSON.parse(raw.data);
1406
- } catch {
1407
- return null;
1408
- }
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
- };
1417
- }
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";
1429
- }
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;
1441
- }
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 };
1447
- },
1448
- async loadHistory(sessionId, cursor) {
1449
- if (opts.loadHistory) return opts.loadHistory(sessionId, cursor);
1450
- return { messages: [], hasMore: false, nextCursor: null };
1451
- },
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
- });
1467
- }
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
- );
1475
- }
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;
1484
- }
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
- };
1520
- }
1521
- chunkOLISEQHS_cjs.__name(createPydanticAIChatTransport, "createPydanticAIChatTransport");
1522
- function useChatScroll(options) {
1523
- const {
1524
- containerRef,
1525
- bottomRef,
1526
- isStreaming = false,
1527
- bottomThresholdPx = 80,
1528
- messagesCount = 0
1529
- } = options;
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(
1536
- (smooth = false) => {
1537
- const el = containerRef.current;
1538
- if (!el) return;
1539
- el.scrollTo({
1540
- top: el.scrollHeight,
1541
- behavior: smooth ? "smooth" : "auto"
1542
- });
1543
- stickyRef.current = true;
1544
- setIsAtBottom(true);
1545
- setUnreadCount(0);
1546
- },
1547
- [containerRef]
1548
- );
1549
- const resetUnread = react.useCallback(() => setUnreadCount(0), []);
1550
- react.useEffect(() => {
1551
- const el = containerRef.current;
1552
- if (!el) return;
1553
- const onScroll = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
1554
- const distance = el.scrollHeight - el.scrollTop - el.clientHeight;
1555
- const atBottom = distance <= bottomThresholdPx;
1556
- stickyRef.current = atBottom;
1557
- setIsAtBottom(atBottom);
1558
- if (atBottom) setUnreadCount(0);
1559
- }, "onScroll");
1560
- onScroll();
1561
- el.addEventListener("scroll", onScroll, { passive: true });
1562
- return () => {
1563
- el.removeEventListener("scroll", onScroll);
1564
- };
1565
- }, [containerRef, bottomThresholdPx]);
1566
- react.useEffect(() => {
1567
- const el = containerRef.current;
1568
- if (!el) return;
1569
- if (isStreaming) {
1570
- wasStreamingRef.current = true;
1571
- if (!stickyRef.current) return;
1572
- let raf = 0;
1573
- const tick = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
1574
- if (!stickyRef.current) return;
1575
- el.scrollTop = el.scrollHeight;
1576
- raf = requestAnimationFrame(tick);
1577
- }, "tick");
1578
- raf = requestAnimationFrame(tick);
1579
- return () => cancelAnimationFrame(raf);
1580
- }
1581
- if (wasStreamingRef.current && stickyRef.current) {
1582
- wasStreamingRef.current = false;
1583
- let raf1 = 0;
1584
- let raf2 = 0;
1585
- raf1 = requestAnimationFrame(() => {
1586
- el.scrollTop = el.scrollHeight;
1587
- raf2 = requestAnimationFrame(() => {
1588
- el.scrollTop = el.scrollHeight;
1589
- });
1590
- });
1591
- return () => {
1592
- cancelAnimationFrame(raf1);
1593
- cancelAnimationFrame(raf2);
1594
- };
1595
- }
1596
- wasStreamingRef.current = false;
1597
- return;
1598
- }, [containerRef, isStreaming]);
1599
- react.useEffect(() => {
1600
- if (messagesCount > lastCountRef.current) {
1601
- if (stickyRef.current) {
1602
- const el = containerRef.current;
1603
- if (el) el.scrollTop = el.scrollHeight;
1604
- } else {
1605
- setUnreadCount((n) => n + (messagesCount - lastCountRef.current));
1606
- }
1607
- }
1608
- lastCountRef.current = messagesCount;
1609
- }, [containerRef, messagesCount]);
1610
- react.useEffect(() => {
1611
- }, [bottomRef]);
1612
- return { isAtBottom, unreadCount, scrollToBottom, resetUnread };
1613
- }
1614
- chunkOLISEQHS_cjs.__name(useChatScroll, "useChatScroll");
1615
- function useChatHistory(options) {
1616
- const { enabled = true, containerRef, topSentinelRef, hasMore, isLoadingMore, loadMore } = options;
1617
- const heightBeforeRef = react.useRef(null);
1618
- react.useEffect(() => {
1619
- if (heightBeforeRef.current == null) return;
1620
- const el = containerRef.current;
1621
- if (!el) {
1622
- heightBeforeRef.current = null;
1623
- return;
1624
- }
1625
- if (!isLoadingMore) {
1626
- const delta = el.scrollHeight - heightBeforeRef.current;
1627
- if (delta > 0) {
1628
- el.scrollTop += delta;
1629
- }
1630
- heightBeforeRef.current = null;
1631
- }
1632
- }, [containerRef, isLoadingMore]);
1633
- react.useEffect(() => {
1634
- if (!enabled || !hasMore) return;
1635
- const sentinel = topSentinelRef.current;
1636
- const root = containerRef.current;
1637
- if (!sentinel || !root) return;
1638
- const observer = new IntersectionObserver(
1639
- (entries) => {
1640
- const entry = entries[0];
1641
- if (!entry?.isIntersecting) return;
1642
- if (isLoadingMore) return;
1643
- const el = containerRef.current;
1644
- if (el) heightBeforeRef.current = el.scrollHeight;
1645
- void loadMore();
1646
- },
1647
- { root, threshold: 0, rootMargin: "200px 0px 0px 0px" }
1648
- );
1649
- observer.observe(sentinel);
1650
- return () => observer.disconnect();
1651
- }, [enabled, hasMore, isLoadingMore, containerRef, topSentinelRef, loadMore]);
1652
- }
1653
- chunkOLISEQHS_cjs.__name(useChatHistory, "useChatHistory");
1654
- function useChatLightbox() {
1655
- const [state, setState] = react.useState(null);
1656
- const open = react.useCallback((att, gallery) => {
1657
- const list = gallery && gallery.length ? gallery : [att];
1658
- const idx = list.findIndex((a) => a.id === att.id);
1659
- setState({ gallery: list, index: idx === -1 ? 0 : idx });
1660
- }, []);
1661
- const close = react.useCallback(() => setState(null), []);
1662
- return { state, open, close };
1663
- }
1664
- chunkOLISEQHS_cjs.__name(useChatLightbox, "useChatLightbox");
1665
- var DEFAULT_STORAGE_KEY = "chat.visitor.fingerprint";
1666
- function generate() {
1667
- if (typeof crypto !== "undefined" && "randomUUID" in crypto) {
1668
- return crypto.randomUUID();
1669
- }
1670
- return `v-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
1671
- }
1672
- chunkOLISEQHS_cjs.__name(generate, "generate");
1673
- function useVisitorFingerprint(opts = {}) {
1674
- const storageKey = opts.storageKey ?? DEFAULT_STORAGE_KEY;
1675
- const [fp, setFp] = react.useState(null);
1676
- react.useEffect(() => {
1677
- let value = null;
1678
- try {
1679
- value = window.localStorage.getItem(storageKey);
1680
- if (!value) {
1681
- value = generate();
1682
- window.localStorage.setItem(storageKey, value);
1683
- }
1684
- } catch {
1685
- value = generate();
1686
- }
1687
- setFp(value);
1688
- }, [storageKey]);
1689
- return fp;
1690
- }
1691
- chunkOLISEQHS_cjs.__name(useVisitorFingerprint, "useVisitorFingerprint");
1692
- var DEFAULT_DOCK_PREFS = {
1693
- mode: "popover",
1694
- side: "right",
1695
- sideWidth: 420
1696
- };
1697
- var DEFAULT_KEY = "chat.dock.prefs";
1698
- function useChatDockPrefs(opts = {}) {
1699
- const key = opts.storageKey ?? DEFAULT_KEY;
1700
- const initial = { ...DEFAULT_DOCK_PREFS, ...opts.defaults };
1701
- const [prefs, setStored] = hooks.useLocalStorage(key, initial);
1702
- const setPrefs = react.useCallback(
1703
- (patch) => {
1704
- setStored((prev) => ({ ...prev, ...patch }));
1705
- },
1706
- [setStored]
1707
- );
1708
- const toggleMode = react.useCallback(() => {
1709
- setStored((prev) => ({ ...prev, mode: prev.mode === "side" ? "popover" : "side" }));
1710
- }, [setStored]);
1711
- const toggleSide = react.useCallback(() => {
1712
- setStored((prev) => ({ ...prev, side: prev.side === "right" ? "left" : "right" }));
1713
- }, [setStored]);
1714
- const reset = react.useCallback(() => setStored(initial), [setStored, initial]);
1715
- return { ...prefs, setPrefs, toggleMode, toggleSide, reset };
1716
- }
1717
- chunkOLISEQHS_cjs.__name(useChatDockPrefs, "useChatDockPrefs");
1718
- function useChatUnread(opts = {}) {
1719
- const { open = false, countRoles = ["assistant"] } = opts;
1720
- const ctx = chunkTBSHZO5R_cjs.useChatContext();
1721
- const [lastSeenId, setLastSeenId] = react.useState(null);
1722
- const initialized = react.useRef(false);
1723
- react.useEffect(() => {
1724
- if (initialized.current) return;
1725
- initialized.current = true;
1726
- const tail = ctx.messages[ctx.messages.length - 1];
1727
- setLastSeenId(tail?.id ?? null);
1728
- }, [ctx.messages]);
1729
- react.useEffect(() => {
1730
- if (!open) return;
1731
- const tail = ctx.messages[ctx.messages.length - 1];
1732
- setLastSeenId(tail?.id ?? null);
1733
- }, [open, ctx.messages]);
1734
- const seenIdx = lastSeenId ? ctx.messages.findIndex((m) => m.id === lastSeenId) : -1;
1735
- const after = seenIdx === -1 ? ctx.messages : ctx.messages.slice(seenIdx + 1);
1736
- const inbound = after.filter((m) => countRoles.includes(m.role));
1737
- const unread = inbound.length > 0 ? inbound[inbound.length - 1] : null;
1738
- const markRead = react.useCallback(() => {
1739
- const tail = ctx.messages[ctx.messages.length - 1];
1740
- setLastSeenId(tail?.id ?? null);
1741
- }, [ctx.messages]);
1742
- return { unread, count: inbound.length, markRead };
1743
- }
1744
- chunkOLISEQHS_cjs.__name(useChatUnread, "useChatUnread");
1745
- var STORAGE_KEY = "djangocfg-chat-audio:prefs";
1746
- var useChatAudioPrefs = hooks.createAudioPrefsStore(STORAGE_KEY);
1747
-
1748
- // src/tools/Chat/core/payload-dispatch.ts
1749
- function dispatchToolPayload(matchers, fallback) {
1750
- return (value, kind, call) => {
1751
- for (const m of matchers) {
1752
- if (m.match(value, kind, call)) return m.render(value, kind, call);
1753
- }
1754
- return fallback(value, kind, call);
1755
- };
1756
- }
1757
- chunkOLISEQHS_cjs.__name(dispatchToolPayload, "dispatchToolPayload");
1758
- function isPlainObject(v) {
1759
- return v !== null && typeof v === "object" && !Array.isArray(v);
1760
- }
1761
- chunkOLISEQHS_cjs.__name(isPlainObject, "isPlainObject");
1762
- function isLatLng(v) {
1763
- return isPlainObject(v) && typeof v.lat === "number" && typeof v.lng === "number";
1764
- }
1765
- chunkOLISEQHS_cjs.__name(isLatLng, "isLatLng");
1766
- function isGeoJSONFeatureCollection(v) {
1767
- return isPlainObject(v) && v.type === "FeatureCollection" && Array.isArray(v.features);
1768
- }
1769
- chunkOLISEQHS_cjs.__name(isGeoJSONFeatureCollection, "isGeoJSONFeatureCollection");
1770
- function isStringValue(v) {
1771
- return typeof v === "string";
1772
- }
1773
- chunkOLISEQHS_cjs.__name(isStringValue, "isStringValue");
1774
-
1775
- // src/tools/Chat/utils/collectImageAttachments.ts
1776
- function collectImageAttachments(messages) {
1777
- const out = [];
1778
- for (const m of messages) {
1779
- if (!m.attachments) continue;
1780
- for (const a of m.attachments) {
1781
- if (a.type === "image") out.push(a);
1782
- }
1783
- }
1784
- return out;
1785
- }
1786
- chunkOLISEQHS_cjs.__name(collectImageAttachments, "collectImageAttachments");
1787
- function AudioToggle({
1788
- size = "icon",
1789
- variant = "ghost",
1790
- alwaysShow = false,
1791
- className
1792
- }) {
1793
- const muted = useChatAudioPrefs((s) => s.muted);
1794
- const setMuted = useChatAudioPrefs((s) => s.setMuted);
1795
- const ctx = chunkTBSHZO5R_cjs.useChatContextOptional();
1796
- if (ctx && !ctx.hasAudio && !alwaysShow) return null;
1797
- const Icon = muted ? lucideReact.VolumeX : lucideReact.Volume2;
1798
- const label = muted ? "Unmute chat sounds" : "Mute chat sounds";
1799
- return /* @__PURE__ */ jsxRuntime.jsx(
1800
- components.Button,
1801
- {
1802
- type: "button",
1803
- variant,
1804
- size,
1805
- onClick: () => setMuted(!muted),
1806
- "aria-label": label,
1807
- "aria-pressed": muted,
1808
- title: label,
1809
- className: lib.cn(size === "icon" ? "h-9 w-9" : "", className),
1810
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { "aria-hidden": true, className: "size-4" })
1811
- }
1812
- );
1813
- }
1814
- chunkOLISEQHS_cjs.__name(AudioToggle, "AudioToggle");
1815
- var LazyChat = chunkW75B7Y6C_cjs.createLazyComponent(
1816
- () => import('./ChatRoot-EFNXQXXN.cjs').then((m) => ({ default: m.ChatRoot })),
1817
- {
1818
- displayName: "LazyChat",
1819
- fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkW75B7Y6C_cjs.LoadingFallback, { minHeight: 320, text: "Loading chat\u2026" })
1820
- }
1821
- );
1822
- chunkW75B7Y6C_cjs.createLazyComponent(
1823
- () => import('./launcher-PMW2YB24.cjs').then((m) => ({ default: m.ChatLauncher })),
1824
- {
1825
- displayName: "LazyChatLauncher",
1826
- // Launcher renders a floating FAB by default — no inline placeholder.
1827
- fallback: null
1828
- }
1829
- );
1830
- var LottiePlayerClient = react.lazy(
1831
- () => import('./LottiePlayer.client-2S7ISJ2S.cjs').then((mod) => ({ default: mod.LottiePlayer }))
1832
- );
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: [
1834
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-gray-300 border-t-gray-900" }),
1835
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-500", children: "Loading player..." })
1836
- ] }) }), "LoadingFallback");
1837
- function LottiePlayer(props) {
1838
- return /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(LoadingFallback5, {}), children: /* @__PURE__ */ jsxRuntime.jsx(LottiePlayerClient, { ...props }) });
1839
- }
1840
- chunkOLISEQHS_cjs.__name(LottiePlayer, "LottiePlayer");
1841
- var DocsLayout = react.lazy(
1842
- () => import('./DocsLayout-OURFYWQE.cjs').then((mod) => ({ default: mod.DocsLayout }))
1843
- );
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");
1845
- var Playground = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ config }) => {
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, {}) }) });
1847
- }, "Playground");
1848
- var OpenapiViewer_default = Playground;
1849
- var CronSchedulerClient = react.lazy(() => import('./CronScheduler.client-WEJF4PWQ.cjs'));
1850
- function CronScheduler(props) {
1851
- return /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerFallback, {}), children: /* @__PURE__ */ jsxRuntime.jsx(CronSchedulerClient, { ...props }) });
1852
- }
1853
- chunkOLISEQHS_cjs.__name(CronScheduler, "CronScheduler");
1854
- function CronSchedulerFallback() {
1855
- return /* @__PURE__ */ jsxRuntime.jsx(
1856
- chunkW75B7Y6C_cjs.LoadingFallback,
1857
- {
1858
- minHeight: 120,
1859
- showText: false,
1860
- className: "rounded-lg"
1861
- }
1862
- );
1863
- }
1864
- chunkOLISEQHS_cjs.__name(CronSchedulerFallback, "CronSchedulerFallback");
1865
-
1866
- // src/tools/CodeEditor/workers/setup.ts
1867
- var isSetup = false;
1868
- function setupMonacoWorkers(getWorker) {
1869
- if (isSetup || typeof window === "undefined") return;
1870
- if (getWorker) {
1871
- self.MonacoEnvironment = {
1872
- getWorker: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((_workerId, label) => getWorker(label), "getWorker")
1873
- };
1874
- }
1875
- isSetup = true;
1876
- }
1877
- chunkOLISEQHS_cjs.__name(setupMonacoWorkers, "setupMonacoWorkers");
1878
-
1879
- // src/tools/CodeEditor/hooks/useMonaco.ts
1880
- function useMonaco() {
1881
- const [monaco, setMonaco] = react.useState(null);
1882
- const [isLoading, setIsLoading] = react.useState(true);
1883
- const [error, setError] = react.useState(null);
1884
- react.useEffect(() => {
1885
- let mounted = true;
1886
- async function loadMonaco() {
1887
- try {
1888
- setupMonacoWorkers();
1889
- const monacoModule = await import('monaco-editor');
1890
- if (mounted) {
1891
- setMonaco(monacoModule);
1892
- setIsLoading(false);
1893
- }
1894
- } catch (err) {
1895
- if (mounted) {
1896
- setError(err instanceof Error ? err : new Error("Failed to load Monaco Editor"));
1897
- setIsLoading(false);
1898
- }
1899
- }
1900
- }
1901
- chunkOLISEQHS_cjs.__name(loadMonaco, "loadMonaco");
1902
- loadMonaco();
1903
- return () => {
1904
- mounted = false;
1905
- };
1906
- }, []);
1907
- return { monaco, isLoading, error };
1908
- }
1909
- chunkOLISEQHS_cjs.__name(useMonaco, "useMonaco");
1910
- function useEditorTheme(monaco, themeOverride) {
1911
- const appTheme = hooks.useResolvedTheme();
1912
- const registered = react.useRef(false);
1913
- react.useEffect(() => {
1914
- if (!monaco || registered.current) return;
1915
- try {
1916
- const colors = _readCSSColors();
1917
- monaco.editor.defineTheme("app-dark", {
1918
- base: "vs-dark",
1919
- inherit: true,
1920
- rules: [
1921
- { token: "comment", foreground: "6A9955", fontStyle: "italic" },
1922
- { token: "keyword", foreground: "C586C0" },
1923
- { token: "string", foreground: "CE9178" },
1924
- { token: "number", foreground: "B5CEA8" },
1925
- { token: "type", foreground: "4EC9B0" },
1926
- { token: "function", foreground: "DCDCAA" },
1927
- { token: "variable", foreground: "9CDCFE" }
1928
- ],
1929
- colors: {
1930
- "editor.background": colors.background,
1931
- "editor.foreground": colors.foreground,
1932
- "editor.lineHighlightBackground": colors.lineHighlight,
1933
- "editor.selectionBackground": colors.selection,
1934
- "editorCursor.foreground": colors.foreground,
1935
- "editorLineNumber.foreground": colors.mutedForeground,
1936
- "editorWidget.background": colors.card,
1937
- "editorWidget.border": colors.border,
1938
- "input.background": colors.card,
1939
- "dropdown.background": colors.card
1940
- }
1941
- });
1942
- monaco.editor.defineTheme("app-light", {
1943
- base: "vs",
1944
- inherit: true,
1945
- rules: [
1946
- { token: "comment", foreground: "008000", fontStyle: "italic" },
1947
- { token: "keyword", foreground: "AF00DB" },
1948
- { token: "string", foreground: "A31515" },
1949
- { token: "number", foreground: "098658" },
1950
- { token: "type", foreground: "267F99" },
1951
- { token: "function", foreground: "795E26" },
1952
- { token: "variable", foreground: "001080" }
1953
- ],
1954
- colors: {
1955
- "editor.background": colors.backgroundLight,
1956
- "editor.foreground": colors.foregroundLight,
1957
- "editor.lineHighlightBackground": colors.lineHighlightLight,
1958
- "editor.selectionBackground": colors.selectionLight,
1959
- "editorLineNumber.foreground": colors.mutedForegroundLight,
1960
- "editorWidget.background": colors.cardLight,
1961
- "editorWidget.border": colors.borderLight
1962
- }
1963
- });
1964
- registered.current = true;
1965
- } catch {
1966
- }
1967
- }, [monaco]);
1968
- if (themeOverride) return themeOverride;
1969
- if (registered.current) {
1970
- return appTheme === "dark" ? "app-dark" : "app-light";
1971
- }
1972
- return appTheme === "dark" ? "vs-dark" : "vs";
1973
- }
1974
- chunkOLISEQHS_cjs.__name(useEditorTheme, "useEditorTheme");
1975
- function _readCSSColors() {
1976
- const get = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((varName) => {
1977
- if (typeof document === "undefined") return "";
1978
- return getComputedStyle(document.documentElement).getPropertyValue(varName).trim();
1979
- }, "get");
1980
- const hslToHex = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((hsl) => {
1981
- if (!hsl) return "";
1982
- const parts = hsl.split(/\s+/).map((s2) => parseFloat(s2.replace("%", "")));
1983
- if (parts.length < 3 || parts.some(isNaN)) return "";
1984
- const [h, s, l] = [parts[0], parts[1] / 100, parts[2] / 100];
1985
- const a = s * Math.min(l, 1 - l);
1986
- const f = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((n) => {
1987
- const k = (n + h / 30) % 12;
1988
- const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
1989
- return Math.round(255 * color).toString(16).padStart(2, "0");
1990
- }, "f");
1991
- return `#${f(0)}${f(8)}${f(4)}`;
1992
- }, "hslToHex");
1993
- const background = hslToHex(get("--background")) || "#0a0a0a";
1994
- const foreground = hslToHex(get("--foreground")) || "#f5f5f5";
1995
- const card = hslToHex(get("--card")) || "#141414";
1996
- const border = hslToHex(get("--border")) || "#262626";
1997
- const mutedForeground = hslToHex(get("--muted-foreground")) || "#858585";
1998
- const lineHighlight = _adjustBrightness(background, 10);
1999
- const primary = hslToHex(get("--primary"));
2000
- const selection = primary ? _adjustBrightness(primary, -40) : "#264F78";
2001
- return {
2002
- background,
2003
- foreground,
2004
- card,
2005
- border,
2006
- mutedForeground,
2007
- lineHighlight,
2008
- selection,
2009
- // Light variants
2010
- backgroundLight: "#ffffff",
2011
- foregroundLight: "#1a1a1a",
2012
- cardLight: "#ffffff",
2013
- borderLight: "#e5e5e5",
2014
- mutedForegroundLight: "#737373",
2015
- lineHighlightLight: "#f5f5f5",
2016
- selectionLight: "#ADD6FF"
2017
- };
2018
- }
2019
- chunkOLISEQHS_cjs.__name(_readCSSColors, "_readCSSColors");
2020
- function _adjustBrightness(hex, amount) {
2021
- const num = parseInt(hex.replace("#", ""), 16);
2022
- const r = Math.min(255, Math.max(0, (num >> 16 & 255) + amount));
2023
- const g = Math.min(255, Math.max(0, (num >> 8 & 255) + amount));
2024
- const b = Math.min(255, Math.max(0, (num & 255) + amount));
2025
- return `#${(r << 16 | g << 8 | b).toString(16).padStart(6, "0")}`;
2026
- }
2027
- chunkOLISEQHS_cjs.__name(_adjustBrightness, "_adjustBrightness");
2028
- var Editor = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function Editor2({
2029
- value = "",
2030
- language = "plaintext",
2031
- onChange,
2032
- onMount,
2033
- options = {},
2034
- className = "",
2035
- height = "100%",
2036
- width = "100%",
2037
- autoHeight = false,
2038
- minHeight = 100,
2039
- maxHeight = 600
2040
- }, ref) {
2041
- const containerRef = react.useRef(null);
2042
- const editorRef = react.useRef(null);
2043
- const { monaco, isLoading } = useMonaco();
2044
- const resolvedTheme = useEditorTheme(monaco, options.theme);
2045
- const [contentHeight, setContentHeight] = react.useState(null);
2046
- const updateContentHeight = react.useCallback((editor) => {
2047
- if (!autoHeight) return;
2048
- const h = editor.getContentHeight();
2049
- setContentHeight(Math.min(Math.max(h, minHeight), maxHeight));
2050
- }, [autoHeight, minHeight, maxHeight]);
2051
- const isInternalChangeRef = react.useRef(false);
2052
- react.useImperativeHandle(ref, () => ({
2053
- getEditor: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current, "getEditor"),
2054
- getValue: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current?.getValue() || "", "getValue"),
2055
- setValue: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((val) => editorRef.current?.setValue(val), "setValue"),
2056
- focus: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editorRef.current?.focus(), "focus")
2057
- }));
2058
- react.useEffect(() => {
2059
- if (!monaco || !containerRef.current || editorRef.current) return;
2060
- const editor = monaco.editor.create(containerRef.current, {
2061
- value,
2062
- language,
2063
- theme: resolvedTheme,
2064
- fontSize: options.fontSize || 14,
2065
- fontFamily: options.fontFamily || "'Fira Code', 'Consolas', monospace",
2066
- tabSize: options.tabSize || 2,
2067
- insertSpaces: options.insertSpaces !== false,
2068
- wordWrap: options.wordWrap || "on",
2069
- minimap: { enabled: options.minimap !== false },
2070
- lineNumbers: options.lineNumbers || "on",
2071
- readOnly: options.readOnly || false,
2072
- automaticLayout: true,
2073
- scrollBeyondLastLine: autoHeight ? false : false,
2074
- scrollbar: autoHeight ? { vertical: "hidden", horizontal: "auto" } : void 0,
2075
- overviewRulerLanes: autoHeight ? 0 : void 0,
2076
- padding: { top: 16, bottom: 16 },
2077
- renderLineHighlight: "all",
2078
- cursorBlinking: "smooth",
2079
- cursorSmoothCaretAnimation: "on",
2080
- smoothScrolling: true,
2081
- bracketPairColorization: { enabled: true },
2082
- guides: {
2083
- bracketPairs: true,
2084
- indentation: true
2085
- }
2086
- });
2087
- editorRef.current = editor;
2088
- if (onChange) {
2089
- editor.onDidChangeModelContent(() => {
2090
- isInternalChangeRef.current = true;
2091
- onChange(editor.getValue());
2092
- });
2093
- }
2094
- if (autoHeight) {
2095
- editor.onDidContentSizeChange(() => updateContentHeight(editor));
2096
- updateContentHeight(editor);
2097
- }
2098
- onMount?.(editor);
2099
- return () => {
2100
- editor.dispose();
2101
- editorRef.current = null;
2102
- };
2103
- }, [monaco]);
2104
- react.useEffect(() => {
2105
- const editor = editorRef.current;
2106
- if (!editor) return;
2107
- if (isInternalChangeRef.current) {
2108
- isInternalChangeRef.current = false;
2109
- return;
2110
- }
2111
- const currentValue = editor.getValue();
2112
- if (value !== currentValue) {
2113
- const position = editor.getPosition();
2114
- const selections = editor.getSelections();
2115
- editor.setValue(value);
2116
- if (position) {
2117
- editor.setPosition(position);
2118
- }
2119
- if (selections && selections.length > 0) {
2120
- editor.setSelections(selections);
2121
- }
2122
- }
2123
- }, [value]);
2124
- react.useEffect(() => {
2125
- const editor = editorRef.current;
2126
- if (!editor || !monaco) return;
2127
- const model = editor.getModel();
2128
- if (model) {
2129
- monaco.editor.setModelLanguage(model, language);
2130
- }
2131
- }, [language, monaco]);
2132
- react.useEffect(() => {
2133
- const editor = editorRef.current;
2134
- if (!editor) return;
2135
- editor.updateOptions({
2136
- theme: resolvedTheme,
2137
- fontSize: options.fontSize,
2138
- readOnly: options.readOnly,
2139
- minimap: { enabled: options.minimap !== false },
2140
- wordWrap: options.wordWrap,
2141
- lineNumbers: options.lineNumbers
2142
- });
2143
- }, [options, resolvedTheme]);
2144
- if (isLoading) {
2145
- return /* @__PURE__ */ jsxRuntime.jsx(
2146
- "div",
2147
- {
2148
- className,
2149
- style: {
2150
- width,
2151
- height,
2152
- display: "flex",
2153
- alignItems: "center",
2154
- justifyContent: "center",
2155
- backgroundColor: "#1e1e1e",
2156
- color: "#666"
2157
- },
2158
- children: "Loading editor..."
2159
- }
2160
- );
2161
- }
2162
- const resolvedHeight = autoHeight && contentHeight != null ? contentHeight : height;
2163
- return /* @__PURE__ */ jsxRuntime.jsx(
2164
- "div",
2165
- {
2166
- ref: containerRef,
2167
- className,
2168
- style: {
2169
- width,
2170
- height: resolvedHeight,
2171
- ...autoHeight && { minHeight, maxHeight, overflow: "hidden" }
2172
- }
2173
- }
2174
- );
2175
- }, "Editor"));
2176
- function DiffEditor({
2177
- original,
2178
- modified,
2179
- language = "plaintext",
2180
- options = {},
2181
- className = "",
2182
- height = "100%"
2183
- }) {
2184
- const containerRef = react.useRef(null);
2185
- const editorRef = react.useRef(null);
2186
- const { monaco, isLoading } = useMonaco();
2187
- const resolvedTheme = useEditorTheme(monaco, options.theme);
2188
- react.useEffect(() => {
2189
- if (!monaco || !containerRef.current || editorRef.current) return;
2190
- const editor = monaco.editor.createDiffEditor(containerRef.current, {
2191
- theme: resolvedTheme,
2192
- fontSize: options.fontSize || 14,
2193
- fontFamily: options.fontFamily || "'Fira Code', 'Consolas', monospace",
2194
- readOnly: true,
2195
- automaticLayout: true,
2196
- renderSideBySide: true,
2197
- scrollBeyondLastLine: false,
2198
- minimap: { enabled: false }
2199
- });
2200
- const originalModel = monaco.editor.createModel(original, language);
2201
- const modifiedModel = monaco.editor.createModel(modified, language);
2202
- editor.setModel({
2203
- original: originalModel,
2204
- modified: modifiedModel
2205
- });
2206
- editorRef.current = editor;
2207
- return () => {
2208
- originalModel.dispose();
2209
- modifiedModel.dispose();
2210
- editor.dispose();
2211
- editorRef.current = null;
2212
- };
2213
- }, [monaco]);
2214
- react.useEffect(() => {
2215
- const editor = editorRef.current;
2216
- if (!editor || !monaco) return;
2217
- const model = editor.getModel();
2218
- if (model) {
2219
- model.original.setValue(original);
2220
- model.modified.setValue(modified);
2221
- }
2222
- }, [original, modified, monaco]);
2223
- react.useEffect(() => {
2224
- const editor = editorRef.current;
2225
- if (!editor || !monaco) return;
2226
- const model = editor.getModel();
2227
- if (model) {
2228
- monaco.editor.setModelLanguage(model.original, language);
2229
- monaco.editor.setModelLanguage(model.modified, language);
2230
- }
2231
- }, [language, monaco]);
2232
- if (isLoading) {
2233
- return /* @__PURE__ */ jsxRuntime.jsx(
2234
- "div",
2235
- {
2236
- className,
2237
- style: {
2238
- width: "100%",
2239
- height,
2240
- display: "flex",
2241
- alignItems: "center",
2242
- justifyContent: "center",
2243
- backgroundColor: "#1e1e1e",
2244
- color: "#666"
2245
- },
2246
- children: "Loading diff editor..."
2247
- }
2248
- );
2249
- }
2250
- return /* @__PURE__ */ jsxRuntime.jsx(
2251
- "div",
2252
- {
2253
- ref: containerRef,
2254
- className,
2255
- style: {
2256
- width: "100%",
2257
- height
2258
- }
2259
- }
2260
- );
2261
- }
2262
- chunkOLISEQHS_cjs.__name(DiffEditor, "DiffEditor");
2263
-
2264
- // src/tools/CodeEditor/lib/languages.ts
2265
- var LANGUAGE_MAP = {
2266
- // Web
2267
- ".html": "html",
2268
- ".htm": "html",
2269
- ".xhtml": "html",
2270
- ".vue": "html",
2271
- ".svelte": "html",
2272
- // CSS
2273
- ".css": "css",
2274
- ".scss": "scss",
2275
- ".sass": "scss",
2276
- ".less": "less",
2277
- // JavaScript/TypeScript
2278
- ".js": "javascript",
2279
- ".mjs": "javascript",
2280
- ".cjs": "javascript",
2281
- ".jsx": "javascript",
2282
- ".ts": "typescript",
2283
- ".tsx": "typescript",
2284
- ".mts": "typescript",
2285
- ".cts": "typescript",
2286
- // Data formats
2287
- ".json": "json",
2288
- ".jsonc": "json",
2289
- ".json5": "json",
2290
- ".yaml": "yaml",
2291
- ".yml": "yaml",
2292
- ".toml": "ini",
2293
- ".xml": "xml",
2294
- ".svg": "xml",
2295
- ".xsl": "xml",
2296
- ".xsd": "xml",
2297
- // Markdown & Documentation
2298
- ".md": "markdown",
2299
- ".mdx": "markdown",
2300
- ".markdown": "markdown",
2301
- ".rst": "restructuredtext",
2302
- ".txt": "plaintext",
2303
- ".text": "plaintext",
2304
- // Programming languages
2305
- ".py": "python",
2306
- ".pyw": "python",
2307
- ".pyi": "python",
2308
- ".rb": "ruby",
2309
- ".rake": "ruby",
2310
- ".gemspec": "ruby",
2311
- ".php": "php",
2312
- ".phtml": "php",
2313
- ".java": "java",
2314
- ".kt": "kotlin",
2315
- ".kts": "kotlin",
2316
- ".scala": "scala",
2317
- ".go": "go",
2318
- ".rs": "rust",
2319
- ".swift": "swift",
2320
- ".c": "c",
2321
- ".h": "c",
2322
- ".cpp": "cpp",
2323
- ".cc": "cpp",
2324
- ".cxx": "cpp",
2325
- ".hpp": "cpp",
2326
- ".hxx": "cpp",
2327
- ".cs": "csharp",
2328
- ".fs": "fsharp",
2329
- ".fsx": "fsharp",
2330
- ".vb": "vb",
2331
- ".lua": "lua",
2332
- ".r": "r",
2333
- ".R": "r",
2334
- ".m": "objective-c",
2335
- ".mm": "objective-c",
2336
- ".pl": "perl",
2337
- ".pm": "perl",
2338
- ".ex": "elixir",
2339
- ".exs": "elixir",
2340
- ".erl": "erlang",
2341
- ".hrl": "erlang",
2342
- ".clj": "clojure",
2343
- ".cljs": "clojure",
2344
- ".cljc": "clojure",
2345
- ".hs": "haskell",
2346
- ".lhs": "haskell",
2347
- ".ml": "fsharp",
2348
- ".mli": "fsharp",
2349
- ".dart": "dart",
2350
- ".groovy": "groovy",
2351
- ".gradle": "groovy",
2352
- ".jl": "julia",
2353
- // Shell & Scripts
2354
- ".sh": "shell",
2355
- ".bash": "shell",
2356
- ".zsh": "shell",
2357
- ".fish": "shell",
2358
- ".ps1": "powershell",
2359
- ".psm1": "powershell",
2360
- ".psd1": "powershell",
2361
- ".bat": "bat",
2362
- ".cmd": "bat",
2363
- // Config files
2364
- ".ini": "ini",
2365
- ".cfg": "ini",
2366
- ".conf": "ini",
2367
- ".properties": "ini",
2368
- ".env": "ini",
2369
- ".gitignore": "ini",
2370
- ".gitattributes": "ini",
2371
- ".editorconfig": "ini",
2372
- ".npmrc": "ini",
2373
- // Database
2374
- ".sql": "sql",
2375
- ".mysql": "mysql",
2376
- ".pgsql": "pgsql",
2377
- ".plsql": "plsql",
2378
- ".redis": "redis",
2379
- // Templates
2380
- ".hbs": "handlebars",
2381
- ".handlebars": "handlebars",
2382
- ".mustache": "handlebars",
2383
- ".ejs": "html",
2384
- ".pug": "pug",
2385
- ".jade": "pug",
2386
- ".twig": "twig",
2387
- ".liquid": "liquid",
2388
- // GraphQL
2389
- ".graphql": "graphql",
2390
- ".gql": "graphql",
2391
- // Docker
2392
- ".dockerfile": "dockerfile",
2393
- // Other
2394
- ".diff": "diff",
2395
- ".patch": "diff",
2396
- ".log": "log",
2397
- ".tex": "latex",
2398
- ".cls": "latex",
2399
- ".sty": "latex",
2400
- ".proto": "protobuf",
2401
- ".sol": "sol",
2402
- ".asm": "mips",
2403
- ".s": "mips",
2404
- ".wasm": "wasm"
2405
- };
2406
- var FILENAME_MAP = {
2407
- Dockerfile: "dockerfile",
2408
- "docker-compose.yml": "yaml",
2409
- "docker-compose.yaml": "yaml",
2410
- Makefile: "makefile",
2411
- makefile: "makefile",
2412
- Gemfile: "ruby",
2413
- Rakefile: "ruby",
2414
- Jenkinsfile: "groovy",
2415
- Vagrantfile: "ruby",
2416
- ".bashrc": "shell",
2417
- ".bash_profile": "shell",
2418
- ".zshrc": "shell",
2419
- ".profile": "shell",
2420
- ".vimrc": "plaintext",
2421
- ".gitconfig": "ini",
2422
- ".htaccess": "ini",
2423
- "nginx.conf": "ini",
2424
- "package.json": "json",
2425
- "tsconfig.json": "json",
2426
- "jsconfig.json": "json",
2427
- ".prettierrc": "json",
2428
- ".eslintrc": "json",
2429
- "composer.json": "json",
2430
- "Cargo.toml": "ini",
2431
- "go.mod": "go",
2432
- "go.sum": "plaintext",
2433
- "requirements.txt": "plaintext",
2434
- "pyproject.toml": "ini",
2435
- "setup.py": "python",
2436
- "setup.cfg": "ini"
2437
- };
2438
- function getLanguageByFilename(filename) {
2439
- if (FILENAME_MAP[filename]) {
2440
- return FILENAME_MAP[filename];
2441
- }
2442
- const lastDot = filename.lastIndexOf(".");
2443
- if (lastDot === -1) {
2444
- return "plaintext";
2445
- }
2446
- const extension = filename.slice(lastDot).toLowerCase();
2447
- return LANGUAGE_MAP[extension] || "plaintext";
2448
- }
2449
- chunkOLISEQHS_cjs.__name(getLanguageByFilename, "getLanguageByFilename");
2450
- var EditorContext = react.createContext(null);
2451
- function useEditorContext() {
2452
- const context = react.useContext(EditorContext);
2453
- if (!context) {
2454
- throw new Error("useEditorContext must be used within EditorProvider");
2455
- }
2456
- return context;
2457
- }
2458
- chunkOLISEQHS_cjs.__name(useEditorContext, "useEditorContext");
2459
- function EditorProvider({ children, onSave }) {
2460
- const { monaco } = useMonaco();
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(
2465
- () => openFiles.find((f) => f.path === activeFilePath) || null,
2466
- [openFiles, activeFilePath]
2467
- );
2468
- const openFile = react.useCallback(
2469
- (path, content, language) => {
2470
- setOpenFiles((files) => {
2471
- const existing = files.find((f) => f.path === path);
2472
- if (existing) {
2473
- return files;
2474
- }
2475
- const basename = path.split("/").pop() || path;
2476
- const detectedLanguage = language || getLanguageByFilename(basename);
2477
- const newFile = {
2478
- path,
2479
- content,
2480
- language: detectedLanguage,
2481
- isDirty: false
2482
- };
2483
- return [...files, newFile];
2484
- });
2485
- setActiveFilePath(path);
2486
- },
2487
- []
2488
- );
2489
- const closeFile = react.useCallback(
2490
- (path) => {
2491
- setOpenFiles((files) => {
2492
- const index = files.findIndex((f) => f.path === path);
2493
- if (index === -1) return files;
2494
- const newFiles = files.filter((f) => f.path !== path);
2495
- if (activeFilePath === path && newFiles.length > 0) {
2496
- const newIndex = Math.min(index, newFiles.length - 1);
2497
- setActiveFilePath(newFiles[newIndex].path);
2498
- } else if (newFiles.length === 0) {
2499
- setActiveFilePath(null);
2500
- }
2501
- return newFiles;
2502
- });
2503
- },
2504
- [activeFilePath]
2505
- );
2506
- const setActiveFile = react.useCallback((path) => {
2507
- setActiveFilePath(path);
2508
- }, []);
2509
- const updateContent = react.useCallback((path, content) => {
2510
- setOpenFiles(
2511
- (files) => files.map(
2512
- (f) => f.path === path ? { ...f, content, isDirty: true } : f
2513
- )
2514
- );
2515
- }, []);
2516
- const saveFile = react.useCallback(
2517
- async (path) => {
2518
- const file = openFiles.find((f) => f.path === path);
2519
- if (!file) return;
2520
- if (onSave) {
2521
- await onSave(path, file.content);
2522
- }
2523
- setOpenFiles(
2524
- (files) => files.map(
2525
- (f) => f.path === path ? { ...f, isDirty: false } : f
2526
- )
2527
- );
2528
- },
2529
- [openFiles, onSave]
2530
- );
2531
- const isDirty = react.useCallback(
2532
- (path) => {
2533
- const file = openFiles.find((f) => f.path === path);
2534
- return file?.isDirty || false;
2535
- },
2536
- [openFiles]
2537
- );
2538
- const getContent = react.useCallback(
2539
- (path) => {
2540
- const file = openFiles.find((f) => f.path === path);
2541
- return file?.content || null;
2542
- },
2543
- [openFiles]
2544
- );
2545
- const getFile = react.useCallback(
2546
- (path) => {
2547
- return openFiles.find((f) => f.path === path) || null;
2548
- },
2549
- [openFiles]
2550
- );
2551
- const value = {
2552
- openFiles,
2553
- activeFile,
2554
- monaco,
2555
- editor,
2556
- isReady: monaco !== null && editor !== null,
2557
- openFile,
2558
- closeFile,
2559
- setActiveFile,
2560
- updateContent,
2561
- saveFile,
2562
- isDirty,
2563
- getContent,
2564
- getFile
2565
- };
2566
- return /* @__PURE__ */ jsxRuntime.jsx(EditorContext.Provider, { value, children });
2567
- }
2568
- chunkOLISEQHS_cjs.__name(EditorProvider, "EditorProvider");
2569
- function useEditor() {
2570
- const [editor, setEditorState] = react.useState(null);
2571
- const setEditor = react.useCallback((editorInstance) => {
2572
- setEditorState(editorInstance);
2573
- }, []);
2574
- return {
2575
- editor,
2576
- isReady: editor !== null,
2577
- setEditor
2578
- };
2579
- }
2580
- chunkOLISEQHS_cjs.__name(useEditor, "useEditor");
2581
- function useLanguage(filename) {
2582
- return react.useMemo(() => {
2583
- if (!filename) return "plaintext";
2584
- const basename = filename.split("/").pop() || filename;
2585
- return getLanguageByFilename(basename);
2586
- }, [filename]);
2587
- }
2588
- chunkOLISEQHS_cjs.__name(useLanguage, "useLanguage");
2589
- var MentionList = react.forwardRef(
2590
- ({ items, command }, ref) => {
2591
- const [selectedIndex, setSelectedIndex] = react.useState(0);
2592
- react.useEffect(() => setSelectedIndex(0), [items]);
2593
- const select = react.useCallback(
2594
- (index) => {
2595
- const item = items[index];
2596
- if (item) command(item);
2597
- },
2598
- [items, command]
2599
- );
2600
- react.useImperativeHandle(ref, () => ({
2601
- onKeyDown: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((event) => {
2602
- if (event.key === "ArrowUp") {
2603
- setSelectedIndex((i) => (i + items.length - 1) % items.length);
2604
- return true;
2605
- }
2606
- if (event.key === "ArrowDown") {
2607
- setSelectedIndex((i) => (i + 1) % items.length);
2608
- return true;
2609
- }
2610
- if (event.key === "Enter") {
2611
- select(selectedIndex);
2612
- return true;
2613
- }
2614
- return false;
2615
- }, "onKeyDown")
2616
- }));
2617
- if (items.length === 0) return null;
2618
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "markdown-mention-list", children: items.map((item, i) => {
2619
- const isSelected = i === selectedIndex;
2620
- const cls = `markdown-mention-item ${isSelected ? "selected" : ""}`;
2621
- return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: cls, onClick: () => select(i), children: [
2622
- item.thumbnail && /* @__PURE__ */ jsxRuntime.jsx("img", { src: item.thumbnail, alt: "", className: "markdown-mention-avatar" }),
2623
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "markdown-mention-info", children: [
2624
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "markdown-mention-name", children: item.label }),
2625
- item.description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "markdown-mention-desc", children: item.description })
2626
- ] })
2627
- ] }, item.id);
2628
- }) });
2629
- }
2630
- );
2631
- MentionList.displayName = "MentionList";
2632
-
2633
- // src/tools/MarkdownEditor/createMentionSuggestion.ts
2634
- function createMentionSuggestion(config) {
2635
- const { maxItems = 5, trigger = "@" } = config;
2636
- return {
2637
- char: trigger,
2638
- items: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ query }) => {
2639
- const q = query.toLowerCase();
2640
- return config.items.filter((item) => item.label.toLowerCase().includes(q)).slice(0, maxItems);
2641
- }, "items"),
2642
- render: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2643
- let component = null;
2644
- let popup = null;
2645
- let cleanupAutoUpdate = null;
2646
- let getReferenceRect = null;
2647
- const buildVirtualElement = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => ({
2648
- getBoundingClientRect: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2649
- const rect = getReferenceRect?.();
2650
- return rect ?? new DOMRect(0, 0, 0, 0);
2651
- }, "getBoundingClientRect")
2652
- }), "buildVirtualElement");
2653
- const updatePosition = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2654
- if (!popup) return;
2655
- const virtualEl = buildVirtualElement();
2656
- void dom.computePosition(virtualEl, popup, {
2657
- placement: "bottom-start",
2658
- middleware: [
2659
- dom.offset(4),
2660
- dom.flip({ fallbackPlacements: ["top-start"] }),
2661
- dom.shift({ padding: 8 })
2662
- ]
2663
- }).then(({ x, y }) => {
2664
- if (!popup) return;
2665
- popup.style.transform = `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`;
2666
- });
2667
- }, "updatePosition");
2668
- const teardown = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2669
- cleanupAutoUpdate?.();
2670
- cleanupAutoUpdate = null;
2671
- popup?.remove();
2672
- popup = null;
2673
- component?.destroy();
2674
- component = null;
2675
- getReferenceRect = null;
2676
- }, "teardown");
2677
- return {
2678
- onStart: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((props) => {
2679
- component = new react$1.ReactRenderer(MentionList, {
2680
- props: {
2681
- items: props.items,
2682
- command: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((item) => {
2683
- props.command({ id: item.id, label: item.label });
2684
- }, "command")
2685
- },
2686
- editor: props.editor
2687
- });
2688
- popup = document.createElement("div");
2689
- popup.style.cssText = "position: absolute; top: 0; left: 0; z-index: 99999;";
2690
- popup.appendChild(component.element);
2691
- document.body.appendChild(popup);
2692
- getReferenceRect = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => props.clientRect?.() ?? null, "getReferenceRect");
2693
- const virtualEl = buildVirtualElement();
2694
- cleanupAutoUpdate = dom.autoUpdate(virtualEl, popup, updatePosition);
2695
- }, "onStart"),
2696
- onUpdate: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((props) => {
2697
- component?.updateProps({
2698
- items: props.items,
2699
- command: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((item) => {
2700
- props.command({ id: item.id, label: item.label });
2701
- }, "command")
2702
- });
2703
- getReferenceRect = /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => props.clientRect?.() ?? null, "getReferenceRect");
2704
- updatePosition();
2705
- }, "onUpdate"),
2706
- onKeyDown: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((props) => {
2707
- if (props.event.key === "Escape") {
2708
- teardown();
2709
- return true;
2710
- }
2711
- return component?.ref?.onKeyDown(props.event) ?? false;
2712
- }, "onKeyDown"),
2713
- onExit: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2714
- teardown();
2715
- }, "onExit")
2716
- };
2717
- }, "render")
2718
- };
2719
- }
2720
- chunkOLISEQHS_cjs.__name(createMentionSuggestion, "createMentionSuggestion");
2721
-
2722
- // src/tools/MarkdownEditor/mentionPresets.ts
2723
- var escapeMd = /* @__PURE__ */ chunkOLISEQHS_cjs.__name((s) => s.replace(/([\\\[\]()_*~`])/g, "\\$1"), "escapeMd");
2724
- var mentionPresets = {
2725
- /** "@Label" — default, ideal for chat where LLMs read the text. */
2726
- plainAt: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((({ label, id }) => `@${label || id}`), "plainAt"),
2727
- /** "Label" — bare label, no @ prefix. */
2728
- plainLabel: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((({ label, id }) => label || id), "plainLabel"),
2729
- /** "[@Label](baseUrl/id)" — clickable markdown link. */
2730
- markdownLink: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((baseUrl) => ({ label, id }) => `[@${escapeMd(label || id)}](${baseUrl}${encodeURIComponent(id)})`, "markdownLink"),
2731
- /** "@[Label](scheme://kind/id)" — Notion / Linear-style custom URI. */
2732
- customUri: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((scheme, kind) => ({ label, id }) => `@[${escapeMd(label || id)}](${scheme}://${kind}/${encodeURIComponent(id)})`, "customUri"),
2733
- /** "<@id>" — Slack-style id-only reference (label dropped — receivers resolve it). */
2734
- slackStyle: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((({ id }) => `<@${id}>`), "slackStyle"),
2735
- /** Inline HTML span — for products that consume markdown with raw HTML allowed. */
2736
- htmlSpan: /* @__PURE__ */ chunkOLISEQHS_cjs.__name((className = "mention") => ({ label, id }) => `<span class="${className}" data-mention-id="${encodeURIComponent(id)}">@${escapeMd(label || id)}</span>`, "htmlSpan")
2737
- };
2738
- var SubmitOnEnter = core.Extension.create({
2739
- name: "submitOnEnter",
2740
- addOptions() {
2741
- return {
2742
- // Default no-op — explicit consumer must override. We never
2743
- // intercept Enter unless an onSubmit is wired, so leaving the
2744
- // extension installed with no handler is safe.
2745
- onSubmit: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => false, "onSubmit")
2746
- };
2747
- },
2748
- addKeyboardShortcuts() {
2749
- return {
2750
- Enter: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2751
- if (typeof document !== "undefined" && document.querySelector(".markdown-mention-list")) {
2752
- return false;
2753
- }
2754
- const result = this.options.onSubmit();
2755
- return result !== false;
2756
- }, "Enter"),
2757
- // Shift+Enter — always insert a newline. Tiptap's StarterKit
2758
- // already binds this to HardBreak; we re-bind to `false` (not
2759
- // handled) so the chain falls through cleanly even if other
2760
- // extensions try to grab Shift+Enter.
2761
- "Shift-Enter": /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => false, "Shift-Enter")
2762
- };
2763
- }
2764
- });
2765
- function getMarkdown(editor) {
2766
- const storage = editor.storage.markdown;
2767
- if (!storage?.manager) return editor.getText();
2768
- return storage.manager.serialize(editor.getJSON());
2769
- }
2770
- chunkOLISEQHS_cjs.__name(getMarkdown, "getMarkdown");
2771
- function extractMentionIds(editor) {
2772
- const ids = [];
2773
- editor.state.doc.descendants((node) => {
2774
- if (node.type.name === "mention" && node.attrs.id) {
2775
- ids.push(node.attrs.id);
2776
- }
2777
- });
2778
- return [...new Set(ids)];
2779
- }
2780
- chunkOLISEQHS_cjs.__name(extractMentionIds, "extractMentionIds");
2781
- var MarkdownEditor = react.forwardRef(/* @__PURE__ */ chunkOLISEQHS_cjs.__name(function MarkdownEditor2({
2782
- value,
2783
- onChange,
2784
- placeholder = "Write markdown...",
2785
- minHeight = 120,
2786
- className = "",
2787
- disabled = false,
2788
- showToolbar = true,
2789
- mentions,
2790
- onMentionIdsChange,
2791
- onSubmit
2792
- }, ref) {
2793
- const onSubmitRef = react.useRef(onSubmit);
2794
- onSubmitRef.current = onSubmit;
2795
- const isExternalUpdate = react.useRef(false);
2796
- const initialMentionsDefinedRef = react.useRef(mentions !== void 0);
2797
- const warnedRef = react.useRef(false);
2798
- if (process.env.NODE_ENV !== "production" && !initialMentionsDefinedRef.current && mentions !== void 0 && !warnedRef.current) {
2799
- warnedRef.current = true;
2800
- console.warn(
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."
2802
- );
2803
- }
2804
- const extensions = react.useMemo(() => {
2805
- const exts = [
2806
- StarterKit__default.default.configure({ heading: { levels: [1, 2, 3] } }),
2807
- Placeholder__default.default.configure({ placeholder }),
2808
- markdown.Markdown,
2809
- // SubmitOnEnter — when the consumer wired an onSubmit, intercept
2810
- // Enter at the keymap level (before StarterKit's HardBreak).
2811
- // The extension calls through `onSubmitRef.current` so handler
2812
- // identity changes don't require an editor rebuild. See
2813
- // submitOnEnter.ts for the keymap-vs-wrapper-handler rationale.
2814
- SubmitOnEnter.configure({
2815
- onSubmit: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2816
- const h = onSubmitRef.current;
2817
- if (!h) return false;
2818
- return h();
2819
- }, "onSubmit")
2820
- })
2821
- ];
2822
- if (mentions) {
2823
- const renderMarkdown = mentions.renderMarkdown ?? mentionPresets.plainAt;
2824
- exts.push(
2825
- Mention__default.default.extend({
2826
- renderMarkdown(node) {
2827
- const raw = node.attrs;
2828
- const attrs = {
2829
- id: raw?.id ?? "",
2830
- label: raw?.label ?? ""
2831
- };
2832
- if (!attrs.id && !attrs.label) return "";
2833
- return renderMarkdown(attrs);
2834
- }
2835
- }).configure({
2836
- HTMLAttributes: { class: "markdown-mention" },
2837
- suggestion: createMentionSuggestion(mentions),
2838
- renderText: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ node }) => `@${node.attrs.label}`, "renderText")
2839
- })
2840
- );
2841
- }
2842
- return exts;
2843
- }, [placeholder, mentions]);
2844
- const editor = react$1.useEditor({
2845
- immediatelyRender: false,
2846
- editable: !disabled,
2847
- extensions,
2848
- content: value,
2849
- onUpdate: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(({ editor: editor2 }) => {
2850
- if (isExternalUpdate.current) return;
2851
- onChange(getMarkdown(editor2));
2852
- if (onMentionIdsChange) {
2853
- onMentionIdsChange(extractMentionIds(editor2));
2854
- }
2855
- }, "onUpdate"),
2856
- editorProps: {
2857
- attributes: {
2858
- class: "markdown-editor-content focus:outline-none text-sm",
2859
- style: `min-height: ${minHeight}px`
2860
- }
2861
- }
2862
- });
2863
- react.useEffect(() => {
2864
- if (!editor) return;
2865
- const current = getMarkdown(editor);
2866
- if (current !== value) {
2867
- isExternalUpdate.current = true;
2868
- editor.commands.setContent(value);
2869
- isExternalUpdate.current = false;
2870
- }
2871
- }, [value, editor]);
2872
- react.useImperativeHandle(
2873
- ref,
2874
- () => ({
2875
- focus: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2876
- editor?.commands.focus();
2877
- }, "focus"),
2878
- moveCursorToEnd: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => {
2879
- editor?.commands.focus("end");
2880
- }, "moveCursorToEnd"),
2881
- getEditor: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor ?? null, "getEditor")
2882
- }),
2883
- [editor]
2884
- );
2885
- const wrapperClass = `markdown-editor rounded-md border border-input bg-background ${disabled ? "opacity-60" : ""} ${className}`.trim();
2886
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: wrapperClass, children: [
2887
- showToolbar && editor && /* @__PURE__ */ jsxRuntime.jsx(MarkdownToolbar, { editor }),
2888
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(react$1.EditorContent, { editor }) })
2889
- ] });
2890
- }, "MarkdownEditor"));
2891
- function MarkdownToolbar({ editor }) {
2892
- const items = react.useMemo(() => [
2893
- { icon: lucideReact.Bold, title: "Bold", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleBold().run(), "action"), active: editor.isActive("bold") },
2894
- { icon: lucideReact.Italic, title: "Italic", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleItalic().run(), "action"), active: editor.isActive("italic") },
2895
- { icon: lucideReact.Strikethrough, title: "Strike", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleStrike().run(), "action"), active: editor.isActive("strike") },
2896
- { icon: lucideReact.Code, title: "Code", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleCode().run(), "action"), active: editor.isActive("code") },
2897
- null,
2898
- { icon: lucideReact.Heading1, title: "H1", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleHeading({ level: 1 }).run(), "action"), active: editor.isActive("heading", { level: 1 }) },
2899
- { icon: lucideReact.Heading2, title: "H2", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleHeading({ level: 2 }).run(), "action"), active: editor.isActive("heading", { level: 2 }) },
2900
- { icon: lucideReact.Heading3, title: "H3", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleHeading({ level: 3 }).run(), "action"), active: editor.isActive("heading", { level: 3 }) },
2901
- null,
2902
- { icon: lucideReact.List, title: "Bullet list", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleBulletList().run(), "action"), active: editor.isActive("bulletList") },
2903
- { icon: lucideReact.ListOrdered, title: "Ordered list", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleOrderedList().run(), "action"), active: editor.isActive("orderedList") },
2904
- { icon: lucideReact.Quote, title: "Quote", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().toggleBlockquote().run(), "action"), active: editor.isActive("blockquote") },
2905
- { icon: lucideReact.Minus, title: "Divider", action: /* @__PURE__ */ chunkOLISEQHS_cjs.__name(() => editor.chain().focus().setHorizontalRule().run(), "action"), active: false }
2906
- ], [editor]);
2907
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-0.5 px-2 py-1.5 border-b border-border", children: items.map((item, i) => {
2908
- if (!item) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-4 bg-border mx-1" }, i);
2909
- const Icon = item.icon;
2910
- const btnClass = `markdown-toolbar-btn ${item.active ? "active" : ""}`;
2911
- return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: item.action, title: item.title, className: btnClass, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { style: { width: 14, height: 14 } }) }, i);
2912
- }) });
2913
- }
2914
- chunkOLISEQHS_cjs.__name(MarkdownToolbar, "MarkdownToolbar");
2915
-
2916
- Object.defineProperty(exports, "CardLoadingFallback", {
2917
- enumerable: true,
2918
- get: function () { return chunkW75B7Y6C_cjs.CardLoadingFallback; }
2919
- });
2920
- Object.defineProperty(exports, "ChatDock", {
2921
- enumerable: true,
2922
- get: function () { return chunkW75B7Y6C_cjs.ChatDock; }
2923
- });
2924
- Object.defineProperty(exports, "ChatFAB", {
2925
- enumerable: true,
2926
- get: function () { return chunkW75B7Y6C_cjs.ChatFAB; }
2927
- });
2928
- Object.defineProperty(exports, "ChatGreeting", {
2929
- enumerable: true,
2930
- get: function () { return chunkW75B7Y6C_cjs.ChatGreeting; }
2931
- });
2932
- Object.defineProperty(exports, "ChatHeader", {
2933
- enumerable: true,
2934
- get: function () { return chunkW75B7Y6C_cjs.ChatHeader; }
2935
- });
2936
- Object.defineProperty(exports, "ChatHeaderActionButton", {
2937
- enumerable: true,
2938
- get: function () { return chunkW75B7Y6C_cjs.ChatHeaderActionButton; }
2939
- });
2940
- Object.defineProperty(exports, "ChatHeaderAudioToggle", {
2941
- enumerable: true,
2942
- get: function () { return chunkW75B7Y6C_cjs.ChatHeaderAudioToggle; }
2943
- });
2944
- Object.defineProperty(exports, "ChatHeaderLanguageButton", {
2945
- enumerable: true,
2946
- get: function () { return chunkW75B7Y6C_cjs.ChatHeaderLanguageButton; }
2947
- });
2948
- Object.defineProperty(exports, "ChatHeaderModeToggle", {
2949
- enumerable: true,
2950
- get: function () { return chunkW75B7Y6C_cjs.ChatHeaderModeToggle; }
2951
- });
2952
- Object.defineProperty(exports, "ChatHeaderResetButton", {
2953
- enumerable: true,
2954
- get: function () { return chunkW75B7Y6C_cjs.ChatHeaderResetButton; }
2955
- });
2956
- Object.defineProperty(exports, "ChatLauncher", {
2957
- enumerable: true,
2958
- get: function () { return chunkW75B7Y6C_cjs.ChatLauncher; }
2959
- });
2960
- Object.defineProperty(exports, "ChatUnreadPreview", {
2961
- enumerable: true,
2962
- get: function () { return chunkW75B7Y6C_cjs.ChatUnreadPreview; }
2963
- });
2964
- Object.defineProperty(exports, "LazyWrapper", {
2965
- enumerable: true,
2966
- get: function () { return chunkW75B7Y6C_cjs.LazyWrapper; }
2967
- });
2968
- Object.defineProperty(exports, "LoadingFallback", {
2969
- enumerable: true,
2970
- get: function () { return chunkW75B7Y6C_cjs.LoadingFallback; }
2971
- });
2972
- Object.defineProperty(exports, "MapLoadingFallback", {
2973
- enumerable: true,
2974
- get: function () { return chunkW75B7Y6C_cjs.MapLoadingFallback; }
2975
- });
2976
- Object.defineProperty(exports, "Spinner", {
2977
- enumerable: true,
2978
- get: function () { return chunkW75B7Y6C_cjs.Spinner; }
2979
- });
2980
- Object.defineProperty(exports, "createLazyComponent", {
2981
- enumerable: true,
2982
- get: function () { return chunkW75B7Y6C_cjs.createLazyComponent; }
2983
- });
2984
- Object.defineProperty(exports, "useChatPresence", {
2985
- enumerable: true,
2986
- get: function () { return chunkW75B7Y6C_cjs.useChatPresence; }
2987
- });
2988
- Object.defineProperty(exports, "useChatReset", {
2989
- enumerable: true,
2990
- get: function () { return chunkW75B7Y6C_cjs.useChatReset; }
2991
- });
2992
- Object.defineProperty(exports, "Attachments", {
2993
- enumerable: true,
2994
- get: function () { return chunk4LFB7I5K_cjs.Attachments; }
2995
- });
2996
- Object.defineProperty(exports, "AttachmentsGrid", {
2997
- enumerable: true,
2998
- get: function () { return chunk4LFB7I5K_cjs.AttachmentsGrid; }
2999
- });
3000
- Object.defineProperty(exports, "AttachmentsList", {
3001
- enumerable: true,
3002
- get: function () { return chunk4LFB7I5K_cjs.AttachmentsList; }
3003
- });
3004
- Object.defineProperty(exports, "ChatRoot", {
3005
- enumerable: true,
3006
- get: function () { return chunk4LFB7I5K_cjs.ChatRoot; }
3007
- });
3008
- Object.defineProperty(exports, "Composer", {
3009
- enumerable: true,
3010
- get: function () { return chunk4LFB7I5K_cjs.Composer; }
3011
- });
3012
- Object.defineProperty(exports, "EmptyState", {
3013
- enumerable: true,
3014
- get: function () { return chunk4LFB7I5K_cjs.EmptyState; }
3015
- });
3016
- Object.defineProperty(exports, "ErrorBanner", {
3017
- enumerable: true,
3018
- get: function () { return chunk4LFB7I5K_cjs.ErrorBanner; }
3019
- });
3020
- Object.defineProperty(exports, "JumpToLatest", {
3021
- enumerable: true,
3022
- get: function () { return chunk4LFB7I5K_cjs.JumpToLatest; }
3023
- });
3024
- Object.defineProperty(exports, "MessageActions", {
3025
- enumerable: true,
3026
- get: function () { return chunk4LFB7I5K_cjs.MessageActions; }
3027
- });
3028
- Object.defineProperty(exports, "MessageBubble", {
3029
- enumerable: true,
3030
- get: function () { return chunk4LFB7I5K_cjs.MessageBubble; }
3031
- });
3032
- Object.defineProperty(exports, "MessageList", {
3033
- enumerable: true,
3034
- get: function () { return chunk4LFB7I5K_cjs.MessageList; }
3035
- });
3036
- Object.defineProperty(exports, "Sources", {
3037
- enumerable: true,
3038
- get: function () { return chunk4LFB7I5K_cjs.Sources; }
3039
- });
3040
- Object.defineProperty(exports, "StreamingIndicator", {
3041
- enumerable: true,
3042
- get: function () { return chunk4LFB7I5K_cjs.StreamingIndicator; }
3043
- });
3044
- Object.defineProperty(exports, "ToolCalls", {
3045
- enumerable: true,
3046
- get: function () { return chunk4LFB7I5K_cjs.ToolCalls; }
3047
- });
3048
- Object.defineProperty(exports, "deriveInitials", {
3049
- enumerable: true,
3050
- get: function () { return chunk4LFB7I5K_cjs.deriveInitials; }
3051
- });
3052
- Object.defineProperty(exports, "isSubmittableDraft", {
3053
- enumerable: true,
3054
- get: function () { return chunk4LFB7I5K_cjs.isSubmittableDraft; }
3055
- });
3056
- Object.defineProperty(exports, "resolvePersona", {
3057
- enumerable: true,
3058
- get: function () { return chunk4LFB7I5K_cjs.resolvePersona; }
3059
- });
3060
- Object.defineProperty(exports, "sanitizeDraft", {
3061
- enumerable: true,
3062
- get: function () { return chunk4LFB7I5K_cjs.sanitizeDraft; }
3063
- });
3064
- Object.defineProperty(exports, "useAutoFocusOnStreamEnd", {
3065
- enumerable: true,
3066
- get: function () { return chunk4LFB7I5K_cjs.useAutoFocusOnStreamEnd; }
3067
- });
3068
- Object.defineProperty(exports, "useChatBubbleStyles", {
3069
- enumerable: true,
3070
- get: function () { return chunk4LFB7I5K_cjs.useChatBubbleStyles; }
3071
- });
3072
- Object.defineProperty(exports, "useChatComposer", {
3073
- enumerable: true,
3074
- get: function () { return chunk4LFB7I5K_cjs.useChatComposer; }
3075
- });
3076
- Object.defineProperty(exports, "useChatDestructiveStyles", {
3077
- enumerable: true,
3078
- get: function () { return chunk4LFB7I5K_cjs.useChatDestructiveStyles; }
3079
- });
3080
- Object.defineProperty(exports, "useChatRoleStyles", {
3081
- enumerable: true,
3082
- get: function () { return chunk4LFB7I5K_cjs.useChatRoleStyles; }
3083
- });
3084
- Object.defineProperty(exports, "useFocusOnEmptyClick", {
3085
- enumerable: true,
3086
- get: function () { return chunk4LFB7I5K_cjs.useFocusOnEmptyClick; }
3087
- });
3088
- Object.defineProperty(exports, "useRegisterComposer", {
3089
- enumerable: true,
3090
- get: function () { return chunk4LFB7I5K_cjs.useRegisterComposer; }
3091
- });
3092
- Object.defineProperty(exports, "CHAT_EVENT_NAME", {
3093
- enumerable: true,
3094
- get: function () { return chunkTBSHZO5R_cjs.CHAT_EVENT_NAME; }
3095
- });
3096
- Object.defineProperty(exports, "CSS_VARS", {
3097
- enumerable: true,
3098
- get: function () { return chunkTBSHZO5R_cjs.CSS_VARS; }
3099
- });
3100
- Object.defineProperty(exports, "ChatProvider", {
3101
- enumerable: true,
3102
- get: function () { return chunkTBSHZO5R_cjs.ChatProvider; }
3103
- });
3104
- Object.defineProperty(exports, "DEFAULT_CHAT_SOUNDS", {
3105
- enumerable: true,
3106
- get: function () { return chunkTBSHZO5R_cjs.DEFAULT_CHAT_SOUNDS; }
3107
- });
3108
- Object.defineProperty(exports, "DEFAULT_LABELS", {
3109
- enumerable: true,
3110
- get: function () { return chunkTBSHZO5R_cjs.DEFAULT_LABELS; }
3111
- });
3112
- Object.defineProperty(exports, "DEFAULT_SIDEBAR", {
3113
- enumerable: true,
3114
- get: function () { return chunkTBSHZO5R_cjs.DEFAULT_SIDEBAR; }
3115
- });
3116
- Object.defineProperty(exports, "DEFAULT_Z_INDEX", {
3117
- enumerable: true,
3118
- get: function () { return chunkTBSHZO5R_cjs.DEFAULT_Z_INDEX; }
3119
- });
3120
- Object.defineProperty(exports, "HOTKEYS", {
3121
- enumerable: true,
3122
- get: function () { return chunkTBSHZO5R_cjs.HOTKEYS; }
3123
- });
3124
- Object.defineProperty(exports, "LIMITS", {
3125
- enumerable: true,
3126
- get: function () { return chunkTBSHZO5R_cjs.LIMITS; }
3127
- });
3128
- Object.defineProperty(exports, "STORAGE_KEYS", {
3129
- enumerable: true,
3130
- get: function () { return chunkTBSHZO5R_cjs.STORAGE_KEYS; }
3131
- });
3132
- Object.defineProperty(exports, "createId", {
3133
- enumerable: true,
3134
- get: function () { return chunkTBSHZO5R_cjs.createId; }
3135
- });
3136
- Object.defineProperty(exports, "createTokenBuffer", {
3137
- enumerable: true,
3138
- get: function () { return chunkTBSHZO5R_cjs.createTokenBuffer; }
3139
- });
3140
- Object.defineProperty(exports, "getChatLogger", {
3141
- enumerable: true,
3142
- get: function () { return chunkTBSHZO5R_cjs.getChatLogger; }
3143
- });
3144
- Object.defineProperty(exports, "initialState", {
3145
- enumerable: true,
3146
- get: function () { return chunkTBSHZO5R_cjs.initialState; }
3147
- });
3148
- Object.defineProperty(exports, "reducer", {
3149
- enumerable: true,
3150
- get: function () { return chunkTBSHZO5R_cjs.reducer; }
3151
- });
3152
- Object.defineProperty(exports, "useChat", {
3153
- enumerable: true,
3154
- get: function () { return chunkTBSHZO5R_cjs.useChat; }
3155
- });
3156
- Object.defineProperty(exports, "useChatAudio", {
3157
- enumerable: true,
3158
- get: function () { return chunkTBSHZO5R_cjs.useChatAudio; }
3159
- });
3160
- Object.defineProperty(exports, "useChatContext", {
3161
- enumerable: true,
3162
- get: function () { return chunkTBSHZO5R_cjs.useChatContext; }
3163
- });
3164
- Object.defineProperty(exports, "useChatContextOptional", {
3165
- enumerable: true,
3166
- get: function () { return chunkTBSHZO5R_cjs.useChatContextOptional; }
3167
- });
3168
- Object.defineProperty(exports, "useChatLayout", {
3169
- enumerable: true,
3170
- get: function () { return chunkTBSHZO5R_cjs.useChatLayout; }
3171
- });
3172
- Object.defineProperty(exports, "ArrayFieldItemTemplate", {
3173
- enumerable: true,
3174
- get: function () { return chunkFEN5S772_cjs.ArrayFieldItemTemplate; }
3175
- });
3176
- Object.defineProperty(exports, "ArrayFieldTemplate", {
3177
- enumerable: true,
3178
- get: function () { return chunkFEN5S772_cjs.ArrayFieldTemplate; }
3179
- });
3180
- Object.defineProperty(exports, "BaseInputTemplate", {
3181
- enumerable: true,
3182
- get: function () { return chunkFEN5S772_cjs.BaseInputTemplate; }
3183
- });
3184
- Object.defineProperty(exports, "CheckboxWidget", {
3185
- enumerable: true,
3186
- get: function () { return chunkFEN5S772_cjs.CheckboxWidget; }
3187
- });
3188
- Object.defineProperty(exports, "ColorWidget", {
3189
- enumerable: true,
3190
- get: function () { return chunkFEN5S772_cjs.ColorWidget; }
3191
- });
3192
- Object.defineProperty(exports, "ErrorListTemplate", {
3193
- enumerable: true,
3194
- get: function () { return chunkFEN5S772_cjs.ErrorListTemplate; }
3195
- });
3196
- Object.defineProperty(exports, "FieldTemplate", {
3197
- enumerable: true,
3198
- get: function () { return chunkFEN5S772_cjs.FieldTemplate; }
3199
- });
3200
- Object.defineProperty(exports, "JsonSchemaForm", {
3201
- enumerable: true,
3202
- get: function () { return chunkFEN5S772_cjs.JsonSchemaForm; }
3203
- });
3204
- Object.defineProperty(exports, "NumberWidget", {
3205
- enumerable: true,
3206
- get: function () { return chunkFEN5S772_cjs.NumberWidget; }
3207
- });
3208
- Object.defineProperty(exports, "ObjectFieldTemplate", {
3209
- enumerable: true,
3210
- get: function () { return chunkFEN5S772_cjs.ObjectFieldTemplate; }
3211
- });
3212
- Object.defineProperty(exports, "SelectWidget", {
3213
- enumerable: true,
3214
- get: function () { return chunkFEN5S772_cjs.SelectWidget; }
3215
- });
3216
- Object.defineProperty(exports, "SliderWidget", {
3217
- enumerable: true,
3218
- get: function () { return chunkFEN5S772_cjs.SliderWidget; }
3219
- });
3220
- Object.defineProperty(exports, "SwitchWidget", {
3221
- enumerable: true,
3222
- get: function () { return chunkFEN5S772_cjs.SwitchWidget; }
3223
- });
3224
- Object.defineProperty(exports, "TextWidget", {
3225
- enumerable: true,
3226
- get: function () { return chunkFEN5S772_cjs.TextWidget; }
3227
- });
3228
- Object.defineProperty(exports, "evaluateDisabledWhen", {
3229
- enumerable: true,
3230
- get: function () { return chunkFEN5S772_cjs.evaluateDisabledWhen; }
3231
- });
3232
- Object.defineProperty(exports, "getRequiredFields", {
3233
- enumerable: true,
3234
- get: function () { return chunkFEN5S772_cjs.getRequiredFields; }
3235
- });
3236
- Object.defineProperty(exports, "hasRequiredFields", {
3237
- enumerable: true,
3238
- get: function () { return chunkFEN5S772_cjs.hasRequiredFields; }
3239
- });
3240
- Object.defineProperty(exports, "mergeDefaults", {
3241
- enumerable: true,
3242
- get: function () { return chunkFEN5S772_cjs.mergeDefaults; }
3243
- });
3244
- Object.defineProperty(exports, "normalizeFormData", {
3245
- enumerable: true,
3246
- get: function () { return chunkFEN5S772_cjs.normalizeFormData; }
3247
- });
3248
- Object.defineProperty(exports, "safeJsonParse", {
3249
- enumerable: true,
3250
- get: function () { return chunkFEN5S772_cjs.safeJsonParse; }
3251
- });
3252
- Object.defineProperty(exports, "safeJsonStringify", {
3253
- enumerable: true,
3254
- get: function () { return chunkFEN5S772_cjs.safeJsonStringify; }
3255
- });
3256
- Object.defineProperty(exports, "validateRequiredFields", {
3257
- enumerable: true,
3258
- get: function () { return chunkFEN5S772_cjs.validateRequiredFields; }
3259
- });
3260
- Object.defineProperty(exports, "validateSchema", {
3261
- enumerable: true,
3262
- get: function () { return chunkFEN5S772_cjs.validateSchema; }
3263
- });
3264
- Object.defineProperty(exports, "useLottie", {
3265
- enumerable: true,
3266
- get: function () { return chunkQJ6GTUCO_cjs.useLottie; }
3267
- });
3268
- Object.defineProperty(exports, "AudioPlayer", {
3269
- enumerable: true,
3270
- get: function () { return chunkYDPDTOSP_cjs.Player; }
3271
- });
3272
- Object.defineProperty(exports, "NativeProvider", {
3273
- enumerable: true,
3274
- get: function () { return chunkKNDLV4PI_cjs.NativeProvider; }
3275
- });
3276
- Object.defineProperty(exports, "StreamProvider", {
3277
- enumerable: true,
3278
- get: function () { return chunkKNDLV4PI_cjs.StreamProvider; }
3279
- });
3280
- Object.defineProperty(exports, "VideoControls", {
3281
- enumerable: true,
3282
- get: function () { return chunkKNDLV4PI_cjs.VideoControls; }
3283
- });
3284
- Object.defineProperty(exports, "VideoErrorFallback", {
3285
- enumerable: true,
3286
- get: function () { return chunkKNDLV4PI_cjs.VideoErrorFallback; }
3287
- });
3288
- Object.defineProperty(exports, "VideoPlayer", {
3289
- enumerable: true,
3290
- get: function () { return chunkKNDLV4PI_cjs.VideoPlayer; }
3291
- });
3292
- Object.defineProperty(exports, "VideoPlayerProvider", {
3293
- enumerable: true,
3294
- get: function () { return chunkKNDLV4PI_cjs.VideoPlayerProvider; }
3295
- });
3296
- Object.defineProperty(exports, "VidstackProvider", {
3297
- enumerable: true,
3298
- get: function () { return chunkKNDLV4PI_cjs.VidstackProvider; }
3299
- });
3300
- Object.defineProperty(exports, "createVideoErrorFallback", {
3301
- enumerable: true,
3302
- get: function () { return chunkKNDLV4PI_cjs.createVideoErrorFallback; }
3303
- });
3304
- Object.defineProperty(exports, "isSimpleStreamSource", {
3305
- enumerable: true,
3306
- get: function () { return chunkKNDLV4PI_cjs.isSimpleStreamSource; }
3307
- });
3308
- Object.defineProperty(exports, "resolveFileSource", {
3309
- enumerable: true,
3310
- get: function () { return chunkKNDLV4PI_cjs.resolveFileSource; }
3311
- });
3312
- Object.defineProperty(exports, "resolvePlayerMode", {
3313
- enumerable: true,
3314
- get: function () { return chunkKNDLV4PI_cjs.resolvePlayerMode; }
3315
- });
3316
- Object.defineProperty(exports, "resolveStreamSource", {
3317
- enumerable: true,
3318
- get: function () { return chunkKNDLV4PI_cjs.resolveStreamSource; }
3319
- });
3320
- Object.defineProperty(exports, "useVideoPlayerContext", {
3321
- enumerable: true,
3322
- get: function () { return chunkKNDLV4PI_cjs.useVideoPlayerContext; }
3323
- });
3324
- Object.defineProperty(exports, "ImageViewer", {
3325
- enumerable: true,
3326
- get: function () { return chunk5I5QNGUG_cjs.ImageViewer; }
3327
- });
3328
- Object.defineProperty(exports, "generateContentKey", {
3329
- enumerable: true,
3330
- get: function () { return chunkYW5IVWHQ_cjs.generateContentKey; }
3331
- });
3332
- Object.defineProperty(exports, "useAudioCache", {
3333
- enumerable: true,
3334
- get: function () { return chunkYW5IVWHQ_cjs.useAudioCache; }
3335
- });
3336
- Object.defineProperty(exports, "useBlobUrlCleanup", {
3337
- enumerable: true,
3338
- get: function () { return chunkYW5IVWHQ_cjs.useBlobUrlCleanup; }
3339
- });
3340
- Object.defineProperty(exports, "useImageCache", {
3341
- enumerable: true,
3342
- get: function () { return chunkYW5IVWHQ_cjs.useImageCache; }
3343
- });
3344
- Object.defineProperty(exports, "useMediaCacheStore", {
3345
- enumerable: true,
3346
- get: function () { return chunkYW5IVWHQ_cjs.useMediaCacheStore; }
3347
- });
3348
- Object.defineProperty(exports, "useVideoCache", {
3349
- enumerable: true,
3350
- get: function () { return chunkYW5IVWHQ_cjs.useVideoCache; }
3351
- });
3352
- Object.defineProperty(exports, "useVideoPlayerSettings", {
3353
- enumerable: true,
3354
- get: function () { return chunkYW5IVWHQ_cjs.useVideoPlayerSettings; }
3355
- });
3356
- Object.defineProperty(exports, "CronSchedulerProvider", {
3357
- enumerable: true,
3358
- get: function () { return chunk76NNDZH6_cjs.CronSchedulerProvider; }
3359
- });
3360
- Object.defineProperty(exports, "CustomInput", {
3361
- enumerable: true,
3362
- get: function () { return chunk76NNDZH6_cjs.CustomInput; }
3363
- });
3364
- Object.defineProperty(exports, "DayChips", {
3365
- enumerable: true,
3366
- get: function () { return chunk76NNDZH6_cjs.DayChips; }
3367
- });
3368
- Object.defineProperty(exports, "MonthDayGrid", {
3369
- enumerable: true,
3370
- get: function () { return chunk76NNDZH6_cjs.MonthDayGrid; }
3371
- });
3372
- Object.defineProperty(exports, "SchedulePreview", {
3373
- enumerable: true,
3374
- get: function () { return chunk76NNDZH6_cjs.SchedulePreview; }
3375
- });
3376
- Object.defineProperty(exports, "ScheduleTypeSelector", {
3377
- enumerable: true,
3378
- get: function () { return chunk76NNDZH6_cjs.ScheduleTypeSelector; }
3379
- });
3380
- Object.defineProperty(exports, "TimeSelector", {
3381
- enumerable: true,
3382
- get: function () { return chunk76NNDZH6_cjs.TimeSelector; }
3383
- });
3384
- Object.defineProperty(exports, "buildCron", {
3385
- enumerable: true,
3386
- get: function () { return chunk76NNDZH6_cjs.buildCron; }
3387
- });
3388
- Object.defineProperty(exports, "humanizeCron", {
3389
- enumerable: true,
3390
- get: function () { return chunk76NNDZH6_cjs.humanizeCron; }
3391
- });
3392
- Object.defineProperty(exports, "isValidCron", {
3393
- enumerable: true,
3394
- get: function () { return chunk76NNDZH6_cjs.isValidCron; }
3395
- });
3396
- Object.defineProperty(exports, "parseCron", {
3397
- enumerable: true,
3398
- get: function () { return chunk76NNDZH6_cjs.parseCron; }
3399
- });
3400
- Object.defineProperty(exports, "useCronCustom", {
3401
- enumerable: true,
3402
- get: function () { return chunk76NNDZH6_cjs.useCronCustom; }
3403
- });
3404
- Object.defineProperty(exports, "useCronMonthDays", {
3405
- enumerable: true,
3406
- get: function () { return chunk76NNDZH6_cjs.useCronMonthDays; }
3407
- });
3408
- Object.defineProperty(exports, "useCronPreview", {
3409
- enumerable: true,
3410
- get: function () { return chunk76NNDZH6_cjs.useCronPreview; }
3411
- });
3412
- Object.defineProperty(exports, "useCronScheduler", {
3413
- enumerable: true,
3414
- get: function () { return chunk76NNDZH6_cjs.useCronScheduler; }
3415
- });
3416
- Object.defineProperty(exports, "useCronSchedulerContext", {
3417
- enumerable: true,
3418
- get: function () { return chunk76NNDZH6_cjs.useCronSchedulerContext; }
3419
- });
3420
- Object.defineProperty(exports, "useCronTime", {
3421
- enumerable: true,
3422
- get: function () { return chunk76NNDZH6_cjs.useCronTime; }
3423
- });
3424
- Object.defineProperty(exports, "useCronType", {
3425
- enumerable: true,
3426
- get: function () { return chunk76NNDZH6_cjs.useCronType; }
3427
- });
3428
- Object.defineProperty(exports, "useCronWeekDays", {
3429
- enumerable: true,
3430
- get: function () { return chunk76NNDZH6_cjs.useCronWeekDays; }
3431
- });
3432
- Object.defineProperty(exports, "TreeError", {
3433
- enumerable: true,
3434
- get: function () { return chunkYXZ6GU7H_cjs.TreeError; }
3435
- });
3436
- Object.defineProperty(exports, "TreeSkeleton", {
3437
- enumerable: true,
3438
- get: function () { return chunkYXZ6GU7H_cjs.TreeSkeleton; }
3439
- });
3440
- Object.defineProperty(exports, "createDemoTree", {
3441
- enumerable: true,
3442
- get: function () { return chunkYXZ6GU7H_cjs.createDemoTree; }
3443
- });
3444
- Object.defineProperty(exports, "DEFAULT_TREE_APPEARANCE", {
3445
- enumerable: true,
3446
- get: function () { return chunkFVVF7VCD_cjs.DEFAULT_TREE_APPEARANCE; }
3447
- });
3448
- Object.defineProperty(exports, "DEFAULT_TREE_LABELS", {
3449
- enumerable: true,
3450
- get: function () { return chunkFVVF7VCD_cjs.DEFAULT_TREE_LABELS; }
3451
- });
3452
- Object.defineProperty(exports, "Tree", {
3453
- enumerable: true,
3454
- get: function () { return chunkFVVF7VCD_cjs.TreeRoot; }
3455
- });
3456
- Object.defineProperty(exports, "TreeChevron", {
3457
- enumerable: true,
3458
- get: function () { return chunkFVVF7VCD_cjs.TreeChevron; }
3459
- });
3460
- Object.defineProperty(exports, "TreeContent", {
3461
- enumerable: true,
3462
- get: function () { return chunkFVVF7VCD_cjs.TreeContent; }
3463
- });
3464
- Object.defineProperty(exports, "TreeEmpty", {
3465
- enumerable: true,
3466
- get: function () { return chunkFVVF7VCD_cjs.TreeEmpty; }
3467
- });
3468
- Object.defineProperty(exports, "TreeIcon", {
3469
- enumerable: true,
3470
- get: function () { return chunkFVVF7VCD_cjs.TreeIcon; }
3471
- });
3472
- Object.defineProperty(exports, "TreeIndentGuides", {
3473
- enumerable: true,
3474
- get: function () { return chunkFVVF7VCD_cjs.TreeIndentGuides; }
3475
- });
3476
- Object.defineProperty(exports, "TreeLabel", {
3477
- enumerable: true,
3478
- get: function () { return chunkFVVF7VCD_cjs.TreeLabel; }
3479
- });
3480
- Object.defineProperty(exports, "TreeProvider", {
3481
- enumerable: true,
3482
- get: function () { return chunkFVVF7VCD_cjs.TreeProvider; }
3483
- });
3484
- Object.defineProperty(exports, "TreeRoot", {
3485
- enumerable: true,
3486
- get: function () { return chunkFVVF7VCD_cjs.TreeRoot; }
3487
- });
3488
- Object.defineProperty(exports, "TreeRow", {
3489
- enumerable: true,
3490
- get: function () { return chunkFVVF7VCD_cjs.TreeRow; }
3491
- });
3492
- Object.defineProperty(exports, "TreeSearchInput", {
3493
- enumerable: true,
3494
- get: function () { return chunkFVVF7VCD_cjs.TreeSearchInput; }
3495
- });
3496
- Object.defineProperty(exports, "appearanceToStyle", {
3497
- enumerable: true,
3498
- get: function () { return chunkFVVF7VCD_cjs.appearanceToStyle; }
3499
- });
3500
- Object.defineProperty(exports, "clearTreeState", {
3501
- enumerable: true,
3502
- get: function () { return chunkFVVF7VCD_cjs.clearTreeState; }
3503
- });
3504
- Object.defineProperty(exports, "createChildCache", {
3505
- enumerable: true,
3506
- get: function () { return chunkFVVF7VCD_cjs.createChildCache; }
3507
- });
3508
- Object.defineProperty(exports, "flattenTree", {
3509
- enumerable: true,
3510
- get: function () { return chunkFVVF7VCD_cjs.flattenTree; }
3511
- });
3512
- Object.defineProperty(exports, "loadTreeState", {
3513
- enumerable: true,
3514
- get: function () { return chunkFVVF7VCD_cjs.loadTreeState; }
3515
- });
3516
- Object.defineProperty(exports, "resolveAppearance", {
3517
- enumerable: true,
3518
- get: function () { return chunkFVVF7VCD_cjs.resolveAppearance; }
3519
- });
3520
- Object.defineProperty(exports, "resolveChildren", {
3521
- enumerable: true,
3522
- get: function () { return chunkFVVF7VCD_cjs.resolveChildren; }
3523
- });
3524
- Object.defineProperty(exports, "saveTreeState", {
3525
- enumerable: true,
3526
- get: function () { return chunkFVVF7VCD_cjs.saveTreeState; }
3527
- });
3528
- Object.defineProperty(exports, "useTreeActions", {
3529
- enumerable: true,
3530
- get: function () { return chunkFVVF7VCD_cjs.useTreeActions; }
3531
- });
3532
- Object.defineProperty(exports, "useTreeContext", {
3533
- enumerable: true,
3534
- get: function () { return chunkFVVF7VCD_cjs.useTreeContext; }
3535
- });
3536
- Object.defineProperty(exports, "useTreeExpansion", {
3537
- enumerable: true,
3538
- get: function () { return chunkFVVF7VCD_cjs.useTreeExpansion; }
3539
- });
3540
- Object.defineProperty(exports, "useTreeFocus", {
3541
- enumerable: true,
3542
- get: function () { return chunkFVVF7VCD_cjs.useTreeFocus; }
3543
- });
3544
- Object.defineProperty(exports, "useTreeKeyboard", {
3545
- enumerable: true,
3546
- get: function () { return chunkFVVF7VCD_cjs.useTreeKeyboard; }
3547
- });
3548
- Object.defineProperty(exports, "useTreeLabels", {
3549
- enumerable: true,
3550
- get: function () { return chunkFVVF7VCD_cjs.useTreeLabels; }
3551
- });
3552
- Object.defineProperty(exports, "useTreeRows", {
3553
- enumerable: true,
3554
- get: function () { return chunkFVVF7VCD_cjs.useTreeRows; }
3555
- });
3556
- Object.defineProperty(exports, "useTreeSearch", {
3557
- enumerable: true,
3558
- get: function () { return chunkFVVF7VCD_cjs.useTreeSearch; }
3559
- });
3560
- Object.defineProperty(exports, "useTreeSelection", {
3561
- enumerable: true,
3562
- get: function () { return chunkFVVF7VCD_cjs.useTreeSelection; }
3563
- });
3564
- Object.defineProperty(exports, "useTreeTypeAhead", {
3565
- enumerable: true,
3566
- get: function () { return chunkFVVF7VCD_cjs.useTreeTypeAhead; }
3567
- });
3568
- Object.defineProperty(exports, "ANCHOR", {
3569
- enumerable: true,
3570
- get: function () { return chunk7IYXZUJO_cjs.ANCHOR; }
3571
- });
3572
- Object.defineProperty(exports, "ActionRow", {
3573
- enumerable: true,
3574
- get: function () { return chunk7IYXZUJO_cjs.ActionRow; }
3575
- });
3576
- Object.defineProperty(exports, "BUBBLE_SURFACE", {
3577
- enumerable: true,
3578
- get: function () { return chunk7IYXZUJO_cjs.BUBBLE_SURFACE; }
3579
- });
3580
- Object.defineProperty(exports, "ChatMessageRow", {
3581
- enumerable: true,
3582
- get: function () { return chunk7IYXZUJO_cjs.ChatMessageRow; }
3583
- });
3584
- Object.defineProperty(exports, "DESTRUCTIVE_SURFACE", {
3585
- enumerable: true,
3586
- get: function () { return chunk7IYXZUJO_cjs.DESTRUCTIVE_SURFACE; }
3587
- });
3588
- Object.defineProperty(exports, "MarkdownMessage", {
3589
- enumerable: true,
3590
- get: function () { return chunk7IYXZUJO_cjs.MarkdownMessage; }
3591
- });
3592
- Object.defineProperty(exports, "MarkdownMessageDefault", {
3593
- enumerable: true,
3594
- get: function () { return chunk7IYXZUJO_cjs.MarkdownMessage_default; }
3595
- });
3596
- Object.defineProperty(exports, "Mermaid", {
3597
- enumerable: true,
3598
- get: function () { return chunk7IYXZUJO_cjs.Mermaid_default; }
3599
- });
3600
- Object.defineProperty(exports, "PrettyCode", {
3601
- enumerable: true,
3602
- get: function () { return chunk7IYXZUJO_cjs.PrettyCode_default; }
3603
- });
3604
- Object.defineProperty(exports, "TOGGLE", {
3605
- enumerable: true,
3606
- get: function () { return chunk7IYXZUJO_cjs.TOGGLE; }
3607
- });
3608
- Object.defineProperty(exports, "TOOL_CALL", {
3609
- enumerable: true,
3610
- get: function () { return chunk7IYXZUJO_cjs.TOOL_CALL; }
3611
- });
3612
- Object.defineProperty(exports, "extractTextFromChildren", {
3613
- enumerable: true,
3614
- get: function () { return chunk7IYXZUJO_cjs.extractTextFromChildren; }
3615
- });
3616
- Object.defineProperty(exports, "useCollapsibleContent", {
3617
- enumerable: true,
3618
- get: function () { return chunk7IYXZUJO_cjs.useCollapsibleContent; }
3619
- });
3620
- Object.defineProperty(exports, "JsonTree", {
3621
- enumerable: true,
3622
- get: function () { return chunkT3MWM23F_cjs.JsonTree_default; }
3623
- });
3624
- exports.AudioToggle = AudioToggle;
3625
- exports.CronScheduler = CronScheduler;
3626
- exports.DEFAULT_DOCK_PREFS = DEFAULT_DOCK_PREFS;
3627
- exports.DiffEditor = DiffEditor;
3628
- exports.Editor = Editor;
3629
- exports.EditorProvider = EditorProvider;
3630
- exports.LazyAudioPlayer = LazyPlayer;
3631
- exports.LazyChat = LazyChat;
3632
- exports.LazyCronScheduler = LazyCronScheduler;
3633
- exports.LazyImageViewer = LazyImageViewer;
3634
- exports.LazyJsonSchemaForm = LazyJsonSchemaForm;
3635
- exports.LazyJsonTree = LazyJsonTree;
3636
- exports.LazyLottiePlayer = LazyLottiePlayer;
3637
- exports.LazyMapContainer = LazyMapContainer;
3638
- exports.LazyMapView = LazyMapView;
3639
- exports.LazyMermaid = LazyMermaid;
3640
- exports.LazyOpenapiViewer = LazyOpenapiViewer;
3641
- exports.LazyPrettyCode = LazyPrettyCode;
3642
- exports.LazyTree = LazyTree;
3643
- exports.LazyVideoPlayer = LazyVideoPlayer;
3644
- exports.LottiePlayer = LottiePlayer;
3645
- exports.MarkdownEditor = MarkdownEditor;
3646
- exports.OpenapiViewer = OpenapiViewer_default;
3647
- exports.TransportError = TransportError;
3648
- exports.collectImageAttachments = collectImageAttachments;
3649
- exports.createHttpTransport = createHttpTransport;
3650
- exports.createMockTransport = createMockTransport;
3651
- exports.createPydanticAIChatTransport = createPydanticAIChatTransport;
3652
- exports.createPydanticAISSEMap = createPydanticAISSEMap;
3653
- exports.createToolIdQueue = createToolIdQueue;
3654
- exports.dispatchToolPayload = dispatchToolPayload;
3655
- exports.isGeoJSONFeatureCollection = isGeoJSONFeatureCollection;
3656
- exports.isLatLng = isLatLng;
3657
- exports.isPlainObject = isPlainObject;
3658
- exports.isStringValue = isStringValue;
3659
- exports.mapPydanticAIEvent = mapPydanticAIEvent;
3660
- exports.mentionPresets = mentionPresets;
3661
- exports.parseSSE = parseSSE;
3662
- exports.useChatAudioPrefs = useChatAudioPrefs;
3663
- exports.useChatDockPrefs = useChatDockPrefs;
3664
- exports.useChatHistory = useChatHistory;
3665
- exports.useChatLightbox = useChatLightbox;
3666
- exports.useChatScroll = useChatScroll;
3667
- exports.useChatUnread = useChatUnread;
3668
- exports.useEditor = useEditor;
3669
- exports.useEditorContext = useEditorContext;
3670
- exports.useLanguage = useLanguage;
3671
- exports.useMonaco = useMonaco;
3672
- exports.useVisitorFingerprint = useVisitorFingerprint;
3673
- //# sourceMappingURL=index.cjs.map
3674
- //# sourceMappingURL=index.cjs.map