@tangle-network/sandbox-cli 0.21.64 → 0.21.65

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 (136) hide show
  1. package/README.md +31 -3
  2. package/SKILL.md +29 -1
  3. package/dist/graph-native-CS_TmaCK.mjs +1 -0
  4. package/dist/graph-viewer/Analytics-bWsqhurt.js +1001 -0
  5. package/dist/graph-viewer/{AnswerStrip-DhwqOyxI.js → AnswerStrip-COxV7gLW.js} +2 -2
  6. package/dist/graph-viewer/Checks-CQGmKcQ0.js +164 -0
  7. package/dist/graph-viewer/Conversations-DgCshBAf.js +627 -0
  8. package/dist/graph-viewer/{Files-DtZhf0ii.js → Files-CvIOGrAs.js} +81 -90
  9. package/dist/graph-viewer/LiveRun-DHmsr6F7.js +311 -0
  10. package/dist/graph-viewer/{Outputs-QET3nPPp.js → Outputs-rwBg_x36.js} +4 -4
  11. package/dist/graph-viewer/Overview-C150tkVa.js +194 -0
  12. package/dist/graph-viewer/{RunOverview-DJQDAMIx.js → RunOverview-CSqsunqf.js} +2 -2
  13. package/dist/graph-viewer/RunPage-F_prVwiV.js +286 -0
  14. package/dist/graph-viewer/Timeline-BFDywlmz.js +335 -0
  15. package/dist/graph-viewer/Today-BdDuqZGF.js +623 -0
  16. package/dist/graph-viewer/Topology-SAfGtd5u.js +238 -0
  17. package/dist/graph-viewer/Traces-BYqXaS_s.js +254 -0
  18. package/dist/graph-viewer/{WallPages-4d9QUZDq.js → WallPages-MM70VZrC.js} +48 -30
  19. package/dist/graph-viewer/agent-runtime.js +55 -55
  20. package/dist/graph-viewer/{data-BJmP7F1M.js → data-DTGmre1W.js} +31 -27
  21. package/dist/graph-viewer/harness-sessions.js +1 -1
  22. package/dist/graph-viewer/index.js +1357 -1392
  23. package/dist/graph-viewer/{lazy-pages-DM0cZM10.js → lazy-pages-BYuq_L_n.js} +9 -5
  24. package/dist/graph-viewer/{outputs-model-CGdvjkQh.js → outputs-model-CHTx8rMz.js} +2 -2
  25. package/dist/graph-viewer/{viewer/plain-words-CgvxtEOa.js → plain-words-BrMHl0On.js} +9 -4
  26. package/dist/graph-viewer/receipt.js +2 -2
  27. package/dist/graph-viewer/record-CsP_3NJS.js +612 -0
  28. package/dist/graph-viewer/record-part-CuT9Xw37.js +334 -0
  29. package/dist/graph-viewer/record.js +2 -336
  30. package/dist/graph-viewer/report-viewer.js +65 -65
  31. package/dist/graph-viewer/report.js +1 -1
  32. package/dist/graph-viewer/research-publication.js +1 -1
  33. package/dist/graph-viewer/{run-files-C1NgzM0l.js → run-files-BckQDdTD.js} +1 -1
  34. package/dist/graph-viewer/{run-receipt-Bvi4-KVM.js → run-receipt-Bt2iXJUy.js} +1 -0
  35. package/dist/graph-viewer/schemas/agent-workspace.play.v1.json +3 -0
  36. package/dist/graph-viewer/schemas/agent-workspace.plays.v1.json +2 -0
  37. package/dist/graph-viewer/schemas/agent-workspace.run.v1.json +1 -0
  38. package/dist/graph-viewer/styles.css +4559 -2385
  39. package/dist/graph-viewer/trace-spans.js +1 -1
  40. package/dist/graph-viewer/ui-xa5w5bEN.js +889 -0
  41. package/dist/graph-viewer/viewer/{AgentGraphCanvas-CMdOlSlh-4EervjeC.js → AgentGraphCanvas-B74GN1o6-BZEumF7-.js} +2610 -2707
  42. package/dist/graph-viewer/viewer/Analytics-E3XS570U.js +1002 -0
  43. package/dist/graph-viewer/viewer/{AnswerStrip-CGUyXuYH.js → AnswerStrip-B7xMU57A.js} +2 -2
  44. package/dist/graph-viewer/viewer/Checks-CJ5XSHbv.js +165 -0
  45. package/dist/graph-viewer/viewer/Conversations-AX8G7Qyl.js +904 -0
  46. package/dist/graph-viewer/viewer/Files-DxL1576V.js +630 -0
  47. package/dist/graph-viewer/viewer/LiveRun-B-BckyEj.js +820 -0
  48. package/dist/graph-viewer/viewer/{Outputs-CumGyjQo.js → Outputs-BoIpgfMv.js} +24 -23
  49. package/dist/graph-viewer/viewer/Overview-Dzg5XJgy.js +436 -0
  50. package/dist/graph-viewer/viewer/RunPage-NtevWXBs.js +285 -0
  51. package/dist/graph-viewer/viewer/{Scores-ZS16yk0n.js → Scores-Dgv4WePL.js} +3 -3
  52. package/dist/graph-viewer/viewer/Timeline-CzY3LVDu.js +335 -0
  53. package/dist/graph-viewer/viewer/Today-Bi9IIwuh.js +623 -0
  54. package/dist/graph-viewer/viewer/Topology-CzjqSFXH.js +239 -0
  55. package/dist/graph-viewer/viewer/Traces-CMX0H1VU.js +254 -0
  56. package/dist/graph-viewer/viewer/{WallPages-CzWpyIfp.js → WallPages-Clj4bORg.js} +50 -32
  57. package/dist/graph-viewer/viewer/addon-webgl-BSCscllv.js +4027 -0
  58. package/dist/graph-viewer/viewer/agent-record-BrP-ENHg.css +2 -0
  59. package/dist/graph-viewer/viewer/{bot-D6Nrej7Z.js → bot-BaQU59LG.js} +1 -1
  60. package/dist/graph-viewer/viewer/{chevron-right-D_5IKLxu.js → chevron-right-Xn05jYLT.js} +1 -1
  61. package/dist/graph-viewer/viewer/{createLucideIcon-yH0cxLMy.js → createLucideIcon-BSphcoOJ.js} +1 -1
  62. package/dist/graph-viewer/viewer/dashboard-D3JhmRhe-DSl0zhkw.js +371 -0
  63. package/dist/graph-viewer/viewer/{data-CkWfWr7i.js → data-CVHeKhrh.js} +144 -139
  64. package/dist/graph-viewer/viewer/dist-4_KJz8ZM.js +349 -0
  65. package/dist/graph-viewer/viewer/dist-Dy-wrdTt.js +1615 -0
  66. package/dist/graph-viewer/viewer/es2015-utW4DTOJ.js +3506 -0
  67. package/dist/graph-viewer/viewer/{final-output-kwY11u9X.js → final-output-BYT-g-9j.js} +1 -1
  68. package/dist/graph-viewer/viewer/flow-waterfall-model-DvrgPLGS-BdThSFH-.js +2696 -0
  69. package/dist/graph-viewer/viewer/git-branch-BzTbIcYL.js +28 -0
  70. package/dist/graph-viewer/viewer/{highlights-Btsi5OXl.js → highlights-DWeSCtiR.js} +4 -4
  71. package/dist/graph-viewer/viewer/jsx-runtime-DPT6sCLq.js +319 -0
  72. package/dist/graph-viewer/viewer/lazy-pages-ChiMJ8r_.js +803 -0
  73. package/dist/graph-viewer/viewer/{markdown-CX_sVrXB.js → markdown-lADwhD7y.js} +2324 -2608
  74. package/dist/graph-viewer/viewer/model-brand-bTcMjQtB-RSb7EbGB.js +476 -0
  75. package/dist/graph-viewer/viewer/{page-header-Brq611fd.js → page-header-QbUg8F8i.js} +12 -11
  76. package/dist/graph-viewer/{plain-words-CgvxtEOa.js → viewer/plain-words-BrMHl0On.js} +9 -4
  77. package/dist/graph-viewer/viewer/primitives-znfPK9NP-B6UO7uDr.js +346 -0
  78. package/dist/graph-viewer/viewer/react-DQ7E2Epi.js +4254 -0
  79. package/dist/graph-viewer/viewer/{react-dom-t1L4_-il.js → react-dom-BEusmvQH.js} +1 -1
  80. package/dist/graph-viewer/viewer/record-DZnT6SWN-H-ul3U3a.js +3523 -0
  81. package/dist/graph-viewer/viewer/record-W39D5MO-.js +1 -0
  82. package/dist/graph-viewer/viewer/record-part-CbweyYoV.js +335 -0
  83. package/dist/graph-viewer/viewer/{segmented-control-BaJmvTNd.js → segmented-control-Di1mbQlP.js} +27 -26
  84. package/dist/graph-viewer/viewer/{shiki-Qnby7Sh6.js → shiki-BfNNlmfZ.js} +15 -15
  85. package/dist/graph-viewer/viewer/status-meta-S0kV_RDp.js +273 -0
  86. package/dist/graph-viewer/viewer/{stream-tokenizer-CWtnjmRd.js → stream-tokenizer-B5wWaM3U.js} +12 -12
  87. package/dist/graph-viewer/viewer/{themes-1i1fzpRk.js → themes-DuRxHiga.js} +1 -1
  88. package/dist/graph-viewer/viewer/ui-Co03nZUX.js +889 -0
  89. package/dist/graph-viewer/viewer/utils-BuObIC0n.js +1815 -0
  90. package/dist/graph-viewer/viewer/workbench-E6_5q_oL.js +28351 -0
  91. package/dist/graph-viewer/viewer/workflows--mZpHYqo.js +3298 -0
  92. package/dist/graph-viewer/viewer/workspace-cKs9sGEO.js +2468 -0
  93. package/dist/graph-viewer/{workspace-model-Ewf17pTW.js → workspace-model-BkPl_J8E.js} +1 -1
  94. package/dist/graph-viewer/workspace-viewer.js +7452 -7489
  95. package/dist/graph-viewer/workspace.js +1 -1
  96. package/dist/index.mjs +27 -22
  97. package/package.json +9 -8
  98. package/dist/graph-viewer/Analytics-DFWW8Phh.js +0 -938
  99. package/dist/graph-viewer/Checks-qgqV4xgV.js +0 -155
  100. package/dist/graph-viewer/Conversations-CGB45kpj.js +0 -545
  101. package/dist/graph-viewer/LiveRun-C21wUKAY.js +0 -210
  102. package/dist/graph-viewer/Overview-BjeLsA2I.js +0 -506
  103. package/dist/graph-viewer/RunPage-CkkcBEUe.js +0 -258
  104. package/dist/graph-viewer/Timeline-C2Xolk0t.js +0 -293
  105. package/dist/graph-viewer/Today-BVVDtSVN.js +0 -660
  106. package/dist/graph-viewer/Topology-DO5XX8e4.js +0 -545
  107. package/dist/graph-viewer/Traces-BhMxjNgw.js +0 -259
  108. package/dist/graph-viewer/part-events-BrLrg_EV.js +0 -276
  109. package/dist/graph-viewer/record-part-CZal_IMH.js +0 -1408
  110. package/dist/graph-viewer/ui-D8QZRsC3.js +0 -938
  111. package/dist/graph-viewer/viewer/Analytics-DD__nbLm.js +0 -939
  112. package/dist/graph-viewer/viewer/Checks-Ds5M7eAW.js +0 -156
  113. package/dist/graph-viewer/viewer/Conversations-C1n0EBBd.js +0 -819
  114. package/dist/graph-viewer/viewer/Files-Cjr7NMU_.js +0 -448
  115. package/dist/graph-viewer/viewer/LiveRun-uPTkPSjo.js +0 -6772
  116. package/dist/graph-viewer/viewer/Overview-4Umk14_2.js +0 -507
  117. package/dist/graph-viewer/viewer/RunPage-DZlBW7Va.js +0 -257
  118. package/dist/graph-viewer/viewer/Timeline-BnK6-yBR.js +0 -294
  119. package/dist/graph-viewer/viewer/Today-a_-oNigi.js +0 -660
  120. package/dist/graph-viewer/viewer/Topology-CQPCLQT6.js +0 -546
  121. package/dist/graph-viewer/viewer/Traces-C0IGk0L4.js +0 -259
  122. package/dist/graph-viewer/viewer/WorkflowGraph-DZ3xejKE-jRXKeSrg.js +0 -1559
  123. package/dist/graph-viewer/viewer/agent-record-Dw772ROs.css +0 -2
  124. package/dist/graph-viewer/viewer/agent-timeline-Cs9Qbpvo.js +0 -1798
  125. package/dist/graph-viewer/viewer/dist-C1-7EfoW.js +0 -488
  126. package/dist/graph-viewer/viewer/file-text-m7a3piQF.js +0 -47
  127. package/dist/graph-viewer/viewer/jsx-runtime-DQWyJOhv.js +0 -2136
  128. package/dist/graph-viewer/viewer/lazy-pages-BowaGsg-.js +0 -20
  129. package/dist/graph-viewer/viewer/model-brand-bTcMjQtB-fagiBQam.js +0 -723
  130. package/dist/graph-viewer/viewer/popover-CvOAjlnk.js +0 -5329
  131. package/dist/graph-viewer/viewer/react-CY3IbSNO.js +0 -4262
  132. package/dist/graph-viewer/viewer/record-part-D3_Anfpe.js +0 -1329
  133. package/dist/graph-viewer/viewer/terminal-83J_I4Ne.js +0 -52
  134. package/dist/graph-viewer/viewer/ui-C9b1rIUH.js +0 -938
  135. package/dist/graph-viewer/viewer/workspace-CekmOBs3.js +0 -25100
  136. package/dist/graph-viewer/viewer/x-DOc2URqZ.js +0 -56
@@ -0,0 +1,2468 @@
1
+ import { i as e } from "./rolldown-runtime-DArdT4gl.js";
2
+ import { n as t, t as n } from "./jsx-runtime-DPT6sCLq.js";
3
+ import { t as r } from "./react-dom-BEusmvQH.js";
4
+ import { _ as i, b as a, c as o, d as s, g as c, h as l, l as u, m as d, n as f, u as p, w as m } from "./primitives-znfPK9NP-B6UO7uDr.js";
5
+ import { t as h } from "./utils-BuObIC0n.js";
6
+ import { r as g, v as _ } from "./workbench-E6_5q_oL.js";
7
+ import { t as v } from "./createLucideIcon-BSphcoOJ.js";
8
+ import { C as y, D as b, E as x, M as S, O as C, S as w, T, _ as E, d as D, i as O, l as k, m as A, p as j, t as M, u as N, v as P, x as F, y as I } from "./markdown-lADwhD7y.js";
9
+ import { n as ee, t as te } from "./segmented-control-Di1mbQlP.js";
10
+ import { t as L } from "./chevron-right-Xn05jYLT.js";
11
+ import { t as R } from "./git-branch-BzTbIcYL.js";
12
+ import "./dashboard-D3JhmRhe-DSl0zhkw.js";
13
+ import { s as z } from "./final-output-BYT-g-9j.js";
14
+ import { G as B, H as ne, K as re, Q as V, U as ie, V as ae, Y as H, Z as oe, q as U } from "./data-CVHeKhrh.js";
15
+ //#region node_modules/.pnpm/lucide-react@1.61.0_@types+react@19.3.0_react@19.3.0/node_modules/lucide-react/dist/esm/icons/book-open.mjs
16
+ var se = {
17
+ name: "book-open",
18
+ size: 24,
19
+ node: [["path", {
20
+ d: "M12 5v16",
21
+ key: "1f6ucr"
22
+ }], ["path", {
23
+ d: "M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",
24
+ key: "1fyvmf"
25
+ }]]
26
+ };
27
+ se.node;
28
+ var ce = v(se), le = {
29
+ name: "braces",
30
+ size: 24,
31
+ node: [["path", {
32
+ d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",
33
+ key: "ezmyqa"
34
+ }], ["path", {
35
+ d: "M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",
36
+ key: "e1hn23"
37
+ }]],
38
+ aliases: ["curly-braces"]
39
+ };
40
+ le.node;
41
+ var ue = v(le), de = {
42
+ name: "download",
43
+ size: 24,
44
+ node: [
45
+ ["path", {
46
+ d: "M12 15V3",
47
+ key: "m9g1x1"
48
+ }],
49
+ ["path", {
50
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
51
+ key: "ih7n3h"
52
+ }],
53
+ ["path", {
54
+ d: "m7 10 5 5 5-5",
55
+ key: "brsn70"
56
+ }]
57
+ ]
58
+ };
59
+ de.node;
60
+ var fe = v(de), pe = {
61
+ name: "eighth-notes",
62
+ size: 24,
63
+ node: [
64
+ ["path", {
65
+ d: "M21 16V3a1 1 0 0 0-1.28-.96l-10 2.917a1 1 0 0 0-.72.96V19",
66
+ key: "uy6ho8"
67
+ }],
68
+ ["circle", {
69
+ cx: "18",
70
+ cy: "16",
71
+ r: "3",
72
+ key: "1hluhg"
73
+ }],
74
+ ["circle", {
75
+ cx: "6",
76
+ cy: "19",
77
+ r: "3",
78
+ key: "1kj8tv"
79
+ }]
80
+ ],
81
+ aliases: ["music"]
82
+ };
83
+ pe.node;
84
+ var me = v(pe), he = {
85
+ name: "file-braces",
86
+ size: 24,
87
+ node: [
88
+ ["path", {
89
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
90
+ key: "1oefj6"
91
+ }],
92
+ ["path", {
93
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
94
+ key: "wfsgrz"
95
+ }],
96
+ ["path", {
97
+ d: "M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",
98
+ key: "1oajmo"
99
+ }],
100
+ ["path", {
101
+ d: "M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",
102
+ key: "mpwhp6"
103
+ }]
104
+ ],
105
+ aliases: ["file-json"]
106
+ };
107
+ he.node;
108
+ var ge = v(he), _e = {
109
+ name: "file-code",
110
+ size: 24,
111
+ node: [
112
+ ["path", {
113
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
114
+ key: "1oefj6"
115
+ }],
116
+ ["path", {
117
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
118
+ key: "wfsgrz"
119
+ }],
120
+ ["path", {
121
+ d: "M10 12.5 8 15l2 2.5",
122
+ key: "1tg20x"
123
+ }],
124
+ ["path", {
125
+ d: "m14 12.5 2 2.5-2 2.5",
126
+ key: "yinavb"
127
+ }]
128
+ ]
129
+ };
130
+ _e.node;
131
+ var W = v(_e), ve = {
132
+ name: "file-cog",
133
+ size: 24,
134
+ node: [
135
+ ["path", {
136
+ d: "M15 8a1 1 0 0 1-1-1V2a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8z",
137
+ key: "1ckgky"
138
+ }],
139
+ ["path", {
140
+ d: "M20 8v12a2 2 0 0 1-2 2h-4.182",
141
+ key: "1726p0"
142
+ }],
143
+ ["path", {
144
+ d: "m3.305 19.53.923-.382",
145
+ key: "ao1pio"
146
+ }],
147
+ ["path", {
148
+ d: "M4 10.592V4a2 2 0 0 1 2-2h8",
149
+ key: "1foop0"
150
+ }],
151
+ ["path", {
152
+ d: "m4.228 16.852-.924-.383",
153
+ key: "1fv9zy"
154
+ }],
155
+ ["path", {
156
+ d: "m5.852 15.228-.383-.923",
157
+ key: "1a9hc2"
158
+ }],
159
+ ["path", {
160
+ d: "m5.852 20.772-.383.924",
161
+ key: "1sh9ke"
162
+ }],
163
+ ["path", {
164
+ d: "m8.148 15.228.383-.923",
165
+ key: "4yu6lf"
166
+ }],
167
+ ["path", {
168
+ d: "m8.53 21.696-.382-.924",
169
+ key: "18b0s9"
170
+ }],
171
+ ["path", {
172
+ d: "m9.773 16.852.922-.383",
173
+ key: "ti6xop"
174
+ }],
175
+ ["path", {
176
+ d: "m9.773 19.148.922.383",
177
+ key: "rws47d"
178
+ }],
179
+ ["circle", {
180
+ cx: "7",
181
+ cy: "18",
182
+ r: "3",
183
+ key: "lvkj7j"
184
+ }]
185
+ ],
186
+ aliases: ["file-cog-2"]
187
+ };
188
+ ve.node;
189
+ var G = v(ve), ye = {
190
+ name: "file-headphone",
191
+ size: 24,
192
+ node: [
193
+ ["path", {
194
+ d: "M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",
195
+ key: "1vfytu"
196
+ }],
197
+ ["path", {
198
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
199
+ key: "wfsgrz"
200
+ }],
201
+ ["path", {
202
+ d: "M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",
203
+ key: "1etmh7"
204
+ }]
205
+ ],
206
+ aliases: ["file-audio", "file-audio-2"]
207
+ };
208
+ ye.node;
209
+ var be = v(ye), xe = {
210
+ name: "file-lock",
211
+ size: 24,
212
+ node: [
213
+ ["path", {
214
+ d: "M4 9.8V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3",
215
+ key: "1432pc"
216
+ }],
217
+ ["path", {
218
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
219
+ key: "wfsgrz"
220
+ }],
221
+ ["path", {
222
+ d: "M9 17v-2a2 2 0 0 0-4 0v2",
223
+ key: "168m41"
224
+ }],
225
+ ["rect", {
226
+ width: "8",
227
+ height: "5",
228
+ x: "3",
229
+ y: "17",
230
+ rx: "1",
231
+ key: "o8vfew"
232
+ }]
233
+ ],
234
+ aliases: ["file-lock-2"]
235
+ };
236
+ xe.node;
237
+ var Se = v(xe), Ce = {
238
+ name: "file-play",
239
+ size: 24,
240
+ node: [
241
+ ["path", {
242
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
243
+ key: "1oefj6"
244
+ }],
245
+ ["path", {
246
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
247
+ key: "wfsgrz"
248
+ }],
249
+ ["path", {
250
+ d: "M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",
251
+ key: "1tzo1f"
252
+ }]
253
+ ],
254
+ aliases: ["file-video"]
255
+ };
256
+ Ce.node;
257
+ var we = v(Ce), Te = {
258
+ name: "file-spreadsheet",
259
+ size: 24,
260
+ node: [
261
+ ["path", {
262
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
263
+ key: "1oefj6"
264
+ }],
265
+ ["path", {
266
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
267
+ key: "wfsgrz"
268
+ }],
269
+ ["path", {
270
+ d: "M8 13h2",
271
+ key: "yr2amv"
272
+ }],
273
+ ["path", {
274
+ d: "M14 13h2",
275
+ key: "un5t4a"
276
+ }],
277
+ ["path", {
278
+ d: "M8 17h2",
279
+ key: "2yhykz"
280
+ }],
281
+ ["path", {
282
+ d: "M14 17h2",
283
+ key: "10kma7"
284
+ }]
285
+ ]
286
+ };
287
+ Te.node;
288
+ var K = v(Te), Ee = {
289
+ name: "file-terminal",
290
+ size: 24,
291
+ node: [
292
+ ["path", {
293
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
294
+ key: "1oefj6"
295
+ }],
296
+ ["path", {
297
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
298
+ key: "wfsgrz"
299
+ }],
300
+ ["path", {
301
+ d: "m8 16 2-2-2-2",
302
+ key: "10vzyd"
303
+ }],
304
+ ["path", {
305
+ d: "M12 18h4",
306
+ key: "1wd2n7"
307
+ }]
308
+ ]
309
+ };
310
+ Ee.node;
311
+ var De = v(Ee), Oe = {
312
+ name: "file",
313
+ size: 24,
314
+ node: [["path", {
315
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
316
+ key: "1oefj6"
317
+ }], ["path", {
318
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
319
+ key: "wfsgrz"
320
+ }]]
321
+ };
322
+ Oe.node;
323
+ var ke = v(Oe), Ae = {
324
+ name: "maximize-2",
325
+ size: 24,
326
+ node: [
327
+ ["path", {
328
+ d: "M15 3h6v6",
329
+ key: "1q9fwt"
330
+ }],
331
+ ["path", {
332
+ d: "m21 3-7 7",
333
+ key: "1l2asr"
334
+ }],
335
+ ["path", {
336
+ d: "m3 21 7-7",
337
+ key: "tjx5ai"
338
+ }],
339
+ ["path", {
340
+ d: "M9 21H3v-6",
341
+ key: "wtvkvv"
342
+ }]
343
+ ]
344
+ };
345
+ Ae.node;
346
+ var je = v(Ae), Me = {
347
+ name: "minimize-2",
348
+ size: 24,
349
+ node: [
350
+ ["path", {
351
+ d: "m14 10 7-7",
352
+ key: "oa77jy"
353
+ }],
354
+ ["path", {
355
+ d: "M20 10h-6V4",
356
+ key: "mjg0md"
357
+ }],
358
+ ["path", {
359
+ d: "m3 21 7-7",
360
+ key: "tjx5ai"
361
+ }],
362
+ ["path", {
363
+ d: "M4 14h6v6",
364
+ key: "rmj7iw"
365
+ }]
366
+ ]
367
+ };
368
+ Me.node;
369
+ var Ne = v(Me), Pe = {
370
+ name: "scale",
371
+ size: 24,
372
+ node: [
373
+ ["path", {
374
+ d: "M12 3v18",
375
+ key: "108xh3"
376
+ }],
377
+ ["path", {
378
+ d: "m19 8 3 8a5 5 0 0 1-6 0zV7",
379
+ key: "zcdpyk"
380
+ }],
381
+ ["path", {
382
+ d: "M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",
383
+ key: "1yorad"
384
+ }],
385
+ ["path", {
386
+ d: "m5 8 3 8a5 5 0 0 1-6 0zV7",
387
+ key: "eua70x"
388
+ }],
389
+ ["path", {
390
+ d: "M7 21h10",
391
+ key: "1b0cd5"
392
+ }]
393
+ ]
394
+ };
395
+ Pe.node;
396
+ var Fe = v(Pe), Ie = {
397
+ name: "zoom-in",
398
+ size: 24,
399
+ node: [
400
+ ["circle", {
401
+ cx: "11",
402
+ cy: "11",
403
+ r: "8",
404
+ key: "4ej97u"
405
+ }],
406
+ ["line", {
407
+ x1: "21",
408
+ x2: "16.65",
409
+ y1: "21",
410
+ y2: "16.65",
411
+ key: "13gj7c"
412
+ }],
413
+ ["line", {
414
+ x1: "11",
415
+ x2: "11",
416
+ y1: "8",
417
+ y2: "14",
418
+ key: "1vmskp"
419
+ }],
420
+ ["line", {
421
+ x1: "8",
422
+ x2: "14",
423
+ y1: "11",
424
+ y2: "11",
425
+ key: "durymu"
426
+ }]
427
+ ]
428
+ };
429
+ Ie.node;
430
+ var Le = v(Ie), Re = {
431
+ name: "zoom-out",
432
+ size: 24,
433
+ node: [
434
+ ["circle", {
435
+ cx: "11",
436
+ cy: "11",
437
+ r: "8",
438
+ key: "4ej97u"
439
+ }],
440
+ ["line", {
441
+ x1: "21",
442
+ x2: "16.65",
443
+ y1: "21",
444
+ y2: "16.65",
445
+ key: "13gj7c"
446
+ }],
447
+ ["line", {
448
+ x1: "8",
449
+ x2: "14",
450
+ y1: "11",
451
+ y2: "11",
452
+ key: "durymu"
453
+ }]
454
+ ]
455
+ };
456
+ Re.node;
457
+ var ze = v(Re), q = /* @__PURE__ */ e(t(), 1), J = n(), Y = q.forwardRef(({ className: e, tone: t = "hint", ...n }, r) => /* @__PURE__ */ (0, J.jsx)("p", {
458
+ ref: r,
459
+ "data-tone": t,
460
+ className: h(u.root, u[t], e),
461
+ ...n
462
+ }));
463
+ Y.displayName = "HelpText";
464
+ //#endregion
465
+ //#region node_modules/.pnpm/@radix-ui+react-label@2.1.17_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@_099847eca268dc359e5086947d5ece66/node_modules/@radix-ui/react-label/dist/index.mjs
466
+ var Be = Object.defineProperty, Ve = /* @__PURE__ */ q.forwardRef(/* @__PURE__ */ ((e, t) => Be(e, "name", {
467
+ value: t,
468
+ configurable: !0
469
+ }))(function(e, t) {
470
+ return /* @__PURE__ */ (0, J.jsx)(f.label, {
471
+ ...e,
472
+ ref: t,
473
+ onMouseDown: (t) => {
474
+ t.target.closest("button, input, select, textarea") || (e.onMouseDown?.(t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
475
+ }
476
+ });
477
+ }, "Label")), He = q.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ (0, J.jsx)(Ve, {
478
+ ref: n,
479
+ className: h(s(), e),
480
+ ...t
481
+ }));
482
+ He.displayName = Ve.displayName;
483
+ //#endregion
484
+ //#region node_modules/.pnpm/@tangle-network+ui@11.51.1_@nanostores+react@1.1.0_nanostores@1.5.5_react@19.3.0__@shik_a7187ff5a73f27dfe4cc06a400b0c7a3/node_modules/@tangle-network/ui/dist/primitives/input.js
485
+ function Ue(...e) {
486
+ return [...new Set(e.join(" ").split(/\s+/).filter(Boolean))].join(" ") || void 0;
487
+ }
488
+ var We = q.forwardRef(({ className: e, type: t, variant: n, size: r, label: i, error: a, hint: o, id: s, "aria-describedby": c, "aria-invalid": l, ...u }, d) => {
489
+ let f = q.useId(), m = s ?? f, g = o ? `${m}-hint` : void 0, _ = a ? `${m}-error` : void 0, v = /* @__PURE__ */ (0, J.jsx)("input", {
490
+ type: t,
491
+ id: m,
492
+ className: h(p({
493
+ variant: a ? "error" : n,
494
+ size: r,
495
+ className: e
496
+ })),
497
+ ref: d,
498
+ ...u,
499
+ "aria-describedby": Ue(c, g, _),
500
+ "aria-invalid": a || n === "error" ? !0 : l
501
+ });
502
+ return !i && !a && !o ? v : /* @__PURE__ */ (0, J.jsxs)("div", {
503
+ className: "w-full space-y-1.5",
504
+ children: [
505
+ i && /* @__PURE__ */ (0, J.jsx)(He, {
506
+ htmlFor: m,
507
+ className: "block",
508
+ children: i
509
+ }),
510
+ v,
511
+ a && /* @__PURE__ */ (0, J.jsx)(Y, {
512
+ id: _,
513
+ tone: "error",
514
+ children: a
515
+ }),
516
+ o && /* @__PURE__ */ (0, J.jsx)(Y, {
517
+ id: g,
518
+ children: o
519
+ })
520
+ ]
521
+ });
522
+ });
523
+ We.displayName = "Input";
524
+ var Ge = q.forwardRef(({ className: e, variant: t, size: n = "default", label: r, error: a, hint: o, id: s, "aria-describedby": u, "aria-invalid": f, ...p }, m) => {
525
+ let g = q.useId(), _ = s ?? g, v = o ? `${_}-hint` : void 0, y = a ? `${_}-error` : void 0, b = /* @__PURE__ */ (0, J.jsx)("textarea", {
526
+ id: _,
527
+ className: h("flex min-h-[120px] w-full resize-y border px-3 py-2", "placeholder:text-[var(--text-dim)]", "disabled:cursor-not-allowed disabled:opacity-50", c, i, n === "sm" ? h(l.sm, d.sm, "px-2.5") : n === "lg" ? h(l.lg, d.lg, "px-4 py-3") : h(l.md, d.md), a && "border-[var(--surface-danger-border)] hover:border-[var(--surface-danger-border)] focus:border-[var(--focus-border-danger)] focus:ring-[var(--focus-halo-danger)]", n === "compact" && "min-h-24 px-3 py-2", n === "touch" && "text-base", e),
528
+ ref: m,
529
+ ...p,
530
+ "aria-describedby": Ue(u, v, y),
531
+ "aria-invalid": a ? !0 : f
532
+ });
533
+ return !r && !a && !o ? b : /* @__PURE__ */ (0, J.jsxs)("div", {
534
+ className: "w-full space-y-1.5",
535
+ children: [
536
+ r && /* @__PURE__ */ (0, J.jsx)(He, {
537
+ htmlFor: _,
538
+ className: "block",
539
+ children: r
540
+ }),
541
+ b,
542
+ a && /* @__PURE__ */ (0, J.jsx)(Y, {
543
+ id: y,
544
+ tone: "error",
545
+ children: a
546
+ }),
547
+ o && /* @__PURE__ */ (0, J.jsx)(Y, {
548
+ id: v,
549
+ children: o
550
+ })
551
+ ]
552
+ });
553
+ });
554
+ Ge.displayName = "Textarea";
555
+ //#endregion
556
+ //#region node_modules/.pnpm/@tangle-network+ui@11.51.1_@nanostores+react@1.1.0_nanostores@1.5.5_react@19.3.0__@shik_a7187ff5a73f27dfe4cc06a400b0c7a3/node_modules/@tangle-network/ui/dist/primitives/empty-state.js
557
+ var Ke = q.forwardRef(({ className: e, icon: t, title: n, description: r, action: i, titleAs: a = "h3", ...s }, c) => /* @__PURE__ */ (0, J.jsxs)("div", {
558
+ ref: c,
559
+ className: h(o.root, e),
560
+ ...s,
561
+ children: [
562
+ t && /* @__PURE__ */ (0, J.jsx)("div", {
563
+ className: o.icon,
564
+ children: t
565
+ }),
566
+ /* @__PURE__ */ (0, J.jsx)(a, {
567
+ className: o.title,
568
+ children: n
569
+ }),
570
+ r && /* @__PURE__ */ (0, J.jsx)("p", {
571
+ className: o.description,
572
+ children: r
573
+ }),
574
+ i && /* @__PURE__ */ (0, J.jsx)("div", {
575
+ className: o.action,
576
+ children: i
577
+ })
578
+ ]
579
+ }));
580
+ Ke.displayName = "EmptyState";
581
+ //#endregion
582
+ //#region node_modules/.pnpm/@tangle-network+ui@11.51.1_@nanostores+react@1.1.0_nanostores@1.5.5_react@19.3.0__@shik_a7187ff5a73f27dfe4cc06a400b0c7a3/node_modules/@tangle-network/ui/dist/primitives/alert.js
583
+ var qe = {
584
+ neutral: "border-border bg-card text-card-foreground",
585
+ info: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
586
+ success: "border-[var(--surface-success-border)] bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]",
587
+ warning: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
588
+ danger: "border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] text-[var(--surface-danger-text)]"
589
+ }, Je = q.forwardRef(({ tone: e = "neutral", icon: t, className: n, children: r, role: i, ...a }, o) => /* @__PURE__ */ (0, J.jsxs)("div", {
590
+ ref: o,
591
+ role: i ?? (e === "danger" || e === "warning" ? "alert" : "status"),
592
+ "data-tone": e,
593
+ className: h("flex w-full min-w-0 gap-3 rounded-lg border px-4 py-3 text-sm", qe[e], n),
594
+ ...a,
595
+ children: [t ? /* @__PURE__ */ (0, J.jsx)("span", {
596
+ "aria-hidden": "true",
597
+ className: "mt-0.5 flex shrink-0 [&_svg]:size-4",
598
+ children: t
599
+ }) : null, /* @__PURE__ */ (0, J.jsx)("div", {
600
+ className: "grid min-w-0 flex-1 gap-1",
601
+ children: r
602
+ })]
603
+ }));
604
+ Je.displayName = "Alert";
605
+ function Ye({ className: e, ...t }) {
606
+ return /* @__PURE__ */ (0, J.jsx)("div", {
607
+ className: h("leading-relaxed [overflow-wrap:anywhere] [[data-tone=neutral]_&]:text-muted-foreground", e),
608
+ ...t
609
+ });
610
+ }
611
+ Ye.displayName = "AlertDescription";
612
+ //#endregion
613
+ //#region node_modules/.pnpm/@tangle-network+ui@11.51.1_@nanostores+react@1.1.0_nanostores@1.5.5_react@19.3.0__@shik_a7187ff5a73f27dfe4cc06a400b0c7a3/node_modules/@tangle-network/ui/dist/lib/optional-peer.js
614
+ var Xe = /could not resolve|cannot find (?:module|package)|can't resolve|failed to resolve|module not found/i;
615
+ function Ze(e) {
616
+ return e instanceof Error && Xe.test(e.message);
617
+ }
618
+ function Qe(e) {
619
+ throw e;
620
+ }
621
+ //#endregion
622
+ //#region node_modules/.pnpm/@tangle-network+ui@11.51.1_@nanostores+react@1.1.0_nanostores@1.5.5_react@19.3.0__@shik_a7187ff5a73f27dfe4cc06a400b0c7a3/node_modules/@tangle-network/ui/dist/files/file-card.js
623
+ var $e = {
624
+ pdf: {
625
+ icon: b,
626
+ tone: "orange"
627
+ },
628
+ image: {
629
+ icon: C,
630
+ tone: "pink"
631
+ },
632
+ video: {
633
+ icon: we,
634
+ tone: "violet"
635
+ },
636
+ audio: {
637
+ icon: be,
638
+ tone: "cyan"
639
+ },
640
+ csv: {
641
+ icon: K,
642
+ tone: "lime"
643
+ },
644
+ spreadsheet: {
645
+ icon: K,
646
+ tone: "lime"
647
+ },
648
+ code: {
649
+ icon: W,
650
+ tone: "blue"
651
+ },
652
+ json: {
653
+ icon: ge,
654
+ tone: "blue"
655
+ },
656
+ yaml: {
657
+ icon: W,
658
+ tone: "blue"
659
+ },
660
+ markdown: {
661
+ icon: b,
662
+ tone: "teal"
663
+ },
664
+ text: {
665
+ icon: b,
666
+ tone: "teal"
667
+ },
668
+ binary: {
669
+ icon: ke,
670
+ tone: "brown"
671
+ }
672
+ };
673
+ function et({ filename: e, mimeType: t, size: n = "md", className: r }) {
674
+ let { icon: i, tone: a } = $e[j(e, t)];
675
+ return /* @__PURE__ */ (0, J.jsx)(A, {
676
+ tone: a,
677
+ size: n,
678
+ icon: /* @__PURE__ */ (0, J.jsx)(i, {}),
679
+ className: r
680
+ });
681
+ }
682
+ function tt(e) {
683
+ if (e === void 0) return;
684
+ let t = e instanceof Date ? e : new Date(e);
685
+ return Number.isNaN(t.getTime()) ? void 0 : t;
686
+ }
687
+ var nt = new Intl.DateTimeFormat(void 0, { dateStyle: "medium" });
688
+ function rt() {
689
+ return /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsx)("span", {
690
+ "aria-hidden": "true",
691
+ children: " · "
692
+ }), /* @__PURE__ */ (0, J.jsx)("span", {
693
+ className: "sr-only",
694
+ children: ", "
695
+ })] });
696
+ }
697
+ function it({ filename: e, mimeType: t, size: n, date: r, showKind: i = !1, className: a }) {
698
+ let o = tt(r), s = [];
699
+ return i && s.push(D(j(e, t))), n !== void 0 && s.push(O(n)), o && s.push(/* @__PURE__ */ (0, J.jsx)("time", {
700
+ dateTime: o.toISOString(),
701
+ suppressHydrationWarning: !0,
702
+ children: nt.format(o)
703
+ }, "date")), s.length === 0 ? null : /* @__PURE__ */ (0, J.jsx)("span", {
704
+ className: h("text-xs text-muted-foreground", a),
705
+ children: s.map((e, t) => /* @__PURE__ */ (0, J.jsxs)(q.Fragment, { children: [t > 0 && /* @__PURE__ */ (0, J.jsx)(rt, {}), e] }, t))
706
+ });
707
+ }
708
+ function at(e) {
709
+ return e.role ? `${e.name} (${e.role})` : e.name;
710
+ }
711
+ var ot = q.forwardRef(({ filename: e, mimeType: t, size: n, date: r, uploader: i, description: a, onDownload: o, actions: s, className: c, ...l }, u) => /* @__PURE__ */ (0, J.jsxs)("div", {
712
+ ref: u,
713
+ className: h("flex min-w-0 flex-col items-center justify-center rounded-[var(--radius-md)] border border-border bg-card px-6 py-12 text-center", c),
714
+ ...l,
715
+ children: [
716
+ /* @__PURE__ */ (0, J.jsx)(et, {
717
+ filename: e,
718
+ mimeType: t,
719
+ size: "lg"
720
+ }),
721
+ /* @__PURE__ */ (0, J.jsx)("p", {
722
+ className: "mt-3 line-clamp-2 max-w-full text-sm font-medium text-foreground [overflow-wrap:anywhere]",
723
+ title: e,
724
+ children: e
725
+ }),
726
+ /* @__PURE__ */ (0, J.jsx)(it, {
727
+ filename: e,
728
+ size: n,
729
+ date: r,
730
+ className: "mt-1"
731
+ }),
732
+ i && /* @__PURE__ */ (0, J.jsxs)("p", {
733
+ className: "mt-0.5 max-w-full truncate text-xs text-muted-foreground",
734
+ children: ["Uploaded by ", at(i)]
735
+ }),
736
+ a && /* @__PURE__ */ (0, J.jsx)("div", {
737
+ className: "mt-3 max-w-md text-sm text-muted-foreground",
738
+ children: a
739
+ }),
740
+ (o || s) && /* @__PURE__ */ (0, J.jsxs)("div", {
741
+ className: "mt-5 flex flex-wrap items-center justify-center gap-2",
742
+ children: [o && /* @__PURE__ */ (0, J.jsxs)(_, {
743
+ type: "button",
744
+ variant: "outline",
745
+ size: "sm",
746
+ onClick: o,
747
+ children: [/* @__PURE__ */ (0, J.jsx)(fe, {}), "Download"]
748
+ }), s]
749
+ })
750
+ ]
751
+ }));
752
+ ot.displayName = "FileCard";
753
+ //#endregion
754
+ //#region node_modules/.pnpm/@tangle-network+ui@11.51.1_@nanostores+react@1.1.0_nanostores@1.5.5_react@19.3.0__@shik_a7187ff5a73f27dfe4cc06a400b0c7a3/node_modules/@tangle-network/ui/dist/files/pdf-loader.js
755
+ var X = {}, st = ["pdfjs-dist"], ct = class extends Error {
756
+ constructor(e) {
757
+ super("PdfViewer needs the optional peer pdfjs-dist. Install pdfjs-dist to render PDF pages.", e), this.name = "MissingPdfjsError";
758
+ }
759
+ };
760
+ function lt(e) {
761
+ return e instanceof Error && e.name === "MissingPdfjsError";
762
+ }
763
+ function ut(e) {
764
+ if (!Ze(e)) return e;
765
+ let t = e.message;
766
+ return st.some((e) => t.includes(e)) ? new ct({ cause: e }) : e;
767
+ }
768
+ async function dt() {
769
+ let e;
770
+ try {
771
+ e = await import("./ui-ByOBsvk7.js").catch(Qe);
772
+ } catch (e) {
773
+ throw ut(e);
774
+ }
775
+ if (typeof e.getDocument != "function") throw new ct();
776
+ return e;
777
+ }
778
+ var ft = null, pt = !1;
779
+ function mt() {
780
+ return ft ??= dt().catch((e) => {
781
+ throw lt(e) || (ft = null), e;
782
+ }), ft.then(async (e) => {
783
+ let { GlobalWorkerOptions: t } = e;
784
+ return X.workerSrc ? t.workerSrc = X.workerSrc : !t.workerSrc && !t.workerPort && await import("./ui-CxK41KO5.js").catch(Qe), !X.assetsUrl && !pt && (pt = !0, console.warn("PdfViewer: no assetsUrl is configured, so JBIG2, CCITT fax and JPEG 2000 images (most black-and-white scans) will not render. See configurePdfViewer.")), e;
785
+ });
786
+ }
787
+ function ht() {
788
+ if (!X.assetsUrl) return {};
789
+ let e = new URL(X.assetsUrl, document.baseURI).href.replace(/\/?$/, "/");
790
+ return {
791
+ wasmUrl: `${e}wasm/`,
792
+ cMapUrl: `${e}cmaps/`,
793
+ cMapPacked: !0,
794
+ standardFontDataUrl: `${e}standard_fonts/`,
795
+ iccUrl: `${e}iccs/`
796
+ };
797
+ }
798
+ //#endregion
799
+ //#region node_modules/.pnpm/@tangle-network+ui@11.51.1_@nanostores+react@1.1.0_nanostores@1.5.5_react@19.3.0__@shik_a7187ff5a73f27dfe4cc06a400b0c7a3/node_modules/@tangle-network/ui/dist/files/pdf-viewer.js
800
+ var gt = 96 / 72, Z = [
801
+ .25,
802
+ .5,
803
+ .75,
804
+ 1,
805
+ 1.25,
806
+ 1.5,
807
+ 2,
808
+ 3,
809
+ 4
810
+ ], _t = Z[0], vt = Z[Z.length - 1], yt = 12, bt = 16777216;
811
+ function xt(e, t, n) {
812
+ return Math.min(n, Math.max(t, e));
813
+ }
814
+ async function St(e, t) {
815
+ if (/^https?:/i.test(new URL(e, document.baseURI).protocol)) return { url: e };
816
+ let n = await fetch(e, { signal: t });
817
+ if (!n.ok) throw Error(`Reading the PDF failed with status ${n.status}.`);
818
+ return { data: new Uint8Array(await n.arrayBuffer()) };
819
+ }
820
+ function Ct(e) {
821
+ if (lt(e)) return {
822
+ notice: "This is the browser's PDF viewer, because this app does not include the page viewer.",
823
+ retry: !1
824
+ };
825
+ let t = e instanceof Error ? e.name : "";
826
+ if (t === "PasswordException") return {
827
+ notice: "This PDF is password-protected, so it opens in the browser's PDF viewer.",
828
+ retry: !1
829
+ };
830
+ if (t === "InvalidPDFException") return {
831
+ notice: "This file could not be read as a PDF.",
832
+ retry: !1
833
+ };
834
+ let n = e?.status;
835
+ return t === "ResponseException" && typeof n == "number" && n > 0 ? {
836
+ notice: `The PDF could not be downloaded (HTTP ${n}).`,
837
+ retry: !0
838
+ } : {
839
+ notice: "The page viewer could not open this PDF, so this is the browser's PDF viewer.",
840
+ retry: !0
841
+ };
842
+ }
843
+ function wt({ src: e, filename: t = "Document", size: n, onDownload: r, className: i }) {
844
+ let [a, o] = (0, q.useState)(0), [s, c] = (0, q.useState)({ status: "loading" });
845
+ return (0, q.useEffect)(() => {
846
+ let n = !0, r, i = new AbortController();
847
+ return c({ status: "loading" }), (async () => {
848
+ let t = await mt(), a = await St(e, i.signal);
849
+ if (!n) return;
850
+ let o = t.getDocument({
851
+ ...a,
852
+ ...ht()
853
+ });
854
+ r = () => o.destroy(), o.onProgress = ({ loaded: e, total: t }) => {
855
+ n && t > 0 && c({
856
+ status: "loading",
857
+ percent: Math.min(100, Math.round(e / t * 100))
858
+ });
859
+ };
860
+ let s = await o.promise;
861
+ n && c({
862
+ status: "ready",
863
+ doc: s
864
+ });
865
+ })().catch((e) => {
866
+ n && (console.error(`PdfViewer: falling back to the browser's PDF viewer for ${t}.`, e), c({
867
+ status: "fallback",
868
+ ...Ct(e)
869
+ }));
870
+ }), () => {
871
+ n = !1, i.abort(), r?.();
872
+ };
873
+ }, [e, a]), /* @__PURE__ */ (0, J.jsx)("div", {
874
+ "data-state": s.status,
875
+ className: h("flex max-h-[100dvh] min-h-0 flex-col overflow-hidden rounded-[var(--radius-md)] border border-border bg-card", i),
876
+ children: s.status === "ready" ? /* @__PURE__ */ (0, J.jsx)(Tt, {
877
+ doc: s.doc,
878
+ filename: t,
879
+ onDownload: r
880
+ }) : s.status === "loading" ? /* @__PURE__ */ (0, J.jsxs)("div", {
881
+ role: "status",
882
+ className: "flex min-h-[12rem] flex-1 flex-col items-center justify-center gap-3 p-6 text-sm text-muted-foreground",
883
+ children: [/* @__PURE__ */ (0, J.jsx)(w, {
884
+ "aria-hidden": "true",
885
+ className: "size-5 animate-spin motion-reduce:animate-none"
886
+ }), /* @__PURE__ */ (0, J.jsxs)("span", { children: [
887
+ "Loading ",
888
+ t,
889
+ s.percent === void 0 ? "…" : ` · ${s.percent}%`
890
+ ] })]
891
+ }) : /* @__PURE__ */ (0, J.jsxs)("div", {
892
+ className: "flex min-h-0 flex-1 flex-col gap-3 overflow-auto p-3",
893
+ children: [/* @__PURE__ */ (0, J.jsxs)(Je, {
894
+ tone: "info",
895
+ icon: /* @__PURE__ */ (0, J.jsx)(y, {}),
896
+ children: [/* @__PURE__ */ (0, J.jsx)(Ye, { children: s.notice }), s.retry && /* @__PURE__ */ (0, J.jsx)("div", { children: /* @__PURE__ */ (0, J.jsx)(_, {
897
+ type: "button",
898
+ variant: "outline",
899
+ size: "sm",
900
+ onClick: () => o((e) => e + 1),
901
+ children: "Try again"
902
+ }) })]
903
+ }), /* @__PURE__ */ (0, J.jsx)("object", {
904
+ data: e,
905
+ type: "application/pdf",
906
+ title: t,
907
+ className: "min-h-[20rem] w-full flex-1 rounded-[var(--radius-md)]",
908
+ children: /* @__PURE__ */ (0, J.jsx)(ot, {
909
+ filename: t,
910
+ mimeType: "application/pdf",
911
+ size: n,
912
+ description: "This browser does not show PDFs inline.",
913
+ onDownload: r,
914
+ className: "h-full"
915
+ })
916
+ })]
917
+ })
918
+ });
919
+ }
920
+ function Tt({ doc: e, filename: t, onDownload: n }) {
921
+ let r = e.numPages, [i, o] = (0, q.useState)(null), s = (0, q.useRef)([]), [c, l] = (0, q.useState)(null), [u, d] = (0, q.useState)(0), [f, p] = (0, q.useState)({ mode: "fit" }), [m, g] = (0, q.useState)(1), v = (0, q.useRef)(null), y = (0, q.useCallback)((e, t) => {
922
+ s.current[e - 1] = t;
923
+ }, []);
924
+ (0, q.useEffect)(() => {
925
+ let t = !0;
926
+ return e.getPage(1).then((e) => {
927
+ if (!t) return;
928
+ let { width: n, height: r } = e.getViewport({ scale: gt });
929
+ l({
930
+ width: n,
931
+ height: r
932
+ });
933
+ }, () => {
934
+ t && l({
935
+ width: 612 * gt,
936
+ height: 792 * gt
937
+ });
938
+ }), () => {
939
+ t = !1;
940
+ };
941
+ }, [e]), (0, q.useLayoutEffect)(() => {
942
+ if (!i || (d(i.clientWidth), typeof ResizeObserver > "u")) return;
943
+ let e = new ResizeObserver(() => d(i.clientWidth));
944
+ return e.observe(i), () => e.disconnect();
945
+ }, [i]);
946
+ let b = c && u > 24 ? xt((u - 24) / c.width, _t, vt) : 1, x = f.mode === "fit" ? b : f.value, S = (0, q.useCallback)(() => {
947
+ if (!i) return;
948
+ let e = i.scrollTop, t = e + i.clientHeight, n = 0, a = -1;
949
+ s.current.forEach((r, i) => {
950
+ if (!r) return;
951
+ let o = Math.min(t, r.offsetTop + r.offsetHeight) - Math.max(e, r.offsetTop);
952
+ o > a && (n = i, a = o);
953
+ }), e + i.clientHeight >= i.scrollHeight - 1 && e > 0 && (n = r - 1);
954
+ let o = s.current[n];
955
+ v.current = {
956
+ index: n,
957
+ fraction: o?.offsetHeight ? (e - o.offsetTop) / o.offsetHeight : 0
958
+ }, g(n + 1);
959
+ }, [i, r]);
960
+ (0, q.useLayoutEffect)(() => {
961
+ let e = v.current && s.current[v.current.index];
962
+ i && v.current && e && (i.scrollTop = e.offsetTop + v.current.fraction * e.offsetHeight, i.scrollLeft = (i.scrollWidth - i.clientWidth) / 2);
963
+ }, [i, x]);
964
+ let C = (0, q.useRef)(0);
965
+ (0, q.useEffect)(() => () => cancelAnimationFrame(C.current), []);
966
+ let T = () => {
967
+ C.current ||= requestAnimationFrame(() => {
968
+ C.current = 0, S();
969
+ });
970
+ }, E = (e) => {
971
+ let t = xt(e, 1, r), n = s.current[t - 1];
972
+ i && n && (i.scrollTop = n.offsetTop - yt, v.current = {
973
+ index: t - 1,
974
+ fraction: n.offsetHeight ? -12 / n.offsetHeight : 0
975
+ }), g(t);
976
+ }, D = (e) => {
977
+ S();
978
+ let t = e > 0 ? Z.find((e) => e > x + .001) ?? vt : [...Z].reverse().find((e) => e < x - .001) ?? _t;
979
+ p({
980
+ mode: "manual",
981
+ value: t
982
+ });
983
+ }, O = Math.round(x * 100), k = f.mode === "fit";
984
+ return /* @__PURE__ */ (0, J.jsxs)(J.Fragment, { children: [/* @__PURE__ */ (0, J.jsxs)("div", {
985
+ role: "group",
986
+ "aria-label": `${t} controls`,
987
+ className: "flex shrink-0 items-center gap-0.5 overflow-x-auto border-b border-border px-1 py-1 [&>*]:shrink-0",
988
+ children: [
989
+ /* @__PURE__ */ (0, J.jsx)(_, {
990
+ type: "button",
991
+ variant: "ghost",
992
+ size: "icon",
993
+ "aria-label": "Previous page",
994
+ title: "Previous page",
995
+ disabled: m <= 1,
996
+ onClick: () => E(m - 1),
997
+ children: /* @__PURE__ */ (0, J.jsx)(ee, {})
998
+ }),
999
+ /* @__PURE__ */ (0, J.jsx)(Et, {
1000
+ current: m,
1001
+ total: r,
1002
+ onCommit: E
1003
+ }),
1004
+ /* @__PURE__ */ (0, J.jsx)(_, {
1005
+ type: "button",
1006
+ variant: "ghost",
1007
+ size: "icon",
1008
+ "aria-label": "Next page",
1009
+ title: "Next page",
1010
+ disabled: m >= r,
1011
+ onClick: () => E(m + 1),
1012
+ children: /* @__PURE__ */ (0, J.jsx)(L, {})
1013
+ }),
1014
+ /* @__PURE__ */ (0, J.jsxs)("div", {
1015
+ className: "ml-auto flex items-center gap-0.5",
1016
+ children: [
1017
+ /* @__PURE__ */ (0, J.jsx)(_, {
1018
+ type: "button",
1019
+ variant: "ghost",
1020
+ size: "icon",
1021
+ "aria-label": "Zoom out",
1022
+ title: "Zoom out",
1023
+ disabled: x <= _t + .001,
1024
+ onClick: () => D(-1),
1025
+ children: /* @__PURE__ */ (0, J.jsx)(ze, {})
1026
+ }),
1027
+ /* @__PURE__ */ (0, J.jsxs)(_, {
1028
+ type: "button",
1029
+ variant: "ghost",
1030
+ size: "sm",
1031
+ "aria-label": `${O}%, fit to width`,
1032
+ title: "Fit to width",
1033
+ "aria-pressed": k,
1034
+ className: h("min-w-12 px-1.5 tabular-nums", k && "bg-primary/10 text-[var(--accent-text)] hover:text-[var(--accent-text)]"),
1035
+ onClick: () => {
1036
+ S(), p({ mode: "fit" });
1037
+ },
1038
+ children: [O, "%"]
1039
+ }),
1040
+ /* @__PURE__ */ (0, J.jsxs)("span", {
1041
+ className: "sr-only",
1042
+ "aria-live": "polite",
1043
+ children: [
1044
+ "Zoom ",
1045
+ O,
1046
+ "%"
1047
+ ]
1048
+ }),
1049
+ /* @__PURE__ */ (0, J.jsx)(_, {
1050
+ type: "button",
1051
+ variant: "ghost",
1052
+ size: "icon",
1053
+ "aria-label": "Zoom in",
1054
+ title: "Zoom in",
1055
+ disabled: x >= vt - .001,
1056
+ onClick: () => D(1),
1057
+ children: /* @__PURE__ */ (0, J.jsx)(Le, {})
1058
+ }),
1059
+ n && /* @__PURE__ */ (0, J.jsx)(_, {
1060
+ type: "button",
1061
+ variant: "ghost",
1062
+ size: "icon",
1063
+ "aria-label": `Download ${t}`,
1064
+ title: "Download",
1065
+ onClick: n,
1066
+ children: /* @__PURE__ */ (0, J.jsx)(fe, {})
1067
+ })
1068
+ ]
1069
+ })
1070
+ ]
1071
+ }), /* @__PURE__ */ (0, J.jsx)("div", {
1072
+ ref: o,
1073
+ tabIndex: 0,
1074
+ role: "region",
1075
+ "aria-label": t,
1076
+ onScroll: T,
1077
+ className: h("relative min-h-0 flex-1 overflow-auto overscroll-contain bg-muted [scrollbar-gutter:stable]", a),
1078
+ children: c ? /* @__PURE__ */ (0, J.jsx)("div", {
1079
+ className: "flex w-max min-w-full flex-col items-center gap-3 p-3",
1080
+ children: Array.from({ length: r }, (t, n) => /* @__PURE__ */ (0, J.jsx)(Ot, {
1081
+ doc: e,
1082
+ pageNumber: n + 1,
1083
+ pageCount: r,
1084
+ zoom: x,
1085
+ placeholder: c,
1086
+ root: i,
1087
+ register: y
1088
+ }, n))
1089
+ }) : /* @__PURE__ */ (0, J.jsxs)("div", {
1090
+ role: "status",
1091
+ className: "flex h-full min-h-[12rem] items-center justify-center text-sm text-muted-foreground",
1092
+ children: [/* @__PURE__ */ (0, J.jsx)(w, {
1093
+ "aria-hidden": "true",
1094
+ className: "size-5 animate-spin motion-reduce:animate-none"
1095
+ }), /* @__PURE__ */ (0, J.jsxs)("span", {
1096
+ className: "sr-only",
1097
+ children: [
1098
+ "Loading ",
1099
+ t,
1100
+ "…"
1101
+ ]
1102
+ })]
1103
+ })
1104
+ })] });
1105
+ }
1106
+ function Et({ current: e, total: t, onCommit: n }) {
1107
+ let [r, i] = (0, q.useState)(null), a = () => {
1108
+ if (r === null) return;
1109
+ let e = Number.parseInt(r, 10);
1110
+ i(null), Number.isFinite(e) && n(e);
1111
+ };
1112
+ return /* @__PURE__ */ (0, J.jsxs)("span", {
1113
+ className: "flex items-center gap-1.5 text-sm text-muted-foreground",
1114
+ children: [/* @__PURE__ */ (0, J.jsx)("input", {
1115
+ type: "text",
1116
+ inputMode: "numeric",
1117
+ "aria-label": `Page, 1 to ${t}`,
1118
+ value: r ?? String(e),
1119
+ onFocus: (e) => e.currentTarget.select(),
1120
+ onChange: (e) => i(e.currentTarget.value.replace(/\D/g, "")),
1121
+ onBlur: a,
1122
+ onKeyDown: (e) => {
1123
+ e.key === "Enter" && a(), e.key === "Escape" && i(null);
1124
+ },
1125
+ className: h(c, "h-8 w-11 rounded-md border px-1 text-center text-base tabular-nums sm:text-sm")
1126
+ }), /* @__PURE__ */ (0, J.jsxs)("span", {
1127
+ "aria-hidden": "true",
1128
+ className: "whitespace-nowrap tabular-nums",
1129
+ children: ["/ ", t]
1130
+ })]
1131
+ });
1132
+ }
1133
+ function Dt(e) {
1134
+ for (let t of e.querySelectorAll("canvas")) t.width = 0, t.height = 0;
1135
+ e.replaceChildren();
1136
+ }
1137
+ var Ot = (0, q.memo)(function({ doc: e, pageNumber: t, pageCount: n, zoom: r, placeholder: i, root: a, register: o }) {
1138
+ let [s, c] = (0, q.useState)(null), [l, u] = (0, q.useState)(!1), [d, f] = (0, q.useState)(!1), p = (0, q.useRef)(null), m = (0, q.useRef)(null), h = r * gt;
1139
+ (0, q.useEffect)(() => {
1140
+ let n = !0;
1141
+ return e.getPage(t).then((e) => n && c(e), () => n && f(!0)), () => {
1142
+ n = !1;
1143
+ };
1144
+ }, [e, t]), (0, q.useEffect)(() => {
1145
+ let e = p.current;
1146
+ if (!e) return;
1147
+ if (typeof IntersectionObserver > "u") {
1148
+ u(!0);
1149
+ return;
1150
+ }
1151
+ let t = new IntersectionObserver(([e]) => u(e?.isIntersecting ?? !1), {
1152
+ root: a,
1153
+ rootMargin: "100% 0px"
1154
+ });
1155
+ return t.observe(e), () => t.disconnect();
1156
+ }, [a]), (0, q.useEffect)(() => {
1157
+ let e = m.current;
1158
+ if (!e || !s) return;
1159
+ if (!l) {
1160
+ Dt(e), s.cleanup();
1161
+ return;
1162
+ }
1163
+ let t = s.getViewport({ scale: h }), n = Math.min(window.devicePixelRatio || 1, Math.sqrt(bt / (t.width * t.height))), r = document.createElement("canvas");
1164
+ r.width = Math.max(1, Math.floor(t.width * n)), r.height = Math.max(1, Math.floor(t.height * n)), r.style.cssText = "display:block;width:100%;height:100%", r.setAttribute("aria-hidden", "true");
1165
+ let i = s.render({
1166
+ canvas: r,
1167
+ viewport: t,
1168
+ transform: n === 1 ? void 0 : [
1169
+ n,
1170
+ 0,
1171
+ 0,
1172
+ n,
1173
+ 0,
1174
+ 0
1175
+ ]
1176
+ }), a = !1;
1177
+ return i.promise.then(() => {
1178
+ a = !0, Dt(e), e.append(r), f(!1);
1179
+ }, (e) => {
1180
+ a = !0, r.width = 0, r.height = 0, e?.name !== "RenderingCancelledException" && f(!0);
1181
+ }), () => {
1182
+ a || i.cancel();
1183
+ };
1184
+ }, [
1185
+ s,
1186
+ l,
1187
+ h
1188
+ ]), (0, q.useEffect)(() => {
1189
+ let e = m.current;
1190
+ return () => {
1191
+ e && Dt(e);
1192
+ };
1193
+ }, []);
1194
+ let g = (0, q.useMemo)(() => {
1195
+ if (s) {
1196
+ let { width: e, height: t } = s.getViewport({ scale: h });
1197
+ return {
1198
+ width: e,
1199
+ height: t
1200
+ };
1201
+ }
1202
+ return {
1203
+ width: i.width * r,
1204
+ height: i.height * r
1205
+ };
1206
+ }, [
1207
+ s,
1208
+ h,
1209
+ r,
1210
+ i
1211
+ ]);
1212
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
1213
+ ref: (e) => {
1214
+ p.current = e, o(t, e);
1215
+ },
1216
+ role: "img",
1217
+ "aria-label": `Page ${t} of ${n}`,
1218
+ "data-page-number": t,
1219
+ style: {
1220
+ width: Math.round(g.width),
1221
+ height: Math.round(g.height)
1222
+ },
1223
+ className: "relative shrink-0 overflow-hidden bg-card shadow-sm ring-1 ring-border",
1224
+ children: [/* @__PURE__ */ (0, J.jsx)("div", {
1225
+ ref: m,
1226
+ className: "absolute inset-0"
1227
+ }), d && /* @__PURE__ */ (0, J.jsxs)("p", {
1228
+ className: "absolute inset-0 flex items-center justify-center p-4 text-center text-sm text-muted-foreground",
1229
+ children: [
1230
+ "Page ",
1231
+ t,
1232
+ " could not be displayed."
1233
+ ]
1234
+ })]
1235
+ });
1236
+ }), Q = "This file needs a download link to preview.", kt = "This file type has no inline preview.", At = "This file has no inline content to preview yet.";
1237
+ function jt({ content: e, filename: t, kind: n }) {
1238
+ let r = e.split("\n").length, i = N(t, n), a = k(t) || i || "txt";
1239
+ return /* @__PURE__ */ (0, J.jsx)(E, {
1240
+ code: e,
1241
+ language: i,
1242
+ label: `${a} · ${r} lines`,
1243
+ showLineNumbers: !0,
1244
+ className: "max-h-[70vh] overflow-auto",
1245
+ children: /* @__PURE__ */ (0, J.jsx)(P, { text: e })
1246
+ });
1247
+ }
1248
+ function Mt(e) {
1249
+ let t = [], n = [], r = "", i = !1, a = !1, o = () => {
1250
+ n.push(i ? r : r.trim()), r = "", i = !1;
1251
+ }, s = () => {
1252
+ o(), (n.length > 1 || n[0] !== "") && t.push(n), n = [];
1253
+ };
1254
+ for (let t = 0; t < e.length; t += 1) {
1255
+ let n = e[t];
1256
+ if (a) {
1257
+ n === "\"" ? e[t + 1] === "\"" ? (r += "\"", t += 1) : a = !1 : r += n;
1258
+ continue;
1259
+ }
1260
+ if (n === "\"") {
1261
+ a = !0, i = !0;
1262
+ continue;
1263
+ }
1264
+ if (n === ",") {
1265
+ o();
1266
+ continue;
1267
+ }
1268
+ if (n === "\r" || n === "\n") {
1269
+ n === "\r" && e[t + 1] === "\n" && (t += 1), s();
1270
+ continue;
1271
+ }
1272
+ r += n;
1273
+ }
1274
+ return (r.length > 0 || i || n.length > 0) && s(), t;
1275
+ }
1276
+ function Nt({ content: e }) {
1277
+ let [t = [], ...n] = Mt(e);
1278
+ if (t.length === 0) return null;
1279
+ let r = n.slice(0, 500), i = Math.max(t.length, ...r.map((e) => e.length)), a = n.length > r.length;
1280
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
1281
+ className: "flex min-h-0 flex-1 flex-col gap-2",
1282
+ children: [/* @__PURE__ */ (0, J.jsx)("div", {
1283
+ className: "min-h-0 overflow-auto rounded-[var(--radius-md)] border border-border",
1284
+ children: /* @__PURE__ */ (0, J.jsxs)("table", {
1285
+ className: "w-full text-sm",
1286
+ children: [/* @__PURE__ */ (0, J.jsx)("thead", { children: /* @__PURE__ */ (0, J.jsx)("tr", { children: Array.from({ length: i }, (e, n) => /* @__PURE__ */ (0, J.jsx)("th", {
1287
+ className: "sticky top-0 whitespace-nowrap border-b border-border bg-card px-3 py-2 text-left text-xs font-semibold text-foreground",
1288
+ children: t[n] ?? ""
1289
+ }, n)) }) }), /* @__PURE__ */ (0, J.jsx)("tbody", { children: r.map((e, t) => /* @__PURE__ */ (0, J.jsx)("tr", {
1290
+ className: "border-b border-border hover:bg-accent",
1291
+ children: Array.from({ length: i }, (t, n) => /* @__PURE__ */ (0, J.jsx)("td", {
1292
+ className: "whitespace-nowrap px-3 py-1.5 font-mono text-xs text-foreground",
1293
+ children: e[n] ?? ""
1294
+ }, n))
1295
+ }, t)) })]
1296
+ })
1297
+ }), /* @__PURE__ */ (0, J.jsxs)("p", {
1298
+ className: "shrink-0 text-xs text-muted-foreground",
1299
+ children: [a ? `Showing ${r.length} of ${n.length} rows` : `${n.length} ${n.length === 1 ? "row" : "rows"}`, ` · ${i} ${i === 1 ? "column" : "columns"}`]
1300
+ })]
1301
+ });
1302
+ }
1303
+ var Pt = {
1304
+ backgroundColor: "var(--color-background)",
1305
+ backgroundImage: "repeating-conic-gradient(var(--color-muted) 0% 25%, transparent 0% 50%)",
1306
+ backgroundSize: "16px 16px"
1307
+ };
1308
+ function Ft({ src: e, filename: t }) {
1309
+ let [n, r] = (0, q.useState)(!1);
1310
+ return /* @__PURE__ */ (0, J.jsx)("div", {
1311
+ className: "flex min-h-[12rem] flex-1 overflow-auto rounded-[var(--radius-md)] border border-border",
1312
+ style: Pt,
1313
+ children: /* @__PURE__ */ (0, J.jsx)("button", {
1314
+ type: "button",
1315
+ onClick: () => r((e) => !e),
1316
+ "aria-pressed": n,
1317
+ "aria-label": n ? "Fit image to pane" : "Show image at natural size",
1318
+ className: h("flex items-center justify-center", a, n ? "m-auto cursor-zoom-out" : "h-full w-full cursor-zoom-in p-4"),
1319
+ children: /* @__PURE__ */ (0, J.jsx)("img", {
1320
+ src: e,
1321
+ alt: t,
1322
+ draggable: !1,
1323
+ className: n ? "max-w-none" : "max-h-full max-w-full object-contain"
1324
+ })
1325
+ })
1326
+ });
1327
+ }
1328
+ function It({ src: e, filename: t }) {
1329
+ return /* @__PURE__ */ (0, J.jsx)("div", {
1330
+ className: "flex min-h-[12rem] flex-1 items-center justify-center overflow-hidden rounded-[var(--radius-md)] border border-border bg-background",
1331
+ children: /* @__PURE__ */ (0, J.jsx)("video", {
1332
+ controls: !0,
1333
+ preload: "metadata",
1334
+ src: e,
1335
+ "aria-label": t,
1336
+ className: "max-h-full max-w-full"
1337
+ })
1338
+ });
1339
+ }
1340
+ function Lt({ src: e, filename: t }) {
1341
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
1342
+ className: "flex flex-col items-center gap-4 rounded-[var(--radius-md)] border border-border bg-background px-6 py-10",
1343
+ children: [
1344
+ /* @__PURE__ */ (0, J.jsx)(me, { className: "h-10 w-10 text-muted-foreground opacity-60" }),
1345
+ /* @__PURE__ */ (0, J.jsx)("p", {
1346
+ className: "max-w-full truncate text-sm font-medium text-foreground",
1347
+ children: t
1348
+ }),
1349
+ /* @__PURE__ */ (0, J.jsx)("audio", {
1350
+ controls: !0,
1351
+ preload: "metadata",
1352
+ src: e,
1353
+ "aria-label": t,
1354
+ className: "w-full max-w-md"
1355
+ })
1356
+ ]
1357
+ });
1358
+ }
1359
+ function Rt({ content: e }) {
1360
+ return /* @__PURE__ */ (0, J.jsx)("pre", {
1361
+ className: "bg-card rounded-[var(--radius-md)] border border-border p-4 overflow-auto max-h-[70vh] text-sm text-foreground font-mono leading-[1.55]",
1362
+ children: e
1363
+ });
1364
+ }
1365
+ function zt({ content: e, urlTransform: t }) {
1366
+ return /* @__PURE__ */ (0, J.jsx)("div", {
1367
+ className: "rounded-[var(--radius-md)] border border-border bg-background p-5",
1368
+ children: /* @__PURE__ */ (0, J.jsx)(M, {
1369
+ urlTransform: t,
1370
+ children: e
1371
+ })
1372
+ });
1373
+ }
1374
+ function Bt({ kind: e, filename: t, mimeType: n, content: r, blobUrl: i, size: a, urlTransform: o, onDownload: s }) {
1375
+ let c = typeof r == "string", l = (e) => /* @__PURE__ */ (0, J.jsx)(ot, {
1376
+ filename: t,
1377
+ mimeType: n,
1378
+ size: a,
1379
+ description: e,
1380
+ onDownload: s
1381
+ });
1382
+ switch (e) {
1383
+ case "pdf": return i ? /* @__PURE__ */ (0, J.jsx)(wt, {
1384
+ src: i,
1385
+ filename: t,
1386
+ size: a,
1387
+ onDownload: s,
1388
+ className: "min-h-[24rem] flex-1"
1389
+ }) : l(Q);
1390
+ case "image": return i ? /* @__PURE__ */ (0, J.jsx)(Ft, {
1391
+ src: i,
1392
+ filename: t
1393
+ }) : c ? /* @__PURE__ */ (0, J.jsx)(jt, {
1394
+ content: r,
1395
+ filename: t,
1396
+ kind: "code"
1397
+ }) : l(Q);
1398
+ case "video": return i ? /* @__PURE__ */ (0, J.jsx)(It, {
1399
+ src: i,
1400
+ filename: t
1401
+ }) : l(Q);
1402
+ case "audio": return i ? /* @__PURE__ */ (0, J.jsx)(Lt, {
1403
+ src: i,
1404
+ filename: t
1405
+ }) : l(Q);
1406
+ case "csv": return c ? /* @__PURE__ */ (0, J.jsx)(Nt, { content: r }) : l(At);
1407
+ case "code":
1408
+ case "json":
1409
+ case "yaml": return c ? /* @__PURE__ */ (0, J.jsx)(jt, {
1410
+ content: r,
1411
+ filename: t,
1412
+ kind: e
1413
+ }) : l(At);
1414
+ case "markdown": return c ? /* @__PURE__ */ (0, J.jsx)(zt, {
1415
+ content: r,
1416
+ urlTransform: o
1417
+ }) : l(At);
1418
+ case "text": return c ? /* @__PURE__ */ (0, J.jsx)(Rt, { content: r }) : l(At);
1419
+ case "spreadsheet": return l("Download to open this workbook in a spreadsheet app.");
1420
+ case "binary": return c ? /* @__PURE__ */ (0, J.jsx)(Rt, { content: r }) : l(i ? kt : Q);
1421
+ }
1422
+ }
1423
+ function Vt({ filename: e, content: t, blobUrl: n, mimeType: r, size: i, urlTransform: a, onClose: o, onDownload: s, hideHeader: c = !1, className: l }) {
1424
+ let u = j(e, r), d = D(u);
1425
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
1426
+ className: h("flex flex-col h-full", l),
1427
+ children: [!c && /* @__PURE__ */ (0, J.jsxs)("div", {
1428
+ className: "flex items-center gap-2 px-3 py-2 border-b border-border shrink-0",
1429
+ children: [
1430
+ /* @__PURE__ */ (0, J.jsxs)("div", {
1431
+ className: "min-w-0 flex-1",
1432
+ children: [/* @__PURE__ */ (0, J.jsx)("div", {
1433
+ className: "truncate text-sm font-medium text-foreground",
1434
+ children: e
1435
+ }), /* @__PURE__ */ (0, J.jsx)("div", {
1436
+ className: "mt-0.5 text-[11px] uppercase tracking-[0.12em] text-muted-foreground",
1437
+ children: d
1438
+ })]
1439
+ }),
1440
+ s && /* @__PURE__ */ (0, J.jsx)("button", {
1441
+ type: "button",
1442
+ onClick: s,
1443
+ "aria-label": `Download ${e}`,
1444
+ className: "p-1.5 rounded-[var(--radius-sm)] hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",
1445
+ children: /* @__PURE__ */ (0, J.jsx)(fe, { className: "h-4 w-4" })
1446
+ }),
1447
+ o && /* @__PURE__ */ (0, J.jsx)("button", {
1448
+ type: "button",
1449
+ onClick: o,
1450
+ "aria-label": `Close ${e}`,
1451
+ className: "p-1.5 rounded-[var(--radius-sm)] hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",
1452
+ children: /* @__PURE__ */ (0, J.jsx)(I, { className: "h-4 w-4" })
1453
+ })
1454
+ ]
1455
+ }), /* @__PURE__ */ (0, J.jsx)("div", {
1456
+ className: "flex min-h-0 flex-1 flex-col overflow-auto p-3",
1457
+ children: /* @__PURE__ */ (0, J.jsx)(Bt, {
1458
+ kind: u,
1459
+ filename: e,
1460
+ mimeType: r,
1461
+ content: t,
1462
+ blobUrl: n,
1463
+ size: i,
1464
+ urlTransform: a,
1465
+ onDownload: s
1466
+ })
1467
+ })]
1468
+ });
1469
+ }
1470
+ //#endregion
1471
+ //#region node_modules/.pnpm/@tangle-network+ui@11.51.1_@nanostores+react@1.1.0_nanostores@1.5.5_react@19.3.0__@shik_a7187ff5a73f27dfe4cc06a400b0c7a3/node_modules/@tangle-network/ui/dist/files/file-tabs.js
1472
+ function Ht(e) {
1473
+ let t = e.split(".").pop()?.toLowerCase() || "";
1474
+ return ["pdf"].includes(t) ? b : ["csv", "xlsx"].includes(t) ? K : W;
1475
+ }
1476
+ function Ut(e) {
1477
+ let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
1478
+ for (let t of e) n.set(t.name, [...n.get(t.name) ?? [], t]);
1479
+ for (let e of n.values()) {
1480
+ if (e.length < 2) continue;
1481
+ let n = e.map((e) => e.path.replace(/\/+$/, "").split("/").slice(0, -1).reverse());
1482
+ e.forEach((e, r) => {
1483
+ let i = n[r], a = i.findIndex((e, t) => n.every((n, i) => i === r || n[t] !== e)), o = i[a >= 0 ? a : 0];
1484
+ o && t.set(e.id, o);
1485
+ });
1486
+ }
1487
+ return t;
1488
+ }
1489
+ function Wt(e) {
1490
+ if (e.length <= 18) return [e, ""];
1491
+ let t = e.lastIndexOf("."), n = Math.min(Math.max((t > 0 ? e.length - t : 0) + 6, 8), 12);
1492
+ return [e.slice(0, -n), e.slice(-n)];
1493
+ }
1494
+ function Gt({ tabs: e, activeId: t, onSelect: n, onClose: r, label: i = "Open files", className: o }) {
1495
+ let s = (0, q.useRef)(null);
1496
+ if ((0, q.useEffect)(() => {
1497
+ let e = s.current, t = e?.querySelector("[aria-selected=\"true\"]")?.parentElement;
1498
+ e && t && (e.scrollLeft = Math.min(t.offsetLeft, Math.max(e.scrollLeft, t.offsetLeft + t.offsetWidth - e.clientWidth)));
1499
+ }, [t, e.length]), e.length === 0) return null;
1500
+ let c = Ut(e), l = () => [...s.current?.querySelectorAll("[role=\"tab\"]") ?? []];
1501
+ return /* @__PURE__ */ (0, J.jsx)("div", {
1502
+ ref: s,
1503
+ role: "tablist",
1504
+ "aria-label": i,
1505
+ onKeyDown: (t) => {
1506
+ let i = l().indexOf(t.target), a = e.length - 1, o = {
1507
+ ArrowRight: i === a ? 0 : i + 1,
1508
+ ArrowLeft: i === 0 ? a : i - 1,
1509
+ Home: 0,
1510
+ End: a
1511
+ }[t.key];
1512
+ if (!(i < 0 || o === void 0 && t.key !== "Delete")) {
1513
+ if (t.preventDefault(), o !== void 0) {
1514
+ l()[o]?.focus(), n(e[o].id);
1515
+ return;
1516
+ }
1517
+ r(e[i].id), requestAnimationFrame(() => (l().find((e) => e.getAttribute("aria-selected") === "true") ?? l().at(-1))?.focus());
1518
+ }
1519
+ },
1520
+ className: h("relative flex h-10 min-w-0 items-end gap-1 overflow-x-auto px-2 shadow-[inset_0_-1px_0_hsl(var(--border))] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", o),
1521
+ children: e.map((i, o) => {
1522
+ let s = i.id === t, l = !s && e[o + 1] !== void 0 && e[o + 1].id !== t, u = c.get(i.id), d = Ht(i.name), [f, p] = Wt(i.name);
1523
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
1524
+ title: i.path,
1525
+ className: h("group relative flex h-[calc(100%-0.375rem)] max-w-72 shrink-0 items-center rounded-t-lg border border-b-0 text-sm", m, s ? "border-border bg-card text-foreground" : "border-transparent text-muted-foreground hover:bg-[var(--ix-hover-bg)] hover:text-foreground", l && "after:absolute after:-right-[3px] after:top-1/2 after:h-4 after:w-px after:-translate-y-1/2 after:bg-border"),
1526
+ children: [/* @__PURE__ */ (0, J.jsxs)("button", {
1527
+ type: "button",
1528
+ role: "tab",
1529
+ "aria-selected": s,
1530
+ "aria-label": `${i.name}${u ? ` in ${u}` : ""}${i.dirty ? ", unsaved changes" : ""}`,
1531
+ tabIndex: s || !t && i === e[0] ? 0 : -1,
1532
+ onClick: () => n(i.id),
1533
+ className: h("flex h-full min-w-0 items-center gap-1.5 rounded-t-lg pl-3 pr-1", a),
1534
+ children: [
1535
+ /* @__PURE__ */ (0, J.jsx)(d, {
1536
+ "aria-hidden": !0,
1537
+ className: "size-3.5 shrink-0 text-muted-foreground"
1538
+ }),
1539
+ /* @__PURE__ */ (0, J.jsxs)("span", {
1540
+ className: "flex min-w-0",
1541
+ children: [/* @__PURE__ */ (0, J.jsx)("span", {
1542
+ className: "overflow-hidden text-ellipsis whitespace-pre",
1543
+ children: f
1544
+ }), p && /* @__PURE__ */ (0, J.jsx)("span", {
1545
+ className: "shrink-0 whitespace-pre",
1546
+ children: p
1547
+ })]
1548
+ }),
1549
+ u && /* @__PURE__ */ (0, J.jsxs)("span", {
1550
+ className: "min-w-0 truncate text-muted-foreground",
1551
+ children: ["· ", u]
1552
+ }),
1553
+ i.dirty && /* @__PURE__ */ (0, J.jsx)("span", {
1554
+ "aria-hidden": !0,
1555
+ className: "size-1.5 shrink-0 rounded-full bg-[var(--accent-text)]"
1556
+ })
1557
+ ]
1558
+ }), /* @__PURE__ */ (0, J.jsx)("button", {
1559
+ type: "button",
1560
+ tabIndex: -1,
1561
+ "aria-label": `Close ${i.name}`,
1562
+ onClick: () => r(i.id),
1563
+ className: h("mr-1.5 grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-[var(--ix-hover-bg)] hover:text-foreground", m, !s && "opacity-0 group-focus-within:opacity-100 group-hover:opacity-100"),
1564
+ children: /* @__PURE__ */ (0, J.jsx)(I, {
1565
+ "aria-hidden": !0,
1566
+ className: "size-3"
1567
+ })
1568
+ })]
1569
+ }, i.id);
1570
+ })
1571
+ });
1572
+ }
1573
+ //#endregion
1574
+ //#region src/workspace/run-files.ts
1575
+ var Kt = {
1576
+ path: H(),
1577
+ href: H(),
1578
+ bytes: re().nonnegative().nullable(),
1579
+ sha256: H().regex(/^[a-f0-9]{64}$/).nullable(),
1580
+ kind: H(),
1581
+ source: ae([
1582
+ "knowledge",
1583
+ "output",
1584
+ "attachment",
1585
+ "submitted result",
1586
+ "receipt"
1587
+ ]),
1588
+ objectId: H().optional()
1589
+ }, qt = U(Kt).catchall(V()), Jt = qt.extend({ alternates: ne(qt).optional() }), Yt = U({
1590
+ schema: B("agent-workspace.run-files.v1"),
1591
+ runId: H(),
1592
+ generatedAt: H(),
1593
+ version: H().regex(/^[a-f0-9]{40}$/).nullable(),
1594
+ scope: B("retained_artifacts"),
1595
+ scopeDetails: H(),
1596
+ complete: ie(),
1597
+ state: ae([
1598
+ "available",
1599
+ "partial",
1600
+ "unavailable"
1601
+ ]),
1602
+ reason: H().nullable(),
1603
+ items: ne(Jt),
1604
+ history: U({
1605
+ state: ae(["available", "unavailable"]),
1606
+ reason: H().nullable(),
1607
+ complete: ie().optional(),
1608
+ omittedVersions: re().nonnegative().nullable().optional(),
1609
+ versions: ne(U({
1610
+ commit: H().regex(/^[a-f0-9]{40}$/),
1611
+ label: H(),
1612
+ at: H().nullable(),
1613
+ subject: H()
1614
+ }).catchall(V()))
1615
+ }).catchall(V()),
1616
+ source: U({
1617
+ runDocumentStale: oe([ie(), U({
1618
+ asOf: H().nullable(),
1619
+ refreshing: B(!0)
1620
+ }).catchall(V())]).optional(),
1621
+ meaning: H()
1622
+ }).catchall(V()),
1623
+ provenanceHref: H()
1624
+ }).catchall(V());
1625
+ function Xt(e, t, n, r) {
1626
+ let i = Yt.parse(e);
1627
+ if (i.runId !== t || i.version !== n) throw Error("The file inventory does not match the requested run and version.");
1628
+ let a = /* @__PURE__ */ new Set();
1629
+ for (let e of i.items) {
1630
+ if (a.has(e.path)) throw Error("The file inventory contains duplicate paths.");
1631
+ a.add(e.path);
1632
+ for (let n of [e, ...e.alternates ?? []]) {
1633
+ if (n.path !== e.path || !n.path || n.path.startsWith("/") || /[\\\u0000-\u001f]/.test(n.path) || n.path.split("/").some((e) => e === ".." || e === "." || !e)) throw Error("The file inventory contains an invalid retained path.");
1634
+ let i = `${r}/runs/${encodeURIComponent(t)}/`, a = "https://agent-workspace.invalid", o = new URL(n.href, a), s = new URL(i, a);
1635
+ if (o.origin !== s.origin || ![
1636
+ "final/",
1637
+ "page/",
1638
+ "artifact/",
1639
+ "receipt/"
1640
+ ].some((e) => n.href.startsWith(i + e) && o.pathname.startsWith(s.pathname + e))) throw Error("The file inventory contains a content route outside this run.");
1641
+ }
1642
+ }
1643
+ if (i.provenanceHref !== `/run/${encodeURIComponent(t)}?section=profiles`) throw Error("The file inventory provenance does not match this run.");
1644
+ return i;
1645
+ }
1646
+ function Zt(e) {
1647
+ return typeof window > "u" ? null : z(e.href, window.location.href);
1648
+ }
1649
+ function Qt(e, t) {
1650
+ return !!(e?.version && e.state === "available" && e.complete && t.source === "knowledge" && t.path.startsWith("pages/") && !e.items.some((e) => e.path === t.path));
1651
+ }
1652
+ //#endregion
1653
+ //#region node_modules/.pnpm/@tangle-network+sandbox-ui@2.0.15_b185337ee4bca5ec0279ca525649b58b/node_modules/@tangle-network/sandbox-ui/dist/tree-data-C8CNt4WE.js
1654
+ var $t = "tangle:vault-tree:", en = {
1655
+ added: {
1656
+ letter: "A",
1657
+ ink: "text-[var(--surface-success-text)]"
1658
+ },
1659
+ modified: {
1660
+ letter: "M",
1661
+ ink: "text-[var(--surface-warning-text)]"
1662
+ },
1663
+ deleted: {
1664
+ letter: "D",
1665
+ ink: "text-[var(--surface-danger-text)]"
1666
+ }
1667
+ }, tn = 12;
1668
+ function nn(e) {
1669
+ if (!e || typeof window > "u") return null;
1670
+ try {
1671
+ return window.localStorage;
1672
+ } catch {
1673
+ return null;
1674
+ }
1675
+ }
1676
+ function rn(e) {
1677
+ let t = nn(e);
1678
+ if (!t) return /* @__PURE__ */ new Set();
1679
+ try {
1680
+ let n = t.getItem($t + e), r = n ? JSON.parse(n) : [];
1681
+ return new Set(Array.isArray(r) ? r.filter((e) => typeof e == "string") : []);
1682
+ } catch {
1683
+ return /* @__PURE__ */ new Set();
1684
+ }
1685
+ }
1686
+ function an(e, t) {
1687
+ let n = nn(e);
1688
+ if (n) try {
1689
+ let r = [...t].slice(-1e3);
1690
+ r.length === 0 ? n.removeItem($t + e) : n.setItem($t + e, JSON.stringify(r));
1691
+ } catch {}
1692
+ }
1693
+ var on = new Intl.Collator(void 0, {
1694
+ numeric: !0,
1695
+ sensitivity: "base"
1696
+ });
1697
+ function sn(e) {
1698
+ return e?.length ? [...e].sort((e, t) => e.type === t.type ? on.compare(e.name, t.name) : e.type === "directory" ? -1 : 1) : [];
1699
+ }
1700
+ var cn = {
1701
+ blue: "text-[var(--tone-blue-icon)]",
1702
+ orange: "text-[var(--tone-orange-icon)]",
1703
+ lime: "text-[var(--tone-lime-icon)]",
1704
+ brown: "text-[var(--tone-brown-icon)]",
1705
+ pink: "text-[var(--tone-pink-icon)]",
1706
+ teal: "text-[var(--tone-teal-icon)]",
1707
+ cyan: "text-[var(--tone-cyan-icon)]",
1708
+ violet: "text-[var(--tone-violet-icon)]"
1709
+ }, $ = (e) => cn[e], ln = {
1710
+ "readme.md": {
1711
+ Icon: ce,
1712
+ ink: $("blue")
1713
+ },
1714
+ "cargo.toml": {
1715
+ Icon: F,
1716
+ ink: $("orange")
1717
+ },
1718
+ "package.json": {
1719
+ Icon: F,
1720
+ ink: $("lime")
1721
+ },
1722
+ license: {
1723
+ Icon: Fe,
1724
+ ink: $("brown")
1725
+ },
1726
+ "license.md": {
1727
+ Icon: Fe,
1728
+ ink: $("brown")
1729
+ },
1730
+ dockerfile: {
1731
+ Icon: G,
1732
+ ink: $("blue")
1733
+ },
1734
+ makefile: {
1735
+ Icon: De,
1736
+ ink: $("brown")
1737
+ }
1738
+ }, un = {
1739
+ md: {
1740
+ Icon: b,
1741
+ ink: $("blue")
1742
+ },
1743
+ mdx: {
1744
+ Icon: b,
1745
+ ink: $("blue")
1746
+ },
1747
+ txt: {
1748
+ Icon: b,
1749
+ ink: "text-muted-foreground"
1750
+ },
1751
+ pdf: {
1752
+ Icon: b,
1753
+ ink: $("pink")
1754
+ },
1755
+ doc: {
1756
+ Icon: b,
1757
+ ink: $("blue")
1758
+ },
1759
+ docx: {
1760
+ Icon: b,
1761
+ ink: $("blue")
1762
+ },
1763
+ csv: {
1764
+ Icon: K,
1765
+ ink: $("teal")
1766
+ },
1767
+ tsv: {
1768
+ Icon: K,
1769
+ ink: $("teal")
1770
+ },
1771
+ xls: {
1772
+ Icon: K,
1773
+ ink: $("teal")
1774
+ },
1775
+ xlsx: {
1776
+ Icon: K,
1777
+ ink: $("teal")
1778
+ },
1779
+ json: {
1780
+ Icon: ue,
1781
+ ink: $("lime")
1782
+ },
1783
+ jsonl: {
1784
+ Icon: ue,
1785
+ ink: $("lime")
1786
+ },
1787
+ png: {
1788
+ Icon: C,
1789
+ ink: $("pink")
1790
+ },
1791
+ jpg: {
1792
+ Icon: C,
1793
+ ink: $("pink")
1794
+ },
1795
+ jpeg: {
1796
+ Icon: C,
1797
+ ink: $("pink")
1798
+ },
1799
+ gif: {
1800
+ Icon: C,
1801
+ ink: $("pink")
1802
+ },
1803
+ webp: {
1804
+ Icon: C,
1805
+ ink: $("pink")
1806
+ },
1807
+ svg: {
1808
+ Icon: C,
1809
+ ink: $("pink")
1810
+ },
1811
+ ts: {
1812
+ Icon: W,
1813
+ ink: $("blue")
1814
+ },
1815
+ tsx: {
1816
+ Icon: W,
1817
+ ink: $("blue")
1818
+ },
1819
+ js: {
1820
+ Icon: W,
1821
+ ink: $("lime")
1822
+ },
1823
+ jsx: {
1824
+ Icon: W,
1825
+ ink: $("lime")
1826
+ },
1827
+ mjs: {
1828
+ Icon: W,
1829
+ ink: $("lime")
1830
+ },
1831
+ cjs: {
1832
+ Icon: W,
1833
+ ink: $("lime")
1834
+ },
1835
+ rs: {
1836
+ Icon: W,
1837
+ ink: $("orange")
1838
+ },
1839
+ py: {
1840
+ Icon: W,
1841
+ ink: $("blue")
1842
+ },
1843
+ go: {
1844
+ Icon: W,
1845
+ ink: $("cyan")
1846
+ },
1847
+ sh: {
1848
+ Icon: De,
1849
+ ink: $("brown")
1850
+ },
1851
+ html: {
1852
+ Icon: W,
1853
+ ink: $("orange")
1854
+ },
1855
+ css: {
1856
+ Icon: W,
1857
+ ink: $("violet")
1858
+ },
1859
+ toml: {
1860
+ Icon: G,
1861
+ ink: $("violet")
1862
+ },
1863
+ yaml: {
1864
+ Icon: G,
1865
+ ink: $("violet")
1866
+ },
1867
+ yml: {
1868
+ Icon: G,
1869
+ ink: $("violet")
1870
+ },
1871
+ ini: {
1872
+ Icon: G,
1873
+ ink: $("violet")
1874
+ },
1875
+ lock: {
1876
+ Icon: Se,
1877
+ ink: "text-muted-foreground"
1878
+ }
1879
+ };
1880
+ function dn(e) {
1881
+ let t = e.toLowerCase();
1882
+ if (ln[t]) return ln[t];
1883
+ if (t.startsWith(".git")) return {
1884
+ Icon: R,
1885
+ ink: $("orange")
1886
+ };
1887
+ let n = t.lastIndexOf(".");
1888
+ return n > 0 && un[t.slice(n + 1)] || {
1889
+ Icon: ke,
1890
+ ink: "text-muted-foreground"
1891
+ };
1892
+ }
1893
+ function fn({ root: e, selectedPath: t, activeFolder: n, onSelect: r, onFolderToggle: i, onFolderSelect: a, storageKey: o, expandAll: s = !1, label: c = "Files", status: l, className: u }) {
1894
+ let [d, f] = (0, q.useState)(() => ({
1895
+ key: o,
1896
+ expanded: rn(o)
1897
+ })), p = d;
1898
+ d.key !== o && (p = {
1899
+ key: o,
1900
+ expanded: rn(o)
1901
+ }, f(p));
1902
+ let m = p.expanded, [h, _] = (0, q.useState)(() => /* @__PURE__ */ new Map()), [v, y] = (0, q.useState)(null), b = (0, q.useRef)(/* @__PURE__ */ new Map()), S = (0, q.useRef)(null), C = (0, q.useRef)(null), w = (0, q.useMemo)(() => {
1903
+ let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = (e, a) => {
1904
+ if (t.set(e.path, e), n.set(e.path, a), e.type === "directory") {
1905
+ let t = sn(e.children);
1906
+ r.set(e.path, t);
1907
+ for (let n of t) i(n, e.path);
1908
+ }
1909
+ }, a = sn(e.children);
1910
+ r.set(null, a);
1911
+ for (let e of a) i(e, null);
1912
+ return {
1913
+ nodes: t,
1914
+ parents: n,
1915
+ children: r
1916
+ };
1917
+ }, [e]), E = (0, q.useCallback)((e) => s || m.has(e), [s, m]), D = (0, q.useMemo)(() => {
1918
+ let e = [], t = (n, r) => {
1919
+ let i = w.children.get(n) ?? [], a = n === null ? i.length : Math.max(200, h.get(n) ?? 0), o = Math.min(i.length, a);
1920
+ i.slice(0, o).forEach((a, o) => {
1921
+ e.push({
1922
+ kind: "node",
1923
+ node: a,
1924
+ depth: r,
1925
+ parent: n,
1926
+ posInSet: o + 1,
1927
+ setSize: i.length
1928
+ }), a.type === "directory" && E(a.path) && t(a.path, r + 1);
1929
+ }), n !== null && o < i.length && e.push({
1930
+ kind: "more",
1931
+ parent: n,
1932
+ depth: r,
1933
+ hidden: i.length - o
1934
+ });
1935
+ };
1936
+ return t(null, 0), e;
1937
+ }, [
1938
+ w,
1939
+ E,
1940
+ h
1941
+ ]), O = (0, q.useMemo)(() => D.filter((e) => e.kind === "node"), [D]), k = (0, q.useCallback)((e) => {
1942
+ f((t) => {
1943
+ let n = t.key === o ? t.expanded : rn(o), r = new Set(n);
1944
+ return e(r), an(o, r), {
1945
+ key: o,
1946
+ expanded: r
1947
+ };
1948
+ });
1949
+ }, [o]), A = (0, q.useCallback)((e, t) => {
1950
+ s || m.has(e) === t || (k((n) => {
1951
+ t ? n.add(e) : n.delete(e);
1952
+ }), i?.(e, t));
1953
+ }, [
1954
+ s,
1955
+ m,
1956
+ k,
1957
+ i
1958
+ ]);
1959
+ (0, q.useEffect)(() => {
1960
+ if (!t || !w.nodes.has(t)) return;
1961
+ let e = [];
1962
+ for (let n = w.parents.get(t) ?? null; n; n = w.parents.get(n) ?? null) e.push(n);
1963
+ C.current = t, e.some((e) => !m.has(e)) && k((t) => {
1964
+ for (let n of e) t.add(n);
1965
+ });
1966
+ }, [t, w]), (0, q.useEffect)(() => {
1967
+ let e = C.current;
1968
+ if (e && b.current.has(e)) {
1969
+ C.current = null;
1970
+ let t = b.current.get(e);
1971
+ t && g(t);
1972
+ }
1973
+ let t = S.current;
1974
+ t && b.current.has(t) && (S.current = null, b.current.get(t)?.focus());
1975
+ }, [D]);
1976
+ let j = (0, q.useMemo)(() => new Set(O.map((e) => e.node.path)), [O]), M = v && j.has(v) && v || t && j.has(t) && t || O[0]?.node.path || null, N = (0, q.useCallback)((e) => {
1977
+ if (!e) return;
1978
+ y(e);
1979
+ let t = b.current.get(e);
1980
+ t ? t.focus() : S.current = e;
1981
+ }, []), P = (0, q.useCallback)((e) => {
1982
+ y(e.path), e.type === "directory" ? (A(e.path, !E(e.path)), a?.(e.path)) : r(e.path);
1983
+ }, [
1984
+ E,
1985
+ r,
1986
+ a,
1987
+ A
1988
+ ]), F = (0, q.useCallback)((e, t) => {
1989
+ let n = O.findIndex((e) => e.node.path === t.path);
1990
+ if (n < 0) return;
1991
+ let r = t.type === "directory", i = r && E(t.path), a = !0;
1992
+ switch (e.key) {
1993
+ case "ArrowDown":
1994
+ N(O[n + 1]?.node.path);
1995
+ break;
1996
+ case "ArrowUp":
1997
+ N(O[n - 1]?.node.path);
1998
+ break;
1999
+ case "Home":
2000
+ N(O[0]?.node.path);
2001
+ break;
2002
+ case "End":
2003
+ N(O[O.length - 1]?.node.path);
2004
+ break;
2005
+ case "ArrowRight":
2006
+ if (r && !i) A(t.path, !0);
2007
+ else if (i) {
2008
+ let e = O[n + 1];
2009
+ e?.parent === t.path && N(e.node.path);
2010
+ }
2011
+ break;
2012
+ case "ArrowLeft":
2013
+ i && !s ? A(t.path, !1) : N(w.parents.get(t.path));
2014
+ break;
2015
+ case "Enter":
2016
+ case " ":
2017
+ P(t);
2018
+ break;
2019
+ default: a = !1;
2020
+ }
2021
+ a && (e.preventDefault(), e.stopPropagation());
2022
+ }, [
2023
+ O,
2024
+ E,
2025
+ N,
2026
+ A,
2027
+ s,
2028
+ w,
2029
+ P
2030
+ ]), I = (0, q.useMemo)(() => {
2031
+ let e = /* @__PURE__ */ new Map();
2032
+ for (let [t, n] of Object.entries(l ?? {})) {
2033
+ let r = t.lastIndexOf("/");
2034
+ for (; r > 0;) {
2035
+ let i = t.slice(0, r);
2036
+ e.get(i) !== "modified" && e.set(i, n === "added" ? "added" : "modified"), r = i.lastIndexOf("/");
2037
+ }
2038
+ }
2039
+ return e;
2040
+ }, [l]), ee = t ? w.parents.get(t) ?? null : null;
2041
+ return /* @__PURE__ */ (0, J.jsx)("div", {
2042
+ role: "tree",
2043
+ "aria-label": c,
2044
+ "data-vault-tree-rows": !0,
2045
+ className: `flex flex-col gap-px ${u ?? ""}`,
2046
+ children: D.map((e) => {
2047
+ if (e.kind === "more") return /* @__PURE__ */ (0, J.jsxs)("button", {
2048
+ type: "button",
2049
+ onClick: () => _((t) => {
2050
+ let n = new Map(t);
2051
+ return n.set(e.parent, Math.max(200, t.get(e.parent) ?? 0) + 200), n;
2052
+ }),
2053
+ style: { paddingInlineStart: e.depth * tn + 28 },
2054
+ className: "flex min-h-8 w-full items-center rounded-md pr-2 text-left text-xs font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
2055
+ children: [
2056
+ "Show ",
2057
+ Math.min(e.hidden, 200),
2058
+ " more of ",
2059
+ e.hidden
2060
+ ]
2061
+ }, `more:${e.parent}`);
2062
+ let { node: r, depth: i } = e, a = r.type === "directory", o = a && E(r.path), s = !a && r.path === t, c = a && r.path === n, u = a ? {
2063
+ Icon: o ? x : T,
2064
+ ink: "text-muted-foreground"
2065
+ } : dn(r.name), d = u.Icon, f = a ? o ? void 0 : I.get(r.path) : l?.[r.path], p = [];
2066
+ for (let t = e.parent; t; t = w.parents.get(t) ?? null) p.unshift(t);
2067
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
2068
+ ref: (e) => {
2069
+ e ? b.current.set(r.path, e) : b.current.delete(r.path);
2070
+ },
2071
+ role: "treeitem",
2072
+ "aria-level": i + 1,
2073
+ "aria-posinset": e.posInSet,
2074
+ "aria-setsize": e.setSize,
2075
+ "aria-expanded": a ? o : void 0,
2076
+ "aria-selected": a ? void 0 : s,
2077
+ "aria-current": c ? "true" : void 0,
2078
+ tabIndex: r.path === M ? 0 : -1,
2079
+ title: r.path,
2080
+ "data-vault-tree-item": r.type,
2081
+ "data-path": r.path,
2082
+ "data-selected": s ? "true" : void 0,
2083
+ onClick: () => P(r),
2084
+ onFocus: () => y(r.path),
2085
+ onKeyDown: (e) => F(e, r),
2086
+ style: { paddingInlineStart: i * tn + 4 },
2087
+ className: [
2088
+ "group relative flex min-h-8 w-full cursor-pointer select-none items-center gap-1.5 rounded-md pr-2 text-sm transition-colors [@media(pointer:coarse)]:min-h-10",
2089
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
2090
+ s ? "bg-[var(--ix-sel-bg)] font-medium text-[var(--accent-text)]" : c ? "bg-muted font-medium text-foreground" : "text-foreground hover:bg-[var(--ix-hover-bg)]"
2091
+ ].join(" "),
2092
+ children: [
2093
+ p.map((e, t) => /* @__PURE__ */ (0, J.jsx)("span", {
2094
+ "aria-hidden": "true",
2095
+ className: `pointer-events-none absolute inset-y-0 w-px ${e === ee ? "bg-[var(--border-strong)]" : "bg-border"}`,
2096
+ style: { left: t * tn + 12 }
2097
+ }, e)),
2098
+ /* @__PURE__ */ (0, J.jsx)("span", {
2099
+ "aria-hidden": "true",
2100
+ className: "flex size-4 shrink-0 items-center justify-center text-muted-foreground",
2101
+ children: a && /* @__PURE__ */ (0, J.jsx)(L, { className: `size-3.5 transition-transform duration-fast ${o ? "rotate-90" : ""}` })
2102
+ }),
2103
+ /* @__PURE__ */ (0, J.jsx)(d, {
2104
+ "aria-hidden": "true",
2105
+ className: `size-4 shrink-0 ${u.ink}`
2106
+ }),
2107
+ /* @__PURE__ */ (0, J.jsx)("span", {
2108
+ className: "min-w-0 flex-1 truncate",
2109
+ children: r.name
2110
+ }),
2111
+ f && (a ? /* @__PURE__ */ (0, J.jsx)("span", {
2112
+ "aria-label": `holds ${f === "added" ? "added" : "changed"} files`,
2113
+ className: `size-1.5 shrink-0 rounded-full ${f === "added" ? "bg-[var(--surface-success-text)]" : "bg-[var(--surface-warning-text)]"}`
2114
+ }) : /* @__PURE__ */ (0, J.jsx)("span", {
2115
+ "aria-label": f,
2116
+ className: `w-3.5 shrink-0 text-center font-mono text-xs font-semibold ${en[f].ink}`,
2117
+ children: en[f].letter
2118
+ }))
2119
+ ]
2120
+ }, r.path);
2121
+ })
2122
+ });
2123
+ }
2124
+ function pn(e) {
2125
+ let t = [], n = /* @__PURE__ */ new Map(), r = (e) => {
2126
+ if (!e) return t;
2127
+ let i = n.get(e);
2128
+ if (i) return i.children ??= [];
2129
+ let a = e.lastIndexOf("/"), o = {
2130
+ name: e.slice(a + 1),
2131
+ path: e,
2132
+ type: "directory",
2133
+ children: []
2134
+ };
2135
+ return n.set(e, o), r(a < 0 ? "" : e.slice(0, a)).push(o), o.children;
2136
+ };
2137
+ for (let t of e) {
2138
+ let e = t.replace(/^(\.\/|\/)+/, "").replace(/\/+$/, "");
2139
+ if (!e) continue;
2140
+ if (t.endsWith("/")) {
2141
+ r(e);
2142
+ continue;
2143
+ }
2144
+ let n = e.lastIndexOf("/");
2145
+ r(n < 0 ? "" : e.slice(0, n)).push({
2146
+ name: e.slice(n + 1),
2147
+ path: e,
2148
+ type: "file"
2149
+ });
2150
+ }
2151
+ return t;
2152
+ }
2153
+ function mn(e, t) {
2154
+ let n = t.trim().toLowerCase();
2155
+ if (!n) return [...e];
2156
+ let r = [];
2157
+ for (let t of e) if (t.name.toLowerCase().includes(n)) r.push(t);
2158
+ else if (t.type === "directory") {
2159
+ let e = mn(t.children ?? [], n);
2160
+ e.length > 0 && r.push({
2161
+ ...t,
2162
+ children: e
2163
+ });
2164
+ }
2165
+ return r;
2166
+ }
2167
+ r();
2168
+ var hn = 864e5;
2169
+ 7 * hn, 30 * hn, 365 * hn;
2170
+ function gn(e = {}) {
2171
+ let t = e.appPathPrefix ?? "/app";
2172
+ return function(e) {
2173
+ let { currentUrl: n, nextUrl: r, formMethod: i, defaultShouldRevalidate: a } = e;
2174
+ return i && i !== "GET" ? !0 : n.pathname !== r.pathname && n.pathname.startsWith(t) && r.pathname.startsWith(t) ? !1 : a;
2175
+ };
2176
+ }
2177
+ gn();
2178
+ var _n = 640, vn = 280, yn = 200;
2179
+ function bn(e, t) {
2180
+ let n = e ? `${e}:sidebar-width` : void 0, [r, i] = (0, q.useState)(() => {
2181
+ if (!n) return vn;
2182
+ try {
2183
+ let e = Number(globalThis.localStorage?.getItem(n));
2184
+ return Number.isFinite(e) && e > 0 ? e : vn;
2185
+ } catch {
2186
+ return vn;
2187
+ }
2188
+ }), a = Math.max(yn, t > 0 ? Math.floor(t / 2) : 560), o = Math.min(a, Math.max(yn, r)), s = (e) => {
2189
+ let t = Math.min(a, Math.max(yn, Math.round(e)));
2190
+ if (i(t), n) try {
2191
+ globalThis.localStorage?.setItem(n, String(t));
2192
+ } catch {}
2193
+ };
2194
+ return {
2195
+ width: o,
2196
+ min: yn,
2197
+ max: a,
2198
+ set: s,
2199
+ reset: () => s(vn)
2200
+ };
2201
+ }
2202
+ var xn = "flex h-11 shrink-0 pointer-coarse:h-14 items-center bg-background shadow-[inset_0_-1px_0_hsl(var(--border))] [--field-surface:hsl(var(--card))]";
2203
+ function Sn({ sidebar: e, label: t }) {
2204
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
2205
+ role: "separator",
2206
+ "aria-orientation": "vertical",
2207
+ "aria-label": `Resize ${t.toLowerCase()} sidebar`,
2208
+ "aria-valuenow": e.width,
2209
+ "aria-valuemin": e.min,
2210
+ "aria-valuemax": e.max,
2211
+ tabIndex: 0,
2212
+ onDoubleClick: e.reset,
2213
+ onKeyDown: (t) => {
2214
+ let n = t.shiftKey ? 64 : 16;
2215
+ if (t.key === "ArrowLeft") e.set(e.width - n);
2216
+ else if (t.key === "ArrowRight") e.set(e.width + n);
2217
+ else if (t.key === "Home") e.set(e.min);
2218
+ else if (t.key === "End") e.set(e.max);
2219
+ else return;
2220
+ t.preventDefault();
2221
+ },
2222
+ onPointerDown: (t) => {
2223
+ let n = t.currentTarget, r = t.clientX, i = e.width;
2224
+ n.setPointerCapture(t.pointerId);
2225
+ let a = (t) => e.set(i + t.clientX - r), o = () => {
2226
+ n.removeEventListener("pointermove", a), n.removeEventListener("pointerup", o);
2227
+ };
2228
+ n.addEventListener("pointermove", a), n.addEventListener("pointerup", o);
2229
+ },
2230
+ className: "group relative z-10 -mr-px w-px shrink-0 cursor-col-resize touch-none outline-none",
2231
+ children: [/* @__PURE__ */ (0, J.jsx)("span", {
2232
+ "aria-hidden": !0,
2233
+ className: "absolute bottom-0 left-0 top-11 w-px pointer-coarse:top-14 bg-border transition-colors group-hover:bg-ring group-focus-visible:bg-ring"
2234
+ }), /* @__PURE__ */ (0, J.jsx)("span", {
2235
+ "aria-hidden": !0,
2236
+ className: "absolute bottom-0 -left-1 top-11 w-[9px] pointer-coarse:top-14"
2237
+ })]
2238
+ });
2239
+ }
2240
+ function Cn(e) {
2241
+ let t = /* @__PURE__ */ new Map(), n = (e) => {
2242
+ t.set(e.path, e), e.children?.forEach(n);
2243
+ };
2244
+ return e.forEach(n), t;
2245
+ }
2246
+ function wn(e) {
2247
+ let t = e.ownerDocument.activeElement;
2248
+ if (!e.contains(t)) return null;
2249
+ for (; t?.shadowRoot?.activeElement;) t = t.shadowRoot.activeElement;
2250
+ return t instanceof HTMLElement ? t : null;
2251
+ }
2252
+ function Tn({ root: e, paths: t, selectedPath: n, onSelect: r, preview: i, onBack: a, emptyState: o, expansionKey: s, search: c = !0, label: l = "Files", headerActions: u, surface: d = "card", layout: f = "split", tabs: p = !0, expandable: m = !0, status: g, className: v, style: y }) {
2253
+ let b = d === "plain", S = (0, q.useRef)(null), [C, w] = (0, q.useState)(0);
2254
+ (0, q.useEffect)(() => {
2255
+ let e = S.current;
2256
+ if (!e || typeof ResizeObserver > "u") return;
2257
+ let t = new ResizeObserver(([e]) => w(e.contentRect.width));
2258
+ return t.observe(e), () => t.disconnect();
2259
+ }, []);
2260
+ let T = f === "split" && (C === 0 || C >= _n), E = bn(s, C), [D, O] = (0, q.useState)(!1);
2261
+ (0, q.useEffect)(() => {
2262
+ if (!D) return;
2263
+ let e = (e) => {
2264
+ e.key !== "Escape" || e.defaultPrevented || (e.preventDefault(), O(!1));
2265
+ };
2266
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
2267
+ }, [D]);
2268
+ let k = (0, q.useMemo)(() => e ? e.path ? [e] : e.children ?? [] : pn(t ?? []), [e, t]), A = (0, q.useMemo)(() => Cn(k), [k]), [j, M] = (0, q.useState)(""), N = (0, q.useMemo)(() => mn(k, j), [k, j]), P = (0, q.useMemo)(() => ({
2269
+ name: l,
2270
+ path: "",
2271
+ type: "directory",
2272
+ children: N
2273
+ }), [l, N]), F = (0, q.useId)(), I = (0, q.useRef)(null), ee = (0, q.useRef)(null), te = (0, q.useRef)(null), L = (0, q.useRef)(!1), R = i !== void 0, z = k.length === 0, B = c && !z, ne = n?.replace(/^(\.\/|\/)+/, "").replace(/\/+$/, ""), re = (0, q.useRef)(!1), V = (0, q.useRef)(!1);
2274
+ return (0, q.useEffect)(() => {
2275
+ if (!re.current) {
2276
+ re.current = !0, L.current = R;
2277
+ return;
2278
+ }
2279
+ if (T) {
2280
+ L.current = R;
2281
+ return;
2282
+ }
2283
+ if (R && !L.current && V.current && ee.current?.focus({ preventScroll: !0 }), V.current = !1, !R && L.current) {
2284
+ let e = te.current;
2285
+ e?.isConnected ? e.focus({ preventScroll: !0 }) : I.current?.focus({ preventScroll: !0 });
2286
+ }
2287
+ L.current = R;
2288
+ }, [R, T]), /* @__PURE__ */ (0, J.jsxs)("div", {
2289
+ ref: S,
2290
+ "data-workspace-files-layout": T ? "split" : "stack",
2291
+ "data-expanded": D ? "" : void 0,
2292
+ className: h("flex h-full min-h-0 min-w-0 overflow-hidden bg-card text-card-foreground [--files-inset:0.75rem]", T ? "flex-row" : "flex-col", !b && "rounded-[var(--radius-lg)] border border-border shadow-[var(--edge-highlight),var(--shadow-card)]", v, D && "fixed inset-0 z-50 h-auto max-h-none w-auto max-w-none rounded-none border-0"),
2293
+ style: D ? void 0 : y,
2294
+ children: [
2295
+ /* @__PURE__ */ (0, J.jsx)("div", {
2296
+ ref: I,
2297
+ hidden: !T && R,
2298
+ tabIndex: -1,
2299
+ role: "region",
2300
+ "aria-label": "Workspace files",
2301
+ style: T ? { width: E.width } : void 0,
2302
+ className: h("flex min-h-0 flex-col outline-none", T ? "shrink-0" : "flex-1", !T && R && "hidden"),
2303
+ children: /* @__PURE__ */ (0, J.jsxs)("section", {
2304
+ "aria-labelledby": F,
2305
+ "data-workspace-files-surface": d,
2306
+ className: "flex min-h-0 flex-1 flex-col",
2307
+ children: [/* @__PURE__ */ (0, J.jsxs)("div", {
2308
+ className: h(xn, "gap-2 px-[var(--files-inset)]"),
2309
+ children: [
2310
+ /* @__PURE__ */ (0, J.jsx)("h2", {
2311
+ id: F,
2312
+ className: h("min-w-0 flex-1 truncate text-sm font-medium text-foreground", (b || B) && "sr-only"),
2313
+ children: l
2314
+ }),
2315
+ B && /* @__PURE__ */ (0, J.jsx)(We, {
2316
+ type: "search",
2317
+ size: "sm",
2318
+ value: j,
2319
+ onChange: (e) => M(e.target.value),
2320
+ placeholder: `Search ${l.toLowerCase()}…`,
2321
+ "aria-label": `Search ${l.toLowerCase()}`,
2322
+ className: "min-w-0 flex-1"
2323
+ }),
2324
+ u && /* @__PURE__ */ (0, J.jsx)("div", {
2325
+ className: "ml-auto flex shrink-0 items-center gap-1",
2326
+ children: u
2327
+ })
2328
+ ]
2329
+ }), /* @__PURE__ */ (0, J.jsx)("div", {
2330
+ className: "min-h-0 flex-1 overflow-y-auto px-[calc(var(--files-inset)_-_0.25rem)] py-2",
2331
+ children: z ? o === void 0 ? /* @__PURE__ */ (0, J.jsx)(Ke, {
2332
+ icon: /* @__PURE__ */ (0, J.jsx)(x, { className: "h-6 w-6" }),
2333
+ title: "No files yet"
2334
+ }) : o : N.length === 0 ? /* @__PURE__ */ (0, J.jsxs)("div", {
2335
+ className: "flex flex-col items-center gap-3 p-6 text-center",
2336
+ children: [/* @__PURE__ */ (0, J.jsxs)("p", {
2337
+ className: "max-w-xs break-words text-xs text-muted-foreground",
2338
+ children: [
2339
+ "No files match “",
2340
+ j.trim(),
2341
+ "”."
2342
+ ]
2343
+ }), /* @__PURE__ */ (0, J.jsx)(_, {
2344
+ type: "button",
2345
+ variant: "outline",
2346
+ size: "sm",
2347
+ onClick: () => M(""),
2348
+ children: "Clear search"
2349
+ })]
2350
+ }) : /* @__PURE__ */ (0, J.jsx)(fn, {
2351
+ root: P,
2352
+ selectedPath: ne,
2353
+ onSelect: (e) => {
2354
+ I.current && (te.current = wn(I.current)), V.current = !0, r?.(e, A.get(e));
2355
+ },
2356
+ onFolderSelect: (e) => r?.(`${e}/`, A.get(e)),
2357
+ storageKey: s,
2358
+ expandAll: j.trim().length > 0,
2359
+ label: l,
2360
+ status: g
2361
+ })
2362
+ })]
2363
+ })
2364
+ }),
2365
+ T && /* @__PURE__ */ (0, J.jsx)(Sn, {
2366
+ sidebar: E,
2367
+ label: l
2368
+ }),
2369
+ (T || i) && /* @__PURE__ */ (0, J.jsx)(Dn, {
2370
+ preview: i,
2371
+ split: T,
2372
+ tabs: T && p,
2373
+ empty: z,
2374
+ backRef: ee,
2375
+ onBack: a,
2376
+ onOpen: (e) => r?.(e, A.get(e)),
2377
+ expand: m ? {
2378
+ expanded: D,
2379
+ toggle: () => O((e) => !e)
2380
+ } : void 0
2381
+ })
2382
+ ]
2383
+ });
2384
+ }
2385
+ var En = (e) => e.replace(/\/+$/, "").split("/").pop() || e;
2386
+ function Dn({ preview: e, split: t, tabs: n, empty: r, backRef: i, onBack: a, onOpen: o, expand: s }) {
2387
+ let c = e?.path, [l, u] = (0, q.useState)(() => c ? [c] : []);
2388
+ (0, q.useEffect)(() => {
2389
+ c && u((e) => e.includes(c) ? e : [...e, c]);
2390
+ }, [c]);
2391
+ let [d, f] = (0, q.useState)("file");
2392
+ (0, q.useEffect)(() => f("file"), [c]);
2393
+ let p = (e) => {
2394
+ let t = l.indexOf(e), n = l.filter((t) => t !== e);
2395
+ if (u(n), e !== c) return;
2396
+ let r = n[Math.min(t, n.length - 1)];
2397
+ r ? o(r) : a?.();
2398
+ }, m = e?.compare, g = s?.expanded ? Ne : je;
2399
+ return /* @__PURE__ */ (0, J.jsxs)("div", {
2400
+ className: "flex min-h-0 min-w-0 flex-1 flex-col",
2401
+ children: [/* @__PURE__ */ (0, J.jsxs)("div", {
2402
+ className: h(xn, "sticky top-0 z-10 gap-2 pr-[var(--files-inset)]", !(n && l.length > 0) && "pl-[var(--files-inset)]", !t && "h-auto min-h-11 flex-wrap py-1.5 pointer-coarse:h-auto"),
2403
+ children: [
2404
+ a && !t && e && /* @__PURE__ */ (0, J.jsxs)(_, {
2405
+ ref: i,
2406
+ type: "button",
2407
+ variant: "ghost",
2408
+ size: "sm",
2409
+ onClick: a,
2410
+ className: "-ml-2 shrink-0 gap-1 px-2 text-muted-foreground",
2411
+ children: [/* @__PURE__ */ (0, J.jsx)(S, { "aria-hidden": "true" }), "Back to files"]
2412
+ }),
2413
+ n && l.length > 0 ? /* @__PURE__ */ (0, J.jsx)(Gt, {
2414
+ tabs: l.map((e) => ({
2415
+ id: e,
2416
+ name: En(e),
2417
+ path: e
2418
+ })),
2419
+ activeId: c,
2420
+ onSelect: o,
2421
+ onClose: p,
2422
+ className: "h-full flex-1 px-[var(--files-inset)]"
2423
+ }) : /* @__PURE__ */ (0, J.jsx)("span", {
2424
+ className: "min-w-0 flex-1 truncate text-sm text-foreground",
2425
+ title: c,
2426
+ children: c && En(c)
2427
+ }),
2428
+ m && /* @__PURE__ */ (0, J.jsx)(te, {
2429
+ "aria-label": "View",
2430
+ value: d,
2431
+ onValueChange: f,
2432
+ options: [{
2433
+ value: "file",
2434
+ label: "File"
2435
+ }, {
2436
+ value: "diff",
2437
+ label: `Diff vs ${m.label}`
2438
+ }],
2439
+ className: h("shrink-0 p-0.5 [&>button]:py-1", !t && "order-last")
2440
+ }),
2441
+ e?.actions && /* @__PURE__ */ (0, J.jsx)("div", {
2442
+ className: "flex shrink-0 items-center gap-2",
2443
+ children: e.actions
2444
+ }),
2445
+ s && /* @__PURE__ */ (0, J.jsx)(_, {
2446
+ type: "button",
2447
+ variant: "ghost",
2448
+ size: "icon-sm",
2449
+ onClick: s.toggle,
2450
+ "aria-pressed": s.expanded,
2451
+ "aria-label": s.expanded ? "Exit full screen" : "Full screen",
2452
+ title: s.expanded ? "Exit full screen (Esc)" : "Full screen",
2453
+ className: "shrink-0 text-muted-foreground",
2454
+ children: /* @__PURE__ */ (0, J.jsx)(g, { "aria-hidden": !0 })
2455
+ })
2456
+ ]
2457
+ }), e ? /* @__PURE__ */ (0, J.jsx)("div", {
2458
+ "data-primary-content": "",
2459
+ className: "flex min-h-0 flex-1 flex-col overflow-auto [&>*]:min-h-full",
2460
+ children: d === "diff" && m ? m.content : e.content
2461
+ }) : /* @__PURE__ */ (0, J.jsx)("div", {
2462
+ className: "flex min-h-0 min-w-0 flex-1 items-center justify-center p-6 text-sm text-muted-foreground",
2463
+ children: r ? null : "Select a file to open it here."
2464
+ })]
2465
+ });
2466
+ }
2467
+ //#endregion
2468
+ export { Vt as a, Zt as i, Xt as n, Qt as r, Tn as t };