@co0ontty/wand 4.102.0 → 4.103.0

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 (212) hide show
  1. package/dist/ai-team-live.js +1 -1
  2. package/dist/apns-client.d.ts +45 -0
  3. package/dist/apns-client.js +156 -0
  4. package/dist/apns-service.d.ts +29 -0
  5. package/dist/apns-service.js +156 -0
  6. package/dist/build-info.json +3 -3
  7. package/dist/conversation-service.d.ts +2 -0
  8. package/dist/conversation-service.js +23 -3
  9. package/dist/conversation-types.d.ts +2 -0
  10. package/dist/dingtalk-auth.d.ts +41 -0
  11. package/dist/dingtalk-auth.js +127 -0
  12. package/dist/dingtalk-dws.d.ts +45 -0
  13. package/dist/dingtalk-dws.js +240 -0
  14. package/dist/dingtalk-service.d.ts +100 -0
  15. package/dist/dingtalk-service.js +865 -0
  16. package/dist/dingtalk-stream.d.ts +24 -0
  17. package/dist/dingtalk-stream.js +115 -0
  18. package/dist/dingtalk-types.d.ts +138 -0
  19. package/dist/dingtalk-types.js +1 -0
  20. package/dist/employee-knowledge.js +8 -0
  21. package/dist/live-activity-service.d.ts +26 -0
  22. package/dist/live-activity-service.js +158 -0
  23. package/dist/live-activity-state.d.ts +37 -0
  24. package/dist/live-activity-state.js +108 -0
  25. package/dist/middleware/api-scope.js +2 -0
  26. package/dist/pi-cli-checkpoint.d.ts +17 -0
  27. package/dist/pi-cli-checkpoint.js +10 -0
  28. package/dist/pi-event-projection.js +13 -0
  29. package/dist/pi-execution.js +2 -1
  30. package/dist/pi-protocol-reader.d.ts +6 -2
  31. package/dist/pi-protocol-reader.js +36 -12
  32. package/dist/pi-tmux-host.d.ts +1 -1
  33. package/dist/pi-tmux-host.js +28 -8
  34. package/dist/pi-tool-result-preview.d.ts +23 -0
  35. package/dist/pi-tool-result-preview.js +185 -0
  36. package/dist/render-daemon-client.js +1 -1
  37. package/dist/render-host.d.ts +3 -3
  38. package/dist/render-host.js +3 -3
  39. package/dist/server-apns-routes.d.ts +12 -0
  40. package/dist/server-apns-routes.js +111 -0
  41. package/dist/server-dingtalk-routes.d.ts +8 -0
  42. package/dist/server-dingtalk-routes.js +35 -0
  43. package/dist/server.js +49 -3
  44. package/dist/session-completion.d.ts +2 -1
  45. package/dist/session-completion.js +6 -2
  46. package/dist/session-registry.d.ts +3 -1
  47. package/dist/session-registry.js +3 -1
  48. package/dist/storage/apns-repository.d.ts +52 -0
  49. package/dist/storage/apns-repository.js +108 -0
  50. package/dist/storage/conversations-repository.d.ts +2 -0
  51. package/dist/storage/conversations-repository.js +10 -0
  52. package/dist/storage/dingtalk-repository.d.ts +20 -0
  53. package/dist/storage/dingtalk-repository.js +75 -0
  54. package/dist/storage/live-activity-repository.d.ts +68 -0
  55. package/dist/storage/live-activity-repository.js +117 -0
  56. package/dist/storage/migrations.js +22 -0
  57. package/dist/storage/sessions-repository.d.ts +5 -0
  58. package/dist/storage/sessions-repository.js +43 -1
  59. package/dist/storage-schema.js +2 -0
  60. package/dist/storage.d.ts +7 -1
  61. package/dist/storage.js +10 -0
  62. package/dist/structured-exec-host.d.ts +9 -1
  63. package/dist/structured-exec-pump.d.ts +11 -0
  64. package/dist/structured-exec-pump.js +27 -8
  65. package/dist/structured-pi-adapter.js +5 -0
  66. package/dist/structured-runner.d.ts +2 -0
  67. package/dist/structured-session-manager.d.ts +2 -0
  68. package/dist/structured-session-manager.js +51 -4
  69. package/dist/types.d.ts +7 -0
  70. package/dist/web-ui/content/module-manifest.json +1 -1
  71. package/dist/web-ui/content/modules/{4f30a913cc5b3f89 → 02fad74223254019}/chunk.js +1 -1
  72. package/dist/web-ui/content/modules/{acb21c7e7fd6cb67 → 033e0a741edd2ba1}/page.js +1 -1
  73. package/dist/web-ui/content/modules/{e61136c22675ec7d → 0c04f94bbfd39a2f}/chunk.js +1 -1
  74. package/dist/web-ui/content/modules/{119874145414688d → 12e91deb96ace24d}/shell-file-panel-drawer.js +1 -1
  75. package/dist/web-ui/content/modules/15279373f0e1461f/host.js +1 -0
  76. package/dist/web-ui/content/modules/{78a46adbf9807f89 → 17603a34d545c784}/chunk.js +1 -1
  77. package/dist/web-ui/content/modules/1f041aa8d3673d93/chunk.js +1 -0
  78. package/dist/web-ui/content/modules/{96dd661559b67ebf → 20483d6e57cfe9d7}/chunk.js +1 -1
  79. package/dist/web-ui/content/modules/{f55031a02775c89e → 217595f72a1c3fc5}/chunk.js +1 -1
  80. package/dist/web-ui/content/modules/2230c51655163cf3/runtime.js +279 -0
  81. package/dist/web-ui/content/modules/{82e40fdf0abfb8cd → 2460e872ab3a1f37}/chunk.js +1 -1
  82. package/dist/web-ui/content/modules/{9e754b01fa4207fb → 2a47853ca7752c1f}/chunk.js +1 -1
  83. package/dist/web-ui/content/modules/{e95b60ab18a79499 → 2afbc201474adacc}/login-visual.js +1 -1
  84. package/dist/web-ui/content/modules/{38917c19e2cf1702 → 30169d15cea782f0}/chunk.js +1 -1
  85. package/dist/web-ui/content/modules/{5513bcbacdf44588 → 37abb74d1a0a0791}/notice-view.js +1 -1
  86. package/dist/web-ui/content/modules/{b62294e53dcb3147 → 38bb024e09cb5d5d}/host.js +1 -1
  87. package/dist/web-ui/content/modules/39faef0cffbad28e/home.js +6 -0
  88. package/dist/web-ui/content/modules/3a2fa12c8b537964/chunk.js +1 -0
  89. package/dist/web-ui/content/modules/{35a8fd2cfd31d7a0 → 3a72b79418f0f80a}/chunk.js +1 -1
  90. package/dist/web-ui/content/modules/{321bd9c755bc30fc → 3bd3c84c4257ba0d}/chunk.js +1 -1
  91. package/dist/web-ui/content/modules/{2981483671797b92 → 3d10e3f6f6f92b55}/chunk.js +1 -1
  92. package/dist/web-ui/content/modules/{6f341fe3e8aee844 → 3d4451bc069c1498}/chunk.js +1 -1
  93. package/dist/web-ui/content/modules/{4a9a3e1f87b2c32b → 3d5c498522b48225}/dialog-modal.js +1 -1
  94. package/dist/web-ui/content/modules/426b8133daebff78/host.js +1 -0
  95. package/dist/web-ui/content/modules/455436229dc57d7f/sidebar-peek.js +1 -0
  96. package/dist/web-ui/content/modules/46de3c2e2ca680c1/host.js +1 -0
  97. package/dist/web-ui/content/modules/47af6b35e1d01ea7/host.js +30 -0
  98. package/dist/web-ui/content/modules/4841e45cb7c5cc67/queue-view-adapter.js +3 -0
  99. package/dist/web-ui/content/modules/{47419445e0aaa3cc → 497789a07177ed7b}/chunk.js +1 -1
  100. package/dist/web-ui/content/modules/{32c461164a1b364c → 5472191457a926d3}/chunk.js +1 -1
  101. package/dist/web-ui/content/modules/{c152782274c04fad → 55a47b6e2c2016f2}/chunk.js +1 -1
  102. package/dist/web-ui/content/modules/5743d8116d15696b/employee-card.js +1 -0
  103. package/dist/web-ui/content/modules/{c81a3d95b14cdcd4 → 578703196f82222d}/chunk.js +1 -1
  104. package/dist/web-ui/content/modules/{8ce71665ae55ccf1 → 57d68f0a47e8fd7c}/toast-region.js +1 -1
  105. package/dist/web-ui/content/modules/58866143a3365521/chunk.js +1 -0
  106. package/dist/web-ui/content/modules/{3601736ae2d678ef → 5bb5db89a343817f}/chunk.js +1 -1
  107. package/dist/web-ui/content/modules/{a098c7b1aa4e2f6b → 5c9e8245d4a8a312}/sha256.js +1 -1
  108. package/dist/web-ui/content/modules/{8198bfd269c0caca → 5de35db482fb1a42}/chunk.js +1 -1
  109. package/dist/web-ui/content/modules/{aab92f2990a7185f → 5e7104e569359449}/chunk.js +1 -1
  110. package/dist/web-ui/content/modules/{4b9deeeb77570db3 → 601a2767ae24d1cb}/chunk.js +1 -1
  111. package/dist/web-ui/content/modules/6687ad7aa57f443b/task-board-host.js +22 -0
  112. package/dist/web-ui/content/modules/{c422f47fd13dc4bc → 684db83476dcba20}/chunk.js +1 -1
  113. package/dist/web-ui/content/modules/{cf715621edb1d12e → 6b0bafa239dfe4e2}/chunk.js +1 -1
  114. package/dist/web-ui/content/modules/{cd22aa55f6cc5276 → 6bd6ee3c9f05e2f5}/chunk.js +1 -1
  115. package/dist/web-ui/content/modules/{09ef1bb1d195d727 → 79b0c18f2bf35740}/host.js +1 -1
  116. package/dist/web-ui/content/modules/{905f8bc3f8a3efb8 → 7ae83a3f06f2daa3}/chunk.js +1 -1
  117. package/dist/web-ui/content/modules/{84b79a33c64e146c → 7f32261c1627c3cd}/chunk.js +1 -1
  118. package/dist/web-ui/content/modules/{eece3c2d2374e8f7 → 805b859b1b76ce4d}/chunk.js +1 -1
  119. package/dist/web-ui/content/modules/{eecaebc5482ee203 → 84358b5b729cbe48}/chunk.js +1 -1
  120. package/dist/web-ui/content/modules/85181d84d5ce62b3/employee-profile.js +1 -0
  121. package/dist/web-ui/content/modules/87edd7cc79811bb8/composer-surface-adapter.js +1 -0
  122. package/dist/web-ui/content/modules/{b0254a2d3652a925 → 8ea498cf092dba30}/chunk.js +1 -1
  123. package/dist/web-ui/content/modules/{a4af270960a39ea6 → 8f0d4e22c18a58b0}/chunk.js +1 -1
  124. package/dist/web-ui/content/modules/{c72c4f1d47c3726d → 907dcf0ea5b5f23f}/chunk.js +1 -1
  125. package/dist/web-ui/content/modules/{9f33acc1c4284e03 → 916021ce252882ca}/chunk.js +1 -1
  126. package/dist/web-ui/content/modules/{98c14fc0474455a5 → 91ee32135a3582b0}/chunk.js +1 -1
  127. package/dist/web-ui/content/modules/92df279c40bc4218/host.js +1 -0
  128. package/dist/web-ui/content/modules/{544dc812abdfbbb8 → 9661b076f08e64b4}/chunk.js +1 -1
  129. package/dist/web-ui/content/modules/{5c94fb2b7abcd1a5 → 97ef63ff1f0784d9}/chunk.js +1 -1
  130. package/dist/web-ui/content/modules/99e48e07517d3f83/dropdown-surface.js +1 -0
  131. package/dist/web-ui/content/modules/9eb83751622e2b97/chunk.js +10 -0
  132. package/dist/web-ui/content/modules/{7375574a2ea42740 → a1715be0f97c2479}/chunk.js +1 -1
  133. package/dist/web-ui/content/modules/{456634525d44777d → a2be1fd01cf06837}/chunk.js +1 -1
  134. package/dist/web-ui/content/modules/a33666b143331cd6/workspace-window.js +1 -0
  135. package/dist/web-ui/content/modules/{b38924f45bfa71d6 → a41351130003e6bb}/chunk.js +1 -1
  136. package/dist/web-ui/content/modules/a59c83b5b5b85da2/host.js +1 -0
  137. package/dist/web-ui/content/modules/{a4dca2ffaf656d3c → a63f0b3d73d97e0b}/chunk.js +1 -1
  138. package/dist/web-ui/content/modules/a685793c5d9b90d1/chunk.js +1 -0
  139. package/dist/web-ui/content/modules/a750f4868304b089/host.js +1 -0
  140. package/dist/web-ui/content/modules/abfe4b88dcd89d88/host.js +1 -0
  141. package/dist/web-ui/content/modules/{15bcc550ef9fd5b7 → acda148b7423bdab}/host.js +1 -1
  142. package/dist/web-ui/content/modules/{ad1136919a65fc6e → af6ff78aeb782cf2}/host.js +1 -1
  143. package/dist/web-ui/content/modules/b32c9addcd31f54b/panel-host.js +1 -0
  144. package/dist/web-ui/content/modules/{b937f1a939618be9 → b358eaf2e45849a6}/host.js +1 -1
  145. package/dist/web-ui/content/modules/{476ff7911bce1a38 → b7aeeb22bf604ec7}/chunk.js +1 -1
  146. package/dist/web-ui/content/modules/bad2c42c7ddeab94/host.js +1 -0
  147. package/dist/web-ui/content/modules/{622a8d12c4c622bf → bb59e8cb4323bf06}/host.js +1 -1
  148. package/dist/web-ui/content/modules/{08c7b047195f138d → be497f1d39753979}/chunk.js +1 -1
  149. package/dist/web-ui/content/modules/bfa8e2c827201374/chunk.js +1 -0
  150. package/dist/web-ui/content/modules/{5395fa57a47e9b96 → bfe51130a84795fb}/chunk.js +1 -1
  151. package/dist/web-ui/content/modules/{8e29056fb56439f7 → c03e0f84f798d33a}/chunk.js +1 -1
  152. package/dist/web-ui/content/modules/c118e0c96bc023ee/host-bridge.js +1 -0
  153. package/dist/web-ui/content/modules/c3512b18c4c0e4ac/brand-identity.js +1 -0
  154. package/dist/web-ui/content/modules/c3e0de0a61f0db34/chunk.js +1 -0
  155. package/dist/web-ui/content/modules/{9d48d1ea3c9228bd → c3e1f083e07d6840}/library-bridge.js +1 -1
  156. package/dist/web-ui/content/modules/cd5e90a37ccdf2dc/group-editor.js +1 -0
  157. package/dist/web-ui/content/modules/{2edc19639ac1bd4b → cdb8281bb89da303}/chunk.js +1 -1
  158. package/dist/web-ui/content/modules/{f6f86d43c12b0864 → ce90d0b55bbe6430}/chunk.js +1 -1
  159. package/dist/web-ui/content/modules/{72b13a7486b6d437 → d274491ffc8ee646}/chunk.js +1 -1
  160. package/dist/web-ui/content/modules/{b1d43ed06a5d1a57 → d3cc94cf4a47a12a}/chunk.js +1 -1
  161. package/dist/web-ui/content/modules/{b0c4eed46c1b6ad4 → d4b07cef43d36e79}/chat-render.js +5 -4
  162. package/dist/web-ui/content/modules/{8a4f0ef2c0812af6 → d7b540917fb90755}/chunk.js +1 -1
  163. package/dist/web-ui/content/modules/{ef7f76b551fdc619 → d856bfc56bea5f20}/chunk.js +1 -1
  164. package/dist/web-ui/content/modules/{42c439d3acfe22bd → d857ea8244b1026e}/chunk.js +1 -1
  165. package/dist/web-ui/content/modules/{36ce8123a2079807 → d9019922118b2c37}/chunk.js +1 -1
  166. package/dist/web-ui/content/modules/{58836e616e6d12ff → d90e77f9f8d4f1ec}/workspaces-panel.js +1 -1
  167. package/dist/web-ui/content/modules/{4d4870f20eb1c52d → da1aa5fa0186fea7}/chunk.js +1 -1
  168. package/dist/web-ui/content/modules/de977ff0b3ad3882/progress.js +1 -0
  169. package/dist/web-ui/content/modules/{222f48948517167e → e01769df89873feb}/chunk.js +1 -1
  170. package/dist/web-ui/content/modules/{5df1b522f5d3c99d → e0ab9fa5a8882433}/host.js +1 -1
  171. package/dist/web-ui/content/modules/e25dea52e13504b6/markdown.js +1 -0
  172. package/dist/web-ui/content/modules/{36bd608366c56b72 → e43af4aa407885fd}/chunk.js +1 -1
  173. package/dist/web-ui/content/modules/ee893f06cdb2b4f7/panel.js +1 -0
  174. package/dist/web-ui/content/modules/{f90f80d7207dff1f → f2bdbdc4a1141826}/host.js +1 -1
  175. package/dist/web-ui/content/modules/{e33f6d66a02ec26c → f36b4d3d44491852}/chunk.js +1 -1
  176. package/dist/web-ui/content/modules/{665e81fe210f1b7a → fa79ed5d045c24dd}/chunk.js +1 -1
  177. package/dist/web-ui/content/styles.css +1 -1
  178. package/dist/web-ui/embedded-assets.d.ts +412 -406
  179. package/dist/web-ui/embedded-assets.js +4 -4
  180. package/package.json +1 -1
  181. package/scripts/install-render-binary.js +1 -1
  182. package/dist/web-ui/content/modules/1a7303b87763fd43/employee-profile.js +0 -1
  183. package/dist/web-ui/content/modules/1d35739f634745f6/task-board-host.js +0 -22
  184. package/dist/web-ui/content/modules/2099d37d57856cbd/brand-identity.js +0 -1
  185. package/dist/web-ui/content/modules/2d6339b2f6c2e2d0/host.js +0 -1
  186. package/dist/web-ui/content/modules/2f88fc37c6105f7e/sidebar-peek.js +0 -1
  187. package/dist/web-ui/content/modules/31124fb7ee6939df/host.js +0 -1
  188. package/dist/web-ui/content/modules/31b28c5d0019c363/host-bridge.js +0 -1
  189. package/dist/web-ui/content/modules/36e5c3a6d6705358/employee-card.js +0 -1
  190. package/dist/web-ui/content/modules/3700d99c54d3c400/host.js +0 -1
  191. package/dist/web-ui/content/modules/3ae29086b227f9d9/markdown.js +0 -1
  192. package/dist/web-ui/content/modules/42db858e4417c702/chunk.js +0 -10
  193. package/dist/web-ui/content/modules/443dc81eac29f233/host.js +0 -1
  194. package/dist/web-ui/content/modules/4af10e1f8a789204/runtime.js +0 -275
  195. package/dist/web-ui/content/modules/55b75ebcf6924001/host.js +0 -30
  196. package/dist/web-ui/content/modules/626c7ce0aa1714b0/host.js +0 -1
  197. package/dist/web-ui/content/modules/76adde4019731df1/chunk.js +0 -1
  198. package/dist/web-ui/content/modules/7925b65867b7aa4a/queue-view-adapter.js +0 -3
  199. package/dist/web-ui/content/modules/8a6844a4251a1271/chunk.js +0 -1
  200. package/dist/web-ui/content/modules/8bd214570df4a7a0/host.js +0 -1
  201. package/dist/web-ui/content/modules/8bff85e108320aab/panel.js +0 -1
  202. package/dist/web-ui/content/modules/988e01b67e6f1883/composer-surface-adapter.js +0 -1
  203. package/dist/web-ui/content/modules/a975ff38c3d43ba8/workspace-window.js +0 -1
  204. package/dist/web-ui/content/modules/b550260fc9c5363a/dropdown-surface.js +0 -1
  205. package/dist/web-ui/content/modules/bce467c603299460/chunk.js +0 -1
  206. package/dist/web-ui/content/modules/c138b442c1682189/panel-host.js +0 -1
  207. package/dist/web-ui/content/modules/c32d14632487364f/group-editor.js +0 -1
  208. package/dist/web-ui/content/modules/c6d0a1b2753a4883/host.js +0 -1
  209. package/dist/web-ui/content/modules/cdff6e7f72879c88/progress.js +0 -1
  210. package/dist/web-ui/content/modules/cfee7b0d79587d59/home.js +0 -6
  211. package/dist/web-ui/content/modules/e5e93fe5304838a1/chunk.js +0 -1
  212. package/dist/web-ui/content/modules/fbe35e7ddd7384fa/host.js +0 -1
@@ -1,4 +1,4 @@
1
1
 
2
2
  const __wandCssTextPool = Object.freeze([".wand-file-explorer-btn,.file-side-panel-header-actions .ant-btn,.file-explorer-up{width:32px;height:32px;flex-shrink:0}.wand-explorer-search-scope{justify-content:space-between;gap:8px;padding:0 0 8px}.wand-explorer-search-scope .ant-checkbox-wrapper{font-size:12px}.wand-explorer-search-scope>.ant-typography{font-size:11px;flex-shrink:0}.wand-explorer-search-count,.wand-explorer-search-duration{font-size:12px}.wand-explorer-search-limit{font-size:12px;line-height:1.5;padding-bottom:8px}.wand-explorer-results{overflow-x:hidden}@media(pointer:coarse){.wand-file-explorer-btn,.file-side-panel-header-actions .ant-btn,.file-explorer-up{width:44px;height:44px}.wand-file-explorer :is([role=treeitem],[role=option]){min-height:44px}}@media(hover:none),(pointer:coarse){.wand-explorer-keyhints{display:none}}\n"]);
3
- import{a as Me,b as ee,c as Ce}from"/assets/modules/5395fa57a47e9b96/chunk.js";import{b as ye}from"/assets/modules/76adde4019731df1/chunk.js";import"/assets/modules/c72c4f1d47c3726d/chunk.js";import{shared132_a as te,shared132_b as O,shared132_c as Y,shared132_d as de,shared132_e as Q,shared132_f as U}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared81_a as Ne}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared110_c as pe,shared110_d as q}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared84_a as Te}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared86_b as ce}from"/assets/modules/4af10e1f8a789204/runtime.js";import{a as Se}from"/assets/modules/8198bfd269c0caca/chunk.js";import{a as se}from"/assets/modules/98c14fc0474455a5/chunk.js";import"/assets/modules/42db858e4417c702/chunk.js";import"/assets/modules/c81a3d95b14cdcd4/chunk.js";import{a as ge}from"/assets/modules/4b9deeeb77570db3/chunk.js";import"/assets/modules/ef7f76b551fdc619/chunk.js";import"/assets/modules/4f30a913cc5b3f89/chunk.js";import{a as j}from"/assets/modules/e61136c22675ec7d/chunk.js";import{d as Ee,e as ie}from"/assets/modules/36ce8123a2079807/chunk.js";import"/assets/modules/b38924f45bfa71d6/chunk.js";import{shared118_a as ke}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared120_a as be}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared95_a as ne}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared23_c as Fe}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared88_a as we}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared24_a as _}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared54_a as H,shared54_b as oe}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/8e29056fb56439f7/chunk.js";import"/assets/modules/08c7b047195f138d/chunk.js";import"/assets/modules/a4dca2ffaf656d3c/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared26_b as xe}from"/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/f6f86d43c12b0864/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared83_g as Re}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared55_a as X}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared60_a as M}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/c422f47fd13dc4bc/chunk.js";import"/assets/modules/32c461164a1b364c/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/222f48948517167e/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared42_t as ve}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared47_a as le}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared61_a as k}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared28_c as ae}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared13_S as Ye,shared13_zb as Z}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared11_a as re}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared5_c as W}from"/assets/modules/4af10e1f8a789204/runtime.js";var p=W(re(),1),me=W(re(),1),$e=W(Ye(),1);function Qe(t){return t.trim()}function Ue(t,n){let i=Qe(n);if(!i)return[];let l=t.toLowerCase(),c=l.length===t.length?l:t,a=l.length===t.length?i.toLowerCase():i,d=[],y=c.indexOf(a);for(;y!==-1;)d.push({start:y,end:y+a.length}),y=c.indexOf(a,y+a.length);return d}function De(t,n){let i=Ue(t,n);if(i.length===0)return[{value:t,match:!1}];let l=[],c=0;for(let a of i)a.start>c&&l.push({value:t.slice(c,a.start),match:!1}),l.push({value:t.slice(a.start,a.end),match:!0}),c=a.end;return c<t.length&&l.push({value:t.slice(c),match:!1}),l}function Je(t,n){let i=n.replace(/\\/g,"/").replace(/\/+$/,""),l=t.replace(/\\/g,"/").replace(/\/+$/,"");return i?l===i?"":l.startsWith(`${i}/`)?l.slice(i.length+1):l:l}function Ze(t,n){let i=Je(t,n);return i||Y(n)||"/"}function Ie(t,n){let i=[],l=new Map;for(let c of t){let a=O(c.path),d=l.get(a);d||(d={key:a,label:Ze(a,n),entries:[]},l.set(a,d),i.push(d)),d.entries.push(c)}return i}function Pe(t,n){if(n==="all")return[...t];let i=n==="dir"?"dir":"file";return t.filter(l=>l.type===i)}function ue(t){return t.type!=="file"||typeof t.size!="number"?"":Re(t.size)}function ze(t){let n=new Date(t);if(Number.isNaN(n.getTime()))return"";let i=l=>String(l).padStart(2,"0");return`${n.getFullYear()}-${i(n.getMonth()+1)}-${i(n.getDate())} ${i(n.getHours())}:${i(n.getMinutes())}`}function Ae(t){let n=0,i=0;for(let l of t)l.type==="dir"?i+=1:n+=1;return{all:t.length,file:n,dir:i}}var A=W(re(),1);var I=W(Z(),1),et=new Set(["ArrowDown","ArrowUp","Home","End"]);function Le({request:t,onSubmit:n,onDismiss:i,repository:l=Ce}){let c=t!==null,[a,d]=(0,A.useState)(""),[y,f]=(0,A.useState)(null),[T,C]=(0,A.useState)(!1),[R,E]=(0,A.useState)(!1),[v,s]=(0,A.useState)(""),[h,g]=(0,A.useState)(-1),b=(0,A.useRef)([]);if((0,A.useEffect)(()=>{t&&(d(t.initialDir),f(null),C(!1),E(!1),s(""),g(-1))},[t]),(0,A.useEffect)(()=>{if(!c)return;let r=a.trim();if(!r){f(null),C(!1),s("\u8BF7\u8F93\u5165\u76EE\u6807\u76EE\u5F55\u3002"),g(-1);return}let u=new AbortController;C(!0),s(""),g(-1);let B=window.setTimeout(()=>{l.list(r,{signal:u.signal}).then(P=>{u.signal.aborted||(f(P),s(""))}).catch(P=>{u.signal.aborted||(f(null),s(ce(P,"\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u76EE\u5F55\u3002")))}).finally(()=>{u.signal.aborted||C(!1)})},140);return()=>{window.clearTimeout(B),u.abort()}},[c,a,l]),(0,A.useEffect)(()=>{h<0||b.current[h]?.scrollIntoView({block:"nearest"})},[h]),!t)return null;let S=y?.currentPath??a.trim();function z(r){d(r),f(null),s(""),g(-1)}async function w(r){if(!t||R)return;let u=te(r,Y(t.from));if(u===t.from){s("\u76EE\u6807\u4F4D\u7F6E\u4E0E\u5F53\u524D\u4F4D\u7F6E\u76F8\u540C\u3002");return}E(!0),s("");try{await n(t.from,u)||s("\u79FB\u52A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u76EE\u6807\u76EE\u5F55\u540E\u91CD\u8BD5\u3002")}catch(B){s(ce(B,"\u79FB\u52A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u76EE\u6807\u76EE\u5F55\u6216\u6743\u9650\u540E\u91CD\u8BD5\u3002"))}finally{E(!1)}}function F(r){z(r.path)}function L(r){if(!r.nativeEvent.isComposing){if(et.has(r.key)){r.preventDefault(),g(u=>ee(u,y?.items.length??0,r.key));return}if(r.key==="Enter"){if(r.preventDefault(),h>=0){let u=y?.items[h];u&&F(u);return}w(S)}}}let D=y?.items.find(r=>r.type==="parent")??null,N=Y(t.from);return(0,I.jsx)(we,{open:c,onOpenChange:r=>{r||i()},title:`\u79FB\u52A8${t.isDir?"\u6587\u4EF6\u5939":"\u6587\u4EF6"}`,description:`\u4E3A\u300C${N}\u300D\u9009\u62E9\u76EE\u6807\u76EE\u5F55\uFF0C\u786E\u8BA4\u540E\u7ACB\u5373\u79FB\u52A8\u3002`,className:"wand-task-library-dialog wand-folder-picker-library-dialog wand-move-dialog",closeLabel:"\u5173\u95ED\u79FB\u52A8\u5BF9\u8BDD\u6846",testId:"move-entry-dialog",dismissable:!R,children:(0,I.jsx)(ye,{noValidate:!0,"aria-busy":T||R,onSubmit:r=>{r.preventDefault(),w(S)},children:(0,I.jsxs)(k,{vertical:!0,gap:16,children:[(0,I.jsxs)(xe,{wrap:!0,"aria-label":"\u5FEB\u6377\u76EE\u5F55",children:[(0,I.jsx)(H,{size:"small",onClick:()=>z("/tmp"),children:"\u4E34\u65F6\u76EE\u5F55 /tmp"}),(0,I.jsx)(H,{size:"small",onClick:()=>z("/"),children:"\u6839\u76EE\u5F55 /"}),(0,I.jsx)(H,{size:"small",disabled:!D||T,onClick:()=>{D&&z(D.path)},children:"\u8FD4\u56DE\u4E0A\u7EA7"})]}),(0,I.jsx)(ge.Item,{label:"\u76EE\u6807\u76EE\u5F55",htmlFor:"wand-move-input",children:(0,I.jsx)(_,{id:"wand-move-input","data-wand-autofocus":!0,autoFocus:!0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-invalid":v?"true":"false","aria-controls":"wand-move-options","aria-activedescendant":h>=0?`wand-move-option-${h}`:void 0,value:a,onChange:r=>d(r.currentTarget.value),onKeyDown:L})}),(0,I.jsx)(Me,{id:"wand-move-options",optionPrefix:"wand-move-option",items:y?.items,loading:T,error:v,activeIndex:h,itemRefs:b,onActivate:F,onActiveIndex:g}),v?(0,I.jsx)(X,{type:"error",showIcon:!0,role:"alert",title:v}):null,(0,I.jsxs)(k,{justify:"space-between",align:"center",gap:12,wrap:!0,children:[(0,I.jsx)(M.Text,{type:"secondary",ellipsis:!0,style:{minWidth:0,flex:1},title:S,children:S||"\u8BF7\u8F93\u5165\u76EE\u6807\u76EE\u5F55"}),(0,I.jsx)(H,{kind:"primary",type:"submit",disabled:T||R||!S,children:R?"\u6B63\u5728\u79FB\u52A8\u2026":"\u79FB\u52A8\u5230\u6B64\u5904"})]})]})})})}var He=__wandCssTextPool[0];var e=W(Z(),1),tt=new Set(["png","jpg","jpeg","gif","webp","svg","avif","bmp","ico","heic","heif"]),rt=new Set(["mp4","webm","mov","mkv","m4v","ogv","mp3","wav","ogg","m4a","flac","aac","opus"]),nt=new Set(["zip","tar","gz","tgz","bz2","7z","rar","xz"]),at=new Set(["md","markdown","mdx"]),ot=new Set(["txt","log"]),it=new Set(["pdf"]),lt=new Set(["ts","tsx","js","jsx","mjs","cjs","json","jsonc","yaml","yml","toml","ini","cfg","conf","env","py","rb","go","rs","java","c","cpp","h","hpp","cs","swift","kt","scala","php","sh","bash","zsh","fish","lua","sql","graphql","proto","vue","svelte","html","htm","xml","css","scss","less","diff","patch"]),Be=[{value:"all",label:"\u5168\u90E8"},{value:"file",label:"\u6587\u4EF6"},{value:"dir",label:"\u6587\u4EF6\u5939"}];function We(t){let n=document.createElement("a");n.href=`/api/file-raw?download=1&path=${encodeURIComponent(t)}`,n.rel="noopener",document.body.appendChild(n),n.click(),n.remove()}function fe(t,n){if(t.type==="dir")return n?"folderOpen":"folder";let i=t.name.toLowerCase(),l=i.lastIndexOf("."),c=l>=0&&l<i.length-1?i.slice(l+1):"";return tt.has(c)?"image":rt.has(c)?"media":nt.has(c)?"archive":it.has(c)?"pdf":at.has(c)?"markdown":ot.has(c)?"file":lt.has(c)?"code":"file"}function V({name:t,size:n=16}){let i={className:"wand-fe-icon",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};switch(t){case"folder":return(0,e.jsx)("svg",{...i,children:(0,e.jsx)("path",{d:"M4 20a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2z"})});case"folderOpen":return(0,e.jsx)("svg",{...i,children:(0,e.jsx)("path",{d:"M6 14l1.5-3A2 2 0 0 1 9.2 10H20a2 2 0 0 1 1.9 2.5l-1.5 6A2 2 0 0 1 18.4 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"})});case"file":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5"})]});case"image":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,e.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,e.jsx)("path",{d:"m21 15-4.5-4.5L5 21"})]});case"code":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"m16 18 6-6-6-6"}),(0,e.jsx)("path",{d:"m8 6-6 6 6 6"})]});case"media":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,e.jsx)("path",{d:"m10 9 5 3-5 3z"})]});case"archive":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M4 4h16v4H4z"}),(0,e.jsx)("path",{d:"M5 8v12h14V8"}),(0,e.jsx)("path",{d:"M12 12v4"})]});case"pdf":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5M8 13h5M8 17h8"})]});case"markdown":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,e.jsx)("path",{d:"M7 15V9l3 4 3-4v6"})]});case"newFile":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5"}),(0,e.jsx)("path",{d:"M12 12v6M9 15h6"})]});case"newFolder":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M4 20a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2z"}),(0,e.jsx)("path",{d:"M12 11v6M9 14h6"})]});case"refresh":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M21 12a9 9 0 1 1-3-6.7"}),(0,e.jsx)("path",{d:"M21 3v6h-6"})]})}}function Ke(t){let n=t.gitStatus;return n?n.staged==="added"?{text:"A",className:"git-added",label:"\u5DF2\u6682\u5B58\u65B0\u589E"}:n.staged==="modified"?{text:"M",className:"git-modified",label:"\u5DF2\u6682\u5B58\u4FEE\u6539"}:n.staged==="deleted"?{text:"D",className:"git-deleted",label:"\u5DF2\u6682\u5B58\u5220\u9664"}:n.staged==="renamed"?{text:"R",className:"git-renamed",label:"\u5DF2\u6682\u5B58\u91CD\u547D\u540D"}:n.unstaged==="modified"?{text:"M",className:"git-modified",label:"\u672A\u6682\u5B58\u4FEE\u6539"}:n.unstaged==="deleted"?{text:"D",className:"git-deleted",label:"\u672A\u6682\u5B58\u5220\u9664"}:n.untracked?{text:"?",className:"git-untracked",label:"\u672A\u8DDF\u8E2A"}:null:null}function je(t){return{"git-added":"success","git-modified":"warning","git-deleted":"error","git-renamed":"purple"}[t.className]}function st(t){let n=[],i=ue(t);i&&n.push(i);let l=t.mtime?ze(t.mtime):"";return l&&n.push(l),t.type==="dir"&&n.push("\u6587\u4EF6\u5939"),n.length>0?`${t.path}
3
+ import{a as Me,b as ee,c as Ce}from"/assets/modules/bfe51130a84795fb/chunk.js";import{b as ye}from"/assets/modules/1f041aa8d3673d93/chunk.js";import"/assets/modules/907dcf0ea5b5f23f/chunk.js";import{shared132_a as te,shared132_b as O,shared132_c as Y,shared132_d as de,shared132_e as Q,shared132_f as U}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared76_a as Ne}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared110_c as pe,shared110_d as q}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared79_a as Te}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared81_b as ce}from"/assets/modules/2230c51655163cf3/runtime.js";import{a as Se}from"/assets/modules/5de35db482fb1a42/chunk.js";import{a as se}from"/assets/modules/91ee32135a3582b0/chunk.js";import"/assets/modules/3a2fa12c8b537964/chunk.js";import"/assets/modules/9eb83751622e2b97/chunk.js";import{a as ge}from"/assets/modules/601a2767ae24d1cb/chunk.js";import"/assets/modules/d856bfc56bea5f20/chunk.js";import"/assets/modules/578703196f82222d/chunk.js";import"/assets/modules/02fad74223254019/chunk.js";import{a as j}from"/assets/modules/0c04f94bbfd39a2f/chunk.js";import{d as Ee,e as ie}from"/assets/modules/d9019922118b2c37/chunk.js";import"/assets/modules/a41351130003e6bb/chunk.js";import{shared118_a as ke}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared120_a as be}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared90_a as ne}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared23_c as Fe}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared83_a as we}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared24_a as _}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared54_a as H,shared54_b as oe}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/c03e0f84f798d33a/chunk.js";import"/assets/modules/be497f1d39753979/chunk.js";import"/assets/modules/a63f0b3d73d97e0b/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared26_b as xe}from"/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/ce90d0b55bbe6430/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared78_g as Re}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared55_a as X}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared60_a as M}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/5472191457a926d3/chunk.js";import"/assets/modules/684db83476dcba20/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/e01769df89873feb/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared42_t as ve}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared47_a as le}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared61_a as k}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared28_c as ae}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared13_S as Ye,shared13_zb as Z}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared11_a as re}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared5_c as W}from"/assets/modules/2230c51655163cf3/runtime.js";var p=W(re(),1),me=W(re(),1),$e=W(Ye(),1);function Qe(t){return t.trim()}function Ue(t,n){let i=Qe(n);if(!i)return[];let l=t.toLowerCase(),c=l.length===t.length?l:t,a=l.length===t.length?i.toLowerCase():i,d=[],y=c.indexOf(a);for(;y!==-1;)d.push({start:y,end:y+a.length}),y=c.indexOf(a,y+a.length);return d}function De(t,n){let i=Ue(t,n);if(i.length===0)return[{value:t,match:!1}];let l=[],c=0;for(let a of i)a.start>c&&l.push({value:t.slice(c,a.start),match:!1}),l.push({value:t.slice(a.start,a.end),match:!0}),c=a.end;return c<t.length&&l.push({value:t.slice(c),match:!1}),l}function Je(t,n){let i=n.replace(/\\/g,"/").replace(/\/+$/,""),l=t.replace(/\\/g,"/").replace(/\/+$/,"");return i?l===i?"":l.startsWith(`${i}/`)?l.slice(i.length+1):l:l}function Ze(t,n){let i=Je(t,n);return i||Y(n)||"/"}function Ie(t,n){let i=[],l=new Map;for(let c of t){let a=O(c.path),d=l.get(a);d||(d={key:a,label:Ze(a,n),entries:[]},l.set(a,d),i.push(d)),d.entries.push(c)}return i}function Pe(t,n){if(n==="all")return[...t];let i=n==="dir"?"dir":"file";return t.filter(l=>l.type===i)}function ue(t){return t.type!=="file"||typeof t.size!="number"?"":Re(t.size)}function ze(t){let n=new Date(t);if(Number.isNaN(n.getTime()))return"";let i=l=>String(l).padStart(2,"0");return`${n.getFullYear()}-${i(n.getMonth()+1)}-${i(n.getDate())} ${i(n.getHours())}:${i(n.getMinutes())}`}function Ae(t){let n=0,i=0;for(let l of t)l.type==="dir"?i+=1:n+=1;return{all:t.length,file:n,dir:i}}var A=W(re(),1);var I=W(Z(),1),et=new Set(["ArrowDown","ArrowUp","Home","End"]);function Le({request:t,onSubmit:n,onDismiss:i,repository:l=Ce}){let c=t!==null,[a,d]=(0,A.useState)(""),[y,f]=(0,A.useState)(null),[T,C]=(0,A.useState)(!1),[R,E]=(0,A.useState)(!1),[v,s]=(0,A.useState)(""),[h,g]=(0,A.useState)(-1),b=(0,A.useRef)([]);if((0,A.useEffect)(()=>{t&&(d(t.initialDir),f(null),C(!1),E(!1),s(""),g(-1))},[t]),(0,A.useEffect)(()=>{if(!c)return;let r=a.trim();if(!r){f(null),C(!1),s("\u8BF7\u8F93\u5165\u76EE\u6807\u76EE\u5F55\u3002"),g(-1);return}let u=new AbortController;C(!0),s(""),g(-1);let B=window.setTimeout(()=>{l.list(r,{signal:u.signal}).then(P=>{u.signal.aborted||(f(P),s(""))}).catch(P=>{u.signal.aborted||(f(null),s(ce(P,"\u65E0\u6CD5\u8BFB\u53D6\u8BE5\u76EE\u5F55\u3002")))}).finally(()=>{u.signal.aborted||C(!1)})},140);return()=>{window.clearTimeout(B),u.abort()}},[c,a,l]),(0,A.useEffect)(()=>{h<0||b.current[h]?.scrollIntoView({block:"nearest"})},[h]),!t)return null;let S=y?.currentPath??a.trim();function z(r){d(r),f(null),s(""),g(-1)}async function w(r){if(!t||R)return;let u=te(r,Y(t.from));if(u===t.from){s("\u76EE\u6807\u4F4D\u7F6E\u4E0E\u5F53\u524D\u4F4D\u7F6E\u76F8\u540C\u3002");return}E(!0),s("");try{await n(t.from,u)||s("\u79FB\u52A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u76EE\u6807\u76EE\u5F55\u540E\u91CD\u8BD5\u3002")}catch(B){s(ce(B,"\u79FB\u52A8\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u76EE\u6807\u76EE\u5F55\u6216\u6743\u9650\u540E\u91CD\u8BD5\u3002"))}finally{E(!1)}}function F(r){z(r.path)}function L(r){if(!r.nativeEvent.isComposing){if(et.has(r.key)){r.preventDefault(),g(u=>ee(u,y?.items.length??0,r.key));return}if(r.key==="Enter"){if(r.preventDefault(),h>=0){let u=y?.items[h];u&&F(u);return}w(S)}}}let D=y?.items.find(r=>r.type==="parent")??null,N=Y(t.from);return(0,I.jsx)(we,{open:c,onOpenChange:r=>{r||i()},title:`\u79FB\u52A8${t.isDir?"\u6587\u4EF6\u5939":"\u6587\u4EF6"}`,description:`\u4E3A\u300C${N}\u300D\u9009\u62E9\u76EE\u6807\u76EE\u5F55\uFF0C\u786E\u8BA4\u540E\u7ACB\u5373\u79FB\u52A8\u3002`,className:"wand-task-library-dialog wand-folder-picker-library-dialog wand-move-dialog",closeLabel:"\u5173\u95ED\u79FB\u52A8\u5BF9\u8BDD\u6846",testId:"move-entry-dialog",dismissable:!R,children:(0,I.jsx)(ye,{noValidate:!0,"aria-busy":T||R,onSubmit:r=>{r.preventDefault(),w(S)},children:(0,I.jsxs)(k,{vertical:!0,gap:16,children:[(0,I.jsxs)(xe,{wrap:!0,"aria-label":"\u5FEB\u6377\u76EE\u5F55",children:[(0,I.jsx)(H,{size:"small",onClick:()=>z("/tmp"),children:"\u4E34\u65F6\u76EE\u5F55 /tmp"}),(0,I.jsx)(H,{size:"small",onClick:()=>z("/"),children:"\u6839\u76EE\u5F55 /"}),(0,I.jsx)(H,{size:"small",disabled:!D||T,onClick:()=>{D&&z(D.path)},children:"\u8FD4\u56DE\u4E0A\u7EA7"})]}),(0,I.jsx)(ge.Item,{label:"\u76EE\u6807\u76EE\u5F55",htmlFor:"wand-move-input",children:(0,I.jsx)(_,{id:"wand-move-input","data-wand-autofocus":!0,autoFocus:!0,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"aria-invalid":v?"true":"false","aria-controls":"wand-move-options","aria-activedescendant":h>=0?`wand-move-option-${h}`:void 0,value:a,onChange:r=>d(r.currentTarget.value),onKeyDown:L})}),(0,I.jsx)(Me,{id:"wand-move-options",optionPrefix:"wand-move-option",items:y?.items,loading:T,error:v,activeIndex:h,itemRefs:b,onActivate:F,onActiveIndex:g}),v?(0,I.jsx)(X,{type:"error",showIcon:!0,role:"alert",title:v}):null,(0,I.jsxs)(k,{justify:"space-between",align:"center",gap:12,wrap:!0,children:[(0,I.jsx)(M.Text,{type:"secondary",ellipsis:!0,style:{minWidth:0,flex:1},title:S,children:S||"\u8BF7\u8F93\u5165\u76EE\u6807\u76EE\u5F55"}),(0,I.jsx)(H,{kind:"primary",type:"submit",disabled:T||R||!S,children:R?"\u6B63\u5728\u79FB\u52A8\u2026":"\u79FB\u52A8\u5230\u6B64\u5904"})]})]})})})}var He=__wandCssTextPool[0];var e=W(Z(),1),tt=new Set(["png","jpg","jpeg","gif","webp","svg","avif","bmp","ico","heic","heif"]),rt=new Set(["mp4","webm","mov","mkv","m4v","ogv","mp3","wav","ogg","m4a","flac","aac","opus"]),nt=new Set(["zip","tar","gz","tgz","bz2","7z","rar","xz"]),at=new Set(["md","markdown","mdx"]),ot=new Set(["txt","log"]),it=new Set(["pdf"]),lt=new Set(["ts","tsx","js","jsx","mjs","cjs","json","jsonc","yaml","yml","toml","ini","cfg","conf","env","py","rb","go","rs","java","c","cpp","h","hpp","cs","swift","kt","scala","php","sh","bash","zsh","fish","lua","sql","graphql","proto","vue","svelte","html","htm","xml","css","scss","less","diff","patch"]),Be=[{value:"all",label:"\u5168\u90E8"},{value:"file",label:"\u6587\u4EF6"},{value:"dir",label:"\u6587\u4EF6\u5939"}];function We(t){let n=document.createElement("a");n.href=`/api/file-raw?download=1&path=${encodeURIComponent(t)}`,n.rel="noopener",document.body.appendChild(n),n.click(),n.remove()}function fe(t,n){if(t.type==="dir")return n?"folderOpen":"folder";let i=t.name.toLowerCase(),l=i.lastIndexOf("."),c=l>=0&&l<i.length-1?i.slice(l+1):"";return tt.has(c)?"image":rt.has(c)?"media":nt.has(c)?"archive":it.has(c)?"pdf":at.has(c)?"markdown":ot.has(c)?"file":lt.has(c)?"code":"file"}function V({name:t,size:n=16}){let i={className:"wand-fe-icon",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};switch(t){case"folder":return(0,e.jsx)("svg",{...i,children:(0,e.jsx)("path",{d:"M4 20a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2z"})});case"folderOpen":return(0,e.jsx)("svg",{...i,children:(0,e.jsx)("path",{d:"M6 14l1.5-3A2 2 0 0 1 9.2 10H20a2 2 0 0 1 1.9 2.5l-1.5 6A2 2 0 0 1 18.4 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"})});case"file":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5"})]});case"image":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,e.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,e.jsx)("path",{d:"m21 15-4.5-4.5L5 21"})]});case"code":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"m16 18 6-6-6-6"}),(0,e.jsx)("path",{d:"m8 6-6 6 6 6"})]});case"media":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,e.jsx)("path",{d:"m10 9 5 3-5 3z"})]});case"archive":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M4 4h16v4H4z"}),(0,e.jsx)("path",{d:"M5 8v12h14V8"}),(0,e.jsx)("path",{d:"M12 12v4"})]});case"pdf":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5M8 13h5M8 17h8"})]});case"markdown":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),(0,e.jsx)("path",{d:"M7 15V9l3 4 3-4v6"})]});case"newFile":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,e.jsx)("path",{d:"M14 3v5h5"}),(0,e.jsx)("path",{d:"M12 12v6M9 15h6"})]});case"newFolder":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M4 20a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5l2 3h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2z"}),(0,e.jsx)("path",{d:"M12 11v6M9 14h6"})]});case"refresh":return(0,e.jsxs)("svg",{...i,children:[(0,e.jsx)("path",{d:"M21 12a9 9 0 1 1-3-6.7"}),(0,e.jsx)("path",{d:"M21 3v6h-6"})]})}}function Ke(t){let n=t.gitStatus;return n?n.staged==="added"?{text:"A",className:"git-added",label:"\u5DF2\u6682\u5B58\u65B0\u589E"}:n.staged==="modified"?{text:"M",className:"git-modified",label:"\u5DF2\u6682\u5B58\u4FEE\u6539"}:n.staged==="deleted"?{text:"D",className:"git-deleted",label:"\u5DF2\u6682\u5B58\u5220\u9664"}:n.staged==="renamed"?{text:"R",className:"git-renamed",label:"\u5DF2\u6682\u5B58\u91CD\u547D\u540D"}:n.unstaged==="modified"?{text:"M",className:"git-modified",label:"\u672A\u6682\u5B58\u4FEE\u6539"}:n.unstaged==="deleted"?{text:"D",className:"git-deleted",label:"\u672A\u6682\u5B58\u5220\u9664"}:n.untracked?{text:"?",className:"git-untracked",label:"\u672A\u8DDF\u8E2A"}:null:null}function je(t){return{"git-added":"success","git-modified":"warning","git-deleted":"error","git-renamed":"purple"}[t.className]}function st(t){let n=[],i=ue(t);i&&n.push(i);let l=t.mtime?ze(t.mtime):"";return l&&n.push(l),t.type==="dir"&&n.push("\u6587\u4EF6\u5939"),n.length>0?`${t.path}
4
4
  ${n.join(" \xB7 ")}`:t.path}var Ve=p.createContext(null);function Ge({entry:t,depth:n,snapshot:i,activePath:l,onToggle:c,onFileActivate:a,onContextMenu:d,renameState:y,setRenameState:f,pendingCreate:T,setPendingCreate:C}){let R=p.useContext(Ve),E=t.type==="dir",v=E?i.expanded.get(t.path):void 0,s=!!v,h=!!(E&&s&&v?.status==="loaded"&&v.entries.length===0),g=E&&!h,b=!E&&l===t.path,S=Ke(t),z=ue(t),[w,F]=p.useState(t.name);p.useEffect(()=>{y?.path===t.path&&F(t.name)},[y?.path,t.name]);let L=async()=>{let r=w.trim();if(f(null),!r||r===t.name)return;let u=te(O(t.path),r);u!==t.path&&await Q.execute({type:"rename",from:t.path,to:u})},D=T?.dir===t.path;return y?.path===t.path?(0,e.jsx)(k,{align:"center",gap:"small",className:"wand-explorer-row editing",style:{padding:"4px 8px",paddingLeft:8+n*12},children:(0,e.jsxs)(k,{align:"center",gap:"small",className:"wand-explorer-rename",style:{flex:1,minWidth:0},children:[(0,e.jsx)("span",{className:"wand-explorer-icon",children:(0,e.jsx)(V,{name:fe(t,!1)})}),(0,e.jsx)(_,{value:w,autoFocus:!0,spellCheck:!1,"aria-label":`\u91CD\u547D\u540D ${t.name}`,onChange:r=>F(r.currentTarget.value),onClick:r=>r.stopPropagation(),onBlur:()=>{L()},onKeyDown:r=>{r.nativeEvent.isComposing||(r.key==="Enter"?(r.preventDefault(),r.currentTarget.blur()):r.key==="Escape"&&(r.preventDefault(),f(null)))}})]})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(ae,{className:`wand-explorer-row${b?" active":""}`,ref:r=>{r?R?.set(t.path,r):R?.delete(t.path)},block:!0,size:"small",type:b?"primary":"text",style:{paddingLeft:8+n*12,justifyContent:"flex-start",gap:4},role:"treeitem",tabIndex:0,"aria-label":t.name,"aria-level":n+1,"aria-expanded":E?s:void 0,"aria-selected":b,onKeyDown:r=>{if(r.target===r.currentTarget)if(r.key==="ContextMenu"||r.shiftKey&&r.key==="F10"){r.preventDefault();let u=r.currentTarget.getBoundingClientRect();d({x:u.left+12,y:u.bottom,entry:t,dir:O(t.path)})}else if(["ArrowDown","ArrowUp","Home","End"].includes(r.key)&&R){r.preventDefault();let u=[...R.values()].filter(K=>K.isConnected);u.sort((K,G)=>K===G?0:K.compareDocumentPosition(G)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);let P=u.indexOf(r.currentTarget)+(r.key==="ArrowDown"?1:-1);r.key==="Home"&&(P=0),r.key==="End"&&(P=u.length-1),u[Math.max(0,Math.min(u.length-1,P))]?.focus()}else r.key==="Enter"||r.key===" "?(r.preventDefault(),E?c(t.path):a(t.path)):E&&(r.key==="ArrowRight"&&!s||r.key==="ArrowLeft"&&s)&&(r.preventDefault(),c(t.path))},title:st(t),onClick:()=>{E?c(t.path):a(t.path)},onDoubleClick:()=>{E&&Q.execute({type:"navigate",dir:t.path})},onContextMenu:r=>{r.preventDefault(),d({x:r.clientX,y:r.clientY,entry:t,dir:O(t.path)})},children:[(0,e.jsx)("span",{className:`wand-explorer-chevron${s?" open":""}${g?"":" empty"}`,style:{width:12,flexShrink:0,transform:s?"rotate(90deg)":void 0},"aria-hidden":"true",children:g?"\u25B8":""}),(0,e.jsx)("span",{className:"wand-explorer-icon","aria-hidden":"true",children:(0,e.jsx)(V,{name:fe(t,s&&E)})}),(0,e.jsx)(M.Text,{ellipsis:!0,className:"wand-explorer-name",style:{flex:1,minWidth:0,textAlign:"left",color:"inherit"},children:t.name}),z?(0,e.jsx)(M.Text,{type:b?void 0:"secondary",className:"wand-explorer-size",style:{color:b?"inherit":void 0},children:z}):null,S&&(0,e.jsx)(ne,{className:`wand-explorer-git ${S.className}`,color:je(S),role:"img",title:S.label,"aria-label":S.label,children:S.text})]}),E&&s&&(0,e.jsxs)("div",{className:"wand-explorer-children",children:[v?.status==="loading"&&(0,e.jsxs)(k,{align:"center",gap:"small",className:"wand-explorer-row pending",style:{padding:"4px 8px",paddingLeft:8+(n+1)*12},role:"status",children:[(0,e.jsx)("span",{className:"wand-explorer-chevron empty"}),(0,e.jsx)("span",{className:"wand-explorer-name",children:"\u52A0\u8F7D\u4E2D"}),(0,e.jsx)(le,{className:"wand-explorer-dots",size:"small","aria-hidden":"true"})]}),v?.status==="error"&&(0,e.jsxs)(k,{align:"center",gap:"small",className:"wand-explorer-row error",style:{padding:"4px 8px",paddingLeft:8+(n+1)*12},role:"alert",children:[(0,e.jsx)("span",{className:"wand-explorer-chevron empty"}),(0,e.jsx)("span",{className:"wand-explorer-name",children:v.error||"\u8BFB\u53D6\u5931\u8D25"})]}),v?.status==="loaded"&&v.entries.length===0&&(0,e.jsxs)(k,{align:"center",gap:"small",className:"wand-explorer-row pending",style:{padding:"4px 8px",paddingLeft:8+(n+1)*12},children:[(0,e.jsx)("span",{className:"wand-explorer-chevron empty"}),(0,e.jsx)("span",{className:"wand-explorer-name",children:"\u7A7A\u6587\u4EF6\u5939"})]}),D&&T&&(0,e.jsx)(Xe,{depth:n+1,kind:T.kind,onCancel:()=>C(null),onSubmit:async r=>{let u=T.dir;C(null),r&&await Q.execute({type:T.kind==="file"?"create.file":"create.dir",dir:u,name:r})}}),v?.status==="loaded"&&v.entries.map(r=>(0,e.jsx)(Ge,{entry:r,depth:n+1,snapshot:i,activePath:l,onToggle:c,onFileActivate:a,onContextMenu:d,renameState:y,setRenameState:f,pendingCreate:T,setPendingCreate:C},r.path))]})]})}function Xe({depth:t,kind:n,onCancel:i,onSubmit:l}){let[c,a]=p.useState("");return(0,e.jsx)(k,{align:"center",gap:"small",className:"wand-explorer-row editing",style:{padding:"4px 8px",paddingLeft:8+t*12},children:(0,e.jsxs)(k,{align:"center",gap:"small",className:"wand-explorer-rename",style:{flex:1,minWidth:0},children:[(0,e.jsx)("span",{className:"wand-explorer-icon",children:(0,e.jsx)(V,{name:n==="file"?"file":"folder"})}),(0,e.jsx)(_,{value:c,autoFocus:!0,"aria-label":n==="file"?"\u65B0\u6587\u4EF6\u540D":"\u65B0\u6587\u4EF6\u5939\u540D",placeholder:n==="file"?"\u6587\u4EF6\u540D\uFF08\u56DE\u8F66\u521B\u5EFA\uFF0CEsc \u53D6\u6D88\uFF09":"\u6587\u4EF6\u5939\u540D\uFF08\u56DE\u8F66\u521B\u5EFA\uFF0CEsc \u53D6\u6D88\uFF09",spellCheck:!1,onChange:d=>a(d.currentTarget.value),onClick:d=>d.stopPropagation(),onBlur:()=>c.trim()?l(c):i(),onKeyDown:d=>{d.nativeEvent.isComposing||(d.key==="Enter"?(d.preventDefault(),l(c)):d.key==="Escape"&&(d.preventDefault(),i()))}})]})})}function ct({state:t,onClose:n,onAction:i}){let l=p.useRef(null),c=ve(),a=p.useRef(new Map),d=p.useRef(document.activeElement);p.useLayoutEffect(()=>{[...a.current.values()].find(h=>!h.disabled)?.focus({preventScroll:!0})},[]),p.useEffect(()=>{let h=b=>{l.current&&!l.current.contains(b.target)&&n()},g=b=>{b.target instanceof Node&&l.current?.contains(b.target)||n()};return window.addEventListener("mousedown",h,!0),window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("mousedown",h,!0),window.removeEventListener("scroll",g,!0)}},[n]);let y=typeof window<"u"?window.innerWidth:1024,f=typeof window<"u"?window.innerHeight:768,T=Math.min(t.x,y-184),C=Math.min(t.y,f-400),R=t.entry,E=R?.type==="dir",v=E&&R?R.path:t.dir,s=(h,g,b={})=>(0,e.jsx)(Ee,{label:h,tone:b.danger?"danger":"default",ref:S=>{S?a.current.set(g,S):a.current.delete(g)},disabled:b.disabled,onClick:()=>{d.current instanceof HTMLElement&&d.current.isConnected&&d.current.focus({preventScroll:!0}),i(g)}});return(0,$e.createPortal)((0,e.jsxs)(se,{ref:l,size:"small",styles:{body:{padding:4}},className:"wand-explorer-context-menu",style:{position:"fixed",zIndex:1100,pointerEvents:"auto",width:180,maxHeight:"calc(100dvh - 16px)",overflowY:"auto",overscrollBehavior:"contain",left:Math.max(8,T),top:Math.max(8,C)},role:"menu","aria-label":"\u6587\u4EF6\u64CD\u4F5C",onKeyDown:h=>{if(h.key==="Escape")h.preventDefault(),h.stopPropagation(),n(),d.current instanceof HTMLElement&&d.current.focus();else if(["ArrowDown","ArrowUp","Home","End"].includes(h.key)){h.preventDefault();let g=[...a.current.values()].filter(z=>!z.disabled),b=g.indexOf(document.activeElement),S=h.key==="Home"?0:h.key==="End"?g.length-1:b+(h.key==="ArrowDown"?1:-1);g[(S+g.length)%g.length]?.focus()}},children:[s("\u65B0\u5EFA\u6587\u4EF6","newFile",{disabled:!v}),s("\u65B0\u5EFA\u6587\u4EF6\u5939","newDir",{disabled:!v}),(0,e.jsx)(ie,{}),R?(0,e.jsxs)(e.Fragment,{children:[E?s("\u8FDB\u5165\u6B64\u76EE\u5F55","navigate"):s("\u6253\u5F00","open"),s("\u5728\u6587\u4EF6\u6811\u4E2D\u663E\u793A","reveal"),s("\u590D\u5236\u5B8C\u6574\u8DEF\u5F84","copyPath"),s("\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84","copyRelative"),!E&&s("\u4E0B\u8F7D\u6587\u4EF6","download"),(0,e.jsx)(ie,{}),s("\u91CD\u547D\u540D","rename"),s("\u79FB\u52A8\u5230\u2026","move"),s("\u5220\u9664","delete",{danger:!0})]}):(0,e.jsxs)(e.Fragment,{children:[s("\u5237\u65B0","refresh"),s("\u590D\u5236\u76EE\u5F55\u8DEF\u5F84","copyPath")]})]}),c??document.body)}function pt({snapshot:t,query:n,rows:i,activeIndex:l,listId:c,rowRefs:a,searchInputRef:d,onActiveIndex:y,onOpen:f,onReveal:T,onContextMenu:C,onFilter:R,onClear:E,onRetry:v}){let s=Ae(t.searchResults??[]),h=Ie(i,t.root),g=p.useRef(!1),b=new Map;i.forEach((w,F)=>b.set(w.path,F));let S=Be.find(w=>w.value===t.searchFilter),z=!t.searchError;return(0,e.jsxs)(k,{vertical:!0,className:"wand-explorer-search-panel",style:{flex:1,minHeight:0},children:[z&&(0,e.jsxs)(k,{wrap:!0,align:"center",gap:6,className:"wand-explorer-search-summary",style:{padding:"8px 0"},children:[(0,e.jsx)(M.Text,{className:"wand-explorer-search-count",children:t.searching?"\u641C\u7D22\u4E2D":`${s.all} \u9879\u7ED3\u679C${t.searchTruncated?" \xB7 \u5DF2\u622A\u65AD":""}`}),!t.searching&&t.searchDurationMs!==null&&s.all>0&&(0,e.jsxs)(M.Text,{type:"secondary",className:"wand-explorer-search-duration",children:[t.searchDurationMs," ms"]}),(0,e.jsx)(Fe,{className:"wand-explorer-search-filters",size:"small","aria-label":"\u6309\u7C7B\u578B\u7B5B\u9009\u7ED3\u679C",value:t.searchFilter,onMouseDown:()=>{g.current=!0},options:Be.map(w=>({value:w.value,disabled:s.all===0,label:(0,e.jsxs)(k,{align:"center",gap:4,className:"wand-explorer-filter-option",children:[w.label,(0,e.jsx)(M.Text,{type:"secondary",className:"wand-explorer-filter-count",children:s[w.value]})]})})),onChange:w=>{R(w),g.current&&d.current?.focus(),g.current=!1}})]}),!t.searching&&t.searchTruncated&&(0,e.jsx)(M.Text,{type:"secondary",className:"wand-explorer-search-limit",role:"status",children:"\u7ED3\u679C\u5DF2\u622A\u65AD\u3002\u8F93\u5165\u66F4\u5B8C\u6574\u540D\u79F0\uFF0C\u6216\u8FDB\u5165\u5B50\u76EE\u5F55\u7EE7\u7EED\u67E5\u627E\u3002"}),t.searching&&(0,e.jsx)(Se,{className:"wand-explorer-search-progress",percent:100,showInfo:!1,size:"small",status:"active","aria-label":"\u6B63\u5728\u641C\u7D22\u6587\u4EF6"}),t.searchError?(0,e.jsx)(X,{className:"wand-file-explorer-empty",type:"error",showIcon:!0,title:"\u641C\u7D22\u5931\u8D25",description:(0,e.jsxs)(k,{vertical:!0,gap:"small",children:[(0,e.jsx)("p",{className:"wand-file-explorer-empty-hint",children:t.searchError}),(0,e.jsx)(H,{kind:"ghost",size:"small",onClick:v,children:"\u91CD\u8BD5\u641C\u7D22"})]})}):i.length>0?(0,e.jsx)(k,{vertical:!0,id:c,className:"wand-explorer-results",role:"listbox","aria-label":"\u641C\u7D22\u7ED3\u679C",style:{flex:1,minHeight:0,overflowY:"auto"},children:h.map(w=>(0,e.jsxs)("div",{className:"wand-explorer-search-group",role:"group","aria-label":w.label,children:[(0,e.jsx)(se,{size:"small",variant:"borderless",className:"wand-explorer-search-group-label",title:(0,e.jsx)(M.Text,{ellipsis:!0,className:"wand-explorer-search-group-path",children:w.label}),extra:(0,e.jsx)(M.Text,{type:"secondary",className:"wand-explorer-search-group-count",children:w.entries.length}),styles:{body:{display:"none"},header:{minHeight:28,padding:"0 8px",fontSize:12}},style:{position:"sticky",top:0,zIndex:1,borderRadius:0,background:"var(--bg-secondary)"},children:(0,e.jsx)("span",{})}),w.entries.map(F=>{let L=b.get(F.path)??-1,D=L===l,N=Ke(F);return(0,e.jsxs)(ae,{block:!0,type:D?"primary":"text",size:"small",style:{justifyContent:"flex-start",gap:6,fontSize:13},id:`${c}-option-${L}`,ref:r=>{r?a.current?.set(F.path,r):a.current?.delete(F.path)},className:`wand-explorer-result${D?" active":""}`,role:"option","aria-selected":D,title:F.path,onMouseEnter:()=>y(L),onClick:()=>f(F),onDoubleClick:()=>T(F),onContextMenu:r=>{r.preventDefault(),C({x:r.clientX,y:r.clientY,entry:F,dir:O(F.path)})},children:[(0,e.jsx)("span",{className:"wand-explorer-result-icon","aria-hidden":"true",children:(0,e.jsx)(V,{name:fe(F,!1)})}),(0,e.jsx)(M.Text,{ellipsis:!0,className:"wand-explorer-result-name",style:{flex:1,minWidth:0,textAlign:"left",color:"inherit"},children:De(F.name,n).map((r,u)=>r.match?(0,e.jsx)(M.Text,{mark:!0,className:"wand-explorer-hit",children:r.value},u):(0,e.jsx)(p.Fragment,{children:r.value},u))}),N&&(0,e.jsx)(ne,{className:`wand-explorer-git ${N.className}`,color:je(N),role:"img",title:N.label,"aria-label":N.label,children:N.text})]},F.path)})]},w.key))}):t.searching?null:s.all>0?(0,e.jsxs)(j,{className:"wand-file-explorer-empty",description:null,children:[(0,e.jsxs)("p",{className:"wand-file-explorer-empty-title",children:["\u300C",S?.label??"\u5F53\u524D","\u300D\u7B5B\u9009\u4E0B\u6CA1\u6709\u7ED3\u679C"]}),(0,e.jsxs)(H,{kind:"ghost",size:"small",onClick:()=>R("all"),children:["\u663E\u793A\u5168\u90E8 ",s.all," \u9879"]})]}):(0,e.jsxs)(j,{className:"wand-file-explorer-empty",description:null,children:[(0,e.jsxs)("p",{className:"wand-file-explorer-empty-title",children:["\u6CA1\u6709\u5339\u914D\u300C",n,"\u300D\u7684\u6587\u4EF6"]}),(0,e.jsx)("p",{className:"wand-file-explorer-empty-hint",children:t.includeGenerated?"\u6309\u540D\u79F0\u641C\u7D22\uFF0C\u5305\u542B\u4F9D\u8D56\u4E0E\u751F\u6210\u76EE\u5F55\uFF1B\u6700\u591A\u5411\u4E0B 5 \u5C42\u3002":"\u6309\u540D\u79F0\u641C\u7D22\u9879\u76EE\u6587\u4EF6\uFF1B\u53EF\u52FE\u9009\u4E0A\u65B9\u9009\u9879\u5305\u542B\u4F9D\u8D56\u4E0E\u751F\u6210\u76EE\u5F55\u3002"}),(0,e.jsx)(H,{kind:"ghost",size:"small",onClick:E,children:"\u6E05\u9664\u641C\u7D22"})]}),i.length>0&&(0,e.jsxs)(k,{wrap:!0,gap:"small",className:"wand-explorer-keyhints","aria-hidden":"true",style:{padding:8},children:[(0,e.jsxs)("span",{children:[(0,e.jsx)(M.Text,{keyboard:!0,children:"\u2191"}),(0,e.jsx)(M.Text,{keyboard:!0,children:"\u2193"}),"\u9009\u62E9"]}),(0,e.jsxs)("span",{children:[(0,e.jsx)(M.Text,{keyboard:!0,children:"\u21B5"}),"\u6253\u5F00"]}),(0,e.jsxs)("span",{children:[(0,e.jsx)(M.Text,{keyboard:!0,children:"\u21E7\u21B5"}),"\u5728\u6811\u4E2D\u5B9A\u4F4D"]}),(0,e.jsxs)("span",{children:[(0,e.jsx)(M.Text,{keyboard:!0,children:"Esc"}),"\u6E05\u7A7A"]})]})]})}function Jt({root:t}){let n=p.useRef(new Map),i=p.useRef(new Map),l=p.useRef(null),c=p.useRef(null),a=dt(),d=(0,me.useSyncExternalStore)(q.subscribe,q.getSnapshot,q.getSnapshot),y=d.open?d.activePath:null,f=Q,[T,C]=p.useState(null),[R,E]=p.useState(null),[v,s]=p.useState(null),[h,g]=p.useState(null),[b,S]=p.useState(a.searchQuery),[z,w]=p.useState(0),F=a.searchQuery.trim(),L=F.length>0,D=p.useMemo(()=>Pe(a.searchResults??[],a.searchFilter),[a.searchResults,a.searchFilter]),N=D.length>0?Math.min(z,D.length-1):-1,r=p.useId();p.useEffect(()=>{t&&f.setRoot(t)},[t,f]),p.useEffect(()=>{S(a.searchQuery)},[a.searchQuery]),p.useEffect(()=>{w(0)},[F,a.searchFilter,a.searchResults]),p.useEffect(()=>{if(N<0)return;let o=D[N];o&&i.current.get(o.path)?.scrollIntoView({block:"nearest"})},[N,D]),p.useEffect(()=>{let o=a.revealPath;if(!o)return;let m=n.current.get(o),x=c.current;c.current=null,f.execute({type:"reveal.done"}),m&&(m.scrollIntoView({block:"center"}),(!x||x.path!==o||x.focus)&&m.focus({preventScroll:!0}))},[a.revealPath,f]),p.useEffect(()=>{if(!y)return;let o=U.getSnapshot();if(!o.root||!de(y,o.root)||o.searchQuery.trim())return;let m=n.current.get(y);if(m){m.scrollIntoView({block:"nearest"});return}c.current={path:y,focus:!1},f.execute({type:"reveal",path:y})},[y,f]);let u=o=>{c.current={path:o,focus:!0},f.execute({type:"reveal",path:o})},B=o=>{pe.open(o).then(m=>{if(m)return;let x=q.getSnapshot();x.activePath!==o||x.failure?.status!==415||(pe.execute({type:"close"}),We(o),J("\u8BE5\u6587\u4EF6\u65E0\u6CD5\u4EE5\u6587\u672C\u6253\u5F00\uFF0C\u5DF2\u5F00\u59CB\u4E0B\u8F7D","info"))})},P=a.root?a.expanded.get(a.root):void 0,K=async o=>{let m=T;if(C(null),!m)return;let x=m.entry;if(o==="newFile"){s({dir:m.entry?.type==="dir"?m.entry.path:m.dir,kind:"file"});return}if(o==="newDir"){s({dir:m.entry?.type==="dir"?m.entry.path:m.dir,kind:"dir"});return}if(o==="navigate"&&x){f.execute({type:"navigate",dir:x.path});return}if(o==="open"&&x){B(x.path);return}if(o==="reveal"&&x){u(x.path);return}if(o==="rename"&&x){E({path:x.path});return}if(o==="move"&&x){g({from:x.path,initialDir:O(x.path),isDir:x.type==="dir"});return}if(o==="delete"&&x){f.execute({type:"delete",path:x.path});return}if(o==="refresh"){f.execute({type:"refresh",dir:m.dir});return}if(o==="copyPath"){let $=await Oe(x?.path??m.dir);J($?"\u5DF2\u590D\u5236\u8DEF\u5F84":"\u590D\u5236\u5931\u8D25",$?"success":"error");return}if(o==="copyRelative"&&x&&a.root){let $=ut(x.path,a.root),he=await Oe($);J(he?"\u5DF2\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84":"\u590D\u5236\u5931\u8D25",he?"success":"error");return}if(o==="download"&&x){We(x.path);return}},G=o=>{o.type==="dir"?u(o.path):B(o.path)},_e=o=>{if(o.nativeEvent.isComposing)return;if((o.key==="ArrowDown"||o.key==="ArrowUp")&&D.length>0){o.preventDefault(),w(ee(N,D.length,o.key));return}if(o.key!=="Enter")return;let m=N>=0?D[N]:void 0;m&&(o.preventDefault(),o.shiftKey?u(m.path):G(m))},qe=v&&a.root&&v.dir===a.root?(0,e.jsx)(Xe,{depth:0,kind:v.kind,onCancel:()=>s(null),onSubmit:async o=>{let m=v.dir;s(null),o&&await f.execute({type:v.kind==="file"?"create.file":"create.dir",dir:m,name:o})}}):null;return(0,e.jsxs)(Ve.Provider,{value:n.current,children:[(0,e.jsx)("style",{id:"wand-file-explorer-styles",children:He}),(0,e.jsxs)(k,{vertical:!0,className:"wand-file-explorer",style:{flex:1,minHeight:0},onContextMenu:o=>{o.target===o.currentTarget&&(o.preventDefault(),C({x:o.clientX,y:o.clientY,entry:null,dir:a.activeDir||a.root}))},children:[(0,e.jsxs)(k,{align:"center",gap:4,className:"wand-file-explorer-toolbar",style:{padding:"4px 0 8px",flexShrink:0},children:[(0,e.jsx)(k,{className:"wand-file-explorer-search",style:{flex:1,minWidth:0},onKeyDown:_e,children:(0,e.jsx)(be,{value:b,label:"\u641C\u7D22\u6587\u4EF6",placeholder:"\u641C\u7D22\u6587\u4EF6\u2026",disabled:!a.root,inputRef:l,listId:L?r:void 0,activeOptionId:N>=0?`${r}-option-${N}`:void 0,onValueChange:S,onSearch:o=>{f.execute({type:"search.start",query:o})}})}),(0,e.jsx)(oe,{className:"wand-file-explorer-btn",title:"\u65B0\u5EFA\u6587\u4EF6","aria-label":"\u65B0\u5EFA\u6587\u4EF6",disabled:!a.root||a.busy,onClick:()=>s({dir:a.activeDir||a.root,kind:"file"}),children:(0,e.jsx)(V,{name:"newFile",size:15})}),(0,e.jsx)(oe,{className:"wand-file-explorer-btn",title:"\u65B0\u5EFA\u6587\u4EF6\u5939","aria-label":"\u65B0\u5EFA\u6587\u4EF6\u5939",disabled:!a.root||a.busy,onClick:()=>s({dir:a.activeDir||a.root,kind:"dir"}),children:(0,e.jsx)(V,{name:"newFolder",size:15})})]}),(0,e.jsxs)(k,{align:"center",className:"wand-explorer-search-scope",children:[(0,e.jsx)(ke,{disabled:!a.root,checked:a.includeGenerated,onChange:o=>{f.execute({type:"search.scope",includeGenerated:o.target.checked})},children:"\u5305\u542B\u4F9D\u8D56\u4E0E\u751F\u6210\u76EE\u5F55"}),(0,e.jsx)(M.Text,{type:"secondary",title:"\u6309\u540D\u79F0\u5339\u914D\u5F53\u524D\u76EE\u5F55\u53CA\u5411\u4E0B 5 \u5C42\uFF0C\u6700\u591A\u8FD4\u56DE 80 \u9879\uFF1B\u9879\u76EE\u6587\u4EF6\u4F18\u5148\u3002",children:"\u540D\u79F0 \xB7 5 \u5C42"})]}),L?(0,e.jsx)(pt,{snapshot:a,query:F,rows:D,activeIndex:N,listId:r,rowRefs:i,searchInputRef:l,onActiveIndex:w,onOpen:G,onReveal:o=>u(o.path),onContextMenu:C,onFilter:o=>{f.execute({type:"search.filter",filter:o})},onClear:()=>{f.execute({type:"search.clear"}),l.current?.focus()},onRetry:()=>{f.execute({type:"search.start",query:b})}}):(0,e.jsxs)(k,{vertical:!0,className:"wand-file-explorer-tree",style:{flex:1,minHeight:0,overflowY:"auto",overflowX:"hidden"},role:"tree","aria-label":"\u6587\u4EF6\u6811",children:[!a.root&&(0,e.jsx)(j,{className:"wand-file-explorer-empty",description:null,children:"\u5C1A\u672A\u9009\u62E9\u5DE5\u4F5C\u76EE\u5F55\u3002"}),a.root&&P?.status==="loading"&&!P.entries.length&&(0,e.jsxs)(j,{className:"wand-file-explorer-empty",description:null,children:[(0,e.jsx)(le,{size:"small"}),"\u52A0\u8F7D\u4E2D\u2026"]}),a.root&&P?.status==="error"&&(0,e.jsx)(X,{className:"wand-file-explorer-empty",type:"error",showIcon:!0,title:"\u8BFB\u53D6\u5931\u8D25",description:(0,e.jsxs)(k,{vertical:!0,gap:"small",children:[(0,e.jsx)("p",{className:"wand-file-explorer-empty-title",children:P.error||"\u8BFB\u53D6\u76EE\u5F55\u5931\u8D25"}),(0,e.jsx)(H,{kind:"ghost",size:"small",onClick:()=>{f.execute({type:"refresh",dir:a.root})},children:"\u91CD\u65B0\u52A0\u8F7D"})]})}),P?.status==="loaded"&&(0,e.jsxs)(e.Fragment,{children:[qe,P.entries.length>0?P.entries.map(o=>(0,e.jsx)(Ge,{entry:o,depth:0,snapshot:a,activePath:y,onToggle:m=>{f.execute({type:"toggle",dir:m})},onFileActivate:B,onContextMenu:m=>C(m),renameState:R,setRenameState:E,pendingCreate:v,setPendingCreate:s},o.path)):(0,e.jsx)(j,{className:"wand-file-explorer-empty",description:null,children:"\u8FD9\u4E2A\u76EE\u5F55\u662F\u7A7A\u7684\u3002"})]})]})]}),T&&(0,e.jsx)(ct,{state:T,onClose:()=>C(null),onAction:o=>{K(o)}}),(0,e.jsx)(Le,{request:h,onDismiss:()=>g(null),onSubmit:async(o,m)=>{let x=h;if(!x)return!1;if(m===o)return J("\u76EE\u6807\u4F4D\u7F6E\u4E0E\u5F53\u524D\u4F4D\u7F6E\u76F8\u540C\u3002","warning"),!1;if(x.isDir&&de(m,o))return J("\u4E0D\u80FD\u628A\u6587\u4EF6\u5939\u79FB\u52A8\u5230\u5B83\u81EA\u5DF1\u6216\u5B83\u7684\u5B50\u76EE\u5F55\u4E2D\u3002","warning"),!1;let $=await f.execute({type:"move",from:o,to:m});return $&&g(null),$}})]})}function dt(){return(0,me.useSyncExternalStore)(U.subscribe,U.getSnapshot,U.getSnapshot)}async function Oe(t){try{return await Ne(t),!0}catch{return!1}}function J(t,n){Te.toast(t,{tone:n})}function ut(t,n){return t.startsWith(n)?t.slice(n.length).replace(/^\/+/,"")||".":t}export{Jt as FileExplorerHost};
@@ -0,0 +1 @@
1
+ import{b as a,c as b,d as c}from"/assets/modules/55a47b6e2c2016f2/chunk.js";import"/assets/modules/6bd6ee3c9f05e2f5/chunk.js";import"/assets/modules/2460e872ab3a1f37/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";export{b as CodeTokens,c as MarkdownPreview,a as MessageFileContext};
@@ -1 +1 @@
1
- import{shared13_g as r}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared11_a as s}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared5_c as l}from"/assets/modules/4af10e1f8a789204/runtime.js";var c=l(s());var h={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z"}}]},name:"swap-right",theme:"outlined"},u=h;function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},f.apply(this,arguments)}var g=(e,t)=>c.createElement(r,f({},e,{ref:t,icon:u})),O=c.forwardRef(g),S=O;var o=l(s());var R={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},m=R;function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},d.apply(this,arguments)}var b=(e,t)=>o.createElement(r,d({},e,{ref:t,icon:m})),w=o.forwardRef(b),_=w;var i=l(s());var C={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},v=C;function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},p.apply(this,arguments)}var x=(e,t)=>i.createElement(r,p({},e,{ref:t,icon:v})),j=i.forwardRef(x),P=j;export{S as a,_ as b,P as c};
1
+ import{shared13_g as r}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared11_a as s}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared5_c as l}from"/assets/modules/2230c51655163cf3/runtime.js";var c=l(s());var h={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z"}}]},name:"swap-right",theme:"outlined"},u=h;function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},f.apply(this,arguments)}var g=(e,t)=>c.createElement(r,f({},e,{ref:t,icon:u})),O=c.forwardRef(g),S=O;var o=l(s());var R={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},m=R;function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},d.apply(this,arguments)}var b=(e,t)=>o.createElement(r,d({},e,{ref:t,icon:m})),w=o.forwardRef(b),_=w;var i=l(s());var C={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"},v=C;function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},p.apply(this,arguments)}var x=(e,t)=>i.createElement(r,p({},e,{ref:t,icon:v})),j=i.forwardRef(x),P=j;export{S as a,_ as b,P as c};
@@ -0,0 +1 @@
1
+ import{g as ge}from"/assets/modules/fa79ed5d045c24dd/chunk.js";import{shared2_a as me,shared2_b as ye}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared3_a as P}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared109_a as fe}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared20_n as se}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared51_g as U,shared51_h as ne}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/7f32261c1627c3cd/chunk.js";import{a as G}from"/assets/modules/91ee32135a3582b0/chunk.js";import{a as z}from"/assets/modules/3a2fa12c8b537964/chunk.js";import"/assets/modules/9eb83751622e2b97/chunk.js";import"/assets/modules/601a2767ae24d1cb/chunk.js";import"/assets/modules/d856bfc56bea5f20/chunk.js";import"/assets/modules/578703196f82222d/chunk.js";import"/assets/modules/02fad74223254019/chunk.js";import{a as B}from"/assets/modules/0c04f94bbfd39a2f/chunk.js";import{h as de}from"/assets/modules/d9019922118b2c37/chunk.js";import"/assets/modules/a41351130003e6bb/chunk.js";import{shared118_a as pe}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared120_a as ce}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared135_a as le}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared23_c as ue}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared24_g as ae}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared54_a as W}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared41_c as J}from"/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/c03e0f84f798d33a/chunk.js";import"/assets/modules/be497f1d39753979/chunk.js";import"/assets/modules/a63f0b3d73d97e0b/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/ce90d0b55bbe6430/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared55_a as re}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared60_a as c}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/3d10e3f6f6f92b55/chunk.js";import"/assets/modules/5472191457a926d3/chunk.js";import"/assets/modules/684db83476dcba20/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/e01769df89873feb/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared42_B as ie}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared61_a as g}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared13_zb as A}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared11_a as oe}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared5_c as T}from"/assets/modules/2230c51655163cf3/runtime.js";var u=T(oe(),1);var f=T(A(),1);function Se({data:e,disabled:y,save:k}){let b=e.settings.autoResources===!0,R=e.autoResourcesAvailable===!0,d=e.autoResourcesReason||"\u8BF7\u66F4\u65B0\u670D\u52A1\u7AEF\u6216\u542F\u7528\u672C\u5730\u51B3\u7B56\u540E\u4F7F\u7528\u3002";return(0,f.jsxs)(g,{vertical:!0,gap:8,component:"section","aria-label":"\u6309\u63D0\u793A\u8BCD\u81EA\u52A8\u914D\u7F6E",children:[(0,f.jsxs)(g,{justify:"space-between",align:"center",gap:12,children:[(0,f.jsxs)(g,{vertical:!0,children:[(0,f.jsx)(c.Text,{strong:!0,children:"\u6309\u63D0\u793A\u8BCD\u81EA\u52A8\u914D\u7F6E"}),(0,f.jsx)(c.Text,{type:"secondary",children:e.skillLocksAvailable?"\u9501\u5B9A\u7684 Skills \u4FDD\u6301\u5F00/\u5173\uFF0C\u5176\u4F59\u81EA\u52A8\u9009\u62E9\uFF1BMCP \u624B\u9009\u4E0E CodeMode \u624B\u52A8\u8986\u76D6\u4F18\u5148\u3002":e.autoCodemodeAvailable?"\u53D1\u9001\u540E\u9009\u62E9 Skills / MCP \u5E76\u5224\u65AD CodeMode\uFF1B\u624B\u9009\u4E0E\u624B\u52A8\u8986\u76D6\u4F18\u5148\u3002":"\u53D1\u9001\u540E\u9009\u62E9 Skills / MCP\uFF0C\u4FDD\u7559\u624B\u9009\u9879\u3002"})]}),(0,f.jsx)(de,{ariaLabel:"\u6309\u63D0\u793A\u8BCD\u81EA\u52A8\u914D\u7F6E",checked:b,disabled:y||!R&&!b,onCheckedChange:m=>{k({autoResources:m})}})]}),(0,f.jsx)(c.Text,{type:"secondary",children:R?"\u4EC5\u672C\u4F1A\u8BDD \xB7 \u672C\u8F6E\u914D\u7F6E\u663E\u793A\u5728\u5C0F\u5B57\u6D88\u606F\u4E2D\uFF1B\u5931\u8D25\u6CBF\u7528\u539F\u914D\u7F6E\uFF0CMCP \u76EE\u524D\u53EA\u6309\u660E\u786E\u70B9\u540D\u9009\u62E9\u3002":d}),e.decisionAdvisor?.notice?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ge,{tone:"warning",children:e.decisionAdvisor.notice}),(0,f.jsx)(fe,{admin:!y})]}):null,R&&!e.autoCodemodeAvailable&&(0,f.jsx)(c.Text,{type:"secondary",children:"\u5F53\u524D\u670D\u52A1\u7AEF\u4EC5\u81EA\u52A8\u9009\u62E9 Skills / MCP\uFF1BCodeMode \u81EA\u52A8\u5224\u65AD\u9700\u66F4\u65B0\u670D\u52A1\u7AEF\u3002"})]})}var E=T(oe(),1);var L=T(A(),1),H=["off","on","locked"],Re=["\u5173\u95ED","\u5F00\u542F","\u5F00\u542F\u5E76\u9501\u5B9A"];function ve({name:e,mode:y,disabled:k,onModeChange:b}){let[R,d]=E.useState(null),m=E.useRef(null),S=E.useRef(!1),o=R??H.indexOf(y),p=k||S.current,I=n=>{let C=n.currentTarget.getBoundingClientRect();return Math.max(0,Math.min(2,Math.floor((n.clientX-C.left)/C.width*3)))},h=()=>{m.current=null,d(null)};async function x(n){if(S.current||k){h();return}if(H[n]===y){d(null);return}S.current=!0,d(n);try{await b(H[n])}finally{S.current=!1,d(null)}}return E.useEffect(()=>{k&&m.current!==null&&h()},[k]),(0,L.jsx)("div",{className:"wand-pi-skill-switch",style:{width:114,flexShrink:0,touchAction:"pan-y",userSelect:"none",direction:"ltr"},role:"slider",tabIndex:p?-1:0,"aria-label":`Skill ${e} \u4F7F\u7528\u8BBE\u7F6E`,"aria-valuemin":0,"aria-valuemax":2,"aria-valuenow":o,"aria-valuetext":Re[o],"aria-disabled":p,"data-mode":H[o],"data-dragging":m.current!==null,title:"\u53F3\u6ED1\uFF1A\u5173 \u2192 \u5F00 \u2192 \u5F00\u5E76\u9501\u5B9A\uFF1B\u5DE6\u6ED1\u56DE\u5F00\u89E3\u9501",onPointerDown:n=>{p||n.button!==0||(n.preventDefault(),n.currentTarget.focus({preventScroll:!0}),m.current=n.pointerId,n.currentTarget.setPointerCapture(n.pointerId),d(I(n)))},onPointerMove:n=>{m.current===n.pointerId&&d(I(n))},onPointerUp:n=>{m.current===n.pointerId&&(m.current=null,x(I(n)))},onPointerCancel:h,onLostPointerCapture:()=>{m.current!==null&&h()},onKeyDown:n=>{if(p)return;let C=n.key==="ArrowRight"||n.key==="ArrowUp"?Math.min(2,o+1):n.key==="ArrowLeft"||n.key==="ArrowDown"?Math.max(0,o-1):n.key==="Home"?0:n.key==="End"?2:null;C!==null&&(n.preventDefault(),n.stopPropagation(),x(C))},children:(0,L.jsx)("div",{"aria-hidden":"true",inert:!0,style:{pointerEvents:"none"},children:(0,L.jsx)(ue,{block:!0,size:"small",value:H[o],disabled:p,options:[{value:"off",label:"\u5173"},{value:"on",label:"\u5F00"},{value:"locked",label:(0,L.jsx)("span",{className:"wand-pi-skill-switch-lock",style:{visibility:o===0?"hidden":void 0},children:(0,L.jsx)(J,{name:o===2?"lock":"unlock",size:15})})}]})})})}function ke(e){return`/api/sessions/${encodeURIComponent(e)}/pi-settings`}var K={load(e,y){return U(ke(e),{credentials:"same-origin",cache:"no-store",signal:y})},save(e,y,k){return U(ke(e),{...ne(y,"PATCH"),credentials:"same-origin",signal:k})}};var s=T(A(),1),V=e=>`wand-pi-settings-panel-${e.sessionId}`,Q="\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u529F\u80FD\u4E0E Skills / MCP\u2026",Ce=[{value:"follow",label:"\u8DDF\u968F Pi \u914D\u7F6E"},{value:"off",label:"\u5173\u95ED"},{value:"on",label:"\u542F\u7528"},{value:"only",label:"\u4EC5 CodeMode"}];function we(e){return e.engine==="cli"?"\u5F71\u54CD\u5F53\u524D\u4F1A\u8BDD\u7684\u4E0B\u4E00\u8F6E\uFF0C\u5E76\u8BB0\u4E3A\u4E4B\u540E\u65B0\u5EFA Pi CLI \u4F1A\u8BDD\u7684\u9ED8\u8BA4\uFF1B\u5176\u4ED6\u5DF2\u6709\u4F1A\u8BDD\u4E0D\u53D8\u3002":"\u4EC5\u5F71\u54CD\u5F53\u524D Wand Agent \u4F1A\u8BDD\u7684\u4E0B\u4E00\u8F6E\uFF1B\u4E0D\u4F1A\u6539\u52A8\u5168\u5C40\u9ED8\u8BA4\u6216\u5176\u4ED6\u4F1A\u8BDD\u3002"}function Te(e){return e?e.resourceCatalog?e.resourceCatalog.supported?e.settings.resources?[e.skillLocksAvailable?"Skills \u4E09\u6863\uFF1A\u5173 \u2192 \u5F00 \u2192 \u5F00\u5E76\u9501\u5B9A\u3002\u9501\u5B9A\u9879\u59CB\u7EC8\u5F00\u542F\uFF0C\u672A\u9501\u5B9A\u9879\u7531\u81EA\u52A8\u914D\u7F6E\u9009\u62E9\uFF1B\u5DE6\u6ED1\u56DE\u300C\u5F00\u300D\u89E3\u9501\u3002":"\u5F53\u524D\u670D\u52A1\u7AEF\u4E0D\u652F\u6301 Skill \u9501\u5B9A\uFF0C\u8BF7\u66F4\u65B0\u670D\u52A1\u7AEF\u3002","\u57FA\u7840\u5DE5\u5177\u4FDD\u6301\u73B0\u6709\u914D\u7F6E\uFF0CMCP \u624B\u9009\u9879\u4FDD\u7559\u3002","\u9009\u62E9\u4E0D\u662F\u6587\u4EF6\u7CFB\u7EDF\u6C99\u7BB1\uFF1B\u65E7\u4F1A\u8BDD\u5386\u53F2\u4E2D\u5DF2\u8BFB\u8FC7\u7684\u6280\u80FD\u5185\u5BB9\u4E0D\u4F1A\u88AB\u5220\u9664\u3002"]:["\u65E7\u4F1A\u8BDD\u4ECD\u6CBF\u7528 Pi \u81EA\u52A8\u53D1\u73B0\uFF1B\u52FE\u9009\u4EFB\u610F\u9879\u6216\u70B9\u51FB\u300C\u6539\u4E3A\u4EC5\u9009\u5B9A\u8D44\u6E90\u300D\u540E\uFF0C\u4E0B\u4E00\u8F6E\u624D\u505C\u6B62\u52A0\u8F7D\u672A\u9009\u9879\u3002\u57FA\u7840\u5DE5\u5177\u4E0D\u53D7\u5F71\u54CD\u3002"]:[e.resourceCatalog.reason||"\u6B64\u4F1A\u8BDD\u4E0D\u652F\u6301 Skills / MCP \u9009\u62E9\u3002"]:["\u5F53\u524D\u670D\u52A1\u7AEF\u5C1A\u4E0D\u652F\u6301 Skills / MCP \u9009\u62E9\uFF0C\u8BF7\u66F4\u65B0\u670D\u52A1\u7AEF\u3002"]:[]}function et({mount:e}){let[y,k]=u.useState(0),[b,R]=u.useState(""),d=`${e.sessionId}|${e.open?"open":"closed"}|${e.openRevision??0}|${y}`,[m,S]=u.useState(()=>({key:d,phase:"loading",message:Q,data:null}));m.key!==d&&(S({key:d,phase:"loading",message:Q,data:null}),b&&R(""));let{data:o,phase:p,message:I}=m.key===d?m:{data:null,phase:"loading",message:Q},h=u.useRef(0),x=u.useRef(null),n=u.useRef(!1),C=u.useRef(null),X=u.useRef(null),F=u.useRef(null),Y=u.useRef(!1),j=`wand-pi-codemode-${e.sessionId}`;function q(t,l){let r=P.getSnapshot().mounts[0];return h.current===t&&!l.aborted&&r?.open===!0&&r.sessionId===e.sessionId&&r.target===e.target&&r.openRevision===e.openRevision}u.useEffect(()=>P.registerFocus(e,()=>{let t=X.current;return t&&!t.disabled?(t.focus({preventScroll:!0}),document.activeElement===t):F.current&&!F.current.disabled?(F.current.focus({preventScroll:!0}),document.activeElement===F.current):!1}),[e.sessionId,e.target]),u.useEffect(()=>{let t=++h.current;if(x.current?.abort(),n.current=!1,!e.open)return;let l=new AbortController;return x.current=l,K.load(e.sessionId,l.signal).then(r=>{q(t,l.signal)&&S({key:d,phase:"ready",data:r,message:r.resourceCatalog?.supported?"\u9009\u62E9\u540E\u81EA\u52A8\u4FDD\u5B58\uFF0C\u4ECE\u4E0B\u4E00\u8F6E\u751F\u6548\uFF1B\u4E0D\u6253\u65AD\u5F53\u524D\u6267\u884C\u3002":r.resourceCatalog?.reason||"\u8BF7\u66F4\u65B0\u670D\u52A1\u7AEF\u4EE5\u9009\u62E9 Skills / MCP"})}).catch(r=>{q(t,l.signal)&&S({key:d,phase:"failed",data:null,message:r instanceof Error?r.message:"\u8BFB\u53D6\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002"})}),()=>{++h.current,l.abort(),x.current?.abort()}},[d,e.sessionId,e.open]),u.useEffect(()=>{if(!e.open||!P.hasPendingFocus())return;let t=0,l=()=>{P.hasPendingFocus()&&(P.focusControl()?P.clearPendingFocus():t=requestAnimationFrame(l))};return t=requestAnimationFrame(l),()=>cancelAnimationFrame(t)},[e.open,p]),u.useEffect(()=>{if(!e.open)return;let t=r=>{let a=r.target;C.current?.contains(a)||e.toggleTarget.contains(a)||a?.closest("#input-box")||ae(a,j)||P.dismiss()},l=r=>{r.key!=="Escape"||r.defaultPrevented||Y.current||(r.preventDefault(),r.stopPropagation(),P.dismiss(),e.returnFocus())};return document.addEventListener("pointerdown",t),document.addEventListener("keydown",l),()=>{document.removeEventListener("pointerdown",t),document.removeEventListener("keydown",l)}},[e.open,e.returnFocus,e.toggleTarget,j]);async function O(t){if(!o||n.current||t.resources&&!o.resourceCatalog?.supported||"lockedSkills"in t&&!o.skillLocksAvailable||"codemodeOverride"in t&&!o.controls?.codemodeOverride)return!1;n.current=!0;let l=++h.current,r=new AbortController;x.current=r,S(a=>({...a,phase:"saving",message:"\u6B63\u5728\u4FDD\u5B58\u9009\u62E9\u2026"}));try{let a=await K.save(e.sessionId,t,r.signal);if(!q(l,r.signal))return!1;let w=t.resources,D=a.settings?.resources;if(w&&(!D||JSON.stringify(D.skills)!==JSON.stringify(w.skills)||JSON.stringify(D.mcpServers)!==JSON.stringify(w.mcpServers)))throw new Error("\u670D\u52A1\u7AEF\u672A\u786E\u8BA4\u672C\u6B21\u9009\u62E9\uFF0C\u8BF7\u91CD\u5F00\u9762\u677F\u6838\u5BF9\u5B9E\u9645\u8BBE\u7F6E\u3002");if("lockedSkills"in t&&JSON.stringify(a.settings.lockedSkills)!==JSON.stringify(t.lockedSkills))throw new Error("\u670D\u52A1\u7AEF\u672A\u786E\u8BA4 Skill \u9501\u5B9A\uFF0C\u8BF7\u91CD\u5F00\u9762\u677F\u6838\u5BF9\u5B9E\u9645\u8BBE\u7F6E\u3002");if("autoResources"in t&&a.settings.autoResources===!0!==t.autoResources)throw new Error("\u670D\u52A1\u7AEF\u672A\u786E\u8BA4\u81EA\u52A8\u9009\u62E9\u8BBE\u7F6E\uFF0C\u8BF7\u91CD\u65B0\u8BFB\u53D6\u6838\u5BF9\u3002");if("codemodeOverride"in t&&(a.settings.codemodeOverride??null)!==t.codemodeOverride)throw new Error("\u670D\u52A1\u7AEF\u672A\u786E\u8BA4 CodeMode \u8BBE\u7F6E\uFF0C\u8BF7\u91CD\u65B0\u8BFB\u53D6\u6838\u5BF9\u3002");return S({key:d,phase:"saved",data:{...o,settings:a.settings},message:"\u5DF2\u4FDD\u5B58 \xB7 \u4ECE\u4E0B\u4E00\u8F6E\u751F\u6548"}),e.onSaved(e.sessionId,a.settings),!0}catch(a){return q(l,r.signal)&&S(w=>({...w,phase:"failed",message:a instanceof Error?a.message:"\u4FDD\u5B58\u5931\u8D25\uFF0C\u539F\u9009\u62E9\u672A\u6539\u53D8\u3002"})),!1}finally{h.current===l&&(n.current=!1)}}let N=o?.settings.resources,Z=t=>{O({resources:t})},M=!!o?.resourceCatalog?.supported,$=!M||p==="saving"||p==="loading",he=b.trim().toLocaleLowerCase();function ee(t,l){let r=o?.resourceCatalog?.[t]??[],a=N?.[t]??[],w=t==="skills"?o?.settings.lockedSkills??[]:[],D=[...new Set([...a,...w])].filter(i=>!r.some(v=>v.id===i)),te=r.filter(i=>`${i.name} ${i.description}`.toLocaleLowerCase().includes(he)),Pe=(i,v)=>{let _=N??{skills:[],mcpServers:[]};Z({..._,[t]:v?[..._[t],i.id]:_[t].filter(be=>be!==i.id)})};return(0,s.jsxs)(G,{size:"small",title:l,extra:(0,s.jsx)(c.Text,{type:"secondary",children:N?`${a.length} / ${r.length}`:`${r.length} \u9879\u53EF\u9009`}),"aria-label":l,children:[r.length?te.length?null:(0,s.jsx)(B,{image:B.PRESENTED_IMAGE_SIMPLE,description:`\u6CA1\u6709\u5339\u914D\u7684${l}`}):(0,s.jsx)(B,{image:B.PRESENTED_IMAGE_SIMPLE,description:t==="skills"?"\u5C1A\u672A\u53D1\u73B0\u5DF2\u5B89\u88C5\u7684 Skill":"\u5C1A\u672A\u914D\u7F6E MCP \u670D\u52A1\uFF08\u4E0D\u4F1A\u81EA\u52A8\u5B89\u88C5\u6216\u8FDE\u63A5\uFF09"}),(0,s.jsxs)(z,{size:"small",children:[te.map(i=>(0,s.jsx)(z.Item,{className:"wand-pi-resource-item","data-selected":a.includes(i.id),children:t==="skills"&&o?.skillLocksAvailable?(0,s.jsxs)(g,{align:"center",justify:"space-between",gap:12,style:{width:"100%"},children:[(0,s.jsxs)(g,{vertical:!0,style:{minWidth:0},children:[(0,s.jsx)(c.Text,{strong:!0,children:i.name}),(0,s.jsx)(c.Text,{type:"secondary",children:i.description})]}),(0,s.jsx)(ve,{name:i.name,mode:me(o.settings,i.id),disabled:$,onModeChange:v=>O(ye(o.settings,i.id,v))})]}):(0,s.jsx)(pe,{"aria-label":`\u542F\u7528 ${i.name}`,checked:a.includes(i.id),disabled:$,onChange:v=>Pe(i,v.target.checked),children:(0,s.jsxs)(g,{vertical:!0,children:[(0,s.jsx)(c.Text,{strong:!0,children:i.name}),(0,s.jsx)(c.Text,{type:"secondary",children:i.description})]})})},i.id)),D.map(i=>(0,s.jsx)(z.Item,{children:(0,s.jsxs)(g,{align:"center",justify:"space-between",gap:12,style:{width:"100%"},children:[(0,s.jsxs)(g,{vertical:!0,children:[(0,s.jsx)(c.Text,{type:"danger",strong:!0,children:"\u8D44\u6E90\u5DF2\u79FB\u9664"}),(0,s.jsx)(c.Text,{type:"secondary",children:"\u4E0D\u4F1A\u56DE\u9000\u52A0\u8F7D\u5176\u4ED6\u8D44\u6E90\uFF1B\u53D6\u6D88\u6B64\u9879\u540E\u53EF\u91CD\u65B0\u9009\u62E9\u3002"})]}),(0,s.jsx)(W,{kind:"ghost",disabled:$,"aria-label":"\u53D6\u6D88\u5DF2\u79FB\u9664\u8D44\u6E90",onClick:()=>{O({resources:{...N??{skills:[],mcpServers:[]},[t]:a.filter(v=>v!==i)},...t==="skills"&&o?.skillLocksAvailable?{lockedSkills:w.filter(v=>v!==i)}:{}})},children:"\u53D6\u6D88"})]})},i))]})]},t)}return(0,s.jsx)(ie,{children:(0,s.jsx)("div",{className:`wand-pi-settings wand-pi-settings-inner${e.open?" is-open":""}`,hidden:!e.open,"aria-hidden":!e.open,inert:!e.open,style:{pointerEvents:"auto"},id:V(e),ref:C,role:"region","aria-labelledby":`${V(e)}-title`,"data-wand-popup-owner":`wand-pi-settings-${e.sessionId}`,"data-wand-ui-root":"",children:(0,s.jsx)(G,{size:"small",title:(0,s.jsxs)("span",{id:`${V(e)}-title`,children:[o?se("pi",o.engine):"\u4F1A\u8BDD"," \u529F\u80FD\u8BBE\u7F6E"]}),extra:(0,s.jsx)(W,{kind:"ghost",type:"button","aria-label":"\u5173\u95ED\u4F1A\u8BDD\u529F\u80FD\u8BBE\u7F6E",onClick:()=>{P.dismiss(),e.returnFocus()},children:(0,s.jsx)(J,{name:"close",size:15})}),children:(0,s.jsxs)(g,{vertical:!0,gap:12,children:[o&&(0,s.jsx)(c.Text,{type:"secondary",className:"wand-pi-settings-scope",children:we(o)}),(0,s.jsx)(re,{type:p==="failed"?"error":p==="saved"?"success":"info",title:I,className:"wand-pi-settings-feedback",role:"status","aria-live":"polite","data-phase":p,action:p==="failed"&&!o?(0,s.jsx)(W,{kind:"ghost",type:"button",onClick:()=>k(t=>t+1),children:"\u91CD\u8BD5"}):void 0}),(0,s.jsx)(ce,{value:b,onValueChange:R,label:"\u641C\u7D22 Skills / MCP",inputRef:X,disabled:!M}),(0,s.jsxs)(g,{vertical:!0,gap:16,style:{maxHeight:"min(390px, 45vh)",overflow:"auto",overflowAnchor:"none"},children:[M&&o&&(0,s.jsx)(Se,{data:o,disabled:$,save:O}),(0,s.jsxs)(g,{align:"center",justify:"space-between",gap:12,wrap:!0,children:[(0,s.jsxs)(g,{vertical:!0,style:{minWidth:0,flex:1},children:[(0,s.jsx)(c.Text,{strong:!0,children:"CodeMode"}),(0,s.jsx)(c.Text,{type:"secondary",children:o&&!o.controls?.codemodeOverride?"\u5F53\u524D\u670D\u52A1\u7AEF\u4E0D\u652F\u6301\u672C\u4F1A\u8BDD CodeMode \u8BBE\u7F6E\uFF0C\u8BF7\u66F4\u65B0\u670D\u52A1\u7AEF\u3002":"\u542F\u7528\u540E\u53EF\u5728\u811A\u672C\u4E2D\u7EC4\u5408\u5DE5\u5177\u8C03\u7528\uFF1B\u4EC5 CodeMode \u5C06\u5DE5\u5177\u58F0\u660E\u6536\u8FDB\u811A\u672C\u5165\u53E3\u3002"})]}),(0,s.jsx)(le,{ariaLabel:"CodeMode \u6A21\u5F0F",value:o?.settings.codemodeOverride??"follow",options:Ce.map(t=>t.value==="follow"&&o?.settings.autoResources&&o.autoCodemodeAvailable?{...t,label:"\u6309\u63D0\u793A\u8BCD\u81EA\u52A8\u5224\u65AD"}:t),triggerRef:F,contentClassName:j,popupOwner:j,disabled:!o?.controls?.codemodeOverride||p==="loading"||p==="saving",onOpenChange:t=>{Y.current=t},onValueChange:t=>{O({codemodeOverride:t==="follow"?null:t})}})]}),!N&&M&&(0,s.jsxs)(g,{align:"center",justify:"space-between",gap:12,wrap:!0,children:[(0,s.jsx)(c.Text,{type:"secondary",children:"\u65E7\u4F1A\u8BDD\u4ECD\u6CBF\u7528 Pi \u81EA\u52A8\u53D1\u73B0"}),(0,s.jsx)(W,{kind:"ghost",type:"button",disabled:$,onClick:()=>{Z({skills:[],mcpServers:[]})},children:"\u6539\u4E3A\u4EC5\u9009\u5B9A\u8D44\u6E90"})]}),M&&(0,s.jsxs)(s.Fragment,{children:[ee("skills","Skills"),ee("mcpServers","MCP")]}),M&&o?.resourceCatalog?.reason&&(0,s.jsx)(c.Text,{type:"secondary",children:o.resourceCatalog.reason}),Te(o).map(t=>(0,s.jsx)(c.Text,{type:"secondary",children:t},t))]})]})})})})}export{et as PiSettingsPanel,Te as panelNotes,we as piSettingsScope};
@@ -1,6 +1,6 @@
1
1
 
2
2
  const __wandCssTextPool = Object.freeze([".wand-new-session-library-dialog .ant-modal-body{scroll-padding-bottom:64px}.wand-new-session-summary{padding-bottom:16px;border-bottom:1px solid var(--border-subtle)}.wand-new-session-summary dl{display:grid;gap:4px;margin:0;font-size:12px}.wand-new-session-summary dl>div{display:grid;grid-template-columns:60px minmax(0,1fr);gap:8px}.wand-new-session-summary dt{color:var(--text-secondary)}.wand-new-session-summary dd{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.wand-new-session-summary .wand-new-session-permission-warning{color:var(--danger)}.wand-new-session-summary .wand-new-session-permission-detail{margin:4px 0 0;font-size:12px;line-height:1.5}.wand-new-session-permission-context dl{margin-bottom:8px}.wand-new-session-subject-collapse .ant-collapse-header-text{min-width:0}.wand-new-session-summary .ant-segmented{min-height:36px}.wand-new-session-library-dialog .ant-input-affix-wrapper,.wand-new-session-library-dialog .ant-input:not(.ant-input-affix-wrapper .ant-input),.wand-new-session-library-dialog .wand-ui-select-trigger{min-height:36px}.wand-new-session-library-dialog .ant-form-item{margin-bottom:12px}.wand-new-session-primary-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.wand-new-session-primary-fields.is-single{grid-template-columns:minmax(0,1fr)}.wand-new-session-primary-fields .ant-form-item{margin-bottom:0}.wand-execution-subject-picker .wand-ui-search{margin-bottom:12px}.wand-execution-subject-picker .ant-form-item{margin-bottom:0}.wand-execution-subject-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 12px}.wand-execution-subject-grid .ant-radio-wrapper{margin:0;min-width:0;padding-block:4px;align-items:center}.wand-execution-subject-grid .ant-radio-wrapper>span:last-child{flex:1;min-width:0}.wand-execution-subject-label .ant-typography{font-size:12px}.wand-execution-subject-label>svg,.wand-execution-subject-label>img{flex-shrink:0}.wand-new-session-logo-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:8px}@media(max-width:540px){.wand-execution-subject-grid,.wand-new-session-primary-fields{grid-template-columns:minmax(0,1fr)}.wand-new-session-logo-bar{flex-wrap:wrap}}@media(pointer:coarse){.wand-execution-subject-grid .ant-radio-wrapper{min-height:44px}.wand-new-session-logo-toggle{min-width:44px;min-height:44px}}\n"]);
3
- import{b as Qn,c as Zn}from"/assets/modules/f55031a02775c89e/chunk.js";import{a as Yn}from"/assets/modules/e33f6d66a02ec26c/chunk.js";import{a as Xn}from"/assets/modules/905f8bc3f8a3efb8/chunk.js";import"/assets/modules/a4af270960a39ea6/chunk.js";import{a as ze}from"/assets/modules/7375574a2ea42740/chunk.js";import{c as Ce}from"/assets/modules/96dd661559b67ebf/chunk.js";import{a as Dn,b as Mn}from"/assets/modules/eecaebc5482ee203/chunk.js";import{b as Qe}from"/assets/modules/6f341fe3e8aee844/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared111_e as Gn,shared111_f as Jn}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared49_b as Vn,shared49_d as $n}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared78_b as U}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared79_g as Me,shared79_h as Bn,shared79_i as Kn}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared112_c as Hn}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared113_c as Sn}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared104_a as X,shared104_b as re}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared65_a as Je}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared114_b as Se}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared93_a as zn,shared93_c as _n}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared67_a as Ge}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared115_k as Ye,shared115_o as Nn}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared50_k as be,shared50_r as Fe}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared17_f as qe}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared19_a as Fn}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared20_a as xn,shared20_d as vn,shared20_k as Re,shared20_m as bn,shared20_n as xe}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared51_f as Pe}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared52_a as Cn,shared52_c as He}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared86_a as De}from"/assets/modules/4af10e1f8a789204/runtime.js";import{b as jn}from"/assets/modules/456634525d44777d/chunk.js";import{c as ge}from"/assets/modules/c81a3d95b14cdcd4/chunk.js";import{a as ce}from"/assets/modules/4b9deeeb77570db3/chunk.js";import"/assets/modules/ef7f76b551fdc619/chunk.js";import"/assets/modules/4f30a913cc5b3f89/chunk.js";import"/assets/modules/e61136c22675ec7d/chunk.js";import{i as Ln}from"/assets/modules/36ce8123a2079807/chunk.js";import"/assets/modules/b38924f45bfa71d6/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared120_a as Wn}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared135_a as Ae}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared23_b as Y,shared23_c as An}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared24_a as We,shared24_i as On}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared54_a as _,shared54_b as Ze}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared41_c as y}from"/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/8e29056fb56439f7/chunk.js";import"/assets/modules/35a8fd2cfd31d7a0/chunk.js";import"/assets/modules/08c7b047195f138d/chunk.js";import"/assets/modules/a4dca2ffaf656d3c/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{b as Pn}from"/assets/modules/f6f86d43c12b0864/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared55_a as ie}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared60_a as L}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{a as Un}from"/assets/modules/38917c19e2cf1702/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/eece3c2d2374e8f7/chunk.js";import"/assets/modules/b0254a2d3652a925/chunk.js";import"/assets/modules/3601736ae2d678ef/chunk.js";import"/assets/modules/78a46adbf9807f89/chunk.js";import"/assets/modules/36bd608366c56b72/chunk.js";import"/assets/modules/321bd9c755bc30fc/chunk.js";import"/assets/modules/2981483671797b92/chunk.js";import"/assets/modules/c422f47fd13dc4bc/chunk.js";import"/assets/modules/32c461164a1b364c/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import"/assets/modules/aab92f2990a7185f/chunk.js";import"/assets/modules/222f48948517167e/chunk.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared42_B as En}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared47_a as ve}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared48_b as Le}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared61_a as f}from"/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import "/assets/modules/4af10e1f8a789204/runtime.js";import{shared13_K as Oe,shared13_N as In,shared13_a as Xe,shared13_ga as Tn,shared13_la as Rn,shared13_zb as fe}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared11_a as Ee}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared5_c as G,shared5_d as $e}from"/assets/modules/4af10e1f8a789204/runtime.js";var p=G(Ee(),1);var F=G(Ee());var{Option:qn}=ge;function et(e){return e?.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}var bt=(e,n)=>{let{prefixCls:l,className:s,style:t,popupClassName:c,dropdownClassName:g,children:I,dataSource:S,rootClassName:B,dropdownStyle:K,dropdownRender:C,popupRender:N,onDropdownVisibleChange:T,onOpenChange:R,styles:J,classNames:D,popupMatchSelectWidth:m,dropdownMatchSelectWidth:w}=e,E=In(I),j=N||C,V=R||T,M=m??w,q;E.length===1&&F.isValidElement(E[0])&&!et(E[0])&&([q]=E);let ee=q?()=>q:void 0,se;E.length&&et(E[0])?se=I:se=S?S.map(u=>{if(F.isValidElement(u))return u;switch(typeof u){case"string":return F.createElement(qn,{key:u,value:u},u);case"object":{let{value:W}=u;return F.createElement(qn,{key:W,value:W},u.text)}default:return}}):[];let{getPrefixCls:ne}=F.useContext(Rn),P=ne("select",l),Q={...e,popupRender:j,onOpenChange:V,popupMatchSelectWidth:M},[x,O]=Tn([D],[J],{props:Q},{popup:{_default:"root"}}),te=F.useMemo(()=>({root:Xe(`${P}-auto-complete`,s,B,x.root,{[`${P}-customize`]:q}),prefix:x.prefix,input:x.input,placeholder:x.placeholder,content:x.content,clear:x.clear,popup:{root:Xe(c,g,x.popup.root),list:x.popup.list,listItem:x.popup.listItem}}),[P,s,B,x,c,g]),i=F.useMemo(()=>({root:{...O.root,...t},input:O.input,prefix:O.prefix,placeholder:O.placeholder,content:O.content,clear:O.clear,popup:{root:{...K,...O.popup.root},list:O.popup.list,listItem:O.popup.listItem}}),[O,t,K]);return F.createElement(ge,{ref:n,suffixIcon:null,...Oe(e,["dataSource","dropdownClassName","popupClassName","onDropdownVisibleChange","onOpenChange"]),prefixCls:P,classNames:te,styles:i,mode:ge.SECRET_COMBOBOX_MODE_DO_NOT_USE,popupRender:j,onOpenChange:V,popupMatchSelectWidth:M,getInputElement:ee},se)},St=F.forwardRef(bt),en=St;var{Option:Ct}=ge,Nt=Pn(en,"popupAlign",e=>Oe(e,["visible"])),nn=en;nn.Option=Ct;nn._InternalPanelDoNotUseOrYouWillBeFired=Nt;var nt=nn;typeof document<"u"&&Le("wand-new-session-layout",__wandCssTextPool[0]);var Z=G(Ee(),1);var It="wand-global",tn="AI \u56E2\u961F\u9700\u8981\u5148\u9009\u62E9\u5DF2\u6709\u9879\u76EE\u3002";function tt(e,n){return!e||n==="global"||e===It?"":e}var Yt=[...Re.map(e=>({value:e.id,label:e.label,description:e.description})),{value:"shell",label:"\u7A7A\u767D\u7EC8\u7AEF",description:"\u4EC5\u542F\u52A8\u7CFB\u7EDF Shell"}];var ot=[{value:"structured",label:"\u5BF9\u8BDD",description:"\u9605\u8BFB\u56DE\u590D\u3001\u67E5\u770B\u5DE5\u5177\u6267\u884C\u8FC7\u7A0B"},{value:"pty",label:"\u7EC8\u7AEF",description:"\u4F7F\u7528\u547D\u4EE4\u884C\u5DE5\u5177\u7684\u4EA4\u4E92\u754C\u9762"}];var d=G(fe(),1),at=[...Re.map(e=>({id:e.id,provider:e.provider,engine:e.engine,label:e.label,description:e.description,structuredOnly:e.engine==="sdk"})),{id:"shell",provider:"shell",label:"\u7A7A\u767D\u7EC8\u7AEF",description:"\u4EC5\u542F\u52A8\u7CFB\u7EDF Shell"}];function on(e,...n){let l=n.join(" ").toLocaleLowerCase();return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean).every(s=>l.includes(s))}function it({selectedSubject:e,kind:n,model:l,disabled:s=!1,teams:t=null,teamWorkspaceId:c="",showModel:g=!0,showKind:I=!0,onSubjectChange:S,onKindChange:B,onModelChange:K}){let{employees:C,loading:N}=Fe(),T=ze(),R=Dn(!0),J=Mn(at,R??{},i=>i.provider),D=c==="",[m,w]=Z.useState(""),E=Z.useRef(null);Z.useEffect(()=>{E.current?.focus({preventScroll:!0})},[]),On(!!m,()=>{w(""),E.current?.focus({preventScroll:!0})});let j=C.filter(i=>!i.archivedAt&&on(m,"\u7845\u57FA\u5458\u5DE5",i.name,i.duty,...i.agents.map(u=>xe(u.provider,u.engine)))),V=t?.filter(i=>on(m,"AI \u56E2\u961F",i.name,i.detail??""))??[],M=J.filter(i=>on(m,"\u6267\u884C\u5DE5\u5177 CLI",i.label,i.description)),q=M.length>0||n!=="pty"&&(j.length>0||V.length>0),[ee,se]=Z.useState("claude"),[ne,P]=Z.useState(null);Z.useEffect(()=>{e.type==="cli"&&e.id!=="shell"&&se(e.id)},[e]);let Q=i=>{s||(B(i),i==="pty"&&(e.type==="employee"||e.type==="team")?(S({type:"cli",id:ee}),P("\u5DF2\u5207\u56DE\u547D\u4EE4\u884C\u5DE5\u5177\uFF1A\u7EC8\u7AEF\u4E0D\u652F\u6301\u5458\u5DE5\u548C\u56E2\u961F\u3002")):i==="pty"&&e.engine==="sdk"?(S({type:"cli",id:e.id}),P("\u5DF2\u5207\u56DE Pi CLI\uFF1AWand Agent \u4EC5\u652F\u6301\u5BF9\u8BDD\u3002")):P(null))},x=n==="pty",O=e.type==="cli"?e.id==="shell"?"shell":bn(e.id,e.engine):"",te=(i,u,W)=>(0,d.jsxs)(f,{align:"center",gap:8,className:"wand-execution-subject-label",children:[i,(0,d.jsxs)(f,{vertical:!0,style:{minWidth:0},children:[(0,d.jsx)(L.Text,{strong:!0,ellipsis:!0,title:u,children:u}),W?(0,d.jsx)(L.Text,{type:"secondary",ellipsis:!0,title:W,children:W}):null]})]});return(0,d.jsx)(En,{children:(0,d.jsxs)(f,{vertical:!0,gap:12,className:"wand-execution-subject-picker",children:[I?(0,d.jsx)(ce.Item,{label:"\u4F1A\u8BDD\u7C7B\u578B",children:(0,d.jsx)(An,{block:!0,"aria-label":"\u4F1A\u8BDD\u7C7B\u578B",value:n,disabled:s,options:ot.map(i=>({value:i.value,label:(0,d.jsx)("span",{title:i.description,children:i.label})})),onChange:i=>Q(i)})}):null,(0,d.jsxs)(ce.Item,{label:"\u6267\u884C\u5BF9\u8C61",children:[(0,d.jsx)(Wn,{value:m,onValueChange:w,disabled:s,inputRef:E,label:"\u641C\u7D22\u6267\u884C\u5BF9\u8C61",placeholder:"\u641C\u7D22\u5458\u5DE5\u3001\u56E2\u961F\u6216\u5DE5\u5177"}),ne?(0,d.jsx)(ie,{type:"warning",showIcon:!0,title:ne}):null,(0,d.jsx)(Ce.Group,{value:`${e.type}:${e.type==="cli"?O:e.id}`,disabled:s,"aria-label":"\u6267\u884C\u5BF9\u8C61",style:{width:"100%"},onChange:i=>{let u=String(i.target.value),W=u.indexOf(":"),me=u.slice(0,W),ue=u.slice(W+1);if(P(null),me==="cli"){let oe=at.find(Be=>Be.id===ue);if(oe){oe.structuredOnly&&n!=="structured"?(B("structured"),P(oe.id==="wand-agent"?"Wand Agent \u4F7F\u7528\u5BF9\u8BDD\u754C\u9762\u3002":null)):P(null),S({type:"cli",id:oe.provider,...oe.engine?{engine:oe.engine}:{}});return}}S({type:me,id:ue})},children:(0,d.jsxs)(f,{vertical:!0,gap:12,children:[!x&&(!m.trim()||j.length>0)?(0,d.jsxs)(f,{vertical:!0,gap:8,role:"group","aria-label":"\u7845\u57FA\u5458\u5DE5",children:[(0,d.jsx)(L.Text,{strong:!0,children:"\u7845\u57FA\u5458\u5DE5"}),N?(0,d.jsx)(ve,{size:"small"}):null,(0,d.jsx)("div",{className:"wand-execution-subject-grid",children:j.map(i=>(0,d.jsx)(Ce,{value:`employee:${i.id}`,children:te((0,d.jsx)(be,{employee:i,size:"md"}),i.name,i.duty||(i.agents[0]?`\u9996\u9009\uFF1A${xe(i.agents[0].provider,i.agents[0].engine)}`:"\u667A\u80FD\u52A9\u624B"))},i.id))}),!N&&C.every(i=>!!i.archivedAt)?(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{children:"\u8FD8\u6CA1\u6709\u7845\u57FA\u5458\u5DE5"}),(0,d.jsx)(_,{kind:"ghost",onClick:()=>Se.open("","","teams"),children:"\u62DB\u8058\u5458\u5DE5"})]}):null]}):null,!x&&V.length>0?(0,d.jsxs)(f,{vertical:!0,gap:8,role:"group","aria-label":"AI \u56E2\u961F",children:[(0,d.jsx)(L.Text,{strong:!0,children:"AI \u56E2\u961F"}),(0,d.jsx)("div",{className:"wand-execution-subject-grid",children:V.map(i=>(0,d.jsx)(Ce,{value:`team:${i.id}`,disabled:s||D,title:D?tn:void 0,children:te((0,d.jsx)(y,{name:"parallel",size:18}),i.name,i.detail)},i.id))}),D?(0,d.jsx)("p",{role:"status",children:tn}):null]}):null,M.length>0?(0,d.jsxs)(f,{vertical:!0,gap:8,role:"group","aria-label":"CLI \u5DE5\u5177",children:[(0,d.jsx)(L.Text,{strong:!0,children:"\u6267\u884C\u5DE5\u5177"}),(0,d.jsx)("div",{className:"wand-execution-subject-grid",children:M.map(i=>{let u=i.structuredOnly&&x;return(0,d.jsx)(Ce,{value:`cli:${i.id}`,disabled:s||u,title:u?"Wand Agent \u4EC5\u652F\u6301\u5BF9\u8BDD":void 0,children:te(i.id==="shell"?(0,d.jsx)(y,{name:"terminal",size:18}):i.engine==="sdk"?(0,d.jsx)(y,{name:"spark",size:18}):(0,d.jsx)(Fn,{provider:i.provider,className:"wand-subject-provider"}),i.label,i.description)},i.id)})})]}):null,q?null:(0,d.jsx)(L.Text,{type:"secondary",role:"status",children:"\u6CA1\u6709\u5339\u914D\u7684\u6267\u884C\u5BF9\u8C61\uFF0C\u8BF7\u66F4\u6362\u5173\u952E\u8BCD\u6216\u6E05\u7A7A\u641C\u7D22\u3002"})]})}),x?(0,d.jsx)(L.Paragraph,{type:"secondary",children:"\u7EC8\u7AEF\u76F4\u63A5\u4F7F\u7528\u547D\u4EE4\u884C\u5DE5\u5177\u3002\u8981\u4F7F\u7528\u5458\u5DE5\u3001\u56E2\u961F\u6216 Wand Agent\uFF0C\u8BF7\u9009\u62E9\u201C\u5BF9\u8BDD\u201D\u3002"}):null]}),g&&e.type==="cli"&&e.id!=="shell"?(0,d.jsx)(ce.Item,{label:"\u6A21\u578B",extra:"\u6240\u9009\u6A21\u578B\u968F\u4F1A\u8BDD\u542F\u52A8\u4E00\u8D77\u63D0\u4EA4\uFF1B\u300C\u8DDF\u968F\u670D\u52A1\u7AEF\u9ED8\u8BA4\u300D\u6CBF\u7528\u670D\u52A1\u7AEF\u914D\u7F6E\u7684\u9ED8\u8BA4\u6A21\u578B\u3002",children:(0,d.jsx)(Ae,{value:l||Ye,options:Nn(T,e.id),ariaLabel:"\u6A21\u578B",searchable:!0,searchPlaceholder:"\u641C\u7D22\u6A21\u578B",disabled:s,className:"wand-workspace-agent-model-select",onValueChange:K})}):null]})})}var an=(e,n)=>globalThis.fetch(e,n),Tt=["structured","pty"],Rt=["default","full-access","auto-edit","native","managed"];function rn(e,n,l){return typeof e=="string"&&n.includes(e)?e:l}function rt(e){return{defaultProvider:rn(e.defaultProvider,xn,"claude"),defaultSessionKind:rn(e.defaultSessionKind,Tt,"structured"),defaultMode:rn(e.defaultMode,Rt,"default"),defaultCwd:He(e.defaultCwd),defaultEngine:e.defaultEngine==="sdk"?"sdk":"cli"}}function st(e){return Array.isArray(e)?e.flatMap(n=>!Cn(n)||typeof n.path!="string"||!n.path.trim()?[]:[{path:n.path,name:He(n.name,n.path.split("/").filter(Boolean).at(-1)??n.path)}]):[]}function Et(e){return e==="codex"?["full-access"]:e==="opencode"||e==="grok"||e==="pi"?["default","full-access","managed"]:e==="qoder"?["default","full-access","auto-edit","managed"]:["default","full-access","auto-edit","native","managed"]}function _e(e,n,l="default"){let s=Et(e);return s.includes(n)?n:s.includes(l)?l:s[0]}function Pt(e){return e==="codex"?"codex-cli-exec":e==="opencode"?"opencode-cli-run":e==="grok"?"grok-cli-headless":e==="qoder"?"qoder-cli-print":e==="pi"?"pi-cli-json":"claude-cli-print"}function lt(e,n,l,s={}){let t=e.cwd.trim()||l.effectiveCwd.trim()||n.defaultCwd,c={cols:Number.isFinite(s.cols)&&(s.cols??0)>0?s.cols:void 0,rows:Number.isFinite(s.rows)&&(s.rows??0)>0?s.rows:void 0},g={cwd:t,worktreeEnabled:e.worktreeEnabled===!0,sessionSource:"interactive",...e.workspaceId?{workspaceId:e.workspaceId}:{},...e.workspaceTaskId?{workspaceTaskId:e.workspaceTaskId}:{}};if(e.kind==="shell")return{...g,...c,kind:"shell",shell:!0,mode:"default"};let I=_e(e.provider,e.mode,n.defaultMode),S={...g,provider:e.provider,mode:I},B=(e.model??"").trim()||(l.selectedModels?.[e.provider]??"").trim();if(e.kind==="pty")return{...S,...c,kind:"pty",command:vn(e.provider),model:B||void 0,...l.thinkingEffort?.trim()?{thinkingEffort:l.thinkingEffort.trim()}:{}};let K=l.thinkingEffort?.trim(),C=!!(e.employeeId&&e.specifiedCli),N=e.provider==="pi"&&e.engine==="sdk"?{engine:"sdk"}:{};return{...S,...N,kind:"structured",runner:Pt(e.provider),model:e.employeeId&&!e.specifiedCli?void 0:B||void 0,thinkingEffort:K||void 0,...e.employeeId?{employeeId:e.employeeId,overrideCli:C}:{}}}var sn=class{constructor(n=an){$e(this,"fetchImpl",n);$e(this,"preferenceWrite",Promise.resolve())}async loadConfig(n={}){if(await this.preferenceWrite.catch(()=>{}),this.fetchImpl===an){let s=await Vn();return n.signal?.throwIfAborted(),rt(s)}let l=await this.fetchImpl("/api/config",{credentials:"same-origin",signal:n.signal});return rt(await Pe(l))}async load(n={}){let l=await this.loadConfig(n),s=await this.fetchImpl("/api/recent-paths",{credentials:"same-origin",signal:n.signal}).then(async t=>t.ok?st(await t.json()):[]).catch(t=>{if(n.signal?.aborted)throw t;return[]});return{config:l,recentPaths:s}}savePreferences(n){if(Object.keys(n).length===0)return this.preferenceWrite;let l=this.preferenceWrite.catch(()=>{}).then(async()=>{let s=await this.fetchImpl("/api/settings/config",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(n)});await Pe(s),this.fetchImpl===an&&$n()});return this.preferenceWrite=l,l}async suggestPaths(n,l={}){let s=await this.fetchImpl(`/api/path-suggestions?q=${encodeURIComponent(n.trim())}`,{credentials:"same-origin",signal:l.signal});return s.ok?st(await s.json()):[]}async create(n){let l=n.kind==="structured",s="/api/sessions",t=l?{kind:"structured",cwd:n.cwd,mode:n.mode,provider:n.provider,runner:n.runner,engine:n.engine,worktreeEnabled:n.worktreeEnabled,model:n.model,thinkingEffort:n.thinkingEffort,employeeId:n.employeeId,overrideCli:n.overrideCli,...n.workspaceId?{workspaceId:n.workspaceId}:{},...n.workspaceTaskId?{workspaceTaskId:n.workspaceTaskId}:{},sessionSource:n.sessionSource}:{kind:"pty",command:n.kind==="pty"?n.command:void 0,provider:n.kind==="pty"?n.provider:void 0,shell:n.kind==="shell"||void 0,cwd:n.cwd,mode:n.mode,worktreeEnabled:n.worktreeEnabled,model:n.kind==="pty"?n.model:void 0,thinkingEffort:n.kind==="pty"?n.thinkingEffort:void 0,cols:n.cols,rows:n.rows,...n.workspaceId?{workspaceId:n.workspaceId}:{},...n.workspaceTaskId?{workspaceTaskId:n.workspaceTaskId}:{},sessionSource:n.sessionSource},c=await this.fetchImpl(s,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)}),g=await Pe(c);if(typeof g.id!="string"||!g.id)throw new Error("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u65B0\u4F1A\u8BDD ID\u3002");return g}},dt=new sn;async function pt(e,n,l){if(e.workspaceTaskId||e.taskName===void 0)return e;let s=e.taskName.trim();if(!s)throw new Error("\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0\u3002");let t={name:s,cwd:n,worktree:!1},c=e.workspaceId?await l.createTask(e.workspaceId,t):await l.createStandaloneTask(t);if(!c.id)throw new Error("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u65B0\u4EFB\u52A1 ID\uFF0C\u8BF7\u5237\u65B0\u4EFB\u52A1\u5217\u8868\u6838\u5BF9\u540E\u518D\u521B\u5EFA\u4F1A\u8BDD\u3002");return{...e,taskName:s,workspaceId:c.workspaceId,workspaceTaskId:c.id,cwd:c.cwd}}var ct=G(Ee(),1);var b=G(fe(),1);function ln({form:e,initialName:n,disabled:l,cwd:s,onChange:t,inline:c}){let{groups:g,loading:I,error:S,reload:B}=Hn(),[K,C]=ct.useState(!1),N=g.flatMap(m=>m.tasks.filter(w=>!w.archived).map(w=>({task:w,group:m}))),T=N.find(({task:m})=>m.id===e.workspaceTaskId),R=e.workspaceTaskId?T?.task.name||e.taskName||n||"\u6240\u9009\u4EFB\u52A1":e.taskName!==void 0?e.taskName||"\u65B0\u5EFA\u4EFB\u52A1\u2026":"\u9ED8\u8BA4\u4EFB\u52A1",J=(0,b.jsx)(Ae,{ariaLabel:"\u6240\u5C5E\u4EFB\u52A1",className:"wand-new-session-model-select",disabled:l,searchable:!0,searchPlaceholder:"\u641C\u7D22\u4EFB\u52A1",value:e.workspaceTaskId||(e.taskName!==void 0?"new":""),options:[{value:"",label:"\u9ED8\u8BA4\u4EFB\u52A1"},{value:"new",label:"\u65B0\u5EFA\u4EFB\u52A1\u2026"},...e.workspaceTaskId&&!T?[{value:e.workspaceTaskId,label:e.taskName||n||"\u5F53\u524D\u4EFB\u52A1"}]:[],...N.map(({task:m,group:w})=>({value:m.id,label:m.name,group:w.workspaceName}))],onValueChange:m=>{let w=N.find(({task:E})=>E.id===m);w?(t({...e,workspaceTaskId:w.task.id,workspaceId:w.task.workspaceId,taskName:void 0,cwd:w.task.worktree?.path||w.task.cwd||w.group.workspaceCwd}),c&&C(!1)):(m===""||m==="new")&&(t({...e,workspaceTaskId:void 0,workspaceId:T&&!T.group.synthetic&&!T.group.global?T.group.workspaceId:e.workspaceId,cwd:e.workspaceTaskId?e.cwd:T?.group.workspaceCwd||s,taskName:m==="new"?e.taskName??"":void 0}),m===""&&c&&C(!1))}}),D=(0,b.jsxs)(f,{vertical:!0,gap:8,style:c?{minWidth:260,padding:4}:void 0,children:[(0,b.jsx)(ce.Item,{label:"\u6240\u5C5E\u4EFB\u52A1",style:{marginBottom:0},children:J}),e.taskName!==void 0&&!e.workspaceTaskId?(0,b.jsx)(ce.Item,{label:"\u4EFB\u52A1\u540D\u79F0",htmlFor:"wand-new-session-task-name",required:!0,style:{marginBottom:0},extra:"\u5148\u521B\u5EFA\u4EFB\u52A1\uFF0C\u518D\u5728\u4EFB\u52A1\u4E2D\u542F\u52A8\u4F1A\u8BDD\u3002",children:(0,b.jsx)(We,{id:"wand-new-session-task-name",autoFocus:c,value:e.taskName,disabled:l,maxLength:200,placeholder:"\u8F93\u5165\u4EFB\u52A1\u540D\u79F0",onChange:m=>t({...e,taskName:m.currentTarget.value}),onKeyDown:m=>{m.key==="Enter"&&!m.nativeEvent.isComposing&&(m.preventDefault(),c&&C(!1))}})}):null,I?(0,b.jsx)("span",{role:"status",children:"\u6B63\u5728\u52A0\u8F7D\u5DF2\u6709\u4EFB\u52A1\u2026"}):null,S?(0,b.jsx)(ie,{type:"warning",title:S,action:(0,b.jsx)(_,{size:"small",onClick:()=>{B()},children:"\u91CD\u8BD5"})}):null,c&&e.taskName!==void 0?(0,b.jsx)(_,{onClick:()=>C(!1),children:"\u5B8C\u6210"}):null]});return c?(0,b.jsx)(Y,{ariaLabel:"\u9009\u62E9\u6240\u5C5E\u4EFB\u52A1",side:"bottom",open:K,onOpenChange:C,trigger:(0,b.jsxs)("button",{type:"button",disabled:l,className:"new-work-inline-trigger new-work-inline-task",title:`\u6240\u5C5E\u4EFB\u52A1\uFF1A${R}\uFF0C\u70B9\u51FB\u66F4\u6362`,"aria-label":"\u6240\u5C5E\u4EFB\u52A1",children:[(0,b.jsx)(y,{name:"clipboard",size:14,className:"new-work-inline-task-icon"}),(0,b.jsx)("span",{className:"new-work-inline-task-name",children:R}),(0,b.jsx)(y,{name:"chevronDown",size:12,className:"new-work-inline-arrow"})]}),children:D}):D}function mt(){Le("wand-new-work",`
3
+ import{b as Qn,c as Zn}from"/assets/modules/217595f72a1c3fc5/chunk.js";import{a as Yn}from"/assets/modules/f36b4d3d44491852/chunk.js";import{a as Xn}from"/assets/modules/7ae83a3f06f2daa3/chunk.js";import"/assets/modules/8f0d4e22c18a58b0/chunk.js";import{a as ze}from"/assets/modules/a1715be0f97c2479/chunk.js";import{c as Ce}from"/assets/modules/20483d6e57cfe9d7/chunk.js";import{a as Dn,b as Mn}from"/assets/modules/84358b5b729cbe48/chunk.js";import{b as Qe}from"/assets/modules/3d4451bc069c1498/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared111_e as Gn,shared111_f as Jn}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared49_b as Vn,shared49_d as $n}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared112_c as Hn}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared99_a as X,shared99_b as re}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared65_a as Je}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared113_b as Se}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared88_a as zn,shared88_c as _n}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared107_b as U}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared108_g as Me,shared108_h as Bn,shared108_i as Kn}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared114_k as Ye,shared114_o as Nn}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared116_c as Sn}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared50_k as be,shared50_r as Fe}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared17_f as qe}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared19_a as Fn}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared20_a as xn,shared20_d as vn,shared20_k as Re,shared20_m as bn,shared20_n as xe}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared67_a as Ge}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared51_f as Pe}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared52_a as Cn,shared52_c as He}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared81_a as De}from"/assets/modules/2230c51655163cf3/runtime.js";import{b as jn}from"/assets/modules/a2be1fd01cf06837/chunk.js";import{a as ce}from"/assets/modules/601a2767ae24d1cb/chunk.js";import"/assets/modules/d856bfc56bea5f20/chunk.js";import{c as ge}from"/assets/modules/578703196f82222d/chunk.js";import"/assets/modules/02fad74223254019/chunk.js";import"/assets/modules/0c04f94bbfd39a2f/chunk.js";import{i as Ln}from"/assets/modules/d9019922118b2c37/chunk.js";import"/assets/modules/a41351130003e6bb/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared120_a as Wn}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared135_a as Ae}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared23_b as Y,shared23_c as An}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared24_a as We,shared24_i as On}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared54_a as _,shared54_b as Ze}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared41_c as y}from"/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/c03e0f84f798d33a/chunk.js";import"/assets/modules/3a72b79418f0f80a/chunk.js";import"/assets/modules/be497f1d39753979/chunk.js";import"/assets/modules/a63f0b3d73d97e0b/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{b as Pn}from"/assets/modules/ce90d0b55bbe6430/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared55_a as ie}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared60_a as L}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{a as Un}from"/assets/modules/30169d15cea782f0/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/805b859b1b76ce4d/chunk.js";import"/assets/modules/8ea498cf092dba30/chunk.js";import"/assets/modules/5bb5db89a343817f/chunk.js";import"/assets/modules/17603a34d545c784/chunk.js";import"/assets/modules/e43af4aa407885fd/chunk.js";import"/assets/modules/3bd3c84c4257ba0d/chunk.js";import"/assets/modules/3d10e3f6f6f92b55/chunk.js";import"/assets/modules/5472191457a926d3/chunk.js";import"/assets/modules/684db83476dcba20/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import"/assets/modules/5e7104e569359449/chunk.js";import"/assets/modules/e01769df89873feb/chunk.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared42_B as En}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared47_a as ve}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared48_b as Le}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared61_a as f}from"/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import "/assets/modules/2230c51655163cf3/runtime.js";import{shared13_K as Oe,shared13_N as In,shared13_a as Xe,shared13_ga as Tn,shared13_la as Rn,shared13_zb as fe}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared11_a as Ee}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared5_c as G,shared5_d as $e}from"/assets/modules/2230c51655163cf3/runtime.js";var p=G(Ee(),1);var F=G(Ee());var{Option:qn}=ge;function et(e){return e?.type&&(e.type.isSelectOption||e.type.isSelectOptGroup)}var bt=(e,n)=>{let{prefixCls:l,className:s,style:t,popupClassName:c,dropdownClassName:g,children:I,dataSource:S,rootClassName:B,dropdownStyle:K,dropdownRender:C,popupRender:N,onDropdownVisibleChange:T,onOpenChange:R,styles:J,classNames:D,popupMatchSelectWidth:m,dropdownMatchSelectWidth:w}=e,E=In(I),j=N||C,V=R||T,M=m??w,q;E.length===1&&F.isValidElement(E[0])&&!et(E[0])&&([q]=E);let ee=q?()=>q:void 0,se;E.length&&et(E[0])?se=I:se=S?S.map(u=>{if(F.isValidElement(u))return u;switch(typeof u){case"string":return F.createElement(qn,{key:u,value:u},u);case"object":{let{value:W}=u;return F.createElement(qn,{key:W,value:W},u.text)}default:return}}):[];let{getPrefixCls:ne}=F.useContext(Rn),P=ne("select",l),Q={...e,popupRender:j,onOpenChange:V,popupMatchSelectWidth:M},[x,O]=Tn([D],[J],{props:Q},{popup:{_default:"root"}}),te=F.useMemo(()=>({root:Xe(`${P}-auto-complete`,s,B,x.root,{[`${P}-customize`]:q}),prefix:x.prefix,input:x.input,placeholder:x.placeholder,content:x.content,clear:x.clear,popup:{root:Xe(c,g,x.popup.root),list:x.popup.list,listItem:x.popup.listItem}}),[P,s,B,x,c,g]),i=F.useMemo(()=>({root:{...O.root,...t},input:O.input,prefix:O.prefix,placeholder:O.placeholder,content:O.content,clear:O.clear,popup:{root:{...K,...O.popup.root},list:O.popup.list,listItem:O.popup.listItem}}),[O,t,K]);return F.createElement(ge,{ref:n,suffixIcon:null,...Oe(e,["dataSource","dropdownClassName","popupClassName","onDropdownVisibleChange","onOpenChange"]),prefixCls:P,classNames:te,styles:i,mode:ge.SECRET_COMBOBOX_MODE_DO_NOT_USE,popupRender:j,onOpenChange:V,popupMatchSelectWidth:M,getInputElement:ee},se)},St=F.forwardRef(bt),en=St;var{Option:Ct}=ge,Nt=Pn(en,"popupAlign",e=>Oe(e,["visible"])),nn=en;nn.Option=Ct;nn._InternalPanelDoNotUseOrYouWillBeFired=Nt;var nt=nn;typeof document<"u"&&Le("wand-new-session-layout",__wandCssTextPool[0]);var Z=G(Ee(),1);var It="wand-global",tn="AI \u56E2\u961F\u9700\u8981\u5148\u9009\u62E9\u5DF2\u6709\u9879\u76EE\u3002";function tt(e,n){return!e||n==="global"||e===It?"":e}var Yt=[...Re.map(e=>({value:e.id,label:e.label,description:e.description})),{value:"shell",label:"\u7A7A\u767D\u7EC8\u7AEF",description:"\u4EC5\u542F\u52A8\u7CFB\u7EDF Shell"}];var ot=[{value:"structured",label:"\u5BF9\u8BDD",description:"\u9605\u8BFB\u56DE\u590D\u3001\u67E5\u770B\u5DE5\u5177\u6267\u884C\u8FC7\u7A0B"},{value:"pty",label:"\u7EC8\u7AEF",description:"\u4F7F\u7528\u547D\u4EE4\u884C\u5DE5\u5177\u7684\u4EA4\u4E92\u754C\u9762"}];var d=G(fe(),1),at=[...Re.map(e=>({id:e.id,provider:e.provider,engine:e.engine,label:e.label,description:e.description,structuredOnly:e.engine==="sdk"})),{id:"shell",provider:"shell",label:"\u7A7A\u767D\u7EC8\u7AEF",description:"\u4EC5\u542F\u52A8\u7CFB\u7EDF Shell"}];function on(e,...n){let l=n.join(" ").toLocaleLowerCase();return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean).every(s=>l.includes(s))}function it({selectedSubject:e,kind:n,model:l,disabled:s=!1,teams:t=null,teamWorkspaceId:c="",showModel:g=!0,showKind:I=!0,onSubjectChange:S,onKindChange:B,onModelChange:K}){let{employees:C,loading:N}=Fe(),T=ze(),R=Dn(!0),J=Mn(at,R??{},i=>i.provider),D=c==="",[m,w]=Z.useState(""),E=Z.useRef(null);Z.useEffect(()=>{E.current?.focus({preventScroll:!0})},[]),On(!!m,()=>{w(""),E.current?.focus({preventScroll:!0})});let j=C.filter(i=>!i.archivedAt&&on(m,"\u7845\u57FA\u5458\u5DE5",i.name,i.duty,...i.agents.map(u=>xe(u.provider,u.engine)))),V=t?.filter(i=>on(m,"AI \u56E2\u961F",i.name,i.detail??""))??[],M=J.filter(i=>on(m,"\u6267\u884C\u5DE5\u5177 CLI",i.label,i.description)),q=M.length>0||n!=="pty"&&(j.length>0||V.length>0),[ee,se]=Z.useState("claude"),[ne,P]=Z.useState(null);Z.useEffect(()=>{e.type==="cli"&&e.id!=="shell"&&se(e.id)},[e]);let Q=i=>{s||(B(i),i==="pty"&&(e.type==="employee"||e.type==="team")?(S({type:"cli",id:ee}),P("\u5DF2\u5207\u56DE\u547D\u4EE4\u884C\u5DE5\u5177\uFF1A\u7EC8\u7AEF\u4E0D\u652F\u6301\u5458\u5DE5\u548C\u56E2\u961F\u3002")):i==="pty"&&e.engine==="sdk"?(S({type:"cli",id:e.id}),P("\u5DF2\u5207\u56DE Pi CLI\uFF1AWand Agent \u4EC5\u652F\u6301\u5BF9\u8BDD\u3002")):P(null))},x=n==="pty",O=e.type==="cli"?e.id==="shell"?"shell":bn(e.id,e.engine):"",te=(i,u,W)=>(0,d.jsxs)(f,{align:"center",gap:8,className:"wand-execution-subject-label",children:[i,(0,d.jsxs)(f,{vertical:!0,style:{minWidth:0},children:[(0,d.jsx)(L.Text,{strong:!0,ellipsis:!0,title:u,children:u}),W?(0,d.jsx)(L.Text,{type:"secondary",ellipsis:!0,title:W,children:W}):null]})]});return(0,d.jsx)(En,{children:(0,d.jsxs)(f,{vertical:!0,gap:12,className:"wand-execution-subject-picker",children:[I?(0,d.jsx)(ce.Item,{label:"\u4F1A\u8BDD\u7C7B\u578B",children:(0,d.jsx)(An,{block:!0,"aria-label":"\u4F1A\u8BDD\u7C7B\u578B",value:n,disabled:s,options:ot.map(i=>({value:i.value,label:(0,d.jsx)("span",{title:i.description,children:i.label})})),onChange:i=>Q(i)})}):null,(0,d.jsxs)(ce.Item,{label:"\u6267\u884C\u5BF9\u8C61",children:[(0,d.jsx)(Wn,{value:m,onValueChange:w,disabled:s,inputRef:E,label:"\u641C\u7D22\u6267\u884C\u5BF9\u8C61",placeholder:"\u641C\u7D22\u5458\u5DE5\u3001\u56E2\u961F\u6216\u5DE5\u5177"}),ne?(0,d.jsx)(ie,{type:"warning",showIcon:!0,title:ne}):null,(0,d.jsx)(Ce.Group,{value:`${e.type}:${e.type==="cli"?O:e.id}`,disabled:s,"aria-label":"\u6267\u884C\u5BF9\u8C61",style:{width:"100%"},onChange:i=>{let u=String(i.target.value),W=u.indexOf(":"),me=u.slice(0,W),ue=u.slice(W+1);if(P(null),me==="cli"){let oe=at.find(Be=>Be.id===ue);if(oe){oe.structuredOnly&&n!=="structured"?(B("structured"),P(oe.id==="wand-agent"?"Wand Agent \u4F7F\u7528\u5BF9\u8BDD\u754C\u9762\u3002":null)):P(null),S({type:"cli",id:oe.provider,...oe.engine?{engine:oe.engine}:{}});return}}S({type:me,id:ue})},children:(0,d.jsxs)(f,{vertical:!0,gap:12,children:[!x&&(!m.trim()||j.length>0)?(0,d.jsxs)(f,{vertical:!0,gap:8,role:"group","aria-label":"\u7845\u57FA\u5458\u5DE5",children:[(0,d.jsx)(L.Text,{strong:!0,children:"\u7845\u57FA\u5458\u5DE5"}),N?(0,d.jsx)(ve,{size:"small"}):null,(0,d.jsx)("div",{className:"wand-execution-subject-grid",children:j.map(i=>(0,d.jsx)(Ce,{value:`employee:${i.id}`,children:te((0,d.jsx)(be,{employee:i,size:"md"}),i.name,i.duty||(i.agents[0]?`\u9996\u9009\uFF1A${xe(i.agents[0].provider,i.agents[0].engine)}`:"\u667A\u80FD\u52A9\u624B"))},i.id))}),!N&&C.every(i=>!!i.archivedAt)?(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{children:"\u8FD8\u6CA1\u6709\u7845\u57FA\u5458\u5DE5"}),(0,d.jsx)(_,{kind:"ghost",onClick:()=>Se.open("","","teams"),children:"\u62DB\u8058\u5458\u5DE5"})]}):null]}):null,!x&&V.length>0?(0,d.jsxs)(f,{vertical:!0,gap:8,role:"group","aria-label":"AI \u56E2\u961F",children:[(0,d.jsx)(L.Text,{strong:!0,children:"AI \u56E2\u961F"}),(0,d.jsx)("div",{className:"wand-execution-subject-grid",children:V.map(i=>(0,d.jsx)(Ce,{value:`team:${i.id}`,disabled:s||D,title:D?tn:void 0,children:te((0,d.jsx)(y,{name:"parallel",size:18}),i.name,i.detail)},i.id))}),D?(0,d.jsx)("p",{role:"status",children:tn}):null]}):null,M.length>0?(0,d.jsxs)(f,{vertical:!0,gap:8,role:"group","aria-label":"CLI \u5DE5\u5177",children:[(0,d.jsx)(L.Text,{strong:!0,children:"\u6267\u884C\u5DE5\u5177"}),(0,d.jsx)("div",{className:"wand-execution-subject-grid",children:M.map(i=>{let u=i.structuredOnly&&x;return(0,d.jsx)(Ce,{value:`cli:${i.id}`,disabled:s||u,title:u?"Wand Agent \u4EC5\u652F\u6301\u5BF9\u8BDD":void 0,children:te(i.id==="shell"?(0,d.jsx)(y,{name:"terminal",size:18}):i.engine==="sdk"?(0,d.jsx)(y,{name:"spark",size:18}):(0,d.jsx)(Fn,{provider:i.provider,className:"wand-subject-provider"}),i.label,i.description)},i.id)})})]}):null,q?null:(0,d.jsx)(L.Text,{type:"secondary",role:"status",children:"\u6CA1\u6709\u5339\u914D\u7684\u6267\u884C\u5BF9\u8C61\uFF0C\u8BF7\u66F4\u6362\u5173\u952E\u8BCD\u6216\u6E05\u7A7A\u641C\u7D22\u3002"})]})}),x?(0,d.jsx)(L.Paragraph,{type:"secondary",children:"\u7EC8\u7AEF\u76F4\u63A5\u4F7F\u7528\u547D\u4EE4\u884C\u5DE5\u5177\u3002\u8981\u4F7F\u7528\u5458\u5DE5\u3001\u56E2\u961F\u6216 Wand Agent\uFF0C\u8BF7\u9009\u62E9\u201C\u5BF9\u8BDD\u201D\u3002"}):null]}),g&&e.type==="cli"&&e.id!=="shell"?(0,d.jsx)(ce.Item,{label:"\u6A21\u578B",extra:"\u6240\u9009\u6A21\u578B\u968F\u4F1A\u8BDD\u542F\u52A8\u4E00\u8D77\u63D0\u4EA4\uFF1B\u300C\u8DDF\u968F\u670D\u52A1\u7AEF\u9ED8\u8BA4\u300D\u6CBF\u7528\u670D\u52A1\u7AEF\u914D\u7F6E\u7684\u9ED8\u8BA4\u6A21\u578B\u3002",children:(0,d.jsx)(Ae,{value:l||Ye,options:Nn(T,e.id),ariaLabel:"\u6A21\u578B",searchable:!0,searchPlaceholder:"\u641C\u7D22\u6A21\u578B",disabled:s,className:"wand-workspace-agent-model-select",onValueChange:K})}):null]})})}var an=(e,n)=>globalThis.fetch(e,n),Tt=["structured","pty"],Rt=["default","full-access","auto-edit","native","managed"];function rn(e,n,l){return typeof e=="string"&&n.includes(e)?e:l}function rt(e){return{defaultProvider:rn(e.defaultProvider,xn,"claude"),defaultSessionKind:rn(e.defaultSessionKind,Tt,"structured"),defaultMode:rn(e.defaultMode,Rt,"default"),defaultCwd:He(e.defaultCwd),defaultEngine:e.defaultEngine==="sdk"?"sdk":"cli"}}function st(e){return Array.isArray(e)?e.flatMap(n=>!Cn(n)||typeof n.path!="string"||!n.path.trim()?[]:[{path:n.path,name:He(n.name,n.path.split("/").filter(Boolean).at(-1)??n.path)}]):[]}function Et(e){return e==="codex"?["full-access"]:e==="opencode"||e==="grok"||e==="pi"?["default","full-access","managed"]:e==="qoder"?["default","full-access","auto-edit","managed"]:["default","full-access","auto-edit","native","managed"]}function _e(e,n,l="default"){let s=Et(e);return s.includes(n)?n:s.includes(l)?l:s[0]}function Pt(e){return e==="codex"?"codex-cli-exec":e==="opencode"?"opencode-cli-run":e==="grok"?"grok-cli-headless":e==="qoder"?"qoder-cli-print":e==="pi"?"pi-cli-json":"claude-cli-print"}function lt(e,n,l,s={}){let t=e.cwd.trim()||l.effectiveCwd.trim()||n.defaultCwd,c={cols:Number.isFinite(s.cols)&&(s.cols??0)>0?s.cols:void 0,rows:Number.isFinite(s.rows)&&(s.rows??0)>0?s.rows:void 0},g={cwd:t,worktreeEnabled:e.worktreeEnabled===!0,sessionSource:"interactive",...e.workspaceId?{workspaceId:e.workspaceId}:{},...e.workspaceTaskId?{workspaceTaskId:e.workspaceTaskId}:{}};if(e.kind==="shell")return{...g,...c,kind:"shell",shell:!0,mode:"default"};let I=_e(e.provider,e.mode,n.defaultMode),S={...g,provider:e.provider,mode:I},B=(e.model??"").trim()||(l.selectedModels?.[e.provider]??"").trim();if(e.kind==="pty")return{...S,...c,kind:"pty",command:vn(e.provider),model:B||void 0,...l.thinkingEffort?.trim()?{thinkingEffort:l.thinkingEffort.trim()}:{}};let K=l.thinkingEffort?.trim(),C=!!(e.employeeId&&e.specifiedCli),N=e.provider==="pi"&&e.engine==="sdk"?{engine:"sdk"}:{};return{...S,...N,kind:"structured",runner:Pt(e.provider),model:e.employeeId&&!e.specifiedCli?void 0:B||void 0,thinkingEffort:K||void 0,...e.employeeId?{employeeId:e.employeeId,overrideCli:C}:{}}}var sn=class{constructor(n=an){$e(this,"fetchImpl",n);$e(this,"preferenceWrite",Promise.resolve())}async loadConfig(n={}){if(await this.preferenceWrite.catch(()=>{}),this.fetchImpl===an){let s=await Vn();return n.signal?.throwIfAborted(),rt(s)}let l=await this.fetchImpl("/api/config",{credentials:"same-origin",signal:n.signal});return rt(await Pe(l))}async load(n={}){let l=await this.loadConfig(n),s=await this.fetchImpl("/api/recent-paths",{credentials:"same-origin",signal:n.signal}).then(async t=>t.ok?st(await t.json()):[]).catch(t=>{if(n.signal?.aborted)throw t;return[]});return{config:l,recentPaths:s}}savePreferences(n){if(Object.keys(n).length===0)return this.preferenceWrite;let l=this.preferenceWrite.catch(()=>{}).then(async()=>{let s=await this.fetchImpl("/api/settings/config",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(n)});await Pe(s),this.fetchImpl===an&&$n()});return this.preferenceWrite=l,l}async suggestPaths(n,l={}){let s=await this.fetchImpl(`/api/path-suggestions?q=${encodeURIComponent(n.trim())}`,{credentials:"same-origin",signal:l.signal});return s.ok?st(await s.json()):[]}async create(n){let l=n.kind==="structured",s="/api/sessions",t=l?{kind:"structured",cwd:n.cwd,mode:n.mode,provider:n.provider,runner:n.runner,engine:n.engine,worktreeEnabled:n.worktreeEnabled,model:n.model,thinkingEffort:n.thinkingEffort,employeeId:n.employeeId,overrideCli:n.overrideCli,...n.workspaceId?{workspaceId:n.workspaceId}:{},...n.workspaceTaskId?{workspaceTaskId:n.workspaceTaskId}:{},sessionSource:n.sessionSource}:{kind:"pty",command:n.kind==="pty"?n.command:void 0,provider:n.kind==="pty"?n.provider:void 0,shell:n.kind==="shell"||void 0,cwd:n.cwd,mode:n.mode,worktreeEnabled:n.worktreeEnabled,model:n.kind==="pty"?n.model:void 0,thinkingEffort:n.kind==="pty"?n.thinkingEffort:void 0,cols:n.cols,rows:n.rows,...n.workspaceId?{workspaceId:n.workspaceId}:{},...n.workspaceTaskId?{workspaceTaskId:n.workspaceTaskId}:{},sessionSource:n.sessionSource},c=await this.fetchImpl(s,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)}),g=await Pe(c);if(typeof g.id!="string"||!g.id)throw new Error("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u65B0\u4F1A\u8BDD ID\u3002");return g}},dt=new sn;async function pt(e,n,l){if(e.workspaceTaskId||e.taskName===void 0)return e;let s=e.taskName.trim();if(!s)throw new Error("\u8BF7\u8F93\u5165\u4EFB\u52A1\u540D\u79F0\u3002");let t={name:s,cwd:n,worktree:!1},c=e.workspaceId?await l.createTask(e.workspaceId,t):await l.createStandaloneTask(t);if(!c.id)throw new Error("\u670D\u52A1\u7AEF\u672A\u8FD4\u56DE\u65B0\u4EFB\u52A1 ID\uFF0C\u8BF7\u5237\u65B0\u4EFB\u52A1\u5217\u8868\u6838\u5BF9\u540E\u518D\u521B\u5EFA\u4F1A\u8BDD\u3002");return{...e,taskName:s,workspaceId:c.workspaceId,workspaceTaskId:c.id,cwd:c.cwd}}var ct=G(Ee(),1);var b=G(fe(),1);function ln({form:e,initialName:n,disabled:l,cwd:s,onChange:t,inline:c}){let{groups:g,loading:I,error:S,reload:B}=Hn(),[K,C]=ct.useState(!1),N=g.flatMap(m=>m.tasks.filter(w=>!w.archived).map(w=>({task:w,group:m}))),T=N.find(({task:m})=>m.id===e.workspaceTaskId),R=e.workspaceTaskId?T?.task.name||e.taskName||n||"\u6240\u9009\u4EFB\u52A1":e.taskName!==void 0?e.taskName||"\u65B0\u5EFA\u4EFB\u52A1\u2026":"\u9ED8\u8BA4\u4EFB\u52A1",J=(0,b.jsx)(Ae,{ariaLabel:"\u6240\u5C5E\u4EFB\u52A1",className:"wand-new-session-model-select",disabled:l,searchable:!0,searchPlaceholder:"\u641C\u7D22\u4EFB\u52A1",value:e.workspaceTaskId||(e.taskName!==void 0?"new":""),options:[{value:"",label:"\u9ED8\u8BA4\u4EFB\u52A1"},{value:"new",label:"\u65B0\u5EFA\u4EFB\u52A1\u2026"},...e.workspaceTaskId&&!T?[{value:e.workspaceTaskId,label:e.taskName||n||"\u5F53\u524D\u4EFB\u52A1"}]:[],...N.map(({task:m,group:w})=>({value:m.id,label:m.name,group:w.workspaceName}))],onValueChange:m=>{let w=N.find(({task:E})=>E.id===m);w?(t({...e,workspaceTaskId:w.task.id,workspaceId:w.task.workspaceId,taskName:void 0,cwd:w.task.worktree?.path||w.task.cwd||w.group.workspaceCwd}),c&&C(!1)):(m===""||m==="new")&&(t({...e,workspaceTaskId:void 0,workspaceId:T&&!T.group.synthetic&&!T.group.global?T.group.workspaceId:e.workspaceId,cwd:e.workspaceTaskId?e.cwd:T?.group.workspaceCwd||s,taskName:m==="new"?e.taskName??"":void 0}),m===""&&c&&C(!1))}}),D=(0,b.jsxs)(f,{vertical:!0,gap:8,style:c?{minWidth:260,padding:4}:void 0,children:[(0,b.jsx)(ce.Item,{label:"\u6240\u5C5E\u4EFB\u52A1",style:{marginBottom:0},children:J}),e.taskName!==void 0&&!e.workspaceTaskId?(0,b.jsx)(ce.Item,{label:"\u4EFB\u52A1\u540D\u79F0",htmlFor:"wand-new-session-task-name",required:!0,style:{marginBottom:0},extra:"\u5148\u521B\u5EFA\u4EFB\u52A1\uFF0C\u518D\u5728\u4EFB\u52A1\u4E2D\u542F\u52A8\u4F1A\u8BDD\u3002",children:(0,b.jsx)(We,{id:"wand-new-session-task-name",autoFocus:c,value:e.taskName,disabled:l,maxLength:200,placeholder:"\u8F93\u5165\u4EFB\u52A1\u540D\u79F0",onChange:m=>t({...e,taskName:m.currentTarget.value}),onKeyDown:m=>{m.key==="Enter"&&!m.nativeEvent.isComposing&&(m.preventDefault(),c&&C(!1))}})}):null,I?(0,b.jsx)("span",{role:"status",children:"\u6B63\u5728\u52A0\u8F7D\u5DF2\u6709\u4EFB\u52A1\u2026"}):null,S?(0,b.jsx)(ie,{type:"warning",title:S,action:(0,b.jsx)(_,{size:"small",onClick:()=>{B()},children:"\u91CD\u8BD5"})}):null,c&&e.taskName!==void 0?(0,b.jsx)(_,{onClick:()=>C(!1),children:"\u5B8C\u6210"}):null]});return c?(0,b.jsx)(Y,{ariaLabel:"\u9009\u62E9\u6240\u5C5E\u4EFB\u52A1",side:"bottom",open:K,onOpenChange:C,trigger:(0,b.jsxs)("button",{type:"button",disabled:l,className:"new-work-inline-trigger new-work-inline-task",title:`\u6240\u5C5E\u4EFB\u52A1\uFF1A${R}\uFF0C\u70B9\u51FB\u66F4\u6362`,"aria-label":"\u6240\u5C5E\u4EFB\u52A1",children:[(0,b.jsx)(y,{name:"clipboard",size:14,className:"new-work-inline-task-icon"}),(0,b.jsx)("span",{className:"new-work-inline-task-name",children:R}),(0,b.jsx)(y,{name:"chevronDown",size:12,className:"new-work-inline-arrow"})]}),children:D}):D}function mt(){Le("wand-new-work",`
4
4
  .new-work-page { position:absolute; inset:0; z-index:8; display:flex; flex-direction:column; min-width:0; min-height:0; overflow:auto; background:var(--bg-primary); }
5
5
  .new-work-heading { min-height:44px; padding:0 var(--wand-page-inset); flex-shrink:0; }
6
6
  .new-work-page-label { font-size:12px; color:var(--text-secondary); }
@@ -1 +1 @@
1
- import{shared54_a as d}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared13_zb as i}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared11_a as m}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared5_c as s}from"/assets/modules/4af10e1f8a789204/runtime.js";var t=s(m(),1);var u=s(i(),1);function E(o,c){let[r,l]=t.useState(!1),a=t.useRef(o);return a.current=o,t.useEffect(()=>{l(!1)},[o]),{expanded:r,control:(0,u.jsx)(d,{size:"small",kind:"ghost",className:"composer-expand-editor","aria-expanded":r,onClick:()=>{let f=o,e=c(),n=e&&{start:e.selectionStart,end:e.selectionEnd,direction:e.selectionDirection,scroll:e.scrollTop};l(p=>!p),requestAnimationFrame(()=>{!e||f!==a.current||e!==c()||!e.isConnected||(e.focus({preventScroll:!0}),n&&(e.setSelectionRange(n.start,n.end,n.direction),e.scrollTop=n.scroll))})},children:r?"\u6536\u8D77\u7F16\u8F91":"\u5C55\u5F00\u7F16\u8F91"})}}export{E as a};
1
+ import{shared54_a as d}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared13_zb as i}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared11_a as m}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared5_c as s}from"/assets/modules/2230c51655163cf3/runtime.js";var t=s(m(),1);var u=s(i(),1);function E(o,c){let[r,l]=t.useState(!1),a=t.useRef(o);return a.current=o,t.useEffect(()=>{l(!1)},[o]),{expanded:r,control:(0,u.jsx)(d,{size:"small",kind:"ghost",className:"composer-expand-editor","aria-expanded":r,onClick:()=>{let f=o,e=c(),n=e&&{start:e.selectionStart,end:e.selectionEnd,direction:e.selectionDirection,scroll:e.scrollTop};l(p=>!p),requestAnimationFrame(()=>{!e||f!==a.current||e!==c()||!e.isConnected||(e.focus({preventScroll:!0}),n&&(e.setSelectionRange(n.start,n.end,n.direction),e.scrollTop=n.scroll))})},children:r?"\u6536\u8D77\u7F16\u8F91":"\u5C55\u5F00\u7F16\u8F91"})}}export{E as a};
@@ -1,3 +1,3 @@
1
1
 
2
2
  const __wandCssTextPool = Object.freeze([".wand-settings-library-grid,.wand-settings-library-default-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:16px}.wand-settings-library-field{margin-bottom:0;min-width:0}.wand-settings-library-number,.wand-settings-library-select,.wand-settings-library-select>button{width:100%}.wand-settings-library-save-bar{display:flex;flex-direction:column;align-items:flex-start;gap:12px}.wand-settings-library-action-label{display:grid}.wand-settings-library-action-label>span{grid-area:1/1}.wand-settings-library-action-measure{visibility:hidden}\n"]);
3
- import{a as A}from"/assets/modules/84b79a33c64e146c/chunk.js";import{a as y}from"/assets/modules/4b9deeeb77570db3/chunk.js";import{h as F}from"/assets/modules/36ce8123a2079807/chunk.js";import{shared135_a as T}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared25_a as k}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared54_a as N}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared55_a as C}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared42_h as v,shared42_i as S}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared48_b as L}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared13_zb as R}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared11_a as B}from"/assets/modules/4af10e1f8a789204/runtime.js";import{shared5_c as h}from"/assets/modules/4af10e1f8a789204/runtime.js";var l=h(B(),1);var e=h(R(),1);typeof document<"u"&&L("wand-settings-field-styles",__wandCssTextPool[0]);function q({title:t,description:n,action:i,children:a}){return(0,e.jsxs)("section",{className:"wand-settings-library-section","aria-label":t,children:[(0,e.jsxs)("div",{className:"wand-settings-library-section-heading",children:[(0,e.jsx)("h3",{children:t}),i]}),n?(0,e.jsx)("p",{children:n}):null,(0,e.jsx)(y,{component:!1,layout:"vertical",children:(0,e.jsx)("div",{className:"wand-settings-library-section-body",children:a})})]})}function z({children:t}){return(0,e.jsx)("div",{className:"wand-settings-library-grid",children:t})}function J({label:t,hint:n,error:i,htmlFor:a,children:s}){return(0,e.jsx)(y.Item,{label:t,htmlFor:a,layout:"vertical",validateStatus:i?"error":void 0,help:i||n,className:"wand-settings-library-field",children:s})}function K({id:t,value:n,onChange:i,type:a="text",placeholder:s,disabled:r,invalid:o,autoComplete:g,min:m,max:b,list:p}){let[c,u]=(0,l.useState)(!1);return a==="number"?(0,e.jsx)(A,{id:t,value:n===""?null:String(n),stringMode:!0,className:"wand-settings-library-number",min:m===void 0?void 0:String(m),max:b===void 0?void 0:String(b),disabled:r,placeholder:s,status:o?"error":void 0,"aria-invalid":o||void 0,autoComplete:g,onChange:d=>i(d===null?"":String(d))}):(0,e.jsx)(k,{id:t,type:a==="password"&&c?"text":a,value:n,placeholder:s,disabled:r,status:o?"error":void 0,"aria-invalid":o||void 0,autoComplete:g,list:p,spellCheck:!1,suffix:a==="password"?(0,e.jsx)(N,{type:"button",kind:"ghost",className:"wand-settings-library-secret-toggle",disabled:r,"aria-controls":t,"aria-pressed":c,"aria-label":c?"\u9690\u85CF\u654F\u611F\u5185\u5BB9":"\u663E\u793A\u654F\u611F\u5185\u5BB9",onClick:()=>u(d=>!d),children:c?"\u9690\u85CF":"\u663E\u793A"}):void 0,onChange:d=>i(d.currentTarget.value)})}function Q({id:t,ariaLabel:n,value:i,options:a,onChange:s,disabled:r,searchable:o,searchPlaceholder:g}){return(0,e.jsx)("div",{id:t,className:"wand-settings-library-select",children:(0,e.jsx)(T,{ariaLabel:n,value:i,options:a,disabled:r,searchable:o,searchPlaceholder:g,onValueChange:s})})}function U({label:t,description:n,checked:i,onCheckedChange:a,disabled:s}){return(0,e.jsxs)("div",{className:"wand-settings-library-toggle-row",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("strong",{children:t}),n?(0,e.jsx)("span",{children:n}):null]}),(0,e.jsx)(F,{ariaLabel:t,checked:i,disabled:s,onCheckedChange:a})]})}function I({children:t,tone:n="info"}){return t?(0,e.jsx)(C,{type:n,title:t,role:"status","aria-live":"polite",showIcon:!0}):null}function E(t,n){let[i,a]=(0,l.useState)(null),s=(0,l.useRef)(!1),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>()=>{r.current!==null&&window.clearTimeout(r.current)},[]),(0,l.useEffect)(()=>{if(t){s.current=!0,a(null),r.current!==null&&(window.clearTimeout(r.current),r.current=null);return}!s.current||n!=="success"&&n!=="error"||(s.current=!1,a(n),r.current!==null&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>{r.current=null,a(null)},n==="error"?S:v))},[t,n]),i}function X({label:t,pending:n=!1,disabled:i,onSave:a,status:s,tone:r}){return(0,e.jsxs)("div",{className:"wand-settings-library-save-bar",children:[(0,e.jsx)(M,{kind:"primary",pending:n,settled:r==="error"?"error":r==="success"||r==="warning"?"success":null,disabled:i,pendingLabel:"\u4FDD\u5B58\u4E2D\u2026",successLabel:"\u5DF2\u4FDD\u5B58",errorLabel:"\u4FDD\u5B58\u5931\u8D25",onClick:a,children:t}),(0,e.jsx)(I,{tone:r,children:s})]})}function M({children:t,pending:n=!1,settled:i=null,pendingLabel:a="\u5904\u7406\u4E2D\u2026",successLabel:s="\u5DF2\u5B8C\u6210",errorLabel:r="\u5931\u8D25",onClick:o,disabled:g,...m}){let b=E(n,i),[p,c]=(0,l.useState)(null),u=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]);let d=p??b,w=f=>{u.current!==null&&window.clearTimeout(u.current),c(f),u.current=window.setTimeout(()=>{u.current=null,c(null)},f==="error"?S:v)};return(0,e.jsx)(N,{...m,className:["wand-settings-library-action",m.className].filter(Boolean).join(" "),"aria-busy":n||void 0,"aria-live":"polite",disabled:g||n||d==="success",onClick:o?async f=>{try{let x=await o(f);x===!1?w("error"):x===!0&&w("success")}catch{w("error")}}:void 0,children:(0,e.jsxs)("span",{className:"wand-settings-library-action-label",children:[(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:t}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:a}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:s}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:r}),(0,e.jsx)("span",{children:n?a:d==="success"?s:d==="error"?r:t})]})})}export{q as a,z as b,J as c,K as d,Q as e,U as f,I as g,X as h,M as i};
3
+ import{a as A}from"/assets/modules/7f32261c1627c3cd/chunk.js";import{a as y}from"/assets/modules/601a2767ae24d1cb/chunk.js";import{h as F}from"/assets/modules/d9019922118b2c37/chunk.js";import{shared135_a as T}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared25_a as k}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared54_a as N}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared55_a as C}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared42_h as v,shared42_i as S}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared48_b as L}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared13_zb as R}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared11_a as B}from"/assets/modules/2230c51655163cf3/runtime.js";import{shared5_c as h}from"/assets/modules/2230c51655163cf3/runtime.js";var l=h(B(),1);var e=h(R(),1);typeof document<"u"&&L("wand-settings-field-styles",__wandCssTextPool[0]);function q({title:t,description:n,action:i,children:a}){return(0,e.jsxs)("section",{className:"wand-settings-library-section","aria-label":t,children:[(0,e.jsxs)("div",{className:"wand-settings-library-section-heading",children:[(0,e.jsx)("h3",{children:t}),i]}),n?(0,e.jsx)("p",{children:n}):null,(0,e.jsx)(y,{component:!1,layout:"vertical",children:(0,e.jsx)("div",{className:"wand-settings-library-section-body",children:a})})]})}function z({children:t}){return(0,e.jsx)("div",{className:"wand-settings-library-grid",children:t})}function J({label:t,hint:n,error:i,htmlFor:a,children:s}){return(0,e.jsx)(y.Item,{label:t,htmlFor:a,layout:"vertical",validateStatus:i?"error":void 0,help:i||n,className:"wand-settings-library-field",children:s})}function K({id:t,value:n,onChange:i,type:a="text",placeholder:s,disabled:r,invalid:o,autoComplete:g,min:m,max:b,list:p}){let[c,u]=(0,l.useState)(!1);return a==="number"?(0,e.jsx)(A,{id:t,value:n===""?null:String(n),stringMode:!0,className:"wand-settings-library-number",min:m===void 0?void 0:String(m),max:b===void 0?void 0:String(b),disabled:r,placeholder:s,status:o?"error":void 0,"aria-invalid":o||void 0,autoComplete:g,onChange:d=>i(d===null?"":String(d))}):(0,e.jsx)(k,{id:t,type:a==="password"&&c?"text":a,value:n,placeholder:s,disabled:r,status:o?"error":void 0,"aria-invalid":o||void 0,autoComplete:g,list:p,spellCheck:!1,suffix:a==="password"?(0,e.jsx)(N,{type:"button",kind:"ghost",className:"wand-settings-library-secret-toggle",disabled:r,"aria-controls":t,"aria-pressed":c,"aria-label":c?"\u9690\u85CF\u654F\u611F\u5185\u5BB9":"\u663E\u793A\u654F\u611F\u5185\u5BB9",onClick:()=>u(d=>!d),children:c?"\u9690\u85CF":"\u663E\u793A"}):void 0,onChange:d=>i(d.currentTarget.value)})}function Q({id:t,ariaLabel:n,value:i,options:a,onChange:s,disabled:r,searchable:o,searchPlaceholder:g}){return(0,e.jsx)("div",{id:t,className:"wand-settings-library-select",children:(0,e.jsx)(T,{ariaLabel:n,value:i,options:a,disabled:r,searchable:o,searchPlaceholder:g,onValueChange:s})})}function U({label:t,description:n,checked:i,onCheckedChange:a,disabled:s}){return(0,e.jsxs)("div",{className:"wand-settings-library-toggle-row",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("strong",{children:t}),n?(0,e.jsx)("span",{children:n}):null]}),(0,e.jsx)(F,{ariaLabel:t,checked:i,disabled:s,onCheckedChange:a})]})}function I({children:t,tone:n="info"}){return t?(0,e.jsx)(C,{type:n,title:t,role:"status","aria-live":"polite",showIcon:!0}):null}function E(t,n){let[i,a]=(0,l.useState)(null),s=(0,l.useRef)(!1),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>()=>{r.current!==null&&window.clearTimeout(r.current)},[]),(0,l.useEffect)(()=>{if(t){s.current=!0,a(null),r.current!==null&&(window.clearTimeout(r.current),r.current=null);return}!s.current||n!=="success"&&n!=="error"||(s.current=!1,a(n),r.current!==null&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>{r.current=null,a(null)},n==="error"?S:v))},[t,n]),i}function X({label:t,pending:n=!1,disabled:i,onSave:a,status:s,tone:r}){return(0,e.jsxs)("div",{className:"wand-settings-library-save-bar",children:[(0,e.jsx)(M,{kind:"primary",pending:n,settled:r==="error"?"error":r==="success"||r==="warning"?"success":null,disabled:i,pendingLabel:"\u4FDD\u5B58\u4E2D\u2026",successLabel:"\u5DF2\u4FDD\u5B58",errorLabel:"\u4FDD\u5B58\u5931\u8D25",onClick:a,children:t}),(0,e.jsx)(I,{tone:r,children:s})]})}function M({children:t,pending:n=!1,settled:i=null,pendingLabel:a="\u5904\u7406\u4E2D\u2026",successLabel:s="\u5DF2\u5B8C\u6210",errorLabel:r="\u5931\u8D25",onClick:o,disabled:g,...m}){let b=E(n,i),[p,c]=(0,l.useState)(null),u=(0,l.useRef)(null);(0,l.useEffect)(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]);let d=p??b,w=f=>{u.current!==null&&window.clearTimeout(u.current),c(f),u.current=window.setTimeout(()=>{u.current=null,c(null)},f==="error"?S:v)};return(0,e.jsx)(N,{...m,className:["wand-settings-library-action",m.className].filter(Boolean).join(" "),"aria-busy":n||void 0,"aria-live":"polite",disabled:g||n||d==="success",onClick:o?async f=>{try{let x=await o(f);x===!1?w("error"):x===!0&&w("success")}catch{w("error")}}:void 0,children:(0,e.jsxs)("span",{className:"wand-settings-library-action-label",children:[(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:t}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:a}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:s}),(0,e.jsx)("span",{"aria-hidden":"true",className:"wand-settings-library-action-measure",children:r}),(0,e.jsx)("span",{children:n?a:d==="success"?s:d==="error"?r:t})]})})}export{q as a,z as b,J as c,K as d,Q as e,U as f,I as g,X as h,M as i};