@acedatacloud/nexior 3.351.0 → 3.351.1

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 (263) hide show
  1. package/dist/apple-touch-icon.png +0 -0
  2. package/dist/assets/ApiCodeButton-BJzi5tyz.js +1 -0
  3. package/dist/assets/ApiCodeButton-CQW-tfDj.css +1 -0
  4. package/dist/assets/{Artifacts-BquAKPo2.js → Artifacts-MMO1OdpT.js} +1 -1
  5. package/dist/assets/{AskUserQuestionCard-79J14AAR.js → AskUserQuestionCard-J0rQ2_X2.js} +1 -1
  6. package/dist/assets/{AudioPreview-CSDaj9pT.js → AudioPreview-DHnIvnV1.js} +1 -1
  7. package/dist/assets/{Auth-DNy0xfIQ.js → Auth-B9RTGhcb.js} +1 -1
  8. package/dist/assets/{Bare-Dk7Fea7z.js → Bare-Dntc5pwa.js} +1 -1
  9. package/dist/assets/{BotPlaceholder-ozgWBXZZ.js → BotPlaceholder-DLGHIQS6.js} +1 -1
  10. package/dist/assets/{BottomFooter-klE-Yvfa.js → BottomFooter-DYsQDDxM.js} +1 -1
  11. package/dist/assets/{BrowserPairingDialog-QrCud3vC.js → BrowserPairingDialog-Bo2uEUzY.js} +1 -1
  12. package/dist/assets/{Callback-cGZMt0bu.js → Callback-BvGbO9wJ.js} +1 -1
  13. package/dist/assets/{CodeSnippet-CEI3_Lg1.js → CodeSnippet-B3bsS2LJ.js} +1 -1
  14. package/dist/assets/{Console-DUjghDqv.js → Console-m71NOva3.js} +1 -1
  15. package/dist/assets/{Consumption-Df5_TTmd.js → Consumption-JEEofYog.js} +1 -1
  16. package/dist/assets/{Conversation-DNFd_0Er.js → Conversation-C9d7mp-Q.js} +1 -1
  17. package/dist/assets/{Conversation-B4qekHn_.js → Conversation-DAOR3s3V.js} +1 -1
  18. package/dist/assets/{CopyToClipboard-BJY08VAg.js → CopyToClipboard-DaW2jH2E.js} +1 -1
  19. package/dist/assets/{Detail-Dt06aJmG.js → Detail-CmZdshoM.js} +2 -2
  20. package/dist/assets/{Extra-BpUNNgQn.js → Extra-Be46iuq1.js} +1 -1
  21. package/dist/assets/{FilePreview-C-2WjDQt.js → FilePreview-aI8mvQrY.js} +1 -1
  22. package/dist/assets/{Hailuo-YmF9UPQ9.js → Hailuo-DqGV3Jlx.js} +1 -1
  23. package/dist/assets/{History-yyj_lDyF.js → History-BbyRej3U.js} +1 -1
  24. package/dist/assets/{ImagePreview-Cp9W6Bga.js → ImagePreview-CZw5RcMp.js} +1 -1
  25. package/dist/assets/{ImageWrapper-ykkNZD7e.js → ImageWrapper-qlYGoYD4.js} +1 -1
  26. package/dist/assets/{Index-hRsKSuxl.js → Index-1hWjuxzE.js} +1 -1
  27. package/dist/assets/{Index-DaO9bq8z.js → Index-2nvPLCt5.js} +1 -1
  28. package/dist/assets/{Index-D1BwbXSa2.js → Index-BDsy-18M2.js} +1 -1
  29. package/dist/assets/{Index-CxNPk9KA.js → Index-BFo6CS_h.js} +1 -1
  30. package/dist/assets/{Index-CmbCf9X1.js → Index-BKkQ8DTT.js} +1 -1
  31. package/dist/assets/{Index-DDDOtIim.js → Index-BN68sJXx.js} +1 -1
  32. package/dist/assets/{Index-CcfX8iyN.js → Index-BRQsofLh.js} +1 -1
  33. package/dist/assets/{Index-A0Bfzr7f.js → Index-BcVYK8bE.js} +1 -1
  34. package/dist/assets/{Index-v19PXQRm.js → Index-Bomg953t.js} +1 -1
  35. package/dist/assets/{Index-CwfmZ_yR2.js → Index-BuRofMri2.js} +1 -1
  36. package/dist/assets/{Index-UK9E0Kps.js → Index-C-ISR1SL.js} +1 -1
  37. package/dist/assets/{Index-uvwc0eZT.js → Index-C7w4KUQX.js} +1 -1
  38. package/dist/assets/{Index-CHI07GVz2.js → Index-CBM2s6B82.js} +1 -1
  39. package/dist/assets/{Index-BzDy0UMl.js → Index-CHTK_QRU.js} +1 -1
  40. package/dist/assets/{Index-CYhmq9sr.js → Index-CHVgLR-X.js} +1 -1
  41. package/dist/assets/{Index-Ca3QX3ck.js → Index-CHktntg9.js} +1 -1
  42. package/dist/assets/{Index-CuXsWO5T.js → Index-CNF-Lr1_.js} +1 -1
  43. package/dist/assets/Index-CYp09HW1.js +1 -0
  44. package/dist/assets/{Index-D8hNrQZQ.js → Index-CjEhAioQ.js} +1 -1
  45. package/dist/assets/{Index-YyUK_1C9.js → Index-CmHu1jNb.js} +1 -1
  46. package/dist/assets/{Index-BMUOJvl1.js → Index-CsWY4jDf.js} +1 -1
  47. package/dist/assets/{Index-BkxN-DDw.js → Index-D3fK4dy3.js} +1 -1
  48. package/dist/assets/{Index-CEjJb6rC.js → Index-D3x7351K.js} +1 -1
  49. package/dist/assets/{Index-CPUnYyBc.js → Index-D9c7jWVJ.js} +1 -1
  50. package/dist/assets/{Index-8Papvd2j.js → Index-DD16I8AO.js} +1 -1
  51. package/dist/assets/{Index-rfQFpN-l.js → Index-DJUjbyg4.js} +1 -1
  52. package/dist/assets/{Index-5laYQ_Vn.js → Index-DPrb3bSk.js} +1 -1
  53. package/dist/assets/{Index-LAaK38Sg2.js → Index-DtbaAFDg2.js} +1 -1
  54. package/dist/assets/{Index-DMVsiHu5.js → Index-I6GmKo0U.js} +1 -1
  55. package/dist/assets/{Index-BW9BqZHz2.js → Index-WQffu7dU2.js} +1 -1
  56. package/dist/assets/{Index-CMDwKQ-Q.js → Index-j9b0__h8.js} +1 -1
  57. package/dist/assets/{Index-BELjHtbo2.js → Index-pJ9GtTcQ2.js} +1 -1
  58. package/dist/assets/{Index-CctUkyy2.js → Index-tjID4Nzn.js} +1 -1
  59. package/dist/assets/{Invitees-BImCOTE1.js → Invitees-B7R99e8_.js} +1 -1
  60. package/dist/assets/{List-DBsb4sYk.js → List-0ajr0QZz.js} +1 -1
  61. package/dist/assets/{List-DbCY-Wxx.js → List-DtdzMyu4.js} +1 -1
  62. package/dist/assets/{List-DEJDc1BH.js → List-SleFKHdi.js} +1 -1
  63. package/dist/assets/{LocalTools-BdiINkTj.js → LocalTools-Brm2FBZ_.js} +1 -1
  64. package/dist/assets/{LocalTools-CNyJ6nqg.js → LocalTools-CmIT5f18.js} +1 -1
  65. package/dist/assets/{Logo-DbTkIiEY.js → Logo-K_E4mDXH.js} +1 -1
  66. package/dist/assets/{Main-DIbtQuvJ.js → Main-DS78OeUW.js} +1 -1
  67. package/dist/assets/{Message-CPnKlip3.js → Message-D_yFGQ7E.js} +1 -1
  68. package/dist/assets/{Model-DjcwYSlG.js → Model-CE2yGHsA.js} +1 -1
  69. package/dist/assets/{Navigator-CsDG8j_a.js → Navigator-Bb61UvZC.js} +3 -3
  70. package/dist/assets/{NotFound-B6urYGYX.js → NotFound-Brp6KOxD.js} +1 -1
  71. package/dist/assets/{PageHeader-DDqDpqWL.js → PageHeader-BO64QAoT.js} +1 -1
  72. package/dist/assets/{Pay-BpHvI1xK.js → Pay-B-9GHL_U.js} +1 -1
  73. package/dist/assets/{Player-DL7XVATT.js → Player-Ck1GkA4v.js} +1 -1
  74. package/dist/assets/{Poivelle-BNOCz_iS.js → Poivelle-BfkcxV8P.js} +1 -1
  75. package/dist/assets/{PromptTextarea-CkuHuU4h.js → PromptTextarea-CAvwbYfl.js} +1 -1
  76. package/dist/assets/{RealtimeCall-CSQ7URMB.js → RealtimeCall-IejvXDiC.js} +1 -1
  77. package/dist/assets/{ReportButton-C11rSSUR.js → ReportButton-QNLl-twb.js} +1 -1
  78. package/dist/assets/{ReportDialog-CeCZOulR.js → ReportDialog-CFQmwYNO.js} +1 -1
  79. package/dist/assets/{ScheduledTasks-DzpvhlDc.js → ScheduledTasks-B7GXLdTR.js} +1 -1
  80. package/dist/assets/{Status-BJmBSwOc.js → Status-4FMzaNsl.js} +1 -1
  81. package/dist/assets/{Subscribe-B8bJWC_X.js → Subscribe-BE_x38cp.js} +1 -1
  82. package/dist/assets/{TabSwitcher-AwWzrNKU.js → TabSwitcher-DeBVyyDT.js} +1 -1
  83. package/dist/assets/{Tts-44KDVGgK.js → Tts-25noNpoZ.js} +1 -1
  84. package/dist/assets/{VideoPlayer-DdGrgCh3.js → VideoPlayer-CFlwMJfi.js} +1 -1
  85. package/dist/assets/arrow-down--rFLhVc-.js +1 -0
  86. package/dist/assets/{arrow-down-wide-narrow-n1PEQKPc.js → arrow-down-wide-narrow-B7NNh0N_.js} +1 -1
  87. package/dist/assets/arrow-left-BEfUKt4l.js +1 -0
  88. package/dist/assets/arrow-right-BeesmDSH.js +1 -0
  89. package/dist/assets/arrow-up-De4PQDE3.js +1 -0
  90. package/dist/assets/{authorizeFlow-Bp4vivKk.js → authorizeFlow-Bpx6UJ_y.js} +1 -1
  91. package/dist/assets/{avatar-B-X3ncVX.js → avatar-DLsasDX2.js} +1 -1
  92. package/dist/assets/{basic--W9DSyf-.js → basic-C1nf5gtX.js} +1 -1
  93. package/dist/assets/{book-open-CshIfIXG.js → book-open-CA63GgoT.js} +1 -1
  94. package/dist/assets/{box-BprjWv9J.js → box-BVRNvOkq.js} +1 -1
  95. package/dist/assets/{boxes-CHpHhI6p.js → boxes-D-6gL6OU.js} +1 -1
  96. package/dist/assets/{brain-a2_WMpPf.js → brain-CpBDTBOm.js} +1 -1
  97. package/dist/assets/{chart-no-axes-combined-Bh2ivW5I.js → chart-no-axes-combined-DbsHUyFg.js} +1 -1
  98. package/dist/assets/{chat-CvQY-nei.js → chat-D_396u-v.js} +1 -1
  99. package/dist/assets/check-DU3fWk08.js +1 -0
  100. package/dist/assets/chevron-down-BGKaZsf4.js +1 -0
  101. package/dist/assets/chevron-right-DNGokh2S.js +1 -0
  102. package/dist/assets/circle-check-DG3Dg_Gr.js +1 -0
  103. package/dist/assets/{circle-question-mark-BC--6L_U.js → circle-question-mark--QHga2iN.js} +1 -1
  104. package/dist/assets/{clipboard-list-DUwddl2Q.js → clipboard-list-CZkPw7f3.js} +1 -1
  105. package/dist/assets/clock-CVw8rZJk.js +1 -0
  106. package/dist/assets/code-CxrjOPnS.js +1 -0
  107. package/dist/assets/{codingBridge-5gbiNCQP.js → codingBridge-CwslFpz0.js} +1 -1
  108. package/dist/assets/{codingBridgeNotify-T098YZg9.js → codingBridgeNotify-DhSIa9P_.js} +2 -2
  109. package/dist/assets/{coins-B0X_VfQM.js → coins-BAQZbHDX.js} +1 -1
  110. package/dist/assets/{collapse-_ywhL20o.js → collapse-BH809l6f.js} +1 -1
  111. package/dist/assets/{constants-FVNrPctQ.js → constants-DdiBRvPy.js} +1 -1
  112. package/dist/assets/{copy-CE10KZzA.js → copy-B4tOxgJH.js} +1 -1
  113. package/dist/assets/{createTaskActions-CoD6GtFP.js → createTaskActions-QIArJVSX.js} +1 -1
  114. package/dist/assets/{digitalhuman-eo1cGWlH.js → digitalhuman-CXjK3uDM.js} +1 -1
  115. package/dist/assets/{dollar-sign-YqEk_g49.js → dollar-sign-DZob5zH9.js} +1 -1
  116. package/dist/assets/{download-Db4cPdrm.js → download-sjMA6DCS.js} +1 -1
  117. package/dist/assets/{drawer-BoDb3Fpk.js → drawer-Cnm2ONDq.js} +1 -1
  118. package/dist/assets/{dropdown-DYA_Zh5D.js → dropdown-DsuDMmtm.js} +1 -1
  119. package/dist/assets/{dropdown-CuGfoCz7.js → dropdown-if7DDYSk.js} +1 -1
  120. package/dist/assets/{ellipsis-DhKh4HoQ.js → ellipsis-Bkccs3QE.js} +1 -1
  121. package/dist/assets/{esm-jjRLjKCY.js → esm-B8FyJb2l.js} +1 -1
  122. package/dist/assets/esm-BK4Phl0t.js +1 -0
  123. package/dist/assets/{esm-BuiPu-uD.js → esm-C3X_Ovgg.js} +1 -1
  124. package/dist/assets/{esm-CuCLOtdT.js → esm-D3PrA6O8.js} +2 -2
  125. package/dist/assets/{esm-Dbqm8YEH.js → esm-DDGjWMIZ.js} +2 -2
  126. package/dist/assets/{esm-C_0csb-S.js → esm-NcCcGRUV.js} +3 -3
  127. package/dist/assets/{esm-BA38U0V_.js → esm-QtC2WA4X.js} +1 -1
  128. package/dist/assets/{external-link-BVEANwpQ.js → external-link-DJNYGnH-.js} +1 -1
  129. package/dist/assets/{eye-A1wi6LDg.js → eye-KtaV-Fp9.js} +1 -1
  130. package/dist/assets/favicon-DcXA9lGi.ico +0 -0
  131. package/dist/assets/{file-BJ7NA_Hj.js → file-FXUEQR63.js} +1 -1
  132. package/dist/assets/{file-output-eDdpV5My.js → file-output-B8wwknW4.js} +1 -1
  133. package/dist/assets/{file-text-Cj-XHlv4.js → file-text-frIq7xXe.js} +1 -1
  134. package/dist/assets/{fish-VlyHmOi-.js → fish-C-z87y5x.js} +1 -1
  135. package/dist/assets/{flux-CTJPPAfO.js → flux-BhCiNufa.js} +1 -1
  136. package/dist/assets/{folder-Bn1WbCJW.js → folder-BtswUsoc.js} +1 -1
  137. package/dist/assets/gauge-Djt7pxD9.js +1 -0
  138. package/dist/assets/{globe-B4LywX9k.js → globe-w7GzyQrb.js} +1 -1
  139. package/dist/assets/{grokvideo-DqsaoFx1.js → grokvideo-DP_zjEZ9.js} +1 -1
  140. package/dist/assets/{hailuo-C7EW-LyR.js → hailuo-DlJKPEVo.js} +1 -1
  141. package/dist/assets/{headphones-BCA_0Vs7.js → headphones-CyjAi0jI.js} +1 -1
  142. package/dist/assets/{history--cQ6Ihwu.js → history-BEKrOGlx.js} +1 -1
  143. package/dist/assets/{house-ClnRE4Ga.js → house-gQegAXtD.js} +1 -1
  144. package/dist/assets/{image-Cccgy4sa.js → image-Dj2OLaW1.js} +1 -1
  145. package/dist/assets/{index-DCEwxRXS.js → index-DSIuJ3Ml.js} +5 -5
  146. package/dist/assets/{index.browser.esm-A_-cf__u.js → index.browser.esm-oa5I3XXn.js} +1 -1
  147. package/dist/assets/{index.es-DmPzk19m.js → index.es--kGwBbSU.js} +1 -1
  148. package/dist/assets/{info-Ckusq785.js → info-CaaWfQ5G.js} +1 -1
  149. package/dist/assets/{input-number-D5Q8Bypi.js → input-number-CXyGkQc9.js} +1 -1
  150. package/dist/assets/{key-round-DhCiaAL9.js → key-round-Cx5ppFpb.js} +1 -1
  151. package/dist/assets/{kling-B4HfS7eO.js → kling-B5K_F9VK.js} +1 -1
  152. package/dist/assets/{languages-T6ytzsQj.js → languages-DHV0MWhc.js} +1 -1
  153. package/dist/assets/{laptop-HK6RbDv4.js → laptop-DTlDRl_Y.js} +1 -1
  154. package/dist/assets/{lightbulb-Cus9q2UQ.js → lightbulb-BDStFAwU.js} +1 -1
  155. package/dist/assets/{link-CEQaYDR2.js → link-2an_YebR.js} +1 -1
  156. package/dist/assets/loader-circle-FJNV85C3.js +1 -0
  157. package/dist/assets/{lock-B91o356X.js → lock-DLH1dqbx.js} +1 -1
  158. package/dist/assets/{luma-0CliOjcQ.js → luma-CjrBomd8.js} +1 -1
  159. package/dist/assets/{maestro-w99vogBe.js → maestro-A6yOgN_V.js} +1 -1
  160. package/dist/assets/{maestro-CdGOukyQ.js → maestro-Cvg871o7.js} +1 -1
  161. package/dist/assets/{mail-YrrOz6GB.js → mail-BJUjxuyo.js} +1 -1
  162. package/dist/assets/{message-circle-DwdFZd5Y.js → message-circle-Cc9A9mbi.js} +1 -1
  163. package/dist/assets/{mic-H4hIsQH-.js → mic-BmXMqOZU.js} +1 -1
  164. package/dist/assets/{midjourney-BHUJfNPU.js → midjourney-Dmdk1X7P.js} +1 -1
  165. package/dist/assets/{mobileLocalExec-DLdo_9Z0.js → mobileLocalExec-AAZnsTn-.js} +2 -2
  166. package/dist/assets/{models-BAyJ5pH0.js → models-CfZmiKuz.js} +1 -1
  167. package/dist/assets/{monitor-DXmTPW1a.js → monitor-C9bcD98n.js} +1 -1
  168. package/dist/assets/{mouse-pointer-2-BvRYkj_X.js → mouse-pointer-2-CKIVz57k.js} +1 -1
  169. package/dist/assets/music-2-CnpHN-4z.js +1 -0
  170. package/dist/assets/{nanobanana-DgnxEhaX.js → nanobanana-D36H-XIY.js} +1 -1
  171. package/dist/assets/{omni-B8DDnhRg.js → omni--0XcWQsP.js} +1 -1
  172. package/dist/assets/{openaiimage-DRmd8dzY.js → openaiimage-BNl3ubwb.js} +1 -1
  173. package/dist/assets/{pagination-Zcuxd8JC.js → pagination-CGAsm_gH.js} +1 -1
  174. package/dist/assets/{pagination-CFTXw3xu.js → pagination-CZulzVrG.js} +1 -1
  175. package/dist/assets/{pagination-DbhEDijW.js → pagination-CxGbe3zt.js} +1 -1
  176. package/dist/assets/{palette-BIXfAS5K.js → palette-D4wwPAFL.js} +1 -1
  177. package/dist/assets/{paperclip-CNvGU_N8.js → paperclip-D_Wm7SdY.js} +1 -1
  178. package/dist/assets/{pause-zy_6nymn.js → pause-Dz5XtZVA.js} +1 -1
  179. package/dist/assets/{pencil-DkYXjNh_.js → pencil-Cx8pvmc5.js} +1 -1
  180. package/dist/assets/{pika-x90m_BSl.js → pika-DgaMy98F.js} +1 -1
  181. package/dist/assets/{pixverse-CMjGSip0.js → pixverse-CGqnn0pH.js} +1 -1
  182. package/dist/assets/play-CzpWdcef.js +1 -0
  183. package/dist/assets/{plug-C7b6Pipr.js → plug-Bs6kWN-O.js} +1 -1
  184. package/dist/assets/plus-C9b56Sqj.js +1 -0
  185. package/dist/assets/{poivelle-BGGM0xYB.js → poivelle-4varOjms.js} +1 -1
  186. package/dist/assets/{popover-BS2yPfjg.js → popover-LyHxU6WZ.js} +1 -1
  187. package/dist/assets/{producer--r51orqd.js → producer-DdUC8NOg.js} +1 -1
  188. package/dist/assets/{qrart-vHdiIRDa.js → qrart-BOoiUz44.js} +1 -1
  189. package/dist/assets/{realtime-Cngzys8N.js → realtime-CLS9HIQM.js} +1 -1
  190. package/dist/assets/{refresh-cw-D8bDFb1i.js → refresh-cw-CUzT_oDu.js} +1 -1
  191. package/dist/assets/rotate-ccw-xw2yS9Ly.js +1 -0
  192. package/dist/assets/rotate-cw-BIq0i1nK.js +1 -0
  193. package/dist/assets/{row-CWrBj9xB.js → row-DFp6lzUY.js} +1 -1
  194. package/dist/assets/search-DYd0_Y9a.js +1 -0
  195. package/dist/assets/{seedance-BoOdIfcM.js → seedance-BEp7Wwm2.js} +1 -1
  196. package/dist/assets/{seedream-B2WSbp--.js → seedream-CKHjYulr.js} +1 -1
  197. package/dist/assets/{select-1w7Zpr6O.js → select-BpS-bYES.js} +1 -1
  198. package/dist/assets/{serp-D67hXb_0.js → serp-BfeSKGit.js} +1 -1
  199. package/dist/assets/{shield-DImarZG1.js → shield-CBgOMcFH.js} +1 -1
  200. package/dist/assets/{shuffle-jrwk-0R5.js → shuffle-BTU8mbfU.js} +1 -1
  201. package/dist/assets/{slider-B1_GHRb5.js → slider-BnJ21MN1.js} +1 -1
  202. package/dist/assets/{sliders-horizontal-KUkgCOdn.js → sliders-horizontal-B_DMl5Dn.js} +1 -1
  203. package/dist/assets/{solana-wallets-Dv1BiqAc.js → solana-wallets-D0SdGP8c.js} +2 -2
  204. package/dist/assets/{solana-wallets-vue-Dqm6hqrZ.js → solana-wallets-vue-DRCCtBjy.js} +1 -1
  205. package/dist/assets/{sora-DJERWbLd.js → sora-UsL7zDOL.js} +1 -1
  206. package/dist/assets/{sparkles-TMKxmA_C.js → sparkles-Djp80sa_.js} +1 -1
  207. package/dist/assets/square-B6AgmEI8.js +1 -0
  208. package/dist/assets/{store-CXxBY3lZ.js → store-2C23o8iJ.js} +1 -1
  209. package/dist/assets/{suno-CqHczeAx.js → suno-DVW0NoQE.js} +1 -1
  210. package/dist/assets/{switch-Ddz6wK95.js → switch-VRq5ipbW.js} +1 -1
  211. package/dist/assets/{table-D27hm8JC.js → table-BFFBn1XT.js} +1 -1
  212. package/dist/assets/{tabs-XDjg0hvL.js → tabs-CJ6H3uSi.js} +1 -1
  213. package/dist/assets/{tag-B1WyQD51.js → tag-CoDFojoH.js} +1 -1
  214. package/dist/assets/terminal-DHQKC33e.js +1 -0
  215. package/dist/assets/{time-picker-CdYyc8Bp.js → time-picker-BWbn-F5j.js} +1 -1
  216. package/dist/assets/{tooltip-CnN93uDP.js → tooltip-iglteC5t.js} +1 -1
  217. package/dist/assets/{trash-2-C5utNutX.js → trash-2-DXpwwp30.js} +1 -1
  218. package/dist/assets/{triangle-alert-DkHeaWG2.js → triangle-alert-BlTA75VV.js} +1 -1
  219. package/dist/assets/{upload-Bcc_2RIh.js → upload-BeiqlzEw.js} +1 -1
  220. package/dist/assets/{upload-CVuy8NY8.js → upload-jWHoCQb0.js} +1 -1
  221. package/dist/assets/user-CHNnnBrI.js +1 -0
  222. package/dist/assets/{veo-zDO64ca8.js → veo-ZCY3POsO.js} +1 -1
  223. package/dist/assets/{video-D_1cn8if.js → video-B4VaUcVJ.js} +1 -1
  224. package/dist/assets/{volume-2-C2qDPZzt.js → volume-2-Bg8G9NGT.js} +1 -1
  225. package/dist/assets/{wallet-Cbrc_KTc.js → wallet-Bh1qMcsQ.js} +1 -1
  226. package/dist/assets/{wan-CGoerQ1H.js → wan-CEePVa2e.js} +1 -1
  227. package/dist/assets/{wand-sparkles-Duz2fMGa.js → wand-sparkles-M6We7RZu.js} +1 -1
  228. package/dist/assets/{web-C4_WPIz7.js → web-10Bjd4d3.js} +1 -1
  229. package/dist/assets/{web-1UHsOk_H.js → web-BSrRo6Ox.js} +1 -1
  230. package/dist/assets/{web-DRQWt7l3.js → web-DmJtpVX_.js} +1 -1
  231. package/dist/assets/{web-CulIGmsl.js → web-ETCGCKka.js} +1 -1
  232. package/dist/assets/{web-ChMqK7uc.js → web-pypqD4p-.js} +1 -1
  233. package/dist/assets/{webextrator-CDUc8bpQ.js → webextrator-CEFICi59.js} +1 -1
  234. package/dist/assets/{zap-DDtjfRic.js → zap-B6cQ7gSm.js} +1 -1
  235. package/dist/favicon.ico +0 -0
  236. package/dist/index.html +5 -4
  237. package/package.json +1 -1
  238. package/dist/assets/ApiCodeButton-DpFaPPQc.css +0 -1
  239. package/dist/assets/ApiCodeButton-l1_BzkCH.js +0 -1
  240. package/dist/assets/Index-CejG1Bud.js +0 -1
  241. package/dist/assets/arrow-down-Bi7CLyGU.js +0 -1
  242. package/dist/assets/arrow-left-BQagie4B.js +0 -1
  243. package/dist/assets/arrow-right-Blty4CyS.js +0 -1
  244. package/dist/assets/arrow-up-C7M7_aoy.js +0 -1
  245. package/dist/assets/check-BXUMT8ed.js +0 -1
  246. package/dist/assets/chevron-down-BT59D8sk.js +0 -1
  247. package/dist/assets/chevron-right-CQ3zs56g.js +0 -1
  248. package/dist/assets/circle-check-BiuRUkJb.js +0 -1
  249. package/dist/assets/clock-BWo5B4kH.js +0 -1
  250. package/dist/assets/code-j4VlLDfA.js +0 -1
  251. package/dist/assets/esm-BNYyuGx2.js +0 -1
  252. package/dist/assets/favicon-kB9rzRjQ.ico +0 -0
  253. package/dist/assets/gauge-C_cegmx1.js +0 -1
  254. package/dist/assets/loader-circle-BPHNkdJW.js +0 -1
  255. package/dist/assets/music-2-wlAjwG7s.js +0 -1
  256. package/dist/assets/play-DqmUkkVt.js +0 -1
  257. package/dist/assets/plus-DYfT7DDK.js +0 -1
  258. package/dist/assets/rotate-ccw-BJYywQ9_.js +0 -1
  259. package/dist/assets/rotate-cw-DG_O3Vek.js +0 -1
  260. package/dist/assets/search-CWmYT17R.js +0 -1
  261. package/dist/assets/square-Dgb1FciS.js +0 -1
  262. package/dist/assets/terminal-CoJHnwAK.js +0 -1
  263. package/dist/assets/user-DSlDon3v.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,L as a,M as o,N as s,T as c,at as l,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{t as y}from"./upload-CVuy8NY8.js";import{t as b}from"./tooltip-CnN93uDP.js";import{t as x}from"./alert-BprQRUmf.js";import{h as S,v as C}from"./models-BAyJ5pH0.js";import{t as w}from"./drawer-BoDb3Fpk.js";import{t as T}from"./box-BprjWv9J.js";import{t as E}from"./clock-BWo5B4kH.js";import{n as D,r as O,t as k}from"./PromptTextarea-CkuHuU4h.js";import{t as A}from"./info-Ckusq785.js";import{t as j}from"./trash-2-C5utNutX.js";import{t as M}from"./triangle-alert-DkHeaWG2.js";import{t as N}from"./upload-Bcc_2RIh.js";import{t as P}from"./wand-sparkles-Duz2fMGa.js";import{At as F,Et as I,Ot as L,Tt as R,jt as z,kt as ee}from"./constants-FVNrPctQ.js";import{$t as te,Gt as ne,Jt as re,Kt as B,Mi as V,Nn as H,O as U,Qt as W,Xt as G,Yt as K,Zt as q,ii as J,kr as Y,qt as X,tn as ie,un as ae,vi as oe}from"./index-DCEwxRXS.js";import{t as se}from"./CopyToClipboard-BJY08VAg.js";import{t as ce}from"./ReportButton-C11rSSUR.js";import{t as le}from"./FilePreview-C-2WjDQt.js";import{t as Z}from"./ImagePreview-Cp9W6Bga.js";import{n as ue}from"./taskDrawerMixin-DyAUhFEq.js";import{t as de}from"./Consumption-Df5_TTmd.js";import{a as Q,n as fe,r as pe,t as me}from"./pagination-Zcuxd8JC.js";import{t as he}from"./VideoPlayer-DdGrgCh3.js";import{t as ge}from"./ApiCodeButton-l1_BzkCH.js";import{t as _e}from"./BotPlaceholder-ozgWBXZZ.js";var ve=v({name:`LayoutOmni`,components:{MagicIcon:P,ElDrawer:w,ElButton:V},mixins:[ue]}),ye={class:`main flex flex-row flex-1`},be={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{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:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ce=U(ve,[[`render`,Se],[`__scopeId`,`data-v-b76ffabf`]]),we=v({name:`OmniPromptInput`,components:{PromptTextarea:k},computed:{prompt:{get(){return this.$store.state.omni?.config?.prompt},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`omni.name.prompt`),info:e.$t(`omni.description.prompt`),placeholder:e.$t(`omni.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=U(we,[[`render`,Te]]),De=v({name:`OmniResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:z,label:`720p`},{value:F,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.omni?.config?.resolution},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,resolution:e})}}},mounted(){this.value||=I}}),Oe={class:`resolution`},ke={class:`header`},Ae={class:`title font-bold`},je={class:`items`},Me=[`onClick`];function Ne(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`h2`,Ae,i(t.$t(`omni.name.resolution`)),1),a(p,{content:t.$t(`omni.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,je,[(g(!0),s(c,null,h(t.options,e=>(g(),s(`div`,{key:e.value,class:n([`item`,{active:t.value===e.value}]),onClick:n=>t.value=e.value},i(e.label),11,Me))),128))])])}var Pe=U(De,[[`render`,Ne],[`__scopeId`,`data-v-1f9abe29`]]),Fe=v({name:`OmniRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:L,label:`16:9`,w:32,h:18},{value:ee,label:`9:16`,w:18,h:32}]},value:{get(){return this.$store.state.omni?.config?.aspect_ratio},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,aspect_ratio:e})}}},mounted(){this.value||=R}}),Ie={class:`ratio`},Le={class:`header`},Re={class:`title font-bold`},ze={class:`items`},Be=[`onClick`],Ve={class:`preview`},He={class:`name`};function Ue(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`omni.name.ratio`)),1),a(p,{content:t.$t(`omni.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,ze,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Ve,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,He,i(r.label),1)],10,Be))),128))])])}var We=U(Fe,[[`render`,Ue],[`__scopeId`,`data-v-1c0c1511`]]),Ge=4,Ke=v({name:`OmniReferenceImagesInput`,components:{ElUpload:y,ElButton:V,InfoIcon:Q,ImagePreview:Z,UploadIcon:N},mixins:[te,W,G,ne],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`,limit:Ge,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)||[]},value(){return this.$store.state.omni?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetReferenceImages()},onExceed(){C.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){C.error(this.$t(`omni.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetReferenceImages()}}}),qe={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},Je={class:`flex min-w-0 items-center`},Ye={class:`title m-0 text-[14px] font-bold`},Xe={class:`file-list flex flex-wrap gap-[10px]`};function Ze(t,n,o,u,d,m){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return g(),s(`div`,null,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,i(t.$t(`omni.name.referenceImages`)),1),a(_,{content:t.$t(`omni.description.referenceImages`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.limit,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Xe,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Qe=U(Ke,[[`render`,Ze]]),$e=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:V,InfoIcon:Q,FilePreview:le,UploadIcon:N},mixins:[W,G],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},videoUrl(){return this.$store.state.omni?.config?.video_urls?.[0]},videoName(){let e=this.videoUrl||``;return e.split(`/`).pop()||e}},methods:{onExceed(){C.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){C.error(this.$t(`omni.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=re(e.size);return t?n?!0:(C.error(this.$t(`omni.message.uploadVideoSizeExceed`,{max:X(B)})),!1):(C.error(this.$t(`omni.message.uploadVideoTypeFailed`)),!1)},setVideoUrls(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,video_urls:e?[e]:void 0})},onRemove(){this.fileList=[],this.setVideoUrls(void 0)},async onSuccess(e,t){let n=e?.file_url||t?.response?.file_url;this.setVideoUrls(n||void 0)}}}),et={class:`field flex min-h-8 w-full items-center justify-between gap-3`},tt={class:`flex min-w-0 items-center`},nt={class:`title m-0 text-[14px] font-bold`},rt={key:0,class:`file-list flex flex-wrap gap-[10px]`};function it(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`file-preview`);return g(),s(`div`,null,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,i(t.$t(`omni.name.referenceVideo`)),1),a(m,{content:t.$t(`omni.description.referenceVideo`)},null,8,[`content`])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value shrink-0`,"show-file-list":!1,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(_,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.uploadVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.videoUrl?(g(),s(`div`,rt,[a(y,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)])}var at=v({name:`OmniConfigPanel`,components:{ElButton:V,MagicIcon:P,PromptInput:Ee,ResolutionSelector:Pe,RatioSelector:We,ReferenceImagesInput:Qe,VideoInput:U($e,[[`render`,it],[`__scopeId`,`data-v-b87d1e4e`]]),Consumption:de},emits:[`generate`],computed:{config(){return this.$store.state.omni?.config},consumption(){return ie(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ot={class:`flex flex-col h-full`},st={class:`flex-1 overflow-y-auto p-5`},ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function lt(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`ratio-selector`),h=l(`resolution-selector`),_=l(`reference-images-input`),v=l(`video-input`),y=l(`consumption`),b=l(`magic-icon`),x=l(`el-button`);return g(),s(`div`,ot,[e(`div`,st,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,ct,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ut=U(at,[[`render`,lt]]),dt=v({name:`OmniTaskPreview`,components:{DeleteIcon:j,ApplicationIcon:T,ChannelIcon:O,CopyToClipboard:se,ExpandIcon:D,InfoIcon:A,MagicIcon:P,TimeIcon:E,WarningIcon:M,ElAlert:x,VideoPlayer:he,ElTooltip:b,ElButton:V,ImagePreview:Z,ApiCodeButton:ge,ReportButton:ce},props:{modelValue:{type:Object,required:!0}},data(){return{nowTs:Date.now(),timer:0}},computed:{video(){return this.modelValue?.response?.data?.[0]},inputImage(){return this.modelValue?.request?.image_urls?.[0]},pendingElapsed(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(e)return Math.max(0,Math.floor(this.nowTs/1e3-e))}},watch:{"modelValue.response":{handler(e){e&&this.stopTimer()}}},mounted(){this.modelValue?.response||(this.timer=window.setInterval(()=>{this.nowTs=Date.now()},1e3))},beforeUnmount(){this.stopTimer()},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await oe.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(`omni/deleteTask`,{id:e}),C.success(this.$t(`common.message.deleteTaskSuccess`))}catch{C.error(this.$t(`common.message.deleteTaskFailed`))}}},stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),ft={class:`preview`},pt={class:`left`},mt={class:`main`},ht={class:`bot`},gt={class:`datetime`},_t=[`aria-label`],vt={class:`info`},yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},bt={key:1,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0})},wt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:1,class:n({content:!0})},Dt={key:0,class:`mb-4`},Ot={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={key:0},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:2,class:n({content:!0})},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:3,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`image-preview`),b=l(`time-icon`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`el-alert`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`report-button`),O=l(`application-icon`),k=l(`expand-icon`),A=l(`channel-icon`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,ft,[e(`div`,pt,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,mt,[e(`div`,ht,[a(h,{capability:`omni`,part:`name`}),e(`span`,gt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[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(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,_t)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,vt,[n.inputImage?(g(),s(`div`,yt,[a(y,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,St,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,xt,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Et,[n.video?.video_url?(g(),s(`div`,Dt,[a(w,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ot,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`omni.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(T,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`omni.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(E,{path:`/gemini/videos`,body:n.modelValue?.request},null,8,[`body`]),a(D,{service:`omni`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(C,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,At,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,jt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Mt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Nt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,$,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Pt,[a(C,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failure`)),1)]),default:p(()=>[e(`p`,Ft,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,It,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Lt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Rt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.status`)),1)]),default:p(()=>[e(`p`,zt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Ct,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.status.pending`)),1)]),default:p(()=>[e(`p`,wt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Tt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var Vt=v({name:`OmniRecentPanel`,components:{TaskPreview:U(dt,[[`render`,Bt],[`__scopeId`,`data-v-08bc502f`]]),BotPlaceholder:_e,NoTasks:pe,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.omni?.tasks,items:this.$store.state.omni?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{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:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=v({name:`OmniIndex`,components:{ConfigPanel:ut,Layout:Ce,RecentPanel:U(Vt,[[`render`,Wt]])},mixins:[q],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===S.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===S.Request||this.fetchingTasks},credential(){return this.$store.state.omni?.credential},config(){return this.$store.state.omni?.config},tasks(){return this.$store.state.omni?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await me({tasks: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(`omni/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(`omni/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!K(this.uploadTracker,e=>this.$t(e),e=>C.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.image_urls)&&(e.image_urls=e.image_urls.filter(e=>typeof e==`string`&&e.trim()),e.image_urls.length||delete e.image_urls),Array.isArray(e?.video_urls)&&(e.video_urls=e.video_urls.filter(e=>typeof e==`string`&&e.trim()),e.video_urls.length||delete e.video_urls),!e?.prompt){C.warning(this.$t(`omni.message.promptRequired`));return}if(e?.video_urls&&!e?.image_urls){C.warning(this.$t(`omni.message.videoRequiresImage`));return}let t={...e,async:!0};if(!ae())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}C.info(this.$t(`omni.message.startingTask`)),Y(`omni`,H.generate(t,{token:n})).then(()=>{C.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?C.error(this.$t(`omni.message.usedUp`)):C.error(this.$t(`omni.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Kt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var qt=U(Gt,[[`render`,Kt]]);export{qt 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,ht as u,it as d,j as f,mt as p,qt as m,rt as h,tt as g,x as _,z as v}from"./vendor-chart-Dw-P17PN.js";import{t as y}from"./upload-jWHoCQb0.js";import{t as b}from"./tooltip-iglteC5t.js";import{t as x}from"./alert-BprQRUmf.js";import{h as S,v as C}from"./models-CfZmiKuz.js";import{t as w}from"./drawer-Cnm2ONDq.js";import{t as T}from"./box-BVRNvOkq.js";import{t as E}from"./clock-CVw8rZJk.js";import{n as D,r as O,t as k}from"./PromptTextarea-CAvwbYfl.js";import{t as A}from"./info-CaaWfQ5G.js";import{t as j}from"./trash-2-DXpwwp30.js";import{t as M}from"./triangle-alert-BlTA75VV.js";import{t as N}from"./upload-BeiqlzEw.js";import{t as P}from"./wand-sparkles-M6We7RZu.js";import{At as F,Et as I,Ot as L,Tt as R,jt as z,kt as ee}from"./constants-DdiBRvPy.js";import{$t as te,Gt as ne,Jt as re,Kt as B,Mi as V,Nn as H,O as U,Qt as W,Xt as G,Yt as K,Zt as q,ii as J,kr as Y,qt as X,tn as ie,un as ae,vi as oe}from"./index-DSIuJ3Ml.js";import{t as se}from"./CopyToClipboard-DaW2jH2E.js";import{t as ce}from"./ReportButton-QNLl-twb.js";import{t as le}from"./FilePreview-aI8mvQrY.js";import{t as Z}from"./ImagePreview-CZw5RcMp.js";import{n as ue}from"./taskDrawerMixin-DyAUhFEq.js";import{t as de}from"./Consumption-JEEofYog.js";import{a as Q,n as fe,r as pe,t as me}from"./pagination-CGAsm_gH.js";import{t as he}from"./VideoPlayer-CFlwMJfi.js";import{t as ge}from"./ApiCodeButton-BJzi5tyz.js";import{t as _e}from"./BotPlaceholder-DLGHIQS6.js";var ve=v({name:`LayoutOmni`,components:{MagicIcon:P,ElDrawer:w,ElButton:V},mixins:[ue]}),ye={class:`main flex flex-row flex-1`},be={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)]`},xe={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Se(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,ye,[e(`div`,be,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,xe,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{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:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Ce=U(ve,[[`render`,Se],[`__scopeId`,`data-v-b76ffabf`]]),we=v({name:`OmniPromptInput`,components:{PromptTextarea:k},computed:{prompt:{get(){return this.$store.state.omni?.config?.prompt},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Te(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`omni.name.prompt`),info:e.$t(`omni.description.prompt`),placeholder:e.$t(`omni.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ee=U(we,[[`render`,Te]]),De=v({name:`OmniResolutionSelector`,components:{InfoIcon:Q},data(){return{options:[{value:z,label:`720p`},{value:F,label:`1080p`}]}},computed:{value:{get(){return this.$store.state.omni?.config?.resolution},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,resolution:e})}}},mounted(){this.value||=I}}),Oe={class:`resolution`},ke={class:`header`},Ae={class:`title font-bold`},je={class:`items`},Me=[`onClick`];function Ne(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Oe,[e(`div`,ke,[e(`h2`,Ae,i(t.$t(`omni.name.resolution`)),1),a(p,{content:t.$t(`omni.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,je,[(g(!0),s(c,null,h(t.options,e=>(g(),s(`div`,{key:e.value,class:n([`item`,{active:t.value===e.value}]),onClick:n=>t.value=e.value},i(e.label),11,Me))),128))])])}var Pe=U(De,[[`render`,Ne],[`__scopeId`,`data-v-1f9abe29`]]),Fe=v({name:`OmniRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:L,label:`16:9`,w:32,h:18},{value:ee,label:`9:16`,w:18,h:32}]},value:{get(){return this.$store.state.omni?.config?.aspect_ratio},set(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,aspect_ratio:e})}}},mounted(){this.value||=R}}),Ie={class:`ratio`},Le={class:`header`},Re={class:`title font-bold`},ze={class:`items`},Be=[`onClick`],Ve={class:`preview`},He={class:`name`};function Ue(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`omni.name.ratio`)),1),a(p,{content:t.$t(`omni.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,ze,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,Ve,[e(`div`,{class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)]),e(`div`,He,i(r.label),1)],10,Be))),128))])])}var We=U(Fe,[[`render`,Ue],[`__scopeId`,`data-v-1c0c1511`]]),Ge=4,Ke=v({name:`OmniReferenceImagesInput`,components:{ElUpload:y,ElButton:V,InfoIcon:Q,ImagePreview:Z,UploadIcon:N},mixins:[te,W,G,ne],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`,limit:Ge,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)||[]},value(){return this.$store.state.omni?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetReferenceImages()},onExceed(){C.warning(this.$t(`omni.message.uploadReferenceExceed`))},onError(){C.error(this.$t(`omni.message.uploadError`))},onSetReferenceImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,image_urls:e.length?e:void 0}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetReferenceImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetReferenceImages()}}}),qe={class:`field mb-[10px] flex min-h-8 w-full items-center justify-between gap-3`},Je={class:`flex min-w-0 items-center`},Ye={class:`title m-0 text-[14px] font-bold`},Xe={class:`file-list flex flex-wrap gap-[10px]`};function Ze(t,n,o,u,d,m){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return g(),s(`div`,null,[e(`div`,qe,[e(`div`,Je,[e(`h2`,Ye,i(t.$t(`omni.name.referenceImages`)),1),a(_,{content:t.$t(`omni.description.referenceImages`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.limit,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,Xe,[(g(!0),s(c,null,h(t.fileList,(e,n)=>(g(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Qe=U(Ke,[[`render`,Ze]]),$e=v({name:`OmniVideoInput`,components:{ElUpload:y,ElButton:V,InfoIcon:Q,FilePreview:le,UploadIcon:N},mixins:[W,G],data(){return{fileList:[],uploadUrl:J()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},videoUrl(){return this.$store.state.omni?.config?.video_urls?.[0]},videoName(){let e=this.videoUrl||``;return e.split(`/`).pop()||e}},methods:{onExceed(){C.warning(this.$t(`omni.message.uploadVideoExceed`))},onError(){C.error(this.$t(`omni.message.uploadVideoError`))},beforeUpload(e){let t=e.type===`video/mp4`||e.type===`video/quicktime`,n=re(e.size);return t?n?!0:(C.error(this.$t(`omni.message.uploadVideoSizeExceed`,{max:X(B)})),!1):(C.error(this.$t(`omni.message.uploadVideoTypeFailed`)),!1)},setVideoUrls(e){this.$store.commit(`omni/setConfig`,{...this.$store.state.omni?.config,video_urls:e?[e]:void 0})},onRemove(){this.fileList=[],this.setVideoUrls(void 0)},async onSuccess(e,t){let n=e?.file_url||t?.response?.file_url;this.setVideoUrls(n||void 0)}}}),et={class:`field flex min-h-8 w-full items-center justify-between gap-3`},tt={class:`flex min-w-0 items-center`},nt={class:`title m-0 text-[14px] font-bold`},rt={key:0,class:`file-list flex flex-wrap gap-[10px]`};function it(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`),y=l(`file-preview`);return g(),s(`div`,null,[e(`div`,et,[e(`div`,tt,[e(`h2`,nt,i(t.$t(`omni.name.referenceVideo`)),1),a(m,{content:t.$t(`omni.description.referenceVideo`)},null,8,[`content`])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.mp4,.mov`,name:`file`,class:`value shrink-0`,"show-file-list":!1,limit:1,multiple:!1,action:t.uploadUrl,"before-upload":t.beforeUpload,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,headers:t.headers},{default:p(()=>[a(_,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(h,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.uploadVideo`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`before-upload`,`on-exceed`,`on-error`,`on-success`,`headers`])]),t.videoUrl?(g(),s(`div`,rt,[a(y,{url:t.videoUrl,name:t.videoName,percentage:100,onRemove:t.onRemove},null,8,[`url`,`name`,`onRemove`])])):o(``,!0)])}var at=v({name:`OmniConfigPanel`,components:{ElButton:V,MagicIcon:P,PromptInput:Ee,ResolutionSelector:Pe,RatioSelector:We,ReferenceImagesInput:Qe,VideoInput:U($e,[[`render`,it],[`__scopeId`,`data-v-b87d1e4e`]]),Consumption:de},emits:[`generate`],computed:{config(){return this.$store.state.omni?.config},consumption(){return ie(this.config,this.service?.cost)},service(){return this.$store.state.omni?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),ot={class:`flex flex-col h-full`},st={class:`flex-1 overflow-y-auto p-5`},ct={class:`flex flex-col items-center justify-center px-5 pb-5`};function lt(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`ratio-selector`),h=l(`resolution-selector`),_=l(`reference-images-input`),v=l(`video-input`),y=l(`consumption`),b=l(`magic-icon`),x=l(`el-button`);return g(),s(`div`,ot,[e(`div`,st,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`})]),e(`div`,ct,[a(y,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(x,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(b,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`omni.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ut=U(at,[[`render`,lt]]),dt=v({name:`OmniTaskPreview`,components:{DeleteIcon:j,ApplicationIcon:T,ChannelIcon:O,CopyToClipboard:se,ExpandIcon:D,InfoIcon:A,MagicIcon:P,TimeIcon:E,WarningIcon:M,ElAlert:x,VideoPlayer:he,ElTooltip:b,ElButton:V,ImagePreview:Z,ApiCodeButton:ge,ReportButton:ce},props:{modelValue:{type:Object,required:!0}},data(){return{nowTs:Date.now(),timer:0}},computed:{video(){return this.modelValue?.response?.data?.[0]},inputImage(){return this.modelValue?.request?.image_urls?.[0]},pendingElapsed(){let e=parseFloat((this.modelValue?.created_at||``).toString());if(e)return Math.max(0,Math.floor(this.nowTs/1e3-e))}},watch:{"modelValue.response":{handler(e){e&&this.stopTimer()}}},mounted(){this.modelValue?.response||(this.timer=window.setInterval(()=>{this.nowTs=Date.now()},1e3))},beforeUnmount(){this.stopTimer()},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await oe.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(`omni/deleteTask`,{id:e}),C.success(this.$t(`common.message.deleteTaskSuccess`))}catch{C.error(this.$t(`common.message.deleteTaskFailed`))}}},stopTimer(){this.timer&&=(window.clearInterval(this.timer),0)},onDownload(e){window.open(e,`_blank`)}}}),ft={class:`preview`},pt={class:`left`},mt={class:`main`},ht={class:`bot`},gt={class:`datetime`},_t=[`aria-label`],vt={class:`info`},yt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},bt={key:1,class:`prompt mt-2`},xt={key:0},St={key:1},Ct={key:0,class:n({content:!0})},wt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:1,class:n({content:!0})},Dt={key:0,class:`mb-4`},Ot={key:1,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={key:0},Mt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:2,class:n({content:!0})},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:3,class:n({content:!0})},zt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function Bt(n,c,u,d,f,m){let h=l(`capability-presentation`),_=l(`delete-icon`),v=l(`el-tooltip`),y=l(`image-preview`),b=l(`time-icon`),x=l(`magic-icon`),S=l(`copy-to-clipboard`),C=l(`el-alert`),w=l(`video-player`),T=l(`el-button`),E=l(`api-code-button`),D=l(`report-button`),O=l(`application-icon`),k=l(`expand-icon`),A=l(`channel-icon`),j=l(`warning-icon`),M=l(`info-icon`);return g(),s(`div`,ft,[e(`div`,pt,[a(h,{capability:`omni`,part:`avatar`,class:`avatar`})]),e(`div`,mt,[e(`div`,ht,[a(h,{capability:`omni`,part:`name`}),e(`span`,gt,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(v,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[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(_,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,_t)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,vt,[n.inputImage?(g(),s(`div`,yt,[a(y,{url:n.inputImage,name:`image`,closable:!1},null,8,[`url`])])):o(``,!0),n.modelValue?.request?.prompt?(g(),s(`p`,bt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?n.video?.state===`processing`||n.video?.state===`pending`?(g(),s(`span`,St,` - (`+i(n.$t(`omni.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,xt,` - (`+i(n.$t(`omni.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,Et,[n.video?.video_url?(g(),s(`div`,Dt,[a(w,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,Ot,[a(v,{class:`box-item`,effect:`dark`,content:n.$t(`omni.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(T,{type:`info`,size:`small`,class:`btn-action`,onClick:c[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`omni.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(E,{path:`/gemini/videos`,body:n.modelValue?.request},null,8,[`body`]),a(D,{service:`omni`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])])):o(``,!0),a(C,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,kt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.resolution?(g(),s(`p`,At,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.resolution`))+`: `+i(n.modelValue?.request?.resolution)+` `,1),n.modelValue?.request?.aspect_ratio?(g(),s(`span`,jt,` · `+i(n.modelValue?.request?.aspect_ratio),1)):o(``,!0)])):o(``,!0),e(`p`,Mt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,Nt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,$,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,Pt,[a(C,{closable:!1,class:`failure`},{template:p(()=>[a(j,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failure`)),1)]),default:p(()=>[e(`p`,Ft,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,It,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(S,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,Lt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(S,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,Rt,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.status`)),1)]),default:p(()=>[e(`p`,zt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})])):(g(),s(`div`,Ct,[a(C,{closable:!1,class:`info`},{template:p(()=>[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.status.pending`)),1)]),default:p(()=>[e(`p`,wt,[a(x,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(S,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.pendingElapsed===void 0?o(``,!0):(g(),s(`p`,Tt,[a(b,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`omni.name.elapsed`))+`: `+i(n.pendingElapsed)+`s `,1)]))]),_:1})]))])])}var Vt=v({name:`OmniRecentPanel`,components:{TaskPreview:U(dt,[[`render`,Bt],[`__scopeId`,`data-v-08bc502f`]]),BotPlaceholder:_e,NoTasks:pe,ScrollList:fe},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.omni?.tasks,items:this.$store.state.omni?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Ht={key:0},Ut={key:2,class:`w-full h-full flex items-center justify-center`};function Wt(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Ht,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{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:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Ut,[a(v)])):o(``,!0)],64)}var Gt=v({name:`OmniIndex`,components:{ConfigPanel:ut,Layout:Ce,RecentPanel:U(Vt,[[`render`,Wt]])},mixins:[q],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.omni?.status?.getApplications===S.Request},tasksLoading(){return this.$store.state.omni?.status?.getTasks===S.Request||this.fetchingTasks},credential(){return this.$store.state.omni?.credential},config(){return this.$store.state.omni?.config},tasks(){return this.$store.state.omni?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await me({tasks: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(`omni/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(`omni/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!K(this.uploadTracker,e=>this.$t(e),e=>C.warning(e)))return;let e={...this.config||{}};if(typeof e?.prompt==`string`&&(e.prompt=e.prompt.trim(),e.prompt||delete e.prompt),Array.isArray(e?.image_urls)&&(e.image_urls=e.image_urls.filter(e=>typeof e==`string`&&e.trim()),e.image_urls.length||delete e.image_urls),Array.isArray(e?.video_urls)&&(e.video_urls=e.video_urls.filter(e=>typeof e==`string`&&e.trim()),e.video_urls.length||delete e.video_urls),!e?.prompt){C.warning(this.$t(`omni.message.promptRequired`));return}if(e?.video_urls&&!e?.image_urls){C.warning(this.$t(`omni.message.videoRequiresImage`));return}let t={...e,async:!0};if(!ae())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}C.info(this.$t(`omni.message.startingTask`)),Y(`omni`,H.generate(t,{token:n})).then(()=>{C.success(this.$t(`omni.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?C.error(this.$t(`omni.message.usedUp`)):C.error(this.$t(`omni.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Kt(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var qt=U(Gt,[[`render`,Kt]]);export{qt 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,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-1w7Zpr6O.js";import{t as x}from"./upload-CVuy8NY8.js";import{t as S}from"./tooltip-CnN93uDP.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-BAyJ5pH0.js";import{t as E}from"./drawer-BoDb3Fpk.js";import{t as D}from"./input-number-D5Q8Bypi.js";import{t as O}from"./switch-Ddz6wK95.js";import{t as k}from"./box-BprjWv9J.js";import{t as A}from"./clock-BWo5B4kH.js";import{r as j,t as M}from"./PromptTextarea-CkuHuU4h.js";import{t as N}from"./image-Cccgy4sa.js";import{t as P}from"./info-Ckusq785.js";import{t as F}from"./trash-2-C5utNutX.js";import{t as I}from"./triangle-alert-DkHeaWG2.js";import{t as L}from"./upload-Bcc_2RIh.js";import{t as R}from"./wand-sparkles-Duz2fMGa.js";import{t as z}from"./zap-DDtjfRic.js";import{Bn as ee,Fn as te,Gn as ne,Hn as re,In as ie,Kn as ae,Ln as oe,Pn as B,Un as V,Vn as H,qn as U,zn as W}from"./constants-FVNrPctQ.js";import{$t as G,Gt as K,Ln as q,Mi as J,O as Y,Qt as se,Xt as ce,Yt as le,Zt as ue,ii as de,kr as fe,tn as pe,un as me,vi as he}from"./index-DCEwxRXS.js";import{t as ge}from"./CopyToClipboard-BJY08VAg.js";import{t as _e}from"./ReportButton-C11rSSUR.js";import{t as X}from"./ImagePreview-Cp9W6Bga.js";import{n as ve}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ye}from"./Consumption-Df5_TTmd.js";import{a as Z,n as be,r as xe,t as Se}from"./pagination-Zcuxd8JC.js";import{t as Ce}from"./ApiCodeButton-l1_BzkCH.js";import{t as we}from"./BotPlaceholder-ozgWBXZZ.js";import{t as Te}from"./ImageWrapper-ykkNZD7e.js";var Ee=_({name:`LayoutNanobanana`,components:{MagicIcon:R,ElDrawer:E,ElButton:J},mixins:[ve]}),De={class:`main flex flex-row flex-1`},Oe={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)]`},ke={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ae(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,De,[e(`div`,Oe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ke,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var je=Y(Ee,[[`render`,Ae],[`__scopeId`,`data-v-fa2172a6`]]),Me=_({name:`PromptInput`,components:{PromptTextarea:M},computed:{prompt:{get(){return this.$store.state.openaiimage?.config?.prompt},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Ne(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`openaiimage.name.prompt`),info:e.$t(`openaiimage.description.prompt`),placeholder:e.$t(`openaiimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Pe=Y(Me,[[`render`,Ne]]),Fe=_({name:`ImageUrlsInput`,components:{UploadIcon:L,ElUpload:x,ElButton:J,InfoIcon:Z,ImagePreview:X},mixins:[G,se,ce,K],data(){return{fileList:[],uploadUrl:de()+`/api/v1/files/`,suppressWatch:!1}},computed:{maxImages(){return 16},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.openaiimage?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){T.warning(this.$t(`openaiimage.message.uploadImageExceed`,{count:16}))},onError(){T.error(this.$t(`openaiimage.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),Ie={class:`field flex min-h-8 w-full items-center justify-between gap-3`},Le={class:`flex min-w-0 items-center`},Re={class:`title m-0 text-[14px] font-bold`},ze={class:`file-list flex flex-wrap gap-[10px]`};function Be(t,n,o,u,d,g){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return h(),s(`div`,null,[e(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`openaiimage.name.imageUrls`)),1),a(_,{content:t.$t(`openaiimage.description.imageUrls`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.maxImages,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,ze,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Ve=Y(Fe,[[`render`,Be]]),He=_({name:`OpenAIImageModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:W,label:this.$t(`openaiimage.model.gptImage1`)},{value:ee,label:this.$t(`openaiimage.model.gptImage15`)},{value:H,label:this.$t(`openaiimage.model.gptImage2`)},{value:re,label:this.$t(`openaiimage.model.gptImage2Official`)}]}},computed:{value:{get(){return this.$store.state.openaiimage?.config?.model},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,model:e})}},modelDescription(){return this.$t(`openaiimage.description.model`)}},mounted(){this.value||=oe}}),Ue={class:`field`},We={class:`label`},Ge={class:`box`},Ke={class:`title font-bold`};function qe(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Ue,[e(`div`,We,[e(`div`,Ge,[e(`h2`,Ke,i(t.$t(`openaiimage.name.model`)),1),a(g,{content:t.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`openaiimage.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Je=Y(He,[[`render`,qe],[`__scopeId`,`data-v-a42acad4`]]);function Q(e){if(!e)return;let t=/^(\d+)x(\d+)$/.exec(e);if(t)return{w:Number(t[1]),h:Number(t[2])}}var Ye=_({name:`OpenAIImageSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,ElSwitch:O,ElInputNumber:D,InfoIcon:Z},data(){return{customMode:!1,customWidth:1024,customHeight:1024}},computed:{model(){return this.$store.state.openaiimage?.config?.model||`gpt-image-2`},storedSize(){return this.$store.state.openaiimage?.config?.size},emptySizeValue(){return``},customSupported(){return ie.includes(this.model)},presets(){return V[this.model]??V[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`||this.model===`gpt-image-2:official`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:ne},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:ae},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:U}]:[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:this.presets}]},useCustom:{get(){return this.customSupported&&this.customMode},set(e){if(!(e&&!this.customSupported))if(this.customMode=e,e){if(this.customError)return;this.commitSize(`${this.customWidth}x${this.customHeight}`)}else this.commitSize()}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.emptySizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return B},customError(){let e=this.customWidth,t=this.customHeight;return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?this.$t(`openaiimage.error.customSizePositive`):e%this.multiple!==0||t%this.multiple!==0?this.$t(`openaiimage.error.customSizeMultiple`,{multiple:this.multiple}):e<this.minSide||t<this.minSide?this.$t(`openaiimage.error.customSizeMin`,{min:this.minSide}):Math.max(e,t)>this.maxSide?this.$t(`openaiimage.error.customSizeMax`,{max:this.maxSide}):e*t>8294400?this.$t(`openaiimage.error.customSizePixels`,{pixels:te.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||this.presets.includes(e))return;let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h,!this.customError)||this.commitSize()}},storedSize(e){if(!e){this.customMode=!1;return}if(this.presets.includes(e)){this.customMode=!1;return}let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth!==t.w&&(this.customWidth=t.w),this.customHeight!==t.h&&(this.customHeight=t.h))},customWidth(){this.syncCustomToStore()},customHeight(){this.syncCustomToStore()}},mounted(){let e=this.storedSize,t=Q(e);e&&t&&this.customSupported&&!this.presets.includes(e)&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h)},methods:{commitSize(e){let t={...this.$store.state.openaiimage?.config};e?t.size=e:delete t.size,this.$store.commit(`openaiimage/setConfig`,t)},syncCustomToStore(){this.useCustom&&(this.customError||this.commitSize(`${this.customWidth}x${this.customHeight}`))}}}),Xe={class:`resolution`},Ze={class:`field`},Qe={class:`label`},$e={class:`box`},et={class:`title font-bold`},tt={class:`field custom-toggle`},nt={class:`label`},rt={class:`box`},it={class:`title font-bold`},at={key:0,class:`custom-inputs`},ot={class:`row`},st={class:`row-label`},ct={class:`row`},lt={class:`row-label`},ut={key:0,class:`error`};function dt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`),x=l(`el-switch`),S=l(`el-input-number`);return h(),s(`div`,Xe,[e(`div`,Ze,[e(`div`,Qe,[e(`div`,$e,[e(`h2`,et,i(t.$t(`openaiimage.name.size`)),1),a(_,{content:t.$t(`openaiimage.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.presetValue,"onUpdate:modelValue":n[0]||=e=>t.presetValue=e,class:`value`,placeholder:t.$t(`openaiimage.placeholder.select`),disabled:t.useCustom},{default:p(()=>[a(v,{label:t.$t(`suno.gender.auto`),value:t.emptySizeValue},null,8,[`label`,`value`]),(h(!0),s(c,null,m(t.presetGroups,e=>(h(),f(y,{key:e.label,label:e.label},{default:p(()=>[(h(!0),s(c,null,m(e.options,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])]),t.customSupported?(h(),s(c,{key:0},[e(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`h2`,it,i(t.$t(`openaiimage.name.customSize`)),1),a(_,{content:t.$t(`openaiimage.description.customSize`),class:`info`},null,8,[`content`])])]),a(x,{modelValue:t.useCustom,"onUpdate:modelValue":n[1]||=e=>t.useCustom=e,class:`value-switch`},null,8,[`modelValue`])]),t.useCustom?(h(),s(`div`,at,[e(`div`,ot,[e(`span`,st,i(t.$t(`openaiimage.name.width`)),1),a(S,{modelValue:t.customWidth,"onUpdate:modelValue":n[2]||=e=>t.customWidth=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),e(`div`,ct,[e(`span`,lt,i(t.$t(`openaiimage.name.height`)),1),a(S,{modelValue:t.customHeight,"onUpdate:modelValue":n[3]||=e=>t.customHeight=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),t.customError?(h(),s(`div`,ut,i(t.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var ft=_({name:`ConfigPanel`,components:{MagicIcon:R,ElButton:J,PromptInput:Pe,Consumption:ye,ImageUrlsInput:Ve,ModelSelector:Je,ResolutionSelector:Y(Ye,[[`render`,dt],[`__scopeId`,`data-v-dfce4922`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return pe({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),pt={class:`flex flex-col h-full`},mt={class:`flex-1 overflow-y-auto p-5`},ht={class:`flex flex-col items-center justify-center px-5 pb-5`};function gt(t,n,o,c,u,d){let f=l(`model-selector`),m=l(`resolution-selector`),g=l(`prompt-input`),_=l(`image-urls-input`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return h(),s(`div`,pt,[e(`div`,mt,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`})]),e(`div`,ht,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var _t=Y(ft,[[`render`,gt]]),vt=_({name:`TaskPreview`,components:{ApplicationIcon:k,ChannelIcon:j,DeleteIcon:F,ImageIcon:N,InfoIcon:P,LightningIcon:z,MagicIcon:R,TimeIcon:A,WarningIcon:I,CopyToClipboard:ge,ElAlert:C,ImageWrapper:Te,ElButton:J,ElTooltip:S,ImagePreview:X,ApiCodeButton:Ce,ReportButton:_e},props:{modelValue:{type:Object,required:!0}},computed:{isEditRequest(){let e=this.modelValue?.request;return this.modelValue?.type===`images_edits`||e?.action===`edit`||this.referenceImages.length>0},showTaskType(){return!!(this.modelValue?.request?.action||this.modelValue?.type||this.referenceImages.length>0)},taskTypeLabel(){return this.isEditRequest?this.$t(`openaiimage.name.edits`):this.$t(`openaiimage.name.generate`)},openaiimagePath(){return this.isEditRequest?`/openai/images/edits`:`/openai/images/generations`},openaiimageCodeBody(){let e=this.modelValue?.request;if(!e)return;let t={...e};if(delete t.action,delete t.callback_url,this.isEditRequest){delete t.image_urls,delete t.image;let e=this.referenceImages;e.length===1?t.image=e[0]:e.length>1&&(t.image=e)}else delete t.image_urls,delete t.image;return t},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{let n=t;if(n?.image_url||n?.url){e.push(n);return}n?.b64_json&&e.push({...n,url:`data:image/png;base64,${n.b64_json}`})}),e},referenceImages(){let e=this.modelValue?.request;if(!e)return[];let t=Array.isArray(e.image_urls)?e.image_urls:[];if(t.length>0)return t.filter(e=>typeof e==`string`&&e.length>0);let n=e.image;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.length>0):typeof n==`string`&&n.length>0?[n]:Array.isArray(e.images)?e.images.map(e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`)return e.image_url}).filter(e=>typeof e==`string`&&e.length>0):[]}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.openaiimage?.config||{}};t.image_urls=[e],this.$store.commit(`openaiimage/setConfig`,t)},async onDelete(){let e=this.modelValue?.id;if(e){try{await he.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(`openaiimage/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}}}}),yt={class:`preview`},bt={class:`left`},xt={class:`main`},St={class:`bot`},Ct={class:`datetime`},wt=[`aria-label`],Tt={class:`info`},Et={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Dt={key:1,class:`prompt mt-2`},Ot={key:0},kt={key:0,class:n({content:!0,failed:!0})},At={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},jt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Mt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:1,class:n({content:!0})},zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Gt={key:2,class:n({content:!0})},Kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Xt(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`image-wrapper`),w=l(`el-button`),T=l(`api-code-button`),E=l(`report-button`),D=l(`application-icon`),O=l(`image-icon`),k=l(`lightning-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`channel-icon`),P=l(`el-alert`),F=l(`warning-icon`),I=l(`info-icon`);return h(),s(`div`,yt,[e(`div`,bt,[a(y,{capability:`openaiimage`,part:`avatar`,class:`avatar`})]),e(`div`,xt,[e(`div`,St,[a(y,{capability:`openaiimage`,part:`name`}),e(`span`,Ct,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Tt,[n.referenceImages.length>0?(h(),s(`div`,Et,[(h(!0),s(c,null,m(n.referenceImages,(e,t)=>(h(),f(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,Dt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Ot,` - (`+i(n.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,kt,[e(`div`,At,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(C,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),e(`div`,jt,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(w,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url||n.images?.[0]?.url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:n.openaiimagePath,body:n.openaiimageCodeBody},null,8,[`path`,`body`]),a(E,{service:`openaiimage`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(P,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Mt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Nt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,Pt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Ft,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,It,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Lt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,Rt,[a(P,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,zt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Bt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Vt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Ht,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Ut,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Wt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Gt,[a(P,{closable:!1,class:`info`},{template:p(()=>[n.modelValue?.response?(h(),f(I,{key:1,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(h(),f(M,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(n.$t(n.modelValue?.response?`openaiimage.name.status`:`openaiimage.status.pending`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Kt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,qt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,Jt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Yt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Zt=_({name:`RecentPanel`,components:{TaskPreview:Y(vt,[[`render`,Xt],[`__scopeId`,`data-v-6519c932`]]),BotPlaceholder:we,NoTasks:xe,ScrollList:be},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.openaiimage?.tasks,items:this.$store.state.openaiimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Qt={key:0},$t={key:2,class:`w-full h-full flex items-center justify-center`};function en(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Qt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{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:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,$t,[a(v)])):o(``,!0)],64)}var tn=_({name:`OpenAIImageIndex`,components:{ConfigPanel:_t,Layout:je,RecentPanel:Y(Zt,[[`render`,en]])},mixins:[ue],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===w.Request},credential(){return this.$store.state.openaiimage?.credential},config(){return this.$store.state.openaiimage?.config},application(){return this.$store.state.openaiimage?.application},tasks(){return this.$store.state.openaiimage?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Se({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`openaiimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`openaiimage/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.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!le(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){T.error(this.$t(`openaiimage.message.promptRequired`));return}e.prompt=e.prompt.trim(),!t&&`image_urls`in e&&delete e.image_urls,e.size||delete e.size;let n={...e,action:`generate`,async:!0},r={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],async:!0};if(!me())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}T.info(this.$t(`openaiimage.message.startingTask`)),fe(`openaiimage`,t?q.edit(r,{token:i}):q.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),T.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?T.error(this.$t(`openaiimage.message.usedUp`)):T.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function nn(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var rn=Y(tn,[[`render`,nn]]);export{rn 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,ht as u,it as d,j as f,mt as p,rt as m,tt as h,x as g,z as _}from"./vendor-chart-Dw-P17PN.js";import{n as v,r as y,t as b}from"./select-BpS-bYES.js";import{t as x}from"./upload-jWHoCQb0.js";import{t as S}from"./tooltip-iglteC5t.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-CfZmiKuz.js";import{t as E}from"./drawer-Cnm2ONDq.js";import{t as D}from"./input-number-CXyGkQc9.js";import{t as O}from"./switch-VRq5ipbW.js";import{t as k}from"./box-BVRNvOkq.js";import{t as A}from"./clock-CVw8rZJk.js";import{r as j,t as M}from"./PromptTextarea-CAvwbYfl.js";import{t as N}from"./image-Dj2OLaW1.js";import{t as P}from"./info-CaaWfQ5G.js";import{t as F}from"./trash-2-DXpwwp30.js";import{t as I}from"./triangle-alert-BlTA75VV.js";import{t as L}from"./upload-BeiqlzEw.js";import{t as R}from"./wand-sparkles-M6We7RZu.js";import{t as z}from"./zap-B6cQ7gSm.js";import{Bn as ee,Fn as te,Gn as ne,Hn as re,In as ie,Kn as ae,Ln as oe,Pn as B,Un as V,Vn as H,qn as U,zn as W}from"./constants-DdiBRvPy.js";import{$t as G,Gt as K,Ln as q,Mi as J,O as Y,Qt as se,Xt as ce,Yt as le,Zt as ue,ii as de,kr as fe,tn as pe,un as me,vi as he}from"./index-DSIuJ3Ml.js";import{t as ge}from"./CopyToClipboard-DaW2jH2E.js";import{t as _e}from"./ReportButton-QNLl-twb.js";import{t as X}from"./ImagePreview-CZw5RcMp.js";import{n as ve}from"./taskDrawerMixin-DyAUhFEq.js";import{t as ye}from"./Consumption-JEEofYog.js";import{a as Z,n as be,r as xe,t as Se}from"./pagination-CGAsm_gH.js";import{t as Ce}from"./ApiCodeButton-BJzi5tyz.js";import{t as we}from"./BotPlaceholder-DLGHIQS6.js";import{t as Te}from"./ImageWrapper-qlYGoYD4.js";var Ee=_({name:`LayoutNanobanana`,components:{MagicIcon:R,ElDrawer:E,ElButton:J},mixins:[ve]}),De={class:`main flex flex-row flex-1`},Oe={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)]`},ke={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function Ae(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),_=l(`el-drawer`);return h(),s(`div`,De,[e(`div`,Oe,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,ke,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{size:`1em`,"aria-hidden":`true`,focusable:`false`})]),_:1},8,[`aria-label`,`title`]),[[g,!t.tasksEmpty]]),a(_,{modelValue:t.drawer,"onUpdate:modelValue":n[1]||=e=>t.drawer=e,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer generator-drawer`},{default:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var je=Y(Ee,[[`render`,Ae],[`__scopeId`,`data-v-fa2172a6`]]),Me=_({name:`PromptInput`,components:{PromptTextarea:M},computed:{prompt:{get(){return this.$store.state.openaiimage?.config?.prompt},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function Ne(e,t,n,r,i,a){let o=l(`prompt-textarea`);return h(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`openaiimage.name.prompt`),info:e.$t(`openaiimage.description.prompt`),placeholder:e.$t(`openaiimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Pe=Y(Me,[[`render`,Ne]]),Fe=_({name:`ImageUrlsInput`,components:{UploadIcon:L,ElUpload:x,ElButton:J,InfoIcon:Z,ImagePreview:X},mixins:[G,se,ce,K],data(){return{fileList:[],uploadUrl:de()+`/api/v1/files/`,suppressWatch:!1}},computed:{maxImages(){return 16},headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.openaiimage?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){T.warning(this.$t(`openaiimage.message.uploadImageExceed`,{count:16}))},onError(){T.error(this.$t(`openaiimage.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),Ie={class:`field flex min-h-8 w-full items-center justify-between gap-3`},Le={class:`flex min-w-0 items-center`},Re={class:`title m-0 text-[14px] font-bold`},ze={class:`file-list flex flex-wrap gap-[10px]`};function Be(t,n,o,u,d,g){let _=l(`info-icon`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`),x=l(`image-preview`);return h(),s(`div`,null,[e(`div`,Ie,[e(`div`,Le,[e(`h2`,Re,i(t.$t(`openaiimage.name.imageUrls`)),1),a(_,{content:t.$t(`openaiimage.description.imageUrls`)},null,8,[`content`])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value shrink-0`,limit:t.maxImages,multiple:!0,"show-file-list":!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-change":t.onChange,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(y,{size:`small`,type:`primary`,round:``},{default:p(()=>[a(v,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`limit`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])]),e(`div`,ze,[(h(!0),s(c,null,m(t.fileList,(e,n)=>(h(),f(x,{key:e.uid||e?.response?.file_url||e.url||n,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:r=>t.onRemovePreview(n,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])}var Ve=Y(Fe,[[`render`,Be]]),He=_({name:`OpenAIImageModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Z},data(){return{options:[{value:W,label:this.$t(`openaiimage.model.gptImage1`)},{value:ee,label:this.$t(`openaiimage.model.gptImage15`)},{value:H,label:this.$t(`openaiimage.model.gptImage2`)},{value:re,label:this.$t(`openaiimage.model.gptImage2Official`)}]}},computed:{value:{get(){return this.$store.state.openaiimage?.config?.model},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,model:e})}},modelDescription(){return this.$t(`openaiimage.description.model`)}},mounted(){this.value||=oe}}),Ue={class:`field`},We={class:`label`},Ge={class:`box`},Ke={class:`title font-bold`};function qe(t,n,r,o,u,d){let g=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return h(),s(`div`,Ue,[e(`div`,We,[e(`div`,Ge,[e(`h2`,Ke,i(t.$t(`openaiimage.name.model`)),1),a(g,{content:t.modelDescription,class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`openaiimage.placeholder.select`)},{default:p(()=>[(h(!0),s(c,null,m(t.options,e=>(h(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Je=Y(He,[[`render`,qe],[`__scopeId`,`data-v-a42acad4`]]);function Q(e){if(!e)return;let t=/^(\d+)x(\d+)$/.exec(e);if(t)return{w:Number(t[1]),h:Number(t[2])}}var Ye=_({name:`OpenAIImageSizeSelector`,components:{ElSelect:y,ElOption:b,ElOptionGroup:v,ElSwitch:O,ElInputNumber:D,InfoIcon:Z},data(){return{customMode:!1,customWidth:1024,customHeight:1024}},computed:{model(){return this.$store.state.openaiimage?.config?.model||`gpt-image-2`},storedSize(){return this.$store.state.openaiimage?.config?.size},emptySizeValue(){return``},customSupported(){return ie.includes(this.model)},presets(){return V[this.model]??V[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`||this.model===`gpt-image-2:official`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:ne},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:ae},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:U}]:[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:this.presets}]},useCustom:{get(){return this.customSupported&&this.customMode},set(e){if(!(e&&!this.customSupported))if(this.customMode=e,e){if(this.customError)return;this.commitSize(`${this.customWidth}x${this.customHeight}`)}else this.commitSize()}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.emptySizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return B},customError(){let e=this.customWidth,t=this.customHeight;return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?this.$t(`openaiimage.error.customSizePositive`):e%this.multiple!==0||t%this.multiple!==0?this.$t(`openaiimage.error.customSizeMultiple`,{multiple:this.multiple}):e<this.minSide||t<this.minSide?this.$t(`openaiimage.error.customSizeMin`,{min:this.minSide}):Math.max(e,t)>this.maxSide?this.$t(`openaiimage.error.customSizeMax`,{max:this.maxSide}):e*t>8294400?this.$t(`openaiimage.error.customSizePixels`,{pixels:te.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||this.presets.includes(e))return;let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h,!this.customError)||this.commitSize()}},storedSize(e){if(!e){this.customMode=!1;return}if(this.presets.includes(e)){this.customMode=!1;return}let t=Q(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth!==t.w&&(this.customWidth=t.w),this.customHeight!==t.h&&(this.customHeight=t.h))},customWidth(){this.syncCustomToStore()},customHeight(){this.syncCustomToStore()}},mounted(){let e=this.storedSize,t=Q(e);e&&t&&this.customSupported&&!this.presets.includes(e)&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h)},methods:{commitSize(e){let t={...this.$store.state.openaiimage?.config};e?t.size=e:delete t.size,this.$store.commit(`openaiimage/setConfig`,t)},syncCustomToStore(){this.useCustom&&(this.customError||this.commitSize(`${this.customWidth}x${this.customHeight}`))}}}),Xe={class:`resolution`},Ze={class:`field`},Qe={class:`label`},$e={class:`box`},et={class:`title font-bold`},tt={class:`field custom-toggle`},nt={class:`label`},rt={class:`box`},it={class:`title font-bold`},at={key:0,class:`custom-inputs`},ot={class:`row`},st={class:`row-label`},ct={class:`row`},lt={class:`row-label`},ut={key:0,class:`error`};function dt(t,n,r,u,d,g){let _=l(`info-icon`),v=l(`el-option`),y=l(`el-option-group`),b=l(`el-select`),x=l(`el-switch`),S=l(`el-input-number`);return h(),s(`div`,Xe,[e(`div`,Ze,[e(`div`,Qe,[e(`div`,$e,[e(`h2`,et,i(t.$t(`openaiimage.name.size`)),1),a(_,{content:t.$t(`openaiimage.description.size`),class:`info`},null,8,[`content`])])]),a(b,{modelValue:t.presetValue,"onUpdate:modelValue":n[0]||=e=>t.presetValue=e,class:`value`,placeholder:t.$t(`openaiimage.placeholder.select`),disabled:t.useCustom},{default:p(()=>[a(v,{label:t.$t(`suno.gender.auto`),value:t.emptySizeValue},null,8,[`label`,`value`]),(h(!0),s(c,null,m(t.presetGroups,e=>(h(),f(y,{key:e.label,label:e.label},{default:p(()=>[(h(!0),s(c,null,m(e.options,e=>(h(),f(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])]),t.customSupported?(h(),s(c,{key:0},[e(`div`,tt,[e(`div`,nt,[e(`div`,rt,[e(`h2`,it,i(t.$t(`openaiimage.name.customSize`)),1),a(_,{content:t.$t(`openaiimage.description.customSize`),class:`info`},null,8,[`content`])])]),a(x,{modelValue:t.useCustom,"onUpdate:modelValue":n[1]||=e=>t.useCustom=e,class:`value-switch`},null,8,[`modelValue`])]),t.useCustom?(h(),s(`div`,at,[e(`div`,ot,[e(`span`,st,i(t.$t(`openaiimage.name.width`)),1),a(S,{modelValue:t.customWidth,"onUpdate:modelValue":n[2]||=e=>t.customWidth=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),e(`div`,ct,[e(`span`,lt,i(t.$t(`openaiimage.name.height`)),1),a(S,{modelValue:t.customHeight,"onUpdate:modelValue":n[3]||=e=>t.customHeight=e,class:`row-input`,min:t.minSide,max:t.maxSide,step:t.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),t.customError?(h(),s(`div`,ut,i(t.customError),1)):o(``,!0)])):o(``,!0)],64)):o(``,!0)])}var ft=_({name:`ConfigPanel`,components:{MagicIcon:R,ElButton:J,PromptInput:Pe,Consumption:ye,ImageUrlsInput:Ve,ModelSelector:Je,ResolutionSelector:Y(Ye,[[`render`,dt],[`__scopeId`,`data-v-dfce4922`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return pe({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),pt={class:`flex flex-col h-full`},mt={class:`flex-1 overflow-y-auto p-5`},ht={class:`flex flex-col items-center justify-center px-5 pb-5`};function gt(t,n,o,c,u,d){let f=l(`model-selector`),m=l(`resolution-selector`),g=l(`prompt-input`),_=l(`image-urls-input`),v=l(`consumption`),y=l(`magic-icon`),b=l(`el-button`);return h(),s(`div`,pt,[e(`div`,mt,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(g,{class:`mb-4`}),a(_,{class:`mb-4`})]),e(`div`,ht,[a(v,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(b,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(y,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var _t=Y(ft,[[`render`,gt]]),vt=_({name:`TaskPreview`,components:{ApplicationIcon:k,ChannelIcon:j,DeleteIcon:F,ImageIcon:N,InfoIcon:P,LightningIcon:z,MagicIcon:R,TimeIcon:A,WarningIcon:I,CopyToClipboard:ge,ElAlert:C,ImageWrapper:Te,ElButton:J,ElTooltip:S,ImagePreview:X,ApiCodeButton:Ce,ReportButton:_e},props:{modelValue:{type:Object,required:!0}},computed:{isEditRequest(){let e=this.modelValue?.request;return this.modelValue?.type===`images_edits`||e?.action===`edit`||this.referenceImages.length>0},showTaskType(){return!!(this.modelValue?.request?.action||this.modelValue?.type||this.referenceImages.length>0)},taskTypeLabel(){return this.isEditRequest?this.$t(`openaiimage.name.edits`):this.$t(`openaiimage.name.generate`)},openaiimagePath(){return this.isEditRequest?`/openai/images/edits`:`/openai/images/generations`},openaiimageCodeBody(){let e=this.modelValue?.request;if(!e)return;let t={...e};if(delete t.action,delete t.callback_url,this.isEditRequest){delete t.image_urls,delete t.image;let e=this.referenceImages;e.length===1?t.image=e[0]:e.length>1&&(t.image=e)}else delete t.image_urls,delete t.image;return t},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{let n=t;if(n?.image_url||n?.url){e.push(n);return}n?.b64_json&&e.push({...n,url:`data:image/png;base64,${n.b64_json}`})}),e},referenceImages(){let e=this.modelValue?.request;if(!e)return[];let t=Array.isArray(e.image_urls)?e.image_urls:[];if(t.length>0)return t.filter(e=>typeof e==`string`&&e.length>0);let n=e.image;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.length>0):typeof n==`string`&&n.length>0?[n]:Array.isArray(e.images)?e.images.map(e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`)return e.image_url}).filter(e=>typeof e==`string`&&e.length>0):[]}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.openaiimage?.config||{}};t.image_urls=[e],this.$store.commit(`openaiimage/setConfig`,t)},async onDelete(){let e=this.modelValue?.id;if(e){try{await he.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(`openaiimage/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}}}}),yt={class:`preview`},bt={class:`left`},xt={class:`main`},St={class:`bot`},Ct={class:`datetime`},wt=[`aria-label`],Tt={class:`info`},Et={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Dt={key:1,class:`prompt mt-2`},Ot={key:0},kt={key:0,class:n({content:!0,failed:!0})},At={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},jt={class:n({operations:!0,"mt-2":!0,"mb-2":!0})},Mt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Pt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Rt={key:1,class:n({content:!0})},zt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Bt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},$={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Vt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ht={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ut={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Wt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Gt={key:2,class:n({content:!0})},Kt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},qt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Jt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Yt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Xt(n,u,d,g,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`image-wrapper`),w=l(`el-button`),T=l(`api-code-button`),E=l(`report-button`),D=l(`application-icon`),O=l(`image-icon`),k=l(`lightning-icon`),A=l(`magic-icon`),j=l(`copy-to-clipboard`),M=l(`time-icon`),N=l(`channel-icon`),P=l(`el-alert`),F=l(`warning-icon`),I=l(`info-icon`);return h(),s(`div`,yt,[e(`div`,bt,[a(y,{capability:`openaiimage`,part:`avatar`,class:`avatar`})]),e(`div`,xt,[e(`div`,St,[a(y,{capability:`openaiimage`,part:`name`}),e(`span`,Ct,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(h(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,wt)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Tt,[n.referenceImages.length>0?(h(),s(`div`,Et,[(h(!0),s(c,null,m(n.referenceImages,(e,t)=>(h(),f(S,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):o(``,!0),n.modelValue?.request?.prompt?(h(),s(`p`,Dt,[r(i(n.modelValue?.request?.prompt)+` `,1),n.modelValue?.response?o(``,!0):(h(),s(`span`,Ot,` - (`+i(n.$t(`openaiimage.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?.success===!0?(h(),s(`div`,kt,[e(`div`,At,[(h(!0),s(c,null,m(n.images,(e,t)=>(h(),f(C,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),e(`div`,jt,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`common.button.edit`),placement:`top-start`},{default:p(()=>[a(w,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onEdit(n.images?.[0]?.image_url||n.images?.[0]?.url),[`stop`])},{default:p(()=>[r(i(n.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),a(T,{path:n.openaiimagePath,body:n.openaiimageCodeBody},null,8,[`path`,`body`]),a(E,{service:`openaiimage`,"target-id":n.modelValue?.id,snapshot:{prompt:n.modelValue?.request?.prompt}},null,8,[`target-id`,`snapshot`])]),a(P,{closable:!1,class:`mt-2 success`},{default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Mt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Nt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,Pt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Ft,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,It,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Lt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(h(),s(`div`,Rt,[a(P,{closable:!1,class:`failure`},{template:p(()=>[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failure`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,zt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,Bt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,$,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Vt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),e(`p`,Ht,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(j,{content:n.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),n.modelValue?.elapsed?(h(),s(`p`,Ut,[a(M,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(h(),s(`p`,Wt,[a(N,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(j,{content:n.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):o(``,!0)]),_:1})])):(h(),s(`div`,Gt,[a(P,{closable:!1,class:`info`},{template:p(()=>[n.modelValue?.response?(h(),f(I,{key:1,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})):(h(),f(M,{key:0,class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`})),r(` `+i(n.$t(n.modelValue?.response?`openaiimage.name.status`:`openaiimage.status.pending`)),1)]),default:p(()=>[n.modelValue?.request?.model?(h(),s(`p`,Kt,[a(D,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.modelValue?.request?.size?(h(),s(`p`,qt,[a(O,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.size`))+`: `+i(n.modelValue?.request?.size),1)])):o(``,!0),n.showTaskType?(h(),s(`p`,Jt,[a(k,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.task`))+`: `+i(n.taskTypeLabel),1)])):o(``,!0),e(`p`,Yt,[a(A,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`openaiimage.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(j,{content:n.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var Zt=_({name:`RecentPanel`,components:{TaskPreview:Y(vt,[[`render`,Xt],[`__scopeId`,`data-v-6519c932`]]),BotPlaceholder:we,NoTasks:xe,ScrollList:be},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.openaiimage?.tasks,items:this.$store.state.openaiimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Qt={key:0},$t={key:2,class:`w-full h-full flex items-center justify-center`};function en(e,t,n,r,i,u){let d=l(`bot-placeholder`),g=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return h(),s(c,null,[e.tasks?.items===void 0?(h(),s(`div`,Qt,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(h(),f(_,{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:p(()=>[(h(!0),s(c,null,m(e.tasks?.items,e=>(h(),f(g,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(h(),s(`div`,$t,[a(v)])):o(``,!0)],64)}var tn=_({name:`OpenAIImageIndex`,components:{ConfigPanel:_t,Layout:je,RecentPanel:Y(Zt,[[`render`,en]])},mixins:[ue],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===w.Request},credential(){return this.$store.state.openaiimage?.credential},config(){return this.$store.state.openaiimage?.config},application(){return this.$store.state.openaiimage?.application},tasks(){return this.$store.state.openaiimage?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Se({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`openaiimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`openaiimage/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.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!le(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){T.error(this.$t(`openaiimage.message.promptRequired`));return}e.prompt=e.prompt.trim(),!t&&`image_urls`in e&&delete e.image_urls,e.size||delete e.size;let n={...e,action:`generate`,async:!0},r={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],async:!0};if(!me())return;let i=this.credential?.token;if(!i){console.error(`no token specified`);return}T.info(this.$t(`openaiimage.message.startingTask`)),fe(`openaiimage`,t?q.edit(r,{token:i}):q.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),T.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?T.error(this.$t(`openaiimage.message.usedUp`)):T.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function nn(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return h(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var rn=Y(tn,[[`render`,nn]]);export{rn 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,ht as u,it as d,j as f,mt as p,qt 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-1w7Zpr6O.js";import{t as x}from"./upload-CVuy8NY8.js";import{t as S}from"./tooltip-CnN93uDP.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-BAyJ5pH0.js";import{t as E}from"./drawer-BoDb3Fpk.js";import{t as D}from"./input-number-D5Q8Bypi.js";import{t as O}from"./switch-Ddz6wK95.js";import{t as k}from"./box-BprjWv9J.js";import{t as A}from"./clock-BWo5B4kH.js";import{n as j,r as M,t as N}from"./PromptTextarea-CkuHuU4h.js";import{t as P}from"./info-Ckusq785.js";import{t as F}from"./trash-2-C5utNutX.js";import{t as I}from"./triangle-alert-DkHeaWG2.js";import{t as L}from"./upload-Bcc_2RIh.js";import{t as R}from"./volume-2-C2qDPZzt.js";import{t as z}from"./wand-sparkles-Duz2fMGa.js";import{$t as ee,Qt as te,_n as B,an as ne,cn as re,dn as ie,fn as ae,gn as V,hn as H,in as oe,ln as se,mn as ce,nn as le,on as ue,pn as de,rn as fe,sn as pe,un as me,yn as U}from"./constants-FVNrPctQ.js";import{$t as W,Fn as he,Gt as G,Mi as K,O as q,Qt as J,Xt as Y,Yt as ge,Zt as _e,ii as X,kr as ve,tn as ye,un as be,vi as xe}from"./index-DCEwxRXS.js";import{t as Se}from"./CopyToClipboard-BJY08VAg.js";import{t as Ce}from"./ReportButton-C11rSSUR.js";import{t as Z}from"./ImagePreview-Cp9W6Bga.js";import{n as we}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Te}from"./Consumption-Df5_TTmd.js";import{a as Q,n as Ee,r as De,t as Oe}from"./pagination-Zcuxd8JC.js";import{t as ke}from"./VideoPlayer-DdGrgCh3.js";import{t as Ae}from"./ApiCodeButton-l1_BzkCH.js";import{t as je}from"./BotPlaceholder-ozgWBXZZ.js";import{t as Me}from"./ImageWrapper-ykkNZD7e.js";import{n as Ne,t as Pe}from"./AudioPreview-CSDaj9pT.js";var Fe=v({name:`LayoutSeedance`,components:{MagicIcon:z,ElDrawer:E,ElButton:K},mixins:[we]}),Ie={class:`main flex flex-row flex-1`},Le={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)]`},Re={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ze(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ie,[e(`div`,Le,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Re,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{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:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Be=q(Fe,[[`render`,ze],[`__scopeId`,`data-v-ff53dce1`]]),Ve=v({name:`SeedancePromptInput`,components:{PromptTextarea:N},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function He(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ue=q(Ve,[[`render`,He]]),We=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:pe,label:this.$t(`seedance.model.seedance20`)},{value:re,label:this.$t(`seedance.model.seedance20Fast`)},{value:se,label:this.$t(`seedance.model.seedance20Mini`)},{value:ue,label:this.$t(`seedance.model.seedance15pro`)},{value:oe,label:this.$t(`seedance.model.seedance10pro`)},{value:ne,label:this.$t(`seedance.model.seedance10proFast`)},{value:fe,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:le,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=te}}),Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`};function Ye(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`h2`,Je,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Xe=q(We,[[`render`,Ye],[`__scopeId`,`data-v-deb4c429`]]),Ze=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),Qe={class:`field`},$e={class:`label`},et={class:`box`},tt={class:`title font-bold`};function nt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Qe,[e(`div`,$e,[e(`div`,et,[e(`h2`,tt,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var rt=q(Ze,[[`render`,nt],[`__scopeId`,`data-v-d61cc21b`]]),$={[V]:0,[B]:1,[H]:2,"4k":3},it=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:Q,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},options(){let e=[{value:V,label:`480p`},{value:B,label:`720p`},{value:H,label:`1080p`},{value:`4k`,label:`4k`}],t=$[this.capability.maxResolution]??$[`1080p`];return e.map(e=>({...e,disabled:$[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),at={class:`resolution`},ot={class:`header`},st={class:`title font-bold`},ct={class:`items`},lt=[`onClick`];function ut(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,at,[e(`div`,ot,[e(`h2`,st,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,ct,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,lt)]),_:2},1032,[`content`,`disabled`]))),128))])])}var dt=q(it,[[`render`,ut],[`__scopeId`,`data-v-db7e8aff`]]),ft=v({name:`SeedanceRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:ie,label:`16:9`,w:32,h:18},{value:de,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:ae,label:`21:9`,w:34,h:14},{value:ce,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=ee}}),pt={class:`ratio`},mt={class:`header`},ht={class:`title font-bold`},gt={class:`items`},_t=[`onClick`],vt={class:`preview`},yt={key:1,class:`rect rect-auto`},bt={class:`name`};function xt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,pt,[e(`div`,mt,[e(`h2`,ht,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,gt,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,vt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,yt,`A`))]),e(`div`,bt,i(r.label),1)],10,_t))),128))])])}var St=q(ft,[[`render`,xt],[`__scopeId`,`data-v-8ddec2dd`]]),Ct=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:O,InfoIcon:Q},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return U(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),wt={key:0,class:`field`},Tt={class:`label`},Et={class:`box`},Dt={class:`title font-bold`},Ot={class:`value`};function kt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,wt,[e(`div`,Tt,[e(`div`,Et,[e(`h2`,Dt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,Ot,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var At=q(Ct,[[`render`,kt],[`__scopeId`,`data-v-df51dfbd`]]),jt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:O,InfoIcon:Q},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),Mt={class:`field`},Nt={class:`label`},Pt={class:`box`},Ft={class:`title font-bold`},It={class:`value`};function Lt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Mt,[e(`div`,Nt,[e(`div`,Pt,[e(`h2`,Ft,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,It,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var Rt=q(jt,[[`render`,Lt],[`__scopeId`,`data-v-ae777d61`]]),zt=v({name:`SeedanceFirstFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:K,InfoIcon:Q,ImagePreview:Z},mixins:[W,J,Y,G],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),Bt={key:0,class:`relative`},Vt={class:`flex min-h-8 items-center pr-20`},Ht={class:`flex justify-start items-center`},Ut={class:`text-sm font-bold`},Wt={key:0,class:`required-badge`};function Gt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,Bt,[e(`div`,Vt,[e(`div`,Ht,[e(`span`,Ut,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,Wt,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{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:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Kt=q(zt,[[`render`,Gt],[`__scopeId`,`data-v-9ed26f7d`]]),qt=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:K,ImagePreview:Z,InfoIcon:Q},mixins:[W,J,Y,G],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),Jt={key:0,class:`relative`},Yt={class:`flex min-h-8 items-center pr-20`},Xt={class:`flex justify-start items-center`},Zt={class:`text-sm font-bold`};function Qt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,Jt,[e(`div`,Yt,[e(`div`,Xt,[e(`span`,Zt,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{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:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var $t=q(qt,[[`render`,Qt],[`__scopeId`,`data-v-9b573754`]]),en=v({name:`SeedanceReferenceImage`,components:{UploadIcon:L,ElUpload:x,ElButton:K,InfoIcon:Q,ImagePreview:Z},mixins:[W,J,Y,G],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),tn={key:0,class:`relative`},nn={class:`flex min-h-8 items-center pr-20`},rn={class:`flex justify-start items-center`},an={class:`text-sm font-bold`};function on(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,tn,[e(`div`,nn,[e(`div`,rn,[e(`span`,an,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{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:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var sn=q(en,[[`render`,on],[`__scopeId`,`data-v-3ae3845d`]]),cn=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:L,ElUpload:x,ElButton:K,InfoIcon:Q},mixins:[J,Y,G],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),ln={key:0,class:`relative`},un={class:`flex min-h-8 items-center pr-20`},dn={class:`flex justify-start items-center`},fn={class:`text-sm font-bold`};function pn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,ln,[e(`div`,un,[e(`div`,dn,[e(`span`,fn,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var mn=q(cn,[[`render`,pn],[`__scopeId`,`data-v-99f6c8be`]]),hn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:L,ElUpload:x,ElButton:K,InfoIcon:Q},mixins:[J,Y,G],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),gn={key:0,class:`relative`},_n={class:`flex min-h-8 items-center pr-20`},vn={class:`flex justify-start items-center`},yn={class:`text-sm font-bold`};function bn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,gn,[e(`div`,_n,[e(`div`,vn,[e(`span`,yn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var xn=q(hn,[[`render`,bn],[`__scopeId`,`data-v-21bc6757`]]),Sn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:O,InfoIcon:Q},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return U(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),Cn={key:0,class:`field`},wn={class:`label`},Tn={class:`box`},En={class:`title font-bold`},Dn={class:`value`};function On(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,Cn,[e(`div`,wn,[e(`div`,Tn,[e(`h2`,En,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Dn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var kn=q(Sn,[[`render`,On],[`__scopeId`,`data-v-edea5451`]]),An=v({name:`SeedanceSeedInput`,components:{ElInputNumber:D,InfoIcon:Q},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),jn={class:`field`},Mn={class:`label`},Nn={class:`box`},Pn={class:`title font-bold`},Fn={class:`value`};function In(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,jn,[e(`div`,Mn,[e(`div`,Nn,[e(`h2`,Pn,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Fn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var Ln=v({name:`SeedanceConfigPanel`,components:{MagicIcon:z,ElButton:K,PromptInput:Ue,ModelSelector:Xe,DurationSelector:rt,ResolutionSelector:dt,RatioSelector:St,GenerateAudioSwitch:At,CameraFixedSwitch:Rt,ReturnLastFrameSwitch:kn,SeedInput:q(An,[[`render`,In],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:Kt,LastFrameImage:$t,ReferenceImage:sn,ReferenceAudio:mn,ReferenceVideo:xn,Consumption:Te},emits:[`generate`],computed:{config(){return this.$store.state.seedance?.config},consumption(){return ye(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Rn={class:`flex flex-col h-full`},zn={class:`flex-1 overflow-y-auto p-5`},Bn={class:`flex flex-col items-center justify-center px-5 pb-5`};function Vn(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`model-selector`),h=l(`ratio-selector`),_=l(`resolution-selector`),v=l(`duration-selector`),y=l(`generate-audio-switch`),b=l(`camera-fixed-switch`),x=l(`return-last-frame-switch`),S=l(`seed-input`),C=l(`first-frame-image`),w=l(`last-frame-image`),T=l(`reference-image`),E=l(`reference-audio`),D=l(`reference-video`),O=l(`consumption`),k=l(`magic-icon`),A=l(`el-button`);return g(),s(`div`,Rn,[e(`div`,zn,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),a(E,{class:`mb-4`}),a(D,{class:`mb-4`})]),e(`div`,Bn,[a(O,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Hn=q(Ln,[[`render`,Vn]]),Un=v({name:`SeedanceTaskPreview`,components:{DeleteIcon:F,ApplicationIcon:k,ChannelIcon:M,FullscreenIcon:j,InfoIcon:P,MagicIcon:z,TimeIcon:A,VolumeIcon:R,WarningIcon:I,CopyToClipboard:Se,ElAlert:C,VideoPlayer:ke,ElTooltip:S,ElButton:K,ImageWrapper:Me,ImagePreview:Z,AudioPreview:Pe,VideoPreview:Ne,ApiCodeButton:Ae,ReportButton:Ce},props:{modelValue:{type:Object,required:!0}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await xe.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(`seedance/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),Wn={class:`preview`},Gn={class:`left`},Kn={class:`main`},qn={class:`bot`},Jn={class:`datetime`},Yn=[`aria-label`],Xn={class:`info`},Zn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Qn={key:1,class:`prompt mt-2`},$n={key:0},er={key:1},tr={key:0,class:n({content:!0})},nr={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},rr={key:1,class:n({content:!0})},ir={key:0,class:`mb-4`},ar={key:1,class:`mb-4`},or={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},sr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},lr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ur={key:0},dr={key:1},fr={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},gr={key:2,class:n({content:!0})},_r={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},br={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},xr={key:3,class:n({content:!0})},Sr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Cr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function wr(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`audio-preview`),w=l(`video-preview`),T=l(`time-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`el-alert`),k=l(`video-player`),A=l(`image-wrapper`),j=l(`el-button`),M=l(`api-code-button`),N=l(`report-button`),P=l(`application-icon`),F=l(`fullscreen-icon`),I=l(`volume-icon`),L=l(`channel-icon`),R=l(`warning-icon`),z=l(`info-icon`);return g(),s(`div`,Wn,[e(`div`,Gn,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Kn,[e(`div`,qn,[a(y,{capability:`seedance`,part:`name`}),e(`span`,Jn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Yn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Xn,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Zn,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(C,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(w,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Qn,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,er,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,$n,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,rr,[n.video?.video_url?(g(),s(`div`,ir,[a(k,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,ar,[a(A,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,or,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(j,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(M,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`]),a(N,{service:`seedance`,"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:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,sr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,cr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,lr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,ur,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,dr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,fr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,pr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,mr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,hr,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,gr,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(R,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,_r,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,vr,[a(z,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,yr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,br,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,xr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(z,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,Sr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Cr,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,tr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,nr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var Tr=v({name:`SeedanceRecentPanel`,components:{TaskPreview:q(Un,[[`render`,wr],[`__scopeId`,`data-v-91bf07f2`]]),BotPlaceholder:je,NoTasks:De,ScrollList:Ee},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Er={key:0},Dr={key:2,class:`w-full h-full flex items-center justify-center`};function Or(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Er,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{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:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Dr,[a(v)])):o(``,!0)],64)}var kr=q(Tr,[[`render`,Or]]),Ar=new Set(Object.keys(me)),jr=e=>Array.isArray(e)?e.filter(e=>!!e?.url):[];function Mr(e){let t={...e||{}};if(typeof t.prompt==`string`&&(t.prompt=t.prompt.trim(),t.prompt||delete t.prompt),t.model&&!Ar.has(t.model))return{reject:`modelUnsupported`};let n=U(t.model);t.images=jr(t.images);let r=t.images.some(e=>e.role===`first_frame`),i=t.images.some(e=>e.role===`last_frame`);!r&&i&&(t.images=t.images.map(e=>e.role===`last_frame`?{...e,role:`first_frame`}:e));let a=t.images.length>0;if(a||delete t.images,delete t.service_tier,!n.acceptsImage&&a)return{reject:`modelRejectsImage`};if(!n.acceptsAudio&&t.generate_audio&&(t.generate_audio=!1),!n.acceptsReturnLastFrame&&t.return_last_frame&&(t.return_last_frame=!1),!n.acceptsLastFrame&&a&&(t.images=t.images.filter(e=>e.role!==`last_frame`),a=t.images.length>0,a||delete t.images),n.acceptsReferenceAudio&&Array.isArray(t.audios)&&(t.audios=t.audios.filter(e=>e?.url)),(!n.acceptsReferenceAudio||!Array.isArray(t.audios)||t.audios.length===0)&&delete t.audios,n.acceptsReferenceVideo&&Array.isArray(t.videos)&&(t.videos=t.videos.filter(e=>e?.url)),(!n.acceptsReferenceVideo||!Array.isArray(t.videos)||t.videos.length===0)&&delete t.videos,!n.acceptsReferenceImage&&Array.isArray(t.images)&&(t.images=t.images.filter(e=>e.role!==`reference_image`),t.images.length===0&&delete t.images),a=Array.isArray(t.images)&&t.images.length>0,n.requiresImage&&!a||!n.acceptsText&&!a)return{reject:`modelRequiresImage`};let o=Array.isArray(t.videos)&&t.videos.length>0;return Array.isArray(t.audios)&&t.audios.length>0&&!a&&!o?{reject:`audioRequiresReference`}:{request:{...t,async:!0}}}var Nr=v({name:`SeedanceIndex`,components:{ConfigPanel:Hn,Layout:Be,RecentPanel:kr},mixins:[_e],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Oe({tasks: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(`seedance/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(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ge(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let{request:e,reject:t}=Mr(this.config);if(t){T.warning(this.$t(`seedance.message.${t}`));return}if(!e||!be())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}T.info(this.$t(`seedance.message.startingTask`)),ve(`seedance`,he.generate(e,{token:n})).then(()=>{T.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?T.error(this.$t(`seedance.message.usedUp`)):T.error(this.$t(`seedance.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Pr(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Fr=q(Nr,[[`render`,Pr]]);export{Fr 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,ht as u,it as d,j as f,mt as p,qt 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-BpS-bYES.js";import{t as x}from"./upload-jWHoCQb0.js";import{t as S}from"./tooltip-iglteC5t.js";import{t as C}from"./alert-BprQRUmf.js";import{h as w,v as T}from"./models-CfZmiKuz.js";import{t as E}from"./drawer-Cnm2ONDq.js";import{t as D}from"./input-number-CXyGkQc9.js";import{t as O}from"./switch-VRq5ipbW.js";import{t as k}from"./box-BVRNvOkq.js";import{t as A}from"./clock-CVw8rZJk.js";import{n as j,r as M,t as N}from"./PromptTextarea-CAvwbYfl.js";import{t as P}from"./info-CaaWfQ5G.js";import{t as F}from"./trash-2-DXpwwp30.js";import{t as I}from"./triangle-alert-BlTA75VV.js";import{t as L}from"./upload-BeiqlzEw.js";import{t as R}from"./volume-2-Bg8G9NGT.js";import{t as z}from"./wand-sparkles-M6We7RZu.js";import{$t as ee,Qt as te,_n as B,an as ne,cn as re,dn as ie,fn as ae,gn as V,hn as H,in as oe,ln as se,mn as ce,nn as le,on as ue,pn as de,rn as fe,sn as pe,un as me,yn as U}from"./constants-DdiBRvPy.js";import{$t as W,Fn as he,Gt as G,Mi as K,O as q,Qt as J,Xt as Y,Yt as ge,Zt as _e,ii as X,kr as ve,tn as ye,un as be,vi as xe}from"./index-DSIuJ3Ml.js";import{t as Se}from"./CopyToClipboard-DaW2jH2E.js";import{t as Ce}from"./ReportButton-QNLl-twb.js";import{t as Z}from"./ImagePreview-CZw5RcMp.js";import{n as we}from"./taskDrawerMixin-DyAUhFEq.js";import{t as Te}from"./Consumption-JEEofYog.js";import{a as Q,n as Ee,r as De,t as Oe}from"./pagination-CGAsm_gH.js";import{t as ke}from"./VideoPlayer-CFlwMJfi.js";import{t as Ae}from"./ApiCodeButton-BJzi5tyz.js";import{t as je}from"./BotPlaceholder-DLGHIQS6.js";import{t as Me}from"./ImageWrapper-qlYGoYD4.js";import{n as Ne,t as Pe}from"./AudioPreview-DHnIvnV1.js";var Fe=v({name:`LayoutSeedance`,components:{MagicIcon:z,ElDrawer:E,ElButton:K},mixins:[we]}),Ie={class:`main flex flex-row flex-1`},Le={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)]`},Re={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ze(t,n,r,i,o,c){let f=l(`magic-icon`),m=l(`el-button`),h=l(`el-drawer`);return g(),s(`div`,Ie,[e(`div`,Le,[d(t.$slots,`config`,{},void 0,!0)]),e(`div`,Re,[d(t.$slots,`result`,{},void 0,!0)]),u(a(m,{circle:``,class:`menu`,"aria-label":t.$t(`common.button.openMenu`),title:t.$t(`common.button.openMenu`),onClick:n[0]||=e=>t.drawer=!0},{default:p(()=>[a(f,{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:p(()=>[d(t.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var Be=q(Fe,[[`render`,ze],[`__scopeId`,`data-v-ff53dce1`]]),Ve=v({name:`SeedancePromptInput`,components:{PromptTextarea:N},computed:{prompt:{get(){return this.$store.state.seedance?.config?.prompt},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,prompt:e})}}},mounted(){this.prompt||=``}});function He(e,t,n,r,i,a){let o=l(`prompt-textarea`);return g(),f(o,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedance.name.prompt`),info:e.$t(`seedance.description.prompt`),placeholder:e.$t(`seedance.placeholder.prompt`),"min-rows":5},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Ue=q(Ve,[[`render`,He]]),We=v({name:`SeedanceModelSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},data(){return{options:[{value:pe,label:this.$t(`seedance.model.seedance20`)},{value:re,label:this.$t(`seedance.model.seedance20Fast`)},{value:se,label:this.$t(`seedance.model.seedance20Mini`)},{value:ue,label:this.$t(`seedance.model.seedance15pro`)},{value:oe,label:this.$t(`seedance.model.seedance10pro`)},{value:ne,label:this.$t(`seedance.model.seedance10proFast`)},{value:fe,label:this.$t(`seedance.model.seedance10liteT2v`)},{value:le,label:this.$t(`seedance.model.seedance10liteI2v`)}]}},computed:{value:{get(){return this.$store.state.seedance?.config?.model},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,model:e})}}},mounted(){this.value||=te}}),Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`};function Ye(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Ge,[e(`div`,Ke,[e(`div`,qe,[e(`h2`,Je,i(t.$t(`seedance.name.model`)),1),a(m,{content:t.$t(`seedance.description.model`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Xe=q(We,[[`render`,Ye],[`__scopeId`,`data-v-deb4c429`]]),Ze=v({name:`SeedanceDurationSelector`,components:{ElSelect:y,ElOption:b,InfoIcon:Q},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},options(){let e=[];this.capability.supportsAutoDuration&&e.push({value:-1,label:`${this.$t(`seedance.placeholder.seed`)} (-1)`});for(let t=this.capability.minDuration;t<=this.capability.maxDuration;t++)e.push({value:t,label:`${t}s`});return e},value:{get(){return this.$store.state.seedance?.config?.duration},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,duration:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=5},methods:{clampValue(){let e=this.value;e!==void 0&&!(e===-1&&this.capability.supportsAutoDuration)&&(e<this.capability.minDuration||e>this.capability.maxDuration)&&(this.value=5)}}}),Qe={class:`field`},$e={class:`label`},et={class:`box`},tt={class:`title font-bold`};function nt(t,n,r,o,u,d){let m=l(`info-icon`),_=l(`el-option`),v=l(`el-select`);return g(),s(`div`,Qe,[e(`div`,$e,[e(`div`,et,[e(`h2`,tt,i(t.$t(`seedance.name.duration`)),1),a(m,{content:t.$t(`seedance.description.duration`),class:`info`},null,8,[`content`])])]),a(v,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,class:`value`,placeholder:t.$t(`seedance.placeholder.select`)},{default:p(()=>[(g(!0),s(c,null,h(t.options,e=>(g(),f(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var rt=q(Ze,[[`render`,nt],[`__scopeId`,`data-v-d61cc21b`]]),$={[V]:0,[B]:1,[H]:2,"4k":3},it=v({name:`SeedanceResolutionSelector`,components:{InfoIcon:Q,ElTooltip:S},computed:{model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},options(){let e=[{value:V,label:`480p`},{value:B,label:`720p`},{value:H,label:`1080p`},{value:`4k`,label:`4k`}],t=$[this.capability.maxResolution]??$[`1080p`];return e.map(e=>({...e,disabled:$[e.value]>t}))},value:{get(){return this.$store.state.seedance?.config?.resolution},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,resolution:e})}}},watch:{model(){this.clampValue()}},mounted(){this.value?this.clampValue():this.value=this.capability.defaultResolution||`720p`},methods:{onSelect(e){e.disabled||(this.value=e.value)},clampValue(){let e=this.value,t=this.options.find(t=>t.value===e);(!e||t&&t.disabled)&&(this.value=this.capability.defaultResolution||`720p`)}}}),at={class:`resolution`},ot={class:`header`},st={class:`title font-bold`},ct={class:`items`},lt=[`onClick`];function ut(t,r,o,u,d,m){let _=l(`info-icon`),v=l(`el-tooltip`);return g(),s(`div`,at,[e(`div`,ot,[e(`h2`,st,i(t.$t(`seedance.name.resolution`)),1),a(_,{content:t.$t(`seedance.description.resolution`),class:`info`},null,8,[`content`])]),e(`div`,ct,[(g(!0),s(c,null,h(t.options,r=>(g(),f(v,{key:r.value,content:t.$t(`seedance.message.resolutionNotSupported`),disabled:!r.disabled,placement:`top`},{default:p(()=>[e(`div`,{class:n([`item`,{active:t.value===r.value,disabled:r.disabled}]),onClick:e=>t.onSelect(r)},i(r.label),11,lt)]),_:2},1032,[`content`,`disabled`]))),128))])])}var dt=q(it,[[`render`,ut],[`__scopeId`,`data-v-db7e8aff`]]),ft=v({name:`SeedanceRatioSelector`,components:{InfoIcon:Q},computed:{options(){return[{value:ie,label:`16:9`,w:32,h:18},{value:de,label:`9:16`,w:18,h:32},{value:`4:3`,label:`4:3`,w:28,h:21},{value:`3:4`,label:`3:4`,w:21,h:28},{value:`1:1`,label:`1:1`,w:24,h:24},{value:ae,label:`21:9`,w:34,h:14},{value:ce,label:this.$t(`seedance.ratio.adaptive`),w:0,h:0}]},value:{get(){return this.$store.state.seedance?.config?.ratio},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,ratio:e})}}},mounted(){this.value||=ee}}),pt={class:`ratio`},mt={class:`header`},ht={class:`title font-bold`},gt={class:`items`},_t=[`onClick`],vt={class:`preview`},yt={key:1,class:`rect rect-auto`},bt={class:`name`};function xt(t,r,o,u,d,f){let p=l(`info-icon`);return g(),s(`div`,pt,[e(`div`,mt,[e(`h2`,ht,i(t.$t(`seedance.name.ratio`)),1),a(p,{content:t.$t(`seedance.description.ratio`),class:`info`},null,8,[`content`])]),e(`div`,gt,[(g(!0),s(c,null,h(t.options,r=>(g(),s(`div`,{key:r.value,class:n([`item`,{active:t.value===r.value}]),onClick:e=>t.value=r.value},[e(`div`,vt,[r.w&&r.h?(g(),s(`div`,{key:0,class:`rect`,style:m({width:r.w+`px`,height:r.h+`px`})},null,4)):(g(),s(`div`,yt,`A`))]),e(`div`,bt,i(r.label),1)],10,_t))),128))])])}var St=q(ft,[[`render`,xt],[`__scopeId`,`data-v-8ddec2dd`]]),Ct=v({name:`SeedanceGenerateAudioSwitch`,components:{ElSwitch:O,InfoIcon:Q},computed:{isSupported(){let e=this.$store.state.seedance?.config?.model;return U(e).acceptsAudio},value:{get(){return this.$store.state.seedance?.config?.generate_audio??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,generate_audio:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),wt={key:0,class:`field`},Tt={class:`label`},Et={class:`box`},Dt={class:`title font-bold`},Ot={class:`value`};function kt(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,wt,[e(`div`,Tt,[e(`div`,Et,[e(`h2`,Dt,i(t.$t(`seedance.name.generateAudio`)),1),a(f,{content:t.$t(`seedance.description.generateAudio`),class:`info`},null,8,[`content`])])]),e(`div`,Ot,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var At=q(Ct,[[`render`,kt],[`__scopeId`,`data-v-df51dfbd`]]),jt=v({name:`SeedanceCameraFixedSwitch`,components:{ElSwitch:O,InfoIcon:Q},computed:{value:{get(){return this.$store.state.seedance?.config?.camerafixed??!1},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,camerafixed:e})}}},mounted(){this.$store.state.seedance?.config?.camerafixed===void 0&&(this.value=!1)}}),Mt={class:`field`},Nt={class:`label`},Pt={class:`box`},Ft={class:`title font-bold`},It={class:`value`};function Lt(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-switch`);return g(),s(`div`,Mt,[e(`div`,Nt,[e(`div`,Pt,[e(`h2`,Ft,i(t.$t(`seedance.name.cameraFixed`)),1),a(d,{content:t.$t(`seedance.description.cameraFixed`),class:`info`},null,8,[`content`])])]),e(`div`,It,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])}var Rt=q(jt,[[`render`,Lt],[`__scopeId`,`data-v-ae777d61`]]),zt=v({name:`SeedanceFirstFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:K,InfoIcon:Q,ImagePreview:Z},mixins:[W,J,Y,G],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsImage"(e){e||(this.fileList=[],this.onSetFirstFrameUrl())}},methods:{onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetFirstFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`first_frame`);e&&t.push({url:e,role:`first_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetFirstFrameUrl()},async onRemove(){this.onSetFirstFrameUrl()}}}),Bt={key:0,class:`relative`},Vt={class:`flex min-h-8 items-center pr-20`},Ht={class:`flex justify-start items-center`},Ut={class:`text-sm font-bold`},Wt={key:0,class:`required-badge`};function Gt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsImage?(g(),s(`div`,Bt,[e(`div`,Vt,[e(`div`,Ht,[e(`span`,Ut,i(t.$t(`seedance.name.firstFrame`)),1),t.capability.requiresImage?(g(),s(`span`,Wt,i(t.$t(`seedance.name.required`)),1)):o(``,!0),a(h,{content:t.$t(`seedance.description.firstFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{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:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var Kt=q(zt,[[`render`,Gt],[`__scopeId`,`data-v-9ed26f7d`]]),qt=v({name:`SeedanceLastFrameImage`,components:{UploadIcon:L,ElUpload:x,ElButton:K,ImagePreview:Z,InfoIcon:Q},mixins:[W,J,Y,G],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsLastFrame"(e){e||(this.fileList=[],this.onSetLastFrameUrl())}},methods:{onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetLastFrameUrl(){let e=this.urls?.[0],t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`last_frame`);e&&t.push({url:e,role:`last_frame`}),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetLastFrameUrl()},async onRemove(){this.onSetLastFrameUrl()}}}),Jt={key:0,class:`relative`},Yt={class:`flex min-h-8 items-center pr-20`},Xt={class:`flex justify-start items-center`},Zt={class:`text-sm font-bold`};function Qt(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsLastFrame?(g(),s(`div`,Jt,[e(`div`,Yt,[e(`div`,Xt,[e(`span`,Zt,i(t.$t(`seedance.name.lastFrame`)),1),a(h,{content:t.$t(`seedance.description.lastFrame`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{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:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var $t=q(qt,[[`render`,Qt],[`__scopeId`,`data-v-9b573754`]]),en=v({name:`SeedanceReferenceImage`,components:{UploadIcon:L,ElUpload:x,ElButton:K,InfoIcon:Q,ImagePreview:Z},mixins:[W,J,Y,G],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceImage"(e){e||(this.fileList=[],this.onSetReferenceImageUrls())}},methods:{onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceImageUrls(){let e=(this.urls||[]).filter(Boolean),t=(this.$store.state.seedance?.config?.images||[]).filter(e=>e?.role!==`reference_image`);e.forEach(e=>t.push({url:e,role:`reference_image`})),this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,images:t.length>0?t:void 0})},async onSuccess(){this.onSetReferenceImageUrls()},async onRemove(){this.onSetReferenceImageUrls()}}}),tn={key:0,class:`relative`},nn={class:`flex min-h-8 items-center pr-20`},rn={class:`flex justify-start items-center`},an={class:`text-sm font-bold`};function on(t,n,c,u,d,m){let h=l(`info-icon`),_=l(`image-preview`),v=l(`upload-icon`),y=l(`el-button`),b=l(`el-upload`);return t.capability.acceptsReferenceImage?(g(),s(`div`,tn,[e(`div`,nn,[e(`div`,rn,[e(`span`,an,i(t.$t(`seedance.name.referenceImage`)),1),a(h,{content:t.$t(`seedance.description.referenceImage`)},null,8,[`content`])])]),a(b,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`picture`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{file:p(({file:e})=>[e.url&&e.percentage!==void 0?(g(),f(_,{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:p(()=>[a(y,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(v,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var sn=q(en,[[`render`,on],[`__scopeId`,`data-v-3ae3845d`]]),cn=v({name:`SeedanceReferenceAudio`,components:{UploadIcon:L,ElUpload:x,ElButton:K,InfoIcon:Q},mixins:[J,Y,G],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceAudio"(e){e||(this.fileList=[],this.onSetReferenceAudios())}},methods:{onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceAudios(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,audios:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceAudios()},async onRemove(){this.onSetReferenceAudios()}}}),ln={key:0,class:`relative`},un={class:`flex min-h-8 items-center pr-20`},dn={class:`flex justify-start items-center`},fn={class:`text-sm font-bold`};function pn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceAudio?(g(),s(`div`,ln,[e(`div`,un,[e(`div`,dn,[e(`span`,fn,i(t.$t(`seedance.name.referenceAudio`)),1),a(m,{content:t.$t(`seedance.description.referenceAudio`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp3,.wav,.m4a,.aac,.ogg,.flac`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var mn=q(cn,[[`render`,pn],[`__scopeId`,`data-v-99f6c8be`]]),hn=v({name:`SeedanceReferenceVideo`,components:{UploadIcon:L,ElUpload:x,ElButton:K,InfoIcon:Q},mixins:[J,Y,G],data(){return{fileList:[],uploadUrl:X()+`/api/v1/files/`}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},model(){return this.$store.state.seedance?.config?.model},capability(){return U(this.model)},urls(){return this.fileList.map(e=>e?.response?.file_url)}},watch:{"capability.acceptsReferenceVideo"(e){e||(this.fileList=[],this.onSetReferenceVideos())}},methods:{onExceed(){T.warning(this.$t(`seedance.message.uploadExceed`))},onError(){T.error(this.$t(`seedance.message.uploadError`))},onSetReferenceVideos(){let e=(this.urls||[]).filter(Boolean);this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,videos:e.length>0?e.map(e=>({url:e})):void 0})},async onSuccess(){this.onSetReferenceVideos()},async onRemove(){this.onSetReferenceVideos()}}}),gn={key:0,class:`relative`},_n={class:`flex min-h-8 items-center pr-20`},vn={class:`flex justify-start items-center`},yn={class:`text-sm font-bold`};function bn(t,n,c,u,d,f){let m=l(`info-icon`),h=l(`upload-icon`),_=l(`el-button`),v=l(`el-upload`);return t.capability.acceptsReferenceVideo?(g(),s(`div`,gn,[e(`div`,_n,[e(`div`,vn,[e(`span`,yn,i(t.$t(`seedance.name.referenceVideo`)),1),a(m,{content:t.$t(`seedance.description.referenceVideo`)},null,8,[`content`])])]),a(v,{ref:`uploader`,"file-list":t.fileList,"onUpdate:fileList":n[0]||=e=>t.fileList=e,name:`file`,accept:`.mp4,.mov,.webm,.mkv,.avi`,limit:1,class:`upload-wrapper`,multiple:!1,"before-upload":t.beforeUploadSizeGuard,action:t.uploadUrl,"list-type":`text`,"on-exceed":t.onExceed,"on-error":t.onError,"on-success":t.onSuccess,"on-remove":t.onRemove,headers:t.headers},{default:p(()=>[a(_,{round:``,type:`primary`,size:`small`,class:`btn btn-upload`},{default:p(()=>[a(h,{class:`icon mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.upload`)),1)]),_:1})]),_:1},8,[`file-list`,`before-upload`,`action`,`on-exceed`,`on-error`,`on-success`,`on-remove`,`headers`])])):o(``,!0)}var xn=q(hn,[[`render`,bn],[`__scopeId`,`data-v-21bc6757`]]),Sn=v({name:`SeedanceReturnLastFrameSwitch`,components:{ElSwitch:O,InfoIcon:Q},computed:{model(){return this.$store.state.seedance?.config?.model},isSupported(){return U(this.model).acceptsReturnLastFrame},value:{get(){return this.$store.state.seedance?.config?.return_last_frame},set(e){this.$store.commit(`seedance/setConfig`,{...this.$store.state.seedance?.config,return_last_frame:e})}}},watch:{isSupported(e){!e&&this.value&&(this.value=!1)}},mounted(){this.value===void 0&&(this.value=!1)}}),Cn={key:0,class:`field`},wn={class:`label`},Tn={class:`box`},En={class:`title font-bold`},Dn={class:`value`};function On(t,n,r,c,u,d){let f=l(`info-icon`),p=l(`el-switch`);return t.isSupported?(g(),s(`div`,Cn,[e(`div`,wn,[e(`div`,Tn,[e(`h2`,En,i(t.$t(`seedance.name.returnLastFrame`)),1),a(f,{content:t.$t(`seedance.description.returnLastFrame`),class:`info`},null,8,[`content`])])]),e(`div`,Dn,[a(p,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,"inline-prompt":``,"active-text":t.$t(`seedance.button.on`),"inactive-text":t.$t(`seedance.button.off`)},null,8,[`modelValue`,`active-text`,`inactive-text`])])])):o(``,!0)}var kn=q(Sn,[[`render`,On],[`__scopeId`,`data-v-edea5451`]]),An=v({name:`SeedanceSeedInput`,components:{ElInputNumber:D,InfoIcon:Q},computed:{value:{get(){let e=this.$store.state.seedance?.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.$store.state.seedance?.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedance/setConfig`,t)}}}}),jn={class:`field`},Mn={class:`label`},Nn={class:`box`},Pn={class:`title font-bold`},Fn={class:`value`};function In(t,n,r,o,c,u){let d=l(`info-icon`),f=l(`el-input-number`);return g(),s(`div`,jn,[e(`div`,Mn,[e(`div`,Nn,[e(`h2`,Pn,i(t.$t(`seedance.name.seed`)),1),a(d,{content:t.$t(`seedance.description.seed`),class:`info`},null,8,[`content`])])]),e(`div`,Fn,[a(f,{modelValue:t.value,"onUpdate:modelValue":n[0]||=e=>t.value=e,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])}var Ln=v({name:`SeedanceConfigPanel`,components:{MagicIcon:z,ElButton:K,PromptInput:Ue,ModelSelector:Xe,DurationSelector:rt,ResolutionSelector:dt,RatioSelector:St,GenerateAudioSwitch:At,CameraFixedSwitch:Rt,ReturnLastFrameSwitch:kn,SeedInput:q(An,[[`render`,In],[`__scopeId`,`data-v-685a9869`]]),FirstFrameImage:Kt,LastFrameImage:$t,ReferenceImage:sn,ReferenceAudio:mn,ReferenceVideo:xn,Consumption:Te},emits:[`generate`],computed:{config(){return this.$store.state.seedance?.config},consumption(){return ye(this.config,this.service?.cost)},service(){return this.$store.state.seedance?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),Rn={class:`flex flex-col h-full`},zn={class:`flex-1 overflow-y-auto p-5`},Bn={class:`flex flex-col items-center justify-center px-5 pb-5`};function Vn(t,n,o,c,u,d){let f=l(`prompt-input`),m=l(`model-selector`),h=l(`ratio-selector`),_=l(`resolution-selector`),v=l(`duration-selector`),y=l(`generate-audio-switch`),b=l(`camera-fixed-switch`),x=l(`return-last-frame-switch`),S=l(`seed-input`),C=l(`first-frame-image`),w=l(`last-frame-image`),T=l(`reference-image`),E=l(`reference-audio`),D=l(`reference-video`),O=l(`consumption`),k=l(`magic-icon`),A=l(`el-button`);return g(),s(`div`,Rn,[e(`div`,zn,[a(f,{class:`mb-4`}),a(m,{class:`mb-4`}),a(h,{class:`mb-4`}),a(_,{class:`mb-4`}),a(v,{class:`mb-4`}),a(y,{class:`mb-4`}),a(b,{class:`mb-4`}),a(x,{class:`mb-4`}),a(S,{class:`mb-4`}),a(C,{class:`mb-4`}),a(w,{class:`mb-4`}),a(T,{class:`mb-4`}),a(E,{class:`mb-4`}),a(D,{class:`mb-4`})]),e(`div`,Bn,[a(O,{value:t.consumption,service:t.service},null,8,[`value`,`service`]),a(A,{type:`primary`,class:`btn w-full`,round:``,onClick:t.onGenerate},{default:p(()=>[a(k,{class:`mr-2`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(t.$t(`seedance.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Hn=q(Ln,[[`render`,Vn]]),Un=v({name:`SeedanceTaskPreview`,components:{DeleteIcon:F,ApplicationIcon:k,ChannelIcon:M,FullscreenIcon:j,InfoIcon:P,MagicIcon:z,TimeIcon:A,VolumeIcon:R,WarningIcon:I,CopyToClipboard:Se,ElAlert:C,VideoPlayer:ke,ElTooltip:S,ElButton:K,ImageWrapper:Me,ImagePreview:Z,AudioPreview:Pe,VideoPreview:Ne,ApiCodeButton:Ae,ReportButton:Ce},props:{modelValue:{type:Object,required:!0}},computed:{video(){return this.modelValue?.response?.data},apiCodeBody(){let e=this.modelValue?.request;if(!e)return e;let{service_tier:t,...n}=e;return n},promptText(){let e=this.modelValue?.request;if(e?.prompt)return e.prompt;let t=e?.content?.find(e=>e?.type===`text`&&e?.text);return t?.text?t.text:this.video?.prompt},referenceImages(){let e=this.collectImages();if(e.length===0)return[];let t=[],n=e.find(e=>e?.role===`first_frame`);n?.url&&t.push({url:n.url,name:`first-frame`});let r=e.find(e=>e?.role===`last_frame`);return r?.url&&t.push({url:r.url,name:`last-frame`}),e.forEach((e,n)=>{e?.url&&e.role!==`first_frame`&&e.role!==`last_frame`&&t.push({url:e.url,name:e.role||`image-${n}`})}),t},referenceAudios(){let e=this.modelValue?.request,t=(e?.audios??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`audio_url`&&e?.audio_url?.url&&t.push(e.audio_url.url)}),t},referenceVideos(){let e=this.modelValue?.request,t=(e?.videos??[]).map(e=>e?.url).filter(Boolean);return(e?.content??[]).forEach(e=>{e?.type===`video_url`&&e?.video_url?.url&&t.push(e.video_url.url)}),t}},methods:{async onDelete(){let e=this.modelValue?.id;if(e){try{await xe.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(`seedance/deleteTask`,{id:e}),T.success(this.$t(`common.message.deleteTaskSuccess`))}catch{T.error(this.$t(`common.message.deleteTaskFailed`))}}},collectImages(){let e=this.modelValue?.request,t=Array.isArray(e?.images)?[...e.images]:[];return(e?.content??[]).forEach(e=>{e?.type===`image_url`&&e?.image_url?.url&&t.push({url:e.image_url.url,role:e.role})}),t},onDownload(e){window.open(e,`_blank`)}}}),Wn={class:`preview`},Gn={class:`left`},Kn={class:`main`},qn={class:`bot`},Jn={class:`datetime`},Yn=[`aria-label`],Xn={class:`info`},Zn={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Qn={key:1,class:`prompt mt-2`},$n={key:0},er={key:1},tr={key:0,class:n({content:!0})},nr={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},rr={key:1,class:n({content:!0})},ir={key:0,class:`mb-4`},ar={key:1,class:`mb-4`},or={key:2,class:n({operations:!0,"mt-2":!0,"mb-2":!0})},sr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},lr={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},ur={key:0},dr={key:1},fr={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mr={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hr={key:5,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},gr={key:2,class:n({content:!0})},_r={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},yr={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},br={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},xr={key:3,class:n({content:!0})},Sr={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Cr={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function wr(n,u,d,m,_,v){let y=l(`capability-presentation`),b=l(`delete-icon`),x=l(`el-tooltip`),S=l(`image-preview`),C=l(`audio-preview`),w=l(`video-preview`),T=l(`time-icon`),E=l(`magic-icon`),D=l(`copy-to-clipboard`),O=l(`el-alert`),k=l(`video-player`),A=l(`image-wrapper`),j=l(`el-button`),M=l(`api-code-button`),N=l(`report-button`),P=l(`application-icon`),F=l(`fullscreen-icon`),I=l(`volume-icon`),L=l(`channel-icon`),R=l(`warning-icon`),z=l(`info-icon`);return g(),s(`div`,Wn,[e(`div`,Gn,[a(y,{capability:`seedance`,part:`avatar`,class:`avatar`})]),e(`div`,Kn,[e(`div`,qn,[a(y,{capability:`seedance`,part:`name`}),e(`span`,Jn,i(n.$dayjs.format(``+new Date(parseFloat((n.modelValue?.created_at||``).toString())*1e3))),1),a(x,{effect:`dark`,content:n.$t(`common.button.delete`),placement:`top`},{default:p(()=>[n.modelValue?.id?(g(),s(`button`,{key:0,type:`button`,class:`btn-delete`,"aria-label":n.$t(`common.button.delete`),onClick:u[0]||=t((...e)=>n.onDelete&&n.onDelete(...e),[`stop`])},[a(b,{size:`1em`,"aria-hidden":`true`,focusable:`false`})],8,Yn)):o(``,!0)]),_:1},8,[`content`])]),e(`div`,Xn,[n.referenceImages.length>0||n.referenceAudios.length>0||n.referenceVideos.length>0?(g(),s(`div`,Zn,[(g(!0),s(c,null,h(n.referenceImages,(e,t)=>(g(),f(S,{key:`image-${t}`,url:e.url,name:e.name,closable:!1},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceAudios,(e,t)=>(g(),f(C,{key:`audio-${t}`,url:e,name:`audio-${t+1}`},null,8,[`url`,`name`]))),128)),(g(!0),s(c,null,h(n.referenceVideos,(e,t)=>(g(),f(w,{key:`video-${t}`,url:e,name:`video-${t+1}`},null,8,[`url`,`name`]))),128))])):o(``,!0),n.promptText?(g(),s(`p`,Qn,[r(i(n.promptText)+` `,1),n.modelValue?.response?n.video?.status===`processing`||n.video?.status===`pending`?(g(),s(`span`,er,` - (`+i(n.$t(`seedance.status.processing`))+`) `,1)):o(``,!0):(g(),s(`span`,$n,` - (`+i(n.$t(`seedance.status.pending`))+`) `,1))])):o(``,!0)]),n.modelValue?.response?n.modelValue?.response?.success===!0?(g(),s(`div`,rr,[n.video?.video_url?(g(),s(`div`,ir,[a(k,{src:n.video?.video_url},null,8,[`src`])])):o(``,!0),n.video?.last_frame_url?(g(),s(`div`,ar,[a(A,{src:n.video?.last_frame_url,"raw-src":n.video?.last_frame_url},null,8,[`src`,`raw-src`])])):o(``,!0),n.video?.video_url?(g(),s(`div`,or,[a(x,{class:`box-item`,effect:`dark`,content:n.$t(`seedance.message.downloadVideo`),placement:`top-start`},{default:p(()=>[a(j,{type:`info`,size:`small`,class:`btn-action`,onClick:u[1]||=t(e=>n.onDownload(n.video?.video_url),[`stop`])},{default:p(()=>[r(i(n.$t(`seedance.button.download`)),1)]),_:1})]),_:1},8,[`content`]),a(M,{path:`/seedance/videos`,body:n.apiCodeBody},null,8,[`body`]),a(N,{service:`seedance`,"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:p(()=>[n.modelValue?.request?.model?(g(),s(`p`,sr,[a(P,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.model`))+`: `+i(n.modelValue?.request?.model),1)])):o(``,!0),n.video?.duration?(g(),s(`p`,cr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.duration`))+`: `+i(n.video?.duration)+`s `,1)])):o(``,!0),n.video?.resolution?(g(),s(`p`,lr,[a(F,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.resolution`))+`: `+i(n.video?.resolution)+` `,1),n.video?.ratio?(g(),s(`span`,ur,` · `+i(n.video?.ratio),1)):o(``,!0),n.video?.framespersecond?(g(),s(`span`,dr,` · `+i(n.video?.framespersecond)+`fps`,1)):o(``,!0)])):o(``,!0),n.modelValue?.request?.generate_audio?(g(),s(`p`,fr,[a(I,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.generateAudio`))+`: `+i(n.$t(`seedance.button.on`)),1)])):o(``,!0),e(`p`,pr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.elapsed?(g(),s(`p`,mr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,hr,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):n.modelValue?.response?.success===!1?(g(),s(`div`,gr,[a(O,{closable:!1,class:`failure`},{template:p(()=>[a(R,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failure`)),1)]),default:p(()=>[e(`p`,_r,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.error?.message?(g(),s(`p`,vr,[a(z,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.failureReason`))+`: `+i(n.modelValue?.response?.error?.message)+` `,1),a(D,{content:n.modelValue?.response?.error?.message,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0),n.modelValue?.elapsed?(g(),s(`p`,yr,[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.elapsed`))+`: `+i(n.modelValue?.elapsed?.toFixed(2))+`s `,1)])):o(``,!0),n.modelValue?.response?.trace_id?(g(),s(`p`,br,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,xr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(z,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.status`)),1)]),default:p(()=>[e(`p`,Sr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),n.modelValue?.response?.trace_id?(g(),s(`p`,Cr,[a(L,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.traceId`))+`: `+i(n.modelValue?.response?.trace_id)+` `,1),a(D,{content:n.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):o(``,!0)]),_:1})])):(g(),s(`div`,tr,[a(O,{closable:!1,class:`info`},{template:p(()=>[a(T,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.status.pending`)),1)]),default:p(()=>[e(`p`,nr,[a(E,{class:`mr-1`,size:`1em`,"aria-hidden":`true`,focusable:`false`}),r(` `+i(n.$t(`seedance.name.taskId`))+`: `+i(n.modelValue?.id)+` `,1),a(D,{content:n.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var Tr=v({name:`SeedanceRecentPanel`,components:{TaskPreview:q(Un,[[`render`,wr],[`__scopeId`,`data-v-91bf07f2`]]),BotPlaceholder:je,NoTasks:De,ScrollList:Ee},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedance?.tasks,items:this.$store.state.seedance?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Er={key:0},Dr={key:2,class:`w-full h-full flex items-center justify-center`};function Or(e,t,n,r,i,u){let d=l(`bot-placeholder`),m=l(`task-preview`),_=l(`scroll-list`),v=l(`no-tasks`);return g(),s(c,null,[e.tasks?.items===void 0?(g(),s(`div`,Er,[a(d)])):e.tasks?.items?.length&&e.tasks?.items?.length>0?(g(),f(_,{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:p(()=>[(g(!0),s(c,null,h(e.tasks?.items,e=>(g(),f(m,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):o(``,!0),e.tasks?.items?.length===0?(g(),s(`div`,Dr,[a(v)])):o(``,!0)],64)}var kr=q(Tr,[[`render`,Or]]),Ar=new Set(Object.keys(me)),jr=e=>Array.isArray(e)?e.filter(e=>!!e?.url):[];function Mr(e){let t={...e||{}};if(typeof t.prompt==`string`&&(t.prompt=t.prompt.trim(),t.prompt||delete t.prompt),t.model&&!Ar.has(t.model))return{reject:`modelUnsupported`};let n=U(t.model);t.images=jr(t.images);let r=t.images.some(e=>e.role===`first_frame`),i=t.images.some(e=>e.role===`last_frame`);!r&&i&&(t.images=t.images.map(e=>e.role===`last_frame`?{...e,role:`first_frame`}:e));let a=t.images.length>0;if(a||delete t.images,delete t.service_tier,!n.acceptsImage&&a)return{reject:`modelRejectsImage`};if(!n.acceptsAudio&&t.generate_audio&&(t.generate_audio=!1),!n.acceptsReturnLastFrame&&t.return_last_frame&&(t.return_last_frame=!1),!n.acceptsLastFrame&&a&&(t.images=t.images.filter(e=>e.role!==`last_frame`),a=t.images.length>0,a||delete t.images),n.acceptsReferenceAudio&&Array.isArray(t.audios)&&(t.audios=t.audios.filter(e=>e?.url)),(!n.acceptsReferenceAudio||!Array.isArray(t.audios)||t.audios.length===0)&&delete t.audios,n.acceptsReferenceVideo&&Array.isArray(t.videos)&&(t.videos=t.videos.filter(e=>e?.url)),(!n.acceptsReferenceVideo||!Array.isArray(t.videos)||t.videos.length===0)&&delete t.videos,!n.acceptsReferenceImage&&Array.isArray(t.images)&&(t.images=t.images.filter(e=>e.role!==`reference_image`),t.images.length===0&&delete t.images),a=Array.isArray(t.images)&&t.images.length>0,n.requiresImage&&!a||!n.acceptsText&&!a)return{reject:`modelRequiresImage`};let o=Array.isArray(t.videos)&&t.videos.length>0;return Array.isArray(t.audios)&&t.audios.length>0&&!a&&!o?{reject:`audioRequiresReference`}:{request:{...t,async:!0}}}var Nr=v({name:`SeedanceIndex`,components:{ConfigPanel:Hn,Layout:Be,RecentPanel:kr},mixins:[_e],inject:[`initialized`],data(){return{task:void 0,job:0,loadingMore:!1,fetchingTasks:!1}},computed:{applicationsLoading(){return this.$store.state.seedance?.status?.getApplications===w.Request},tasksLoading(){return this.$store.state.seedance?.status?.getTasks===w.Request||this.fetchingTasks},credential(){return this.$store.state.seedance?.credential},config(){return this.$store.state.seedance?.config},tasks(){return this.$store.state.seedance?.tasks}},watch:{initialized:{async handler(e){e&&(await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await Oe({tasks: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(`seedance/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(`seedance/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})}finally{this.fetchingTasks=!1}},async onGenerate(){if(!ge(this.uploadTracker,e=>this.$t(e),e=>T.warning(e)))return;let{request:e,reject:t}=Mr(this.config);if(t){T.warning(this.$t(`seedance.message.${t}`));return}if(!e||!be())return;let n=this.credential?.token;if(!n){console.error(`no token specified`);return}T.info(this.$t(`seedance.message.startingTask`)),ve(`seedance`,he.generate(e,{token:n})).then(()=>{T.success(this.$t(`seedance.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?T.error(this.$t(`seedance.message.usedUp`)):T.error(this.$t(`seedance.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Pr(e,t,n,r,i,o){let s=l(`config-panel`),c=l(`recent-panel`),u=l(`layout`);return g(),f(u,null,{config:p(()=>[a(s,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:p(()=>[a(c,{ref:`recentPanel`,loading:e.loadingMore,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Fr=q(Nr,[[`render`,Pr]]);export{Fr as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{n as d,t as ee}from"./table-D27hm8JC.js";import{t as f}from"./tooltip-CnN93uDP.js";import{t as p}from"./card-IQwqnRJR.js";import{n as m,t as h}from"./row-CWrBj9xB.js";import{t as g}from"./divider-Du_3kymg.js";import{t as _}from"./progress-BuyYfFZn.js";import{t as v}from"./skeleton-Dj_a_iIP.js";import{t as y}from"./coins-B0X_VfQM.js";import{t as b}from"./link-CEQaYDR2.js";import{t as x}from"./user-DSlDon3v.js";import{t as S}from"./wallet-Cbrc_KTc.js";import{Mi as C,O as w,Vt as T,_i as E,cr as D,hn as O,lr as k,nn as A,rt as j,tt as M,ur as N,xr as P}from"./index-DCEwxRXS.js";import{t as F}from"./CopyToClipboard-BJY08VAg.js";var I=u({name:`ConsoleDistributionList`,components:{CreditsIcon:y,LinkIcon:b,PercentIcon:E(`percent`,[[`line`,{x1:`19`,x2:`5`,y1:`5`,y2:`19`,key:`1x9vlm`}],[`circle`,{cx:`6.5`,cy:`6.5`,r:`2.5`,key:`4mh3h7`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`2.5`,key:`1mdrzq`}]]),UserIcon:x,WalletIcon:S,CopyToClipboard:F,QrCode:T,ElProgress:_,ElRow:h,ElCol:m,ElButton:C,ElDivider:g,ElCard:p,ElTooltip:f,ElTable:ee,ElTableColumn:d,ElSkeleton:v},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||`1`)},qrColor(){let e=document.documentElement.classList.contains(`dark`);return{dark:e?`#ffffff`:`#000000`,light:e?`#1e1e1e`:`#ffffff`}},distributionLevelMap(){let e={};return this.distributionLevels.forEach(t=>{e[t.level]=t}),e}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:A,goHistory(){this.$router.push({name:M})},goInvitees(){this.$router.push({name:j})},onPageChange(e){this.$router.push({name:this.$route.name?.toString(),query:{page:e}})},getPercentageForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level]?.threshold,t=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor((this.distributionStatus?.price-e)/(t-e)*100)},getDeltaForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor(e-this.distributionStatus?.price)},async onFetchData(){this.loading=!0,await k.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){let e=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{let t=(await N.create(e))?.data?.data?.url||e;this.distributionLink=O()?t.replace(`surl.id`,`share.acedata.cloud`):t}catch{this.distributionLink=e}},async onFetchDistributionStatus(){let{data:e}=await k.getAll({user_id:this.$store.getters.user.id});e.items&&e.items.length>0&&(this.distributionStatus=e.items[0])},async onFetchDistributionLevels(){let{data:e}=await D.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=e.items},async onFetchInvitees(){let{data:e}=await P.getInvitees({});this.invitees=e.items,this.inviteesCount=e.count}}}),L={class:`title`},R={key:1},z={class:`icon-wrapper`},B={class:`text-left`},V={class:`description`},H={class:`value`},U={key:1},W={class:`icon-wrapper`},G={class:`text-left`},K={class:`description`},q={class:`value`},J={key:1},Y={class:`icon-wrapper`},X={class:`text-left`},te={class:`description`},Z={class:`value`},Q={key:1},ne={class:`icon-wrapper`},re={class:`text-left`},ie={class:`description`},ae={class:`value`},oe={key:1},se={class:`title`},ce={class:`clear-both overflow-hidden`},le={class:`float-left description`},ue={class:`float-right description`},de={class:`description`},fe={class:`level`},pe={class:`level`},$={class:`level`},me={key:1},he={class:`title`},ge={class:`link-wrapper text-center`},_e=[`href`],ve={class:`qr-wrapper ml-auto mr-auto`},ye={class:`mt-0`},be={class:`description`},xe={class:`more`};function Se(u,d,ee,f,p,m){let h=o(`el-col`),g=o(`el-row`),_=o(`el-skeleton`),v=o(`wallet-icon`),y=o(`el-button`),b=o(`el-card`),x=o(`credits-icon`),S=o(`el-tooltip`),C=o(`percent-icon`),w=o(`user-icon`),T=o(`el-progress`),E=o(`el-divider`),D=o(`el-table-column`),O=o(`el-table`);o(`link-icon`);let k=o(`copy-to-clipboard`),A=o(`qr-code`);return l(),s(g,{class:`panel`},{default:c(()=>[r(h,{span:24},{default:c(()=>[r(g,null,{default:c(()=>[r(h,{span:24},{default:c(()=>[e(`h2`,L,n(u.$t(`common.title.distribution`)),1)]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,R,[e(`div`,z,[r(v,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,B,[e(`p`,V,n(u.$t(`distribution.title.price`)),1),e(`p`,H,n(u.getPriceString({value:u.distributionStatus?.price})),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goHistory},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,U,[e(`div`,W,[r(x,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,G,[e(`p`,K,n(u.$t(`distribution.title.reward`)),1),e(`p`,q,n(u.getPriceString({value:u.distributionStatus?.reward})),1)]),r(S,{effect:`dark`,content:u.$t(`distribution.message.developingWithDrawal`),placement:`top`},{default:c(()=>[r(y,{type:`primary`,round:``,size:`small`,class:`btn`},{default:c(()=>[t(n(u.$t(`distribution.button.withdrawal`)),1)]),_:1})]),_:1},8,[`content`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,J,[e(`div`,Y,[r(C,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,X,[e(`p`,te,n(u.$t(`distribution.title.percentage`)),1),e(`p`,Z,n(u.distributionStatus?.level?.percentage)+`%`,1)])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,Q,[e(`div`,ne,[r(w,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,re,[e(`p`,ie,n(u.$t(`distribution.title.inviteesCount`)),1),e(`p`,ae,n(u.inviteesCount),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goInvitees},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`level-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,oe,[e(`h4`,se,n(u.$t(`distribution.title.levelInfo`)),1),e(`div`,ce,[e(`div`,le,[e(`p`,null,n(u.$t(`distribution.title.currentLevel`))+`: L`+n(u.distributionStatus?.level?.level),1),e(`p`,null,n(u.$t(`distribution.title.currentPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level]?.percentage)+`% `,1)]),e(`div`,ue,[e(`p`,null,n(u.$t(`distribution.title.nextLevel`))+`: L`+n(u.distributionStatus?.level?.level+1),1),e(`p`,null,n(u.$t(`distribution.title.nextPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level+1]?.percentage)+`% `,1)])]),r(T,{"text-inside":!0,"stroke-width":20,percentage:u.getPercentageForNextLevel(),class:`mb-2`},null,8,[`percentage`]),e(`p`,de,n(u.$t(`distribution.message.deltaPriceForNextLevel`))+`: $`+n(u.getDeltaForNextLevel()),1),r(E),u.distributionLevels?(l(),s(O,{key:0,data:u.distributionLevels,stripe:``},{default:c(()=>[r(D,{label:u.$t(`distribution.field.level`)},{default:c(t=>[e(`span`,fe,`L`+n(t.row?.level),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.threshold`)},{default:c(t=>[e(`span`,pe,`$`+n(t.row?.threshold),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.percentage`)},{default:c(t=>[e(`span`,$,n(t.row?.percentage)+`%`,1)]),_:1},8,[`label`])]),_:1},8,[`data`])):i(``,!0)]))]),_:1})]),_:1}),r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`distribution-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,me,[e(`h4`,he,n(u.$t(`distribution.title.distributionLink`)),1),r(E),e(`div`,ge,[i(``,!0),e(`a`,{href:u.distributionLink,class:`link`},n(u.distributionLink),9,_e),r(k,{content:u.distributionLink},null,8,[`content`])]),e(`div`,ve,[u.distributionLink?(l(),s(A,{key:0,value:u.distributionLink,size:180,margin:2,class:`block mb-2 ml-auto mr-auto`,type:`image/png`,color:u.qrColor},null,8,[`value`,`color`])):i(``,!0),e(`p`,ye,n(u.$t(`distribution.message.distributionQrDescription`)),1)]),e(`p`,be,[t(n(u.$t(`distribution.message.distributionLinkDescription`))+` `,1),e(`span`,xe,[r(S,{effect:`dark`,content:u.$t(`distribution.message.distributionLinkDescription2`),placement:`top`},{default:c(()=>[t(n(u.$t(`distribution.message.technicalDetail`)),1)]),_:1},8,[`content`])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Ce=w(I,[[`render`,Se],[`__scopeId`,`data-v-3657f823`]]);export{Ce as default};
1
+ import"./rolldown-runtime--c01j_DQ.js";import{A as e,I as t,Jt as n,L as r,M as i,N as a,at as o,j as s,mt as c,tt as l,z as u}from"./vendor-chart-Dw-P17PN.js";import{n as d,t as ee}from"./table-BFFBn1XT.js";import{t as f}from"./tooltip-iglteC5t.js";import{t as p}from"./card-IQwqnRJR.js";import{n as m,t as h}from"./row-DFp6lzUY.js";import{t as g}from"./divider-Du_3kymg.js";import{t as _}from"./progress-BuyYfFZn.js";import{t as v}from"./skeleton-Dj_a_iIP.js";import{t as y}from"./coins-BAQZbHDX.js";import{t as b}from"./link-2an_YebR.js";import{t as x}from"./user-CHNnnBrI.js";import{t as S}from"./wallet-Bh1qMcsQ.js";import{Mi as C,O as w,Vt as T,_i as E,cr as D,hn as O,lr as k,nn as A,rt as j,tt as M,ur as N,xr as P}from"./index-DSIuJ3Ml.js";import{t as F}from"./CopyToClipboard-DaW2jH2E.js";var I=u({name:`ConsoleDistributionList`,components:{CreditsIcon:y,LinkIcon:b,PercentIcon:E(`percent`,[[`line`,{x1:`19`,x2:`5`,y1:`5`,y2:`19`,key:`1x9vlm`}],[`circle`,{cx:`6.5`,cy:`6.5`,r:`2.5`,key:`4mh3h7`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`2.5`,key:`1mdrzq`}]]),UserIcon:x,WalletIcon:S,CopyToClipboard:F,QrCode:T,ElProgress:_,ElRow:h,ElCol:m,ElButton:C,ElDivider:g,ElCard:p,ElTooltip:f,ElTable:ee,ElTableColumn:d,ElSkeleton:v},data(){return{invitees:[],inviteesCount:void 0,distributionLevels:[],distributionLink:void 0,distributionStatus:void 0,loading:!1}},computed:{redirect(){return this.$route.query.redirect},page(){return parseInt(this.$route.query.page?.toString()||`1`)},qrColor(){let e=document.documentElement.classList.contains(`dark`);return{dark:e?`#ffffff`:`#000000`,light:e?`#1e1e1e`:`#ffffff`}},distributionLevelMap(){let e={};return this.distributionLevels.forEach(t=>{e[t.level]=t}),e}},watch:{page:{handler(){this.onFetchData()}}},async mounted(){this.onFetchData(),this.onGenerateDistributionLink()},methods:{getPriceString:A,goHistory(){this.$router.push({name:M})},goInvitees(){this.$router.push({name:j})},onPageChange(e){this.$router.push({name:this.$route.name?.toString(),query:{page:e}})},getPercentageForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level]?.threshold,t=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor((this.distributionStatus?.price-e)/(t-e)*100)},getDeltaForNextLevel(){let e=this.distributionLevelMap[this.distributionStatus?.level?.level+1]?.threshold;return Math.floor(e-this.distributionStatus?.price)},async onFetchData(){this.loading=!0,await k.initialize(),Promise.all([this.onFetchDistributionStatus(),this.onFetchDistributionLevels(),this.onFetchInvitees()]).finally(()=>{this.loading=!1})},async onGenerateDistributionLink(){let e=`${window.location.origin}?inviter_id=${this.$store.getters.user.id}`;try{let t=(await N.create(e))?.data?.data?.url||e;this.distributionLink=O()?t.replace(`surl.id`,`share.acedata.cloud`):t}catch{this.distributionLink=e}},async onFetchDistributionStatus(){let{data:e}=await k.getAll({user_id:this.$store.getters.user.id});e.items&&e.items.length>0&&(this.distributionStatus=e.items[0])},async onFetchDistributionLevels(){let{data:e}=await D.getAll({limit:20,user_id:this.$store.getters.user.id});this.distributionLevels=e.items},async onFetchInvitees(){let{data:e}=await P.getInvitees({});this.invitees=e.items,this.inviteesCount=e.count}}}),L={class:`title`},R={key:1},z={class:`icon-wrapper`},B={class:`text-left`},V={class:`description`},H={class:`value`},U={key:1},W={class:`icon-wrapper`},G={class:`text-left`},K={class:`description`},q={class:`value`},J={key:1},Y={class:`icon-wrapper`},X={class:`text-left`},te={class:`description`},Z={class:`value`},Q={key:1},ne={class:`icon-wrapper`},re={class:`text-left`},ie={class:`description`},ae={class:`value`},oe={key:1},se={class:`title`},ce={class:`clear-both overflow-hidden`},le={class:`float-left description`},ue={class:`float-right description`},de={class:`description`},fe={class:`level`},pe={class:`level`},$={class:`level`},me={key:1},he={class:`title`},ge={class:`link-wrapper text-center`},_e=[`href`],ve={class:`qr-wrapper ml-auto mr-auto`},ye={class:`mt-0`},be={class:`description`},xe={class:`more`};function Se(u,d,ee,f,p,m){let h=o(`el-col`),g=o(`el-row`),_=o(`el-skeleton`),v=o(`wallet-icon`),y=o(`el-button`),b=o(`el-card`),x=o(`credits-icon`),S=o(`el-tooltip`),C=o(`percent-icon`),w=o(`user-icon`),T=o(`el-progress`),E=o(`el-divider`),D=o(`el-table-column`),O=o(`el-table`);o(`link-icon`);let k=o(`copy-to-clipboard`),A=o(`qr-code`);return l(),s(g,{class:`panel`},{default:c(()=>[r(h,{span:24},{default:c(()=>[r(g,null,{default:c(()=>[r(h,{span:24},{default:c(()=>[e(`h2`,L,n(u.$t(`common.title.distribution`)),1)]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,R,[e(`div`,z,[r(v,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,B,[e(`p`,V,n(u.$t(`distribution.title.price`)),1),e(`p`,H,n(u.getPriceString({value:u.distributionStatus?.price})),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goHistory},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,U,[e(`div`,W,[r(x,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,G,[e(`p`,K,n(u.$t(`distribution.title.reward`)),1),e(`p`,q,n(u.getPriceString({value:u.distributionStatus?.reward})),1)]),r(S,{effect:`dark`,content:u.$t(`distribution.message.developingWithDrawal`),placement:`top`},{default:c(()=>[r(y,{type:`primary`,round:``,size:`small`,class:`btn`},{default:c(()=>[t(n(u.$t(`distribution.button.withdrawal`)),1)]),_:1})]),_:1},8,[`content`])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,J,[e(`div`,Y,[r(C,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,X,[e(`p`,te,n(u.$t(`distribution.title.percentage`)),1),e(`p`,Z,n(u.distributionStatus?.level?.percentage)+`%`,1)])]))]),_:1})]),_:1}),r(h,{md:6,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`item-mini mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,Q,[e(`div`,ne,[r(w,{class:`icon`,size:`1em`,"aria-hidden":`true`,focusable:`false`})]),e(`div`,re,[e(`p`,ie,n(u.$t(`distribution.title.inviteesCount`)),1),e(`p`,ae,n(u.inviteesCount),1)]),r(y,{type:`primary`,round:``,size:`small`,class:`btn`,onClick:u.goInvitees},{default:c(()=>[t(n(u.$t(`distribution.button.detail`)),1)]),_:1},8,[`onClick`])]))]),_:1})]),_:1})]),_:1}),r(g,{gutter:15},{default:c(()=>[r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`level-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,oe,[e(`h4`,se,n(u.$t(`distribution.title.levelInfo`)),1),e(`div`,ce,[e(`div`,le,[e(`p`,null,n(u.$t(`distribution.title.currentLevel`))+`: L`+n(u.distributionStatus?.level?.level),1),e(`p`,null,n(u.$t(`distribution.title.currentPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level]?.percentage)+`% `,1)]),e(`div`,ue,[e(`p`,null,n(u.$t(`distribution.title.nextLevel`))+`: L`+n(u.distributionStatus?.level?.level+1),1),e(`p`,null,n(u.$t(`distribution.title.nextPercentage`))+`: `+n(u.distributionLevelMap[u.distributionStatus?.level?.level+1]?.percentage)+`% `,1)])]),r(T,{"text-inside":!0,"stroke-width":20,percentage:u.getPercentageForNextLevel(),class:`mb-2`},null,8,[`percentage`]),e(`p`,de,n(u.$t(`distribution.message.deltaPriceForNextLevel`))+`: $`+n(u.getDeltaForNextLevel()),1),r(E),u.distributionLevels?(l(),s(O,{key:0,data:u.distributionLevels,stripe:``},{default:c(()=>[r(D,{label:u.$t(`distribution.field.level`)},{default:c(t=>[e(`span`,fe,`L`+n(t.row?.level),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.threshold`)},{default:c(t=>[e(`span`,pe,`$`+n(t.row?.threshold),1)]),_:1},8,[`label`]),r(D,{label:u.$t(`distribution.field.percentage`)},{default:c(t=>[e(`span`,$,n(t.row?.percentage)+`%`,1)]),_:1},8,[`label`])]),_:1},8,[`data`])):i(``,!0)]))]),_:1})]),_:1}),r(h,{md:12,xs:24},{default:c(()=>[r(b,{shadow:`hover`,class:`distribution-info mb-4`},{default:c(()=>[u.loading?(l(),s(_,{key:0})):(l(),a(`div`,me,[e(`h4`,he,n(u.$t(`distribution.title.distributionLink`)),1),r(E),e(`div`,ge,[i(``,!0),e(`a`,{href:u.distributionLink,class:`link`},n(u.distributionLink),9,_e),r(k,{content:u.distributionLink},null,8,[`content`])]),e(`div`,ve,[u.distributionLink?(l(),s(A,{key:0,value:u.distributionLink,size:180,margin:2,class:`block mb-2 ml-auto mr-auto`,type:`image/png`,color:u.qrColor},null,8,[`value`,`color`])):i(``,!0),e(`p`,ye,n(u.$t(`distribution.message.distributionQrDescription`)),1)]),e(`p`,be,[t(n(u.$t(`distribution.message.distributionLinkDescription`))+` `,1),e(`span`,xe,[r(S,{effect:`dark`,content:u.$t(`distribution.message.distributionLinkDescription2`),placement:`top`},{default:c(()=>[t(n(u.$t(`distribution.message.technicalDetail`)),1)]),_:1},8,[`content`])])])]))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}var Ce=w(I,[[`render`,Se],[`__scopeId`,`data-v-3657f823`]]);export{Ce as default};