ghost 6.24.0 → 6.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/components/tryghost-i18n-6.25.1.tgz +0 -0
  2. package/components/tryghost-parse-email-address-6.25.1.tgz +0 -0
  3. package/core/boot.js +3 -1
  4. package/core/built/admin/assets/{PolarAngleAxis-7TlIQL3R.js → PolarAngleAxis-C6ZeSpZB.js} +1 -1
  5. package/core/built/admin/assets/{_baseAssignValue-DJsCJz6y.js → _baseAssignValue-BKAl5FrV.js} +1 -1
  6. package/core/built/admin/assets/{a-large-small-BnBpzYwl.js → a-large-small-B_ulQCIs.js} +1 -1
  7. package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +1 -1
  8. package/core/built/admin/assets/admin-x-settings/{code-editor-view-De3K_osj.mjs → code-editor-view-CBYT1gA1.mjs} +2 -2
  9. package/core/built/admin/assets/admin-x-settings/{index-bGxDzD13.mjs → index-CN5CixaU.mjs} +2 -2
  10. package/core/built/admin/assets/admin-x-settings/{index-5D8KqsFU.mjs → index-CPQODntW.mjs} +2 -2
  11. package/core/built/admin/assets/admin-x-settings/{index-BIUDn7ot.mjs → index-CgTfOd7g.mjs} +9 -9
  12. package/core/built/admin/assets/admin-x-settings/{modals-DuokUyAH.mjs → modals-_y-6HROx.mjs} +2 -2
  13. package/core/built/admin/assets/{at-sign-DC4NtDDM.js → at-sign-B8xWKM0y.js} +1 -1
  14. package/core/built/admin/assets/{audience-CC5U4UxI.js → audience-CBOR--z9.js} +1 -1
  15. package/core/built/admin/assets/{avatar-flipboard-_GQfQXQc.js → avatar-flipboard-IipGb_wZ.js} +1 -1
  16. package/core/built/admin/assets/{bluesky-sharing-BKyzPl9y.js → bluesky-sharing-CkI1QuAm.js} +1 -1
  17. package/core/built/admin/assets/{chart-BCQFlmhJ.js → chart-_slUcr-K.js} +1 -1
  18. package/core/built/admin/assets/{chunk.423.dae9a3bbe7845c3a3cfc.js → chunk.434.de8a15730373eccfeefe.js} +13 -101
  19. package/core/built/admin/assets/{chunk.524.b5e454aa74df4428420c.js → chunk.524.5b9b463506a16221fc91.js} +6 -6
  20. package/core/built/admin/assets/{chunk.582.20635869be68725e6d5c.js → chunk.582.d8eae1661d753befaefd.js} +7 -7
  21. package/core/built/admin/assets/{chunk.123.1255d9e815f933dfdc57.js → chunk.630.3dbb0231a2d871126a80.js} +8 -6
  22. package/core/built/admin/assets/{code-editor-view-BXnjo7qe.js → code-editor-view-BWMqr2JV.js} +1 -1
  23. package/core/built/admin/assets/comments-BeoA0nfK.js +1 -0
  24. package/core/built/admin/assets/{content-helpers-CQXipRWa.js → content-helpers-CmTGdEmL.js} +1 -1
  25. package/core/built/admin/assets/{copy-B-MxRWPu.js → copy-CDHcAPJw.js} +1 -1
  26. package/core/built/admin/assets/{data-list-B2sqn7IE.js → data-list-Crb1ffbp.js} +1 -1
  27. package/core/built/admin/assets/{deleted-feed-item-DQi676Dy.js → deleted-feed-item-DBW0zJQg.js} +1 -1
  28. package/core/built/admin/assets/{dropzone-GgOCfK2j.js → dropzone-B9JUsQlW.js} +3 -3
  29. package/core/built/admin/assets/{edit-profile-COx5FmF9.js → edit-profile-Dz-IhetN.js} +1 -1
  30. package/core/built/admin/assets/{empty-indicator-Bf4Dqk72.js → empty-indicator-2QGnEbtY.js} +1 -1
  31. package/core/built/admin/assets/{en-BkI47Ou-.js → en-BRQS1Z8j.js} +1 -1
  32. package/core/built/admin/assets/{feed-Dzc-8jwd.js → feed-T3kW9UJA.js} +1 -1
  33. package/core/built/admin/assets/filters-ChOMQQZW.js +1 -0
  34. package/core/built/admin/assets/{gh-chart-Ch6dYUac.js → gh-chart-fuWw60Ka.js} +1 -1
  35. package/core/built/admin/assets/{ghost-69e448feab2cb78aba64f7177fa4d6f0.js → ghost-78b4a517ac907213ab47708eef33bc6f.js} +423 -542
  36. package/core/built/admin/assets/{growth-BIBJdcm6.js → growth-D9sCnmon.js} +1 -1
  37. package/core/built/admin/assets/{hash-BGd7HEsT.js → hash-CI1pQ1UC.js} +1 -1
  38. package/core/built/admin/assets/header-OevT95FI.js +1 -0
  39. package/core/built/admin/assets/{inbox-CFzKvW3h.js → inbox-DYY8-M1K.js} +1 -1
  40. package/core/built/admin/assets/{index-Dy8dCc8t.js → index-8CZdLQzu.js} +4 -4
  41. package/core/built/admin/assets/{index-DIO8ceib.js → index-BDAOs7pI.js} +1 -1
  42. package/core/built/admin/assets/{index-BZyG96u1.js → index-BEEgMX-_.js} +1 -1
  43. package/core/built/admin/assets/index-BbveDn8H.css +1 -0
  44. package/core/built/admin/assets/{index-BYXKsmpv.js → index-C-Cpbee5.js} +1 -1
  45. package/core/built/admin/assets/{index-DDJAHYHQ.js → index-CCF2RKxR.js} +12 -12
  46. package/core/built/admin/assets/{index-ZuWSQ3L6.js → index-CEnfjH5h.js} +93 -93
  47. package/core/built/admin/assets/{index-_WMp37yL.js → index-CcFVbffG.js} +1 -1
  48. package/core/built/admin/assets/{index-DpZazR71.js → index-CyMlhfZJ.js} +1 -1
  49. package/core/built/admin/assets/{index-DM98UB_U.js → index-DBZYUfjO.js} +1 -1
  50. package/core/built/admin/assets/{index-D0gRP4Gp.js → index-DJa3pLmx.js} +1 -1
  51. package/core/built/admin/assets/{index-n5opb8tL.js → index-DVqmhe-L.js} +1 -1
  52. package/core/built/admin/assets/{index-S2DGJkmz.js → index-DW5aEj6O.js} +2 -2
  53. package/core/built/admin/assets/{index-CvX5YYEz.js → index-DcFgRUSN.js} +1 -1
  54. package/core/built/admin/assets/{index-7NTHsKgE.js → index-DjgsxHeB.js} +1 -1
  55. package/core/built/admin/assets/index-mqQc8MVd.js +1 -0
  56. package/core/built/admin/assets/{index-CsHjDdYB.js → index-qQZsxgFE.js} +1 -1
  57. package/core/built/admin/assets/{koenig-lexical-8qAZ5o1x.js → koenig-lexical-CsbE6fpi.js} +1 -1
  58. package/core/built/admin/assets/kpis-Dw04ruBN.js +1 -0
  59. package/core/built/admin/assets/{label-CofMdj8x.js → label-tBvn89sm.js} +1 -1
  60. package/core/built/admin/assets/{links-MSlYSad1.js → links-Do4jcjIh.js} +1 -1
  61. package/core/built/admin/assets/{loader-circle-CF5G2g_Z.js → loader-circle-C8exRUku.js} +4 -4
  62. package/core/built/admin/assets/{lucide-react-DZiAu6PQ.js → lucide-react-4VO5Dwow.js} +1 -1
  63. package/core/built/admin/assets/{main-layout-DEVUkqt_.js → main-layout-BAqXRgAx.js} +1 -1
  64. package/core/built/admin/assets/{member-route-mLKS-PsA.js → member-route-D4n-RbQd.js} +1 -1
  65. package/core/built/admin/assets/members-DRLgwCgJ.js +15 -0
  66. package/core/built/admin/assets/{message-square-text-DESy3kSk.js → message-square-text-CC_1bY-Q.js} +5 -5
  67. package/core/built/admin/assets/{minus-DVNwSjD6.js → minus-DSyx9DCe.js} +1 -1
  68. package/core/built/admin/assets/{modals-FYjLOMaQ.js → modals-AryZr_DA.js} +13 -13
  69. package/core/built/admin/assets/{moderation-u4WS46a-.js → moderation-DwKm9LO-.js} +1 -1
  70. package/core/built/admin/assets/{newsletter-Cj0UCg4J.js → newsletter-C0rydPGS.js} +1 -1
  71. package/core/built/admin/assets/{newsletters-_UvhdBE3.js → newsletters-DKdmxfDG.js} +1 -1
  72. package/core/built/admin/assets/{note-CRnFryTp.js → note-996Zos9G.js} +1 -1
  73. package/core/built/admin/assets/{overview-Cr0dGxEU.js → overview-r17hlWAB.js} +1 -1
  74. package/core/built/admin/assets/{pagemenu-BqoDENpI.js → pagemenu-DzpB1AkZ.js} +17 -17
  75. package/core/built/admin/assets/{post-analytics-DIr_rDtL.js → post-analytics-AwufPVFE.js} +1 -1
  76. package/core/built/admin/assets/{post-analytics-context-WA--pwK5.js → post-analytics-context-GFe0lMc-.js} +1 -1
  77. package/core/built/admin/assets/{post-analytics-header-D97SoEaV.js → post-analytics-header-DmGyNvP9.js} +1 -1
  78. package/core/built/admin/assets/{post-share-modal-DBxR7WCX.js → post-share-modal-CTpdCS2X.js} +1 -1
  79. package/core/built/admin/assets/posts/{comments-Bswx2dzs.mjs → comments-Cvt31uBs.mjs} +597 -674
  80. package/core/built/admin/assets/posts/{dialog-67vvNv8e.mjs → dialog-DaViJlnd.mjs} +3 -3
  81. package/core/built/admin/assets/posts/{dropdown-menu-BKZfsAPJ.mjs → dropdown-menu-B4KGMiRI.mjs} +5 -5
  82. package/core/built/admin/assets/posts/{empty-indicator-DTmBQa_3.mjs → empty-indicator-BaD6pCXM.mjs} +2 -2
  83. package/core/built/admin/assets/posts/filters-BsCI4RJg.mjs +2835 -0
  84. package/core/built/admin/assets/posts/{get-site-timezone-D75cHSJ1.mjs → get-site-timezone-Bo-iI2bI.mjs} +2 -2
  85. package/core/built/admin/assets/posts/{growth-BqJWjpAp.mjs → growth-BJxIDp2o.mjs} +14 -14
  86. package/core/built/admin/assets/posts/header-7zhnErbb.mjs +100 -0
  87. package/core/built/admin/assets/posts/{heading-DXxLDQ96.mjs → heading-BCDx_eVF.mjs} +2 -2
  88. package/core/built/admin/assets/posts/{hooks-pVotzebr.mjs → hooks-DQL2O_El.mjs} +2 -2
  89. package/core/built/admin/assets/posts/{index-DZ1HzbGS.mjs → index-0mEgtljt.mjs} +3 -3
  90. package/core/built/admin/assets/posts/{index-By5yPnMZ.mjs → index-BTzJVQ6S.mjs} +10 -10
  91. package/core/built/admin/assets/posts/{input-DdXe2Fjm.mjs → input-DaHXv92f.mjs} +2 -2
  92. package/core/built/admin/assets/posts/{kpis-1MXZeSC9.mjs → kpis-GRsx6fPV.mjs} +10 -10
  93. package/core/built/admin/assets/posts/{links-DGzzdzsH.mjs → links-B1q_pqE9.mjs} +4 -4
  94. package/core/built/admin/assets/posts/{loading-indicator-CSj2spwS.mjs → loading-indicator-DiYqXomj.mjs} +3 -3
  95. package/core/built/admin/assets/posts/{main-layout-CGs25JVH.mjs → main-layout-DeqPTJTe.mjs} +2 -2
  96. package/core/built/admin/assets/posts/{members-BRcED5fL.mjs → members-LABk5yI5.mjs} +4102 -3442
  97. package/core/built/admin/assets/posts/{newsletter-D706LlgM.mjs → newsletter-C_nbHBaP.mjs} +15 -15
  98. package/core/built/admin/assets/posts/{overview-5dG5ypjx.mjs → overview-AJnKv4Ze.mjs} +16 -16
  99. package/core/built/admin/assets/posts/{post-analytics-wvNuOa4c.mjs → post-analytics-b_CKsePp.mjs} +6 -6
  100. package/core/built/admin/assets/posts/{post-analytics-context-BqnFe05q.mjs → post-analytics-context-D6jtpxxm.mjs} +5 -5
  101. package/core/built/admin/assets/posts/{post-analytics-header-Dsi5l6hb.mjs → post-analytics-header-R5UF_tF0.mjs} +11 -11
  102. package/core/built/admin/assets/posts/{post-share-modal-DWe35McY.mjs → post-share-modal-y4BEOajk.mjs} +4 -4
  103. package/core/built/admin/assets/posts/posts-C2hNrf1c.mjs +37 -0
  104. package/core/built/admin/assets/posts/posts.js +1 -1
  105. package/core/built/admin/assets/posts/{reply-B4vwBMwj.mjs → reply-2Uvi3Kxb.mjs} +2 -2
  106. package/core/built/admin/assets/posts/{search-DQuB1WMm.mjs → search-se7meOnL.mjs} +2 -2
  107. package/core/built/admin/assets/posts/{select-BMPHyOdQ.mjs → select-DpUpauFg.mjs} +8 -8
  108. package/core/built/admin/assets/posts/{separator-DgZ2VF9r.mjs → separator-CdBM46dw.mjs} +3 -3
  109. package/core/built/admin/assets/posts/{settings-D-wnf7Qg.mjs → settings-Chhj9xKP.mjs} +2 -2
  110. package/core/built/admin/assets/posts/{sheet-SOdCzxUt.mjs → sheet--k3SiDko.mjs} +3 -3
  111. package/core/built/admin/assets/posts/{skeleton-Du7JXZ_1.mjs → skeleton-CUSLSLoY.mjs} +3 -3
  112. package/core/built/admin/assets/posts/{source-icon-DcBtKbCl.mjs → source-icon-BjYUIoXN.mjs} +3 -3
  113. package/core/built/admin/assets/posts/{stats-CeLav-Hu.mjs → stats-BRdXKaxM.mjs} +4 -4
  114. package/core/built/admin/assets/posts/{table-DlaJMBps.mjs → table-Bgi_UcfL.mjs} +2 -2
  115. package/core/built/admin/assets/posts/{tabs-BQQbtw2g.mjs → tabs-DT8Bh72E.mjs} +14 -14
  116. package/core/built/admin/assets/posts/tags-BCFLnZYl.mjs +399 -0
  117. package/core/built/admin/assets/posts/{tags-CLyaNf39.mjs → tags-Kv2q0o3p.mjs} +2 -2
  118. package/core/built/admin/assets/posts/use-scroll-restoration-CLAUAal3.mjs +517 -0
  119. package/core/built/admin/assets/posts/{use-infinite-virtual-scroll-B_NwiBXK.mjs → virtual-list-window-CQDEqNBL.mjs} +246 -262
  120. package/core/built/admin/assets/posts/{web-TEVKbXSI.mjs → web-CqN0MQU6.mjs} +18 -18
  121. package/core/built/admin/assets/posts-GvXDuhVG.js +1 -0
  122. package/core/built/admin/assets/{referrers-J4vexZCf.js → referrers-Bd9pW-WX.js} +1 -1
  123. package/core/built/admin/assets/{repeat-BxOK9zhN.js → repeat-y6HlMgGO.js} +2 -2
  124. package/core/built/admin/assets/{reply-BoTN-eE0.js → reply-Cc8ryI5v.js} +2 -2
  125. package/core/built/admin/assets/{select-Bd1zcqox.js → select-CGr_5qad.js} +1 -1
  126. package/core/built/admin/assets/{settings-D72z6T_a.js → settings-BPsfSgg3.js} +1 -1
  127. package/core/built/admin/assets/{settings-BGbGoa4s.js → settings-BTd0Adha.js} +19 -19
  128. package/core/built/admin/assets/{sort-button-BOLTpImz.js → sort-button-k76_5HR2.js} +1 -1
  129. package/core/built/admin/assets/{source-icon-BqEM5MvU.js → source-icon-DMt0UskC.js} +1 -1
  130. package/core/built/admin/assets/{sprout-Bf-wc2Vo.js → sprout-Td9eaOoY.js} +2 -2
  131. package/core/built/admin/assets/{square-Cj_bJ0HZ.js → square-Df8vEYlG.js} +1 -1
  132. package/core/built/admin/assets/stats/{audience-BiHYBUzT.mjs → audience-DMTObpL8.mjs} +3 -3
  133. package/core/built/admin/assets/stats/{content-helpers-CIXZiyCm.mjs → content-helpers-ReMp9KJN.mjs} +4 -4
  134. package/core/built/admin/assets/stats/{index-CkKk-p14.mjs → index-6L-yLKFX.mjs} +8 -8
  135. package/core/built/admin/assets/stats/{index-DBB8Oih1.mjs → index-CIUyjeP-.mjs} +5 -5
  136. package/core/built/admin/assets/stats/{index-9zQR4gr0.mjs → index-CMSDpQm3.mjs} +3626 -3513
  137. package/core/built/admin/assets/stats/{index-DErXBfDM.mjs → index-Ca-_KJzy.mjs} +5 -5
  138. package/core/built/admin/assets/stats/{index-DMSmQLxG.mjs → index-CfO5yPSP.mjs} +5 -5
  139. package/core/built/admin/assets/stats/{sort-button-BqY7GFaO.mjs → sort-button-BB_M2CdZ.mjs} +3 -3
  140. package/core/built/admin/assets/stats/{stats-BeJgKX2G.mjs → stats-B2nnuLeU.mjs} +4 -4
  141. package/core/built/admin/assets/stats/stats.js +1 -1
  142. package/core/built/admin/assets/stats/{tabs-CPz357mW.mjs → tabs-DjJG-d3O.mjs} +3 -3
  143. package/core/built/admin/assets/stats/{use-growth-stats-WMYXBQE3.mjs → use-growth-stats-BMT5M7l6.mjs} +3 -3
  144. package/core/built/admin/assets/{stats-DWpHtRym.js → stats-Bs9ZbmXX.js} +1 -1
  145. package/core/built/admin/assets/stats-view-BWoPuaLz.js +1 -0
  146. package/core/built/admin/assets/{step-1-Bjya9Gt0.js → step-1-BUvsuCs0.js} +1 -1
  147. package/core/built/admin/assets/{step-2-CJ6I8JNc.js → step-2-DI9ekXls.js} +1 -1
  148. package/core/built/admin/assets/{step-3-3fs6Y2Kj.js → step-3-DzT_XhaS.js} +2 -2
  149. package/core/built/admin/assets/{table-B4zlzEDP.js → table-BKqaEGAm.js} +1 -1
  150. package/core/built/admin/assets/{tabs-mR5oJGm5.js → tabs-G6Ql8vbf.js} +1 -1
  151. package/core/built/admin/assets/tags-BHm-dlBs.js +1 -0
  152. package/core/built/admin/assets/{tags-CsgMtkFL.js → tags-_taMP0sJ.js} +1 -1
  153. package/core/built/admin/assets/{textarea-CQjEvapR.js → textarea-DcVuGYYq.js} +1 -1
  154. package/core/built/admin/assets/{tiers-CQE0v797.js → tiers-kv-xBoqQ.js} +1 -1
  155. package/core/built/admin/assets/{toggle-group-CR-Z-bJL.js → toggle-group-DsatLdt7.js} +1 -1
  156. package/core/built/admin/assets/{topic-filter-_NyD55eH.js → topic-filter-DkJyIuAf.js} +1 -1
  157. package/core/built/admin/assets/{trash-BFSLkv0z.js → trash-BeZZgbn-.js} +1 -1
  158. package/core/built/admin/assets/{upload-BTxT4v2z.js → upload-BG7KNIn7.js} +4 -4
  159. package/core/built/admin/assets/{use-growth-stats-BGymNu5O.js → use-growth-stats-CNGdl44N.js} +1 -1
  160. package/core/built/admin/assets/use-scroll-restoration-CQ3w0W98.js +1 -0
  161. package/core/built/admin/assets/{use-simple-pagination-Cq7Afp_c.js → use-simple-pagination-BeIJ_5Vv.js} +1 -1
  162. package/core/built/admin/assets/{user-plus-DMl69yKl.js → user-plus-CMxR50-Y.js} +1 -1
  163. package/core/built/admin/assets/{user-round-check-CVuZXUPz.js → user-round-check-2nhPmqP3.js} +1 -1
  164. package/core/built/admin/assets/virtual-list-window-Uq8oKYVG.js +4 -0
  165. package/core/built/admin/assets/{wallet-cards-zHR_y6Sp.js → wallet-cards-CJcVzH0D.js} +1 -1
  166. package/core/built/admin/assets/{web-CmFHgeQw.js → web-BPwTFKrc.js} +1 -1
  167. package/core/built/admin/index.html +7 -7
  168. package/core/frontend/helpers/ghost_head.js +1 -4
  169. package/core/server/data/migrations/versions/6.25/2026-03-26-15-47-00-insert-default-email-design-settings-row.js +42 -0
  170. package/core/server/data/migrations/versions/6.25/2026-03-30-20-22-25-add-email-design-setting-permissions.js +44 -0
  171. package/core/server/data/migrations/versions/6.25/2026-03-30-22-16-43-add-email-design-setting-id-to-automated-emails.js +8 -0
  172. package/core/server/data/migrations/versions/6.25/2026-03-31-13-12-10-backfill-automated-emails-email-design-setting-id.js +45 -0
  173. package/core/server/data/migrations/versions/6.25/2026-03-31-20-31-19-drop-nullable-on-automated-emails-email-design-setting-id.js +3 -0
  174. package/core/server/data/schema/fixtures/fixtures.json +35 -0
  175. package/core/server/data/schema/schema.js +1 -0
  176. package/core/server/data/seeders/importers/comment-reports-importer.js +1 -3
  177. package/core/server/data/seeders/importers/comments-importer.js +3 -2
  178. package/core/server/data/seeders/importers/email-batches-importer.js +3 -3
  179. package/core/server/data/seeders/importers/email-recipients-importer.js +6 -6
  180. package/core/server/data/seeders/importers/emails-importer.js +4 -3
  181. package/core/server/data/seeders/importers/members-click-events-importer.js +1 -1
  182. package/core/server/data/seeders/importers/members-created-events-importer.js +2 -1
  183. package/core/server/data/seeders/importers/members-feedback-importer.js +3 -4
  184. package/core/server/data/seeders/importers/members-login-events-importer.js +3 -2
  185. package/core/server/data/seeders/importers/members-status-events-importer.js +1 -2
  186. package/core/server/data/seeders/importers/members-stripe-customers-importer.js +2 -1
  187. package/core/server/data/seeders/importers/members-stripe-customers-subscriptions-importer.js +4 -2
  188. package/core/server/data/seeders/importers/members-subscribe-events-importer.js +1 -2
  189. package/core/server/data/seeders/importers/members-subscription-created-events-importer.js +3 -1
  190. package/core/server/data/seeders/importers/offer-redemptions-importer.js +3 -3
  191. package/core/server/data/seeders/utils/database-date.js +26 -1
  192. package/core/server/models/automated-email.js +27 -0
  193. package/core/server/models/email-design-setting.js +27 -0
  194. package/core/server/services/members/service.js +0 -22
  195. package/core/server/services/stripe/service.js +1 -2
  196. package/core/server/services/verification/verification-webhook-service.js +2 -2
  197. package/core/server/services/verification/verification-webhook-service.ts +2 -2
  198. package/core/server/services/verification-trigger.js +34 -69
  199. package/core/server/services/webhooks/webhook-trigger.js +1 -1
  200. package/core/shared/labs.js +2 -2
  201. package/package.json +10 -28
  202. package/tsconfig.tsbuildinfo +1 -1
  203. package/yarn.lock +423 -107
  204. package/components/tryghost-i18n-6.24.0.tgz +0 -0
  205. package/components/tryghost-parse-email-address-6.24.0.tgz +0 -0
  206. package/core/built/admin/assets/comments-CteqV7ZN.js +0 -1
  207. package/core/built/admin/assets/filters-DXXaCya7.js +0 -1
  208. package/core/built/admin/assets/index-QB-va_sk.css +0 -1
  209. package/core/built/admin/assets/index-nBUk6L1X.js +0 -1
  210. package/core/built/admin/assets/kpis-Cv75oSPY.js +0 -1
  211. package/core/built/admin/assets/members-DcElgZ2t.js +0 -15
  212. package/core/built/admin/assets/posts/filters-Ds_ZaYIU.mjs +0 -2722
  213. package/core/built/admin/assets/posts/posts-DI5YQFp4.mjs +0 -17
  214. package/core/built/admin/assets/posts/tags-CjwolIiT.mjs +0 -395
  215. package/core/built/admin/assets/posts/use-scroll-restoration-YSR5jwQl.mjs +0 -232
  216. package/core/built/admin/assets/posts-CJHEP4C-.js +0 -1
  217. package/core/built/admin/assets/stats-view-CcyaLPwj.js +0 -1
  218. package/core/built/admin/assets/tags-DEFC6GpD.js +0 -1
  219. package/core/built/admin/assets/use-infinite-virtual-scroll-CNqGwgHd.js +0 -4
  220. package/core/built/admin/assets/use-scroll-restoration-BWtb0NrS.js +0 -1
  221. package/core/shared/config/env/config.testing-browser.json +0 -98
  222. /package/core/built/admin/assets/{chunk.423.dae9a3bbe7845c3a3cfc.js.LICENSE.txt → chunk.434.de8a15730373eccfeefe.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2835 @@
1
+ import { q as z, a as U, D as T, u as H, j as n, b as V, o as M, E as wr, F as _e, G as ke, H as rt, J as jr, U as Cr, v as D, B as $e, A as Le, a4 as Nr, n as I, W as Ct, T as Y } from "./index-BTzJVQ6S.mjs";
2
+ import { P as De, q as Nt, t as Pt, r as Pr, s as Sr, u as _r, F as kr, R as Er, b as Tr, O as Ar, d as Fr, C as xe, X as St } from "./dialog-DaViJlnd.mjs";
3
+ import { h as je, b as nt, d as at, P as Ce, f as G, e as ae, i as Ir, m as Or, c as ge } from "./heading-BCDx_eVF.mjs";
4
+ import { S as zr, P as Rr, b as $r, L as Xe } from "./search-se7meOnL.mjs";
5
+ import { u as Lr, g as Ve, R as _t, A as st, h as kt, i as Et, D as Dr, a as Vr, b as Mr, c as Hr } from "./dropdown-menu-B4KGMiRI.mjs";
6
+ function qr(e) {
7
+ const r = z({ value: e, previous: e });
8
+ return U(() => (r.current.value !== e && (r.current.previous = r.current.value, r.current.value = e), r.current.previous), [e]);
9
+ }
10
+ var Me = "Switch", [Br] = at(Me), [Wr, Kr] = Br(Me), Tt = T(
11
+ (e, r) => {
12
+ const {
13
+ __scopeSwitch: t,
14
+ name: s,
15
+ checked: a,
16
+ defaultChecked: o,
17
+ required: i,
18
+ disabled: c,
19
+ value: u = "on",
20
+ onCheckedChange: d,
21
+ form: l,
22
+ ...f
23
+ } = e, [x, g] = H(null), m = je(r, (O) => g(O)), y = z(!1), b = x ? l || !!x.closest("form") : !0, [j, S] = nt({
24
+ prop: a,
25
+ defaultProp: o ?? !1,
26
+ onChange: d,
27
+ caller: Me
28
+ });
29
+ return /* @__PURE__ */ n.jsxs(Wr, { scope: t, checked: j, disabled: c, children: [
30
+ /* @__PURE__ */ n.jsx(
31
+ Ce.button,
32
+ {
33
+ type: "button",
34
+ role: "switch",
35
+ "aria-checked": j,
36
+ "aria-required": i,
37
+ "data-state": Ot(j),
38
+ "data-disabled": c ? "" : void 0,
39
+ disabled: c,
40
+ value: u,
41
+ ...f,
42
+ ref: m,
43
+ onClick: G(e.onClick, (O) => {
44
+ S((A) => !A), b && (y.current = O.isPropagationStopped(), y.current || O.stopPropagation());
45
+ })
46
+ }
47
+ ),
48
+ b && /* @__PURE__ */ n.jsx(
49
+ It,
50
+ {
51
+ control: x,
52
+ bubbles: !y.current,
53
+ name: s,
54
+ value: u,
55
+ checked: j,
56
+ required: i,
57
+ disabled: c,
58
+ form: l,
59
+ style: { transform: "translateX(-100%)" }
60
+ }
61
+ )
62
+ ] });
63
+ }
64
+ );
65
+ Tt.displayName = Me;
66
+ var At = "SwitchThumb", Ft = T(
67
+ (e, r) => {
68
+ const { __scopeSwitch: t, ...s } = e, a = Kr(At, t);
69
+ return /* @__PURE__ */ n.jsx(
70
+ Ce.span,
71
+ {
72
+ "data-state": Ot(a.checked),
73
+ "data-disabled": a.disabled ? "" : void 0,
74
+ ...s,
75
+ ref: r
76
+ }
77
+ );
78
+ }
79
+ );
80
+ Ft.displayName = At;
81
+ var Ur = "SwitchBubbleInput", It = T(
82
+ ({
83
+ __scopeSwitch: e,
84
+ control: r,
85
+ checked: t,
86
+ bubbles: s = !0,
87
+ ...a
88
+ }, o) => {
89
+ const i = z(null), c = je(i, o), u = qr(t), d = Lr(r);
90
+ return V(() => {
91
+ const l = i.current;
92
+ if (!l) return;
93
+ const f = window.HTMLInputElement.prototype, g = Object.getOwnPropertyDescriptor(
94
+ f,
95
+ "checked"
96
+ ).set;
97
+ if (u !== t && g) {
98
+ const m = new Event("click", { bubbles: s });
99
+ g.call(l, t), l.dispatchEvent(m);
100
+ }
101
+ }, [u, t, s]), /* @__PURE__ */ n.jsx(
102
+ "input",
103
+ {
104
+ type: "checkbox",
105
+ "aria-hidden": !0,
106
+ defaultChecked: t,
107
+ ...a,
108
+ tabIndex: -1,
109
+ ref: c,
110
+ style: {
111
+ ...a.style,
112
+ ...d,
113
+ position: "absolute",
114
+ pointerEvents: "none",
115
+ opacity: 0,
116
+ margin: 0
117
+ }
118
+ }
119
+ );
120
+ }
121
+ );
122
+ It.displayName = Ur;
123
+ function Ot(e) {
124
+ return e ? "checked" : "unchecked";
125
+ }
126
+ var zt = Tt, Gr = Ft, Yr = Object.freeze({
127
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
128
+ position: "absolute",
129
+ border: 0,
130
+ width: 1,
131
+ height: 1,
132
+ padding: 0,
133
+ margin: -1,
134
+ overflow: "hidden",
135
+ clip: "rect(0, 0, 0, 0)",
136
+ whiteSpace: "nowrap",
137
+ wordWrap: "normal"
138
+ }), Xr = "VisuallyHidden", Rt = T(
139
+ (e, r) => /* @__PURE__ */ n.jsx(
140
+ Ce.span,
141
+ {
142
+ ...e,
143
+ ref: r,
144
+ style: { ...Yr, ...e.style }
145
+ }
146
+ )
147
+ );
148
+ Rt.displayName = Xr;
149
+ var Zr = Rt, [He] = at("Tooltip", [
150
+ Ve
151
+ ]), qe = Ve(), $t = "TooltipProvider", Jr = 700, Ze = "tooltip.open", [Qr, ot] = He($t), Lt = (e) => {
152
+ const {
153
+ __scopeTooltip: r,
154
+ delayDuration: t = Jr,
155
+ skipDelayDuration: s = 300,
156
+ disableHoverableContent: a = !1,
157
+ children: o
158
+ } = e, i = z(!0), c = z(!1), u = z(0);
159
+ return V(() => {
160
+ const d = u.current;
161
+ return () => window.clearTimeout(d);
162
+ }, []), /* @__PURE__ */ n.jsx(
163
+ Qr,
164
+ {
165
+ scope: r,
166
+ isOpenDelayedRef: i,
167
+ delayDuration: t,
168
+ onOpen: M(() => {
169
+ window.clearTimeout(u.current), i.current = !1;
170
+ }, []),
171
+ onClose: M(() => {
172
+ window.clearTimeout(u.current), u.current = window.setTimeout(
173
+ () => i.current = !0,
174
+ s
175
+ );
176
+ }, [s]),
177
+ isPointerInTransitRef: c,
178
+ onPointerInTransitChange: M((d) => {
179
+ c.current = d;
180
+ }, []),
181
+ disableHoverableContent: a,
182
+ children: o
183
+ }
184
+ );
185
+ };
186
+ Lt.displayName = $t;
187
+ var Ee = "Tooltip", [en, Te] = He(Ee), Dt = (e) => {
188
+ const {
189
+ __scopeTooltip: r,
190
+ children: t,
191
+ open: s,
192
+ defaultOpen: a,
193
+ onOpenChange: o,
194
+ disableHoverableContent: i,
195
+ delayDuration: c
196
+ } = e, u = ot(Ee, e.__scopeTooltip), d = qe(r), [l, f] = H(null), x = ae(), g = z(0), m = i ?? u.disableHoverableContent, y = c ?? u.delayDuration, b = z(!1), [j, S] = nt({
197
+ prop: s,
198
+ defaultProp: a ?? !1,
199
+ onChange: (L) => {
200
+ L ? (u.onOpen(), document.dispatchEvent(new CustomEvent(Ze))) : u.onClose(), o == null || o(L);
201
+ },
202
+ caller: Ee
203
+ }), O = U(() => j ? b.current ? "delayed-open" : "instant-open" : "closed", [j]), A = M(() => {
204
+ window.clearTimeout(g.current), g.current = 0, b.current = !1, S(!0);
205
+ }, [S]), $ = M(() => {
206
+ window.clearTimeout(g.current), g.current = 0, S(!1);
207
+ }, [S]), C = M(() => {
208
+ window.clearTimeout(g.current), g.current = window.setTimeout(() => {
209
+ b.current = !0, S(!0), g.current = 0;
210
+ }, y);
211
+ }, [y, S]);
212
+ return V(() => () => {
213
+ g.current && (window.clearTimeout(g.current), g.current = 0);
214
+ }, []), /* @__PURE__ */ n.jsx(_t, { ...d, children: /* @__PURE__ */ n.jsx(
215
+ en,
216
+ {
217
+ scope: r,
218
+ contentId: x,
219
+ open: j,
220
+ stateAttribute: O,
221
+ trigger: l,
222
+ onTriggerChange: f,
223
+ onTriggerEnter: M(() => {
224
+ u.isOpenDelayedRef.current ? C() : A();
225
+ }, [u.isOpenDelayedRef, C, A]),
226
+ onTriggerLeave: M(() => {
227
+ m ? $() : (window.clearTimeout(g.current), g.current = 0);
228
+ }, [$, m]),
229
+ onOpen: A,
230
+ onClose: $,
231
+ disableHoverableContent: m,
232
+ children: t
233
+ }
234
+ ) });
235
+ };
236
+ Dt.displayName = Ee;
237
+ var Je = "TooltipTrigger", Vt = T(
238
+ (e, r) => {
239
+ const { __scopeTooltip: t, ...s } = e, a = Te(Je, t), o = ot(Je, t), i = qe(t), c = z(null), u = je(r, c, a.onTriggerChange), d = z(!1), l = z(!1), f = M(() => d.current = !1, []);
240
+ return V(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ n.jsx(st, { asChild: !0, ...i, children: /* @__PURE__ */ n.jsx(
241
+ Ce.button,
242
+ {
243
+ "aria-describedby": a.open ? a.contentId : void 0,
244
+ "data-state": a.stateAttribute,
245
+ ...s,
246
+ ref: u,
247
+ onPointerMove: G(e.onPointerMove, (x) => {
248
+ x.pointerType !== "touch" && !l.current && !o.isPointerInTransitRef.current && (a.onTriggerEnter(), l.current = !0);
249
+ }),
250
+ onPointerLeave: G(e.onPointerLeave, () => {
251
+ a.onTriggerLeave(), l.current = !1;
252
+ }),
253
+ onPointerDown: G(e.onPointerDown, () => {
254
+ a.open && a.onClose(), d.current = !0, document.addEventListener("pointerup", f, { once: !0 });
255
+ }),
256
+ onFocus: G(e.onFocus, () => {
257
+ d.current || a.onOpen();
258
+ }),
259
+ onBlur: G(e.onBlur, a.onClose),
260
+ onClick: G(e.onClick, a.onClose)
261
+ }
262
+ ) });
263
+ }
264
+ );
265
+ Vt.displayName = Je;
266
+ var lt = "TooltipPortal", [tn, rn] = He(lt, {
267
+ forceMount: void 0
268
+ }), Mt = (e) => {
269
+ const { __scopeTooltip: r, forceMount: t, children: s, container: a } = e, o = Te(lt, r);
270
+ return /* @__PURE__ */ n.jsx(tn, { scope: r, forceMount: t, children: /* @__PURE__ */ n.jsx(De, { present: t || o.open, children: /* @__PURE__ */ n.jsx(Nt, { asChild: !0, container: a, children: s }) }) });
271
+ };
272
+ Mt.displayName = lt;
273
+ var be = "TooltipContent", Ht = T(
274
+ (e, r) => {
275
+ const t = rn(be, e.__scopeTooltip), { forceMount: s = t.forceMount, side: a = "top", ...o } = e, i = Te(be, e.__scopeTooltip);
276
+ return /* @__PURE__ */ n.jsx(De, { present: s || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ n.jsx(qt, { side: a, ...o, ref: r }) : /* @__PURE__ */ n.jsx(nn, { side: a, ...o, ref: r }) });
277
+ }
278
+ ), nn = T((e, r) => {
279
+ const t = Te(be, e.__scopeTooltip), s = ot(be, e.__scopeTooltip), a = z(null), o = je(r, a), [i, c] = H(null), { trigger: u, onClose: d } = t, l = a.current, { onPointerInTransitChange: f } = s, x = M(() => {
280
+ c(null), f(!1);
281
+ }, [f]), g = M(
282
+ (m, y) => {
283
+ const b = m.currentTarget, j = { x: m.clientX, y: m.clientY }, S = cn(j, b.getBoundingClientRect()), O = un(j, S), A = dn(y.getBoundingClientRect()), $ = mn([...O, ...A]);
284
+ c($), f(!0);
285
+ },
286
+ [f]
287
+ );
288
+ return V(() => () => x(), [x]), V(() => {
289
+ if (u && l) {
290
+ const m = (b) => g(b, l), y = (b) => g(b, u);
291
+ return u.addEventListener("pointerleave", m), l.addEventListener("pointerleave", y), () => {
292
+ u.removeEventListener("pointerleave", m), l.removeEventListener("pointerleave", y);
293
+ };
294
+ }
295
+ }, [u, l, g, x]), V(() => {
296
+ if (i) {
297
+ const m = (y) => {
298
+ const b = y.target, j = { x: y.clientX, y: y.clientY }, S = (u == null ? void 0 : u.contains(b)) || (l == null ? void 0 : l.contains(b)), O = !pn(j, i);
299
+ S ? x() : O && (x(), d());
300
+ };
301
+ return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
302
+ }
303
+ }, [u, l, i, d, x]), /* @__PURE__ */ n.jsx(qt, { ...e, ref: o });
304
+ }), [an, sn] = He(Ee, { isInside: !1 }), on = Ir("TooltipContent"), qt = T(
305
+ (e, r) => {
306
+ const {
307
+ __scopeTooltip: t,
308
+ children: s,
309
+ "aria-label": a,
310
+ onEscapeKeyDown: o,
311
+ onPointerDownOutside: i,
312
+ ...c
313
+ } = e, u = Te(be, t), d = qe(t), { onClose: l } = u;
314
+ return V(() => (document.addEventListener(Ze, l), () => document.removeEventListener(Ze, l)), [l]), V(() => {
315
+ if (u.trigger) {
316
+ const f = (x) => {
317
+ const g = x.target;
318
+ g != null && g.contains(u.trigger) && l();
319
+ };
320
+ return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
321
+ }
322
+ }, [u.trigger, l]), /* @__PURE__ */ n.jsx(
323
+ Pt,
324
+ {
325
+ asChild: !0,
326
+ disableOutsidePointerEvents: !1,
327
+ onEscapeKeyDown: o,
328
+ onPointerDownOutside: i,
329
+ onFocusOutside: (f) => f.preventDefault(),
330
+ onDismiss: l,
331
+ children: /* @__PURE__ */ n.jsxs(
332
+ kt,
333
+ {
334
+ "data-state": u.stateAttribute,
335
+ ...d,
336
+ ...c,
337
+ ref: r,
338
+ style: {
339
+ ...c.style,
340
+ "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
341
+ "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
342
+ "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
343
+ "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
344
+ "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
345
+ },
346
+ children: [
347
+ /* @__PURE__ */ n.jsx(on, { children: s }),
348
+ /* @__PURE__ */ n.jsx(an, { scope: t, isInside: !0, children: /* @__PURE__ */ n.jsx(Zr, { id: u.contentId, role: "tooltip", children: a || s }) })
349
+ ]
350
+ }
351
+ )
352
+ }
353
+ );
354
+ }
355
+ );
356
+ Ht.displayName = be;
357
+ var Bt = "TooltipArrow", ln = T(
358
+ (e, r) => {
359
+ const { __scopeTooltip: t, ...s } = e, a = qe(t);
360
+ return sn(
361
+ Bt,
362
+ t
363
+ ).isInside ? null : /* @__PURE__ */ n.jsx(Et, { ...a, ...s, ref: r });
364
+ }
365
+ );
366
+ ln.displayName = Bt;
367
+ function cn(e, r) {
368
+ const t = Math.abs(r.top - e.y), s = Math.abs(r.bottom - e.y), a = Math.abs(r.right - e.x), o = Math.abs(r.left - e.x);
369
+ switch (Math.min(t, s, a, o)) {
370
+ case o:
371
+ return "left";
372
+ case a:
373
+ return "right";
374
+ case t:
375
+ return "top";
376
+ case s:
377
+ return "bottom";
378
+ default:
379
+ throw new Error("unreachable");
380
+ }
381
+ }
382
+ function un(e, r, t = 5) {
383
+ const s = [];
384
+ switch (r) {
385
+ case "top":
386
+ s.push(
387
+ { x: e.x - t, y: e.y + t },
388
+ { x: e.x + t, y: e.y + t }
389
+ );
390
+ break;
391
+ case "bottom":
392
+ s.push(
393
+ { x: e.x - t, y: e.y - t },
394
+ { x: e.x + t, y: e.y - t }
395
+ );
396
+ break;
397
+ case "left":
398
+ s.push(
399
+ { x: e.x + t, y: e.y - t },
400
+ { x: e.x + t, y: e.y + t }
401
+ );
402
+ break;
403
+ case "right":
404
+ s.push(
405
+ { x: e.x - t, y: e.y - t },
406
+ { x: e.x - t, y: e.y + t }
407
+ );
408
+ break;
409
+ }
410
+ return s;
411
+ }
412
+ function dn(e) {
413
+ const { top: r, right: t, bottom: s, left: a } = e;
414
+ return [
415
+ { x: a, y: r },
416
+ { x: t, y: r },
417
+ { x: t, y: s },
418
+ { x: a, y: s }
419
+ ];
420
+ }
421
+ function pn(e, r) {
422
+ const { x: t, y: s } = e;
423
+ let a = !1;
424
+ for (let o = 0, i = r.length - 1; o < r.length; i = o++) {
425
+ const c = r[o], u = r[i], d = c.x, l = c.y, f = u.x, x = u.y;
426
+ l > s != x > s && t < (f - d) * (s - l) / (x - l) + d && (a = !a);
427
+ }
428
+ return a;
429
+ }
430
+ function mn(e) {
431
+ const r = e.slice();
432
+ return r.sort((t, s) => t.x < s.x ? -1 : t.x > s.x ? 1 : t.y < s.y ? -1 : t.y > s.y ? 1 : 0), vn(r);
433
+ }
434
+ function vn(e) {
435
+ if (e.length <= 1) return e.slice();
436
+ const r = [];
437
+ for (let s = 0; s < e.length; s++) {
438
+ const a = e[s];
439
+ for (; r.length >= 2; ) {
440
+ const o = r[r.length - 1], i = r[r.length - 2];
441
+ if ((o.x - i.x) * (a.y - i.y) >= (o.y - i.y) * (a.x - i.x)) r.pop();
442
+ else break;
443
+ }
444
+ r.push(a);
445
+ }
446
+ r.pop();
447
+ const t = [];
448
+ for (let s = e.length - 1; s >= 0; s--) {
449
+ const a = e[s];
450
+ for (; t.length >= 2; ) {
451
+ const o = t[t.length - 1], i = t[t.length - 2];
452
+ if ((o.x - i.x) * (a.y - i.y) >= (o.y - i.y) * (a.x - i.x)) t.pop();
453
+ else break;
454
+ }
455
+ t.push(a);
456
+ }
457
+ return t.pop(), r.length === 1 && t.length === 1 && r[0].x === t[0].x && r[0].y === t[0].y ? r : r.concat(t);
458
+ }
459
+ var hn = Lt, fn = Dt, xn = Vt, gn = Mt, Wt = Ht, Be = "Popover", [Kt] = at(Be, [
460
+ Ve
461
+ ]), Ae = Ve(), [bn, oe] = Kt(Be), Ut = (e) => {
462
+ const {
463
+ __scopePopover: r,
464
+ children: t,
465
+ open: s,
466
+ defaultOpen: a,
467
+ onOpenChange: o,
468
+ modal: i = !1
469
+ } = e, c = Ae(r), u = z(null), [d, l] = H(!1), [f, x] = nt({
470
+ prop: s,
471
+ defaultProp: a ?? !1,
472
+ onChange: o,
473
+ caller: Be
474
+ });
475
+ return /* @__PURE__ */ n.jsx(_t, { ...c, children: /* @__PURE__ */ n.jsx(
476
+ bn,
477
+ {
478
+ scope: r,
479
+ contentId: ae(),
480
+ triggerRef: u,
481
+ open: f,
482
+ onOpenChange: x,
483
+ onOpenToggle: M(() => x((g) => !g), [x]),
484
+ hasCustomAnchor: d,
485
+ onCustomAnchorAdd: M(() => l(!0), []),
486
+ onCustomAnchorRemove: M(() => l(!1), []),
487
+ modal: i,
488
+ children: t
489
+ }
490
+ ) });
491
+ };
492
+ Ut.displayName = Be;
493
+ var Gt = "PopoverAnchor", yn = T(
494
+ (e, r) => {
495
+ const { __scopePopover: t, ...s } = e, a = oe(Gt, t), o = Ae(t), { onCustomAnchorAdd: i, onCustomAnchorRemove: c } = a;
496
+ return V(() => (i(), () => c()), [i, c]), /* @__PURE__ */ n.jsx(st, { ...o, ...s, ref: r });
497
+ }
498
+ );
499
+ yn.displayName = Gt;
500
+ var Yt = "PopoverTrigger", Xt = T(
501
+ (e, r) => {
502
+ const { __scopePopover: t, ...s } = e, a = oe(Yt, t), o = Ae(t), i = je(r, a.triggerRef), c = /* @__PURE__ */ n.jsx(
503
+ Ce.button,
504
+ {
505
+ type: "button",
506
+ "aria-haspopup": "dialog",
507
+ "aria-expanded": a.open,
508
+ "aria-controls": a.contentId,
509
+ "data-state": tr(a.open),
510
+ ...s,
511
+ ref: i,
512
+ onClick: G(e.onClick, a.onOpenToggle)
513
+ }
514
+ );
515
+ return a.hasCustomAnchor ? c : /* @__PURE__ */ n.jsx(st, { asChild: !0, ...o, children: c });
516
+ }
517
+ );
518
+ Xt.displayName = Yt;
519
+ var it = "PopoverPortal", [wn, jn] = Kt(it, {
520
+ forceMount: void 0
521
+ }), Zt = (e) => {
522
+ const { __scopePopover: r, forceMount: t, children: s, container: a } = e, o = oe(it, r);
523
+ return /* @__PURE__ */ n.jsx(wn, { scope: r, forceMount: t, children: /* @__PURE__ */ n.jsx(De, { present: t || o.open, children: /* @__PURE__ */ n.jsx(Nt, { asChild: !0, container: a, children: s }) }) });
524
+ };
525
+ Zt.displayName = it;
526
+ var ye = "PopoverContent", Jt = T(
527
+ (e, r) => {
528
+ const t = jn(ye, e.__scopePopover), { forceMount: s = t.forceMount, ...a } = e, o = oe(ye, e.__scopePopover);
529
+ return /* @__PURE__ */ n.jsx(De, { present: s || o.open, children: o.modal ? /* @__PURE__ */ n.jsx(Nn, { ...a, ref: r }) : /* @__PURE__ */ n.jsx(Pn, { ...a, ref: r }) });
530
+ }
531
+ );
532
+ Jt.displayName = ye;
533
+ var Cn = Or("PopoverContent.RemoveScroll"), Nn = T(
534
+ (e, r) => {
535
+ const t = oe(ye, e.__scopePopover), s = z(null), a = je(r, s), o = z(!1);
536
+ return V(() => {
537
+ const i = s.current;
538
+ if (i) return Pr(i);
539
+ }, []), /* @__PURE__ */ n.jsx(Sr, { as: Cn, allowPinchZoom: !0, children: /* @__PURE__ */ n.jsx(
540
+ Qt,
541
+ {
542
+ ...e,
543
+ ref: a,
544
+ trapFocus: t.open,
545
+ disableOutsidePointerEvents: !0,
546
+ onCloseAutoFocus: G(e.onCloseAutoFocus, (i) => {
547
+ var c;
548
+ i.preventDefault(), o.current || (c = t.triggerRef.current) == null || c.focus();
549
+ }),
550
+ onPointerDownOutside: G(
551
+ e.onPointerDownOutside,
552
+ (i) => {
553
+ const c = i.detail.originalEvent, u = c.button === 0 && c.ctrlKey === !0, d = c.button === 2 || u;
554
+ o.current = d;
555
+ },
556
+ { checkForDefaultPrevented: !1 }
557
+ ),
558
+ onFocusOutside: G(
559
+ e.onFocusOutside,
560
+ (i) => i.preventDefault(),
561
+ { checkForDefaultPrevented: !1 }
562
+ )
563
+ }
564
+ ) });
565
+ }
566
+ ), Pn = T(
567
+ (e, r) => {
568
+ const t = oe(ye, e.__scopePopover), s = z(!1), a = z(!1);
569
+ return /* @__PURE__ */ n.jsx(
570
+ Qt,
571
+ {
572
+ ...e,
573
+ ref: r,
574
+ trapFocus: !1,
575
+ disableOutsidePointerEvents: !1,
576
+ onCloseAutoFocus: (o) => {
577
+ var i, c;
578
+ (i = e.onCloseAutoFocus) == null || i.call(e, o), o.defaultPrevented || (s.current || (c = t.triggerRef.current) == null || c.focus(), o.preventDefault()), s.current = !1, a.current = !1;
579
+ },
580
+ onInteractOutside: (o) => {
581
+ var u, d;
582
+ (u = e.onInteractOutside) == null || u.call(e, o), o.defaultPrevented || (s.current = !0, o.detail.originalEvent.type === "pointerdown" && (a.current = !0));
583
+ const i = o.target;
584
+ ((d = t.triggerRef.current) == null ? void 0 : d.contains(i)) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && a.current && o.preventDefault();
585
+ }
586
+ }
587
+ );
588
+ }
589
+ ), Qt = T(
590
+ (e, r) => {
591
+ const {
592
+ __scopePopover: t,
593
+ trapFocus: s,
594
+ onOpenAutoFocus: a,
595
+ onCloseAutoFocus: o,
596
+ disableOutsidePointerEvents: i,
597
+ onEscapeKeyDown: c,
598
+ onPointerDownOutside: u,
599
+ onFocusOutside: d,
600
+ onInteractOutside: l,
601
+ ...f
602
+ } = e, x = oe(ye, t), g = Ae(t);
603
+ return _r(), /* @__PURE__ */ n.jsx(
604
+ kr,
605
+ {
606
+ asChild: !0,
607
+ loop: !0,
608
+ trapped: s,
609
+ onMountAutoFocus: a,
610
+ onUnmountAutoFocus: o,
611
+ children: /* @__PURE__ */ n.jsx(
612
+ Pt,
613
+ {
614
+ asChild: !0,
615
+ disableOutsidePointerEvents: i,
616
+ onInteractOutside: l,
617
+ onEscapeKeyDown: c,
618
+ onPointerDownOutside: u,
619
+ onFocusOutside: d,
620
+ onDismiss: () => x.onOpenChange(!1),
621
+ children: /* @__PURE__ */ n.jsx(
622
+ kt,
623
+ {
624
+ "data-state": tr(x.open),
625
+ role: "dialog",
626
+ id: x.contentId,
627
+ ...g,
628
+ ...f,
629
+ ref: r,
630
+ style: {
631
+ ...f.style,
632
+ "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
633
+ "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
634
+ "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
635
+ "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
636
+ "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
637
+ }
638
+ }
639
+ )
640
+ }
641
+ )
642
+ }
643
+ );
644
+ }
645
+ ), er = "PopoverClose", Sn = T(
646
+ (e, r) => {
647
+ const { __scopePopover: t, ...s } = e, a = oe(er, t);
648
+ return /* @__PURE__ */ n.jsx(
649
+ Ce.button,
650
+ {
651
+ type: "button",
652
+ ...s,
653
+ ref: r,
654
+ onClick: G(e.onClick, () => a.onOpenChange(!1))
655
+ }
656
+ );
657
+ }
658
+ );
659
+ Sn.displayName = er;
660
+ var _n = "PopoverArrow", kn = T(
661
+ (e, r) => {
662
+ const { __scopePopover: t, ...s } = e, a = Ae(t);
663
+ return /* @__PURE__ */ n.jsx(Et, { ...a, ...s, ref: r });
664
+ }
665
+ );
666
+ kn.displayName = _n;
667
+ function tr(e) {
668
+ return e ? "open" : "closed";
669
+ }
670
+ var En = Ut, Tn = Xt, An = Zt, rr = Jt, ht = 1, Fn = 0.9, In = 0.8, On = 0.17, Ue = 0.1, Ge = 0.999, zn = 0.9999, Rn = 0.99, $n = /[\\\/_+.#"@\[\(\{&]/, Ln = /[\\\/_+.#"@\[\(\{&]/g, Dn = /[\s-]/, nr = /[\s-]/g;
671
+ function Qe(e, r, t, s, a, o, i) {
672
+ if (o === r.length) return a === e.length ? ht : Rn;
673
+ var c = `${a},${o}`;
674
+ if (i[c] !== void 0) return i[c];
675
+ for (var u = s.charAt(o), d = t.indexOf(u, a), l = 0, f, x, g, m; d >= 0; ) f = Qe(e, r, t, s, d + 1, o + 1, i), f > l && (d === a ? f *= ht : $n.test(e.charAt(d - 1)) ? (f *= In, g = e.slice(a, d - 1).match(Ln), g && a > 0 && (f *= Math.pow(Ge, g.length))) : Dn.test(e.charAt(d - 1)) ? (f *= Fn, m = e.slice(a, d - 1).match(nr), m && a > 0 && (f *= Math.pow(Ge, m.length))) : (f *= On, a > 0 && (f *= Math.pow(Ge, d - a))), e.charAt(d) !== r.charAt(o) && (f *= zn)), (f < Ue && t.charAt(d - 1) === s.charAt(o + 1) || s.charAt(o + 1) === s.charAt(o) && t.charAt(d - 1) !== s.charAt(o)) && (x = Qe(e, r, t, s, d + 1, o + 2, i), x * Ue > f && (f = x * Ue)), f > l && (l = f), d = t.indexOf(u, d + 1);
676
+ return i[c] = l, l;
677
+ }
678
+ function ft(e) {
679
+ return e.toLowerCase().replace(nr, " ");
680
+ }
681
+ function Vn(e, r, t) {
682
+ return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, Qe(e, r, ft(e), ft(r), 0, 0, {});
683
+ }
684
+ var Mn = Symbol.for("react.lazy"), ze = wr[" use ".trim().toString()];
685
+ function Hn(e) {
686
+ return typeof e == "object" && e !== null && "then" in e;
687
+ }
688
+ function ar(e) {
689
+ return e != null && typeof e == "object" && "$$typeof" in e && e.$$typeof === Mn && "_payload" in e && Hn(e._payload);
690
+ }
691
+ // @__NO_SIDE_EFFECTS__
692
+ function qn(e) {
693
+ const r = /* @__PURE__ */ Bn(e), t = T((s, a) => {
694
+ let { children: o, ...i } = s;
695
+ ar(o) && typeof ze == "function" && (o = ze(o._payload));
696
+ const c = _e.toArray(o), u = c.find(Kn);
697
+ if (u) {
698
+ const d = u.props.children, l = c.map((f) => f === u ? _e.count(d) > 1 ? _e.only(null) : ke(d) ? d.props.children : null : f);
699
+ return /* @__PURE__ */ n.jsx(r, { ...i, ref: a, children: ke(d) ? rt(d, void 0, l) : null });
700
+ }
701
+ return /* @__PURE__ */ n.jsx(r, { ...i, ref: a, children: o });
702
+ });
703
+ return t.displayName = `${e}.Slot`, t;
704
+ }
705
+ // @__NO_SIDE_EFFECTS__
706
+ function Bn(e) {
707
+ const r = T((t, s) => {
708
+ let { children: a, ...o } = t;
709
+ if (ar(a) && typeof ze == "function" && (a = ze(a._payload)), ke(a)) {
710
+ const i = Gn(a), c = Un(o, a.props);
711
+ return a.type !== jr && (c.ref = s ? ge(s, i) : i), rt(a, c);
712
+ }
713
+ return _e.count(a) > 1 ? _e.only(null) : null;
714
+ });
715
+ return r.displayName = `${e}.SlotClone`, r;
716
+ }
717
+ var Wn = Symbol("radix.slottable");
718
+ function Kn(e) {
719
+ return ke(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Wn;
720
+ }
721
+ function Un(e, r) {
722
+ const t = { ...r };
723
+ for (const s in r) {
724
+ const a = e[s], o = r[s];
725
+ /^on[A-Z]/.test(s) ? a && o ? t[s] = (...c) => {
726
+ const u = o(...c);
727
+ return a(...c), u;
728
+ } : a && (t[s] = a) : s === "style" ? t[s] = { ...a, ...o } : s === "className" && (t[s] = [a, o].filter(Boolean).join(" "));
729
+ }
730
+ return { ...e, ...t };
731
+ }
732
+ function Gn(e) {
733
+ var s, a;
734
+ let r = (s = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : s.get, t = r && "isReactWarning" in r && r.isReactWarning;
735
+ return t ? e.ref : (r = (a = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : a.get, t = r && "isReactWarning" in r && r.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
736
+ }
737
+ var Yn = [
738
+ "a",
739
+ "button",
740
+ "div",
741
+ "form",
742
+ "h2",
743
+ "h3",
744
+ "img",
745
+ "input",
746
+ "label",
747
+ "li",
748
+ "nav",
749
+ "ol",
750
+ "p",
751
+ "select",
752
+ "span",
753
+ "svg",
754
+ "ul"
755
+ ], le = Yn.reduce((e, r) => {
756
+ const t = /* @__PURE__ */ qn(`Primitive.${r}`), s = T((a, o) => {
757
+ const { asChild: i, ...c } = a, u = i ? t : r;
758
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ n.jsx(u, { ...c, ref: o });
759
+ });
760
+ return s.displayName = `Primitive.${r}`, { ...e, [r]: s };
761
+ }, {}), Pe = '[cmdk-group=""]', Ye = '[cmdk-group-items=""]', Xn = '[cmdk-group-heading=""]', sr = '[cmdk-item=""]', xt = `${sr}:not([aria-disabled="true"])`, et = "cmdk-item-select", me = "data-value", Zn = (e, r, t) => Vn(e, r, t), or = Le(void 0), Fe = () => $e(or), lr = Le(void 0), ct = () => $e(lr), ir = Le(void 0), cr = T((e, r) => {
762
+ let t = ve(() => {
763
+ var p, N;
764
+ return { search: "", value: (N = (p = e.value) != null ? p : e.defaultValue) != null ? N : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
765
+ }), s = ve(() => /* @__PURE__ */ new Set()), a = ve(() => /* @__PURE__ */ new Map()), o = ve(() => /* @__PURE__ */ new Map()), i = ve(() => /* @__PURE__ */ new Set()), c = ur(e), { label: u, children: d, value: l, onValueChange: f, filter: x, shouldFilter: g, loop: m, disablePointerSelection: y = !1, vimBindings: b = !0, ...j } = e, S = ae(), O = ae(), A = ae(), $ = z(null), C = ia();
766
+ ue(() => {
767
+ if (l !== void 0) {
768
+ let p = l.trim();
769
+ t.current.value = p, L.emit();
770
+ }
771
+ }, [l]), ue(() => {
772
+ C(6, B);
773
+ }, []);
774
+ let L = U(() => ({ subscribe: (p) => (i.current.add(p), () => i.current.delete(p)), snapshot: () => t.current, setState: (p, N, E) => {
775
+ var w, h, v, P;
776
+ if (!Object.is(t.current[p], N)) {
777
+ if (t.current[p] = N, p === "search") R(), X(), C(1, k);
778
+ else if (p === "value") {
779
+ if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
780
+ let _ = document.getElementById(A);
781
+ _ ? _.focus() : (w = document.getElementById(S)) == null || w.focus();
782
+ }
783
+ if (C(7, () => {
784
+ var _;
785
+ t.current.selectedItemId = (_ = W()) == null ? void 0 : _.id, L.emit();
786
+ }), E || C(5, B), ((h = c.current) == null ? void 0 : h.value) !== void 0) {
787
+ let _ = N ?? "";
788
+ (P = (v = c.current).onValueChange) == null || P.call(v, _);
789
+ return;
790
+ }
791
+ }
792
+ L.emit();
793
+ }
794
+ }, emit: () => {
795
+ i.current.forEach((p) => p());
796
+ } }), []), ne = U(() => ({ value: (p, N, E) => {
797
+ var w;
798
+ N !== ((w = o.current.get(p)) == null ? void 0 : w.value) && (o.current.set(p, { value: N, keywords: E }), t.current.filtered.items.set(p, ee(N, E)), C(2, () => {
799
+ X(), L.emit();
800
+ }));
801
+ }, item: (p, N) => (s.current.add(p), N && (a.current.has(N) ? a.current.get(N).add(p) : a.current.set(N, /* @__PURE__ */ new Set([p]))), C(3, () => {
802
+ R(), X(), t.current.value || k(), L.emit();
803
+ }), () => {
804
+ o.current.delete(p), s.current.delete(p), t.current.filtered.items.delete(p);
805
+ let E = W();
806
+ C(4, () => {
807
+ R(), (E == null ? void 0 : E.getAttribute("id")) === p && k(), L.emit();
808
+ });
809
+ }), group: (p) => (a.current.has(p) || a.current.set(p, /* @__PURE__ */ new Set()), () => {
810
+ o.current.delete(p), a.current.delete(p);
811
+ }), filter: () => c.current.shouldFilter, label: u || e["aria-label"], getDisablePointerSelection: () => c.current.disablePointerSelection, listId: S, inputId: A, labelId: O, listInnerRef: $ }), []);
812
+ function ee(p, N) {
813
+ var E, w;
814
+ let h = (w = (E = c.current) == null ? void 0 : E.filter) != null ? w : Zn;
815
+ return p ? h(p, t.current.search, N) : 0;
816
+ }
817
+ function X() {
818
+ if (!t.current.search || c.current.shouldFilter === !1) return;
819
+ let p = t.current.filtered.items, N = [];
820
+ t.current.filtered.groups.forEach((w) => {
821
+ let h = a.current.get(w), v = 0;
822
+ h.forEach((P) => {
823
+ let _ = p.get(P);
824
+ v = Math.max(_, v);
825
+ }), N.push([w, v]);
826
+ });
827
+ let E = $.current;
828
+ Z().sort((w, h) => {
829
+ var v, P;
830
+ let _ = w.getAttribute("id"), F = h.getAttribute("id");
831
+ return ((v = p.get(F)) != null ? v : 0) - ((P = p.get(_)) != null ? P : 0);
832
+ }).forEach((w) => {
833
+ let h = w.closest(Ye);
834
+ h ? h.appendChild(w.parentElement === h ? w : w.closest(`${Ye} > *`)) : E.appendChild(w.parentElement === E ? w : w.closest(`${Ye} > *`));
835
+ }), N.sort((w, h) => h[1] - w[1]).forEach((w) => {
836
+ var h;
837
+ let v = (h = $.current) == null ? void 0 : h.querySelector(`${Pe}[${me}="${encodeURIComponent(w[0])}"]`);
838
+ v == null || v.parentElement.appendChild(v);
839
+ });
840
+ }
841
+ function k() {
842
+ let p = Z().find((E) => E.getAttribute("aria-disabled") !== "true"), N = p == null ? void 0 : p.getAttribute(me);
843
+ L.setState("value", N || void 0);
844
+ }
845
+ function R() {
846
+ var p, N, E, w;
847
+ if (!t.current.search || c.current.shouldFilter === !1) {
848
+ t.current.filtered.count = s.current.size;
849
+ return;
850
+ }
851
+ t.current.filtered.groups = /* @__PURE__ */ new Set();
852
+ let h = 0;
853
+ for (let v of s.current) {
854
+ let P = (N = (p = o.current.get(v)) == null ? void 0 : p.value) != null ? N : "", _ = (w = (E = o.current.get(v)) == null ? void 0 : E.keywords) != null ? w : [], F = ee(P, _);
855
+ t.current.filtered.items.set(v, F), F > 0 && h++;
856
+ }
857
+ for (let [v, P] of a.current) for (let _ of P) if (t.current.filtered.items.get(_) > 0) {
858
+ t.current.filtered.groups.add(v);
859
+ break;
860
+ }
861
+ t.current.filtered.count = h;
862
+ }
863
+ function B() {
864
+ var p, N, E;
865
+ let w = W();
866
+ w && (((p = w.parentElement) == null ? void 0 : p.firstChild) === w && ((E = (N = w.closest(Pe)) == null ? void 0 : N.querySelector(Xn)) == null || E.scrollIntoView({ block: "nearest" })), w.scrollIntoView({ block: "nearest" }));
867
+ }
868
+ function W() {
869
+ var p;
870
+ return (p = $.current) == null ? void 0 : p.querySelector(`${sr}[aria-selected="true"]`);
871
+ }
872
+ function Z() {
873
+ var p;
874
+ return Array.from(((p = $.current) == null ? void 0 : p.querySelectorAll(xt)) || []);
875
+ }
876
+ function J(p) {
877
+ let N = Z()[p];
878
+ N && L.setState("value", N.getAttribute(me));
879
+ }
880
+ function Q(p) {
881
+ var N;
882
+ let E = W(), w = Z(), h = w.findIndex((P) => P === E), v = w[h + p];
883
+ (N = c.current) != null && N.loop && (v = h + p < 0 ? w[w.length - 1] : h + p === w.length ? w[0] : w[h + p]), v && L.setState("value", v.getAttribute(me));
884
+ }
885
+ function ie(p) {
886
+ let N = W(), E = N == null ? void 0 : N.closest(Pe), w;
887
+ for (; E && !w; ) E = p > 0 ? oa(E, Pe) : la(E, Pe), w = E == null ? void 0 : E.querySelector(xt);
888
+ w ? L.setState("value", w.getAttribute(me)) : Q(p);
889
+ }
890
+ let te = () => J(Z().length - 1), Ne = (p) => {
891
+ p.preventDefault(), p.metaKey ? te() : p.altKey ? ie(1) : Q(1);
892
+ }, Ie = (p) => {
893
+ p.preventDefault(), p.metaKey ? J(0) : p.altKey ? ie(-1) : Q(-1);
894
+ };
895
+ return D(le.div, { ref: r, tabIndex: -1, ...j, "cmdk-root": "", onKeyDown: (p) => {
896
+ var N;
897
+ (N = j.onKeyDown) == null || N.call(j, p);
898
+ let E = p.nativeEvent.isComposing || p.keyCode === 229;
899
+ if (!(p.defaultPrevented || E)) switch (p.key) {
900
+ case "n":
901
+ case "j": {
902
+ b && p.ctrlKey && Ne(p);
903
+ break;
904
+ }
905
+ case "ArrowDown": {
906
+ Ne(p);
907
+ break;
908
+ }
909
+ case "p":
910
+ case "k": {
911
+ b && p.ctrlKey && Ie(p);
912
+ break;
913
+ }
914
+ case "ArrowUp": {
915
+ Ie(p);
916
+ break;
917
+ }
918
+ case "Home": {
919
+ p.preventDefault(), J(0);
920
+ break;
921
+ }
922
+ case "End": {
923
+ p.preventDefault(), te();
924
+ break;
925
+ }
926
+ case "Enter": {
927
+ p.preventDefault();
928
+ let w = W();
929
+ if (w) {
930
+ let h = new Event(et);
931
+ w.dispatchEvent(h);
932
+ }
933
+ }
934
+ }
935
+ } }, D("label", { "cmdk-label": "", htmlFor: ne.inputId, id: ne.labelId, style: ua }, u), We(e, (p) => D(lr.Provider, { value: L }, D(or.Provider, { value: ne }, p))));
936
+ }), Jn = T((e, r) => {
937
+ var t, s;
938
+ let a = ae(), o = z(null), i = $e(ir), c = Fe(), u = ur(e), d = (s = (t = u.current) == null ? void 0 : t.forceMount) != null ? s : i == null ? void 0 : i.forceMount;
939
+ ue(() => {
940
+ if (!d) return c.item(a, i == null ? void 0 : i.id);
941
+ }, [d]);
942
+ let l = dr(a, o, [e.value, e.children, o], e.keywords), f = ct(), x = se((C) => C.value && C.value === l.current), g = se((C) => d || c.filter() === !1 ? !0 : C.search ? C.filtered.items.get(a) > 0 : !0);
943
+ V(() => {
944
+ let C = o.current;
945
+ if (!(!C || e.disabled)) return C.addEventListener(et, m), () => C.removeEventListener(et, m);
946
+ }, [g, e.onSelect, e.disabled]);
947
+ function m() {
948
+ var C, L;
949
+ y(), (L = (C = u.current).onSelect) == null || L.call(C, l.current);
950
+ }
951
+ function y() {
952
+ f.setState("value", l.current, !0);
953
+ }
954
+ if (!g) return null;
955
+ let { disabled: b, value: j, onSelect: S, forceMount: O, keywords: A, ...$ } = e;
956
+ return D(le.div, { ref: ge(o, r), ...$, id: a, "cmdk-item": "", role: "option", "aria-disabled": !!b, "aria-selected": !!x, "data-disabled": !!b, "data-selected": !!x, onPointerMove: b || c.getDisablePointerSelection() ? void 0 : y, onClick: b ? void 0 : m }, e.children);
957
+ }), Qn = T((e, r) => {
958
+ let { heading: t, children: s, forceMount: a, ...o } = e, i = ae(), c = z(null), u = z(null), d = ae(), l = Fe(), f = se((g) => a || l.filter() === !1 ? !0 : g.search ? g.filtered.groups.has(i) : !0);
959
+ ue(() => l.group(i), []), dr(i, c, [e.value, e.heading, u]);
960
+ let x = U(() => ({ id: i, forceMount: a }), [a]);
961
+ return D(le.div, { ref: ge(c, r), ...o, "cmdk-group": "", role: "presentation", hidden: f ? void 0 : !0 }, t && D("div", { ref: u, "cmdk-group-heading": "", "aria-hidden": !0, id: d }, t), We(e, (g) => D("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? d : void 0 }, D(ir.Provider, { value: x }, g))));
962
+ }), ea = T((e, r) => {
963
+ let { alwaysRender: t, ...s } = e, a = z(null), o = se((i) => !i.search);
964
+ return !t && !o ? null : D(le.div, { ref: ge(a, r), ...s, "cmdk-separator": "", role: "separator" });
965
+ }), ta = T((e, r) => {
966
+ let { onValueChange: t, ...s } = e, a = e.value != null, o = ct(), i = se((d) => d.search), c = se((d) => d.selectedItemId), u = Fe();
967
+ return V(() => {
968
+ e.value != null && o.setState("search", e.value);
969
+ }, [e.value]), D(le.input, { ref: r, ...s, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": u.listId, "aria-labelledby": u.labelId, "aria-activedescendant": c, id: u.inputId, type: "text", value: a ? e.value : i, onChange: (d) => {
970
+ a || o.setState("search", d.target.value), t == null || t(d.target.value);
971
+ } });
972
+ }), ra = T((e, r) => {
973
+ let { children: t, label: s = "Suggestions", ...a } = e, o = z(null), i = z(null), c = se((d) => d.selectedItemId), u = Fe();
974
+ return V(() => {
975
+ if (i.current && o.current) {
976
+ let d = i.current, l = o.current, f, x = new ResizeObserver(() => {
977
+ f = requestAnimationFrame(() => {
978
+ let g = d.offsetHeight;
979
+ l.style.setProperty("--cmdk-list-height", g.toFixed(1) + "px");
980
+ });
981
+ });
982
+ return x.observe(d), () => {
983
+ cancelAnimationFrame(f), x.unobserve(d);
984
+ };
985
+ }
986
+ }, []), D(le.div, { ref: ge(o, r), ...a, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": c, "aria-label": s, id: u.listId }, We(e, (d) => D("div", { ref: ge(i, u.listInnerRef), "cmdk-list-sizer": "" }, d)));
987
+ }), na = T((e, r) => {
988
+ let { open: t, onOpenChange: s, overlayClassName: a, contentClassName: o, container: i, ...c } = e;
989
+ return D(Er, { open: t, onOpenChange: s }, D(Tr, { container: i }, D(Ar, { "cmdk-overlay": "", className: a }), D(Fr, { "aria-label": e.label, "cmdk-dialog": "", className: o }, D(cr, { ref: r, ...c }))));
990
+ }), aa = T((e, r) => se((t) => t.filtered.count === 0) ? D(le.div, { ref: r, ...e, "cmdk-empty": "", role: "presentation" }) : null), sa = T((e, r) => {
991
+ let { progress: t, children: s, label: a = "Loading...", ...o } = e;
992
+ return D(le.div, { ref: r, ...o, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": a }, We(e, (i) => D("div", { "aria-hidden": !0 }, i)));
993
+ }), de = Object.assign(cr, { List: ra, Item: Jn, Input: ta, Group: Qn, Separator: ea, Dialog: na, Empty: aa, Loading: sa });
994
+ function oa(e, r) {
995
+ let t = e.nextElementSibling;
996
+ for (; t; ) {
997
+ if (t.matches(r)) return t;
998
+ t = t.nextElementSibling;
999
+ }
1000
+ }
1001
+ function la(e, r) {
1002
+ let t = e.previousElementSibling;
1003
+ for (; t; ) {
1004
+ if (t.matches(r)) return t;
1005
+ t = t.previousElementSibling;
1006
+ }
1007
+ }
1008
+ function ur(e) {
1009
+ let r = z(e);
1010
+ return ue(() => {
1011
+ r.current = e;
1012
+ }), r;
1013
+ }
1014
+ var ue = typeof window > "u" ? V : Cr;
1015
+ function ve(e) {
1016
+ let r = z();
1017
+ return r.current === void 0 && (r.current = e()), r;
1018
+ }
1019
+ function se(e) {
1020
+ let r = ct(), t = () => e(r.snapshot());
1021
+ return Nr(r.subscribe, t, t);
1022
+ }
1023
+ function dr(e, r, t, s = []) {
1024
+ let a = z(), o = Fe();
1025
+ return ue(() => {
1026
+ var i;
1027
+ let c = (() => {
1028
+ var d;
1029
+ for (let l of t) {
1030
+ if (typeof l == "string") return l.trim();
1031
+ if (typeof l == "object" && "current" in l) return l.current ? (d = l.current.textContent) == null ? void 0 : d.trim() : a.current;
1032
+ }
1033
+ })(), u = s.map((d) => d.trim());
1034
+ o.value(e, c, u), (i = r.current) == null || i.setAttribute(me, c), a.current = c;
1035
+ }), a;
1036
+ }
1037
+ var ia = () => {
1038
+ let [e, r] = H(), t = ve(() => /* @__PURE__ */ new Map());
1039
+ return ue(() => {
1040
+ t.current.forEach((s) => s()), t.current = /* @__PURE__ */ new Map();
1041
+ }, [e]), (s, a) => {
1042
+ t.current.set(s, a), r({});
1043
+ };
1044
+ };
1045
+ function ca(e) {
1046
+ let r = e.type;
1047
+ return typeof r == "function" ? r(e.props) : "render" in r ? r.render(e.props) : e;
1048
+ }
1049
+ function We({ asChild: e, children: r }, t) {
1050
+ return e && ke(r) ? rt(ca(r), { ref: r.ref }, t(r.props.children)) : t(r);
1051
+ }
1052
+ var ua = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
1053
+ function Re({ className: e, ...r }) {
1054
+ return /* @__PURE__ */ n.jsx(
1055
+ de,
1056
+ {
1057
+ className: I(
1058
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
1059
+ e
1060
+ ),
1061
+ ...r
1062
+ }
1063
+ );
1064
+ }
1065
+ function ut({ className: e, ...r }) {
1066
+ return /* @__PURE__ */ n.jsxs("div", { className: "flex items-center border-b border-border px-3", "cmdk-input-wrapper": "", "data-slot": "command-input", children: [
1067
+ /* @__PURE__ */ n.jsx(zr, { className: "me-2 size-4 shrink-0 opacity-50" }),
1068
+ /* @__PURE__ */ n.jsx(
1069
+ de.Input,
1070
+ {
1071
+ className: I(
1072
+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-hidden text-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
1073
+ e
1074
+ ),
1075
+ ...r
1076
+ }
1077
+ )
1078
+ ] });
1079
+ }
1080
+ function dt({ className: e, ...r }) {
1081
+ return /* @__PURE__ */ n.jsx(
1082
+ de.List,
1083
+ {
1084
+ className: I("max-h-[300px] p-1 overflow-y-auto overflow-x-hidden", e),
1085
+ "data-slot": "command-list",
1086
+ ...r
1087
+ }
1088
+ );
1089
+ }
1090
+ function pt({ ...e }) {
1091
+ return /* @__PURE__ */ n.jsx(de.Empty, { className: "py-6 text-center text-sm", "data-slot": "command-empty", ...e });
1092
+ }
1093
+ function we({ className: e, ...r }) {
1094
+ return /* @__PURE__ */ n.jsx(
1095
+ de.Group,
1096
+ {
1097
+ className: I(
1098
+ "overflow-hidden p-1.5 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
1099
+ e
1100
+ ),
1101
+ "data-slot": "command-group",
1102
+ ...r
1103
+ }
1104
+ );
1105
+ }
1106
+ function fe({ className: e, ...r }) {
1107
+ return /* @__PURE__ */ n.jsx(
1108
+ de.Separator,
1109
+ {
1110
+ className: I("-mx-1.5 h-px bg-border", e),
1111
+ "data-slot": "command-separator",
1112
+ ...r
1113
+ }
1114
+ );
1115
+ }
1116
+ function ce({ className: e, ...r }) {
1117
+ return /* @__PURE__ */ n.jsx(
1118
+ de.Item,
1119
+ {
1120
+ className: I(
1121
+ "relative flex text-foreground cursor-default gap-2 select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
1122
+ "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]",
1123
+ e
1124
+ ),
1125
+ "data-slot": "command-item",
1126
+ ...r
1127
+ }
1128
+ );
1129
+ }
1130
+ function Ia({ icon: e = xe, className: r, ...t }) {
1131
+ return /* @__PURE__ */ n.jsx(
1132
+ e,
1133
+ {
1134
+ className: I("size-4 ms-auto text-primary", r),
1135
+ "data-check": "true",
1136
+ "data-slot": "command-check",
1137
+ ...t
1138
+ }
1139
+ );
1140
+ }
1141
+ const mt = En, vt = Tn, Ke = T(({ className: e, align: r = "center", sideOffset: t = 4, ...s }, a) => /* @__PURE__ */ n.jsx(An, { children: /* @__PURE__ */ n.jsx("div", { className: Ct, children: /* @__PURE__ */ n.jsx(
1142
+ rr,
1143
+ {
1144
+ ref: a,
1145
+ align: r,
1146
+ className: I(
1147
+ "z-50 rounded-md bg-white dark:bg-gray-950 p-5 text-popover-foreground shadow-md border outline-hidden data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-popover-content-transform-origin)",
1148
+ e
1149
+ ),
1150
+ sideOffset: t,
1151
+ ...s
1152
+ }
1153
+ ) }) }));
1154
+ Ke.displayName = rr.displayName;
1155
+ const da = Y(
1156
+ "peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
1157
+ {
1158
+ variants: {
1159
+ size: {
1160
+ default: "h-5 w-9",
1161
+ sm: "h-4 w-7"
1162
+ }
1163
+ },
1164
+ defaultVariants: {
1165
+ size: "default"
1166
+ }
1167
+ }
1168
+ ), pa = Y(
1169
+ "pointer-events-none block rounded-full bg-background ring-0 [filter:drop-shadow(0_1px_2px_rgba(0,0,0,0.07))] transition-transform data-[state=unchecked]:translate-x-0",
1170
+ {
1171
+ variants: {
1172
+ size: {
1173
+ default: "size-4 data-[state=checked]:translate-x-4",
1174
+ sm: "size-3 data-[state=checked]:translate-x-3"
1175
+ }
1176
+ },
1177
+ defaultVariants: {
1178
+ size: "default"
1179
+ }
1180
+ }
1181
+ ), pr = T(({ className: e, size: r, ...t }, s) => /* @__PURE__ */ n.jsx(
1182
+ zt,
1183
+ {
1184
+ className: I(da({ size: r, className: e })),
1185
+ ...t,
1186
+ ref: s,
1187
+ children: /* @__PURE__ */ n.jsx(
1188
+ Gr,
1189
+ {
1190
+ className: I(pa({ size: r }))
1191
+ }
1192
+ )
1193
+ }
1194
+ ));
1195
+ pr.displayName = zt.displayName;
1196
+ const Oa = hn, ma = fn, va = xn, mr = T(({ className: e, sideOffset: r = 4, ...t }, s) => /* @__PURE__ */ n.jsx(gn, { children: /* @__PURE__ */ n.jsx("div", { className: Ct, children: /* @__PURE__ */ n.jsx(
1197
+ Wt,
1198
+ {
1199
+ ref: s,
1200
+ className: I(
1201
+ "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
1202
+ e
1203
+ ),
1204
+ sideOffset: r,
1205
+ ...t
1206
+ }
1207
+ ) }) }));
1208
+ mr.displayName = Wt.displayName;
1209
+ const he = {
1210
+ // UI Labels
1211
+ addFilter: "",
1212
+ clearFilters: "Clear",
1213
+ searchFields: "Search fields...",
1214
+ noFieldsFound: "No fields found.",
1215
+ noResultsFound: "No results found.",
1216
+ loading: "Loading...",
1217
+ loadMore: "Load more",
1218
+ select: "Select...",
1219
+ true: "True",
1220
+ false: "False",
1221
+ min: "Min",
1222
+ max: "Max",
1223
+ to: "to",
1224
+ typeAndPressEnter: "Type and press Enter to add tag",
1225
+ selected: "selected",
1226
+ selectedCount: "selected",
1227
+ percent: "%",
1228
+ defaultCurrency: "$",
1229
+ defaultColor: "#000000",
1230
+ addFilterTitle: "",
1231
+ // Operators
1232
+ operators: {
1233
+ is: "is",
1234
+ isNot: "is not",
1235
+ isAnyOf: "is any of",
1236
+ isNotAnyOf: "is not any of",
1237
+ includesAll: "includes all",
1238
+ excludesAll: "excludes all",
1239
+ before: "before",
1240
+ after: "after",
1241
+ between: "between",
1242
+ notBetween: "not between",
1243
+ contains: "contains",
1244
+ notContains: "does not contain",
1245
+ startsWith: "starts with",
1246
+ endsWith: "ends with",
1247
+ isExactly: "is exactly",
1248
+ equals: "equals",
1249
+ notEquals: "not equals",
1250
+ greaterThan: "greater than",
1251
+ lessThan: "less than",
1252
+ overlaps: "overlaps",
1253
+ includes: "includes",
1254
+ excludes: "excludes",
1255
+ includesAllOf: "includes all of",
1256
+ includesAnyOf: "includes any of",
1257
+ empty: "is empty",
1258
+ notEmpty: "is not empty"
1259
+ },
1260
+ // Placeholders
1261
+ placeholders: {
1262
+ enterField: (e) => `Enter ${e}...`,
1263
+ selectField: "Select...",
1264
+ searchField: (e) => `Search ${e.toLowerCase()}...`,
1265
+ enterKey: "Enter key...",
1266
+ enterValue: "Enter value..."
1267
+ },
1268
+ // Helper functions
1269
+ helpers: {
1270
+ formatOperator: (e) => e.replace(/_/g, " ")
1271
+ },
1272
+ // Validation
1273
+ validation: {
1274
+ invalidEmail: "Invalid email format",
1275
+ invalidUrl: "Invalid URL format",
1276
+ invalidTel: "Invalid phone format",
1277
+ invalid: "Invalid input format"
1278
+ }
1279
+ }, vr = Le({
1280
+ variant: "outline",
1281
+ size: "md",
1282
+ radius: "md",
1283
+ i18n: he,
1284
+ cursorPointer: !0,
1285
+ className: void 0,
1286
+ showAddButton: !0,
1287
+ addButtonText: void 0,
1288
+ addButtonIcon: void 0,
1289
+ addButtonClassName: void 0,
1290
+ addButton: void 0,
1291
+ showSearchInput: !0,
1292
+ trigger: void 0,
1293
+ allowMultiple: !0
1294
+ }), pe = () => $e(vr), tt = 200, ha = Y(
1295
+ [
1296
+ "relative flex shrink-0 items-center text-foreground outline-hidden transition",
1297
+ "has-[[data-slot=filters-input]:focus-visible]:ring-ring/30",
1298
+ "has-[[data-slot=filters-input]:focus-visible]:border-ring",
1299
+ "has-[[data-slot=filters-input]:focus-visible]:outline-hidden",
1300
+ "has-[[data-slot=filters-input]:focus-visible]:ring-[3px]",
1301
+ "has-[[data-slot=filters-input]:focus-visible]:z-1",
1302
+ "has-[[data-slot=filters-input]:[aria-invalid=true]]:border",
1303
+ "has-[[data-slot=filters-input]:[aria-invalid=true]]:border-solid",
1304
+ "has-[[data-slot=filters-input]:[aria-invalid=true]]:border-destructive/60",
1305
+ "has-[[data-slot=filters-input]:[aria-invalid=true]]:ring-destructive/10",
1306
+ "dark:has-[[data-slot=filters-input]:[aria-invalid=true]]:border-destructive",
1307
+ "dark:has-[[data-slot=filters-input]:[aria-invalid=true]]:ring-destructive/20"
1308
+ ],
1309
+ {
1310
+ variants: {
1311
+ variant: {
1312
+ solid: "border-0 bg-secondary",
1313
+ outline: "border border-border bg-background"
1314
+ },
1315
+ size: {
1316
+ lg: "h-10 px-2.5 text-sm has-[[data-slot=filters-prefix]]:ps-0 has-[[data-slot=filters-suffix]]:pe-0",
1317
+ md: "h-[34px] px-2 text-sm has-[[data-slot=filters-prefix]]:ps-0 has-[[data-slot=filters-suffix]]:pe-0",
1318
+ sm: "h-8 px-2 text-xs has-[[data-slot=filters-prefix]]:ps-0 has-[[data-slot=filters-suffix]]:pe-0"
1319
+ },
1320
+ cursorPointer: {
1321
+ true: "cursor-pointer",
1322
+ false: ""
1323
+ }
1324
+ },
1325
+ defaultVariants: {
1326
+ variant: "outline",
1327
+ size: "md",
1328
+ cursorPointer: !0
1329
+ }
1330
+ }
1331
+ ), fa = Y(
1332
+ [
1333
+ "inline-flex shrink-0 items-center justify-center text-muted-foreground transition hover:text-foreground",
1334
+ "focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden"
1335
+ ],
1336
+ {
1337
+ variants: {
1338
+ variant: {
1339
+ solid: "bg-secondary",
1340
+ outline: "border border-s-0 border-border hover:bg-secondary"
1341
+ },
1342
+ size: {
1343
+ lg: "size-10 [&_svg:not([class*=size-])]:size-4",
1344
+ md: "size-[34px] [&_svg:not([class*=size-])]:size-3.5",
1345
+ sm: "size-8 [&_svg:not([class*=size-])]:size-3"
1346
+ },
1347
+ cursorPointer: {
1348
+ true: "cursor-pointer",
1349
+ false: ""
1350
+ },
1351
+ radius: {
1352
+ md: "rounded-e-md",
1353
+ full: "rounded-e-full"
1354
+ }
1355
+ },
1356
+ defaultVariants: {
1357
+ variant: "outline",
1358
+ size: "md",
1359
+ radius: "md",
1360
+ cursorPointer: !0
1361
+ }
1362
+ }
1363
+ ), gt = Y(
1364
+ [
1365
+ "inline-flex shrink-0 items-center justify-center text-foreground transition",
1366
+ "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]",
1367
+ "focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden"
1368
+ ],
1369
+ {
1370
+ variants: {
1371
+ variant: {
1372
+ solid: "border border-input hover:bg-secondary/60",
1373
+ outline: "border border-border hover:bg-accent"
1374
+ },
1375
+ size: {
1376
+ lg: "h-10 gap-1.5 px-4 text-sm [&_svg:not([class*=size-])]:size-4",
1377
+ md: "h-[34px] gap-1.5 px-3 text-sm [&_svg:not([class*=size-])]:size-4",
1378
+ sm: "h-8 gap-1.5 px-2.5 text-xs [&_svg:not([class*=size-])]:size-3.5"
1379
+ },
1380
+ radius: {
1381
+ md: "rounded-md",
1382
+ full: "rounded-full"
1383
+ },
1384
+ cursorPointer: {
1385
+ true: "cursor-pointer",
1386
+ false: ""
1387
+ }
1388
+ },
1389
+ defaultVariants: {
1390
+ variant: "outline",
1391
+ size: "md",
1392
+ cursorPointer: !0
1393
+ }
1394
+ }
1395
+ ), xa = Y(
1396
+ [
1397
+ "relative flex shrink-0 items-center whitespace-nowrap text-muted-foreground transition hover:text-foreground focus-visible:z-1 data-[state=open]:text-foreground",
1398
+ "focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden"
1399
+ ],
1400
+ {
1401
+ variants: {
1402
+ variant: {
1403
+ solid: "bg-secondary",
1404
+ outline: "border border-e-0 border-border bg-background hover:bg-secondary data-[state=open]:bg-secondary [&+[data-slot=filters-remove]]:border-s"
1405
+ },
1406
+ size: {
1407
+ lg: "h-10 gap-1.5 px-4 text-sm",
1408
+ md: "h-[34px] gap-0.5 px-3 text-sm",
1409
+ sm: "h-8 gap-1 px-2.5 text-xs"
1410
+ },
1411
+ cursorPointer: {
1412
+ true: "cursor-pointer",
1413
+ false: ""
1414
+ }
1415
+ },
1416
+ defaultVariants: {
1417
+ variant: "outline",
1418
+ size: "md",
1419
+ cursorPointer: !0
1420
+ }
1421
+ }
1422
+ ), ga = Y(
1423
+ [
1424
+ "flex shrink-0 items-center gap-1.5 px-1.5 py-1 text-foreground",
1425
+ "[&_svg:not([class*=size-])]:size-4"
1426
+ ],
1427
+ {
1428
+ variants: {
1429
+ variant: {
1430
+ solid: "bg-secondary",
1431
+ outline: "border border-e-0 border-border"
1432
+ },
1433
+ size: {
1434
+ lg: "h-10 gap-1.5 px-4 text-sm [&_svg:not([class*=size-])]:size-4",
1435
+ md: "h-[34px] gap-1.5 px-3 text-sm [&_svg:not([class*=size-])]:size-4",
1436
+ sm: "h-8 gap-0.5 px-2.5 text-xs [&_svg:not([class*=size-])]:size-3.5"
1437
+ },
1438
+ radius: {
1439
+ md: "rounded-s-md",
1440
+ full: "rounded-s-full"
1441
+ }
1442
+ },
1443
+ defaultVariants: {
1444
+ variant: "outline",
1445
+ size: "md"
1446
+ }
1447
+ }
1448
+ ), Se = Y(
1449
+ [
1450
+ "relative flex min-w-0 shrink items-center gap-1 text-foreground transition focus-visible:z-1",
1451
+ "focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden"
1452
+ ],
1453
+ {
1454
+ variants: {
1455
+ variant: {
1456
+ solid: "bg-secondary",
1457
+ outline: "border border-border bg-background hover:bg-secondary has-[[data-slot=switch]]:hover:bg-transparent"
1458
+ },
1459
+ size: {
1460
+ lg: "h-10 gap-1.5 px-4 text-sm [&_svg:not([class*=size-])]:size-4",
1461
+ md: "h-[34px] gap-1.5 px-3 text-sm [&_svg:not([class*=size-])]:size-4",
1462
+ sm: "h-8 gap-0.5 px-2.5 text-xs [&_svg:not([class*=size-])]:size-3.5"
1463
+ },
1464
+ cursorPointer: {
1465
+ true: "cursor-pointer has-[[data-slot=switch]]:cursor-default",
1466
+ false: ""
1467
+ }
1468
+ },
1469
+ defaultVariants: {
1470
+ variant: "outline",
1471
+ size: "md",
1472
+ cursorPointer: !0
1473
+ }
1474
+ }
1475
+ ), bt = Y("flex shrink-0 items-center justify-center text-foreground", {
1476
+ variants: {
1477
+ variant: {
1478
+ solid: "",
1479
+ outline: ""
1480
+ },
1481
+ size: {
1482
+ lg: "h-10 px-4 text-sm",
1483
+ md: "h-[34px] px-3 text-sm",
1484
+ sm: "h-8 px-2.5 text-xs"
1485
+ }
1486
+ },
1487
+ defaultVariants: {
1488
+ variant: "outline",
1489
+ size: "md"
1490
+ }
1491
+ }), Oe = Y("flex shrink-0 items-center text-muted-foreground", {
1492
+ variants: {
1493
+ variant: {
1494
+ solid: "bg-secondary",
1495
+ outline: "border border-x-0 border-border bg-background"
1496
+ },
1497
+ size: {
1498
+ lg: "h-10 px-4 text-sm",
1499
+ md: "h-[34px] px-3 text-sm",
1500
+ sm: "h-8 px-2.5 text-xs"
1501
+ }
1502
+ },
1503
+ defaultVariants: {
1504
+ variant: "outline",
1505
+ size: "md"
1506
+ }
1507
+ }), ba = Y("relative flex flex-wrap items-center", {
1508
+ variants: {
1509
+ variant: {
1510
+ solid: "gap-2",
1511
+ outline: ""
1512
+ },
1513
+ size: {
1514
+ sm: "gap-1.5",
1515
+ md: "gap-2.5",
1516
+ lg: "gap-3.5"
1517
+ }
1518
+ },
1519
+ defaultVariants: {
1520
+ variant: "outline",
1521
+ size: "md"
1522
+ }
1523
+ }), ya = Y("flex max-w-[calc(100vw-32px)] items-center", {
1524
+ variants: {
1525
+ variant: {
1526
+ solid: "gap-px",
1527
+ outline: ""
1528
+ }
1529
+ },
1530
+ defaultVariants: {
1531
+ variant: "outline"
1532
+ }
1533
+ });
1534
+ function K({
1535
+ field: e,
1536
+ onChange: r,
1537
+ onBlur: t,
1538
+ onKeyDown: s,
1539
+ onInputChange: a,
1540
+ className: o,
1541
+ ...i
1542
+ }) {
1543
+ const c = pe(), [u, d] = H(!0), [l, f] = H(""), x = (j, S) => !S || !j ? !0 : new RegExp(S).test(j), g = (j, S = !1) => {
1544
+ if ((j === "text" || j === "number") && S)
1545
+ return c.i18n.validation.invalid;
1546
+ switch (j) {
1547
+ case "email":
1548
+ return c.i18n.validation.invalidEmail;
1549
+ case "url":
1550
+ return c.i18n.validation.invalidUrl;
1551
+ case "tel":
1552
+ return c.i18n.validation.invalidTel;
1553
+ default:
1554
+ return c.i18n.validation.invalid;
1555
+ }
1556
+ }, m = (j) => {
1557
+ r == null || r(j);
1558
+ }, y = (j) => {
1559
+ const S = j.target.value, O = (e == null ? void 0 : e.pattern) || i.pattern;
1560
+ if (S && O) {
1561
+ let A = !0;
1562
+ e != null && e.validation ? A = e.validation(S) : A = x(S, O), d(A);
1563
+ const $ = !!(e != null && e.pattern || i.pattern);
1564
+ f(A ? "" : g((e == null ? void 0 : e.type) || "", $));
1565
+ } else
1566
+ d(!0), f("");
1567
+ a && a(j), t == null || t(j);
1568
+ }, b = (j) => {
1569
+ if (!u && !["Tab", "Escape", "Enter", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(j.key) && (d(!0), f("")), j.key === "Enter" && a) {
1570
+ const S = {
1571
+ ...j,
1572
+ target: j.target,
1573
+ currentTarget: j.currentTarget
1574
+ };
1575
+ a(S);
1576
+ }
1577
+ s == null || s(j);
1578
+ };
1579
+ return /* @__PURE__ */ n.jsxs(
1580
+ "div",
1581
+ {
1582
+ className: I("w-36", ha({ variant: c.variant, size: c.size }), o),
1583
+ "data-slot": "filters-input-wrapper",
1584
+ children: [
1585
+ (e == null ? void 0 : e.prefix) && /* @__PURE__ */ n.jsx(
1586
+ "div",
1587
+ {
1588
+ className: bt({ variant: c.variant, size: c.size }),
1589
+ "data-slot": "filters-prefix",
1590
+ children: e.prefix
1591
+ }
1592
+ ),
1593
+ /* @__PURE__ */ n.jsxs("div", { className: "flex w-full items-stretch", children: [
1594
+ /* @__PURE__ */ n.jsx(
1595
+ "input",
1596
+ {
1597
+ "aria-describedby": !u && l ? `${(e == null ? void 0 : e.key) || "input"}-error` : void 0,
1598
+ "aria-invalid": !u,
1599
+ autoComplete: "off",
1600
+ className: "w-full bg-transparent outline-hidden dark:!bg-transparent",
1601
+ "data-form-type": "other",
1602
+ "data-lpignore": "true",
1603
+ "data-slot": "filters-input",
1604
+ "data-1p-ignore": !0,
1605
+ onBlur: y,
1606
+ onChange: m,
1607
+ onKeyDown: b,
1608
+ ...i
1609
+ }
1610
+ ),
1611
+ !u && l && /* @__PURE__ */ n.jsxs(ma, { children: [
1612
+ /* @__PURE__ */ n.jsx(va, { asChild: !0, children: /* @__PURE__ */ n.jsx("div", { className: "absolute top-1/2 right-2 flex -translate-y-1/2 items-center", children: /* @__PURE__ */ n.jsx($r, { className: "size-3.5 text-destructive" }) }) }),
1613
+ /* @__PURE__ */ n.jsx(mr, { children: /* @__PURE__ */ n.jsx("p", { className: "text-sm", children: l }) })
1614
+ ] })
1615
+ ] }),
1616
+ (e == null ? void 0 : e.suffix) && /* @__PURE__ */ n.jsx(
1617
+ "div",
1618
+ {
1619
+ className: I(bt({ variant: c.variant, size: c.size })),
1620
+ "data-slot": "filters-suffix",
1621
+ children: e.suffix
1622
+ }
1623
+ )
1624
+ ]
1625
+ }
1626
+ );
1627
+ }
1628
+ function wa({ className: e, icon: r = /* @__PURE__ */ n.jsx(St, {}), ...t }) {
1629
+ const s = pe();
1630
+ return /* @__PURE__ */ n.jsx(
1631
+ "button",
1632
+ {
1633
+ className: I(
1634
+ fa({
1635
+ variant: s.variant,
1636
+ size: s.size,
1637
+ cursorPointer: s.cursorPointer,
1638
+ radius: s.radius
1639
+ }),
1640
+ e
1641
+ ),
1642
+ "data-slot": "filters-remove",
1643
+ ...t,
1644
+ type: "button",
1645
+ children: r
1646
+ }
1647
+ );
1648
+ }
1649
+ const hr = (e) => "fields" in e && Array.isArray(e.fields), fr = (e) => !!(e.group && e.fields), xr = (e) => e.reduce((r, t) => hr(t) ? [...r, ...t.fields] : fr(t) ? [...r, ...t.fields] : [...r, t], []), ja = (e) => xr(e).reduce(
1650
+ (t, s) => (s.key && (t[s.key] = s), t),
1651
+ {}
1652
+ ), gr = (e) => ({
1653
+ select: [
1654
+ { value: "is", label: e.operators.is },
1655
+ { value: "is_not", label: e.operators.isNot },
1656
+ { value: "empty", label: e.operators.empty },
1657
+ { value: "not_empty", label: e.operators.notEmpty }
1658
+ ],
1659
+ multiselect: [
1660
+ { value: "is_any_of", label: e.operators.isAnyOf },
1661
+ { value: "is_not_any_of", label: e.operators.isNotAnyOf },
1662
+ { value: "includes_all", label: e.operators.includesAll },
1663
+ { value: "excludes_all", label: e.operators.excludesAll },
1664
+ { value: "empty", label: e.operators.empty },
1665
+ { value: "not_empty", label: e.operators.notEmpty }
1666
+ ],
1667
+ date: [
1668
+ { value: "before", label: e.operators.before },
1669
+ { value: "after", label: e.operators.after },
1670
+ { value: "is", label: e.operators.is },
1671
+ { value: "is_not", label: e.operators.isNot },
1672
+ { value: "empty", label: e.operators.empty },
1673
+ { value: "not_empty", label: e.operators.notEmpty }
1674
+ ],
1675
+ daterange: [
1676
+ { value: "between", label: e.operators.between },
1677
+ { value: "not_between", label: e.operators.notBetween },
1678
+ { value: "empty", label: e.operators.empty },
1679
+ { value: "not_empty", label: e.operators.notEmpty }
1680
+ ],
1681
+ text: [
1682
+ { value: "contains", label: e.operators.contains },
1683
+ { value: "not_contains", label: e.operators.notContains },
1684
+ { value: "starts_with", label: e.operators.startsWith },
1685
+ { value: "ends_with", label: e.operators.endsWith },
1686
+ { value: "is", label: e.operators.isExactly },
1687
+ { value: "empty", label: e.operators.empty },
1688
+ { value: "not_empty", label: e.operators.notEmpty }
1689
+ ],
1690
+ number: [
1691
+ { value: "equals", label: e.operators.equals },
1692
+ { value: "not_equals", label: e.operators.notEquals },
1693
+ { value: "greater_than", label: e.operators.greaterThan },
1694
+ { value: "less_than", label: e.operators.lessThan },
1695
+ { value: "between", label: e.operators.between },
1696
+ { value: "empty", label: e.operators.empty },
1697
+ { value: "not_empty", label: e.operators.notEmpty }
1698
+ ],
1699
+ numberrange: [
1700
+ { value: "between", label: e.operators.between },
1701
+ { value: "overlaps", label: e.operators.overlaps },
1702
+ { value: "contains", label: e.operators.contains },
1703
+ { value: "empty", label: e.operators.empty },
1704
+ { value: "not_empty", label: e.operators.notEmpty }
1705
+ ],
1706
+ boolean: [
1707
+ { value: "is", label: e.operators.is },
1708
+ { value: "is_not", label: e.operators.isNot },
1709
+ { value: "empty", label: e.operators.empty },
1710
+ { value: "not_empty", label: e.operators.notEmpty }
1711
+ ],
1712
+ email: [
1713
+ { value: "contains", label: e.operators.contains },
1714
+ { value: "not_contains", label: e.operators.notContains },
1715
+ { value: "starts_with", label: e.operators.startsWith },
1716
+ { value: "ends_with", label: e.operators.endsWith },
1717
+ { value: "is", label: e.operators.isExactly },
1718
+ { value: "empty", label: e.operators.empty },
1719
+ { value: "not_empty", label: e.operators.notEmpty }
1720
+ ],
1721
+ url: [
1722
+ { value: "contains", label: e.operators.contains },
1723
+ { value: "not_contains", label: e.operators.notContains },
1724
+ { value: "starts_with", label: e.operators.startsWith },
1725
+ { value: "ends_with", label: e.operators.endsWith },
1726
+ { value: "is", label: e.operators.isExactly },
1727
+ { value: "empty", label: e.operators.empty },
1728
+ { value: "not_empty", label: e.operators.notEmpty }
1729
+ ],
1730
+ tel: [
1731
+ { value: "contains", label: e.operators.contains },
1732
+ { value: "not_contains", label: e.operators.notContains },
1733
+ { value: "starts_with", label: e.operators.startsWith },
1734
+ { value: "ends_with", label: e.operators.endsWith },
1735
+ { value: "is", label: e.operators.isExactly },
1736
+ { value: "empty", label: e.operators.empty },
1737
+ { value: "not_empty", label: e.operators.notEmpty }
1738
+ ],
1739
+ time: [
1740
+ { value: "before", label: e.operators.before },
1741
+ { value: "after", label: e.operators.after },
1742
+ { value: "is", label: e.operators.is },
1743
+ { value: "between", label: e.operators.between },
1744
+ { value: "empty", label: e.operators.empty },
1745
+ { value: "not_empty", label: e.operators.notEmpty }
1746
+ ],
1747
+ datetime: [
1748
+ { value: "before", label: e.operators.before },
1749
+ { value: "after", label: e.operators.after },
1750
+ { value: "is", label: e.operators.is },
1751
+ { value: "between", label: e.operators.between },
1752
+ { value: "empty", label: e.operators.empty },
1753
+ { value: "not_empty", label: e.operators.notEmpty }
1754
+ ]
1755
+ });
1756
+ gr(he);
1757
+ const Ca = (e, r, t) => {
1758
+ if (e.operators)
1759
+ return e.operators;
1760
+ const s = gr(t);
1761
+ let a = e.type || "select";
1762
+ return a === "select" && r.length > 1 && (a = "multiselect"), a === "multiselect" || e.type === "multiselect" ? s.multiselect : s[a] || s.select;
1763
+ };
1764
+ function Na({ field: e, operator: r, values: t, onChange: s }) {
1765
+ var a;
1766
+ const o = pe(), i = Ca(e, t, o.i18n), c = ((a = i.find((u) => u.value === r)) == null ? void 0 : a.label) || o.i18n.helpers.formatOperator(r);
1767
+ return e.hideOperatorSelect ? /* @__PURE__ */ n.jsx("div", { className: "flex items-center self-stretch border border-r-[0px] px-3 text-sm whitespace-nowrap text-muted-foreground", children: c }) : /* @__PURE__ */ n.jsxs(Dr, { children: [
1768
+ /* @__PURE__ */ n.jsx(Vr, { className: xa({ variant: o.variant, size: o.size }), children: c }),
1769
+ /* @__PURE__ */ n.jsx(Mr, { align: "start", className: "w-fit min-w-fit", children: i.map((u) => /* @__PURE__ */ n.jsxs(
1770
+ Hr,
1771
+ {
1772
+ className: "flex items-center justify-between",
1773
+ onClick: () => s(u.value),
1774
+ children: [
1775
+ /* @__PURE__ */ n.jsx("span", { children: u.label }),
1776
+ /* @__PURE__ */ n.jsx(xe, { className: `ms-auto text-primary ${u.value === r ? "opacity-100" : "opacity-0"}` })
1777
+ ]
1778
+ },
1779
+ u.value
1780
+ )) })
1781
+ ] });
1782
+ }
1783
+ function yt({
1784
+ searchable: e,
1785
+ label: r,
1786
+ searchInput: t,
1787
+ isSearching: s,
1788
+ className: a,
1789
+ onSearchChange: o
1790
+ }) {
1791
+ const i = pe();
1792
+ return e ? /* @__PURE__ */ n.jsxs("div", { className: "relative", children: [
1793
+ /* @__PURE__ */ n.jsx(
1794
+ ut,
1795
+ {
1796
+ className: a,
1797
+ placeholder: i.i18n.placeholders.searchField(r || ""),
1798
+ value: t,
1799
+ onValueChange: o
1800
+ }
1801
+ ),
1802
+ s && /* @__PURE__ */ n.jsx(Xe, { className: "pointer-events-none absolute top-1/2 right-3 size-4 -translate-y-1/2 animate-spin text-muted-foreground" })
1803
+ ] }) : null;
1804
+ }
1805
+ function Pa(e, r) {
1806
+ const t = r.trim().toLowerCase();
1807
+ return t ? e.filter((s) => {
1808
+ var a;
1809
+ return s.label.toLowerCase().includes(t) || ((a = s.detail) == null ? void 0 : a.toLowerCase().includes(t));
1810
+ }) : e;
1811
+ }
1812
+ function wt({
1813
+ contextLabel: e,
1814
+ selectedOptions: r,
1815
+ unselectedOptions: t,
1816
+ isInitialLoad: s,
1817
+ isLoadingMore: a,
1818
+ hasMore: o,
1819
+ onLoadMore: i,
1820
+ onSelectSelected: c,
1821
+ onSelectUnselected: u
1822
+ }) {
1823
+ const d = pe();
1824
+ return /* @__PURE__ */ n.jsxs(dt, { className: "outline-hidden", children: [
1825
+ s ? /* @__PURE__ */ n.jsxs("div", { className: "flex items-center justify-center py-6 text-sm text-muted-foreground", children: [
1826
+ /* @__PURE__ */ n.jsx(Xe, { className: "mr-2 size-4 animate-spin" }),
1827
+ d.i18n.loading
1828
+ ] }) : /* @__PURE__ */ n.jsx(pt, { children: d.i18n.noResultsFound }),
1829
+ r.length > 0 && /* @__PURE__ */ n.jsx(we, { heading: e, children: r.map((l) => /* @__PURE__ */ n.jsxs(
1830
+ ce,
1831
+ {
1832
+ className: "group flex items-center gap-2",
1833
+ onSelect: () => c(l),
1834
+ children: [
1835
+ l.icon && l.icon,
1836
+ /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col overflow-hidden", children: [
1837
+ /* @__PURE__ */ n.jsx("span", { className: "truncate text-accent-foreground", title: l.label, children: l.label }),
1838
+ l.detail && /* @__PURE__ */ n.jsx("span", { className: "truncate text-sm text-muted-foreground", title: l.detail, children: l.detail })
1839
+ ] }),
1840
+ /* @__PURE__ */ n.jsx(xe, { className: "ms-auto text-primary" })
1841
+ ]
1842
+ },
1843
+ String(l.value)
1844
+ )) }),
1845
+ t.length > 0 && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
1846
+ r.length > 0 && /* @__PURE__ */ n.jsx(fe, {}),
1847
+ /* @__PURE__ */ n.jsx(we, { children: t.map((l) => /* @__PURE__ */ n.jsxs(
1848
+ ce,
1849
+ {
1850
+ className: "group flex items-center gap-2",
1851
+ value: l.label + (l.detail ? ` - ${l.detail}` : ""),
1852
+ onSelect: () => u(l),
1853
+ children: [
1854
+ l.icon && l.icon,
1855
+ /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col overflow-hidden", children: [
1856
+ /* @__PURE__ */ n.jsx("span", { className: "truncate text-accent-foreground", title: l.label, children: l.label }),
1857
+ l.detail && /* @__PURE__ */ n.jsx("span", { className: "truncate text-sm text-muted-foreground", title: l.detail, children: l.detail })
1858
+ ] }),
1859
+ /* @__PURE__ */ n.jsx(xe, { className: "ms-auto text-primary opacity-0" })
1860
+ ]
1861
+ },
1862
+ String(l.value)
1863
+ )) })
1864
+ ] }),
1865
+ o && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
1866
+ (r.length > 0 || t.length > 0) && /* @__PURE__ */ n.jsx(fe, {}),
1867
+ /* @__PURE__ */ n.jsx("div", { className: "p-1.5", children: /* @__PURE__ */ n.jsxs(
1868
+ "button",
1869
+ {
1870
+ className: "flex w-full items-center justify-center rounded-xs px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-50",
1871
+ disabled: a,
1872
+ type: "button",
1873
+ onClick: i,
1874
+ children: [
1875
+ a && /* @__PURE__ */ n.jsx(Xe, { className: "mr-2 size-4 animate-spin" }),
1876
+ a ? d.i18n.loading : d.i18n.loadMore
1877
+ ]
1878
+ }
1879
+ ) })
1880
+ ] })
1881
+ ] });
1882
+ }
1883
+ function br({
1884
+ field: e,
1885
+ values: r,
1886
+ onChange: t,
1887
+ onClose: s,
1888
+ inline: a = !1,
1889
+ searchInput: o,
1890
+ onSearchChange: i,
1891
+ shouldClientFilter: c,
1892
+ isInitialLoad: u,
1893
+ isSearching: d,
1894
+ isLoadingMore: l,
1895
+ hasMore: f,
1896
+ onLoadMore: x
1897
+ }) {
1898
+ var g;
1899
+ const [m, y] = H(!1), [b, j] = H([]), S = pe(), O = e.type === "multiselect" || r.length > 1, A = U(() => e.value ?? r, [e.value, r]);
1900
+ V(() => {
1901
+ m && e.searchable !== !1 && setTimeout(() => {
1902
+ const k = document.querySelector("[cmdk-input]");
1903
+ k && k.focus();
1904
+ }, 0);
1905
+ }, [m, e.searchable]);
1906
+ const $ = U(
1907
+ () => {
1908
+ var k;
1909
+ return ((k = e.options) == null ? void 0 : k.filter((R) => A.includes(R.value))) || [];
1910
+ },
1911
+ [e.options, A]
1912
+ );
1913
+ V(() => {
1914
+ if (A.length === 0) {
1915
+ j([]);
1916
+ return;
1917
+ }
1918
+ $.length > 0 && j((k) => {
1919
+ const R = [];
1920
+ for (const B of A) {
1921
+ const W = $.find((Z) => Z.value === B) ?? k.find((Z) => Z.value === B);
1922
+ W && R.push(W);
1923
+ }
1924
+ return R;
1925
+ });
1926
+ }, [$, A]);
1927
+ const C = U(() => A.length === 0 ? [] : b.length > 0 ? b : $, [b, A.length, $]), L = U(() => Pa(C, o), [o, C]), ne = ((g = e.options) == null ? void 0 : g.filter((k) => !A.includes(k.value))) || [], ee = (k) => {
1928
+ i(k);
1929
+ }, X = () => {
1930
+ y(!1), setTimeout(() => i(""), tt), s == null || s();
1931
+ };
1932
+ return a ? /* @__PURE__ */ n.jsx("div", { className: "w-full", children: /* @__PURE__ */ n.jsxs(Re, { shouldFilter: c, children: [
1933
+ /* @__PURE__ */ n.jsx(
1934
+ yt,
1935
+ {
1936
+ className: "h-8.5 pr-8 text-sm",
1937
+ isSearching: d,
1938
+ label: e.label,
1939
+ searchable: e.searchable !== !1,
1940
+ searchInput: o,
1941
+ onSearchChange: ee
1942
+ }
1943
+ ),
1944
+ /* @__PURE__ */ n.jsx(
1945
+ wt,
1946
+ {
1947
+ contextLabel: e.label || "Selected",
1948
+ hasMore: f,
1949
+ isInitialLoad: u,
1950
+ isLoadingMore: l,
1951
+ selectedOptions: L,
1952
+ unselectedOptions: ne,
1953
+ onLoadMore: x,
1954
+ onSelectSelected: (k) => {
1955
+ if (O) {
1956
+ const R = A.filter((B) => B !== k.value);
1957
+ e.onValueChange ? e.onValueChange(R) : t(R);
1958
+ } else
1959
+ e.onValueChange ? e.onValueChange([]) : t([]);
1960
+ },
1961
+ onSelectUnselected: (k) => {
1962
+ if (O) {
1963
+ const R = [...A, k.value];
1964
+ if (e.maxSelections && R.length > e.maxSelections)
1965
+ return;
1966
+ e.onValueChange ? e.onValueChange(R) : t(R), e.autoCloseOnSelect && (s == null || s());
1967
+ } else
1968
+ e.onValueChange ? e.onValueChange([k.value]) : t([k.value]), s == null || s();
1969
+ }
1970
+ }
1971
+ )
1972
+ ] }) }) : /* @__PURE__ */ n.jsxs(
1973
+ mt,
1974
+ {
1975
+ open: m,
1976
+ onOpenChange: (k) => {
1977
+ y(k), k || setTimeout(() => i(""), tt);
1978
+ },
1979
+ children: [
1980
+ /* @__PURE__ */ n.jsx(
1981
+ vt,
1982
+ {
1983
+ className: I(Se({
1984
+ variant: S.variant,
1985
+ size: S.size,
1986
+ cursorPointer: S.cursorPointer
1987
+ }), e.triggerClassName ?? "max-w-[240px]"),
1988
+ children: /* @__PURE__ */ n.jsx("div", { className: "flex min-w-0 items-center gap-1.5", children: e.customValueRenderer ? e.customValueRenderer(r, e.options || []) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
1989
+ C.length > 0 && C.some((k) => k.icon) && /* @__PURE__ */ n.jsx("div", { className: I("-space-x-0.5 flex shrink-0 items-center", e.selectedOptionsClassName), children: C.slice(0, 3).map((k) => /* @__PURE__ */ n.jsx("div", { children: k.icon }, String(k.value))) }),
1990
+ C.length === 1 ? /* @__PURE__ */ n.jsx("span", { className: "min-w-0 truncate text-accent-foreground", title: C[0].detail ? `${C[0].label} - ${C[0].detail}` : C[0].label, children: C[0].label }) : C.length > 1 ? `${C.length} ${S.i18n.selectedCount}` : S.i18n.select
1991
+ ] }) })
1992
+ }
1993
+ ),
1994
+ /* @__PURE__ */ n.jsx(
1995
+ Ke,
1996
+ {
1997
+ align: "start",
1998
+ className: I(
1999
+ "p-0 data-[state=closed]:animation-none! data-[state=closed]:duration-0!",
2000
+ e.className || "w-[200px]"
2001
+ ),
2002
+ children: /* @__PURE__ */ n.jsxs(Re, { shouldFilter: c, children: [
2003
+ /* @__PURE__ */ n.jsx(
2004
+ yt,
2005
+ {
2006
+ className: "h-[34px] pr-8 text-sm",
2007
+ isSearching: d,
2008
+ label: e.label,
2009
+ searchable: e.searchable !== !1,
2010
+ searchInput: o,
2011
+ onSearchChange: ee
2012
+ }
2013
+ ),
2014
+ /* @__PURE__ */ n.jsx(
2015
+ wt,
2016
+ {
2017
+ hasMore: f,
2018
+ isInitialLoad: u,
2019
+ isLoadingMore: l,
2020
+ selectedOptions: L,
2021
+ unselectedOptions: ne,
2022
+ onLoadMore: x,
2023
+ onSelectSelected: (k) => {
2024
+ t(O ? r.filter((R) => R !== k.value) : []), O || (y(!1), X());
2025
+ },
2026
+ onSelectUnselected: (k) => {
2027
+ if (O) {
2028
+ const R = [...r, k.value];
2029
+ if (e.maxSelections && R.length > e.maxSelections)
2030
+ return;
2031
+ t(R), e.autoCloseOnSelect && X();
2032
+ } else
2033
+ t([k.value]), y(!1), X();
2034
+ }
2035
+ }
2036
+ )
2037
+ ] })
2038
+ }
2039
+ )
2040
+ ]
2041
+ }
2042
+ );
2043
+ }
2044
+ function Sa({
2045
+ field: e,
2046
+ values: r,
2047
+ onChange: t,
2048
+ onClose: s,
2049
+ inline: a = !1,
2050
+ searchInput: o,
2051
+ onSearchChange: i
2052
+ }) {
2053
+ const c = U(() => e.value ?? r, [e.value, r]), u = e.valueSource.useOptions({
2054
+ query: o,
2055
+ selectedValues: c
2056
+ }), d = U(() => ({
2057
+ ...e,
2058
+ options: u.options
2059
+ }), [e, u.options]);
2060
+ return /* @__PURE__ */ n.jsx(
2061
+ br,
2062
+ {
2063
+ field: d,
2064
+ hasMore: u.hasMore,
2065
+ inline: a,
2066
+ isInitialLoad: u.isInitialLoad,
2067
+ isLoadingMore: u.isLoadingMore,
2068
+ isSearching: u.isSearching,
2069
+ searchInput: o,
2070
+ shouldClientFilter: !1,
2071
+ values: r,
2072
+ onChange: t,
2073
+ onClose: s,
2074
+ onLoadMore: u.loadMore,
2075
+ onSearchChange: i
2076
+ }
2077
+ );
2078
+ }
2079
+ function yr({
2080
+ field: e,
2081
+ values: r,
2082
+ onChange: t,
2083
+ onClose: s,
2084
+ inline: a = !1
2085
+ }) {
2086
+ var o;
2087
+ const [i, c] = H(""), u = ((o = e.options) == null ? void 0 : o.length) ?? 0;
2088
+ return e.valueSource ? /* @__PURE__ */ n.jsx(
2089
+ Sa,
2090
+ {
2091
+ field: e,
2092
+ inline: a,
2093
+ searchInput: i,
2094
+ values: r,
2095
+ onChange: t,
2096
+ onClose: s,
2097
+ onSearchChange: c
2098
+ },
2099
+ e.valueSource.id
2100
+ ) : /* @__PURE__ */ n.jsx(
2101
+ br,
2102
+ {
2103
+ field: e,
2104
+ hasMore: !1,
2105
+ inline: a,
2106
+ isInitialLoad: !!e.isLoading && u === 0,
2107
+ isLoadingMore: !1,
2108
+ isSearching: !!e.isLoading && u > 0,
2109
+ searchInput: i,
2110
+ shouldClientFilter: !0,
2111
+ values: r,
2112
+ onChange: t,
2113
+ onClose: s,
2114
+ onLoadMore: () => {
2115
+ },
2116
+ onSearchChange: c
2117
+ }
2118
+ );
2119
+ }
2120
+ function _a({ field: e, values: r, onChange: t, operator: s }) {
2121
+ var a, o;
2122
+ const [i, c] = H(!1), [u, d] = H(""), l = pe();
2123
+ if (V(() => {
2124
+ i && e.searchable !== !1 && setTimeout(() => {
2125
+ const m = document.querySelector("[cmdk-input]");
2126
+ m && m.focus();
2127
+ }, 0);
2128
+ }, [i, e.searchable]), s === "empty" || s === "not_empty")
2129
+ return null;
2130
+ if (e.customRenderer)
2131
+ return /* @__PURE__ */ n.jsx(
2132
+ "div",
2133
+ {
2134
+ className: Se({
2135
+ variant: l.variant,
2136
+ size: l.size,
2137
+ cursorPointer: l.cursorPointer
2138
+ }),
2139
+ children: e.customRenderer({ field: e, values: r, onChange: t, operator: s })
2140
+ }
2141
+ );
2142
+ if (e.type === "boolean") {
2143
+ const m = r[0] === !0, y = e.onLabel || l.i18n.true, b = e.offLabel || l.i18n.false;
2144
+ return /* @__PURE__ */ n.jsx(
2145
+ "div",
2146
+ {
2147
+ className: Se({
2148
+ variant: l.variant,
2149
+ size: l.size,
2150
+ cursorPointer: l.cursorPointer
2151
+ }),
2152
+ children: /* @__PURE__ */ n.jsxs("div", { className: "flex items-center gap-2", children: [
2153
+ /* @__PURE__ */ n.jsx(pr, { checked: m, size: "sm", onCheckedChange: (j) => t([j]) }),
2154
+ e.onLabel && e.offLabel && /* @__PURE__ */ n.jsx("span", { className: "text-xs text-muted-foreground", children: m ? y : b })
2155
+ ] })
2156
+ }
2157
+ );
2158
+ }
2159
+ if (e.type === "time") {
2160
+ if (s === "between") {
2161
+ const m = r[0] || "", y = r[1] || "";
2162
+ return /* @__PURE__ */ n.jsxs("div", { className: "flex items-center", "data-slot": "filters-item", children: [
2163
+ /* @__PURE__ */ n.jsx(
2164
+ K,
2165
+ {
2166
+ className: e.className,
2167
+ field: e,
2168
+ type: "time",
2169
+ value: m,
2170
+ onChange: (b) => t([b.target.value, y]),
2171
+ onInputChange: e.onInputChange
2172
+ }
2173
+ ),
2174
+ /* @__PURE__ */ n.jsx(
2175
+ "div",
2176
+ {
2177
+ className: Oe({ variant: l.variant, size: l.size }),
2178
+ "data-slot": "filters-between",
2179
+ children: l.i18n.to
2180
+ }
2181
+ ),
2182
+ /* @__PURE__ */ n.jsx(
2183
+ K,
2184
+ {
2185
+ className: e.className,
2186
+ field: e,
2187
+ type: "time",
2188
+ value: y,
2189
+ onChange: (b) => t([m, b.target.value]),
2190
+ onInputChange: e.onInputChange
2191
+ }
2192
+ )
2193
+ ] });
2194
+ }
2195
+ return /* @__PURE__ */ n.jsx(
2196
+ K,
2197
+ {
2198
+ className: e.className,
2199
+ field: e,
2200
+ type: "time",
2201
+ value: r[0] || "",
2202
+ onChange: (m) => t([m.target.value]),
2203
+ onInputChange: e.onInputChange
2204
+ }
2205
+ );
2206
+ }
2207
+ if (e.type === "datetime") {
2208
+ if (s === "between") {
2209
+ const m = r[0] || "", y = r[1] || "";
2210
+ return /* @__PURE__ */ n.jsxs("div", { className: "flex items-center", "data-slot": "filters-item", children: [
2211
+ /* @__PURE__ */ n.jsx(
2212
+ K,
2213
+ {
2214
+ className: I("w-36 max-w-full", e.className),
2215
+ field: e,
2216
+ type: "datetime-local",
2217
+ value: m,
2218
+ onChange: (b) => t([b.target.value, y]),
2219
+ onInputChange: e.onInputChange
2220
+ }
2221
+ ),
2222
+ /* @__PURE__ */ n.jsx(
2223
+ "div",
2224
+ {
2225
+ className: Oe({ variant: l.variant, size: l.size }),
2226
+ "data-slot": "filters-between",
2227
+ children: l.i18n.to
2228
+ }
2229
+ ),
2230
+ /* @__PURE__ */ n.jsx(
2231
+ K,
2232
+ {
2233
+ className: I("w-36 max-w-full", e.className),
2234
+ field: e,
2235
+ type: "datetime-local",
2236
+ value: y,
2237
+ onChange: (b) => t([m, b.target.value]),
2238
+ onInputChange: e.onInputChange
2239
+ }
2240
+ )
2241
+ ] });
2242
+ }
2243
+ return /* @__PURE__ */ n.jsx(
2244
+ K,
2245
+ {
2246
+ className: I("w-36 max-w-full", e.className),
2247
+ field: e,
2248
+ type: "datetime-local",
2249
+ value: r[0] || "",
2250
+ onChange: (m) => t([m.target.value]),
2251
+ onInputChange: e.onInputChange
2252
+ }
2253
+ );
2254
+ }
2255
+ if (["email", "url", "tel"].includes(e.type || "")) {
2256
+ const m = () => {
2257
+ switch (e.type) {
2258
+ case "email":
2259
+ return "email";
2260
+ case "url":
2261
+ return "url";
2262
+ case "tel":
2263
+ return "tel";
2264
+ default:
2265
+ return "text";
2266
+ }
2267
+ }, y = () => {
2268
+ switch (e.type) {
2269
+ case "email":
2270
+ return "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
2271
+ case "url":
2272
+ return "^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$";
2273
+ case "tel":
2274
+ return "^[\\+]?[1-9][\\d]{0,15}$";
2275
+ default:
2276
+ return;
2277
+ }
2278
+ };
2279
+ return /* @__PURE__ */ n.jsx(
2280
+ K,
2281
+ {
2282
+ className: e.className,
2283
+ field: e,
2284
+ pattern: e.pattern || y(),
2285
+ placeholder: e.placeholder || l.i18n.placeholders.enterField(e.type || "text"),
2286
+ type: m(),
2287
+ value: r[0] || "",
2288
+ onChange: (b) => t([b.target.value]),
2289
+ onInputChange: e.onInputChange
2290
+ }
2291
+ );
2292
+ }
2293
+ if (e.type === "daterange") {
2294
+ const m = r[0] || "", y = r[1] || "";
2295
+ return /* @__PURE__ */ n.jsxs(
2296
+ "div",
2297
+ {
2298
+ className: Se({
2299
+ variant: l.variant,
2300
+ size: l.size,
2301
+ cursorPointer: l.cursorPointer
2302
+ }),
2303
+ children: [
2304
+ /* @__PURE__ */ n.jsx(
2305
+ K,
2306
+ {
2307
+ className: I("w-24 max-w-full", e.className),
2308
+ field: e,
2309
+ type: "date",
2310
+ value: m,
2311
+ onChange: (b) => t([b.target.value, y]),
2312
+ onInputChange: e.onInputChange
2313
+ }
2314
+ ),
2315
+ /* @__PURE__ */ n.jsx(
2316
+ "div",
2317
+ {
2318
+ className: Oe({ variant: l.variant, size: l.size }),
2319
+ "data-slot": "filters-between",
2320
+ children: l.i18n.to
2321
+ }
2322
+ ),
2323
+ /* @__PURE__ */ n.jsx(
2324
+ K,
2325
+ {
2326
+ className: I("w-24 max-w-full", e.className),
2327
+ field: e,
2328
+ type: "date",
2329
+ value: y,
2330
+ onChange: (b) => t([m, b.target.value]),
2331
+ onInputChange: e.onInputChange
2332
+ }
2333
+ )
2334
+ ]
2335
+ }
2336
+ );
2337
+ }
2338
+ if (e.type === "text" || e.type === "number") {
2339
+ if (e.type === "number" && s === "between") {
2340
+ const m = r[0] || "", y = r[1] || "";
2341
+ return /* @__PURE__ */ n.jsxs("div", { className: "flex items-center", "data-slot": "filters-item", children: [
2342
+ /* @__PURE__ */ n.jsx(
2343
+ K,
2344
+ {
2345
+ className: I("w-16 max-w-full", e.className),
2346
+ field: e,
2347
+ max: e.max,
2348
+ min: e.min,
2349
+ pattern: e.pattern,
2350
+ placeholder: l.i18n.min,
2351
+ step: e.step,
2352
+ type: "number",
2353
+ value: m,
2354
+ onChange: (b) => t([b.target.value, y]),
2355
+ onInputChange: e.onInputChange
2356
+ }
2357
+ ),
2358
+ /* @__PURE__ */ n.jsx(
2359
+ "div",
2360
+ {
2361
+ className: Oe({ variant: l.variant, size: l.size }),
2362
+ "data-slot": "filters-between",
2363
+ children: l.i18n.to
2364
+ }
2365
+ ),
2366
+ /* @__PURE__ */ n.jsx(
2367
+ K,
2368
+ {
2369
+ className: I("w-16 max-w-full", e.className),
2370
+ field: e,
2371
+ max: e.max,
2372
+ min: e.min,
2373
+ pattern: e.pattern,
2374
+ placeholder: l.i18n.max,
2375
+ step: e.step,
2376
+ type: "number",
2377
+ value: y,
2378
+ onChange: (b) => t([m, b.target.value]),
2379
+ onInputChange: e.onInputChange
2380
+ }
2381
+ )
2382
+ ] });
2383
+ }
2384
+ return /* @__PURE__ */ n.jsx("div", { className: "flex items-center", "data-slot": "filters-item", children: /* @__PURE__ */ n.jsx(
2385
+ K,
2386
+ {
2387
+ className: I("w-36", e.className),
2388
+ field: e,
2389
+ max: e.type === "number" ? e.max : void 0,
2390
+ min: e.type === "number" ? e.min : void 0,
2391
+ pattern: e.pattern,
2392
+ placeholder: e.placeholder,
2393
+ step: e.type === "number" ? e.step : void 0,
2394
+ type: e.type === "number" ? "number" : "text",
2395
+ value: r[0] || "",
2396
+ onChange: (m) => t([m.target.value]),
2397
+ onInputChange: e.onInputChange
2398
+ }
2399
+ ) });
2400
+ }
2401
+ if (e.type === "date")
2402
+ return /* @__PURE__ */ n.jsx(
2403
+ K,
2404
+ {
2405
+ className: I("w-16", e.className),
2406
+ field: e,
2407
+ type: "date",
2408
+ value: r[0] || "",
2409
+ onChange: (m) => t([m.target.value]),
2410
+ onInputChange: e.onInputChange
2411
+ }
2412
+ );
2413
+ if (e.type === "select" || e.type === "multiselect")
2414
+ return /* @__PURE__ */ n.jsx(yr, { field: e, values: r, onChange: t });
2415
+ const f = r.length > 1, x = ((a = e.options) == null ? void 0 : a.filter((m) => r.includes(m.value))) || [], g = ((o = e.options) == null ? void 0 : o.filter((m) => !r.includes(m.value))) || [];
2416
+ return /* @__PURE__ */ n.jsxs(
2417
+ mt,
2418
+ {
2419
+ open: i,
2420
+ onOpenChange: (m) => {
2421
+ c(m), m || setTimeout(() => d(""), tt);
2422
+ },
2423
+ children: [
2424
+ /* @__PURE__ */ n.jsx(
2425
+ vt,
2426
+ {
2427
+ className: Se({
2428
+ variant: l.variant,
2429
+ size: l.size,
2430
+ cursorPointer: l.cursorPointer
2431
+ }),
2432
+ children: /* @__PURE__ */ n.jsx("div", { className: "flex w-full min-w-0 items-center gap-1.5", children: e.customValueRenderer ? e.customValueRenderer(r, e.options || []) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
2433
+ x.length > 0 && /* @__PURE__ */ n.jsx("div", { className: "flex shrink-0 items-center -space-x-1.5", children: x.slice(0, 3).map((m) => /* @__PURE__ */ n.jsx("div", { children: m.icon }, String(m.value))) }),
2434
+ x.length === 1 ? /* @__PURE__ */ n.jsx("span", { className: "min-w-0 truncate text-accent-foreground", title: x[0].detail ? `${x[0].label} - ${x[0].detail}` : x[0].label, children: x[0].label }) : x.length > 1 ? `${x.length} ${l.i18n.selectedCount}` : l.i18n.select
2435
+ ] }) })
2436
+ }
2437
+ ),
2438
+ /* @__PURE__ */ n.jsx(Ke, { className: I("w-36 p-0 data-[state=closed]:animation-none! data-[state=closed]:duration-0!", e.popoverContentClassName), children: /* @__PURE__ */ n.jsxs(Re, { children: [
2439
+ e.searchable !== !1 && /* @__PURE__ */ n.jsx(
2440
+ ut,
2441
+ {
2442
+ className: "h-[34px] text-sm",
2443
+ placeholder: l.i18n.placeholders.searchField(e.label || ""),
2444
+ value: u,
2445
+ onValueChange: d
2446
+ }
2447
+ ),
2448
+ /* @__PURE__ */ n.jsxs(dt, { className: "outline-hidden", children: [
2449
+ /* @__PURE__ */ n.jsx(pt, { children: l.i18n.noResultsFound }),
2450
+ x.length > 0 && /* @__PURE__ */ n.jsx(we, { children: x.map((m) => /* @__PURE__ */ n.jsxs(
2451
+ ce,
2452
+ {
2453
+ className: "group flex items-center gap-2",
2454
+ onSelect: () => {
2455
+ t(f ? r.filter((y) => y !== m.value) : []), f || c(!1);
2456
+ },
2457
+ children: [
2458
+ m.icon && m.icon,
2459
+ /* @__PURE__ */ n.jsx("span", { className: "truncate text-accent-foreground", children: m.label }),
2460
+ /* @__PURE__ */ n.jsx(xe, { className: "ms-auto text-primary" })
2461
+ ]
2462
+ },
2463
+ String(m.value)
2464
+ )) }),
2465
+ g.length > 0 && /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
2466
+ x.length > 0 && /* @__PURE__ */ n.jsx(fe, {}),
2467
+ /* @__PURE__ */ n.jsx(we, { children: g.map((m) => /* @__PURE__ */ n.jsxs(
2468
+ ce,
2469
+ {
2470
+ className: "group flex items-center gap-2",
2471
+ value: m.label,
2472
+ onSelect: () => {
2473
+ if (f) {
2474
+ const y = [...r, m.value];
2475
+ if (e.maxSelections && y.length > e.maxSelections)
2476
+ return;
2477
+ t(y);
2478
+ } else
2479
+ t([m.value]), c(!1);
2480
+ },
2481
+ children: [
2482
+ m.icon && m.icon,
2483
+ /* @__PURE__ */ n.jsx("span", { className: "truncate text-accent-foreground", children: m.label }),
2484
+ /* @__PURE__ */ n.jsx(xe, { className: "ms-auto text-primary opacity-0" })
2485
+ ]
2486
+ },
2487
+ String(m.value)
2488
+ )) })
2489
+ ] })
2490
+ ] })
2491
+ ] }) })
2492
+ ]
2493
+ }
2494
+ );
2495
+ }
2496
+ function za({
2497
+ filters: e,
2498
+ fields: r,
2499
+ onChange: t,
2500
+ className: s,
2501
+ showAddButton: a = !0,
2502
+ addButtonText: o,
2503
+ addButtonIcon: i,
2504
+ addButtonClassName: c,
2505
+ addButton: u,
2506
+ showClearButton: d = !1,
2507
+ clearButtonText: l,
2508
+ clearButtonIcon: f,
2509
+ clearButtonClassName: x,
2510
+ clearButton: g,
2511
+ onClear: m,
2512
+ variant: y = "outline",
2513
+ size: b = "md",
2514
+ radius: j = "md",
2515
+ i18n: S,
2516
+ showSearchInput: O = !0,
2517
+ cursorPointer: A = !0,
2518
+ trigger: $,
2519
+ allowMultiple: C = !0,
2520
+ popoverContentClassName: L,
2521
+ popoverAlign: ne = "start",
2522
+ keyboardShortcut: ee,
2523
+ onActiveFieldChange: X
2524
+ }) {
2525
+ const [k, R] = H(!1), [B, W] = H(null), [Z, J] = H([]);
2526
+ V(() => {
2527
+ X == null || X(B);
2528
+ }, [B, X]), V(() => {
2529
+ if (!ee)
2530
+ return;
2531
+ const h = (v) => {
2532
+ const P = v.target;
2533
+ P.tagName === "INPUT" || P.tagName === "TEXTAREA" || P.isContentEditable || v.key.toLowerCase() === ee.toLowerCase() && !v.metaKey && !v.ctrlKey && !v.altKey && (v.preventDefault(), R((_) => !_));
2534
+ };
2535
+ return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
2536
+ }, [ee]), V(() => {
2537
+ k && setTimeout(() => {
2538
+ const h = document.querySelector("[cmdk-input]");
2539
+ if (h)
2540
+ h.focus();
2541
+ else {
2542
+ const v = document.querySelector("[cmdk-root]");
2543
+ v && v.focus();
2544
+ }
2545
+ }, 0);
2546
+ }, [k, B, O]);
2547
+ const Q = {
2548
+ ...he,
2549
+ ...S,
2550
+ operators: {
2551
+ ...he.operators,
2552
+ ...S == null ? void 0 : S.operators
2553
+ },
2554
+ placeholders: {
2555
+ ...he.placeholders,
2556
+ ...S == null ? void 0 : S.placeholders
2557
+ },
2558
+ validation: {
2559
+ ...he.validation,
2560
+ ...S == null ? void 0 : S.validation
2561
+ }
2562
+ }, ie = U(() => ja(r), [r]), te = B ? ie[B] : null, Ne = M(
2563
+ (h, v) => {
2564
+ t(
2565
+ e.map((P) => {
2566
+ if (P.id === h) {
2567
+ const _ = { ...P, ...v };
2568
+ return (v.operator === "empty" || v.operator === "not_empty") && (_.values = []), _;
2569
+ }
2570
+ return P;
2571
+ })
2572
+ );
2573
+ },
2574
+ [e, t]
2575
+ ), Ie = M(
2576
+ (h) => {
2577
+ t(e.filter((v) => v.id !== h));
2578
+ },
2579
+ [e, t]
2580
+ ), p = M(() => {
2581
+ R(!1), W(null), J([]);
2582
+ }, []), N = M(
2583
+ (h) => {
2584
+ const v = ie[h];
2585
+ if (!(v != null && v.key))
2586
+ return;
2587
+ if (v.type === "select" || v.type === "multiselect") {
2588
+ if (W(v.key), !C && v.type === "multiselect") {
2589
+ const q = e.find((re) => re.field === h);
2590
+ J(q ? q.values : []);
2591
+ } else
2592
+ J([]);
2593
+ return;
2594
+ }
2595
+ const P = v.defaultOperator || (v.type === "daterange" || v.type === "numberrange" ? "between" : "is");
2596
+ let _ = [];
2597
+ v.defaultValue !== void 0 ? _ = [v.defaultValue] : ["text", "number", "date", "email", "url", "tel", "time", "datetime"].includes(v.type || "") ? _ = [""] : v.type === "daterange" ? _ = ["", ""] : v.type === "numberrange" ? _ = [v.min || 0, v.max || 100] : v.type === "boolean" && (_ = [!1]);
2598
+ const F = jt(h, P, _);
2599
+ t([...e, F]), p();
2600
+ },
2601
+ [C, p, ie, e, t]
2602
+ ), E = M(
2603
+ (h, v, P = !0) => {
2604
+ if (!h.key)
2605
+ return;
2606
+ if (!C) {
2607
+ const q = e.find((re) => re.field === h.key);
2608
+ if (q) {
2609
+ t(e.map((re) => re.id === q.id ? { ...re, values: v } : re)), J(v), P && p();
2610
+ return;
2611
+ }
2612
+ }
2613
+ const _ = h.defaultOperator || (h.type === "multiselect" ? "is_any_of" : "is"), F = jt(h.key, _, v);
2614
+ t([...e, F]), P ? p() : J(v);
2615
+ },
2616
+ [C, p, e, t]
2617
+ ), w = U(() => xr(r).filter((v) => !v.key || v.type === "separator" ? !1 : C ? !0 : !e.some((P) => P.field === v.key)), [r, e, C]);
2618
+ return /* @__PURE__ */ n.jsx(
2619
+ vr.Provider,
2620
+ {
2621
+ value: {
2622
+ variant: y,
2623
+ size: b,
2624
+ radius: j,
2625
+ i18n: Q,
2626
+ cursorPointer: A,
2627
+ className: s,
2628
+ showAddButton: a,
2629
+ addButtonText: o,
2630
+ addButtonIcon: i,
2631
+ addButtonClassName: c,
2632
+ addButton: u,
2633
+ showSearchInput: O,
2634
+ trigger: $,
2635
+ allowMultiple: C
2636
+ },
2637
+ children: /* @__PURE__ */ n.jsxs("div", { className: I(
2638
+ ba({ variant: y, size: b }),
2639
+ e.length > 0 && "w-full",
2640
+ d && e.length > 0 && "sm:pr-24",
2641
+ s
2642
+ ), children: [
2643
+ e.map((h) => {
2644
+ const v = ie[h.field];
2645
+ return v ? /* @__PURE__ */ n.jsxs("div", { className: ya({ variant: y }), "data-slot": "filter-item", children: [
2646
+ /* @__PURE__ */ n.jsxs("div", { className: ga({ variant: y, size: b, radius: j }), children: [
2647
+ v.icon,
2648
+ v.label
2649
+ ] }),
2650
+ /* @__PURE__ */ n.jsx(
2651
+ Na,
2652
+ {
2653
+ field: v,
2654
+ operator: h.operator,
2655
+ values: h.values,
2656
+ onChange: (P) => Ne(h.id, { operator: P })
2657
+ }
2658
+ ),
2659
+ /* @__PURE__ */ n.jsx(
2660
+ _a,
2661
+ {
2662
+ field: v,
2663
+ operator: h.operator,
2664
+ values: h.values,
2665
+ onChange: (P) => Ne(h.id, { values: P })
2666
+ }
2667
+ ),
2668
+ /* @__PURE__ */ n.jsx(wa, { onClick: () => Ie(h.id) })
2669
+ ] }, h.id) : null;
2670
+ }),
2671
+ a && w.length > 0 && /* @__PURE__ */ n.jsxs(
2672
+ mt,
2673
+ {
2674
+ open: k,
2675
+ onOpenChange: (h) => {
2676
+ R(h), h || (W(null), J([]));
2677
+ },
2678
+ children: [
2679
+ /* @__PURE__ */ n.jsx(vt, { asChild: !0, children: u || /* @__PURE__ */ n.jsxs(
2680
+ "button",
2681
+ {
2682
+ className: I(
2683
+ gt({
2684
+ variant: y,
2685
+ size: b,
2686
+ cursorPointer: A,
2687
+ radius: j
2688
+ }),
2689
+ c
2690
+ ),
2691
+ title: Q.addFilterTitle,
2692
+ type: "button",
2693
+ children: [
2694
+ i || /* @__PURE__ */ n.jsx(Rr, {}),
2695
+ o || Q.addFilter
2696
+ ]
2697
+ }
2698
+ ) }),
2699
+ /* @__PURE__ */ n.jsx(
2700
+ Ke,
2701
+ {
2702
+ align: ne,
2703
+ className: I(
2704
+ "p-0 data-[state=closed]:animation-none! data-[state=closed]:duration-0!",
2705
+ (te == null ? void 0 : te.className) || L || "w-[220px]"
2706
+ ),
2707
+ children: te ? (
2708
+ // Show original select/multiselect rendering without back button
2709
+ // SelectOptionsPopover renders its own Command component when inline={true}
2710
+ /* @__PURE__ */ n.jsx(
2711
+ yr,
2712
+ {
2713
+ field: te,
2714
+ inline: !0,
2715
+ values: Z,
2716
+ onChange: (h) => {
2717
+ const v = te.type === "select";
2718
+ E(te, h, v);
2719
+ },
2720
+ onClose: p
2721
+ }
2722
+ )
2723
+ ) : (
2724
+ // Show field selection - needs Command wrapper for search/list
2725
+ /* @__PURE__ */ n.jsxs(Re, { className: "outline-hidden", tabIndex: O ? void 0 : 0, children: [
2726
+ O && /* @__PURE__ */ n.jsx(ut, { className: "h-[34px]", placeholder: Q.searchFields }),
2727
+ /* @__PURE__ */ n.jsxs(dt, { className: "outline-hidden", children: [
2728
+ /* @__PURE__ */ n.jsx(pt, { children: Q.noFieldsFound }),
2729
+ r.map((h, v) => {
2730
+ if (hr(h)) {
2731
+ const _ = h.fields.filter((F) => F.type === "separator" || C ? !0 : !e.some((q) => q.field === F.key));
2732
+ return _.length === 0 ? null : /* @__PURE__ */ n.jsx(we, { heading: h.group || "Fields", children: _.map((F, q) => {
2733
+ if (F.type === "separator") {
2734
+ const re = F.key ?? `${h.group ?? `group-${v}`}-separator-${q}`;
2735
+ return /* @__PURE__ */ n.jsx(fe, {}, re);
2736
+ }
2737
+ return /* @__PURE__ */ n.jsxs(
2738
+ ce,
2739
+ {
2740
+ className: "min-w-0",
2741
+ onSelect: () => F.key && N(F.key),
2742
+ children: [
2743
+ F.icon,
2744
+ /* @__PURE__ */ n.jsx("span", { className: "truncate", children: F.label })
2745
+ ]
2746
+ },
2747
+ F.key ?? `${h.group ?? `group-${v}`}-field-${q}`
2748
+ );
2749
+ }) }, h.group || `group-${v}`);
2750
+ }
2751
+ if (fr(h)) {
2752
+ const _ = h.fields.filter((F) => F.type === "separator" || C ? !0 : !e.some((q) => q.field === F.key));
2753
+ return _.length === 0 ? null : /* @__PURE__ */ n.jsx(we, { heading: h.group || "Fields", children: _.map((F) => {
2754
+ if (F.type === "separator") {
2755
+ const q = F.key || `${h.group || `group-${v}`}-separator-${F.label || Math.random()}`;
2756
+ return /* @__PURE__ */ n.jsx(fe, {}, q);
2757
+ }
2758
+ return /* @__PURE__ */ n.jsxs(ce, { className: "min-w-0", onSelect: () => F.key && N(F.key), children: [
2759
+ F.icon,
2760
+ /* @__PURE__ */ n.jsx("span", { className: "truncate", children: F.label })
2761
+ ] }, F.key);
2762
+ }) }, h.group || `group-${v}`);
2763
+ }
2764
+ const P = h;
2765
+ if (P.type === "separator") {
2766
+ const _ = P.key || `flat-separator-${P.label || v}`;
2767
+ return /* @__PURE__ */ n.jsx(fe, {}, _);
2768
+ }
2769
+ return !C && e.some((_) => _.field === P.key) ? null : /* @__PURE__ */ n.jsxs(ce, { className: "min-w-0", onSelect: () => P.key && N(P.key), children: [
2770
+ P.icon,
2771
+ /* @__PURE__ */ n.jsx("span", { className: "truncate", children: P.label })
2772
+ ] }, P.key);
2773
+ })
2774
+ ] })
2775
+ ] })
2776
+ )
2777
+ }
2778
+ )
2779
+ ]
2780
+ }
2781
+ ),
2782
+ d && e.length > 0 && (g || /* @__PURE__ */ n.jsxs(
2783
+ "button",
2784
+ {
2785
+ className: I(
2786
+ gt({
2787
+ variant: y,
2788
+ size: b,
2789
+ cursorPointer: A,
2790
+ radius: j
2791
+ }),
2792
+ "border-0 bg-transparent hover:bg-transparent hover:text-foreground",
2793
+ "sm:absolute sm:right-0 sm:top-0",
2794
+ x
2795
+ ),
2796
+ type: "button",
2797
+ onClick: () => {
2798
+ m ? m() : t([]);
2799
+ },
2800
+ children: [
2801
+ f || /* @__PURE__ */ n.jsx(St, {}),
2802
+ l || Q.clearFilters
2803
+ ]
2804
+ }
2805
+ ))
2806
+ ] })
2807
+ }
2808
+ );
2809
+ }
2810
+ const jt = (e, r, t = []) => ({
2811
+ id: `${Date.now()}-${Math.random().toString(36).substring(2, 11)}`,
2812
+ field: e,
2813
+ operator: r || "is",
2814
+ values: t
2815
+ });
2816
+ export {
2817
+ Re as C,
2818
+ za as F,
2819
+ mt as P,
2820
+ Oa as T,
2821
+ Yr as V,
2822
+ ma as a,
2823
+ va as b,
2824
+ jt as c,
2825
+ mr as d,
2826
+ vt as e,
2827
+ Ke as f,
2828
+ dt as g,
2829
+ pt as h,
2830
+ we as i,
2831
+ ce as j,
2832
+ Ia as k,
2833
+ qr as u
2834
+ };
2835
+ //# sourceMappingURL=filters-BsCI4RJg.mjs.map