@acedatacloud/nexior 3.329.47 → 3.329.49

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 (231) hide show
  1. package/dist/assets/{ApiCodeButton-DXiZffUI.js → ApiCodeButton-C1q6DpUc.js} +1 -1
  2. package/dist/assets/{Artifacts-Cr7EhKP5.js → Artifacts-DSkrN6kI.js} +1 -1
  3. package/dist/assets/{AskUserQuestionCard-N8gAyjLm.js → AskUserQuestionCard-BNbSlFEK.js} +1 -1
  4. package/dist/assets/{AudioPreview-CML8SkN1.js → AudioPreview-CpN_2vyQ.js} +1 -1
  5. package/dist/assets/{Auth-B0L8OvzY.js → Auth-CO9spnLV.js} +1 -1
  6. package/dist/assets/{Bare-BMh2Lddv.js → Bare-BfwNlM4m.js} +1 -1
  7. package/dist/assets/{BotPlaceholder-vAnmSqdw.js → BotPlaceholder-BU4rzneO.js} +1 -1
  8. package/dist/assets/{BottomFooter-ChksTxbS.js → BottomFooter-CKzOaCbY.js} +1 -1
  9. package/dist/assets/{Callback-CY4oayCx.js → Callback-BsA_M9Wj.js} +1 -1
  10. package/dist/assets/{CodeSnippet-DnplS-Fe.js → CodeSnippet-CtXMPNA9.js} +1 -1
  11. package/dist/assets/{Console-BiSlT_Xh.js → Console-DpOsWoTC.js} +1 -1
  12. package/dist/assets/{Consumption-D5IaOx8Q.js → Consumption-DfYXtMEK.js} +1 -1
  13. package/dist/assets/{Conversation-D_RMWAHG.js → Conversation-CVbWnSw_.js} +1 -1
  14. package/dist/assets/{Conversation-CjXRyJPK.js → Conversation-CXp1mP3q.js} +1 -1
  15. package/dist/assets/{CopyToClipboard-CUgv3RMH.js → CopyToClipboard-C7E8BXWT.js} +1 -1
  16. package/dist/assets/{Detail-DZOIdJUJ.js → Detail-DhUHqqQj.js} +2 -2
  17. package/dist/assets/{Extra-DeqcB4NU.js → Extra-CUDD56dI.js} +1 -1
  18. package/dist/assets/{FilePreview-CeMbCBB3.js → FilePreview-9FStloBk.js} +1 -1
  19. package/dist/assets/{Hailuo-Cdxuvcyj.js → Hailuo-DzbWam_H.js} +1 -1
  20. package/dist/assets/{History-BKJbtcls.js → History-vvO0LxOa.js} +1 -1
  21. package/dist/assets/{ImagePreview-LOhAiiTN.js → ImagePreview-BBHtU8GY.js} +1 -1
  22. package/dist/assets/{ImageWrapper-CZLe7I8w.js → ImageWrapper-DsAff5Ns.js} +1 -1
  23. package/dist/assets/{Index-BpuWfsi-.js → Index-B-6dkN9u.js} +1 -1
  24. package/dist/assets/{Index-Cq_yYYuA.js → Index-B-OtD2EQ.js} +1 -1
  25. package/dist/assets/{Index-D0K19zXX.js → Index-BYEK7oLy.js} +1 -1
  26. package/dist/assets/{Index-CQgVEb7R.js → Index-BeTjVwO2.js} +1 -1
  27. package/dist/assets/{Index-4rmxL6_G.js → Index-BqcmU7xf.js} +1 -1
  28. package/dist/assets/{Index-wGswIler.js → Index-BslkUcqq.js} +1 -1
  29. package/dist/assets/{Index-CEi7NjBF.js → Index-Bt9eoTX1.js} +1 -1
  30. package/dist/assets/{Index-8c4LeySS.js → Index-BzOenE3Y.js} +1 -1
  31. package/dist/assets/{Index-DOMj90an.js → Index-CDBBxz9e.js} +1 -1
  32. package/dist/assets/Index-CR73Oos0.js +1 -0
  33. package/dist/assets/{Index-U-3Ms21M.js → Index-CVKVzkJM.js} +1 -1
  34. package/dist/assets/{Index-mRIwEpvN.js → Index-Cfopx8tu.js} +1 -1
  35. package/dist/assets/{Index-1NshYOPQ.js → Index-CgOk7jXk.js} +1 -1
  36. package/dist/assets/{Index-CCmJnUNM.js → Index-Cs-k79pH.js} +1 -1
  37. package/dist/assets/{Index-DL-lm09l.css → Index-DD1ANV9-.css} +1 -1
  38. package/dist/assets/{Index-CvF6R9ss.js → Index-DMtWBrVh.js} +1 -1
  39. package/dist/assets/{Index-C4eqk9iO.js → Index-DUVL8e3y.js} +1 -1
  40. package/dist/assets/{Index-Hr9zUPQx.js → Index-Dpc4MuO1.js} +1 -1
  41. package/dist/assets/{Index-DiJLZN7T.js → Index-DrGKng9p.js} +1 -1
  42. package/dist/assets/{Index-YDgVZz99.js → Index-EiK87mwD.js} +1 -1
  43. package/dist/assets/{Index-BEhqoYBQ.js → Index-FpQ_vxK0.js} +1 -1
  44. package/dist/assets/{Index-CJlxrp-s.js → Index-N16h62qZ.js} +1 -1
  45. package/dist/assets/{Index-h5ergfyd.js → Index-O-qclrVy.js} +1 -1
  46. package/dist/assets/{Index-DE1aTD68.js → Index-Oyu-ui3n.js} +1 -1
  47. package/dist/assets/{Index-C4DkJshe.js → Index-VDIFy2JJ.js} +1 -1
  48. package/dist/assets/{Index-DsSJB2bN.css → Index-Y-iZg6hM.css} +1 -1
  49. package/dist/assets/{Index-B_pXzA0j.js → Index-ZD6SKMH1.js} +1 -1
  50. package/dist/assets/{Index-DSm_6zUU.js → Index-dU-Qb50E.js} +1 -1
  51. package/dist/assets/{Index-BhtnCSNW.js → Index-gRK9r0N7.js} +1 -1
  52. package/dist/assets/{Index-DGLjc0zP.js → Index-sqK5kNVi.js} +1 -1
  53. package/dist/assets/{Index-kz8g--hT.js → Index-wvOVditV.js} +1 -1
  54. package/dist/assets/{Invitees-Cl1AHc7H.js → Invitees-DKkZzibd.js} +1 -1
  55. package/dist/assets/{List-QGo5601C.js → List-FSR6CchO.js} +1 -1
  56. package/dist/assets/{List-Cmf3tiIG.js → List-UxMzjHgz.js} +1 -1
  57. package/dist/assets/{List-eQH_bBH9.js → List-xIX4PUWP.js} +1 -1
  58. package/dist/assets/{LocalTools-BZcTCTVo.js → LocalTools-CKNv-uwd.js} +1 -1
  59. package/dist/assets/{LocalTools-D03YYP46.js → LocalTools-D23LoYaf.js} +1 -1
  60. package/dist/assets/{Main-Cd2O04ny.js → Main-D5Ed1DGt.js} +1 -1
  61. package/dist/assets/{Message-vUVj868t.js → Message-CoTz6PpW.js} +1 -1
  62. package/dist/assets/{Model-BJNmLw2F.js → Model-RnSe5zkU.js} +1 -1
  63. package/dist/assets/{Navigator-BdD5nBGz.js → Navigator-Dyz0grXz.js} +3 -3
  64. package/dist/assets/{NotFound-C66gBNOM.js → NotFound-Dct8hAOx.js} +1 -1
  65. package/dist/assets/{Pay-B1pcoJhk.js → Pay-CBjM-psz.js} +1 -1
  66. package/dist/assets/{Player-CFCKqV_q.js → Player-BTN_Z13c.js} +1 -1
  67. package/dist/assets/{PromptTextarea-CKaWFNQd.js → PromptTextarea-CdwZdO5y.js} +1 -1
  68. package/dist/assets/{RealtimeCall-BXPWu7qX.js → RealtimeCall-fLUjP9EP.js} +1 -1
  69. package/dist/assets/{ScheduledTasks-CMhPHarh.js → ScheduledTasks-CRovuYkr.js} +1 -1
  70. package/dist/assets/{Status-DiCLbQTx.js → Status-CNU7_pwj.js} +1 -1
  71. package/dist/assets/{Subscribe-CFSpn5V8.js → Subscribe-BZ1u7Bk8.js} +1 -1
  72. package/dist/assets/{TabSwitcher-IlvdQxTZ.js → TabSwitcher-CBnyZq7X.js} +1 -1
  73. package/dist/assets/{Tts-CxhWs5o9.js → Tts-xKs0_YzE.js} +1 -1
  74. package/dist/assets/{VideoPlayer-CSTH3vgH.js → VideoPlayer-CUWCkmQ3.js} +1 -1
  75. package/dist/assets/{alert-CRCLZLDm.js → alert-B1qzKF9D.js} +1 -1
  76. package/dist/assets/arrow-down-2s-Ey0lu.js +1 -0
  77. package/dist/assets/{arrow-down-wide-narrow-CttL_tNO.js → arrow-down-wide-narrow-CfLw2piV.js} +1 -1
  78. package/dist/assets/arrow-left-CND8Hhju.js +1 -0
  79. package/dist/assets/arrow-right-5FLtXm8Q.js +1 -0
  80. package/dist/assets/arrow-up-D3Lb1mKP.js +1 -0
  81. package/dist/assets/{avatar-B1wTrFIQ.js → avatar-44xUgXCU.js} +1 -1
  82. package/dist/assets/{basic-XiOBUPiG.js → basic-BDnyRaHj.js} +1 -1
  83. package/dist/assets/{box-DkopZ42i.js → box-CZ1zxXG3.js} +1 -1
  84. package/dist/assets/{boxes-DeHVVLsn.js → boxes-u_o1AIY-.js} +1 -1
  85. package/dist/assets/{brain-Ds44jfN1.js → brain-BLWRTeKA.js} +1 -1
  86. package/dist/assets/{chart-no-axes-combined-yPmrtHVG.js → chart-no-axes-combined-CQAL3ofL.js} +1 -1
  87. package/dist/assets/{chat-DiWy5OW1.js → chat-DFDUy1uO.js} +1 -1
  88. package/dist/assets/check-B8L527TA.js +1 -0
  89. package/dist/assets/chevron-down-CQm-G07K.js +1 -0
  90. package/dist/assets/chevron-right-CIPkBc0m.js +1 -0
  91. package/dist/assets/circle-check-DSSiRbo3.js +1 -0
  92. package/dist/assets/clock-B6LUjlYj.js +1 -0
  93. package/dist/assets/{codingBridge-BAEuULeY.js → codingBridge-BSJqPMF9.js} +1 -1
  94. package/dist/assets/{codingBridgeNotify-BG6cDZ9i.js → codingBridgeNotify-BZ0Eq6UY.js} +2 -2
  95. package/dist/assets/{coins-DyBfKvGK.js → coins-L-F_TSIn.js} +1 -1
  96. package/dist/assets/{collapse-B83An552.js → collapse-BvfDPMaN.js} +1 -1
  97. package/dist/assets/{createTaskActions-B4eak3bh.js → createTaskActions-Di1S8qFs.js} +1 -1
  98. package/dist/assets/{digitalhuman-D5hZ9xa5.js → digitalhuman-EsehSFue.js} +1 -1
  99. package/dist/assets/{dollar-sign-yMiR7ssb.js → dollar-sign-B1RVNNfi.js} +1 -1
  100. package/dist/assets/{download-Dz7bzLLQ.js → download-DznPbK5b.js} +1 -1
  101. package/dist/assets/{drawer-BRlhyO2f.js → drawer-CQCUUEqh.js} +1 -1
  102. package/dist/assets/{dropdown--4Kz-O3Z.js → dropdown-Bmk5IpPZ.js} +1 -1
  103. package/dist/assets/{dropdown-BGflSj-z.js → dropdown-CziS9LpB.js} +1 -1
  104. package/dist/assets/{ellipsis-CI4AbTFs.js → ellipsis-DssmdjL6.js} +1 -1
  105. package/dist/assets/{esm-k7hhNa_N.js → esm-BdnWjHab.js} +1 -1
  106. package/dist/assets/{esm-mnmEyROT.js → esm-CUkoQ0je.js} +2 -2
  107. package/dist/assets/esm-CZskvJDR.js +1 -0
  108. package/dist/assets/{esm-CMernjWu.js → esm-C_3Z1MjU.js} +1 -1
  109. package/dist/assets/{esm-Vu9FMjws.js → esm-DI6sEZHj.js} +2 -2
  110. package/dist/assets/{esm-C7PK17qJ.js → esm-DcZqq1n6.js} +3 -3
  111. package/dist/assets/{esm-BGkgX2i6.js → esm-cRbA_7V_.js} +1 -1
  112. package/dist/assets/{external-link-DmqTP-54.js → external-link-D9t6nDCM.js} +1 -1
  113. package/dist/assets/{eye-BX2KPnL-.js → eye-BOUbmTD_.js} +1 -1
  114. package/dist/assets/{file-output-E3rCxj9i.js → file-output-C6LPB0OG.js} +1 -1
  115. package/dist/assets/{file-text-DtKLSP1U.js → file-text-Bsevgo70.js} +1 -1
  116. package/dist/assets/{fish-CmPOymqA.js → fish-BwnwtNMl.js} +1 -1
  117. package/dist/assets/{flux-Bs1tqAs5.js → flux-DVaK3qqk.js} +1 -1
  118. package/dist/assets/{folder-B9TdcZND.js → folder-BnpnTHta.js} +1 -1
  119. package/dist/assets/gauge-oFU5VpIZ.js +1 -0
  120. package/dist/assets/{globe-C_rt19wp.js → globe-DrCHQAYf.js} +1 -1
  121. package/dist/assets/{grokvideo-CVNaiCy_.js → grokvideo-DchXHcWF.js} +1 -1
  122. package/dist/assets/{hailuo-CSfBMQ5u.js → hailuo-CBMoRx7S.js} +1 -1
  123. package/dist/assets/{headphones-CcQjeVd2.js → headphones-C_g6xJ4K.js} +1 -1
  124. package/dist/assets/{history-DutXEvuA.js → history-C-wNFVdW.js} +1 -1
  125. package/dist/assets/{image-Cxi-nuFz.js → image-DonYE05J.js} +1 -1
  126. package/dist/assets/{index-BL0bUCVy.js → index-DX67OIaB.js} +3 -3
  127. package/dist/assets/{index.browser.esm-ByffCoDx.js → index.browser.esm-CKQ4Dtxz.js} +1 -1
  128. package/dist/assets/{index.es-CPNzQTpd.js → index.es-J-lc8luD.js} +1 -1
  129. package/dist/assets/{info-DWMxOY1R.js → info-Dky-jV7U.js} +1 -1
  130. package/dist/assets/{input-number-BgWs_lAF.js → input-number-D9LQyEYi.js} +1 -1
  131. package/dist/assets/{key-round-BQEr7cJ8.js → key-round-LS7ykuFJ.js} +1 -1
  132. package/dist/assets/{kling-ZHhu08Lx.js → kling-NLVLT602.js} +1 -1
  133. package/dist/assets/{languages-BEwcHI73.js → languages-C3oKpZQh.js} +1 -1
  134. package/dist/assets/{laptop-BQV_oPNN.js → laptop-CY12Y9v3.js} +1 -1
  135. package/dist/assets/{lightbulb-DQvWcdZu.js → lightbulb-a7W8xb4c.js} +1 -1
  136. package/dist/assets/{link-DJsSOAFe.js → link-D5jgYZtk.js} +1 -1
  137. package/dist/assets/loader-circle-hWM49H9Q.js +1 -0
  138. package/dist/assets/{luma-Dn_Oa-MR.js → luma-YaWYxB--.js} +1 -1
  139. package/dist/assets/{maestro-Dmr_Mg18.js → maestro-D2tFvh1n.js} +1 -1
  140. package/dist/assets/{mail-CDfHGwY3.js → mail-M3Wsz5DV.js} +1 -1
  141. package/dist/assets/{message-circle-CFg3oSsM.js → message-circle-8NfHzHTt.js} +1 -1
  142. package/dist/assets/{mic-DuhiLkXm.js → mic-B6TeXShU.js} +1 -1
  143. package/dist/assets/{midjourney-Be5eE9-O.js → midjourney-DSe_v6RI.js} +1 -1
  144. package/dist/assets/{mobileLocalExec-eE2hhsJF.js → mobileLocalExec-CJrnmUnR.js} +2 -2
  145. package/dist/assets/{mouse-pointer-2-CY17a8BJ.js → mouse-pointer-2-9VWb0Bv6.js} +1 -1
  146. package/dist/assets/music-2-BmfEF6UJ.js +1 -0
  147. package/dist/assets/{nanobanana-BPlMS_Wt.js → nanobanana-CIsctuwk.js} +1 -1
  148. package/dist/assets/{omni-BxIZ5_vx.js → omni-BqSJ7xTX.js} +1 -1
  149. package/dist/assets/{openaiimage-CaqZAR8F.js → openaiimage-Dh8IbRan.js} +1 -1
  150. package/dist/assets/{pagination-BHkO0PTu.js → pagination-WJ-XwyWR.js} +1 -1
  151. package/dist/assets/{pagination-Hpfd7aUl.js → pagination-hYtqNcFK.js} +1 -1
  152. package/dist/assets/{palette-CFGxzEQy.js → palette-UGQvyFEh.js} +1 -1
  153. package/dist/assets/{paperclip-eHxMMxoy.js → paperclip-C4MlWqjo.js} +1 -1
  154. package/dist/assets/{pause-DDkHS2BO.js → pause-fW0dTGgT.js} +1 -1
  155. package/dist/assets/{pencil-DQx_4fLE.js → pencil-B2nSUIn9.js} +1 -1
  156. package/dist/assets/{pika-C9PfsIf_.js → pika-4S-oHpAN.js} +1 -1
  157. package/dist/assets/{pixverse-BQ1WMnJD.js → pixverse-DRC1b0Co.js} +1 -1
  158. package/dist/assets/play-sYAa27gr.js +1 -0
  159. package/dist/assets/plus-B5sdRSJi.js +1 -0
  160. package/dist/assets/{popover-BXPh_Wf1.js → popover-DBk2LFDd.js} +1 -1
  161. package/dist/assets/{producer-CoMiVn2f.js → producer-Bz_xxQb0.js} +1 -1
  162. package/dist/assets/{qrart-BhMUX87u.js → qrart-B-JABrjI.js} +1 -1
  163. package/dist/assets/{realtime-B_d0qZEm.js → realtime-EMnrRee8.js} +1 -1
  164. package/dist/assets/{refresh-cw-Bc7y7zXE.js → refresh-cw-Bhu4GtTV.js} +1 -1
  165. package/dist/assets/rotate-ccw-CHQE7-WL.js +1 -0
  166. package/dist/assets/rotate-cw-DOBdany9.js +1 -0
  167. package/dist/assets/{row-CKJkOBT1.js → row-CzTFLPKk.js} +1 -1
  168. package/dist/assets/search-BJ1rua7n.js +1 -0
  169. package/dist/assets/{seedance-DAA47Gz_.js → seedance-CF_gSR1q.js} +1 -1
  170. package/dist/assets/{seedream-iHkeFbRc.js → seedream-CjsdQSXE.js} +1 -1
  171. package/dist/assets/{select-COeLiCZz.js → select-CZ-weEBK.js} +1 -1
  172. package/dist/assets/{serp-CG6q2aPD.js → serp-NukecbM_.js} +1 -1
  173. package/dist/assets/{shield-DcVg8xdQ.js → shield-OdDzDAdH.js} +1 -1
  174. package/dist/assets/{shuffle-B_8sTICH.js → shuffle-DvlIuAxx.js} +1 -1
  175. package/dist/assets/{slider-D2zgVB9i.js → slider-DqzyNxNA.js} +1 -1
  176. package/dist/assets/{sliders-horizontal-DiEb5kP4.js → sliders-horizontal-BYJfkZAL.js} +1 -1
  177. package/dist/assets/{solana-wallets-DCOmlFUM.js → solana-wallets-mJ53HiX9.js} +2 -2
  178. package/dist/assets/{solana-wallets-vue-D_7YjsRY.js → solana-wallets-vue-BNpu0L2n.js} +1 -1
  179. package/dist/assets/{sora-DqcF98C-.js → sora-33Hzfoef.js} +1 -1
  180. package/dist/assets/square-Cbuok-fk.js +1 -0
  181. package/dist/assets/{suno-CbtZ4A_5.js → suno-octQRdDF.js} +1 -1
  182. package/dist/assets/{switch-YUqT6TZI.js → switch-C0P68ZFq.js} +1 -1
  183. package/dist/assets/{table-BTc5yOXS.js → table-MQVRj0FS.js} +1 -1
  184. package/dist/assets/{tabs-CJNKip_G.js → tabs-CYKIx2FD.js} +1 -1
  185. package/dist/assets/{tag-mafUjsv8.js → tag-CKxxF8Zd.js} +1 -1
  186. package/dist/assets/{taskDrawerMixin-BV7T00JI.js → taskDrawerMixin-Cm4PoHpK.js} +1 -1
  187. package/dist/assets/terminal-BEMj4F_a.js +1 -0
  188. package/dist/assets/{time-picker-CWbrPLZp.js → time-picker-CbgK5quX.js} +1 -1
  189. package/dist/assets/{tooltip-CdwmIuyi.js → tooltip-N7QSFzip.js} +1 -1
  190. package/dist/assets/{trash-2-EtzbCDwL.js → trash-2-CSgZwHve.js} +1 -1
  191. package/dist/assets/{triangle-alert-BnFsEUpB.js → triangle-alert-CNPqv5of.js} +1 -1
  192. package/dist/assets/{upload-C-Vgck-0.js → upload-7JbUsHpw.js} +1 -1
  193. package/dist/assets/{upload-lY0v4ivH.js → upload-C2D3m-Zg.js} +1 -1
  194. package/dist/assets/user-VwycOgAC.js +1 -0
  195. package/dist/assets/{veo-9xBayW8h.js → veo-zSI1fuoh.js} +1 -1
  196. package/dist/assets/{video-CfnZ27fY.js → video-BWQGQA8o.js} +1 -1
  197. package/dist/assets/{volume-2-0YuFecH1.js → volume-2-_Do0sS3-.js} +1 -1
  198. package/dist/assets/{wallet-BI-yz-yD.js → wallet-Cx4_zL5h.js} +1 -1
  199. package/dist/assets/{wan-8lgYaitn.js → wan-DGDG1ap0.js} +1 -1
  200. package/dist/assets/{wand-sparkles-CFb_FeMs.js → wand-sparkles-nKvNmNyI.js} +1 -1
  201. package/dist/assets/{web-DkLsyd0I.js → web-BKFW74fX.js} +1 -1
  202. package/dist/assets/{web-nhxHVlrs.js → web-CPBOpWaH.js} +1 -1
  203. package/dist/assets/{web-7Sh0Do4B.js → web-ChRErvS3.js} +1 -1
  204. package/dist/assets/{web-CulEdVtg.js → web-DLFyPdVQ.js} +1 -1
  205. package/dist/assets/{web-hpqEAGe0.js → web-oVrmC0iM.js} +1 -1
  206. package/dist/assets/{webextrator-BndgjvT5.js → webextrator-R7sCdYuf.js} +1 -1
  207. package/dist/assets/{zap-DrU-fvIV.js → zap-DDBuCYL8.js} +1 -1
  208. package/dist/index.html +1 -1
  209. package/package.json +1 -1
  210. package/dist/assets/Index-DqfZ9huL.js +0 -1
  211. package/dist/assets/arrow-down-C0dg7AQ9.js +0 -1
  212. package/dist/assets/arrow-left-B7nPt9ZO.js +0 -1
  213. package/dist/assets/arrow-right-D1dwtIHN.js +0 -1
  214. package/dist/assets/arrow-up-C9s3Onj2.js +0 -1
  215. package/dist/assets/check-Qny-uyrr.js +0 -1
  216. package/dist/assets/chevron-down-46IMn-jW.js +0 -1
  217. package/dist/assets/chevron-right-DZOwZfbr.js +0 -1
  218. package/dist/assets/circle-check-nGMK5h3h.js +0 -1
  219. package/dist/assets/clock-DK3A1641.js +0 -1
  220. package/dist/assets/esm-D2sTy_Mn.js +0 -1
  221. package/dist/assets/gauge-BBYQ7PAj.js +0 -1
  222. package/dist/assets/loader-circle-CXGHDBnc.js +0 -1
  223. package/dist/assets/music-2-BYyQi7W8.js +0 -1
  224. package/dist/assets/play-CpXXpfNH.js +0 -1
  225. package/dist/assets/plus-JexWBv_b.js +0 -1
  226. package/dist/assets/rotate-ccw-9-NBqOrj.js +0 -1
  227. package/dist/assets/rotate-cw-DzB0xHcL.js +0 -1
  228. package/dist/assets/search-C3rM1tn3.js +0 -1
  229. package/dist/assets/square-Ckzuv0XE.js +0 -1
  230. package/dist/assets/terminal-DA-lRaos.js +0 -1
  231. package/dist/assets/user-ELktgHhd.js +0 -1
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,ht as l,it as u,j as d,mt as f,qt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-COeLiCZz.js";import{n as b,t as x}from"./tabs-CJNKip_G.js";import{t as S}from"./upload-lY0v4ivH.js";import{t as C}from"./tooltip-CdwmIuyi.js";import{t as w}from"./alert-CRCLZLDm.js";import{t as T}from"./drawer-BRlhyO2f.js";import{t as E}from"./switch-YUqT6TZI.js";import{n as D}from"./taskDrawerMixin-BV7T00JI.js";import{t as O}from"./box-DkopZ42i.js";import{t as k}from"./clock-DK3A1641.js";import{t as A}from"./CopyToClipboard-CUgv3RMH.js";import{n as j,r as M,t as N}from"./PromptTextarea-CKaWFNQd.js";import{t as P}from"./info-DWMxOY1R.js";import{t as F}from"./languages-BEwcHI73.js";import{t as ee}from"./triangle-alert-BnFsEUpB.js";import{t as te}from"./upload-C-Vgck-0.js";import{t as I}from"./wand-sparkles-CFb_FeMs.js";import{t as ne}from"./zap-DrU-fvIV.js";import{$r as L,ei as R,ti as z}from"./constants-D-3QKDN1.js";import{$t as re,Ai as B,Bn as ie,Bt as ae,E as V,Ht as H,Vt as U,Wt as W,ei as G,gi as K,mr as q,ri as J,zt as oe}from"./index-BL0bUCVy.js";import{t as Y}from"./ImagePreview-LOhAiiTN.js";import{t as se}from"./Consumption-D5IaOx8Q.js";import{a as X,n as ce,r as le,t as ue}from"./pagination-BHkO0PTu.js";import{t as de}from"./VideoPlayer-CSTH3vgH.js";import{t as fe}from"./ApiCodeButton-DXiZffUI.js";import{t as pe}from"./BotPlaceholder-vAnmSqdw.js";var me=_({name:`LayoutVeo`,components:{MagicIcon:I,ElDrawer:T,ElButton:B},mixins:[D]}),he={class:`main flex flex-row flex-1`},ge={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},_e={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ve(t,n,r,a,s,d){let p=c(`magic-icon`),m=c(`el-button`),_=c(`el-drawer`);return h(),o(`div`,he,[e(`div`,ge,[u(t.$slots,`config`,{},void 0,!0)]),e(`div`,_e,[u(t.$slots,`result`,{},void 0,!0)]),l(i(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:f(()=>[i(p,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:f(()=>[u(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ye=V(me,[[`render`,ve],[`__scopeId`,`data-v-293c9493`]]),Z=`veo31-fast-ingredients`,be=[{value:`veo31-fast`,label:`Veo 3.1 Fast`},{value:`veo3-fast`,label:`Veo 3 Fast`},{value:`veo31`,label:`Veo 3.1`},{value:`veo3`,label:`Veo 3`}],Q=(e,t)=>{let n=!!(e?.action&&e.action!==t),r={...e,action:t};return t===`text2video`?(r.model=r.model===`veo31-fast-ingredients`?z:r.model||`veo31-fast`,delete r.image_urls,r):t===`ingredients2video`?(r.model=Z,n?delete r.image_urls:r.image_urls=r.image_urls?.slice(0,3),r):(r.model=r.model===`veo31-fast-ingredients`?z:r.model||`veo31-fast`,n?delete r.image_urls:r.image_urls=r.image_urls?.slice(0,2),r)},xe=e=>{let t={...Q(e,e?.action||`text2video`),async:!0};return t.image_urls?.length||delete t.image_urls,t},Se=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},computed:{isModelLocked(){return this.$store.state.veo?.config?.action===`ingredients2video`},options(){return this.isModelLocked?[{value:Z,label:`Veo 3.1 Fast`}]:be},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||=z}}),Ce={class:`field`},we={class:`title font-bold`};function Te(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Ce,[e(`h2`,we,r(t.$t(`veo.name.model`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`veo.placeholder.select`),disabled:t.isModelLocked},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var Ee=V(Se,[[`render`,Te],[`__scopeId`,`data-v-90ed8cff`]]),De=_({name:`ActionSelector`,components:{ElTabs:b,ElTabPane:x},data(){return{}},computed:{options(){return[{value:`text2video`,label:this.$t(`veo.button.action1`)},{value:`image2video`,label:this.$t(`veo.button.action2`)},{value:`ingredients2video`,label:this.$t(`veo.button.actionIngredients`)}]},value(){return this.$store.state.veo?.config?.action||`text2video`}},mounted(){this.$store.state.veo?.config?.action||this.onUpdate(L)},methods:{onUpdate(e){this.$store.commit(`veo/setConfig`,Q(this.$store.state.veo?.config,e))}}});function Oe(e,t,n,r,i,a){let l=c(`el-tab-pane`),u=c(`el-tabs`);return h(),d(u,{"model-value":e.value,class:`action-tabs scenario-tabs scenario-tabs--divided`,stretch:``,"onUpdate:modelValue":e.onUpdate},{default:f(()=>[(h(!0),o(s,null,m(e.options,e=>(h(),d(l,{key:e.value,name:e.value,label:e.label},null,8,[`name`,`label`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var ke=V(De,[[`render`,Oe],[`__scopeId`,`data-v-531a5c55`]]),Ae=_({name:`TranslationSelector`,components:{ElSwitch:E,InfoIcon:X},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug(`set translation`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),je={class:`relative`},Me={class:`flex justify-between`},Ne={class:`flex justify-start items-center`},Pe={class:`text-sm font-bold`},Fe={class:`flex justify-end items-center`};function Ie(t,n,a,s,l,u){let d=c(`info-icon`),f=c(`el-switch`);return h(),o(`div`,je,[e(`div`,Me,[e(`div`,Ne,[e(`span`,Pe,r(t.$t(`veo.name.translation`)),1),i(d,{content:t.$t(`veo.description.translation`)},null,8,[`content`])]),e(`div`,Fe,[i(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Le=V(Ae,[[`render`,Ie]]),Re=_({name:`AspectRatioSelector`,data(){return{options:[{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.veo?.config?.aspect_ratio},set(e){console.debug(`set aspect_ratio`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||=R}}),ze={class:`text-sm font-bold mb-2 block`},Be={class:`items`},Ve=[`onClick`],He={class:`name`};function Ue(n,i,a,c,l,u){return h(),o(`div`,null,[e(`span`,ze,r(n.$t(`veo.name.ratio`)),1),e(`div`,Be,[(h(!0),o(s,null,m(n.options,(i,a)=>(h(),o(`div`,{key:a,class:t({active:n.active===a,item:!0}),onClick:e=>n.value=i.value},[e(`div`,{class:t([`preview`,i.label])},[e(`div`,{class:`rect`,style:p({width:i.width+`px`,height:i.height+`px`})},null,4)],2),e(`p`,He,r(i.label),1)],10,Ve))),128))])])}var We=V(Re,[[`render`,Ue],[`__scopeId`,`data-v-28c472c4`]]),Ge=_({name:`StartEndImage`,components:{UploadIcon:te,ElUpload:S,ElButton:B,InfoIcon:X,ImagePreview:Y},mixins:[H,ae],props:{limit:{type:Number,default:2},ingredients:{type:Boolean,default:!1}},emits:[`change`],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},title(){return this.ingredients?this.$t(`veo.button.actionIngredients`):this.$t(`veo.name.startEndImage`)},description(){return this.ingredients?this.$t(`veo.description.imageUrl`):this.$t(`veo.description.uploadStartEndImage`)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(e=>!!e)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},watch:{limit(){this.fileList.length>this.limit&&(this.fileList=this.fileList.slice(0,this.limit),this.onSetStartEndImageUrl())}},mounted(){this.fileList=(this.value||[]).map((e,t)=>({name:`reference-${t+1}`,percentage:100,response:{file_url:e},status:`success`,uid:Date.now()+t,url:e}))},methods:{onExceed(){K.warning(this.$t(`veo.message.uploadReferencesLimit`,{limit:this.limit}))},onError(){K.error(this.$t(`veo.message.uploadReferencesError`))},onSetStartEndImageUrl(){let e=this.urls;this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()},onRemove(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onSetStartEndImageUrl()}}}),Ke={class:`relative`},qe={class:`flex justify-between`},Je={class:`flex justify-start items-center`},Ye={class:`text-sm font-bold`};function Xe(t,s,l,u,p,m){let g=c(`info-icon`),_=c(`image-preview`),v=c(`upload-icon`),y=c(`el-button`),b=c(`el-upload`);return h(),o(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`span`,Ye,r(t.title),1),i(g,{content:t.description},null,8,[`content`])])]),i(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":s[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:t.limit,class:`upload-wrapper`,multiple:!0,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:f(({file:e})=>[e.url&&e.percentage!==void 0?(h(),d(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):a(``,!0)]),default:f(()=>[i(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:f(()=>[i(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`veo.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ze=V(Ge,[[`render`,Xe],[`__scopeId`,`data-v-89137805`]]),Qe=_({name:`PromptInput`,components:{PromptTextarea:N},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function $e(e,t,n,r,i,a){let o=c(`prompt-textarea`);return h(),d(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`veo.name.prompt`),info:e.$t(`veo.description.prompt`),placeholder:e.$t(`veo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var et=_({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:B,Consumption:se,PromptInput:V(Qe,[[`render`,$e]]),ModelSelector:Ee,StartEndImage:Ze,ActionSelector:ke,TranslationSelector:Le,AspectRatioSelector:We},emits:[`generate`],computed:{config(){return this.$store.state.veo?.config},showsImages(){return this.config?.action===`image2video`||this.config?.action===`ingredients2video`},imageLimit(){return this.config?.action===`ingredients2video`?3:2},consumption(){return W(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),tt={class:`flex flex-col h-full`},nt={class:`flex-1 overflow-y-auto p-5`},rt={class:`flex flex-col items-center justify-center px-5 pb-5`};function it(t,s,l,u,p,m){let g=c(`action-selector`),_=c(`model-selector`),v=c(`start-end-image`),y=c(`prompt-input`),b=c(`aspect-ratio-selector`),x=c(`translation-selector`),S=c(`consumption`),C=c(`magic-icon`),w=c(`el-button`);return h(),o(`div`,tt,[e(`div`,nt,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),t.showsImages?(h(),d(v,{key:t.config?.action,class:`mb-4`,limit:t.imageLimit,ingredients:t.config?.action===`ingredients2video`},null,8,[`limit`,`ingredients`])):a(``,!0),i(y,{class:`mb-4`}),i(b,{class:`mb-4`}),i(x,{class:`mb-4`})]),e(`div`,rt,[i(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),i(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:f(()=>[i(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`veo.button.generate`)),1)]),_:1},8,[`onClick`])])])}var at=V(et,[[`render`,it]]),ot=_({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:M,ExpandIcon:j,InfoIcon:P,LanguageIcon:F,LightningIcon:ne,MagicIcon:I,TimeIcon:k,WarningIcon:ee,CopyToClipboard:A,ElAlert:w,VideoPlayer:de,ImagePreview:Y,ElTooltip:C,ElButton:B,ApiCodeButton:fe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{referenceImages(){let e=this.modelValue?.request?.image_urls;return Array.isArray(e)?e.filter(e=>typeof e==`string`&&!!e):[]},actionLabel(){let e=this.modelValue?.request,t=e?.model===`veo31-fast-ingredients`||this.referenceImages.length>2?`ingredients2video`:this.referenceImages.length>0?`image2video`:`text2video`,n=e?.action||t;return this.$t({text2video:`veo.button.action1`,image2video:`veo.button.action2`,ingredients2video:`veo.button.actionIngredients`}[n]||`veo.name.action`)},traceId(){return this.modelValue?.response?.trace_id||this.modelValue?.trace_id},taskInfoClass(){return this.modelValue?.response?.success===!0?`success`:this.modelValue?.response?.success===!1?`failure`:`info`}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),st={class:`preview`},ct={class:`left`},lt={class:`main`},ut={class:`bot`},dt={class:`datetime`},ft={class:`info`},pt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},mt={key:1,class:`prompt mt-2`},ht={key:0},gt={key:1},_t={key:0,class:t({content:!0,failed:!0})},vt={key:0,class:`mb-4`},yt={key:1,class:t({operations:!0,"mt-2":!0})},bt={key:1,class:t({content:!0})},xt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},St={class:t({content:!0})},Ct={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Et={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function kt(l,u,p,g,_,v){let y=c(`capability-presentation`),b=c(`image-preview`),x=c(`video-player`),S=c(`el-button`),C=c(`el-tooltip`),w=c(`api-code-button`),T=c(`warning-icon`),E=c(`info-icon`),D=c(`copy-to-clipboard`),O=c(`el-alert`),k=c(`application-icon`),A=c(`lightning-icon`),j=c(`expand-icon`),M=c(`language-icon`),N=c(`magic-icon`),P=c(`time-icon`),F=c(`channel-icon`);return h(),o(`div`,st,[e(`div`,ct,[i(y,{capability:`veo`,part:`avatar`,class:`avatar`})]),e(`div`,lt,[e(`div`,ut,[i(y,{capability:`veo`,part:`name`}),e(`span`,dt,r(l.$dayjs.format(``+new Date(parseFloat((l.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,ft,[l.referenceImages.length>0?(h(),o(`div`,pt,[(h(!0),o(s,null,m(l.referenceImages,(e,t)=>(h(),d(b,{key:`${t}-${e}`,url:e,name:`reference-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):a(``,!0),l.modelValue?.request?.prompt?(h(),o(`p`,mt,[n(r(l.modelValue?.request?.prompt)+` `,1),l.modelValue?.response?a(``,!0):(h(),o(`span`,ht,` - (`+r(l.$t(`veo.status.pending`))+`) `,1)),Array.isArray(l.modelValue?.response?.data)&&l.modelValue?.response?.data[0]?.state===`running`?(h(),o(`span`,gt,` - (`+r(l.$t(`veo.status.processing`))+`) `,1)):a(``,!0)])):a(``,!0)]),l.modelValue?.response?.success===!0&&l.modelValue?.response?.data?(h(),o(`div`,_t,[l.modelValue?.response?.data[0]?.video_url?(h(),o(`div`,vt,[i(x,{src:l.modelValue?.response?.data[0]?.video_url},null,8,[`src`])])):a(``,!0),l.modelValue?.response.success?(h(),o(`div`,yt,[i(C,{class:`box-item`,effect:`dark`,content:l.$t(`veo.message.downloadVideo`),placement:`top-start`},{default:f(()=>[l.modelValue?.response?.data[0]?.video_url?(h(),d(S,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=e=>l.onDownload(e,l.modelValue?.response?.data[0]?.video_url)},{default:f(()=>[n(r(l.$t(`veo.button.download`)),1)]),_:1})):a(``,!0)]),_:1},8,[`content`]),i(w,{path:`/veo/videos`,body:l.modelValue?.request},null,8,[`body`])])):a(``,!0)])):a(``,!0),l.modelValue?.response?.success===!1?(h(),o(`div`,bt,[i(O,{closable:!1,class:`failure`},{template:f(()=>[i(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.failure`)),1)]),default:f(()=>[e(`p`,xt,[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.failureReason`))+`: `+r(l.modelValue?.response?.error?.message)+` `,1),i(D,{content:l.modelValue?.response?.error?.message},null,8,[`content`])])]),_:1})])):a(``,!0),e(`div`,St,[i(O,{closable:!1,class:t([`mt-2`,`task-metadata`,l.taskInfoClass])},{default:f(()=>[l.modelValue?.request?.model?(h(),o(`p`,Ct,[i(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.model`))+`: `+r(l.modelValue?.request?.model),1)])):a(``,!0),e(`p`,wt,[i(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.action`))+`: `+r(l.actionLabel),1)]),l.modelValue?.request?.aspect_ratio?(h(),o(`p`,Tt,[i(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.ratio`))+`: `+r(l.modelValue?.request?.aspect_ratio),1)])):a(``,!0),l.modelValue?.request?.translation===void 0?a(``,!0):(h(),o(`p`,Et,[i(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.translation`))+`: `+r(l.$t(l.modelValue?.request?.translation?`seedance.button.on`:`seedance.button.off`)),1)])),e(`p`,$,[i(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.taskId`))+`: `+r(l.modelValue?.id)+` `,1),i(D,{content:l.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),l.modelValue?.elapsed?(h(),o(`p`,Dt,[i(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.elapsed`))+`: `+r(l.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0),l.traceId?(h(),o(`p`,Ot,[i(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.traceId`))+`: `+r(l.traceId)+` `,1),i(D,{content:l.traceId,class:`btn-copy inline-block`},null,8,[`content`])])):a(``,!0)]),_:1},8,[`class`])])])])}var At=_({name:`RecentPanel`,components:{TaskPreview:V(ot,[[`render`,kt],[`__scopeId`,`data-v-54ddb667`]]),NoTasks:le,BotPlaceholder:pe,ScrollList:ce},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),jt={key:0},Mt={key:2,class:`w-full h-full flex items-center justify-center`};function Nt(e,t,n,r,l,u){let p=c(`bot-placeholder`),g=c(`task-preview`),_=c(`scroll-list`),v=c(`no-tasks`);return h(),o(s,null,[e.tasks?.items===void 0?(h(),o(`div`,jt,[i(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),d(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:f(()=>[(h(!0),o(s,null,m(e.tasks?.items,(e,t)=>(h(),d(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(h(),o(`div`,Mt,[i(v)])):a(``,!0)],64)}var Pt=_({name:`VeoIndex`,components:{ConfigPanel:at,Layout:ye,RecentPanel:V(At,[[`render`,Nt]])},mixins:[U],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===G.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===G.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ue({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`veo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`veo/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`veo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!oe(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let e=xe(this.config);if(!re())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}if((e.action===`image2video`||e.action===`ingredients2video`)&&!(e.image_urls&&e.image_urls.length>0)){K.warning(this.$t(`veo.message.imageRequired`));return}K.info(this.$t(`veo.message.startingTask`)),q(`veo`,ie.generate(e,{token:t})).then(()=>{K.success(this.$t(`veo.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?K.error(this.$t(`veo.message.usedUp`)):K.error(this.$t(`veo.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Ft(e,t,n,r,a,o){let s=c(`config-panel`),l=c(`recent-panel`),u=c(`layout`);return h(),d(u,null,{config:f(()=>[i(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:f(()=>[i(l,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var It=V(Pt,[[`render`,Ft]]);export{It as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,ht as l,it as u,j as d,mt as f,qt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-CZ-weEBK.js";import{n as b,t as x}from"./tabs-CYKIx2FD.js";import{t as S}from"./upload-C2D3m-Zg.js";import{t as C}from"./tooltip-N7QSFzip.js";import{t as w}from"./alert-B1qzKF9D.js";import{t as T}from"./drawer-CQCUUEqh.js";import{t as E}from"./switch-C0P68ZFq.js";import{n as D}from"./taskDrawerMixin-Cm4PoHpK.js";import{t as O}from"./box-CZ1zxXG3.js";import{t as k}from"./clock-B6LUjlYj.js";import{t as A}from"./CopyToClipboard-C7E8BXWT.js";import{n as j,r as M,t as N}from"./PromptTextarea-CdwZdO5y.js";import{t as P}from"./info-Dky-jV7U.js";import{t as F}from"./languages-C3oKpZQh.js";import{t as ee}from"./triangle-alert-CNPqv5of.js";import{t as te}from"./upload-7JbUsHpw.js";import{t as I}from"./wand-sparkles-nKvNmNyI.js";import{t as ne}from"./zap-DDBuCYL8.js";import{$r as L,ei as R,ti as z}from"./constants-D-3QKDN1.js";import{$t as re,Ai as B,Bn as ie,Bt as ae,E as V,Ht as H,Vt as U,Wt as W,ei as G,gi as K,mr as q,ri as J,zt as oe}from"./index-DX67OIaB.js";import{t as Y}from"./ImagePreview-BBHtU8GY.js";import{t as se}from"./Consumption-DfYXtMEK.js";import{a as X,n as ce,r as le,t as ue}from"./pagination-WJ-XwyWR.js";import{t as de}from"./VideoPlayer-CUWCkmQ3.js";import{t as fe}from"./ApiCodeButton-C1q6DpUc.js";import{t as pe}from"./BotPlaceholder-BU4rzneO.js";var me=_({name:`LayoutVeo`,components:{MagicIcon:I,ElDrawer:T,ElButton:B},mixins:[D]}),he={class:`main flex flex-row flex-1`},ge={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},_e={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ve(t,n,r,a,s,d){let p=c(`magic-icon`),m=c(`el-button`),_=c(`el-drawer`);return h(),o(`div`,he,[e(`div`,ge,[u(t.$slots,`config`,{},void 0,!0)]),e(`div`,_e,[u(t.$slots,`result`,{},void 0,!0)]),l(i(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:f(()=>[i(p,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:f(()=>[u(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ye=V(me,[[`render`,ve],[`__scopeId`,`data-v-293c9493`]]),Z=`veo31-fast-ingredients`,be=[{value:`veo31-fast`,label:`Veo 3.1 Fast`},{value:`veo3-fast`,label:`Veo 3 Fast`},{value:`veo31`,label:`Veo 3.1`},{value:`veo3`,label:`Veo 3`}],Q=(e,t)=>{let n=!!(e?.action&&e.action!==t),r={...e,action:t};return t===`text2video`?(r.model=r.model===`veo31-fast-ingredients`?z:r.model||`veo31-fast`,delete r.image_urls,r):t===`ingredients2video`?(r.model=Z,n?delete r.image_urls:r.image_urls=r.image_urls?.slice(0,3),r):(r.model=r.model===`veo31-fast-ingredients`?z:r.model||`veo31-fast`,n?delete r.image_urls:r.image_urls=r.image_urls?.slice(0,2),r)},xe=e=>{let t={...Q(e,e?.action||`text2video`),async:!0};return t.image_urls?.length||delete t.image_urls,t},Se=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},computed:{isModelLocked(){return this.$store.state.veo?.config?.action===`ingredients2video`},options(){return this.isModelLocked?[{value:Z,label:`Veo 3.1 Fast`}]:be},value:{get(){return this.$store.state.veo?.config?.model},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo.config,model:e})}}},mounted(){this.value||=z}}),Ce={class:`field`},we={class:`title font-bold`};function Te(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Ce,[e(`h2`,we,r(t.$t(`veo.name.model`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`veo.placeholder.select`),disabled:t.isModelLocked},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])])}var Ee=V(Se,[[`render`,Te],[`__scopeId`,`data-v-90ed8cff`]]),De=_({name:`ActionSelector`,components:{ElTabs:b,ElTabPane:x},data(){return{}},computed:{options(){return[{value:`text2video`,label:this.$t(`veo.button.action1`)},{value:`image2video`,label:this.$t(`veo.button.action2`)},{value:`ingredients2video`,label:this.$t(`veo.button.actionIngredients`)}]},value(){return this.$store.state.veo?.config?.action||`text2video`}},mounted(){this.$store.state.veo?.config?.action||this.onUpdate(L)},methods:{onUpdate(e){this.$store.commit(`veo/setConfig`,Q(this.$store.state.veo?.config,e))}}});function Oe(e,t,n,r,i,a){let l=c(`el-tab-pane`),u=c(`el-tabs`);return h(),d(u,{"model-value":e.value,class:`action-tabs scenario-tabs scenario-tabs--divided`,stretch:``,"onUpdate:modelValue":e.onUpdate},{default:f(()=>[(h(!0),o(s,null,m(e.options,e=>(h(),d(l,{key:e.value,name:e.value,label:e.label},null,8,[`name`,`label`]))),128))]),_:1},8,[`model-value`,`onUpdate:modelValue`])}var ke=V(De,[[`render`,Oe],[`__scopeId`,`data-v-531a5c55`]]),Ae=_({name:`TranslationSelector`,components:{ElSwitch:E,InfoIcon:X},computed:{value:{get(){return this.$store.state.veo?.config?.translation},set(e){console.debug(`set translation`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,translation:e})}}},mounted(){this.value===void 0&&(this.value=!1)}}),je={class:`relative`},Me={class:`flex justify-between`},Ne={class:`flex justify-start items-center`},Pe={class:`text-sm font-bold`},Fe={class:`flex justify-end items-center`};function Ie(t,n,a,s,l,u){let d=c(`info-icon`),f=c(`el-switch`);return h(),o(`div`,je,[e(`div`,Me,[e(`div`,Ne,[e(`span`,Pe,r(t.$t(`veo.name.translation`)),1),i(d,{content:t.$t(`veo.description.translation`)},null,8,[`content`])]),e(`div`,Fe,[i(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`},null,8,[`modelValue`])])])])}var Le=V(Ae,[[`render`,Ie]]),Re=_({name:`AspectRatioSelector`,data(){return{options:[{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.veo?.config?.aspect_ratio},set(e){console.debug(`set aspect_ratio`,e),this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,aspect_ratio:e})}}},mounted(){this.value||=R}}),ze={class:`text-sm font-bold mb-2 block`},Be={class:`items`},Ve=[`onClick`],He={class:`name`};function Ue(n,i,a,c,l,u){return h(),o(`div`,null,[e(`span`,ze,r(n.$t(`veo.name.ratio`)),1),e(`div`,Be,[(h(!0),o(s,null,m(n.options,(i,a)=>(h(),o(`div`,{key:a,class:t({active:n.active===a,item:!0}),onClick:e=>n.value=i.value},[e(`div`,{class:t([`preview`,i.label])},[e(`div`,{class:`rect`,style:p({width:i.width+`px`,height:i.height+`px`})},null,4)],2),e(`p`,He,r(i.label),1)],10,Ve))),128))])])}var We=V(Re,[[`render`,Ue],[`__scopeId`,`data-v-28c472c4`]]),Ge=_({name:`StartEndImage`,components:{UploadIcon:te,ElUpload:S,ElButton:B,InfoIcon:X,ImagePreview:Y},mixins:[H,ae],props:{limit:{type:Number,default:2},ingredients:{type:Boolean,default:!1}},emits:[`change`],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},title(){return this.ingredients?this.$t(`veo.button.actionIngredients`):this.$t(`veo.name.startEndImage`)},description(){return this.ingredients?this.$t(`veo.description.imageUrl`):this.$t(`veo.description.uploadStartEndImage`)},urls(){return this.fileList.map(e=>e.response?.file_url||e.url).filter(e=>!!e)},value:{get(){return this.$store.state?.veo?.config?.image_urls},set(){}}},watch:{limit(){this.fileList.length>this.limit&&(this.fileList=this.fileList.slice(0,this.limit),this.onSetStartEndImageUrl())}},mounted(){this.fileList=(this.value||[]).map((e,t)=>({name:`reference-${t+1}`,percentage:100,response:{file_url:e},status:`success`,uid:Date.now()+t,url:e}))},methods:{onExceed(){K.warning(this.$t(`veo.message.uploadReferencesLimit`,{limit:this.limit}))},onError(){K.error(this.$t(`veo.message.uploadReferencesError`))},onSetStartEndImageUrl(){let e=this.urls;this.$store.commit(`veo/setConfig`,{...this.$store.state?.veo?.config,image_urls:e})},async onSuccess(){this.onSetStartEndImageUrl()},onRemove(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onSetStartEndImageUrl()}}}),Ke={class:`relative`},qe={class:`flex justify-between`},Je={class:`flex justify-start items-center`},Ye={class:`text-sm font-bold`};function Xe(t,s,l,u,p,m){let g=c(`info-icon`),_=c(`image-preview`),v=c(`upload-icon`),y=c(`el-button`),b=c(`el-upload`);return h(),o(`div`,Ke,[e(`div`,qe,[e(`div`,Je,[e(`span`,Ye,r(t.title),1),i(g,{content:t.description},null,8,[`content`])])]),i(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":s[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:t.limit,class:`upload-wrapper`,multiple:!0,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:f(({file:e})=>[e.url&&e.percentage!==void 0?(h(),d(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.onRemove(e)},null,8,[`url`,`name`,`percentage`,`onRemove`])):a(``,!0)]),default:f(()=>[i(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:f(()=>[i(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`veo.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var Ze=V(Ge,[[`render`,Xe],[`__scopeId`,`data-v-89137805`]]),Qe=_({name:`PromptInput`,components:{PromptTextarea:N},computed:{prompt:{get(){return this.$store.state.veo?.config?.prompt},set(e){this.$store.commit(`veo/setConfig`,{...this.$store.state.veo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function $e(e,t,n,r,i,a){let o=c(`prompt-textarea`);return h(),d(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`veo.name.prompt`),info:e.$t(`veo.description.prompt`),placeholder:e.$t(`veo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var et=_({name:`ConfigPanel`,components:{MagicIcon:I,ElButton:B,Consumption:se,PromptInput:V(Qe,[[`render`,$e]]),ModelSelector:Ee,StartEndImage:Ze,ActionSelector:ke,TranslationSelector:Le,AspectRatioSelector:We},emits:[`generate`],computed:{config(){return this.$store.state.veo?.config},showsImages(){return this.config?.action===`image2video`||this.config?.action===`ingredients2video`},imageLimit(){return this.config?.action===`ingredients2video`?3:2},consumption(){return W(this.config,this.service?.cost)},service(){return this.$store.state.veo?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),tt={class:`flex flex-col h-full`},nt={class:`flex-1 overflow-y-auto p-5`},rt={class:`flex flex-col items-center justify-center px-5 pb-5`};function it(t,s,l,u,p,m){let g=c(`action-selector`),_=c(`model-selector`),v=c(`start-end-image`),y=c(`prompt-input`),b=c(`aspect-ratio-selector`),x=c(`translation-selector`),S=c(`consumption`),C=c(`magic-icon`),w=c(`el-button`);return h(),o(`div`,tt,[e(`div`,nt,[i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),t.showsImages?(h(),d(v,{key:t.config?.action,class:`mb-4`,limit:t.imageLimit,ingredients:t.config?.action===`ingredients2video`},null,8,[`limit`,`ingredients`])):a(``,!0),i(y,{class:`mb-4`}),i(b,{class:`mb-4`}),i(x,{class:`mb-4`})]),e(`div`,rt,[i(S,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),i(w,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:f(()=>[i(C,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`veo.button.generate`)),1)]),_:1},8,[`onClick`])])])}var at=V(et,[[`render`,it]]),ot=_({name:`TaskPreview`,components:{ApplicationIcon:O,ChannelIcon:M,ExpandIcon:j,InfoIcon:P,LanguageIcon:F,LightningIcon:ne,MagicIcon:I,TimeIcon:k,WarningIcon:ee,CopyToClipboard:A,ElAlert:w,VideoPlayer:de,ImagePreview:Y,ElTooltip:C,ElButton:B,ApiCodeButton:fe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{referenceImages(){let e=this.modelValue?.request?.image_urls;return Array.isArray(e)?e.filter(e=>typeof e==`string`&&!!e):[]},actionLabel(){let e=this.modelValue?.request,t=e?.model===`veo31-fast-ingredients`||this.referenceImages.length>2?`ingredients2video`:this.referenceImages.length>0?`image2video`:`text2video`,n=e?.action||t;return this.$t({text2video:`veo.button.action1`,image2video:`veo.button.action2`,ingredients2video:`veo.button.actionIngredients`}[n]||`veo.name.action`)},traceId(){return this.modelValue?.response?.trace_id||this.modelValue?.trace_id},taskInfoClass(){return this.modelValue?.response?.success===!0?`success`:this.modelValue?.response?.success===!1?`failure`:`info`}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),st={class:`preview`},ct={class:`left`},lt={class:`main`},ut={class:`bot`},dt={class:`datetime`},ft={class:`info`},pt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},mt={key:1,class:`prompt mt-2`},ht={key:0},gt={key:1},_t={key:0,class:t({content:!0,failed:!0})},vt={key:0,class:`mb-4`},yt={key:1,class:t({operations:!0,"mt-2":!0})},bt={key:1,class:t({content:!0})},xt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},St={class:t({content:!0})},Ct={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Et={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Dt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function kt(l,u,p,g,_,v){let y=c(`capability-presentation`),b=c(`image-preview`),x=c(`video-player`),S=c(`el-button`),C=c(`el-tooltip`),w=c(`api-code-button`),T=c(`warning-icon`),E=c(`info-icon`),D=c(`copy-to-clipboard`),O=c(`el-alert`),k=c(`application-icon`),A=c(`lightning-icon`),j=c(`expand-icon`),M=c(`language-icon`),N=c(`magic-icon`),P=c(`time-icon`),F=c(`channel-icon`);return h(),o(`div`,st,[e(`div`,ct,[i(y,{capability:`veo`,part:`avatar`,class:`avatar`})]),e(`div`,lt,[e(`div`,ut,[i(y,{capability:`veo`,part:`name`}),e(`span`,dt,r(l.$dayjs.format(``+new Date(parseFloat((l.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,ft,[l.referenceImages.length>0?(h(),o(`div`,pt,[(h(!0),o(s,null,m(l.referenceImages,(e,t)=>(h(),d(b,{key:`${t}-${e}`,url:e,name:`reference-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):a(``,!0),l.modelValue?.request?.prompt?(h(),o(`p`,mt,[n(r(l.modelValue?.request?.prompt)+` `,1),l.modelValue?.response?a(``,!0):(h(),o(`span`,ht,` - (`+r(l.$t(`veo.status.pending`))+`) `,1)),Array.isArray(l.modelValue?.response?.data)&&l.modelValue?.response?.data[0]?.state===`running`?(h(),o(`span`,gt,` - (`+r(l.$t(`veo.status.processing`))+`) `,1)):a(``,!0)])):a(``,!0)]),l.modelValue?.response?.success===!0&&l.modelValue?.response?.data?(h(),o(`div`,_t,[l.modelValue?.response?.data[0]?.video_url?(h(),o(`div`,vt,[i(x,{src:l.modelValue?.response?.data[0]?.video_url},null,8,[`src`])])):a(``,!0),l.modelValue?.response.success?(h(),o(`div`,yt,[i(C,{class:`box-item`,effect:`dark`,content:l.$t(`veo.message.downloadVideo`),placement:`top-start`},{default:f(()=>[l.modelValue?.response?.data[0]?.video_url?(h(),d(S,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:u[0]||=e=>l.onDownload(e,l.modelValue?.response?.data[0]?.video_url)},{default:f(()=>[n(r(l.$t(`veo.button.download`)),1)]),_:1})):a(``,!0)]),_:1},8,[`content`]),i(w,{path:`/veo/videos`,body:l.modelValue?.request},null,8,[`body`])])):a(``,!0)])):a(``,!0),l.modelValue?.response?.success===!1?(h(),o(`div`,bt,[i(O,{closable:!1,class:`failure`},{template:f(()=>[i(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.failure`)),1)]),default:f(()=>[e(`p`,xt,[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.failureReason`))+`: `+r(l.modelValue?.response?.error?.message)+` `,1),i(D,{content:l.modelValue?.response?.error?.message},null,8,[`content`])])]),_:1})])):a(``,!0),e(`div`,St,[i(O,{closable:!1,class:t([`mt-2`,`task-metadata`,l.taskInfoClass])},{default:f(()=>[l.modelValue?.request?.model?(h(),o(`p`,Ct,[i(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.model`))+`: `+r(l.modelValue?.request?.model),1)])):a(``,!0),e(`p`,wt,[i(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.action`))+`: `+r(l.actionLabel),1)]),l.modelValue?.request?.aspect_ratio?(h(),o(`p`,Tt,[i(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.ratio`))+`: `+r(l.modelValue?.request?.aspect_ratio),1)])):a(``,!0),l.modelValue?.request?.translation===void 0?a(``,!0):(h(),o(`p`,Et,[i(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.translation`))+`: `+r(l.$t(l.modelValue?.request?.translation?`seedance.button.on`:`seedance.button.off`)),1)])),e(`p`,$,[i(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.taskId`))+`: `+r(l.modelValue?.id)+` `,1),i(D,{content:l.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),l.modelValue?.elapsed?(h(),o(`p`,Dt,[i(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.elapsed`))+`: `+r(l.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0),l.traceId?(h(),o(`p`,Ot,[i(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(l.$t(`veo.name.traceId`))+`: `+r(l.traceId)+` `,1),i(D,{content:l.traceId,class:`btn-copy inline-block`},null,8,[`content`])])):a(``,!0)]),_:1},8,[`class`])])])])}var At=_({name:`RecentPanel`,components:{TaskPreview:V(ot,[[`render`,kt],[`__scopeId`,`data-v-54ddb667`]]),NoTasks:le,BotPlaceholder:pe,ScrollList:ce},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.veo?.tasks,items:this.$store.state.veo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),jt={key:0},Mt={key:2,class:`w-full h-full flex items-center justify-center`};function Nt(e,t,n,r,l,u){let p=c(`bot-placeholder`),g=c(`task-preview`),_=c(`scroll-list`),v=c(`no-tasks`);return h(),o(s,null,[e.tasks?.items===void 0?(h(),o(`div`,jt,[i(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),d(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:f(()=>[(h(!0),o(s,null,m(e.tasks?.items,(e,t)=>(h(),d(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(h(),o(`div`,Mt,[i(v)])):a(``,!0)],64)}var Pt=_({name:`VeoIndex`,components:{ConfigPanel:at,Layout:ye,RecentPanel:V(At,[[`render`,Nt]])},mixins:[U],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.veo?.status?.getApplications===G.Request},tasksLoading(){return this.$store.state.veo?.status?.getTasks===G.Request||this.fetchingTasks},credential(){return this.$store.state.veo.credential},config(){return this.$store.state.veo.config},tasks(){return this.$store.state.veo.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ue({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`veo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`veo/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`veo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!oe(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let e=xe(this.config);if(!re())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}if((e.action===`image2video`||e.action===`ingredients2video`)&&!(e.image_urls&&e.image_urls.length>0)){K.warning(this.$t(`veo.message.imageRequired`));return}K.info(this.$t(`veo.message.startingTask`)),q(`veo`,ie.generate(e,{token:t})).then(()=>{K.success(this.$t(`veo.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?K.error(this.$t(`veo.message.usedUp`)):K.error(this.$t(`veo.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Ft(e,t,n,r,a,o){let s=c(`config-panel`),l=c(`recent-panel`),u=c(`layout`);return h(),d(u,null,{config:f(()=>[i(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:f(()=>[i(l,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var It=V(Pt,[[`render`,Ft]]);export{It as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,ht as d,j as f,mt as p,ot as m,rt as h,st as ee,tt as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-lY0v4ivH.js";import{t as y}from"./checkbox-DLvBiGkW.js";import{t as b}from"./drawer-BRlhyO2f.js";import{n as x,r as S,t as C}from"./dropdown--4Kz-O3Z.js";import{t as w}from"./popover-BXPh_Wf1.js";import{n as T,t as E}from"./skeleton-BVbQKb45.js";import{t as te}from"./arrow-right-D1dwtIHN.js";import{t as D}from"./arrow-up-C9s3Onj2.js";import{t as ne}from"./brain-Ds44jfN1.js";import{t as O}from"./check-Qny-uyrr.js";import{t as re}from"./chevron-down-46IMn-jW.js";import{n as k,t as ie}from"./CodeSnippet-DnplS-Fe.js";import{t as A}from"./CopyToClipboard-CUgv3RMH.js";import{t as ae}from"./eye-BX2KPnL-.js";import{t as oe}from"./file-text-DtKLSP1U.js";import{n as j,t as se}from"./shield-DcVg8xdQ.js";import{t as ce}from"./folder-B9TdcZND.js";import{t as M}from"./gauge-BBYQ7PAj.js";import{t as N}from"./history-DutXEvuA.js";import{t as P}from"./info-DWMxOY1R.js";import{t as F}from"./laptop-BQV_oPNN.js";import{t as I}from"./link-DJsSOAFe.js";import{t as L}from"./loader-circle-CXGHDBnc.js";import{i as le,n as R,t as ue}from"./AskUserQuestionCard-N8gAyjLm.js";import{t as de}from"./paperclip-eHxMMxoy.js";import{t as z}from"./pencil-DQx_4fLE.js";import{t as B}from"./plus-JexWBv_b.js";import{t as V}from"./rotate-cw-DzB0xHcL.js";import{t as fe}from"./search-C3rM1tn3.js";import{t as pe}from"./square-Ckzuv0XE.js";import{t as me}from"./terminal-DA-lRaos.js";import{t as he}from"./trash-2-EtzbCDwL.js";import{Ai as H,E as U,Ht as ge,Kt as _e,ei as W,gi as G,hi as ve,mi as K,pi as q,ri as ye,ui as be,xi as J,zi as Y}from"./index-BL0bUCVy.js";import"./vendor-highlight-BtIeKitL.js";import{s as xe,t as Se}from"./codingBridgeNotify-BG6cDZ9i.js";var Ce=K(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),we=K(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Te=K(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ee=_({name:`CodingBridgeNotificationToggle`,components:{LoadingIcon:L,NotificationIcon:we,NotificationOffIcon:Ce,ElButton:H},data(){return{enabled:!1,busy:!1}},computed:{supported(){return be()||xe()}},mounted(){this.enabled=!be()&&Se()===`granted`},methods:{async onToggle(){this.busy=!0;try{if(this.enabled){await this.$store.dispatch(`codingBridge/disableNotifications`),this.enabled=!1,G.success(this.$t(`codingBridge.notify.disabled`));return}let e=await this.$store.dispatch(`codingBridge/enableNotifications`);e===`enabled`?(this.enabled=!0,G.success(this.$t(`codingBridge.notify.enabled`))):e===`denied`?G.warning(this.$t(`codingBridge.notify.denied`)):G.warning(this.$t(`codingBridge.notify.unsupported`))}catch{G.error(this.$t(`codingBridge.notify.failed`))}finally{this.busy=!1}}}});function De(e,t,n,r,i,a){let s=u(`loading-icon`),c=u(`notification-icon`),l=u(`notification-off-icon`),d=u(`el-button`);return e.supported?(g(),f(d,{key:0,circle:``,size:`small`,type:e.enabled?`primary`:`default`,title:e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),disabled:e.busy,"aria-label":e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),onClick:e.onToggle},{default:p(()=>[e.busy?(g(),f(s,{key:0,class:`adc-icon-spin`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):e.enabled?(g(),f(c,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),f(l,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`type`,`title`,`disabled`,`aria-label`,`onClick`])):o(``,!0)}var Oe=_({name:`CodingBridgeNodeList`,components:{AddIcon:B,DeleteIcon:he,DesktopIcon:le,DeveloperIcon:F,RedoIcon:V,ElButton:H,NotificationToggle:U(Ee,[[`render`,De]])},emits:[`pair`],computed:{nodes(){return this.$store.state.codingBridge?.nodes??[]},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},connection(){return this.$store.state.codingBridge?.connection??`disconnected`},connectionLabel(){return this.$t(`codingBridge.connection.${this.connection}`)},connectionDotClass(){switch(this.connection){case`connected`:return`bg-[var(--el-color-success)]`;case`connecting`:return`bg-[var(--el-color-warning)]`;case`error`:return`bg-[var(--el-color-danger)]`;default:return`bg-[var(--app-text-subtle)]`}}},methods:{onSelect(e){this.$store.dispatch(`codingBridge/selectNode`,e)},onRefresh(){this.$store.dispatch(`codingBridge/getNodes`)},async onDelete(e){try{await ve.confirm(this.$t(`codingBridge.nodeList.removeConfirm`,{name:e.name}),this.$t(`codingBridge.nodeList.remove`),{confirmButtonText:this.$t(`codingBridge.nodeList.remove`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`})}catch{return}try{await this.$store.dispatch(`codingBridge/deleteNode`,e.node_id),G.success(this.$t(`codingBridge.nodeList.removeSuccess`))}catch{G.error(this.$t(`codingBridge.nodeList.removeFailed`))}}}}),ke={class:`node-list flex flex-col h-full bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ae={class:`flex items-center justify-between px-4 py-3 border-b border-[var(--app-border-subtle)]`},je={class:`flex items-center gap-2 font-medium`},Me={class:`flex items-center gap-1`},Ne={class:`flex items-center gap-2 px-4 py-2 text-xs border-b border-[var(--app-border-subtle)]`},Pe={class:`text-[var(--app-text-subtle)]`},Fe={class:`flex-1 overflow-y-auto`},Ie={key:0,class:`p-6 text-center text-sm text-[var(--app-text-subtle)]`},Le={class:`mb-3`},Re={key:1,class:`list-none m-0 p-0`},ze=[`onClick`],Be={class:`flex-1 min-w-0`},Ve={class:`flex items-center gap-2`},He={class:`truncate font-medium`},Ue=[`title`],We={class:`text-xs text-[var(--app-text-subtle)] truncate`};function Ge(o,c,d,f,m,ee){let _=u(`developer-icon`),v=u(`notification-toggle`),y=u(`redo-icon`),b=u(`el-button`),x=u(`add-icon`),S=u(`desktop-icon`),C=u(`delete-icon`);return g(),s(`div`,ke,[e(`div`,Ae,[e(`div`,je,[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(o.$t(`codingBridge.nodeList.title`)),1)]),e(`div`,Me,[a(v),a(b,{circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.refresh`),title:o.$t(`codingBridge.nodeList.refresh`),onClick:o.onRefresh},{default:p(()=>[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`]),a(b,{type:`primary`,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.pair`),title:o.$t(`codingBridge.nodeList.pair`),onClick:c[0]||=e=>o.$emit(`pair`)},{default:p(()=>[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])])]),e(`div`,Ne,[e(`span`,{class:n([`inline-block w-2 h-2 rounded-full`,o.connectionDotClass])},null,2),e(`span`,Pe,i(o.connectionLabel),1)]),e(`div`,Fe,[o.nodes.length?(g(),s(`ul`,Re,[(g(!0),s(l,null,h(o.nodes,r=>(g(),s(`li`,{key:r.node_id,class:n([`group flex items-center gap-3 px-4 py-3 cursor-pointer border-b border-[var(--app-border-subtle)] hover:bg-[var(--app-content-bg)]`,{"bg-[var(--app-content-bg)]":r.node_id===o.currentNodeId}]),onClick:e=>o.onSelect(r.node_id)},[a(S,{class:`text-[var(--app-text-subtle)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`div`,Be,[e(`div`,Ve,[e(`span`,He,i(r.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,r.status===`online`?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`]),title:r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)},null,10,Ue)]),e(`div`,We,i(r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)),1)]),a(b,{class:`opacity-0 group-hover:opacity-100`,text:``,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.remove`),title:o.$t(`codingBridge.nodeList.remove`),onClick:t(e=>o.onDelete(r),[`stop`])},{default:p(()=>[a(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])],10,ze))),128))])):(g(),s(`div`,Ie,[e(`p`,Le,i(o.$t(`codingBridge.nodeList.empty`)),1),a(b,{type:`primary`,round:``,size:`small`,onClick:c[1]||=e=>o.$emit(`pair`)},{default:p(()=>[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`codingBridge.nodeList.pairFirst`)),1)]),_:1})]))])])}var Ke=U(Oe,[[`render`,Ge]]),qe=e=>{let t=e?.questions;return Array.isArray(t)&&t.length>0&&t.every(e=>e&&typeof e.question==`string`&&Array.isArray(e.options))},Je=e=>e?(e.tool||``).toLowerCase()===`askuserquestion`?!0:qe(e.input):!1,Ye=e=>({questions:e.input?.questions??[]}),Xe=100,X=4e4,Ze=12e3,Z=6e3,Q=(e,t)=>{if(e.length<=t)return e;let n=((e.length-t)/1024).toFixed(1);return`${e.slice(0,t)}\n\n··· +${n} KB ···`},Qe=_({name:`CodingBridgeTranscriptItem`,directives:{highlight:_e},components:{CloseIcon:q,ConfirmIcon:O,EditIcon:z,FileIcon:j,InfoIcon:P,VueMarkdown:R,CodeSnippet:ie,CopyToClipboard:A},props:{event:{type:Object,required:!0},editable:{type:Boolean,default:!1}},emits:[`edit`],data(){return{renderedText:Q(this.event.text||``,X),streamTimer:0}},computed:{commandText(){let e=this.event.input;if(!e)return``;for(let t of[`command`,`cmd`,`script`]){let n=e[t];if(typeof n==`string`&&n.trim())return Q(n,Z)}return``},filePath(){let e=this.event.input;if(!e)return``;for(let t of[`file_path`,`filePath`,`path`,`notebook_path`,`filename`]){let n=e[t];if(typeof n==`string`&&n.trim())return n}return``},toolDescription(){let e=this.event.input?.description;return typeof e==`string`?e:``},toolIcon(){if(this.commandText)return me;let e=(this.event.tool??``).toLowerCase();return/read|cat|view/.test(e)?oe:/write|edit|create|update|insert/.test(e)?z:/grep|glob|search|find|list/.test(e)?fe:k},questionLines(){let e=(this.event.tool??``).toLowerCase(),t=this.event.input?.questions;return!(e===`askuserquestion`||Array.isArray(t))||!Array.isArray(t)?[]:t.filter(e=>e&&typeof e.question==`string`).map(e=>({header:typeof e.header==`string`?e.header:``,question:e.question}))},inputText(){let e=this.event.input;if(!e)return``;let t={};for(let[n,r]of Object.entries(e))n===`timeout`||n===`description`||(t[n]=r);if(Object.keys(t).length===0)return``;try{return Q(JSON.stringify(t,null,2),Z)}catch{return Q(String(e),Z)}},thinkingText(){return Q(this.event.text||``,X)},resultText(){let e=this.event.content;return typeof e==`string`&&e.length>0?e:`—`},resultDisplay(){return Q(this.resultText,Ze)},resultLabel(){let e=[];return this.event.is_error?e.push(this.$t(`codingBridge.transcript.turnFailed`)):e.push(this.$t(`codingBridge.transcript.turnDone`)),typeof this.event.cost_usd==`number`&&this.event.cost_usd>0&&e.push(`$${this.event.cost_usd.toFixed(4)}`),e.join(` · `)},hasAttachments(){return!!this.event.attachments?.length},noticeText(){let e=this.event.subtype,t=this.event.command;if(t){if(e===`slash_unavailable`)return this.$t(`codingBridge.notice.slashUnavailable`,{command:t});if(e===`slash_codex_unsupported`)return this.$t(`codingBridge.notice.slashCodexUnsupported`,{command:t})}return this.event.text||``}},watch:{"event.text"(){this.scheduleRender()},"event.streaming"(e){e||this.flushRender()}},beforeUnmount(){this.streamTimer&&window.clearTimeout(this.streamTimer)},methods:{scheduleRender(){if(!this.event.streaming){this.flushRender();return}this.streamTimer||=window.setTimeout(()=>{this.streamTimer=0,this.renderedText=Q(this.event.text||``,X)},Xe)},flushRender(){this.streamTimer&&=(window.clearTimeout(this.streamTimer),0),this.renderedText=Q(this.event.text||``,X)}}}),$e={key:0,class:`group flex items-end justify-end gap-1.5`},et=[`title`,`aria-label`],tt={class:`max-w-[85%] rounded-lg px-3 py-2 bg-[var(--el-color-primary)] text-white whitespace-pre-wrap break-words`},nt=[`src`],rt=[`href`],it=[`src`],at={key:1,class:`flex h-9 w-9 items-center justify-center rounded bg-white/15`},ot={class:`min-w-0 truncate`},st={key:2},ct={key:2,class:`whitespace-pre-wrap break-words italic text-[var(--app-text-subtle)] border-l-2 border-[var(--app-border-subtle)] pl-3`},lt={key:3,class:`overflow-hidden rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)]`},ut={class:`flex items-center gap-2 px-2.5 py-1.5 font-medium text-[var(--app-text-subtle)]`},dt={key:0,class:`min-w-0 truncate text-xs font-normal opacity-70`},ft={key:0,class:`flex flex-col gap-1.5 px-2.5 pb-2`},pt={key:0,class:`font-medium text-[var(--app-text)]`},mt={class:`whitespace-pre-wrap break-words text-[var(--app-text-subtle)]`},ht={key:1,class:`px-2.5 pb-2`},gt={key:2,class:`px-2.5 pb-2 font-mono text-xs break-all text-[var(--app-text-subtle)]`},_t={key:3,class:`px-2.5 pb-2`},vt={key:0,class:`absolute right-1.5 top-1.5 z-10 rounded bg-[var(--app-content-bg)] px-1 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`},yt={key:5,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)]`},bt={key:6,class:`flex items-start gap-2 rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)] text-[var(--app-text-subtle)] px-3 py-2 text-xs`},xt={class:`whitespace-pre-wrap break-words`},St={key:7,class:`rounded-md bg-[var(--el-color-danger-light-9)] text-[var(--el-color-danger)] px-3 py-2 whitespace-pre-wrap break-words`};function Ct(t,r,c,p,_,v){let y=u(`edit-icon`),b=u(`file-icon`),x=u(`vue-markdown`),S=u(`code-snippet`),C=u(`copy-to-clipboard`),w=u(`close-icon`),T=u(`confirm-icon`),E=u(`info-icon`),te=m(`highlight`);return g(),s(`div`,{class:n([`transcript-item text-sm leading-relaxed`,`kind-${t.event.kind}`])},[t.event.kind===`prompt`?(g(),s(`div`,$e,[t.editable?(g(),s(`button`,{key:0,type:`button`,class:`cb-edit-btn opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100`,title:t.$t(`codingBridge.session.editPrompt`),"aria-label":t.$t(`codingBridge.session.editPrompt`),onClick:r[0]||=e=>t.$emit(`edit`,t.event)},[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,et)):o(``,!0),e(`div`,tt,[t.event.images&&t.event.images.length?(g(),s(`div`,{key:0,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text||t.hasAttachments}])},[(g(!0),s(l,null,h(t.event.images,(e,t)=>(g(),s(`img`,{key:t,src:e,class:`w-16 h-16 rounded object-cover`,alt:``},null,8,nt))),128))],2)):o(``,!0),t.hasAttachments?(g(),s(`div`,{key:1,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text}])},[(g(!0),s(l,null,h(t.event.attachments,(t,n)=>(g(),s(`a`,{key:`${t.url}-${n}`,href:t.url,target:`_blank`,rel:`noopener noreferrer`,class:`flex max-w-[220px] items-center gap-2 rounded-md bg-white/15 px-2 py-1.5 text-xs text-white hover:bg-white/20`},[t.type===`image`?(g(),s(`img`,{key:0,src:t.url,class:`h-9 w-9 rounded object-cover`,alt:``},null,8,it)):(g(),s(`span`,at,[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,ot,i(t.name||t.url),1)],8,rt))),128))],2)):o(``,!0),t.event.text?(g(),s(`span`,st,i(t.event.text),1)):o(``,!0)])])):t.event.kind===`text`?(g(),s(`div`,{key:1,class:n([`cb-stream-text`,{"is-streaming":t.event.streaming}])},[d(a(x,{source:t.renderedText,class:`markdown-body bg-transparent text-[var(--app-text)]`},null,8,[`source`]),[[te]])],2)):t.event.kind===`thinking`?(g(),s(`div`,ct,i(t.thinkingText),1)):t.event.kind===`tool_use`?(g(),s(`div`,lt,[e(`div`,ut,[(g(),f(ee(t.toolIcon),{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.event.tool),1),t.toolDescription?(g(),s(`span`,dt,i(t.toolDescription),1)):o(``,!0)]),t.questionLines.length?(g(),s(`div`,ft,[(g(!0),s(l,null,h(t.questionLines,(t,n)=>(g(),s(`div`,{key:n,class:`rounded border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-2.5 py-1.5 text-xs`},[t.header?(g(),s(`div`,pt,i(t.header),1)):o(``,!0),e(`div`,mt,i(t.question),1)]))),128))])):t.commandText?(g(),s(`div`,ht,[a(S,{code:t.commandText,lang:`bash`,copyable:``},null,8,[`code`])])):t.filePath?(g(),s(`div`,gt,i(t.filePath),1)):t.inputText?(g(),s(`div`,_t,[a(S,{code:t.inputText,lang:`json`,copyable:``},null,8,[`code`])])):o(``,!0)])):t.event.kind===`tool_result`?(g(),s(`div`,{key:4,class:n([`group relative overflow-hidden rounded-md`,t.event.is_error?`bg-[var(--el-color-danger-light-9)]`:`bg-[var(--app-sidebar-bg)]`])},[t.event.content?(g(),s(`div`,vt,[a(C,{content:t.resultText},null,8,[`content`])])):o(``,!0),e(`pre`,{class:n([`m-0 max-h-72 overflow-auto whitespace-pre-wrap break-words px-2.5 py-2 font-mono text-xs`,t.event.is_error?`text-[var(--el-color-danger)]`:`text-[var(--app-text-subtle)]`])},i(t.resultDisplay),3)],2)):t.event.kind===`result`?(g(),s(`div`,yt,[t.event.is_error?(g(),f(w,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),f(T,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.resultLabel),1)])):t.event.kind===`notice`?(g(),s(`div`,bt,[a(E,{class:`mt-0.5 flex-none text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,xt,i(t.noticeText),1)])):t.event.kind===`error`?(g(),s(`div`,St,i(t.event.text),1)):o(``,!0)],2)}var wt=U(Qe,[[`render`,Ct],[`__scopeId`,`data-v-2028b19a`]]),Tt=`Pondering.Noodling.Conjuring.Brewing.Cooking.Crafting.Churning.Simmering.Percolating.Ruminating.Musing.Marinating.Synthesizing.Computing.Hatching.Forging.Vibing.Working.Thinking.Cogitating.Mulling.Stewing.Tinkering.Wrangling.Spinning.Reticulating.Manifesting.Deliberating`.split(`.`),Et=[`思考中`,`酝酿中`,`沉思中`,`推敲中`,`构思中`,`计算中`,`琢磨中`,`捣鼓中`,`炼制中`,`召唤中`,`编织中`,`烹饪中`,`咀嚼中`,`盘算中`,`发酵中`,`运转中`,`冥想中`,`鼓捣中`,`熬制中`,`神游中`,`演算中`,`雕琢中`,`头脑风暴中`,`反复斟酌中`],Dt=60,Ot=1500,kt=28,At=_({name:`CodingBridgeThinkingIndicator`,components:{LoadingIcon:L},data(){return{display:``,elapsed:0,charIndex:0,phase:`typing`,currentWord:``,elapsedTimer:0,typeTimer:0}},computed:{words(){return this.$i18n.locale.startsWith(`zh`)?Et:Tt}},mounted(){this.currentWord=this.pickWord(),this.elapsedTimer=window.setInterval(()=>{this.elapsed+=1},1e3),this.scheduleType(Dt)},beforeUnmount(){window.clearInterval(this.elapsedTimer),window.clearTimeout(this.typeTimer)},methods:{pickWord(){let e=this.words;if(e.length<=1)return e[0]??``;let t=this.currentWord;for(;t===this.currentWord;)t=e[Math.floor(Math.random()*e.length)];return t},scheduleType(e){this.typeTimer=window.setTimeout(this.advance,e)},advance(){let e=this.currentWord;this.phase===`typing`?(this.charIndex+=1,this.display=e.slice(0,this.charIndex),this.charIndex>=e.length?(this.phase=`holding`,this.scheduleType(Ot)):this.scheduleType(Dt)):this.phase===`holding`?(this.phase=`deleting`,this.scheduleType(kt)):(--this.charIndex,this.display=e.slice(0,Math.max(0,this.charIndex)),this.charIndex<=0?(this.currentWord=this.pickWord(),this.phase=`typing`,this.scheduleType(Dt)):this.scheduleType(kt))}}}),jt={class:`cb-thinking flex items-center gap-2 text-sm text-[var(--app-text-subtle)] py-1`},Mt={class:`cb-thinking__word`},Nt={class:`cb-thinking__elapsed tabular-nums opacity-60`};function Pt(t,n,o,c,l,d){let f=u(`loading-icon`);return g(),s(`div`,jt,[a(f,{class:`cb-thinking__spinner adc-icon-spin text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Mt,[r(i(t.display),1),n[0]||=e(`span`,{class:`cb-thinking__caret`},`▋`,-1)]),e(`span`,Nt,`(`+i(t.elapsed)+`s)`,1)])}var Ft=U(At,[[`render`,Pt],[`__scopeId`,`data-v-ae116215`]]),It=_({name:`CodingBridgeDirectoryDialog`,components:{ContinueIcon:te,FileIcon:j,FolderIcon:ce,RedoIcon:V,UpIcon:D,ElDialog:J,ElButton:H,ElInput:Y},props:{visible:{type:Boolean,default:!1},initialPath:{type:String,default:``}},emits:[`update:visible`,`select`],data(){return{pathInput:``}},computed:{listing(){return this.$store.state.codingBridge?.directory},loading(){return this.$store.state.codingBridge?.directoryLoading===!0},directories(){return(this.listing?.entries??[]).filter(e=>e.type===`dir`)},files(){return(this.listing?.entries??[]).filter(e=>e.type===`file`)},isEmpty(){return!!this.listing&&!this.listing.error&&(this.listing.entries??[]).length===0}},watch:{"listing.path"(e){this.pathInput=e??``}},methods:{onOpen(){this.pathInput=this.initialPath||``,this.$store.dispatch(`codingBridge/browseDir`,this.initialPath||void 0)},goPath(){let e=this.pathInput.trim();e&&this.$store.dispatch(`codingBridge/browseDir`,e)},syncPathInput(){this.pathInput=this.listing?.path??``},onVisibleChange(e){this.$emit(`update:visible`,e),e||this.$store.dispatch(`codingBridge/clearDirectory`)},openDir(e){this.$store.dispatch(`codingBridge/browseDir`,e)},goParent(){this.listing?.parent&&this.$store.dispatch(`codingBridge/browseDir`,this.listing.parent)},refresh(){this.$store.dispatch(`codingBridge/browseDir`,this.listing?.path||this.initialPath||void 0)},chooseCurrent(){this.listing&&!this.listing.error&&(this.$emit(`select`,this.listing.path),this.onVisibleChange(!1))}}}),Lt={class:`flex flex-col gap-2`},Rt={class:`flex items-center gap-2 min-w-0`},zt={class:`h-72 overflow-y-auto border border-[var(--app-border-subtle)] rounded-md divide-y divide-[var(--app-border-subtle)]`},Bt={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)]`},Vt={key:1,class:`h-full flex items-center justify-center text-sm text-[var(--el-color-danger)]`},Ht=[`onClick`],Ut={class:`truncate`,dir:`ltr`},Wt={class:`truncate`,dir:`ltr`},Gt={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)] py-8`},Kt={key:0,class:`text-[11px] text-[var(--app-text-subtle)] px-1`},qt={class:`flex items-center justify-end gap-2`};function Jt(t,d,m,ee,_,v){let y=u(`up-icon`),b=u(`el-button`),x=u(`continue-icon`),S=u(`el-input`),C=u(`redo-icon`),w=u(`folder-icon`),T=u(`file-icon`),E=u(`el-dialog`);return g(),f(E,{"model-value":t.visible,title:t.$t(`codingBridge.directory.title`),width:`520px`,"append-to-body":``,"onUpdate:modelValue":t.onVisibleChange,onOpen:t.onOpen},{footer:p(()=>[e(`div`,qt,[a(b,{round:``,onClick:d[1]||=e=>t.onVisibleChange(!1)},{default:p(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1}),a(b,{type:`primary`,round:``,disabled:!t.listing||!!t.listing.error,onClick:t.chooseCurrent},{default:p(()=>[r(i(t.$t(`codingBridge.directory.choose`)),1)]),_:1},8,[`disabled`,`onClick`])])]),default:p(()=>[e(`div`,Lt,[e(`div`,Rt,[a(b,{size:`small`,circle:``,disabled:!t.listing||!t.listing.parent||t.loading,title:t.$t(`codingBridge.directory.up`),"aria-label":t.$t(`codingBridge.directory.up`),onClick:t.goParent},{default:p(()=>[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`]),a(S,{modelValue:t.pathInput,"onUpdate:modelValue":d[0]||=e=>t.pathInput=e,size:`small`,class:`flex-1 min-w-0`,dir:`ltr`,placeholder:t.$t(`codingBridge.directory.pathPlaceholder`),disabled:t.loading,onKeyup:c(t.goPath,[`enter`]),onBlur:t.syncPathInput},{append:p(()=>[a(b,{title:t.$t(`codingBridge.directory.go`),disabled:t.loading||!t.pathInput.trim(),"aria-label":t.$t(`codingBridge.directory.go`),onClick:t.goPath},{default:p(()=>[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`title`,`disabled`,`aria-label`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`disabled`,`onKeyup`,`onBlur`]),a(b,{size:`small`,circle:``,disabled:t.loading,title:t.$t(`codingBridge.directory.refresh`),"aria-label":t.$t(`codingBridge.directory.refresh`),onClick:t.refresh},{default:p(()=>[a(C,{class:n({"adc-icon-spin":t.loading}),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`])]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`])]),e(`div`,zt,[t.loading&&!t.listing?(g(),s(`div`,Bt,i(t.$t(`codingBridge.directory.loading`)),1)):t.listing&&t.listing.error?(g(),s(`div`,Vt,i(t.listing.error),1)):(g(),s(l,{key:2},[(g(!0),s(l,null,h(t.directories,n=>(g(),s(`button`,{key:n.path,type:`button`,class:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[var(--app-content-hover-bg)]`,onClick:e=>t.openDir(n.path)},[a(w,{class:`text-[var(--el-color-warning)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Ut,i(n.name),1)],8,Ht))),128)),(g(!0),s(l,null,h(t.files,t=>(g(),s(`div`,{key:t.path,class:`w-full flex items-center gap-2 px-3 py-2 text-sm text-[var(--app-text-subtle)]`},[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Wt,i(t.name),1)]))),128)),t.isEmpty?(g(),s(`div`,Gt,i(t.$t(`codingBridge.directory.empty`)),1)):o(``,!0)],64))]),t.listing&&t.listing.truncated?(g(),s(`p`,Kt,i(t.$t(`codingBridge.directory.truncated`)),1)):o(``,!0)])]),_:1},8,[`model-value`,`title`,`onUpdate:modelValue`,`onOpen`])}var Yt=U(It,[[`render`,Jt]]),Xt=`data:image/svg+xml,%3csvg%20fill='%23D97757'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='m4.7144%2015.9555%204.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608%201.5179.1032%202.2767.1578%201.6514.0972%202.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973%209.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686%201.9064%201.4754%202.4893%201.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335%206.6997%200l.9957.1336.419.3642.6192%201.4147%201.0018%202.2282%201.5543%203.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853%201.8517-.5586%202.9021-.3643%201.9429h.2125l.2429-.2429.9835-1.3053%201.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759%201.1293-.34%201.1657-1.0625%201.3478-.8804%201.1414-1.2628%201.7-.7893%201.36.0729.1093.1882-.0183%202.8535-.607%201.5421-.2794%201.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607%201.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929%201.0686%202.0035%201.8092%202.5075%202.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496%202.3436%203.5214.1214%201.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38%2017.959l-1.1414-1.9428-.1397.079-.674%207.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328%201.9672-2.1796%202.9446-1.7243%201.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889%202.386-3.0357%201.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385%204.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429%201.9064-1.3114Z'/%3e%3c/svg%3e`,Zt=`data:image/svg+xml,%3csvg%20fill='%23000000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.676l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v2.999l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e`,Qt=`data:image/svg+xml,%3csvg%20fill='%23000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%20Copilot%3c/title%3e%3cpath%20d='M23.922%2016.997C23.061%2018.492%2018.063%2022.02%2012%2022.02%205.937%2022.02.939%2018.492.078%2016.997A.641.641%200%200%201%200%2016.741v-2.869a.883.883%200%200%201%20.053-.22c.372-.935%201.347-2.292%202.605-2.656.167-.429.414-1.055.644-1.517a10.098%2010.098%200%200%201-.052-1.086c0-1.331.282-2.499%201.132-3.368.397-.406.89-.717%201.474-.952C7.255%202.937%209.248%201.98%2011.978%201.98c2.731%200%204.767.957%206.166%202.093.584.235%201.077.546%201.474.952.85.869%201.132%202.037%201.132%203.368%200%20.368-.014.733-.052%201.086.23.462.477%201.088.644%201.517%201.258.364%202.233%201.721%202.605%202.656a.841.841%200%200%201%20.053.22v2.869a.641.641%200%200%201-.078.256Zm-11.75-5.992h-.344a4.359%204.359%200%200%201-.355.508c-.77.947-1.918%201.492-3.508%201.492-1.725%200-2.989-.359-3.782-1.259a2.137%202.137%200%200%201-.085-.104L4%2011.746v6.585c1.435.779%204.514%202.179%208%202.179%203.486%200%206.565-1.4%208-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057%201.259-3.782%201.259-1.59%200-2.738-.545-3.508-1.492a4.359%204.359%200%200%201-.355-.508Zm2.328%203.25c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm-5%200c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm3.313-6.185c.136%201.057.403%201.913.878%202.497.442.544%201.134.938%202.344.938%201.573%200%202.292-.337%202.657-.751.384-.435.558-1.15.558-2.361%200-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438%201.578v.021c0%20.265.021.562.063.893Zm-1.626%200c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824%201.025-.462.472-.705%201.179-.705%202.319%200%201.211.175%201.926.558%202.361.365.414%201.084.751%202.657.751%201.21%200%201.902-.394%202.344-.938.475-.584.742-1.44.878-2.497Z'/%3e%3c/svg%3e`,$t=50*1024*1024,$=10,en=60,tn=60,nn={claude:{src:Xt,invertOnDark:!1},codex:{src:Zt,invertOnDark:!0},copilot:{src:Qt,invertOnDark:!0}},rn=_({name:`CodingBridgeSessionView`,components:{AddIcon:B,AiIcon:ne,AttachmentIcon:de,CloseIcon:q,CodeIcon:k,ConfirmIcon:O,DeveloperIcon:F,EditIcon:z,ExpandDownIcon:re,FileIcon:j,FolderOpenIcon:Te,HistoryIcon:N,PerformanceIcon:M,RedoIcon:V,SecurityIcon:se,StopIcon:pe,UpIcon:D,ViewIcon:ae,ElInput:Y,ElButton:H,ElPopover:w,ElDropdown:C,ElDropdownMenu:S,ElDropdownItem:x,ElUpload:v,ElCheckbox:y,ElSkeleton:E,ElSkeletonItem:T,TranscriptItem:wt,ThinkingIndicator:Ft,DirectoryDialog:Yt,AskUserQuestionCard:ue,CopyToClipboard:A},mixins:[ge],emits:[`history`,`devices`],data(){return{prompt:``,cwd:``,model:``,customModelDraft:``,permissionMode:`bypassPermissions`,provider:`claude`,effort:``,directoryVisible:!1,slashMenuOpen:!1,slashActiveIndex:0,editingEventId:``,restoreCode:!1,attachmentFileList:[],uploadUrl:ye()+`/api/v1/files/`,maxAttachments:$,visibleCount:en}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},lastComposer(){let e=this.currentNodeId;return(e?this.$store.state.codingBridge?.lastComposer?.[e]:void 0)??{}},currentNode(){return this.$store.state.codingBridge?.nodes?.find(e=>e.node_id===this.currentNodeId)},nodeOnline(){return this.currentNode?.status===`online`},currentSessionId(){return this.$store.state.codingBridge?.currentSessionId},currentSession(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.sessions?.[e]:void 0},events(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.events?.[e]??[]:[]},visibleEvents(){let e=this.events;return e.length>this.visibleCount?e.slice(-this.visibleCount):e},hiddenEventCount(){return Math.max(0,this.events.length-this.visibleCount)},historyLoading(){return this.$store.state.codingBridge?.status?.getHistoryDetail===W.Request},pendingQuestion(){let e=this.currentSessionId;if(!e)return;let t=(this.$store.state.codingBridge?.permissions??[]).find(t=>t.session_id===e&&Je(t));return t?{request_id:t.request_id,payload:Ye(t)}:void 0},isNewSession(){return!this.currentSessionId},canPickCwd(){return this.isNewSession||!this.currentSession?.started},readonly(){return this.currentSession?.readonly===!0},resumeHint(){return!!this.currentSession?.provider&&!this.currentSession?.started&&!this.readonly},replayLabel(){return!this.currentSession?.provider||this.currentSession?.started?``:this.currentSession.provider===`codex`?this.$t(`codingBridge.history.codexLabel`):this.currentSession.provider===`claude`?this.$t(`codingBridge.history.claudeLabel`):this.providerName(this.currentSession.provider)},running(){let e=this.currentSession?.status;return e===`running`||e===`starting`},thinking(){return this.running&&!this.pendingQuestion},connected(){return this.$store.state.codingBridge?.connection===`connected`},canRetry(){return this.currentSession?.status===`error`&&!this.readonly&&this.connected&&this.nodeOnline&&this.events.some(e=>e.kind===`prompt`)},attachments(){return(this.attachmentFileList||[]).map(e=>{let t=e.response?.file_url||(typeof e.url==`string`&&!e.url.startsWith(`blob:`)?e.url:``);if(!t)return;let n=e.raw,r=n?.type||e.mime_type||``;return{type:this.isImageAttachment(e)?`image`:`file`,url:t,name:e.name,mime_type:r,size:n?.size}}).filter(e=>!!e)},uploadingAttachments(){return(this.attachmentFileList||[]).some(e=>this.isAttachmentUploading(e))},canSend(){return(!!this.prompt.trim()||this.attachments.length>0)&&!this.uploadingAttachments&&this.connected&&this.nodeOnline},composerHint(){return this.uploadingAttachments?this.$t(`codingBridge.session.uploadingAttachment`):this.providerCaps.length&&!this.currentProviderAvailable?this.$t(`codingBridge.session.providerUnavailableHint`,{name:this.providerName(this.provider)}):this.resumeHint?this.$t(`codingBridge.history.resumeHint`):this.$t(`codingBridge.session.enterHint`)},nodeCapabilities(){let e=this.currentNodeId;return e?this.$store.state.codingBridge?.capabilities?.[e]:void 0},providerCaps(){return this.nodeCapabilities?.providers??[]},currentProviderCap(){return this.providerCaps.find(e=>e.name===this.provider)},canEdit(){return this.readonly?!1:!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_edit},canRestoreCode(){return!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_code_restore},editingActive(){return!!this.editingEventId},currentProviderAvailable(){return this.providerCaps.length?this.currentProviderCap?.available!==!1:!0},providerOptions(){return this.providerCaps.length?this.providerCaps.map(e=>({value:e.name,label:e.label,available:e.available!==!1})):[{label:this.$t(`codingBridge.session.providerClaude`),value:`claude`,available:!0},{label:this.$t(`codingBridge.session.providerCodex`),value:`codex`,available:!0},{label:`GitHub Copilot`,value:`copilot`,available:!0}]},modelOptions(){return this.currentProviderCap?.models??[]},allowCustomModel(){return this.currentProviderCap?.allow_custom_model??!0},effortOptions(){let e=this.currentProviderCap?.efforts;return(e&&e.length?e:[``]).map(e=>({value:e,label:this.effortLabel(e)}))},permissionModeOptions(){let e=this.currentProviderCap?.permission_modes;return(e&&e.length?e:[`default`,`acceptEdits`,`plan`,`bypassPermissions`]).map(e=>({value:e,label:this.permissionModeLabel(e)}))},sessionMeta(){let e=this.currentSession;if(!e)return``;let t=[];return e.provider&&t.push(this.providerName(e.provider)),e.cwd&&t.push(e.cwd),e.model&&t.push(e.model),t.join(` · `)},activeProviderName(){return this.currentSession?.provider||this.provider},slashCommands(){let e=this.activeProviderName;return this.providerCaps.find(t=>t.name===e)?.commands??[]},slashMatches(){let e=this.prompt.match(/^\/(\S*)$/);if(!e)return[];let t=e[1].toLowerCase();return this.slashCommands.filter(e=>[e.name,...e.aliases??[]].some(e=>e.toLowerCase().startsWith(t)))},slashMenuVisible(){return this.slashMenuOpen&&this.slashMatches.length>0},diagnostics(){let e=[];return this.currentNodeId&&e.push({label:this.$t(`codingBridge.session.nodeId`),value:this.currentNodeId}),this.currentSessionId&&e.push({label:this.$t(`codingBridge.session.sessionId`),value:this.currentSessionId}),this.currentSession?.trace_id&&e.push({label:this.$t(`codingBridge.session.traceId`),value:this.currentSession.trace_id}),e}},watch:{events(){this.scrollToBottom()},pendingQuestion(){this.scrollToBottom()},thinking(){this.scrollToBottom()},currentSessionId(){this.scrollToBottom(),this.visibleCount=en,this.editingEventId=``,this.restoreCode=!1,this.syncSessionSettings()},currentNodeId(){this.requestCapabilities(),this.isNewSession&&this.restoreComposerPrefs()},providerCaps(){if(!this.isNewSession||!this.providerCaps.length)return;let e=this.providerCaps.find(e=>e.name===this.provider);if(!e||e.available===!1){let e=this.providerCaps.find(e=>e.available!==!1);e&&(this.provider=e.name)}},provider(){this.isNewSession&&(this.model=``,this.effort=``)},prompt(e){this.slashMenuOpen=/^\/\S*$/.test(e),this.slashActiveIndex>=this.slashMatches.length&&(this.slashActiveIndex=0)}},mounted(){this.requestCapabilities(),this.syncSessionSettings()},methods:{requestCapabilities(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getCapabilities`,this.currentNodeId)},effortLabel(e){let t={"":`codingBridge.session.effortDefault`,low:`codingBridge.session.effortLow`,medium:`codingBridge.session.effortMedium`,high:`codingBridge.session.effortHigh`,max:`codingBridge.session.effortMax`}[e];return t?this.$t(t):e},permissionModeLabel(e){let t={default:`codingBridge.session.permissionModeDefault`,acceptEdits:`codingBridge.session.permissionModeAcceptEdits`,plan:`codingBridge.session.permissionModePlan`,bypassPermissions:`codingBridge.session.permissionModeBypass`}[e];return t?this.$t(t):e},providerName(e){let t=this.providerCaps.find(t=>t.name===e);return t?t.label:{claude:this.$t(`codingBridge.session.providerClaude`),codex:this.$t(`codingBridge.session.providerCodex`),copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return nn[e]??null},syncSessionSettings(){let e=this.currentSession;if(!e){this.restoreComposerPrefs();return}let t=this.lastComposer;e.provider&&(this.provider=e.provider),this.model=e.model??``,this.customModelDraft=``,this.cwd=e.cwd??t.cwd??``,this.effort=e.effort??t.effort??``,this.permissionMode=e.permission_mode??t.permissionMode??`bypassPermissions`},selectModel(e){this.model=e,this.customModelDraft=``,this.closeModelPopover()},applyCustomModel(){let e=this.customModelDraft.trim();e&&(this.model=e,this.customModelDraft=``,this.closeModelPopover())},closeModelPopover(){this.$refs.modelPopover?.hide?.()},onComposerEnter(e){let t=e;t.isComposing||t.keyCode===229||t.shiftKey||t.ctrlKey||t.metaKey||t.altKey||(t.preventDefault(),this.onSend())},onComposerKeydown(e){let t=e;if(this.slashMenuVisible&&!t.isComposing&&t.keyCode!==229){if(t.key===`ArrowDown`){t.preventDefault(),this.moveSlash(1);return}if(t.key===`ArrowUp`){t.preventDefault(),this.moveSlash(-1);return}if(t.key===`Escape`){t.preventDefault(),this.slashMenuOpen=!1;return}if(t.key===`Tab`||t.key===`Enter`&&!t.shiftKey){t.preventDefault(),this.applySlash(this.slashMatches[this.slashActiveIndex]);return}}t.key===`Enter`&&this.onComposerEnter(t)},moveSlash(e){let t=this.slashMatches.length;t&&(this.slashActiveIndex=(this.slashActiveIndex+e+t)%t,this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-slash-menu__item--active`))?.scrollIntoView({block:`nearest`})}))},applySlash(e){e&&(this.prompt=`/${e.name} `,this.slashMenuOpen=!1,this.slashActiveIndex=0)},onSend(){if(!this.canSend)return;let e=this.attachments;if(this.editingEventId){this.$store.dispatch(`codingBridge/editPrompt`,{eventId:this.editingEventId,prompt:this.prompt,model:this.model,permissionMode:this.permissionMode,effort:this.effort,attachments:e.length?e:void 0,restoreCode:this.restoreCode}),this.resetComposer();return}this.currentNodeId&&this.$store.commit(`codingBridge/setLastComposer`,{node_id:this.currentNodeId,prefs:{cwd:this.cwd,provider:this.provider,model:this.model,permissionMode:this.permissionMode,effort:this.effort}}),this.$store.dispatch(`codingBridge/sendPrompt`,{prompt:this.prompt,cwd:this.cwd,model:this.model,permissionMode:this.permissionMode,provider:this.provider,effort:this.effort,attachments:e.length?e:void 0}),this.resetComposer()},resetComposer(){this.prompt=``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.editingEventId=``,this.restoreCode=!1,this.clearAttachments()},cancelEdit(){this.resetComposer()},onAnswerQuestion(e){this.$store.dispatch(`codingBridge/answerQuestion`,{request_id:e.tool_use_id,output:e.output})},onSkipQuestion(e){this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:e.tool_use_id,decision:`deny`})},beforeAttachmentUpload(e){return this.attachmentFileList.length>=$?(G.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:$})),!1):e.size>$t?(G.warning(this.$t(`codingBridge.session.attachmentTooLarge`)),!1):!0},onAttachmentChange(e){if(!e.url&&e.raw&&this.isImageAttachment(e))try{e.url=URL.createObjectURL(e.raw)}catch{}},onAttachmentSuccess(e,t){e?.file_url&&(this.revokeBlobUrl(t),t.url=e.file_url,t.response=e)},onAttachmentError(){G.error(this.$t(`codingBridge.session.attachmentUploadError`))},onAttachmentExceed(){G.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:$}))},onTriggerAttachmentUpload(){this.$nextTick(()=>{let e=this.$refs.uploader?.$el;(e?.querySelector(`input.el-upload__input`)||e?.querySelector(`input[type="file"]`))?.click()})},isAttachmentUploading(e){return e.status===`ready`||e.status===`uploading`},isImageAttachment(e){return(e.raw?.type||``).startsWith(`image/`)?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name||e.url||``)},attachmentPreviewUrl(e){return this.isImageAttachment(e)&&(e.url||e.response?.file_url)||``},removeAttachment(e,t){this.revokeBlobUrl(t),this.attachmentFileList.splice(e,1)},clearAttachments(){for(let e of this.attachmentFileList)this.revokeBlobUrl(e);this.attachmentFileList=[]},revokeBlobUrl(e){if(e.url?.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}},onInterrupt(){this.$store.dispatch(`codingBridge/interruptSession`)},onRetry(){this.$store.dispatch(`codingBridge/retryLastPrompt`)},onEditPrompt(e){this.canEdit&&(this.editingEventId=e.id,this.restoreCode=!1,this.prompt=e.text??``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.clearAttachments(),this.attachmentFileList=(e.attachments??[]).map((e,t)=>({name:e.name||e.url,url:e.url,status:`success`,percentage:100,uid:Date.now()+t,response:{file_url:e.url},mime_type:e.mime_type})),this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-composer__input textarea`))?.focus()}))},openDirectory(){this.directoryVisible=!0},onDirectorySelect(e){this.cwd=e},onNewSession(){this.$store.dispatch(`codingBridge/newSession`),this.restoreComposerPrefs(),this.resetComposer()},restoreComposerPrefs(){let e=this.lastComposer;this.cwd=e.cwd??``,this.provider=e.provider??`claude`,this.permissionMode=e.permissionMode??`bypassPermissions`,this.customModelDraft=``,this.$nextTick(()=>{this.model=e.model??``,this.effort=e.effort??``})},scrollToBottom(){this.$nextTick(()=>{let e=this.$refs.transcript;e&&(e.scrollTop=e.scrollHeight)})},loadEarlier(){let e=this.$refs.transcript,t=e?.scrollHeight??0;this.visibleCount+=tn,this.$nextTick(()=>{e&&(e.scrollTop=e.scrollHeight-t+e.scrollTop)})}}}),an={class:`session-view flex flex-col h-full bg-[var(--app-content-bg)]`},on={key:0,class:`flex-1 flex flex-col items-center justify-center text-center p-8 text-[var(--app-text-subtle)]`},sn={class:`text-sm`},cn={class:`flex items-center justify-between gap-3 px-5 py-3 border-b border-[var(--app-border-subtle)]`},ln={class:`flex items-center gap-2 min-w-0`},un=[`title`,`aria-label`],dn={class:`min-w-0`},fn={class:`flex items-center gap-2 font-medium`},pn={class:`truncate`},mn={key:0,class:`text-xs text-[var(--app-text-subtle)] truncate`},hn={key:0,class:`text-[var(--el-color-primary)]`},gn={class:`flex items-center gap-2 flex-none`},_n={key:0,class:`px-5 py-2 text-xs bg-[var(--el-color-warning-light-9)] text-[var(--el-color-warning)] border-b border-[var(--app-border-subtle)]`},vn={key:1,class:`flex flex-wrap items-center gap-x-4 gap-y-1 px-5 py-1.5 text-[11px] text-[var(--app-text-subtle)] border-b border-[var(--app-border-subtle)]`},yn={class:`opacity-70 flex-none`},bn=[`title`],xn={ref:`transcript`,class:`flex-1 min-h-0 overflow-y-auto px-5 py-4 flex flex-col gap-3`},Sn={key:0,class:`cb-skeleton`},Cn={class:`flex flex-col gap-4`},wn={class:`flex justify-end`},Tn={class:`flex flex-col gap-1.5`},En={class:`flex justify-end`},Dn={class:`flex flex-col gap-1.5`},On={key:1,class:`m-auto text-center text-sm text-[var(--app-text-subtle)]`},kn=[`title`],An={key:4,class:`flex justify-center pt-1`},jn={key:2,class:`cb-question-dock flex-none px-5`},Mn={class:`border-t border-[var(--app-border-subtle)] p-3`},Nn={key:0,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)] px-1 py-2`},Pn={key:0,class:`mb-2 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-lg bg-[var(--el-color-primary-light-9)] px-3 py-2 text-xs text-[var(--app-text)]`},Fn={class:`inline-flex items-center gap-1.5`},In={class:`cb-composer rounded-2xl border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-2.5 transition-colors focus-within:border-[var(--el-color-primary-light-5)]`},Ln={key:0,class:`flex flex-wrap gap-2 pb-2`},Rn=[`src`,`alt`],zn={key:1,class:`flex h-8 w-8 items-center justify-center rounded bg-[var(--app-content-bg)]`},Bn=[`title`],Vn={key:2,class:`text-[10px] text-[var(--app-text-subtle)]`},Hn=[`title`,`aria-label`,`onClick`],Un={key:1,class:`cb-slash-menu`},Wn=[`onMousedown`,`onMouseenter`],Gn={class:`cb-slash-menu__name`},Kn={key:0,class:`cb-slash-menu__hint`},qn={key:1,class:`cb-slash-menu__desc`},Jn={ref:`attachmentUploadTrigger`,class:`block h-0 w-0`,"aria-hidden":`true`},Yn={class:`mt-1.5 flex items-center gap-1.5`},Xn=[`title`,`aria-label`],Zn={class:`flex min-w-0 flex-1 flex-wrap items-center gap-1.5`},Qn={type:`button`,class:`cb-pill`},$n=[`src`],er={class:`truncate`},tr=[`src`],nr={key:1,class:`ml-1 text-xs opacity-60`},rr={key:1,class:`cb-pill cb-pill--static`},ir=[`src`],ar={class:`truncate`},or={type:`button`,class:`cb-pill`},sr={class:`truncate`},cr={class:`cb-model-menu`},lr={class:`truncate`},ur=[`onClick`],dr={class:`truncate`},fr={key:0,class:`cb-model-custom`},pr={type:`button`,class:`cb-pill`},mr={class:`truncate`},hr={type:`button`,class:`cb-pill`},gr={class:`truncate`},_r={type:`button`,class:`cb-pill`},vr={class:`truncate`},yr=[`title`,`aria-label`],br={key:4,class:`cb-pill cb-pill--static`},xr={class:`truncate`},Sr={class:`text-[11px] text-[var(--app-text-subtle)] mt-1 px-1`};function Cr(d,m,ee,_,v,y){let b=u(`developer-icon`),x=u(`el-button`),S=u(`history-icon`),C=u(`add-icon`),w=u(`copy-to-clipboard`),T=u(`el-skeleton-item`),E=u(`el-skeleton`),te=u(`up-icon`),D=u(`transcript-item`),ne=u(`thinking-indicator`),O=u(`redo-icon`),re=u(`ask-user-question-card`),k=u(`view-icon`),ie=u(`edit-icon`),A=u(`el-checkbox`),ae=u(`file-icon`),oe=u(`close-icon`),j=u(`el-input`),se=u(`el-upload`),ce=u(`attachment-icon`),M=u(`code-icon`),N=u(`expand-down-icon`),P=u(`confirm-icon`),F=u(`el-dropdown-item`),I=u(`el-dropdown-menu`),L=u(`el-dropdown`),le=u(`ai-icon`),R=u(`el-popover`),ue=u(`performance-icon`),de=u(`security-icon`),z=u(`folder-open-icon`),B=u(`stop-icon`),V=u(`directory-dialog`);return g(),s(`div`,an,[d.currentNode?(g(),s(l,{key:1},[e(`div`,cn,[e(`div`,ln,[e(`button`,{type:`button`,class:`cb-devices-btn md:hidden`,title:d.$t(`codingBridge.nodeList.title`),"aria-label":d.$t(`codingBridge.nodeList.title`),onClick:m[1]||=e=>d.$emit(`devices`)},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,un),e(`div`,dn,[e(`div`,fn,[e(`span`,pn,i(d.currentNode.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,d.nodeOnline?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`])},null,2)]),d.currentSession?(g(),s(`div`,mn,[e(`span`,null,i(d.sessionMeta),1),d.replayLabel?(g(),s(`span`,hn,` · `+i(d.replayLabel),1)):o(``,!0)])):o(``,!0)])]),e(`div`,gn,[a(x,{size:`small`,round:``,onClick:m[2]||=e=>d.$emit(`history`)},{default:p(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.history.button`)),1)]),_:1}),d.currentSessionId?(g(),f(x,{key:0,size:`small`,round:``,onClick:d.onNewSession},{default:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])):o(``,!0)])]),d.nodeOnline?o(``,!0):(g(),s(`div`,_n,i(d.$t(`codingBridge.session.deviceOffline`)),1)),d.diagnostics.length?(g(),s(`div`,vn,[(g(!0),s(l,null,h(d.diagnostics,t=>(g(),s(`span`,{key:t.label,class:`inline-flex items-center gap-1 min-w-0`},[e(`span`,yn,i(t.label)+`:`,1),e(`span`,{class:`font-mono break-all`,title:t.value},i(t.value),9,bn),a(w,{content:t.value,class:`inline-block flex-none`},null,8,[`content`])]))),128))])):o(``,!0),e(`div`,xn,[d.historyLoading&&!d.events.length?(g(),s(`div`,Sn,[a(E,{animated:``},{template:p(()=>[e(`div`,Cn,[e(`div`,wn,[a(T,{variant:`rect`,class:`cb-sk cb-sk--user`})]),e(`div`,Tn,[a(T,{variant:`text`,style:{width:`55%`}}),a(T,{variant:`text`,style:{width:`88%`}}),a(T,{variant:`text`,style:{width:`70%`}})]),a(T,{variant:`rect`,class:`cb-sk cb-sk--tool`}),e(`div`,En,[a(T,{variant:`rect`,class:`cb-sk cb-sk--user-sm`})]),e(`div`,Dn,[a(T,{variant:`text`,style:{width:`80%`}}),a(T,{variant:`text`,style:{width:`45%`}})])])]),_:1})])):d.events.length?o(``,!0):(g(),s(`div`,On,i(d.$t(`codingBridge.session.startHint`)),1)),d.hiddenEventCount>0?(g(),s(`button`,{key:2,type:`button`,class:`cb-load-earlier mx-auto mb-1 flex items-center gap-1.5 rounded-full border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-1 text-xs text-[var(--app-text-subtle)] hover:text-[var(--el-color-primary)]`,title:`+${d.hiddenEventCount}`,onClick:m[3]||=(...e)=>d.loadEarlier&&d.loadEarlier(...e)},[a(te,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.hiddenEventCount),1)],8,kn)):o(``,!0),(g(!0),s(l,null,h(d.visibleEvents,e=>(g(),f(D,{key:e.id,event:e,editable:d.canEdit,onEdit:d.onEditPrompt},null,8,[`event`,`editable`,`onEdit`]))),128)),d.thinking?(g(),f(ne,{key:3})):o(``,!0),d.canRetry?(g(),s(`div`,An,[a(x,{size:`small`,round:``,onClick:d.onRetry},{default:p(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.retry`)),1)]),_:1},8,[`onClick`])])):o(``,!0)],512),d.pendingQuestion?(g(),s(`div`,jn,[(g(),f(re,{key:d.pendingQuestion.request_id,"tool-use-id":d.pendingQuestion.request_id,payload:d.pendingQuestion.payload,onSubmit:d.onAnswerQuestion,onSkip:d.onSkipQuestion},null,8,[`tool-use-id`,`payload`,`onSubmit`,`onSkip`]))])):o(``,!0),e(`div`,Mn,[d.readonly?(g(),s(`div`,Nn,[a(k,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(d.$t(`codingBridge.history.readonly`)),1),a(x,{class:`ml-auto`,size:`small`,round:``,onClick:d.onNewSession},{default:p(()=>[r(i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])])):(g(),s(l,{key:1},[d.editingActive?(g(),s(`div`,Pn,[e(`span`,Fn,[a(ie,{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.editingBanner`)),1)]),d.canRestoreCode?(g(),f(A,{key:0,modelValue:d.restoreCode,"onUpdate:modelValue":m[4]||=e=>d.restoreCode=e,size:`small`,class:`cb-restore-code`},{default:p(()=>[r(i(d.$t(`codingBridge.session.editRestoreCode`)),1)]),_:1},8,[`modelValue`])):o(``,!0),e(`button`,{type:`button`,class:`ml-auto cb-edit-cancel`,onClick:m[5]||=(...e)=>d.cancelEdit&&d.cancelEdit(...e)},i(d.$t(`codingBridge.session.editCancel`)),1)])):o(``,!0),e(`div`,In,[d.attachmentFileList.length?(g(),s(`div`,Ln,[(g(!0),s(l,null,h(d.attachmentFileList,(t,n)=>(g(),s(`div`,{key:t.uid||t.name||n,class:`group relative flex max-w-[220px] items-center gap-2 rounded-md border border-[var(--app-border-subtle)] bg-[var(--app-sidebar-bg)] px-2 py-1.5 text-xs`},[d.attachmentPreviewUrl(t)?(g(),s(`img`,{key:0,src:d.attachmentPreviewUrl(t),class:`h-8 w-8 rounded object-cover`,alt:d.$t(`codingBridge.session.attachmentImageAlt`)},null,8,Rn)):(g(),s(`span`,zn,[a(ae,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,{class:`min-w-0 flex-1 truncate`,title:t.name},i(t.name),9,Bn),d.isAttachmentUploading(t)?(g(),s(`span`,Vn,i(Math.round(t.percentage||0))+`% `,1)):o(``,!0),e(`button`,{type:`button`,class:`flex h-5 w-5 items-center justify-center rounded-full text-[var(--app-text-subtle)] hover:bg-[var(--app-content-hover-bg)] hover:text-[var(--el-color-danger)]`,title:d.$t(`codingBridge.session.removeAttachment`),"aria-label":d.$t(`codingBridge.session.removeAttachment`),onClick:e=>d.removeAttachment(n,t)},[a(oe,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Hn)]))),128))])):o(``,!0),d.slashMenuVisible?(g(),s(`ul`,Un,[(g(!0),s(l,null,h(d.slashMatches,(r,a)=>(g(),s(`li`,{key:r.name,class:n([`cb-slash-menu__item`,{"cb-slash-menu__item--active":a===d.slashActiveIndex}]),onMousedown:t(e=>d.applySlash(r),[`prevent`]),onMouseenter:e=>d.slashActiveIndex=a},[e(`span`,Gn,`/`+i(r.name),1),r.argument_hint?(g(),s(`span`,Kn,i(r.argument_hint),1)):o(``,!0),r.description?(g(),s(`span`,qn,i(r.description),1)):o(``,!0)],42,Wn))),128))])):o(``,!0),a(j,{modelValue:d.prompt,"onUpdate:modelValue":m[6]||=e=>d.prompt=e,type:`textarea`,autosize:{minRows:2,maxRows:12},resize:`none`,class:`cb-composer__input`,placeholder:d.$t(`codingBridge.session.promptPlaceholder`),onKeydown:d.onComposerKeydown},null,8,[`modelValue`,`placeholder`,`onKeydown`]),a(se,{ref:`uploader`,"file-list":d.attachmentFileList,"onUpdate:fileList":m[7]||=e=>d.attachmentFileList=e,class:`h-0 w-0 overflow-hidden opacity-0`,name:`file`,action:d.uploadUrl,headers:d.headers,multiple:!0,limit:d.maxAttachments,"show-file-list":!1,"before-upload":d.beforeAttachmentUpload,"on-change":d.onAttachmentChange,"on-success":d.onAttachmentSuccess,"on-error":d.onAttachmentError,"on-exceed":d.onAttachmentExceed},{default:p(()=>[e(`span`,Jn,null,512)]),_:1},8,[`file-list`,`action`,`headers`,`limit`,`before-upload`,`on-change`,`on-success`,`on-error`,`on-exceed`]),e(`div`,Yn,[e(`button`,{type:`button`,class:`cb-icon-btn`,title:d.$t(`codingBridge.session.attachFile`),"aria-label":d.$t(`codingBridge.session.attachFile`),onClick:m[8]||=(...e)=>d.onTriggerAttachmentUpload&&d.onTriggerAttachmentUpload(...e)},[a(ce,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Xn),e(`div`,Zn,[d.isNewSession?(g(),f(L,{key:0,trigger:`click`,onCommand:m[9]||=e=>d.provider=e},{dropdown:p(()=>[a(I,null,{default:p(()=>[(g(!0),s(l,null,h(d.providerOptions,e=>(g(),f(F,{key:e.value,command:e.value,disabled:!e.available},{default:p(()=>[a(P,{class:n([`mr-2`,e.value===d.provider?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),d.providerIcon(e.value)?(g(),s(`img`,{key:0,src:d.providerIcon(e.value).src,class:n([`cb-pill__brand mr-1.5`,{"cb-pill__brand--invert":d.providerIcon(e.value).invertOnDark}]),alt:``},null,10,tr)):o(``,!0),r(` `+i(e.label)+` `,1),e.available?o(``,!0):(g(),s(`span`,nr,i(d.$t(`codingBridge.session.providerUnavailable`)),1))]),_:2},1032,[`command`,`disabled`]))),128))]),_:1})]),default:p(()=>[e(`button`,Qn,[d.providerIcon(d.provider)?(g(),s(`img`,{key:0,src:d.providerIcon(d.provider).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.provider).invertOnDark}]),alt:``},null,10,$n)):(g(),f(M,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,er,i(d.providerName(d.provider)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})):(g(),s(`span`,rr,[d.providerIcon(d.currentSession?.provider||`claude`)?(g(),s(`img`,{key:0,src:d.providerIcon(d.currentSession?.provider||`claude`).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.currentSession?.provider||`claude`).invertOnDark}]),alt:``},null,10,ir)):(g(),f(M,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,ar,i(d.providerName(d.currentSession?.provider||`claude`)),1)])),a(R,{ref:`modelPopover`,trigger:`click`,placement:`top-start`,width:260},{reference:p(()=>[e(`button`,or,[a(le,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,sr,i(d.model||d.$t(`codingBridge.session.modelDefault`)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:p(()=>[e(`div`,cr,[e(`button`,{type:`button`,class:`cb-model-option`,onClick:m[10]||=e=>d.selectModel(``)},[a(P,{class:n([`cb-model-option__check`,d.model?`opacity-0`:`opacity-100`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,lr,i(d.$t(`codingBridge.session.modelDefault`)),1)]),(g(!0),s(l,null,h(d.modelOptions,t=>(g(),s(`button`,{key:t.value,type:`button`,class:`cb-model-option`,onClick:e=>d.selectModel(t.value)},[a(P,{class:n([`cb-model-option__check`,t.value===d.model?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,dr,i(t.label),1)],8,ur))),128)),d.allowCustomModel?(g(),s(`div`,fr,[a(j,{modelValue:d.customModelDraft,"onUpdate:modelValue":m[11]||=e=>d.customModelDraft=e,size:`small`,placeholder:d.$t(`codingBridge.session.modelPlaceholder`),onKeyup:c(d.applyCustomModel,[`enter`])},{append:p(()=>[a(x,{disabled:!d.customModelDraft.trim(),"aria-label":d.$t(`common.button.confirm`),title:d.$t(`common.button.confirm`),onClick:d.applyCustomModel},{default:p(()=>[a(P,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])])):o(``,!0)])]),_:1},512),d.effortOptions.length>1?(g(),f(L,{key:2,trigger:`click`,onCommand:m[12]||=e=>d.effort=e},{dropdown:p(()=>[a(I,null,{default:p(()=>[(g(!0),s(l,null,h(d.effortOptions,e=>(g(),f(F,{key:e.value,command:e.value},{default:p(()=>[a(P,{class:n([`mr-2`,e.value===d.effort?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:p(()=>[e(`button`,pr,[a(ue,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,mr,i(d.effortLabel(d.effort)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})):o(``,!0),a(L,{trigger:`click`,onCommand:m[13]||=e=>d.permissionMode=e},{dropdown:p(()=>[a(I,null,{default:p(()=>[(g(!0),s(l,null,h(d.permissionModeOptions,e=>(g(),f(F,{key:e.value,command:e.value},{default:p(()=>[a(P,{class:n([`mr-2`,e.value===d.permissionMode?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:p(()=>[e(`button`,hr,[a(de,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,gr,i(d.permissionModeLabel(d.permissionMode)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1}),d.canPickCwd?(g(),f(R,{key:3,trigger:`click`,placement:`top-start`,width:320},{reference:p(()=>[e(`button`,_r,[a(z,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,vr,i(d.cwd||d.$t(`codingBridge.session.cwdDefault`)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:p(()=>[a(j,{modelValue:d.cwd,"onUpdate:modelValue":m[17]||=e=>d.cwd=e,size:`small`,clearable:``,class:`cb-cwd-input`,placeholder:d.$t(`codingBridge.session.cwdPlaceholder`)},{suffix:p(()=>[e(`span`,{class:`cb-cwd-browse`,role:`button`,tabindex:`0`,title:d.$t(`codingBridge.directory.title`),"aria-label":d.$t(`codingBridge.directory.title`),onClick:m[14]||=(...e)=>d.openDirectory&&d.openDirectory(...e),onKeydown:[m[15]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`enter`]),m[16]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`space`])]},[a(z,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],40,yr)]),_:1},8,[`modelValue`,`placeholder`])]),_:1})):d.currentSession?.cwd?(g(),s(`span`,br,[a(z,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,xr,i(d.currentSession?.cwd),1)])):o(``,!0)]),d.running?(g(),f(x,{key:0,circle:``,"aria-label":d.$t(`common.button.stop`),title:d.$t(`common.button.stop`),onClick:d.onInterrupt},{default:p(()=>[a(B,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])):o(``,!0),a(x,{type:`primary`,round:``,disabled:!d.canSend,onClick:d.onSend},{default:p(()=>[r(i(d.editingActive?d.$t(`codingBridge.session.editSubmit`):d.$t(`codingBridge.session.send`)),1)]),_:1},8,[`disabled`,`onClick`])])]),e(`p`,Sr,i(d.composerHint),1)],64))])],64)):(g(),s(`div`,on,[a(b,{class:`text-4xl mb-3`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,sn,i(d.$t(`codingBridge.session.noDevice`)),1),a(x,{class:`md:hidden mt-4`,round:``,onClick:m[0]||=e=>d.$emit(`devices`)},{default:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.nodeList.title`)),1)]),_:1})])),a(V,{visible:d.directoryVisible,"onUpdate:visible":m[18]||=e=>d.directoryVisible=e,"initial-path":d.cwd,onSelect:d.onDirectorySelect},null,8,[`visible`,`initial-path`,`onSelect`])])}var wr=U(rn,[[`render`,Cr],[`__scopeId`,`data-v-05e55dc1`]]),Tr=_({name:`CodingBridgePairDialog`,components:{LinkIcon:I,ElDialog:J,ElInput:Y,ElButton:H},props:{visible:{type:Boolean,default:!1},initialCode:{type:String,default:``}},emits:[`update:visible`],data(){return{code:``}},computed:{claiming(){return this.$store.state.codingBridge?.status?.claimPair===W.Request}},watch:{visible(e){e&&this.initialCode&&(this.code=this.initialCode)},initialCode(e){e&&(this.code=e)}},methods:{async onClaim(){let e=this.code.trim();if(e)try{let t=await this.$store.dispatch(`codingBridge/claimPair`,e);G.success(this.$t(`codingBridge.pair.success`,{name:t})),this.code=``,this.$emit(`update:visible`,!1)}catch(e){let t=e?.response?.status;t===404?G.error(this.$t(`codingBridge.pair.invalidCode`)):t===409?G.error(this.$t(`codingBridge.pair.usedCode`)):G.error(this.$t(`codingBridge.pair.failed`))}}}}),Er={class:`content`},Dr={class:`text-sm text-[var(--app-text-subtle)] mb-4`},Or={class:`steps list-none m-0 p-0 mb-4`},kr={class:`flex gap-3 mb-3`},Ar={class:`flex-1 min-w-0`},jr={class:`text-sm mb-1`},Mr={class:`flex gap-3 mb-3`},Nr={class:`flex-1 min-w-0`},Pr={class:`text-sm mb-1`},Fr={class:`flex gap-3`},Ir={class:`flex-1 min-w-0`},Lr={class:`text-sm`};function Rr(t,n,o,s,l,d){let m=u(`el-input`),h=u(`link-icon`),ee=u(`el-button`),_=u(`el-dialog`);return g(),f(_,{"model-value":t.visible,width:`520px`,title:t.$t(`codingBridge.pair.title`),center:``,"onUpdate:modelValue":n[1]||=e=>t.$emit(`update:visible`,e)},{default:p(()=>[e(`div`,Er,[e(`p`,Dr,i(t.$t(`codingBridge.pair.intro`)),1),e(`ol`,Or,[e(`li`,kr,[n[3]||=e(`span`,{class:`step-index`},`1`,-1),e(`div`,Ar,[e(`p`,jr,i(t.$t(`codingBridge.pair.step1`)),1),n[2]||=e(`code`,{class:`cmd`},`pip install coding-bridge`,-1)])]),e(`li`,Mr,[n[5]||=e(`span`,{class:`step-index`},`2`,-1),e(`div`,Nr,[e(`p`,Pr,i(t.$t(`codingBridge.pair.step2`)),1),n[4]||=e(`code`,{class:`cmd`},`coding-bridge up`,-1)])]),e(`li`,Fr,[n[6]||=e(`span`,{class:`step-index`},`3`,-1),e(`div`,Ir,[e(`p`,Lr,i(t.$t(`codingBridge.pair.step3`)),1)])])]),a(m,{modelValue:t.code,"onUpdate:modelValue":n[0]||=e=>t.code=e,size:`large`,class:`mb-3`,placeholder:t.$t(`codingBridge.pair.codePlaceholder`),clearable:``,onKeyup:c(t.onClaim,[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeyup`]),a(ee,{type:`primary`,round:``,class:`w-full`,loading:t.claiming,disabled:!t.code.trim(),onClick:t.onClaim},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.pair.claim`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])]),_:1},8,[`model-value`,`title`])}var zr=U(Tr,[[`render`,Rr],[`__scopeId`,`data-v-54bd85f1`]]),Br=_({name:`CodingBridgePermissionDialog`,components:{CloseIcon:q,CodeIcon:k,ConfirmIcon:O,ElDialog:J,ElButton:H},computed:{request(){return(this.$store.state.codingBridge?.permissions??[]).find(e=>!Je(e))},hasInput(){return!!this.request?.input&&Object.keys(this.request.input).length>0},inputText(){try{return JSON.stringify(this.request?.input,null,2)}catch{return String(this.request?.input??``)}}},methods:{onAllow(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`allow`})},onDeny(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`deny`})}}}),Vr={key:0,class:`content`},Hr={class:`text-sm text-[var(--app-text-subtle)] mb-3`},Ur={class:`rounded-md border border-[var(--app-border-subtle)] p-3 mb-3`},Wr={class:`flex items-center gap-2 font-medium`},Gr={key:0,class:`text-xs text-[var(--app-text-subtle)] mt-1`},Kr={key:1,class:`mt-2 text-xs overflow-x-auto whitespace-pre-wrap break-words text-[var(--app-text-subtle)] max-h-[200px]`},qr={class:`flex justify-end gap-2`};function Jr(t,n,c,l,d,m){let h=u(`code-icon`),ee=u(`close-icon`),_=u(`el-button`),v=u(`confirm-icon`),y=u(`el-dialog`);return g(),f(y,{"model-value":!!t.request,width:`480px`,title:t.$t(`codingBridge.permission.title`),"close-on-click-modal":!1,"show-close":!1,center:``},{footer:p(()=>[e(`div`,qr,[a(_,{round:``,onClick:t.onDeny},{default:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.deny`)),1)]),_:1},8,[`onClick`]),a(_,{type:`primary`,round:``,onClick:t.onAllow},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.allow`)),1)]),_:1},8,[`onClick`])])]),default:p(()=>[t.request?(g(),s(`div`,Vr,[e(`p`,Hr,i(t.$t(`codingBridge.permission.subtitle`)),1),e(`div`,Ur,[e(`div`,Wr,[a(h,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(t.request.display_name||t.request.title||t.request.tool),1)]),t.request.description?(g(),s(`p`,Gr,i(t.request.description),1)):o(``,!0),t.hasInput?(g(),s(`pre`,Kr,i(t.inputText),1)):o(``,!0)])])):o(``,!0)]),_:1},8,[`model-value`,`title`])}var Yr=U(Br,[[`render`,Jr]]),Xr={claude:{src:Xt,invertOnDark:!1},codex:{src:Zt,invertOnDark:!0},copilot:{src:Qt,invertOnDark:!0}},Zr=_({name:`CodingBridgeHistoryDrawer`,components:{CodeIcon:k,RedoIcon:V,ElDrawer:b,ElButton:H},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`],computed:{currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},loading(){return this.$store.state.codingBridge?.status?.getHistory===W.Request},sessions(){let e=this.currentNodeId;return[...e?this.$store.state.codingBridge?.history?.[e]??[]:[]].sort((e,t)=>(t.updated_at??0)-(e.updated_at??0))}},watch:{visible(e){e&&this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)}},methods:{providerLabel(e){return{claude:`Claude Code`,codex:`Codex`,copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return Xr[e]??null},refresh(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)},open(e){this.currentNodeId&&(this.$store.dispatch(`codingBridge/reattachSession`,{node_id:this.currentNodeId,provider:e.provider,session_id:e.session_id}),this.$emit(`update:visible`,!1))},formatTime(e){try{return new Date(e).toLocaleString()}catch{return``}}}}),Qr={class:`flex flex-col h-full`},$r={class:`flex items-center justify-between mb-3`},ei={class:`text-xs text-[var(--app-text-subtle)] m-0`},ti={key:0,class:`m-auto text-sm text-[var(--app-text-subtle)]`},ni={key:1,class:`m-auto text-sm text-[var(--app-text-subtle)]`},ri={key:2,class:`m-auto text-sm text-[var(--app-text-subtle)] text-center`},ii={key:3,class:`list-none m-0 p-0 flex-1 overflow-y-auto flex flex-col gap-2`},ai=[`onClick`],oi={class:`flex items-center gap-2 mb-1`},si=[`src`,`alt`],ci={class:`text-sm font-medium truncate flex-1`},li=[`title`],ui={class:`text-[11px] text-[var(--app-text-subtle)] truncate`},di={key:0},fi={key:1},pi={class:`text-[11px] text-[var(--app-text-subtle)] mt-0.5`},mi={key:0},hi={key:1};function gi(t,c,d,m,ee,_){let v=u(`redo-icon`),y=u(`el-button`),b=u(`code-icon`),x=u(`el-drawer`);return g(),f(x,{"model-value":t.visible,direction:`rtl`,size:`380px`,title:t.$t(`codingBridge.history.title`),"onUpdate:modelValue":c[0]||=e=>t.$emit(`update:visible`,e)},{default:p(()=>[e(`div`,Qr,[e(`div`,$r,[e(`p`,ei,i(t.$t(`codingBridge.history.intro`)),1),a(y,{size:`small`,round:``,loading:t.loading,onClick:t.refresh},{default:p(()=>[t.loading?o(``,!0):(g(),f(v,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(t.$t(`codingBridge.history.refresh`)),1)]),_:1},8,[`loading`,`onClick`])]),t.currentNodeId?t.loading&&!t.sessions.length?(g(),s(`div`,ni,i(t.$t(`codingBridge.history.loading`)),1)):t.sessions.length?(g(),s(`ul`,ii,[(g(!0),s(l,null,h(t.sessions,r=>(g(),s(`li`,{key:r.provider+`:`+r.session_id,class:`item rounded-lg p-3 cursor-pointer border border-[var(--app-border-subtle)]`,onClick:e=>t.open(r)},[e(`div`,oi,[t.providerIcon(r.provider)?(g(),s(`img`,{key:0,src:t.providerIcon(r.provider).src,class:n([`provider-icon`,{"provider-icon--invert":t.providerIcon(r.provider).invertOnDark}]),alt:t.providerLabel(r.provider)},null,10,si)):(g(),f(b,{key:1,class:`provider-icon`,title:t.providerLabel(r.provider),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`title`])),e(`span`,ci,i(r.title),1),r.running?(g(),s(`span`,{key:2,class:`running-dot`,title:t.$t(`codingBridge.history.running`)},null,8,li)):o(``,!0)]),e(`div`,ui,[r.cwd?(g(),s(`span`,di,i(r.cwd),1)):o(``,!0),r.git_branch?(g(),s(`span`,fi,` · `+i(r.git_branch),1)):o(``,!0)]),e(`div`,pi,[r.updated_at?(g(),s(`span`,mi,i(t.formatTime(r.updated_at)),1)):o(``,!0),r.message_count?(g(),s(`span`,hi,` · `+i(t.$t(`codingBridge.history.messages`,{count:r.message_count})),1)):o(``,!0)])],8,ai))),128))])):(g(),s(`div`,ri,i(t.$t(`codingBridge.history.empty`)),1)):(g(),s(`div`,ti,i(t.$t(`codingBridge.session.noDevice`)),1))])]),_:1},8,[`model-value`,`title`])}var _i=_({name:`CodingBridgeIndex`,components:{ElDrawer:b,NodeList:Ke,SessionView:wr,PairDialog:zr,PermissionDialog:Yr,HistoryDrawer:U(Zr,[[`render`,gi],[`__scopeId`,`data-v-af006e93`]])},data(){return{drawer:!1,pairVisible:!1,historyVisible:!1,initialCode:``}},mounted(){this.$store.dispatch(`codingBridge/connect`),this.$store.dispatch(`codingBridge/getNodes`);let e=this.$route.query.code;typeof e==`string`&&e&&(this.initialCode=e,this.pairVisible=!0),this.restoreFromUrl(),this.handleNotificationDeepLink(),this.cleanUrl()},beforeUnmount(){this.$store.dispatch(`codingBridge/disconnect`)},methods:{openPair(){this.initialCode=``,this.pairVisible=!0},openPairFromDrawer(){this.drawer=!1,this.openPair()},restoreFromUrl(){let e=this.$route.query,t=typeof e.session==`string`?e.session:``,n=typeof e.node==`string`?e.node:``;if(!t||!n)return;let r=e.provider===`codex`||e.provider===`copilot`?e.provider:`claude`;this.$store.commit(`codingBridge/setCurrentNode`,n),this.$store.commit(`codingBridge/setHistoryRef`,{node_id:n,provider:r,session_id:t}),this.$store.dispatch(`codingBridge/getHistory`,n),this.$store.dispatch(`codingBridge/requestSessions`,n)},cleanUrl(){let e=this.$route.query,t=[`session`,`node`,`provider`,`request`,`code`];if(!t.some(t=>t in e))return;let n={...e};t.forEach(e=>delete n[e]),this.$router.replace({query:n}).catch(()=>{})},handleNotificationDeepLink(){let e=this.$route.query.node;typeof e==`string`&&e&&(this.$route.query.session||this.$store.dispatch(`codingBridge/selectNode`,e),this.$store.dispatch(`codingBridge/requestPendingPermissions`,e))}}}),vi={class:`coding-bridge flex flex-row h-full relative`};function yi(e,t,n,r,i,o){let c=u(`node-list`),l=u(`session-view`),d=u(`el-drawer`),f=u(`pair-dialog`),m=u(`permission-dialog`),h=u(`history-drawer`);return g(),s(`div`,vi,[a(c,{class:`sidebar w-[300px] flex-none`,onPair:e.openPair},null,8,[`onPair`]),a(l,{class:`flex-1 min-w-0`,onHistory:t[0]||=t=>e.historyVisible=!0,onDevices:t[1]||=t=>e.drawer=!0}),a(d,{modelValue:e.drawer,"onUpdate:modelValue":t[2]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`300px`,class:`drawer`},{default:p(()=>[a(c,{onPair:e.openPairFromDrawer},null,8,[`onPair`])]),_:1},8,[`modelValue`]),a(f,{visible:e.pairVisible,"onUpdate:visible":t[3]||=t=>e.pairVisible=t,"initial-code":e.initialCode},null,8,[`visible`,`initial-code`]),a(m),a(h,{visible:e.historyVisible,"onUpdate:visible":t[4]||=t=>e.historyVisible=t},null,8,[`visible`])])}var bi=U(_i,[[`render`,yi],[`__scopeId`,`data-v-2879fe0f`]]);export{bi as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,C as t,Gt as n,I as r,Jt as i,L as a,M as o,N as s,S as c,T as l,at as u,ht as d,j as f,mt as p,ot as m,rt as h,st as ee,tt as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{t as v}from"./upload-C2D3m-Zg.js";import{t as y}from"./checkbox-DLvBiGkW.js";import{t as b}from"./drawer-CQCUUEqh.js";import{n as x,r as S,t as C}from"./dropdown-Bmk5IpPZ.js";import{t as w}from"./popover-DBk2LFDd.js";import{n as T,t as E}from"./skeleton-BVbQKb45.js";import{t as te}from"./arrow-right-5FLtXm8Q.js";import{t as D}from"./arrow-up-D3Lb1mKP.js";import{t as ne}from"./brain-BLWRTeKA.js";import{t as O}from"./check-B8L527TA.js";import{t as re}from"./chevron-down-CQm-G07K.js";import{n as k,t as ie}from"./CodeSnippet-CtXMPNA9.js";import{t as A}from"./CopyToClipboard-C7E8BXWT.js";import{t as ae}from"./eye-BOUbmTD_.js";import{t as oe}from"./file-text-Bsevgo70.js";import{n as j,t as se}from"./shield-OdDzDAdH.js";import{t as ce}from"./folder-BnpnTHta.js";import{t as M}from"./gauge-oFU5VpIZ.js";import{t as N}from"./history-C-wNFVdW.js";import{t as P}from"./info-Dky-jV7U.js";import{t as F}from"./laptop-CY12Y9v3.js";import{t as I}from"./link-D5jgYZtk.js";import{t as L}from"./loader-circle-hWM49H9Q.js";import{i as le,n as R,t as ue}from"./AskUserQuestionCard-BNbSlFEK.js";import{t as de}from"./paperclip-C4MlWqjo.js";import{t as z}from"./pencil-B2nSUIn9.js";import{t as B}from"./plus-B5sdRSJi.js";import{t as V}from"./rotate-cw-DOBdany9.js";import{t as fe}from"./search-BJ1rua7n.js";import{t as pe}from"./square-Cbuok-fk.js";import{t as me}from"./terminal-BEMj4F_a.js";import{t as he}from"./trash-2-CSgZwHve.js";import{Ai as H,E as U,Ht as ge,Kt as _e,ei as W,gi as G,hi as ve,mi as K,pi as q,ri as ye,ui as be,xi as J,zi as Y}from"./index-DX67OIaB.js";import"./vendor-highlight-BtIeKitL.js";import{s as xe,t as Se}from"./codingBridgeNotify-BZ0Eq6UY.js";var Ce=K(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),we=K(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),Te=K(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Ee=_({name:`CodingBridgeNotificationToggle`,components:{LoadingIcon:L,NotificationIcon:we,NotificationOffIcon:Ce,ElButton:H},data(){return{enabled:!1,busy:!1}},computed:{supported(){return be()||xe()}},mounted(){this.enabled=!be()&&Se()===`granted`},methods:{async onToggle(){this.busy=!0;try{if(this.enabled){await this.$store.dispatch(`codingBridge/disableNotifications`),this.enabled=!1,G.success(this.$t(`codingBridge.notify.disabled`));return}let e=await this.$store.dispatch(`codingBridge/enableNotifications`);e===`enabled`?(this.enabled=!0,G.success(this.$t(`codingBridge.notify.enabled`))):e===`denied`?G.warning(this.$t(`codingBridge.notify.denied`)):G.warning(this.$t(`codingBridge.notify.unsupported`))}catch{G.error(this.$t(`codingBridge.notify.failed`))}finally{this.busy=!1}}}});function De(e,t,n,r,i,a){let s=u(`loading-icon`),c=u(`notification-icon`),l=u(`notification-off-icon`),d=u(`el-button`);return e.supported?(g(),f(d,{key:0,circle:``,size:`small`,type:e.enabled?`primary`:`default`,title:e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),disabled:e.busy,"aria-label":e.enabled?e.$t(`codingBridge.notify.disable`):e.$t(`codingBridge.notify.enable`),onClick:e.onToggle},{default:p(()=>[e.busy?(g(),f(s,{key:0,class:`adc-icon-spin`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):e.enabled?(g(),f(c,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),f(l,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]),_:1},8,[`type`,`title`,`disabled`,`aria-label`,`onClick`])):o(``,!0)}var Oe=_({name:`CodingBridgeNodeList`,components:{AddIcon:B,DeleteIcon:he,DesktopIcon:le,DeveloperIcon:F,RedoIcon:V,ElButton:H,NotificationToggle:U(Ee,[[`render`,De]])},emits:[`pair`],computed:{nodes(){return this.$store.state.codingBridge?.nodes??[]},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},connection(){return this.$store.state.codingBridge?.connection??`disconnected`},connectionLabel(){return this.$t(`codingBridge.connection.${this.connection}`)},connectionDotClass(){switch(this.connection){case`connected`:return`bg-[var(--el-color-success)]`;case`connecting`:return`bg-[var(--el-color-warning)]`;case`error`:return`bg-[var(--el-color-danger)]`;default:return`bg-[var(--app-text-subtle)]`}}},methods:{onSelect(e){this.$store.dispatch(`codingBridge/selectNode`,e)},onRefresh(){this.$store.dispatch(`codingBridge/getNodes`)},async onDelete(e){try{await ve.confirm(this.$t(`codingBridge.nodeList.removeConfirm`,{name:e.name}),this.$t(`codingBridge.nodeList.remove`),{confirmButtonText:this.$t(`codingBridge.nodeList.remove`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`})}catch{return}try{await this.$store.dispatch(`codingBridge/deleteNode`,e.node_id),G.success(this.$t(`codingBridge.nodeList.removeSuccess`))}catch{G.error(this.$t(`codingBridge.nodeList.removeFailed`))}}}}),ke={class:`node-list flex flex-col h-full bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},Ae={class:`flex items-center justify-between px-4 py-3 border-b border-[var(--app-border-subtle)]`},je={class:`flex items-center gap-2 font-medium`},Me={class:`flex items-center gap-1`},Ne={class:`flex items-center gap-2 px-4 py-2 text-xs border-b border-[var(--app-border-subtle)]`},Pe={class:`text-[var(--app-text-subtle)]`},Fe={class:`flex-1 overflow-y-auto`},Ie={key:0,class:`p-6 text-center text-sm text-[var(--app-text-subtle)]`},Le={class:`mb-3`},Re={key:1,class:`list-none m-0 p-0`},ze=[`onClick`],Be={class:`flex-1 min-w-0`},Ve={class:`flex items-center gap-2`},He={class:`truncate font-medium`},Ue=[`title`],We={class:`text-xs text-[var(--app-text-subtle)] truncate`};function Ge(o,c,d,f,m,ee){let _=u(`developer-icon`),v=u(`notification-toggle`),y=u(`redo-icon`),b=u(`el-button`),x=u(`add-icon`),S=u(`desktop-icon`),C=u(`delete-icon`);return g(),s(`div`,ke,[e(`div`,Ae,[e(`div`,je,[a(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(o.$t(`codingBridge.nodeList.title`)),1)]),e(`div`,Me,[a(v),a(b,{circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.refresh`),title:o.$t(`codingBridge.nodeList.refresh`),onClick:o.onRefresh},{default:p(()=>[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`]),a(b,{type:`primary`,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.pair`),title:o.$t(`codingBridge.nodeList.pair`),onClick:c[0]||=e=>o.$emit(`pair`)},{default:p(()=>[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`])])]),e(`div`,Ne,[e(`span`,{class:n([`inline-block w-2 h-2 rounded-full`,o.connectionDotClass])},null,2),e(`span`,Pe,i(o.connectionLabel),1)]),e(`div`,Fe,[o.nodes.length?(g(),s(`ul`,Re,[(g(!0),s(l,null,h(o.nodes,r=>(g(),s(`li`,{key:r.node_id,class:n([`group flex items-center gap-3 px-4 py-3 cursor-pointer border-b border-[var(--app-border-subtle)] hover:bg-[var(--app-content-bg)]`,{"bg-[var(--app-content-bg)]":r.node_id===o.currentNodeId}]),onClick:e=>o.onSelect(r.node_id)},[a(S,{class:`text-[var(--app-text-subtle)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`div`,Be,[e(`div`,Ve,[e(`span`,He,i(r.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,r.status===`online`?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`]),title:r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)},null,10,Ue)]),e(`div`,We,i(r.status===`online`?o.$t(`codingBridge.status.online`):o.$t(`codingBridge.status.offline`)),1)]),a(b,{class:`opacity-0 group-hover:opacity-100`,text:``,circle:``,size:`small`,"aria-label":o.$t(`codingBridge.nodeList.remove`),title:o.$t(`codingBridge.nodeList.remove`),onClick:t(e=>o.onDelete(r),[`stop`])},{default:p(()=>[a(C,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])],10,ze))),128))])):(g(),s(`div`,Ie,[e(`p`,Le,i(o.$t(`codingBridge.nodeList.empty`)),1),a(b,{type:`primary`,round:``,size:`small`,onClick:c[1]||=e=>o.$emit(`pair`)},{default:p(()=>[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(o.$t(`codingBridge.nodeList.pairFirst`)),1)]),_:1})]))])])}var Ke=U(Oe,[[`render`,Ge]]),qe=e=>{let t=e?.questions;return Array.isArray(t)&&t.length>0&&t.every(e=>e&&typeof e.question==`string`&&Array.isArray(e.options))},Je=e=>e?(e.tool||``).toLowerCase()===`askuserquestion`?!0:qe(e.input):!1,Ye=e=>({questions:e.input?.questions??[]}),Xe=100,X=4e4,Ze=12e3,Z=6e3,Q=(e,t)=>{if(e.length<=t)return e;let n=((e.length-t)/1024).toFixed(1);return`${e.slice(0,t)}\n\n··· +${n} KB ···`},Qe=_({name:`CodingBridgeTranscriptItem`,directives:{highlight:_e},components:{CloseIcon:q,ConfirmIcon:O,EditIcon:z,FileIcon:j,InfoIcon:P,VueMarkdown:R,CodeSnippet:ie,CopyToClipboard:A},props:{event:{type:Object,required:!0},editable:{type:Boolean,default:!1}},emits:[`edit`],data(){return{renderedText:Q(this.event.text||``,X),streamTimer:0}},computed:{commandText(){let e=this.event.input;if(!e)return``;for(let t of[`command`,`cmd`,`script`]){let n=e[t];if(typeof n==`string`&&n.trim())return Q(n,Z)}return``},filePath(){let e=this.event.input;if(!e)return``;for(let t of[`file_path`,`filePath`,`path`,`notebook_path`,`filename`]){let n=e[t];if(typeof n==`string`&&n.trim())return n}return``},toolDescription(){let e=this.event.input?.description;return typeof e==`string`?e:``},toolIcon(){if(this.commandText)return me;let e=(this.event.tool??``).toLowerCase();return/read|cat|view/.test(e)?oe:/write|edit|create|update|insert/.test(e)?z:/grep|glob|search|find|list/.test(e)?fe:k},questionLines(){let e=(this.event.tool??``).toLowerCase(),t=this.event.input?.questions;return!(e===`askuserquestion`||Array.isArray(t))||!Array.isArray(t)?[]:t.filter(e=>e&&typeof e.question==`string`).map(e=>({header:typeof e.header==`string`?e.header:``,question:e.question}))},inputText(){let e=this.event.input;if(!e)return``;let t={};for(let[n,r]of Object.entries(e))n===`timeout`||n===`description`||(t[n]=r);if(Object.keys(t).length===0)return``;try{return Q(JSON.stringify(t,null,2),Z)}catch{return Q(String(e),Z)}},thinkingText(){return Q(this.event.text||``,X)},resultText(){let e=this.event.content;return typeof e==`string`&&e.length>0?e:`—`},resultDisplay(){return Q(this.resultText,Ze)},resultLabel(){let e=[];return this.event.is_error?e.push(this.$t(`codingBridge.transcript.turnFailed`)):e.push(this.$t(`codingBridge.transcript.turnDone`)),typeof this.event.cost_usd==`number`&&this.event.cost_usd>0&&e.push(`$${this.event.cost_usd.toFixed(4)}`),e.join(` · `)},hasAttachments(){return!!this.event.attachments?.length},noticeText(){let e=this.event.subtype,t=this.event.command;if(t){if(e===`slash_unavailable`)return this.$t(`codingBridge.notice.slashUnavailable`,{command:t});if(e===`slash_codex_unsupported`)return this.$t(`codingBridge.notice.slashCodexUnsupported`,{command:t})}return this.event.text||``}},watch:{"event.text"(){this.scheduleRender()},"event.streaming"(e){e||this.flushRender()}},beforeUnmount(){this.streamTimer&&window.clearTimeout(this.streamTimer)},methods:{scheduleRender(){if(!this.event.streaming){this.flushRender();return}this.streamTimer||=window.setTimeout(()=>{this.streamTimer=0,this.renderedText=Q(this.event.text||``,X)},Xe)},flushRender(){this.streamTimer&&=(window.clearTimeout(this.streamTimer),0),this.renderedText=Q(this.event.text||``,X)}}}),$e={key:0,class:`group flex items-end justify-end gap-1.5`},et=[`title`,`aria-label`],tt={class:`max-w-[85%] rounded-lg px-3 py-2 bg-[var(--el-color-primary)] text-white whitespace-pre-wrap break-words`},nt=[`src`],rt=[`href`],it=[`src`],at={key:1,class:`flex h-9 w-9 items-center justify-center rounded bg-white/15`},ot={class:`min-w-0 truncate`},st={key:2},ct={key:2,class:`whitespace-pre-wrap break-words italic text-[var(--app-text-subtle)] border-l-2 border-[var(--app-border-subtle)] pl-3`},lt={key:3,class:`overflow-hidden rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)]`},ut={class:`flex items-center gap-2 px-2.5 py-1.5 font-medium text-[var(--app-text-subtle)]`},dt={key:0,class:`min-w-0 truncate text-xs font-normal opacity-70`},ft={key:0,class:`flex flex-col gap-1.5 px-2.5 pb-2`},pt={key:0,class:`font-medium text-[var(--app-text)]`},mt={class:`whitespace-pre-wrap break-words text-[var(--app-text-subtle)]`},ht={key:1,class:`px-2.5 pb-2`},gt={key:2,class:`px-2.5 pb-2 font-mono text-xs break-all text-[var(--app-text-subtle)]`},_t={key:3,class:`px-2.5 pb-2`},vt={key:0,class:`absolute right-1.5 top-1.5 z-10 rounded bg-[var(--app-content-bg)] px-1 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`},yt={key:5,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)]`},bt={key:6,class:`flex items-start gap-2 rounded-md bg-[var(--app-sidebar-bg)] border border-[var(--app-border-subtle)] text-[var(--app-text-subtle)] px-3 py-2 text-xs`},xt={class:`whitespace-pre-wrap break-words`},St={key:7,class:`rounded-md bg-[var(--el-color-danger-light-9)] text-[var(--el-color-danger)] px-3 py-2 whitespace-pre-wrap break-words`};function Ct(t,r,c,p,_,v){let y=u(`edit-icon`),b=u(`file-icon`),x=u(`vue-markdown`),S=u(`code-snippet`),C=u(`copy-to-clipboard`),w=u(`close-icon`),T=u(`confirm-icon`),E=u(`info-icon`),te=m(`highlight`);return g(),s(`div`,{class:n([`transcript-item text-sm leading-relaxed`,`kind-${t.event.kind}`])},[t.event.kind===`prompt`?(g(),s(`div`,$e,[t.editable?(g(),s(`button`,{key:0,type:`button`,class:`cb-edit-btn opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100`,title:t.$t(`codingBridge.session.editPrompt`),"aria-label":t.$t(`codingBridge.session.editPrompt`),onClick:r[0]||=e=>t.$emit(`edit`,t.event)},[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,et)):o(``,!0),e(`div`,tt,[t.event.images&&t.event.images.length?(g(),s(`div`,{key:0,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text||t.hasAttachments}])},[(g(!0),s(l,null,h(t.event.images,(e,t)=>(g(),s(`img`,{key:t,src:e,class:`w-16 h-16 rounded object-cover`,alt:``},null,8,nt))),128))],2)):o(``,!0),t.hasAttachments?(g(),s(`div`,{key:1,class:n([`flex flex-wrap gap-1.5`,{"mb-1.5":t.event.text}])},[(g(!0),s(l,null,h(t.event.attachments,(t,n)=>(g(),s(`a`,{key:`${t.url}-${n}`,href:t.url,target:`_blank`,rel:`noopener noreferrer`,class:`flex max-w-[220px] items-center gap-2 rounded-md bg-white/15 px-2 py-1.5 text-xs text-white hover:bg-white/20`},[t.type===`image`?(g(),s(`img`,{key:0,src:t.url,class:`h-9 w-9 rounded object-cover`,alt:``},null,8,it)):(g(),s(`span`,at,[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,ot,i(t.name||t.url),1)],8,rt))),128))],2)):o(``,!0),t.event.text?(g(),s(`span`,st,i(t.event.text),1)):o(``,!0)])])):t.event.kind===`text`?(g(),s(`div`,{key:1,class:n([`cb-stream-text`,{"is-streaming":t.event.streaming}])},[d(a(x,{source:t.renderedText,class:`markdown-body bg-transparent text-[var(--app-text)]`},null,8,[`source`]),[[te]])],2)):t.event.kind===`thinking`?(g(),s(`div`,ct,i(t.thinkingText),1)):t.event.kind===`tool_use`?(g(),s(`div`,lt,[e(`div`,ut,[(g(),f(ee(t.toolIcon),{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.event.tool),1),t.toolDescription?(g(),s(`span`,dt,i(t.toolDescription),1)):o(``,!0)]),t.questionLines.length?(g(),s(`div`,ft,[(g(!0),s(l,null,h(t.questionLines,(t,n)=>(g(),s(`div`,{key:n,class:`rounded border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-2.5 py-1.5 text-xs`},[t.header?(g(),s(`div`,pt,i(t.header),1)):o(``,!0),e(`div`,mt,i(t.question),1)]))),128))])):t.commandText?(g(),s(`div`,ht,[a(S,{code:t.commandText,lang:`bash`,copyable:``},null,8,[`code`])])):t.filePath?(g(),s(`div`,gt,i(t.filePath),1)):t.inputText?(g(),s(`div`,_t,[a(S,{code:t.inputText,lang:`json`,copyable:``},null,8,[`code`])])):o(``,!0)])):t.event.kind===`tool_result`?(g(),s(`div`,{key:4,class:n([`group relative overflow-hidden rounded-md`,t.event.is_error?`bg-[var(--el-color-danger-light-9)]`:`bg-[var(--app-sidebar-bg)]`])},[t.event.content?(g(),s(`div`,vt,[a(C,{content:t.resultText},null,8,[`content`])])):o(``,!0),e(`pre`,{class:n([`m-0 max-h-72 overflow-auto whitespace-pre-wrap break-words px-2.5 py-2 font-mono text-xs`,t.event.is_error?`text-[var(--el-color-danger)]`:`text-[var(--app-text-subtle)]`])},i(t.resultDisplay),3)],2)):t.event.kind===`result`?(g(),s(`div`,yt,[t.event.is_error?(g(),f(w,{key:0,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),f(T,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,null,i(t.resultLabel),1)])):t.event.kind===`notice`?(g(),s(`div`,bt,[a(E,{class:`mt-0.5 flex-none text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,xt,i(t.noticeText),1)])):t.event.kind===`error`?(g(),s(`div`,St,i(t.event.text),1)):o(``,!0)],2)}var wt=U(Qe,[[`render`,Ct],[`__scopeId`,`data-v-2028b19a`]]),Tt=`Pondering.Noodling.Conjuring.Brewing.Cooking.Crafting.Churning.Simmering.Percolating.Ruminating.Musing.Marinating.Synthesizing.Computing.Hatching.Forging.Vibing.Working.Thinking.Cogitating.Mulling.Stewing.Tinkering.Wrangling.Spinning.Reticulating.Manifesting.Deliberating`.split(`.`),Et=[`思考中`,`酝酿中`,`沉思中`,`推敲中`,`构思中`,`计算中`,`琢磨中`,`捣鼓中`,`炼制中`,`召唤中`,`编织中`,`烹饪中`,`咀嚼中`,`盘算中`,`发酵中`,`运转中`,`冥想中`,`鼓捣中`,`熬制中`,`神游中`,`演算中`,`雕琢中`,`头脑风暴中`,`反复斟酌中`],Dt=60,Ot=1500,kt=28,At=_({name:`CodingBridgeThinkingIndicator`,components:{LoadingIcon:L},data(){return{display:``,elapsed:0,charIndex:0,phase:`typing`,currentWord:``,elapsedTimer:0,typeTimer:0}},computed:{words(){return this.$i18n.locale.startsWith(`zh`)?Et:Tt}},mounted(){this.currentWord=this.pickWord(),this.elapsedTimer=window.setInterval(()=>{this.elapsed+=1},1e3),this.scheduleType(Dt)},beforeUnmount(){window.clearInterval(this.elapsedTimer),window.clearTimeout(this.typeTimer)},methods:{pickWord(){let e=this.words;if(e.length<=1)return e[0]??``;let t=this.currentWord;for(;t===this.currentWord;)t=e[Math.floor(Math.random()*e.length)];return t},scheduleType(e){this.typeTimer=window.setTimeout(this.advance,e)},advance(){let e=this.currentWord;this.phase===`typing`?(this.charIndex+=1,this.display=e.slice(0,this.charIndex),this.charIndex>=e.length?(this.phase=`holding`,this.scheduleType(Ot)):this.scheduleType(Dt)):this.phase===`holding`?(this.phase=`deleting`,this.scheduleType(kt)):(--this.charIndex,this.display=e.slice(0,Math.max(0,this.charIndex)),this.charIndex<=0?(this.currentWord=this.pickWord(),this.phase=`typing`,this.scheduleType(Dt)):this.scheduleType(kt))}}}),jt={class:`cb-thinking flex items-center gap-2 text-sm text-[var(--app-text-subtle)] py-1`},Mt={class:`cb-thinking__word`},Nt={class:`cb-thinking__elapsed tabular-nums opacity-60`};function Pt(t,n,o,c,l,d){let f=u(`loading-icon`);return g(),s(`div`,jt,[a(f,{class:`cb-thinking__spinner adc-icon-spin text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Mt,[r(i(t.display),1),n[0]||=e(`span`,{class:`cb-thinking__caret`},`▋`,-1)]),e(`span`,Nt,`(`+i(t.elapsed)+`s)`,1)])}var Ft=U(At,[[`render`,Pt],[`__scopeId`,`data-v-ae116215`]]),It=_({name:`CodingBridgeDirectoryDialog`,components:{ContinueIcon:te,FileIcon:j,FolderIcon:ce,RedoIcon:V,UpIcon:D,ElDialog:J,ElButton:H,ElInput:Y},props:{visible:{type:Boolean,default:!1},initialPath:{type:String,default:``}},emits:[`update:visible`,`select`],data(){return{pathInput:``}},computed:{listing(){return this.$store.state.codingBridge?.directory},loading(){return this.$store.state.codingBridge?.directoryLoading===!0},directories(){return(this.listing?.entries??[]).filter(e=>e.type===`dir`)},files(){return(this.listing?.entries??[]).filter(e=>e.type===`file`)},isEmpty(){return!!this.listing&&!this.listing.error&&(this.listing.entries??[]).length===0}},watch:{"listing.path"(e){this.pathInput=e??``}},methods:{onOpen(){this.pathInput=this.initialPath||``,this.$store.dispatch(`codingBridge/browseDir`,this.initialPath||void 0)},goPath(){let e=this.pathInput.trim();e&&this.$store.dispatch(`codingBridge/browseDir`,e)},syncPathInput(){this.pathInput=this.listing?.path??``},onVisibleChange(e){this.$emit(`update:visible`,e),e||this.$store.dispatch(`codingBridge/clearDirectory`)},openDir(e){this.$store.dispatch(`codingBridge/browseDir`,e)},goParent(){this.listing?.parent&&this.$store.dispatch(`codingBridge/browseDir`,this.listing.parent)},refresh(){this.$store.dispatch(`codingBridge/browseDir`,this.listing?.path||this.initialPath||void 0)},chooseCurrent(){this.listing&&!this.listing.error&&(this.$emit(`select`,this.listing.path),this.onVisibleChange(!1))}}}),Lt={class:`flex flex-col gap-2`},Rt={class:`flex items-center gap-2 min-w-0`},zt={class:`h-72 overflow-y-auto border border-[var(--app-border-subtle)] rounded-md divide-y divide-[var(--app-border-subtle)]`},Bt={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)]`},Vt={key:1,class:`h-full flex items-center justify-center text-sm text-[var(--el-color-danger)]`},Ht=[`onClick`],Ut={class:`truncate`,dir:`ltr`},Wt={class:`truncate`,dir:`ltr`},Gt={key:0,class:`h-full flex items-center justify-center text-sm text-[var(--app-text-subtle)] py-8`},Kt={key:0,class:`text-[11px] text-[var(--app-text-subtle)] px-1`},qt={class:`flex items-center justify-end gap-2`};function Jt(t,d,m,ee,_,v){let y=u(`up-icon`),b=u(`el-button`),x=u(`continue-icon`),S=u(`el-input`),C=u(`redo-icon`),w=u(`folder-icon`),T=u(`file-icon`),E=u(`el-dialog`);return g(),f(E,{"model-value":t.visible,title:t.$t(`codingBridge.directory.title`),width:`520px`,"append-to-body":``,"onUpdate:modelValue":t.onVisibleChange,onOpen:t.onOpen},{footer:p(()=>[e(`div`,qt,[a(b,{round:``,onClick:d[1]||=e=>t.onVisibleChange(!1)},{default:p(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1}),a(b,{type:`primary`,round:``,disabled:!t.listing||!!t.listing.error,onClick:t.chooseCurrent},{default:p(()=>[r(i(t.$t(`codingBridge.directory.choose`)),1)]),_:1},8,[`disabled`,`onClick`])])]),default:p(()=>[e(`div`,Lt,[e(`div`,Rt,[a(b,{size:`small`,circle:``,disabled:!t.listing||!t.listing.parent||t.loading,title:t.$t(`codingBridge.directory.up`),"aria-label":t.$t(`codingBridge.directory.up`),onClick:t.goParent},{default:p(()=>[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`]),a(S,{modelValue:t.pathInput,"onUpdate:modelValue":d[0]||=e=>t.pathInput=e,size:`small`,class:`flex-1 min-w-0`,dir:`ltr`,placeholder:t.$t(`codingBridge.directory.pathPlaceholder`),disabled:t.loading,onKeyup:c(t.goPath,[`enter`]),onBlur:t.syncPathInput},{append:p(()=>[a(b,{title:t.$t(`codingBridge.directory.go`),disabled:t.loading||!t.pathInput.trim(),"aria-label":t.$t(`codingBridge.directory.go`),onClick:t.goPath},{default:p(()=>[a(x,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`title`,`disabled`,`aria-label`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`disabled`,`onKeyup`,`onBlur`]),a(b,{size:`small`,circle:``,disabled:t.loading,title:t.$t(`codingBridge.directory.refresh`),"aria-label":t.$t(`codingBridge.directory.refresh`),onClick:t.refresh},{default:p(()=>[a(C,{class:n({"adc-icon-spin":t.loading}),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`])]),_:1},8,[`disabled`,`title`,`aria-label`,`onClick`])]),e(`div`,zt,[t.loading&&!t.listing?(g(),s(`div`,Bt,i(t.$t(`codingBridge.directory.loading`)),1)):t.listing&&t.listing.error?(g(),s(`div`,Vt,i(t.listing.error),1)):(g(),s(l,{key:2},[(g(!0),s(l,null,h(t.directories,n=>(g(),s(`button`,{key:n.path,type:`button`,class:`w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-[var(--app-content-hover-bg)]`,onClick:e=>t.openDir(n.path)},[a(w,{class:`text-[var(--el-color-warning)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Ut,i(n.name),1)],8,Ht))),128)),(g(!0),s(l,null,h(t.files,t=>(g(),s(`div`,{key:t.path,class:`w-full flex items-center gap-2 px-3 py-2 text-sm text-[var(--app-text-subtle)]`},[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,Wt,i(t.name),1)]))),128)),t.isEmpty?(g(),s(`div`,Gt,i(t.$t(`codingBridge.directory.empty`)),1)):o(``,!0)],64))]),t.listing&&t.listing.truncated?(g(),s(`p`,Kt,i(t.$t(`codingBridge.directory.truncated`)),1)):o(``,!0)])]),_:1},8,[`model-value`,`title`,`onUpdate:modelValue`,`onOpen`])}var Yt=U(It,[[`render`,Jt]]),Xt=`data:image/svg+xml,%3csvg%20fill='%23D97757'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='m4.7144%2015.9555%204.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608%201.5179.1032%202.2767.1578%201.6514.0972%202.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973%209.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686%201.9064%201.4754%202.4893%201.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335%206.6997%200l.9957.1336.419.3642.6192%201.4147%201.0018%202.2282%201.5543%203.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853%201.8517-.5586%202.9021-.3643%201.9429h.2125l.2429-.2429.9835-1.3053%201.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759%201.1293-.34%201.1657-1.0625%201.3478-.8804%201.1414-1.2628%201.7-.7893%201.36.0729.1093.1882-.0183%202.8535-.607%201.5421-.2794%201.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607%201.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929%201.0686%202.0035%201.8092%202.5075%202.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496%202.3436%203.5214.1214%201.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38%2017.959l-1.1414-1.9428-.1397.079-.674%207.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328%201.9672-2.1796%202.9446-1.7243%201.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889%202.386-3.0357%201.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385%204.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429%201.9064-1.3114Z'/%3e%3c/svg%3e`,Zt=`data:image/svg+xml,%3csvg%20fill='%23000000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M22.282%209.821a5.985%205.985%200%200%200-.516-4.91%206.046%206.046%200%200%200-6.51-2.9A6.065%206.065%200%200%200%204.981%204.18a5.985%205.985%200%200%200-3.998%202.9%206.046%206.046%200%200%200%20.743%207.097%205.98%205.98%200%200%200%20.51%204.911%206.051%206.051%200%200%200%206.515%202.9A5.985%205.985%200%200%200%2013.26%2024a6.056%206.056%200%200%200%205.772-4.206%205.99%205.99%200%200%200%203.997-2.9%206.056%206.056%200%200%200-.747-7.073zM13.26%2022.43a4.476%204.476%200%200%201-2.876-1.04l.141-.081%204.779-2.758a.795.795%200%200%200%20.392-.681v-6.737l2.02%201.168a.071.071%200%200%201%20.038.052v5.583a4.504%204.504%200%200%201-4.494%204.494zM3.6%2018.304a4.47%204.47%200%200%201-.535-3.014l.142.085%204.783%202.759a.771.771%200%200%200%20.78%200l5.843-3.369v2.332a.08.08%200%200%201-.033.062L9.74%2019.95a4.5%204.5%200%200%201-6.14-1.646zM2.34%207.896a4.485%204.485%200%200%201%202.366-1.973V11.6a.766.766%200%200%200%20.388.676l5.815%203.355-2.02%201.168a.076.076%200%200%201-.071%200l-4.83-2.786A4.504%204.504%200%200%201%202.34%207.872zm16.597%203.855l-5.833-3.387L15.119%207.2a.076.076%200%200%201%20.071%200l4.83%202.791a4.494%204.494%200%200%201-.676%208.105v-5.678a.79.79%200%200%200-.407-.667zm2.01-3.023l-.141-.085-4.774-2.782a.776.776%200%200%200-.785%200L9.409%209.23V6.897a.066.066%200%200%201%20.028-.061l4.83-2.787a4.5%204.5%200%200%201%206.68%204.66zm-12.64%204.135l-2.02-1.164a.08.08%200%200%201-.038-.057V6.075a4.5%204.5%200%200%201%207.375-3.453l-.142.08L8.704%205.46a.795.795%200%200%200-.393.681zm1.097-2.365l2.602-1.5%202.607%201.5v2.999l-2.597%201.5-2.607-1.5z'/%3e%3c/svg%3e`,Qt=`data:image/svg+xml,%3csvg%20fill='%23000'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGitHub%20Copilot%3c/title%3e%3cpath%20d='M23.922%2016.997C23.061%2018.492%2018.063%2022.02%2012%2022.02%205.937%2022.02.939%2018.492.078%2016.997A.641.641%200%200%201%200%2016.741v-2.869a.883.883%200%200%201%20.053-.22c.372-.935%201.347-2.292%202.605-2.656.167-.429.414-1.055.644-1.517a10.098%2010.098%200%200%201-.052-1.086c0-1.331.282-2.499%201.132-3.368.397-.406.89-.717%201.474-.952C7.255%202.937%209.248%201.98%2011.978%201.98c2.731%200%204.767.957%206.166%202.093.584.235%201.077.546%201.474.952.85.869%201.132%202.037%201.132%203.368%200%20.368-.014.733-.052%201.086.23.462.477%201.088.644%201.517%201.258.364%202.233%201.721%202.605%202.656a.841.841%200%200%201%20.053.22v2.869a.641.641%200%200%201-.078.256Zm-11.75-5.992h-.344a4.359%204.359%200%200%201-.355.508c-.77.947-1.918%201.492-3.508%201.492-1.725%200-2.989-.359-3.782-1.259a2.137%202.137%200%200%201-.085-.104L4%2011.746v6.585c1.435.779%204.514%202.179%208%202.179%203.486%200%206.565-1.4%208-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057%201.259-3.782%201.259-1.59%200-2.738-.545-3.508-1.492a4.359%204.359%200%200%201-.355-.508Zm2.328%203.25c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm-5%200c.549%200%201%20.451%201%201v2c0%20.549-.451%201-1%201-.549%200-1-.451-1-1v-2c0-.549.451-1%201-1Zm3.313-6.185c.136%201.057.403%201.913.878%202.497.442.544%201.134.938%202.344.938%201.573%200%202.292-.337%202.657-.751.384-.435.558-1.15.558-2.361%200-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438%201.578v.021c0%20.265.021.562.063.893Zm-1.626%200c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824%201.025-.462.472-.705%201.179-.705%202.319%200%201.211.175%201.926.558%202.361.365.414%201.084.751%202.657.751%201.21%200%201.902-.394%202.344-.938.475-.584.742-1.44.878-2.497Z'/%3e%3c/svg%3e`,$t=50*1024*1024,$=10,en=60,tn=60,nn={claude:{src:Xt,invertOnDark:!1},codex:{src:Zt,invertOnDark:!0},copilot:{src:Qt,invertOnDark:!0}},rn=_({name:`CodingBridgeSessionView`,components:{AddIcon:B,AiIcon:ne,AttachmentIcon:de,CloseIcon:q,CodeIcon:k,ConfirmIcon:O,DeveloperIcon:F,EditIcon:z,ExpandDownIcon:re,FileIcon:j,FolderOpenIcon:Te,HistoryIcon:N,PerformanceIcon:M,RedoIcon:V,SecurityIcon:se,StopIcon:pe,UpIcon:D,ViewIcon:ae,ElInput:Y,ElButton:H,ElPopover:w,ElDropdown:C,ElDropdownMenu:S,ElDropdownItem:x,ElUpload:v,ElCheckbox:y,ElSkeleton:E,ElSkeletonItem:T,TranscriptItem:wt,ThinkingIndicator:Ft,DirectoryDialog:Yt,AskUserQuestionCard:ue,CopyToClipboard:A},mixins:[ge],emits:[`history`,`devices`],data(){return{prompt:``,cwd:``,model:``,customModelDraft:``,permissionMode:`bypassPermissions`,provider:`claude`,effort:``,directoryVisible:!1,slashMenuOpen:!1,slashActiveIndex:0,editingEventId:``,restoreCode:!1,attachmentFileList:[],uploadUrl:ye()+`/api/v1/files/`,maxAttachments:$,visibleCount:en}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},lastComposer(){let e=this.currentNodeId;return(e?this.$store.state.codingBridge?.lastComposer?.[e]:void 0)??{}},currentNode(){return this.$store.state.codingBridge?.nodes?.find(e=>e.node_id===this.currentNodeId)},nodeOnline(){return this.currentNode?.status===`online`},currentSessionId(){return this.$store.state.codingBridge?.currentSessionId},currentSession(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.sessions?.[e]:void 0},events(){let e=this.currentSessionId;return e?this.$store.state.codingBridge?.events?.[e]??[]:[]},visibleEvents(){let e=this.events;return e.length>this.visibleCount?e.slice(-this.visibleCount):e},hiddenEventCount(){return Math.max(0,this.events.length-this.visibleCount)},historyLoading(){return this.$store.state.codingBridge?.status?.getHistoryDetail===W.Request},pendingQuestion(){let e=this.currentSessionId;if(!e)return;let t=(this.$store.state.codingBridge?.permissions??[]).find(t=>t.session_id===e&&Je(t));return t?{request_id:t.request_id,payload:Ye(t)}:void 0},isNewSession(){return!this.currentSessionId},canPickCwd(){return this.isNewSession||!this.currentSession?.started},readonly(){return this.currentSession?.readonly===!0},resumeHint(){return!!this.currentSession?.provider&&!this.currentSession?.started&&!this.readonly},replayLabel(){return!this.currentSession?.provider||this.currentSession?.started?``:this.currentSession.provider===`codex`?this.$t(`codingBridge.history.codexLabel`):this.currentSession.provider===`claude`?this.$t(`codingBridge.history.claudeLabel`):this.providerName(this.currentSession.provider)},running(){let e=this.currentSession?.status;return e===`running`||e===`starting`},thinking(){return this.running&&!this.pendingQuestion},connected(){return this.$store.state.codingBridge?.connection===`connected`},canRetry(){return this.currentSession?.status===`error`&&!this.readonly&&this.connected&&this.nodeOnline&&this.events.some(e=>e.kind===`prompt`)},attachments(){return(this.attachmentFileList||[]).map(e=>{let t=e.response?.file_url||(typeof e.url==`string`&&!e.url.startsWith(`blob:`)?e.url:``);if(!t)return;let n=e.raw,r=n?.type||e.mime_type||``;return{type:this.isImageAttachment(e)?`image`:`file`,url:t,name:e.name,mime_type:r,size:n?.size}}).filter(e=>!!e)},uploadingAttachments(){return(this.attachmentFileList||[]).some(e=>this.isAttachmentUploading(e))},canSend(){return(!!this.prompt.trim()||this.attachments.length>0)&&!this.uploadingAttachments&&this.connected&&this.nodeOnline},composerHint(){return this.uploadingAttachments?this.$t(`codingBridge.session.uploadingAttachment`):this.providerCaps.length&&!this.currentProviderAvailable?this.$t(`codingBridge.session.providerUnavailableHint`,{name:this.providerName(this.provider)}):this.resumeHint?this.$t(`codingBridge.history.resumeHint`):this.$t(`codingBridge.session.enterHint`)},nodeCapabilities(){let e=this.currentNodeId;return e?this.$store.state.codingBridge?.capabilities?.[e]:void 0},providerCaps(){return this.nodeCapabilities?.providers??[]},currentProviderCap(){return this.providerCaps.find(e=>e.name===this.provider)},canEdit(){return this.readonly?!1:!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_edit},canRestoreCode(){return!!this.providerCaps.find(e=>e.name===this.activeProviderName)?.supports_code_restore},editingActive(){return!!this.editingEventId},currentProviderAvailable(){return this.providerCaps.length?this.currentProviderCap?.available!==!1:!0},providerOptions(){return this.providerCaps.length?this.providerCaps.map(e=>({value:e.name,label:e.label,available:e.available!==!1})):[{label:this.$t(`codingBridge.session.providerClaude`),value:`claude`,available:!0},{label:this.$t(`codingBridge.session.providerCodex`),value:`codex`,available:!0},{label:`GitHub Copilot`,value:`copilot`,available:!0}]},modelOptions(){return this.currentProviderCap?.models??[]},allowCustomModel(){return this.currentProviderCap?.allow_custom_model??!0},effortOptions(){let e=this.currentProviderCap?.efforts;return(e&&e.length?e:[``]).map(e=>({value:e,label:this.effortLabel(e)}))},permissionModeOptions(){let e=this.currentProviderCap?.permission_modes;return(e&&e.length?e:[`default`,`acceptEdits`,`plan`,`bypassPermissions`]).map(e=>({value:e,label:this.permissionModeLabel(e)}))},sessionMeta(){let e=this.currentSession;if(!e)return``;let t=[];return e.provider&&t.push(this.providerName(e.provider)),e.cwd&&t.push(e.cwd),e.model&&t.push(e.model),t.join(` · `)},activeProviderName(){return this.currentSession?.provider||this.provider},slashCommands(){let e=this.activeProviderName;return this.providerCaps.find(t=>t.name===e)?.commands??[]},slashMatches(){let e=this.prompt.match(/^\/(\S*)$/);if(!e)return[];let t=e[1].toLowerCase();return this.slashCommands.filter(e=>[e.name,...e.aliases??[]].some(e=>e.toLowerCase().startsWith(t)))},slashMenuVisible(){return this.slashMenuOpen&&this.slashMatches.length>0},diagnostics(){let e=[];return this.currentNodeId&&e.push({label:this.$t(`codingBridge.session.nodeId`),value:this.currentNodeId}),this.currentSessionId&&e.push({label:this.$t(`codingBridge.session.sessionId`),value:this.currentSessionId}),this.currentSession?.trace_id&&e.push({label:this.$t(`codingBridge.session.traceId`),value:this.currentSession.trace_id}),e}},watch:{events(){this.scrollToBottom()},pendingQuestion(){this.scrollToBottom()},thinking(){this.scrollToBottom()},currentSessionId(){this.scrollToBottom(),this.visibleCount=en,this.editingEventId=``,this.restoreCode=!1,this.syncSessionSettings()},currentNodeId(){this.requestCapabilities(),this.isNewSession&&this.restoreComposerPrefs()},providerCaps(){if(!this.isNewSession||!this.providerCaps.length)return;let e=this.providerCaps.find(e=>e.name===this.provider);if(!e||e.available===!1){let e=this.providerCaps.find(e=>e.available!==!1);e&&(this.provider=e.name)}},provider(){this.isNewSession&&(this.model=``,this.effort=``)},prompt(e){this.slashMenuOpen=/^\/\S*$/.test(e),this.slashActiveIndex>=this.slashMatches.length&&(this.slashActiveIndex=0)}},mounted(){this.requestCapabilities(),this.syncSessionSettings()},methods:{requestCapabilities(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getCapabilities`,this.currentNodeId)},effortLabel(e){let t={"":`codingBridge.session.effortDefault`,low:`codingBridge.session.effortLow`,medium:`codingBridge.session.effortMedium`,high:`codingBridge.session.effortHigh`,max:`codingBridge.session.effortMax`}[e];return t?this.$t(t):e},permissionModeLabel(e){let t={default:`codingBridge.session.permissionModeDefault`,acceptEdits:`codingBridge.session.permissionModeAcceptEdits`,plan:`codingBridge.session.permissionModePlan`,bypassPermissions:`codingBridge.session.permissionModeBypass`}[e];return t?this.$t(t):e},providerName(e){let t=this.providerCaps.find(t=>t.name===e);return t?t.label:{claude:this.$t(`codingBridge.session.providerClaude`),codex:this.$t(`codingBridge.session.providerCodex`),copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return nn[e]??null},syncSessionSettings(){let e=this.currentSession;if(!e){this.restoreComposerPrefs();return}let t=this.lastComposer;e.provider&&(this.provider=e.provider),this.model=e.model??``,this.customModelDraft=``,this.cwd=e.cwd??t.cwd??``,this.effort=e.effort??t.effort??``,this.permissionMode=e.permission_mode??t.permissionMode??`bypassPermissions`},selectModel(e){this.model=e,this.customModelDraft=``,this.closeModelPopover()},applyCustomModel(){let e=this.customModelDraft.trim();e&&(this.model=e,this.customModelDraft=``,this.closeModelPopover())},closeModelPopover(){this.$refs.modelPopover?.hide?.()},onComposerEnter(e){let t=e;t.isComposing||t.keyCode===229||t.shiftKey||t.ctrlKey||t.metaKey||t.altKey||(t.preventDefault(),this.onSend())},onComposerKeydown(e){let t=e;if(this.slashMenuVisible&&!t.isComposing&&t.keyCode!==229){if(t.key===`ArrowDown`){t.preventDefault(),this.moveSlash(1);return}if(t.key===`ArrowUp`){t.preventDefault(),this.moveSlash(-1);return}if(t.key===`Escape`){t.preventDefault(),this.slashMenuOpen=!1;return}if(t.key===`Tab`||t.key===`Enter`&&!t.shiftKey){t.preventDefault(),this.applySlash(this.slashMatches[this.slashActiveIndex]);return}}t.key===`Enter`&&this.onComposerEnter(t)},moveSlash(e){let t=this.slashMatches.length;t&&(this.slashActiveIndex=(this.slashActiveIndex+e+t)%t,this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-slash-menu__item--active`))?.scrollIntoView({block:`nearest`})}))},applySlash(e){e&&(this.prompt=`/${e.name} `,this.slashMenuOpen=!1,this.slashActiveIndex=0)},onSend(){if(!this.canSend)return;let e=this.attachments;if(this.editingEventId){this.$store.dispatch(`codingBridge/editPrompt`,{eventId:this.editingEventId,prompt:this.prompt,model:this.model,permissionMode:this.permissionMode,effort:this.effort,attachments:e.length?e:void 0,restoreCode:this.restoreCode}),this.resetComposer();return}this.currentNodeId&&this.$store.commit(`codingBridge/setLastComposer`,{node_id:this.currentNodeId,prefs:{cwd:this.cwd,provider:this.provider,model:this.model,permissionMode:this.permissionMode,effort:this.effort}}),this.$store.dispatch(`codingBridge/sendPrompt`,{prompt:this.prompt,cwd:this.cwd,model:this.model,permissionMode:this.permissionMode,provider:this.provider,effort:this.effort,attachments:e.length?e:void 0}),this.resetComposer()},resetComposer(){this.prompt=``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.editingEventId=``,this.restoreCode=!1,this.clearAttachments()},cancelEdit(){this.resetComposer()},onAnswerQuestion(e){this.$store.dispatch(`codingBridge/answerQuestion`,{request_id:e.tool_use_id,output:e.output})},onSkipQuestion(e){this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:e.tool_use_id,decision:`deny`})},beforeAttachmentUpload(e){return this.attachmentFileList.length>=$?(G.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:$})),!1):e.size>$t?(G.warning(this.$t(`codingBridge.session.attachmentTooLarge`)),!1):!0},onAttachmentChange(e){if(!e.url&&e.raw&&this.isImageAttachment(e))try{e.url=URL.createObjectURL(e.raw)}catch{}},onAttachmentSuccess(e,t){e?.file_url&&(this.revokeBlobUrl(t),t.url=e.file_url,t.response=e)},onAttachmentError(){G.error(this.$t(`codingBridge.session.attachmentUploadError`))},onAttachmentExceed(){G.warning(this.$t(`codingBridge.session.attachmentLimit`,{count:$}))},onTriggerAttachmentUpload(){this.$nextTick(()=>{let e=this.$refs.uploader?.$el;(e?.querySelector(`input.el-upload__input`)||e?.querySelector(`input[type="file"]`))?.click()})},isAttachmentUploading(e){return e.status===`ready`||e.status===`uploading`},isImageAttachment(e){return(e.raw?.type||``).startsWith(`image/`)?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(e.name||e.url||``)},attachmentPreviewUrl(e){return this.isImageAttachment(e)&&(e.url||e.response?.file_url)||``},removeAttachment(e,t){this.revokeBlobUrl(t),this.attachmentFileList.splice(e,1)},clearAttachments(){for(let e of this.attachmentFileList)this.revokeBlobUrl(e);this.attachmentFileList=[]},revokeBlobUrl(e){if(e.url?.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}},onInterrupt(){this.$store.dispatch(`codingBridge/interruptSession`)},onRetry(){this.$store.dispatch(`codingBridge/retryLastPrompt`)},onEditPrompt(e){this.canEdit&&(this.editingEventId=e.id,this.restoreCode=!1,this.prompt=e.text??``,this.slashMenuOpen=!1,this.slashActiveIndex=0,this.clearAttachments(),this.attachmentFileList=(e.attachments??[]).map((e,t)=>({name:e.name||e.url,url:e.url,status:`success`,percentage:100,uid:Date.now()+t,response:{file_url:e.url},mime_type:e.mime_type})),this.$nextTick(()=>{(this.$el?.querySelector?.(`.cb-composer__input textarea`))?.focus()}))},openDirectory(){this.directoryVisible=!0},onDirectorySelect(e){this.cwd=e},onNewSession(){this.$store.dispatch(`codingBridge/newSession`),this.restoreComposerPrefs(),this.resetComposer()},restoreComposerPrefs(){let e=this.lastComposer;this.cwd=e.cwd??``,this.provider=e.provider??`claude`,this.permissionMode=e.permissionMode??`bypassPermissions`,this.customModelDraft=``,this.$nextTick(()=>{this.model=e.model??``,this.effort=e.effort??``})},scrollToBottom(){this.$nextTick(()=>{let e=this.$refs.transcript;e&&(e.scrollTop=e.scrollHeight)})},loadEarlier(){let e=this.$refs.transcript,t=e?.scrollHeight??0;this.visibleCount+=tn,this.$nextTick(()=>{e&&(e.scrollTop=e.scrollHeight-t+e.scrollTop)})}}}),an={class:`session-view flex flex-col h-full bg-[var(--app-content-bg)]`},on={key:0,class:`flex-1 flex flex-col items-center justify-center text-center p-8 text-[var(--app-text-subtle)]`},sn={class:`text-sm`},cn={class:`flex items-center justify-between gap-3 px-5 py-3 border-b border-[var(--app-border-subtle)]`},ln={class:`flex items-center gap-2 min-w-0`},un=[`title`,`aria-label`],dn={class:`min-w-0`},fn={class:`flex items-center gap-2 font-medium`},pn={class:`truncate`},mn={key:0,class:`text-xs text-[var(--app-text-subtle)] truncate`},hn={key:0,class:`text-[var(--el-color-primary)]`},gn={class:`flex items-center gap-2 flex-none`},_n={key:0,class:`px-5 py-2 text-xs bg-[var(--el-color-warning-light-9)] text-[var(--el-color-warning)] border-b border-[var(--app-border-subtle)]`},vn={key:1,class:`flex flex-wrap items-center gap-x-4 gap-y-1 px-5 py-1.5 text-[11px] text-[var(--app-text-subtle)] border-b border-[var(--app-border-subtle)]`},yn={class:`opacity-70 flex-none`},bn=[`title`],xn={ref:`transcript`,class:`flex-1 min-h-0 overflow-y-auto px-5 py-4 flex flex-col gap-3`},Sn={key:0,class:`cb-skeleton`},Cn={class:`flex flex-col gap-4`},wn={class:`flex justify-end`},Tn={class:`flex flex-col gap-1.5`},En={class:`flex justify-end`},Dn={class:`flex flex-col gap-1.5`},On={key:1,class:`m-auto text-center text-sm text-[var(--app-text-subtle)]`},kn=[`title`],An={key:4,class:`flex justify-center pt-1`},jn={key:2,class:`cb-question-dock flex-none px-5`},Mn={class:`border-t border-[var(--app-border-subtle)] p-3`},Nn={key:0,class:`flex items-center gap-2 text-xs text-[var(--app-text-subtle)] px-1 py-2`},Pn={key:0,class:`mb-2 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-lg bg-[var(--el-color-primary-light-9)] px-3 py-2 text-xs text-[var(--app-text)]`},Fn={class:`inline-flex items-center gap-1.5`},In={class:`cb-composer rounded-2xl border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-2.5 transition-colors focus-within:border-[var(--el-color-primary-light-5)]`},Ln={key:0,class:`flex flex-wrap gap-2 pb-2`},Rn=[`src`,`alt`],zn={key:1,class:`flex h-8 w-8 items-center justify-center rounded bg-[var(--app-content-bg)]`},Bn=[`title`],Vn={key:2,class:`text-[10px] text-[var(--app-text-subtle)]`},Hn=[`title`,`aria-label`,`onClick`],Un={key:1,class:`cb-slash-menu`},Wn=[`onMousedown`,`onMouseenter`],Gn={class:`cb-slash-menu__name`},Kn={key:0,class:`cb-slash-menu__hint`},qn={key:1,class:`cb-slash-menu__desc`},Jn={ref:`attachmentUploadTrigger`,class:`block h-0 w-0`,"aria-hidden":`true`},Yn={class:`mt-1.5 flex items-center gap-1.5`},Xn=[`title`,`aria-label`],Zn={class:`flex min-w-0 flex-1 flex-wrap items-center gap-1.5`},Qn={type:`button`,class:`cb-pill`},$n=[`src`],er={class:`truncate`},tr=[`src`],nr={key:1,class:`ml-1 text-xs opacity-60`},rr={key:1,class:`cb-pill cb-pill--static`},ir=[`src`],ar={class:`truncate`},or={type:`button`,class:`cb-pill`},sr={class:`truncate`},cr={class:`cb-model-menu`},lr={class:`truncate`},ur=[`onClick`],dr={class:`truncate`},fr={key:0,class:`cb-model-custom`},pr={type:`button`,class:`cb-pill`},mr={class:`truncate`},hr={type:`button`,class:`cb-pill`},gr={class:`truncate`},_r={type:`button`,class:`cb-pill`},vr={class:`truncate`},yr=[`title`,`aria-label`],br={key:4,class:`cb-pill cb-pill--static`},xr={class:`truncate`},Sr={class:`text-[11px] text-[var(--app-text-subtle)] mt-1 px-1`};function Cr(d,m,ee,_,v,y){let b=u(`developer-icon`),x=u(`el-button`),S=u(`history-icon`),C=u(`add-icon`),w=u(`copy-to-clipboard`),T=u(`el-skeleton-item`),E=u(`el-skeleton`),te=u(`up-icon`),D=u(`transcript-item`),ne=u(`thinking-indicator`),O=u(`redo-icon`),re=u(`ask-user-question-card`),k=u(`view-icon`),ie=u(`edit-icon`),A=u(`el-checkbox`),ae=u(`file-icon`),oe=u(`close-icon`),j=u(`el-input`),se=u(`el-upload`),ce=u(`attachment-icon`),M=u(`code-icon`),N=u(`expand-down-icon`),P=u(`confirm-icon`),F=u(`el-dropdown-item`),I=u(`el-dropdown-menu`),L=u(`el-dropdown`),le=u(`ai-icon`),R=u(`el-popover`),ue=u(`performance-icon`),de=u(`security-icon`),z=u(`folder-open-icon`),B=u(`stop-icon`),V=u(`directory-dialog`);return g(),s(`div`,an,[d.currentNode?(g(),s(l,{key:1},[e(`div`,cn,[e(`div`,ln,[e(`button`,{type:`button`,class:`cb-devices-btn md:hidden`,title:d.$t(`codingBridge.nodeList.title`),"aria-label":d.$t(`codingBridge.nodeList.title`),onClick:m[1]||=e=>d.$emit(`devices`)},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,un),e(`div`,dn,[e(`div`,fn,[e(`span`,pn,i(d.currentNode.name),1),e(`span`,{class:n([`inline-block w-2 h-2 rounded-full flex-none`,d.nodeOnline?`bg-[var(--el-color-success)]`:`bg-[var(--app-text-subtle)]`])},null,2)]),d.currentSession?(g(),s(`div`,mn,[e(`span`,null,i(d.sessionMeta),1),d.replayLabel?(g(),s(`span`,hn,` · `+i(d.replayLabel),1)):o(``,!0)])):o(``,!0)])]),e(`div`,gn,[a(x,{size:`small`,round:``,onClick:m[2]||=e=>d.$emit(`history`)},{default:p(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.history.button`)),1)]),_:1}),d.currentSessionId?(g(),f(x,{key:0,size:`small`,round:``,onClick:d.onNewSession},{default:p(()=>[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])):o(``,!0)])]),d.nodeOnline?o(``,!0):(g(),s(`div`,_n,i(d.$t(`codingBridge.session.deviceOffline`)),1)),d.diagnostics.length?(g(),s(`div`,vn,[(g(!0),s(l,null,h(d.diagnostics,t=>(g(),s(`span`,{key:t.label,class:`inline-flex items-center gap-1 min-w-0`},[e(`span`,yn,i(t.label)+`:`,1),e(`span`,{class:`font-mono break-all`,title:t.value},i(t.value),9,bn),a(w,{content:t.value,class:`inline-block flex-none`},null,8,[`content`])]))),128))])):o(``,!0),e(`div`,xn,[d.historyLoading&&!d.events.length?(g(),s(`div`,Sn,[a(E,{animated:``},{template:p(()=>[e(`div`,Cn,[e(`div`,wn,[a(T,{variant:`rect`,class:`cb-sk cb-sk--user`})]),e(`div`,Tn,[a(T,{variant:`text`,style:{width:`55%`}}),a(T,{variant:`text`,style:{width:`88%`}}),a(T,{variant:`text`,style:{width:`70%`}})]),a(T,{variant:`rect`,class:`cb-sk cb-sk--tool`}),e(`div`,En,[a(T,{variant:`rect`,class:`cb-sk cb-sk--user-sm`})]),e(`div`,Dn,[a(T,{variant:`text`,style:{width:`80%`}}),a(T,{variant:`text`,style:{width:`45%`}})])])]),_:1})])):d.events.length?o(``,!0):(g(),s(`div`,On,i(d.$t(`codingBridge.session.startHint`)),1)),d.hiddenEventCount>0?(g(),s(`button`,{key:2,type:`button`,class:`cb-load-earlier mx-auto mb-1 flex items-center gap-1.5 rounded-full border border-[var(--app-border-subtle)] bg-[var(--app-content-bg)] px-3 py-1 text-xs text-[var(--app-text-subtle)] hover:text-[var(--el-color-primary)]`,title:`+${d.hiddenEventCount}`,onClick:m[3]||=(...e)=>d.loadEarlier&&d.loadEarlier(...e)},[a(te,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.hiddenEventCount),1)],8,kn)):o(``,!0),(g(!0),s(l,null,h(d.visibleEvents,e=>(g(),f(D,{key:e.id,event:e,editable:d.canEdit,onEdit:d.onEditPrompt},null,8,[`event`,`editable`,`onEdit`]))),128)),d.thinking?(g(),f(ne,{key:3})):o(``,!0),d.canRetry?(g(),s(`div`,An,[a(x,{size:`small`,round:``,onClick:d.onRetry},{default:p(()=>[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.retry`)),1)]),_:1},8,[`onClick`])])):o(``,!0)],512),d.pendingQuestion?(g(),s(`div`,jn,[(g(),f(re,{key:d.pendingQuestion.request_id,"tool-use-id":d.pendingQuestion.request_id,payload:d.pendingQuestion.payload,onSubmit:d.onAnswerQuestion,onSkip:d.onSkipQuestion},null,8,[`tool-use-id`,`payload`,`onSubmit`,`onSkip`]))])):o(``,!0),e(`div`,Mn,[d.readonly?(g(),s(`div`,Nn,[a(k,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(d.$t(`codingBridge.history.readonly`)),1),a(x,{class:`ml-auto`,size:`small`,round:``,onClick:d.onNewSession},{default:p(()=>[r(i(d.$t(`codingBridge.session.newSession`)),1)]),_:1},8,[`onClick`])])):(g(),s(l,{key:1},[d.editingActive?(g(),s(`div`,Pn,[e(`span`,Fn,[a(ie,{class:`text-[var(--el-color-primary)]`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.session.editingBanner`)),1)]),d.canRestoreCode?(g(),f(A,{key:0,modelValue:d.restoreCode,"onUpdate:modelValue":m[4]||=e=>d.restoreCode=e,size:`small`,class:`cb-restore-code`},{default:p(()=>[r(i(d.$t(`codingBridge.session.editRestoreCode`)),1)]),_:1},8,[`modelValue`])):o(``,!0),e(`button`,{type:`button`,class:`ml-auto cb-edit-cancel`,onClick:m[5]||=(...e)=>d.cancelEdit&&d.cancelEdit(...e)},i(d.$t(`codingBridge.session.editCancel`)),1)])):o(``,!0),e(`div`,In,[d.attachmentFileList.length?(g(),s(`div`,Ln,[(g(!0),s(l,null,h(d.attachmentFileList,(t,n)=>(g(),s(`div`,{key:t.uid||t.name||n,class:`group relative flex max-w-[220px] items-center gap-2 rounded-md border border-[var(--app-border-subtle)] bg-[var(--app-sidebar-bg)] px-2 py-1.5 text-xs`},[d.attachmentPreviewUrl(t)?(g(),s(`img`,{key:0,src:d.attachmentPreviewUrl(t),class:`h-8 w-8 rounded object-cover`,alt:d.$t(`codingBridge.session.attachmentImageAlt`)},null,8,Rn)):(g(),s(`span`,zn,[a(ae,{size:`1em`,"aria-hidden":`true`,focusable:`false`})])),e(`span`,{class:`min-w-0 flex-1 truncate`,title:t.name},i(t.name),9,Bn),d.isAttachmentUploading(t)?(g(),s(`span`,Vn,i(Math.round(t.percentage||0))+`% `,1)):o(``,!0),e(`button`,{type:`button`,class:`flex h-5 w-5 items-center justify-center rounded-full text-[var(--app-text-subtle)] hover:bg-[var(--app-content-hover-bg)] hover:text-[var(--el-color-danger)]`,title:d.$t(`codingBridge.session.removeAttachment`),"aria-label":d.$t(`codingBridge.session.removeAttachment`),onClick:e=>d.removeAttachment(n,t)},[a(oe,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Hn)]))),128))])):o(``,!0),d.slashMenuVisible?(g(),s(`ul`,Un,[(g(!0),s(l,null,h(d.slashMatches,(r,a)=>(g(),s(`li`,{key:r.name,class:n([`cb-slash-menu__item`,{"cb-slash-menu__item--active":a===d.slashActiveIndex}]),onMousedown:t(e=>d.applySlash(r),[`prevent`]),onMouseenter:e=>d.slashActiveIndex=a},[e(`span`,Gn,`/`+i(r.name),1),r.argument_hint?(g(),s(`span`,Kn,i(r.argument_hint),1)):o(``,!0),r.description?(g(),s(`span`,qn,i(r.description),1)):o(``,!0)],42,Wn))),128))])):o(``,!0),a(j,{modelValue:d.prompt,"onUpdate:modelValue":m[6]||=e=>d.prompt=e,type:`textarea`,autosize:{minRows:2,maxRows:12},resize:`none`,class:`cb-composer__input`,placeholder:d.$t(`codingBridge.session.promptPlaceholder`),onKeydown:d.onComposerKeydown},null,8,[`modelValue`,`placeholder`,`onKeydown`]),a(se,{ref:`uploader`,"file-list":d.attachmentFileList,"onUpdate:fileList":m[7]||=e=>d.attachmentFileList=e,class:`h-0 w-0 overflow-hidden opacity-0`,name:`file`,action:d.uploadUrl,headers:d.headers,multiple:!0,limit:d.maxAttachments,"show-file-list":!1,"before-upload":d.beforeAttachmentUpload,"on-change":d.onAttachmentChange,"on-success":d.onAttachmentSuccess,"on-error":d.onAttachmentError,"on-exceed":d.onAttachmentExceed},{default:p(()=>[e(`span`,Jn,null,512)]),_:1},8,[`file-list`,`action`,`headers`,`limit`,`before-upload`,`on-change`,`on-success`,`on-error`,`on-exceed`]),e(`div`,Yn,[e(`button`,{type:`button`,class:`cb-icon-btn`,title:d.$t(`codingBridge.session.attachFile`),"aria-label":d.$t(`codingBridge.session.attachFile`),onClick:m[8]||=(...e)=>d.onTriggerAttachmentUpload&&d.onTriggerAttachmentUpload(...e)},[a(ce,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Xn),e(`div`,Zn,[d.isNewSession?(g(),f(L,{key:0,trigger:`click`,onCommand:m[9]||=e=>d.provider=e},{dropdown:p(()=>[a(I,null,{default:p(()=>[(g(!0),s(l,null,h(d.providerOptions,e=>(g(),f(F,{key:e.value,command:e.value,disabled:!e.available},{default:p(()=>[a(P,{class:n([`mr-2`,e.value===d.provider?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),d.providerIcon(e.value)?(g(),s(`img`,{key:0,src:d.providerIcon(e.value).src,class:n([`cb-pill__brand mr-1.5`,{"cb-pill__brand--invert":d.providerIcon(e.value).invertOnDark}]),alt:``},null,10,tr)):o(``,!0),r(` `+i(e.label)+` `,1),e.available?o(``,!0):(g(),s(`span`,nr,i(d.$t(`codingBridge.session.providerUnavailable`)),1))]),_:2},1032,[`command`,`disabled`]))),128))]),_:1})]),default:p(()=>[e(`button`,Qn,[d.providerIcon(d.provider)?(g(),s(`img`,{key:0,src:d.providerIcon(d.provider).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.provider).invertOnDark}]),alt:``},null,10,$n)):(g(),f(M,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,er,i(d.providerName(d.provider)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})):(g(),s(`span`,rr,[d.providerIcon(d.currentSession?.provider||`claude`)?(g(),s(`img`,{key:0,src:d.providerIcon(d.currentSession?.provider||`claude`).src,class:n([`cb-pill__brand`,{"cb-pill__brand--invert":d.providerIcon(d.currentSession?.provider||`claude`).invertOnDark}]),alt:``},null,10,ir)):(g(),f(M,{key:1,class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),e(`span`,ar,i(d.providerName(d.currentSession?.provider||`claude`)),1)])),a(R,{ref:`modelPopover`,trigger:`click`,placement:`top-start`,width:260},{reference:p(()=>[e(`button`,or,[a(le,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,sr,i(d.model||d.$t(`codingBridge.session.modelDefault`)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:p(()=>[e(`div`,cr,[e(`button`,{type:`button`,class:`cb-model-option`,onClick:m[10]||=e=>d.selectModel(``)},[a(P,{class:n([`cb-model-option__check`,d.model?`opacity-0`:`opacity-100`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,lr,i(d.$t(`codingBridge.session.modelDefault`)),1)]),(g(!0),s(l,null,h(d.modelOptions,t=>(g(),s(`button`,{key:t.value,type:`button`,class:`cb-model-option`,onClick:e=>d.selectModel(t.value)},[a(P,{class:n([`cb-model-option__check`,t.value===d.model?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),e(`span`,dr,i(t.label),1)],8,ur))),128)),d.allowCustomModel?(g(),s(`div`,fr,[a(j,{modelValue:d.customModelDraft,"onUpdate:modelValue":m[11]||=e=>d.customModelDraft=e,size:`small`,placeholder:d.$t(`codingBridge.session.modelPlaceholder`),onKeyup:c(d.applyCustomModel,[`enter`])},{append:p(()=>[a(x,{disabled:!d.customModelDraft.trim(),"aria-label":d.$t(`common.button.confirm`),title:d.$t(`common.button.confirm`),onClick:d.applyCustomModel},{default:p(()=>[a(P,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`disabled`,`aria-label`,`title`,`onClick`])]),_:1},8,[`modelValue`,`placeholder`,`onKeyup`])])):o(``,!0)])]),_:1},512),d.effortOptions.length>1?(g(),f(L,{key:2,trigger:`click`,onCommand:m[12]||=e=>d.effort=e},{dropdown:p(()=>[a(I,null,{default:p(()=>[(g(!0),s(l,null,h(d.effortOptions,e=>(g(),f(F,{key:e.value,command:e.value},{default:p(()=>[a(P,{class:n([`mr-2`,e.value===d.effort?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:p(()=>[e(`button`,pr,[a(ue,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,mr,i(d.effortLabel(d.effort)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1})):o(``,!0),a(L,{trigger:`click`,onCommand:m[13]||=e=>d.permissionMode=e},{dropdown:p(()=>[a(I,null,{default:p(()=>[(g(!0),s(l,null,h(d.permissionModeOptions,e=>(g(),f(F,{key:e.value,command:e.value},{default:p(()=>[a(P,{class:n([`mr-2`,e.value===d.permissionMode?`opacity-100`:`opacity-0`]),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`class`]),r(` `+i(e.label),1)]),_:2},1032,[`command`]))),128))]),_:1})]),default:p(()=>[e(`button`,hr,[a(de,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,gr,i(d.permissionModeLabel(d.permissionMode)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),_:1}),d.canPickCwd?(g(),f(R,{key:3,trigger:`click`,placement:`top-start`,width:320},{reference:p(()=>[e(`button`,_r,[a(z,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,vr,i(d.cwd||d.$t(`codingBridge.session.cwdDefault`)),1),a(N,{class:`cb-pill__caret`,size:`1em`,"aria-hidden":`true`,focusable:`false`})])]),default:p(()=>[a(j,{modelValue:d.cwd,"onUpdate:modelValue":m[17]||=e=>d.cwd=e,size:`small`,clearable:``,class:`cb-cwd-input`,placeholder:d.$t(`codingBridge.session.cwdPlaceholder`)},{suffix:p(()=>[e(`span`,{class:`cb-cwd-browse`,role:`button`,tabindex:`0`,title:d.$t(`codingBridge.directory.title`),"aria-label":d.$t(`codingBridge.directory.title`),onClick:m[14]||=(...e)=>d.openDirectory&&d.openDirectory(...e),onKeydown:[m[15]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`enter`]),m[16]||=c(t((...e)=>d.openDirectory&&d.openDirectory(...e),[`prevent`]),[`space`])]},[a(z,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],40,yr)]),_:1},8,[`modelValue`,`placeholder`])]),_:1})):d.currentSession?.cwd?(g(),s(`span`,br,[a(z,{class:`cb-pill__icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,xr,i(d.currentSession?.cwd),1)])):o(``,!0)]),d.running?(g(),f(x,{key:0,circle:``,"aria-label":d.$t(`common.button.stop`),title:d.$t(`common.button.stop`),onClick:d.onInterrupt},{default:p(()=>[a(B,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`,`onClick`])):o(``,!0),a(x,{type:`primary`,round:``,disabled:!d.canSend,onClick:d.onSend},{default:p(()=>[r(i(d.editingActive?d.$t(`codingBridge.session.editSubmit`):d.$t(`codingBridge.session.send`)),1)]),_:1},8,[`disabled`,`onClick`])])]),e(`p`,Sr,i(d.composerHint),1)],64))])],64)):(g(),s(`div`,on,[a(b,{class:`text-4xl mb-3`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`p`,sn,i(d.$t(`codingBridge.session.noDevice`)),1),a(x,{class:`md:hidden mt-4`,round:``,onClick:m[0]||=e=>d.$emit(`devices`)},{default:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(d.$t(`codingBridge.nodeList.title`)),1)]),_:1})])),a(V,{visible:d.directoryVisible,"onUpdate:visible":m[18]||=e=>d.directoryVisible=e,"initial-path":d.cwd,onSelect:d.onDirectorySelect},null,8,[`visible`,`initial-path`,`onSelect`])])}var wr=U(rn,[[`render`,Cr],[`__scopeId`,`data-v-05e55dc1`]]),Tr=_({name:`CodingBridgePairDialog`,components:{LinkIcon:I,ElDialog:J,ElInput:Y,ElButton:H},props:{visible:{type:Boolean,default:!1},initialCode:{type:String,default:``}},emits:[`update:visible`],data(){return{code:``}},computed:{claiming(){return this.$store.state.codingBridge?.status?.claimPair===W.Request}},watch:{visible(e){e&&this.initialCode&&(this.code=this.initialCode)},initialCode(e){e&&(this.code=e)}},methods:{async onClaim(){let e=this.code.trim();if(e)try{let t=await this.$store.dispatch(`codingBridge/claimPair`,e);G.success(this.$t(`codingBridge.pair.success`,{name:t})),this.code=``,this.$emit(`update:visible`,!1)}catch(e){let t=e?.response?.status;t===404?G.error(this.$t(`codingBridge.pair.invalidCode`)):t===409?G.error(this.$t(`codingBridge.pair.usedCode`)):G.error(this.$t(`codingBridge.pair.failed`))}}}}),Er={class:`content`},Dr={class:`text-sm text-[var(--app-text-subtle)] mb-4`},Or={class:`steps list-none m-0 p-0 mb-4`},kr={class:`flex gap-3 mb-3`},Ar={class:`flex-1 min-w-0`},jr={class:`text-sm mb-1`},Mr={class:`flex gap-3 mb-3`},Nr={class:`flex-1 min-w-0`},Pr={class:`text-sm mb-1`},Fr={class:`flex gap-3`},Ir={class:`flex-1 min-w-0`},Lr={class:`text-sm`};function Rr(t,n,o,s,l,d){let m=u(`el-input`),h=u(`link-icon`),ee=u(`el-button`),_=u(`el-dialog`);return g(),f(_,{"model-value":t.visible,width:`520px`,title:t.$t(`codingBridge.pair.title`),center:``,"onUpdate:modelValue":n[1]||=e=>t.$emit(`update:visible`,e)},{default:p(()=>[e(`div`,Er,[e(`p`,Dr,i(t.$t(`codingBridge.pair.intro`)),1),e(`ol`,Or,[e(`li`,kr,[n[3]||=e(`span`,{class:`step-index`},`1`,-1),e(`div`,Ar,[e(`p`,jr,i(t.$t(`codingBridge.pair.step1`)),1),n[2]||=e(`code`,{class:`cmd`},`pip install coding-bridge`,-1)])]),e(`li`,Mr,[n[5]||=e(`span`,{class:`step-index`},`2`,-1),e(`div`,Nr,[e(`p`,Pr,i(t.$t(`codingBridge.pair.step2`)),1),n[4]||=e(`code`,{class:`cmd`},`coding-bridge up`,-1)])]),e(`li`,Fr,[n[6]||=e(`span`,{class:`step-index`},`3`,-1),e(`div`,Ir,[e(`p`,Lr,i(t.$t(`codingBridge.pair.step3`)),1)])])]),a(m,{modelValue:t.code,"onUpdate:modelValue":n[0]||=e=>t.code=e,size:`large`,class:`mb-3`,placeholder:t.$t(`codingBridge.pair.codePlaceholder`),clearable:``,onKeyup:c(t.onClaim,[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeyup`]),a(ee,{type:`primary`,round:``,class:`w-full`,loading:t.claiming,disabled:!t.code.trim(),onClick:t.onClaim},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.pair.claim`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])]),_:1},8,[`model-value`,`title`])}var zr=U(Tr,[[`render`,Rr],[`__scopeId`,`data-v-54bd85f1`]]),Br=_({name:`CodingBridgePermissionDialog`,components:{CloseIcon:q,CodeIcon:k,ConfirmIcon:O,ElDialog:J,ElButton:H},computed:{request(){return(this.$store.state.codingBridge?.permissions??[]).find(e=>!Je(e))},hasInput(){return!!this.request?.input&&Object.keys(this.request.input).length>0},inputText(){try{return JSON.stringify(this.request?.input,null,2)}catch{return String(this.request?.input??``)}}},methods:{onAllow(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`allow`})},onDeny(){this.request&&this.$store.dispatch(`codingBridge/resolvePermission`,{request_id:this.request.request_id,decision:`deny`})}}}),Vr={key:0,class:`content`},Hr={class:`text-sm text-[var(--app-text-subtle)] mb-3`},Ur={class:`rounded-md border border-[var(--app-border-subtle)] p-3 mb-3`},Wr={class:`flex items-center gap-2 font-medium`},Gr={key:0,class:`text-xs text-[var(--app-text-subtle)] mt-1`},Kr={key:1,class:`mt-2 text-xs overflow-x-auto whitespace-pre-wrap break-words text-[var(--app-text-subtle)] max-h-[200px]`},qr={class:`flex justify-end gap-2`};function Jr(t,n,c,l,d,m){let h=u(`code-icon`),ee=u(`close-icon`),_=u(`el-button`),v=u(`confirm-icon`),y=u(`el-dialog`);return g(),f(y,{"model-value":!!t.request,width:`480px`,title:t.$t(`codingBridge.permission.title`),"close-on-click-modal":!1,"show-close":!1,center:``},{footer:p(()=>[e(`div`,qr,[a(_,{round:``,onClick:t.onDeny},{default:p(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.deny`)),1)]),_:1},8,[`onClick`]),a(_,{type:`primary`,round:``,onClick:t.onAllow},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`codingBridge.permission.allow`)),1)]),_:1},8,[`onClick`])])]),default:p(()=>[t.request?(g(),s(`div`,Vr,[e(`p`,Hr,i(t.$t(`codingBridge.permission.subtitle`)),1),e(`div`,Ur,[e(`div`,Wr,[a(h,{size:`1em`,"aria-hidden":`true`,focusable:`false`}),e(`span`,null,i(t.request.display_name||t.request.title||t.request.tool),1)]),t.request.description?(g(),s(`p`,Gr,i(t.request.description),1)):o(``,!0),t.hasInput?(g(),s(`pre`,Kr,i(t.inputText),1)):o(``,!0)])])):o(``,!0)]),_:1},8,[`model-value`,`title`])}var Yr=U(Br,[[`render`,Jr]]),Xr={claude:{src:Xt,invertOnDark:!1},codex:{src:Zt,invertOnDark:!0},copilot:{src:Qt,invertOnDark:!0}},Zr=_({name:`CodingBridgeHistoryDrawer`,components:{CodeIcon:k,RedoIcon:V,ElDrawer:b,ElButton:H},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`],computed:{currentNodeId(){return this.$store.state.codingBridge?.currentNodeId},loading(){return this.$store.state.codingBridge?.status?.getHistory===W.Request},sessions(){let e=this.currentNodeId;return[...e?this.$store.state.codingBridge?.history?.[e]??[]:[]].sort((e,t)=>(t.updated_at??0)-(e.updated_at??0))}},watch:{visible(e){e&&this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)}},methods:{providerLabel(e){return{claude:`Claude Code`,codex:`Codex`,copilot:`GitHub Copilot`}[e]??e},providerIcon(e){return Xr[e]??null},refresh(){this.currentNodeId&&this.$store.dispatch(`codingBridge/getHistory`,this.currentNodeId)},open(e){this.currentNodeId&&(this.$store.dispatch(`codingBridge/reattachSession`,{node_id:this.currentNodeId,provider:e.provider,session_id:e.session_id}),this.$emit(`update:visible`,!1))},formatTime(e){try{return new Date(e).toLocaleString()}catch{return``}}}}),Qr={class:`flex flex-col h-full`},$r={class:`flex items-center justify-between mb-3`},ei={class:`text-xs text-[var(--app-text-subtle)] m-0`},ti={key:0,class:`m-auto text-sm text-[var(--app-text-subtle)]`},ni={key:1,class:`m-auto text-sm text-[var(--app-text-subtle)]`},ri={key:2,class:`m-auto text-sm text-[var(--app-text-subtle)] text-center`},ii={key:3,class:`list-none m-0 p-0 flex-1 overflow-y-auto flex flex-col gap-2`},ai=[`onClick`],oi={class:`flex items-center gap-2 mb-1`},si=[`src`,`alt`],ci={class:`text-sm font-medium truncate flex-1`},li=[`title`],ui={class:`text-[11px] text-[var(--app-text-subtle)] truncate`},di={key:0},fi={key:1},pi={class:`text-[11px] text-[var(--app-text-subtle)] mt-0.5`},mi={key:0},hi={key:1};function gi(t,c,d,m,ee,_){let v=u(`redo-icon`),y=u(`el-button`),b=u(`code-icon`),x=u(`el-drawer`);return g(),f(x,{"model-value":t.visible,direction:`rtl`,size:`380px`,title:t.$t(`codingBridge.history.title`),"onUpdate:modelValue":c[0]||=e=>t.$emit(`update:visible`,e)},{default:p(()=>[e(`div`,Qr,[e(`div`,$r,[e(`p`,ei,i(t.$t(`codingBridge.history.intro`)),1),a(y,{size:`small`,round:``,loading:t.loading,onClick:t.refresh},{default:p(()=>[t.loading?o(``,!0):(g(),f(v,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(t.$t(`codingBridge.history.refresh`)),1)]),_:1},8,[`loading`,`onClick`])]),t.currentNodeId?t.loading&&!t.sessions.length?(g(),s(`div`,ni,i(t.$t(`codingBridge.history.loading`)),1)):t.sessions.length?(g(),s(`ul`,ii,[(g(!0),s(l,null,h(t.sessions,r=>(g(),s(`li`,{key:r.provider+`:`+r.session_id,class:`item rounded-lg p-3 cursor-pointer border border-[var(--app-border-subtle)]`,onClick:e=>t.open(r)},[e(`div`,oi,[t.providerIcon(r.provider)?(g(),s(`img`,{key:0,src:t.providerIcon(r.provider).src,class:n([`provider-icon`,{"provider-icon--invert":t.providerIcon(r.provider).invertOnDark}]),alt:t.providerLabel(r.provider)},null,10,si)):(g(),f(b,{key:1,class:`provider-icon`,title:t.providerLabel(r.provider),size:`1em`,"aria-hidden":`true`,focusable:`false`},null,8,[`title`])),e(`span`,ci,i(r.title),1),r.running?(g(),s(`span`,{key:2,class:`running-dot`,title:t.$t(`codingBridge.history.running`)},null,8,li)):o(``,!0)]),e(`div`,ui,[r.cwd?(g(),s(`span`,di,i(r.cwd),1)):o(``,!0),r.git_branch?(g(),s(`span`,fi,` · `+i(r.git_branch),1)):o(``,!0)]),e(`div`,pi,[r.updated_at?(g(),s(`span`,mi,i(t.formatTime(r.updated_at)),1)):o(``,!0),r.message_count?(g(),s(`span`,hi,` · `+i(t.$t(`codingBridge.history.messages`,{count:r.message_count})),1)):o(``,!0)])],8,ai))),128))])):(g(),s(`div`,ri,i(t.$t(`codingBridge.history.empty`)),1)):(g(),s(`div`,ti,i(t.$t(`codingBridge.session.noDevice`)),1))])]),_:1},8,[`model-value`,`title`])}var _i=_({name:`CodingBridgeIndex`,components:{ElDrawer:b,NodeList:Ke,SessionView:wr,PairDialog:zr,PermissionDialog:Yr,HistoryDrawer:U(Zr,[[`render`,gi],[`__scopeId`,`data-v-af006e93`]])},data(){return{drawer:!1,pairVisible:!1,historyVisible:!1,initialCode:``}},mounted(){this.$store.dispatch(`codingBridge/connect`),this.$store.dispatch(`codingBridge/getNodes`);let e=this.$route.query.code;typeof e==`string`&&e&&(this.initialCode=e,this.pairVisible=!0),this.restoreFromUrl(),this.handleNotificationDeepLink(),this.cleanUrl()},beforeUnmount(){this.$store.dispatch(`codingBridge/disconnect`)},methods:{openPair(){this.initialCode=``,this.pairVisible=!0},openPairFromDrawer(){this.drawer=!1,this.openPair()},restoreFromUrl(){let e=this.$route.query,t=typeof e.session==`string`?e.session:``,n=typeof e.node==`string`?e.node:``;if(!t||!n)return;let r=e.provider===`codex`||e.provider===`copilot`?e.provider:`claude`;this.$store.commit(`codingBridge/setCurrentNode`,n),this.$store.commit(`codingBridge/setHistoryRef`,{node_id:n,provider:r,session_id:t}),this.$store.dispatch(`codingBridge/getHistory`,n),this.$store.dispatch(`codingBridge/requestSessions`,n)},cleanUrl(){let e=this.$route.query,t=[`session`,`node`,`provider`,`request`,`code`];if(!t.some(t=>t in e))return;let n={...e};t.forEach(e=>delete n[e]),this.$router.replace({query:n}).catch(()=>{})},handleNotificationDeepLink(){let e=this.$route.query.node;typeof e==`string`&&e&&(this.$route.query.session||this.$store.dispatch(`codingBridge/selectNode`,e),this.$store.dispatch(`codingBridge/requestPendingPermissions`,e))}}}),vi={class:`coding-bridge flex flex-row h-full relative`};function yi(e,t,n,r,i,o){let c=u(`node-list`),l=u(`session-view`),d=u(`el-drawer`),f=u(`pair-dialog`),m=u(`permission-dialog`),h=u(`history-drawer`);return g(),s(`div`,vi,[a(c,{class:`sidebar w-[300px] flex-none`,onPair:e.openPair},null,8,[`onPair`]),a(l,{class:`flex-1 min-w-0`,onHistory:t[0]||=t=>e.historyVisible=!0,onDevices:t[1]||=t=>e.drawer=!0}),a(d,{modelValue:e.drawer,"onUpdate:modelValue":t[2]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`300px`,class:`drawer`},{default:p(()=>[a(c,{onPair:e.openPairFromDrawer},null,8,[`onPair`])]),_:1},8,[`modelValue`]),a(f,{visible:e.pairVisible,"onUpdate:visible":t[3]||=t=>e.pairVisible=t,"initial-code":e.initialCode},null,8,[`visible`,`initial-code`]),a(m),a(h,{visible:e.historyVisible,"onUpdate:visible":t[4]||=t=>e.historyVisible=t},null,8,[`visible`])])}var bi=U(_i,[[`render`,yi],[`__scopeId`,`data-v-2879fe0f`]]);export{bi as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,ht as l,it as u,j as d,mt as f,qt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-COeLiCZz.js";import{t as b}from"./upload-lY0v4ivH.js";import{t as x}from"./tooltip-CdwmIuyi.js";import{t as S}from"./alert-CRCLZLDm.js";import{t as C}from"./drawer-BRlhyO2f.js";import{t as w}from"./input-number-BgWs_lAF.js";import{t as T}from"./slider-D2zgVB9i.js";import{n as E}from"./taskDrawerMixin-BV7T00JI.js";import{t as D}from"./clock-DK3A1641.js";import{t as ee}from"./CopyToClipboard-CUgv3RMH.js";import{r as O,t as k}from"./PromptTextarea-CKaWFNQd.js";import{t as A}from"./info-DWMxOY1R.js";import{t as j}from"./triangle-alert-BnFsEUpB.js";import{t as M}from"./upload-C-Vgck-0.js";import{t as N}from"./wand-sparkles-CFb_FeMs.js";import{cr as te,dr as P,lr as F,ur as I}from"./constants-D-3QKDN1.js";import{$t as L,Ai as R,Bt as z,E as B,Ht as V,In as H,Vt as U,Wt as W,ei as G,gi as K,mr as q,ri as J,zt as Y}from"./index-BL0bUCVy.js";import{t as X}from"./ImagePreview-LOhAiiTN.js";import{t as Z}from"./Consumption-D5IaOx8Q.js";import{a as Q,n as ne,r as re,t as ie}from"./pagination-BHkO0PTu.js";import{t as ae}from"./VideoPlayer-CSTH3vgH.js";import{t as oe}from"./ApiCodeButton-DXiZffUI.js";import{t as se}from"./BotPlaceholder-vAnmSqdw.js";var ce=_({name:`LayoutPixverse`,components:{MagicIcon:N,ElDrawer:C,ElButton:R},mixins:[E]}),le={class:`main flex flex-row flex-1`},ue={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},de={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function fe(t,n,r,a,s,d){let p=c(`magic-icon`),m=c(`el-button`),_=c(`el-drawer`);return h(),o(`div`,le,[e(`div`,ue,[u(t.$slots,`config`,{},void 0,!0)]),e(`div`,de,[u(t.$slots,`result`,{},void 0,!0)]),l(i(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:f(()=>[i(p,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:f(()=>[u(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var pe=B(ce,[[`render`,fe],[`__scopeId`,`data-v-9da6c14b`]]),me=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`v3.5`,label:`v3.5`},{value:`v4`,label:`v4`},{value:`v4.5`,label:`v4.5`}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.model},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,model:e})}}},mounted(){this.value||=F}}),he={class:`field`},ge={class:`title font-bold`};function _e(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,he,[e(`h2`,ge,r(t.$t(`pixverse.name.model`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ve=B(me,[[`render`,_e],[`__scopeId`,`data-v-e8f337ca`]]),ye=_({name:`QualitySelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`360p`,label:`360p`},{value:`540p`,label:`540p`},{value:`720p`,label:`720p`},{value:`1080p`,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.quality},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,quality:e})}}},mounted(){this.value||=P}}),be={class:`field`},xe={class:`title font-bold`};function Se(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,be,[e(`h2`,xe,r(t.$t(`pixverse.name.quality`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ce=B(ye,[[`render`,Se],[`__scopeId`,`data-v-64aeaae9`]]),we=_({name:`MotionSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`normal`,label:this.$t(`pixverse.name.motion1`)},{value:`fast`,label:this.$t(`pixverse.name.motion2`)}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.motion},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,motion:e})}}},mounted(){this.value||=I}}),Te={class:`field`},Ee={class:`title font-bold`};function De(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Te,[e(`h2`,Ee,r(t.$t(`pixverse.name.motion`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Oe=B(we,[[`render`,De],[`__scopeId`,`data-v-94237408`]]),ke=_({name:`StyleSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`cyberpunk`,label:this.$t(`pixverse.name.style1`)},{value:`anime`,label:this.$t(`pixverse.name.style2`)},{value:`comic`,label:this.$t(`pixverse.name.style3`)},{value:`clay`,label:this.$t(`pixverse.name.style4`)},{value:`3d_animation`,label:this.$t(`pixverse.name.style5`)},{value:`realistic`,label:this.$t(`pixverse.name.style6`)}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.style},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,style:e})}}},mounted(){this.value||=``}}),Ae={class:`field`},je={class:`title font-bold`};function Me(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Ae,[e(`h2`,je,r(t.$t(`pixverse.name.style`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ne=B(ke,[[`render`,Me],[`__scopeId`,`data-v-64e17b3c`]]),Pe=_({name:`SeedSelector`,components:{ElSlider:T,InfoIcon:Q,ElInputNumber:w},computed:{value:{get(){return this.$store.state?.pixverse?.config?.seed},set(e){console.debug(`set seed`,e),this.$store.commit(`pixverse/setConfig`,{...this.$store.state?.pixverse?.config,seed:e})}}},mounted(){this.value||=void 0}}),Fe={class:`flex justify-between`},Ie={class:`flex justify-start items-center`},Le={class:`text-sm font-bold`},Re={class:`flex justify-end items-center`},ze={class:`w-full`};function Be(t,n,a,s,l,u){let d=c(`info-icon`),f=c(`el-input-number`),p=c(`el-slider`);return h(),o(`div`,null,[e(`div`,Fe,[e(`div`,Ie,[e(`span`,Le,r(t.$t(`pixverse.name.seed`)),1),i(d,{content:t.$t(`pixverse.description.seed`)},null,8,[`content`])]),e(`div`,Re,[i(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,ze,[i(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1e3,step:1},null,8,[`modelValue`])])])}var Ve=B(Pe,[[`render`,Be]]),He=_({name:`DurationSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:5,label:`5s`},{value:8,label:`8s`}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.duration},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,duration:e})}}},mounted(){this.value||=5}}),Ue={class:`field`},We={class:`title font-bold`};function Ge(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Ue,[e(`h2`,We,r(t.$t(`pixverse.name.duration`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ke=B(He,[[`render`,Ge],[`__scopeId`,`data-v-065c77ef`]]),qe=_({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`4:3`,label:`4:3`,width:20,height:15},{value:`3:4`,label:`3:4`,width:15,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.pixverse.config?.aspect_ratio},set(e){console.debug(`set aspect_ratio`,e),this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,aspect_ratio:e})}}},mounted(){this.value||=te}}),Je={class:`text-sm font-bold mb-2 block`},Ye={class:`items`},Xe=[`onClick`],Ze={class:`name`};function Qe(n,i,a,c,l,u){return h(),o(`div`,null,[e(`span`,Je,r(n.$t(`pixverse.name.aspectRatio`)),1),e(`div`,Ye,[(h(!0),o(s,null,m(n.options,(i,a)=>(h(),o(`div`,{key:a,class:t({active:n.active===a,item:!0}),onClick:e=>n.value=i.value},[e(`div`,{class:t([`preview`,i.label])},[e(`div`,{class:`rect`,style:p({width:i.width+`px`,height:i.height+`px`})},null,4)],2),e(`p`,Ze,r(i.label),1)],10,Xe))),128))])])}var $e=B(qe,[[`render`,Qe],[`__scopeId`,`data-v-53038264`]]),et=_({name:`StartImage`,components:{UploadIcon:M,ElUpload:b,ElButton:R,InfoIcon:Q,ImagePreview:X},mixins:[V,z],emits:[`change`],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.pixverse?.config?.image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){K.warning(this.$t(`pixverse.message.uploadReferencesExceed`))},onError(){K.error(this.$t(`pixverse.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`pixverse/setConfig`,{...this.$store.state?.pixverse?.config,image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),tt={class:`relative`},nt={class:`flex justify-between`},rt={class:`flex justify-start items-center`},it={class:`text-sm font-bold`};function at(t,s,l,u,p,m){let g=c(`info-icon`),_=c(`image-preview`),v=c(`upload-icon`),y=c(`el-button`),b=c(`el-upload`);return h(),o(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`span`,it,r(t.$t(`pixverse.name.startImage`)),1),i(g,{content:t.$t(`pixverse.description.uploadStartImage`)},null,8,[`content`])])]),i(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":s[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:f(({file:e})=>[e.url&&e.percentage!==void 0?(h(),d(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):a(``,!0)]),default:f(()=>[i(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:f(()=>[i(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var ot=B(et,[[`render`,at],[`__scopeId`,`data-v-0a7c3c57`]]),st=_({name:`PromptInput`,components:{PromptTextarea:k},computed:{prompt:{get(){return this.$store.state.pixverse?.config?.prompt},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse?.config,prompt:e})}}},mounted(){this.prompt||=``}});function ct(e,t,n,r,i,a){let o=c(`prompt-textarea`);return h(),d(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`pixverse.name.prompt`),info:e.$t(`pixverse.description.prompt`),placeholder:e.$t(`pixverse.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var lt=_({name:`ConfigPanel`,components:{MagicIcon:N,ElButton:R,PromptInput:B(st,[[`render`,ct]]),ModelSelector:ve,QualitySelector:Ce,MotionSelector:Oe,StyleSelector:Ne,DurationSelector:Ke,StartImage:ot,SeedSelector:Ve,RatioSelector:$e,Consumption:Z},emits:[`generate`],computed:{config(){return this.$store.state.pixverse?.config},consumption(){return W(this.config,this.service?.cost)},service(){return this.$store.state.pixverse?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ut={class:`flex flex-col h-full`},dt={class:`flex-1 overflow-y-auto p-5`},ft={class:`flex flex-col items-center justify-center px-5 pb-5`};function pt(t,a,s,l,u,d){let p=c(`prompt-input`),m=c(`model-selector`),g=c(`style-selector`),_=c(`ratio-selector`),v=c(`motion-selector`),y=c(`quality-selector`),b=c(`start-image`),x=c(`seed-selector`),S=c(`duration-selector`),C=c(`consumption`),w=c(`magic-icon`),T=c(`el-button`);return h(),o(`div`,ut,[e(`div`,dt,[i(p,{class:`mb-4`}),i(m,{class:`mb-4`}),i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),i(v,{class:`mb-4`}),i(y,{class:`mb-4`}),i(b,{class:`mb-4`}),i(x,{class:`mb-4`}),i(S,{class:`mb-4`})]),e(`div`,ft,[i(C,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),i(T,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:f(()=>[i(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.button.generate`)),1)]),_:1},8,[`onClick`])])])}var mt=B(lt,[[`render`,pt]]),ht=_({name:`TaskPreview`,components:{ChannelIcon:O,InfoIcon:A,MagicIcon:N,TimeIcon:D,WarningIcon:j,CopyToClipboard:ee,ElAlert:S,VideoPlayer:ae,ElTooltip:x,ElButton:R,ApiCodeButton:oe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.pixverse?.application},config(){return this.$store.state.pixverse?.config}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),gt={class:`preview`},_t={class:`left`},vt={class:`main`},yt={class:`bot`},bt={class:`datetime`},xt={class:`info`},St={key:0,class:`prompt mt-2`},Ct={key:0},wt={key:1},Tt={key:0,class:t({content:!0,failed:!0})},Et={key:0,class:`mb-4`},$={key:1,class:t({operations:!0,"mt-2":!0})},Dt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},At={key:1,class:t({content:!0})},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Ft(t,s,l,u,p,m){let g=c(`capability-presentation`),_=c(`video-player`),v=c(`el-button`),y=c(`el-tooltip`),b=c(`api-code-button`),x=c(`channel-icon`),S=c(`magic-icon`),C=c(`copy-to-clipboard`),w=c(`time-icon`),T=c(`el-alert`),E=c(`warning-icon`),D=c(`info-icon`);return h(),o(`div`,gt,[e(`div`,_t,[i(g,{capability:`pixverse`,part:`avatar`,class:`avatar`})]),e(`div`,vt,[e(`div`,yt,[i(g,{capability:`pixverse`,part:`name`}),e(`span`,bt,r(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,xt,[t.modelValue?.request?.prompt?(h(),o(`p`,St,[n(r(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?a(``,!0):(h(),o(`span`,Ct,` - (`+r(t.$t(`pixverse.status.pending`))+`) `,1)),t.modelValue?.response?.data&&(t.modelValue?.response?.data[0]?.state===`processing`||t.modelValue?.response?.data[0]?.state===`pending`)?(h(),o(`span`,wt,` - (`+r(t.$t(`pixverse.status.processing`))+`) `,1)):a(``,!0)])):a(``,!0)]),t.modelValue?.response?.success===!0&&t.modelValue?.response?.data?(h(),o(`div`,Tt,[t.modelValue?.response?.data[0]?.video_url?(h(),o(`div`,Et,[i(_,{src:t.modelValue?.response?.data[0]?.video_url},null,8,[`src`])])):a(``,!0),t.modelValue?.response.success?(h(),o(`div`,$,[i(y,{class:`box-item`,effect:`dark`,content:t.$t(`pixverse.message.downloadVideo`),placement:`top-start`},{default:f(()=>[t.modelValue?.response?.data[0]?.video_url?(h(),d(v,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:s[0]||=e=>t.onDownload(e,t.modelValue?.response?.data[0]?.video_url)},{default:f(()=>[n(r(t.$t(`pixverse.button.download`)),1)]),_:1})):a(``,!0)]),_:1},8,[`content`]),i(b,{path:`/pixverse/videos`,body:t.modelValue?.request},null,8,[`body`])])):a(``,!0),i(T,{closable:!1,class:`mt-2 success`},{default:f(()=>[e(`p`,Dt,[i(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.model`))+`: `+r(t.modelValue?.request?.model),1)]),e(`p`,Ot,[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(C,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(h(),o(`p`,kt,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0)]),_:1})])):a(``,!0),t.modelValue?.response?.success===!1?(h(),o(`div`,At,[i(T,{closable:!1,class:`failure`},{template:f(()=>[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.failure`)),1)]),default:f(()=>[e(`p`,jt,[i(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.failureReason`))+`: `+r(t.modelValue?.response?.error?.message)+` `,1),i(C,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),e(`p`,Mt,[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(C,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(h(),o(`p`,Nt,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0),t.modelValue?.response?.trace_id?(h(),o(`p`,Pt,[i(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.traceId`))+`: `+r(t.modelValue?.response?.trace_id)+` `,1),i(C,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):a(``,!0)]),_:1})])):a(``,!0)])])}var It=_({name:`RecentPanel`,components:{TaskPreview:B(ht,[[`render`,Ft],[`__scopeId`,`data-v-b3ee3fb1`]]),NoTasks:re,BotPlaceholder:se,ScrollList:ne},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.pixverse?.tasks,items:this.$store.state.pixverse?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Lt={key:0},Rt={key:2,class:`w-full h-full flex items-center justify-center`};function zt(e,t,n,r,l,u){let p=c(`bot-placeholder`),g=c(`task-preview`),_=c(`scroll-list`),v=c(`no-tasks`);return h(),o(s,null,[e.tasks?.items===void 0?(h(),o(`div`,Lt,[i(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),d(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:f(()=>[(h(!0),o(s,null,m(e.tasks?.items,(e,t)=>(h(),d(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(h(),o(`div`,Rt,[i(v)])):a(``,!0)],64)}var Bt=_({name:`PixverseIndex`,components:{ConfigPanel:mt,Layout:pe,RecentPanel:B(It,[[`render`,zt]])},mixins:[U],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.pixverse?.status?.getApplications===G.Request},tasksLoading(){return this.$store.state.pixverse?.status?.getTasks===G.Request||this.fetchingTasks},credential(){return this.$store.state.pixverse.credential},config(){return this.$store.state.pixverse.config},tasks(){return this.$store.state.pixverse.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ie({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`pixverse/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`pixverse/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`pixverse/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!Y(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let e={...this.config,async:!0};if(!L())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}K.info(this.$t(`pixverse.message.startingTask`)),q(`pixverse`,H.generate(e,{token:t})).then(()=>{K.success(this.$t(`pixverse.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?K.error(this.$t(`pixverse.message.usedUp`)):K.error(this.$t(`pixverse.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Vt(e,t,n,r,a,o){let s=c(`config-panel`),l=c(`recent-panel`),u=c(`layout`);return h(),d(u,null,{config:f(()=>[i(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:f(()=>[i(l,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Ht=B(Bt,[[`render`,Vt]]);export{Ht as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,Gt as t,I as n,Jt as r,L as i,M as a,N as o,T as s,at as c,ht as l,it as u,j as d,mt as f,qt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{r as v,t as y}from"./select-CZ-weEBK.js";import{t as b}from"./upload-C2D3m-Zg.js";import{t as x}from"./tooltip-N7QSFzip.js";import{t as S}from"./alert-B1qzKF9D.js";import{t as C}from"./drawer-CQCUUEqh.js";import{t as w}from"./input-number-D9LQyEYi.js";import{t as T}from"./slider-DqzyNxNA.js";import{n as E}from"./taskDrawerMixin-Cm4PoHpK.js";import{t as D}from"./clock-B6LUjlYj.js";import{t as ee}from"./CopyToClipboard-C7E8BXWT.js";import{r as O,t as k}from"./PromptTextarea-CdwZdO5y.js";import{t as A}from"./info-Dky-jV7U.js";import{t as j}from"./triangle-alert-CNPqv5of.js";import{t as M}from"./upload-7JbUsHpw.js";import{t as N}from"./wand-sparkles-nKvNmNyI.js";import{cr as te,dr as P,lr as F,ur as I}from"./constants-D-3QKDN1.js";import{$t as L,Ai as R,Bt as z,E as B,Ht as V,In as H,Vt as U,Wt as W,ei as G,gi as K,mr as q,ri as J,zt as Y}from"./index-DX67OIaB.js";import{t as X}from"./ImagePreview-BBHtU8GY.js";import{t as Z}from"./Consumption-DfYXtMEK.js";import{a as Q,n as ne,r as re,t as ie}from"./pagination-WJ-XwyWR.js";import{t as ae}from"./VideoPlayer-CUWCkmQ3.js";import{t as oe}from"./ApiCodeButton-C1q6DpUc.js";import{t as se}from"./BotPlaceholder-BU4rzneO.js";var ce=_({name:`LayoutPixverse`,components:{MagicIcon:N,ElDrawer:C,ElButton:R},mixins:[E]}),le={class:`main flex flex-row flex-1`},ue={class:`config w-[320px] flex-none h-full min-h-0 overflow-hidden flex flex-col bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},de={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function fe(t,n,r,a,s,d){let p=c(`magic-icon`),m=c(`el-button`),_=c(`el-drawer`);return h(),o(`div`,le,[e(`div`,ue,[u(t.$slots,`config`,{},void 0,!0)]),e(`div`,de,[u(t.$slots,`result`,{},void 0,!0)]),l(i(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:f(()=>[i(p,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),i(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:f(()=>[u(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var pe=B(ce,[[`render`,fe],[`__scopeId`,`data-v-9da6c14b`]]),me=_({name:`ModelSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`v3.5`,label:`v3.5`},{value:`v4`,label:`v4`},{value:`v4.5`,label:`v4.5`}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.model},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,model:e})}}},mounted(){this.value||=F}}),he={class:`field`},ge={class:`title font-bold`};function _e(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,he,[e(`h2`,ge,r(t.$t(`pixverse.name.model`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ve=B(me,[[`render`,_e],[`__scopeId`,`data-v-e8f337ca`]]),ye=_({name:`QualitySelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`360p`,label:`360p`},{value:`540p`,label:`540p`},{value:`720p`,label:`720p`},{value:`1080p`,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.quality},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,quality:e})}}},mounted(){this.value||=P}}),be={class:`field`},xe={class:`title font-bold`};function Se(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,be,[e(`h2`,xe,r(t.$t(`pixverse.name.quality`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ce=B(ye,[[`render`,Se],[`__scopeId`,`data-v-64aeaae9`]]),we=_({name:`MotionSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`normal`,label:this.$t(`pixverse.name.motion1`)},{value:`fast`,label:this.$t(`pixverse.name.motion2`)}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.motion},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,motion:e})}}},mounted(){this.value||=I}}),Te={class:`field`},Ee={class:`title font-bold`};function De(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Te,[e(`h2`,Ee,r(t.$t(`pixverse.name.motion`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Oe=B(we,[[`render`,De],[`__scopeId`,`data-v-94237408`]]),ke=_({name:`StyleSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:`cyberpunk`,label:this.$t(`pixverse.name.style1`)},{value:`anime`,label:this.$t(`pixverse.name.style2`)},{value:`comic`,label:this.$t(`pixverse.name.style3`)},{value:`clay`,label:this.$t(`pixverse.name.style4`)},{value:`3d_animation`,label:this.$t(`pixverse.name.style5`)},{value:`realistic`,label:this.$t(`pixverse.name.style6`)}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.style},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,style:e})}}},mounted(){this.value||=``}}),Ae={class:`field`},je={class:`title font-bold`};function Me(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Ae,[e(`h2`,je,r(t.$t(`pixverse.name.style`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ne=B(ke,[[`render`,Me],[`__scopeId`,`data-v-64e17b3c`]]),Pe=_({name:`SeedSelector`,components:{ElSlider:T,InfoIcon:Q,ElInputNumber:w},computed:{value:{get(){return this.$store.state?.pixverse?.config?.seed},set(e){console.debug(`set seed`,e),this.$store.commit(`pixverse/setConfig`,{...this.$store.state?.pixverse?.config,seed:e})}}},mounted(){this.value||=void 0}}),Fe={class:`flex justify-between`},Ie={class:`flex justify-start items-center`},Le={class:`text-sm font-bold`},Re={class:`flex justify-end items-center`},ze={class:`w-full`};function Be(t,n,a,s,l,u){let d=c(`info-icon`),f=c(`el-input-number`),p=c(`el-slider`);return h(),o(`div`,null,[e(`div`,Fe,[e(`div`,Ie,[e(`span`,Le,r(t.$t(`pixverse.name.seed`)),1),i(d,{content:t.$t(`pixverse.description.seed`)},null,8,[`content`])]),e(`div`,Re,[i(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"controls-position":`right`},null,8,[`modelValue`])])]),e(`div`,ze,[i(p,{modelValue:t.value,"onUpdate:modelValue":n[1]||=e=>t.value=e,min:0,max:1e3,step:1},null,8,[`modelValue`])])])}var Ve=B(Pe,[[`render`,Be]]),He=_({name:`DurationSelector`,components:{ElSelect:v,ElOption:y},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{options:[{value:5,label:`5s`},{value:8,label:`8s`}]}},computed:{value:{get(){return this.$store.state.pixverse?.config?.duration},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,duration:e})}}},mounted(){this.value||=5}}),Ue={class:`field`},We={class:`title font-bold`};function Ge(t,n,a,l,u,p){let g=c(`el-option`),_=c(`el-select`);return h(),o(`div`,Ue,[e(`h2`,We,r(t.$t(`pixverse.name.duration`)),1),i(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`pixverse.placeholder.select`)},{default:f(()=>[(h(!0),o(s,null,m(t.options,e=>(h(),d(g,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Ke=B(He,[[`render`,Ge],[`__scopeId`,`data-v-065c77ef`]]),qe=_({name:`RatioSelector`,data(){return{options:[{value:`1:1`,label:`1:1`,width:20,height:20},{value:`4:3`,label:`4:3`,width:20,height:15},{value:`3:4`,label:`3:4`,width:15,height:20},{value:`16:9`,label:`16:9`,width:25,height:13},{value:`9:16`,label:`9:16`,width:13,height:25}]}},computed:{active(){return this.options.findIndex(e=>e.value===this.value)||0},value:{get(){return this.$store.state.pixverse.config?.aspect_ratio},set(e){console.debug(`set aspect_ratio`,e),this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse.config,aspect_ratio:e})}}},mounted(){this.value||=te}}),Je={class:`text-sm font-bold mb-2 block`},Ye={class:`items`},Xe=[`onClick`],Ze={class:`name`};function Qe(n,i,a,c,l,u){return h(),o(`div`,null,[e(`span`,Je,r(n.$t(`pixverse.name.aspectRatio`)),1),e(`div`,Ye,[(h(!0),o(s,null,m(n.options,(i,a)=>(h(),o(`div`,{key:a,class:t({active:n.active===a,item:!0}),onClick:e=>n.value=i.value},[e(`div`,{class:t([`preview`,i.label])},[e(`div`,{class:`rect`,style:p({width:i.width+`px`,height:i.height+`px`})},null,4)],2),e(`p`,Ze,r(i.label),1)],10,Xe))),128))])])}var $e=B(qe,[[`render`,Qe],[`__scopeId`,`data-v-53038264`]]),et=_({name:`StartImage`,components:{UploadIcon:M,ElUpload:b,ElButton:R,InfoIcon:Q,ImagePreview:X},mixins:[V,z],emits:[`change`],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url)},value:{get(){return this.$store.state?.pixverse?.config?.image_url},set(){}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){K.warning(this.$t(`pixverse.message.uploadReferencesExceed`))},onError(){K.error(this.$t(`pixverse.message.uploadReferencesError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`pixverse/setConfig`,{...this.$store.state?.pixverse?.config,image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),tt={class:`relative`},nt={class:`flex justify-between`},rt={class:`flex justify-start items-center`},it={class:`text-sm font-bold`};function at(t,s,l,u,p,m){let g=c(`info-icon`),_=c(`image-preview`),v=c(`upload-icon`),y=c(`el-button`),b=c(`el-upload`);return h(),o(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`span`,it,r(t.$t(`pixverse.name.startImage`)),1),i(g,{content:t.$t(`pixverse.description.uploadStartImage`)},null,8,[`content`])])]),i(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":s[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:5,class:`upload-wrapper`,multiple:!1,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{file:f(({file:e})=>[e.url&&e.percentage!==void 0?(h(),d(_,{key:0,url:e.url,name:e.name,percentage:e.percentage,onRemove:n=>t.fileList.splice(t.fileList.indexOf(e),1)},null,8,[`url`,`name`,`percentage`,`onRemove`])):a(``,!0)]),default:f(()=>[i(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:f(()=>[i(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.button.uploadReferences`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`headers`])])}var ot=B(et,[[`render`,at],[`__scopeId`,`data-v-0a7c3c57`]]),st=_({name:`PromptInput`,components:{PromptTextarea:k},computed:{prompt:{get(){return this.$store.state.pixverse?.config?.prompt},set(e){this.$store.commit(`pixverse/setConfig`,{...this.$store.state.pixverse?.config,prompt:e})}}},mounted(){this.prompt||=``}});function ct(e,t,n,r,i,a){let o=c(`prompt-textarea`);return h(),d(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`pixverse.name.prompt`),info:e.$t(`pixverse.description.prompt`),placeholder:e.$t(`pixverse.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var lt=_({name:`ConfigPanel`,components:{MagicIcon:N,ElButton:R,PromptInput:B(st,[[`render`,ct]]),ModelSelector:ve,QualitySelector:Ce,MotionSelector:Oe,StyleSelector:Ne,DurationSelector:Ke,StartImage:ot,SeedSelector:Ve,RatioSelector:$e,Consumption:Z},emits:[`generate`],computed:{config(){return this.$store.state.pixverse?.config},consumption(){return W(this.config,this.service?.cost)},service(){return this.$store.state.pixverse?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ut={class:`flex flex-col h-full`},dt={class:`flex-1 overflow-y-auto p-5`},ft={class:`flex flex-col items-center justify-center px-5 pb-5`};function pt(t,a,s,l,u,d){let p=c(`prompt-input`),m=c(`model-selector`),g=c(`style-selector`),_=c(`ratio-selector`),v=c(`motion-selector`),y=c(`quality-selector`),b=c(`start-image`),x=c(`seed-selector`),S=c(`duration-selector`),C=c(`consumption`),w=c(`magic-icon`),T=c(`el-button`);return h(),o(`div`,ut,[e(`div`,dt,[i(p,{class:`mb-4`}),i(m,{class:`mb-4`}),i(g,{class:`mb-4`}),i(_,{class:`mb-4`}),i(v,{class:`mb-4`}),i(y,{class:`mb-4`}),i(b,{class:`mb-4`}),i(x,{class:`mb-4`}),i(S,{class:`mb-4`})]),e(`div`,ft,[i(C,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),i(T,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:f(()=>[i(w,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.button.generate`)),1)]),_:1},8,[`onClick`])])])}var mt=B(lt,[[`render`,pt]]),ht=_({name:`TaskPreview`,components:{ChannelIcon:O,InfoIcon:A,MagicIcon:N,TimeIcon:D,WarningIcon:j,CopyToClipboard:ee,ElAlert:S,VideoPlayer:ae,ElTooltip:x,ElButton:R,ApiCodeButton:oe},props:{modelValue:{type:Object,required:!0}},data(){return{}},computed:{application(){return this.$store.state.pixverse?.application},config(){return this.$store.state.pixverse?.config}},methods:{onDownload(e,t){e?.stopPropagation(),console.log(`on download`),window.open(t,`_blank`)},onOpenVideo(e){window.open(e,`_blank`)}}}),gt={class:`preview`},_t={class:`left`},vt={class:`main`},yt={class:`bot`},bt={class:`datetime`},xt={class:`info`},St={key:0,class:`prompt mt-2`},Ct={key:0},wt={key:1},Tt={key:0,class:t({content:!0,failed:!0})},Et={key:0,class:`mb-4`},$={key:1,class:t({operations:!0,"mt-2":!0})},Dt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},At={key:1,class:t({content:!0})},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Ft(t,s,l,u,p,m){let g=c(`capability-presentation`),_=c(`video-player`),v=c(`el-button`),y=c(`el-tooltip`),b=c(`api-code-button`),x=c(`channel-icon`),S=c(`magic-icon`),C=c(`copy-to-clipboard`),w=c(`time-icon`),T=c(`el-alert`),E=c(`warning-icon`),D=c(`info-icon`);return h(),o(`div`,gt,[e(`div`,_t,[i(g,{capability:`pixverse`,part:`avatar`,class:`avatar`})]),e(`div`,vt,[e(`div`,yt,[i(g,{capability:`pixverse`,part:`name`}),e(`span`,bt,r(t.$dayjs.format(``+new Date(parseFloat((t.modelValue?.created_at||``).toString())*1e3))),1)]),e(`div`,xt,[t.modelValue?.request?.prompt?(h(),o(`p`,St,[n(r(t.modelValue?.request?.prompt)+` `,1),t.modelValue?.response?a(``,!0):(h(),o(`span`,Ct,` - (`+r(t.$t(`pixverse.status.pending`))+`) `,1)),t.modelValue?.response?.data&&(t.modelValue?.response?.data[0]?.state===`processing`||t.modelValue?.response?.data[0]?.state===`pending`)?(h(),o(`span`,wt,` - (`+r(t.$t(`pixverse.status.processing`))+`) `,1)):a(``,!0)])):a(``,!0)]),t.modelValue?.response?.success===!0&&t.modelValue?.response?.data?(h(),o(`div`,Tt,[t.modelValue?.response?.data[0]?.video_url?(h(),o(`div`,Et,[i(_,{src:t.modelValue?.response?.data[0]?.video_url},null,8,[`src`])])):a(``,!0),t.modelValue?.response.success?(h(),o(`div`,$,[i(y,{class:`box-item`,effect:`dark`,content:t.$t(`pixverse.message.downloadVideo`),placement:`top-start`},{default:f(()=>[t.modelValue?.response?.data[0]?.video_url?(h(),d(v,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:s[0]||=e=>t.onDownload(e,t.modelValue?.response?.data[0]?.video_url)},{default:f(()=>[n(r(t.$t(`pixverse.button.download`)),1)]),_:1})):a(``,!0)]),_:1},8,[`content`]),i(b,{path:`/pixverse/videos`,body:t.modelValue?.request},null,8,[`body`])])):a(``,!0),i(T,{closable:!1,class:`mt-2 success`},{default:f(()=>[e(`p`,Dt,[i(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.model`))+`: `+r(t.modelValue?.request?.model),1)]),e(`p`,Ot,[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(C,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(h(),o(`p`,kt,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0)]),_:1})])):a(``,!0),t.modelValue?.response?.success===!1?(h(),o(`div`,At,[i(T,{closable:!1,class:`failure`},{template:f(()=>[i(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.failure`)),1)]),default:f(()=>[e(`p`,jt,[i(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.failureReason`))+`: `+r(t.modelValue?.response?.error?.message)+` `,1),i(C,{content:t.modelValue?.response?.error?.message},null,8,[`content`])]),e(`p`,Mt,[i(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.taskId`))+`: `+r(t.modelValue?.id)+` `,1),i(C,{content:t.modelValue?.id},null,8,[`content`])]),t.modelValue?.elapsed?(h(),o(`p`,Nt,[i(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.elapsed`))+`: `+r(t.modelValue?.elapsed?.toFixed(2))+`s `,1)])):a(``,!0),t.modelValue?.response?.trace_id?(h(),o(`p`,Pt,[i(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),n(` `+r(t.$t(`pixverse.name.traceId`))+`: `+r(t.modelValue?.response?.trace_id)+` `,1),i(C,{content:t.modelValue?.response?.trace_id},null,8,[`content`])])):a(``,!0)]),_:1})])):a(``,!0)])])}var It=_({name:`RecentPanel`,components:{TaskPreview:B(ht,[[`render`,Ft],[`__scopeId`,`data-v-b3ee3fb1`]]),NoTasks:re,BotPlaceholder:se,ScrollList:ne},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.pixverse?.tasks,items:this.$store.state.pixverse?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Lt={key:0},Rt={key:2,class:`w-full h-full flex items-center justify-center`};function zt(e,t,n,r,l,u){let p=c(`bot-placeholder`),g=c(`task-preview`),_=c(`scroll-list`),v=c(`no-tasks`);return h(),o(s,null,[e.tasks?.items===void 0?(h(),o(`div`,Lt,[i(p)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),d(_,{key:1,ref:`scrollList`,class:`h-full w-full overflow-y-auto tasks`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:f(()=>[(h(!0),o(s,null,m(e.tasks?.items,(e,t)=>(h(),d(g,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):a(``,!0),e.tasks?.items?.length===0?(h(),o(`div`,Rt,[i(v)])):a(``,!0)],64)}var Bt=_({name:`PixverseIndex`,components:{ConfigPanel:mt,Layout:pe,RecentPanel:B(It,[[`render`,zt]])},mixins:[U],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.pixverse?.status?.getApplications===G.Request},tasksLoading(){return this.$store.state.pixverse?.status?.getTasks===G.Request||this.fetchingTasks},credential(){return this.$store.state.pixverse.credential},config(){return this.$store.state.pixverse.config},tasks(){return this.$store.state.pixverse.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ie({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loadingMore,setLoading:e=>this.loadingMore=e,isBlocked:()=>this.tasksLoading||this.applicationsLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`pixverse/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`pixverse/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),this.fetchingTasks=!0;try{await this.$store.dispatch(`pixverse/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!Y(this.uploadTracker,e=>this.$t(e),e=>K.warning(e)))return;let e={...this.config,async:!0};if(!L())return;let t=this.credential?.token;if(!t){console.error(`no token specified`);return}K.info(this.$t(`pixverse.message.startingTask`)),q(`pixverse`,H.generate(e,{token:t})).then(()=>{K.success(this.$t(`pixverse.message.startTaskSuccess`))}).catch(e=>{(e?.response?.data)?.error?.code===`used_up`?K.error(this.$t(`pixverse.message.usedUp`)):K.error(this.$t(`pixverse.message.startTaskFailed`))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Vt(e,t,n,r,a,o){let s=c(`config-panel`),l=c(`recent-panel`),u=c(`layout`);return h(),d(u,null,{config:f(()=>[i(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:f(()=>[i(l,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Ht=B(Bt,[[`render`,Vt]]);export{Ht as default};