@templatical/editor 0.39.0 → 0.39.2

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 (273) hide show
  1. package/README.md +2 -4
  2. package/dist/{AiChatSidebar-jVlXXND3.js → AiChatSidebar-pOxCZWz9.js} +14 -14
  3. package/dist/{AiFeatureMenu-C1HCntyQ.js → AiFeatureMenu-Bljk6Qjv.js} +7 -7
  4. package/dist/{BlockIssueBadge-JhNgcUmZ.js → BlockIssueBadge-D5oGxOQP.js} +5 -5
  5. package/dist/{BlockPreviewCanvas-C_rA5LJN.js → BlockPreviewCanvas-DXGjUECG.js} +27 -27
  6. package/dist/{CloudHeaderExtras-DvYyNsPB.js → CloudHeaderExtras-DaocwNmy.js} +5 -5
  7. package/dist/{CloudPanels-CDPhPVdd.js → CloudPanels-CyZAnSJY.js} +7 -7
  8. package/dist/{CollaboratorBar-Co9UPoB0.js → CollaboratorBar-C7Zca3g1.js} +4 -4
  9. package/dist/{CommentsPanel-CRcVN9Ri.js → CommentsPanel-CNOb7YCm.js} +2 -2
  10. package/dist/{CommentsSidebar-gDU977br.js → CommentsSidebar-VmwjU9va.js} +14 -14
  11. package/dist/{CountdownBlock-CEzrfe5R.js → CountdownBlock-DSvbf3qU.js} +3 -3
  12. package/dist/{CountdownToolbar-B00zhkNJ.js → CountdownToolbar-C2kfS6Oy.js} +31 -30
  13. package/dist/{DesignReferenceSidebar-DedivZZl.js → DesignReferenceSidebar-QC4gEUWp.js} +11 -11
  14. package/dist/{IssuesPanel-C-PjdmAV.js → IssuesPanel-DL2Xr14_.js} +8 -8
  15. package/dist/{LoadingTrack-BlTL4zFv.js → LoadingTrack-C2jKCU2d.js} +1 -1
  16. package/dist/LogicTagInsertButton-D8IwH-9Z.js +1071 -0
  17. package/dist/MediaEditModal-D4GEq2md.js +3545 -0
  18. package/dist/{MediaPanels-BpQNY8YX.js → MediaPanels-sapgKtxu.js} +2 -2
  19. package/dist/MergeTagInput-QI-5KG2R.js +81 -0
  20. package/dist/{MergeTagModeToggle-DGuzSAdX.js → MergeTagModeToggle-D793Bj_E.js} +14 -55
  21. package/dist/{ParagraphEditor-jMKLLTa8.js → ParagraphEditor-DkkPSexG.js} +65 -66
  22. package/dist/{RestoreVersionDialog-DG1jUdBM.js → RestoreVersionDialog-BgueZnZr.js} +5 -5
  23. package/dist/{RichTextEditorContent-JrNEg0kv.js → RichTextEditorContent-BC5UTVnb.js} +11 -11
  24. package/dist/{SaveBlockDialog-C0KC-OKs.js → SaveBlockDialog-BuTuVlLr.js} +12 -11
  25. package/dist/{SavedBlocksBrowserModal-zyOiRgWZ.js → SavedBlocksBrowserModal-Srhix8BB.js} +17 -16
  26. package/dist/{SavedBlocksPanels-epMd799w.js → SavedBlocksPanels-B2iScCS-.js} +2 -2
  27. package/dist/{SavedBlocksPickBar-CJqqQ3jd.js → SavedBlocksPickBar-cI7bDQQi.js} +4 -4
  28. package/dist/{TemplateScoringPanel-m2FOeaai.js → TemplateScoringPanel-C2Rdlyn6.js} +16 -16
  29. package/dist/TemplateSettings-C_5leDdF.js +245 -0
  30. package/dist/{TestEmailModal-D58kYkMV.js → TestEmailModal-DJ5q_u4N.js} +10 -10
  31. package/dist/{TestEmailPanel-BmFVBIQt.js → TestEmailPanel-CP24UGst.js} +2 -2
  32. package/dist/{TitleEditor-C4BGPXnf.js → TitleEditor-QBBOXtxx.js} +15 -15
  33. package/dist/ToggleSwitch-JvQ_CmI1.js +102 -0
  34. package/dist/Toolbar-COD2TW20.js +2426 -0
  35. package/dist/{TplModal-BIDJw4Kj.js → TplModal-C8xGjC1l.js} +5 -5
  36. package/dist/{VersionHistoryMenu-dt_aZQfh.js → VersionHistoryMenu-BVQityes.js} +10 -10
  37. package/dist/{VersionHistoryPanels-B_5SBRrr.js → VersionHistoryPanels-BrK6na4A.js} +2 -2
  38. package/dist/{VersionPreviewBanner-DttvOkwd.js → VersionPreviewBanner-BaMSgA1O.js} +3 -3
  39. package/dist/{blockTypeIcons-CzTizYmK.js → blockTypeIcons-CdXugKyV.js} +16 -37
  40. package/dist/bundle-stats.json +8 -8
  41. package/dist/{ca-Jx2CDwtn.js → ca-BTf1Zbqb.js} +9 -0
  42. package/dist/cdn/chunks/{AiChatSidebar-DeZl9Tk0.js → AiChatSidebar-CjSEoK4x.js} +8 -8
  43. package/dist/cdn/chunks/{AiChatSidebar-DeZl9Tk0.js.map → AiChatSidebar-CjSEoK4x.js.map} +1 -1
  44. package/dist/cdn/chunks/{AiFeatureMenu-Bv8jMu9p.js → AiFeatureMenu-l0K5TOSn.js} +6 -6
  45. package/dist/cdn/chunks/{AiFeatureMenu-Bv8jMu9p.js.map → AiFeatureMenu-l0K5TOSn.js.map} +1 -1
  46. package/dist/cdn/chunks/{BlockIssueBadge-B6PpoOPv.js → BlockIssueBadge-9hHpaXb9.js} +5 -5
  47. package/dist/cdn/chunks/{BlockIssueBadge-B6PpoOPv.js.map → BlockIssueBadge-9hHpaXb9.js.map} +1 -1
  48. package/dist/cdn/chunks/{BlockPreviewCanvas-DfEtDosD.js → BlockPreviewCanvas-lQrAdgG3.js} +30 -30
  49. package/dist/cdn/chunks/{BlockPreviewCanvas-DfEtDosD.js.map → BlockPreviewCanvas-lQrAdgG3.js.map} +1 -1
  50. package/dist/cdn/chunks/{CloudHeaderExtras-Hk98ub-C.js → CloudHeaderExtras-CXNe7Q-4.js} +5 -5
  51. package/dist/cdn/chunks/{CloudHeaderExtras-Hk98ub-C.js.map → CloudHeaderExtras-CXNe7Q-4.js.map} +1 -1
  52. package/dist/cdn/chunks/{CloudPanels-Ba3GLmvF.js → CloudPanels-bHhh9AUA.js} +6 -6
  53. package/dist/cdn/chunks/{CloudPanels-Ba3GLmvF.js.map → CloudPanels-bHhh9AUA.js.map} +1 -1
  54. package/dist/cdn/chunks/{CollaboratorBar-D2dCQ9gg.js → CollaboratorBar-DgqcaGGI.js} +5 -5
  55. package/dist/cdn/chunks/{CollaboratorBar-D2dCQ9gg.js.map → CollaboratorBar-DgqcaGGI.js.map} +1 -1
  56. package/dist/cdn/chunks/{CommentsPanel-CV2HveQk.js → CommentsPanel-Cy4TlTHC.js} +3 -3
  57. package/dist/cdn/chunks/{CommentsPanel-CV2HveQk.js.map → CommentsPanel-Cy4TlTHC.js.map} +1 -1
  58. package/dist/cdn/chunks/{CommentsSidebar-Dok_vaRc.js → CommentsSidebar-C7oAP3Mx.js} +5 -5
  59. package/dist/cdn/chunks/{CommentsSidebar-Dok_vaRc.js.map → CommentsSidebar-C7oAP3Mx.js.map} +1 -1
  60. package/dist/cdn/chunks/{CountdownBlock-DGDl3ota.js → CountdownBlock-DdC8Lg5F.js} +4 -4
  61. package/dist/cdn/chunks/{CountdownBlock-DGDl3ota.js.map → CountdownBlock-DdC8Lg5F.js.map} +1 -1
  62. package/dist/cdn/chunks/{CountdownToolbar-B9Rin64t.js → CountdownToolbar-CN9h4nlC.js} +22 -21
  63. package/dist/cdn/chunks/{CountdownToolbar-B9Rin64t.js.map → CountdownToolbar-CN9h4nlC.js.map} +1 -1
  64. package/dist/cdn/chunks/{DesignReferenceSidebar-eCuTFak2.js → DesignReferenceSidebar-Bjo0M-AY.js} +7 -7
  65. package/dist/cdn/chunks/{DesignReferenceSidebar-eCuTFak2.js.map → DesignReferenceSidebar-Bjo0M-AY.js.map} +1 -1
  66. package/dist/cdn/chunks/{IssuesPanel-CP7FEzw7.js → IssuesPanel-DdFk-Blf.js} +6 -6
  67. package/dist/cdn/chunks/{IssuesPanel-CP7FEzw7.js.map → IssuesPanel-DdFk-Blf.js.map} +1 -1
  68. package/dist/cdn/chunks/{LoadingTrack-Cm3TDKb3.js → LoadingTrack-Ba5xh5HD.js} +2 -2
  69. package/dist/cdn/chunks/{LoadingTrack-Cm3TDKb3.js.map → LoadingTrack-Ba5xh5HD.js.map} +1 -1
  70. package/dist/cdn/chunks/LogicTagInsertButton-DpyPozop.js +1035 -0
  71. package/dist/cdn/chunks/LogicTagInsertButton-DpyPozop.js.map +1 -0
  72. package/dist/cdn/chunks/MediaEditModal-BBZRcYKe.js +3529 -0
  73. package/dist/cdn/chunks/MediaEditModal-BBZRcYKe.js.map +1 -0
  74. package/dist/cdn/chunks/{MediaPanels-TYrKKHX5.js → MediaPanels-CSBCsFwT.js} +3 -3
  75. package/dist/cdn/chunks/{MediaPanels-TYrKKHX5.js.map → MediaPanels-CSBCsFwT.js.map} +1 -1
  76. package/dist/cdn/chunks/MergeTagInput-ERJr7bP_.js +83 -0
  77. package/dist/cdn/chunks/MergeTagInput-ERJr7bP_.js.map +1 -0
  78. package/dist/cdn/chunks/{MergeTagModeToggle-QGTUIWWo.js → MergeTagModeToggle-n3nvSNeQ.js} +5 -5
  79. package/dist/cdn/chunks/{MergeTagModeToggle-QGTUIWWo.js.map → MergeTagModeToggle-n3nvSNeQ.js.map} +1 -1
  80. package/dist/cdn/chunks/{ParagraphEditor-D1tsPv4v.js → ParagraphEditor-DO4RzP8l.js} +40 -40
  81. package/dist/cdn/chunks/{ParagraphEditor-D1tsPv4v.js.map → ParagraphEditor-DO4RzP8l.js.map} +1 -1
  82. package/dist/cdn/chunks/{RestoreVersionDialog-BeCxNPLS.js → RestoreVersionDialog-CzZ_sFnz.js} +5 -5
  83. package/dist/cdn/chunks/{RestoreVersionDialog-BeCxNPLS.js.map → RestoreVersionDialog-CzZ_sFnz.js.map} +1 -1
  84. package/dist/cdn/chunks/{RichTextEditorContent-BBxzACFQ.js → RichTextEditorContent-Ch5zeyZ7.js} +8 -8
  85. package/dist/cdn/chunks/{RichTextEditorContent-BBxzACFQ.js.map → RichTextEditorContent-Ch5zeyZ7.js.map} +1 -1
  86. package/dist/cdn/chunks/{SaveBlockDialog-CLgh_g7H.js → SaveBlockDialog-LgxYrXyx.js} +10 -9
  87. package/dist/cdn/chunks/{SaveBlockDialog-CLgh_g7H.js.map → SaveBlockDialog-LgxYrXyx.js.map} +1 -1
  88. package/dist/cdn/chunks/{SavedBlocksBrowserModal-B4TcUJJe.js → SavedBlocksBrowserModal-CdeSsTpb.js} +9 -9
  89. package/dist/cdn/chunks/{SavedBlocksBrowserModal-B4TcUJJe.js.map → SavedBlocksBrowserModal-CdeSsTpb.js.map} +1 -1
  90. package/dist/cdn/chunks/{SavedBlocksPanels-CaBsHoRC.js → SavedBlocksPanels-B5hakNJj.js} +3 -3
  91. package/dist/cdn/chunks/{SavedBlocksPanels-CaBsHoRC.js.map → SavedBlocksPanels-B5hakNJj.js.map} +1 -1
  92. package/dist/cdn/chunks/{SavedBlocksPickBar-iG35XCDx.js → SavedBlocksPickBar-Cl6PLwwV.js} +5 -5
  93. package/dist/cdn/chunks/{SavedBlocksPickBar-iG35XCDx.js.map → SavedBlocksPickBar-Cl6PLwwV.js.map} +1 -1
  94. package/dist/cdn/chunks/{TemplateScoringPanel-DuQJBykq.js → TemplateScoringPanel--JxR6CsQ.js} +6 -6
  95. package/dist/cdn/chunks/{TemplateScoringPanel-DuQJBykq.js.map → TemplateScoringPanel--JxR6CsQ.js.map} +1 -1
  96. package/dist/cdn/chunks/TemplateSettings-DjXiiiNr.js +207 -0
  97. package/dist/cdn/chunks/TemplateSettings-DjXiiiNr.js.map +1 -0
  98. package/dist/cdn/chunks/{TestEmailModal-D6Woss3r.js → TestEmailModal-BAuDxJtD.js} +9 -9
  99. package/dist/cdn/chunks/{TestEmailModal-D6Woss3r.js.map → TestEmailModal-BAuDxJtD.js.map} +1 -1
  100. package/dist/cdn/chunks/{TestEmailPanel-CWQFB7J3.js → TestEmailPanel-GUGZisLp.js} +3 -3
  101. package/dist/cdn/chunks/{TestEmailPanel-CWQFB7J3.js.map → TestEmailPanel-GUGZisLp.js.map} +1 -1
  102. package/dist/cdn/chunks/{TitleEditor-CbY1tgSl.js → TitleEditor-uKu33Nwr.js} +12 -12
  103. package/dist/cdn/chunks/{TitleEditor-CbY1tgSl.js.map → TitleEditor-uKu33Nwr.js.map} +1 -1
  104. package/dist/cdn/chunks/ToggleSwitch-CDy8OfcB.js +104 -0
  105. package/dist/cdn/chunks/ToggleSwitch-CDy8OfcB.js.map +1 -0
  106. package/dist/cdn/chunks/Toolbar-dxDYwN5E.js +2385 -0
  107. package/dist/cdn/chunks/Toolbar-dxDYwN5E.js.map +1 -0
  108. package/dist/cdn/chunks/{TplModal-CGpp-d_r.js → TplModal-DuwS2ifK.js} +5 -5
  109. package/dist/cdn/chunks/{TplModal-CGpp-d_r.js.map → TplModal-DuwS2ifK.js.map} +1 -1
  110. package/dist/cdn/chunks/{VersionHistoryMenu-ByVJXDbK.js → VersionHistoryMenu-Dij1pTEb.js} +6 -6
  111. package/dist/cdn/chunks/{VersionHistoryMenu-ByVJXDbK.js.map → VersionHistoryMenu-Dij1pTEb.js.map} +1 -1
  112. package/dist/cdn/chunks/{VersionHistoryPanels-CQJ5OggF.js → VersionHistoryPanels-GeR6MStB.js} +3 -3
  113. package/dist/cdn/chunks/{VersionHistoryPanels-CQJ5OggF.js.map → VersionHistoryPanels-GeR6MStB.js.map} +1 -1
  114. package/dist/cdn/chunks/{VersionPreviewBanner-G4lLbfr8.js → VersionPreviewBanner-Df3FVlig.js} +4 -4
  115. package/dist/cdn/chunks/{VersionPreviewBanner-G4lLbfr8.js.map → VersionPreviewBanner-Df3FVlig.js.map} +1 -1
  116. package/dist/cdn/chunks/{blockTypeIcons-CQY-vxdM.js → blockTypeIcons-raBjStuv.js} +2 -2
  117. package/dist/cdn/chunks/{blockTypeIcons-CQY-vxdM.js.map → blockTypeIcons-raBjStuv.js.map} +1 -1
  118. package/dist/cdn/chunks/{ca-Jx2CDwtn.js → ca-BTf1Zbqb.js} +10 -1
  119. package/dist/cdn/chunks/{ca-Jx2CDwtn.js.map → ca-BTf1Zbqb.js.map} +1 -1
  120. package/dist/cdn/chunks/{cloud-BLgCKP7Z.js → cloud-eaXyxZ8l.js} +2 -2
  121. package/dist/cdn/chunks/{cloud-BLgCKP7Z.js.map → cloud-eaXyxZ8l.js.map} +1 -1
  122. package/dist/cdn/chunks/{createCloudRuntime-ClvtMBF1.js → createCloudRuntime-D5bXzcTe.js} +6 -6
  123. package/dist/cdn/chunks/{createCloudRuntime-ClvtMBF1.js.map → createCloudRuntime-D5bXzcTe.js.map} +1 -1
  124. package/dist/{de-Ck0pBGHu.js → cdn/chunks/de-xzrh9PA3.js} +11 -0
  125. package/dist/cdn/chunks/{de-Ck0pBGHu.js.map → de-xzrh9PA3.js.map} +1 -1
  126. package/dist/cdn/chunks/{dist-BW6Y49zE.js → dist-BRZhN8qJ.js} +4 -4
  127. package/dist/cdn/chunks/dist-BRZhN8qJ.js.map +1 -0
  128. package/dist/cdn/chunks/{dist-CAFTQ6Y2.js → dist-CXB2_kBa.js} +27 -22
  129. package/dist/cdn/chunks/dist-CXB2_kBa.js.map +1 -0
  130. package/dist/cdn/chunks/{draggable-kbOhCgnk.js → draggable-IB4x6w2O.js} +1477 -1470
  131. package/dist/cdn/chunks/draggable-IB4x6w2O.js.map +1 -0
  132. package/dist/cdn/chunks/editor-modal-C-yBlj2C.js +2700 -0
  133. package/dist/cdn/chunks/editor-modal-C-yBlj2C.js.map +1 -0
  134. package/dist/cdn/chunks/en-DYtFUE2l.js +2 -0
  135. package/dist/cdn/chunks/{es-lagTvUfX.js → es-BT4LSpE2.js} +10 -1
  136. package/dist/cdn/chunks/{es-lagTvUfX.js.map → es-BT4LSpE2.js.map} +1 -1
  137. package/dist/cdn/chunks/{extensions-D2YIhF7u.js → extensions-Bhu8UEE5.js} +105 -45
  138. package/dist/cdn/chunks/extensions-Bhu8UEE5.js.map +1 -0
  139. package/dist/cdn/chunks/{fr-C4hVl5Lk.js → fr-CI7OJoql.js} +10 -1
  140. package/dist/cdn/chunks/{fr-C4hVl5Lk.js.map → fr-CI7OJoql.js.map} +1 -1
  141. package/dist/cdn/chunks/{icons-DdrAicM2.js → icons-BKkJ-5xF.js} +43 -43
  142. package/dist/cdn/chunks/{icons-DdrAicM2.js.map → icons-BKkJ-5xF.js.map} +1 -1
  143. package/dist/cdn/chunks/{keys-DXYJTLZF.js → keys-dJbD1QPs.js} +2 -2
  144. package/dist/cdn/chunks/{keys-DXYJTLZF.js.map → keys-dJbD1QPs.js.map} +1 -1
  145. package/dist/{nl-CReD7Apd.js → cdn/chunks/nl-D8y5OWGB.js} +11 -0
  146. package/dist/cdn/chunks/{nl-CReD7Apd.js.map → nl-D8y5OWGB.js.map} +1 -1
  147. package/dist/cdn/chunks/{pt-BR-BRA0-vGP.js → pt-BR-DMCbUBvJ.js} +10 -1
  148. package/dist/cdn/chunks/{pt-BR-BRA0-vGP.js.map → pt-BR-DMCbUBvJ.js.map} +1 -1
  149. package/dist/cdn/chunks/socialIcons-9VrG8X3m.js +1054 -0
  150. package/dist/cdn/chunks/socialIcons-9VrG8X3m.js.map +1 -0
  151. package/dist/cdn/chunks/{src-fn7uy1FD.js → src-O5Sp_qJ7.js} +3 -3
  152. package/dist/cdn/chunks/{src-fn7uy1FD.js.map → src-O5Sp_qJ7.js.map} +1 -1
  153. package/dist/cdn/chunks/templateSettingsFields-YCFVBVYh.js +36 -0
  154. package/dist/cdn/chunks/templateSettingsFields-YCFVBVYh.js.map +1 -0
  155. package/dist/cdn/chunks/{tiptap-Epe8m3Vo.js → tiptap-DhLuKyDc.js} +2776 -2773
  156. package/dist/cdn/chunks/tiptap-DhLuKyDc.js.map +1 -0
  157. package/dist/cdn/chunks/{useAliveFlag-CT9gjvO_.js → useAliveFlag-DAlQLbM2.js} +2 -2
  158. package/dist/cdn/chunks/{useAliveFlag-CT9gjvO_.js.map → useAliveFlag-DAlQLbM2.js.map} +1 -1
  159. package/dist/cdn/chunks/{useCloudI18n-OezCj0cx.js → useCloudI18n-C09JcFS0.js} +3 -3
  160. package/dist/cdn/chunks/{useCloudI18n-OezCj0cx.js.map → useCloudI18n-C09JcFS0.js.map} +1 -1
  161. package/dist/cdn/chunks/useEditorCore-BHmIp1hW.js +2592 -0
  162. package/dist/cdn/chunks/useEditorCore-BHmIp1hW.js.map +1 -0
  163. package/dist/cdn/chunks/useEditorRoot-DFx2fXJP.js +10 -0
  164. package/dist/cdn/chunks/{useEditorRoot-ByHPMqYT.js.map → useEditorRoot-DFx2fXJP.js.map} +1 -1
  165. package/dist/cdn/chunks/{useI18n-BhE7ndNr.js → useI18n-DTZ9sIcv.js} +3 -3
  166. package/dist/cdn/chunks/{useI18n-BhE7ndNr.js.map → useI18n-DTZ9sIcv.js.map} +1 -1
  167. package/dist/cdn/chunks/useLogicTag-E2V0Xdcb.js +38 -0
  168. package/dist/cdn/chunks/useLogicTag-E2V0Xdcb.js.map +1 -0
  169. package/dist/cdn/chunks/{useMergeTag-DE2mpy1w.js → useMergeTag-BE8oDoha.js} +3 -3
  170. package/dist/cdn/chunks/{useMergeTag-DE2mpy1w.js.map → useMergeTag-BE8oDoha.js.map} +1 -1
  171. package/dist/cdn/chunks/{usePopoverPosition-BPL891uG.js → usePopoverPosition-gB9q-ql7.js} +3 -3
  172. package/dist/cdn/chunks/{usePopoverPosition-BPL891uG.js.map → usePopoverPosition-gB9q-ql7.js.map} +1 -1
  173. package/dist/cdn/chunks/{useScrollToBlock-DwF4pVur.js → useScrollToBlock-CtTXwmiU.js} +3 -3
  174. package/dist/cdn/chunks/{useScrollToBlock-DwF4pVur.js.map → useScrollToBlock-CtTXwmiU.js.map} +1 -1
  175. package/dist/cdn/editor.css +1 -1
  176. package/dist/cdn/editor.js +809 -3337
  177. package/dist/cdn/editor.js.map +1 -1
  178. package/dist/{check-9xX6RVHz.js → check-eqb2JhqU.js} +1 -1
  179. package/dist/{chevron-down-J5hFJ6TL.js → chevron-down-Dkr-7Ywl.js} +1 -1
  180. package/dist/{chevron-right-BJuo5PQ-.js → chevron-right-Bge4XF_B.js} +1 -1
  181. package/dist/{chevron-up-Qfi5k52_.js → chevron-up-CQAyl0kC.js} +1 -1
  182. package/dist/{circle-alert-BiArYmkB.js → circle-alert-CYgTHKWr.js} +1 -1
  183. package/dist/{clock-BkYJZ7Y0.js → clock-BgSJZJP5.js} +1 -1
  184. package/dist/{cloud-DdidMW6f.js → cloud-C9xWZXhg.js} +1 -1
  185. package/dist/{copy-BRLUNHwF.js → copy-mw6PVnOJ.js} +1 -1
  186. package/dist/{createCloudRuntime-CNFXaTNQ.js → createCloudRuntime-BGd5--Bq.js} +5 -5
  187. package/dist/{createLucideIcon-CDDkF1Tm.js → createLucideIcon-BxY5yz5u.js} +6 -6
  188. package/dist/{cdn/chunks/de-Ck0pBGHu.js → de-xzrh9PA3.js} +9 -2
  189. package/dist/{dist-D8i1ixHK.js → dist-8VFzbeu9.js} +3 -3
  190. package/dist/{dist-DBirAJIs.js → dist-BDuPwOyn.js} +26 -21
  191. package/dist/{dist-CtF9STPS.js → dist-BJM3eFyT.js} +1 -1
  192. package/dist/{dist-DkcA6epL.js → dist-BdHF7nyq.js} +3 -3
  193. package/dist/{dist-ByT5fgKq.js → dist-Bl4rxpX9.js} +1 -1
  194. package/dist/{dist-BVqAYoRB.js → dist-BmsLcnrO.js} +4 -4
  195. package/dist/{dist-CtMXAH7a.js → dist-BxVnMgXZ.js} +1 -1
  196. package/dist/{dist-DC-3T0ED.js → dist-CQSVro7b.js} +1 -1
  197. package/dist/{dist-f7HXo6j6.js → dist-DQbOebGW.js} +1 -1
  198. package/dist/{dist-DL9334yz.js → dist-DerFNpDY.js} +3 -3
  199. package/dist/{dist-D08oVYhr.js → dist-Djmzp6wi.js} +1 -1
  200. package/dist/{dist-D7WY8VPq.js → dist-DyrEOKEJ.js} +1 -1
  201. package/dist/{dist-DzdeVn-W.js → dist-EDkj3Ub1.js} +1 -1
  202. package/dist/{dist-C1tsW_99.js → dist-wyXxj3R1.js} +1 -1
  203. package/dist/editor-modal-oD1qNz_P.js +2773 -0
  204. package/dist/en-CM5fTFSo.js +2 -0
  205. package/dist/{es-lagTvUfX.js → es-BT4LSpE2.js} +9 -0
  206. package/dist/extensions-DRN-elXT.js +1645 -0
  207. package/dist/{eye-DwhBOaV8.js → eye-DphkRtAD.js} +1 -1
  208. package/dist/{fr-C4hVl5Lk.js → fr-CI7OJoql.js} +9 -0
  209. package/dist/{image-up-CiyQNZBt.js → image-up-Qi2BXD7T.js} +1 -1
  210. package/dist/{info-D6A1qEiF.js → info-VSyAs02q.js} +1 -1
  211. package/dist/{keys-DD1rl72F.js → keys-BdoSgsz9.js} +1 -1
  212. package/dist/{link-tKGmYWsB.js → link-CNuozGqD.js} +1 -1
  213. package/dist/{list-DjZQRpeI.js → list-BA0I5Wmu.js} +1 -1
  214. package/dist/{loader-circle-D9ZL3Sv0.js → loader-circle-z5eeqasv.js} +1 -1
  215. package/dist/{message-circle-KTHxCcpB.js → message-circle-BsQ9hEup.js} +1 -1
  216. package/dist/{cdn/chunks/nl-CReD7Apd.js → nl-D8y5OWGB.js} +9 -2
  217. package/dist/package-OkXfuRoO.js +25 -0
  218. package/dist/{pencil-Bq-nbQ7F.js → pencil-DFVFA7Dj.js} +1 -1
  219. package/dist/{plus-CRMnR4IG.js → plus-D8bkVjZ7.js} +1 -1
  220. package/dist/{pt-BR-BRA0-vGP.js → pt-BR-DMCbUBvJ.js} +9 -0
  221. package/dist/{refresh-cw-D7bYS5tm.js → refresh-cw-DPB7YFuz.js} +1 -1
  222. package/dist/{runtime-dom.esm-bundler-PnoZU512.js → runtime-dom.esm-bundler-BGbPz4-g.js} +2 -2
  223. package/dist/{search-DUo0YwPz.js → search-C-dCgqIa.js} +1 -1
  224. package/dist/{send-DaVMQphu.js → send-Cm2fy2zm.js} +1 -1
  225. package/dist/{shield-check-DxaaurL9.js → shield-check-COgBYFDF.js} +1 -1
  226. package/dist/smartphone-v0u_MOEV.js +46 -0
  227. package/dist/socialIcons-DkGcpEwC.js +1130 -0
  228. package/dist/{sparkles-D6T6k30e.js → sparkles-Ds0RF8Iu.js} +1 -1
  229. package/dist/style.css +1 -1
  230. package/dist/templateSettingsFields-YCFVBVYh.js +34 -0
  231. package/dist/templatical-editor.js +895 -3498
  232. package/dist/{text-align-start-vreFpmCX.js → text-align-start-DiavaIm6.js} +1 -1
  233. package/dist/{trash-DBv8MGY6.js → trash-DnOkfu2V.js} +1 -1
  234. package/dist/{triangle-alert-CmNS2LLv.js → triangle-alert-DGLAyXnh.js} +1 -1
  235. package/dist/{upload-DDB9Fs0P.js → upload-BBDme2cy.js} +1 -1
  236. package/dist/{useAliveFlag-oyByIcjy.js → useAliveFlag-BkKyhkwZ.js} +1 -1
  237. package/dist/{useCloudI18n-C1wuXik6.js → useCloudI18n-D1iedlP3.js} +2 -2
  238. package/dist/{useEditorCore-jfwgLThK.js → useEditorCore-C5APBjjV.js} +1140 -2325
  239. package/dist/{useEditorRoot-eVv4doqZ.js → useEditorRoot-BOxn5EfP.js} +2 -2
  240. package/dist/{useI18n-VOtdfENx.js → useI18n-Ds_-druD.js} +2 -2
  241. package/dist/useLogicTag-DoHfc08B.js +36 -0
  242. package/dist/{useMergeTag-CQM9pFca.js → useMergeTag-DXyum3kG.js} +2 -2
  243. package/dist/{usePopoverPosition-gZjRywai.js → usePopoverPosition-Du-Ah8E9.js} +2 -2
  244. package/dist/{useScrollToBlock-C0Ehnyl4.js → useScrollToBlock-DXQYPCnJ.js} +3 -3
  245. package/dist/{vue.runtime.esm-bundler-DShF3P6k.js → vue.runtime.esm-bundler-CyqhBwpY.js} +1133 -1126
  246. package/dist/{x-B7sgO_z8.js → x-3BHV3Q6K.js} +1 -1
  247. package/package.json +14 -14
  248. package/dist/ColorPicker-BTtN94te.js +0 -501
  249. package/dist/FieldRow-C8nOknr_.js +0 -128
  250. package/dist/MergeTagInput-Cw1RoMly.js +0 -509
  251. package/dist/MergeTagSuggestion-BXO3UIXW.js +0 -1329
  252. package/dist/cdn/chunks/ColorPicker-BaonTCAQ.js +0 -502
  253. package/dist/cdn/chunks/ColorPicker-BaonTCAQ.js.map +0 -1
  254. package/dist/cdn/chunks/FieldRow-D9OJhYeb.js +0 -130
  255. package/dist/cdn/chunks/FieldRow-D9OJhYeb.js.map +0 -1
  256. package/dist/cdn/chunks/MergeTagInput-CSIThqkz.js +0 -470
  257. package/dist/cdn/chunks/MergeTagInput-CSIThqkz.js.map +0 -1
  258. package/dist/cdn/chunks/MergeTagSuggestion-CY6WK8Eb.js +0 -215
  259. package/dist/cdn/chunks/MergeTagSuggestion-CY6WK8Eb.js.map +0 -1
  260. package/dist/cdn/chunks/dist-BW6Y49zE.js.map +0 -1
  261. package/dist/cdn/chunks/dist-CAFTQ6Y2.js.map +0 -1
  262. package/dist/cdn/chunks/draggable-kbOhCgnk.js.map +0 -1
  263. package/dist/cdn/chunks/editor-modal-B6IdQWlf.js +0 -5908
  264. package/dist/cdn/chunks/editor-modal-B6IdQWlf.js.map +0 -1
  265. package/dist/cdn/chunks/en-DjunooBz.js +0 -2
  266. package/dist/cdn/chunks/extensions-D2YIhF7u.js.map +0 -1
  267. package/dist/cdn/chunks/tiptap-Epe8m3Vo.js.map +0 -1
  268. package/dist/cdn/chunks/useEditorCore-06PtcUi1.js +0 -3698
  269. package/dist/cdn/chunks/useEditorCore-06PtcUi1.js.map +0 -1
  270. package/dist/cdn/chunks/useEditorRoot-ByHPMqYT.js +0 -10
  271. package/dist/editor-modal-uAEB6xKz.js +0 -5998
  272. package/dist/en-CQWkDCpm.js +0 -2
  273. package/dist/extensions-CcGj7OfS.js +0 -470
@@ -0,0 +1,2773 @@
1
+ import { A as e, At as t, B as n, D as r, J as i, K as a, M as o, P as s, R as c, S as l, V as u, Z as d, _ as f, at as p, c as m, d as h, g, h as _, i as v, j as y, jt as b, kt as x, l as S, r as C, rt as w, s as T, tt as E, u as D, v as O } from "./vue.runtime.esm-bundler-CyqhBwpY.js";
2
+ import { a as k, c as A, s as j, t as M } from "./runtime-dom.esm-bundler-BGbPz4-g.js";
3
+ import { h as N } from "./dist-8VFzbeu9.js";
4
+ import { a as P, n as F, o as I, r as L, s as R, t as ee } from "./dist-BDuPwOyn.js";
5
+ import { t as z } from "./createLucideIcon-BxY5yz5u.js";
6
+ import { t as B } from "./check-eqb2JhqU.js";
7
+ import { t as V } from "./chevron-right-Bge4XF_B.js";
8
+ import { t as te } from "./copy-mw6PVnOJ.js";
9
+ import { t as ne } from "./link-CNuozGqD.js";
10
+ import { t as re } from "./list-BA0I5Wmu.js";
11
+ import { t as H } from "./loader-circle-z5eeqasv.js";
12
+ import { t as U } from "./pencil-DFVFA7Dj.js";
13
+ import { t as W } from "./plus-D8bkVjZ7.js";
14
+ import { t as G } from "./refresh-cw-DPB7YFuz.js";
15
+ import { t as ie } from "./search-C-dCgqIa.js";
16
+ import { t as ae } from "./trash-DnOkfu2V.js";
17
+ import { t as oe } from "./upload-BBDme2cy.js";
18
+ import { t as se } from "./x-3BHV3Q6K.js";
19
+ import { t as K } from "./_plugin-vue_export-helper-B3ysoDQm.js";
20
+ var q = z({
21
+ name: "file",
22
+ size: 24,
23
+ node: [["path", {
24
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
25
+ key: "1oefj6"
26
+ }], ["path", {
27
+ d: "M14 2v5a1 1 0 0 0 1 1h5",
28
+ key: "wfsgrz"
29
+ }]]
30
+ }), J = z({
31
+ name: "folder",
32
+ size: 24,
33
+ node: [["path", {
34
+ d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
35
+ key: "1kt360"
36
+ }]]
37
+ }), ce = z({
38
+ name: "grid-2x2",
39
+ size: 24,
40
+ node: [
41
+ ["path", {
42
+ d: "M12 3v18",
43
+ key: "108xh3"
44
+ }],
45
+ ["path", {
46
+ d: "M3 12h18",
47
+ key: "1i2n21"
48
+ }],
49
+ ["rect", {
50
+ x: "3",
51
+ y: "3",
52
+ width: "18",
53
+ height: "18",
54
+ rx: "2",
55
+ key: "h1oib"
56
+ }]
57
+ ],
58
+ aliases: ["grid-2-x-2"]
59
+ }), Y = z({
60
+ name: "panel-left",
61
+ size: 24,
62
+ node: [["rect", {
63
+ width: "18",
64
+ height: "18",
65
+ x: "3",
66
+ y: "3",
67
+ rx: "2",
68
+ key: "afitv7"
69
+ }], ["path", {
70
+ d: "M9 3v18",
71
+ key: "fh3hqa"
72
+ }]],
73
+ aliases: ["sidebar"]
74
+ }), le = z({
75
+ name: "star",
76
+ size: 24,
77
+ node: [["path", {
78
+ d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",
79
+ key: "r04s7s"
80
+ }]]
81
+ }), ue = Symbol("templaticalMediaLimits"), X = Symbol("templaticalMediaPopoverTarget"), de = Symbol("templaticalMediaTranslations"), Z = Symbol("templaticalMediaUiTheme"), fe = Symbol("templaticalMediaUiLocale"), pe = { mediaLibrary: {
82
+ title: "Media Library",
83
+ searchPlaceholder: "Search files...",
84
+ allFiles: "All Files",
85
+ filterAll: "All Types",
86
+ filterImages: "Images",
87
+ filterDocuments: "Documents",
88
+ filterVideos: "Videos",
89
+ filterAudio: "Audio",
90
+ newFolder: "New Folder",
91
+ folderName: "Folder name",
92
+ noFiles: "No files found",
93
+ noSearchResults: "No files match your search",
94
+ dropOrClick: "Drop files here or click to upload",
95
+ acceptedFormats: "Images, PDF, Video, Audio, Documents (max 10MB)",
96
+ uploading: "Uploading...",
97
+ uploadingProgress: "Uploading {current} of {total}...",
98
+ selectImage: "Select Image",
99
+ selectFile: "Select File",
100
+ deleteSelected: "Delete",
101
+ copyUrl: "Copy URL",
102
+ copied: "Copied!",
103
+ browseMedia: "Browse Media Library",
104
+ renameFolder: "Rename folder",
105
+ addSubfolder: "Add subfolder",
106
+ subfolderName: "Subfolder name",
107
+ sortNewest: "Newest First",
108
+ sortOldest: "Oldest First",
109
+ sortNameAsc: "Name A-Z",
110
+ sortNameDesc: "Name Z-A",
111
+ sortSizeAsc: "Smallest First",
112
+ sortSizeDesc: "Largest First",
113
+ moveSelected: "Move",
114
+ moveToRoot: "All Files",
115
+ currentFolder: "(current)",
116
+ confirmDelete: "Confirm?",
117
+ renameFile: "Rename",
118
+ editFile: "Edit File",
119
+ fileName: "Filename",
120
+ altText: "Alt Text",
121
+ altTextPlaceholder: "Describe this image for accessibility",
122
+ saveChanges: "Save",
123
+ cancel: "Cancel",
124
+ frequentlyUsed: "Frequently Used",
125
+ deleteWarningTitle: "Delete File",
126
+ deleteWarningMessage: "Are you sure? This action is irreversible.",
127
+ deleteWarningUsageNote: "The following files are used in templates. Deleting them may break those templates.",
128
+ deleteAnyway: "Delete",
129
+ usedInTemplates: "Used in {count} template(s)",
130
+ viewGrid: "Grid view",
131
+ viewList: "List view",
132
+ showFolders: "Show folders",
133
+ hideFolders: "Hide folders",
134
+ importFromUrl: "Import from URL",
135
+ importUrlPlaceholder: "https://example.com/image.jpg",
136
+ import: "Import",
137
+ importing: "Importing...",
138
+ importError: "Failed to import from URL",
139
+ replaceFile: "Replace File",
140
+ replaceWarningTitle: "Replace File",
141
+ replaceWarningMessage: "You are about to replace this file. The replacement must have the same file extension ({extension}).",
142
+ replaceWarningUsageNote: "This file is used in {count} template(s). Replacing it will update all references.",
143
+ replaceSelectFile: "Select replacement file",
144
+ replace: "Replace",
145
+ replacing: "Replacing...",
146
+ replaceError: "Failed to replace file",
147
+ saving: "Saving...",
148
+ cropAspectRatio: "Aspect Ratio",
149
+ cropFree: "Free",
150
+ cropSquare: "1:1",
151
+ cropLandscape43: "4:3",
152
+ cropLandscape169: "16:9",
153
+ cropOriginal: "Original",
154
+ cropMaxWidth: "Max Width",
155
+ cropMaxHeight: "Max Height",
156
+ cropOutputSize: "Output Size",
157
+ cropPixels: "px",
158
+ cropOptional: "(optional)",
159
+ close: "Close",
160
+ searchAriaLabel: "Search files",
161
+ filterAriaLabel: "Filter by type",
162
+ filesListAriaLabel: "Files",
163
+ loading: "Loading",
164
+ expandFolder: "Expand folder",
165
+ collapseFolder: "Collapse folder",
166
+ deleteFolder: "Delete folder",
167
+ deleteFolderConfirm: "Confirm delete",
168
+ storageTooltip: "{used} of {total} used ({remaining} remaining)"
169
+ } };
170
+ //#endregion
171
+ //#region ../media-library/src/composables/useI18n.ts
172
+ function Q(e) {
173
+ let t = e ?? l(de, null), n = (a(t) ? t.value : t) ?? pe;
174
+ function r(e, t) {
175
+ return e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : `{${n}}`);
176
+ }
177
+ return {
178
+ t: n,
179
+ format: r
180
+ };
181
+ }
182
+ //#endregion
183
+ //#region ../media-library/src/composables/useMediaCategories.ts
184
+ var me = [
185
+ "images",
186
+ "documents",
187
+ "videos",
188
+ "audio"
189
+ ];
190
+ function $(e) {
191
+ let t = e ?? l(ue, null);
192
+ if (!t) throw Error("[Templatical] useMediaCategories() needs media limits in scope. Render it under <MediaLibraryModal> or provide MEDIA_LIMITS_KEY yourself.");
193
+ let n = t, r = T(() => !0), i = T(() => n.maxFileSize ?? Infinity), a = T(() => {
194
+ let e = n.accept;
195
+ if (e && e.length > 0) return e;
196
+ let t = n.mimeTypes;
197
+ return t ? Object.keys(t) : me;
198
+ }), o = T(() => {
199
+ let e = n.mimeTypes;
200
+ return e ? a.value.flatMap((t) => e[t] ?? []) : [];
201
+ }), s = T(() => o.value.join(","));
202
+ function c(e, t) {
203
+ let r = n.mimeTypes;
204
+ return !r || (t && t.length > 0 ? t : Object.keys(r)).some((t) => r[t]?.includes(e) ?? !1);
205
+ }
206
+ function u(e) {
207
+ return c(e.type) && e.size <= i.value;
208
+ }
209
+ function d(e) {
210
+ let t = n.mimeTypes;
211
+ return t ? t.images?.includes(e) ?? !1 : e.startsWith("image/");
212
+ }
213
+ function f(e) {
214
+ let t = n.mimeTypes;
215
+ if (!t) return null;
216
+ for (let [n, r] of Object.entries(t)) if (r?.includes(e)) return n;
217
+ return null;
218
+ }
219
+ return {
220
+ isMediaLibraryEnabled: r,
221
+ allAcceptedMimeTypes: o,
222
+ allAcceptedInputString: s,
223
+ maxFileSize: i,
224
+ availableCategories: a,
225
+ isAcceptedMimeType: c,
226
+ isAcceptedFile: u,
227
+ isImageMimeType: d,
228
+ getCategoryForMimeType: f
229
+ };
230
+ }
231
+ //#endregion
232
+ //#region ../media-library/src/composables/useFocusTrap.ts
233
+ var he = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
234
+ function ge(e, t) {
235
+ let n = null, r = null, a = null;
236
+ function o(e) {
237
+ if (!e) return document;
238
+ let t = e.getRootNode();
239
+ return t && "activeElement" in t ? t : document;
240
+ }
241
+ function s() {
242
+ return e.value ? Array.from(e.value.querySelectorAll(he)).filter((e) => e.offsetParent !== null) : [];
243
+ }
244
+ function l(t) {
245
+ if (t.key !== "Tab") return;
246
+ let n = s();
247
+ if (n.length === 0) return;
248
+ let r = n[0], i = n[n.length - 1], a = o(e.value).activeElement;
249
+ t.shiftKey ? a === r && (t.preventDefault(), i.focus()) : a === i && (t.preventDefault(), r.focus());
250
+ }
251
+ function u() {
252
+ let t = r !== null || a !== null;
253
+ t && d({ restoreFocus: !1 }), t || (n = o(e.value).activeElement), a = requestAnimationFrame(() => {
254
+ a = null;
255
+ let t = s();
256
+ t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
257
+ }), r = P(e, "keydown", l);
258
+ }
259
+ function d(e = {}) {
260
+ let t = e.restoreFocus !== !1;
261
+ a !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(a), a = null), r?.(), r = null, t && n && n.focus && (n.focus(), n = null);
262
+ }
263
+ let f = c([t, e], ([e, t]) => {
264
+ e && t ? u() : d();
265
+ }, { flush: "post" });
266
+ i(() => {
267
+ f(), d();
268
+ });
269
+ }
270
+ //#endregion
271
+ //#region ../media-library/src/components/media/MediaBreadcrumb.vue?vue&type=script&setup=true&lang.ts
272
+ var _e = {
273
+ key: 0,
274
+ class: "tpl:flex tpl:items-center tpl:gap-1 tpl:text-xs",
275
+ style: { color: "var(--tpl-text-muted)" }
276
+ }, ve = ["onClick"], ye = {
277
+ key: 1,
278
+ style: { color: "var(--tpl-text)" }
279
+ }, be = /* @__PURE__ */ O({
280
+ __name: "MediaBreadcrumb",
281
+ props: {
282
+ folders: {},
283
+ currentFolderId: {}
284
+ },
285
+ emits: ["navigate"],
286
+ setup(t, { emit: n }) {
287
+ let r = t, i = n, { t: a } = Q(), s = T(() => {
288
+ if (!r.currentFolderId) return [];
289
+ let e = [];
290
+ return c(r.folders, r.currentFolderId, e), e;
291
+ });
292
+ function c(e, t, n) {
293
+ for (let r of e) {
294
+ if (r.id === t) return n.push(r), !0;
295
+ if (c(r.children, t, n)) return n.unshift(r), !0;
296
+ }
297
+ return !1;
298
+ }
299
+ return (t, n) => s.value.length > 0 ? (e(), h("div", _e, [m("button", {
300
+ class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
301
+ style: { color: "var(--tpl-primary)" },
302
+ onClick: n[0] ||= (e) => i("navigate", null)
303
+ }, b(p(a).mediaLibrary.allFiles), 1), (e(!0), h(C, null, o(s.value, (t, n) => (e(), h(C, { key: t.id }, [g(p(V), {
304
+ size: 12,
305
+ "stroke-width": 2
306
+ }), n < s.value.length - 1 ? (e(), h("button", {
307
+ key: 0,
308
+ class: "tpl:transition-colors tpl:duration-150 tpl:hover:underline",
309
+ style: { color: "var(--tpl-primary)" },
310
+ onClick: (e) => i("navigate", t.id)
311
+ }, b(t.name), 9, ve)) : (e(), h("span", ye, b(t.name), 1))], 64))), 128))])) : D("", !0);
312
+ }
313
+ }), xe = ["aria-expanded", "aria-label"], Se = {
314
+ key: 1,
315
+ class: "tpl:size-4 tpl:shrink-0"
316
+ }, Ce = {
317
+ key: 0,
318
+ class: "tpl:truncate"
319
+ }, we = ["onKeydown"], Te = ["title", "aria-label"], Ee = ["title", "aria-label"], De = ["title", "aria-label"], Oe = { key: 0 }, ke = ["placeholder", "onKeydown"], Ae = /* @__PURE__ */ O({
320
+ __name: "MediaFolderTreeNode",
321
+ props: {
322
+ folder: {},
323
+ currentFolderId: {},
324
+ depth: {},
325
+ canCreateFolder: { type: Boolean },
326
+ canRenameFolder: { type: Boolean },
327
+ canDeleteFolder: { type: Boolean }
328
+ },
329
+ emits: [
330
+ "navigate",
331
+ "createFolder",
332
+ "renameFolder",
333
+ "deleteFolder"
334
+ ],
335
+ setup(n, { emit: r }) {
336
+ let i = n, a = r, { t: c } = Q(), l = d(!1), f = d(!1), _ = d(""), v = d(!1), y = d(""), w = d(!1), E = T(() => i.folder.children.length > 0), O = T(() => i.depth < 4), M = T(() => i.currentFolderId === i.folder.id), N = T(() => i.currentFolderId ? F(i.folder.children, i.currentFolderId) : !1), P = T(() => l.value || N.value);
337
+ function F(e, t) {
338
+ for (let n of e) if (n.id === t || F(n.children, t)) return !0;
339
+ return !1;
340
+ }
341
+ function I() {
342
+ l.value = !l.value;
343
+ }
344
+ function L() {
345
+ f.value = !0, _.value = i.folder.name;
346
+ }
347
+ function R() {
348
+ let e = _.value.trim();
349
+ e && e !== i.folder.name && a("renameFolder", i.folder.id, e), f.value = !1, _.value = "";
350
+ }
351
+ function ee() {
352
+ f.value = !1, _.value = "";
353
+ }
354
+ function z() {
355
+ v.value = !0, y.value = "", l.value = !0;
356
+ }
357
+ function B() {
358
+ y.value.trim() && a("createFolder", y.value.trim(), i.folder.id), v.value = !1, y.value = "";
359
+ }
360
+ function te() {
361
+ v.value = !1, y.value = "";
362
+ }
363
+ function ne() {
364
+ if (w.value) {
365
+ a("deleteFolder", i.folder.id), w.value = !1;
366
+ return;
367
+ }
368
+ w.value = !0;
369
+ }
370
+ function re(e) {
371
+ let t = e.relatedTarget;
372
+ t && e.currentTarget.contains(t) || (w.value = !1);
373
+ }
374
+ return (r, i) => {
375
+ let l = s("MediaFolderTreeNode", !0);
376
+ return e(), h("div", null, [m("div", {
377
+ class: "tpl:group tpl:flex tpl:w-full tpl:items-center tpl:gap-1 tpl:py-1.5 tpl:pr-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
378
+ style: t({
379
+ paddingLeft: `${n.depth * 16 + 8}px`,
380
+ backgroundColor: M.value ? "var(--tpl-bg-active)" : "transparent",
381
+ color: M.value ? "var(--tpl-primary)" : "var(--tpl-text)"
382
+ }),
383
+ onFocusout: re
384
+ }, [
385
+ E.value || v.value ? (e(), h("button", {
386
+ key: 0,
387
+ type: "button",
388
+ class: "tpl:flex tpl:size-4 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
389
+ "aria-expanded": P.value,
390
+ "aria-label": P.value ? p(c).mediaLibrary.collapseFolder : p(c).mediaLibrary.expandFolder,
391
+ onClick: A(I, ["stop"])
392
+ }, [g(p(V), {
393
+ class: x(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-90": P.value }]),
394
+ size: 10,
395
+ "stroke-width": 2
396
+ }, null, 8, ["class"])], 8, xe)) : (e(), h("span", Se)),
397
+ m("button", {
398
+ type: "button",
399
+ class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-1.5",
400
+ onClick: i[0] ||= (e) => a("navigate", n.folder.id)
401
+ }, [g(p(J), {
402
+ class: "tpl:shrink-0",
403
+ size: 14,
404
+ "stroke-width": 1.5
405
+ }), f.value ? D("", !0) : (e(), h("span", Ce, b(n.folder.name), 1))]),
406
+ f.value ? u((e(), h("input", {
407
+ key: 2,
408
+ "onUpdate:modelValue": i[1] ||= (e) => _.value = e,
409
+ type: "text",
410
+ class: "tpl:min-w-0 tpl:flex-1 tpl:rounded tpl:border tpl:px-1.5 tpl:py-0.5 tpl:text-xs tpl:outline-none",
411
+ style: {
412
+ "border-color": "var(--tpl-primary)",
413
+ "background-color": "var(--tpl-bg)",
414
+ color: "var(--tpl-text)"
415
+ },
416
+ autofocus: "",
417
+ onKeydown: [j(R, ["enter"]), j(A(ee, ["stop"]), ["escape"])],
418
+ onBlur: R,
419
+ onClick: i[2] ||= A(() => {}, ["stop"])
420
+ }, null, 40, we)), [[k, _.value]]) : D("", !0),
421
+ f.value ? D("", !0) : (e(), h("span", {
422
+ key: 3,
423
+ class: x(["tpl:flex tpl:shrink-0 tpl:items-center tpl:gap-0.5 tpl:transition-opacity", M.value || w.value ? "tpl:opacity-100" : "tpl:opacity-0 tpl:group-hover:opacity-100 tpl:group-focus-within:opacity-100"])
424
+ }, [
425
+ O.value && n.canCreateFolder ? (e(), h("button", {
426
+ key: 0,
427
+ type: "button",
428
+ class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
429
+ title: p(c).mediaLibrary.addSubfolder,
430
+ "aria-label": p(c).mediaLibrary.addSubfolder,
431
+ onClick: A(z, ["stop"])
432
+ }, [g(p(W), {
433
+ size: 12,
434
+ "stroke-width": 2
435
+ })], 8, Te)) : D("", !0),
436
+ n.canRenameFolder ? (e(), h("button", {
437
+ key: 1,
438
+ type: "button",
439
+ class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
440
+ title: p(c).mediaLibrary.renameFolder,
441
+ "aria-label": p(c).mediaLibrary.renameFolder,
442
+ onClick: A(L, ["stop"])
443
+ }, [g(p(U), {
444
+ size: 12,
445
+ "stroke-width": 2
446
+ })], 8, Ee)) : D("", !0),
447
+ n.canDeleteFolder ? (e(), h("button", {
448
+ key: 2,
449
+ type: "button",
450
+ "data-testid": "media-folder-delete",
451
+ class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded tpl:transition-colors",
452
+ title: w.value ? p(c).mediaLibrary.deleteFolderConfirm : p(c).mediaLibrary.deleteFolder,
453
+ "aria-label": w.value ? p(c).mediaLibrary.deleteFolderConfirm : p(c).mediaLibrary.deleteFolder,
454
+ onClick: A(ne, ["stop"])
455
+ }, [g(p(ae), {
456
+ size: 12,
457
+ "stroke-width": 2,
458
+ style: { color: "var(--tpl-danger)" }
459
+ })], 8, De)) : D("", !0)
460
+ ], 2))
461
+ ], 36), P.value ? (e(), h("div", Oe, [(e(!0), h(C, null, o(n.folder.children, (t) => (e(), S(l, {
462
+ key: t.id,
463
+ folder: t,
464
+ "current-folder-id": n.currentFolderId,
465
+ depth: n.depth + 1,
466
+ "can-create-folder": n.canCreateFolder,
467
+ "can-rename-folder": n.canRenameFolder,
468
+ "can-delete-folder": n.canDeleteFolder,
469
+ onNavigate: i[3] ||= (e) => a("navigate", e),
470
+ onCreateFolder: i[4] ||= (e, t) => a("createFolder", e, t),
471
+ onRenameFolder: i[5] ||= (e, t) => a("renameFolder", e, t),
472
+ onDeleteFolder: i[6] ||= (e) => a("deleteFolder", e)
473
+ }, null, 8, [
474
+ "folder",
475
+ "current-folder-id",
476
+ "depth",
477
+ "can-create-folder",
478
+ "can-rename-folder",
479
+ "can-delete-folder"
480
+ ]))), 128)), v.value ? (e(), h("div", {
481
+ key: 0,
482
+ style: t({ paddingLeft: `${(n.depth + 1) * 16 + 8}px` }),
483
+ class: "tpl:py-1.5 tpl:pr-2"
484
+ }, [u(m("input", {
485
+ "onUpdate:modelValue": i[7] ||= (e) => y.value = e,
486
+ type: "text",
487
+ class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
488
+ style: {
489
+ "border-color": "var(--tpl-primary)",
490
+ "background-color": "var(--tpl-bg)",
491
+ color: "var(--tpl-text)"
492
+ },
493
+ placeholder: p(c).mediaLibrary.subfolderName,
494
+ autofocus: "",
495
+ onKeydown: [j(B, ["enter"]), j(A(te, ["stop"]), ["escape"])],
496
+ onBlur: B
497
+ }, null, 40, ke), [[k, y.value]])], 4)) : D("", !0)])) : D("", !0)]);
498
+ };
499
+ }
500
+ }), je = {
501
+ "data-testid": "media-folder-tree",
502
+ class: "tpl:flex tpl:h-full tpl:flex-col tpl:overflow-y-auto"
503
+ }, Me = {
504
+ key: 0,
505
+ class: "tpl:px-3 tpl:py-2"
506
+ }, Ne = ["placeholder", "onKeydown"], Pe = /* @__PURE__ */ O({
507
+ __name: "MediaFolderTree",
508
+ props: {
509
+ folders: {},
510
+ currentFolderId: {},
511
+ viewMode: {},
512
+ hasFrequentlyUsed: { type: Boolean },
513
+ canCreateFolder: { type: Boolean },
514
+ canRenameFolder: { type: Boolean },
515
+ canDeleteFolder: { type: Boolean }
516
+ },
517
+ emits: [
518
+ "navigate",
519
+ "createFolder",
520
+ "renameFolder",
521
+ "deleteFolder",
522
+ "showFrequentlyUsed"
523
+ ],
524
+ setup(n, { emit: r }) {
525
+ let i = r, { t: a } = Q(), s = d(!1), c = d("");
526
+ function l() {
527
+ s.value = !0, c.value = "";
528
+ }
529
+ function f() {
530
+ c.value.trim() && i("createFolder", c.value.trim()), s.value = !1, c.value = "";
531
+ }
532
+ function v() {
533
+ s.value = !1, c.value = "";
534
+ }
535
+ return (r, d) => (e(), h("div", je, [
536
+ m("button", {
537
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
538
+ style: t({
539
+ backgroundColor: n.viewMode === "files" && n.currentFolderId === null ? "var(--tpl-bg-active)" : "transparent",
540
+ color: n.viewMode === "files" && n.currentFolderId === null ? "var(--tpl-primary)" : "var(--tpl-text)"
541
+ }),
542
+ onClick: d[0] ||= (e) => i("navigate", null)
543
+ }, [g(p(q), {
544
+ size: 14,
545
+ "stroke-width": 1.5
546
+ }), _(" " + b(p(a).mediaLibrary.allFiles), 1)], 4),
547
+ (e(!0), h(C, null, o(n.folders, (t) => (e(), S(Ae, {
548
+ key: t.id,
549
+ folder: t,
550
+ "current-folder-id": n.currentFolderId,
551
+ depth: 0,
552
+ "can-create-folder": n.canCreateFolder,
553
+ "can-rename-folder": n.canRenameFolder,
554
+ "can-delete-folder": n.canDeleteFolder,
555
+ onNavigate: d[1] ||= (e) => i("navigate", e),
556
+ onCreateFolder: d[2] ||= (e, t) => i("createFolder", e, t),
557
+ onRenameFolder: d[3] ||= (e, t) => i("renameFolder", e, t),
558
+ onDeleteFolder: d[4] ||= (e) => i("deleteFolder", e)
559
+ }, null, 8, [
560
+ "folder",
561
+ "current-folder-id",
562
+ "can-create-folder",
563
+ "can-rename-folder",
564
+ "can-delete-folder"
565
+ ]))), 128)),
566
+ s.value ? (e(), h("div", Me, [u(m("input", {
567
+ "onUpdate:modelValue": d[5] ||= (e) => c.value = e,
568
+ type: "text",
569
+ class: "tpl:w-full tpl:rounded tpl:border tpl:px-2 tpl:py-1 tpl:text-xs tpl:outline-none",
570
+ style: {
571
+ "border-color": "var(--tpl-primary)",
572
+ "background-color": "var(--tpl-bg)",
573
+ color: "var(--tpl-text)"
574
+ },
575
+ placeholder: p(a).mediaLibrary.folderName,
576
+ autofocus: "",
577
+ onKeydown: [j(f, ["enter"]), j(A(v, ["stop"]), ["escape"])],
578
+ onBlur: f
579
+ }, null, 40, Ne), [[k, c.value]])])) : D("", !0),
580
+ !s.value && n.canCreateFolder ? (e(), h("button", {
581
+ key: 1,
582
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:transition-all tpl:duration-150",
583
+ style: { color: "var(--tpl-text-muted)" },
584
+ onClick: l
585
+ }, [g(p(W), {
586
+ size: 14,
587
+ "stroke-width": 1.5
588
+ }), _(" " + b(p(a).mediaLibrary.newFolder), 1)])) : D("", !0),
589
+ d[7] ||= m("div", { class: "tpl:flex-1" }, null, -1),
590
+ n.hasFrequentlyUsed ? (e(), h("button", {
591
+ key: 2,
592
+ "data-testid": "media-frequently-used",
593
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-2 tpl:border-t tpl:px-3 tpl:py-2 tpl:text-left tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
594
+ style: t({
595
+ borderColor: "var(--tpl-border)",
596
+ backgroundColor: n.viewMode === "frequently-used" ? "var(--tpl-bg-active)" : "transparent",
597
+ color: n.viewMode === "frequently-used" ? "var(--tpl-primary)" : "var(--tpl-text)"
598
+ }),
599
+ onClick: d[6] ||= (e) => i("showFrequentlyUsed")
600
+ }, [g(p(le), {
601
+ size: 14,
602
+ "stroke-width": 1.5
603
+ }), _(" " + b(p(a).mediaLibrary.frequentlyUsed), 1)], 4)) : D("", !0)
604
+ ]));
605
+ }
606
+ }), Fe = /* @__PURE__ */ O({
607
+ __name: "MediaFileIcon",
608
+ props: { mimeType: {} },
609
+ setup(n) {
610
+ let r = n, i = {
611
+ "application/pdf": {
612
+ label: "PDF",
613
+ color: "var(--tpl-danger)",
614
+ bgColor: "var(--tpl-danger-light)",
615
+ icon: "document"
616
+ },
617
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
618
+ label: "DOC",
619
+ color: "var(--tpl-secondary)",
620
+ bgColor: "var(--tpl-secondary-light)",
621
+ icon: "document"
622
+ },
623
+ "application/msword": {
624
+ label: "DOC",
625
+ color: "var(--tpl-secondary)",
626
+ bgColor: "var(--tpl-secondary-light)",
627
+ icon: "document"
628
+ },
629
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
630
+ label: "XLS",
631
+ color: "var(--tpl-success)",
632
+ bgColor: "var(--tpl-success-light)",
633
+ icon: "document"
634
+ },
635
+ "application/vnd.ms-excel": {
636
+ label: "XLS",
637
+ color: "var(--tpl-success)",
638
+ bgColor: "var(--tpl-success-light)",
639
+ icon: "document"
640
+ },
641
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
642
+ label: "PPT",
643
+ color: "var(--tpl-warning)",
644
+ bgColor: "var(--tpl-warning-light)",
645
+ icon: "document"
646
+ },
647
+ "application/vnd.ms-powerpoint": {
648
+ label: "PPT",
649
+ color: "var(--tpl-warning)",
650
+ bgColor: "var(--tpl-warning-light)",
651
+ icon: "document"
652
+ },
653
+ "text/csv": {
654
+ label: "CSV",
655
+ color: "var(--tpl-success)",
656
+ bgColor: "var(--tpl-success-light)",
657
+ icon: "document"
658
+ },
659
+ "text/plain": {
660
+ label: "TXT",
661
+ color: "var(--tpl-text-muted)",
662
+ bgColor: "var(--tpl-bg-hover)",
663
+ icon: "document"
664
+ },
665
+ "video/mp4": {
666
+ label: "MP4",
667
+ color: "var(--tpl-primary)",
668
+ bgColor: "var(--tpl-primary-light)",
669
+ icon: "video"
670
+ },
671
+ "video/quicktime": {
672
+ label: "MOV",
673
+ color: "var(--tpl-primary)",
674
+ bgColor: "var(--tpl-primary-light)",
675
+ icon: "video"
676
+ },
677
+ "video/webm": {
678
+ label: "WEBM",
679
+ color: "var(--tpl-primary)",
680
+ bgColor: "var(--tpl-primary-light)",
681
+ icon: "video"
682
+ },
683
+ "audio/mpeg": {
684
+ label: "MP3",
685
+ color: "var(--tpl-secondary)",
686
+ bgColor: "var(--tpl-secondary-light)",
687
+ icon: "audio"
688
+ },
689
+ "audio/wav": {
690
+ label: "WAV",
691
+ color: "var(--tpl-secondary)",
692
+ bgColor: "var(--tpl-secondary-light)",
693
+ icon: "audio"
694
+ },
695
+ "audio/ogg": {
696
+ label: "OGG",
697
+ color: "var(--tpl-secondary)",
698
+ bgColor: "var(--tpl-secondary-light)",
699
+ icon: "audio"
700
+ }
701
+ }, a = {
702
+ label: "FILE",
703
+ color: "var(--tpl-text-muted)",
704
+ bgColor: "var(--tpl-bg-hover)",
705
+ icon: "document"
706
+ }, o = T(() => i[r.mimeType] ?? a);
707
+ return (n, r) => (e(), h("div", {
708
+ class: "tpl:flex tpl:aspect-square tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2",
709
+ style: t({ backgroundColor: o.value.bgColor })
710
+ }, [o.value.icon === "document" ? (e(), h("svg", {
711
+ key: 0,
712
+ width: "60",
713
+ height: "60",
714
+ viewBox: "0 0 24 24",
715
+ fill: "none",
716
+ stroke: "currentColor",
717
+ "stroke-width": "1.5",
718
+ style: t({ color: o.value.color })
719
+ }, [...r[0] ||= [
720
+ m("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }, null, -1),
721
+ m("polyline", { points: "14 2 14 8 20 8" }, null, -1),
722
+ m("line", {
723
+ x1: "8",
724
+ y1: "13",
725
+ x2: "16",
726
+ y2: "13"
727
+ }, null, -1),
728
+ m("line", {
729
+ x1: "8",
730
+ y1: "17",
731
+ x2: "12",
732
+ y2: "17"
733
+ }, null, -1)
734
+ ]], 4)) : o.value.icon === "video" ? (e(), h("svg", {
735
+ key: 1,
736
+ width: "40",
737
+ height: "40",
738
+ viewBox: "0 0 24 24",
739
+ fill: "none",
740
+ stroke: "currentColor",
741
+ "stroke-width": "1.5",
742
+ style: t({ color: o.value.color })
743
+ }, [...r[1] ||= [m("rect", {
744
+ x: "2",
745
+ y: "4",
746
+ width: "20",
747
+ height: "16",
748
+ rx: "2"
749
+ }, null, -1), m("polygon", {
750
+ points: "10,8 16,12 10,16",
751
+ fill: "currentColor",
752
+ stroke: "none"
753
+ }, null, -1)]], 4)) : (e(), h("svg", {
754
+ key: 2,
755
+ width: "40",
756
+ height: "40",
757
+ viewBox: "0 0 24 24",
758
+ fill: "none",
759
+ stroke: "currentColor",
760
+ "stroke-width": "1.5",
761
+ style: t({ color: o.value.color })
762
+ }, [...r[2] ||= [
763
+ m("path", { d: "M9 18V5l12-2v13" }, null, -1),
764
+ m("circle", {
765
+ cx: "6",
766
+ cy: "18",
767
+ r: "3"
768
+ }, null, -1),
769
+ m("circle", {
770
+ cx: "18",
771
+ cy: "16",
772
+ r: "3"
773
+ }, null, -1)
774
+ ]], 4)), m("span", {
775
+ class: "tpl:text-xs tpl:font-bold tpl:tracking-wider",
776
+ style: t({ color: o.value.color })
777
+ }, b(o.value.label), 5)], 4));
778
+ }
779
+ });
780
+ //#endregion
781
+ //#region ../media-library/src/utils/formatAbsoluteDate.ts
782
+ function Ie(e, t, n) {
783
+ let r = new Date(e);
784
+ if (Number.isNaN(r.getTime())) return "";
785
+ let i = t?.trim().replace(/_/g, "-") || void 0;
786
+ try {
787
+ return r.toLocaleDateString(i, n);
788
+ } catch {
789
+ return r.toLocaleDateString(void 0, n);
790
+ }
791
+ }
792
+ //#endregion
793
+ //#region ../media-library/src/components/media/MediaGrid.vue?vue&type=script&setup=true&lang.ts
794
+ var Le = { class: "tpl:p-4" }, Re = ["aria-label"], ze = {
795
+ key: 1,
796
+ class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-16"
797
+ }, Be = {
798
+ class: "tpl:text-xs",
799
+ style: { color: "var(--tpl-text-muted)" }
800
+ }, Ve = ["aria-label"], He = [
801
+ "data-media-id",
802
+ "aria-selected",
803
+ "aria-label",
804
+ "onClick",
805
+ "onDblclick",
806
+ "onKeydown"
807
+ ], Ue = { class: "tpl:aspect-square" }, We = ["src", "alt"], Ge = { class: "tpl:px-2 tpl:py-1.5" }, Ke = {
808
+ class: "tpl:truncate tpl:text-[10px] tpl:font-medium",
809
+ style: { color: "var(--tpl-text)" }
810
+ }, qe = {
811
+ class: "tpl:flex tpl:justify-between tpl:text-[10px]",
812
+ style: { color: "var(--tpl-text-muted)" }
813
+ }, Je = { key: 0 }, Ye = { key: 1 }, Xe = [
814
+ "title",
815
+ "aria-label",
816
+ "onClick"
817
+ ], Ze = [
818
+ "title",
819
+ "aria-label",
820
+ "onClick"
821
+ ], Qe = {
822
+ key: 0,
823
+ "aria-hidden": "true",
824
+ class: "tpl:absolute tpl:top-1.5 tpl:right-1.5 tpl:flex tpl:size-5 tpl:items-center tpl:justify-center tpl:rounded-full",
825
+ style: {
826
+ "background-color": "var(--tpl-primary)",
827
+ color: "var(--tpl-on-primary)"
828
+ }
829
+ }, $e = ["aria-label"], et = [
830
+ "data-media-id",
831
+ "aria-selected",
832
+ "aria-label",
833
+ "onClick",
834
+ "onDblclick",
835
+ "onKeydown"
836
+ ], tt = {
837
+ class: "tpl:size-10 tpl:shrink-0 tpl:overflow-hidden tpl:rounded",
838
+ style: { "background-color": "var(--tpl-bg-hover)" }
839
+ }, nt = ["src", "alt"], rt = {
840
+ key: 1,
841
+ class: "tpl-list-icon tpl:size-full"
842
+ }, it = { class: "tpl:min-w-0 tpl:flex-1" }, at = {
843
+ class: "tpl:truncate tpl:text-xs tpl:font-medium",
844
+ style: { color: "var(--tpl-text)" }
845
+ }, ot = {
846
+ class: "tpl:text-[10px]",
847
+ style: { color: "var(--tpl-text-muted)" }
848
+ }, st = [
849
+ "title",
850
+ "aria-label",
851
+ "onClick"
852
+ ], ct = [
853
+ "title",
854
+ "aria-label",
855
+ "onClick"
856
+ ], lt = {
857
+ key: 0,
858
+ "aria-hidden": "true",
859
+ class: "tpl:flex tpl:size-5 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:rounded-full",
860
+ style: {
861
+ "background-color": "var(--tpl-primary)",
862
+ color: "var(--tpl-on-primary)"
863
+ }
864
+ }, ut = {
865
+ key: 4,
866
+ class: "tpl:flex tpl:justify-center tpl:py-4"
867
+ }, dt = /*#__PURE__*/ K(/* @__PURE__ */ O({
868
+ __name: "MediaGrid",
869
+ props: {
870
+ items: {},
871
+ selectedIds: {},
872
+ isLoading: { type: Boolean },
873
+ hasMore: { type: Boolean },
874
+ accept: {},
875
+ layout: {},
876
+ searchQuery: {},
877
+ canUpdate: { type: Boolean },
878
+ canReplace: { type: Boolean }
879
+ },
880
+ emits: [
881
+ "select",
882
+ "toggle",
883
+ "loadMore",
884
+ "edit",
885
+ "replace",
886
+ "confirm"
887
+ ],
888
+ setup(n, { emit: r }) {
889
+ let i = n, a = r, { isAcceptedMimeType: s, isImageMimeType: c } = $();
890
+ function u(e) {
891
+ return e.mimeType ?? "";
892
+ }
893
+ function f(e) {
894
+ return e.thumbnailUrl ?? e.url;
895
+ }
896
+ function v(e) {
897
+ return !i.accept || i.accept.length === 0 || s(u(e), i.accept);
898
+ }
899
+ function y(e) {
900
+ return i.canUpdate === !0 && e.canUpdate !== !1;
901
+ }
902
+ function w(e) {
903
+ return i.canReplace === !0 && e.canUpdate !== !1;
904
+ }
905
+ function T(e, t) {
906
+ if (t.metaKey || t.ctrlKey) {
907
+ a("toggle", e.id);
908
+ return;
909
+ }
910
+ a("select", e);
911
+ }
912
+ function E(e) {
913
+ v(e) && a("confirm", e);
914
+ }
915
+ function O(e, t) {
916
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), a("select", e));
917
+ }
918
+ function k(e) {
919
+ return i.selectedIds.has(e.id);
920
+ }
921
+ function j(e) {
922
+ return k(e) ? "tpl:opacity-100" : "tpl:opacity-0 tpl:group-hover:opacity-100 tpl:group-focus-within:opacity-100";
923
+ }
924
+ let { t: M } = Q(), N = l(fe, null), P = d(null);
925
+ R(P, ([{ isIntersecting: e }]) => {
926
+ e && i.hasMore && !i.isLoading && a("loadMore");
927
+ }, { threshold: .1 });
928
+ function F(e) {
929
+ return e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1048576).toFixed(1)} MB`;
930
+ }
931
+ function I(e) {
932
+ return Ie(e, N?.value, {
933
+ year: "numeric",
934
+ month: "short",
935
+ day: "numeric"
936
+ });
937
+ }
938
+ return (r, i) => (e(), h("div", Le, [
939
+ n.isLoading && n.items.length === 0 ? (e(), h("div", {
940
+ key: 0,
941
+ role: "status",
942
+ "aria-busy": "true",
943
+ "aria-label": p(M).mediaLibrary.loading,
944
+ class: x(n.layout === "list" ? "tpl:flex tpl:flex-col tpl:gap-1" : "tpl:grid tpl:grid-cols-4 tpl:gap-3")
945
+ }, [(e(), h(C, null, o(8, (e) => m("div", {
946
+ key: e,
947
+ class: x(["tpl-pulse tpl:rounded-lg", n.layout === "list" ? "tpl:h-12" : "tpl:aspect-square"]),
948
+ style: { "background-color": "var(--tpl-bg-hover)" },
949
+ "aria-hidden": "true"
950
+ }, null, 2)), 64))], 10, Re)) : n.items.length === 0 ? (e(), h("div", ze, [g(p(q), {
951
+ class: "tpl:mb-3",
952
+ size: 40,
953
+ "stroke-width": 1,
954
+ style: { color: "var(--tpl-text-dim)" }
955
+ }), m("p", Be, b(n.searchQuery ? p(M).mediaLibrary.noSearchResults : p(M).mediaLibrary.noFiles), 1)])) : n.layout === "list" ? (e(), h("div", {
956
+ key: 3,
957
+ role: "listbox",
958
+ "aria-label": p(M).mediaLibrary.filesListAriaLabel,
959
+ "aria-multiselectable": "true",
960
+ class: "tpl:flex tpl:flex-col tpl:gap-1"
961
+ }, [(e(!0), h(C, null, o(n.items, (n) => (e(), h("div", {
962
+ key: n.id,
963
+ role: "option",
964
+ tabindex: "0",
965
+ "data-testid": "media-library-item",
966
+ class: x(["tpl-media-list-item tpl:group tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-150", [!v(n) && !k(n) ? "tpl:opacity-60" : ""]]),
967
+ "data-media-id": n.id,
968
+ "aria-selected": k(n),
969
+ "aria-label": n.filename || n.url,
970
+ style: t({ backgroundColor: k(n) ? "var(--tpl-bg-hover)" : "transparent" }),
971
+ onClick: (e) => T(n, e),
972
+ onDblclick: (e) => E(n),
973
+ onKeydown: (e) => O(n, e)
974
+ }, [
975
+ m("div", tt, [p(c)(u(n)) ? (e(), h("img", {
976
+ key: 0,
977
+ src: f(n),
978
+ alt: n.filename || n.url,
979
+ class: "tpl:size-full tpl:object-cover",
980
+ loading: "lazy"
981
+ }, null, 8, nt)) : (e(), h("div", rt, [g(Fe, { "mime-type": u(n) }, null, 8, ["mime-type"])]))]),
982
+ m("div", it, [m("p", at, b(n.filename || n.url), 1), m("p", ot, [
983
+ n.size == null ? D("", !0) : (e(), h(C, { key: 0 }, [_(b(F(n.size)), 1)], 64)),
984
+ n.createdAt ? (e(), h(C, { key: 1 }, [n.size == null ? D("", !0) : (e(), h(C, { key: 0 }, [_(" · ")], 64)), _(" " + b(I(n.createdAt)), 1)], 64)) : D("", !0),
985
+ p(c)(u(n)) && n.width && n.height ? (e(), h(C, { key: 2 }, [_(" · " + b(n.width) + "×" + b(n.height), 1)], 64)) : D("", !0)
986
+ ])]),
987
+ m("div", { class: x(["tpl:flex tpl:gap-1 tpl:transition-opacity tpl:duration-150", j(n)]) }, [y(n) ? (e(), h("button", {
988
+ key: 0,
989
+ type: "button",
990
+ "data-testid": "media-edit",
991
+ class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
992
+ style: { color: "var(--tpl-text-muted)" },
993
+ title: p(M).mediaLibrary.editFile,
994
+ "aria-label": p(M).mediaLibrary.editFile,
995
+ onClick: A((e) => a("edit", n), ["stop"])
996
+ }, [g(p(U), {
997
+ size: 12,
998
+ "stroke-width": 2
999
+ })], 8, st)) : D("", !0), w(n) ? (e(), h("button", {
1000
+ key: 1,
1001
+ type: "button",
1002
+ "data-testid": "media-replace",
1003
+ class: "tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded",
1004
+ style: { color: "var(--tpl-text-muted)" },
1005
+ title: p(M).mediaLibrary.replaceFile,
1006
+ "aria-label": p(M).mediaLibrary.replaceFile,
1007
+ onClick: A((e) => a("replace", n), ["stop"])
1008
+ }, [g(p(G), {
1009
+ size: 12,
1010
+ "stroke-width": 2
1011
+ })], 8, ct)) : D("", !0)], 2),
1012
+ k(n) ? (e(), h("div", lt, [g(p(B), {
1013
+ size: 12,
1014
+ "stroke-width": 3
1015
+ })])) : D("", !0)
1016
+ ], 46, et))), 128))], 8, $e)) : (e(), h("div", {
1017
+ key: 2,
1018
+ role: "listbox",
1019
+ "aria-label": p(M).mediaLibrary.filesListAriaLabel,
1020
+ "aria-multiselectable": "true",
1021
+ class: "tpl:grid tpl:grid-cols-4 tpl:gap-3"
1022
+ }, [(e(!0), h(C, null, o(n.items, (n) => (e(), h("div", {
1023
+ key: n.id,
1024
+ role: "option",
1025
+ tabindex: "0",
1026
+ "data-testid": "media-library-item",
1027
+ class: x(["tpl-media-item tpl:group tpl:relative tpl:overflow-hidden tpl:rounded-lg tpl:border-2 tpl:transition-all tpl:duration-150", [
1028
+ "tpl:cursor-pointer",
1029
+ !v(n) && !k(n) ? "tpl:opacity-60" : "",
1030
+ k(n) ? "tpl-media-item--selected" : ""
1031
+ ]]),
1032
+ "data-media-id": n.id,
1033
+ "aria-selected": k(n),
1034
+ "aria-label": n.filename || n.url,
1035
+ style: t({
1036
+ borderColor: k(n) ? "var(--tpl-primary)" : "transparent",
1037
+ backgroundColor: !v(n) && !k(n) ? "var(--tpl-bg)" : "var(--tpl-bg-hover)"
1038
+ }),
1039
+ onClick: (e) => T(n, e),
1040
+ onDblclick: (e) => E(n),
1041
+ onKeydown: (e) => O(n, e)
1042
+ }, [
1043
+ m("div", Ue, [p(c)(u(n)) ? (e(), h("img", {
1044
+ key: 0,
1045
+ src: f(n),
1046
+ alt: n.filename || n.url,
1047
+ class: "tpl:size-full tpl:object-cover",
1048
+ loading: "lazy"
1049
+ }, null, 8, We)) : (e(), S(Fe, {
1050
+ key: 1,
1051
+ "mime-type": u(n)
1052
+ }, null, 8, ["mime-type"]))]),
1053
+ m("div", Ge, [m("p", Ke, b(n.filename || n.url), 1), m("p", qe, [n.size == null ? D("", !0) : (e(), h("span", Je, b(F(n.size)), 1)), p(c)(u(n)) && n.width && n.height ? (e(), h("span", Ye, b(n.width) + "×" + b(n.height), 1)) : D("", !0)])]),
1054
+ m("div", { class: x(["tpl:absolute tpl:top-1.5 tpl:left-1.5 tpl:flex tpl:gap-1 tpl:transition-opacity tpl:duration-150", j(n)]) }, [y(n) ? (e(), h("button", {
1055
+ key: 0,
1056
+ type: "button",
1057
+ "data-testid": "media-edit",
1058
+ class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full",
1059
+ style: {
1060
+ "background-color": "var(--tpl-overlay)",
1061
+ color: "var(--tpl-on-primary)"
1062
+ },
1063
+ title: p(M).mediaLibrary.editFile,
1064
+ "aria-label": p(M).mediaLibrary.editFile,
1065
+ onClick: A((e) => a("edit", n), ["stop"])
1066
+ }, [g(p(U), {
1067
+ size: 11,
1068
+ "stroke-width": 2
1069
+ })], 8, Xe)) : D("", !0), w(n) ? (e(), h("button", {
1070
+ key: 1,
1071
+ type: "button",
1072
+ "data-testid": "media-replace",
1073
+ class: "tpl:flex tpl:size-6 tpl:items-center tpl:justify-center tpl:rounded-full",
1074
+ style: {
1075
+ "background-color": "var(--tpl-overlay)",
1076
+ color: "var(--tpl-on-primary)"
1077
+ },
1078
+ title: p(M).mediaLibrary.replaceFile,
1079
+ "aria-label": p(M).mediaLibrary.replaceFile,
1080
+ onClick: A((e) => a("replace", n), ["stop"])
1081
+ }, [g(p(G), {
1082
+ size: 11,
1083
+ "stroke-width": 2
1084
+ })], 8, Ze)) : D("", !0)], 2),
1085
+ k(n) ? (e(), h("div", Qe, [g(p(B), {
1086
+ size: 12,
1087
+ "stroke-width": 3
1088
+ })])) : D("", !0)
1089
+ ], 46, He))), 128))], 8, Ve)),
1090
+ m("div", {
1091
+ ref_key: "sentinelRef",
1092
+ ref: P,
1093
+ class: "tpl:h-4"
1094
+ }, null, 512),
1095
+ n.isLoading && n.items.length > 0 ? (e(), h("div", ut, [g(p(H), {
1096
+ class: "tpl-spinner",
1097
+ size: 20,
1098
+ "stroke-width": 2,
1099
+ style: { color: "var(--tpl-primary)" }
1100
+ })])) : D("", !0)
1101
+ ]));
1102
+ }
1103
+ }), [["__scopeId", "data-v-373617e3"]]), ft = ["data-tpl-theme"], pt = {
1104
+ id: "tpl-media-import-title",
1105
+ class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
1106
+ style: { color: "var(--tpl-text)" }
1107
+ }, mt = { class: "tpl:mb-3" }, ht = [
1108
+ "aria-label",
1109
+ "aria-invalid",
1110
+ "aria-describedby",
1111
+ "placeholder",
1112
+ "disabled"
1113
+ ], gt = {
1114
+ key: 0,
1115
+ id: "tpl-media-import-error",
1116
+ role: "alert",
1117
+ class: "tpl:mb-3 tpl:text-xs",
1118
+ style: { color: "var(--tpl-danger)" }
1119
+ }, _t = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, vt = ["disabled"], yt = ["disabled"], bt = {
1120
+ key: 0,
1121
+ class: "tpl:flex tpl:items-center tpl:gap-1.5"
1122
+ }, xt = { key: 1 }, St = /* @__PURE__ */ O({
1123
+ __name: "MediaImportUrlModal",
1124
+ props: {
1125
+ visible: { type: Boolean },
1126
+ isImporting: { type: Boolean },
1127
+ error: {}
1128
+ },
1129
+ emits: ["import", "close"],
1130
+ setup(t, { emit: r }) {
1131
+ let i = t, a = r, { t: o } = Q(), s = l(Z, null), f = l(X, d(null)), y = d("");
1132
+ c(() => i.visible, (e) => {
1133
+ e && (y.value = "");
1134
+ });
1135
+ function C() {
1136
+ let e = y.value.trim();
1137
+ e && !i.isImporting && a("import", e);
1138
+ }
1139
+ function w() {
1140
+ i.isImporting || a("close");
1141
+ }
1142
+ let E = d(null);
1143
+ ge(E, T(() => i.visible));
1144
+ function O(e) {
1145
+ e.stopPropagation(), e.key === "Enter" && (e.preventDefault(), C()), e.key === "Escape" && w();
1146
+ }
1147
+ return (r, i) => (e(), S(v, { to: p(f) || "body" }, [g(M, {
1148
+ "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
1149
+ "enter-from-class": "tpl:opacity-0",
1150
+ "enter-to-class": "tpl:opacity-100",
1151
+ "leave-active-class": "tpl:transition tpl:ease-in tpl:duration-100",
1152
+ "leave-from-class": "tpl:opacity-100",
1153
+ "leave-to-class": "tpl:opacity-0"
1154
+ }, {
1155
+ default: n(() => [t.visible ? (e(), h("div", {
1156
+ key: 0,
1157
+ "data-tpl-theme": p(s),
1158
+ class: x([p(f) ? void 0 : "tpl", "tpl:fixed tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:p-4"]),
1159
+ style: { "background-color": "var(--tpl-overlay)" },
1160
+ onClick: A(w, ["self"]),
1161
+ onKeydown: O
1162
+ }, [m("div", {
1163
+ ref_key: "dialogRef",
1164
+ ref: E,
1165
+ role: "dialog",
1166
+ "aria-modal": "true",
1167
+ "aria-labelledby": "tpl-media-import-title",
1168
+ class: "tpl:max-h-[90%] tpl:w-full tpl:max-w-sm tpl:overflow-y-auto tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
1169
+ style: { "background-color": "var(--tpl-bg-elevated)" }
1170
+ }, [
1171
+ m("h3", pt, b(p(o).mediaLibrary.importFromUrl), 1),
1172
+ m("div", mt, [u(m("input", {
1173
+ "onUpdate:modelValue": i[0] ||= (e) => y.value = e,
1174
+ type: "url",
1175
+ "aria-label": p(o).mediaLibrary.importFromUrl,
1176
+ "aria-invalid": !!t.error,
1177
+ "aria-describedby": t.error ? "tpl-media-import-error" : void 0,
1178
+ class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:outline-none",
1179
+ style: {
1180
+ "border-color": "var(--tpl-border)",
1181
+ "background-color": "var(--tpl-bg)",
1182
+ color: "var(--tpl-text)"
1183
+ },
1184
+ placeholder: p(o).mediaLibrary.importUrlPlaceholder,
1185
+ disabled: t.isImporting,
1186
+ autofocus: ""
1187
+ }, null, 8, ht), [[k, y.value]])]),
1188
+ t.error ? (e(), h("p", gt, b(t.error), 1)) : D("", !0),
1189
+ m("div", _t, [m("button", {
1190
+ class: x(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150", { "tpl:cursor-not-allowed tpl:opacity-50": t.isImporting }]),
1191
+ style: {
1192
+ "border-color": "var(--tpl-border)",
1193
+ color: "var(--tpl-text)",
1194
+ "background-color": "var(--tpl-bg)"
1195
+ },
1196
+ disabled: t.isImporting,
1197
+ onClick: w
1198
+ }, b(p(o).mediaLibrary.cancel), 11, vt), m("button", {
1199
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
1200
+ style: {
1201
+ "background-color": "var(--tpl-primary)",
1202
+ color: "var(--tpl-on-primary)"
1203
+ },
1204
+ disabled: !y.value.trim() || t.isImporting,
1205
+ onClick: C
1206
+ }, [t.isImporting ? (e(), h("span", bt, [g(p(H), {
1207
+ class: "tpl:animate-spin",
1208
+ size: 12,
1209
+ "stroke-width": 2
1210
+ }), _(" " + b(p(o).mediaLibrary.importing), 1)])) : (e(), h("span", xt, b(p(o).mediaLibrary.import), 1))], 8, yt)])
1211
+ ], 512)], 42, ft)) : D("", !0)]),
1212
+ _: 1
1213
+ })], 8, ["to"]));
1214
+ }
1215
+ }), Ct = { class: "tpl:max-h-56 tpl:overflow-y-auto tpl:py-1" }, wt = ["disabled", "onClick"], Tt = { class: "tpl:truncate" }, Et = {
1216
+ key: 0,
1217
+ class: "tpl:shrink-0",
1218
+ style: { color: "var(--tpl-text-dim)" }
1219
+ }, Dt = /* @__PURE__ */ O({
1220
+ __name: "MediaMovePicker",
1221
+ props: {
1222
+ folders: {},
1223
+ currentFolderId: {}
1224
+ },
1225
+ emits: ["select", "close"],
1226
+ setup(n, { emit: r }) {
1227
+ let i = r, { t: a } = Q(), s = d(null);
1228
+ function c(e, t = 0) {
1229
+ let n = [];
1230
+ for (let r of e) n.push({
1231
+ id: r.id,
1232
+ name: r.name,
1233
+ depth: t
1234
+ }), r.children.length && n.push(...c(r.children, t + 1));
1235
+ return n;
1236
+ }
1237
+ return ee(s, () => {
1238
+ i("close");
1239
+ }), (r, l) => (e(), h("div", {
1240
+ ref_key: "pickerRef",
1241
+ ref: s,
1242
+ class: "tpl:absolute tpl:bottom-full tpl:left-0 tpl:z-10 tpl:mb-2 tpl:w-56 tpl:overflow-hidden tpl:rounded-lg tpl:border tpl:shadow-lg",
1243
+ style: {
1244
+ "border-color": "var(--tpl-border)",
1245
+ "background-color": "var(--tpl-bg-elevated)"
1246
+ }
1247
+ }, [m("div", Ct, [n.currentFolderId === null ? D("", !0) : (e(), h("button", {
1248
+ key: 0,
1249
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:px-3 tpl:py-1.5 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
1250
+ style: { color: "var(--tpl-text)" },
1251
+ onClick: l[0] ||= (e) => i("select", null)
1252
+ }, [g(p(q), {
1253
+ class: "tpl:shrink-0",
1254
+ size: 14,
1255
+ "stroke-width": 1.5
1256
+ }), _(" " + b(p(a).mediaLibrary.moveToRoot), 1)])), (e(!0), h(C, null, o(c(n.folders), (r) => (e(), h("button", {
1257
+ key: r.id,
1258
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:gap-1.5 tpl:py-1.5 tpl:pr-3 tpl:text-left tpl:text-xs tpl:transition-colors tpl:duration-100",
1259
+ style: t({
1260
+ paddingLeft: `${r.depth * 16 + 12}px`,
1261
+ color: r.id === n.currentFolderId ? "var(--tpl-text-dim)" : "var(--tpl-text)",
1262
+ opacity: r.id === n.currentFolderId ? .5 : 1
1263
+ }),
1264
+ disabled: r.id === n.currentFolderId,
1265
+ onClick: (e) => i("select", r.id)
1266
+ }, [
1267
+ g(p(J), {
1268
+ class: "tpl:shrink-0",
1269
+ size: 14,
1270
+ "stroke-width": 1.5
1271
+ }),
1272
+ m("span", Tt, b(r.name), 1),
1273
+ r.id === n.currentFolderId ? (e(), h("span", Et, b(p(a).mediaLibrary.currentFolder), 1)) : D("", !0)
1274
+ ], 12, wt))), 128))])], 512));
1275
+ }
1276
+ }), Ot = { class: "tpl:flex tpl:items-center tpl:gap-3" }, kt = ["src", "alt"], At = {
1277
+ key: 1,
1278
+ class: "tpl:flex tpl:size-10 tpl:shrink-0 tpl:items-center tpl:justify-center tpl:overflow-hidden tpl:rounded",
1279
+ style: { border: "1px solid var(--tpl-border)" }
1280
+ }, jt = { class: "tpl:min-w-0 tpl:flex-1" }, Mt = {
1281
+ class: "tpl:truncate tpl:text-xs tpl:font-medium",
1282
+ style: { color: "var(--tpl-text)" }
1283
+ }, Nt = {
1284
+ class: "tpl:mt-0.5 tpl:text-[10px]",
1285
+ style: { color: "var(--tpl-text-muted)" }
1286
+ }, Pt = /*#__PURE__*/ K(/* @__PURE__ */ O({
1287
+ __name: "MediaPreviewPanel",
1288
+ props: {
1289
+ item: {},
1290
+ folders: {}
1291
+ },
1292
+ setup(t) {
1293
+ let n = t, r = l(fe, null), { isImageMimeType: i } = $();
1294
+ function a(e, t, n = []) {
1295
+ for (let r of e) {
1296
+ let e = [...n, r.name];
1297
+ if (r.id === t) return e;
1298
+ if (r.children.length) {
1299
+ let n = a(r.children, t, e);
1300
+ if (n) return n;
1301
+ }
1302
+ }
1303
+ return null;
1304
+ }
1305
+ let o = T(() => {
1306
+ if (!n.item.folderId || !n.folders) return null;
1307
+ let e = a(n.folders, n.item.folderId);
1308
+ return e ? e.join("/") : null;
1309
+ }), s = T(() => n.item.mimeType ?? ""), c = T(() => i(s.value));
1310
+ function u(e) {
1311
+ return e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1048576).toFixed(1)} MB`;
1312
+ }
1313
+ function d(e) {
1314
+ return Ie(e, r?.value, {
1315
+ year: "numeric",
1316
+ month: "short",
1317
+ day: "numeric"
1318
+ });
1319
+ }
1320
+ let f = T(() => n.item.filename || n.item.url);
1321
+ return (n, r) => (e(), h("div", Ot, [c.value ? (e(), h("img", {
1322
+ key: 0,
1323
+ src: t.item.url,
1324
+ alt: t.item.alt || f.value,
1325
+ class: "tpl:size-10 tpl:shrink-0 tpl:rounded tpl:object-cover",
1326
+ style: { border: "1px solid var(--tpl-border)" }
1327
+ }, null, 8, kt)) : (e(), h("div", At, [g(Fe, {
1328
+ "mime-type": s.value,
1329
+ class: "tpl-preview-icon"
1330
+ }, null, 8, ["mime-type"])])), m("div", jt, [
1331
+ m("p", Mt, b(f.value), 1),
1332
+ m("p", Nt, [
1333
+ t.item.size == null ? D("", !0) : (e(), h(C, { key: 0 }, [_(b(u(t.item.size)), 1)], 64)),
1334
+ t.item.createdAt ? (e(), h(C, { key: 1 }, [t.item.size == null ? D("", !0) : (e(), h(C, { key: 0 }, [_(" · ")], 64)), _(" " + b(d(t.item.createdAt)), 1)], 64)) : D("", !0),
1335
+ c.value && t.item.width && t.item.height ? (e(), h(C, { key: 2 }, [_(" · " + b(t.item.width) + "×" + b(t.item.height) + "px ", 1)], 64)) : D("", !0),
1336
+ o.value ? (e(), h(C, { key: 3 }, [
1337
+ r[0] ||= _(" · ", -1),
1338
+ g(p(J), {
1339
+ class: "tpl:mb-px tpl:inline",
1340
+ size: 9,
1341
+ "stroke-width": 2
1342
+ }),
1343
+ _(" " + b(o.value), 1)
1344
+ ], 64)) : D("", !0)
1345
+ ]),
1346
+ c.value ? (e(), h("p", {
1347
+ key: 0,
1348
+ class: x(["tpl:mt-0.5 tpl:truncate tpl:text-[10px] tpl:italic", { "tpl:invisible": !t.item.alt }]),
1349
+ style: { color: "var(--tpl-text-dim)" }
1350
+ }, b(t.item.alt || "\xA0"), 3)) : D("", !0)
1351
+ ])]));
1352
+ }
1353
+ }), [["__scopeId", "data-v-c3c1707e"]]), Ft = ["data-tpl-theme"], It = {
1354
+ id: "tpl-media-replace-title",
1355
+ class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
1356
+ style: { color: "var(--tpl-text)" }
1357
+ }, Lt = {
1358
+ class: "tpl:mb-2 tpl:text-xs",
1359
+ style: { color: "var(--tpl-text-muted)" }
1360
+ }, Rt = {
1361
+ key: 0,
1362
+ class: "tpl:mb-3 tpl:text-xs",
1363
+ style: { color: "var(--tpl-text-muted)" }
1364
+ }, zt = {
1365
+ class: "tpl:mb-3 tpl:rounded tpl:border tpl:p-2",
1366
+ style: { "border-color": "var(--tpl-border)" }
1367
+ }, Bt = {
1368
+ class: "tpl:truncate tpl:text-xs tpl:font-medium",
1369
+ style: { color: "var(--tpl-text)" }
1370
+ }, Vt = { class: "tpl:mb-4" }, Ht = {
1371
+ class: "tpl:mb-1 tpl:block tpl:text-xs tpl:font-medium",
1372
+ style: { color: "var(--tpl-text-muted)" }
1373
+ }, Ut = [
1374
+ "accept",
1375
+ "aria-invalid",
1376
+ "aria-describedby"
1377
+ ], Wt = {
1378
+ key: 1,
1379
+ id: "tpl-media-replace-error",
1380
+ role: "alert",
1381
+ class: "tpl:mb-3 tpl:text-xs",
1382
+ style: { color: "var(--tpl-danger)" }
1383
+ }, Gt = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Kt = ["disabled"], qt = ["disabled"], Jt = /* @__PURE__ */ O({
1384
+ __name: "MediaReplaceModal",
1385
+ props: {
1386
+ visible: { type: Boolean },
1387
+ item: {},
1388
+ usageInfo: {},
1389
+ isReplacing: { type: Boolean },
1390
+ error: {}
1391
+ },
1392
+ emits: ["replace", "close"],
1393
+ setup(t, { emit: r }) {
1394
+ let i = t, a = r, { t: o } = Q(), s = l(Z, null), u = l(X, d(null)), f = d(null), _ = d(null), y = T(() => {
1395
+ if (!i.item) return "";
1396
+ let e = (i.item.filename ?? "").split(".");
1397
+ return e.length > 1 ? e[e.length - 1].toLowerCase() : "";
1398
+ }), C = T(() => y.value ? `.${y.value}` : "*"), w = T(() => (i.usageInfo?.templateCount ?? 0) > 0);
1399
+ c(() => i.visible, (e) => {
1400
+ e || (_.value = null, f.value && (f.value.value = ""));
1401
+ });
1402
+ function E(e) {
1403
+ let t = e.target;
1404
+ t.files && t.files.length > 0 && (_.value = t.files[0]);
1405
+ }
1406
+ function O() {
1407
+ _.value && a("replace", _.value);
1408
+ }
1409
+ let k = d(null);
1410
+ ge(k, T(() => i.visible && i.item !== null));
1411
+ function j(e) {
1412
+ e.stopPropagation(), e.key === "Escape" && a("close");
1413
+ }
1414
+ return (r, i) => (e(), S(v, { to: p(u) || "body" }, [g(M, {
1415
+ "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
1416
+ "enter-from-class": "tpl:opacity-0",
1417
+ "enter-to-class": "tpl:opacity-100",
1418
+ "leave-active-class": "tpl:transition tpl:ease-in tpl:duration-100",
1419
+ "leave-from-class": "tpl:opacity-100",
1420
+ "leave-to-class": "tpl:opacity-0"
1421
+ }, {
1422
+ default: n(() => [t.visible && t.item ? (e(), h("div", {
1423
+ key: 0,
1424
+ "data-tpl-theme": p(s),
1425
+ class: x([p(u) ? void 0 : "tpl", "tpl:fixed tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:p-4"]),
1426
+ style: { "background-color": "var(--tpl-overlay)" },
1427
+ onClick: i[1] ||= A((e) => a("close"), ["self"]),
1428
+ onKeydown: j
1429
+ }, [m("div", {
1430
+ ref_key: "dialogRef",
1431
+ ref: k,
1432
+ role: "dialog",
1433
+ "aria-modal": "true",
1434
+ "aria-labelledby": "tpl-media-replace-title",
1435
+ class: "tpl:max-h-[90%] tpl:w-full tpl:max-w-sm tpl:overflow-y-auto tpl:rounded-lg tpl:p-5 tpl:shadow-xl",
1436
+ style: { "background-color": "var(--tpl-bg-elevated)" }
1437
+ }, [
1438
+ m("h3", It, b(p(o).mediaLibrary.replaceWarningTitle), 1),
1439
+ m("p", Lt, b(p(o).mediaLibrary.replaceWarningMessage.replace("{extension}", `.${y.value}`)), 1),
1440
+ w.value ? (e(), h("p", Rt, b(p(o).mediaLibrary.replaceWarningUsageNote.replace("{count}", t.usageInfo.templateCount.toString())), 1)) : D("", !0),
1441
+ m("div", zt, [m("p", Bt, b(t.item.filename), 1)]),
1442
+ m("div", Vt, [m("label", Ht, b(p(o).mediaLibrary.replaceSelectFile), 1), m("input", {
1443
+ ref_key: "fileInputRef",
1444
+ ref: f,
1445
+ type: "file",
1446
+ accept: C.value,
1447
+ "aria-invalid": !!t.error,
1448
+ "aria-describedby": t.error ? "tpl-media-replace-error" : void 0,
1449
+ class: "tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs",
1450
+ style: {
1451
+ "border-color": "var(--tpl-border)",
1452
+ "background-color": "var(--tpl-bg)",
1453
+ color: "var(--tpl-text)"
1454
+ },
1455
+ onChange: E
1456
+ }, null, 40, Ut)]),
1457
+ t.error ? (e(), h("p", Wt, b(t.error), 1)) : D("", !0),
1458
+ m("div", Gt, [m("button", {
1459
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
1460
+ style: {
1461
+ "border-color": "var(--tpl-border)",
1462
+ color: "var(--tpl-text)",
1463
+ "background-color": "var(--tpl-bg)"
1464
+ },
1465
+ disabled: t.isReplacing,
1466
+ onClick: i[0] ||= (e) => a("close")
1467
+ }, b(p(o).mediaLibrary.cancel), 9, Kt), m("button", {
1468
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
1469
+ style: {
1470
+ "background-color": "var(--tpl-primary)",
1471
+ color: "var(--tpl-on-primary)"
1472
+ },
1473
+ disabled: !_.value || t.isReplacing,
1474
+ onClick: O
1475
+ }, b(t.isReplacing ? p(o).mediaLibrary.replacing : p(o).mediaLibrary.replace), 9, qt)])
1476
+ ], 512)], 42, Ft)) : D("", !0)]),
1477
+ _: 1
1478
+ })], 8, ["to"]));
1479
+ }
1480
+ }), Yt = ["aria-label", "aria-busy"], Xt = {
1481
+ key: 0,
1482
+ class: "tpl:flex tpl:items-center tpl:gap-2"
1483
+ }, Zt = {
1484
+ class: "tpl:text-xs",
1485
+ style: { color: "var(--tpl-text-muted)" }
1486
+ }, Qt = {
1487
+ class: "tpl:text-xs",
1488
+ style: { color: "var(--tpl-text-muted)" }
1489
+ }, $t = {
1490
+ class: "tpl:mt-1 tpl:text-[10px]",
1491
+ style: { color: "var(--tpl-text-dim)" }
1492
+ }, en = /* @__PURE__ */ O({
1493
+ __name: "MediaUploadZone",
1494
+ props: {
1495
+ isUploading: { type: Boolean },
1496
+ uploadProgress: {}
1497
+ },
1498
+ emits: ["upload"],
1499
+ setup(t, { emit: n }) {
1500
+ let r = n, { t: i, format: a } = Q(), { allAcceptedInputString: o, isAcceptedFile: s } = $(), c = d();
1501
+ function l(e) {
1502
+ let t = [];
1503
+ for (let n of Array.from(e)) s(n) && t.push(n);
1504
+ return t;
1505
+ }
1506
+ function u(e) {
1507
+ let t = l(e);
1508
+ t.length && r("upload", t);
1509
+ }
1510
+ let { isOverDropZone: f } = L(c, { onDrop: (e) => {
1511
+ e?.length && u(e);
1512
+ } }), { open: _, onChange: v } = I({
1513
+ accept: o.value,
1514
+ multiple: !0
1515
+ });
1516
+ return v((e) => {
1517
+ e?.length && u(e);
1518
+ }), (n, r) => (e(), h("button", {
1519
+ ref_key: "dropZoneRef",
1520
+ ref: c,
1521
+ type: "button",
1522
+ "data-testid": "media-upload-zone",
1523
+ class: x(["tpl-upload-zone tpl:flex tpl:w-full tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-lg tpl:border-2 tpl:border-dashed tpl:p-5 tpl:text-center tpl:transition-all tpl:duration-150", p(f) ? "tpl-upload-zone-active" : ""]),
1524
+ "aria-label": p(i).mediaLibrary.dropOrClick,
1525
+ "aria-busy": t.isUploading,
1526
+ style: {
1527
+ "border-color": "var(--tpl-border-light)",
1528
+ "background-color": "var(--tpl-bg)"
1529
+ },
1530
+ onClick: r[0] ||= (e) => p(_)()
1531
+ }, [t.isUploading ? (e(), h("div", Xt, [g(p(H), {
1532
+ class: "tpl-spinner",
1533
+ size: 20,
1534
+ "stroke-width": 2,
1535
+ style: { color: "var(--tpl-primary)" }
1536
+ }), m("span", Zt, b(t.uploadProgress && t.uploadProgress.total > 1 ? p(a)(p(i).mediaLibrary.uploadingProgress, {
1537
+ current: t.uploadProgress.current,
1538
+ total: t.uploadProgress.total
1539
+ }) : p(i).mediaLibrary.uploading), 1)])) : (e(), h(C, { key: 1 }, [
1540
+ g(p(oe), {
1541
+ class: "tpl:mb-2",
1542
+ size: 24,
1543
+ "stroke-width": 1.5,
1544
+ style: { color: "var(--tpl-text-dim)" }
1545
+ }),
1546
+ m("p", Qt, b(p(i).mediaLibrary.dropOrClick), 1),
1547
+ m("p", $t, b(p(i).mediaLibrary.acceptedFormats), 1)
1548
+ ], 64))], 10, Yt));
1549
+ }
1550
+ }), tn = ["aria-label"], nn = [
1551
+ "width",
1552
+ "height",
1553
+ "viewBox"
1554
+ ], rn = [
1555
+ "cx",
1556
+ "cy",
1557
+ "r",
1558
+ "stroke-width"
1559
+ ], an = [
1560
+ "cx",
1561
+ "cy",
1562
+ "r",
1563
+ "stroke-width",
1564
+ "stroke",
1565
+ "stroke-dasharray",
1566
+ "stroke-dashoffset"
1567
+ ], on = {
1568
+ key: 0,
1569
+ class: "tpl:absolute tpl:top-full tpl:left-1/2 tpl:z-50 tpl:mt-2 tpl:-translate-x-1/2 tpl:rounded-md tpl:px-2.5 tpl:py-1.5 tpl:text-xs tpl:whitespace-nowrap tpl:shadow-lg",
1570
+ style: {
1571
+ "background-color": "var(--tpl-text)",
1572
+ color: "var(--tpl-bg-elevated)"
1573
+ }
1574
+ }, sn = /* @__PURE__ */ O({
1575
+ __name: "StorageProgressRing",
1576
+ props: {
1577
+ usedBytes: {},
1578
+ limitBytes: {},
1579
+ size: {}
1580
+ },
1581
+ setup(t) {
1582
+ let r = t, { t: i, format: a } = Q(), o = d(!1), s = T(() => r.size ?? 24), c = T(() => Math.max(2, s.value / 8)), l = T(() => (s.value - c.value) / 2), u = T(() => 2 * Math.PI * l.value), f = T(() => r.limitBytes <= 0 ? 0 : Math.min(100, r.usedBytes / r.limitBytes * 100)), p = T(() => u.value - f.value / 100 * u.value), v = T(() => f.value >= 95 ? "var(--tpl-danger)" : f.value >= 75 ? "var(--tpl-warning)" : "var(--tpl-primary)");
1583
+ function y(e) {
1584
+ if (e === 0) return "0 B";
1585
+ let t = 1024, n = [
1586
+ "B",
1587
+ "KB",
1588
+ "MB",
1589
+ "GB"
1590
+ ], r = Math.floor(Math.log(e) / Math.log(t)), i = e / t ** r, a = +(r >= 2);
1591
+ return `${i.toFixed(a)} ${n[r]}`;
1592
+ }
1593
+ let x = T(() => y(r.usedBytes)), S = T(() => y(r.limitBytes)), C = T(() => Math.max(0, r.limitBytes - r.usedBytes)), w = T(() => y(C.value)), E = T(() => a(i.mediaLibrary.storageTooltip, {
1594
+ used: x.value,
1595
+ total: S.value,
1596
+ remaining: w.value
1597
+ }));
1598
+ return (t, r) => (e(), h("div", {
1599
+ "data-testid": "media-storage-ring",
1600
+ class: "tpl:relative tpl:inline-flex tpl:cursor-help tpl:items-center tpl:justify-center",
1601
+ tabindex: "0",
1602
+ "aria-label": E.value,
1603
+ onMouseenter: r[0] ||= (e) => o.value = !0,
1604
+ onMouseleave: r[1] ||= (e) => o.value = !1,
1605
+ onFocus: r[2] ||= (e) => o.value = !0,
1606
+ onBlur: r[3] ||= (e) => o.value = !1
1607
+ }, [(e(), h("svg", {
1608
+ width: s.value,
1609
+ height: s.value,
1610
+ class: "tpl:-rotate-90",
1611
+ viewBox: `0 0 ${s.value} ${s.value}`
1612
+ }, [m("circle", {
1613
+ cx: s.value / 2,
1614
+ cy: s.value / 2,
1615
+ r: l.value,
1616
+ fill: "none",
1617
+ "stroke-width": c.value,
1618
+ style: { stroke: "var(--tpl-border)" }
1619
+ }, null, 8, rn), m("circle", {
1620
+ cx: s.value / 2,
1621
+ cy: s.value / 2,
1622
+ r: l.value,
1623
+ fill: "none",
1624
+ "stroke-width": c.value,
1625
+ stroke: v.value,
1626
+ "stroke-linecap": "round",
1627
+ "stroke-dasharray": u.value,
1628
+ "stroke-dashoffset": p.value,
1629
+ class: "tpl:transition-all tpl:duration-300 tpl:ease-out"
1630
+ }, null, 8, an)], 8, nn)), g(M, {
1631
+ "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
1632
+ "enter-from-class": "tpl:opacity-0 tpl:translate-y-1",
1633
+ "enter-to-class": "tpl:opacity-100 tpl:translate-y-0",
1634
+ "leave-active-class": "tpl:transition tpl:ease-in tpl:duration-100",
1635
+ "leave-from-class": "tpl:opacity-100 tpl:translate-y-0",
1636
+ "leave-to-class": "tpl:opacity-0 tpl:translate-y-1"
1637
+ }, {
1638
+ default: n(() => [o.value ? (e(), h("div", on, [_(b(E.value) + " ", 1), r[4] ||= m("div", {
1639
+ class: "tpl:absolute tpl:-top-1 tpl:left-1/2 tpl:size-2 tpl:-translate-x-1/2 tpl:rotate-45",
1640
+ style: { "background-color": "var(--tpl-text)" }
1641
+ }, null, -1)])) : D("", !0)]),
1642
+ _: 1
1643
+ })], 40, tn));
1644
+ }
1645
+ });
1646
+ //#endregion
1647
+ //#region ../media-library/src/utils/treeFolders.ts
1648
+ function cn(e) {
1649
+ let t = /* @__PURE__ */ new Map();
1650
+ for (let n of e) t.set(n.id, {
1651
+ ...n,
1652
+ children: []
1653
+ });
1654
+ let n = [];
1655
+ for (let e of t.values()) {
1656
+ let r = e.parentId ?? null, i = r ? t.get(r) : void 0;
1657
+ i ? i.children.push(e) : n.push(e);
1658
+ }
1659
+ return n;
1660
+ }
1661
+ //#endregion
1662
+ //#region ../media-library/src/composables/useMediaLibraryUI.ts
1663
+ function ln(e) {
1664
+ let { library: t, translations: n } = e;
1665
+ function r() {
1666
+ return "value" in n && typeof n.value == "object" ? n.value : n;
1667
+ }
1668
+ let i = d("grid"), a = d(!1), o = d(""), s = d(null), l = d(!1), u = d(!1), f = T(() => t.previewItem.value?.url ?? null), p = T(() => t.frequentlyUsedItems.value.length > 0), m = T(() => t.viewMode.value === "frequently-used" ? t.frequentlyUsedItems.value : t.items.value), h = T(() => Object.values(t.deleteUsageInfo.value).some((e) => e.templateCount > 0)), g = T(() => cn(t.folders.value)), _ = {
1669
+ images: () => r().mediaLibrary.filterImages,
1670
+ documents: () => r().mediaLibrary.filterDocuments,
1671
+ videos: () => r().mediaLibrary.filterVideos,
1672
+ audio: () => r().mediaLibrary.filterAudio
1673
+ };
1674
+ function v(e) {
1675
+ return _[e]?.() ?? e;
1676
+ }
1677
+ c(a, (e) => {
1678
+ e && t.loadFolders();
1679
+ });
1680
+ let y = N((e) => {
1681
+ t.search(e);
1682
+ }, 300);
1683
+ function b(e) {
1684
+ o.value = e, y(e);
1685
+ }
1686
+ let { copy: x, copied: S } = F({
1687
+ copiedDuring: 2e3,
1688
+ legacy: !0
1689
+ });
1690
+ async function C(e) {
1691
+ await t.uploadFiles(e);
1692
+ }
1693
+ function w(e) {
1694
+ t.selectItem(e);
1695
+ }
1696
+ async function E(e, n) {
1697
+ await t.createFolder(e, n);
1698
+ }
1699
+ async function D(e, n) {
1700
+ await t.renameFolder(e, n);
1701
+ }
1702
+ async function O(e) {
1703
+ await t.deleteFolder(e);
1704
+ }
1705
+ function k(e) {
1706
+ s.value = e;
1707
+ }
1708
+ async function A(e, n, r, i) {
1709
+ i && await t.replaceMediaDirectly(e, i.file), await t.updateFile(e, n, r), s.value = null;
1710
+ }
1711
+ async function j(e) {
1712
+ await t.importFromUrl(e) && (l.value = !1);
1713
+ }
1714
+ async function M(e) {
1715
+ u.value = !1, await t.moveSelected(e);
1716
+ }
1717
+ async function P() {
1718
+ await t.checkUsageBeforeDelete();
1719
+ }
1720
+ function I(e) {
1721
+ t.checkUsageBeforeReplace(e);
1722
+ }
1723
+ async function L(e) {
1724
+ await t.replaceFile(e);
1725
+ }
1726
+ function R() {
1727
+ t.clearSelection(), t.cancelDelete(), t.cancelReplace(), o.value = "", t.searchQuery.value = "", t.categoryFilter.value = null, t.sortOption.value = "newest", t.viewMode.value = "files", s.value = null, l.value = !1;
1728
+ }
1729
+ return {
1730
+ layoutMode: i,
1731
+ showSidebar: a,
1732
+ searchInput: o,
1733
+ editingItem: s,
1734
+ showImportUrlModal: l,
1735
+ showMovePicker: u,
1736
+ selectedUrl: f,
1737
+ hasFrequentlyUsed: p,
1738
+ displayItems: m,
1739
+ hasUsedFiles: h,
1740
+ folderTree: g,
1741
+ copy: x,
1742
+ copied: S,
1743
+ getCategoryLabel: v,
1744
+ handleSearchInput: b,
1745
+ handleUpload: C,
1746
+ handleSelect: w,
1747
+ handleCreateFolder: E,
1748
+ handleRenameFolder: D,
1749
+ handleDeleteFolder: O,
1750
+ handleEditItem: k,
1751
+ handleEditSave: A,
1752
+ handleImportFromUrl: j,
1753
+ handleMoveToFolder: M,
1754
+ handleDeleteClick: P,
1755
+ handleReplaceItem: I,
1756
+ handleReplaceFile: L,
1757
+ resetUI: R
1758
+ };
1759
+ }
1760
+ //#endregion
1761
+ //#region ../media-library/src/composable.ts
1762
+ function un(e) {
1763
+ let { provider: t } = e, n = d([]), r = d([]), i = d(null), a = d("files"), o = d(""), s = d(null), c = d("newest"), l = d(!1), u = d(!1), f = d(!1), p = d(null), m = d(null), h = d(/* @__PURE__ */ new Set()), g = d(null), _ = d([]), v = d({}), y = d(!1), b = d([]), x = d(!1), S = d(null), C = d(!1), T = d(null), E = d(!1), D = d(null), O = d(null), k = d(null), A = 0;
1764
+ function j(t) {
1765
+ try {
1766
+ t();
1767
+ } catch (t) {
1768
+ e.onError?.(t);
1769
+ }
1770
+ }
1771
+ function M() {
1772
+ return t.folders === !1 ? null : t.folders;
1773
+ }
1774
+ function N() {
1775
+ return w(e.templateId);
1776
+ }
1777
+ function P(e) {
1778
+ let t = {};
1779
+ o.value ? t.search = o.value : i.value != null && (t.folderId = i.value), s.value && (t.category = s.value), e && (t.cursor = e);
1780
+ let n = N();
1781
+ return n && (t.templateId = n), t;
1782
+ }
1783
+ async function F() {
1784
+ let r = ++A;
1785
+ l.value = !0;
1786
+ let i = P();
1787
+ try {
1788
+ let e = await t.list(i);
1789
+ if (r !== A) return;
1790
+ n.value = e.items, p.value = e.nextCursor ?? null, f.value = !!e.nextCursor;
1791
+ } catch (t) {
1792
+ if (r !== A) return;
1793
+ e.onError?.(t);
1794
+ } finally {
1795
+ r === A && (l.value = !1);
1796
+ }
1797
+ }
1798
+ async function I() {
1799
+ if (!f.value || !p.value || l.value) return;
1800
+ let r = ++A;
1801
+ l.value = !0;
1802
+ let i = P(p.value);
1803
+ try {
1804
+ let e = await t.list(i);
1805
+ if (r !== A) return;
1806
+ n.value = [...n.value, ...e.items], p.value = e.nextCursor ?? null, f.value = !!e.nextCursor;
1807
+ } catch (t) {
1808
+ if (r !== A) return;
1809
+ e.onError?.(t);
1810
+ } finally {
1811
+ r === A && (l.value = !1);
1812
+ }
1813
+ }
1814
+ async function L(e) {
1815
+ o.value = e, await F();
1816
+ }
1817
+ async function R(e) {
1818
+ s.value = e, await F();
1819
+ }
1820
+ async function ee(e) {
1821
+ c.value = e, await F();
1822
+ }
1823
+ async function z(e) {
1824
+ a.value = "files", i.value = e, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await F();
1825
+ }
1826
+ async function B() {
1827
+ a.value = "frequently-used", i.value = null, o.value = "", h.value = /* @__PURE__ */ new Set(), g.value = null, await G();
1828
+ }
1829
+ async function V(r) {
1830
+ let { create: a } = t;
1831
+ if (typeof a != "function") return null;
1832
+ u.value = !0;
1833
+ try {
1834
+ let e = { file: r };
1835
+ i.value != null && (e.folderId = i.value);
1836
+ let o = N();
1837
+ o && (e.templateId = o);
1838
+ let s = await a(e);
1839
+ return n.value = [s, ...n.value], j(() => t.onCreated?.(s)), s;
1840
+ } catch (t) {
1841
+ return e.onError?.(t), null;
1842
+ } finally {
1843
+ u.value = !1;
1844
+ }
1845
+ }
1846
+ async function te(r) {
1847
+ let { create: a } = t;
1848
+ if (typeof a == "function") {
1849
+ u.value = !0, m.value = {
1850
+ current: 0,
1851
+ total: r.length
1852
+ };
1853
+ try {
1854
+ for (let o = 0; o < r.length; o++) {
1855
+ m.value = {
1856
+ current: o + 1,
1857
+ total: r.length
1858
+ };
1859
+ try {
1860
+ let e = { file: r[o] };
1861
+ i.value != null && (e.folderId = i.value);
1862
+ let s = N();
1863
+ s && (e.templateId = s);
1864
+ let c = await a(e);
1865
+ n.value = [c, ...n.value], j(() => t.onCreated?.(c));
1866
+ } catch (t) {
1867
+ e.onError?.(t);
1868
+ }
1869
+ }
1870
+ } finally {
1871
+ u.value = !1, m.value = null;
1872
+ }
1873
+ }
1874
+ }
1875
+ async function ne(t) {
1876
+ if (h.value.size === 0) return;
1877
+ let { move: r } = M() ?? { move: !1 };
1878
+ if (typeof r == "function") try {
1879
+ let e = await r([...h.value], t);
1880
+ if (i.value === null) {
1881
+ let t = new Map(e.map((e) => [e.id, e]));
1882
+ n.value = n.value.map((e) => t.get(e.id) ?? e);
1883
+ } else n.value = n.value.filter((e) => !h.value.has(e.id));
1884
+ h.value = /* @__PURE__ */ new Set(), g.value = null;
1885
+ } catch (t) {
1886
+ e.onError?.(t);
1887
+ }
1888
+ }
1889
+ async function re(r, i, a) {
1890
+ let { update: o } = t;
1891
+ if (typeof o == "function") try {
1892
+ let e = { filename: i };
1893
+ a !== void 0 && (e.alt = a);
1894
+ let s = await o(r, e);
1895
+ n.value = n.value.map((e) => e.id === r ? s : e), g.value?.id === r && (g.value = s), j(() => t.onUpdated?.(s));
1896
+ } catch (t) {
1897
+ e.onError?.(t);
1898
+ }
1899
+ }
1900
+ function H(e) {
1901
+ let t = /* @__PURE__ */ new Map();
1902
+ for (let r of n.value) e.includes(r.id) && t.set(r.id, r);
1903
+ for (let n of _.value) e.includes(n.id) && !t.has(n.id) && t.set(n.id, n);
1904
+ return [...t.values()];
1905
+ }
1906
+ function U(e) {
1907
+ n.value = n.value.filter((t) => !e.includes(t.id)), _.value = _.value.filter((t) => !e.includes(t.id)), h.value = /* @__PURE__ */ new Set(), g.value = null;
1908
+ }
1909
+ async function W() {
1910
+ if (h.value.size === 0) return;
1911
+ let { delete: n } = t;
1912
+ if (typeof n != "function") return;
1913
+ let r = [...h.value], i = H(r);
1914
+ try {
1915
+ await n(r), U(r);
1916
+ for (let e of i) j(() => t.onDeleted?.(e));
1917
+ } catch (t) {
1918
+ e.onError?.(t);
1919
+ }
1920
+ }
1921
+ async function G() {
1922
+ let { frequentlyUsed: n } = t;
1923
+ if (typeof n == "function") try {
1924
+ _.value = await n();
1925
+ } catch (t) {
1926
+ e.onError?.(t);
1927
+ }
1928
+ }
1929
+ async function ie() {
1930
+ if (h.value.size === 0) return !1;
1931
+ b.value = [...h.value];
1932
+ let { checkUsage: n } = t;
1933
+ if (typeof n != "function") return v.value = {}, y.value = !0, !1;
1934
+ try {
1935
+ let e = await n(b.value);
1936
+ v.value = e;
1937
+ let t = Object.values(e).some((e) => e.templateCount > 0);
1938
+ return y.value = !0, t;
1939
+ } catch (t) {
1940
+ return e.onError?.(t), !1;
1941
+ }
1942
+ }
1943
+ async function ae() {
1944
+ let { delete: n } = t;
1945
+ if (typeof n != "function" || (y.value = !1, b.value.length === 0)) return;
1946
+ let r = b.value, i = H(r);
1947
+ try {
1948
+ await n(r), U(r), b.value = [], v.value = {};
1949
+ for (let e of i) j(() => t.onDeleted?.(e));
1950
+ } catch (t) {
1951
+ e.onError?.(t);
1952
+ }
1953
+ }
1954
+ function oe() {
1955
+ y.value = !1, b.value = [], v.value = {};
1956
+ }
1957
+ async function se(r) {
1958
+ let a = t.importFromUrl;
1959
+ if (typeof a != "function") return null;
1960
+ x.value = !0, S.value = null;
1961
+ try {
1962
+ let e = await a(r, i.value, N());
1963
+ return n.value = [e, ...n.value], j(() => t.onCreated?.(e)), e;
1964
+ } catch (t) {
1965
+ return S.value = t instanceof Error ? t.message : "Import failed", e.onError?.(t), null;
1966
+ } finally {
1967
+ x.value = !1;
1968
+ }
1969
+ }
1970
+ function K(e) {
1971
+ let t = new Set(h.value);
1972
+ t.has(e) ? t.delete(e) : t.add(e), h.value = t;
1973
+ }
1974
+ function q() {
1975
+ h.value = /* @__PURE__ */ new Set(), g.value = null;
1976
+ }
1977
+ function J(e) {
1978
+ g.value = e, h.value = /* @__PURE__ */ new Set([e.id]);
1979
+ }
1980
+ async function ce() {
1981
+ let { storage: n } = t;
1982
+ if (typeof n != "function") {
1983
+ k.value = null;
1984
+ return;
1985
+ }
1986
+ try {
1987
+ k.value = await n();
1988
+ } catch (t) {
1989
+ e.onError?.(t);
1990
+ }
1991
+ }
1992
+ async function Y() {
1993
+ let t = M();
1994
+ if (t) try {
1995
+ r.value = await t.list();
1996
+ } catch (t) {
1997
+ e.onError?.(t);
1998
+ }
1999
+ }
2000
+ async function le(t, n) {
2001
+ let { create: r } = M() ?? { create: !1 };
2002
+ if (typeof r != "function") return null;
2003
+ try {
2004
+ let e = { name: t };
2005
+ n !== void 0 && (e.parentId = n);
2006
+ let i = await r(e);
2007
+ return await Y(), i;
2008
+ } catch (t) {
2009
+ return e.onError?.(t), null;
2010
+ }
2011
+ }
2012
+ function ue(e, t) {
2013
+ for (let n of e) if (n.id === t) return n;
2014
+ return null;
2015
+ }
2016
+ async function X(t, n) {
2017
+ let { update: r } = M() ?? { update: !1 };
2018
+ if (typeof r == "function") try {
2019
+ await r(t, { name: n }), await Y();
2020
+ } catch (t) {
2021
+ e.onError?.(t);
2022
+ }
2023
+ }
2024
+ async function de(t) {
2025
+ let { delete: n } = M() ?? { delete: !1 };
2026
+ if (typeof n == "function") try {
2027
+ let e = ue(r.value, t)?.parentId ?? null;
2028
+ await n(t), i.value === t && (i.value = e), await Y(), await F();
2029
+ } catch (t) {
2030
+ e.onError?.(t);
2031
+ }
2032
+ }
2033
+ async function Z(n) {
2034
+ D.value = n, T.value = null;
2035
+ let { checkUsage: r } = t;
2036
+ if (typeof r != "function") {
2037
+ O.value = null, E.value = !0;
2038
+ return;
2039
+ }
2040
+ try {
2041
+ let e = await r([n.id]);
2042
+ O.value = e[n.id] ?? null, E.value = !0;
2043
+ } catch (t) {
2044
+ e.onError?.(t);
2045
+ }
2046
+ }
2047
+ function fe() {
2048
+ E.value = !1, D.value = null, O.value = null, T.value = null;
2049
+ }
2050
+ function pe(e) {
2051
+ n.value = n.value.map((t) => t.id === e.id ? e : t), _.value = _.value.map((t) => t.id === e.id ? e : t), g.value?.id === e.id && (g.value = e), j(() => t.onUpdated?.(e));
2052
+ }
2053
+ async function Q(n) {
2054
+ let { replace: r } = t;
2055
+ if (typeof r != "function" || !D.value) return null;
2056
+ C.value = !0, T.value = null;
2057
+ try {
2058
+ let e = await r(D.value.id, n);
2059
+ return pe(e), E.value = !1, D.value = null, O.value = null, e;
2060
+ } catch (t) {
2061
+ return T.value = t instanceof Error ? t.message : "Replace failed", e.onError?.(t), null;
2062
+ } finally {
2063
+ C.value = !1;
2064
+ }
2065
+ }
2066
+ async function me(n, r) {
2067
+ let { replace: i } = t;
2068
+ if (typeof i != "function") return null;
2069
+ try {
2070
+ let e = await i(n, r);
2071
+ return pe(e), e;
2072
+ } catch (t) {
2073
+ return e.onError?.(t), null;
2074
+ }
2075
+ }
2076
+ return {
2077
+ items: n,
2078
+ folders: r,
2079
+ currentFolderId: i,
2080
+ viewMode: a,
2081
+ searchQuery: o,
2082
+ categoryFilter: s,
2083
+ sortOption: c,
2084
+ isLoading: l,
2085
+ isUploading: u,
2086
+ uploadProgress: m,
2087
+ hasMore: f,
2088
+ selectedItems: h,
2089
+ previewItem: g,
2090
+ frequentlyUsedItems: _,
2091
+ deleteUsageInfo: v,
2092
+ showDeleteWarning: y,
2093
+ loadItems: F,
2094
+ loadMore: I,
2095
+ search: L,
2096
+ filterByCategory: R,
2097
+ sortBy: ee,
2098
+ navigateToFolder: z,
2099
+ showFrequentlyUsed: B,
2100
+ uploadFile: V,
2101
+ uploadFiles: te,
2102
+ moveSelected: ne,
2103
+ updateFile: re,
2104
+ deleteSelected: W,
2105
+ isImportingFromUrl: x,
2106
+ importFromUrlError: S,
2107
+ importFromUrl: se,
2108
+ toggleSelection: K,
2109
+ clearSelection: q,
2110
+ selectItem: J,
2111
+ loadFolders: Y,
2112
+ createFolder: le,
2113
+ renameFolder: X,
2114
+ deleteFolder: de,
2115
+ findFolderInTree: ue,
2116
+ loadFrequentlyUsed: G,
2117
+ checkUsageBeforeDelete: ie,
2118
+ confirmDelete: ae,
2119
+ cancelDelete: oe,
2120
+ isReplacing: C,
2121
+ replaceError: T,
2122
+ showReplaceWarning: E,
2123
+ pendingReplaceItem: D,
2124
+ replaceUsageInfo: O,
2125
+ checkUsageBeforeReplace: Z,
2126
+ cancelReplace: fe,
2127
+ replaceFile: Q,
2128
+ replaceMediaDirectly: me,
2129
+ storageInfo: k,
2130
+ loadStorage: ce
2131
+ };
2132
+ }
2133
+ //#endregion
2134
+ //#region ../media-library/src/components/MediaLibraryChrome.vue?vue&type=script&setup=true&lang.ts
2135
+ var dn = { class: "tpl:relative tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col tpl:overflow-hidden" }, fn = {
2136
+ class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-3.5",
2137
+ style: { "border-color": "var(--tpl-border)" }
2138
+ }, pn = {
2139
+ id: "tpl-media-library-title",
2140
+ class: "tpl:text-sm tpl:font-semibold",
2141
+ style: { color: "var(--tpl-text)" }
2142
+ }, mn = { class: "tpl:flex tpl:items-center tpl:gap-3" }, hn = { class: "tpl:relative" }, gn = [
2143
+ "value",
2144
+ "disabled",
2145
+ "aria-label",
2146
+ "placeholder"
2147
+ ], _n = ["aria-label"], vn = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, yn = {
2148
+ key: 0,
2149
+ class: "tpl:flex tpl:w-48 tpl:shrink-0 tpl:flex-col tpl:border-r",
2150
+ style: {
2151
+ "border-color": "var(--tpl-border)",
2152
+ "background-color": "var(--tpl-bg)"
2153
+ }
2154
+ }, bn = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:flex-col" }, xn = {
2155
+ class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-b tpl:px-4 tpl:py-2.5",
2156
+ style: { "border-color": "var(--tpl-border)" }
2157
+ }, Sn = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Cn = [
2158
+ "title",
2159
+ "aria-label",
2160
+ "aria-pressed"
2161
+ ], wn = {
2162
+ key: 1,
2163
+ class: "tpl:text-xs tpl:font-medium",
2164
+ style: { color: "var(--tpl-text)" }
2165
+ }, Tn = {
2166
+ class: "tpl:flex tpl:rounded-md tpl:p-0.5",
2167
+ style: {
2168
+ border: "1px solid var(--tpl-border)",
2169
+ "background-color": "var(--tpl-bg)"
2170
+ }
2171
+ }, En = [
2172
+ "title",
2173
+ "aria-label",
2174
+ "aria-pressed"
2175
+ ], Dn = [
2176
+ "title",
2177
+ "aria-label",
2178
+ "aria-pressed"
2179
+ ], On = { class: "tpl:flex tpl:items-center tpl:gap-2" }, kn = ["aria-label", "value"], An = { value: "" }, jn = ["value"], Mn = { class: "tpl:min-h-0 tpl:flex-1 tpl:overflow-y-auto" }, Nn = {
2180
+ key: 0,
2181
+ class: "tpl:px-4 tpl:pt-3"
2182
+ }, Pn = {
2183
+ class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
2184
+ style: {
2185
+ "background-color": "var(--tpl-bg-elevated)",
2186
+ "box-shadow": "var(--tpl-shadow-xl)"
2187
+ }
2188
+ }, Fn = {
2189
+ id: "tpl-media-delete-title",
2190
+ class: "tpl:mb-2 tpl:text-sm tpl:font-semibold",
2191
+ style: { color: "var(--tpl-text)" }
2192
+ }, In = {
2193
+ key: 0,
2194
+ "data-testid": "media-delete-usage",
2195
+ class: "tpl:mb-4 tpl:text-xs",
2196
+ style: { color: "var(--tpl-text-muted)" }
2197
+ }, Ln = {
2198
+ key: 1,
2199
+ class: "tpl:mb-4 tpl:max-h-32 tpl:overflow-y-auto tpl:rounded tpl:border tpl:p-2",
2200
+ style: { "border-color": "var(--tpl-border)" }
2201
+ }, Rn = { class: "tpl:font-medium" }, zn = { style: { color: "var(--tpl-text-muted)" } }, Bn = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, Vn = {
2202
+ class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
2203
+ style: { "border-color": "var(--tpl-border)" }
2204
+ }, Hn = { class: "tpl:flex tpl:min-w-0 tpl:flex-1 tpl:items-center tpl:gap-3" }, Un = { class: "tpl:flex tpl:items-center tpl:gap-5" }, Wn = {
2205
+ key: 0,
2206
+ class: "tpl:flex tpl:items-center tpl:gap-2"
2207
+ }, Gn = {
2208
+ key: 1,
2209
+ class: "tpl:relative"
2210
+ }, Kn = { class: "tpl:flex tpl:items-center tpl:gap-2" }, qn = ["data-testid", "disabled"], Jn = /* @__PURE__ */ O({
2211
+ __name: "MediaLibraryChrome",
2212
+ props: {
2213
+ provider: {},
2214
+ accept: {},
2215
+ templateId: {},
2216
+ onError: { type: Function },
2217
+ translations: {},
2218
+ showClose: { type: Boolean },
2219
+ showConfirm: { type: Boolean },
2220
+ confirmTestId: {}
2221
+ },
2222
+ emits: [
2223
+ "close",
2224
+ "confirm",
2225
+ "ready"
2226
+ ],
2227
+ setup(i, { expose: a, emit: s }) {
2228
+ let l = i, u = s, d = f(() => import("./MediaEditModal-D4GEq2md.js")), v = T(() => l.translations), w = T(() => l.confirmTestId ?? "media-confirm"), E = {
2229
+ get maxFileSize() {
2230
+ return l.provider.maxFileSize;
2231
+ },
2232
+ get mimeTypes() {
2233
+ return l.provider.mimeTypes;
2234
+ },
2235
+ get accept() {
2236
+ return l.accept;
2237
+ }
2238
+ };
2239
+ y(ue, E);
2240
+ let { isAcceptedMimeType: O, availableCategories: k } = $(E), j = un({
2241
+ provider: l.provider,
2242
+ templateId: () => l.templateId,
2243
+ onError: (e) => l.onError?.(e)
2244
+ }), N = ln({
2245
+ library: j,
2246
+ translations: v
2247
+ }), P = T(() => typeof l.provider.create == "function"), F = T(() => l.provider.folders !== !1), I = T(() => typeof l.provider.importFromUrl == "function"), L = T(() => typeof l.provider.delete == "function"), R = T(() => typeof l.provider.update == "function"), ee = T(() => typeof l.provider.replace == "function"), z = T(() => typeof l.provider.frequentlyUsed == "function"), V = T(() => {
2248
+ let e = l.provider.folders;
2249
+ return e !== !1 && typeof e.move == "function";
2250
+ }), H = T(() => {
2251
+ let e = l.provider.folders;
2252
+ return e !== !1 && typeof e.create == "function";
2253
+ }), U = T(() => {
2254
+ let e = l.provider.folders;
2255
+ return e !== !1 && typeof e.update == "function";
2256
+ }), W = T(() => {
2257
+ let e = l.provider.folders;
2258
+ return e !== !1 && typeof e.delete == "function";
2259
+ }), G = T(() => j.isLoading.value && N.displayItems.value.length === 0), ae = T(() => {
2260
+ let e = j.previewItem.value;
2261
+ return e ? !l.accept?.length || O(e.mimeType ?? "", l.accept) : !1;
2262
+ }), oe = T(() => {
2263
+ if (!L.value) return 0;
2264
+ let e = 0;
2265
+ for (let t of j.selectedItems.value) N.displayItems.value.find((e) => e.id === t)?.canDelete !== !1 && (e += 1);
2266
+ return e;
2267
+ }), K = T(() => N.showImportUrlModal.value || N.editingItem.value !== null || j.showReplaceWarning.value);
2268
+ function q() {
2269
+ return K.value ? !0 : N.showMovePicker.value ? (N.showMovePicker.value = !1, !0) : j.showDeleteWarning.value ? (j.cancelDelete(), !0) : !1;
2270
+ }
2271
+ function J() {
2272
+ ae.value && j.previewItem.value && u("confirm", j.previewItem.value);
2273
+ }
2274
+ function le(e) {
2275
+ let t = e.target.value;
2276
+ j.filterByCategory(t || null);
2277
+ }
2278
+ async function X() {
2279
+ let e = /* @__PURE__ */ new Set();
2280
+ for (let t of j.selectedItems.value) N.displayItems.value.find((e) => e.id === t)?.canDelete !== !1 && e.add(t);
2281
+ j.selectedItems.value = e, await N.handleDeleteClick();
2282
+ }
2283
+ return c(() => l.accept, (e) => {
2284
+ e?.length === 1 && (j.categoryFilter.value = e[0]);
2285
+ }, { immediate: !0 }), j.loadItems(), j.loadFrequentlyUsed(), j.loadStorage(), u("ready"), r(() => {
2286
+ N.resetUI();
2287
+ }), a({
2288
+ nestedDialogOpen: K,
2289
+ handleEscape: q,
2290
+ library: j,
2291
+ ui: N
2292
+ }), (r, a) => (e(), h("div", dn, [
2293
+ m("div", fn, [m("h2", pn, b(v.value.mediaLibrary.title), 1), m("div", mn, [
2294
+ p(j).storageInfo.value ? (e(), S(sn, {
2295
+ key: 0,
2296
+ "used-bytes": p(j).storageInfo.value.usedBytes,
2297
+ "limit-bytes": p(j).storageInfo.value.limitBytes,
2298
+ size: 22
2299
+ }, null, 8, ["used-bytes", "limit-bytes"])) : D("", !0),
2300
+ m("div", hn, [m("input", {
2301
+ value: p(N).searchInput.value,
2302
+ type: "search",
2303
+ disabled: G.value,
2304
+ "aria-label": v.value.mediaLibrary.searchAriaLabel,
2305
+ class: "tpl:w-52 tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-3 tpl:pl-8 tpl:text-xs tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:outline-none tpl:focus:shadow-[var(--tpl-ring)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
2306
+ style: {
2307
+ "border-color": "var(--tpl-border)",
2308
+ "background-color": "var(--tpl-bg)",
2309
+ color: "var(--tpl-text)"
2310
+ },
2311
+ placeholder: v.value.mediaLibrary.searchPlaceholder,
2312
+ onInput: a[0] ||= (e) => p(N).handleSearchInput(e.target.value)
2313
+ }, null, 40, gn), g(p(ie), {
2314
+ class: "tpl:absolute tpl:top-1/2 tpl:left-2.5 tpl:-translate-y-1/2",
2315
+ size: 13,
2316
+ "stroke-width": 2,
2317
+ style: { color: "var(--tpl-text-dim)" }
2318
+ })]),
2319
+ i.showClose ? (e(), h("button", {
2320
+ key: 1,
2321
+ type: "button",
2322
+ "aria-label": v.value.mediaLibrary.close,
2323
+ class: "tpl:flex tpl:size-7 tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
2324
+ style: { color: "var(--tpl-text-muted)" },
2325
+ onClick: a[1] ||= (e) => u("close")
2326
+ }, [g(p(se), {
2327
+ size: 18,
2328
+ "stroke-width": 2
2329
+ })], 8, _n)) : D("", !0)
2330
+ ])]),
2331
+ m("div", vn, [g(M, {
2332
+ "enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
2333
+ "enter-from-class": "tpl:-ml-48 tpl:opacity-0",
2334
+ "enter-to-class": "tpl:ml-0 tpl:opacity-100",
2335
+ "leave-active-class": "tpl:transition-all tpl:duration-150 tpl:ease-in",
2336
+ "leave-from-class": "tpl:ml-0 tpl:opacity-100",
2337
+ "leave-to-class": "tpl:-ml-48 tpl:opacity-0"
2338
+ }, {
2339
+ default: n(() => [F.value && p(N).showSidebar.value ? (e(), h("div", yn, [g(Pe, {
2340
+ folders: p(N).folderTree.value,
2341
+ "current-folder-id": p(j).currentFolderId.value,
2342
+ "view-mode": p(j).viewMode.value,
2343
+ "has-frequently-used": z.value && p(N).hasFrequentlyUsed.value,
2344
+ "can-create-folder": H.value,
2345
+ "can-rename-folder": U.value,
2346
+ "can-delete-folder": W.value,
2347
+ onNavigate: p(j).navigateToFolder,
2348
+ onCreateFolder: p(N).handleCreateFolder,
2349
+ onRenameFolder: p(N).handleRenameFolder,
2350
+ onDeleteFolder: p(N).handleDeleteFolder,
2351
+ onShowFrequentlyUsed: p(j).showFrequentlyUsed
2352
+ }, null, 8, [
2353
+ "folders",
2354
+ "current-folder-id",
2355
+ "view-mode",
2356
+ "has-frequently-used",
2357
+ "can-create-folder",
2358
+ "can-rename-folder",
2359
+ "can-delete-folder",
2360
+ "onNavigate",
2361
+ "onCreateFolder",
2362
+ "onRenameFolder",
2363
+ "onDeleteFolder",
2364
+ "onShowFrequentlyUsed"
2365
+ ])])) : D("", !0)]),
2366
+ _: 1
2367
+ }), m("div", bn, [m("div", xn, [m("div", Sn, [
2368
+ F.value ? (e(), h("button", {
2369
+ key: 0,
2370
+ type: "button",
2371
+ "data-testid": "media-folder-toggle",
2372
+ class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:transition-all tpl:duration-150",
2373
+ style: t({
2374
+ color: p(N).showSidebar.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2375
+ backgroundColor: p(N).showSidebar.value ? "var(--tpl-bg)" : "transparent",
2376
+ border: p(N).showSidebar.value ? "1px solid var(--tpl-border)" : "1px solid transparent"
2377
+ }),
2378
+ title: p(N).showSidebar.value ? v.value.mediaLibrary.hideFolders : v.value.mediaLibrary.showFolders,
2379
+ "aria-label": p(N).showSidebar.value ? v.value.mediaLibrary.hideFolders : v.value.mediaLibrary.showFolders,
2380
+ "aria-pressed": p(N).showSidebar.value,
2381
+ onClick: a[2] ||= (e) => p(N).showSidebar.value = !p(N).showSidebar.value
2382
+ }, [g(p(Y), {
2383
+ size: 16,
2384
+ "stroke-width": 2
2385
+ })], 12, Cn)) : D("", !0),
2386
+ p(j).viewMode.value === "frequently-used" ? (e(), h("span", wn, b(v.value.mediaLibrary.frequentlyUsed), 1)) : (e(), S(be, {
2387
+ key: 2,
2388
+ folders: p(N).folderTree.value,
2389
+ "current-folder-id": p(j).currentFolderId.value,
2390
+ onNavigate: p(j).navigateToFolder
2391
+ }, null, 8, [
2392
+ "folders",
2393
+ "current-folder-id",
2394
+ "onNavigate"
2395
+ ])),
2396
+ m("div", Tn, [m("button", {
2397
+ type: "button",
2398
+ class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2399
+ style: t({
2400
+ color: p(N).layoutMode.value === "grid" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2401
+ backgroundColor: p(N).layoutMode.value === "grid" ? "var(--tpl-bg-elevated)" : "transparent"
2402
+ }),
2403
+ title: v.value.mediaLibrary.viewGrid,
2404
+ "aria-label": v.value.mediaLibrary.viewGrid,
2405
+ "aria-pressed": p(N).layoutMode.value === "grid",
2406
+ onClick: a[3] ||= (e) => p(N).layoutMode.value = "grid"
2407
+ }, [g(p(ce), {
2408
+ size: 14,
2409
+ "stroke-width": 2
2410
+ })], 12, En), m("button", {
2411
+ type: "button",
2412
+ class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:transition-all tpl:duration-150",
2413
+ style: t({
2414
+ color: p(N).layoutMode.value === "list" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
2415
+ backgroundColor: p(N).layoutMode.value === "list" ? "var(--tpl-bg-elevated)" : "transparent"
2416
+ }),
2417
+ title: v.value.mediaLibrary.viewList,
2418
+ "aria-label": v.value.mediaLibrary.viewList,
2419
+ "aria-pressed": p(N).layoutMode.value === "list",
2420
+ onClick: a[4] ||= (e) => p(N).layoutMode.value = "list"
2421
+ }, [g(p(re), {
2422
+ size: 14,
2423
+ "stroke-width": 2
2424
+ })], 12, Dn)])
2425
+ ]), m("div", On, [p(k).length > 1 ? (e(), h("select", {
2426
+ key: 0,
2427
+ "aria-label": v.value.mediaLibrary.filterAriaLabel,
2428
+ class: "tpl:rounded-md tpl:border tpl:py-1.5 tpl:pr-7 tpl:pl-2.5 tpl:text-xs tpl:transition-all tpl:duration-150 tpl:outline-none",
2429
+ style: {
2430
+ "border-color": "var(--tpl-border)",
2431
+ "background-color": "var(--tpl-bg)",
2432
+ color: "var(--tpl-text)"
2433
+ },
2434
+ value: p(j).categoryFilter.value ?? "",
2435
+ onChange: le
2436
+ }, [m("option", An, b(v.value.mediaLibrary.filterAll), 1), (e(!0), h(C, null, o(p(k), (t) => (e(), h("option", {
2437
+ key: t,
2438
+ value: t
2439
+ }, b(p(N).getCategoryLabel(t)), 9, jn))), 128))], 40, kn)) : D("", !0)])]), m("div", Mn, [p(j).viewMode.value === "files" && (P.value || I.value) ? (e(), h("div", Nn, [P.value ? (e(), S(en, {
2440
+ key: 0,
2441
+ "is-uploading": p(j).isUploading.value,
2442
+ "upload-progress": p(j).uploadProgress.value,
2443
+ onUpload: p(N).handleUpload
2444
+ }, null, 8, [
2445
+ "is-uploading",
2446
+ "upload-progress",
2447
+ "onUpload"
2448
+ ])) : D("", !0), I.value ? (e(), h("button", {
2449
+ key: 1,
2450
+ "data-testid": "media-import-url",
2451
+ class: "tpl:mt-2 tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-dashed tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2452
+ style: {
2453
+ "border-color": "var(--tpl-border)",
2454
+ color: "var(--tpl-text-muted)",
2455
+ "background-color": "var(--tpl-bg)"
2456
+ },
2457
+ onClick: a[5] ||= (e) => p(N).showImportUrlModal.value = !0
2458
+ }, [g(p(ne), {
2459
+ size: 14,
2460
+ "stroke-width": 2
2461
+ }), _(" " + b(v.value.mediaLibrary.importFromUrl), 1)])) : D("", !0)])) : D("", !0), g(dt, {
2462
+ items: p(N).displayItems.value,
2463
+ "selected-ids": p(j).selectedItems.value,
2464
+ "is-loading": p(j).isLoading.value,
2465
+ "has-more": p(j).viewMode.value === "files" && p(j).hasMore.value,
2466
+ accept: i.accept,
2467
+ layout: p(N).layoutMode.value,
2468
+ "search-query": p(j).searchQuery.value,
2469
+ "can-update": R.value,
2470
+ "can-replace": ee.value,
2471
+ onSelect: p(N).handleSelect,
2472
+ onToggle: p(j).toggleSelection,
2473
+ onLoadMore: p(j).loadMore,
2474
+ onEdit: p(N).handleEditItem,
2475
+ onReplace: p(N).handleReplaceItem,
2476
+ onConfirm: J
2477
+ }, null, 8, [
2478
+ "items",
2479
+ "selected-ids",
2480
+ "is-loading",
2481
+ "has-more",
2482
+ "accept",
2483
+ "layout",
2484
+ "search-query",
2485
+ "can-update",
2486
+ "can-replace",
2487
+ "onSelect",
2488
+ "onToggle",
2489
+ "onLoadMore",
2490
+ "onEdit",
2491
+ "onReplace"
2492
+ ])])])]),
2493
+ g(St, {
2494
+ visible: p(N).showImportUrlModal.value,
2495
+ "is-importing": p(j).isImportingFromUrl.value,
2496
+ error: p(j).importFromUrlError.value,
2497
+ onImport: p(N).handleImportFromUrl,
2498
+ onClose: a[6] ||= (e) => p(N).showImportUrlModal.value = !1
2499
+ }, null, 8, [
2500
+ "visible",
2501
+ "is-importing",
2502
+ "error",
2503
+ "onImport"
2504
+ ]),
2505
+ p(N).editingItem.value ? (e(), S(p(d), {
2506
+ key: 0,
2507
+ visible: !0,
2508
+ item: p(N).editingItem.value,
2509
+ onSave: p(N).handleEditSave,
2510
+ onClose: a[7] ||= (e) => p(N).editingItem.value = null
2511
+ }, null, 8, ["item", "onSave"])) : D("", !0),
2512
+ g(Jt, {
2513
+ visible: p(j).showReplaceWarning.value,
2514
+ item: p(j).pendingReplaceItem.value,
2515
+ "usage-info": p(j).replaceUsageInfo.value,
2516
+ "is-replacing": p(j).isReplacing.value,
2517
+ error: p(j).replaceError.value,
2518
+ onReplace: p(N).handleReplaceFile,
2519
+ onClose: p(j).cancelReplace
2520
+ }, null, 8, [
2521
+ "visible",
2522
+ "item",
2523
+ "usage-info",
2524
+ "is-replacing",
2525
+ "error",
2526
+ "onReplace",
2527
+ "onClose"
2528
+ ]),
2529
+ g(M, {
2530
+ "enter-active-class": "tpl:transition tpl:ease-out tpl:duration-150",
2531
+ "enter-from-class": "tpl:opacity-0",
2532
+ "enter-to-class": "tpl:opacity-100",
2533
+ "leave-active-class": "tpl:transition tpl:ease-in tpl:duration-100",
2534
+ "leave-from-class": "tpl:opacity-100",
2535
+ "leave-to-class": "tpl:opacity-0"
2536
+ }, {
2537
+ default: n(() => [p(j).showDeleteWarning.value ? (e(), h("div", {
2538
+ key: 0,
2539
+ role: "dialog",
2540
+ "aria-modal": "true",
2541
+ "aria-labelledby": "tpl-media-delete-title",
2542
+ class: "tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-lg)]",
2543
+ style: {
2544
+ "background-color": "var(--tpl-overlay)",
2545
+ "backdrop-filter": "blur(8px)",
2546
+ "-webkit-backdrop-filter": "blur(8px)"
2547
+ },
2548
+ onClick: a[10] ||= A((...e) => p(j).cancelDelete && p(j).cancelDelete(...e), ["self"])
2549
+ }, [m("div", Pn, [
2550
+ m("h3", Fn, b(v.value.mediaLibrary.deleteWarningTitle), 1),
2551
+ m("p", {
2552
+ class: x(["tpl:text-xs", p(N).hasUsedFiles.value ? "tpl:mb-2" : "tpl:mb-4"]),
2553
+ style: { color: "var(--tpl-text-muted)" }
2554
+ }, b(v.value.mediaLibrary.deleteWarningMessage), 3),
2555
+ p(N).hasUsedFiles.value ? (e(), h("p", In, b(v.value.mediaLibrary.deleteWarningUsageNote), 1)) : D("", !0),
2556
+ p(N).hasUsedFiles.value ? (e(), h("div", Ln, [(e(!0), h(C, null, o(p(j).deleteUsageInfo.value, (t, n) => (e(), h("div", {
2557
+ key: n,
2558
+ class: "tpl:text-xs",
2559
+ style: { color: "var(--tpl-text)" }
2560
+ }, [t.templateCount > 0 ? (e(), h(C, { key: 0 }, [m("span", Rn, b(p(N).displayItems.value.find((e) => e.id === n)?.filename || n), 1), m("span", zn, " - " + b(v.value.mediaLibrary.usedInTemplates.replace("{count}", t.templateCount.toString())), 1)], 64)) : D("", !0)]))), 128))])) : D("", !0),
2561
+ m("div", Bn, [m("button", {
2562
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2563
+ style: {
2564
+ "border-color": "var(--tpl-border)",
2565
+ color: "var(--tpl-text)",
2566
+ "background-color": "var(--tpl-bg)"
2567
+ },
2568
+ onClick: a[8] ||= (...e) => p(j).cancelDelete && p(j).cancelDelete(...e)
2569
+ }, b(v.value.mediaLibrary.cancel), 1), m("button", {
2570
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2571
+ style: {
2572
+ "border-color": "var(--tpl-danger)",
2573
+ color: "var(--tpl-danger)",
2574
+ "background-color": "var(--tpl-bg)"
2575
+ },
2576
+ onClick: a[9] ||= (...e) => p(j).confirmDelete && p(j).confirmDelete(...e)
2577
+ }, b(p(N).hasUsedFiles.value ? v.value.mediaLibrary.deleteAnyway : v.value.mediaLibrary.confirmDelete), 1)])
2578
+ ])])) : D("", !0)]),
2579
+ _: 1
2580
+ }),
2581
+ m("div", Vn, [m("div", Hn, [p(j).previewItem.value ? (e(), S(Pt, {
2582
+ key: 0,
2583
+ item: p(j).previewItem.value,
2584
+ folders: p(N).folderTree.value
2585
+ }, null, 8, ["item", "folders"])) : D("", !0)]), m("div", Un, [p(j).selectedItems.value.size > 0 ? (e(), h("div", Wn, [p(j).previewItem.value ? (e(), h("button", {
2586
+ key: 0,
2587
+ class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2588
+ style: t({
2589
+ borderColor: p(N).copied.value ? "var(--tpl-success)" : "var(--tpl-border)",
2590
+ color: p(N).copied.value ? "var(--tpl-success)" : "var(--tpl-text)",
2591
+ backgroundColor: "var(--tpl-bg)"
2592
+ }),
2593
+ onClick: a[11] ||= (e) => p(N).copy(p(N).selectedUrl.value)
2594
+ }, [p(N).copied.value ? (e(), S(p(B), {
2595
+ key: 1,
2596
+ size: 12,
2597
+ "stroke-width": 2
2598
+ })) : (e(), S(p(te), {
2599
+ key: 0,
2600
+ size: 12,
2601
+ "stroke-width": 2
2602
+ })), _(" " + b(p(N).copied.value ? v.value.mediaLibrary.copied : v.value.mediaLibrary.copyUrl), 1)], 4)) : D("", !0), V.value ? (e(), h("div", Gn, [m("button", {
2603
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2604
+ style: {
2605
+ "border-color": "var(--tpl-border)",
2606
+ color: "var(--tpl-text)",
2607
+ "background-color": "var(--tpl-bg)"
2608
+ },
2609
+ onClick: a[12] ||= (e) => p(N).showMovePicker.value = !p(N).showMovePicker.value
2610
+ }, b(v.value.mediaLibrary.moveSelected), 1), p(N).showMovePicker.value ? (e(), S(Dt, {
2611
+ key: 0,
2612
+ folders: p(N).folderTree.value,
2613
+ "current-folder-id": p(j).currentFolderId.value,
2614
+ onSelect: p(N).handleMoveToFolder,
2615
+ onClose: a[13] ||= (e) => p(N).showMovePicker.value = !1
2616
+ }, null, 8, [
2617
+ "folders",
2618
+ "current-folder-id",
2619
+ "onSelect"
2620
+ ])) : D("", !0)])) : D("", !0)])) : D("", !0), m("div", Kn, [oe.value > 0 ? (e(), h("button", {
2621
+ key: 0,
2622
+ "data-testid": "media-delete",
2623
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2624
+ style: {
2625
+ "border-color": "var(--tpl-danger)",
2626
+ color: "var(--tpl-danger)",
2627
+ "background-color": "var(--tpl-bg)"
2628
+ },
2629
+ onClick: X
2630
+ }, b(v.value.mediaLibrary.deleteSelected), 1)) : D("", !0), i.showConfirm ? (e(), h("button", {
2631
+ key: 1,
2632
+ "data-testid": w.value,
2633
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:px-4 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-primary-hover)] tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
2634
+ style: {
2635
+ "background-color": "var(--tpl-primary)",
2636
+ color: "var(--tpl-on-primary)"
2637
+ },
2638
+ disabled: !ae.value,
2639
+ onClick: J
2640
+ }, b(i.accept?.length ? v.value.mediaLibrary.selectImage : v.value.mediaLibrary.selectFile), 9, qn)) : D("", !0)])])])
2641
+ ]));
2642
+ }
2643
+ }), Yn = /* #__PURE__ */ Object.assign({
2644
+ "./locales/ca.ts": () => import("./ca-BTf1Zbqb.js"),
2645
+ "./locales/de.ts": () => import("./de-xzrh9PA3.js"),
2646
+ "./locales/en.ts": () => import("./en-CM5fTFSo.js"),
2647
+ "./locales/es.ts": () => import("./es-BT4LSpE2.js"),
2648
+ "./locales/fr.ts": () => import("./fr-CI7OJoql.js"),
2649
+ "./locales/nl.ts": () => import("./nl-D8y5OWGB.js"),
2650
+ "./locales/pt-BR.ts": () => import("./pt-BR-DMCbUBvJ.js")
2651
+ });
2652
+ function Xn(e) {
2653
+ return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
2654
+ }
2655
+ var Zn = Xn(Yn);
2656
+ function Qn(e) {
2657
+ return e.trim().replace(/_/g, "-").toLowerCase();
2658
+ }
2659
+ function $n(e) {
2660
+ let t = Qn(e);
2661
+ return Zn.find((e) => Qn(e) === t);
2662
+ }
2663
+ function er(e) {
2664
+ return Qn(e).split("-")[0];
2665
+ }
2666
+ function tr(e) {
2667
+ return $n(e) ?? $n(er(e)) ?? "en";
2668
+ }
2669
+ async function nr(e) {
2670
+ let t = Yn[`./locales/${tr(e)}.ts`];
2671
+ return (await t()).default;
2672
+ }
2673
+ //#endregion
2674
+ //#region ../media-library/src/components/MediaLibraryModal.vue?vue&type=script&setup=true&lang.ts
2675
+ var rr = ["data-tpl-theme"], ir = /* @__PURE__ */ O({
2676
+ __name: "MediaLibraryModal",
2677
+ props: {
2678
+ visible: { type: Boolean },
2679
+ provider: {},
2680
+ accept: {},
2681
+ popoverTarget: {},
2682
+ locale: {},
2683
+ uiTheme: {},
2684
+ templateId: {},
2685
+ onError: { type: Function }
2686
+ },
2687
+ emits: ["close", "select"],
2688
+ setup(t, { emit: r }) {
2689
+ let i = t, a = r, o = d(null);
2690
+ c(() => i.locale, async (e) => {
2691
+ o.value = await nr(e ?? "en");
2692
+ }, { immediate: !0 }), y(de, o);
2693
+ let s = T(() => i.uiTheme);
2694
+ y(Z, s);
2695
+ let l = E(() => i.popoverTarget ?? null);
2696
+ y(X, l), y(fe, E(() => i.locale));
2697
+ let u = d(null), f = d(null);
2698
+ ge(u, T(() => i.visible && o.value !== null && !f.value?.nestedDialogOpen));
2699
+ function p(e) {
2700
+ if (e.key === "Escape") {
2701
+ if (f.value?.handleEscape()) {
2702
+ e.preventDefault();
2703
+ return;
2704
+ }
2705
+ a("close");
2706
+ }
2707
+ }
2708
+ P(document, "keydown", p);
2709
+ function _(e) {
2710
+ a("select", e), a("close");
2711
+ }
2712
+ return (r, i) => (e(), S(v, { to: t.popoverTarget || "body" }, [g(M, {
2713
+ "enter-active-class": "tpl:transition tpl:duration-200",
2714
+ "enter-from-class": "tpl:opacity-0",
2715
+ "enter-to-class": "tpl:opacity-100",
2716
+ "leave-active-class": "tpl:transition tpl:duration-150",
2717
+ "leave-from-class": "tpl:opacity-100",
2718
+ "leave-to-class": "tpl:opacity-0"
2719
+ }, {
2720
+ default: n(() => [t.visible && o.value ? (e(), h("div", {
2721
+ key: 0,
2722
+ "data-testid": "media-library-modal",
2723
+ "data-tpl-theme": s.value,
2724
+ class: x([t.popoverTarget ? void 0 : "tpl", "tpl-media-overlay tpl:fixed tpl:inset-0 tpl:z-10 tpl:flex tpl:items-center tpl:justify-center tpl:p-4"]),
2725
+ style: {
2726
+ "background-color": "var(--tpl-overlay)",
2727
+ "backdrop-filter": "blur(8px)",
2728
+ "-webkit-backdrop-filter": "blur(8px)"
2729
+ },
2730
+ onClick: i[1] ||= A((e) => a("close"), ["self"])
2731
+ }, [m("div", {
2732
+ ref_key: "dialogRef",
2733
+ ref: u,
2734
+ role: "dialog",
2735
+ "aria-modal": "true",
2736
+ "aria-labelledby": "tpl-media-library-title",
2737
+ "data-testid": "media-library-dialog",
2738
+ class: "tpl-media-modal tpl-scale-in tpl:flex tpl:flex-col tpl:overflow-hidden tpl:rounded-[var(--tpl-radius-lg)]",
2739
+ style: {
2740
+ width: "900px",
2741
+ height: "650px",
2742
+ "max-width": "100%",
2743
+ "max-height": "90%",
2744
+ "background-color": "var(--tpl-bg-elevated)",
2745
+ border: "1px solid var(--tpl-border)",
2746
+ "box-shadow": "var(--tpl-shadow-xl)"
2747
+ }
2748
+ }, [g(Jn, {
2749
+ ref_key: "chromeRef",
2750
+ ref: f,
2751
+ provider: t.provider,
2752
+ accept: t.accept,
2753
+ "template-id": t.templateId,
2754
+ "on-error": t.onError,
2755
+ translations: o.value,
2756
+ "show-close": "",
2757
+ "show-confirm": "",
2758
+ "confirm-test-id": "media-confirm",
2759
+ onClose: i[0] ||= (e) => a("close"),
2760
+ onConfirm: _
2761
+ }, null, 8, [
2762
+ "provider",
2763
+ "accept",
2764
+ "template-id",
2765
+ "on-error",
2766
+ "translations"
2767
+ ])], 512)], 10, rr)) : D("", !0)]),
2768
+ _: 1
2769
+ })], 8, ["to"]));
2770
+ }
2771
+ });
2772
+ //#endregion
2773
+ export { ir as MediaLibraryModal, X as a, pe as i, $ as n, Z as o, Q as r, ge as t };