@acedatacloud/nexior 3.373.0 → 3.374.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/{ApiCodeButton-CPGhOLiu.js → ApiCodeButton-DBIIyPcm.js} +1 -1
  3. package/dist/assets/{ApiCodeDialog-DFuXfQd9.js → ApiCodeDialog-SgTrP35-.js} +1 -1
  4. package/dist/assets/{Artifacts-Iqbb6kPL.js → Artifacts-Bv8c6c23.js} +1 -1
  5. package/dist/assets/{AskUserQuestionCard-Bk9JCcJ8.js → AskUserQuestionCard-5upmtI3F.js} +1 -1
  6. package/dist/assets/{AudioPreview-CTkYCaUg.js → AudioPreview-CO5m-MPN.js} +1 -1
  7. package/dist/assets/{Auth-CEyaqXq1.js → Auth-C_3Q01T9.js} +1 -1
  8. package/dist/assets/{Bare-BoCgRT4k.js → Bare-Bgcy9ZBE.js} +1 -1
  9. package/dist/assets/{BotPlaceholder-rtyV1S5S.js → BotPlaceholder-D9exsWtJ.js} +1 -1
  10. package/dist/assets/{BottomFooter-C9FOv2BL.js → BottomFooter-Cpt55XyN.js} +1 -1
  11. package/dist/assets/{BrowseConnectors-C5DxLI6K.js → BrowseConnectors-DDaCrhbs.js} +1 -1
  12. package/dist/assets/{BrowserPairingDialog-DCjvZU5w.js → BrowserPairingDialog-BrWPFDvv.js} +1 -1
  13. package/dist/assets/{Callback-D-d0eMPz.js → Callback-Dxh5oYOa.js} +1 -1
  14. package/dist/assets/{CodeSnippet-CMO3vvju.js → CodeSnippet-BsfF8y-K.js} +1 -1
  15. package/dist/assets/{Console-CKPPBa35.js → Console-DX8ah6RZ.js} +1 -1
  16. package/dist/assets/Conversation-CGF5Pv35.js +2 -0
  17. package/dist/assets/{Conversation-GudouywL.css → Conversation-Chcq_bCw.css} +1 -1
  18. package/dist/assets/Conversation-DYP2DA8I.css +1 -0
  19. package/dist/assets/Conversation-jOky6QFU.js +1 -0
  20. package/dist/assets/{CopyToClipboard-DAyi_3OQ.js → CopyToClipboard-CaPuzTeQ.js} +1 -1
  21. package/dist/assets/{Detail-CTQSPtD-.js → Detail-Do_URYhR.js} +1 -1
  22. package/dist/assets/{Detail-DsfPabsJ.css → Detail-_ZtOzPZR.css} +1 -1
  23. package/dist/assets/{Extra-ufopKO8y.js → Extra-BALtwRjN.js} +1 -1
  24. package/dist/assets/{FilePreview-C3m04qXO.js → FilePreview-D9sljXpn.js} +1 -1
  25. package/dist/assets/{Hailuo-Cf3wIS8E.js → Hailuo-Dqi6oENw.js} +1 -1
  26. package/dist/assets/{History-DuhNyqmx.js → History-BnMHhtb9.js} +1 -1
  27. package/dist/assets/{ImagePreview-B9s8J01K.js → ImagePreview-DBaF-RWM.js} +1 -1
  28. package/dist/assets/{ImageWrapper-BjkTskuv.js → ImageWrapper-B7c3P7Rp.js} +1 -1
  29. package/dist/assets/{Index-CQN94Ffh.js → Index-6EQp8Djd.js} +1 -1
  30. package/dist/assets/Index-BBn91pAG.css +1 -0
  31. package/dist/assets/Index-BRcf8_aI.js +1 -0
  32. package/dist/assets/{Index-C9F9XQrE.js → Index-B_e8X3lR.js} +1 -1
  33. package/dist/assets/{Index-BOWuTVKJ.js → Index-BfEjGMYY.js} +1 -1
  34. package/dist/assets/Index-BfvWsCCs.js +88 -0
  35. package/dist/assets/{Index-CTssKsjV.js → Index-Bn8GR3Dp.js} +1 -1
  36. package/dist/assets/{Index-BzW0A_LR.js → Index-C-MhLOpV.js} +1 -1
  37. package/dist/assets/{Index-x4ufT6Wq.js → Index-C3Xg5_rD.js} +1 -1
  38. package/dist/assets/{Index-C2iRq2Qw.js → Index-C5n7st14.js} +1 -1
  39. package/dist/assets/{Index-Cmlh0TTt.js → Index-CBWvzpUv.js} +1 -1
  40. package/dist/assets/{Index-p0oLVoSJ.js → Index-CH0Qtl-U.js} +1 -1
  41. package/dist/assets/{Index-W2bzrAkx.js → Index-CgZQ_vHY.js} +1 -1
  42. package/dist/assets/{Index-B814uEoG.js → Index-Cioeau9t.js} +1 -1
  43. package/dist/assets/{Index-bfV69lWl.js → Index-Cxnk8D6L.js} +1 -1
  44. package/dist/assets/{Index-D4Tr3isP.js → Index-D0VEtNow.js} +1 -1
  45. package/dist/assets/{Index-BS7v2wU2.js → Index-D0dMY9JE.js} +1 -1
  46. package/dist/assets/{Index-F1BT3eOb.js → Index-D2u3DAyP.js} +1 -1
  47. package/dist/assets/{Index-eYV6BI-A.js → Index-D2uwTXnV.js} +1 -1
  48. package/dist/assets/{Index-D66kDMHS.js → Index-D6RtTR0S.js} +1 -1
  49. package/dist/assets/{Index-Rki18BDG.js → Index-DEg9qoqB.js} +1 -1
  50. package/dist/assets/{Index-BLzxNEI-.js → Index-DHNhF-7Z.js} +1 -1
  51. package/dist/assets/{Index-BDTpG_CL.js → Index-DN1YZ-qD.js} +1 -1
  52. package/dist/assets/{Index-DJCFVLwM2.js → Index-DNEKHbbD2.js} +1 -1
  53. package/dist/assets/{Index-R-WSTcHf.js → Index-DZeE-ePv.js} +1 -1
  54. package/dist/assets/Index-Df07w6x-.css +1 -0
  55. package/dist/assets/{Index-mqcRxSL5.js → Index-DgOG6dMN.js} +1 -1
  56. package/dist/assets/{Index-Dm2FysUI.js → Index-Dibj94eG.js} +1 -1
  57. package/dist/assets/{Index-aXa81CRx.js → Index-Dq-UvUyY.js} +1 -1
  58. package/dist/assets/{Index-F-Qw_DW5.js → Index-DuK9WzML.js} +1 -1
  59. package/dist/assets/{Index-DOlAXSLg.js → Index-DyHHY0TK.js} +1 -1
  60. package/dist/assets/{Index-DNJbG1CR.js → Index-LRgJ_nsN.js} +1 -1
  61. package/dist/assets/{Index-B0I-tNOZ.js → Index-N-brMCrR.js} +1 -1
  62. package/dist/assets/{Index-B8K7J-Rx.js → Index-h7_JkwcG.js} +1 -1
  63. package/dist/assets/{Index-CQYVGH6u.js → Index-h8LHd7to.js} +1 -1
  64. package/dist/assets/{Index-BFtve-z8.js → Index-lqpxMyXe.js} +1 -1
  65. package/dist/assets/{Index-BbmuP-wW.js → Index-o2Kv6S1v.js} +1 -1
  66. package/dist/assets/{Index-sILLMUh9.js → Index-rnPbAWjw.js} +1 -1
  67. package/dist/assets/{Invitees-BPgznSM5.js → Invitees-C7Z_tbfl.js} +1 -1
  68. package/dist/assets/{List-DJY6Nb8v.js → List-D3pfOeks.js} +1 -1
  69. package/dist/assets/List-DskSS78c.css +1 -0
  70. package/dist/assets/{List-BAwEMkdI.js → List-neAXCyf2.js} +1 -1
  71. package/dist/assets/List-sKWhZB_b.js +1 -0
  72. package/dist/assets/{LocalTools-DgG-l2y-.js → LocalTools-CURjPTl3.js} +1 -1
  73. package/dist/assets/{LocalTools-B1SlBrqM.js → LocalTools-Co4IuNQp.js} +1 -1
  74. package/dist/assets/{Logo-2-jsdWuy.js → Logo-CcnyAHG2.js} +1 -1
  75. package/dist/assets/{Main-Bz-ZeY4M.js → Main-Bh0TsiI3.js} +1 -1
  76. package/dist/assets/Message-CkA6luHF.js +3 -0
  77. package/dist/assets/{Message-DpArQcCJ.css → Message-DziQP5Mk.css} +1 -1
  78. package/dist/assets/{Model-BjikoYEE.js → Model-BY0CeF_w.js} +1 -1
  79. package/dist/assets/Navigator-CoyJaNGh.css +1 -0
  80. package/dist/assets/Navigator-vxqlT7Zw.js +8 -0
  81. package/dist/assets/{NotFound-P-Z9lp5X.js → NotFound-DeOf4Lmk.js} +1 -1
  82. package/dist/assets/{PageHeader-BxTrgmLo.js → PageHeader-CoIHTlzp.js} +1 -1
  83. package/dist/assets/Pay-Bk74bPkY.css +1 -0
  84. package/dist/assets/Pay-D1qVtYXO.js +1 -0
  85. package/dist/assets/{Player-HIE1CRLU.js → Player-WwC32zK4.js} +1 -1
  86. package/dist/assets/{Poivelle-DdfK2kNt.js → Poivelle-w3LUq8sQ.js} +1 -1
  87. package/dist/assets/{RealtimeCall-Ba9tO2Yj.js → RealtimeCall-DEptKr-y.js} +1 -1
  88. package/dist/assets/{ReportButton-DalKc7i7.js → ReportButton-DqBK7S8_.js} +1 -1
  89. package/dist/assets/{ReportDialog-B6Qoh1wW.js → ReportDialog-BcyM6Mys.js} +1 -1
  90. package/dist/assets/{ScenarioPaymentMode-4_9JDWFN.js → ScenarioPaymentMode-D9JSjV3-.js} +1 -1
  91. package/dist/assets/{ScheduledTasks-DxC3K9N6.js → ScheduledTasks-DlpEvJc3.js} +1 -1
  92. package/dist/assets/{ServicePricingSummary-D39Eh-NT.js → ServicePricingSummary-C1I-y6dH.js} +1 -1
  93. package/dist/assets/{ShowcaseGrid-B2quKvc1.js → ShowcaseGrid-6Ma1uGZt.js} +1 -1
  94. package/dist/assets/{ShowcaseResultTabs-DJVmexf9.js → ShowcaseResultTabs-rMhxrzq3.js} +1 -1
  95. package/dist/assets/{SolanaWalletPickerDialog-C32469k6.js → SolanaWalletPickerDialog-DmzZ-uJQ.js} +1 -1
  96. package/dist/assets/{Status-BhcoTAdf.js → Status-CkzKt4ib.js} +1 -1
  97. package/dist/assets/{Subscribe-CJx_ZR9K.js → Subscribe-BwmBt3UL.js} +1 -1
  98. package/dist/assets/{TabSwitcher-CB6X5f83.js → TabSwitcher-Jf2B0-vC.js} +1 -1
  99. package/dist/assets/{Tts-D3TeVguS.js → Tts-BC01zHR_.js} +1 -1
  100. package/dist/assets/{VideoPlayer-CVXvO7ac.js → VideoPlayer-CC3Fzeqq.js} +1 -1
  101. package/dist/assets/{VideoPreview-CaYgutzc.js → VideoPreview-gtqNXvtJ.js} +1 -1
  102. package/dist/assets/{WriteSkillDialog-B_vIUyKv.js → WriteSkillDialog-DxKxdZbp.js} +1 -1
  103. package/dist/assets/{airwallexCheckout-CHcL5hMp.js → airwallexCheckout-CdX6OLbg.js} +1 -1
  104. package/dist/assets/arrow-down-CSGt9t2E.js +1 -0
  105. package/dist/assets/{arrow-down-wide-narrow-CmP_1d1p.js → arrow-down-wide-narrow-Bm2Z5o2d.js} +1 -1
  106. package/dist/assets/arrow-left-l3XZii7G.js +1 -0
  107. package/dist/assets/arrow-right-DldGU1an.js +1 -0
  108. package/dist/assets/arrow-up-4Sf4V16e.js +1 -0
  109. package/dist/assets/{authorizeFlow-OwiOb8oj.js → authorizeFlow-IFKM_0Z8.js} +1 -1
  110. package/dist/assets/{avatar-DtKcRmyc.js → avatar-B1N5e5xG.js} +1 -1
  111. package/dist/assets/{basic-DFz2cG3y.js → basic-7j1i_FPI.js} +1 -1
  112. package/dist/assets/{book-open-DZpy0lDE.js → book-open-CnBkGve5.js} +1 -1
  113. package/dist/assets/{box-CUMQZuBm.js → box-C0GiZ7-u.js} +1 -1
  114. package/dist/assets/{boxes-DzL0z1qi.js → boxes-2cg2oc78.js} +1 -1
  115. package/dist/assets/{brain-D74VlTYy.js → brain-De0zKChZ.js} +1 -1
  116. package/dist/assets/{chart-no-axes-combined-CzzR93Eg.js → chart-no-axes-combined-DXPCYBnP.js} +1 -1
  117. package/dist/assets/{chat-CyU-pFNA.js → chat-B3V3PQNf.js} +2 -2
  118. package/dist/assets/check-Cmnz4Bu0.js +1 -0
  119. package/dist/assets/chevron-down-DHjWJMvN.js +1 -0
  120. package/dist/assets/chevron-right-hDs_4ftT.js +1 -0
  121. package/dist/assets/{circle-alert-D0sxSJv2.js → circle-alert-FynFeKnI.js} +1 -1
  122. package/dist/assets/circle-check-CrhnV2f6.js +1 -0
  123. package/dist/assets/{circle-question-mark-CIeXcJ5Q.js → circle-question-mark-C8xvGTGb.js} +1 -1
  124. package/dist/assets/{clipboard-list-gaqYUCJ1.js → clipboard-list-841pTGDa.js} +1 -1
  125. package/dist/assets/clock-B7yL_XXj.js +1 -0
  126. package/dist/assets/code-CDH4NELE.js +1 -0
  127. package/dist/assets/{codingBridge-BNK38lhI.js → codingBridge-CyaSQuc1.js} +1 -1
  128. package/dist/assets/{codingBridgeNotify-CFoOLcGh.js → codingBridgeNotify-CfKf4JbW.js} +1 -1
  129. package/dist/assets/{coins-uy26CC1l.js → coins-DA-dIOC6.js} +1 -1
  130. package/dist/assets/{collapse-0WRpvPa2.js → collapse-B_bQM9KN.js} +1 -1
  131. package/dist/assets/{constants-CiMGQy1r.js → constants-BmcMHgPT.js} +1 -1
  132. package/dist/assets/{copy-CO_zOPB-.js → copy-BNJ4Vvq_.js} +1 -1
  133. package/dist/assets/{createTaskActions-Cd9PLmA4.js → createTaskActions-DtPQuKJS.js} +1 -1
  134. package/dist/assets/{date-picker-DTbFn6T6.js → date-picker-DRc3s80w.js} +1 -1
  135. package/dist/assets/{digitalhuman-B5mwnJsv.js → digitalhuman-DsHsrai7.js} +1 -1
  136. package/dist/assets/{dollar-sign-CVSntPP0.js → dollar-sign-B7sFSE65.js} +1 -1
  137. package/dist/assets/{download-B-NUX5--.js → download-CAwranau.js} +1 -1
  138. package/dist/assets/{drawer-DiMGL-ON.js → drawer-CkM_NHcO.js} +1 -1
  139. package/dist/assets/{dropdown-YDxjipAw.js → dropdown-BpefDnJp.js} +1 -1
  140. package/dist/assets/{dropdown-GpprrdIj.js → dropdown-Dq3sNHZD.js} +1 -1
  141. package/dist/assets/{ellipsis-CGz_HpMx.js → ellipsis-POyVAzgA.js} +1 -1
  142. package/dist/assets/{esm-for_ctUv.js → esm-Bf4QHayu.js} +2 -2
  143. package/dist/assets/{external-link-Dy7ppeTW.js → external-link-eI3g6xpp.js} +1 -1
  144. package/dist/assets/{eye-tHuN1elp.js → eye-Ces_jYmy.js} +1 -1
  145. package/dist/assets/{file-EU87NQEf.js → file-COdWS7Yw.js} +1 -1
  146. package/dist/assets/{file-output-hFv46DRo.js → file-output-Rckcbv_F.js} +1 -1
  147. package/dist/assets/{file-text-g2ZxAyz9.js → file-text-DhO9-O7o.js} +1 -1
  148. package/dist/assets/{fish-DKFPgcN4.js → fish-DDjd2Wg6.js} +1 -1
  149. package/dist/assets/{flux-DKmsK4Hx.js → flux-DepHkctW.js} +1 -1
  150. package/dist/assets/{folder-BYGmJ8b6.js → folder-B4Jjo77l.js} +1 -1
  151. package/dist/assets/gauge-CCcCam0v.js +1 -0
  152. package/dist/assets/{generationInput-D9-UKuN_.js → generationInput-Df1upTx9.js} +1 -1
  153. package/dist/assets/{globe-Bcfo0NCz.js → globe-CEk5a0cn.js} +1 -1
  154. package/dist/assets/{grokvideo-zMkbw8fc.js → grokvideo-Co5-RZJD.js} +1 -1
  155. package/dist/assets/{hailuo-UTru_8wK.js → hailuo-DMoPPvUl.js} +1 -1
  156. package/dist/assets/{headphones-DgMfW7oh.js → headphones-DxEzVzix.js} +1 -1
  157. package/dist/assets/{history-BS-RsX0W.js → history-P1COJCLH.js} +1 -1
  158. package/dist/assets/{house-SuFpuLeo.js → house-qa6WrFu9.js} +1 -1
  159. package/dist/assets/{i18n-DBtpbeq0.js → i18n-3aZQnVTW.js} +1 -1
  160. package/dist/assets/{image-CtUMzDVv.js → image-DfZ-yD3f.js} +1 -1
  161. package/dist/assets/{imageRequests-JgZOB_cZ.js → imageRequests-DIYH9CLr.js} +1 -1
  162. package/dist/assets/{index-4v6EkWvr.js → index-BHXtbt9o.js} +17 -17
  163. package/dist/assets/{index.es-I-vzV5XY.js → index.es-C_Gq4vgy.js} +1 -1
  164. package/dist/assets/{info-DTb1_1Yi.js → info-xIzYgAiV.js} +1 -1
  165. package/dist/assets/{input-number-Djsi0Vju.js → input-number-VyPGUhHP.js} +1 -1
  166. package/dist/assets/{key-round-CE4FB-CQ.js → key-round-CL1Zurw8.js} +1 -1
  167. package/dist/assets/{kling-BBMsArmW.js → kling-C1-5IiSC.js} +1 -1
  168. package/dist/assets/{languages-F2SfnPWp.js → languages-CDk9EAaf.js} +1 -1
  169. package/dist/assets/{laptop-Z9AblF2E.js → laptop-BlMF8fEG.js} +1 -1
  170. package/dist/assets/{lightbulb-BgsBKuzo.js → lightbulb-d6wy4poq.js} +1 -1
  171. package/dist/assets/{link-CZvMZO1z.js → link-6giGq_cF.js} +1 -1
  172. package/dist/assets/loader-circle-B3QYalEy.js +1 -0
  173. package/dist/assets/{lock-D3s5uN5k.js → lock-cFepzwhs.js} +1 -1
  174. package/dist/assets/{luma-C5efGpzj.js → luma-Eq1wRQnR.js} +1 -1
  175. package/dist/assets/{maestro-D5lKvi4O.js → maestro-0ulY9gMw.js} +1 -1
  176. package/dist/assets/{maestroLanguages-BDi0WKKu.js → maestroLanguages-CczPeCVu.js} +1 -1
  177. package/dist/assets/{mail-Bkvex4jo.js → mail-NnEBpr3-.js} +1 -1
  178. package/dist/assets/{message-circle-DycSW4AS.js → message-circle-DBJKZmSe.js} +1 -1
  179. package/dist/assets/{mic-C2EoIIf7.js → mic-DPRovWzT.js} +1 -1
  180. package/dist/assets/{midjourney-DTQQpYgn.js → midjourney-K2rr_-Oi.js} +1 -1
  181. package/dist/assets/{minimax-CEPXgN5N.js → minimax-CauLdfeU.js} +1 -1
  182. package/dist/assets/{mobileLocalExec-C1dCnnBV.js → mobileLocalExec-mQzutnPF.js} +1 -1
  183. package/dist/assets/modelPresentation-Dh0NlBYP.js +1 -0
  184. package/dist/assets/{models-DGI43qxx.js → models-CSuuDqRA.js} +1 -1
  185. package/dist/assets/{monitor-DGrD9zYu.js → monitor-Cf_suH9d.js} +1 -1
  186. package/dist/assets/{mouse-pointer-2-BBpO7Y1t.js → mouse-pointer-2-CgCiODhx.js} +1 -1
  187. package/dist/assets/music-2-BgZoB-sB.js +1 -0
  188. package/dist/assets/{nanobanana-BM7qluDQ.js → nanobanana-yHjhfh57.js} +1 -1
  189. package/dist/assets/{omni-C4G4ivob.js → omni-CauuzHoU.js} +1 -1
  190. package/dist/assets/{openaiimage-B55A85T0.js → openaiimage-BR52tx59.js} +1 -1
  191. package/dist/assets/{pagination-Cjli_PVC.js → pagination-BeJR0FnO.js} +1 -1
  192. package/dist/assets/{pagination-B_yoORyz.js → pagination-DuM0KuRQ.js} +1 -1
  193. package/dist/assets/{pagination-BXh591ef.js → pagination-SWvC0yg5.js} +1 -1
  194. package/dist/assets/{palette-DjM-fYCI.js → palette-DldUt8tv.js} +1 -1
  195. package/dist/assets/{paperclip-Chtwsjh7.js → paperclip-CWFcTsCu.js} +1 -1
  196. package/dist/assets/{pause-BOP04ErV.js → pause-CCpGY3qg.js} +1 -1
  197. package/dist/assets/{pencil-D9ojJ_V5.js → pencil-CviRmSpy.js} +1 -1
  198. package/dist/assets/{pika-BAA2o_D9.js → pika-CGSOn140.js} +1 -1
  199. package/dist/assets/{pixverse-Cg6kYapr.js → pixverse-hqijNgdF.js} +1 -1
  200. package/dist/assets/play-gSzuLJWl.js +1 -0
  201. package/dist/assets/{plug-AiEJQNqZ.js → plug-CCpoxaDM.js} +1 -1
  202. package/dist/assets/plus-CwKarPA6.js +1 -0
  203. package/dist/assets/{poivelle-CXexGIHQ.js → poivelle-BetUJVZU.js} +1 -1
  204. package/dist/assets/{popover-B19Mwnte.js → popover-14jHG21y.js} +1 -1
  205. package/dist/assets/{producer-t30I_n1a.js → producer-FVRoLWlQ.js} +1 -1
  206. package/dist/assets/{qrart-KXAjcMVd.js → qrart-DyTDi4GZ.js} +1 -1
  207. package/dist/assets/{qwenimage-BSWnzFX8.js → qwenimage-nE6zZ0LS.js} +1 -1
  208. package/dist/assets/{realtime-dyUL5gTl.js → realtime-CWG_Ti28.js} +1 -1
  209. package/dist/assets/{refresh-cw-C7pDC97K.js → refresh-cw-LcYscKQ-.js} +1 -1
  210. package/dist/assets/rotate-ccw-Bo7KtpMu.js +1 -0
  211. package/dist/assets/rotate-cw-CD8xES6w.js +1 -0
  212. package/dist/assets/{row-BUXbo_F4.js → row-D_DEh6Xl.js} +1 -1
  213. package/dist/assets/search-b_c_47BV.js +1 -0
  214. package/dist/assets/{seedance-DYFFGyr2.js → seedance-6PiEj-B2.js} +1 -1
  215. package/dist/assets/{seedream-Qe5Usaxl.js → seedream-yHV_q-Ae.js} +1 -1
  216. package/dist/assets/{select-D2uv1cbt.js → select-CD3MG9sV.js} +1 -1
  217. package/dist/assets/{serp-D1BPo8kK.js → serp-Cq0cLf_x.js} +1 -1
  218. package/dist/assets/{shield-C-rcf9l1.js → shield-Cm7slfR-.js} +1 -1
  219. package/dist/assets/{showcase-DnVkF0_b.js → showcase-DYvH5oMm.js} +1 -1
  220. package/dist/assets/{showcaseRecreateMixin-apGTM24e.js → showcaseRecreateMixin-CT2Cvorb.js} +1 -1
  221. package/dist/assets/{shuffle-DJswF87H.js → shuffle-B1KYbijI.js} +1 -1
  222. package/dist/assets/{site-CEPHwLgd.js → site-BEX0ZLbD.js} +1 -1
  223. package/dist/assets/{site-1pjTNxh5.js → site-BYASZitz.js} +1 -1
  224. package/dist/assets/{site-Bvh-2S-J.js → site-BjLO0gUB.js} +1 -1
  225. package/dist/assets/{site-BOu2zV-d.js → site-Bt_JKZ8_.js} +1 -1
  226. package/dist/assets/{site-DDA2o_Id.js → site-C7-KBTVd.js} +1 -1
  227. package/dist/assets/{site-C6oN2RaM.js → site-CDPN4jzA.js} +1 -1
  228. package/dist/assets/{site-B596s5Hy.js → site-CK0w9rEp.js} +1 -1
  229. package/dist/assets/{site-CNEqbjRh.js → site-CTK1gxZP.js} +1 -1
  230. package/dist/assets/{site-Byfe5O5U.js → site-CrmLn8MR.js} +1 -1
  231. package/dist/assets/{site-BtiNTH-u.js → site-DPTs-HaR.js} +1 -1
  232. package/dist/assets/{site-C8eb5zY0.js → site-DX9RE0Cm.js} +1 -1
  233. package/dist/assets/{site-B0ySowjc.js → site-n5xenwh8.js} +1 -1
  234. package/dist/assets/siteHome-DDAyaghg.js +1 -0
  235. package/dist/assets/{slider-B49gjC66.js → slider-BIlpcCpb.js} +1 -1
  236. package/dist/assets/{solana-wallets-4lUhwO0E.js → solana-wallets-DR-tBP0Q.js} +2 -2
  237. package/dist/assets/{sora-BsMjVXhF.js → sora-D3Oa75Xq.js} +1 -1
  238. package/dist/assets/{sparkles-BZHTMV6g.js → sparkles-DP6P2HKD.js} +1 -1
  239. package/dist/assets/square-DuewWOOD.js +1 -0
  240. package/dist/assets/{store-CAiKYenZ.js → store-LrvK8rpV.js} +1 -1
  241. package/dist/assets/{suno-B9SQateb.js → suno-CLaEQFqS.js} +1 -1
  242. package/dist/assets/{switch-cui34BG0.js → switch-CPDNjdtX.js} +1 -1
  243. package/dist/assets/{table-t8i5Xkas.js → table-CTGYIkVp.js} +1 -1
  244. package/dist/assets/{tabs-C48-bEy8.js → tabs-O76shONs.js} +1 -1
  245. package/dist/assets/{tag-CZL93MZS.js → tag-CrzKKwWK.js} +1 -1
  246. package/dist/assets/{taskPolling-DFVKVaSg.js → taskPolling-Cpolqm-4.js} +1 -1
  247. package/dist/assets/terminal-TymL8Q-5.js +1 -0
  248. package/dist/assets/{time-picker-DFWL--4z.js → time-picker-CB3JdUZX.js} +1 -1
  249. package/dist/assets/{tooltip-b_dQsMp2.js → tooltip-BKeGCQnC.js} +1 -1
  250. package/dist/assets/{trash-2-DE5mDXQJ.js → trash-2-1--IdOz8.js} +1 -1
  251. package/dist/assets/{triangle-alert-k9eV3S4u.js → triangle-alert-CsggA_lm.js} +1 -1
  252. package/dist/assets/{upload-DcGdzIA8.js → upload-C1ZLDC6M.js} +1 -1
  253. package/dist/assets/{upload-C_YrWWV5.js → upload-QoHt30kH.js} +1 -1
  254. package/dist/assets/user-avGCO_1o.js +1 -0
  255. package/dist/assets/{veo-CvKwb0nV.js → veo-DgIXEVsh.js} +1 -1
  256. package/dist/assets/{video-DBacGDok.js → video-ByywsO-8.js} +1 -1
  257. package/dist/assets/{volume-2-BRQneKEO.js → volume-2-qWcpmyoS.js} +1 -1
  258. package/dist/assets/{wallet-D-QaX5a3.js → wallet-BnFgg2rL.js} +1 -1
  259. package/dist/assets/{wan-C26g3uja.js → wan-CAJwbpzm.js} +1 -1
  260. package/dist/assets/{wand-sparkles-BEDgmNQE.js → wand-sparkles-D1YhC4me.js} +1 -1
  261. package/dist/assets/{web-BH1GhKbC.js → web-BqjUMapP.js} +1 -1
  262. package/dist/assets/{webextrator-D1_Tyoxh.js → webextrator-D2P5CJFc.js} +1 -1
  263. package/dist/assets/{zap-BmQzpLlI.js → zap-B41N3VAA.js} +1 -1
  264. package/dist/index.html +4 -4
  265. package/package.json +3 -5
  266. package/dist/assets/Conversation-B_7cXksy.js +0 -1
  267. package/dist/assets/Conversation-BfZwK4nv.css +0 -1
  268. package/dist/assets/Conversation-D33iRE99.js +0 -2
  269. package/dist/assets/Index-BcnBM2_V.css +0 -1
  270. package/dist/assets/Index-CiY5C67L.js +0 -1
  271. package/dist/assets/Index-DAMOBJFE.js +0 -87
  272. package/dist/assets/Index-gg_QycUv.css +0 -1
  273. package/dist/assets/List-D1LHqOx8.js +0 -1
  274. package/dist/assets/List-fEYoiJm9.css +0 -1
  275. package/dist/assets/Message-DXOrh0Yb.js +0 -3
  276. package/dist/assets/Navigator-CWAnHPzI.css +0 -1
  277. package/dist/assets/Navigator-DA9O7LrE.js +0 -8
  278. package/dist/assets/Pay-CVDZ8AV7.css +0 -1
  279. package/dist/assets/Pay-nyj5eV3Q.js +0 -1
  280. package/dist/assets/arrow-down-C6wrQYLF.js +0 -1
  281. package/dist/assets/arrow-left-9K7XoAiv.js +0 -1
  282. package/dist/assets/arrow-right-DWu6OFra.js +0 -1
  283. package/dist/assets/arrow-up-DkByh98Z.js +0 -1
  284. package/dist/assets/check-CvicfOQx.js +0 -1
  285. package/dist/assets/chevron-down-Cu8qxeJ7.js +0 -1
  286. package/dist/assets/chevron-right-BmBtd2ES.js +0 -1
  287. package/dist/assets/circle-check-Bh3XYVs5.js +0 -1
  288. package/dist/assets/clock-CIt1oE3U.js +0 -1
  289. package/dist/assets/code-S3-Q90Fi.js +0 -1
  290. package/dist/assets/gauge-BfO9lXC9.js +0 -1
  291. package/dist/assets/loader-circle-CDDo32OH.js +0 -1
  292. package/dist/assets/modelPresentation-C1qgMEpp.js +0 -1
  293. package/dist/assets/music-2-CXSc24qt.js +0 -1
  294. package/dist/assets/play-0nBvxH6w.js +0 -1
  295. package/dist/assets/plus-BeTeDkfL.js +0 -1
  296. package/dist/assets/rotate-ccw-Csq3BM2o.js +0 -1
  297. package/dist/assets/rotate-cw-7JNWsuSC.js +0 -1
  298. package/dist/assets/search-D_IRBgpu.js +0 -1
  299. package/dist/assets/siteHome-BY2nqQ15.js +0 -1
  300. package/dist/assets/square-BMfu1Pnd.js +0 -1
  301. package/dist/assets/terminal-C6r6vbBY.js +0 -1
  302. package/dist/assets/user-kwcck43C.js +0 -1
@@ -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,K as a,L as o,M as s,Mt as c,N as l,Q as u,S as d,St as f,T as p,b as m,ft as h,ht as g,j as _,k as v,mt as y,qt as b,rt as x,st as S,tt as C,wt as w,z as T}from"./vendor-chart-Dw-P17PN.js";import{r as E,t as D}from"./select-D2uv1cbt.js";import{n as O,t as k}from"./form-BdKMEyCR.js";import{_ as ee,h as te,v as ne}from"./models-DGI43qxx.js";import{t as A}from"./input-number-Djsi0Vju.js";import{t as re}from"./segmented-D0zHdf9D.js";import{t as ie}from"./arrow-left-9K7XoAiv.js";import{t as j}from"./arrow-right-DWu6OFra.js";import{t as ae}from"./arrow-up-DkByh98Z.js";import{t as oe}from"./box-CUMQZuBm.js";import{t as se}from"./check-CvicfOQx.js";import{t as ce}from"./chevron-down-Cu8qxeJ7.js";import{t as le}from"./chevron-right-BmBtd2ES.js";import{t as ue}from"./copy-CO_zOPB-.js";import{t as de}from"./download-B-NUX5--.js";import{t as M}from"./file-text-g2ZxAyz9.js";import{t as N}from"./history-BS-RsX0W.js";import{t as P}from"./house-SuFpuLeo.js";import{t as F}from"./image-CtUMzDVv.js";import{t as fe}from"./loader-circle-CDDo32OH.js";import{t as I}from"./mouse-pointer-2-BBpO7Y1t.js";import{t as pe}from"./music-2-CXSc24qt.js";import{t as L}from"./play-0nBvxH6w.js";import{t as me}from"./plus-BeTeDkfL.js";import{t as he}from"./search-D_IRBgpu.js";import{t as R}from"./sparkles-BZHTMV6g.js";import{t as ge}from"./trash-2-DE5mDXQJ.js";import{t as _e}from"./triangle-alert-k9eV3S4u.js";import{t as ve}from"./upload-DcGdzIA8.js";import{t as z}from"./video-DBacGDok.js";import{a as B}from"./i18n-DBtpbeq0.js";import{A as V,Ua as H,Wa as ye,Ya as be,fo as U,io as W}from"./index-4v6EkWvr.js";import{t as xe}from"./VideoPlayer-CVXvO7ac.js";var G=H(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),Se=H(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),K=H(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),q=H(`clapperboard`,[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]),Ce=H(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),we=H(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),J=H(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Te=H(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Ee=H(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),De=H(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),Y=H(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),X={class:`discovery-home`},Oe={class:`discovery-header`},Z={class:`brand`},Q={class:`project-links`},ke=[`title`,`aria-label`,`onClick`],Ae={key:0,class:`discovery-state`,role:`status`},je={class:`creator`,"aria-labelledby":`poivelle-create-title`},Me={class:`creator-kicker`},Ne={id:`poivelle-create-title`},Pe=[`aria-label`],Fe=[`disabled`,`onClick`],Ie=[`placeholder`,`disabled`],Le={class:`composer-footer`},Re=[`disabled`,`title`],ze={class:`prompt-starters`},Be=[`disabled`,`onClick`],Ve={class:`works`,"aria-labelledby":`poivelle-works-title`},He={class:`works-heading`},Ue={id:`poivelle-works-title`},We={class:`search`},Ge=[`placeholder`,`aria-label`],Ke={class:`category-tabs`},qe=[`onClick`],Je={class:`work-grid`},Ye={class:`cover`},Xe=[`src`,`alt`,`onError`],Ze={key:2,class:`film-badge`},Qe=[`aria-label`,`onClick`],$e={class:`duration-badge`},et={class:`work-copy`},$={class:`work-meta`},tt={class:`work-actions`},nt=[`onClick`],rt=[`disabled`,`onClick`],it={key:0,class:`film-dialog-heading`},at={id:`poivelle-film-dialog-title`},ot=V(T({__name:`DiscoveryHome`,emits:[`open-studio`],setup(a,{emit:d}){let f=d,h=ee(),b=v(()=>h.state.poivelle),T=v(()=>b.value?.projects??[]),E=v(()=>b.value?.discoveryWorks??[]),D=w(``),O=w(``),k=w(!1),A=w(),re=w(new Set),ie=w(`official:pulsecam`),j=w(`all`),oe=[{workId:`official:pulsecam`,label:`poivelle.discovery.commercial`,icon:q},{workId:`official:moonlit-signal`,label:`poivelle.discovery.musicVideo`,icon:pe},{workId:`official:northstar-origin`,label:`poivelle.discovery.documentary`,icon:K}],se=[`poivelle.discovery.starterProduct`,`poivelle.discovery.starterMusic`,`poivelle.discovery.starterDocumentary`],ce=[{value:`all`,label:`poivelle.discovery.all`},{value:`commercial`,label:`poivelle.discovery.commercial`},{value:`music_video`,label:`poivelle.discovery.musicVideo`},{value:`narrative`,label:`poivelle.discovery.narrative`},{value:`documentary`,label:`poivelle.discovery.documentary`},{value:`community`,label:`poivelle.discovery.community`}],de=v(()=>{let e=O.value.trim().toLowerCase();return E.value.filter(t=>(j.value===`all`||t.category===j.value)&&(!e||`${t.title} ${t.description} ${t.creator_name} ${(t.tags??[]).join(` `)}`.toLowerCase().includes(e)))}),M=v(()=>b.value?.status?.bootstrap===te.Request),N=v(()=>b.value?.error),P=v({get:()=>!!A.value,set:e=>{e||(A.value=void 0)}}),F=v(()=>{let e=E.value.find(e=>e.id===ie.value);return e&&e.copyable!==!1?e:E.value.find(e=>e.copyable!==!1)}),I=()=>h.dispatch(`poivelle/bootstrap`,{loadProject:!1}),me=e=>{re.value=new Set([...re.value,e])},R=e=>e.video_url?.startsWith(`https://`)?e.video_url:void 0,ge=e=>{if(e&&typeof e==`object`&&`response`in e){let t=e.response?.data?.detail;if(typeof t==`string`)return t;if(typeof t?.message==`string`)return t.message}return e instanceof Error?e.message:B(`poivelle.error.generic`)},_e=e=>{let t=Math.floor(e/60),n=e%60;return t?`${t}:${n.toString().padStart(2,`0`)}`:`0:${n.toString().padStart(2,`0`)}`},ve=async e=>{await h.dispatch(`poivelle/loadProject`,e),f(`open-studio`)},z=async(e,t)=>{if(!k.value){k.value=!0;try{await h.dispatch(`poivelle/copyDiscoveryWork`,{work_id:e.id,prompt:t,title:t.slice(0,80)}),f(`open-studio`)}catch(e){ne.error(ge(e))}finally{k.value=!1}}},V=async()=>{let e=F.value;e&&D.value.trim()&&await z(e,D.value.trim())},H=async e=>{await z(e,D.value.trim()||`${B(`poivelle.discovery.copyPrefix`)} ${e.title}`)};return u(I),(a,u)=>(C(),l(`main`,X,[e(`header`,Oe,[e(`div`,Z,[o(c(q),{size:19,"aria-hidden":`true`}),u[3]||=r(` POIVELLE`,-1)]),e(`div`,Q,[(C(!0),l(p,null,x(T.value.slice(0,3),e=>(C(),l(`button`,{key:e.id,type:`button`,title:e.title,"aria-label":e.title,onClick:t=>ve(e.id)},[r(i(e.title)+` `,1),o(c(le),{size:13,"aria-hidden":`true`})],8,ke))),128))])]),M.value||N.value?(C(),l(`div`,Ae,[M.value?(C(),_(c(fe),{key:0,size:16,class:`spinning`,"aria-hidden":`true`})):s(``,!0),e(`span`,null,i(M.value?a.$t(`poivelle.status.loading`):N.value),1),N.value?(C(),l(`button`,{key:1,type:`button`,onClick:I},i(a.$t(`poivelle.action.retry`)),1)):s(``,!0)])):s(``,!0),e(`section`,je,[e(`p`,Me,i(a.$t(`poivelle.discovery.kicker`)),1),e(`h1`,Ne,i(a.$t(`poivelle.discovery.title`)),1),e(`div`,{class:`mode-switch`,"aria-label":a.$t(`poivelle.discovery.skills`)},[(C(),l(p,null,x(oe,t=>e(`button`,{key:t.workId,type:`button`,class:n({active:ie.value===t.workId}),disabled:M.value,onClick:e=>ie.value=t.workId},[(C(),_(S(t.icon),{size:15,"aria-hidden":`true`})),r(` `+i(a.$t(t.label)),1)],10,Fe)),64))],8,Pe),e(`form`,{class:`composer`,onSubmit:t(V,[`prevent`])},[g(e(`textarea`,{"onUpdate:modelValue":u[0]||=e=>D.value=e,placeholder:a.$t(`poivelle.discovery.placeholder`),disabled:M.value,maxlength:`500`,rows:`4`},null,8,Ie),[[m,D.value]]),e(`div`,Le,[e(`span`,null,i(D.value.length)+`/500`,1),e(`button`,{type:`submit`,disabled:!D.value.trim()||!F.value||M.value||k.value,title:a.$t(`poivelle.discovery.create`)},[k.value?(C(),_(c(fe),{key:0,size:18,class:`spinning`,"aria-hidden":`true`})):(C(),_(c(ae),{key:1,size:18,"aria-hidden":`true`}))],8,Re)])],32),e(`div`,ze,[(C(),l(p,null,x(se,t=>e(`button`,{key:t,type:`button`,disabled:M.value,onClick:e=>D.value=a.$t(t)},i(a.$t(t)),9,Be)),64))])]),e(`section`,Ve,[e(`div`,He,[e(`div`,null,[e(`span`,null,i(a.$t(`poivelle.discovery.galleryKicker`)),1),e(`h2`,Ue,i(a.$t(`poivelle.discovery.gallery`)),1)]),e(`label`,We,[o(c(he),{size:16,"aria-hidden":`true`}),g(e(`input`,{"onUpdate:modelValue":u[1]||=e=>O.value=e,placeholder:a.$t(`poivelle.discovery.search`),"aria-label":a.$t(`poivelle.discovery.search`)},null,8,Ge),[[m,O.value]])])]),e(`div`,Ke,[(C(),l(p,null,x(ce,t=>e(`button`,{key:t.value,type:`button`,class:n({active:j.value===t.value}),onClick:e=>j.value=t.value},i(a.$t(t.label)),11,qe)),64))]),e(`div`,Je,[(C(!0),l(p,null,x(de.value,t=>(C(),l(`article`,{key:t.id,class:`work-card`},[e(`div`,Ye,[t.cover_url&&!re.value.has(t.id)?(C(),l(`img`,{key:0,src:t.cover_url,alt:t.title,onError:e=>me(t.id)},null,40,Xe)):(C(),_(c(Ce),{key:1,size:32,"aria-hidden":`true`})),R(t)?(C(),l(`span`,Ze,i(a.$t(`poivelle.discovery.finishedFilm`)),1)):s(``,!0),R(t)?(C(),l(`button`,{key:3,type:`button`,class:`cover-play`,"aria-label":`${a.$t(`poivelle.discovery.playFilm`)}: ${t.title}`,onClick:e=>A.value=t},[o(c(L),{size:18,fill:`currentColor`,"aria-hidden":`true`}),r(` `+i(a.$t(`poivelle.discovery.playFilm`)),1)],8,Qe)):s(``,!0),e(`span`,$e,i(t.duration_seconds?_e(t.duration_seconds):a.$t(`poivelle.discovery.community`)),1)]),e(`div`,et,[e(`div`,$,[e(`span`,null,i(t.creator_name),1),e(`strong`,null,i(t.title),1),e(`p`,null,i(t.description),1)]),e(`div`,tt,[R(t)?(C(),l(`button`,{key:0,type:`button`,class:`play-button`,onClick:e=>A.value=t},[o(c(L),{size:14,fill:`currentColor`,"aria-hidden":`true`}),r(` `+i(a.$t(`poivelle.discovery.play`)),1)],8,nt)):s(``,!0),t.copyable===!1?s(``,!0):(C(),l(`button`,{key:1,type:`button`,class:`copy-button`,disabled:M.value||k.value,onClick:e=>H(t)},[o(c(ue),{size:14,"aria-hidden":`true`}),r(` `+i(a.$t(`poivelle.discovery.copy`)),1)],8,rt))])])]))),128))])]),o(c(be),{modelValue:P.value,"onUpdate:modelValue":u[2]||=e=>P.value=e,class:`film-preview-dialog`,"aria-labelledby":`poivelle-film-dialog-title`,width:`min(920px, calc(100vw - 32px))`,"align-center":``,"append-to-body":``,"destroy-on-close":``},{header:y(()=>[A.value?(C(),l(`div`,it,[e(`span`,null,i(a.$t(`poivelle.discovery.finishedFilm`)),1),e(`strong`,at,i(A.value.title),1),e(`small`,null,[r(i(A.value.creator_name)+` `,1),A.value.duration_seconds?(C(),l(p,{key:0},[r(` · `+i(_e(A.value.duration_seconds)),1)],64)):s(``,!0)])])):s(``,!0)]),default:y(()=>[A.value&&R(A.value)?(C(),_(xe,{key:`${A.value.id}-${A.value.video_url}`,src:R(A.value)},null,8,[`src`])):s(``,!0)]),_:1},8,[`modelValue`])]))}}),[[`__scopeId`,`data-v-91feafb0`]]),st={class:`studio-header`},ct={class:`identity`},lt=[`title`],ut={class:`wordmark`},dt={key:0,class:`version`},ft={class:`actions`},pt={class:`sync-state`},mt=[`title`],ht=[`disabled`],gt=V(T({__name:`StudioHeader`,props:{projectTitle:{},graphVersion:{},canRun:{type:Boolean},canEdit:{type:Boolean},primaryLabel:{}},emits:[`open-projects`,`home`,`commit`,`run`],setup(t){return(n,a)=>(C(),l(`header`,st,[e(`div`,ct,[e(`button`,{class:`home-button`,type:`button`,title:n.$t(`poivelle.discovery.back`),onClick:a[0]||=e=>n.$emit(`home`)},[o(c(ie),{size:16,"aria-hidden":`true`})],8,lt),e(`span`,ut,[o(c(q),{size:15,"aria-hidden":`true`}),a[4]||=r(` POIVELLE`,-1)]),e(`button`,{class:`project-button`,type:`button`,onClick:a[1]||=e=>n.$emit(`open-projects`)},[e(`span`,null,i(t.projectTitle||n.$t(`poivelle.project.noProject`)),1),o(c(ce),{size:14,"aria-hidden":`true`})]),t.graphVersion===void 0?s(``,!0):(C(),l(`span`,dt,`Graph v`+i(t.graphVersion),1))]),e(`div`,ft,[e(`span`,pt,[a[5]||=e(`span`,{class:`sync-dot`},null,-1),r(` `+i(n.$t(`poivelle.status.synced`)),1)]),t.canEdit?(C(),l(`button`,{key:0,class:`icon-button`,type:`button`,title:n.$t(`poivelle.action.commit`),onClick:a[2]||=e=>n.$emit(`commit`)},[o(c(we),{size:17,"aria-hidden":`true`})],8,mt)):s(``,!0),e(`button`,{class:`primary-button`,type:`button`,disabled:!t.canRun,onClick:a[3]||=e=>n.$emit(`run`)},[o(c(L),{size:15,fill:`currentColor`,"aria-hidden":`true`}),r(` `+i(t.primaryLabel||n.$t(`poivelle.action.runSkill`)),1)],8,ht)])]))}}),[[`__scopeId`,`data-v-86d45f69`]]),_t={class:`production-rail`},vt={class:`rail-section`},yt={class:`section-heading`},bt=[`title`],xt={class:`project-list`},St=[`onClick`],Ct={key:0,class:`empty-copy`},wt={class:`rail-section assets-section`},Tt={class:`section-heading`},Et=[`title`],Dt={class:`asset-filters`},Ot=[`onClick`],kt={class:`asset-list`},At={key:0,class:`empty-copy`},jt={class:`rail-section compact-section`},Mt={class:`section-heading static`},Nt={class:`revision-list`},Pt={key:0,class:`empty-copy`},Ft=V(T({__name:`ProductionRail`,props:{projects:{},currentProjectId:{},assets:{},revisions:{},canEdit:{type:Boolean}},emits:[`select-project`,`create-project`,`import-asset`],setup(t){let r=t,a=[`all`,`character`,`location`,`image`,`video`,`voice`],u=w(`all`),d=v(()=>u.value===`all`?r.assets:r.assets.filter(e=>e.kind===u.value)),f=e=>e===`video`?z:e===`voice`||e===`music`||e===`sfx`?G:e===`script`||e===`brand`?M:F;return(r,m)=>(C(),l(`aside`,_t,[e(`div`,vt,[e(`div`,yt,[e(`span`,null,i(r.$t(`poivelle.section.projects`)),1),t.canEdit?(C(),l(`button`,{key:0,type:`button`,title:r.$t(`poivelle.project.create`),onClick:m[0]||=e=>r.$emit(`create-project`)},[o(c(me),{size:15,"aria-hidden":`true`})],8,bt)):s(``,!0)]),e(`div`,xt,[(C(!0),l(p,null,x(t.projects,a=>(C(),l(`button`,{key:a.id,type:`button`,class:n([`project-row`,{active:a.id===t.currentProjectId}]),onClick:e=>r.$emit(`select-project`,a.id)},[o(c(q),{size:15,"aria-hidden":`true`}),e(`span`,null,i(a.title),1),e(`small`,null,`v`+i(a.graph_version),1)],10,St))),128)),t.projects.length?s(``,!0):(C(),l(`p`,Ct,i(r.$t(`poivelle.project.empty`)),1))])]),e(`div`,wt,[e(`div`,Tt,[e(`span`,null,i(r.$t(`poivelle.section.assets`)),1),t.canEdit?(C(),l(`button`,{key:0,type:`button`,title:r.$t(`poivelle.asset.import`),onClick:m[1]||=e=>r.$emit(`import-asset`)},[o(c(ve),{size:15,"aria-hidden":`true`})],8,Et)):s(``,!0)]),e(`div`,Dt,[(C(),l(p,null,x(a,t=>e(`button`,{key:t,type:`button`,class:n({active:u.value===t}),onClick:e=>u.value=t},i(t===`all`?r.$t(`poivelle.asset.all`):t),11,Ot)),64))]),e(`div`,kt,[(C(!0),l(p,null,x(d.value,t=>(C(),l(`button`,{key:t.id,type:`button`,class:`asset-row`},[(C(),_(S(f(t.kind)),{size:15,"aria-hidden":`true`})),e(`span`,null,[e(`strong`,null,i(t.title),1),e(`small`,null,i(t.kind)+` · `+i(t.scope),1)])]))),128)),d.value.length?s(``,!0):(C(),l(`p`,At,i(r.$t(`poivelle.asset.empty`)),1))])]),e(`div`,jt,[e(`div`,Mt,[e(`span`,null,i(r.$t(`poivelle.section.revisions`)),1),o(c(N),{size:14,"aria-hidden":`true`})]),e(`div`,Nt,[(C(!0),l(p,null,x(t.revisions.slice(0,4),t=>(C(),l(`div`,{key:t.id,class:`revision-row`},[e(`span`,null,`R`+i(t.revision_number),1),e(`small`,null,`Graph v`+i(t.graph_version),1)]))),128)),t.revisions.length?s(``,!0):(C(),l(`p`,Pt,i(r.$t(`poivelle.revision.empty`)),1))])])]))}}),[[`__scopeId`,`data-v-71c6054d`]]),It=[`aria-label`],Lt=[`onClick`],Rt=V(T({__name:`ProjectionTabs`,props:{modelValue:{},canEdit:{type:Boolean}},emits:[`update:modelValue`,`create-node`],setup(t){let a=[{value:`overview`,label:`poivelle.projection.overview`,icon:P},{value:`canvas`,label:`poivelle.projection.advanced`,icon:J},{value:`storyboard`,label:`poivelle.projection.storyboard`,icon:q},{value:`timeline`,label:`poivelle.projection.timeline`,icon:De},{value:`review`,label:`poivelle.projection.review`,icon:Te}];return(u,d)=>(C(),l(`nav`,{class:`projection-tabs`,"aria-label":u.$t(`poivelle.projection.label`)},[(C(),l(p,null,x(a,a=>e(`button`,{key:a.value,type:`button`,class:n({active:t.modelValue===a.value}),onClick:e=>u.$emit(`update:modelValue`,a.value)},[(C(),_(S(a.icon),{size:14,"aria-hidden":`true`})),r(` `+i(u.$t(a.label)),1)],10,Lt)),64)),d[1]||=e(`span`,{class:`spacer`},null,-1),t.canEdit?(C(),l(`button`,{key:0,class:`add-node`,type:`button`,onClick:d[0]||=e=>u.$emit(`create-node`)},[o(c(me),{size:14,"aria-hidden":`true`}),r(` `+i(u.$t(`poivelle.node.create`)),1)])):s(``,!0)],8,It))}}),[[`__scopeId`,`data-v-393d2d3e`]]),zt={class:`connections`,"aria-hidden":`true`},Bt=[`x1`,`y1`,`x2`,`y2`],Vt=[`onClick`],Ht={class:`node-type`},Ut={class:`node-summary`},Wt={key:0,class:`lock-mark`},Gt={key:0,class:`empty-canvas`},Kt=V(T({__name:`GraphCanvas`,props:{graph:{},selectedNodeId:{},canEdit:{type:Boolean}},emits:[`select-node`,`create-node`],setup(a){let u=a,d=v(()=>new Map(u.graph.layouts.map(e=>[e.node_id,e]))),f=e=>{let t=u.graph.nodes.findIndex(t=>t.id===e);return{x:52+t%3*250,y:54+Math.floor(t/3)*170,width:208,height:116}},m=e=>d.value.get(e)??f(e),h=e=>{let t=m(e);return{x:t.x+t.width/2,y:t.y+t.height/2}},g=e=>{let t=m(e);return{left:`${t.x}px`,top:`${t.y}px`,width:`${t.width}px`,minHeight:`${t.height}px`}},_=v(()=>u.graph.edges.filter(e=>u.graph.nodes.some(t=>t.id===e.source.node_id)&&u.graph.nodes.some(t=>t.id===e.target.node_id))),y=e=>{let t=e.payload.text??e.payload.prompt??e.payload.description;return typeof t==`string`&&t?t:`Version ${e.version}`};return(u,d)=>(C(),l(`div`,{class:`graph-canvas`,onClick:d[1]||=t(e=>u.$emit(`select-node`,void 0),[`self`])},[(C(),l(`svg`,zt,[(C(!0),l(p,null,x(_.value,e=>(C(),l(`line`,{key:e.id,x1:h(e.source.node_id).x,y1:h(e.source.node_id).y,x2:h(e.target.node_id).x,y2:h(e.target.node_id).y},null,8,Bt))),128))])),(C(!0),l(p,null,x(a.graph.nodes,f=>(C(),l(`button`,{key:f.id,type:`button`,class:n([`graph-node`,`type-${f.node_type}`,{selected:f.id===a.selectedNodeId}]),style:b(g(f.id)),onClick:t(e=>u.$emit(`select-node`,f.id),[`stop`])},[e(`span`,Ht,i(f.node_type),1),e(`strong`,null,i(f.title),1),e(`span`,Ut,i(y(f)),1),f.locked_paths.length?(C(),l(`span`,Wt,[o(c(Ee),{size:11}),d[2]||=r(` locked`,-1)])):s(``,!0)],14,Vt))),128)),a.graph.nodes.length?s(``,!0):(C(),l(`div`,Gt,[o(c(J),{size:28,"stroke-width":`1.5`,"aria-hidden":`true`}),e(`h2`,null,i(u.$t(`poivelle.graph.emptyTitle`)),1),e(`p`,null,i(u.$t(`poivelle.graph.emptyBody`)),1),a.canEdit?(C(),l(`button`,{key:0,type:`button`,onClick:d[0]||=e=>u.$emit(`create-node`)},[o(c(me),{size:15,"aria-hidden":`true`}),r(` `+i(u.$t(`poivelle.node.create`)),1)])):s(``,!0)]))]))}}),[[`__scopeId`,`data-v-cd67c1fc`]]),qt={class:`media-lane`},Jt={key:0,class:`candidate-strip`},Yt=[`src`],Xt=[`src`],Zt=[`onClick`],Qt={key:1},$t=[`onClick`],en={key:1,class:`unavailable-takes`},tn={key:2,class:`empty-candidates`},nn=V(T({__name:`StoryboardMediaLane`,props:{title:{},kind:{},nodeIds:{},artifacts:{},takes:{},selections:{},canEdit:{type:Boolean},canSelect:{type:Boolean}},emits:[`select-node`,`select-take`],setup(t){let r=t,a=v(()=>{let e=new Set(r.nodeIds),t=new Map(r.artifacts.map(e=>[e.id,e])),n=r.takes.filter(t=>e.has(t.target_node_id)&&t.state===`ready`).flatMap(e=>[...new Set(e.artifact_ids)].map(e=>t.get(e)).filter(e=>!!e).map(t=>({key:`${e.id}:${t.id}`,take:e,artifact:t,selected:r.selections.some(t=>t.target_node_id===e.target_node_id&&t.take_id===e.id)}))),i=new Set(n.map(e=>e.artifact.id)),a=r.artifacts.filter(t=>e.has(t.node_id??``)&&t.kind===r.kind&&!i.has(t.id)).map(e=>({key:e.id,take:void 0,artifact:e,selected:!1}));return[...n,...a]}),o=v(()=>r.takes.filter(e=>r.nodeIds.includes(e.target_node_id)&&e.state!==`ready`)),c=w([]),u=e=>{c.value=c.value.includes(e)?c.value.filter(t=>t!==e):[...c.value.slice(-1),e]};return(r,d)=>(C(),l(`section`,qt,[e(`header`,null,[e(`span`,null,i(t.title),1),t.nodeIds[0]?(C(),l(`button`,{key:0,type:`button`,onClick:d[0]||=e=>r.$emit(`select-node`,t.nodeIds[0])},i(r.$t(`poivelle.storyboard.openNode`)),1)):s(``,!0)]),a.value.length?(C(),l(`div`,Jt,[(C(!0),l(p,null,x(a.value,a=>(C(),l(`article`,{key:a.key,class:n([`candidate`,{selected:a.selected,comparing:c.value.includes(a.key)}])},[t.kind===`image`?(C(),l(`img`,{key:0,src:a.artifact.storage_url,alt:``},null,8,Yt)):(C(),l(`video`,{key:1,src:a.artifact.storage_url,controls:``,preload:`metadata`},null,8,Xt)),e(`div`,null,[e(`span`,null,i(a.take?`TAKE`:`ARTIFACT`),1),e(`strong`,null,i(a.artifact.id.slice(-8)),1),t.canEdit&&t.canSelect&&a.take&&!a.selected?(C(),l(`button`,{key:0,type:`button`,onClick:e=>r.$emit(`select-take`,{target_node_id:a.take.target_node_id,take_id:a.take.id})},i(r.$t(`poivelle.storyboard.selectTake`)),9,Zt)):a.selected?(C(),l(`em`,Qt,i(r.$t(`poivelle.storyboard.selected`)),1)):s(``,!0),e(`button`,{type:`button`,class:`compare-toggle`,onClick:e=>u(a.key)},i(c.value.includes(a.key)?r.$t(`poivelle.storyboard.comparing`):r.$t(`poivelle.storyboard.compare`)),9,$t)])],2))),128))])):s(``,!0),o.value.length?(C(),l(`div`,en,[(C(!0),l(p,null,x(o.value,e=>(C(),l(`span`,{key:e.id},i(e.state===`failed`?r.$t(`poivelle.storyboard.failedTake`):r.$t(`poivelle.storyboard.restrictedTake`)),1))),128))])):s(``,!0),!a.value.length&&!o.value.length?(C(),l(`div`,tn,i(r.$t(`poivelle.storyboard.noCandidates`)),1)):s(``,!0)]))}}),[[`__scopeId`,`data-v-4e385f6a`]]),rn={class:`storyboard-view`},an={key:0,class:`storyboard-heading`},on={class:`section-label`},sn=[`onClick`],cn={class:`shot-number`},ln={class:`shot-production`},un={class:`shot-metadata`},dn={class:`prompt-columns`},fn={class:`candidate-columns`},pn=[`onClick`],mn={key:0,class:`empty-view`},hn=V(T({__name:`StoryboardView`,props:{graph:{},storyboard:{},artifacts:{},takes:{},selections:{},selectedNodeId:{},canEdit:{type:Boolean},canSelect:{type:Boolean}},emits:[`select-node`,`select-take`],setup(t){let r=t,a=v(()=>r.storyboard?.sections.reduce((e,t)=>e+t.shots.length,0)??0),u=v(()=>r.graph.nodes.filter(e=>[`storyboard`,`scene`,`shot`,`image`,`video`].includes(e.node_type)));return(r,d)=>(C(),l(`div`,rn,[t.storyboard?(C(),l(`header`,an,[e(`div`,null,[e(`span`,null,i(t.storyboard.schema_ref),1),e(`h2`,null,i(t.storyboard.title),1)]),e(`dl`,null,[e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.product`)),1),e(`dd`,null,i(t.storyboard.product_name),1)]),e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.duration`)),1),e(`dd`,null,i(t.storyboard.target_duration_seconds)+`s`,1)]),e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.shots`)),1),e(`dd`,null,i(a.value),1)])])])):s(``,!0),t.storyboard?(C(!0),l(p,{key:1},x(t.storyboard.sections,a=>(C(),l(`section`,{key:a.id,class:`story-section`},[e(`div`,on,[e(`span`,null,i(String(a.order).padStart(2,`0`)),1),e(`h3`,null,i(a.title),1)]),(C(!0),l(p,null,x(a.shots,a=>(C(),l(`article`,{key:a.row.id,class:n([`shot-row`,{selected:a.shot_node_id===t.selectedNodeId}])},[e(`button`,{class:`shot-brief`,type:`button`,onClick:e=>r.$emit(`select-node`,a.shot_node_id)},[e(`span`,cn,`SHOT `+i(String(a.row.shot_number).padStart(2,`0`)),1),e(`strong`,null,i(a.row.plot_description),1),e(`span`,null,i(a.row.duration_seconds)+`s · `+i(a.row.shot_size),1)],8,sn),e(`div`,ln,[e(`dl`,un,[e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.action`)),1),e(`dd`,null,i(a.row.character_action||`—`),1)]),e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.emotion`)),1),e(`dd`,null,i(a.row.emotion||`—`),1)]),e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.lighting`)),1),e(`dd`,null,i(a.row.lighting_and_atmosphere),1)]),e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.audio`)),1),e(`dd`,null,i(a.row.audio_effects),1)])]),e(`div`,dn,[e(`div`,null,[e(`span`,null,i(r.$t(`poivelle.storyboard.imagePrompt`)),1),e(`p`,null,i(a.row.image_generation_prompt),1)]),e(`div`,null,[e(`span`,null,i(r.$t(`poivelle.storyboard.motionPrompt`)),1),e(`p`,null,i(a.row.video_motion_prompt),1)])])]),e(`div`,fn,[o(nn,{title:r.$t(`poivelle.storyboard.frames`),kind:`image`,"node-ids":a.image_node_ids,artifacts:t.artifacts,takes:t.takes,selections:t.selections,"can-edit":t.canEdit,"can-select":t.canSelect,onSelectNode:d[0]||=e=>r.$emit(`select-node`,e),onSelectTake:d[1]||=e=>r.$emit(`select-take`,e)},null,8,[`title`,`node-ids`,`artifacts`,`takes`,`selections`,`can-edit`,`can-select`]),o(nn,{title:r.$t(`poivelle.storyboard.motion`),kind:`video`,"node-ids":a.video_node_ids,artifacts:t.artifacts,takes:t.takes,selections:t.selections,"can-edit":t.canEdit,"can-select":t.canSelect,onSelectNode:d[2]||=e=>r.$emit(`select-node`,e),onSelectTake:d[3]||=e=>r.$emit(`select-take`,e)},null,8,[`title`,`node-ids`,`artifacts`,`takes`,`selections`,`can-edit`,`can-select`])])],2))),128))]))),128)):(C(),l(p,{key:2},[(C(!0),l(p,null,x(u.value,(a,s)=>(C(),l(`button`,{key:a.id,type:`button`,class:n([`legacy-card`,{selected:a.id===t.selectedNodeId}]),onClick:e=>r.$emit(`select-node`,a.id)},[e(`span`,null,i(String(s+1).padStart(2,`0`)),1),o(c(q),{size:26,"stroke-width":`1.25`,"aria-hidden":`true`}),e(`strong`,null,i(a.title),1)],10,pn))),128)),u.value.length?s(``,!0):(C(),l(`div`,mn,[o(c(q),{size:30,"stroke-width":`1.4`}),e(`h2`,null,i(r.$t(`poivelle.storyboard.emptyTitle`)),1),e(`p`,null,i(r.$t(`poivelle.storyboard.emptyBody`)),1)]))],64))]))}}),[[`__scopeId`,`data-v-ce90da94`]]),gn={class:`timeline-view`},_n={key:0,class:`master-output`,"aria-labelledby":`poivelle-master-title`},vn={class:`master-heading`},yn={class:`master-kicker`},bn={id:`poivelle-master-title`},xn=[`href`],Sn=[`src`,`aria-label`],Cn={key:0,class:`master-status`,role:`status`},wn={key:1,class:`master-status is-error`,role:`alert`},Tn={class:`master-metadata`},En={class:`timeline-ruler`},Dn={key:1,class:`tracks`},On={class:`track-label`},kn={class:`track-lane`},An=[`title`],jn=[`aria-label`],Mn={key:0,class:`clip-actions`},Nn=[`disabled`,`onClick`],Pn=[`disabled`,`onClick`],Fn={key:2,class:`empty-timeline`},In=120/5e3,Ln=V(T({__name:`TimelineView`,props:{timeline:{},graph:{},artifacts:{},canEdit:{type:Boolean}},emits:[`move-clip`],setup(t){let n=t,a=v(()=>{let e=new Set(n.graph.nodes.filter(e=>e.node_type===`composition`).map(e=>e.id));return[...n.artifacts??[]].filter(t=>t.kind===`video`&&t.state===`committed`&&t.restriction_watermark===0&&!!t.node_id&&e.has(t.node_id)&&t.metadata?.operation===`compose.timeline@1`).sort((e,t)=>t.created_at.localeCompare(e.created_at))[0]}),u=w(!0),d=w(!1);h(()=>a.value?.id,()=>{u.value=!0,d.value=!1});let f=()=>{u.value=!0,d.value=!1},m=()=>{u.value=!1,d.value=!0},g=e=>{let t=a.value?.metadata?.[e];return typeof t==`number`&&Number.isFinite(t)?t:void 0},_=v(()=>{let e=g(`duration_ms`);return e===void 0?`—`:`${(e/1e3).toFixed(1)}s`}),y=v(()=>{let e=g(`width`),t=g(`height`);return e&&t?`${e} × ${t}`:`—`}),S=v(()=>{let e=g(`width`),t=g(`height`);return e&&t?{aspectRatio:`${e} / ${t}`}:void 0}),T=e=>n.timeline?.clips.filter(t=>t.track_id===e)??[],E=e=>e.artifact_id.slice(-6),D=e=>({left:`${e.timeline_start_ms*In}px`,width:`${Math.max(48,(e.source_out_ms-e.source_in_ms)/(e.speed??1)*In)}px`});return(n,h)=>(C(),l(`div`,gn,[a.value?(C(),l(`section`,_n,[e(`div`,vn,[e(`div`,null,[e(`span`,yn,i(n.$t(`poivelle.timeline.deliverable`)),1),e(`h2`,bn,i(n.$t(`poivelle.timeline.masterTitle`)),1)]),e(`a`,{class:`master-download`,href:a.value.storage_url,target:`_blank`,rel:`noopener noreferrer`,download:``},[o(c(de),{size:15,"aria-hidden":`true`}),r(` `+i(n.$t(`poivelle.timeline.download`)),1)],8,xn)]),e(`div`,{class:`master-media`,style:b(S.value)},[e(`video`,{class:`master-player`,src:a.value.storage_url,"aria-label":n.$t(`poivelle.timeline.playerLabel`),controls:``,playsinline:``,preload:`metadata`,onLoadstart:f,onLoadedmetadata:h[0]||=e=>u.value=!1,onCanplay:h[1]||=e=>u.value=!1,onError:m},null,40,Sn),u.value&&!d.value?(C(),l(`div`,Cn,[o(c(fe),{size:24,class:`is-spinning`,"aria-hidden":`true`}),e(`span`,null,i(n.$t(`poivelle.timeline.loading`)),1)])):s(``,!0),d.value?(C(),l(`div`,wn,[o(c(_e),{size:24,"aria-hidden":`true`}),e(`span`,null,i(n.$t(`poivelle.timeline.loadError`)),1)])):s(``,!0)],4),e(`dl`,Tn,[e(`div`,null,[e(`dt`,null,i(n.$t(`poivelle.timeline.duration`)),1),e(`dd`,null,i(_.value),1)]),e(`div`,null,[e(`dt`,null,i(n.$t(`poivelle.timeline.frame`)),1),e(`dd`,null,i(y.value),1)]),e(`div`,null,[e(`dt`,null,i(n.$t(`poivelle.timeline.videoClips`)),1),e(`dd`,null,i(g(`video_clips`)??`—`),1)]),e(`div`,null,[e(`dt`,null,i(n.$t(`poivelle.timeline.audioClips`)),1),e(`dd`,null,i(g(`audio_clips`)??`—`),1)])])])):s(``,!0),e(`div`,En,[(C(),l(p,null,x(10,t=>e(`span`,{key:t},i((t-1)*5)+`s`,1)),64))]),t.timeline?.tracks.length?(C(),l(`div`,Dn,[(C(!0),l(p,null,x(t.timeline.tracks,r=>(C(),l(`div`,{key:r.id,class:`track-row`},[e(`div`,On,i(r.title||r.kind||r.id),1),e(`div`,kn,[(C(!0),l(p,null,x(T(r.id),(a,o)=>(C(),l(`div`,{key:a.id,class:`timeline-clip`,style:b(D(a)),title:a.artifact_id},[e(`button`,{type:`button`,"aria-label":a.artifact_id},i(E(a)),9,jn),t.canEdit&&r.kind===`video`?(C(),l(`span`,Mn,[e(`button`,{type:`button`,disabled:o===0,onClick:e=>n.$emit(`move-clip`,{trackId:r.id,clipId:a.id,direction:-1})},` ‹ `,8,Nn),e(`button`,{type:`button`,disabled:o===T(r.id).length-1,onClick:e=>n.$emit(`move-clip`,{trackId:r.id,clipId:a.id,direction:1})},` › `,8,Pn)])):s(``,!0)],12,An))),128))])]))),128))])):(C(),l(`div`,Fn,[o(c(Ce),{size:30,"stroke-width":`1.4`}),e(`h2`,null,i(n.$t(`poivelle.timeline.emptyTitle`)),1),e(`p`,null,i(n.$t(`poivelle.timeline.emptyBody`)),1)]))]))}}),[[`__scopeId`,`data-v-37eb37c8`]]),Rn={class:`review-view`},zn={class:`review-summary`},Bn={class:`eyebrow`},Vn={class:`summary-metrics`},Hn={class:`review-columns`},Un={key:0,class:`item-actions`},Wn=[`onClick`],Gn={key:0,class:`empty-copy`},Kn=[`onClick`],qn=[`onClick`],Jn={key:0,class:`empty-copy`},Yn={key:1,class:`run-detail`},Xn={key:0},Zn=[`onClick`],Qn={key:2,class:`forensic-failures`,role:`alert`},$n=V(T({__name:`ReviewView`,props:{graph:{},proposals:{},revisions:{},runs:{},activeRun:{},evaluations:{},forensicValidations:{},costs:{},canEdit:{type:Boolean}},emits:[`reject-proposal`,`cancel-run`,`open-run`,`retry-step`],setup(a){let o=a,c=v(()=>o.proposals.filter(e=>e.state===`awaiting_approval`)),u=e=>![`release_pending`,`succeeded`,`failed`,`cancelled`].includes(e.state),d=v(()=>o.evaluations.filter(e=>e.verdict===`pass`).length),f=v(()=>o.forensicValidations[0]),m=v(()=>f.value?.result.checks.filter(e=>e.verdict===`fail`)??[]),h=e=>[...o.activeRun?.attempts??[]].filter(t=>t.step_run_id===e).sort((e,t)=>t.created_at.localeCompare(e.created_at))[0],g=e=>(e/1e6).toFixed(2);return(o,_)=>(C(),l(`div`,Rn,[e(`section`,zn,[e(`div`,null,[e(`span`,Bn,i(o.$t(`poivelle.review.heading`)),1),e(`h2`,null,i(a.revisions.length?`Revision ${a.revisions[0].revision_number}`:o.$t(`poivelle.review.noRevision`)),1)]),e(`div`,Vn,[e(`span`,null,[e(`strong`,null,i(a.graph.nodes.length),1),r(i(o.$t(`poivelle.review.nodes`)),1)]),e(`span`,null,[e(`strong`,null,i(a.proposals.length),1),r(i(o.$t(`poivelle.review.proposals`)),1)]),e(`span`,null,[e(`strong`,null,i(a.runs.length),1),r(i(o.$t(`poivelle.review.runs`)),1)]),e(`span`,null,[e(`strong`,null,i(g(a.costs?.totals_microcredits.final??0)),1),r(i(o.$t(`poivelle.review.finalCost`)),1)]),e(`span`,null,[e(`strong`,null,i(d.value)+`/`+i(a.evaluations.length),1),r(i(o.$t(`poivelle.review.qualityChecks`)),1)]),e(`span`,null,[e(`strong`,{class:n(f.value?.result.verdict===`fail`?`metric-fail`:``)},i(f.value?.result.verdict??`—`),3),r(i(o.$t(`poivelle.review.forensics`)),1)])])]),e(`section`,Hn,[e(`div`,null,[e(`h3`,null,i(o.$t(`poivelle.review.pendingProposals`)),1),(C(!0),l(p,null,x(c.value,t=>(C(),l(`article`,{key:t.id,class:`review-item`},[e(`span`,{class:n([`risk`,`risk-${t.risk_class}`])},i(t.risk_class),3),e(`strong`,null,i(t.intent),1),e(`p`,null,i(t.rationale),1),a.canEdit?(C(),l(`div`,Un,[e(`span`,null,i(o.$t(`poivelle.review.approvalTokenRequired`)),1),e(`button`,{type:`button`,onClick:e=>o.$emit(`reject-proposal`,t.id)},i(o.$t(`poivelle.review.reject`)),9,Wn)])):s(``,!0)]))),128)),c.value.length?s(``,!0):(C(),l(`p`,Gn,i(o.$t(`poivelle.review.noProposals`)),1))]),e(`div`,null,[e(`h3`,null,i(o.$t(`poivelle.review.execution`)),1),(C(!0),l(p,null,x(a.runs,r=>(C(),l(`article`,{key:r.id,class:n([`run-item`,{active:a.activeRun?.run.id===r.id}]),onClick:e=>o.$emit(`open-run`,r.id)},[e(`span`,{class:n([`run-state`,`state-${r.state}`])},null,2),e(`div`,null,[e(`strong`,null,i(r.state),1),e(`small`,null,i(r.id),1)]),a.canEdit&&u(r)?(C(),l(`button`,{key:0,type:`button`,class:`cancel-run`,onClick:t(e=>o.$emit(`cancel-run`,r.id),[`stop`])},i(o.$t(`poivelle.run.cancel`)),9,qn)):s(``,!0)],10,Kn))),128)),a.runs.length?s(``,!0):(C(),l(`p`,Jn,i(o.$t(`poivelle.review.noRuns`)),1)),a.activeRun?(C(),l(`section`,Yn,[e(`header`,null,[e(`strong`,null,i(o.$t(`poivelle.review.runDetail`)),1),e(`span`,null,i(a.activeRun.attempts.length)+` `+i(o.$t(`poivelle.review.attempts`)),1)]),(C(!0),l(p,null,x(a.activeRun.steps,r=>(C(),l(`article`,{key:r.id,class:`step-item`},[e(`span`,{class:n([`run-state`,`state-${r.state}`])},null,2),e(`div`,null,[e(`strong`,null,i(r.operation),1),e(`small`,null,i(r.state)+` · `+i(r.node_id),1),h(r.id)?.error?(C(),l(`p`,Xn,i(h(r.id)?.error?.code??`provider_error`)+`: `+i(h(r.id)?.error?.message??o.$t(`poivelle.error.generic`)),1)):s(``,!0)]),a.canEdit&&[`failed`,`manual_recovery`].includes(r.state)?(C(),l(`button`,{key:0,type:`button`,class:`retry-step`,onClick:t(e=>o.$emit(`retry-step`,r),[`stop`])},i(o.$t(`poivelle.review.retryStep`)),9,Zn)):s(``,!0)]))),128))])):s(``,!0),m.value.length?(C(),l(`section`,Qn,[e(`strong`,null,i(o.$t(`poivelle.review.forensics`)),1),(C(!0),l(p,null,x(m.value,e=>(C(),l(`p`,{key:e.code},i(e.code)+` · `+i(String(e.actual??`—`))+` / `+i(String(e.expected??`—`)),1))),128))])):s(``,!0)])])]))}}),[[`__scopeId`,`data-v-e66361d5`]]),er={class:`inspector-panel`},tr={class:`inspector-heading`},nr={class:`field`},rr={class:`field`},ir=[`value`],ar={class:`field grow`},or={class:`node-meta`},sr={key:1,class:`empty-inspector`},cr=V(T({__name:`InspectorPanel`,props:{node:{}},emits:[`update`,`delete`],setup(t,{emit:n}){let a=t,s=n,u=w(``),f=w(``);h(()=>a.node,e=>{u.value=e?.title??``;let t=e?.payload.prompt??e?.payload.text??``;f.value=typeof t==`string`?t:``},{immediate:!0});let y=v(()=>a.node?a.node.node_type===`video`?z:a.node.node_type===`audio`?G:[`shot`,`scene`,`storyboard`].includes(a.node.node_type)?q:[`image`,`character`,`location`].includes(a.node.node_type)?F:a.node.node_type===`script`||a.node.node_type===`text`?M:oe:I),b=()=>{let e=u.value.trim();a.node&&e&&e!==a.node.title&&s(`update`,{path:`/title`,value:e})},x=()=>{if(!a.node)return;let e=a.node.payload.prompt===void 0?`text`:`prompt`;f.value!==a.node.payload[e]&&s(`update`,{path:`/payload/${e}`,value:f.value})};return(n,a)=>(C(),l(`aside`,er,[e(`div`,tr,[e(`div`,null,[e(`span`,null,i(n.$t(`poivelle.section.inspector`)),1),e(`strong`,null,i(t.node?.title||n.$t(`poivelle.inspector.noSelection`)),1)]),(C(),_(S(y.value),{size:18,"aria-hidden":`true`}))]),t.node?(C(),l(p,{key:0},[e(`label`,nr,[e(`span`,null,i(n.$t(`poivelle.field.title`)),1),g(e(`input`,{"onUpdate:modelValue":a[0]||=e=>u.value=e,type:`text`,onBlur:b,onKeydown:d(b,[`enter`])},null,544),[[m,u.value]])]),e(`label`,rr,[e(`span`,null,i(n.$t(`poivelle.field.type`)),1),e(`input`,{value:t.node.node_type,type:`text`,disabled:``},null,8,ir)]),e(`label`,ar,[e(`span`,null,i(n.$t(`poivelle.field.prompt`)),1),g(e(`textarea`,{"onUpdate:modelValue":a[1]||=e=>f.value=e,rows:`8`,onBlur:x},null,544),[[m,f.value]])]),e(`div`,or,[a[3]||=e(`span`,null,`NODE`,-1),e(`code`,null,i(t.node.id),1),a[4]||=e(`span`,null,`VERSION`,-1),e(`code`,null,i(t.node.version),1)]),e(`button`,{class:`danger-button`,type:`button`,onClick:a[2]||=e=>n.$emit(`delete`)},[o(c(ge),{size:14,"aria-hidden":`true`}),r(` `+i(n.$t(`poivelle.node.delete`)),1)])],64)):(C(),l(`div`,sr,[o(c(I),{size:24,"stroke-width":`1.4`}),e(`p`,null,i(n.$t(`poivelle.inspector.empty`)),1)]))]))}}),[[`__scopeId`,`data-v-7a6ae318`]]),lr={class:`agent-dock`},ur={class:`agent-identity`},dr={class:`proposal-strip`},fr=[`onClick`],pr={key:0},mr=[`disabled`],hr=V(T({__name:`AgentDock`,props:{proposals:{},selectedNodeId:{},skill:{},canEdit:{type:Boolean}},emits:[`run`,`open-proposal`],setup(t){let a=t,u=v(()=>a.proposals.filter(e=>e.state===`awaiting_approval`));return(a,d)=>(C(),l(`section`,lr,[e(`div`,ur,[o(c(Se),{size:16,"aria-hidden":`true`}),e(`div`,null,[e(`strong`,null,i(a.$t(`poivelle.agent.title`)),1),e(`span`,null,i(t.skill),1)])]),e(`div`,dr,[(C(!0),l(p,null,x(u.value,t=>(C(),l(`button`,{key:t.id,type:`button`,onClick:e=>a.$emit(`open-proposal`,t.id)},[e(`span`,{class:n([`risk-dot`,`risk-${t.risk_class}`])},null,2),e(`strong`,null,i(t.intent),1),e(`small`,null,i(t.state),1)],8,fr))),128)),u.value.length?s(``,!0):(C(),l(`p`,pr,i(a.$t(`poivelle.agent.noProposals`)),1))]),t.canEdit?(C(),l(`button`,{key:0,class:`agent-button`,type:`button`,disabled:!t.selectedNodeId,onClick:d[0]||=e=>a.$emit(`run`)},[o(c(R),{size:15,"aria-hidden":`true`}),r(` `+i(a.$t(`poivelle.agent.plan`)),1)],8,mr)):s(``,!0)]))}}),[[`__scopeId`,`data-v-81fac9f8`]]),gr={class:`project-guide`,"aria-labelledby":`project-guide-title`},_r={class:`guide-copy`},vr={id:`project-guide-title`},yr={class:`guide-body`},br={class:`project-facts`},xr={class:`guide-actions`},Sr=[`disabled`],Cr={class:`cost-note`},wr={class:`production-steps`},Tr={class:`done`},Er=[`value`,`max`],Dr=[`value`,`max`],Or=V(T({__name:`ProjectGuide`,props:{projectTitle:{},graph:{},storyboard:{},artifacts:{},takes:{},selections:{},canEdit:{type:Boolean},busy:{type:Boolean}},emits:[`generate-node`,`open-storyboard`],setup(t){let a=t,u=v(()=>a.storyboard?a.storyboard.sections.flatMap(e=>e.shots.flatMap(e=>e.image_node_ids)):a.graph.nodes.filter(e=>e.node_type===`image`).map(e=>e.id)),d=v(()=>a.storyboard?a.storyboard.sections.flatMap(e=>e.shots.flatMap(e=>e.video_node_ids)):a.graph.nodes.filter(e=>e.node_type===`video`).map(e=>e.id)),f=v(()=>new Set([...a.artifacts.filter(e=>e.state===`committed`).flatMap(e=>e.node_id??[]),...a.takes.filter(e=>e.state===`ready`).map(e=>e.target_node_id)])),p=v(()=>u.value.filter(e=>f.value.has(e)).length),m=v(()=>d.value.filter(e=>f.value.has(e)).length),h=v(()=>new Set(a.selections.map(e=>e.target_node_id))),g=v(()=>u.value.filter(e=>h.value.has(e)).length),y=v(()=>d.value.filter(e=>h.value.has(e)).length),b=v(()=>p.value===u.value.length&&g.value<u.value.length||m.value===d.value.length&&y.value<d.value.length),x=v(()=>a.graph.nodes.some(e=>e.node_type===`output`)),S=v(()=>{let e=new Set(a.graph.nodes.filter(e=>e.node_type===`output`).map(e=>e.id));return a.artifacts.some(t=>t.state===`committed`&&!!t.node_id&&e.has(t.node_id))}),w=v(()=>{let e=u.value.find(e=>!f.value.has(e));if(e)return a.graph.nodes.find(t=>t.id===e);if(g.value<u.value.length)return;let t=d.value.find(e=>!f.value.has(e));if(t)return a.graph.nodes.find(e=>e.id===t);if(!(y.value<d.value.length))return a.graph.nodes.find(e=>e.node_type===`audio`&&!f.value.has(e.id))}),T=v(()=>(a.storyboard?.sections.reduce((e,t)=>e+t.shots.length,0)??a.graph.nodes.filter(e=>e.node_type===`shot`).length)||d.value.length),E=v(()=>{let e=a.graph.nodes.find(e=>e.node_type===`script`),t=Number(e?.payload?.target_duration_seconds);return a.storyboard?.target_duration_seconds??(Number.isFinite(t)?t:40)}),D=v(()=>{let e=a.graph.nodes.find(e=>e.node_type===`script`);return String(e?.payload?.aspect_ratio??`16:9`)}),O=v(()=>w.value?.node_type===`image`?B(`poivelle.guide.generateFrame`,{current:p.value+1,total:u.value.length}):w.value?.node_type===`video`?B(`poivelle.guide.generateMotion`,{current:m.value+1,total:d.value.length}):B(`poivelle.guide.generateScore`));return(a,f)=>(C(),l(`section`,gr,[e(`div`,_r,[e(`p`,null,i(a.$t(`poivelle.guide.kicker`)),1),e(`h1`,vr,i(a.$t(`poivelle.guide.title`,{title:t.projectTitle})),1),e(`p`,yr,i(a.$t(`poivelle.guide.body`)),1),e(`dl`,br,[e(`div`,null,[e(`dt`,null,i(a.$t(`poivelle.guide.duration`)),1),e(`dd`,null,i(E.value)+`s`,1)]),e(`div`,null,[e(`dt`,null,i(a.$t(`poivelle.guide.shots`)),1),e(`dd`,null,i(T.value),1)]),e(`div`,null,[e(`dt`,null,i(a.$t(`poivelle.guide.format`)),1),e(`dd`,null,i(D.value),1)])]),e(`div`,xr,[w.value?(C(),l(`button`,{key:0,type:`button`,class:`primary-action`,disabled:!t.canEdit||t.busy,onClick:f[0]||=e=>a.$emit(`generate-node`,w.value.id)},[t.busy?(C(),_(c(fe),{key:0,size:17,class:`spinning`,"aria-hidden":`true`})):(C(),_(c(R),{key:1,size:17,"aria-hidden":`true`})),r(` `+i(O.value),1)],8,Sr)):(C(),l(`button`,{key:1,type:`button`,class:`primary-action`,onClick:f[1]||=e=>a.$emit(`open-storyboard`)},[o(c(q),{size:17,"aria-hidden":`true`}),r(` `+i(b.value?a.$t(`poivelle.guide.chooseResults`):a.$t(`poivelle.guide.reviewResults`)),1)])),e(`button`,{type:`button`,class:`secondary-action`,onClick:f[2]||=e=>a.$emit(`open-storyboard`)},[r(i(a.$t(`poivelle.guide.reviewPlan`))+` `,1),o(c(j),{size:15,"aria-hidden":`true`})])]),e(`p`,Cr,[o(c(Y),{size:14,"aria-hidden":`true`}),r(` `+i(a.$t(`poivelle.guide.costNote`)),1)])]),e(`ol`,wr,[e(`li`,Tr,[e(`span`,null,[o(c(se),{size:15,"aria-hidden":`true`})]),e(`div`,null,[e(`strong`,null,i(a.$t(`poivelle.guide.stepPlan`)),1),e(`p`,null,i(a.$t(`poivelle.guide.stepPlanBody`,{shots:T.value})),1)]),e(`small`,null,i(a.$t(`poivelle.guide.ready`)),1)]),e(`li`,{class:n({current:g.value<u.value.length,done:u.value.length>0&&g.value===u.value.length})},[f[3]||=e(`span`,null,`2`,-1),e(`div`,null,[e(`strong`,null,i(a.$t(`poivelle.guide.stepFrames`)),1),e(`p`,null,i(a.$t(`poivelle.guide.stepFramesBody`)),1),e(`progress`,{value:p.value,max:Math.max(u.value.length,1)},null,8,Er)]),e(`small`,null,i(p.value)+` `+i(a.$t(`poivelle.guide.generated`))+` · `+i(g.value)+` `+i(a.$t(`poivelle.guide.selected`)),1)],2),e(`li`,{class:n({current:g.value===u.value.length&&y.value<d.value.length,done:d.value.length>0&&y.value===d.value.length})},[f[4]||=e(`span`,null,`3`,-1),e(`div`,null,[e(`strong`,null,i(a.$t(`poivelle.guide.stepMotion`)),1),e(`p`,null,i(a.$t(`poivelle.guide.stepMotionBody`)),1),e(`progress`,{value:m.value,max:Math.max(d.value.length,1)},null,8,Dr)]),e(`small`,null,i(m.value)+` `+i(a.$t(`poivelle.guide.generated`))+` · `+i(y.value)+` `+i(a.$t(`poivelle.guide.selected`)),1)],2),x.value?(C(),l(`li`,{key:0,class:n({current:y.value===d.value.length&&!S.value,done:S.value})},[f[5]||=e(`span`,null,`4`,-1),e(`div`,null,[e(`strong`,null,i(a.$t(`poivelle.guide.stepMaster`)),1),e(`p`,null,i(a.$t(`poivelle.guide.stepMasterBody`)),1)]),e(`small`,null,i(S.value?a.$t(`poivelle.guide.ready`):a.$t(`poivelle.guide.waiting`)),1)],2)):s(``,!0)])]))}}),[[`__scopeId`,`data-v-86112731`]]),kr={class:`poivelle-studio`},Ar={key:0,class:`error-banner`},jr={key:1,class:`loading-state`},Mr={key:2,class:`studio-body`},Nr={class:`projection-workspace`},Pr={class:`projection-content`},Fr={key:3,class:`onboarding`},Ir={key:0,class:`dry-run-summary`},Lr={class:`dry-run-note`},Rr=V(T({__name:`StudioWorkspace`,emits:[`back-home`],setup(n){let d=ee(),m=v(()=>d.state.poivelle),h=v(()=>m.value?.workspaces??[]),g=v(()=>m.value?.projects??[]),b=v(()=>m.value?.graph),S=v(()=>m.value?.assets??[]),T=v(()=>m.value?.artifacts??[]),ie=v(()=>m.value?.takes??[]),j=v(()=>m.value?.selections??[]),ae=v(()=>m.value?.storyboard),oe=v(()=>m.value?.revisions??[]),se=v(()=>m.value?.proposals??[]),ce=v(()=>m.value?.runs??[]),le=v(()=>m.value?.activeRun),ue=v(()=>m.value?.evaluations??[]),de=v(()=>m.value?.forensicValidations??[]),M=v(()=>m.value?.costs),N=v(()=>m.value?.timeline),P=v(()=>m.value?.projection??`overview`),F=v(()=>m.value?.selectedNodeId),I=v(()=>b.value?.nodes.find(e=>e.id===F.value)),pe=v(()=>g.value.find(e=>e.id===m.value?.currentProjectId)),L=v(()=>[`owner`,`producer`,`director`,`editor`].includes(m.value?.currentMembership?.role??``)),he=v(()=>m.value?.dryRun),R=v(()=>m.value?.error),ge=v(()=>[m.value?.status?.bootstrap,m.value?.status?.graph].includes(te.Request)),ve=v(()=>new Set([...T.value.filter(e=>e.state===`committed`).flatMap(e=>e.node_id??[]),...ie.value.filter(e=>e.state===`ready`).map(e=>e.target_node_id)])),z=v(()=>new Set(j.value.map(e=>e.target_node_id))),V=v(()=>ae.value?ae.value.sections.flatMap(e=>e.shots.flatMap(e=>e.image_node_ids)):b.value?.nodes.filter(e=>e.node_type===`image`).map(e=>e.id)??[]),H=v(()=>ae.value?ae.value.sections.flatMap(e=>e.shots.flatMap(e=>e.video_node_ids)):b.value?.nodes.filter(e=>e.node_type===`video`).map(e=>e.id)??[]),xe=v(()=>V.value.length>0&&V.value.every(e=>ve.value.has(e))&&V.value.some(e=>!z.value.has(e))||H.value.length>0&&H.value.every(e=>ve.value.has(e))&&H.value.some(e=>!z.value.has(e))),G=v(()=>{let e=V.value.find(e=>!ve.value.has(e));if(e)return b.value?.nodes.find(t=>t.id===e);if(V.value.some(e=>!z.value.has(e)))return;let t=H.value.find(e=>!ve.value.has(e));if(t)return b.value?.nodes.find(e=>e.id===t);if(H.value.some(e=>!z.value.has(e)))return;let n=b.value?.nodes.find(e=>e.node_type===`audio`&&!ve.value.has(e.id));if(n)return n}),Se=v(()=>G.value?.node_type===`image`?B(`poivelle.guide.generateNextFrame`):G.value?.node_type===`video`?B(`poivelle.guide.generateNextMotion`):G.value?.node_type===`audio`?B(`poivelle.guide.generateScore`):B(`poivelle.guide.continue`)),K=w(!1),we=w(!1),J=w(!1),Te=w(!1),Ee=w(!1),De=w(!1),Y=f({name:``,monthly_limit_microcredits:void 0}),X=f({workspace_id:``,title:``,workflow:`blank`,skill:`film.drama.short@1.0.0`,product_name:``,product_category:`professional action imaging device`,brand_tone:`precise, fearless, cinematic, premium`,aspect_ratio:`16:9`}),Oe=[{label:B(`poivelle.project.blankWorkflow`),value:`blank`},{label:B(`poivelle.project.commercialTVC`),value:`commercial_tvc`}],Z=f({node_type:`scene`,title:``,prompt:``}),Q=f({title:``,kind:`image`,source_url:``,content_hash:``}),ke=[`script`,`character`,`location`,`prop`,`storyboard`,`scene`,`shot`,`image`,`video`,`audio`,`subtitle`,`composition`,`output`,`note`],Ae=[`character`,`location`,`prop`,`image`,`video`,`voice`,`music`,`sfx`,`brand`],je=()=>d.dispatch(`poivelle/bootstrap`),Me=e=>d.dispatch(`poivelle/loadProject`,e),Ne=e=>d.dispatch(`poivelle/selectNode`,e),Pe=e=>d.dispatch(`poivelle/setProjection`,e),Fe=()=>{X.workspace_id=m.value?.currentWorkspaceId??h.value[0]?.id??``,J.value=!0},Ie=async()=>{Y.name.trim()&&await $(async()=>{await d.dispatch(`poivelle/createWorkspace`,{...Y,name:Y.name.trim()}),we.value=!1,Fe()})},Le=async()=>{!X.workspace_id||!X.title.trim()||await $(async()=>{X.workflow===`commercial_tvc`?(await d.dispatch(`poivelle/createCommercialTVCProject`,{workspace_id:X.workspace_id,title:X.title.trim(),product_name:X.product_name.trim()||X.title.trim(),product_category:X.product_category.trim(),brand_tone:X.brand_tone.trim(),aspect_ratio:X.aspect_ratio,managed_execution:!1}),Pe(`storyboard`)):await d.dispatch(`poivelle/createProject`,{workspace_id:X.workspace_id,title:X.title.trim(),skill:X.skill,domain:`film.drama.short`}),J.value=!1,X.title=``})},Re=async()=>{Z.title.trim()&&await $(async()=>{await d.dispatch(`poivelle/createNode`,{node_type:Z.node_type,title:Z.title.trim(),payload:{prompt:Z.prompt}}),Te.value=!1,Z.title=``,Z.prompt=``})},ze=async()=>{!m.value?.currentWorkspaceId||!Q.title||!Q.source_url||!Q.content_hash||await $(async()=>{await d.dispatch(`poivelle/importAsset`,{...Q,project_id:m.value.currentProjectId}),Ee.value=!1})},Be=e=>d.dispatch(`poivelle/updateSelectedNode`,e),Ve=async()=>{await ye.confirm(B(`poivelle.node.deleteConfirm`),``,{type:`warning`}),await d.dispatch(`poivelle/deleteSelectedNode`)},He=async()=>{await d.dispatch(`poivelle/commitRevision`,`Studio checkpoint`),ne.success(B(`poivelle.revision.committed`))},Ue=async()=>{I.value&&await $(async()=>{await d.dispatch(`poivelle/dryRun`,I.value?.node_type===`composition`?`compose`:`generate`),De.value=!0})},We=async e=>{await Ne(e),await a(),await Ue()},Ge=async()=>{if(P.value===`overview`){G.value?await We(G.value.id):xe.value&&Pe(`storyboard`);return}I.value&&await Ue()},Ke=async()=>{await $(async()=>{let e=await d.dispatch(`poivelle/confirmDryRun`);De.value=!1,e&&ne.success(B(`poivelle.run.queued`))})},qe=e=>{Pe(`review`),ne.info(`${B(`poivelle.agent.proposal`)} ${e.slice(-8)}`)},Je=async e=>{await ye.confirm(B(`poivelle.review.rejectConfirm`),``,{type:`warning`}),await $(()=>d.dispatch(`poivelle/rejectProposal`,e))},Ye=async e=>{await ye.confirm(B(`poivelle.run.cancelConfirm`),``,{type:`warning`}),await $(()=>d.dispatch(`poivelle/cancelRun`,e))},Xe=e=>$(()=>d.dispatch(`poivelle/loadRun`,e)),Ze=async e=>{await $(async()=>{await d.dispatch(`poivelle/retryStep`,e),De.value=!0})},Qe=async e=>{if(!N.value)return;let t=N.value.clips.map(e=>({...e})),n=t.filter(t=>t.track_id===e.trackId).sort((e,t)=>e.timeline_start_ms-t.timeline_start_ms),r=n.findIndex(t=>t.id===e.clipId),i=r+e.direction;if(r<0||i<0||i>=n.length)return;[n[r],n[i]]=[n[i],n[r]];let a=0;n.forEach(e=>{let t=typeof e.speed==`number`&&Number.isFinite(e.speed)&&e.speed>0?e.speed:1;e.timeline_start_ms=a,a+=(e.source_out_ms-e.source_in_ms)/t}),await $(()=>d.dispatch(`poivelle/saveTimeline`,{...N.value,clips:t}))},$e=async e=>{await $(async()=>{await d.dispatch(`poivelle/selectTake`,e),ne.success(B(`poivelle.storyboard.selectionSaved`))})},et=e=>`${(e/1e6).toFixed(2)} credits`,$=async e=>{K.value=!0;try{await e()}catch(e){ne.error(e?.response?.data?.detail?.message??e?.response?.data?.detail??e?.message??B(`poivelle.error.generic`))}finally{K.value=!1}};return u(je),(n,a)=>(C(),l(`main`,kr,[o(gt,{"project-title":pe.value?.title,"graph-version":b.value?.graph_version,"can-run":L.value&&(P.value===`overview`?!!G.value||xe.value:!!I.value),"can-edit":L.value,"primary-label":P.value===`overview`?xe.value?n.$t(`poivelle.guide.chooseResults`):Se.value:void 0,onOpenProjects:a[0]||=e=>J.value=!0,onHome:a[1]||=e=>n.$emit(`back-home`),onCommit:He,onRun:Ge},null,8,[`project-title`,`graph-version`,`can-run`,`can-edit`,`primary-label`]),R.value?(C(),l(`div`,Ar,[o(c(_e),{size:15,"aria-hidden":`true`}),e(`span`,null,i(R.value),1),e(`button`,{type:`button`,onClick:je},i(n.$t(`poivelle.action.retry`)),1)])):s(``,!0),ge.value&&!b.value?(C(),l(`div`,jr,[o(c(fe),{size:25,class:`is-spinning`,"aria-hidden":`true`}),e(`span`,null,i(n.$t(`poivelle.status.loading`)),1)])):pe.value&&b.value?(C(),l(`div`,Mr,[P.value===`overview`?s(``,!0):(C(),_(Ft,{key:0,projects:g.value,"current-project-id":pe.value.id,assets:S.value,revisions:oe.value,"can-edit":L.value,onSelectProject:Me,onCreateProject:Fe,onImportAsset:a[2]||=e=>Ee.value=!0},null,8,[`projects`,`current-project-id`,`assets`,`revisions`,`can-edit`])),e(`section`,Nr,[o(Rt,{"model-value":P.value,"can-edit":L.value,"onUpdate:modelValue":Pe,onCreateNode:a[3]||=e=>Te.value=!0},null,8,[`model-value`,`can-edit`]),e(`div`,Pr,[P.value===`overview`?(C(),_(Or,{key:0,"project-title":pe.value.title,graph:b.value,storyboard:ae.value,artifacts:T.value,takes:ie.value,selections:j.value,"can-edit":L.value,busy:K.value,onGenerateNode:We,onOpenStoryboard:a[4]||=e=>Pe(`storyboard`)},null,8,[`project-title`,`graph`,`storyboard`,`artifacts`,`takes`,`selections`,`can-edit`,`busy`])):P.value===`canvas`?(C(),_(Kt,{key:1,graph:b.value,"selected-node-id":F.value,"can-edit":L.value,onSelectNode:Ne,onCreateNode:a[5]||=e=>Te.value=!0},null,8,[`graph`,`selected-node-id`,`can-edit`])):P.value===`storyboard`?(C(),_(hn,{key:2,graph:b.value,storyboard:ae.value,artifacts:T.value,takes:ie.value,selections:j.value,"selected-node-id":F.value,"can-edit":L.value,"can-select":L.value&&oe.value.length>0,onSelectNode:Ne,onSelectTake:$e},null,8,[`graph`,`storyboard`,`artifacts`,`takes`,`selections`,`selected-node-id`,`can-edit`,`can-select`])):P.value===`timeline`?(C(),_(Ln,{key:3,timeline:N.value,graph:b.value,artifacts:T.value,"can-edit":L.value,onMoveClip:Qe},null,8,[`timeline`,`graph`,`artifacts`,`can-edit`])):(C(),_($n,{key:4,graph:b.value,proposals:se.value,revisions:oe.value,runs:ce.value,"active-run":le.value,evaluations:ue.value,"forensic-validations":de.value,costs:M.value,"can-edit":L.value,onRejectProposal:Je,onCancelRun:Ye,onOpenRun:Xe,onRetryStep:Ze},null,8,[`graph`,`proposals`,`revisions`,`runs`,`active-run`,`evaluations`,`forensic-validations`,`costs`,`can-edit`]))]),P.value===`overview`?s(``,!0):(C(),_(hr,{key:0,proposals:se.value,"selected-node-id":F.value,skill:pe.value.active_skill,"can-edit":L.value,onRun:Ue,onOpenProposal:qe},null,8,[`proposals`,`selected-node-id`,`skill`,`can-edit`]))]),L.value&&P.value===`canvas`?(C(),_(cr,{key:1,node:I.value,onUpdate:Be,onDelete:Ve},null,8,[`node`])):s(``,!0)])):(C(),l(`section`,Fr,[a[38]||=e(`div`,{class:`onboarding-number`},`01 / STUDIO`,-1),o(c(Ce),{size:34,"stroke-width":`1.25`,"aria-hidden":`true`}),e(`h1`,null,i(n.$t(`poivelle.onboarding.title`)),1),e(`p`,null,i(n.$t(`poivelle.onboarding.body`)),1),h.value.length?L.value?(C(),l(`button`,{key:1,type:`button`,onClick:Fe},[o(c(q),{size:15,"aria-hidden":`true`}),r(` `+i(n.$t(`poivelle.project.create`)),1)])):s(``,!0):(C(),l(`button`,{key:0,type:`button`,onClick:a[6]||=e=>we.value=!0},[o(c(me),{size:15,"aria-hidden":`true`}),r(` `+i(n.$t(`poivelle.workspace.create`)),1)]))])),o(c(be),{modelValue:we.value,"onUpdate:modelValue":a[11]||=e=>we.value=e,title:n.$t(`poivelle.workspace.create`),width:`420px`},{footer:y(()=>[o(c(W),{onClick:a[10]||=e=>we.value=!1},{default:y(()=>[r(i(n.$t(`common.button.cancel`)),1)]),_:1}),o(c(W),{type:`primary`,loading:K.value,onClick:Ie},{default:y(()=>[r(i(n.$t(`common.button.confirm`)),1)]),_:1},8,[`loading`])]),default:y(()=>[o(c(k),{"label-position":`top`,onSubmit:a[9]||=t(()=>{},[`prevent`])},{default:y(()=>[o(c(O),{label:n.$t(`poivelle.workspace.name`)},{default:y(()=>[o(c(U),{modelValue:Y.name,"onUpdate:modelValue":a[7]||=e=>Y.name=e,maxlength:`120`,autofocus:``},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.workspace.budget`)},{default:y(()=>[o(c(A),{modelValue:Y.monthly_limit_microcredits,"onUpdate:modelValue":a[8]||=e=>Y.monthly_limit_microcredits=e,min:0,step:1e6},null,8,[`modelValue`])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`modelValue`,`title`]),o(c(be),{modelValue:J.value,"onUpdate:modelValue":a[22]||=e=>J.value=e,title:n.$t(`poivelle.project.create`),width:`460px`},{footer:y(()=>[o(c(W),{onClick:a[21]||=e=>J.value=!1},{default:y(()=>[r(i(n.$t(`common.button.cancel`)),1)]),_:1}),o(c(W),{type:`primary`,loading:K.value,onClick:Le},{default:y(()=>[r(i(n.$t(`common.button.confirm`)),1)]),_:1},8,[`loading`])]),default:y(()=>[o(c(k),{"label-position":`top`,onSubmit:a[20]||=t(()=>{},[`prevent`])},{default:y(()=>[o(c(O),{label:n.$t(`poivelle.project.workspace`)},{default:y(()=>[o(c(E),{modelValue:X.workspace_id,"onUpdate:modelValue":a[12]||=e=>X.workspace_id=e,style:{width:`100%`}},{default:y(()=>[(C(!0),l(p,null,x(h.value,e=>(C(),_(c(D),{key:e.id,label:e.name,value:e.id},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.project.title`)},{default:y(()=>[o(c(U),{modelValue:X.title,"onUpdate:modelValue":a[13]||=e=>X.title=e,maxlength:`200`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.project.workflow`)},{default:y(()=>[o(c(re),{modelValue:X.workflow,"onUpdate:modelValue":a[14]||=e=>X.workflow=e,options:Oe,block:``},null,8,[`modelValue`])]),_:1},8,[`label`]),X.workflow===`commercial_tvc`?(C(),l(p,{key:0},[o(c(O),{label:n.$t(`poivelle.project.productName`)},{default:y(()=>[o(c(U),{modelValue:X.product_name,"onUpdate:modelValue":a[15]||=e=>X.product_name=e,maxlength:`120`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.project.productCategory`)},{default:y(()=>[o(c(U),{modelValue:X.product_category,"onUpdate:modelValue":a[16]||=e=>X.product_category=e,maxlength:`180`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.project.brandTone`)},{default:y(()=>[o(c(U),{modelValue:X.brand_tone,"onUpdate:modelValue":a[17]||=e=>X.brand_tone=e,type:`textarea`,rows:2,maxlength:`240`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.project.aspectRatio`)},{default:y(()=>[o(c(re),{modelValue:X.aspect_ratio,"onUpdate:modelValue":a[18]||=e=>X.aspect_ratio=e,options:[`16:9`,`9:16`,`1:1`]},null,8,[`modelValue`])]),_:1},8,[`label`])],64)):s(``,!0),o(c(O),{label:n.$t(`poivelle.project.skill`)},{default:y(()=>[X.workflow===`blank`?(C(),_(c(E),{key:0,modelValue:X.skill,"onUpdate:modelValue":a[19]||=e=>X.skill=e,style:{width:`100%`}},{default:y(()=>[o(c(D),{label:`Short drama · professional`,value:`film.drama.short@1.0.0`}),o(c(D),{label:`Commercial film · professional`,value:`film.commercial@1.0.0`}),o(c(D),{label:`Music video · professional`,value:`film.music-video@1.0.0`})]),_:1},8,[`modelValue`])):s(``,!0)]),_:1},8,[`label`])]),_:1})]),_:1},8,[`modelValue`,`title`]),o(c(be),{modelValue:Te.value,"onUpdate:modelValue":a[28]||=e=>Te.value=e,title:n.$t(`poivelle.node.create`),width:`460px`},{footer:y(()=>[o(c(W),{onClick:a[27]||=e=>Te.value=!1},{default:y(()=>[r(i(n.$t(`common.button.cancel`)),1)]),_:1}),o(c(W),{type:`primary`,loading:K.value,onClick:Re},{default:y(()=>[r(i(n.$t(`common.button.confirm`)),1)]),_:1},8,[`loading`])]),default:y(()=>[o(c(k),{"label-position":`top`,onSubmit:a[26]||=t(()=>{},[`prevent`])},{default:y(()=>[o(c(O),{label:n.$t(`poivelle.field.type`)},{default:y(()=>[o(c(E),{modelValue:Z.node_type,"onUpdate:modelValue":a[23]||=e=>Z.node_type=e,style:{width:`100%`}},{default:y(()=>[(C(),l(p,null,x(ke,e=>o(c(D),{key:e,label:e,value:e},null,8,[`label`,`value`])),64))]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.field.title`)},{default:y(()=>[o(c(U),{modelValue:Z.title,"onUpdate:modelValue":a[24]||=e=>Z.title=e,maxlength:`240`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.field.prompt`)},{default:y(()=>[o(c(U),{modelValue:Z.prompt,"onUpdate:modelValue":a[25]||=e=>Z.prompt=e,type:`textarea`,rows:5},null,8,[`modelValue`])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`modelValue`,`title`]),o(c(be),{modelValue:Ee.value,"onUpdate:modelValue":a[35]||=e=>Ee.value=e,title:n.$t(`poivelle.asset.import`),width:`500px`},{footer:y(()=>[o(c(W),{onClick:a[34]||=e=>Ee.value=!1},{default:y(()=>[r(i(n.$t(`common.button.cancel`)),1)]),_:1}),o(c(W),{type:`primary`,loading:K.value,onClick:ze},{default:y(()=>[r(i(n.$t(`common.button.confirm`)),1)]),_:1},8,[`loading`])]),default:y(()=>[o(c(k),{"label-position":`top`,onSubmit:a[33]||=t(()=>{},[`prevent`])},{default:y(()=>[o(c(O),{label:n.$t(`poivelle.asset.title`)},{default:y(()=>[o(c(U),{modelValue:Q.title,"onUpdate:modelValue":a[29]||=e=>Q.title=e,maxlength:`240`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.field.type`)},{default:y(()=>[o(c(E),{modelValue:Q.kind,"onUpdate:modelValue":a[30]||=e=>Q.kind=e,style:{width:`100%`}},{default:y(()=>[(C(),l(p,null,x(Ae,e=>o(c(D),{key:e,label:e,value:e},null,8,[`label`,`value`])),64))]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.asset.url`)},{default:y(()=>[o(c(U),{modelValue:Q.source_url,"onUpdate:modelValue":a[31]||=e=>Q.source_url=e},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.asset.hash`)},{default:y(()=>[o(c(U),{modelValue:Q.content_hash,"onUpdate:modelValue":a[32]||=e=>Q.content_hash=e,placeholder:`sha256:...`},null,8,[`modelValue`])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`modelValue`,`title`]),o(c(be),{modelValue:De.value,"onUpdate:modelValue":a[37]||=e=>De.value=e,title:n.$t(`poivelle.run.confirmTitle`),width:`520px`},{footer:y(()=>[o(c(W),{onClick:a[36]||=e=>De.value=!1},{default:y(()=>[r(i(n.$t(`common.button.cancel`)),1)]),_:1}),o(c(W),{type:`primary`,loading:K.value,onClick:Ke},{default:y(()=>[r(i(n.$t(`poivelle.run.confirm`)),1)]),_:1},8,[`loading`])]),default:y(()=>[he.value?(C(),l(`div`,Ir,[e(`div`,null,[e(`span`,null,i(n.$t(`poivelle.run.targets`)),1),e(`strong`,null,i(he.value.dependency_closure.length),1)]),e(`div`,null,[e(`span`,null,i(n.$t(`poivelle.run.maximum`)),1),e(`strong`,null,i(et(he.value.max_cost_microcredits)),1)]),e(`div`,null,[e(`span`,null,i(n.$t(`poivelle.run.approval`)),1),e(`strong`,null,i(he.value.required_approval),1)])])):s(``,!0),e(`p`,Lr,i(n.$t(`poivelle.run.confirmBody`)),1)]),_:1},8,[`modelValue`,`title`])]))}}),[[`__scopeId`,`data-v-1b367de3`]]),zr=T({__name:`Index`,setup(e){let t=w(`discovery`);return(e,n)=>t.value===`discovery`?(C(),_(ot,{key:0,onOpenStudio:n[0]||=e=>t.value=`studio`})):(C(),_(Rr,{key:1,onBackHome:n[1]||=e=>t.value=`discovery`}))}});export{zr 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,K as a,L as o,M as s,Mt as c,N as l,Q as u,S as d,St as f,T as p,b as m,ft as h,ht as g,j as _,k as v,mt as y,qt as b,rt as x,st as S,tt as C,wt as w,z as T}from"./vendor-chart-Dw-P17PN.js";import{r as E,t as D}from"./select-CD3MG9sV.js";import{n as O,t as k}from"./form-BdKMEyCR.js";import{_ as ee,h as te,v as ne}from"./models-CSuuDqRA.js";import{t as A}from"./input-number-VyPGUhHP.js";import{t as re}from"./segmented-D0zHdf9D.js";import{t as ie}from"./arrow-left-l3XZii7G.js";import{t as j}from"./arrow-right-DldGU1an.js";import{t as ae}from"./arrow-up-4Sf4V16e.js";import{t as oe}from"./box-C0GiZ7-u.js";import{t as se}from"./check-Cmnz4Bu0.js";import{t as ce}from"./chevron-down-DHjWJMvN.js";import{t as le}from"./chevron-right-hDs_4ftT.js";import{t as ue}from"./copy-BNJ4Vvq_.js";import{t as de}from"./download-CAwranau.js";import{t as M}from"./file-text-DhO9-O7o.js";import{t as N}from"./history-P1COJCLH.js";import{t as P}from"./house-qa6WrFu9.js";import{t as F}from"./image-DfZ-yD3f.js";import{t as fe}from"./loader-circle-B3QYalEy.js";import{t as I}from"./mouse-pointer-2-CgCiODhx.js";import{t as pe}from"./music-2-BgZoB-sB.js";import{t as L}from"./play-gSzuLJWl.js";import{t as me}from"./plus-CwKarPA6.js";import{t as he}from"./search-b_c_47BV.js";import{t as R}from"./sparkles-DP6P2HKD.js";import{t as ge}from"./trash-2-1--IdOz8.js";import{t as _e}from"./triangle-alert-CsggA_lm.js";import{t as ve}from"./upload-C1ZLDC6M.js";import{t as z}from"./video-ByywsO-8.js";import{a as B}from"./i18n-3aZQnVTW.js";import{A as V,Ua as H,Wa as ye,Ya as be,fo as U,io as W}from"./index-BHXtbt9o.js";import{t as xe}from"./VideoPlayer-CC3Fzeqq.js";var G=H(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),Se=H(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),K=H(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),q=H(`clapperboard`,[[`path`,{d:`m12.296 3.464 3.02 3.956`,key:`qash78`}],[`path`,{d:`M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z`,key:`1h7j8b`}],[`path`,{d:`M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`4lm6w1`}],[`path`,{d:`m6.18 5.276 3.1 3.899`,key:`zjj9t3`}]]),Ce=H(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),we=H(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),J=H(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Te=H(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Ee=H(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),De=H(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),Y=H(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),X={class:`discovery-home`},Oe={class:`discovery-header`},Z={class:`brand`},Q={class:`project-links`},ke=[`title`,`aria-label`,`onClick`],Ae={key:0,class:`discovery-state`,role:`status`},je={class:`creator`,"aria-labelledby":`poivelle-create-title`},Me={class:`creator-kicker`},Ne={id:`poivelle-create-title`},Pe=[`aria-label`],Fe=[`disabled`,`onClick`],Ie=[`placeholder`,`disabled`],Le={class:`composer-footer`},Re=[`disabled`,`title`],ze={class:`prompt-starters`},Be=[`disabled`,`onClick`],Ve={class:`works`,"aria-labelledby":`poivelle-works-title`},He={class:`works-heading`},Ue={id:`poivelle-works-title`},We={class:`search`},Ge=[`placeholder`,`aria-label`],Ke={class:`category-tabs`},qe=[`onClick`],Je={class:`work-grid`},Ye={class:`cover`},Xe=[`src`,`alt`,`onError`],Ze={key:2,class:`film-badge`},Qe=[`aria-label`,`onClick`],$e={class:`duration-badge`},et={class:`work-copy`},$={class:`work-meta`},tt={class:`work-actions`},nt=[`onClick`],rt=[`disabled`,`onClick`],it={key:0,class:`film-dialog-heading`},at={id:`poivelle-film-dialog-title`},ot=V(T({__name:`DiscoveryHome`,emits:[`open-studio`],setup(a,{emit:d}){let f=d,h=ee(),b=v(()=>h.state.poivelle),T=v(()=>b.value?.projects??[]),E=v(()=>b.value?.discoveryWorks??[]),D=w(``),O=w(``),k=w(!1),A=w(),re=w(new Set),ie=w(`official:pulsecam`),j=w(`all`),oe=[{workId:`official:pulsecam`,label:`poivelle.discovery.commercial`,icon:q},{workId:`official:moonlit-signal`,label:`poivelle.discovery.musicVideo`,icon:pe},{workId:`official:northstar-origin`,label:`poivelle.discovery.documentary`,icon:K}],se=[`poivelle.discovery.starterProduct`,`poivelle.discovery.starterMusic`,`poivelle.discovery.starterDocumentary`],ce=[{value:`all`,label:`poivelle.discovery.all`},{value:`commercial`,label:`poivelle.discovery.commercial`},{value:`music_video`,label:`poivelle.discovery.musicVideo`},{value:`narrative`,label:`poivelle.discovery.narrative`},{value:`documentary`,label:`poivelle.discovery.documentary`},{value:`community`,label:`poivelle.discovery.community`}],de=v(()=>{let e=O.value.trim().toLowerCase();return E.value.filter(t=>(j.value===`all`||t.category===j.value)&&(!e||`${t.title} ${t.description} ${t.creator_name} ${(t.tags??[]).join(` `)}`.toLowerCase().includes(e)))}),M=v(()=>b.value?.status?.bootstrap===te.Request),N=v(()=>b.value?.error),P=v({get:()=>!!A.value,set:e=>{e||(A.value=void 0)}}),F=v(()=>{let e=E.value.find(e=>e.id===ie.value);return e&&e.copyable!==!1?e:E.value.find(e=>e.copyable!==!1)}),I=()=>h.dispatch(`poivelle/bootstrap`,{loadProject:!1}),me=e=>{re.value=new Set([...re.value,e])},R=e=>e.video_url?.startsWith(`https://`)?e.video_url:void 0,ge=e=>{if(e&&typeof e==`object`&&`response`in e){let t=e.response?.data?.detail;if(typeof t==`string`)return t;if(typeof t?.message==`string`)return t.message}return e instanceof Error?e.message:B(`poivelle.error.generic`)},_e=e=>{let t=Math.floor(e/60),n=e%60;return t?`${t}:${n.toString().padStart(2,`0`)}`:`0:${n.toString().padStart(2,`0`)}`},ve=async e=>{await h.dispatch(`poivelle/loadProject`,e),f(`open-studio`)},z=async(e,t)=>{if(!k.value){k.value=!0;try{await h.dispatch(`poivelle/copyDiscoveryWork`,{work_id:e.id,prompt:t,title:t.slice(0,80)}),f(`open-studio`)}catch(e){ne.error(ge(e))}finally{k.value=!1}}},V=async()=>{let e=F.value;e&&D.value.trim()&&await z(e,D.value.trim())},H=async e=>{await z(e,D.value.trim()||`${B(`poivelle.discovery.copyPrefix`)} ${e.title}`)};return u(I),(a,u)=>(C(),l(`main`,X,[e(`header`,Oe,[e(`div`,Z,[o(c(q),{size:19,"aria-hidden":`true`}),u[3]||=r(` POIVELLE`,-1)]),e(`div`,Q,[(C(!0),l(p,null,x(T.value.slice(0,3),e=>(C(),l(`button`,{key:e.id,type:`button`,title:e.title,"aria-label":e.title,onClick:t=>ve(e.id)},[r(i(e.title)+` `,1),o(c(le),{size:13,"aria-hidden":`true`})],8,ke))),128))])]),M.value||N.value?(C(),l(`div`,Ae,[M.value?(C(),_(c(fe),{key:0,size:16,class:`spinning`,"aria-hidden":`true`})):s(``,!0),e(`span`,null,i(M.value?a.$t(`poivelle.status.loading`):N.value),1),N.value?(C(),l(`button`,{key:1,type:`button`,onClick:I},i(a.$t(`poivelle.action.retry`)),1)):s(``,!0)])):s(``,!0),e(`section`,je,[e(`p`,Me,i(a.$t(`poivelle.discovery.kicker`)),1),e(`h1`,Ne,i(a.$t(`poivelle.discovery.title`)),1),e(`div`,{class:`mode-switch`,"aria-label":a.$t(`poivelle.discovery.skills`)},[(C(),l(p,null,x(oe,t=>e(`button`,{key:t.workId,type:`button`,class:n({active:ie.value===t.workId}),disabled:M.value,onClick:e=>ie.value=t.workId},[(C(),_(S(t.icon),{size:15,"aria-hidden":`true`})),r(` `+i(a.$t(t.label)),1)],10,Fe)),64))],8,Pe),e(`form`,{class:`composer`,onSubmit:t(V,[`prevent`])},[g(e(`textarea`,{"onUpdate:modelValue":u[0]||=e=>D.value=e,placeholder:a.$t(`poivelle.discovery.placeholder`),disabled:M.value,maxlength:`500`,rows:`4`},null,8,Ie),[[m,D.value]]),e(`div`,Le,[e(`span`,null,i(D.value.length)+`/500`,1),e(`button`,{type:`submit`,disabled:!D.value.trim()||!F.value||M.value||k.value,title:a.$t(`poivelle.discovery.create`)},[k.value?(C(),_(c(fe),{key:0,size:18,class:`spinning`,"aria-hidden":`true`})):(C(),_(c(ae),{key:1,size:18,"aria-hidden":`true`}))],8,Re)])],32),e(`div`,ze,[(C(),l(p,null,x(se,t=>e(`button`,{key:t,type:`button`,disabled:M.value,onClick:e=>D.value=a.$t(t)},i(a.$t(t)),9,Be)),64))])]),e(`section`,Ve,[e(`div`,He,[e(`div`,null,[e(`span`,null,i(a.$t(`poivelle.discovery.galleryKicker`)),1),e(`h2`,Ue,i(a.$t(`poivelle.discovery.gallery`)),1)]),e(`label`,We,[o(c(he),{size:16,"aria-hidden":`true`}),g(e(`input`,{"onUpdate:modelValue":u[1]||=e=>O.value=e,placeholder:a.$t(`poivelle.discovery.search`),"aria-label":a.$t(`poivelle.discovery.search`)},null,8,Ge),[[m,O.value]])])]),e(`div`,Ke,[(C(),l(p,null,x(ce,t=>e(`button`,{key:t.value,type:`button`,class:n({active:j.value===t.value}),onClick:e=>j.value=t.value},i(a.$t(t.label)),11,qe)),64))]),e(`div`,Je,[(C(!0),l(p,null,x(de.value,t=>(C(),l(`article`,{key:t.id,class:`work-card`},[e(`div`,Ye,[t.cover_url&&!re.value.has(t.id)?(C(),l(`img`,{key:0,src:t.cover_url,alt:t.title,onError:e=>me(t.id)},null,40,Xe)):(C(),_(c(Ce),{key:1,size:32,"aria-hidden":`true`})),R(t)?(C(),l(`span`,Ze,i(a.$t(`poivelle.discovery.finishedFilm`)),1)):s(``,!0),R(t)?(C(),l(`button`,{key:3,type:`button`,class:`cover-play`,"aria-label":`${a.$t(`poivelle.discovery.playFilm`)}: ${t.title}`,onClick:e=>A.value=t},[o(c(L),{size:18,fill:`currentColor`,"aria-hidden":`true`}),r(` `+i(a.$t(`poivelle.discovery.playFilm`)),1)],8,Qe)):s(``,!0),e(`span`,$e,i(t.duration_seconds?_e(t.duration_seconds):a.$t(`poivelle.discovery.community`)),1)]),e(`div`,et,[e(`div`,$,[e(`span`,null,i(t.creator_name),1),e(`strong`,null,i(t.title),1),e(`p`,null,i(t.description),1)]),e(`div`,tt,[R(t)?(C(),l(`button`,{key:0,type:`button`,class:`play-button`,onClick:e=>A.value=t},[o(c(L),{size:14,fill:`currentColor`,"aria-hidden":`true`}),r(` `+i(a.$t(`poivelle.discovery.play`)),1)],8,nt)):s(``,!0),t.copyable===!1?s(``,!0):(C(),l(`button`,{key:1,type:`button`,class:`copy-button`,disabled:M.value||k.value,onClick:e=>H(t)},[o(c(ue),{size:14,"aria-hidden":`true`}),r(` `+i(a.$t(`poivelle.discovery.copy`)),1)],8,rt))])])]))),128))])]),o(c(be),{modelValue:P.value,"onUpdate:modelValue":u[2]||=e=>P.value=e,class:`film-preview-dialog`,"aria-labelledby":`poivelle-film-dialog-title`,width:`min(920px, calc(100vw - 32px))`,"align-center":``,"append-to-body":``,"destroy-on-close":``},{header:y(()=>[A.value?(C(),l(`div`,it,[e(`span`,null,i(a.$t(`poivelle.discovery.finishedFilm`)),1),e(`strong`,at,i(A.value.title),1),e(`small`,null,[r(i(A.value.creator_name)+` `,1),A.value.duration_seconds?(C(),l(p,{key:0},[r(` · `+i(_e(A.value.duration_seconds)),1)],64)):s(``,!0)])])):s(``,!0)]),default:y(()=>[A.value&&R(A.value)?(C(),_(xe,{key:`${A.value.id}-${A.value.video_url}`,src:R(A.value)},null,8,[`src`])):s(``,!0)]),_:1},8,[`modelValue`])]))}}),[[`__scopeId`,`data-v-91feafb0`]]),st={class:`studio-header`},ct={class:`identity`},lt=[`title`],ut={class:`wordmark`},dt={key:0,class:`version`},ft={class:`actions`},pt={class:`sync-state`},mt=[`title`],ht=[`disabled`],gt=V(T({__name:`StudioHeader`,props:{projectTitle:{},graphVersion:{},canRun:{type:Boolean},canEdit:{type:Boolean},primaryLabel:{}},emits:[`open-projects`,`home`,`commit`,`run`],setup(t){return(n,a)=>(C(),l(`header`,st,[e(`div`,ct,[e(`button`,{class:`home-button`,type:`button`,title:n.$t(`poivelle.discovery.back`),onClick:a[0]||=e=>n.$emit(`home`)},[o(c(ie),{size:16,"aria-hidden":`true`})],8,lt),e(`span`,ut,[o(c(q),{size:15,"aria-hidden":`true`}),a[4]||=r(` POIVELLE`,-1)]),e(`button`,{class:`project-button`,type:`button`,onClick:a[1]||=e=>n.$emit(`open-projects`)},[e(`span`,null,i(t.projectTitle||n.$t(`poivelle.project.noProject`)),1),o(c(ce),{size:14,"aria-hidden":`true`})]),t.graphVersion===void 0?s(``,!0):(C(),l(`span`,dt,`Graph v`+i(t.graphVersion),1))]),e(`div`,ft,[e(`span`,pt,[a[5]||=e(`span`,{class:`sync-dot`},null,-1),r(` `+i(n.$t(`poivelle.status.synced`)),1)]),t.canEdit?(C(),l(`button`,{key:0,class:`icon-button`,type:`button`,title:n.$t(`poivelle.action.commit`),onClick:a[2]||=e=>n.$emit(`commit`)},[o(c(we),{size:17,"aria-hidden":`true`})],8,mt)):s(``,!0),e(`button`,{class:`primary-button`,type:`button`,disabled:!t.canRun,onClick:a[3]||=e=>n.$emit(`run`)},[o(c(L),{size:15,fill:`currentColor`,"aria-hidden":`true`}),r(` `+i(t.primaryLabel||n.$t(`poivelle.action.runSkill`)),1)],8,ht)])]))}}),[[`__scopeId`,`data-v-86d45f69`]]),_t={class:`production-rail`},vt={class:`rail-section`},yt={class:`section-heading`},bt=[`title`],xt={class:`project-list`},St=[`onClick`],Ct={key:0,class:`empty-copy`},wt={class:`rail-section assets-section`},Tt={class:`section-heading`},Et=[`title`],Dt={class:`asset-filters`},Ot=[`onClick`],kt={class:`asset-list`},At={key:0,class:`empty-copy`},jt={class:`rail-section compact-section`},Mt={class:`section-heading static`},Nt={class:`revision-list`},Pt={key:0,class:`empty-copy`},Ft=V(T({__name:`ProductionRail`,props:{projects:{},currentProjectId:{},assets:{},revisions:{},canEdit:{type:Boolean}},emits:[`select-project`,`create-project`,`import-asset`],setup(t){let r=t,a=[`all`,`character`,`location`,`image`,`video`,`voice`],u=w(`all`),d=v(()=>u.value===`all`?r.assets:r.assets.filter(e=>e.kind===u.value)),f=e=>e===`video`?z:e===`voice`||e===`music`||e===`sfx`?G:e===`script`||e===`brand`?M:F;return(r,m)=>(C(),l(`aside`,_t,[e(`div`,vt,[e(`div`,yt,[e(`span`,null,i(r.$t(`poivelle.section.projects`)),1),t.canEdit?(C(),l(`button`,{key:0,type:`button`,title:r.$t(`poivelle.project.create`),onClick:m[0]||=e=>r.$emit(`create-project`)},[o(c(me),{size:15,"aria-hidden":`true`})],8,bt)):s(``,!0)]),e(`div`,xt,[(C(!0),l(p,null,x(t.projects,a=>(C(),l(`button`,{key:a.id,type:`button`,class:n([`project-row`,{active:a.id===t.currentProjectId}]),onClick:e=>r.$emit(`select-project`,a.id)},[o(c(q),{size:15,"aria-hidden":`true`}),e(`span`,null,i(a.title),1),e(`small`,null,`v`+i(a.graph_version),1)],10,St))),128)),t.projects.length?s(``,!0):(C(),l(`p`,Ct,i(r.$t(`poivelle.project.empty`)),1))])]),e(`div`,wt,[e(`div`,Tt,[e(`span`,null,i(r.$t(`poivelle.section.assets`)),1),t.canEdit?(C(),l(`button`,{key:0,type:`button`,title:r.$t(`poivelle.asset.import`),onClick:m[1]||=e=>r.$emit(`import-asset`)},[o(c(ve),{size:15,"aria-hidden":`true`})],8,Et)):s(``,!0)]),e(`div`,Dt,[(C(),l(p,null,x(a,t=>e(`button`,{key:t,type:`button`,class:n({active:u.value===t}),onClick:e=>u.value=t},i(t===`all`?r.$t(`poivelle.asset.all`):t),11,Ot)),64))]),e(`div`,kt,[(C(!0),l(p,null,x(d.value,t=>(C(),l(`button`,{key:t.id,type:`button`,class:`asset-row`},[(C(),_(S(f(t.kind)),{size:15,"aria-hidden":`true`})),e(`span`,null,[e(`strong`,null,i(t.title),1),e(`small`,null,i(t.kind)+` · `+i(t.scope),1)])]))),128)),d.value.length?s(``,!0):(C(),l(`p`,At,i(r.$t(`poivelle.asset.empty`)),1))])]),e(`div`,jt,[e(`div`,Mt,[e(`span`,null,i(r.$t(`poivelle.section.revisions`)),1),o(c(N),{size:14,"aria-hidden":`true`})]),e(`div`,Nt,[(C(!0),l(p,null,x(t.revisions.slice(0,4),t=>(C(),l(`div`,{key:t.id,class:`revision-row`},[e(`span`,null,`R`+i(t.revision_number),1),e(`small`,null,`Graph v`+i(t.graph_version),1)]))),128)),t.revisions.length?s(``,!0):(C(),l(`p`,Pt,i(r.$t(`poivelle.revision.empty`)),1))])])]))}}),[[`__scopeId`,`data-v-71c6054d`]]),It=[`aria-label`],Lt=[`onClick`],Rt=V(T({__name:`ProjectionTabs`,props:{modelValue:{},canEdit:{type:Boolean}},emits:[`update:modelValue`,`create-node`],setup(t){let a=[{value:`overview`,label:`poivelle.projection.overview`,icon:P},{value:`canvas`,label:`poivelle.projection.advanced`,icon:J},{value:`storyboard`,label:`poivelle.projection.storyboard`,icon:q},{value:`timeline`,label:`poivelle.projection.timeline`,icon:De},{value:`review`,label:`poivelle.projection.review`,icon:Te}];return(u,d)=>(C(),l(`nav`,{class:`projection-tabs`,"aria-label":u.$t(`poivelle.projection.label`)},[(C(),l(p,null,x(a,a=>e(`button`,{key:a.value,type:`button`,class:n({active:t.modelValue===a.value}),onClick:e=>u.$emit(`update:modelValue`,a.value)},[(C(),_(S(a.icon),{size:14,"aria-hidden":`true`})),r(` `+i(u.$t(a.label)),1)],10,Lt)),64)),d[1]||=e(`span`,{class:`spacer`},null,-1),t.canEdit?(C(),l(`button`,{key:0,class:`add-node`,type:`button`,onClick:d[0]||=e=>u.$emit(`create-node`)},[o(c(me),{size:14,"aria-hidden":`true`}),r(` `+i(u.$t(`poivelle.node.create`)),1)])):s(``,!0)],8,It))}}),[[`__scopeId`,`data-v-393d2d3e`]]),zt={class:`connections`,"aria-hidden":`true`},Bt=[`x1`,`y1`,`x2`,`y2`],Vt=[`onClick`],Ht={class:`node-type`},Ut={class:`node-summary`},Wt={key:0,class:`lock-mark`},Gt={key:0,class:`empty-canvas`},Kt=V(T({__name:`GraphCanvas`,props:{graph:{},selectedNodeId:{},canEdit:{type:Boolean}},emits:[`select-node`,`create-node`],setup(a){let u=a,d=v(()=>new Map(u.graph.layouts.map(e=>[e.node_id,e]))),f=e=>{let t=u.graph.nodes.findIndex(t=>t.id===e);return{x:52+t%3*250,y:54+Math.floor(t/3)*170,width:208,height:116}},m=e=>d.value.get(e)??f(e),h=e=>{let t=m(e);return{x:t.x+t.width/2,y:t.y+t.height/2}},g=e=>{let t=m(e);return{left:`${t.x}px`,top:`${t.y}px`,width:`${t.width}px`,minHeight:`${t.height}px`}},_=v(()=>u.graph.edges.filter(e=>u.graph.nodes.some(t=>t.id===e.source.node_id)&&u.graph.nodes.some(t=>t.id===e.target.node_id))),y=e=>{let t=e.payload.text??e.payload.prompt??e.payload.description;return typeof t==`string`&&t?t:`Version ${e.version}`};return(u,d)=>(C(),l(`div`,{class:`graph-canvas`,onClick:d[1]||=t(e=>u.$emit(`select-node`,void 0),[`self`])},[(C(),l(`svg`,zt,[(C(!0),l(p,null,x(_.value,e=>(C(),l(`line`,{key:e.id,x1:h(e.source.node_id).x,y1:h(e.source.node_id).y,x2:h(e.target.node_id).x,y2:h(e.target.node_id).y},null,8,Bt))),128))])),(C(!0),l(p,null,x(a.graph.nodes,f=>(C(),l(`button`,{key:f.id,type:`button`,class:n([`graph-node`,`type-${f.node_type}`,{selected:f.id===a.selectedNodeId}]),style:b(g(f.id)),onClick:t(e=>u.$emit(`select-node`,f.id),[`stop`])},[e(`span`,Ht,i(f.node_type),1),e(`strong`,null,i(f.title),1),e(`span`,Ut,i(y(f)),1),f.locked_paths.length?(C(),l(`span`,Wt,[o(c(Ee),{size:11}),d[2]||=r(` locked`,-1)])):s(``,!0)],14,Vt))),128)),a.graph.nodes.length?s(``,!0):(C(),l(`div`,Gt,[o(c(J),{size:28,"stroke-width":`1.5`,"aria-hidden":`true`}),e(`h2`,null,i(u.$t(`poivelle.graph.emptyTitle`)),1),e(`p`,null,i(u.$t(`poivelle.graph.emptyBody`)),1),a.canEdit?(C(),l(`button`,{key:0,type:`button`,onClick:d[0]||=e=>u.$emit(`create-node`)},[o(c(me),{size:15,"aria-hidden":`true`}),r(` `+i(u.$t(`poivelle.node.create`)),1)])):s(``,!0)]))]))}}),[[`__scopeId`,`data-v-cd67c1fc`]]),qt={class:`media-lane`},Jt={key:0,class:`candidate-strip`},Yt=[`src`],Xt=[`src`],Zt=[`onClick`],Qt={key:1},$t=[`onClick`],en={key:1,class:`unavailable-takes`},tn={key:2,class:`empty-candidates`},nn=V(T({__name:`StoryboardMediaLane`,props:{title:{},kind:{},nodeIds:{},artifacts:{},takes:{},selections:{},canEdit:{type:Boolean},canSelect:{type:Boolean}},emits:[`select-node`,`select-take`],setup(t){let r=t,a=v(()=>{let e=new Set(r.nodeIds),t=new Map(r.artifacts.map(e=>[e.id,e])),n=r.takes.filter(t=>e.has(t.target_node_id)&&t.state===`ready`).flatMap(e=>[...new Set(e.artifact_ids)].map(e=>t.get(e)).filter(e=>!!e).map(t=>({key:`${e.id}:${t.id}`,take:e,artifact:t,selected:r.selections.some(t=>t.target_node_id===e.target_node_id&&t.take_id===e.id)}))),i=new Set(n.map(e=>e.artifact.id)),a=r.artifacts.filter(t=>e.has(t.node_id??``)&&t.kind===r.kind&&!i.has(t.id)).map(e=>({key:e.id,take:void 0,artifact:e,selected:!1}));return[...n,...a]}),o=v(()=>r.takes.filter(e=>r.nodeIds.includes(e.target_node_id)&&e.state!==`ready`)),c=w([]),u=e=>{c.value=c.value.includes(e)?c.value.filter(t=>t!==e):[...c.value.slice(-1),e]};return(r,d)=>(C(),l(`section`,qt,[e(`header`,null,[e(`span`,null,i(t.title),1),t.nodeIds[0]?(C(),l(`button`,{key:0,type:`button`,onClick:d[0]||=e=>r.$emit(`select-node`,t.nodeIds[0])},i(r.$t(`poivelle.storyboard.openNode`)),1)):s(``,!0)]),a.value.length?(C(),l(`div`,Jt,[(C(!0),l(p,null,x(a.value,a=>(C(),l(`article`,{key:a.key,class:n([`candidate`,{selected:a.selected,comparing:c.value.includes(a.key)}])},[t.kind===`image`?(C(),l(`img`,{key:0,src:a.artifact.storage_url,alt:``},null,8,Yt)):(C(),l(`video`,{key:1,src:a.artifact.storage_url,controls:``,preload:`metadata`},null,8,Xt)),e(`div`,null,[e(`span`,null,i(a.take?`TAKE`:`ARTIFACT`),1),e(`strong`,null,i(a.artifact.id.slice(-8)),1),t.canEdit&&t.canSelect&&a.take&&!a.selected?(C(),l(`button`,{key:0,type:`button`,onClick:e=>r.$emit(`select-take`,{target_node_id:a.take.target_node_id,take_id:a.take.id})},i(r.$t(`poivelle.storyboard.selectTake`)),9,Zt)):a.selected?(C(),l(`em`,Qt,i(r.$t(`poivelle.storyboard.selected`)),1)):s(``,!0),e(`button`,{type:`button`,class:`compare-toggle`,onClick:e=>u(a.key)},i(c.value.includes(a.key)?r.$t(`poivelle.storyboard.comparing`):r.$t(`poivelle.storyboard.compare`)),9,$t)])],2))),128))])):s(``,!0),o.value.length?(C(),l(`div`,en,[(C(!0),l(p,null,x(o.value,e=>(C(),l(`span`,{key:e.id},i(e.state===`failed`?r.$t(`poivelle.storyboard.failedTake`):r.$t(`poivelle.storyboard.restrictedTake`)),1))),128))])):s(``,!0),!a.value.length&&!o.value.length?(C(),l(`div`,tn,i(r.$t(`poivelle.storyboard.noCandidates`)),1)):s(``,!0)]))}}),[[`__scopeId`,`data-v-4e385f6a`]]),rn={class:`storyboard-view`},an={key:0,class:`storyboard-heading`},on={class:`section-label`},sn=[`onClick`],cn={class:`shot-number`},ln={class:`shot-production`},un={class:`shot-metadata`},dn={class:`prompt-columns`},fn={class:`candidate-columns`},pn=[`onClick`],mn={key:0,class:`empty-view`},hn=V(T({__name:`StoryboardView`,props:{graph:{},storyboard:{},artifacts:{},takes:{},selections:{},selectedNodeId:{},canEdit:{type:Boolean},canSelect:{type:Boolean}},emits:[`select-node`,`select-take`],setup(t){let r=t,a=v(()=>r.storyboard?.sections.reduce((e,t)=>e+t.shots.length,0)??0),u=v(()=>r.graph.nodes.filter(e=>[`storyboard`,`scene`,`shot`,`image`,`video`].includes(e.node_type)));return(r,d)=>(C(),l(`div`,rn,[t.storyboard?(C(),l(`header`,an,[e(`div`,null,[e(`span`,null,i(t.storyboard.schema_ref),1),e(`h2`,null,i(t.storyboard.title),1)]),e(`dl`,null,[e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.product`)),1),e(`dd`,null,i(t.storyboard.product_name),1)]),e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.duration`)),1),e(`dd`,null,i(t.storyboard.target_duration_seconds)+`s`,1)]),e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.shots`)),1),e(`dd`,null,i(a.value),1)])])])):s(``,!0),t.storyboard?(C(!0),l(p,{key:1},x(t.storyboard.sections,a=>(C(),l(`section`,{key:a.id,class:`story-section`},[e(`div`,on,[e(`span`,null,i(String(a.order).padStart(2,`0`)),1),e(`h3`,null,i(a.title),1)]),(C(!0),l(p,null,x(a.shots,a=>(C(),l(`article`,{key:a.row.id,class:n([`shot-row`,{selected:a.shot_node_id===t.selectedNodeId}])},[e(`button`,{class:`shot-brief`,type:`button`,onClick:e=>r.$emit(`select-node`,a.shot_node_id)},[e(`span`,cn,`SHOT `+i(String(a.row.shot_number).padStart(2,`0`)),1),e(`strong`,null,i(a.row.plot_description),1),e(`span`,null,i(a.row.duration_seconds)+`s · `+i(a.row.shot_size),1)],8,sn),e(`div`,ln,[e(`dl`,un,[e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.action`)),1),e(`dd`,null,i(a.row.character_action||`—`),1)]),e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.emotion`)),1),e(`dd`,null,i(a.row.emotion||`—`),1)]),e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.lighting`)),1),e(`dd`,null,i(a.row.lighting_and_atmosphere),1)]),e(`div`,null,[e(`dt`,null,i(r.$t(`poivelle.storyboard.audio`)),1),e(`dd`,null,i(a.row.audio_effects),1)])]),e(`div`,dn,[e(`div`,null,[e(`span`,null,i(r.$t(`poivelle.storyboard.imagePrompt`)),1),e(`p`,null,i(a.row.image_generation_prompt),1)]),e(`div`,null,[e(`span`,null,i(r.$t(`poivelle.storyboard.motionPrompt`)),1),e(`p`,null,i(a.row.video_motion_prompt),1)])])]),e(`div`,fn,[o(nn,{title:r.$t(`poivelle.storyboard.frames`),kind:`image`,"node-ids":a.image_node_ids,artifacts:t.artifacts,takes:t.takes,selections:t.selections,"can-edit":t.canEdit,"can-select":t.canSelect,onSelectNode:d[0]||=e=>r.$emit(`select-node`,e),onSelectTake:d[1]||=e=>r.$emit(`select-take`,e)},null,8,[`title`,`node-ids`,`artifacts`,`takes`,`selections`,`can-edit`,`can-select`]),o(nn,{title:r.$t(`poivelle.storyboard.motion`),kind:`video`,"node-ids":a.video_node_ids,artifacts:t.artifacts,takes:t.takes,selections:t.selections,"can-edit":t.canEdit,"can-select":t.canSelect,onSelectNode:d[2]||=e=>r.$emit(`select-node`,e),onSelectTake:d[3]||=e=>r.$emit(`select-take`,e)},null,8,[`title`,`node-ids`,`artifacts`,`takes`,`selections`,`can-edit`,`can-select`])])],2))),128))]))),128)):(C(),l(p,{key:2},[(C(!0),l(p,null,x(u.value,(a,s)=>(C(),l(`button`,{key:a.id,type:`button`,class:n([`legacy-card`,{selected:a.id===t.selectedNodeId}]),onClick:e=>r.$emit(`select-node`,a.id)},[e(`span`,null,i(String(s+1).padStart(2,`0`)),1),o(c(q),{size:26,"stroke-width":`1.25`,"aria-hidden":`true`}),e(`strong`,null,i(a.title),1)],10,pn))),128)),u.value.length?s(``,!0):(C(),l(`div`,mn,[o(c(q),{size:30,"stroke-width":`1.4`}),e(`h2`,null,i(r.$t(`poivelle.storyboard.emptyTitle`)),1),e(`p`,null,i(r.$t(`poivelle.storyboard.emptyBody`)),1)]))],64))]))}}),[[`__scopeId`,`data-v-ce90da94`]]),gn={class:`timeline-view`},_n={key:0,class:`master-output`,"aria-labelledby":`poivelle-master-title`},vn={class:`master-heading`},yn={class:`master-kicker`},bn={id:`poivelle-master-title`},xn=[`href`],Sn=[`src`,`aria-label`],Cn={key:0,class:`master-status`,role:`status`},wn={key:1,class:`master-status is-error`,role:`alert`},Tn={class:`master-metadata`},En={class:`timeline-ruler`},Dn={key:1,class:`tracks`},On={class:`track-label`},kn={class:`track-lane`},An=[`title`],jn=[`aria-label`],Mn={key:0,class:`clip-actions`},Nn=[`disabled`,`onClick`],Pn=[`disabled`,`onClick`],Fn={key:2,class:`empty-timeline`},In=120/5e3,Ln=V(T({__name:`TimelineView`,props:{timeline:{},graph:{},artifacts:{},canEdit:{type:Boolean}},emits:[`move-clip`],setup(t){let n=t,a=v(()=>{let e=new Set(n.graph.nodes.filter(e=>e.node_type===`composition`).map(e=>e.id));return[...n.artifacts??[]].filter(t=>t.kind===`video`&&t.state===`committed`&&t.restriction_watermark===0&&!!t.node_id&&e.has(t.node_id)&&t.metadata?.operation===`compose.timeline@1`).sort((e,t)=>t.created_at.localeCompare(e.created_at))[0]}),u=w(!0),d=w(!1);h(()=>a.value?.id,()=>{u.value=!0,d.value=!1});let f=()=>{u.value=!0,d.value=!1},m=()=>{u.value=!1,d.value=!0},g=e=>{let t=a.value?.metadata?.[e];return typeof t==`number`&&Number.isFinite(t)?t:void 0},_=v(()=>{let e=g(`duration_ms`);return e===void 0?`—`:`${(e/1e3).toFixed(1)}s`}),y=v(()=>{let e=g(`width`),t=g(`height`);return e&&t?`${e} × ${t}`:`—`}),S=v(()=>{let e=g(`width`),t=g(`height`);return e&&t?{aspectRatio:`${e} / ${t}`}:void 0}),T=e=>n.timeline?.clips.filter(t=>t.track_id===e)??[],E=e=>e.artifact_id.slice(-6),D=e=>({left:`${e.timeline_start_ms*In}px`,width:`${Math.max(48,(e.source_out_ms-e.source_in_ms)/(e.speed??1)*In)}px`});return(n,h)=>(C(),l(`div`,gn,[a.value?(C(),l(`section`,_n,[e(`div`,vn,[e(`div`,null,[e(`span`,yn,i(n.$t(`poivelle.timeline.deliverable`)),1),e(`h2`,bn,i(n.$t(`poivelle.timeline.masterTitle`)),1)]),e(`a`,{class:`master-download`,href:a.value.storage_url,target:`_blank`,rel:`noopener noreferrer`,download:``},[o(c(de),{size:15,"aria-hidden":`true`}),r(` `+i(n.$t(`poivelle.timeline.download`)),1)],8,xn)]),e(`div`,{class:`master-media`,style:b(S.value)},[e(`video`,{class:`master-player`,src:a.value.storage_url,"aria-label":n.$t(`poivelle.timeline.playerLabel`),controls:``,playsinline:``,preload:`metadata`,onLoadstart:f,onLoadedmetadata:h[0]||=e=>u.value=!1,onCanplay:h[1]||=e=>u.value=!1,onError:m},null,40,Sn),u.value&&!d.value?(C(),l(`div`,Cn,[o(c(fe),{size:24,class:`is-spinning`,"aria-hidden":`true`}),e(`span`,null,i(n.$t(`poivelle.timeline.loading`)),1)])):s(``,!0),d.value?(C(),l(`div`,wn,[o(c(_e),{size:24,"aria-hidden":`true`}),e(`span`,null,i(n.$t(`poivelle.timeline.loadError`)),1)])):s(``,!0)],4),e(`dl`,Tn,[e(`div`,null,[e(`dt`,null,i(n.$t(`poivelle.timeline.duration`)),1),e(`dd`,null,i(_.value),1)]),e(`div`,null,[e(`dt`,null,i(n.$t(`poivelle.timeline.frame`)),1),e(`dd`,null,i(y.value),1)]),e(`div`,null,[e(`dt`,null,i(n.$t(`poivelle.timeline.videoClips`)),1),e(`dd`,null,i(g(`video_clips`)??`—`),1)]),e(`div`,null,[e(`dt`,null,i(n.$t(`poivelle.timeline.audioClips`)),1),e(`dd`,null,i(g(`audio_clips`)??`—`),1)])])])):s(``,!0),e(`div`,En,[(C(),l(p,null,x(10,t=>e(`span`,{key:t},i((t-1)*5)+`s`,1)),64))]),t.timeline?.tracks.length?(C(),l(`div`,Dn,[(C(!0),l(p,null,x(t.timeline.tracks,r=>(C(),l(`div`,{key:r.id,class:`track-row`},[e(`div`,On,i(r.title||r.kind||r.id),1),e(`div`,kn,[(C(!0),l(p,null,x(T(r.id),(a,o)=>(C(),l(`div`,{key:a.id,class:`timeline-clip`,style:b(D(a)),title:a.artifact_id},[e(`button`,{type:`button`,"aria-label":a.artifact_id},i(E(a)),9,jn),t.canEdit&&r.kind===`video`?(C(),l(`span`,Mn,[e(`button`,{type:`button`,disabled:o===0,onClick:e=>n.$emit(`move-clip`,{trackId:r.id,clipId:a.id,direction:-1})},` ‹ `,8,Nn),e(`button`,{type:`button`,disabled:o===T(r.id).length-1,onClick:e=>n.$emit(`move-clip`,{trackId:r.id,clipId:a.id,direction:1})},` › `,8,Pn)])):s(``,!0)],12,An))),128))])]))),128))])):(C(),l(`div`,Fn,[o(c(Ce),{size:30,"stroke-width":`1.4`}),e(`h2`,null,i(n.$t(`poivelle.timeline.emptyTitle`)),1),e(`p`,null,i(n.$t(`poivelle.timeline.emptyBody`)),1)]))]))}}),[[`__scopeId`,`data-v-37eb37c8`]]),Rn={class:`review-view`},zn={class:`review-summary`},Bn={class:`eyebrow`},Vn={class:`summary-metrics`},Hn={class:`review-columns`},Un={key:0,class:`item-actions`},Wn=[`onClick`],Gn={key:0,class:`empty-copy`},Kn=[`onClick`],qn=[`onClick`],Jn={key:0,class:`empty-copy`},Yn={key:1,class:`run-detail`},Xn={key:0},Zn=[`onClick`],Qn={key:2,class:`forensic-failures`,role:`alert`},$n=V(T({__name:`ReviewView`,props:{graph:{},proposals:{},revisions:{},runs:{},activeRun:{},evaluations:{},forensicValidations:{},costs:{},canEdit:{type:Boolean}},emits:[`reject-proposal`,`cancel-run`,`open-run`,`retry-step`],setup(a){let o=a,c=v(()=>o.proposals.filter(e=>e.state===`awaiting_approval`)),u=e=>![`release_pending`,`succeeded`,`failed`,`cancelled`].includes(e.state),d=v(()=>o.evaluations.filter(e=>e.verdict===`pass`).length),f=v(()=>o.forensicValidations[0]),m=v(()=>f.value?.result.checks.filter(e=>e.verdict===`fail`)??[]),h=e=>[...o.activeRun?.attempts??[]].filter(t=>t.step_run_id===e).sort((e,t)=>t.created_at.localeCompare(e.created_at))[0],g=e=>(e/1e6).toFixed(2);return(o,_)=>(C(),l(`div`,Rn,[e(`section`,zn,[e(`div`,null,[e(`span`,Bn,i(o.$t(`poivelle.review.heading`)),1),e(`h2`,null,i(a.revisions.length?`Revision ${a.revisions[0].revision_number}`:o.$t(`poivelle.review.noRevision`)),1)]),e(`div`,Vn,[e(`span`,null,[e(`strong`,null,i(a.graph.nodes.length),1),r(i(o.$t(`poivelle.review.nodes`)),1)]),e(`span`,null,[e(`strong`,null,i(a.proposals.length),1),r(i(o.$t(`poivelle.review.proposals`)),1)]),e(`span`,null,[e(`strong`,null,i(a.runs.length),1),r(i(o.$t(`poivelle.review.runs`)),1)]),e(`span`,null,[e(`strong`,null,i(g(a.costs?.totals_microcredits.final??0)),1),r(i(o.$t(`poivelle.review.finalCost`)),1)]),e(`span`,null,[e(`strong`,null,i(d.value)+`/`+i(a.evaluations.length),1),r(i(o.$t(`poivelle.review.qualityChecks`)),1)]),e(`span`,null,[e(`strong`,{class:n(f.value?.result.verdict===`fail`?`metric-fail`:``)},i(f.value?.result.verdict??`—`),3),r(i(o.$t(`poivelle.review.forensics`)),1)])])]),e(`section`,Hn,[e(`div`,null,[e(`h3`,null,i(o.$t(`poivelle.review.pendingProposals`)),1),(C(!0),l(p,null,x(c.value,t=>(C(),l(`article`,{key:t.id,class:`review-item`},[e(`span`,{class:n([`risk`,`risk-${t.risk_class}`])},i(t.risk_class),3),e(`strong`,null,i(t.intent),1),e(`p`,null,i(t.rationale),1),a.canEdit?(C(),l(`div`,Un,[e(`span`,null,i(o.$t(`poivelle.review.approvalTokenRequired`)),1),e(`button`,{type:`button`,onClick:e=>o.$emit(`reject-proposal`,t.id)},i(o.$t(`poivelle.review.reject`)),9,Wn)])):s(``,!0)]))),128)),c.value.length?s(``,!0):(C(),l(`p`,Gn,i(o.$t(`poivelle.review.noProposals`)),1))]),e(`div`,null,[e(`h3`,null,i(o.$t(`poivelle.review.execution`)),1),(C(!0),l(p,null,x(a.runs,r=>(C(),l(`article`,{key:r.id,class:n([`run-item`,{active:a.activeRun?.run.id===r.id}]),onClick:e=>o.$emit(`open-run`,r.id)},[e(`span`,{class:n([`run-state`,`state-${r.state}`])},null,2),e(`div`,null,[e(`strong`,null,i(r.state),1),e(`small`,null,i(r.id),1)]),a.canEdit&&u(r)?(C(),l(`button`,{key:0,type:`button`,class:`cancel-run`,onClick:t(e=>o.$emit(`cancel-run`,r.id),[`stop`])},i(o.$t(`poivelle.run.cancel`)),9,qn)):s(``,!0)],10,Kn))),128)),a.runs.length?s(``,!0):(C(),l(`p`,Jn,i(o.$t(`poivelle.review.noRuns`)),1)),a.activeRun?(C(),l(`section`,Yn,[e(`header`,null,[e(`strong`,null,i(o.$t(`poivelle.review.runDetail`)),1),e(`span`,null,i(a.activeRun.attempts.length)+` `+i(o.$t(`poivelle.review.attempts`)),1)]),(C(!0),l(p,null,x(a.activeRun.steps,r=>(C(),l(`article`,{key:r.id,class:`step-item`},[e(`span`,{class:n([`run-state`,`state-${r.state}`])},null,2),e(`div`,null,[e(`strong`,null,i(r.operation),1),e(`small`,null,i(r.state)+` · `+i(r.node_id),1),h(r.id)?.error?(C(),l(`p`,Xn,i(h(r.id)?.error?.code??`provider_error`)+`: `+i(h(r.id)?.error?.message??o.$t(`poivelle.error.generic`)),1)):s(``,!0)]),a.canEdit&&[`failed`,`manual_recovery`].includes(r.state)?(C(),l(`button`,{key:0,type:`button`,class:`retry-step`,onClick:t(e=>o.$emit(`retry-step`,r),[`stop`])},i(o.$t(`poivelle.review.retryStep`)),9,Zn)):s(``,!0)]))),128))])):s(``,!0),m.value.length?(C(),l(`section`,Qn,[e(`strong`,null,i(o.$t(`poivelle.review.forensics`)),1),(C(!0),l(p,null,x(m.value,e=>(C(),l(`p`,{key:e.code},i(e.code)+` · `+i(String(e.actual??`—`))+` / `+i(String(e.expected??`—`)),1))),128))])):s(``,!0)])])]))}}),[[`__scopeId`,`data-v-e66361d5`]]),er={class:`inspector-panel`},tr={class:`inspector-heading`},nr={class:`field`},rr={class:`field`},ir=[`value`],ar={class:`field grow`},or={class:`node-meta`},sr={key:1,class:`empty-inspector`},cr=V(T({__name:`InspectorPanel`,props:{node:{}},emits:[`update`,`delete`],setup(t,{emit:n}){let a=t,s=n,u=w(``),f=w(``);h(()=>a.node,e=>{u.value=e?.title??``;let t=e?.payload.prompt??e?.payload.text??``;f.value=typeof t==`string`?t:``},{immediate:!0});let y=v(()=>a.node?a.node.node_type===`video`?z:a.node.node_type===`audio`?G:[`shot`,`scene`,`storyboard`].includes(a.node.node_type)?q:[`image`,`character`,`location`].includes(a.node.node_type)?F:a.node.node_type===`script`||a.node.node_type===`text`?M:oe:I),b=()=>{let e=u.value.trim();a.node&&e&&e!==a.node.title&&s(`update`,{path:`/title`,value:e})},x=()=>{if(!a.node)return;let e=a.node.payload.prompt===void 0?`text`:`prompt`;f.value!==a.node.payload[e]&&s(`update`,{path:`/payload/${e}`,value:f.value})};return(n,a)=>(C(),l(`aside`,er,[e(`div`,tr,[e(`div`,null,[e(`span`,null,i(n.$t(`poivelle.section.inspector`)),1),e(`strong`,null,i(t.node?.title||n.$t(`poivelle.inspector.noSelection`)),1)]),(C(),_(S(y.value),{size:18,"aria-hidden":`true`}))]),t.node?(C(),l(p,{key:0},[e(`label`,nr,[e(`span`,null,i(n.$t(`poivelle.field.title`)),1),g(e(`input`,{"onUpdate:modelValue":a[0]||=e=>u.value=e,type:`text`,onBlur:b,onKeydown:d(b,[`enter`])},null,544),[[m,u.value]])]),e(`label`,rr,[e(`span`,null,i(n.$t(`poivelle.field.type`)),1),e(`input`,{value:t.node.node_type,type:`text`,disabled:``},null,8,ir)]),e(`label`,ar,[e(`span`,null,i(n.$t(`poivelle.field.prompt`)),1),g(e(`textarea`,{"onUpdate:modelValue":a[1]||=e=>f.value=e,rows:`8`,onBlur:x},null,544),[[m,f.value]])]),e(`div`,or,[a[3]||=e(`span`,null,`NODE`,-1),e(`code`,null,i(t.node.id),1),a[4]||=e(`span`,null,`VERSION`,-1),e(`code`,null,i(t.node.version),1)]),e(`button`,{class:`danger-button`,type:`button`,onClick:a[2]||=e=>n.$emit(`delete`)},[o(c(ge),{size:14,"aria-hidden":`true`}),r(` `+i(n.$t(`poivelle.node.delete`)),1)])],64)):(C(),l(`div`,sr,[o(c(I),{size:24,"stroke-width":`1.4`}),e(`p`,null,i(n.$t(`poivelle.inspector.empty`)),1)]))]))}}),[[`__scopeId`,`data-v-7a6ae318`]]),lr={class:`agent-dock`},ur={class:`agent-identity`},dr={class:`proposal-strip`},fr=[`onClick`],pr={key:0},mr=[`disabled`],hr=V(T({__name:`AgentDock`,props:{proposals:{},selectedNodeId:{},skill:{},canEdit:{type:Boolean}},emits:[`run`,`open-proposal`],setup(t){let a=t,u=v(()=>a.proposals.filter(e=>e.state===`awaiting_approval`));return(a,d)=>(C(),l(`section`,lr,[e(`div`,ur,[o(c(Se),{size:16,"aria-hidden":`true`}),e(`div`,null,[e(`strong`,null,i(a.$t(`poivelle.agent.title`)),1),e(`span`,null,i(t.skill),1)])]),e(`div`,dr,[(C(!0),l(p,null,x(u.value,t=>(C(),l(`button`,{key:t.id,type:`button`,onClick:e=>a.$emit(`open-proposal`,t.id)},[e(`span`,{class:n([`risk-dot`,`risk-${t.risk_class}`])},null,2),e(`strong`,null,i(t.intent),1),e(`small`,null,i(t.state),1)],8,fr))),128)),u.value.length?s(``,!0):(C(),l(`p`,pr,i(a.$t(`poivelle.agent.noProposals`)),1))]),t.canEdit?(C(),l(`button`,{key:0,class:`agent-button`,type:`button`,disabled:!t.selectedNodeId,onClick:d[0]||=e=>a.$emit(`run`)},[o(c(R),{size:15,"aria-hidden":`true`}),r(` `+i(a.$t(`poivelle.agent.plan`)),1)],8,mr)):s(``,!0)]))}}),[[`__scopeId`,`data-v-81fac9f8`]]),gr={class:`project-guide`,"aria-labelledby":`project-guide-title`},_r={class:`guide-copy`},vr={id:`project-guide-title`},yr={class:`guide-body`},br={class:`project-facts`},xr={class:`guide-actions`},Sr=[`disabled`],Cr={class:`cost-note`},wr={class:`production-steps`},Tr={class:`done`},Er=[`value`,`max`],Dr=[`value`,`max`],Or=V(T({__name:`ProjectGuide`,props:{projectTitle:{},graph:{},storyboard:{},artifacts:{},takes:{},selections:{},canEdit:{type:Boolean},busy:{type:Boolean}},emits:[`generate-node`,`open-storyboard`],setup(t){let a=t,u=v(()=>a.storyboard?a.storyboard.sections.flatMap(e=>e.shots.flatMap(e=>e.image_node_ids)):a.graph.nodes.filter(e=>e.node_type===`image`).map(e=>e.id)),d=v(()=>a.storyboard?a.storyboard.sections.flatMap(e=>e.shots.flatMap(e=>e.video_node_ids)):a.graph.nodes.filter(e=>e.node_type===`video`).map(e=>e.id)),f=v(()=>new Set([...a.artifacts.filter(e=>e.state===`committed`).flatMap(e=>e.node_id??[]),...a.takes.filter(e=>e.state===`ready`).map(e=>e.target_node_id)])),p=v(()=>u.value.filter(e=>f.value.has(e)).length),m=v(()=>d.value.filter(e=>f.value.has(e)).length),h=v(()=>new Set(a.selections.map(e=>e.target_node_id))),g=v(()=>u.value.filter(e=>h.value.has(e)).length),y=v(()=>d.value.filter(e=>h.value.has(e)).length),b=v(()=>p.value===u.value.length&&g.value<u.value.length||m.value===d.value.length&&y.value<d.value.length),x=v(()=>a.graph.nodes.some(e=>e.node_type===`output`)),S=v(()=>{let e=new Set(a.graph.nodes.filter(e=>e.node_type===`output`).map(e=>e.id));return a.artifacts.some(t=>t.state===`committed`&&!!t.node_id&&e.has(t.node_id))}),w=v(()=>{let e=u.value.find(e=>!f.value.has(e));if(e)return a.graph.nodes.find(t=>t.id===e);if(g.value<u.value.length)return;let t=d.value.find(e=>!f.value.has(e));if(t)return a.graph.nodes.find(e=>e.id===t);if(!(y.value<d.value.length))return a.graph.nodes.find(e=>e.node_type===`audio`&&!f.value.has(e.id))}),T=v(()=>(a.storyboard?.sections.reduce((e,t)=>e+t.shots.length,0)??a.graph.nodes.filter(e=>e.node_type===`shot`).length)||d.value.length),E=v(()=>{let e=a.graph.nodes.find(e=>e.node_type===`script`),t=Number(e?.payload?.target_duration_seconds);return a.storyboard?.target_duration_seconds??(Number.isFinite(t)?t:40)}),D=v(()=>{let e=a.graph.nodes.find(e=>e.node_type===`script`);return String(e?.payload?.aspect_ratio??`16:9`)}),O=v(()=>w.value?.node_type===`image`?B(`poivelle.guide.generateFrame`,{current:p.value+1,total:u.value.length}):w.value?.node_type===`video`?B(`poivelle.guide.generateMotion`,{current:m.value+1,total:d.value.length}):B(`poivelle.guide.generateScore`));return(a,f)=>(C(),l(`section`,gr,[e(`div`,_r,[e(`p`,null,i(a.$t(`poivelle.guide.kicker`)),1),e(`h1`,vr,i(a.$t(`poivelle.guide.title`,{title:t.projectTitle})),1),e(`p`,yr,i(a.$t(`poivelle.guide.body`)),1),e(`dl`,br,[e(`div`,null,[e(`dt`,null,i(a.$t(`poivelle.guide.duration`)),1),e(`dd`,null,i(E.value)+`s`,1)]),e(`div`,null,[e(`dt`,null,i(a.$t(`poivelle.guide.shots`)),1),e(`dd`,null,i(T.value),1)]),e(`div`,null,[e(`dt`,null,i(a.$t(`poivelle.guide.format`)),1),e(`dd`,null,i(D.value),1)])]),e(`div`,xr,[w.value?(C(),l(`button`,{key:0,type:`button`,class:`primary-action`,disabled:!t.canEdit||t.busy,onClick:f[0]||=e=>a.$emit(`generate-node`,w.value.id)},[t.busy?(C(),_(c(fe),{key:0,size:17,class:`spinning`,"aria-hidden":`true`})):(C(),_(c(R),{key:1,size:17,"aria-hidden":`true`})),r(` `+i(O.value),1)],8,Sr)):(C(),l(`button`,{key:1,type:`button`,class:`primary-action`,onClick:f[1]||=e=>a.$emit(`open-storyboard`)},[o(c(q),{size:17,"aria-hidden":`true`}),r(` `+i(b.value?a.$t(`poivelle.guide.chooseResults`):a.$t(`poivelle.guide.reviewResults`)),1)])),e(`button`,{type:`button`,class:`secondary-action`,onClick:f[2]||=e=>a.$emit(`open-storyboard`)},[r(i(a.$t(`poivelle.guide.reviewPlan`))+` `,1),o(c(j),{size:15,"aria-hidden":`true`})])]),e(`p`,Cr,[o(c(Y),{size:14,"aria-hidden":`true`}),r(` `+i(a.$t(`poivelle.guide.costNote`)),1)])]),e(`ol`,wr,[e(`li`,Tr,[e(`span`,null,[o(c(se),{size:15,"aria-hidden":`true`})]),e(`div`,null,[e(`strong`,null,i(a.$t(`poivelle.guide.stepPlan`)),1),e(`p`,null,i(a.$t(`poivelle.guide.stepPlanBody`,{shots:T.value})),1)]),e(`small`,null,i(a.$t(`poivelle.guide.ready`)),1)]),e(`li`,{class:n({current:g.value<u.value.length,done:u.value.length>0&&g.value===u.value.length})},[f[3]||=e(`span`,null,`2`,-1),e(`div`,null,[e(`strong`,null,i(a.$t(`poivelle.guide.stepFrames`)),1),e(`p`,null,i(a.$t(`poivelle.guide.stepFramesBody`)),1),e(`progress`,{value:p.value,max:Math.max(u.value.length,1)},null,8,Er)]),e(`small`,null,i(p.value)+` `+i(a.$t(`poivelle.guide.generated`))+` · `+i(g.value)+` `+i(a.$t(`poivelle.guide.selected`)),1)],2),e(`li`,{class:n({current:g.value===u.value.length&&y.value<d.value.length,done:d.value.length>0&&y.value===d.value.length})},[f[4]||=e(`span`,null,`3`,-1),e(`div`,null,[e(`strong`,null,i(a.$t(`poivelle.guide.stepMotion`)),1),e(`p`,null,i(a.$t(`poivelle.guide.stepMotionBody`)),1),e(`progress`,{value:m.value,max:Math.max(d.value.length,1)},null,8,Dr)]),e(`small`,null,i(m.value)+` `+i(a.$t(`poivelle.guide.generated`))+` · `+i(y.value)+` `+i(a.$t(`poivelle.guide.selected`)),1)],2),x.value?(C(),l(`li`,{key:0,class:n({current:y.value===d.value.length&&!S.value,done:S.value})},[f[5]||=e(`span`,null,`4`,-1),e(`div`,null,[e(`strong`,null,i(a.$t(`poivelle.guide.stepMaster`)),1),e(`p`,null,i(a.$t(`poivelle.guide.stepMasterBody`)),1)]),e(`small`,null,i(S.value?a.$t(`poivelle.guide.ready`):a.$t(`poivelle.guide.waiting`)),1)],2)):s(``,!0)])]))}}),[[`__scopeId`,`data-v-86112731`]]),kr={class:`poivelle-studio`},Ar={key:0,class:`error-banner`},jr={key:1,class:`loading-state`},Mr={key:2,class:`studio-body`},Nr={class:`projection-workspace`},Pr={class:`projection-content`},Fr={key:3,class:`onboarding`},Ir={key:0,class:`dry-run-summary`},Lr={class:`dry-run-note`},Rr=V(T({__name:`StudioWorkspace`,emits:[`back-home`],setup(n){let d=ee(),m=v(()=>d.state.poivelle),h=v(()=>m.value?.workspaces??[]),g=v(()=>m.value?.projects??[]),b=v(()=>m.value?.graph),S=v(()=>m.value?.assets??[]),T=v(()=>m.value?.artifacts??[]),ie=v(()=>m.value?.takes??[]),j=v(()=>m.value?.selections??[]),ae=v(()=>m.value?.storyboard),oe=v(()=>m.value?.revisions??[]),se=v(()=>m.value?.proposals??[]),ce=v(()=>m.value?.runs??[]),le=v(()=>m.value?.activeRun),ue=v(()=>m.value?.evaluations??[]),de=v(()=>m.value?.forensicValidations??[]),M=v(()=>m.value?.costs),N=v(()=>m.value?.timeline),P=v(()=>m.value?.projection??`overview`),F=v(()=>m.value?.selectedNodeId),I=v(()=>b.value?.nodes.find(e=>e.id===F.value)),pe=v(()=>g.value.find(e=>e.id===m.value?.currentProjectId)),L=v(()=>[`owner`,`producer`,`director`,`editor`].includes(m.value?.currentMembership?.role??``)),he=v(()=>m.value?.dryRun),R=v(()=>m.value?.error),ge=v(()=>[m.value?.status?.bootstrap,m.value?.status?.graph].includes(te.Request)),ve=v(()=>new Set([...T.value.filter(e=>e.state===`committed`).flatMap(e=>e.node_id??[]),...ie.value.filter(e=>e.state===`ready`).map(e=>e.target_node_id)])),z=v(()=>new Set(j.value.map(e=>e.target_node_id))),V=v(()=>ae.value?ae.value.sections.flatMap(e=>e.shots.flatMap(e=>e.image_node_ids)):b.value?.nodes.filter(e=>e.node_type===`image`).map(e=>e.id)??[]),H=v(()=>ae.value?ae.value.sections.flatMap(e=>e.shots.flatMap(e=>e.video_node_ids)):b.value?.nodes.filter(e=>e.node_type===`video`).map(e=>e.id)??[]),xe=v(()=>V.value.length>0&&V.value.every(e=>ve.value.has(e))&&V.value.some(e=>!z.value.has(e))||H.value.length>0&&H.value.every(e=>ve.value.has(e))&&H.value.some(e=>!z.value.has(e))),G=v(()=>{let e=V.value.find(e=>!ve.value.has(e));if(e)return b.value?.nodes.find(t=>t.id===e);if(V.value.some(e=>!z.value.has(e)))return;let t=H.value.find(e=>!ve.value.has(e));if(t)return b.value?.nodes.find(e=>e.id===t);if(H.value.some(e=>!z.value.has(e)))return;let n=b.value?.nodes.find(e=>e.node_type===`audio`&&!ve.value.has(e.id));if(n)return n}),Se=v(()=>G.value?.node_type===`image`?B(`poivelle.guide.generateNextFrame`):G.value?.node_type===`video`?B(`poivelle.guide.generateNextMotion`):G.value?.node_type===`audio`?B(`poivelle.guide.generateScore`):B(`poivelle.guide.continue`)),K=w(!1),we=w(!1),J=w(!1),Te=w(!1),Ee=w(!1),De=w(!1),Y=f({name:``,monthly_limit_microcredits:void 0}),X=f({workspace_id:``,title:``,workflow:`blank`,skill:`film.drama.short@1.0.0`,product_name:``,product_category:`professional action imaging device`,brand_tone:`precise, fearless, cinematic, premium`,aspect_ratio:`16:9`}),Oe=[{label:B(`poivelle.project.blankWorkflow`),value:`blank`},{label:B(`poivelle.project.commercialTVC`),value:`commercial_tvc`}],Z=f({node_type:`scene`,title:``,prompt:``}),Q=f({title:``,kind:`image`,source_url:``,content_hash:``}),ke=[`script`,`character`,`location`,`prop`,`storyboard`,`scene`,`shot`,`image`,`video`,`audio`,`subtitle`,`composition`,`output`,`note`],Ae=[`character`,`location`,`prop`,`image`,`video`,`voice`,`music`,`sfx`,`brand`],je=()=>d.dispatch(`poivelle/bootstrap`),Me=e=>d.dispatch(`poivelle/loadProject`,e),Ne=e=>d.dispatch(`poivelle/selectNode`,e),Pe=e=>d.dispatch(`poivelle/setProjection`,e),Fe=()=>{X.workspace_id=m.value?.currentWorkspaceId??h.value[0]?.id??``,J.value=!0},Ie=async()=>{Y.name.trim()&&await $(async()=>{await d.dispatch(`poivelle/createWorkspace`,{...Y,name:Y.name.trim()}),we.value=!1,Fe()})},Le=async()=>{!X.workspace_id||!X.title.trim()||await $(async()=>{X.workflow===`commercial_tvc`?(await d.dispatch(`poivelle/createCommercialTVCProject`,{workspace_id:X.workspace_id,title:X.title.trim(),product_name:X.product_name.trim()||X.title.trim(),product_category:X.product_category.trim(),brand_tone:X.brand_tone.trim(),aspect_ratio:X.aspect_ratio,managed_execution:!1}),Pe(`storyboard`)):await d.dispatch(`poivelle/createProject`,{workspace_id:X.workspace_id,title:X.title.trim(),skill:X.skill,domain:`film.drama.short`}),J.value=!1,X.title=``})},Re=async()=>{Z.title.trim()&&await $(async()=>{await d.dispatch(`poivelle/createNode`,{node_type:Z.node_type,title:Z.title.trim(),payload:{prompt:Z.prompt}}),Te.value=!1,Z.title=``,Z.prompt=``})},ze=async()=>{!m.value?.currentWorkspaceId||!Q.title||!Q.source_url||!Q.content_hash||await $(async()=>{await d.dispatch(`poivelle/importAsset`,{...Q,project_id:m.value.currentProjectId}),Ee.value=!1})},Be=e=>d.dispatch(`poivelle/updateSelectedNode`,e),Ve=async()=>{await ye.confirm(B(`poivelle.node.deleteConfirm`),``,{type:`warning`}),await d.dispatch(`poivelle/deleteSelectedNode`)},He=async()=>{await d.dispatch(`poivelle/commitRevision`,`Studio checkpoint`),ne.success(B(`poivelle.revision.committed`))},Ue=async()=>{I.value&&await $(async()=>{await d.dispatch(`poivelle/dryRun`,I.value?.node_type===`composition`?`compose`:`generate`),De.value=!0})},We=async e=>{await Ne(e),await a(),await Ue()},Ge=async()=>{if(P.value===`overview`){G.value?await We(G.value.id):xe.value&&Pe(`storyboard`);return}I.value&&await Ue()},Ke=async()=>{await $(async()=>{let e=await d.dispatch(`poivelle/confirmDryRun`);De.value=!1,e&&ne.success(B(`poivelle.run.queued`))})},qe=e=>{Pe(`review`),ne.info(`${B(`poivelle.agent.proposal`)} ${e.slice(-8)}`)},Je=async e=>{await ye.confirm(B(`poivelle.review.rejectConfirm`),``,{type:`warning`}),await $(()=>d.dispatch(`poivelle/rejectProposal`,e))},Ye=async e=>{await ye.confirm(B(`poivelle.run.cancelConfirm`),``,{type:`warning`}),await $(()=>d.dispatch(`poivelle/cancelRun`,e))},Xe=e=>$(()=>d.dispatch(`poivelle/loadRun`,e)),Ze=async e=>{await $(async()=>{await d.dispatch(`poivelle/retryStep`,e),De.value=!0})},Qe=async e=>{if(!N.value)return;let t=N.value.clips.map(e=>({...e})),n=t.filter(t=>t.track_id===e.trackId).sort((e,t)=>e.timeline_start_ms-t.timeline_start_ms),r=n.findIndex(t=>t.id===e.clipId),i=r+e.direction;if(r<0||i<0||i>=n.length)return;[n[r],n[i]]=[n[i],n[r]];let a=0;n.forEach(e=>{let t=typeof e.speed==`number`&&Number.isFinite(e.speed)&&e.speed>0?e.speed:1;e.timeline_start_ms=a,a+=(e.source_out_ms-e.source_in_ms)/t}),await $(()=>d.dispatch(`poivelle/saveTimeline`,{...N.value,clips:t}))},$e=async e=>{await $(async()=>{await d.dispatch(`poivelle/selectTake`,e),ne.success(B(`poivelle.storyboard.selectionSaved`))})},et=e=>`${(e/1e6).toFixed(2)} credits`,$=async e=>{K.value=!0;try{await e()}catch(e){ne.error(e?.response?.data?.detail?.message??e?.response?.data?.detail??e?.message??B(`poivelle.error.generic`))}finally{K.value=!1}};return u(je),(n,a)=>(C(),l(`main`,kr,[o(gt,{"project-title":pe.value?.title,"graph-version":b.value?.graph_version,"can-run":L.value&&(P.value===`overview`?!!G.value||xe.value:!!I.value),"can-edit":L.value,"primary-label":P.value===`overview`?xe.value?n.$t(`poivelle.guide.chooseResults`):Se.value:void 0,onOpenProjects:a[0]||=e=>J.value=!0,onHome:a[1]||=e=>n.$emit(`back-home`),onCommit:He,onRun:Ge},null,8,[`project-title`,`graph-version`,`can-run`,`can-edit`,`primary-label`]),R.value?(C(),l(`div`,Ar,[o(c(_e),{size:15,"aria-hidden":`true`}),e(`span`,null,i(R.value),1),e(`button`,{type:`button`,onClick:je},i(n.$t(`poivelle.action.retry`)),1)])):s(``,!0),ge.value&&!b.value?(C(),l(`div`,jr,[o(c(fe),{size:25,class:`is-spinning`,"aria-hidden":`true`}),e(`span`,null,i(n.$t(`poivelle.status.loading`)),1)])):pe.value&&b.value?(C(),l(`div`,Mr,[P.value===`overview`?s(``,!0):(C(),_(Ft,{key:0,projects:g.value,"current-project-id":pe.value.id,assets:S.value,revisions:oe.value,"can-edit":L.value,onSelectProject:Me,onCreateProject:Fe,onImportAsset:a[2]||=e=>Ee.value=!0},null,8,[`projects`,`current-project-id`,`assets`,`revisions`,`can-edit`])),e(`section`,Nr,[o(Rt,{"model-value":P.value,"can-edit":L.value,"onUpdate:modelValue":Pe,onCreateNode:a[3]||=e=>Te.value=!0},null,8,[`model-value`,`can-edit`]),e(`div`,Pr,[P.value===`overview`?(C(),_(Or,{key:0,"project-title":pe.value.title,graph:b.value,storyboard:ae.value,artifacts:T.value,takes:ie.value,selections:j.value,"can-edit":L.value,busy:K.value,onGenerateNode:We,onOpenStoryboard:a[4]||=e=>Pe(`storyboard`)},null,8,[`project-title`,`graph`,`storyboard`,`artifacts`,`takes`,`selections`,`can-edit`,`busy`])):P.value===`canvas`?(C(),_(Kt,{key:1,graph:b.value,"selected-node-id":F.value,"can-edit":L.value,onSelectNode:Ne,onCreateNode:a[5]||=e=>Te.value=!0},null,8,[`graph`,`selected-node-id`,`can-edit`])):P.value===`storyboard`?(C(),_(hn,{key:2,graph:b.value,storyboard:ae.value,artifacts:T.value,takes:ie.value,selections:j.value,"selected-node-id":F.value,"can-edit":L.value,"can-select":L.value&&oe.value.length>0,onSelectNode:Ne,onSelectTake:$e},null,8,[`graph`,`storyboard`,`artifacts`,`takes`,`selections`,`selected-node-id`,`can-edit`,`can-select`])):P.value===`timeline`?(C(),_(Ln,{key:3,timeline:N.value,graph:b.value,artifacts:T.value,"can-edit":L.value,onMoveClip:Qe},null,8,[`timeline`,`graph`,`artifacts`,`can-edit`])):(C(),_($n,{key:4,graph:b.value,proposals:se.value,revisions:oe.value,runs:ce.value,"active-run":le.value,evaluations:ue.value,"forensic-validations":de.value,costs:M.value,"can-edit":L.value,onRejectProposal:Je,onCancelRun:Ye,onOpenRun:Xe,onRetryStep:Ze},null,8,[`graph`,`proposals`,`revisions`,`runs`,`active-run`,`evaluations`,`forensic-validations`,`costs`,`can-edit`]))]),P.value===`overview`?s(``,!0):(C(),_(hr,{key:0,proposals:se.value,"selected-node-id":F.value,skill:pe.value.active_skill,"can-edit":L.value,onRun:Ue,onOpenProposal:qe},null,8,[`proposals`,`selected-node-id`,`skill`,`can-edit`]))]),L.value&&P.value===`canvas`?(C(),_(cr,{key:1,node:I.value,onUpdate:Be,onDelete:Ve},null,8,[`node`])):s(``,!0)])):(C(),l(`section`,Fr,[a[38]||=e(`div`,{class:`onboarding-number`},`01 / STUDIO`,-1),o(c(Ce),{size:34,"stroke-width":`1.25`,"aria-hidden":`true`}),e(`h1`,null,i(n.$t(`poivelle.onboarding.title`)),1),e(`p`,null,i(n.$t(`poivelle.onboarding.body`)),1),h.value.length?L.value?(C(),l(`button`,{key:1,type:`button`,onClick:Fe},[o(c(q),{size:15,"aria-hidden":`true`}),r(` `+i(n.$t(`poivelle.project.create`)),1)])):s(``,!0):(C(),l(`button`,{key:0,type:`button`,onClick:a[6]||=e=>we.value=!0},[o(c(me),{size:15,"aria-hidden":`true`}),r(` `+i(n.$t(`poivelle.workspace.create`)),1)]))])),o(c(be),{modelValue:we.value,"onUpdate:modelValue":a[11]||=e=>we.value=e,title:n.$t(`poivelle.workspace.create`),width:`420px`},{footer:y(()=>[o(c(W),{onClick:a[10]||=e=>we.value=!1},{default:y(()=>[r(i(n.$t(`common.button.cancel`)),1)]),_:1}),o(c(W),{type:`primary`,loading:K.value,onClick:Ie},{default:y(()=>[r(i(n.$t(`common.button.confirm`)),1)]),_:1},8,[`loading`])]),default:y(()=>[o(c(k),{"label-position":`top`,onSubmit:a[9]||=t(()=>{},[`prevent`])},{default:y(()=>[o(c(O),{label:n.$t(`poivelle.workspace.name`)},{default:y(()=>[o(c(U),{modelValue:Y.name,"onUpdate:modelValue":a[7]||=e=>Y.name=e,maxlength:`120`,autofocus:``},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.workspace.budget`)},{default:y(()=>[o(c(A),{modelValue:Y.monthly_limit_microcredits,"onUpdate:modelValue":a[8]||=e=>Y.monthly_limit_microcredits=e,min:0,step:1e6},null,8,[`modelValue`])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`modelValue`,`title`]),o(c(be),{modelValue:J.value,"onUpdate:modelValue":a[22]||=e=>J.value=e,title:n.$t(`poivelle.project.create`),width:`460px`},{footer:y(()=>[o(c(W),{onClick:a[21]||=e=>J.value=!1},{default:y(()=>[r(i(n.$t(`common.button.cancel`)),1)]),_:1}),o(c(W),{type:`primary`,loading:K.value,onClick:Le},{default:y(()=>[r(i(n.$t(`common.button.confirm`)),1)]),_:1},8,[`loading`])]),default:y(()=>[o(c(k),{"label-position":`top`,onSubmit:a[20]||=t(()=>{},[`prevent`])},{default:y(()=>[o(c(O),{label:n.$t(`poivelle.project.workspace`)},{default:y(()=>[o(c(E),{modelValue:X.workspace_id,"onUpdate:modelValue":a[12]||=e=>X.workspace_id=e,style:{width:`100%`}},{default:y(()=>[(C(!0),l(p,null,x(h.value,e=>(C(),_(c(D),{key:e.id,label:e.name,value:e.id},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.project.title`)},{default:y(()=>[o(c(U),{modelValue:X.title,"onUpdate:modelValue":a[13]||=e=>X.title=e,maxlength:`200`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.project.workflow`)},{default:y(()=>[o(c(re),{modelValue:X.workflow,"onUpdate:modelValue":a[14]||=e=>X.workflow=e,options:Oe,block:``},null,8,[`modelValue`])]),_:1},8,[`label`]),X.workflow===`commercial_tvc`?(C(),l(p,{key:0},[o(c(O),{label:n.$t(`poivelle.project.productName`)},{default:y(()=>[o(c(U),{modelValue:X.product_name,"onUpdate:modelValue":a[15]||=e=>X.product_name=e,maxlength:`120`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.project.productCategory`)},{default:y(()=>[o(c(U),{modelValue:X.product_category,"onUpdate:modelValue":a[16]||=e=>X.product_category=e,maxlength:`180`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.project.brandTone`)},{default:y(()=>[o(c(U),{modelValue:X.brand_tone,"onUpdate:modelValue":a[17]||=e=>X.brand_tone=e,type:`textarea`,rows:2,maxlength:`240`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.project.aspectRatio`)},{default:y(()=>[o(c(re),{modelValue:X.aspect_ratio,"onUpdate:modelValue":a[18]||=e=>X.aspect_ratio=e,options:[`16:9`,`9:16`,`1:1`]},null,8,[`modelValue`])]),_:1},8,[`label`])],64)):s(``,!0),o(c(O),{label:n.$t(`poivelle.project.skill`)},{default:y(()=>[X.workflow===`blank`?(C(),_(c(E),{key:0,modelValue:X.skill,"onUpdate:modelValue":a[19]||=e=>X.skill=e,style:{width:`100%`}},{default:y(()=>[o(c(D),{label:`Short drama · professional`,value:`film.drama.short@1.0.0`}),o(c(D),{label:`Commercial film · professional`,value:`film.commercial@1.0.0`}),o(c(D),{label:`Music video · professional`,value:`film.music-video@1.0.0`})]),_:1},8,[`modelValue`])):s(``,!0)]),_:1},8,[`label`])]),_:1})]),_:1},8,[`modelValue`,`title`]),o(c(be),{modelValue:Te.value,"onUpdate:modelValue":a[28]||=e=>Te.value=e,title:n.$t(`poivelle.node.create`),width:`460px`},{footer:y(()=>[o(c(W),{onClick:a[27]||=e=>Te.value=!1},{default:y(()=>[r(i(n.$t(`common.button.cancel`)),1)]),_:1}),o(c(W),{type:`primary`,loading:K.value,onClick:Re},{default:y(()=>[r(i(n.$t(`common.button.confirm`)),1)]),_:1},8,[`loading`])]),default:y(()=>[o(c(k),{"label-position":`top`,onSubmit:a[26]||=t(()=>{},[`prevent`])},{default:y(()=>[o(c(O),{label:n.$t(`poivelle.field.type`)},{default:y(()=>[o(c(E),{modelValue:Z.node_type,"onUpdate:modelValue":a[23]||=e=>Z.node_type=e,style:{width:`100%`}},{default:y(()=>[(C(),l(p,null,x(ke,e=>o(c(D),{key:e,label:e,value:e},null,8,[`label`,`value`])),64))]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.field.title`)},{default:y(()=>[o(c(U),{modelValue:Z.title,"onUpdate:modelValue":a[24]||=e=>Z.title=e,maxlength:`240`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.field.prompt`)},{default:y(()=>[o(c(U),{modelValue:Z.prompt,"onUpdate:modelValue":a[25]||=e=>Z.prompt=e,type:`textarea`,rows:5},null,8,[`modelValue`])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`modelValue`,`title`]),o(c(be),{modelValue:Ee.value,"onUpdate:modelValue":a[35]||=e=>Ee.value=e,title:n.$t(`poivelle.asset.import`),width:`500px`},{footer:y(()=>[o(c(W),{onClick:a[34]||=e=>Ee.value=!1},{default:y(()=>[r(i(n.$t(`common.button.cancel`)),1)]),_:1}),o(c(W),{type:`primary`,loading:K.value,onClick:ze},{default:y(()=>[r(i(n.$t(`common.button.confirm`)),1)]),_:1},8,[`loading`])]),default:y(()=>[o(c(k),{"label-position":`top`,onSubmit:a[33]||=t(()=>{},[`prevent`])},{default:y(()=>[o(c(O),{label:n.$t(`poivelle.asset.title`)},{default:y(()=>[o(c(U),{modelValue:Q.title,"onUpdate:modelValue":a[29]||=e=>Q.title=e,maxlength:`240`},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.field.type`)},{default:y(()=>[o(c(E),{modelValue:Q.kind,"onUpdate:modelValue":a[30]||=e=>Q.kind=e,style:{width:`100%`}},{default:y(()=>[(C(),l(p,null,x(Ae,e=>o(c(D),{key:e,label:e,value:e},null,8,[`label`,`value`])),64))]),_:1},8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.asset.url`)},{default:y(()=>[o(c(U),{modelValue:Q.source_url,"onUpdate:modelValue":a[31]||=e=>Q.source_url=e},null,8,[`modelValue`])]),_:1},8,[`label`]),o(c(O),{label:n.$t(`poivelle.asset.hash`)},{default:y(()=>[o(c(U),{modelValue:Q.content_hash,"onUpdate:modelValue":a[32]||=e=>Q.content_hash=e,placeholder:`sha256:...`},null,8,[`modelValue`])]),_:1},8,[`label`])]),_:1})]),_:1},8,[`modelValue`,`title`]),o(c(be),{modelValue:De.value,"onUpdate:modelValue":a[37]||=e=>De.value=e,title:n.$t(`poivelle.run.confirmTitle`),width:`520px`},{footer:y(()=>[o(c(W),{onClick:a[36]||=e=>De.value=!1},{default:y(()=>[r(i(n.$t(`common.button.cancel`)),1)]),_:1}),o(c(W),{type:`primary`,loading:K.value,onClick:Ke},{default:y(()=>[r(i(n.$t(`poivelle.run.confirm`)),1)]),_:1},8,[`loading`])]),default:y(()=>[he.value?(C(),l(`div`,Ir,[e(`div`,null,[e(`span`,null,i(n.$t(`poivelle.run.targets`)),1),e(`strong`,null,i(he.value.dependency_closure.length),1)]),e(`div`,null,[e(`span`,null,i(n.$t(`poivelle.run.maximum`)),1),e(`strong`,null,i(et(he.value.max_cost_microcredits)),1)]),e(`div`,null,[e(`span`,null,i(n.$t(`poivelle.run.approval`)),1),e(`strong`,null,i(he.value.required_approval),1)])])):s(``,!0),e(`p`,Lr,i(n.$t(`poivelle.run.confirmBody`)),1)]),_:1},8,[`modelValue`,`title`])]))}}),[[`__scopeId`,`data-v-1b367de3`]]),zr=T({__name:`Index`,setup(e){let t=w(`discovery`);return(e,n)=>t.value===`discovery`?(C(),_(ot,{key:0,onOpenStudio:n[0]||=e=>t.value=`studio`})):(C(),_(Rr,{key:1,onBackHome:n[1]||=e=>t.value=`discovery`}))}});export{zr 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,P as c,T as l,at as u,ht as d,it as f,j as p,mt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-D2uv1cbt.js";import{t as x}from"./upload-C_YrWWV5.js";import{t as S}from"./tooltip-b_dQsMp2.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-DGI43qxx.js";import{n as E,r as D}from"./radio-BNhFzeBO.js";import{n as O,t as k}from"./collapse-0WRpvPa2.js";import{t as A}from"./drawer-DiMGL-ON.js";import{t as j}from"./input-number-Djsi0Vju.js";import{t as M}from"./progress-BuyYfFZn.js";import{t as N}from"./clock-CIt1oE3U.js";import{a as ee,i as P,n as te,o as ne,r as re,s as ie,t as ae}from"./pagination-Cjli_PVC.js";import{t as oe}from"./info-DTb1_1Yi.js";import{t as se}from"./music-2-CXSc24qt.js";import{t as ce}from"./plus-BeTeDkfL.js";import{t as F}from"./trash-2-DE5mDXQJ.js";import{t as I}from"./triangle-alert-k9eV3S4u.js";import{t as le}from"./upload-DcGdzIA8.js";import{t as ue}from"./user-kwcck43C.js";import{t as de}from"./video-DBacGDok.js";import{t as L}from"./wand-sparkles-BEDgmNQE.js";import{Gr as fe,Hr as pe,Jr as me,Ur as R,Wr as he,Yr as ge}from"./constants-CiMGQy1r.js";import{A as z,Ba as _e,Cn as ve,Dr as B,Er as ye,Ha as be,O as xe,Tr as V,Vi as H,Wa as U,Ya as Se,at as Ce,ca as we,ct as Te,ea as Ee,et as De,fo as Oe,io as W,it as ke,ot as Ae,pi as G,st as je,ui as K,zi as q}from"./index-4v6EkWvr.js";import{t as Me}from"./CopyToClipboard-DAyi_3OQ.js";import{t as Ne}from"./ReportButton-DalKc7i7.js";import{t as J}from"./ImagePreview-B9s8J01K.js";import{n as Pe}from"./taskDrawerMixin-DyAUhFEq.js";import{n as Fe,t as Ie}from"./ServicePricingSummary-D39Eh-NT.js";import{t as Y}from"./AudioPreview-CTkYCaUg.js";import{t as Le}from"./VideoPlayer-CVXvO7ac.js";import{t as X}from"./VideoPreview-CaYgutzc.js";import{t as Re}from"./ScenarioPaymentMode-4_9JDWFN.js";import{t as ze}from"./ApiCodeButton-CPGhOLiu.js";import{t as Be}from"./BotPlaceholder-rtyV1S5S.js";import{t as Ve}from"./taskPollingMixin-CcLxtz8z.js";var He=v({name:`LayoutDigitalHuman`,components:{UserIcon:ue,ElDrawer:A,ElButton:W},mixins:[Pe]}),Ue={class:`main flex flex-row flex-1`},We={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)]`},Ge={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ke(t,n,r,i,o,c){let l=u(`user-icon`),p=u(`el-button`),h=u(`el-drawer`);return g(),s(`div`,Ue,[e(`div`,We,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ge,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var qe=z(He,[[`render`,Ke],[`__scopeId`,`data-v-909c6359`]]),Je=v({name:`DigitalHumanMediaInput`,components:{AudioPreview:Y,CloseIcon:be,ElButton:W,ElProgress:M,ElUpload:x,ImagePreview:J,MusicIcon:se,UploadIcon:le,VideoIcon:de,VideoPreview:X},mixins:[Te,je,Ce,De],props:{kind:{type:String,required:!0},accept:{type:String,default:``},buttonText:{type:String,default:``},hint:{type:String,default:``}},emits:[`change`],data(){return{fileList:[],uploadUrl:_e()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},hasFile(){return this.fileList.length>0}},methods:{uploadedUrl(e){return e?.response?.file_url},isPending(e){return e.status===`ready`||e.status===`uploading`},onExceed(e){let t=this.$refs.uploader;t?.clearFiles();let n=e[0];n&&(t?.handleStart?.(n),t?.submit?.())},onError(){T.error(this.$t(`digitalhuman.message.uploadError`))},onRemoveFile(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onChange()},onChange(){let e=this.fileList?.[0];this.$emit(`change`,e?this.uploadedUrl(e):void 0)}}}),Ye={class:`thumb`},Xe={key:2,class:`placeholder`},Ze=[`title`],Qe=[`aria-label`,`title`,`onClick`],$e={key:0,class:`hint`};function et(c,d,f,h,_,v){let y=u(`image-preview`),b=u(`video-preview`),x=u(`audio-preview`),S=u(`el-progress`),C=u(`video-icon`),w=u(`music-icon`),T=u(`close-icon`),E=u(`upload-icon`),D=u(`el-button`),O=u(`el-upload`);return g(),p(O,{ref:`uploader`,"file-list":c.fileList,"onUpdate:fileList":d[0]||=e=>c.fileList=e,accept:c.accept,name:`file`,class:`media-input`,limit:1,multiple:!1,"before-upload":c.beforeUploadSizeGuard,action:c.uploadUrl,headers:c.headers,"on-exceed":c.onExceed,"on-error":c.onError,"on-success":c.onChange,"on-remove":c.onChange},{file:m(({file:r})=>[e(`div`,{class:n([`slot`,{pending:c.isPending(r)}])},[c.kind===`image`&&r.url?(g(),p(y,{key:0,url:r.url,name:r.name,percentage:r.percentage,onRemove:e=>c.onRemoveFile(r)},null,8,[`url`,`name`,`percentage`,`onRemove`])):(g(),s(l,{key:1},[e(`div`,Ye,[c.kind===`video`&&c.uploadedUrl(r)?(g(),p(b,{key:0,url:c.uploadedUrl(r)},null,8,[`url`])):c.kind===`audio`&&c.uploadedUrl(r)?(g(),p(x,{key:1,url:c.uploadedUrl(r)},null,8,[`url`])):(g(),s(`div`,Xe,[c.isPending(r)?(g(),p(S,{key:0,type:`circle`,"stroke-width":4,percentage:Math.round(r.percentage||0),width:34},null,8,[`percentage`])):c.kind===`video`?(g(),p(C,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),p(w,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]))]),e(`span`,{class:`filename`,title:r.name},i(r.name),9,Ze),e(`button`,{type:`button`,class:`remove`,"aria-label":c.$t(`common.button.close`),title:c.$t(`common.button.close`),onClick:t(e=>c.onRemoveFile(r),[`stop`])},[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Qe)],64))],2)]),default:m(()=>[a(D,{round:``,type:`primary`,size:`small`,class:`btn`},{default:m(()=>[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.hasFile?c.$t(`digitalhuman.button.replace`):c.buttonText),1)]),_:1}),c.hint?(g(),s(`p`,$e,i(c.hint),1)):o(``,!0)]),_:1},8,[`file-list`,`accept`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`])}var Z=z(Je,[[`render`,et],[`__scopeId`,`data-v-db0590a9`]]),tt=20,Q=e=>{let t=e;return!!t&&typeof t.voice_id==`string`&&!!t.voice_id&&typeof t.name==`string`},$=()=>{try{let e=JSON.parse(localStorage.getItem(`digitalhuman.voices`)||`[]`);return Array.isArray(e)?e.filter(Q).map(e=>({voice_id:e.voice_id,name:e.name,lang:typeof e.lang==`string`?e.lang:`zh`,created_at:typeof e.created_at==`number`?e.created_at:0})):[]}catch{return[]}},nt=e=>{try{localStorage.setItem(ge,JSON.stringify(e))}catch{}return e},rt=e=>Q(e)?nt([e,...$().filter(t=>t.voice_id!==e.voice_id)].slice(0,tt)):$(),it=e=>nt($().filter(t=>t.voice_id!==e)),at=e=>`${e} ${$().length+1}`,ot=3e3,st=60,ct=v({name:`DigitalHumanVoiceCloneDialog`,components:{Consumption:Fe,ElAlert:C,ElButton:W,ElDialog:Se,ElInput:Oe,ElRadioButton:E,ElRadioGroup:D,MediaInput:Z},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`,`cloned`],data(){return{sampleUrl:void 0,name:``,lang:`zh`,cloning:!1,destroyed:!1,runId:0,DIGITALHUMAN_AUDIO_ACCEPT:R,DIGITALHUMAN_VOICE_CLONE_CONSUMPTION:2,voiceQuoteUsdc:void 0,voiceQuoteLoading:!1,quoteRunId:0}},computed:{service(){return this.$store.state.digitalhuman?.service},credentialToken(){return this.$store.state.digitalhuman?.credential?.token},walletMode(){return q()&&H(`digitalhuman`).mode===`wallet`},langOptions(){return pe.map(e=>({value:e,label:this.$t(`digitalhuman.name.lang_${e}`)}))}},watch:{walletMode(e){this.voiceQuoteUsdc=void 0,e&&this.visible&&this.sampleUrl&&this.refreshVoiceQuote()},visible(e){e?(this.sampleUrl=void 0,this.name=at(this.$t(`digitalhuman.name.myVoice`)),this.lang=`zh`):(this.runId++,this.quoteRunId++,this.cloning=!1,this.voiceQuoteLoading=!1)}},beforeUnmount(){this.destroyed=!0,this.runId++,this.quoteRunId++},methods:{onVisible(e){this.cloning&&!e||this.$emit(`update:visible`,e)},onSampleChange(e){this.sampleUrl=e,this.voiceQuoteUsdc=void 0,e&&this.walletMode&&this.refreshVoiceQuote()},isStale(e){return this.destroyed||e!==this.runId},sleep(e){return new Promise(t=>setTimeout(t,e))},async refreshVoiceQuote(){if(!this.sampleUrl)return;let e=++this.quoteRunId;this.voiceQuoteLoading=!0;try{let t=await B.quoteVoice(this.voiceRequest());e===this.quoteRunId&&this.walletMode&&(this.voiceQuoteUsdc=t.amountUsdc)}catch(e){console.warn(`x402 voice quote failed`,e)}finally{e===this.quoteRunId&&(this.voiceQuoteLoading=!1)}},voiceRequest(){return ye({audio_url:this.sampleUrl||``,lang:this.lang,name:this.name||void 0})},paymentOptions(){if(!this.walletMode)return this.credentialToken?{token:this.credentialToken}:void 0;let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credentialToken}}},async onClone(){if(!this.sampleUrl)return;let e=this.paymentOptions();if(!e)return;let t=++this.runId;this.cloning=!0;try{let{data:n}=await B.cloneVoice(this.voiceRequest(),e);if(this.isStale(t))return;if(n?.voice_id){this.onCloned(n.voice_id);return}if(n?.task_id)await this.pollVoice(n.task_id,t);else throw Error(`no task`)}catch(e){if(e instanceof K)return;this.isStale(t)||T.error(this.$t(`digitalhuman.message.voiceCloneFailed`))}finally{this.isStale(t)||(this.cloning=!1)}},async pollVoice(e,t){for(let n=0;n<st;n++){if(this.isStale(t)||(await this.sleep(ot),this.isStale(t)))return;let n=this.credentialToken,{data:r}=await B.pollTask(e,n?{token:n}:{mode:`x402`});if(this.isStale(t))return;if(r?.voice_id){this.onCloned(r.voice_id);return}if(r?.state===`failed`)throw Error(`clone failed`)}throw Error(`timeout`)},getWalletContext(){return G(this.$wallet)},async confirmWalletPayment(e){return U.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},onCloned(e){rt({voice_id:e,name:this.name||this.$t(`digitalhuman.name.myVoice`),lang:this.lang,created_at:Date.now()/1e3}),T.success(this.$t(`digitalhuman.message.voiceCloneSuccess`)),this.cloning=!1,this.$emit(`cloned`,e),this.$emit(`update:visible`,!1)}}}),lt={class:`text-xs text-[var(--el-text-color-secondary)] mb-3`},ut={class:`field mb-3`},dt={class:`label`},ft={class:`field`},pt={class:`label`},mt={class:`text-xs mb-0`},ht={key:1,class:`mt-4 text-xs text-[var(--el-text-color-secondary)]`},gt={class:`footer`},_t={key:0,class:`cost text-xs text-[var(--el-text-color-secondary)]`};function vt(t,n,o,c,d,f){let _=u(`media-input`),v=u(`el-input`),y=u(`el-radio-button`),b=u(`el-radio-group`),x=u(`el-alert`),S=u(`consumption`),C=u(`el-button`),w=u(`el-dialog`);return g(),p(w,{"model-value":t.visible,title:t.$t(`digitalhuman.name.cloneVoice`),width:`440`,"align-center":``,"append-to-body":``,"close-on-click-modal":!t.cloning,"close-on-press-escape":!t.cloning,"onUpdate:modelValue":t.onVisible},{footer:m(()=>[e(`div`,gt,[t.walletMode?(g(),s(`span`,_t,i(t.voiceQuoteLoading?`…`:t.voiceQuoteUsdc?`${t.voiceQuoteUsdc} USDC`:t.$t(`common.x402Scenario.quoteBeforeSigning`)),1)):(g(),p(S,{key:1,value:t.DIGITALHUMAN_VOICE_CLONE_CONSUMPTION,service:t.service,class:`cost`},null,8,[`value`,`service`])),e(`div`,null,[a(C,{disabled:t.cloning,onClick:n[2]||=e=>t.onVisible(!1)},{default:m(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`]),a(C,{type:`primary`,loading:t.cloning,disabled:!t.sampleUrl||t.cloning,onClick:t.onClone},{default:m(()=>[r(i(t.$t(`digitalhuman.button.startClone`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])]),default:m(()=>[e(`p`,lt,i(t.$t(`digitalhuman.message.voiceCloneHint`)),1),a(_,{kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSample`),hint:t.$t(`digitalhuman.message.audioHint`),class:`mb-4`,onChange:t.onSampleChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]),e(`div`,ut,[e(`span`,dt,i(t.$t(`digitalhuman.name.voiceName`)),1),a(v,{modelValue:t.name,"onUpdate:modelValue":n[0]||=e=>t.name=e,class:`control`,placeholder:t.$t(`digitalhuman.placeholder.voiceName`)},null,8,[`modelValue`,`placeholder`])]),e(`div`,ft,[e(`span`,pt,i(t.$t(`digitalhuman.name.voiceLang`)),1),a(b,{modelValue:t.lang,"onUpdate:modelValue":n[1]||=e=>t.lang=e,class:`control`},{default:m(()=>[(g(!0),s(l,null,h(t.langOptions,e=>(g(),p(y,{key:e.value,value:e.value},{default:m(()=>[r(i(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`])]),t.cloning?(g(),p(x,{key:0,closable:!1,type:`info`,class:`mt-4`},{default:m(()=>[e(`p`,mt,i(t.$t(`digitalhuman.message.voiceCloneRunning`)),1)]),_:1})):(g(),s(`p`,ht,i(t.$t(`digitalhuman.message.voiceStoredLocally`)),1))]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`onUpdate:modelValue`])}var yt=v({name:`DigitalHumanTimbreSelector`,components:{AddIcon:ce,DeleteIcon:F,ElButton:W,ElOption:b,ElSelect:y,VoiceCloneDialog:z(ct,[[`render`,vt],[`__scopeId`,`data-v-037c810e`]])},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{voices:$(),dialogVisible:!1}},mounted(){this.modelValue&&!this.voices.some(e=>e.voice_id===this.modelValue)&&this.$emit(`update:modelValue`,void 0)},methods:{labelFor(e){let t=this.$t(`digitalhuman.name.lang_${e.lang}`);return t.startsWith(`digitalhuman.`)?e.name:`${e.name} · ${t}`},onCloned(e){this.voices=$(),this.$emit(`update:modelValue`,e)},onRemove(e){this.voices=it(e),this.modelValue===e&&this.$emit(`update:modelValue`,void 0)}}}),bt={class:`row`},xt={class:`label`},St={class:`option`},Ct={class:`option-name`},wt=[`aria-label`,`title`,`onClick`],Tt={class:`empty`};function Et(n,o,d,f,_,v){let y=u(`delete-icon`),b=u(`el-option`),x=u(`el-select`),S=u(`add-icon`),C=u(`el-button`),w=u(`voice-clone-dialog`);return g(),s(`div`,null,[e(`div`,bt,[e(`span`,xt,i(n.$t(`digitalhuman.name.timbre`)),1),a(x,{"model-value":n.modelValue,class:`control`,placeholder:n.$t(`digitalhuman.placeholder.pickTimbre`),"onUpdate:modelValue":o[0]||=e=>n.$emit(`update:modelValue`,e)},c({default:m(()=>[(g(!0),s(l,null,h(n.voices,r=>(g(),p(b,{key:r.voice_id,label:n.labelFor(r),value:r.voice_id},{default:m(()=>[e(`span`,St,[e(`span`,Ct,i(n.labelFor(r)),1),e(`button`,{type:`button`,class:`option-remove`,"aria-label":n.$t(`common.button.delete`),title:n.$t(`common.button.delete`),onClick:t(e=>n.onRemove(r.voice_id),[`stop`])},[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)])]),_:2},1032,[`label`,`value`]))),128))]),_:2},[n.voices.length===0?{name:`empty`,fn:m(()=>[e(`p`,Tt,i(n.$t(`digitalhuman.message.noVoiceYet`)),1)]),key:`0`}:void 0]),1032,[`model-value`,`placeholder`])]),a(C,{size:`small`,text:``,type:`primary`,class:`clone`,onClick:o[1]||=e=>n.dialogVisible=!0},{default:m(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.button.cloneNewVoice`)),1)]),_:1}),a(w,{visible:n.dialogVisible,"onUpdate:visible":o[2]||=e=>n.dialogVisible=e,onCloned:n.onCloned},null,8,[`visible`,`onCloned`])])}var Dt=v({name:`ConfigPanel`,components:{ServicePricingSummary:Ie,ElButton:W,ElCollapse:k,ElCollapseItem:O,ElInputNumber:j,ElRadioButton:E,ElRadioGroup:D,InfoIcon:ee,MagicIcon:L,MediaInput:Z,PromptTextarea:P,TimbreSelector:z(yt,[[`render`,Et],[`__scopeId`,`data-v-e191cc56`]]),WarningIcon:I,ScenarioPaymentMode:Re},emits:[`generate`],data(){return{faceMode:`video`,voiceMode:`text`,advancedOpen:[],DIGITALHUMAN_VIDEO_ACCEPT:me,DIGITALHUMAN_IMAGE_ACCEPT:fe,DIGITALHUMAN_AUDIO_ACCEPT:R,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.digitalhuman?.config},service(){return this.$store.state.digitalhuman?.service},consumption(){return ve(this.config,this.service?.cost)},missing(){let e=[];return(this.faceMode===`video`?this.config?.video_url:this.config?.image_url)||e.push({key:`face`,message:this.$t(`digitalhuman.message.missingFace`)}),this.voiceMode===`text`?(this.config?.text?.trim()||e.push({key:`text`,message:this.$t(`digitalhuman.message.missingText`)}),this.config?.voice_id||e.push({key:`timbre`,message:this.$t(`digitalhuman.message.missingTimbre`)})):this.config?.audio_url||e.push({key:`audio`,message:this.$t(`digitalhuman.message.missingAudio`)}),e},text:{get(){return this.config?.text},set(e){this.update({text:e})}},voiceId:{get(){return this.config?.voice_id},set(e){this.update({voice_id:e})}},speed:{get(){return this.config?.speed??1},set(e){this.update({speed:e})}},walletMode(){return q()&&H(`digitalhuman`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0},faceMode(){this.walletMode&&this.scheduleQuote()},voiceMode(){this.walletMode&&this.scheduleQuote()}},mounted(){this.config?.image_url&&!this.config?.video_url&&(this.faceMode=`photo`),this.config?.audio_url&&(this.voiceMode=`audio`)},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=H(`digitalhuman`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=V(this.config,this.faceMode,this.voiceMode),r=await B.quote(n);t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=r.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},isMissing(e){return this.missing.some(t=>t.key===e)},update(e){this.$store.commit(`digitalhuman/setConfig`,{...this.config,...e})},onFaceModeChange(e){this.update(e===`video`?{image_url:void 0}:{video_url:void 0})},onVoiceModeChange(e){this.update(e===`audio`?{text:void 0,voice_id:void 0}:{audio_url:void 0})},onFaceVideoChange(e){this.update({video_url:e})},onFacePhotoChange(e){this.update({image_url:e})},onAudioChange(e){this.update({audio_url:e})},onGenerate(){let e=this.missing[0];if(e){T.warning(e.message);let t=e.key===`face`?`face`:`voice`;this.$refs[t]?.scrollIntoView?.({behavior:`smooth`,block:`center`});return}this.$emit(`generate`,V(this.config,this.faceMode,this.voiceMode))}}}),Ot={class:`flex flex-col h-full`},kt={class:`flex-1 overflow-y-auto p-5`},At={ref:`face`,class:`field-block mb-6`},jt={class:`field-head`},Mt={class:`field-title font-bold`},Nt={key:0,class:`required-badge`},Pt={ref:`voice`,class:`field-block mb-6`},Ft={class:`field-head`},It={class:`field-title font-bold`},Lt={key:0,class:`required-badge`},Rt={class:`field-row`},zt={class:`field-head`},Bt={class:`field-title font-bold`},Vt={class:`flex flex-col items-center justify-center px-5 pb-5`},Ht={key:0,class:`hint-missing`},Ut={class:`hint-eta`};function Wt(t,n,c,d,f,h){let _=u(`info-icon`),v=u(`el-radio-button`),y=u(`el-radio-group`),b=u(`media-input`),x=u(`prompt-textarea`),S=u(`timbre-selector`),C=u(`el-input-number`),w=u(`el-collapse-item`),T=u(`el-collapse`),E=u(`warning-icon`),D=u(`scenario-payment-mode`),O=u(`service-pricing-summary`),k=u(`magic-icon`),A=u(`el-button`);return g(),s(`div`,Ot,[e(`div`,kt,[e(`section`,At,[e(`div`,jt,[e(`h2`,Mt,i(t.$t(`digitalhuman.name.step1`)),1),t.isMissing(`face`)?(g(),s(`span`,Nt,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step1`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.faceMode,"onUpdate:modelValue":n[0]||=e=>t.faceMode=e,class:`mode-switch mb-3`,onChange:t.onFaceModeChange},{default:m(()=>[a(v,{value:`video`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModeVideo`)),1)]),_:1}),a(v,{value:`photo`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModePhoto`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.faceMode===`video`?(g(),p(b,{key:0,kind:`video`,accept:t.DIGITALHUMAN_VIDEO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFaceVideo`),hint:t.$t(`digitalhuman.message.faceVideoHint`),onChange:t.onFaceVideoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`])):(g(),p(b,{key:1,kind:`image`,accept:t.DIGITALHUMAN_IMAGE_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFacePhoto`),hint:t.$t(`digitalhuman.message.facePhotoHint`),onChange:t.onFacePhotoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),e(`section`,Pt,[e(`div`,Ft,[e(`h2`,It,i(t.$t(`digitalhuman.name.step2`)),1),t.isMissing(`text`)||t.isMissing(`timbre`)||t.isMissing(`audio`)?(g(),s(`span`,Lt,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step2`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.voiceMode,"onUpdate:modelValue":n[1]||=e=>t.voiceMode=e,class:`mode-switch mb-3`,onChange:t.onVoiceModeChange},{default:m(()=>[a(v,{value:`text`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeText`)),1)]),_:1}),a(v,{value:`audio`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeAudio`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.voiceMode===`text`?(g(),s(l,{key:0},[a(x,{modelValue:t.text,"onUpdate:modelValue":n[2]||=e=>t.text=e,class:`mb-3`,title:t.$t(`digitalhuman.name.speech`),placeholder:t.$t(`digitalhuman.placeholder.speech`),"min-rows":5,"max-rows":14},null,8,[`modelValue`,`title`,`placeholder`]),a(S,{modelValue:t.voiceId,"onUpdate:modelValue":n[3]||=e=>t.voiceId=e},null,8,[`modelValue`])],64)):(g(),p(b,{key:1,kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSpeechAudio`),hint:t.$t(`digitalhuman.message.audioHint`),onChange:t.onAudioChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),a(T,{modelValue:t.advancedOpen,"onUpdate:modelValue":n[5]||=e=>t.advancedOpen=e,class:`advanced`},{default:m(()=>[a(w,{name:`advanced`,title:t.$t(`digitalhuman.name.advanced`)},{default:m(()=>[e(`div`,Rt,[e(`div`,zt,[e(`h2`,Bt,i(t.$t(`digitalhuman.name.speed`)),1),a(_,{content:t.$t(`digitalhuman.description.speed`),class:`ml-1`},null,8,[`content`])]),a(C,{modelValue:t.speed,"onUpdate:modelValue":n[4]||=e=>t.speed=e,class:`field-control`,min:.5,max:2,step:.1,precision:1,"controls-position":`right`},null,8,[`modelValue`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])]),e(`div`,Vt,[t.missing.length>0?(g(),s(`p`,Ht,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.missing[0].message),1)])):o(``,!0),a(D,{scenario:`digitalhuman`}),t.walletMode?o(``,!0):(g(),p(O,{key:1,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:m(()=>[a(k,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`digitalhuman.button.generateVideo`)),1)]),_:1},8,[`onClick`]),e(`p`,Ut,i(t.$t(`digitalhuman.message.eta`)),1)])])}var Gt=z(Dt,[[`render`,Wt],[`__scopeId`,`data-v-0b652d94`]]),Kt=[`.jpg`,`.jpeg`,`.png`,`.webp`,`.bmp`,`.gif`],qt=v({name:`TaskPreview`,components:{ApiCodeButton:ze,AudioPreview:Y,ChannelIcon:ie,CopyToClipboard:Me,DeleteIcon:F,ElAlert:C,ElButton:W,ElProgress:M,ElTooltip:S,FullscreenIcon:ne,ImagePreview:J,InfoIcon:oe,MagicIcon:L,ReportButton:Ne,TimeIcon:N,VideoPlayer:Le,VideoPreview:X,WarningIcon:I},props:{modelValue:{type:Object,required:!0}},computed:{status(){return this.modelValue?.status||this.modelValue?.response?.state||`pending`},isSuccess(){return[`succeed`,`succeeded`].includes(this.status)||!!this.modelValue?.response?.video_url},isFailure(){return[`failed`,`dead`].includes(this.status)||this.modelValue?.response?.success===!1},isTerminal(){return this.isSuccess||this.isFailure},videoUrl(){return this.modelValue?.response?.video_url},progressPct(){let e=this.modelValue?.response?.progress;return typeof e==`number`?e:0},voiceLabel(){return this.modelValue?.request?.audio_url?this.$t(`digitalhuman.name.audioDriven`):this.$t(`digitalhuman.name.textDriven`)},faceUrl(){return this.modelValue?.request?.video_url||this.modelValue?.request?.image_url},isPhotoFace(){if(this.modelValue?.request?.image_url)return!0;let e=(this.faceUrl||``).split(`?`)[0].toLowerCase();return Kt.some(t=>e.endsWith(t))},audioUrl(){return this.modelValue?.request?.audio_url},outputSize(){let{width:e,height:t}=this.modelValue?.response||{};return e&&t?`${e}×${t}`:void 0},etaText(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(!e)return;let t=he-(Date.now()/1e3-e);return t<=60?this.$t(`digitalhuman.message.etaAlmostDone`):this.$t(`digitalhuman.message.etaRemaining`,{minutes:Math.ceil(t/60)})},statusLabel(){let e=`digitalhuman.status.${this.status}`,t=this.$t(e);return t===e?this.$t(`digitalhuman.status.processing`):t},failureReason(){let e=this.modelValue?.response?.error;if(e)return typeof e==`string`?e:e?.message}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await U.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`digitalhuman/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),window.open(t,`_blank`)}}}),Jt={class:`preview`},Yt={class:`left`},Xt={class:`main`},Zt={class:`bot`},Qt={class:`datetime`},$t=[`aria-label`],en={class:`info`},tn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},nn={class:`prompt mt-2`},rn={key:0},an={key:0,class:`content`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ln={key:1,class:`content`},un={class:`operations mt-2`},dn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},gn={key:2,class:`content`},_n={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function xn(n,c,l,d,f,h){let _=u(`capability-presentation`),v=u(`delete-icon`),y=u(`el-tooltip`),b=u(`image-preview`),x=u(`video-preview`),S=u(`audio-preview`),C=u(`time-icon`),w=u(`el-progress`),T=u(`magic-icon`),E=u(`copy-to-clipboard`),D=u(`el-alert`),O=u(`video-player`),k=u(`el-button`),A=u(`api-code-button`),j=u(`report-button`),M=u(`fullscreen-icon`),N=u(`channel-icon`),ee=u(`warning-icon`),P=u(`info-icon`);return g(),s(`div`,Jt,[e(`div`,Yt,[a(_,{capability:`digitalhuman`,part:`avatar`,class:`avatar`})]),e(`div`,Xt,[e(`div`,Zt,[a(_,{capability:`digitalhuman`,part:`name`}),e(`span`,Qt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:m(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,$t)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,en,[n.faceUrl||n.audioUrl?(g(),s(`div`,tn,[n.faceUrl&&n.isPhotoFace?(g(),p(b,{key:0,url:n.faceUrl,name:`face`,closable:!1},null,8,[`url`])):n.faceUrl?(g(),p(x,{key:1,url:n.faceUrl,name:`face`},null,8,[`url`])):o(``,!0),n.audioUrl?(g(),p(S,{key:2,url:n.audioUrl,name:`audio`},null,8,[`url`])):o(``,!0)])):o(``,!0),e(`p`,nn,[r(i(n.modelValue?.request?.text||n.voiceLabel)+` `,1),n.isTerminal?o(``,!0):(g(),s(`span`,rn,` - (`+i(n.statusLabel)+`) `,1))])]),n.isTerminal?o(``,!0):(g(),s(`div`,an,[a(D,{closable:!1,class:`info-state`},{default:m(()=>[e(`p`,on,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.statusLabel),1)]),a(w,{percentage:n.progressPct,"stroke-width":6,class:`mb-2`},null,8,[`percentage`]),n.etaText?(g(),s(`p`,sn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.etaLabel`))+`: `+i(n.etaText),1)])):o(``,!0),e(`p`,cn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])),n.isSuccess?(g(),s(`div`,ln,[n.videoUrl?(g(),p(O,{key:0,src:n.videoUrl},null,8,[`src`])):o(``,!0),e(`div`,un,[n.videoUrl?(g(),p(k,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=e=>n.onDownload(e,n.videoUrl)},{default:m(()=>[r(i(n.$t(`digitalhuman.button.download`)),1)]),_:1})):o(``,!0),a(A,{path:`/digital-human/videos`,body:n.modelValue?.request},null,8,[`body`]),a(j,{service:`digitalhuman`,"target-id":n.modelValue?.id,snapshot:{text:n.modelValue?.request?.text}},null,8,[`target-id`,`snapshot`])]),a(D,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.response?.duration?(g(),s(`p`,dn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.duration`))+`: `+i(n.modelValue?.response?.duration?.toFixed(1))+`s `,1)])):o(``,!0),n.outputSize?(g(),s(`p`,fn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.outputSize`))+`: `+i(n.outputSize),1)])):o(``,!0),e(`p`,pn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,mn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,hn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,gn,[a(D,{closable:!1,class:`failure`},{template:m(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failure`)),1)]),default:m(()=>[e(`p`,_n,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(g(),s(`p`,vn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(E,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,yn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,bn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Sn=v({name:`RecentPanel`,components:{TaskPreview:z(qt,[[`render`,xn],[`__scopeId`,`data-v-342f1d6d`]]),NoTasks:re,BotPlaceholder:Be,ScrollList:te},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.digitalhuman?.tasks,items:this.$store.state.digitalhuman?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Cn={key:0},wn={key:2,class:`w-full h-full flex items-center justify-center`};function Tn(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),_=u(`scroll-list`),v=u(`no-tasks`);return g(),s(l,null,[e.tasks?.items===void 0?(g(),s(`div`,Cn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),p(_,{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:m(()=>[(g(!0),s(l,null,h(e.tasks?.items,(e,t)=>(g(),p(f,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,wn,[a(v)])):o(``,!0)],64)}var En=v({name:`DigitalHumanIndex`,components:{ConfigPanel:Gt,Layout:qe,RecentPanel:z(Sn,[[`render`,Tn]])},mixins:[Ae,Ve(`digitalhuman`,!1)],inject:[`initialized`],data(){return{job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.digitalhuman?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.digitalhuman?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.digitalhuman.credential},config(){return this.$store.state.digitalhuman.config},tasks(){return this.$store.state.digitalhuman.tasks},walletMode(){return q()&&H(`digitalhuman`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`digitalhuman/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){window.clearInterval(this.job),e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ae({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(){await this.$store.dispatch(`digitalhuman/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`digitalhuman/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(e){if(!ke(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let t;if(this.walletMode){let n=this.getWalletContext();if(!n){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=B.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!we())return;let n=this.credential?.token;if(!n)return;t=B.generate(e,{token:n})}T.info(this.$t(`digitalhuman.message.startingTask`)),Ee(`digitalhuman`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`digitalhuman.message.startTaskSuccess`))}).catch(e=>{e instanceof K||xe(e,`digitalhuman`)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`digitalhuman.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return G(this.$wallet)},async confirmWalletPayment(e){return U.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Dn(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`layout`);return g(),p(l,null,{config:m(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var On=z(En,[[`render`,Dn]]);export{On 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,P as c,T as l,at as u,ht as d,it as f,j as p,mt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{r as y,t as b}from"./select-CD3MG9sV.js";import{t as x}from"./upload-QoHt30kH.js";import{t as S}from"./tooltip-BKeGCQnC.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-CSuuDqRA.js";import{n as E,r as D}from"./radio-BNhFzeBO.js";import{n as O,t as k}from"./collapse-B_bQM9KN.js";import{t as A}from"./drawer-CkM_NHcO.js";import{t as j}from"./input-number-VyPGUhHP.js";import{t as M}from"./progress-BuyYfFZn.js";import{t as N}from"./clock-B7yL_XXj.js";import{a as ee,i as P,n as te,o as ne,r as re,s as ie,t as ae}from"./pagination-BeJR0FnO.js";import{t as oe}from"./info-xIzYgAiV.js";import{t as se}from"./music-2-BgZoB-sB.js";import{t as ce}from"./plus-CwKarPA6.js";import{t as F}from"./trash-2-1--IdOz8.js";import{t as I}from"./triangle-alert-CsggA_lm.js";import{t as le}from"./upload-C1ZLDC6M.js";import{t as ue}from"./user-avGCO_1o.js";import{t as de}from"./video-ByywsO-8.js";import{t as L}from"./wand-sparkles-D1YhC4me.js";import{Gr as fe,Hr as pe,Jr as me,Ur as R,Wr as he,Yr as ge}from"./constants-BmcMHgPT.js";import{A as z,Ba as _e,Cn as ve,Dr as B,Er as ye,Ha as be,O as xe,Tr as V,Vi as H,Wa as U,Ya as Se,at as Ce,ca as we,ct as Te,ea as Ee,et as De,fo as Oe,io as W,it as ke,ot as Ae,pi as G,st as je,ui as K,zi as q}from"./index-BHXtbt9o.js";import{t as Me}from"./CopyToClipboard-CaPuzTeQ.js";import{t as Ne}from"./ReportButton-DqBK7S8_.js";import{t as J}from"./ImagePreview-DBaF-RWM.js";import{n as Pe}from"./taskDrawerMixin-DyAUhFEq.js";import{n as Fe,t as Ie}from"./ServicePricingSummary-C1I-y6dH.js";import{t as Y}from"./AudioPreview-CO5m-MPN.js";import{t as Le}from"./VideoPlayer-CC3Fzeqq.js";import{t as X}from"./VideoPreview-gtqNXvtJ.js";import{t as Re}from"./ScenarioPaymentMode-D9JSjV3-.js";import{t as ze}from"./ApiCodeButton-DBIIyPcm.js";import{t as Be}from"./BotPlaceholder-D9exsWtJ.js";import{t as Ve}from"./taskPollingMixin-CcLxtz8z.js";var He=v({name:`LayoutDigitalHuman`,components:{UserIcon:ue,ElDrawer:A,ElButton:W},mixins:[Pe]}),Ue={class:`main flex flex-row flex-1`},We={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)]`},Ge={class:`result h-full p-4 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ke(t,n,r,i,o,c){let l=u(`user-icon`),p=u(`el-button`),h=u(`el-drawer`);return g(),s(`div`,Ue,[e(`div`,We,[f(t.$slots,`config`,{},void 0,!0)]),e(`div`,Ge,[f(t.$slots,`result`,{},void 0,!0)]),d(a(p,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:m(()=>[a(l,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[_,!t.tasksEmpty]]),a(h,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`generator-drawer`},{default:m(()=>[f(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var qe=z(He,[[`render`,Ke],[`__scopeId`,`data-v-909c6359`]]),Je=v({name:`DigitalHumanMediaInput`,components:{AudioPreview:Y,CloseIcon:be,ElButton:W,ElProgress:M,ElUpload:x,ImagePreview:J,MusicIcon:se,UploadIcon:le,VideoIcon:de,VideoPreview:X},mixins:[Te,je,Ce,De],props:{kind:{type:String,required:!0},accept:{type:String,default:``},buttonText:{type:String,default:``},hint:{type:String,default:``}},emits:[`change`],data(){return{fileList:[],uploadUrl:_e()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},hasFile(){return this.fileList.length>0}},methods:{uploadedUrl(e){return e?.response?.file_url},isPending(e){return e.status===`ready`||e.status===`uploading`},onExceed(e){let t=this.$refs.uploader;t?.clearFiles();let n=e[0];n&&(t?.handleStart?.(n),t?.submit?.())},onError(){T.error(this.$t(`digitalhuman.message.uploadError`))},onRemoveFile(e){let t=this.fileList.indexOf(e);t>=0&&this.fileList.splice(t,1),this.onChange()},onChange(){let e=this.fileList?.[0];this.$emit(`change`,e?this.uploadedUrl(e):void 0)}}}),Ye={class:`thumb`},Xe={key:2,class:`placeholder`},Ze=[`title`],Qe=[`aria-label`,`title`,`onClick`],$e={key:0,class:`hint`};function et(c,d,f,h,_,v){let y=u(`image-preview`),b=u(`video-preview`),x=u(`audio-preview`),S=u(`el-progress`),C=u(`video-icon`),w=u(`music-icon`),T=u(`close-icon`),E=u(`upload-icon`),D=u(`el-button`),O=u(`el-upload`);return g(),p(O,{ref:`uploader`,"file-list":c.fileList,"onUpdate:fileList":d[0]||=e=>c.fileList=e,accept:c.accept,name:`file`,class:`media-input`,limit:1,multiple:!1,"before-upload":c.beforeUploadSizeGuard,action:c.uploadUrl,headers:c.headers,"on-exceed":c.onExceed,"on-error":c.onError,"on-success":c.onChange,"on-remove":c.onChange},{file:m(({file:r})=>[e(`div`,{class:n([`slot`,{pending:c.isPending(r)}])},[c.kind===`image`&&r.url?(g(),p(y,{key:0,url:r.url,name:r.name,percentage:r.percentage,onRemove:e=>c.onRemoveFile(r)},null,8,[`url`,`name`,`percentage`,`onRemove`])):(g(),s(l,{key:1},[e(`div`,Ye,[c.kind===`video`&&c.uploadedUrl(r)?(g(),p(b,{key:0,url:c.uploadedUrl(r)},null,8,[`url`])):c.kind===`audio`&&c.uploadedUrl(r)?(g(),p(x,{key:1,url:c.uploadedUrl(r)},null,8,[`url`])):(g(),s(`div`,Xe,[c.isPending(r)?(g(),p(S,{key:0,type:`circle`,"stroke-width":4,percentage:Math.round(r.percentage||0),width:34},null,8,[`percentage`])):c.kind===`video`?(g(),p(C,{key:1,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(g(),p(w,{key:2,size:`1em`,"aria-hidden":`true`,focusable:`false`}))]))]),e(`span`,{class:`filename`,title:r.name},i(r.name),9,Ze),e(`button`,{type:`button`,class:`remove`,"aria-label":c.$t(`common.button.close`),title:c.$t(`common.button.close`),onClick:t(e=>c.onRemoveFile(r),[`stop`])},[a(T,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Qe)],64))],2)]),default:m(()=>[a(D,{round:``,type:`primary`,size:`small`,class:`btn`},{default:m(()=>[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(c.hasFile?c.$t(`digitalhuman.button.replace`):c.buttonText),1)]),_:1}),c.hint?(g(),s(`p`,$e,i(c.hint),1)):o(``,!0)]),_:1},8,[`file-list`,`accept`,`before-upload`,`action`,`headers`,`on-exceed`,`on-error`,`on-success`,`on-remove`])}var Z=z(Je,[[`render`,et],[`__scopeId`,`data-v-db0590a9`]]),tt=20,Q=e=>{let t=e;return!!t&&typeof t.voice_id==`string`&&!!t.voice_id&&typeof t.name==`string`},$=()=>{try{let e=JSON.parse(localStorage.getItem(`digitalhuman.voices`)||`[]`);return Array.isArray(e)?e.filter(Q).map(e=>({voice_id:e.voice_id,name:e.name,lang:typeof e.lang==`string`?e.lang:`zh`,created_at:typeof e.created_at==`number`?e.created_at:0})):[]}catch{return[]}},nt=e=>{try{localStorage.setItem(ge,JSON.stringify(e))}catch{}return e},rt=e=>Q(e)?nt([e,...$().filter(t=>t.voice_id!==e.voice_id)].slice(0,tt)):$(),it=e=>nt($().filter(t=>t.voice_id!==e)),at=e=>`${e} ${$().length+1}`,ot=3e3,st=60,ct=v({name:`DigitalHumanVoiceCloneDialog`,components:{Consumption:Fe,ElAlert:C,ElButton:W,ElDialog:Se,ElInput:Oe,ElRadioButton:E,ElRadioGroup:D,MediaInput:Z},props:{visible:{type:Boolean,default:!1}},emits:[`update:visible`,`cloned`],data(){return{sampleUrl:void 0,name:``,lang:`zh`,cloning:!1,destroyed:!1,runId:0,DIGITALHUMAN_AUDIO_ACCEPT:R,DIGITALHUMAN_VOICE_CLONE_CONSUMPTION:2,voiceQuoteUsdc:void 0,voiceQuoteLoading:!1,quoteRunId:0}},computed:{service(){return this.$store.state.digitalhuman?.service},credentialToken(){return this.$store.state.digitalhuman?.credential?.token},walletMode(){return q()&&H(`digitalhuman`).mode===`wallet`},langOptions(){return pe.map(e=>({value:e,label:this.$t(`digitalhuman.name.lang_${e}`)}))}},watch:{walletMode(e){this.voiceQuoteUsdc=void 0,e&&this.visible&&this.sampleUrl&&this.refreshVoiceQuote()},visible(e){e?(this.sampleUrl=void 0,this.name=at(this.$t(`digitalhuman.name.myVoice`)),this.lang=`zh`):(this.runId++,this.quoteRunId++,this.cloning=!1,this.voiceQuoteLoading=!1)}},beforeUnmount(){this.destroyed=!0,this.runId++,this.quoteRunId++},methods:{onVisible(e){this.cloning&&!e||this.$emit(`update:visible`,e)},onSampleChange(e){this.sampleUrl=e,this.voiceQuoteUsdc=void 0,e&&this.walletMode&&this.refreshVoiceQuote()},isStale(e){return this.destroyed||e!==this.runId},sleep(e){return new Promise(t=>setTimeout(t,e))},async refreshVoiceQuote(){if(!this.sampleUrl)return;let e=++this.quoteRunId;this.voiceQuoteLoading=!0;try{let t=await B.quoteVoice(this.voiceRequest());e===this.quoteRunId&&this.walletMode&&(this.voiceQuoteUsdc=t.amountUsdc)}catch(e){console.warn(`x402 voice quote failed`,e)}finally{e===this.quoteRunId&&(this.voiceQuoteLoading=!1)}},voiceRequest(){return ye({audio_url:this.sampleUrl||``,lang:this.lang,name:this.name||void 0})},paymentOptions(){if(!this.walletMode)return this.credentialToken?{token:this.credentialToken}:void 0;let e=this.getWalletContext();if(!e){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}return{mode:`x402`,x402:{wallet:e,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credentialToken}}},async onClone(){if(!this.sampleUrl)return;let e=this.paymentOptions();if(!e)return;let t=++this.runId;this.cloning=!0;try{let{data:n}=await B.cloneVoice(this.voiceRequest(),e);if(this.isStale(t))return;if(n?.voice_id){this.onCloned(n.voice_id);return}if(n?.task_id)await this.pollVoice(n.task_id,t);else throw Error(`no task`)}catch(e){if(e instanceof K)return;this.isStale(t)||T.error(this.$t(`digitalhuman.message.voiceCloneFailed`))}finally{this.isStale(t)||(this.cloning=!1)}},async pollVoice(e,t){for(let n=0;n<st;n++){if(this.isStale(t)||(await this.sleep(ot),this.isStale(t)))return;let n=this.credentialToken,{data:r}=await B.pollTask(e,n?{token:n}:{mode:`x402`});if(this.isStale(t))return;if(r?.voice_id){this.onCloned(r.voice_id);return}if(r?.state===`failed`)throw Error(`clone failed`)}throw Error(`timeout`)},getWalletContext(){return G(this.$wallet)},async confirmWalletPayment(e){return U.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},onCloned(e){rt({voice_id:e,name:this.name||this.$t(`digitalhuman.name.myVoice`),lang:this.lang,created_at:Date.now()/1e3}),T.success(this.$t(`digitalhuman.message.voiceCloneSuccess`)),this.cloning=!1,this.$emit(`cloned`,e),this.$emit(`update:visible`,!1)}}}),lt={class:`text-xs text-[var(--el-text-color-secondary)] mb-3`},ut={class:`field mb-3`},dt={class:`label`},ft={class:`field`},pt={class:`label`},mt={class:`text-xs mb-0`},ht={key:1,class:`mt-4 text-xs text-[var(--el-text-color-secondary)]`},gt={class:`footer`},_t={key:0,class:`cost text-xs text-[var(--el-text-color-secondary)]`};function vt(t,n,o,c,d,f){let _=u(`media-input`),v=u(`el-input`),y=u(`el-radio-button`),b=u(`el-radio-group`),x=u(`el-alert`),S=u(`consumption`),C=u(`el-button`),w=u(`el-dialog`);return g(),p(w,{"model-value":t.visible,title:t.$t(`digitalhuman.name.cloneVoice`),width:`440`,"align-center":``,"append-to-body":``,"close-on-click-modal":!t.cloning,"close-on-press-escape":!t.cloning,"onUpdate:modelValue":t.onVisible},{footer:m(()=>[e(`div`,gt,[t.walletMode?(g(),s(`span`,_t,i(t.voiceQuoteLoading?`…`:t.voiceQuoteUsdc?`${t.voiceQuoteUsdc} USDC`:t.$t(`common.x402Scenario.quoteBeforeSigning`)),1)):(g(),p(S,{key:1,value:t.DIGITALHUMAN_VOICE_CLONE_CONSUMPTION,service:t.service,class:`cost`},null,8,[`value`,`service`])),e(`div`,null,[a(C,{disabled:t.cloning,onClick:n[2]||=e=>t.onVisible(!1)},{default:m(()=>[r(i(t.$t(`common.button.cancel`)),1)]),_:1},8,[`disabled`]),a(C,{type:`primary`,loading:t.cloning,disabled:!t.sampleUrl||t.cloning,onClick:t.onClone},{default:m(()=>[r(i(t.$t(`digitalhuman.button.startClone`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])]),default:m(()=>[e(`p`,lt,i(t.$t(`digitalhuman.message.voiceCloneHint`)),1),a(_,{kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSample`),hint:t.$t(`digitalhuman.message.audioHint`),class:`mb-4`,onChange:t.onSampleChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]),e(`div`,ut,[e(`span`,dt,i(t.$t(`digitalhuman.name.voiceName`)),1),a(v,{modelValue:t.name,"onUpdate:modelValue":n[0]||=e=>t.name=e,class:`control`,placeholder:t.$t(`digitalhuman.placeholder.voiceName`)},null,8,[`modelValue`,`placeholder`])]),e(`div`,ft,[e(`span`,pt,i(t.$t(`digitalhuman.name.voiceLang`)),1),a(b,{modelValue:t.lang,"onUpdate:modelValue":n[1]||=e=>t.lang=e,class:`control`},{default:m(()=>[(g(!0),s(l,null,h(t.langOptions,e=>(g(),p(y,{key:e.value,value:e.value},{default:m(()=>[r(i(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`])]),t.cloning?(g(),p(x,{key:0,closable:!1,type:`info`,class:`mt-4`},{default:m(()=>[e(`p`,mt,i(t.$t(`digitalhuman.message.voiceCloneRunning`)),1)]),_:1})):(g(),s(`p`,ht,i(t.$t(`digitalhuman.message.voiceStoredLocally`)),1))]),_:1},8,[`model-value`,`title`,`close-on-click-modal`,`close-on-press-escape`,`onUpdate:modelValue`])}var yt=v({name:`DigitalHumanTimbreSelector`,components:{AddIcon:ce,DeleteIcon:F,ElButton:W,ElOption:b,ElSelect:y,VoiceCloneDialog:z(ct,[[`render`,vt],[`__scopeId`,`data-v-037c810e`]])},props:{modelValue:{type:String,default:void 0}},emits:[`update:modelValue`],data(){return{voices:$(),dialogVisible:!1}},mounted(){this.modelValue&&!this.voices.some(e=>e.voice_id===this.modelValue)&&this.$emit(`update:modelValue`,void 0)},methods:{labelFor(e){let t=this.$t(`digitalhuman.name.lang_${e.lang}`);return t.startsWith(`digitalhuman.`)?e.name:`${e.name} · ${t}`},onCloned(e){this.voices=$(),this.$emit(`update:modelValue`,e)},onRemove(e){this.voices=it(e),this.modelValue===e&&this.$emit(`update:modelValue`,void 0)}}}),bt={class:`row`},xt={class:`label`},St={class:`option`},Ct={class:`option-name`},wt=[`aria-label`,`title`,`onClick`],Tt={class:`empty`};function Et(n,o,d,f,_,v){let y=u(`delete-icon`),b=u(`el-option`),x=u(`el-select`),S=u(`add-icon`),C=u(`el-button`),w=u(`voice-clone-dialog`);return g(),s(`div`,null,[e(`div`,bt,[e(`span`,xt,i(n.$t(`digitalhuman.name.timbre`)),1),a(x,{"model-value":n.modelValue,class:`control`,placeholder:n.$t(`digitalhuman.placeholder.pickTimbre`),"onUpdate:modelValue":o[0]||=e=>n.$emit(`update:modelValue`,e)},c({default:m(()=>[(g(!0),s(l,null,h(n.voices,r=>(g(),p(b,{key:r.voice_id,label:n.labelFor(r),value:r.voice_id},{default:m(()=>[e(`span`,St,[e(`span`,Ct,i(n.labelFor(r)),1),e(`button`,{type:`button`,class:`option-remove`,"aria-label":n.$t(`common.button.delete`),title:n.$t(`common.button.delete`),onClick:t(e=>n.onRemove(r.voice_id),[`stop`])},[a(y,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)])]),_:2},1032,[`label`,`value`]))),128))]),_:2},[n.voices.length===0?{name:`empty`,fn:m(()=>[e(`p`,Tt,i(n.$t(`digitalhuman.message.noVoiceYet`)),1)]),key:`0`}:void 0]),1032,[`model-value`,`placeholder`])]),a(C,{size:`small`,text:``,type:`primary`,class:`clone`,onClick:o[1]||=e=>n.dialogVisible=!0},{default:m(()=>[a(S,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.button.cloneNewVoice`)),1)]),_:1}),a(w,{visible:n.dialogVisible,"onUpdate:visible":o[2]||=e=>n.dialogVisible=e,onCloned:n.onCloned},null,8,[`visible`,`onCloned`])])}var Dt=v({name:`ConfigPanel`,components:{ServicePricingSummary:Ie,ElButton:W,ElCollapse:k,ElCollapseItem:O,ElInputNumber:j,ElRadioButton:E,ElRadioGroup:D,InfoIcon:ee,MagicIcon:L,MediaInput:Z,PromptTextarea:P,TimbreSelector:z(yt,[[`render`,Et],[`__scopeId`,`data-v-e191cc56`]]),WarningIcon:I,ScenarioPaymentMode:Re},emits:[`generate`],data(){return{faceMode:`video`,voiceMode:`text`,advancedOpen:[],DIGITALHUMAN_VIDEO_ACCEPT:me,DIGITALHUMAN_IMAGE_ACCEPT:fe,DIGITALHUMAN_AUDIO_ACCEPT:R,quoteTimer:0,quoteRunId:0}},computed:{config(){return this.$store.state.digitalhuman?.config},service(){return this.$store.state.digitalhuman?.service},consumption(){return ve(this.config,this.service?.cost)},missing(){let e=[];return(this.faceMode===`video`?this.config?.video_url:this.config?.image_url)||e.push({key:`face`,message:this.$t(`digitalhuman.message.missingFace`)}),this.voiceMode===`text`?(this.config?.text?.trim()||e.push({key:`text`,message:this.$t(`digitalhuman.message.missingText`)}),this.config?.voice_id||e.push({key:`timbre`,message:this.$t(`digitalhuman.message.missingTimbre`)})):this.config?.audio_url||e.push({key:`audio`,message:this.$t(`digitalhuman.message.missingAudio`)}),e},text:{get(){return this.config?.text},set(e){this.update({text:e})}},voiceId:{get(){return this.config?.voice_id},set(e){this.update({voice_id:e})}},speed:{get(){return this.config?.speed??1},set(e){this.update({speed:e})}},walletMode(){return q()&&H(`digitalhuman`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0},faceMode(){this.walletMode&&this.scheduleQuote()},voiceMode(){this.walletMode&&this.scheduleQuote()}},mounted(){this.config?.image_url&&!this.config?.video_url&&(this.faceMode=`photo`),this.config?.audio_url&&(this.voiceMode=`audio`)},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteTimer=window.setTimeout(this.refreshQuote,350)},async refreshQuote(){let e=H(`digitalhuman`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=V(this.config,this.faceMode,this.voiceMode),r=await B.quote(n);t===this.quoteRunId&&e.mode===`wallet`&&(e.quoteUsdc=r.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},isMissing(e){return this.missing.some(t=>t.key===e)},update(e){this.$store.commit(`digitalhuman/setConfig`,{...this.config,...e})},onFaceModeChange(e){this.update(e===`video`?{image_url:void 0}:{video_url:void 0})},onVoiceModeChange(e){this.update(e===`audio`?{text:void 0,voice_id:void 0}:{audio_url:void 0})},onFaceVideoChange(e){this.update({video_url:e})},onFacePhotoChange(e){this.update({image_url:e})},onAudioChange(e){this.update({audio_url:e})},onGenerate(){let e=this.missing[0];if(e){T.warning(e.message);let t=e.key===`face`?`face`:`voice`;this.$refs[t]?.scrollIntoView?.({behavior:`smooth`,block:`center`});return}this.$emit(`generate`,V(this.config,this.faceMode,this.voiceMode))}}}),Ot={class:`flex flex-col h-full`},kt={class:`flex-1 overflow-y-auto p-5`},At={ref:`face`,class:`field-block mb-6`},jt={class:`field-head`},Mt={class:`field-title font-bold`},Nt={key:0,class:`required-badge`},Pt={ref:`voice`,class:`field-block mb-6`},Ft={class:`field-head`},It={class:`field-title font-bold`},Lt={key:0,class:`required-badge`},Rt={class:`field-row`},zt={class:`field-head`},Bt={class:`field-title font-bold`},Vt={class:`flex flex-col items-center justify-center px-5 pb-5`},Ht={key:0,class:`hint-missing`},Ut={class:`hint-eta`};function Wt(t,n,c,d,f,h){let _=u(`info-icon`),v=u(`el-radio-button`),y=u(`el-radio-group`),b=u(`media-input`),x=u(`prompt-textarea`),S=u(`timbre-selector`),C=u(`el-input-number`),w=u(`el-collapse-item`),T=u(`el-collapse`),E=u(`warning-icon`),D=u(`scenario-payment-mode`),O=u(`service-pricing-summary`),k=u(`magic-icon`),A=u(`el-button`);return g(),s(`div`,Ot,[e(`div`,kt,[e(`section`,At,[e(`div`,jt,[e(`h2`,Mt,i(t.$t(`digitalhuman.name.step1`)),1),t.isMissing(`face`)?(g(),s(`span`,Nt,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step1`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.faceMode,"onUpdate:modelValue":n[0]||=e=>t.faceMode=e,class:`mode-switch mb-3`,onChange:t.onFaceModeChange},{default:m(()=>[a(v,{value:`video`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModeVideo`)),1)]),_:1}),a(v,{value:`photo`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.faceModePhoto`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.faceMode===`video`?(g(),p(b,{key:0,kind:`video`,accept:t.DIGITALHUMAN_VIDEO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFaceVideo`),hint:t.$t(`digitalhuman.message.faceVideoHint`),onChange:t.onFaceVideoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`])):(g(),p(b,{key:1,kind:`image`,accept:t.DIGITALHUMAN_IMAGE_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadFacePhoto`),hint:t.$t(`digitalhuman.message.facePhotoHint`),onChange:t.onFacePhotoChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),e(`section`,Pt,[e(`div`,Ft,[e(`h2`,It,i(t.$t(`digitalhuman.name.step2`)),1),t.isMissing(`text`)||t.isMissing(`timbre`)||t.isMissing(`audio`)?(g(),s(`span`,Lt,i(t.$t(`digitalhuman.name.required`)),1)):o(``,!0),a(_,{content:t.$t(`digitalhuman.description.step2`),class:`ml-1`},null,8,[`content`])]),a(y,{modelValue:t.voiceMode,"onUpdate:modelValue":n[1]||=e=>t.voiceMode=e,class:`mode-switch mb-3`,onChange:t.onVoiceModeChange},{default:m(()=>[a(v,{value:`text`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeText`)),1)]),_:1}),a(v,{value:`audio`},{default:m(()=>[r(i(t.$t(`digitalhuman.name.voiceModeAudio`)),1)]),_:1})]),_:1},8,[`modelValue`,`onChange`]),t.voiceMode===`text`?(g(),s(l,{key:0},[a(x,{modelValue:t.text,"onUpdate:modelValue":n[2]||=e=>t.text=e,class:`mb-3`,title:t.$t(`digitalhuman.name.speech`),placeholder:t.$t(`digitalhuman.placeholder.speech`),"min-rows":5,"max-rows":14},null,8,[`modelValue`,`title`,`placeholder`]),a(S,{modelValue:t.voiceId,"onUpdate:modelValue":n[3]||=e=>t.voiceId=e},null,8,[`modelValue`])],64)):(g(),p(b,{key:1,kind:`audio`,accept:t.DIGITALHUMAN_AUDIO_ACCEPT,"button-text":t.$t(`digitalhuman.button.uploadSpeechAudio`),hint:t.$t(`digitalhuman.message.audioHint`),onChange:t.onAudioChange},null,8,[`accept`,`button-text`,`hint`,`onChange`]))],512),a(T,{modelValue:t.advancedOpen,"onUpdate:modelValue":n[5]||=e=>t.advancedOpen=e,class:`advanced`},{default:m(()=>[a(w,{name:`advanced`,title:t.$t(`digitalhuman.name.advanced`)},{default:m(()=>[e(`div`,Rt,[e(`div`,zt,[e(`h2`,Bt,i(t.$t(`digitalhuman.name.speed`)),1),a(_,{content:t.$t(`digitalhuman.description.speed`),class:`ml-1`},null,8,[`content`])]),a(C,{modelValue:t.speed,"onUpdate:modelValue":n[4]||=e=>t.speed=e,class:`field-control`,min:.5,max:2,step:.1,precision:1,"controls-position":`right`},null,8,[`modelValue`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])]),e(`div`,Vt,[t.missing.length>0?(g(),s(`p`,Ht,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.missing[0].message),1)])):o(``,!0),a(D,{scenario:`digitalhuman`}),t.walletMode?o(``,!0):(g(),p(O,{key:1,value:t.consumption,service:t.service},null,8,[`value`,`service`])),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:m(()=>[a(k,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`digitalhuman.button.generateVideo`)),1)]),_:1},8,[`onClick`]),e(`p`,Ut,i(t.$t(`digitalhuman.message.eta`)),1)])])}var Gt=z(Dt,[[`render`,Wt],[`__scopeId`,`data-v-0b652d94`]]),Kt=[`.jpg`,`.jpeg`,`.png`,`.webp`,`.bmp`,`.gif`],qt=v({name:`TaskPreview`,components:{ApiCodeButton:ze,AudioPreview:Y,ChannelIcon:ie,CopyToClipboard:Me,DeleteIcon:F,ElAlert:C,ElButton:W,ElProgress:M,ElTooltip:S,FullscreenIcon:ne,ImagePreview:J,InfoIcon:oe,MagicIcon:L,ReportButton:Ne,TimeIcon:N,VideoPlayer:Le,VideoPreview:X,WarningIcon:I},props:{modelValue:{type:Object,required:!0}},computed:{status(){return this.modelValue?.status||this.modelValue?.response?.state||`pending`},isSuccess(){return[`succeed`,`succeeded`].includes(this.status)||!!this.modelValue?.response?.video_url},isFailure(){return[`failed`,`dead`].includes(this.status)||this.modelValue?.response?.success===!1},isTerminal(){return this.isSuccess||this.isFailure},videoUrl(){return this.modelValue?.response?.video_url},progressPct(){let e=this.modelValue?.response?.progress;return typeof e==`number`?e:0},voiceLabel(){return this.modelValue?.request?.audio_url?this.$t(`digitalhuman.name.audioDriven`):this.$t(`digitalhuman.name.textDriven`)},faceUrl(){return this.modelValue?.request?.video_url||this.modelValue?.request?.image_url},isPhotoFace(){if(this.modelValue?.request?.image_url)return!0;let e=(this.faceUrl||``).split(`?`)[0].toLowerCase();return Kt.some(t=>e.endsWith(t))},audioUrl(){return this.modelValue?.request?.audio_url},outputSize(){let{width:e,height:t}=this.modelValue?.response||{};return e&&t?`${e}×${t}`:void 0},etaText(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(!e)return;let t=he-(Date.now()/1e3-e);return t<=60?this.$t(`digitalhuman.message.etaAlmostDone`):this.$t(`digitalhuman.message.etaRemaining`,{minutes:Math.ceil(t/60)})},statusLabel(){let e=`digitalhuman.status.${this.status}`,t=this.$t(e);return t===e?this.$t(`digitalhuman.status.processing`):t},failureReason(){let e=this.modelValue?.response?.error;if(e)return typeof e==`string`?e:e?.message}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await U.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`digitalhuman/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e,t){e?.stopPropagation(),window.open(t,`_blank`)}}}),Jt={class:`preview`},Yt={class:`left`},Xt={class:`main`},Zt={class:`bot`},Qt={class:`datetime`},$t=[`aria-label`],en={class:`info`},tn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},nn={class:`prompt mt-2`},rn={key:0},an={key:0,class:`content`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},ln={key:1,class:`content`},un={class:`operations mt-2`},dn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},gn={key:2,class:`content`},_n={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},bn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function xn(n,c,l,d,f,h){let _=u(`capability-presentation`),v=u(`delete-icon`),y=u(`el-tooltip`),b=u(`image-preview`),x=u(`video-preview`),S=u(`audio-preview`),C=u(`time-icon`),w=u(`el-progress`),T=u(`magic-icon`),E=u(`copy-to-clipboard`),D=u(`el-alert`),O=u(`video-player`),k=u(`el-button`),A=u(`api-code-button`),j=u(`report-button`),M=u(`fullscreen-icon`),N=u(`channel-icon`),ee=u(`warning-icon`),P=u(`info-icon`);return g(),s(`div`,Jt,[e(`div`,Yt,[a(_,{capability:`digitalhuman`,part:`avatar`,class:`avatar`})]),e(`div`,Xt,[e(`div`,Zt,[a(_,{capability:`digitalhuman`,part:`name`}),e(`span`,Qt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:m(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,$t)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,en,[n.faceUrl||n.audioUrl?(g(),s(`div`,tn,[n.faceUrl&&n.isPhotoFace?(g(),p(b,{key:0,url:n.faceUrl,name:`face`,closable:!1},null,8,[`url`])):n.faceUrl?(g(),p(x,{key:1,url:n.faceUrl,name:`face`},null,8,[`url`])):o(``,!0),n.audioUrl?(g(),p(S,{key:2,url:n.audioUrl,name:`audio`},null,8,[`url`])):o(``,!0)])):o(``,!0),e(`p`,nn,[r(i(n.modelValue?.request?.text||n.voiceLabel)+` `,1),n.isTerminal?o(``,!0):(g(),s(`span`,rn,` - (`+i(n.statusLabel)+`) `,1))])]),n.isTerminal?o(``,!0):(g(),s(`div`,an,[a(D,{closable:!1,class:`info-state`},{default:m(()=>[e(`p`,on,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.statusLabel),1)]),a(w,{percentage:n.progressPct,"stroke-width":6,class:`mb-2`},null,8,[`percentage`]),n.etaText?(g(),s(`p`,sn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.etaLabel`))+`: `+i(n.etaText),1)])):o(``,!0),e(`p`,cn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])),n.isSuccess?(g(),s(`div`,ln,[n.videoUrl?(g(),p(O,{key:0,src:n.videoUrl},null,8,[`src`])):o(``,!0),e(`div`,un,[n.videoUrl?(g(),p(k,{key:0,type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=e=>n.onDownload(e,n.videoUrl)},{default:m(()=>[r(i(n.$t(`digitalhuman.button.download`)),1)]),_:1})):o(``,!0),a(A,{path:`/digital-human/videos`,body:n.modelValue?.request},null,8,[`body`]),a(j,{service:`digitalhuman`,"target-id":n.modelValue?.id,snapshot:{text:n.modelValue?.request?.text}},null,8,[`target-id`,`snapshot`])]),a(D,{closable:!1,class:`mt-2 success`},{default:m(()=>[n.modelValue?.response?.duration?(g(),s(`p`,dn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.duration`))+`: `+i(n.modelValue?.response?.duration?.toFixed(1))+`s `,1)])):o(``,!0),n.outputSize?(g(),s(`p`,fn,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.outputSize`))+`: `+i(n.outputSize),1)])):o(``,!0),e(`p`,pn,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,mn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,hn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(g(),s(`div`,gn,[a(D,{closable:!1,class:`failure`},{template:m(()=>[a(ee,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failure`)),1)]),default:m(()=>[e(`p`,_n,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(E,{content:n.modelValue?.id},null,8,[`content`])]),n.failureReason?(g(),s(`p`,vn,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.failureReason`))+`: `+i(n.failureReason)+` `,1),a(E,{content:n.failureReason},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,yn,[a(C,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,bn,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`digitalhuman.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(E,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])):o(``,!0)]),_:1})])):o(``,!0)])])}var Sn=v({name:`RecentPanel`,components:{TaskPreview:z(qt,[[`render`,xn],[`__scopeId`,`data-v-342f1d6d`]]),NoTasks:re,BotPlaceholder:Be,ScrollList:te},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.digitalhuman?.tasks,items:this.$store.state.digitalhuman?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Cn={key:0},wn={key:2,class:`w-full h-full flex items-center justify-center`};function Tn(e,t,n,r,i,c){let d=u(`bot-placeholder`),f=u(`task-preview`),_=u(`scroll-list`),v=u(`no-tasks`);return g(),s(l,null,[e.tasks?.items===void 0?(g(),s(`div`,Cn,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),p(_,{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:m(()=>[(g(!0),s(l,null,h(e.tasks?.items,(e,t)=>(g(),p(f,{key:t,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,wn,[a(v)])):o(``,!0)],64)}var En=v({name:`DigitalHumanIndex`,components:{ConfigPanel:Gt,Layout:qe,RecentPanel:z(Sn,[[`render`,Tn]])},mixins:[Ae,Ve(`digitalhuman`,!1)],inject:[`initialized`],data(){return{job:0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.digitalhuman?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.digitalhuman?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.digitalhuman.credential},config(){return this.$store.state.digitalhuman.config},tasks(){return this.$store.state.digitalhuman.tasks},walletMode(){return q()&&H(`digitalhuman`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`digitalhuman/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},initialized:{async handler(e){window.clearInterval(this.job),e&&(await this.onGetTasks(),await this.onScrollDown(),this.job||=window.setInterval(this.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ae({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(){await this.$store.dispatch(`digitalhuman/getService`)},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.fetchingTasks)return;let{limit:t=5,createdAtMin:n,createdAtMax:r}=e||{};this.fetchingTasks=!0;try{await this.$store.dispatch(`digitalhuman/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(e){if(!ke(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let t;if(this.walletMode){let n=this.getWalletContext();if(!n){T.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}t=B.generate(e,{mode:`x402`,x402:{wallet:n,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!we())return;let n=this.credential?.token;if(!n)return;t=B.generate(e,{token:n})}T.info(this.$t(`digitalhuman.message.startingTask`)),Ee(`digitalhuman`,t).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),T.success(this.$t(`digitalhuman.message.startTaskSuccess`))}).catch(e=>{e instanceof K||xe(e,`digitalhuman`)||(this.walletMode?T.error(this.$t(`common.x402Scenario.paymentFailed`)):T.error(this.$t(`digitalhuman.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return G(this.$wallet)},async confirmWalletPayment(e){return U.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Dn(e,t,n,r,i,o){let s=u(`config-panel`),c=u(`recent-panel`),l=u(`layout`);return g(),p(l,null,{config:m(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:m(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var On=z(En,[[`render`,Dn]]);export{On 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,T as c,at as l,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{r as h,t as g}from"./select-D2uv1cbt.js";import{t as _}from"./upload-C_YrWWV5.js";import{t as v}from"./tooltip-b_dQsMp2.js";import{t as y}from"./alert-BprQRUmf.js";import{h as b,v as x}from"./models-DGI43qxx.js";import{t as S}from"./clock-CIt1oE3U.js";import{a as C,i as w,n as T,r as E,s as D,t as O}from"./pagination-Cjli_PVC.js";import{t as k}from"./info-DTb1_1Yi.js";import{t as A}from"./trash-2-DE5mDXQJ.js";import{t as ee}from"./triangle-alert-k9eV3S4u.js";import{t as j}from"./wand-sparkles-BEDgmNQE.js";import{Or as M}from"./constants-CiMGQy1r.js";import{A as N,Ba as P,Cn as F,O as I,Vi as L,Wa as R,at as te,br as z,ca as B,ct as V,ea as H,et as U,io as W,it as G,ot as K,pi as q,st as J,ui as Y,yr as X,zi as Z}from"./index-4v6EkWvr.js";import{t as Q}from"./CopyToClipboard-DAyi_3OQ.js";import{t as ne}from"./ReportButton-DalKc7i7.js";import{t as re}from"./ImagePreview-B9s8J01K.js";import{t as ie}from"./ServicePricingSummary-D39Eh-NT.js";import{t as ae}from"./VideoPlayer-CVXvO7ac.js";import{t as oe}from"./ScenarioPaymentMode-4_9JDWFN.js";import{t as se}from"./ApiCodeButton-CPGhOLiu.js";import{t as ce}from"./BotPlaceholder-rtyV1S5S.js";import{t as le}from"./taskPollingMixin-CcLxtz8z.js";import{t as ue}from"./Hailuo-Cf3wIS8E.js";import{n as de,t as fe}from"./generationInput-D9-UKuN_.js";var pe=m({name:`ModelSelector`,components:{ElSelect:h,ElOption:g},data(){return{}},computed:{options(){return[{value:`minimax-t2v`,label:this.$t(`hailuo.button.model1`)},{value:`minimax-i2v`,label:this.$t(`hailuo.button.model2`)},{value:`minimax-i2v-director`,label:this.$t(`hailuo.button.model3`)}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||=M}}),me={class:`field`},he={class:`title font-bold`},ge={class:`float-left`};function _e(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,me,[e(`h2`,he,i(t.$t(`hailuo.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`hailuo.placeholder.select`),clearable:``},{default:d(()=>[(p(!0),s(c,null,f(t.options,t=>(p(),u(g,{key:t.value,label:t.label,value:t.value},{default:d(()=>[e(`span`,ge,i(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ve=N(pe,[[`render`,_e],[`__scopeId`,`data-v-a768fbd9`]]),ye=m({name:`StartImageUrlInput`,components:{ElUpload:_,ElButton:W,InfoIcon:C,ImagePreview:re},mixins:[V,J,te,U],data(){return{fileList:[],uploadUrl:P()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){x.warning(this.$t(`hailuo.message.uploadStartImageExceed`))},onError(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},async onRemove(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),be={class:`relative`},xe={class:`flex justify-between`},Se={class:`flex justify-start items-center`},Ce={class:`text-sm font-bold`};function we(t,n,c,f,m,h){let g=l(`info-icon`),_=l(`image-preview`),v=l(`el-button`),y=l(`el-upload`);return p(),s(`div`,be,[e(`div`,xe,[e(`div`,Se,[e(`span`,Ce,i(t.$t(`hailuo.name.startImageUrl`)),1),a(g,{content:t.$t(`hailuo.description.startImageUrl`),class:`info`},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,"show-file-list":!0,limit:1,multiple:!1,"list-type":`picture`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-remove":t.onRemove,"on-success":t.onSuccess,headers:t.headers},{file:d(({file:e})=>[e.url&&e.percentage!==void 0?(p(),u(_,{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`])):o(``,!0)]),default:d(()=>[a(v,{size:`small`,type:`primary`,class:`btn btn-upload`,round:``},{default:d(()=>[r(i(t.$t(`hailuo.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-remove`,`on-success`,`headers`])])}var Te=N(ye,[[`render`,we],[`__scopeId`,`data-v-322d7e4c`]]),Ee=m({name:`PromptInput`,components:{PromptTextarea:w},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function De(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`hailuo.name.prompt`),info:e.$t(`hailuo.description.prompt`),placeholder:e.$t(`hailuo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Oe=m({name:`PresetPanel`,components:{MagicIcon:j,ElButton:W,PromptInput:N(Ee,[[`render`,De]]),StartImageUrlInput:Te,ModelSelector:ve,ServicePricingSummary:ie,ScenarioPaymentMode:oe},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return fe(`hailuo`,X(this.config))},config(){return this.$store.state.hailuo?.config},consumption(){return F(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service},walletMode(){return Z()&&L(`hailuo`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=L(`hailuo`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=L(`hailuo`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await z.quote(X(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),ke={class:`flex flex-col h-full`},Ae={class:`flex-1 overflow-y-auto p-5`},je={class:`flex flex-col items-center justify-center px-5 pb-5`};function Me(t,n,c,f,m,h){let g=l(`prompt-input`),_=l(`model-selector`),v=l(`start-image-url-input`),y=l(`scenario-payment-mode`),b=l(`service-pricing-summary`),x=l(`magic-icon`),S=l(`el-button`);return p(),s(`div`,ke,[e(`div`,Ae,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),t.config?.model===`minimax-i2v`?(p(),u(v,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,je,[a(y,{scenario:`hailuo`}),t.walletMode?o(``,!0):(p(),u(b,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(p(),u(S,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(p(),u(S,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))])])}var Ne=N(Oe,[[`render`,Me]]),Pe=m({name:`TaskPreview`,components:{DeleteIcon:A,ChannelIcon:D,InfoIcon:k,MagicIcon:j,TimeIcon:S,WarningIcon:ee,CopyToClipboard:Q,ElAlert:y,VideoPlayer:ae,ElTooltip:v,ElButton:W,ApiCodeButton:se,ReportButton:ne},props:{modelValue:{type:Object,required:!0}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||this.video?.state===`failed`||this.video?.state===`cancelled`},isWaiting(){return!this.modelValue?.response||!this.isFailure&&[`queued`,`pending`,`processing`,`running`].includes(this.video?.state||``)},application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await R.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`hailuo/deleteTask`,{id:e}),x.success(this.$t(`common.message.deleteTaskSuccess`))}catch{x.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){console.debug(`on download hailuo video`,e),window.open(e,`_blank`)}}}),Fe={class:`preview`},Ie={class:`left`},Le={class:`main`},Re={class:`bot`},ze={class:`datetime`},Be=[`aria-label`],Ve={class:`info`},He={key:0,class:`prompt mt-2`},Ue={key:0},We={key:1},Ge={key:0,class:n({content:!0,failed:!0})},Ke={key:0,class:`mb-4`},qe={key:1,class:n({operations:!0,"mt-2":!0})},Je={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ye={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Xe={key:1,class:n({content:!0})},Ze={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$e={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},et={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},tt={key:2,class:n({content:!0})},nt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function rt(n,c,f,m,h,g){let _=l(`capability-presentation`),v=l(`delete-icon`),y=l(`el-tooltip`),b=l(`video-player`),x=l(`el-button`),S=l(`api-code-button`),C=l(`report-button`),w=l(`channel-icon`),T=l(`copy-to-clipboard`),E=l(`magic-icon`),D=l(`time-icon`),O=l(`el-alert`),k=l(`warning-icon`),A=l(`info-icon`);return p(),s(`div`,Fe,[e(`div`,Ie,[a(_,{capability:`hailuo`,part:`avatar`,class:`avatar`})]),e(`div`,Le,[e(`div`,Re,[a(_,{capability:`hailuo`,part:`name`}),e(`span`,ze,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:d(()=>[n.modelValue?.id?(p(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Be)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Ve,[n.modelValue?.request?.prompt?(p(),s(`p`,He,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ue,` - (`+i(n.$t(`hailuo.status.pending`))+`) `,1)),n.modelValue?.response&&n.isWaiting?(p(),s(`span`,We,` - (`+i(n.$t(`hailuo.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0&&!n.isFailure&&!n.isWaiting?(p(),s(`div`,Ge,[n.video?.video_url?(p(),s(`div`,Ke,[a(b,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?(p(),s(`div`,qe,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`hailuo.message.downloadVideo`),placement:`top-start`},{default:d(()=>[n.video?.video_url?(p(),u(x,{key:0,type:`info`,size:`small`,class:`mb-2`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:d(()=>[r(i(n.$t(`hailuo.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(S,{path:`/hailuo/videos`,body:n.modelValue?.request},null,8,[`body`]),a(C,{service:`hailuo`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Je,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.model`))+`: `+i(n.modelValue?.request?.model)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])):o(``,!0),e(`p`,$,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,Ye,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(p(),s(`div`,Xe,[a(O,{closable:!1,class:`failure`},{template:d(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failure`)),1)]),default:d(()=>[e(`p`,Ze,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Qe,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,$e,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,et,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),n.isWaiting?(p(),s(`div`,tt,[a(O,{closable:!1,class:`info`},{template:d(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`hailuo.status.processing`:`hailuo.status.pending`)),1)]),default:d(()=>[e(`p`,nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var it=m({name:`RecentPanel`,components:{TaskPreview:N(Pe,[[`render`,rt],[`__scopeId`,`data-v-f8835e7e`]]),BotPlaceholder:ce,NoTasks:E,ScrollList:T},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),at={key:0},ot={key:2,class:`w-full h-full flex items-center justify-center`};function st(e,t,n,r,i,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return p(),s(c,null,[e.tasks?.items===void 0?(p(),s(`div`,at,[a(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(p(),u(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:d(()=>[(p(!0),s(c,null,f(e.tasks?.items,e=>(p(),u(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(p(),s(`div`,ot,[a(v)])):o(``,!0)],64)}var ct=m({name:`HailuoIndex`,components:{ConfigPanel:Ne,Layout:ue,RecentPanel:N(it,[[`render`,st]])},mixins:[K,le(`hailuo`)],inject:[`initialized`],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===b.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===b.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks},walletMode(){return Z()&&L(`hailuo`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`hailuo/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await O({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(`hailuo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`hailuo/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(`hailuo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=X(this.config),t=de(`hailuo`,e);if(t){x.error(this.$t(`common.message.${t}`));return}if(!G(this.uploadTracker,e=>this.$t(e),e=>x.warning(e)))return;let n;if(this.walletMode){let t=this.getWalletContext();if(!t){x.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=z.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!B())return;let t=this.credential?.token;if(!t)return;n=z.generate(e,{token:t})}x.info(this.$t(`hailuo.message.startingTask`)),H(`hailuo`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),x.success(this.$t(`hailuo.message.startTaskSuccess`))}).catch(e=>{e instanceof Y||I(e,`hailuo`)||(this.walletMode?x.error(this.$t(`common.x402Scenario.paymentFailed`)):x.error(this.$t(`hailuo.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return q(this.$wallet)},async confirmWalletPayment(e){return R.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function lt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),f=l(`layout`);return p(),u(f,null,{config:d(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:d(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var ut=N(ct,[[`render`,lt]]);export{ut 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,T as c,at as l,j as u,mt as d,rt as f,tt as p,z as m}from"./vendor-chart-Dw-P17PN.js";import{r as h,t as g}from"./select-CD3MG9sV.js";import{t as _}from"./upload-QoHt30kH.js";import{t as v}from"./tooltip-BKeGCQnC.js";import{t as y}from"./alert-BprQRUmf.js";import{h as b,v as x}from"./models-CSuuDqRA.js";import{t as S}from"./clock-B7yL_XXj.js";import{a as C,i as w,n as T,r as E,s as D,t as O}from"./pagination-BeJR0FnO.js";import{t as k}from"./info-xIzYgAiV.js";import{t as A}from"./trash-2-1--IdOz8.js";import{t as ee}from"./triangle-alert-CsggA_lm.js";import{t as j}from"./wand-sparkles-D1YhC4me.js";import{Or as M}from"./constants-BmcMHgPT.js";import{A as N,Ba as P,Cn as F,O as I,Vi as L,Wa as R,at as te,br as z,ca as B,ct as V,ea as H,et as U,io as W,it as G,ot as K,pi as q,st as J,ui as Y,yr as X,zi as Z}from"./index-BHXtbt9o.js";import{t as Q}from"./CopyToClipboard-CaPuzTeQ.js";import{t as ne}from"./ReportButton-DqBK7S8_.js";import{t as re}from"./ImagePreview-DBaF-RWM.js";import{t as ie}from"./ServicePricingSummary-C1I-y6dH.js";import{t as ae}from"./VideoPlayer-CC3Fzeqq.js";import{t as oe}from"./ScenarioPaymentMode-D9JSjV3-.js";import{t as se}from"./ApiCodeButton-DBIIyPcm.js";import{t as ce}from"./BotPlaceholder-D9exsWtJ.js";import{t as le}from"./taskPollingMixin-CcLxtz8z.js";import{t as ue}from"./Hailuo-Dqi6oENw.js";import{n as de,t as fe}from"./generationInput-Df1upTx9.js";var pe=m({name:`ModelSelector`,components:{ElSelect:h,ElOption:g},data(){return{}},computed:{options(){return[{value:`minimax-t2v`,label:this.$t(`hailuo.button.model1`)},{value:`minimax-i2v`,label:this.$t(`hailuo.button.model2`)},{value:`minimax-i2v-director`,label:this.$t(`hailuo.button.model3`)}]},value:{get(){return this.$store.state.hailuo?.config?.model},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,model:e})}}},mounted(){this.value||=M}}),me={class:`field`},he={class:`title font-bold`},ge={class:`float-left`};function _e(t,n,r,o,m,h){let g=l(`el-option`),_=l(`el-select`);return p(),s(`div`,me,[e(`h2`,he,i(t.$t(`hailuo.name.model`)),1),a(_,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`hailuo.placeholder.select`),clearable:``},{default:d(()=>[(p(!0),s(c,null,f(t.options,t=>(p(),u(g,{key:t.value,label:t.label,value:t.value},{default:d(()=>[e(`span`,ge,i(t.label),1)]),_:2},1032,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var ve=N(pe,[[`render`,_e],[`__scopeId`,`data-v-a768fbd9`]]),ye=m({name:`StartImageUrlInput`,components:{ElUpload:_,ElButton:W,InfoIcon:C,ImagePreview:re},mixins:[V,J,te,U],data(){return{fileList:[],uploadUrl:P()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e.url).filter(e=>e!==void 0)},value:{get(){return this.$store.state.hailuo?.config?.first_image_url},set(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})}}},mounted(){this.value||=void 0,this.onSetStartImageUrl()},methods:{onExceed(){x.warning(this.$t(`hailuo.message.uploadStartImageExceed`))},onError(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},async onRemove(){x.error(this.$t(`hailuo.message.uploadStartImageError`))},onSetStartImageUrl(){let e=this.urls?.[0];this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,first_image_url:e})},async onSuccess(){this.onSetStartImageUrl()}}}),be={class:`relative`},xe={class:`flex justify-between`},Se={class:`flex justify-start items-center`},Ce={class:`text-sm font-bold`};function we(t,n,c,f,m,h){let g=l(`info-icon`),_=l(`image-preview`),v=l(`el-button`),y=l(`el-upload`);return p(),s(`div`,be,[e(`div`,xe,[e(`div`,Se,[e(`span`,Ce,i(t.$t(`hailuo.name.startImageUrl`)),1),a(g,{content:t.$t(`hailuo.description.startImageUrl`),class:`info`},null,8,[`content`])])]),a(y,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,"show-file-list":!0,limit:1,multiple:!1,"list-type":`picture`,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-remove":t.onRemove,"on-success":t.onSuccess,headers:t.headers},{file:d(({file:e})=>[e.url&&e.percentage!==void 0?(p(),u(_,{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`])):o(``,!0)]),default:d(()=>[a(v,{size:`small`,type:`primary`,class:`btn btn-upload`,round:``},{default:d(()=>[r(i(t.$t(`hailuo.button.uploadStartImageUrl`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-remove`,`on-success`,`headers`])])}var Te=N(ye,[[`render`,we],[`__scopeId`,`data-v-322d7e4c`]]),Ee=m({name:`PromptInput`,components:{PromptTextarea:w},computed:{prompt:{get(){return this.$store.state.hailuo?.config?.prompt},set(e){this.$store.commit(`hailuo/setConfig`,{...this.$store.state.hailuo?.config,prompt:e})}}},mounted(){this.prompt||=``}});function De(e,t,n,r,i,a){let o=l(`prompt-textarea`);return p(),u(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`hailuo.name.prompt`),info:e.$t(`hailuo.description.prompt`),placeholder:e.$t(`hailuo.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Oe=m({name:`PresetPanel`,components:{MagicIcon:j,ElButton:W,PromptInput:N(Ee,[[`render`,De]]),StartImageUrlInput:Te,ModelSelector:ve,ServicePricingSummary:ie,ScenarioPaymentMode:oe},emits:[`generate`],data(){return{quoteTimer:0,quoteRunId:0}},computed:{canGenerate(){return fe(`hailuo`,X(this.config))},config(){return this.$store.state.hailuo?.config},consumption(){return F(this.config,this.service?.cost)},service(){return this.$store.state.hailuo?.service},walletMode(){return Z()&&L(`hailuo`).mode===`wallet`}},watch:{walletMode:{handler(e){e&&this.scheduleQuote()},immediate:!0},config:{handler(){this.walletMode&&this.scheduleQuote()},deep:!0}},beforeUnmount(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1},methods:{scheduleQuote(){window.clearTimeout(this.quoteTimer),this.quoteRunId+=1;let e=L(`hailuo`);e.quoteUsdc=void 0,e.quoteLoading=!1,this.canGenerate&&(this.quoteTimer=window.setTimeout(this.refreshQuote,350))},async refreshQuote(){if(!this.canGenerate)return;let e=L(`hailuo`),t=++this.quoteRunId;e.quoteLoading=!0,e.quoteUsdc=void 0;try{let n=await z.quote(X(this.config));t===this.quoteRunId&&e.mode===`wallet`&&this.canGenerate&&(e.quoteUsdc=n.amountUsdc)}catch(e){console.warn(`x402 quote failed`,e)}finally{t===this.quoteRunId&&(e.quoteLoading=!1)}},onGenerate(){this.$emit(`generate`)}}}),ke={class:`flex flex-col h-full`},Ae={class:`flex-1 overflow-y-auto p-5`},je={class:`flex flex-col items-center justify-center px-5 pb-5`};function Me(t,n,c,f,m,h){let g=l(`prompt-input`),_=l(`model-selector`),v=l(`start-image-url-input`),y=l(`scenario-payment-mode`),b=l(`service-pricing-summary`),x=l(`magic-icon`),S=l(`el-button`);return p(),s(`div`,ke,[e(`div`,Ae,[a(g,{class:`mb-4`}),a(_,{class:`mb-4`}),t.config?.model===`minimax-i2v`?(p(),u(v,{key:0,class:`mb-4`})):o(``,!0)]),e(`div`,je,[a(y,{scenario:`hailuo`}),t.walletMode?o(``,!0):(p(),u(b,{key:0,value:t.consumption,service:t.service},null,8,[`value`,`service`])),t.config?.video_url!==void 0||t.config?.custom?(p(),u(S,{key:1,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.extend`)),1)]),_:1},8,[`disabled`,`onClick`])):(p(),u(S,{key:2,type:`primary`,class:`btn w-full`,round:``,disabled:!t.canGenerate,onClick:t.onGenerate},{default:d(()=>[a(x,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`hailuo.button.generate`)),1)]),_:1},8,[`disabled`,`onClick`]))])])}var Ne=N(Oe,[[`render`,Me]]),Pe=m({name:`TaskPreview`,components:{DeleteIcon:A,ChannelIcon:D,InfoIcon:k,MagicIcon:j,TimeIcon:S,WarningIcon:ee,CopyToClipboard:Q,ElAlert:y,VideoPlayer:ae,ElTooltip:v,ElButton:W,ApiCodeButton:se,ReportButton:ne},props:{modelValue:{type:Object,required:!0}},computed:{isFailure(){let e=this.modelValue?.response;return e?.success===!1||!!e?.error||this.video?.state===`failed`||this.video?.state===`cancelled`},isWaiting(){return!this.modelValue?.response||!this.isFailure&&[`queued`,`pending`,`processing`,`running`].includes(this.video?.state||``)},application(){return this.$store.state.hailuo?.application},config(){return this.$store.state.hailuo?.config},video(){return this.modelValue?.response?.data?.[0]}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await R.confirm(this.$t(`common.message.deleteTaskConfirm`),this.$t(`common.button.delete`),{type:`warning`,confirmButtonText:this.$t(`common.button.delete`),cancelButtonText:this.$t(`common.button.cancel`),confirmButtonClass:`el-button--danger`})}catch{return}try{await this.$store.dispatch(`hailuo/deleteTask`,{id:e}),x.success(this.$t(`common.message.deleteTaskSuccess`))}catch{x.error(this.$t(`common.message.deleteTaskFailed`))}}},onDownload(e){console.debug(`on download hailuo video`,e),window.open(e,`_blank`)}}}),Fe={class:`preview`},Ie={class:`left`},Le={class:`main`},Re={class:`bot`},ze={class:`datetime`},Be=[`aria-label`],Ve={class:`info`},He={key:0,class:`prompt mt-2`},Ue={key:0},We={key:1},Ge={key:0,class:n({content:!0,failed:!0})},Ke={key:0,class:`mb-4`},qe={key:1,class:n({operations:!0,"mt-2":!0})},Je={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ye={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Xe={key:1,class:n({content:!0})},Ze={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Qe={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$e={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},et={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},tt={key:2,class:n({content:!0})},nt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function rt(n,c,f,m,h,g){let _=l(`capability-presentation`),v=l(`delete-icon`),y=l(`el-tooltip`),b=l(`video-player`),x=l(`el-button`),S=l(`api-code-button`),C=l(`report-button`),w=l(`channel-icon`),T=l(`copy-to-clipboard`),E=l(`magic-icon`),D=l(`time-icon`),O=l(`el-alert`),k=l(`warning-icon`),A=l(`info-icon`);return p(),s(`div`,Fe,[e(`div`,Ie,[a(_,{capability:`hailuo`,part:`avatar`,class:`avatar`})]),e(`div`,Le,[e(`div`,Re,[a(_,{capability:`hailuo`,part:`name`}),e(`span`,ze,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(y,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:d(()=>[n.modelValue?.id?(p(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:c[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(v,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Be)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Ve,[n.modelValue?.request?.prompt?(p(),s(`p`,He,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(p(),s(`span`,Ue,` - (`+i(n.$t(`hailuo.status.pending`))+`) `,1)),n.modelValue?.response&&n.isWaiting?(p(),s(`span`,We,` - (`+i(n.$t(`hailuo.status.processing`))+`) `,1)):o(``,!0)])):o(``,!0)]),n.modelValue?.response?.success===!0&&!n.isFailure&&!n.isWaiting?(p(),s(`div`,Ge,[n.video?.video_url?(p(),s(`div`,Ke,[a(b,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?(p(),s(`div`,qe,[a(y,{class:`box-item`,effect:`dark`,content:n.$t(`hailuo.message.downloadVideo`),placement:`top-start`},{default:d(()=>[n.video?.video_url?(p(),u(x,{key:0,type:`info`,size:`small`,class:`mb-2`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:d(()=>[r(i(n.$t(`hailuo.button.download`)),1)]),_:1})):o(``,!0)]),_:1},8,[`content`]),a(S,{path:`/hailuo/videos`,body:n.modelValue?.request},null,8,[`body`]),a(C,{service:`hailuo`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(O,{closable:!1,class:`mt-2 success`},{default:d(()=>[n.modelValue?.request?.model?(p(),s(`p`,Je,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.model`))+`: `+i(n.modelValue?.request?.model)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])):o(``,!0),e(`p`,$,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,Ye,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0)]),_:1})])):o(``,!0),n.isFailure?(p(),s(`div`,Xe,[a(O,{closable:!1,class:`failure`},{template:d(()=>[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failure`)),1)]),default:d(()=>[e(`p`,Ze,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])]),e(`p`,Qe,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(T,{content:n.modelValue?.response?.error?.message},null,8,[`content`])]),n.modelValue?.elapsed?(p(),s(`p`,$e,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),e(`p`,et,[a(w,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(T,{content:n.modelValue?.response?.trace_id},null,8,[`content`])])]),_:1})])):o(``,!0),n.isWaiting?(p(),s(`div`,tt,[a(O,{closable:!1,class:`info`},{template:d(()=>[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(n.modelValue?.response?`hailuo.status.processing`:`hailuo.status.pending`)),1)]),default:d(()=>[e(`p`,nt,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`hailuo.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(T,{content:n.modelValue?.id},null,8,[`content`])])]),_:1})])):o(``,!0)])])}var it=m({name:`RecentPanel`,components:{TaskPreview:N(Pe,[[`render`,rt],[`__scopeId`,`data-v-f8835e7e`]]),BotPlaceholder:ce,NoTasks:E,ScrollList:T},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.hailuo?.tasks,items:this.$store.state.hailuo?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),at={key:0},ot={key:2,class:`w-full h-full flex items-center justify-center`};function st(e,t,n,r,i,m){let h=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return p(),s(c,null,[e.tasks?.items===void 0?(p(),s(`div`,at,[a(h)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(p(),u(_,{key:1,ref:`scrollList`,class:`tasks w-full h-full overflow-y-auto`,loading:e.loading,onReachTop:t[0]||=t=>e.$emit(`reach-top`)},{default:d(()=>[(p(!0),s(c,null,f(e.tasks?.items,e=>(p(),u(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(p(),s(`div`,ot,[a(v)])):o(``,!0)],64)}var ct=m({name:`HailuoIndex`,components:{ConfigPanel:Ne,Layout:ue,RecentPanel:N(it,[[`render`,st]])},mixins:[K,le(`hailuo`)],inject:[`initialized`],data(){return{task:void 0,job:0,timer:void 0,loadingMore:!1,fetchingTasks:!1,walletTaskIds:[]}},computed:{applicationsLoading(){return this.$store.state.hailuo?.status?.getApplications===b.Request},tasksLoading(){return this.$store.state.hailuo?.status?.getTasks===b.Request||this.fetchingTasks},credential(){return this.$store.state.hailuo.credential},config(){return this.$store.state.hailuo.config},application(){return this.$store.state.hailuo.application},tasks(){return this.$store.state.hailuo.tasks},walletMode(){return Z()&&L(`hailuo`).mode===`wallet`}},watch:{walletMode:{async handler(e,t){if(!(t===void 0||e===t)){if(this.$store.commit(`hailuo/setTasks`,void 0),e&&!this.job&&(this.job=window.setInterval(this.onPollTasks,5e3)),!e&&!this.credential?.token){window.clearInterval(this.job),this.job=0,await this.onScrollDown();return}await this.onGetTasks(),await this.onScrollDown()}}},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.onPollTasks,5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await O({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(`hailuo/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`hailuo/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(`hailuo/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r,...this.walletMode&&!this.credential?.token?{mode:`x402`,ids:this.walletTaskIds}:{}})}finally{this.fetchingTasks=!1}},async onGenerate(){let e=X(this.config),t=de(`hailuo`,e);if(t){x.error(this.$t(`common.message.${t}`));return}if(!G(this.uploadTracker,e=>this.$t(e),e=>x.warning(e)))return;let n;if(this.walletMode){let t=this.getWalletContext();if(!t){x.warning(this.$t(`common.x402Scenario.connectWalletFirst`));return}n=z.generate(e,{mode:`x402`,x402:{wallet:t,confirm:e=>this.confirmWalletPayment(e),identityToken:this.credential?.token}})}else{if(!B())return;let t=this.credential?.token;if(!t)return;n=z.generate(e,{token:t})}x.info(this.$t(`hailuo.message.startingTask`)),H(`hailuo`,n).then(e=>{let t=e?.data?.task_id;this.walletMode&&!this.credential?.token&&t&&!this.walletTaskIds.includes(t)&&this.walletTaskIds.unshift(t),x.success(this.$t(`hailuo.message.startTaskSuccess`))}).catch(e=>{e instanceof Y||I(e,`hailuo`)||(this.walletMode?x.error(this.$t(`common.x402Scenario.paymentFailed`)):x.error(this.$t(`hailuo.message.startTaskFailed`)))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getWalletContext(){return q(this.$wallet)},async confirmWalletPayment(e){return R.confirm(this.$t(`common.x402Scenario.confirmPayment`,{amount:e.amountUsdc}),this.$t(`order.message.x402ConfirmTitle`),{confirmButtonText:this.$t(`order.message.x402WalletPayCta`),cancelButtonText:this.$t(`common.button.cancel`),type:`warning`}).then(()=>!0).catch(()=>!1)},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function lt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),f=l(`layout`);return p(),u(f,null,{config:d(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:d(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var ut=N(ct,[[`render`,lt]]);export{ut as default};