@alepha/devtools 0.14.2 → 0.14.3

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 (67) hide show
  1. package/assets/devtools/chunk.B3_W5FaN.js +1 -0
  2. package/assets/devtools/chunk.BBrq-Wwo.js +7 -0
  3. package/assets/devtools/{chunk.Dwb-lFg8.js → chunk.BC4Lys4j.js} +1 -1
  4. package/assets/devtools/chunk.BNC0DJB8.js +1 -0
  5. package/assets/devtools/chunk.BOc4btAA.js +2 -0
  6. package/assets/devtools/chunk.BPjMdorr.js +1 -0
  7. package/assets/devtools/chunk.Bdi_dTor.js +1 -0
  8. package/assets/devtools/{chunk.BA8URMP8.js → chunk.BeYM7pih.js} +1 -1
  9. package/assets/devtools/{chunk.BkQQhCPw.js → chunk.BjjA59Pf.js} +1 -1
  10. package/assets/devtools/{chunk.D6vpaxPE.js → chunk.ByuRJbSC.js} +1 -1
  11. package/assets/devtools/chunk.C1yl87Yo.js +1 -0
  12. package/assets/devtools/{chunk.CSlinMdh.js → chunk.C5K_AIru.js} +1 -1
  13. package/assets/devtools/chunk.C6NWzsJg.js +1 -0
  14. package/assets/devtools/{chunk.CcRPc1V0.js → chunk.CAWWjC4E.js} +1 -1
  15. package/assets/devtools/chunk.CQ8PqHT0.js +1 -0
  16. package/assets/devtools/{chunk.B_-9nxHc.js → chunk.CYVZxO-p.js} +1 -1
  17. package/assets/devtools/{chunk.DRx03mgu.js → chunk.ChDpavl2.js} +1 -1
  18. package/assets/devtools/chunk.DAVfKvCa.js +2 -0
  19. package/assets/devtools/{chunk.QuY3UyEF.js → chunk.DF8tZYh8.js} +1 -1
  20. package/assets/devtools/{chunk.CD3lZA1D.js → chunk.DI-f4xNk.js} +1 -1
  21. package/assets/devtools/{chunk.CMrSghiM.js → chunk.DLDchrhP.js} +1 -1
  22. package/assets/devtools/{chunk.DUP1E40B.js → chunk.DN-SKgAD.js} +1 -1
  23. package/assets/devtools/{chunk.BXj_XO3l.js → chunk.DcaVw31J.js} +1 -1
  24. package/assets/devtools/chunk.Dwv4A_H_.js +1 -0
  25. package/assets/devtools/chunk.DxjqPOcc.js +1 -0
  26. package/assets/devtools/{chunk.C2Epljet.js → chunk.I1TSx4X4.js} +1 -1
  27. package/assets/devtools/chunk.INuuLdYd.js +1 -0
  28. package/assets/devtools/{chunk.C2XzHl1-.js → chunk.PWK2K2kI.js} +1 -1
  29. package/assets/devtools/chunk.UAANdYnt.js +1 -0
  30. package/assets/devtools/chunk.XsVAJU_N.js +9 -0
  31. package/assets/devtools/chunk.iyc5GsVj.js +1 -0
  32. package/assets/devtools/chunk.mJxmm31y.js +1 -0
  33. package/assets/devtools/chunk.ospt8-RN.js +1 -0
  34. package/assets/devtools/entry.DBfTnVUe.js +75 -0
  35. package/assets/devtools/index.html +1 -1
  36. package/dist/index.d.ts +29 -0
  37. package/dist/index.js +15 -0
  38. package/dist/index.js.map +1 -1
  39. package/package.json +9 -9
  40. package/src/__tests__/DevCollectorProvider.spec.ts +7 -0
  41. package/src/api/providers/DevToolsDatabaseProvider.ts +16 -0
  42. package/src/ui/components/DevDashboard.tsx +13 -163
  43. package/src/ui/components/DevLayout.tsx +26 -21
  44. package/src/ui/components/graph/DevDependencyGraph.tsx +123 -104
  45. package/src/ui/components/graph/GraphControls.tsx +31 -25
  46. package/assets/devtools/chunk.3mUAkkKN.js +0 -1
  47. package/assets/devtools/chunk.AVmV_XG3.js +0 -1
  48. package/assets/devtools/chunk.B9Nj9arT.js +0 -1
  49. package/assets/devtools/chunk.BZoA8zmc.js +0 -1
  50. package/assets/devtools/chunk.Bk_AzNdP.js +0 -7
  51. package/assets/devtools/chunk.BlCuAV4r.js +0 -2
  52. package/assets/devtools/chunk.BoKPUi4h.js +0 -2
  53. package/assets/devtools/chunk.CMPoj2S1.js +0 -1
  54. package/assets/devtools/chunk.CNyKXw81.js +0 -9
  55. package/assets/devtools/chunk.CUdeQBl0.js +0 -6
  56. package/assets/devtools/chunk.CqWgHz10.js +0 -1
  57. package/assets/devtools/chunk.DCS6fHH1.js +0 -1
  58. package/assets/devtools/chunk.DIbRzrh1.js +0 -1
  59. package/assets/devtools/chunk.DJdym_tE.js +0 -1
  60. package/assets/devtools/chunk.DhCpNWJE.js +0 -1
  61. package/assets/devtools/chunk.DojDQgy5.js +0 -1
  62. package/assets/devtools/chunk.DqX1betX.js +0 -1
  63. package/assets/devtools/chunk.OgXBCMJY.js +0 -1
  64. package/assets/devtools/chunk.VmKlHUok.js +0 -1
  65. package/assets/devtools/chunk.VyCl7mMj.js +0 -1
  66. package/assets/devtools/chunk.e9ZcH1yi.js +0 -1
  67. package/assets/devtools/entry.r_sixgJG.js +0 -75
@@ -1,10 +1,9 @@
1
- import { useInject } from "@alepha/react";
2
- import { ui } from "@alepha/ui";
1
+ import { useAction, useInject } from "@alepha/react";
2
+ import { ui, useDialog } from "@alepha/ui";
3
3
  import {
4
4
  ActionIcon,
5
5
  Alert,
6
6
  Badge,
7
- Box,
8
7
  Flex,
9
8
  Group,
10
9
  Loader,
@@ -35,7 +34,6 @@ import "@xyflow/react/dist/style.css";
35
34
  import { HttpClient } from "alepha/server";
36
35
  import { useCallback, useEffect, useMemo, useState } from "react";
37
36
  import { devMetadataSchema } from "../../../api/schemas/DevMetadata.ts";
38
- import type { DevProviderMetadata } from "../../../api/schemas/DevProviderMetadata.ts";
39
37
  import { getModuleColor } from "./constants.ts";
40
38
  import { GraphControls } from "./GraphControls.tsx";
41
39
  import {
@@ -58,60 +56,8 @@ const nodeTypes = {
58
56
  provider: ProviderNode,
59
57
  };
60
58
 
61
- const FlowControls = () => {
62
- const { zoomIn, zoomOut, fitView } = useReactFlow();
63
- const [isLocked, setIsLocked] = useState(false);
64
-
65
- return (
66
- <Stack
67
- gap={4}
68
- style={{
69
- position: "absolute",
70
- bottom: 16,
71
- left: 16,
72
- zIndex: 10,
73
- backgroundColor: ui.colors.elevated,
74
- border: `1px solid ${ui.colors.border}`,
75
- borderRadius: 8,
76
- padding: 4,
77
- }}
78
- >
79
- <Tooltip label="Zoom in" position="right">
80
- <ActionIcon size="sm" variant="subtle" onClick={() => zoomIn()}>
81
- <IconPlus size={14} />
82
- </ActionIcon>
83
- </Tooltip>
84
- <Tooltip label="Zoom out" position="right">
85
- <ActionIcon size="sm" variant="subtle" onClick={() => zoomOut()}>
86
- <IconMinus size={14} />
87
- </ActionIcon>
88
- </Tooltip>
89
- <Tooltip label="Fit view" position="right">
90
- <ActionIcon
91
- size="sm"
92
- variant="subtle"
93
- onClick={() => fitView({ padding: 0.2 })}
94
- >
95
- <IconFocusCentered size={14} />
96
- </ActionIcon>
97
- </Tooltip>
98
- <Tooltip label={isLocked ? "Unlock" : "Lock"} position="right">
99
- <ActionIcon
100
- size="sm"
101
- variant="subtle"
102
- onClick={() => setIsLocked(!isLocked)}
103
- >
104
- {isLocked ? <IconLock size={14} /> : <IconLockOpen size={14} />}
105
- </ActionIcon>
106
- </Tooltip>
107
- </Stack>
108
- );
109
- };
110
-
111
59
  export const DevDependencyGraph = () => {
112
60
  const http = useInject(HttpClient);
113
- const [providers, setProviders] = useState<DevProviderMetadata[]>([]);
114
- const [loading, setLoading] = useState(true);
115
61
  const [nodes, setNodes, onNodesChange] = useNodesState<ProviderNodeType>([]);
116
62
  const [edges, setEdges, onEdgesChange] = useEdgesState<ProviderEdge>([]);
117
63
  const [selectedNode, setSelectedNode] = useState<{
@@ -126,17 +72,18 @@ export const DevDependencyGraph = () => {
126
72
  viewMode: "modules",
127
73
  });
128
74
 
129
- // Fetch data
130
- useEffect(() => {
131
- http
132
- .fetch("/devtools/api/metadata", {
133
- schema: { response: devMetadataSchema },
134
- })
135
- .then((res) => {
136
- setProviders(res.data.providers);
137
- setLoading(false);
138
- });
139
- }, []);
75
+ const { loading, result } = useAction(
76
+ {
77
+ runOnInit: true,
78
+ handler: () =>
79
+ http.fetch("/devtools/api/metadata", {
80
+ schema: { response: devMetadataSchema },
81
+ }),
82
+ },
83
+ [],
84
+ );
85
+
86
+ const providers = result?.data.providers || [];
140
87
 
141
88
  // Get unique modules
142
89
  const modules = useMemo(() => {
@@ -246,6 +193,8 @@ export const DevDependencyGraph = () => {
246
193
  [nodes, handleNodeClick],
247
194
  );
248
195
 
196
+ const dialog = useDialog();
197
+
249
198
  // Export as PNG
250
199
  const handleExport = useCallback(() => {
251
200
  // Get the react-flow viewport element
@@ -253,7 +202,10 @@ export const DevDependencyGraph = () => {
253
202
  if (!viewport) return;
254
203
 
255
204
  // Use html2canvas or similar - for now just alert
256
- alert("Export feature requires html2canvas library. Coming soon!");
205
+ return dialog.alert({
206
+ title: "Export",
207
+ message: "Export feature requires html2canvas library. Coming soon!",
208
+ });
257
209
  }, []);
258
210
 
259
211
  if (loading) {
@@ -265,9 +217,15 @@ export const DevDependencyGraph = () => {
265
217
  }
266
218
 
267
219
  return (
268
- <Flex direction="column" gap="md" w="100%" h="100%">
220
+ <Flex p="xl" direction="column" gap="md" w="100%" h="100%" flex={1} mih={0}>
269
221
  <Group justify="space-between" wrap="nowrap">
270
222
  <Group gap="sm">
223
+ <Flex
224
+ bdrs={"sm"}
225
+ h={"20px"}
226
+ w={"4px"}
227
+ bg={"var(--mantine-primary-color-filled)"}
228
+ />
271
229
  <IconTopologyRing size={24} opacity={0.7} />
272
230
  <Text size="lg" fw={500}>
273
231
  Dependency Graph
@@ -309,50 +267,111 @@ export const DevDependencyGraph = () => {
309
267
  </Alert>
310
268
  )}
311
269
 
312
- <Box
270
+ <Flex
271
+ flex={1}
272
+ h={"100%"}
313
273
  style={{
314
- flex: 1,
315
274
  borderRadius: 8,
316
275
  border: `1px solid ${ui.colors.border}`,
317
- overflow: "hidden",
318
276
  position: "relative",
319
277
  }}
320
278
  >
321
- <ReactFlowProvider>
322
- <ReactFlow
323
- nodes={nodes}
324
- edges={edges}
325
- onNodesChange={onNodesChange}
326
- onEdgesChange={onEdgesChange}
327
- onNodeClick={handleNodeClick as any}
328
- onPaneClick={handlePaneClick}
329
- nodeTypes={nodeTypes as any}
330
- fitView
331
- fitViewOptions={{ padding: 0.2 }}
332
- minZoom={0.1}
333
- maxZoom={2}
334
- proOptions={{ hideAttribution: true }}
335
- >
336
- <Background variant={BackgroundVariant.Dots} gap={20} size={1} />
337
- <MiniMap
338
- nodeColor={(node) =>
339
- getModuleColor((node.data as ProviderNodeData)?.module)
340
- }
341
- maskColor="rgba(0, 0, 0, 0.5)"
342
- style={{ backgroundColor: ui.colors.surface }}
343
- />
344
- <FlowControls />
345
- </ReactFlow>
346
- </ReactFlowProvider>
279
+ <Flex
280
+ h={"100%"}
281
+ style={{
282
+ position: "absolute",
283
+ top: 0,
284
+ left: 0,
285
+ right: 0,
286
+ bottom: 0,
287
+ }}
288
+ >
289
+ <ReactFlowProvider>
290
+ <ReactFlow
291
+ nodes={nodes}
292
+ edges={edges}
293
+ onNodesChange={onNodesChange}
294
+ onEdgesChange={onEdgesChange}
295
+ onNodeClick={handleNodeClick as any}
296
+ onPaneClick={handlePaneClick}
297
+ nodeTypes={nodeTypes as any}
298
+ fitView
299
+ fitViewOptions={{ padding: 0.2 }}
300
+ minZoom={0.1}
301
+ maxZoom={2}
302
+ proOptions={{ hideAttribution: true }}
303
+ >
304
+ <Background variant={BackgroundVariant.Dots} gap={20} size={1} />
305
+ <MiniMap
306
+ nodeColor={(node) =>
307
+ getModuleColor((node.data as ProviderNodeData)?.module)
308
+ }
309
+ maskColor="rgba(0, 0, 0, 0.5)"
310
+ style={{ backgroundColor: ui.colors.surface }}
311
+ />
312
+ <FlowControls />
313
+ </ReactFlow>
314
+ </ReactFlowProvider>
347
315
 
348
- <NodeDetails
349
- node={selectedNode}
350
- onClose={() => handlePaneClick()}
351
- onNodeClick={handleDetailsNodeClick}
352
- />
353
- </Box>
316
+ <NodeDetails
317
+ node={selectedNode}
318
+ onClose={() => handlePaneClick()}
319
+ onNodeClick={handleDetailsNodeClick}
320
+ />
321
+ </Flex>
322
+ </Flex>
354
323
  </Flex>
355
324
  );
356
325
  };
357
326
 
358
327
  export default DevDependencyGraph;
328
+
329
+ const FlowControls = () => {
330
+ const { zoomIn, zoomOut, fitView } = useReactFlow();
331
+ const [isLocked, setIsLocked] = useState(false);
332
+
333
+ return (
334
+ <Stack
335
+ gap={4}
336
+ style={{
337
+ position: "absolute",
338
+ bottom: 16,
339
+ left: 16,
340
+ zIndex: 10,
341
+ backgroundColor: ui.colors.elevated,
342
+ border: `1px solid ${ui.colors.border}`,
343
+ borderRadius: 8,
344
+ padding: 4,
345
+ }}
346
+ >
347
+ <Tooltip label="Zoom in" position="right">
348
+ <ActionIcon size="sm" variant="subtle" onClick={() => zoomIn()}>
349
+ <IconPlus size={14} />
350
+ </ActionIcon>
351
+ </Tooltip>
352
+ <Tooltip label="Zoom out" position="right">
353
+ <ActionIcon size="sm" variant="subtle" onClick={() => zoomOut()}>
354
+ <IconMinus size={14} />
355
+ </ActionIcon>
356
+ </Tooltip>
357
+ <Tooltip label="Fit view" position="right">
358
+ <ActionIcon
359
+ size="sm"
360
+ variant="subtle"
361
+ onClick={() => fitView({ padding: 0.2 })}
362
+ >
363
+ <IconFocusCentered size={14} />
364
+ </ActionIcon>
365
+ </Tooltip>
366
+ <Tooltip label={isLocked ? "Unlock" : "Lock"} position="right">
367
+ <ActionIcon
368
+ size="sm"
369
+ variant="subtle"
370
+ onClick={() => setIsLocked(!isLocked)}
371
+ >
372
+ {isLocked ? <IconLock size={14} /> : <IconLockOpen size={14} />}
373
+ </ActionIcon>
374
+ </Tooltip>
375
+ </Stack>
376
+ );
377
+ };
@@ -1,3 +1,4 @@
1
+ import { ui } from "@alepha/ui";
1
2
  import {
2
3
  ActionIcon,
3
4
  Badge,
@@ -45,31 +46,36 @@ export const GraphControls = ({
45
46
 
46
47
  return (
47
48
  <Flex gap="sm" wrap="wrap" align="center">
48
- <SegmentedControl
49
- size="xs"
50
- value={filters.viewMode}
51
- onChange={(value) =>
52
- onFiltersChange({ ...filters, viewMode: value as ViewMode })
53
- }
54
- data={[
55
- {
56
- label: (
57
- <Tooltip label="Modules">
58
- <IconBoxMultiple size={14} />
59
- </Tooltip>
60
- ),
61
- value: "modules",
62
- },
63
- {
64
- label: (
65
- <Tooltip label="Services">
66
- <IconBox size={14} />
67
- </Tooltip>
68
- ),
69
- value: "providers",
70
- },
71
- ]}
72
- />
49
+ <Flex>
50
+ <SegmentedControl
51
+ size="xs"
52
+ value={filters.viewMode}
53
+ onChange={(value) =>
54
+ onFiltersChange({ ...filters, viewMode: value as ViewMode })
55
+ }
56
+ data={[
57
+ {
58
+ label: (
59
+ <Tooltip label="Modules">
60
+ <IconBoxMultiple
61
+ size={ui.sizes.icon.sm}
62
+ style={{ marginTop: 2 }}
63
+ />
64
+ </Tooltip>
65
+ ),
66
+ value: "modules",
67
+ },
68
+ {
69
+ label: (
70
+ <Tooltip label="Services">
71
+ <IconBox size={ui.sizes.icon.sm} style={{ marginTop: 2 }} />
72
+ </Tooltip>
73
+ ),
74
+ value: "providers",
75
+ },
76
+ ]}
77
+ />
78
+ </Flex>
73
79
 
74
80
  <TextInput
75
81
  placeholder={isModuleView ? "Search modules..." : "Search services..."}
@@ -1 +0,0 @@
1
- import{w as C,Y as O,Z as R,r as x,j as e,F as m,T as i,B as c,H as j,ae as D,z as B,ac as z,O as S,E as F,G as _,ad as v,a5 as $,a9 as I}from"./entry.r_sixgJG.js";import{J as w}from"./chunk.CSlinMdh.js";import{d as A}from"./chunk.DRx03mgu.js";import{S as f,B as T}from"./chunk.CMrSghiM.js";import{I as H}from"./chunk.BA8URMP8.js";import{T as g}from"./chunk.DhCpNWJE.js";import{I as J}from"./chunk.Dwb-lFg8.js";import{I as V,a as G}from"./chunk.D6vpaxPE.js";import{T as Y}from"./chunk.CD3lZA1D.js";import"./chunk.BlqFPyLh.js";import"./chunk.CcRPc1V0.js";import"./chunk.uyVen0u2.js";const Z=[["path",{d:"M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2",key:"svg-0"}]],q=C("outline","folder-open","FolderOpen",Z);const K=[["path",{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2",key:"svg-0"}]],Q=C("outline","folder","Folder",K);const U=[["path",{d:"M10 14l11 -11",key:"svg-0"}],["path",{d:"M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5",key:"svg-1"}]],L=C("outline","send","Send",U),M={memory:"#69db7c",redis:"#ff6b6b",default:"#495057"},E=s=>M[s]??M.default,W=s=>{const o={name:"",fullPath:"",children:new Map};for(const p of s){const l=p.name.split(/[./]/);let a=o;for(let n=0;n<l.length;n++){const r=l[n],d=l.slice(0,n+1).join("/");a.children.has(r)||a.children.set(r,{name:r,fullPath:d,children:new Map}),a=a.children.get(r)}a.topic=p}return o},N=({node:s,depth:o,selectedTopic:p,onSelectTopic:l,expandedNodes:a,onToggleExpand:n})=>{const r=s.children.size>0,d=a.has(s.fullPath),b=s.topic&&p?.name===s.topic.name,t=s.topic?E(s.topic.provider):"#495057",u=()=>{s.topic&&l(s.topic),r&&n(s.fullPath)};return e.jsxs(c,{children:[e.jsxs(m,{align:"center",gap:4,px:"sm",py:4,onClick:u,style:{cursor:"pointer",paddingLeft:o*16+8,backgroundColor:b?`${t}15`:void 0,borderLeft:b?`2px solid ${t}`:"2px solid transparent",borderBottom:`1px solid ${j.colors.border}`},children:[r?d?e.jsx(F,{size:12,opacity:.5}):e.jsx(_,{size:12,opacity:.5}):e.jsx(c,{w:12}),r?d?e.jsx(q,{size:14,opacity:.5}):e.jsx(Q,{size:14,opacity:.5}):e.jsx(S,{size:14,opacity:.5}),e.jsx(i,{size:"sm",style:{flex:1},truncate:!0,fw:s.topic?500:400,children:s.name}),s.topic&&e.jsx(T,{size:"xs",variant:"light",color:s.topic.provider==="redis"?"red":"green",children:s.topic.provider})]}),r&&d&&e.jsx(c,{children:Array.from(s.children.values()).sort((h,y)=>{const P=h.children.size>0,k=y.children.size>0;return P&&!k?-1:!P&&k?1:h.name.localeCompare(y.name)}).map(h=>e.jsx(N,{node:h,depth:o+1,selectedTopic:p,onSelectTopic:l,expandedNodes:a,onToggleExpand:n},h.fullPath))})]})},X=({topics:s,selectedTopic:o,onSelectTopic:p,search:l,onSearchChange:a})=>{const[n,r]=x.useState(new Set),d=x.useMemo(()=>W(s),[s]);x.useEffect(()=>{const t=new Set,u=h=>{h.fullPath&&t.add(h.fullPath);for(const y of h.children.values())u(y)};u(d),r(t)},[d]);const b=x.useCallback(t=>{r(u=>{const h=new Set(u);return h.has(t)?h.delete(t):h.add(t),h})},[]);return e.jsxs(f,{gap:0,h:"100%",children:[e.jsx(c,{p:"sm",style:{borderBottom:`1px solid ${j.colors.border}`},children:e.jsx(D,{placeholder:"Search topics...",leftSection:e.jsx(B,{size:14}),size:"xs",value:l,onChange:t=>a(t.target.value)})}),e.jsx(z,{style:{flex:1},children:Array.from(d.children.values()).sort((t,u)=>t.name.localeCompare(u.name)).map(t=>e.jsx(N,{node:t,depth:0,selectedTopic:o,onSelectTopic:p,expandedNodes:n,onToggleExpand:b},t.fullPath))})]})},ee=({topic:s})=>e.jsx(z,{h:"100%",p:"md",children:e.jsxs(f,{gap:"lg",children:[e.jsxs(c,{children:[e.jsx(i,{size:"sm",fw:600,mb:"xs",children:"Topic Info"}),e.jsxs(f,{gap:"xs",children:[e.jsxs(m,{gap:"sm",children:[e.jsx(i,{size:"sm",c:"dimmed",w:100,children:"Name"}),e.jsx(i,{size:"sm",ff:"monospace",children:s.name})]}),e.jsxs(m,{gap:"sm",children:[e.jsx(i,{size:"sm",c:"dimmed",w:100,children:"Provider"}),e.jsx(T,{size:"xs",variant:"light",color:s.provider==="redis"?"red":"green",children:s.provider})]}),s.description&&e.jsxs(m,{gap:"sm",children:[e.jsx(i,{size:"sm",c:"dimmed",w:100,children:"Description"}),e.jsx(i,{size:"sm",children:s.description})]})]})]}),s.schema&&e.jsxs(c,{children:[e.jsx(i,{size:"sm",fw:600,mb:"xs",children:"Message Schema"}),e.jsx(c,{p:"sm",style:{border:`1px solid ${j.colors.border}`,borderRadius:8,backgroundColor:j.colors.surface},children:e.jsx(w,{data:s.schema,maxDepth:5,size:"xs"})})]})]})}),se=({topic:s})=>{const[o,p]=x.useState([]),[l,a]=x.useState(!1),n=x.useCallback(()=>{const r=s.schema?{example:"data",topic:s.name,timestamp:new Date().toISOString()}:{message:`Hello from ${s.name}`};p(d=>[{id:Math.random().toString(36).slice(2),timestamp:new Date,payload:r},...d.slice(0,49)])},[s]);return e.jsxs(m,{direction:"column",h:"100%",children:[e.jsx(c,{p:"sm",style:{borderBottom:`1px solid ${j.colors.border}`},children:e.jsxs(m,{gap:"sm",align:"center",justify:"space-between",children:[e.jsxs(m,{gap:"sm",align:"center",children:[e.jsx(v,{label:l?"Stop listening (coming soon)":"Start listening (coming soon)",children:e.jsx($,{size:"xs",variant:"light",color:l?"red":"green",leftSection:e.jsx(J,{size:14}),onClick:()=>a(!l),disabled:!0,children:l?"Stop":"Listen"})}),e.jsxs(i,{size:"xs",c:"dimmed",children:[o.length," messages"]})]}),e.jsxs(m,{gap:"sm",children:[e.jsx(v,{label:"Add fake message (for demo)",children:e.jsx(I,{size:"sm",variant:"light",onClick:n,children:e.jsx(L,{size:14})})}),e.jsx(v,{label:"Clear messages",children:e.jsx(I,{size:"sm",variant:"light",color:"gray",onClick:()=>p([]),children:e.jsx(V,{size:14})})})]})]})}),o.length===0?e.jsx(m,{align:"center",justify:"center",style:{flex:1},c:"dimmed",children:e.jsxs(f,{align:"center",gap:"xs",children:[e.jsx(S,{size:48,opacity:.3}),e.jsx(i,{size:"sm",children:"No messages yet"}),e.jsx(i,{size:"xs",c:"dimmed",children:"Click the send icon to add a fake message for demo"})]})}):e.jsx(z,{style:{flex:1},children:e.jsx(f,{gap:0,children:o.map(r=>e.jsxs(c,{p:"sm",style:{borderBottom:`1px solid ${j.colors.border}`},children:[e.jsxs(m,{align:"center",gap:"xs",mb:"xs",children:[e.jsx(G,{size:12,opacity:.5}),e.jsx(i,{size:"xs",c:"dimmed",children:r.timestamp.toLocaleTimeString()})]}),e.jsx(c,{p:"xs",style:{backgroundColor:j.colors.surface,borderRadius:4},children:e.jsx(w,{data:r.payload,maxDepth:3,size:"xs"})})]},r.id))})})]})},re=({topic:s})=>{const[o,p]=x.useState(JSON.stringify({message:"Hello",timestamp:new Date().toISOString()},null,2)),[l,a]=x.useState(null),n=()=>{try{JSON.parse(o),a(null),alert(`Message would be published to "${s.name}" (coming soon)`)}catch{a("Invalid JSON")}};return e.jsx(z,{h:"100%",p:"md",children:e.jsxs(f,{gap:"md",children:[e.jsxs(c,{children:[e.jsx(i,{size:"sm",fw:600,mb:"xs",children:"Publish Message"}),e.jsx(i,{size:"xs",c:"dimmed",mb:"sm",children:"Send a test message to this topic (coming soon)"})]}),e.jsxs(c,{children:[e.jsx(i,{size:"sm",c:"dimmed",mb:"xs",children:"Payload (JSON)"}),e.jsx(Y,{value:o,onChange:r=>p(r.target.value),minRows:8,maxRows:15,autosize:!0,ff:"monospace",size:"xs",error:l,styles:{input:{backgroundColor:j.colors.surface}}})]}),e.jsx(v,{label:"Publish message (coming soon)",children:e.jsx($,{size:"sm",variant:"light",leftSection:e.jsx(L,{size:16}),onClick:n,disabled:!0,children:"Publish"})}),s.schema&&e.jsxs(c,{children:[e.jsx(i,{size:"sm",c:"dimmed",mb:"xs",children:"Expected Schema"}),e.jsx(c,{p:"sm",style:{border:`1px solid ${j.colors.border}`,borderRadius:8,backgroundColor:j.colors.surface},children:e.jsx(w,{data:s.schema,maxDepth:3,size:"xs"})})]})]})})},ie=({topic:s})=>{const o=E(s.provider);return e.jsxs(m,{direction:"column",h:"100%",children:[e.jsxs(c,{px:"md",py:"sm",style:{borderBottom:`1px solid ${j.colors.border}`,backgroundColor:`${o}08`},children:[e.jsxs(m,{align:"center",gap:"sm",children:[e.jsx(S,{size:18,opacity:.7}),e.jsx(i,{size:"md",fw:600,ff:"monospace",children:s.name}),e.jsx(T,{size:"xs",variant:"light",color:s.provider==="redis"?"red":"green",children:s.provider})]}),s.description&&e.jsx(i,{size:"xs",c:"dimmed",mt:4,children:s.description})]}),e.jsxs(g,{defaultValue:"schema",style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs(g.List,{px:"md",children:[e.jsx(g.Tab,{value:"schema",children:"Schema"}),e.jsx(g.Tab,{value:"messages",children:"Messages"}),e.jsx(g.Tab,{value:"publish",children:"Publish"})]}),e.jsx(g.Panel,{value:"schema",style:{flex:1,overflow:"hidden"},children:e.jsx(ee,{topic:s})}),e.jsx(g.Panel,{value:"messages",style:{flex:1,overflow:"hidden"},children:e.jsx(se,{topic:s})}),e.jsx(g.Panel,{value:"publish",style:{flex:1,overflow:"hidden"},children:e.jsx(re,{topic:s})})]})]})},oe=()=>e.jsx(m,{align:"center",justify:"center",h:"100%",c:"dimmed",children:e.jsxs(f,{align:"center",gap:"xs",children:[e.jsx(S,{size:48,opacity:.3}),e.jsx(i,{size:"sm",children:"Select a topic to view details"})]})}),te=()=>e.jsx(m,{align:"center",justify:"center",h:"100%",c:"dimmed",children:e.jsxs(f,{align:"center",gap:"xs",children:[e.jsx(H,{size:48,opacity:.3}),e.jsx(i,{children:"No topics found"}),e.jsx(i,{size:"sm",c:"dimmed",children:"Add topics using $topic primitive to see them here"})]})}),fe=()=>{const s=O(R),[o,p]=x.useState([]),[l,a]=x.useState(!0),[n,r]=x.useState(null),[d,b]=x.useState("");x.useEffect(()=>{s.fetch("/devtools/api/metadata",{schema:{response:A}}).then(u=>{p(u.data.topics),a(!1)})},[]);const t=x.useMemo(()=>{if(!d)return o;const u=d.toLowerCase();return o.filter(h=>h.name.toLowerCase().includes(u))},[o,d]);return l?e.jsx(m,{align:"center",justify:"center",h:"100%",children:e.jsx(i,{c:"dimmed",children:"Loading..."})}):o.length===0?e.jsx(te,{}):e.jsxs(m,{h:"100%",style:{overflow:"hidden"},children:[e.jsx(c,{w:280,style:{borderRight:`1px solid ${j.colors.border}`,backgroundColor:j.colors.surface},children:e.jsx(X,{topics:t,selectedTopic:n,onSelectTopic:r,search:d,onSearchChange:b})}),e.jsx(c,{style:{flex:1,overflow:"hidden"},children:n?e.jsx(ie,{topic:n}):e.jsx(oe,{})})]})};export{fe as DevTopicsViewer,fe as default};
@@ -1 +0,0 @@
1
- import{c as $e,f as T,b as P,bc as Me,ag as B,j as g,bd as J,aJ as Z,be as Ae,B as S,bf as Ke,e as We,b7 as He,bb as Ue,r as p,d as Xe,bg as G,a0 as Ye,bh as qe,bi as H,ay as U,n as Be,bj as Je,bk as Ze,bl as Ge,bm as X,bn as Y,bo as q,bp as Le,bq as Qe,o as eo,q as L,aw as oo,ai as to,$ as ro,br as so,bs as no,s as Q,bt as ao,a1 as io,t as lo,v as co}from"./entry.r_sixgJG.js";import{n as po}from"./chunk.BjFrJKj1.js";import{u as fo}from"./chunk.CcRPc1V0.js";function uo(e,s={active:!0}){return typeof e!="function"||!s.active?s.onKeyDown||po:r=>{r.key==="Escape"&&(e(r),s.onTrigger?.())}}const[go,ee]=$e("Popover component was not found in the tree");var oe={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const z=T((e,s)=>{const r=P("PopoverDropdown",null,e),{className:t,style:i,vars:f,children:d,onKeyDownCapture:a,variant:n,classNames:w,styles:c,...u}=r,o=ee(),m=Me({opened:o.opened,shouldReturnFocus:o.returnFocus}),v=o.withRoles?{"aria-labelledby":o.getTargetId(),id:o.getDropdownId(),role:"dialog",tabIndex:-1}:{},b=B(s,o.floating);return o.disabled?null:g.jsx(J,{...o.portalProps,withinPortal:o.withinPortal,children:g.jsx(Z,{mounted:o.opened,...o.transitionProps,transition:o.transitionProps?.transition||"fade",duration:o.transitionProps?.duration??150,keepMounted:o.keepMounted,exitDuration:typeof o.transitionProps?.exitDuration=="number"?o.transitionProps.exitDuration:o.transitionProps?.duration,children:y=>g.jsx(Ae,{active:o.trapFocus&&o.opened,innerRef:b,children:g.jsxs(S,{...v,...u,variant:n,onKeyDownCapture:uo(()=>{o.onClose?.(),o.onDismiss?.()},{active:o.closeOnEscape,onTrigger:m,onKeyDown:a}),"data-position":o.placement,"data-fixed":o.floatingStrategy==="fixed"||void 0,...o.getStyles("dropdown",{className:t,props:r,classNames:w,styles:c,style:[{...y,zIndex:o.zIndex,top:o.y??0,left:o.x??0,width:o.width==="target"?void 0:We(o.width),...o.referenceHidden?{display:"none"}:null},o.resolvedStyles.dropdown,c?.dropdown,i]}),children:[d,g.jsx(Ke,{ref:o.arrowRef,arrowX:o.arrowX,arrowY:o.arrowY,visible:o.withArrow,position:o.placement,arrowSize:o.arrowSize,arrowRadius:o.arrowRadius,arrowOffset:o.arrowOffset,arrowPosition:o.arrowPosition,...o.getStyles("arrow",{props:r,classNames:w,styles:c})})]})})})})});z.classes=oe;z.displayName="@mantine/core/PopoverDropdown";const wo={refProp:"ref",popupType:"dialog"},te=T((e,s)=>{const{children:r,refProp:t,popupType:i,...f}=P("PopoverTarget",wo,e),d=He(r);if(!d)throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const a=f,n=ee(),w=B(n.reference,Ue(d),s),c=n.withRoles?{"aria-haspopup":i,"aria-expanded":n.opened,"aria-controls":n.getDropdownId(),id:n.getTargetId()}:{},u=d.props;return p.cloneElement(d,{...a,...c,...n.targetProps,className:Xe(n.targetProps.className,a.className,u.className),[t]:w,...n.controlled?null:{onClick:()=>{n.onToggle(),u.onClick?.()}}})});te.displayName="@mantine/core/PopoverTarget";function ho(e){if(e===void 0)return{shift:!0,flip:!0};const s={...e};return e.shift===void 0&&(s.shift=!0),e.flip===void 0&&(s.flip=!0),s}function mo(e,s,r){const t=ho(e.middlewares),i=[Je(e.offset),Ze()];return e.dropdownVisible&&r!=="test"&&e.preventPositionChangeWhenVisible&&(t.flip=!1),t.shift&&i.push(Ge(typeof t.shift=="boolean"?{limiter:X(),padding:5}:{limiter:X(),padding:5,...t.shift})),t.flip&&i.push(typeof t.flip=="boolean"?Y():Y(t.flip)),t.inline&&i.push(typeof t.inline=="boolean"?q():q(t.inline)),i.push(Le({element:e.arrowRef,padding:e.arrowOffset})),(t.size||e.width==="target")&&i.push(Qe({...typeof t.size=="boolean"?{}:t.size,apply({rects:f,availableWidth:d,availableHeight:a,...n}){const c=s().refs.floating.current?.style??{};t.size&&(typeof t.size=="object"&&t.size.apply?t.size.apply({rects:f,availableWidth:d,availableHeight:a,...n}):Object.assign(c,{maxWidth:`${d}px`,maxHeight:`${a}px`})),e.width==="target"&&Object.assign(c,{width:`${f.reference.width}px`})}})),i}function vo(e){const s=G(),[r,t]=Ye({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),i=p.useRef(r),f=()=>{r&&!e.disabled&&t(!1)},d=()=>{e.disabled||t(!r)},a=qe({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:mo(e,()=>a,s),whileElementsMounted:e.keepMounted?void 0:H});return p.useEffect(()=>{if(!(!a.refs.reference.current||!a.refs.floating.current)&&r)return H(a.refs.reference.current,a.refs.floating.current,a.update)},[r,a.update]),U(()=>{e.onPositionChange?.(a.placement),e.positionRef.current=a.placement},[a.placement,e.preventPositionChangeWhenVisible]),U(()=>{r!==i.current&&(r?e.onOpen?.():e.onClose?.()),i.current=r},[r,e.onClose,e.onOpen]),Be(()=>{let n=-1;return r&&(n=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(n)}},[r,e.position]),{floating:a,controlled:typeof e.opened=="boolean",opened:r,onClose:f,onToggle:d}}const bo={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:eo("popover"),__staticSelector:"Popover",width:"max-content"},yo=Q((e,{radius:s,shadow:r})=>({dropdown:{"--popover-radius":s===void 0?void 0:io(s),"--popover-shadow":ao(r)}}));function x(e){const s=P("Popover",bo,e),{children:r,position:t,offset:i,onPositionChange:f,positionDependencies:d,opened:a,transitionProps:n,onExitTransitionEnd:w,onEnterTransitionEnd:c,width:u,middlewares:o,withArrow:m,arrowSize:v,arrowOffset:b,arrowRadius:y,arrowPosition:ne,unstyled:N,classNames:D,styles:C,closeOnClickOutside:ae,withinPortal:j,portalProps:ie,closeOnEscape:le,clickOutsideEvents:de,trapFocus:ce,onClose:pe,onDismiss:R,onOpen:fe,onChange:ue,zIndex:ge,radius:we,shadow:he,id:me,defaultOpened:k,__staticSelector:F,withRoles:ve,disabled:I,returnFocus:be,variant:ye,keepMounted:V,vars:Pe,floatingStrategy:_,withOverlay:xe,overlayProps:O,hideDetached:De,attributes:Ce,preventPositionChangeWhenVisible:E,...Re}=s,$=L({name:F,props:s,classes:oe,classNames:D,styles:C,unstyled:N,attributes:Ce,rootSelector:"dropdown",vars:Pe,varsResolver:yo}),{resolvedStyles:Oe}=oo({classNames:D,styles:C,props:s}),[Ee,M]=p.useState(a??k??!1),A=p.useRef(t),K=p.useRef(null),[Se,Te]=p.useState(null),[ze,Ne]=p.useState(null),{dir:je}=to(),ke=G(),W=ro(me),l=vo({middlewares:o,width:u,position:so(je,t),offset:typeof i=="number"?i+(m?v/2:0):i,arrowRef:K,arrowOffset:b,onPositionChange:f,positionDependencies:d,opened:a,defaultOpened:k,onChange:ue,onOpen:fe,onClose:pe,onDismiss:R,strategy:_,dropdownVisible:Ee,setDropdownVisible:M,positionRef:A,disabled:I,preventPositionChangeWhenVisible:E,keepMounted:V});fo(()=>{ae&&(l.onClose(),R?.())},de,[Se,ze]);const Fe=p.useCallback(h=>{Te(h),l.floating.refs.setReference(h)},[l.floating.refs.setReference]),Ie=p.useCallback(h=>{Ne(h),l.floating.refs.setFloating(h)},[l.floating.refs.setFloating]),Ve=p.useCallback(()=>{n?.onExited?.(),w?.(),M(!1),E||(A.current=t)},[n?.onExited,w,E,t]),_e=p.useCallback(()=>{n?.onEntered?.(),c?.()},[n?.onEntered,c]);return g.jsxs(go,{value:{returnFocus:be,disabled:I,controlled:l.controlled,reference:Fe,floating:Ie,x:l.floating.x,y:l.floating.y,arrowX:l.floating?.middlewareData?.arrow?.x,arrowY:l.floating?.middlewareData?.arrow?.y,opened:l.opened,arrowRef:K,transitionProps:{...n,onExited:Ve,onEntered:_e},width:u,withArrow:m,arrowSize:v,arrowOffset:b,arrowRadius:y,arrowPosition:ne,placement:l.floating.placement,trapFocus:ce,withinPortal:j,portalProps:ie,zIndex:ge,radius:we,shadow:he,closeOnEscape:le,onDismiss:R,onClose:l.onClose,onToggle:l.onToggle,getTargetId:()=>`${W}-target`,getDropdownId:()=>`${W}-dropdown`,withRoles:ve,targetProps:Re,__staticSelector:F,classNames:D,styles:C,unstyled:N,variant:ye,keepMounted:V,getStyles:$,resolvedStyles:Oe,floatingStrategy:_,referenceHidden:De&&ke!=="test"?l.floating.middlewareData.hide?.referenceHidden:!1},children:[r,xe&&g.jsx(Z,{transition:"fade",mounted:l.opened,duration:n?.duration||250,exitDuration:n?.exitDuration||250,children:h=>g.jsx(J,{withinPortal:j,children:g.jsx(no,{...O,...$("overlay",{className:O?.className,style:[h,O?.style]})})})})]})}x.Target=te;x.Dropdown=z;x.displayName="@mantine/core/Popover";x.extend=e=>e;var re={root:"m_3eebeb36",label:"m_9e365f20"};const Po={orientation:"horizontal"},xo=Q((e,{color:s,variant:r,size:t})=>({root:{"--divider-color":s?co(s,e):void 0,"--divider-border-style":r,"--divider-size":lo(t,"divider-size")}})),se=T((e,s)=>{const r=P("Divider",Po,e),{classNames:t,className:i,style:f,styles:d,unstyled:a,vars:n,color:w,orientation:c,label:u,labelPosition:o,mod:m,attributes:v,...b}=r,y=L({name:"Divider",classes:re,props:r,className:i,style:f,classNames:t,styles:d,unstyled:a,attributes:v,vars:n,varsResolver:xo});return g.jsx(S,{ref:s,mod:[{orientation:c,"with-label":!!u},m],...y("root"),...b,role:"separator",children:u&&g.jsx(S,{component:"span",mod:{position:o},...y("label"),children:u})})});se.classes=re;se.displayName="@mantine/core/Divider";export{se as D,x as P};
@@ -1 +0,0 @@
1
- import{r as m,f as E,b as A,q as se,s as re,j as i,B as L,v as ee,t as oe,c as Eo,aB as me,b6 as jo,b7 as Ue,ag as ge,bb as Po,$ as fe,a0 as te,aI as He,e as Ce,ax as Ro,U as To,a1 as we,b5 as qe,aj as We,ak as Ze,aG as $o,ac as Vo,d as Mo,aw as Bo,a3 as Je,w as ye}from"./entry.r_sixgJG.js";import{I as zo,a as Fo,b as Lo}from"./chunk.VyCl7mMj.js";import{P as he}from"./chunk.AVmV_XG3.js";function Go(e){const o=m.useRef(void 0);return m.useEffect(()=>{o.current=e},[e]),o.current}function be(e,o=document){const t=o.querySelector(e);if(t)return t;const s=o.querySelectorAll("*");for(let r=0;r<s.length;r+=1){const a=s[r];if(a.shadowRoot){const n=be(e,a.shadowRoot);if(n)return n}}return null}function U(e,o=document){const t=[],s=o.querySelectorAll(e);t.push(...Array.from(s));const r=o.querySelectorAll("*");for(let a=0;a<r.length;a+=1){const n=r[a];if(n.shadowRoot){const l=U(e,n.shadowRoot);t.push(...l)}}return t}function H(e){if(!e)return document;const o=e.getRootNode();return o instanceof ShadowRoot||o instanceof Document?o:document}function Qe(e){return typeof e=="string"?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e=="number"?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(o=>Qe(o))}:e}function Ko(e){return e?e.map(o=>Qe(o)):[]}function Xe(e){return e.reduce((o,t)=>"group"in t?{...o,...Xe(t.items)}:(o[t.value]=t,o),{})}var P={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2",optionsDropdownCheckPlaceholder:"m_a530ee0a"};const Ho={error:null},Uo=re((e,{size:o,color:t})=>({chevron:{"--combobox-chevron-size":oe(o,"combobox-chevron-size"),"--combobox-chevron-color":t?ee(t,e):void 0}})),ke=E((e,o)=>{const t=A("ComboboxChevron",Ho,e),{size:s,error:r,style:a,className:n,classNames:l,styles:c,unstyled:d,vars:p,mod:u,...b}=t,x=se({name:"ComboboxChevron",classes:P,props:t,style:a,className:n,classNames:l,styles:c,unstyled:d,vars:p,varsResolver:Uo,rootSelector:"chevron"});return i.jsx(L,{component:"svg",...b,...x("chevron"),size:s,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:r},u],ref:o,children:i.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});ke.classes=P;ke.displayName="@mantine/core/ComboboxChevron";const[qo,M]=Eo("Combobox component was not found in tree"),Ye=m.forwardRef(({size:e,onMouseDown:o,onClick:t,onClear:s,...r},a)=>i.jsx(me.ClearButton,{ref:a,tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:n=>{n.preventDefault(),o?.(n)},onClick:n=>{s(),t?.(n)}}));Ye.displayName="@mantine/core/ComboboxClearButton";const Se=E((e,o)=>{const{classNames:t,styles:s,className:r,style:a,hidden:n,...l}=A("ComboboxDropdown",null,e),c=M();return i.jsx(he.Dropdown,{...l,ref:o,role:"presentation","data-hidden":n||void 0,...c.getStyles("dropdown",{className:r,style:a,classNames:t,styles:s})})});Se.classes=P;Se.displayName="@mantine/core/ComboboxDropdown";const Wo={refProp:"ref"},eo=E((e,o)=>{const{children:t,refProp:s}=A("ComboboxDropdownTarget",Wo,e);if(M(),!jo(t))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return i.jsx(he.Target,{ref:o,refProp:s,children:t})});eo.displayName="@mantine/core/ComboboxDropdownTarget";const Oe=E((e,o)=>{const{classNames:t,className:s,style:r,styles:a,vars:n,...l}=A("ComboboxEmpty",null,e),c=M();return i.jsx(L,{ref:o,...c.getStyles("empty",{className:s,classNames:t,styles:a,style:r}),...l})});Oe.classes=P;Oe.displayName="@mantine/core/ComboboxEmpty";function De({onKeyDown:e,withKeyboardNavigation:o,withAriaAttributes:t,withExpandedAttribute:s,targetType:r,autoComplete:a}){const n=M(),[l,c]=m.useState(null),d=u=>{if(e?.(u),!n.readOnly&&o){if(u.nativeEvent.isComposing)return;if(u.nativeEvent.code==="ArrowDown"&&(u.preventDefault(),n.store.dropdownOpened?c(n.store.selectNextOption()):(n.store.openDropdown("keyboard"),c(n.store.selectActiveOption()),n.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),u.nativeEvent.code==="ArrowUp"&&(u.preventDefault(),n.store.dropdownOpened?c(n.store.selectPreviousOption()):(n.store.openDropdown("keyboard"),c(n.store.selectActiveOption()),n.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),u.nativeEvent.code==="Enter"||u.nativeEvent.code==="NumpadEnter"){if(u.nativeEvent.keyCode===229)return;const b=n.store.getSelectedOptionIndex();n.store.dropdownOpened&&b!==-1?(u.preventDefault(),n.store.clickSelectedOption()):r==="button"&&(u.preventDefault(),n.store.openDropdown("keyboard"))}u.key==="Escape"&&n.store.closeDropdown("keyboard"),u.nativeEvent.code==="Space"&&r==="button"&&(u.preventDefault(),n.store.toggleDropdown("keyboard"))}};return{...t?{"aria-haspopup":"listbox","aria-expanded":s?!!(n.store.listId&&n.store.dropdownOpened):void 0,"aria-controls":n.store.dropdownOpened&&n.store.listId?n.store.listId:void 0,"aria-activedescendant":n.store.dropdownOpened&&l||void 0,autoComplete:a,"data-expanded":n.store.dropdownOpened||void 0,"data-mantine-stop-propagation":n.store.dropdownOpened||void 0}:{},onKeyDown:d}}const Zo={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},oo=E((e,o)=>{const{children:t,refProp:s,withKeyboardNavigation:r,withAriaAttributes:a,withExpandedAttribute:n,targetType:l,autoComplete:c,...d}=A("ComboboxEventsTarget",Zo,e),p=Ue(t);if(!p)throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=M(),b=De({targetType:l,withAriaAttributes:a,withKeyboardNavigation:r,withExpandedAttribute:n,onKeyDown:p.props.onKeyDown,autoComplete:c});return m.cloneElement(p,{...b,...d,[s]:ge(o,u.store.targetRef,Po(p))})});oo.displayName="@mantine/core/ComboboxEventsTarget";const _e=E((e,o)=>{const{classNames:t,className:s,style:r,styles:a,vars:n,...l}=A("ComboboxFooter",null,e),c=M();return i.jsx(L,{ref:o,...c.getStyles("footer",{className:s,classNames:t,style:r,styles:a}),...l,onMouseDown:d=>{d.preventDefault()}})});_e.classes=P;_e.displayName="@mantine/core/ComboboxFooter";const Ne=E((e,o)=>{const{classNames:t,className:s,style:r,styles:a,vars:n,children:l,label:c,id:d,...p}=A("ComboboxGroup",null,e),u=M(),b=fe(d);return i.jsxs(L,{ref:o,role:"group","aria-labelledby":c?b:void 0,...u.getStyles("group",{className:s,classNames:t,style:r,styles:a}),...p,children:[c&&i.jsx("div",{id:b,...u.getStyles("groupLabel",{classNames:t,styles:a}),children:c}),l]})});Ne.classes=P;Ne.displayName="@mantine/core/ComboboxGroup";const Ie=E((e,o)=>{const{classNames:t,className:s,style:r,styles:a,vars:n,...l}=A("ComboboxHeader",null,e),c=M();return i.jsx(L,{ref:o,...c.getStyles("header",{className:s,classNames:t,style:r,styles:a}),...l,onMouseDown:d=>{d.preventDefault()}})});Ie.classes=P;Ie.displayName="@mantine/core/ComboboxHeader";function to({value:e,valuesDivider:o=",",...t}){return i.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(o):e||"",...t})}to.displayName="@mantine/core/ComboboxHiddenInput";const Ae=E((e,o)=>{const t=A("ComboboxOption",null,e),{classNames:s,className:r,style:a,styles:n,vars:l,onClick:c,id:d,active:p,onMouseDown:u,onMouseOver:b,disabled:x,selected:k,mod:g,...w}=t,S=M(),D=m.useId(),_=d||D;return i.jsx(L,{...S.getStyles("option",{className:r,classNames:s,styles:n,style:a}),...w,ref:o,id:_,mod:["combobox-option",{"combobox-active":p,"combobox-disabled":x,"combobox-selected":k},g],role:"option",onClick:h=>{x?h.preventDefault():(S.onOptionSubmit?.(t.value,t),c?.(h))},onMouseDown:h=>{h.preventDefault(),u?.(h)},onMouseOver:h=>{S.resetSelectionOnOptionHover&&S.store.resetSelectedOption(),b?.(h)}})});Ae.classes=P;Ae.displayName="@mantine/core/ComboboxOption";const Ee=E((e,o)=>{const t=A("ComboboxOptions",null,e),{classNames:s,className:r,style:a,styles:n,id:l,onMouseDown:c,labelledBy:d,...p}=t,u=M(),b=fe(l);return m.useEffect(()=>{u.store.setListId(b)},[b]),i.jsx(L,{ref:o,...u.getStyles("options",{className:r,style:a,classNames:s,styles:n}),...p,id:b,role:"listbox","aria-labelledby":d,onMouseDown:x=>{x.preventDefault(),c?.(x)}})});Ee.classes=P;Ee.displayName="@mantine/core/ComboboxOptions";const Jo={withAriaAttributes:!0,withKeyboardNavigation:!0},je=E((e,o)=>{const t=A("ComboboxSearch",Jo,e),{classNames:s,styles:r,unstyled:a,vars:n,withAriaAttributes:l,onKeyDown:c,withKeyboardNavigation:d,size:p,...u}=t,b=M(),x=b.getStyles("search"),k=De({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:d,withExpandedAttribute:!1,onKeyDown:c,autoComplete:"off"});return i.jsx(me,{ref:ge(o,b.store.searchRef),classNames:[{input:x.className},s],styles:[{input:x.style},r],size:p||b.size,...k,...u,__staticSelector:"Combobox"})});je.classes=P;je.displayName="@mantine/core/ComboboxSearch";const Qo={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},no=E((e,o)=>{const{children:t,refProp:s,withKeyboardNavigation:r,withAriaAttributes:a,withExpandedAttribute:n,targetType:l,autoComplete:c,...d}=A("ComboboxTarget",Qo,e),p=Ue(t);if(!p)throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const u=M(),b=De({targetType:l,withAriaAttributes:a,withKeyboardNavigation:r,withExpandedAttribute:n,onKeyDown:p.props.onKeyDown,autoComplete:c}),x=m.cloneElement(p,{...b,...d});return i.jsx(he.Target,{ref:ge(o,u.store.targetRef),children:x})});no.displayName="@mantine/core/ComboboxTarget";function Xo(e,o,t){for(let s=e-1;s>=0;s-=1)if(!o[s].hasAttribute("data-combobox-disabled"))return s;if(t){for(let s=o.length-1;s>-1;s-=1)if(!o[s].hasAttribute("data-combobox-disabled"))return s}return e}function Yo(e,o,t){for(let s=e+1;s<o.length;s+=1)if(!o[s].hasAttribute("data-combobox-disabled"))return s;if(t){for(let s=0;s<o.length;s+=1)if(!o[s].hasAttribute("data-combobox-disabled"))return s}return e}function et(e){for(let o=0;o<e.length;o+=1)if(!e[o].hasAttribute("data-combobox-disabled"))return o;return-1}function so({defaultOpened:e,opened:o,onOpenedChange:t,onDropdownClose:s,onDropdownOpen:r,loop:a=!0,scrollBehavior:n="instant"}={}){const[l,c]=te({value:o,defaultValue:e,finalValue:!1,onChange:t}),d=m.useRef(null),p=m.useRef(-1),u=m.useRef(null),b=m.useRef(null),x=m.useRef(-1),k=m.useRef(-1),g=m.useRef(-1),w=m.useCallback((f="unknown")=>{l||(c(!0),r?.(f))},[c,r,l]),S=m.useCallback((f="unknown")=>{l&&(c(!1),s?.(f))},[c,s,l]),D=m.useCallback((f="unknown")=>{l?S(f):w(f)},[S,w,l]),_=m.useCallback(()=>{const f=H(b.current),O=be(`#${d.current} [data-combobox-selected]`,f);O?.removeAttribute("data-combobox-selected"),O?.removeAttribute("aria-selected")},[]),h=m.useCallback(f=>{const O=H(b.current),z=be(`#${d.current}`,O),N=z?U("[data-combobox-option]",z):null;if(!N)return null;const I=f>=N.length?0:f<0?N.length-1:f;return p.current=I,N?.[I]&&!N[I].hasAttribute("data-combobox-disabled")?(_(),N[I].setAttribute("data-combobox-selected","true"),N[I].setAttribute("aria-selected","true"),N[I].scrollIntoView({block:"nearest",behavior:n}),N[I].id):null},[n,_]),C=m.useCallback(()=>{const f=H(b.current),O=be(`#${d.current} [data-combobox-active]`,f);if(O){const N=U(`#${d.current} [data-combobox-option]`,f).findIndex(I=>I===O);return h(N)}return h(0)},[h]),j=m.useCallback(()=>{const f=H(b.current),O=U(`#${d.current} [data-combobox-option]`,f);return h(Yo(p.current,O,a))},[h,a]),R=m.useCallback(()=>{const f=H(b.current),O=U(`#${d.current} [data-combobox-option]`,f);return h(Xo(p.current,O,a))},[h,a]),ce=m.useCallback(()=>{const f=H(b.current),O=U(`#${d.current} [data-combobox-option]`,f);return h(et(O))},[h]),J=m.useCallback((f="selected",O)=>{g.current=window.setTimeout(()=>{const z=H(b.current),N=U(`#${d.current} [data-combobox-option]`,z),I=N.findIndex(Y=>Y.hasAttribute(`data-combobox-${f}`));p.current=I,O?.scrollIntoView&&N[I]?.scrollIntoView({block:"nearest",behavior:n})},0)},[]),le=m.useCallback(()=>{p.current=-1,_()},[_]),q=m.useCallback(()=>{const f=H(b.current);U(`#${d.current} [data-combobox-option]`,f)?.[p.current]?.click()},[]),B=m.useCallback(f=>{d.current=f},[]),Q=m.useCallback(()=>{x.current=window.setTimeout(()=>u.current?.focus(),0)},[]),K=m.useCallback(()=>{k.current=window.setTimeout(()=>b.current?.focus(),0)},[]),X=m.useCallback(()=>p.current,[]);return m.useEffect(()=>()=>{window.clearTimeout(x.current),window.clearTimeout(k.current),window.clearTimeout(g.current)},[]),{dropdownOpened:l,openDropdown:w,closeDropdown:S,toggleDropdown:D,selectedOptionIndex:p.current,getSelectedOptionIndex:X,selectOption:h,selectFirstOption:ce,selectActiveOption:C,selectNextOption:j,selectPreviousOption:R,resetSelectedOption:le,updateSelectedOptionIndex:J,listId:d.current,setListId:B,clickSelectedOption:q,searchRef:u,focusSearchInput:Q,targetRef:b,focusTarget:K}}const ot={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},tt=re((e,{size:o,dropdownPadding:t})=>({options:{"--combobox-option-fz":He(o),"--combobox-option-padding":oe(o,"combobox-option-padding")},dropdown:{"--combobox-padding":t===void 0?void 0:Ce(t),"--combobox-option-fz":He(o),"--combobox-option-padding":oe(o,"combobox-option-padding")}}));function v(e){const o=A("Combobox",ot,e),{classNames:t,styles:s,unstyled:r,children:a,store:n,vars:l,onOptionSubmit:c,onClose:d,size:p,dropdownPadding:u,resetSelectionOnOptionHover:b,__staticSelector:x,readOnly:k,attributes:g,...w}=o,S=so(),D=n||S,_=se({name:x||"Combobox",classes:P,props:o,classNames:t,styles:s,unstyled:r,attributes:g,vars:l,varsResolver:tt}),h=()=>{d?.(),D.closeDropdown()};return i.jsx(qo,{value:{getStyles:_,store:D,onOptionSubmit:c,size:p,resetSelectionOnOptionHover:b,readOnly:k},children:i.jsx(he,{opened:D.dropdownOpened,preventPositionChangeWhenVisible:!0,...w,onChange:C=>!C&&h(),withRoles:!1,unstyled:r,children:a})})}const nt=e=>e;v.extend=nt;v.classes=P;v.displayName="@mantine/core/Combobox";v.Target=no;v.Dropdown=Se;v.Options=Ee;v.Option=Ae;v.Search=je;v.Empty=Oe;v.Chevron=ke;v.Footer=_e;v.Header=Ie;v.EventsTarget=oo;v.DropdownTarget=eo;v.Group=Ne;v.ClearButton=Ye;v.HiddenInput=to;const ro=m.createContext(null),st=ro.Provider,ao=()=>m.useContext(ro),[rt,at]=Ro();var co={card:"m_26775b0a"};const ct={withBorder:!0},lt=re((e,{radius:o})=>({card:{"--card-radius":we(o)}})),Pe=E((e,o)=>{const t=A("CheckboxCard",ct,e),{classNames:s,className:r,style:a,styles:n,unstyled:l,vars:c,checked:d,mod:p,withBorder:u,value:b,onClick:x,defaultChecked:k,onChange:g,attributes:w,...S}=t,D=se({name:"CheckboxCard",classes:co,props:t,className:r,style:a,classNames:s,styles:n,unstyled:l,attributes:w,vars:c,varsResolver:lt,rootSelector:"card"}),_=ao(),h=typeof d=="boolean"?d:_?_.value.includes(b||""):void 0,[C,j]=te({value:h,defaultValue:k,finalValue:!1,onChange:g});return i.jsx(rt,{value:{checked:C},children:i.jsx(To,{ref:o,mod:[{"with-border":u,checked:C},p],...D("card"),...S,role:"checkbox","aria-checked":C,onClick:R=>{x?.(R),_?.onChange(b||""),j(!C)}})})});Pe.displayName="@mantine/core/CheckboxCard";Pe.classes=co;const Re=E((e,o)=>{const{value:t,defaultValue:s,onChange:r,size:a,wrapperProps:n,children:l,readOnly:c,disabled:d,...p}=A("CheckboxGroup",null,e),[u,b]=te({value:t,defaultValue:s,finalValue:[],onChange:r}),x=k=>{const g=typeof k=="string"?k:k.currentTarget.value;!c&&b(u.includes(g)?u.filter(w=>w!==g):[...u,g])};return i.jsx(st,{value:{value:u,onChange:x,size:a,disabled:d},children:i.jsx(me.Wrapper,{size:a,ref:o,...n,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:i.jsx(zo,{role:"group",children:l})})})});Re.classes=me.Wrapper.classes;Re.displayName="@mantine/core/CheckboxGroup";function lo({size:e,style:o,...t}){const s=e!==void 0?{width:Ce(e),height:Ce(e),...o}:o;return i.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:s,"aria-hidden":!0,...t,children:i.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function io({indeterminate:e,...o}){return e?i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...o,children:i.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):i.jsx(lo,{...o})}var uo={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const it={icon:io,variant:"filled"},dt=re((e,{radius:o,color:t,size:s,iconColor:r,variant:a,autoContrast:n})=>{const l=qe({color:t||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--checkbox-size":oe(s,"checkbox-size"),"--checkbox-radius":o===void 0?void 0:we(o),"--checkbox-color":a==="outline"?c:ee(t,e),"--checkbox-icon-color":r?ee(r,e):Ze(n,e)?We({color:t,theme:e,autoContrast:n}):void 0}}}),Te=E((e,o)=>{const t=A("CheckboxIndicator",it,e),{classNames:s,className:r,style:a,styles:n,unstyled:l,vars:c,icon:d,indeterminate:p,radius:u,color:b,iconColor:x,autoContrast:k,checked:g,mod:w,variant:S,disabled:D,attributes:_,...h}=t,C=se({name:"CheckboxIndicator",classes:uo,props:t,className:r,style:a,classNames:s,styles:n,unstyled:l,attributes:_,vars:c,varsResolver:dt,rootSelector:"indicator"}),j=at(),R=typeof g=="boolean"||typeof p=="boolean"?g||p:j?.checked||!1;return i.jsx(L,{ref:o,...C("indicator",{variant:S}),variant:S,mod:[{checked:R,disabled:D},w],...h,children:i.jsx(d,{indeterminate:p,...C("icon")})})});Te.displayName="@mantine/core/CheckboxIndicator";Te.classes=uo;var po={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const ut={labelPosition:"right",icon:io,variant:"filled"},pt=re((e,{radius:o,color:t,size:s,iconColor:r,variant:a,autoContrast:n})=>{const l=qe({color:t||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--checkbox-size":oe(s,"checkbox-size"),"--checkbox-radius":o===void 0?void 0:we(o),"--checkbox-color":a==="outline"?c:ee(t,e),"--checkbox-icon-color":r?ee(r,e):Ze(n,e)?We({color:t,theme:e,autoContrast:n}):void 0}}}),ae=E((e,o)=>{const t=A("Checkbox",ut,e),{classNames:s,className:r,style:a,styles:n,unstyled:l,vars:c,color:d,label:p,id:u,size:b,radius:x,wrapperProps:k,checked:g,labelPosition:w,description:S,error:D,disabled:_,variant:h,indeterminate:C,icon:j,rootRef:R,iconColor:ce,onChange:J,autoContrast:le,mod:q,attributes:B,...Q}=t,K=ao(),X=b||K?.size,f=se({name:"Checkbox",props:t,classes:po,className:r,style:a,classNames:s,styles:n,unstyled:l,attributes:B,vars:c,varsResolver:pt}),{styleProps:O,rest:z}=$o(Q),N=fe(u),I={checked:K?.value.includes(z.value)??g,onChange:ie=>{K?.onChange(ie),J?.(ie)},disabled:K?.disabled??_},Y=m.useRef(null),F=o||Y;return m.useEffect(()=>{F&&"current"in F&&F.current&&(F.current.indeterminate=C||!1,C?F.current.setAttribute("data-indeterminate","true"):F.current.removeAttribute("data-indeterminate"))},[C,F]),i.jsx(Fo,{...f("root"),__staticSelector:"Checkbox",__stylesApiProps:t,id:N,size:X,labelPosition:w,label:p,description:S,error:D,disabled:I.disabled,classNames:s,styles:n,unstyled:l,"data-checked":I.checked||g||void 0,variant:h,ref:R,mod:q,...O,...k,children:i.jsxs(L,{...f("inner"),mod:{"data-label-position":w},children:[i.jsx(L,{component:"input",id:N,ref:F,mod:{error:!!D},...f("input",{focusable:!0,variant:h}),...z,...I,type:"checkbox"}),i.jsx(j,{indeterminate:C,...f("icon")})]})})});ae.classes={...po,...Lo};ae.displayName="@mantine/core/Checkbox";ae.Group=Re;ae.Indicator=Te;ae.Card=Pe;function ne(e){return"group"in e}function bo({options:e,search:o,limit:t}){const s=o.trim().toLowerCase(),r=[];for(let a=0;a<e.length;a+=1){const n=e[a];if(r.length===t)return r;ne(n)&&r.push({group:n.group,items:bo({options:n.items,search:o,limit:t-r.length})}),ne(n)||n.label.toLowerCase().includes(s)&&r.push(n)}return r}function bt(e){if(e.length===0)return!0;for(const o of e)if(!("group"in o)||o.items.length>0)return!1;return!0}function mo(e,o=new Set){if(Array.isArray(e))for(const t of e)if(ne(t))mo(t.items,o);else{if(typeof t.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof t.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof t.value}`);if(o.has(t.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${t.value}" was provided more than once`);o.add(t.value)}}function mt(e,o){return Array.isArray(e)?e.includes(o):e===o}function fo({data:e,withCheckIcon:o,withAlignedLabels:t,value:s,checkIconPosition:r,unstyled:a,renderOption:n}){if(!ne(e)){const c=mt(s,e.value),d=o&&(c?i.jsx(lo,{className:P.optionsDropdownCheckIcon}):t?i.jsx("div",{className:P.optionsDropdownCheckPlaceholder}):null),p=i.jsxs(i.Fragment,{children:[r==="left"&&d,i.jsx("span",{children:e.label}),r==="right"&&d]});return i.jsx(v.Option,{value:e.value,disabled:e.disabled,className:Mo({[P.optionsDropdownOption]:!a}),"data-reverse":r==="right"||void 0,"data-checked":c||void 0,"aria-selected":c,active:c,children:typeof n=="function"?n({option:e,checked:c}):p})}const l=e.items.map(c=>i.jsx(fo,{data:c,value:s,unstyled:a,withCheckIcon:o,withAlignedLabels:t,checkIconPosition:r,renderOption:n},c.value));return i.jsx(v.Group,{label:e.group,children:l})}function ft({data:e,hidden:o,hiddenWhenEmpty:t,filter:s,search:r,limit:a,maxDropdownHeight:n,withScrollArea:l=!0,filterOptions:c=!0,withCheckIcon:d=!1,withAlignedLabels:p=!1,value:u,checkIconPosition:b,nothingFoundMessage:x,unstyled:k,labelId:g,renderOption:w,scrollAreaProps:S,"aria-label":D}){mo(e);const h=typeof r=="string"?(s||bo)({options:e,search:c?r:"",limit:a??1/0}):e,C=bt(h),j=h.map(R=>i.jsx(fo,{data:R,withCheckIcon:d,withAlignedLabels:p,value:u,checkIconPosition:b,unstyled:k,renderOption:w},ne(R)?R.group:R.value));return i.jsx(v.Dropdown,{hidden:o||t&&C,"data-composed":!0,children:i.jsxs(v.Options,{labelledBy:g,"aria-label":D,children:[l?i.jsx(Vo.Autosize,{mah:n??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...S,children:j}):j,C&&x&&i.jsx(v.Empty,{children:x})]})})}const ht={withCheckIcon:!0,allowDeselect:!0,checkIconPosition:"left"},ho=E((e,o)=>{const t=A("Select",ht,e),{classNames:s,styles:r,unstyled:a,vars:n,dropdownOpened:l,defaultDropdownOpened:c,onDropdownClose:d,onDropdownOpen:p,onFocus:u,onBlur:b,onClick:x,onChange:k,data:g,value:w,defaultValue:S,selectFirstOptionOnChange:D,onOptionSubmit:_,comboboxProps:h,readOnly:C,disabled:j,filter:R,limit:ce,withScrollArea:J,maxDropdownHeight:le,size:q,searchable:B,rightSection:Q,checkIconPosition:K,withCheckIcon:X,withAlignedLabels:f,nothingFoundMessage:O,name:z,form:N,searchValue:I,defaultSearchValue:Y,onSearchChange:F,allowDeselect:ie,error:$e,rightSectionPointerEvents:xo,id:vo,clearable:Co,clearButtonProps:go,hiddenInputProps:wo,renderOption:yo,onClear:ko,autoComplete:So,scrollAreaProps:Oo,__defaultRightSection:gt,__clearSection:wt,__clearable:yt,chevronColor:Do,autoSelectOnBlur:Ve,attributes:Me,...de}=t,xe=m.useMemo(()=>Ko(g),[g]),ue=m.useRef({}),$=m.useMemo(()=>Xe(xe),[xe]),Be=fe(vo),[y,ze,Fe]=te({value:w,defaultValue:S,finalValue:null,onChange:k}),G=typeof y=="string"?y in $?$[y]:ue.current[y]:void 0,Le=Go(G),[pe,_o,No]=te({value:I,defaultValue:Y,finalValue:G?G.label:"",onChange:F}),V=so({opened:l,defaultOpened:c,onDropdownOpen:()=>{p?.(),V.updateSelectedOptionIndex("active",{scrollIntoView:!0})},onDropdownClose:()=>{d?.(),setTimeout(V.resetSelectedOption,0)}}),W=T=>{_o(T),V.resetSelectedOption()},{resolvedClassNames:Ge,resolvedStyles:Ke}=Bo({props:t,styles:r,classNames:s});m.useEffect(()=>{D&&V.selectFirstOption()},[D,pe]),m.useEffect(()=>{w===null&&W(""),typeof w=="string"&&G&&(Le?.value!==G.value||Le?.label!==G.label)&&W(G.label)},[w,G]),m.useEffect(()=>{!Fe&&!No&&W(typeof y=="string"?y in $?$[y]?.label:ue.current[y]?.label||"":"")},[$,y]),m.useEffect(()=>{y&&y in $&&(ue.current[y]=$[y])},[$,y]);const Io=i.jsx(v.ClearButton,{...go,onClear:()=>{ze(null,null),W(""),ko?.()}}),Ao=Co&&!!y&&!j&&!C;return i.jsxs(i.Fragment,{children:[i.jsxs(v,{store:V,__staticSelector:"Select",classNames:Ge,styles:Ke,unstyled:a,readOnly:C,size:q,attributes:Me,keepMounted:Ve,onOptionSubmit:T=>{_?.(T);const Z=ie&&$[T].value===y?null:$[T],ve=Z?Z.value:null;ve!==y&&ze(ve,Z),!Fe&&W(typeof ve=="string"&&Z?.label||""),V.closeDropdown()},...h,children:[i.jsx(v.Target,{targetType:B?"input":"button",autoComplete:So,children:i.jsx(Je,{id:Be,ref:o,__defaultRightSection:i.jsx(v.Chevron,{size:q,error:$e,unstyled:a,color:Do}),__clearSection:Io,__clearable:Ao,rightSection:Q,rightSectionPointerEvents:xo||"none",...de,size:q,__staticSelector:"Select",disabled:j,readOnly:C||!B,value:pe,onChange:T=>{W(T.currentTarget.value),V.openDropdown(),D&&V.selectFirstOption()},onFocus:T=>{B&&V.openDropdown(),u?.(T)},onBlur:T=>{Ve&&V.clickSelectedOption(),B&&V.closeDropdown();const Z=typeof y=="string"&&(y in $?$[y]:ue.current[y]);W(Z&&Z.label||""),b?.(T)},onClick:T=>{B?V.openDropdown():V.toggleDropdown(),x?.(T)},classNames:Ge,styles:Ke,unstyled:a,pointer:!B,error:$e,attributes:Me})}),i.jsx(ft,{data:xe,hidden:C||j,filter:R,search:pe,limit:ce,hiddenWhenEmpty:!O,withScrollArea:J,maxDropdownHeight:le,filterOptions:!!B&&G?.label!==pe,value:y,checkIconPosition:K,withCheckIcon:X,withAlignedLabels:f,nothingFoundMessage:O,unstyled:a,labelId:de.label?`${Be}-label`:void 0,"aria-label":de.label?void 0:de["aria-label"],renderOption:yo,scrollAreaProps:Oo})]}),i.jsx(v.HiddenInput,{value:y,name:z,form:N,disabled:j,...wo})]})});ho.classes={...Je.classes,...v.classes};ho.displayName="@mantine/core/Select";const xt=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]],Dt=ye("outline","arrow-down","ArrowDown",xt);const vt=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],_t=ye("outline","arrow-up","ArrowUp",vt);const Ct=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],Nt=ye("outline","plus","Plus",Ct);export{ae as C,Dt as I,ft as O,ho as S,_t as a,Nt as b,Xe as c,v as d,lo as e,Ko as g,ne as i,so as u};
@@ -1 +0,0 @@
1
- import{w as e}from"./entry.r_sixgJG.js";const o=[["path",{d:"M5 7l5 5l-5 5",key:"svg-0"}],["path",{d:"M12 19l7 0",key:"svg-1"}]],n=e("outline","terminal","Terminal",o);export{n as I};