admin-ui-starter-kit 0.6.1 → 0.6.4

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 (498) hide show
  1. package/.agents/skills/component-library-rules/references/components/services__hooks.md +6 -1
  2. package/dist/_shared/{auth-B_KVUjsB.cjs → auth-DdezEtKK.cjs} +2 -2
  3. package/dist/_shared/{auth-B_KVUjsB.cjs.map → auth-DdezEtKK.cjs.map} +1 -1
  4. package/dist/_shared/{auth-C_TgyzDl.js → auth-e7yab9pK.js} +2 -2
  5. package/dist/_shared/{auth-C_TgyzDl.js.map → auth-e7yab9pK.js.map} +1 -1
  6. package/dist/_shared/{buttons-C8jy-jMd.cjs → buttons-Bek9F7qK.cjs} +2 -2
  7. package/dist/_shared/{buttons-C8jy-jMd.cjs.map → buttons-Bek9F7qK.cjs.map} +1 -1
  8. package/dist/_shared/{buttons-MxvdokeK.js → buttons-DcynMPnE.js} +2 -2
  9. package/dist/_shared/{buttons-MxvdokeK.js.map → buttons-DcynMPnE.js.map} +1 -1
  10. package/dist/_shared/cards-CbbHly7W.cjs +2 -0
  11. package/dist/_shared/cards-CbbHly7W.cjs.map +1 -0
  12. package/dist/_shared/{cards-CtBoSZG9.js → cards-RZxRLx3f.js} +6 -6
  13. package/dist/_shared/cards-RZxRLx3f.js.map +1 -0
  14. package/dist/_shared/{comments-DGBxF9fD.js → comments-BJqgvSFY.js} +2 -2
  15. package/dist/_shared/{comments-DGBxF9fD.js.map → comments-BJqgvSFY.js.map} +1 -1
  16. package/dist/_shared/{comments-C8iXy9XO.cjs → comments-BjPciQfo.cjs} +2 -2
  17. package/dist/_shared/{comments-C8iXy9XO.cjs.map → comments-BjPciQfo.cjs.map} +1 -1
  18. package/dist/_shared/{data-display-C_44_V-W.cjs → data-display-C21skrV4.cjs} +2 -2
  19. package/dist/_shared/{data-display-C_44_V-W.cjs.map → data-display-C21skrV4.cjs.map} +1 -1
  20. package/dist/_shared/{data-display-CRFaMkxT.js → data-display-C5-1dZua.js} +71 -71
  21. package/dist/_shared/{data-display-CRFaMkxT.js.map → data-display-C5-1dZua.js.map} +1 -1
  22. package/dist/_shared/{forms-qnwoUqxf.js → forms-BoquZE2Y.js} +3 -3
  23. package/dist/_shared/{forms-qnwoUqxf.js.map → forms-BoquZE2Y.js.map} +1 -1
  24. package/dist/_shared/{forms-rmKcy5uO.cjs → forms-CzrEYejY.cjs} +2 -2
  25. package/dist/_shared/{forms-rmKcy5uO.cjs.map → forms-CzrEYejY.cjs.map} +1 -1
  26. package/dist/_shared/{overlays-CdtMAkKG.js → overlays-DW8OIK5R.js} +134 -47
  27. package/dist/_shared/overlays-DW8OIK5R.js.map +1 -0
  28. package/dist/_shared/overlays-Du65iCkx.cjs +2 -0
  29. package/dist/_shared/overlays-Du65iCkx.cjs.map +1 -0
  30. package/dist/_shared/{page-C6EzwvTz.cjs → page-D8UMXREv.cjs} +2 -2
  31. package/dist/_shared/{page-C6EzwvTz.cjs.map → page-D8UMXREv.cjs.map} +1 -1
  32. package/dist/_shared/{page-DCW1eWCJ.js → page-D9LNsHMN.js} +2 -2
  33. package/dist/_shared/{page-DCW1eWCJ.js.map → page-D9LNsHMN.js.map} +1 -1
  34. package/dist/_shared/{settings-QOBrbgdN.js → settings-BeZOIEJB.js} +2 -2
  35. package/dist/_shared/{settings-QOBrbgdN.js.map → settings-BeZOIEJB.js.map} +1 -1
  36. package/dist/_shared/{settings-DbAyxMrX.cjs → settings-DI-K34bW.cjs} +2 -2
  37. package/dist/_shared/{settings-DbAyxMrX.cjs.map → settings-DI-K34bW.cjs.map} +1 -1
  38. package/dist/_shared/{table-CUA_A-oO.js → table-B_pqCQxC.js} +3 -3
  39. package/dist/_shared/table-B_pqCQxC.js.map +1 -0
  40. package/dist/_shared/table-CGVOXtdv.cjs +2 -0
  41. package/dist/_shared/table-CGVOXtdv.cjs.map +1 -0
  42. package/dist/components/base/buttons/index.cjs +1 -1
  43. package/dist/components/base/buttons/index.js +1 -1
  44. package/dist/components/base/cards/index.cjs +1 -1
  45. package/dist/components/base/cards/index.js +1 -1
  46. package/dist/components/base/forms/index.cjs +1 -1
  47. package/dist/components/base/forms/index.js +1 -1
  48. package/dist/components/base/table/index.cjs +1 -1
  49. package/dist/components/base/table/index.js +1 -1
  50. package/dist/components/composed/admin/index.cjs +1 -1
  51. package/dist/components/composed/admin/index.js +2 -2
  52. package/dist/components/composed/ai/index.cjs +1 -1
  53. package/dist/components/composed/ai/index.js +2 -2
  54. package/dist/components/composed/analytics/index.cjs +1 -1
  55. package/dist/components/composed/analytics/index.js +1 -1
  56. package/dist/components/composed/cards/index.cjs +1 -1
  57. package/dist/components/composed/cards/index.js +2 -2
  58. package/dist/components/composed/commerce/index.cjs +1 -1
  59. package/dist/components/composed/commerce/index.js +2 -2
  60. package/dist/components/composed/dark-surfaces/index.cjs +1 -1
  61. package/dist/components/composed/dark-surfaces/index.js +1 -1
  62. package/dist/components/composed/data-display/index.cjs +1 -1
  63. package/dist/components/composed/data-display/index.js +1 -1
  64. package/dist/components/composed/data-display/metadata/metadata-list.d.ts.map +1 -1
  65. package/dist/components/composed/navigation/index.cjs +1 -1
  66. package/dist/components/composed/navigation/index.js +1 -1
  67. package/dist/components/composed/timelines/index.cjs +1 -1
  68. package/dist/components/composed/timelines/index.js +1 -1
  69. package/dist/components/features/activities/index.cjs +1 -1
  70. package/dist/components/features/activities/index.js +1 -1
  71. package/dist/components/features/card/index.cjs +1 -1
  72. package/dist/components/features/card/index.js +2 -2
  73. package/dist/components/features/comments/index.cjs +1 -1
  74. package/dist/components/features/comments/index.js +1 -1
  75. package/dist/components/features/event-log/index.cjs +1 -1
  76. package/dist/components/features/event-log/index.js +2 -2
  77. package/dist/components/features/media-library/index.cjs +1 -1
  78. package/dist/components/features/media-library/index.js +2 -2
  79. package/dist/components/features/overlays/hooks/index.d.ts +1 -0
  80. package/dist/components/features/overlays/hooks/index.d.ts.map +1 -1
  81. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +33 -0
  82. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts.map +1 -0
  83. package/dist/components/features/overlays/index.cjs +1 -1
  84. package/dist/components/features/overlays/index.d.ts +1 -1
  85. package/dist/components/features/overlays/index.d.ts.map +1 -1
  86. package/dist/components/features/overlays/index.js +2 -2
  87. package/dist/components/features/products/index.cjs +1 -1
  88. package/dist/components/features/products/index.js +4 -4
  89. package/dist/components/features/resource/index.cjs +1 -1
  90. package/dist/components/features/resource/index.js +2 -2
  91. package/dist/components/features/schema-form/index.cjs +1 -1
  92. package/dist/components/features/schema-form/index.js +2 -2
  93. package/dist/components/layout/auth/index.cjs +1 -1
  94. package/dist/components/layout/auth/index.js +1 -1
  95. package/dist/components/layout/index.cjs +1 -1
  96. package/dist/components/layout/index.js +3 -3
  97. package/dist/components/layout/page/index.cjs +1 -1
  98. package/dist/components/layout/page/index.js +1 -1
  99. package/dist/components/layout/settings/index.cjs +1 -1
  100. package/dist/components/layout/settings/index.js +1 -1
  101. package/dist/services/actions/index.cjs +1 -1
  102. package/dist/services/actions/index.js +1 -1
  103. package/dist/showcase/assets/{AreaChart-CGkuyNyy.js → AreaChart-Y0ZwblHU.js} +1 -1
  104. package/dist/showcase/assets/{CompositeItem-DAQ048AO.js → CompositeItem-BIY_Cp7P.js} +1 -1
  105. package/dist/showcase/assets/{CompositeRoot-8-OuCMMq.js → CompositeRoot-DSPvBRQr.js} +1 -1
  106. package/dist/showcase/assets/{DialogTrigger-1P-jwcoH.js → DialogTrigger-DHUp8vXe.js} +1 -1
  107. package/dist/showcase/assets/{LabelableContext-BDyZArAc.js → LabelableContext-CasUI4hR.js} +1 -1
  108. package/dist/showcase/assets/{PreviewLayout-wYGhlcJt.js → PreviewLayout-B_l930k0.js} +1 -1
  109. package/dist/showcase/assets/{RadioGroup-DuiI4W--.js → RadioGroup-BgZ-UH79.js} +1 -1
  110. package/dist/showcase/assets/{ScrollAreaCorner-Df5uTkWT.js → ScrollAreaCorner-BbwFElLA.js} +1 -1
  111. package/dist/showcase/assets/{Separator-BuTBo5a_.js → Separator-dQuencsA.js} +1 -1
  112. package/dist/showcase/assets/{ToolbarRootContext-B4S4Fn7d.js → ToolbarRootContext-BE0hbejq.js} +1 -1
  113. package/dist/showcase/assets/{accordion-D3beuJpC.js → accordion-D93ZNsLn.js} +1 -1
  114. package/dist/showcase/assets/{accordion-variants-BTMpfSPI.js → accordion-variants-Bl4bIQH4.js} +1 -1
  115. package/dist/showcase/assets/{action-menu-DsAr1OqF.js → action-menu--rEgMzDi.js} +1 -1
  116. package/dist/showcase/assets/{actions-BzyHAEZR.js → actions-3iedOWD9.js} +1 -1
  117. package/dist/showcase/assets/{activities-BgoelWKu.js → activities-CyrAWFlu.js} +1 -1
  118. package/dist/showcase/assets/{activities-feed-card-DI4MIm3-.js → activities-feed-card-bhIATc2O.js} +1 -1
  119. package/dist/showcase/assets/{admin-n-JemkNh.js → admin-CZzNsj2q.js} +1 -1
  120. package/dist/showcase/assets/{ai-BXyk1mT0.js → ai-CasHwkW4.js} +1 -1
  121. package/dist/showcase/assets/{ai-artifact-C8CmZ94f.js → ai-artifact-BgWvrLAb.js} +1 -1
  122. package/dist/showcase/assets/{ai-chat-CTQQ4e4X.js → ai-chat-seS9aW-1.js} +1 -1
  123. package/dist/showcase/assets/{ai-elements-DGnlBq8E.js → ai-elements-Tku5_ous.js} +1 -1
  124. package/dist/showcase/assets/{ai-tool-call-bHnWNBtN.js → ai-tool-call-BU6xbmXG.js} +1 -1
  125. package/dist/showcase/assets/{alert-bPnj3_cC.js → alert-6Emt6KX2.js} +1 -1
  126. package/dist/showcase/assets/{alert-CIHGXUul.js → alert-B6aLWiRW.js} +1 -1
  127. package/dist/showcase/assets/{alert-N79A6qIx.js → alert-CtoTQ0vN.js} +1 -1
  128. package/dist/showcase/assets/{api-key-list-Bf1KoRJq.js → api-key-list-C0glWR3z.js} +1 -1
  129. package/dist/showcase/assets/{api-key-list-DyZ_DaRx.js → api-key-list-DcWSbY3u.js} +1 -1
  130. package/dist/showcase/assets/{app-sidebar-Co0LUSvz.js → app-sidebar-D_eNP_jh.js} +1 -1
  131. package/dist/showcase/assets/arrow-down-qyKZ1H5j.js +1 -0
  132. package/dist/showcase/assets/arrow-left-C9I0h_su.js +1 -0
  133. package/dist/showcase/assets/arrow-right-DswaRsr6.js +1 -0
  134. package/dist/showcase/assets/arrow-up-5BijPOxK.js +1 -0
  135. package/dist/showcase/assets/arrow-up-right-CbVVNT6g.js +1 -0
  136. package/dist/showcase/assets/{avatar-DKLsNeBi.js → avatar-BYHVCvVW.js} +1 -1
  137. package/dist/showcase/assets/{avatar-D3kvVy00.js → avatar-BlLAVC87.js} +1 -1
  138. package/dist/showcase/assets/{avatar-CJaCYGWf.js → avatar-DQTXjcS4.js} +1 -1
  139. package/dist/showcase/assets/{avatar-CxwFyL4T.js → avatar-DveZy09C.js} +1 -1
  140. package/dist/showcase/assets/{badge-CSMmwDLr.js → badge-Bth3mRTh.js} +1 -1
  141. package/dist/showcase/assets/{badge-check-TQRmqI7C.js → badge-check-DocF8Ho3.js} +1 -1
  142. package/dist/showcase/assets/{bell-CwRy7zpP.js → bell-DXBoeAzi.js} +1 -1
  143. package/dist/showcase/assets/{bot-Bt02Uzhq.js → bot-Ch-Y1HK8.js} +1 -1
  144. package/dist/showcase/assets/{box-Bfv5RQBf.js → box-72m9QSDa.js} +1 -1
  145. package/dist/showcase/assets/{braces-CxUoAPd4.js → braces-CC17X3TE.js} +1 -1
  146. package/dist/showcase/assets/{brain-CNapE0CP.js → brain-Dvbla_5x.js} +1 -1
  147. package/dist/showcase/assets/{brand-CBq1YoS0.js → brand-D5ciAq8v.js} +1 -1
  148. package/dist/showcase/assets/{breadcrumb-DyXpErBT.js → breadcrumb-BBCaOVyz.js} +1 -1
  149. package/dist/showcase/assets/{breadcrumb-DRioiUd_.js → breadcrumb-Bt8yVTCj.js} +1 -1
  150. package/dist/showcase/assets/{breadcrumbs-BzHeoItO.js → breadcrumbs-CkVWfcAN.js} +1 -1
  151. package/dist/showcase/assets/{briefcase-N74Hu0O2.js → briefcase-8rQTJwpE.js} +1 -1
  152. package/dist/showcase/assets/{building-2-D81ygy-F.js → building-2-CV7gTtXz.js} +1 -1
  153. package/dist/showcase/assets/{button-Bgqg7AmN.js → button-HGjoBio3.js} +1 -1
  154. package/dist/showcase/assets/{button-group-DPV1XIW3.js → button-group-LWToSCrp.js} +1 -1
  155. package/dist/showcase/assets/{buttons-qpZWlILG.js → buttons-Bn_dX6Kk.js} +1 -1
  156. package/dist/showcase/assets/{calendar-DcYyOrNY.js → calendar-BTsffmY8.js} +1 -1
  157. package/dist/showcase/assets/{calendar-BXG5CwbY.js → calendar-Bhpyn4u0.js} +1 -1
  158. package/dist/showcase/assets/{calendar-D-CSqGtC.js → calendar-DjrUTKcD.js} +1 -1
  159. package/dist/showcase/assets/{calendar-days-CNNiyV9e.js → calendar-days-BKCkzWjV.js} +1 -1
  160. package/dist/showcase/assets/{camera-D0yVo0xC.js → camera-EjpDG3mc.js} +1 -1
  161. package/dist/showcase/assets/{card-CH7Ev3xS.js → card-Bp6iGuOF.js} +1 -1
  162. package/dist/showcase/assets/{card-Bl-y9-8y.js → card-CHc6AVFt.js} +1 -1
  163. package/dist/showcase/assets/card-primitives-Bv6XGPJd.js +1 -0
  164. package/dist/showcase/assets/{card-radio-group-DpeIWyiO.js → card-radio-group-Ce9FsiSv.js} +1 -1
  165. package/dist/showcase/assets/{cards-7xave3ub.js → cards-_CGG9zir.js} +1 -1
  166. package/dist/showcase/assets/{carousel--kHTFkC7.js → carousel-BVbsKH2W.js} +1 -1
  167. package/dist/showcase/assets/{cell-renderers-Cx8rAZln.js → cell-renderers-CosD6Gby.js} +1 -1
  168. package/dist/showcase/assets/{chart-DU8INHbt.js → chart-CwOp8Sf8.js} +1 -1
  169. package/dist/showcase/assets/{chart-column-Dbekq8cy.js → chart-column-sz871NdJ.js} +1 -1
  170. package/dist/showcase/assets/{checkbox-ClPnzko9.js → checkbox-BO38TYqr.js} +1 -1
  171. package/dist/showcase/assets/checkbox-W4MhlPlJ.js +1 -0
  172. package/dist/showcase/assets/chevron-down-BFh1Fz2P.js +1 -0
  173. package/dist/showcase/assets/chevron-left-C5_X5glO.js +1 -0
  174. package/dist/showcase/assets/chevron-up-DPH3boVS.js +1 -0
  175. package/dist/showcase/assets/chevrons-up-down-CM5mIDaw.js +1 -0
  176. package/dist/showcase/assets/circle-BFDzL1iF.js +1 -0
  177. package/dist/showcase/assets/{circle-alert-9j29FrsT.js → circle-alert-C6MbOB0m.js} +1 -1
  178. package/dist/showcase/assets/circle-check-C0X85t4j.js +1 -0
  179. package/dist/showcase/assets/circle-check-big-CBaodck_.js +1 -0
  180. package/dist/showcase/assets/circle-dot-DdRpIhnL.js +1 -0
  181. package/dist/showcase/assets/{circle-question-mark-BRiF5RV4.js → circle-question-mark-CKlcead7.js} +1 -1
  182. package/dist/showcase/assets/{circle-x-BF20gddw.js → circle-x-MO44aKHe.js} +1 -1
  183. package/dist/showcase/assets/clock-3-CXQJFcbh.js +1 -0
  184. package/dist/showcase/assets/clock-GhBJJ6n1.js +1 -0
  185. package/dist/showcase/assets/{code-xml-D2f-X63y.js → code-xml-BSX7Qyi5.js} +1 -1
  186. package/dist/showcase/assets/{collapsible-CF0oQTVS.js → collapsible-CZLTO5EH.js} +1 -1
  187. package/dist/showcase/assets/{collapsible-Ru5-bssh.js → collapsible-LrDO_sSQ.js} +1 -1
  188. package/dist/showcase/assets/{combobox-DpJTW_Rq.js → combobox-TmDBXkM-.js} +1 -1
  189. package/dist/showcase/assets/{command-Dno8Ogez.js → command-9-r1qrJt.js} +1 -1
  190. package/dist/showcase/assets/{command-LRFStKBy.js → command-DGne3l9s.js} +1 -1
  191. package/dist/showcase/assets/{comment-composer-Dht7nfbv.js → comment-composer-BI0qnvuY.js} +1 -1
  192. package/dist/showcase/assets/{comment-item-B6IgQsMr.js → comment-item-Cedds6Lm.js} +1 -1
  193. package/dist/showcase/assets/{comments-B3ksV3Mn.js → comments-De02NOns.js} +1 -1
  194. package/dist/showcase/assets/{commerce-B1_Offbz.js → commerce-DldtS83o.js} +1 -1
  195. package/dist/showcase/assets/{composite-BjQWIYF-.js → composite-BjZZlzzb.js} +1 -1
  196. package/dist/showcase/assets/{contact-card-Bss4YHZz.js → contact-card-muCZ3uXV.js} +1 -1
  197. package/dist/showcase/assets/{content-container-D4BM1Zro.js → content-container-BxSLICeL.js} +1 -1
  198. package/dist/showcase/assets/{copyable-Dst8oaw5.js → copyable-DYhhmTqM.js} +1 -1
  199. package/dist/showcase/assets/{copyable-C0J88R_R.js → copyable-MNU75-J9.js} +1 -1
  200. package/dist/showcase/assets/{course-card-BuqwjqtO.js → course-card-Dl1wsuJx.js} +1 -1
  201. package/dist/showcase/assets/{cpu-CFy0M0rN.js → cpu-CsWq4fcX.js} +1 -1
  202. package/dist/showcase/assets/{credit-card-CFq0S1Ma.js → credit-card-B0AUZiWw.js} +1 -1
  203. package/dist/showcase/assets/{css-variables-BAALjDwD.js → css-variables-Be7DzahT.js} +1 -1
  204. package/dist/showcase/assets/{currency-BZzZRv2_.js → currency-BtPM_Xtw.js} +1 -1
  205. package/dist/showcase/assets/{dark-surfaces-CVKt2Yww.js → dark-surfaces-DRFERSEv.js} +1 -1
  206. package/dist/showcase/assets/{data-view-Be0uoLqL.js → data-view-DmWd0h7G.js} +2 -2
  207. package/dist/showcase/assets/{data-view-D6_zyFwk.js → data-view-DnLH2o0i.js} +1 -1
  208. package/dist/showcase/assets/{database-DSC-ysYT.js → database-C0YqGaQ_.js} +1 -1
  209. package/dist/showcase/assets/{date-block-Bgu_LMxB.js → date-block-BQH25FLS.js} +1 -1
  210. package/dist/showcase/assets/{date-picker-ByYEZGMg.js → date-picker-BF-jevhh.js} +1 -1
  211. package/dist/showcase/assets/{date-pickers-DzSQrvWs.js → date-pickers-q2v3ajJm.js} +1 -1
  212. package/dist/showcase/assets/{dense-info-BhFkOQbt.js → dense-info-Cb-roqDU.js} +1 -1
  213. package/dist/showcase/assets/{design-system-consistency-D6iCJLcr.js → design-system-consistency-DMSJknaM.js} +1 -1
  214. package/dist/showcase/assets/{dialog-C1heXuxu.js → dialog-C0ALRmbP.js} +1 -1
  215. package/dist/showcase/assets/{dialog-DzrcsKvl.js → dialog-CbXon08k.js} +1 -1
  216. package/dist/showcase/assets/{display-utilities-eu-EVMrx.js → display-utilities-kBUVw7o3.js} +1 -1
  217. package/dist/showcase/assets/{dist-DV4Tv32d.js → dist-CTSkWj_M.js} +1 -1
  218. package/dist/showcase/assets/{dist-BlIID0_L.js → dist-W8bxVfew.js} +1 -1
  219. package/dist/showcase/assets/{dollar-sign-qp4G3P_K.js → dollar-sign-VNxVZleW.js} +1 -1
  220. package/dist/showcase/assets/{download-zlcHjSdS.js → download-Ds_6eIpx.js} +1 -1
  221. package/dist/showcase/assets/{dropdown-menu-DZ47rJaE.js → dropdown-menu-C1G_y9dv.js} +1 -1
  222. package/dist/showcase/assets/{dropzone-Dx4EqBHu.js → dropzone-CxOLmdkt.js} +1 -1
  223. package/dist/showcase/assets/{earth-BuXqXHh6.js → earth-HLyEI1oq.js} +1 -1
  224. package/dist/showcase/assets/{ellipsis-DgAjMZHc.js → ellipsis-BLyAd9A-.js} +1 -1
  225. package/dist/showcase/assets/{ellipsis-vertical-BA8_YMyV.js → ellipsis-vertical-TG4mYU2J.js} +1 -1
  226. package/dist/showcase/assets/{empty-DXjKmyNv.js → empty-B54k9xAG.js} +1 -1
  227. package/dist/showcase/assets/{empty-item-DIGWYsI0.js → empty-item-BmA4rmq7.js} +1 -1
  228. package/dist/showcase/assets/{empty-state-BSc0tQNC.js → empty-state-CH7gjjg7.js} +1 -1
  229. package/dist/showcase/assets/{empty-state-CkixFVN1.js → empty-state-hUKvmKa-.js} +1 -1
  230. package/dist/showcase/assets/{enhanced-activities-CKbHgR4f.js → enhanced-activities-BRDVL9RR.js} +1 -1
  231. package/dist/showcase/assets/{enhanced-combobox-DAKQyFUg.js → enhanced-combobox-2wbQJS6R.js} +1 -1
  232. package/dist/showcase/assets/{esm-C3PfkuOc.js → esm-CUTefMLr.js} +1 -1
  233. package/dist/showcase/assets/{event-calendar-rNju8jaT.js → event-calendar-Bf9xFZlt.js} +1 -1
  234. package/dist/showcase/assets/{event-log-BUK1blGb.js → event-log-CeRDSL-h.js} +1 -1
  235. package/dist/showcase/assets/{example-PsbgbESI.js → example-CJMJcnb4.js} +1 -1
  236. package/dist/showcase/assets/{external-link-CgB9zfWz.js → external-link-CvXhYrnd.js} +1 -1
  237. package/dist/showcase/assets/{eye-YnIHbdKe.js → eye-Cl_GfUKH.js} +1 -1
  238. package/dist/showcase/assets/{feature-announcement-CWwjAPI1.js → feature-announcement-Dw0SokLo.js} +1 -1
  239. package/dist/showcase/assets/{file-3Z2xkc-8.js → file-CJFWrwy1.js} +1 -1
  240. package/dist/showcase/assets/{file-text-BQeGXxPG.js → file-text-BTTFP8Jo.js} +1 -1
  241. package/dist/showcase/assets/{filter-layout-D7YskzbC.js → filter-layout-DUVqG5Ql.js} +1 -1
  242. package/dist/showcase/assets/{filters-2YY_wVwq.js → filters-BLcCaplV.js} +1 -1
  243. package/dist/showcase/assets/{flag-Bw3wwRgF.js → flag-BxI3EGPG.js} +1 -1
  244. package/dist/showcase/assets/{folder-open-CZ5Bq4lK.js → folder-open-4d8qsiAj.js} +1 -1
  245. package/dist/showcase/assets/{form-field-AWNJL9FM.js → form-field-Dhy0eM5B.js} +1 -1
  246. package/dist/showcase/assets/{format-DUU7-42g.js → format-zGqa9Olc.js} +1 -1
  247. package/dist/showcase/assets/{forms-CWJ3HBbk.js → forms-D99qG5Gb.js} +1 -1
  248. package/dist/showcase/assets/{funnel-vxNNph7w.js → funnel-Cg7SOShf.js} +1 -1
  249. package/dist/showcase/assets/{generic-DlyFJDj6.js → generic-CfrG943t.js} +1 -1
  250. package/dist/showcase/assets/{getPseudoElementBounds-CibNto5h.js → getPseudoElementBounds-lw5shsdM.js} +1 -1
  251. package/dist/showcase/assets/{gift-BjRHqTcQ.js → gift-BXtKbzvA.js} +1 -1
  252. package/dist/showcase/assets/{giftcard-cards-DcujCFff.js → giftcard-cards-CqYaN0jC.js} +1 -1
  253. package/dist/showcase/assets/{git-branch-B7XnpQE0.js → git-branch-BWAuIMOQ.js} +1 -1
  254. package/dist/showcase/assets/{global-search-CWvNfmpe.js → global-search-CHUva8pR.js} +1 -1
  255. package/dist/showcase/assets/{global-search-Ct7I1Xd2.js → global-search-Df7JovOG.js} +1 -1
  256. package/dist/showcase/assets/{globe-CHleXWd2.js → globe-CvIW_foU.js} +1 -1
  257. package/dist/showcase/assets/{gradient-card-Bw4oJljh.js → gradient-card-CdM2J1Hv.js} +1 -1
  258. package/dist/showcase/assets/{hash-BVGqnm6_.js → hash-wBs5gyr_.js} +1 -1
  259. package/dist/showcase/assets/{header-CgApizpk.js → header-DXPFmpUT.js} +1 -1
  260. package/dist/showcase/assets/{header-notifications-B2v1Mdri.js → header-notifications-FsnCJLpe.js} +1 -1
  261. package/dist/showcase/assets/{heart-BwvHCA-d.js → heart-B4fOMIr6.js} +1 -1
  262. package/dist/showcase/assets/{hooks-A_AQLIRZ.js → hooks-DtMOMalj.js} +6 -3
  263. package/dist/showcase/assets/{house-opqNxOmP.js → house-hebmAxEE.js} +1 -1
  264. package/dist/showcase/assets/{icon-badge-ognVhKWR.js → icon-badge-DrZ5qGpa.js} +1 -1
  265. package/dist/showcase/assets/{icon-badge-CsG95J1Z.js → icon-badge-JEug_P_U.js} +1 -1
  266. package/dist/showcase/assets/{image-apDSlTAx.js → image-CxNywgkb.js} +1 -1
  267. package/dist/showcase/assets/{inbox-WrbeTKEw.js → inbox-DqAmGdDd.js} +1 -1
  268. package/dist/showcase/assets/index-DujM0kEF.css +2 -0
  269. package/dist/showcase/assets/{index-QESvAJrb.js → index-jD-KSiHu.js} +2 -2
  270. package/dist/showcase/assets/inertValue-Dg9TwvOb.js +1 -0
  271. package/dist/showcase/assets/{info-C3G9KRCx.js → info-B5fZn_ZC.js} +1 -1
  272. package/dist/showcase/assets/{inline-stat-CO01t7SJ.js → inline-stat-CklKufoA.js} +1 -1
  273. package/dist/showcase/assets/{inline-stat-BnjUqzDM.js → inline-stat-Dep7oHIi.js} +1 -1
  274. package/dist/showcase/assets/{input-yYoqWQQ7.js → input-CkNgwwCs.js} +1 -1
  275. package/dist/showcase/assets/{input-CBJy1dMs.js → input-DAPMRlKO.js} +1 -1
  276. package/dist/showcase/assets/{input-group-CZyYSq4r.js → input-group-06D68uB6.js} +1 -1
  277. package/dist/showcase/assets/{input-group-Dfqufdp4.js → input-group-Bq9aXQPG.js} +1 -1
  278. package/dist/showcase/assets/{inputs-Bhw_FGDY.js → inputs-C8G3y-zR.js} +1 -1
  279. package/dist/showcase/assets/{installation-DnvS2ZUn.js → installation-BV5xOvoE.js} +1 -1
  280. package/dist/showcase/assets/{invoice-header-B9Ak8GXX.js → invoice-header-BcUxzT68.js} +1 -1
  281. package/dist/showcase/assets/{invoice-items-DY5zUZhE.js → invoice-items-B42Jfxl7.js} +1 -1
  282. package/dist/showcase/assets/{invoice-mini-BAryECEH.js → invoice-mini-RJGdlErg.js} +1 -1
  283. package/dist/showcase/assets/{invoice-table-BUvjee74.js → invoice-table--MdP6ysv.js} +1 -1
  284. package/dist/showcase/assets/isSameDay-srttAIjD.js +1 -0
  285. package/dist/showcase/assets/isToday-BPub5Zvi.js +1 -0
  286. package/dist/showcase/assets/{italic-CjQCLJci.js → italic-1BNA_XlU.js} +1 -1
  287. package/dist/showcase/assets/{item-DxPwk321.js → item-B9KyqUGa.js} +1 -1
  288. package/dist/showcase/assets/{item-D1Jxrpia.js → item-DoIlPm6J.js} +1 -1
  289. package/dist/showcase/assets/{item-BMSdEK3V.js → item-ffIfXEGd.js} +1 -1
  290. package/dist/showcase/assets/{kanban-DXWCGieQ.js → kanban-Cfad3edR.js} +1 -1
  291. package/dist/showcase/assets/{key-round-DpuhXiJQ.js → key-round-J11Zc216.js} +1 -1
  292. package/dist/showcase/assets/{label-D1wLK5nY.js → label-DqaB8ZB2.js} +1 -1
  293. package/dist/showcase/assets/{languages-CGYZVmbV.js → languages-D9UaP3QU.js} +1 -1
  294. package/dist/showcase/assets/{layers-DJZSVGAu.js → layers-QXZ9Jfej.js} +1 -1
  295. package/dist/showcase/assets/{layout-app-shell-UX63nzTO.js → layout-app-shell-CW1eRJmU.js} +1 -1
  296. package/dist/showcase/assets/{layout-auth-Bav5BBqp.js → layout-auth-j4K6lveg.js} +1 -1
  297. package/dist/showcase/assets/{layout-containers-DMHD2zdV.js → layout-containers-NclLtsV0.js} +1 -1
  298. package/dist/showcase/assets/{layout-header-CGesu_kM.js → layout-header-B8AOTiwL.js} +1 -1
  299. package/dist/showcase/assets/{layout-page-DHXu8SIv.js → layout-page-DM79QHyW.js} +1 -1
  300. package/dist/showcase/assets/{layout-primitives-CokzGwd2.js → layout-primitives-Dyop-WMt.js} +1 -1
  301. package/dist/showcase/assets/{layout-sidebar-CLUYajcu.js → layout-sidebar-uBNaHqjD.js} +1 -1
  302. package/dist/showcase/assets/{layout-users-DHUNAnFA.js → layout-users-BkhDiOOz.js} +1 -1
  303. package/dist/showcase/assets/{layout-workspace-y0v2FpDW.js → layout-workspace-C2hSimZW.js} +1 -1
  304. package/dist/showcase/assets/{lib-g_kR7X9Z.js → lib-CDssULuD.js} +1 -1
  305. package/dist/showcase/assets/{list-checks-CXt8visd.js → list-checks-DA2jqXdm.js} +1 -1
  306. package/dist/showcase/assets/{lock-CpZ5kLUd.js → lock-BDZLNQLR.js} +1 -1
  307. package/dist/showcase/assets/{lock-keyhole-Cy2raRO6.js → lock-keyhole-CWYENd9O.js} +1 -1
  308. package/dist/showcase/assets/{mail-Cj6uT4TA.js → mail-CCdaRmft.js} +1 -1
  309. package/dist/showcase/assets/{mail-check-Di70bdf6.js → mail-check-DZF1VbCX.js} +1 -1
  310. package/dist/showcase/assets/{map-DMXbG_04.js → map-CDFEmmZH.js} +3 -3
  311. package/dist/showcase/assets/{map-pin-EKhu7vEj.js → map-pin-CdV-R6nt.js} +1 -1
  312. package/dist/showcase/assets/{media-library-Dnp9S0oW.js → media-library-BJyn1s9d.js} +1 -1
  313. package/dist/showcase/assets/{mention-inline-suggestions-Bp-fVNYF.js → mention-inline-suggestions-DPO6FhXx.js} +1 -1
  314. package/dist/showcase/assets/{mentions-DNRk30XZ.js → mentions-DtWHbcS6.js} +1 -1
  315. package/dist/showcase/assets/{menus-DFURb5VL.js → menus-BmjngFE4.js} +1 -1
  316. package/dist/showcase/assets/{message-square-DG0qIsG_.js → message-square-bM29txT3.js} +1 -1
  317. package/dist/showcase/assets/{metadata-list-Cb1DQd4S.js → metadata-list-DvYTAJri.js} +1 -1
  318. package/dist/showcase/assets/metadata-list-xVUTVyy9.js +1 -0
  319. package/dist/showcase/assets/{metric-BkzIsP8H.js → metric-BPNCh4eA.js} +1 -1
  320. package/dist/showcase/assets/{metric-bar-CU73nx89.js → metric-bar-BX4sCMrM.js} +1 -1
  321. package/dist/showcase/assets/{metric-grid-BMLMbLjE.js → metric-grid-IyHP3nmU.js} +1 -1
  322. package/dist/showcase/assets/{metric-trend-chip-Dutl5uZo.js → metric-trend-chip-Dih8eR17.js} +1 -1
  323. package/dist/showcase/assets/{metrics-analytics-bar-AqG2oyIy.js → metrics-analytics-bar-DK16RNMs.js} +1 -1
  324. package/dist/showcase/assets/{metrics-analytics-cards-CrFHmR2f.js → metrics-analytics-cards-Byyl13YT.js} +1 -1
  325. package/dist/showcase/assets/{metrics-comparison-CY-DyLv7.js → metrics-comparison-DGHFMBL-.js} +1 -1
  326. package/dist/showcase/assets/{metrics-heatmap-BmX_CkiP.js → metrics-heatmap-Bl6C7i0j.js} +1 -1
  327. package/dist/showcase/assets/{metrics-inline-badge-C1IFjdJN.js → metrics-inline-badge-Bz79zbNK.js} +1 -1
  328. package/dist/showcase/assets/{metrics-kpi-row-8Kbn034e.js → metrics-kpi-row-DzZ9dRFY.js} +1 -1
  329. package/dist/showcase/assets/{metrics-micro-grid-CodO02yA.js → metrics-micro-grid-DyoQiuzr.js} +1 -1
  330. package/dist/showcase/assets/{metrics-overview-CdPqEAAG.js → metrics-overview-DoyHPEZw.js} +1 -1
  331. package/dist/showcase/assets/{metrics-stat-cards-Cw7UMWmb.js → metrics-stat-cards-B1b7NFqW.js} +1 -1
  332. package/dist/showcase/assets/minus-BE2L5hVc.js +1 -0
  333. package/dist/showcase/assets/{money-display-CFfUZLus.js → money-display-CXQ_8LfA.js} +1 -1
  334. package/dist/showcase/assets/{month-year-picker-ChVcYm9f.js → month-year-picker-ra8FEN8F.js} +1 -1
  335. package/dist/showcase/assets/{navigation-Boyt1q-1.js → navigation-CFfVZQJ1.js} +1 -1
  336. package/dist/showcase/assets/{navigation-CThYYxkL.js → navigation-Da0MVkqr.js} +1 -1
  337. package/dist/showcase/assets/{navigation-extras-CxLc-Mqx.js → navigation-extras-LpsdoXfx.js} +1 -1
  338. package/dist/showcase/assets/{onboarding-checklist-C15gqmFc.js → onboarding-checklist-DPNatNOk.js} +1 -1
  339. package/dist/showcase/assets/{overflow-tab-bar-B2Htn-Ft.js → overflow-tab-bar-C0vTzcEY.js} +1 -1
  340. package/dist/showcase/assets/{overlays-Cpj4akiw.js → overlays-Blmbun0J.js} +1 -1
  341. package/dist/showcase/assets/{overlays-CPZfp0nk.js → overlays-t0joc10Y.js} +1 -1
  342. package/dist/showcase/assets/{overview-BB-Xbkff.js → overview-Ckq8vbOR.js} +1 -1
  343. package/dist/showcase/assets/{package-DLn6nx-u.js → package-Cjod_a06.js} +1 -1
  344. package/dist/showcase/assets/{package-check-B0wyBUSU.js → package-check-JRHaNnkl.js} +1 -1
  345. package/dist/showcase/assets/{page-BPFNsNh7.js → page-9xr7xnuW.js} +1 -1
  346. package/dist/showcase/assets/page-action-button-BRXnfsEx.js +1 -0
  347. package/dist/showcase/assets/{page-header-BGqE9hzO.js → page-header-Bdlxfn_9.js} +1 -1
  348. package/dist/showcase/assets/{pagination-T4FmLNHn.js → pagination-CeaYhOvv.js} +1 -1
  349. package/dist/showcase/assets/{pagination-Be6ynLCp.js → pagination-DdZZHvNF.js} +1 -1
  350. package/dist/showcase/assets/{paperclip-B_kxXzSN.js → paperclip-BRM-yXTB.js} +1 -1
  351. package/dist/showcase/assets/{password-input-qfQ5eIU4.js → password-input-1FVEugoO.js} +1 -1
  352. package/dist/showcase/assets/{pencil-DlDLApli.js → pencil-DiG2dQ8F.js} +1 -1
  353. package/dist/showcase/assets/{phone-D8tvvbSQ.js → phone-BREyNZN-.js} +1 -1
  354. package/dist/showcase/assets/plus-CQcelTNc.js +1 -0
  355. package/dist/showcase/assets/{popover-Bu7aaPjE.js → popover-Czmwspmc.js} +1 -1
  356. package/dist/showcase/assets/{popover-menu-CD_JfEeq.js → popover-menu-beuCaiLt.js} +1 -1
  357. package/dist/showcase/assets/{popover-BsCx2XMI.js → popover-uqk7myG2.js} +1 -1
  358. package/dist/showcase/assets/{products-BzHX1ta0.js → products-DGNqIbLs.js} +1 -1
  359. package/dist/showcase/assets/{progress-jIJ_EIKE.js → progress-D76Df908.js} +1 -1
  360. package/dist/showcase/assets/{progress-CpW2ZGAy.js → progress-DjUprSDD.js} +1 -1
  361. package/dist/showcase/assets/{props-table-CCcohuyT.js → props-table-DoDq8Mvr.js} +1 -1
  362. package/dist/showcase/assets/{quote-Bc9eHVKi.js → quote-BvGGgyJ0.js} +1 -1
  363. package/dist/showcase/assets/{receipt-B77_VWtt.js → receipt-rgnlMgyi.js} +1 -1
  364. package/dist/showcase/assets/{receipt-text-BlL_TJsS.js → receipt-text-CBQrVlnU.js} +1 -1
  365. package/dist/showcase/assets/{refinement-guide-BpzOvT_R.js → refinement-guide-B_BpIMxm.js} +1 -1
  366. package/dist/showcase/assets/{refresh-cw-CELG4taF.js → refresh-cw-C-yHy6B7.js} +1 -1
  367. package/dist/showcase/assets/{resolveValueLabel-LRTUaJTb.js → resolveValueLabel-0bwEvIG-.js} +1 -1
  368. package/dist/showcase/assets/{resource-BT8_ck3n.js → resource-8f61BZ8t.js} +1 -1
  369. package/dist/showcase/assets/{resource-C7J3yZp6.js → resource-BEh6R0gu.js} +1 -1
  370. package/dist/showcase/assets/{resource-selector-card-Ay8ImvKg.js → resource-selector-card-DJwXY_Ms.js} +1 -1
  371. package/dist/showcase/assets/{rich-text-editor-CdGVvtsm.js → rich-text-editor-D433iv0N.js} +1 -1
  372. package/dist/showcase/assets/{rich-text-editor-DVtTVuZ6.js → rich-text-editor-vTRfWsOK.js} +1 -1
  373. package/dist/showcase/assets/rotate-ccw-JuE4H14F.js +1 -0
  374. package/dist/showcase/assets/{route-CgBh1oKF.js → route-eSu1bFNn.js} +1 -1
  375. package/dist/showcase/assets/{save-BFsAGR7O.js → save-Bpjj-rBP.js} +1 -1
  376. package/dist/showcase/assets/{schema-form-CaF-lBkN.js → schema-form-DmOpxd96.js} +1 -1
  377. package/dist/showcase/assets/{scroll-area-CpDi_6FP.js → scroll-area-B9OdCBy9.js} +1 -1
  378. package/dist/showcase/assets/{scroll-area-BkZULoZA.js → scroll-area-BH80l2As.js} +1 -1
  379. package/dist/showcase/assets/{section-D-N8Ze16.js → section-BPNIPavy.js} +1 -1
  380. package/dist/showcase/assets/{select-ReMZs8K6.js → select-BauiG1a3.js} +1 -1
  381. package/dist/showcase/assets/{select-C9Mfb_Gj.js → select-CPopSr5c.js} +1 -1
  382. package/dist/showcase/assets/{send-C6PbwpHN.js → send-DNCcBKXs.js} +1 -1
  383. package/dist/showcase/assets/{separator-CywPSoE0.js → separator-BK0beCOv.js} +1 -1
  384. package/dist/showcase/assets/{separator-Ha9YxI2x.js → separator-CKM9A-mm.js} +1 -1
  385. package/dist/showcase/assets/{settings-2-CVq5Uyv5.js → settings-2-B8fz7JZB.js} +1 -1
  386. package/dist/showcase/assets/{settings-DkTHc0Ob.js → settings-Cy2y3sQw.js} +1 -1
  387. package/dist/showcase/assets/{sheet-k-P0gWlk.js → sheet-C7VWkXE1.js} +1 -1
  388. package/dist/showcase/assets/{shield-Cme7_JJR.js → shield-ClPev4gS.js} +1 -1
  389. package/dist/showcase/assets/{shield-alert-CxV0S5w0.js → shield-alert-6XO5YZ5u.js} +1 -1
  390. package/dist/showcase/assets/{shield-check-BW_7p6Xf.js → shield-check-DSfGVZq0.js} +1 -1
  391. package/dist/showcase/assets/{shopping-bag-CoR8AMYU.js → shopping-bag-DzMrGvpF.js} +1 -1
  392. package/dist/showcase/assets/{showcase-m3FzbvoC.js → showcase-DuZaO6q9.js} +1 -1
  393. package/dist/showcase/assets/{sidebar-bz_FzvjM.js → sidebar-7y9EQYWf.js} +1 -1
  394. package/dist/showcase/assets/{sidebar.context-BWMPnGn6.js → sidebar.context-DUheJD8t.js} +1 -1
  395. package/dist/showcase/assets/{skeleton-BJMnQDgf.js → skeleton-Dgr8Vabr.js} +1 -1
  396. package/dist/showcase/assets/{skeleton-DoWW5XZD.js → skeleton-HSpErFqw.js} +1 -1
  397. package/dist/showcase/assets/{slider-BH1Gtp_p.js → slider-B7f81APg.js} +1 -1
  398. package/dist/showcase/assets/{smart-card-C6-idFYI.js → smart-card-p97LLZCW.js} +1 -1
  399. package/dist/showcase/assets/{sonner-CGZ3FC4U.js → sonner-CWazrN19.js} +1 -1
  400. package/dist/showcase/assets/{sortable.esm-CE0TA9V_.js → sortable.esm-uufol7Mz.js} +1 -1
  401. package/dist/showcase/assets/{sparkles-8yQFcmte.js → sparkles-Z4V23xKK.js} +1 -1
  402. package/dist/showcase/assets/{spinner-CNveVfOr.js → spinner-BUgjAjWE.js} +1 -1
  403. package/dist/showcase/assets/{spinner-CO8LjtjY.js → spinner-CXu7z8-j.js} +1 -1
  404. package/dist/showcase/assets/{spinner-BYUX0luk.js → spinner-DCwR0mnD.js} +1 -1
  405. package/dist/showcase/assets/{square-pen-CWylvezY.js → square-pen-jwp_OWMQ.js} +1 -1
  406. package/dist/showcase/assets/{stacked-avatars-DiNA5OJK.js → stacked-avatars-CHEpTotO.js} +1 -1
  407. package/dist/showcase/assets/{star-t53uwwyp.js → star-Ck8Lg5hm.js} +1 -1
  408. package/dist/showcase/assets/startOfDay-BzULZHy4.js +1 -0
  409. package/dist/showcase/assets/{styles-CwpnwrEQ.js → styles-CNYitflH.js} +1 -1
  410. package/dist/showcase/assets/{suggestions-CvxZxsmc.js → suggestions-CSF9MlKl.js} +1 -1
  411. package/dist/showcase/assets/{switch-CewkokYT.js → switch-BX9KSLIF.js} +1 -1
  412. package/dist/showcase/assets/{switch-D-7uqDR8.js → switch-Bn0WaWa9.js} +1 -1
  413. package/dist/showcase/assets/{sync-DnBSRAwH.js → sync-BuKBnqWW.js} +1 -1
  414. package/dist/showcase/assets/{table-3cUcSCBR.js → table-DNJcLaud.js} +42 -20
  415. package/dist/showcase/assets/{table-ds5oNU0h.js → table-NfpOWGsG.js} +1 -1
  416. package/dist/showcase/assets/{table-actions-CrujG5R-.js → table-actions-Ci9Yszp0.js} +1 -1
  417. package/dist/showcase/assets/{tabs-C-hJfSn5.js → tabs-CYNFQdIr.js} +1 -1
  418. package/dist/showcase/assets/{tabs-GG911oaV.js → tabs-Cm_p6znb.js} +1 -1
  419. package/dist/showcase/assets/{tags-input-DBeIaeVn.js → tags-input-DE4QZqS_.js} +1 -1
  420. package/dist/showcase/assets/{text-button-EZojp9Ye.js → text-button-D9llh4pU.js} +1 -1
  421. package/dist/showcase/assets/{text-link-DcKeYjEX.js → text-link-ZT6QGJOL.js} +1 -1
  422. package/dist/showcase/assets/{textarea-DgNgSl1g.js → textarea-CgcHuGVq.js} +1 -1
  423. package/dist/showcase/assets/{textarea-PXKZSiRa.js → textarea-D2uT_GJt.js} +1 -1
  424. package/dist/showcase/assets/{timelines-CaF_Ze8z.js → timelines-BEFO7tJ0.js} +1 -1
  425. package/dist/showcase/assets/{toggle-group-D_iuhL1G.js → toggle-group-oYpa59lN.js} +1 -1
  426. package/dist/showcase/assets/{toggles-BKaayRmE.js → toggles-BL93YmQo.js} +1 -1
  427. package/dist/showcase/assets/{toggles-group-DRAksOw2.js → toggles-group-BG-xiQCY.js} +1 -1
  428. package/dist/showcase/assets/{tooltip-B_LnC5D2.js → tooltip-BMI7zHwP.js} +1 -1
  429. package/dist/showcase/assets/{trash-2-DhUpICQq.js → trash-2-CtRtVsCy.js} +1 -1
  430. package/dist/showcase/assets/trending-up-2NQ-P8vB.js +1 -0
  431. package/dist/showcase/assets/{truck-D6SGLjv1.js → truck-Cl0nyN_j.js} +1 -1
  432. package/dist/showcase/assets/{typography-qEz6MMn9.js → typography-C7pCPhg7.js} +1 -1
  433. package/dist/showcase/assets/{ui-badge-BA334hdB.js → ui-badge-BvmuMzSq.js} +1 -1
  434. package/dist/showcase/assets/{ui-card-CjqUyGvB.js → ui-card-B7ziOMAn.js} +1 -1
  435. package/dist/showcase/assets/{ui-table-cDgI6WMk.js → ui-table-BEFHakBU.js} +1 -1
  436. package/dist/showcase/assets/{upload-tray-BcA-7pqW.js → upload-tray-CMKqTtEp.js} +1 -1
  437. package/dist/showcase/assets/{use-layout-link-DIUWH-oo.js → use-layout-link-nEU6ctSs.js} +1 -1
  438. package/dist/showcase/assets/{useAnchoredPopupScrollLock-BavpibMb.js → useAnchoredPopupScrollLock-B1xyKMh7.js} +1 -1
  439. package/dist/showcase/assets/{useAriaLabelledBy-HDEJjv0f.js → useAriaLabelledBy-BMlFgz-H.js} +1 -1
  440. package/dist/showcase/assets/{useCollapsiblePanel-CL0pCuxO.js → useCollapsiblePanel-BEzH6TC2.js} +1 -1
  441. package/dist/showcase/assets/{useCompositeItem-LkMSD9DW.js → useCompositeItem-CIuww7-p.js} +1 -1
  442. package/dist/showcase/assets/{useCompositeListItem-C_oLUvf8.js → useCompositeListItem-PrMTh4tz.js} +1 -1
  443. package/dist/showcase/assets/{useLabelableId-DDpjUdIO.js → useLabelableId-BBLkeLGr.js} +1 -1
  444. package/dist/showcase/assets/{useOpenInteractionType-DQOSh-Eu.js → useOpenInteractionType-CW0quo3l.js} +1 -1
  445. package/dist/showcase/assets/useRender-6NNMHJJU.js +1 -0
  446. package/dist/showcase/assets/{useTriggerFocusGuards-BPFrAxlp.js → useTriggerFocusGuards-DEza_iee.js} +1 -1
  447. package/dist/showcase/assets/{useValueChanged-lYlHqRM1.js → useValueChanged-BmWIb3SN.js} +1 -1
  448. package/dist/showcase/assets/user-BDIP5UPS.js +1 -0
  449. package/dist/showcase/assets/{user-plus-B1Pi7SNv.js → user-plus-BCqHFh2h.js} +1 -1
  450. package/dist/showcase/assets/{users-DAlxvktS.js → users-Bh7xGRX2.js} +1 -1
  451. package/dist/showcase/assets/{vendor-profile-ClJ6G6SO.js → vendor-profile-BlYcRbPI.js} +1 -1
  452. package/dist/showcase/assets/{video-DxooIkh-.js → video-BucshqNW.js} +1 -1
  453. package/dist/showcase/assets/{wrench-BiwmotMF.js → wrench-DQvhyTEb.js} +1 -1
  454. package/dist/showcase/assets/x-DyuS4YRT.js +1 -0
  455. package/dist/showcase/assets/{zap-a90eC6iO.js → zap-Dpn8_pnQ.js} +1 -1
  456. package/dist/showcase/index.html +2 -2
  457. package/dist/style.css +1 -1
  458. package/package.json +1 -1
  459. package/dist/_shared/cards-BKFwMTjM.cjs +0 -2
  460. package/dist/_shared/cards-BKFwMTjM.cjs.map +0 -1
  461. package/dist/_shared/cards-CtBoSZG9.js.map +0 -1
  462. package/dist/_shared/overlays-CdtMAkKG.js.map +0 -1
  463. package/dist/_shared/overlays-Diy_H0Au.cjs +0 -2
  464. package/dist/_shared/overlays-Diy_H0Au.cjs.map +0 -1
  465. package/dist/_shared/table-CUA_A-oO.js.map +0 -1
  466. package/dist/_shared/table-mPchjiRn.cjs +0 -2
  467. package/dist/_shared/table-mPchjiRn.cjs.map +0 -1
  468. package/dist/showcase/assets/arrow-down-BttnoDxP.js +0 -1
  469. package/dist/showcase/assets/arrow-left-B1kFGJ8v.js +0 -1
  470. package/dist/showcase/assets/arrow-right-Md96ra7v.js +0 -1
  471. package/dist/showcase/assets/arrow-up-B9e9cP-q.js +0 -1
  472. package/dist/showcase/assets/arrow-up-right-BOHJNdrp.js +0 -1
  473. package/dist/showcase/assets/card-primitives-CiU5lL3a.js +0 -1
  474. package/dist/showcase/assets/checkbox-Qhh92dbS.js +0 -1
  475. package/dist/showcase/assets/chevron-down-BqrI6QzQ.js +0 -1
  476. package/dist/showcase/assets/chevron-left-TJKYH3rG.js +0 -1
  477. package/dist/showcase/assets/chevron-up-CPuAmh-d.js +0 -1
  478. package/dist/showcase/assets/chevrons-up-down-DZB44PVY.js +0 -1
  479. package/dist/showcase/assets/circle-CY0DkTje.js +0 -1
  480. package/dist/showcase/assets/circle-check-BkFKejsY.js +0 -1
  481. package/dist/showcase/assets/circle-check-big-vu3Znqdx.js +0 -1
  482. package/dist/showcase/assets/circle-dot-CsBIkbEH.js +0 -1
  483. package/dist/showcase/assets/clock-3-mhWDhdka.js +0 -1
  484. package/dist/showcase/assets/clock-Dd-urPd2.js +0 -1
  485. package/dist/showcase/assets/index-CCxHwV7T.css +0 -2
  486. package/dist/showcase/assets/inertValue-DrANZiJk.js +0 -1
  487. package/dist/showcase/assets/isSameDay-DVP1ae2V.js +0 -1
  488. package/dist/showcase/assets/isToday-CNAQB-p9.js +0 -1
  489. package/dist/showcase/assets/metadata-list-BhlsEWYT.js +0 -1
  490. package/dist/showcase/assets/minus-B1es6KJX.js +0 -1
  491. package/dist/showcase/assets/page-action-button-DMS8Vcmz.js +0 -1
  492. package/dist/showcase/assets/plus-BkhJjfUv.js +0 -1
  493. package/dist/showcase/assets/rotate-ccw-MwEZ1b11.js +0 -1
  494. package/dist/showcase/assets/startOfDay-BKFJecZ3.js +0 -1
  495. package/dist/showcase/assets/trending-up-Kfm5l65O.js +0 -1
  496. package/dist/showcase/assets/useRender-CnmFaF3Y.js +0 -1
  497. package/dist/showcase/assets/user-DLuRcjl0.js +0 -1
  498. package/dist/showcase/assets/x-idpnOHil.js +0 -1
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../lib/strings.cjs"),t=require("../../../lib/utils.cjs"),n=require("../../../_shared/button-Bd5bEIiB.cjs"),r=require("../../../_shared/typography-CO9uwZhF.cjs"),i=require("../../../_shared/overlays-Diy_H0Au.cjs"),a=require("../../../_shared/badge-BeSKxX1u.cjs"),o=require("../../../_shared/alert-V0V36Sny.cjs"),s=require("../../../_shared/input-CB6hxh-5.cjs"),c=require("../../../_shared/forms-rmKcy5uO.cjs"),l=require("../../../_shared/display-Bin2vVex.cjs");let u=require("react"),d=require("react/jsx-runtime"),f=require("lucide-react"),p=require("react-dom");var m={title:`Add media`,description:`Pick from the library, or upload new files.`,close:`Close media library`,tabs:{library:`Library`,upload:`Upload`},searchPlaceholder:`Search by name or tag...`,clearSearch:`Clear search`,typeFilterLabel:`Type`,collectionFilterLabel:`Collection`,sortLabel:`Sort`,viewLabel:`View`,allTypes:`All`,images:`Images`,videos:`Videos`,files:`Files`,allCollections:`All collections`,sortNewest:`Newest`,sortName:`Name`,sortSize:`Size`,sortUsage:`Most used`,gridView:`Grid view`,tableView:`Table view`,countAll:`{count} items`,countFiltered:`{count} of {total} items`,emptyLibraryTitle:`Library is empty`,emptyLibraryDescription:`Upload images or videos to start building the library.`,emptyFilteredTitle:`No media matches`,emptyFilteredDescription:`Try a different search term, or clear the filters.`,clearFilters:`Clear filters`,uploadMedia:`Upload media`,loading:`Loading media...`,errorTitle:`Media could not load`,errorDescription:`Try again or adjust your filters.`,cardDetails:`Details for {name}`,privateLabel:`Private`,publicLabel:`Public`,typeImage:`Image`,typeVideo:`Video`,typeFile:`File`,unknownSize:`Unknown`,notUsed:`Not used yet`,usedIn:`{count} {count, plural, one {place} other {places}}`,table:{name:`Name`,type:`Type`,size:`Size`,collection:`Collection`,used:`Used`},detail:{title:`Details`,altText:`Alt text`,altPlaceholder:`Describe this media for screen readers`,collection:`Collection`,tags:`Tags`,tagsPlaceholder:`Comma-separated`,public:`Public`,publicHint:`Served from the public CDN`,privateHint:`Only visible in the admin`,type:`Type`,size:`Size`,dimensions:`Dimensions`,uploaded:`Uploaded`,usedIn:`Used in`,replace:`Replace file`,delete:`Delete`,close:`Close details`},upload:{dropTitle:`Drag files here or click to browse`,dropHint:`JPG, PNG, WebP, SVG and MP4 up to 50 MB per file`,dragOver:`Release to stage files`,collection:`Collection`,tags:`Tags`,tagsPlaceholder:`Comma-separated`,public:`Public`,publicHint:`Serve from the public CDN`,noFiles:`No files staged`,stagedCount:`{count} {count, plural, one {file} other {files}}`,removeFile:`Remove {name}`,uploading:`Uploading`,done:`Done`},footer:{pickOne:`Pick one item`,pickMany:`Pick one or more items`,selectedCount:`{count} selected`,clear:`Clear`,cancel:`Cancel`,confirmEmpty:`Add to product`,confirmOne:`Add 1 item`,confirmMany:`Add {count} items`,noFiles:`No files staged`,stagedSummary:`{count} {count, plural, one {file} other {files}} · {size}`,upload:`Upload`,uploadMany:`Upload {count} files`,uploading:`Uploading...`},gallery:{emptyTitle:`No media attached`,emptyDescription:`Add images, video, or files to this resource.`,add:`Add media`,addMore:`Add more`,addTile:`Add another media item`,cover:`Cover`,primary:`Primary`,setPrimary:`Set primary`,remove:`Remove`,movePrevious:`Move previous`,moveNext:`Move next`,itemPosition:`{index} of {total}`,maxReached:`Maximum reached`}};function h(e,t){return e.replace(/\{(\w+), plural, one \{([^}]*)\} other \{([^}]*)\}\}/g,(e,n,r,i)=>Number(t[n])===1?r:i).replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??``))}var g={collection:void 0,tags:[],public:!0},_=[],v={getId:e=>e.id,getName:e=>e.name,getType:e=>e.type,getSrc:e=>e.src,getAlt:e=>e.alt,getSize:e=>e.size,getWidth:e=>e.width,getHeight:e=>e.height,getDuration:e=>e.duration,getCollection:e=>e.collection,getTags:e=>e.tags??[],getPublic:e=>e.public,getUploadedAt:e=>e.uploadedAt,getUsageCount:e=>e.usageCount,getTint:e=>e.tint,getMimeType:e=>e.mimeType};function y(e){return{...v,...e??{}}}function b(e){return!e||e<=0?``:e>=1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function x(e,t){let n=t.getWidth(e),r=t.getHeight(e);return!n||!r?``:`${n} x ${r}`}function S(e,t){let n=t.getUploadedAt(e);if(!n)return 0;let r=(n instanceof Date?n:new Date(n)).getTime();return Number.isFinite(r)?r:0}function C(e){return e.type.startsWith(`image/`)?`image`:e.type.startsWith(`video/`)?`video`:`file`}function w(e){if(e.type.startsWith(`image/`)&&!(typeof URL>`u`||typeof URL.createObjectURL!=`function`))return URL.createObjectURL(e)}function T(e){!e||typeof URL>`u`||typeof URL.revokeObjectURL!=`function`||URL.revokeObjectURL(e)}function E(e){return Array.isArray(e)?{items:e,total:e.length}:e}function ee(e,t){return t&&typeof e==`object`&&e?{...e,...t}:e}function te(e,t,n,r,i){let a=n.trim().toLowerCase();return e.filter(e=>r!==`all`&&t.getType(e)!==r||i!==`all`&&t.getCollection(e)!==i?!1:a?[t.getName(e),t.getAlt(e),t.getCollection(e),...t.getTags(e)].filter(Boolean).join(` `).toLowerCase().includes(a):!0)}function ne(e,t,n){let r=e.slice();return n===`name`?r.sort((e,n)=>t.getName(e).localeCompare(t.getName(n))):n===`size`?r.sort((e,n)=>(t.getSize(n)??0)-(t.getSize(e)??0)):n===`usage`?r.sort((e,n)=>(t.getUsageCount(n)??0)-(t.getUsageCount(e)??0)):r.sort((e,n)=>S(n,t)-S(e,t)),r}function D({items:e=_,fetcher:t,accessors:n,selectionMode:r=`multiple`,value:i,defaultValue:a=[],onValueChange:o,onItemUpdate:s,onItemDelete:c,onUpload:l,onError:d,initialTab:f=`library`,defaultView:p=`grid`,defaultQuery:m=``,defaultType:h=`all`,defaultCollection:v=`all`,defaultSort:b=`newest`,defaultUploadOptions:x}={}){let S=(0,u.useMemo)(()=>y(n),[n]),[D,O]=(0,u.useState)(f),[k,A]=(0,u.useState)(p),[j,M]=(0,u.useState)(m),[N,P]=(0,u.useState)(h),[F,I]=(0,u.useState)(v),[L,re]=(0,u.useState)(b),[ie,ae]=(0,u.useState)(null),[R,oe]=(0,u.useState)(()=>[...a]),[se,ce]=(0,u.useState)([]),[le,ue]=(0,u.useState)(),[de,fe]=(0,u.useState)(!1),[pe,z]=(0,u.useState)(null),[me,he]=(0,u.useState)([]),[ge,_e]=(0,u.useState)(()=>new Set),[ve,B]=(0,u.useState)({}),[V,H]=(0,u.useState)([]),[U,W]=(0,u.useState)(!1),[G,ye]=(0,u.useState)({...g,...x,tags:x?.tags??g.tags}),K=i!==void 0,q=(0,u.useMemo)(()=>K?[...i??[]]:R,[R,K,i]),J=(0,u.useMemo)(()=>new Set(q),[q]),Y=(0,u.useRef)(new Set);(0,u.useEffect)(()=>{if(!t)return;let e=new AbortController;return fe(!0),z(null),t({query:j,type:N,collection:F===`all`?void 0:F,sort:L,signal:e.signal}).then(t=>{if(e.signal.aborted)return;let n=E(t);ce(n.items),ue(n.total)}).catch(t=>{e.signal.aborted||(z(t),d?.(t))}).finally(()=>{e.signal.aborted||fe(!1)}),()=>e.abort()},[F,t,d,j,L,N]),(0,u.useEffect)(()=>{let e=Y.current;return()=>{for(let t of e)T(t);e.clear()}},[]);let X=(0,u.useMemo)(()=>t?se:[...me,...e],[me,se,t,e]),Z=(0,u.useMemo)(()=>X.filter(e=>!ge.has(S.getId(e))).map(e=>ee(e,ve[S.getId(e)])),[S,ve,ge,X]),Q=(0,u.useMemo)(()=>{let e=t?Z:te(Z,S,j,N,F);return t?e:ne(e,S,L)},[S,F,t,Z,j,L,N]),be=le??Z.length,xe=Q.length,Se=(0,u.useMemo)(()=>Z.filter(e=>J.has(S.getId(e))),[S,Z,J]),Ce=!!j.trim()||N!==`all`||F!==`all`,$=(0,u.useCallback)(e=>{K||oe(e);let t=new Set(e),n=Z.filter(e=>t.has(S.getId(e)));o?.(e,n)},[S,K,o,Z]),we=(0,u.useCallback)(e=>{let t=new Set(r===`single`?[]:J);J.has(e)&&r!==`single`?t.delete(e):t.add(e),$(Array.from(t))},[$,J,r]),Te=(0,u.useCallback)(()=>$([]),[$]),Ee=(0,u.useCallback)(()=>{M(``),P(`all`),I(`all`)},[]),De=(0,u.useCallback)(e=>{H(t=>[...t,...e.map((e,t)=>{let n=w(e);return n&&Y.current.add(n),{id:`staged-${Date.now()}-${t}`,file:e,name:e.name,size:e.size,type:C(e),src:n,progress:0,status:`staged`}})])},[]),Oe=(0,u.useCallback)(e=>{H(t=>{let n=t.find(t=>t.id===e);return n?.src&&(T(n.src),Y.current.delete(n.src)),t.filter(t=>t.id!==e)})},[]),ke=(0,u.useCallback)(()=>{H(e=>{for(let t of e)t.src&&(T(t.src),Y.current.delete(t.src));return[]})},[]),Ae=(0,u.useCallback)(e=>{ye(t=>({...t,...e}))},[]),je=(0,u.useCallback)((e,t)=>{H(n=>n.map(n=>n.id===e?{...n,...t}:n))},[]);return{tab:D,setTab:O,view:k,setView:A,query:j,setQuery:M,type:N,setType:P,collection:F,setCollection:I,sort:L,setSort:re,detailId:ie,setDetailId:ae,items:Z,visibleItems:Q,selectedIds:q,selectedItems:Se,selectedSet:J,toggleSelection:we,clearSelection:Te,clearFilters:Ee,loading:de,error:pe,hasFilters:Ce,totalCount:be,filteredCount:xe,stagedFiles:V,addFiles:De,removeStagedFile:Oe,clearStagedFiles:ke,updateUploadOptions:Ae,uploadOptions:G,uploading:U,startUpload:(0,u.useCallback)(async()=>{if(U||V.length===0)return;W(!0),H(e=>e.map(e=>({...e,status:`uploading`,progress:0})));let e={setProgress:(e,t)=>{je(e,{progress:Math.max(0,Math.min(100,t))})},setFileStatus:(e,t,n)=>je(e,{status:t,error:n})};try{let t=V.map(e=>e.file),n=await l?.(t,G,e);if(H(e=>e.map(e=>({...e,status:`done`,progress:100}))),n?.length){he(e=>[...n,...e]);let e=n.map(e=>S.getId(e));$(r===`single`?e.slice(0,1):Array.from(new Set([...e,...q])))}ke(),O(`library`)}catch(e){z(e),H(e=>e.map(e=>e.status===`uploading`?{...e,status:`error`,error:`Upload failed`}:e)),d?.(e)}finally{W(!1)}},[S,$,ke,d,l,q,r,je,V,G,U]),updateItem:(0,u.useCallback)((e,t)=>{let n=S.getId(e);B(e=>({...e,[n]:{...e[n],...t}})),s?.(e,t)},[S,s]),removeItem:(0,u.useCallback)(e=>{let t=S.getId(e);_e(e=>new Set(e).add(t)),J.has(t)&&$(q.filter(e=>e!==t)),c?.(e)},[S,$,c,q,J]),accessors:S}}function O(e,t){return e===`image`?(0,d.jsx)(f.ImageIcon,{className:t??`size-4`}):e===`video`?(0,d.jsx)(f.Video,{className:t??`size-4`}):(0,d.jsx)(f.File,{className:t??`size-4`})}function k(e,t){return e===`image`?t.typeImage:e===`video`?t.typeVideo:t.typeFile}function A(e,t){return e?h(t.usedIn,{count:e}):t.notUsed}function j({children:e,tint:n,className:r}){return(0,d.jsx)(`div`,{className:t.cn(`media-library-preview relative overflow-hidden bg-muted`,r),style:n?{background:n}:void 0,children:e})}function M({src:e,alt:t,type:n,className:r,loading:i=`lazy`}){let[a,o]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{o(!1)},[e]),!e||a?(0,d.jsx)(`div`,{className:`media-library-preview--fallback flex size-full items-center justify-center text-muted-foreground`,children:O(n,`size-6`)}):(0,d.jsx)(`img`,{src:e,alt:t,loading:i,className:r,onError:()=>o(!0)})}function N({icon:e,title:n,description:i,action:a,className:o}){return(0,d.jsxs)(`div`,{className:t.cn(`media-library-empty-state--component flex min-h-64 flex-col items-center justify-center rounded-lg border border-dashed border-border bg-muted/20 px-6 py-10 text-center`,o),children:[(0,d.jsx)(`div`,{className:`mb-3 inline-flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:e??(0,d.jsx)(f.ImageIcon,{className:`size-5`})}),(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,children:n}),!!i&&(0,d.jsx)(r.s,{type:`secondary`,size:`xs`,className:`mt-1 max-w-sm`,children:i}),!!a&&(0,d.jsx)(`div`,{className:`mt-4`,children:a})]})}function P({query:e,type:r,typeFilters:i,collection:a,sort:o,view:l,collections:u=[],strings:p,onQueryChange:m,onTypeChange:h,onCollectionChange:g,onSortChange:_,onViewChange:v,onClearFilters:y,toolbarEnd:b}){let x=[{value:`all`,label:p.allTypes,icon:null},{value:`image`,label:p.images,icon:f.ImageIcon},{value:`video`,label:p.videos,icon:f.Video},{value:`file`,label:p.files,icon:f.File}].filter(e=>(i??[`all`,`image`,`video`]).includes(e.value)),S=[{value:`all`,label:p.allCollections},...u.map(e=>({value:e.value,label:String(e.label)}))],C=[{value:`newest`,label:p.sortNewest},{value:`name`,label:p.sortName},{value:`size`,label:p.sortSize},{value:`usage`,label:p.sortUsage}];return(0,d.jsxs)(`div`,{className:`media-library-toolbar--component flex flex-wrap items-center gap-2`,children:[(0,d.jsx)(`div`,{className:`min-w-52 flex-1`,children:(0,d.jsx)(s.t,{value:e,onChange:e=>m(e.target.value),placeholder:p.searchPlaceholder,startIcon:f.Search,clearable:!0,onClear:()=>m(``),strings:{clear:p.clearSearch},className:`rounded-full bg-muted/20`})}),(0,d.jsx)(`div`,{className:`media-library-toolbar--type-toggle flex h-9 items-center rounded-md bg-muted p-0.5`,role:`tablist`,"aria-label":p.typeFilterLabel,children:x.map(e=>{let i=e.icon,a=r===e.value;return(0,d.jsxs)(n.t,{type:`button`,role:`tab`,"aria-selected":a,variant:`secondary`,buttonStyle:`ghost`,className:t.cn(`h-8 rounded-sm px-3 text-xs shadow-none`,a?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>h(e.value),children:[i&&(0,d.jsx)(i,{className:`size-3.5`}),e.label]},e.value)})}),(0,d.jsx)(`div`,{className:`min-w-40`,children:(0,d.jsx)(c.Y,{value:a,options:S,onChange:e=>g(e??`all`),placeholder:p.collectionFilterLabel,"aria-label":p.collectionFilterLabel,className:`bg-background`})}),(0,d.jsx)(`div`,{className:`min-w-32`,children:(0,d.jsx)(c.Y,{value:o,options:C,onChange:e=>_(e??`newest`),placeholder:p.sortLabel,"aria-label":p.sortLabel,className:`bg-background`})}),(0,d.jsxs)(`div`,{className:`media-library-toolbar--view-toggle ml-auto flex h-9 items-center rounded-md bg-muted p-0.5`,children:[(0,d.jsx)(n.t,{type:`button`,variant:l===`grid`?`dark`:`secondary`,buttonStyle:l===`grid`?`solid`:`ghost`,size:`icon-small`,className:t.cn(l===`grid`&&`bg-background text-foreground shadow-xs hover:bg-background`),"aria-label":p.gridView,onClick:()=>v(`grid`),children:(0,d.jsx)(f.Grid2X2,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:l===`table`?`dark`:`secondary`,buttonStyle:l===`table`?`solid`:`ghost`,size:`icon-small`,className:t.cn(l===`table`&&`bg-background text-foreground shadow-xs hover:bg-background`),"aria-label":p.tableView,onClick:()=>v(`table`),children:(0,d.jsx)(f.LayoutList,{className:`size-3.5`})})]}),!!e&&(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:y,children:p.clearFilters}),b]})}function F({item:e,selected:i=!1,density:o=`comfortable`,showMeta:s=!0,accessors:c,strings:l,onToggle:u,onDetails:p,className:m}){let g=c.getType(e),_=c.getName(e),v=c.getSrc(e),y=c.getAlt(e)||_,x=c.getSize(e),S=c.getUsageCount(e),C=c.getPublic(e)===!1,w=c.getDuration(e);return(0,d.jsxs)(`div`,{"data-selected":i||void 0,"data-density":o,className:t.cn(`media-library-card--component group/card overflow-hidden rounded-xl border border-border/70 bg-card text-left shadow-xs transition-all`,`hover:border-primary/30 hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,i&&`media-library-card--selected border-primary ring-1 ring-primary`,m),onClick:u,children:[(0,d.jsxs)(j,{tint:c.getTint(e),className:t.cn(o===`compact`?`aspect-square`:`aspect-[4/3]`),children:[(0,d.jsx)(M,{src:v,alt:y,type:g,className:`size-full object-cover`}),(0,d.jsx)(`span`,{className:t.cn(`media-library-card--check absolute left-2 top-2 inline-flex size-5 items-center justify-center rounded-md border border-border bg-background/95 text-transparent opacity-0 shadow-xs backdrop-blur transition-opacity group-hover/card:opacity-100 group-focus-visible/card:opacity-100`,i&&`bg-primary text-primary-foreground opacity-100`),"aria-hidden":`true`,children:(0,d.jsx)(f.Check,{className:`size-3`})}),!!p&&(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`solid`,size:`icon-small`,className:`media-library-card--details absolute right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100`,"aria-label":h(l.cardDetails,{name:_}),onClick:e=>{e.stopPropagation(),p()},children:(0,d.jsx)(f.Info,{className:`size-3.5`})}),g===`video`&&!!w&&(0,d.jsxs)(a.t,{variant:`secondary`,className:`media-library-card--duration absolute bottom-2 left-2 bg-foreground text-background`,children:[(0,d.jsx)(f.Play,{className:`size-3 fill-current`}),w]}),C&&(0,d.jsx)(a.t,{variant:`secondary`,className:`media-library-card--private absolute bottom-2 right-2 bg-background/90`,children:(0,d.jsx)(f.Lock,{className:`size-3`})})]}),(0,d.jsxs)(`div`,{className:`media-library-card--body grid gap-1 px-3 py-2.5`,children:[(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:_}),s&&(0,d.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,className:`truncate`,children:b(x)||l.unknownSize}),!!S&&(0,d.jsxs)(r.s,{tag:`span`,size:`xxs`,type:`secondary`,className:`ml-auto inline-flex items-center gap-1`,children:[(0,d.jsx)(f.Layers3,{className:`size-3`}),S]})]})]})]})}function I({items:e,selectedSet:i,accessors:o,strings:s,onToggle:c,onDetails:l}){return(0,d.jsxs)(`div`,{className:`media-library-table--component min-w-180`,children:[(0,d.jsxs)(`div`,{className:`sticky top-0 z-10 grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-3 border-b border-border bg-background px-3 py-2`,children:[(0,d.jsx)(`span`,{}),(0,d.jsx)(`span`,{}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,weight:`semibold`,children:s.table.name}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,weight:`semibold`,children:s.table.type}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,weight:`semibold`,children:s.table.size}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,weight:`semibold`,children:s.table.collection}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,weight:`semibold`,children:s.table.used}),(0,d.jsx)(`span`,{})]}),e.map(e=>{let u=o.getId(e),p=i.has(u),m=o.getType(e),g=o.getName(e),_=o.getSrc(e),v=o.getPublic(e)===!1;return(0,d.jsxs)(`div`,{"data-selected":p||void 0,className:t.cn(`media-library-table--row grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-3 border-b border-border/60 px-3 py-2 last:border-b-0`,`cursor-pointer rounded-lg transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,p&&`bg-primary/10`),onClick:()=>c(u),children:[(0,d.jsx)(`span`,{className:t.cn(`inline-flex size-5 items-center justify-center rounded-md border border-border text-transparent`,p&&`border-primary bg-primary text-primary-foreground`),"aria-hidden":`true`,children:(0,d.jsx)(f.Check,{className:`size-3`})}),(0,d.jsx)(j,{tint:o.getTint(e),className:`size-9 rounded-md`,children:_?(0,d.jsx)(`img`,{src:_,alt:``,loading:`lazy`,className:`size-full object-cover`}):(0,d.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:O(m,`size-4`)})}),(0,d.jsxs)(r.s,{tag:`div`,weight:`semibold`,size:`xs`,className:`flex min-w-0 items-center gap-1 truncate`,children:[(0,d.jsx)(`span`,{className:`truncate`,children:g}),v&&(0,d.jsx)(f.Lock,{className:`size-3 shrink-0 text-muted-foreground`})]}),(0,d.jsx)(a.t,{variant:`secondary`,children:k(m,s)}),(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,children:b(o.getSize(e))||s.unknownSize}),(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`truncate`,children:o.getCollection(e)||`-`}),(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,children:o.getUsageCount(e)?o.getUsageCount(e):`-`}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,"aria-label":h(s.cardDetails,{name:g}),onClick:e=>{e.stopPropagation(),l(u)},children:(0,d.jsx)(f.Info,{className:`size-3.5`})})]},u)})]})}function L({item:e,collections:t=[],accessors:i,strings:o,onClose:u,onUpdate:p,onRemove:m,renderDetail:h}){if(!e)return null;let g=i.getName(e),_=i.getType(e),v=i.getSrc(e),y=i.getCollection(e)??t[0]?.value??``,S=i.getTags(e),C=i.getPublic(e)??!0,w=h?.(e,{accessors:i,update:p,remove:m,close:u});return w?(0,d.jsx)(d.Fragment,{children:w}):(0,d.jsxs)(`aside`,{className:`media-library-detail-panel--component flex min-h-0 w-full flex-col border-l border-border bg-background lg:w-72`,children:[(0,d.jsxs)(`div`,{className:`media-library-detail-panel--header flex items-center gap-2 border-b border-border px-3 py-2.5`,children:[(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,"aria-label":o.detail.close,onClick:u,children:(0,d.jsx)(f.ArrowLeft,{className:`size-3.5`})}),(0,d.jsx)(r.s,{weight:`semibold`,children:o.detail.title})]}),(0,d.jsxs)(`div`,{className:`media-library-detail-panel--body grid min-h-0 gap-4 overflow-y-auto p-4`,children:[(0,d.jsxs)(j,{tint:i.getTint(e),className:`aspect-[4/3] rounded-lg border border-border`,children:[(0,d.jsx)(M,{src:v,alt:i.getAlt(e)||g,type:_,className:`size-full object-cover`}),_===`video`&&!!i.getDuration(e)&&(0,d.jsxs)(a.t,{className:`absolute bottom-2 right-2 bg-foreground text-background`,children:[(0,d.jsx)(f.Play,{className:`size-3 fill-current`}),i.getDuration(e)]})]}),(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,className:`break-words`,children:g}),(0,d.jsx)(`dl`,{className:`media-library-detail-panel--facts grid gap-2`,children:[[o.detail.type,k(_,o)],[o.detail.size,b(i.getSize(e))||o.unknownSize],[o.detail.dimensions,x(e,i)||`-`],[o.detail.uploaded,String(i.getUploadedAt(e)??`-`)],[o.detail.usedIn,A(i.getUsageCount(e),o)]].map(([e,t])=>(0,d.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,d.jsx)(`dt`,{children:(0,d.jsx)(r.s,{tag:`span`,size:`xs`,type:`secondary`,children:e})}),(0,d.jsx)(`dd`,{className:`m-0 text-right`,children:(0,d.jsx)(r.s,{tag:`span`,size:`xs`,weight:`medium`,children:t})})]},e))}),(0,d.jsx)(l.D,{label:o.detail.altText,children:(0,d.jsx)(s.t,{value:i.getAlt(e)??``,placeholder:o.detail.altPlaceholder,onChange:e=>p({alt:e.target.value})})}),(0,d.jsx)(l.D,{label:o.detail.collection,children:(0,d.jsx)(c.Y,{value:y,options:t.map(e=>({value:e.value,label:String(e.label)})),"aria-label":o.detail.collection,onChange:e=>p({collection:e})})}),(0,d.jsx)(l.D,{label:o.detail.tags,children:(0,d.jsx)(s.t,{value:S.join(`, `),placeholder:o.detail.tagsPlaceholder,onChange:e=>p({tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})}),(0,d.jsxs)(`div`,{className:`media-library-detail-panel--public flex items-center justify-between gap-4 rounded-lg border border-border bg-muted/20 p-3`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(r.s,{weight:`semibold`,size:`xs`,children:o.detail.public}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,children:C?o.detail.publicHint:o.detail.privateHint})]}),(0,d.jsx)(c.J,{checked:C,onCheckedChange:e=>p({public:e})})]}),(0,d.jsxs)(`div`,{className:`media-library-detail-panel--actions flex flex-wrap gap-2`,children:[(0,d.jsxs)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`outline`,children:[(0,d.jsx)(f.UploadCloud,{className:`size-3.5`}),o.detail.replace]}),(0,d.jsxs)(n.t,{type:`button`,variant:`error`,buttonStyle:`ghost`,onClick:m,children:[(0,d.jsx)(f.Trash2,{className:`size-3.5`}),o.detail.delete]})]})]})]})}function re({stagedFiles:e,uploadOptions:t,collections:i=[],uploading:o=!1,strings:u,onFiles:p,onRemoveFile:m,onOptionsChange:g,empty:_}){return(0,d.jsxs)(`div`,{className:`media-library-upload-panel--component grid gap-4 p-4`,children:[(0,d.jsx)(c.T,{onDrop:p,accept:`image/*,video/*`,multiple:!0,size:`default`,strings:{instruction:u.upload.dropTitle,helper:u.upload.dropHint,dragOver:u.upload.dragOver}}),e.length>0?(0,d.jsx)(`div`,{className:`media-library-upload-panel--staged grid gap-2`,children:e.map(e=>(0,d.jsxs)(`div`,{className:`media-library-upload-panel--staged-file flex items-center gap-3 rounded-lg border border-border bg-card p-2`,children:[(0,d.jsx)(j,{className:`size-10 rounded-md`,children:e.src?(0,d.jsx)(`img`,{src:e.src,alt:e.name,className:`size-full object-cover`}):(0,d.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:O(e.type,`size-4`)})}),(0,d.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,d.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,d.jsx)(r.s,{weight:`semibold`,size:`xs`,className:`truncate`,children:e.name}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,className:`ml-auto shrink-0`,children:b(e.size)})]}),(e.status===`uploading`||e.status===`done`)&&(0,d.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-muted`,children:(0,d.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width]`,style:{width:`${e.progress}%`}})}),e.status===`error`&&(0,d.jsx)(r.s,{size:`xxs`,type:`error`,children:e.error})]}),e.status===`done`?(0,d.jsx)(a.t,{variant:`success`,children:u.upload.done}):e.status===`uploading`?(0,d.jsxs)(r.s,{size:`xxs`,type:`secondary`,className:`tabular-nums`,children:[Math.round(e.progress),`%`]}):(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:o,"aria-label":h(u.upload.removeFile,{name:e.name}),onClick:()=>m(e.id),children:(0,d.jsx)(f.X,{className:`size-3.5`})})]},e.id))}):_,(0,d.jsxs)(`div`,{className:`media-library-upload-panel--options grid gap-3 rounded-lg border border-border bg-muted/20 p-3 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,d.jsx)(l.D,{label:u.upload.collection,children:(0,d.jsx)(c.Y,{value:t.collection??i[0]?.value,options:i.map(e=>({value:e.value,label:String(e.label)})),"aria-label":u.upload.collection,onChange:e=>g({collection:e})})}),(0,d.jsx)(l.D,{label:u.upload.tags,children:(0,d.jsx)(s.t,{value:t.tags.join(`, `),placeholder:u.upload.tagsPlaceholder,onChange:e=>g({tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})}),(0,d.jsxs)(`div`,{className:`flex items-center justify-between gap-4 md:self-end`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(r.s,{weight:`semibold`,size:`xs`,children:u.upload.public}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,children:u.upload.publicHint})]}),(0,d.jsx)(c.J,{checked:t.public,onCheckedChange:e=>g({public:e})})]})]})]})}function ie({tab:e,selectedIds:i,selectionMode:a,stagedFiles:o,strings:s,onClearSelection:c,className:l}){let u=i.length,f=o.reduce((e,t)=>e+t.size,0),p=o.length,m=t.cn(`media-library-footer-summary--component flex min-w-0 items-center gap-3`,l);return e===`upload`?(0,d.jsx)(`div`,{className:m,"aria-live":`polite`,children:(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`truncate`,children:p===0?s.footer.noFiles:h(s.footer.stagedSummary,{count:p,size:b(f)})})}):(0,d.jsx)(`div`,{className:m,"aria-live":`polite`,children:u>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(r.s,{weight:`semibold`,size:`xs`,className:`whitespace-nowrap`,children:h(s.footer.selectedCount,{count:u})}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`small`,onClick:c,children:s.footer.clear})]}):(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`truncate`,children:a===`single`?s.footer.pickOne:s.footer.pickMany})})}function ae({tab:e,selectedItems:r,selectedIds:i,stagedFiles:a,uploading:o=!1,strings:s,confirmLabel:c,cancelLabel:l,onCancel:u,onConfirm:f,onUpload:p,onCancelUpload:m,className:g}){let _=i.length,v=a.length;return e===`upload`?(0,d.jsxs)(`div`,{className:t.cn(`media-library-footer-actions--component flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,g),children:[(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,disabled:o,onClick:m,children:l??s.footer.cancel}),(0,d.jsx)(n.t,{type:`button`,disabled:v===0||o,onClick:p,loading:o,loadingLabels:{loading:s.footer.uploading},children:v<=1?s.footer.upload:h(s.footer.uploadMany,{count:v})})]}):(0,d.jsxs)(`div`,{className:t.cn(`media-library-footer-actions--component flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,g),children:[(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:u,children:l??s.footer.cancel}),(0,d.jsx)(n.t,{type:`button`,disabled:_===0,onClick:f,children:c??(_===0?s.footer.confirmEmpty:r.length===1?s.footer.confirmOne:h(s.footer.confirmMany,{count:_}))})]})}function R({tab:e,selectedItems:n,selectedIds:r,selectionMode:i,stagedFiles:a,uploading:o=!1,strings:s,confirmLabel:c,cancelLabel:l,onCancel:u,onConfirm:f,onClearSelection:p,onUpload:m,onCancelUpload:h,chrome:g=`section`,className:_}){return(0,d.jsxs)(`footer`,{className:t.cn(`media-library-footer--component flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,g===`section`&&`border-t border-border bg-background px-4 py-3`,_),children:[(0,d.jsx)(ie,{tab:e,selectedIds:r,selectionMode:i,stagedFiles:a,strings:s,onClearSelection:p}),(0,d.jsx)(ae,{tab:e,selectedItems:n,selectedIds:r,stagedFiles:a,uploading:o,strings:s,confirmLabel:c,cancelLabel:l,onCancel:u,onConfirm:f,onUpload:m,onCancelUpload:h})]})}var oe=(0,u.createContext)(null);function se(e,t,n){return(0,u.useMemo)(()=>{if(e)return e;let r=new Set;for(let e of t){let t=n(e);t&&r.add(t)}return Array.from(r).map(e=>({value:e,label:e}))},[e,n,t])}function ce({title:i,description:a,confirmLabel:s,cancelLabel:c,selectionMode:l=`multiple`,density:g=`comfortable`,showMeta:_=!0,allowUpload:v=!0,typeFilters:y,confirmOnSelect:b=!1,onConfirm:x,onCancel:S,onClose:C,strings:w,slots:T,heightClassName:E,className:ee,items:te,fetcher:ne,accessors:O,collections:k,value:A,defaultValue:j,onValueChange:M,onItemUpdate:ce,onItemDelete:le,onUpload:ue,onError:de,initialTab:fe,defaultView:pe,defaultQuery:z,defaultType:me,defaultCollection:he,defaultSort:ge,defaultUploadOptions:_e,...ve}){let B=e.useStrings(m,w),V=D({items:te,fetcher:ne,accessors:O,collections:k,selectionMode:l,value:A,defaultValue:j,onValueChange:M,onItemUpdate:ce,onItemDelete:le,onUpload:ue,onError:de,initialTab:fe,defaultView:pe,defaultQuery:z,defaultType:me,defaultCollection:he,defaultSort:ge,defaultUploadOptions:_e}),H=se(k,V.items,V.accessors.getCollection),U=v?V.tab:`library`,W=V.detailId?V.items.find(e=>V.accessors.getId(e)===V.detailId)??null:null,G=(0,u.useContext)(oe),ye=!T?.footer,K=G&&ye?(0,d.jsx)(ie,{tab:U,selectedIds:V.selectedIds,selectionMode:l,stagedFiles:V.stagedFiles,strings:B,onClearSelection:V.clearSelection,className:`media-library-dialog--selection-summary shrink-0 justify-end`}):null,q=!!(i||a||T?.headerStart),J=!!(v||T?.headerEnd||K),Y=q||J,X=()=>{x?.(V.selectedItems,V.selectedIds),C?.()},Z=()=>{S?.(),C?.()},Q=e=>{let t=V.accessors.getId(e);V.toggleSelection(t),b&&(x?.([e],[t]),C?.())},be=V.filteredCount===V.totalCount?h(B.countAll,{count:V.totalCount}):h(B.countFiltered,{count:V.filteredCount,total:V.totalCount}),xe=T?.footer??(G?(0,d.jsx)(ae,{tab:U,selectedItems:V.selectedItems,selectedIds:V.selectedIds,stagedFiles:V.stagedFiles,uploading:V.uploading,strings:B,confirmLabel:s,cancelLabel:c,onCancel:Z,onConfirm:X,onUpload:V.startUpload,onCancelUpload:()=>{V.clearStagedFiles(),V.setTab(`library`)},className:`ml-auto`}):(0,d.jsx)(R,{tab:U,selectedItems:V.selectedItems,selectedIds:V.selectedIds,selectionMode:l,stagedFiles:V.stagedFiles,uploading:V.uploading,strings:B,confirmLabel:s,cancelLabel:c,onCancel:Z,onConfirm:X,onClearSelection:V.clearSelection,onUpload:V.startUpload,onCancelUpload:()=>{V.clearStagedFiles(),V.setTab(`library`)}}));return(0,d.jsxs)(`section`,{className:t.cn(`media-library--component flex min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-background`,E??`h-190 max-h-[calc(100vh-7rem)]`,ee),...ve,children:[Y&&(0,d.jsxs)(`header`,{className:`media-library--header flex flex-col gap-3 border-b border-border px-4 py-3 lg:flex-row lg:items-center lg:justify-between`,children:[q&&(0,d.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[T?.headerStart,(i||a)&&(0,d.jsxs)(`div`,{className:`min-w-0`,children:[!!i&&(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,children:i}),!!a&&(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:a})]})]}),J&&(0,d.jsxs)(`div`,{className:t.cn(`flex min-w-0 flex-wrap items-center gap-2`,K?`flex-1 justify-between`:`lg:justify-end`),children:[(0,d.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[v&&(0,d.jsxs)(`div`,{className:`media-library--tabs flex items-center rounded-md bg-muted p-0.5`,role:`tablist`,children:[(0,d.jsxs)(n.t,{type:`button`,role:`tab`,"aria-selected":U===`library`,variant:`secondary`,buttonStyle:`ghost`,className:t.cn(`h-8 rounded-sm px-3 shadow-none`,U===`library`?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>V.setTab(`library`),children:[(0,d.jsx)(f.ImageIcon,{className:`size-3.5`}),B.tabs.library]}),(0,d.jsxs)(n.t,{type:`button`,role:`tab`,"aria-selected":U===`upload`,variant:`secondary`,buttonStyle:`ghost`,className:t.cn(`h-8 rounded-sm px-3 shadow-none`,U===`upload`?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>V.setTab(`upload`),children:[(0,d.jsx)(f.UploadCloud,{className:`size-3.5`}),B.tabs.upload,V.stagedFiles.length>0&&(0,d.jsx)(`span`,{className:`rounded-full bg-background/20 px-1.5 text-xxs tabular-nums`,children:V.stagedFiles.length})]})]}),T?.headerEnd]}),K]})]}),(0,d.jsxs)(`div`,{className:`media-library--body flex min-h-0 flex-1`,children:[U===`upload`?(0,d.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:(0,d.jsx)(re,{stagedFiles:V.stagedFiles,uploadOptions:V.uploadOptions,collections:H,uploading:V.uploading,strings:B,onFiles:V.addFiles,onRemoveFile:V.removeStagedFile,onOptionsChange:V.updateUploadOptions,empty:T?.uploadEmpty})}):(0,d.jsxs)(`div`,{className:t.cn(`media-library--library min-w-0 flex-1 flex-col`,W?`hidden lg:flex`:`flex`),children:[(0,d.jsxs)(`div`,{className:`media-library--toolbar border-b border-border/70 px-4 py-3`,children:[(0,d.jsx)(P,{query:V.query,type:V.type,typeFilters:y,collection:V.collection,sort:V.sort,view:V.view,collections:H,strings:B,onQueryChange:V.setQuery,onTypeChange:V.setType,onCollectionChange:V.setCollection,onSortChange:V.setSort,onViewChange:V.setView,onClearFilters:V.clearFilters,toolbarEnd:T?.toolbarEnd}),(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-2`,"aria-live":`polite`,children:be})]}),(0,d.jsx)(`div`,{className:`media-library--results min-h-0 flex-1 overflow-y-auto p-4`,children:V.loading?T?.loading??(0,d.jsx)(`div`,{className:`flex min-h-64 items-center justify-center`,children:(0,d.jsx)(r.s,{type:`secondary`,children:B.loading})}):V.error?T?.error??(0,d.jsxs)(o.t,{variant:`destructive`,children:[(0,d.jsx)(o.i,{children:B.errorTitle}),(0,d.jsx)(o.r,{children:B.errorDescription})]}):V.visibleItems.length===0?T?.empty??(0,d.jsx)(N,{title:V.hasFilters?B.emptyFilteredTitle:B.emptyLibraryTitle,description:V.hasFilters?B.emptyFilteredDescription:B.emptyLibraryDescription,action:V.hasFilters?(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`outline`,onClick:V.clearFilters,children:B.clearFilters}):v?(0,d.jsxs)(n.t,{type:`button`,onClick:()=>V.setTab(`upload`),children:[(0,d.jsx)(f.UploadCloud,{className:`size-3.5`}),B.uploadMedia]}):void 0}):V.view===`table`?(0,d.jsx)(`div`,{className:`overflow-x-auto`,children:(0,d.jsx)(I,{items:V.visibleItems,selectedSet:V.selectedSet,selectionMode:l,accessors:V.accessors,strings:B,onToggle:e=>{let t=V.items.find(t=>V.accessors.getId(t)===e);t&&Q(t)},onDetails:V.setDetailId})}):(0,d.jsx)(`div`,{className:t.cn(`media-library--grid grid gap-3`,g===`compact`?`grid-cols-[repeat(auto-fill,minmax(136px,1fr))]`:`grid-cols-[repeat(auto-fill,minmax(168px,1fr))]`),children:V.visibleItems.map(e=>{let t=V.accessors.getId(e),n={id:t,selected:V.selectedSet.has(t),selectionMode:l,accessors:V.accessors,toggle:()=>Q(e),openDetails:()=>V.setDetailId(t)},r=T?.renderItem?.(e,n);return r?(0,d.jsx)(`div`,{children:r},t):(0,d.jsx)(F,{item:e,selected:n.selected,density:g,showMeta:_,selectionMode:l,accessors:V.accessors,strings:B,onToggle:n.toggle,onDetails:n.openDetails},t)})})})]}),U===`library`&&(0,d.jsx)(L,{item:W,collections:H,accessors:V.accessors,strings:B,onClose:()=>V.setDetailId(null),onUpdate:e=>W&&V.updateItem(W,e),onRemove:()=>{W&&(V.removeItem(W),V.setDetailId(null))},renderDetail:T?.renderDetail})]}),G?G.element?(0,p.createPortal)(xe,G.element):null:xe]})}function le({open:n,onOpenChange:r,trigger:a,dialogTitle:o,dialogDescription:s,onClose:c,className:l,dialogClassName:f,contentClassName:p,closeOnEscape:h=!0,closeOnBackdropClick:g=!0,..._}){let v=e.useStrings(m,_.strings),[y,b]=(0,u.useState)(!1),[x,S]=(0,u.useState)(null),C=n!==void 0,w=C?n:y,T=e=>{C||b(e),r?.(e)},E=()=>{T(!1),c?.()};return(0,d.jsx)(oe.Provider,{value:{element:x},children:(0,d.jsx)(i.r,{open:w,onOpenChange:T,onClose:c,trigger:a,title:o??v.title,description:s??v.description,size:`full`,showCancel:!1,showConfirm:!1,footer:(0,d.jsx)(`div`,{ref:S,className:`media-library-dialog--footer`}),className:t.cn(`media-library-dialog--component max-h-[calc(100vh-2rem)] max-w-[min(1060px,calc(100vw-2rem))]`,f),contentClassName:t.cn(`media-library-dialog--body flex min-h-0 flex-col overflow-hidden p-0`,p),closeOnBackdropClick:g,closeOnEscape:h,children:(0,d.jsx)(ce,{..._,onClose:E,className:t.cn(`media-library-dialog--library rounded-none border-0`,l),heightClassName:_.heightClassName??`min-h-0 flex-1`,strings:_.strings})})})}function ue(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return i===void 0||r.splice(n,0,i),r}function de({items:i,accessors:o,title:s,description:c,primaryId:l,onPrimaryChange:u,onRemove:p,onReorder:g,onAdd:_,maxItems:v,layout:x=`field`,density:S=`comfortable`,readOnly:C=!1,empty:w,action:T,renderItem:E,strings:ee,className:te,...ne}){let D=e.useStrings(m,ee),O=y(o),k=i.length,A=l??(k>0?O.getId(i[0]):void 0),j=!C&&!!_&&(v===void 0||k<v),M=j&&(x===`field`||k>0)?(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`outline`,icon:f.Plus,onClick:_,children:D.gallery.add}):v!==void 0&&k>=v?(0,d.jsx)(a.t,{variant:`secondary`,children:D.gallery.maxReached}):null,P=(e,t)=>{if(t<0||t>=k||e===t)return;let n=ue(i,e,t);g?.(n.map(e=>O.getId(e)),n)},F=!!(s||c||T||M),I=k===0&&x!==`field`,L=()=>!j||x!==`field`?null:(0,d.jsxs)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,className:t.cn(`media-resource-gallery--add-tile h-auto min-h-24 w-full flex-col rounded-lg border border-dashed border-border bg-background text-muted-foreground shadow-none`,`aspect-square hover:border-primary/50 hover:bg-primary/5 hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`),"aria-label":D.gallery.addTile,onClick:_,children:[(0,d.jsx)(f.Plus,{className:`size-4`}),(0,d.jsx)(`span`,{className:`sr-only`,children:D.gallery.addTile})]});return(0,d.jsxs)(`section`,{className:t.cn(`media-resource-gallery--component rounded-lg border border-border bg-card shadow-xs`,te),"data-layout":x,"data-density":S,...ne,children:[F&&(0,d.jsxs)(`header`,{className:`media-resource-gallery--header flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,d.jsxs)(`div`,{className:`min-w-0`,children:[!!s&&(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,children:s}),!!c&&(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:c})]}),(0,d.jsx)(`div`,{className:`media-resource-gallery--actions flex flex-wrap items-center gap-2`,children:T??M})]}),I?(0,d.jsx)(`div`,{className:`media-resource-gallery--empty p-4 pt-0`,children:w??(0,d.jsx)(N,{title:D.gallery.emptyTitle,description:D.gallery.emptyDescription,action:j?(0,d.jsx)(n.t,{type:`button`,icon:f.ImagePlus,onClick:_,children:D.gallery.add}):void 0})}):(0,d.jsxs)(`div`,{className:t.cn(`media-resource-gallery--items p-4`,F&&`pt-0`,x===`list`?`grid gap-2`:x===`field`?`grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-3 sm:grid-cols-[repeat(auto-fill,minmax(108px,1fr))]`:S===`compact`?`grid grid-cols-[repeat(auto-fill,minmax(132px,1fr))] gap-3`:`grid grid-cols-[repeat(auto-fill,minmax(164px,1fr))] gap-3`),children:[i.map((e,i)=>{let o=O.getId(e),s=O.getName(e),c=O.getType(e),l=O.getSrc(e),m=O.getAlt(e)||s,g=o===A,_=O.getPublic(e)===!1,v=O.getDuration(e),y=i>0,S=i<k-1,w=E?.(e,{id:o,index:i,total:k,primary:g,accessors:O,canMovePrevious:y,canMoveNext:S,setPrimary:()=>u?.(o,e),remove:()=>p?.(o,e),movePrevious:()=>P(i,i-1),moveNext:()=>P(i,i+1)});return w?(0,d.jsx)(`div`,{children:w},o):x===`field`?(0,d.jsxs)(`div`,{className:t.cn(`media-resource-gallery--item group/gallery relative aspect-square overflow-hidden rounded-lg border border-border bg-background shadow-xs`,`transition-colors hover:border-primary/40 focus-within:border-primary/50`,g&&`col-span-2 row-span-2 min-h-52`),"data-primary":g||void 0,children:[l?(0,d.jsx)(`img`,{src:l,alt:m,loading:`lazy`,className:`size-full object-cover`}):(0,d.jsx)(`div`,{className:`flex size-full items-center justify-center bg-muted text-muted-foreground`,children:(0,d.jsx)(f.File,{className:g?`size-7`:`size-5`})}),g&&(0,d.jsx)(a.t,{variant:`secondary`,className:`absolute left-2 top-2 bg-background/90 shadow-xs`,children:D.gallery.cover}),c===`video`&&!!v&&(0,d.jsxs)(a.t,{variant:`secondary`,className:`absolute bottom-2 left-2 bg-foreground text-background`,children:[(0,d.jsx)(f.Play,{className:`size-3 fill-current`}),v]}),_&&(0,d.jsx)(`span`,{className:`absolute bottom-2 right-2 inline-flex size-6 items-center justify-center rounded-full border border-border bg-background/90 text-muted-foreground shadow-xs`,children:(0,d.jsx)(f.Lock,{className:`size-3`})}),!C&&(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`solid`,size:`icon-small`,className:`absolute right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/gallery:opacity-100 group-focus-within/gallery:opacity-100`,"aria-label":D.gallery.remove,onClick:()=>p?.(o,e),children:(0,d.jsx)(f.X,{className:`size-3.5`})})]},o):x===`list`?(0,d.jsxs)(`div`,{className:`media-resource-gallery--item flex min-w-0 items-center gap-3 rounded-lg border border-border bg-background p-2`,"data-primary":g||void 0,children:[(0,d.jsx)(`div`,{className:`relative size-12 shrink-0 overflow-hidden rounded-md bg-muted`,children:l?(0,d.jsx)(`img`,{src:l,alt:m,loading:`lazy`,className:`size-full object-cover`}):(0,d.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:(0,d.jsx)(f.File,{className:`size-4`})})}),(0,d.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,d.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:s}),g&&(0,d.jsx)(a.t,{variant:`info`,children:D.gallery.primary})]}),(0,d.jsxs)(r.s,{size:`xxs`,type:`secondary`,children:[h(D.gallery.itemPosition,{index:i+1,total:k}),` · `,b(O.getSize(e))||D.unknownSize]})]}),!C&&(0,d.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:g,"aria-label":D.gallery.setPrimary,onClick:()=>u?.(o,e),children:(0,d.jsx)(f.Star,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:!y,"aria-label":D.gallery.movePrevious,onClick:()=>P(i,i-1),children:(0,d.jsx)(f.ArrowLeft,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:!S,"aria-label":D.gallery.moveNext,onClick:()=>P(i,i+1),children:(0,d.jsx)(f.ArrowRight,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`error`,buttonStyle:`ghost`,size:`icon-small`,"aria-label":D.gallery.remove,onClick:()=>p?.(o,e),children:(0,d.jsx)(f.Trash2,{className:`size-3.5`})})]})]},o):(0,d.jsxs)(`div`,{className:`media-resource-gallery--item group/gallery overflow-hidden rounded-lg border border-border bg-background shadow-xs transition-colors hover:border-primary/40`,"data-primary":g||void 0,children:[(0,d.jsxs)(`div`,{className:`relative aspect-[4/3] bg-muted`,children:[l?(0,d.jsx)(`img`,{src:l,alt:m,loading:`lazy`,className:`size-full object-cover`}):(0,d.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:(0,d.jsx)(f.File,{className:`size-6`})}),(0,d.jsxs)(`div`,{className:`absolute left-2 top-2 flex flex-wrap gap-1`,children:[g&&(0,d.jsx)(a.t,{variant:`info`,children:D.gallery.primary}),(0,d.jsx)(a.t,{variant:`secondary`,children:h(D.gallery.itemPosition,{index:i+1,total:k})})]})]}),(0,d.jsxs)(`div`,{className:`media-resource-gallery--item-body grid gap-2 p-3`,children:[(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:s}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,children:b(O.getSize(e))||D.unknownSize})]}),!C&&(0,d.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:g,"aria-label":D.gallery.setPrimary,onClick:()=>u?.(o,e),children:(0,d.jsx)(f.Star,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:!y,"aria-label":D.gallery.movePrevious,onClick:()=>P(i,i-1),children:(0,d.jsx)(f.ArrowLeft,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:!S,"aria-label":D.gallery.moveNext,onClick:()=>P(i,i+1),children:(0,d.jsx)(f.ArrowRight,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`error`,buttonStyle:`ghost`,size:`icon-small`,className:`ml-auto`,"aria-label":D.gallery.remove,onClick:()=>p?.(o,e),children:(0,d.jsx)(f.Trash2,{className:`size-3.5`})})]})]})]},o)}),L()]})]})}exports.MediaLibrary=ce,exports.MediaLibraryCard=F,exports.MediaLibraryDetailPanel=L,exports.MediaLibraryDialog=le,exports.MediaLibraryEmptyState=N,exports.MediaLibraryFooter=R,exports.MediaLibraryTable=I,exports.MediaLibraryToolbar=P,exports.MediaLibraryUploadPanel=re,exports.MediaResourceGallery=de,exports.defaultMediaLibraryStrings=m,exports.formatMediaLibrarySize=b,exports.formatMediaLibraryString=h,exports.getMediaLibraryDimensions=x,exports.resolveMediaLibraryAccessors=y,exports.useMediaLibrary=D;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../lib/strings.cjs"),t=require("../../../lib/utils.cjs"),n=require("../../../_shared/button-Bd5bEIiB.cjs"),r=require("../../../_shared/typography-CO9uwZhF.cjs"),i=require("../../../_shared/overlays-Du65iCkx.cjs"),a=require("../../../_shared/badge-BeSKxX1u.cjs"),o=require("../../../_shared/alert-V0V36Sny.cjs"),s=require("../../../_shared/input-CB6hxh-5.cjs"),c=require("../../../_shared/forms-CzrEYejY.cjs"),l=require("../../../_shared/display-Bin2vVex.cjs");let u=require("react"),d=require("react/jsx-runtime"),f=require("lucide-react"),p=require("react-dom");var m={title:`Add media`,description:`Pick from the library, or upload new files.`,close:`Close media library`,tabs:{library:`Library`,upload:`Upload`},searchPlaceholder:`Search by name or tag...`,clearSearch:`Clear search`,typeFilterLabel:`Type`,collectionFilterLabel:`Collection`,sortLabel:`Sort`,viewLabel:`View`,allTypes:`All`,images:`Images`,videos:`Videos`,files:`Files`,allCollections:`All collections`,sortNewest:`Newest`,sortName:`Name`,sortSize:`Size`,sortUsage:`Most used`,gridView:`Grid view`,tableView:`Table view`,countAll:`{count} items`,countFiltered:`{count} of {total} items`,emptyLibraryTitle:`Library is empty`,emptyLibraryDescription:`Upload images or videos to start building the library.`,emptyFilteredTitle:`No media matches`,emptyFilteredDescription:`Try a different search term, or clear the filters.`,clearFilters:`Clear filters`,uploadMedia:`Upload media`,loading:`Loading media...`,errorTitle:`Media could not load`,errorDescription:`Try again or adjust your filters.`,cardDetails:`Details for {name}`,privateLabel:`Private`,publicLabel:`Public`,typeImage:`Image`,typeVideo:`Video`,typeFile:`File`,unknownSize:`Unknown`,notUsed:`Not used yet`,usedIn:`{count} {count, plural, one {place} other {places}}`,table:{name:`Name`,type:`Type`,size:`Size`,collection:`Collection`,used:`Used`},detail:{title:`Details`,altText:`Alt text`,altPlaceholder:`Describe this media for screen readers`,collection:`Collection`,tags:`Tags`,tagsPlaceholder:`Comma-separated`,public:`Public`,publicHint:`Served from the public CDN`,privateHint:`Only visible in the admin`,type:`Type`,size:`Size`,dimensions:`Dimensions`,uploaded:`Uploaded`,usedIn:`Used in`,replace:`Replace file`,delete:`Delete`,close:`Close details`},upload:{dropTitle:`Drag files here or click to browse`,dropHint:`JPG, PNG, WebP, SVG and MP4 up to 50 MB per file`,dragOver:`Release to stage files`,collection:`Collection`,tags:`Tags`,tagsPlaceholder:`Comma-separated`,public:`Public`,publicHint:`Serve from the public CDN`,noFiles:`No files staged`,stagedCount:`{count} {count, plural, one {file} other {files}}`,removeFile:`Remove {name}`,uploading:`Uploading`,done:`Done`},footer:{pickOne:`Pick one item`,pickMany:`Pick one or more items`,selectedCount:`{count} selected`,clear:`Clear`,cancel:`Cancel`,confirmEmpty:`Add to product`,confirmOne:`Add 1 item`,confirmMany:`Add {count} items`,noFiles:`No files staged`,stagedSummary:`{count} {count, plural, one {file} other {files}} · {size}`,upload:`Upload`,uploadMany:`Upload {count} files`,uploading:`Uploading...`},gallery:{emptyTitle:`No media attached`,emptyDescription:`Add images, video, or files to this resource.`,add:`Add media`,addMore:`Add more`,addTile:`Add another media item`,cover:`Cover`,primary:`Primary`,setPrimary:`Set primary`,remove:`Remove`,movePrevious:`Move previous`,moveNext:`Move next`,itemPosition:`{index} of {total}`,maxReached:`Maximum reached`}};function h(e,t){return e.replace(/\{(\w+), plural, one \{([^}]*)\} other \{([^}]*)\}\}/g,(e,n,r,i)=>Number(t[n])===1?r:i).replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??``))}var g={collection:void 0,tags:[],public:!0},_=[],v={getId:e=>e.id,getName:e=>e.name,getType:e=>e.type,getSrc:e=>e.src,getAlt:e=>e.alt,getSize:e=>e.size,getWidth:e=>e.width,getHeight:e=>e.height,getDuration:e=>e.duration,getCollection:e=>e.collection,getTags:e=>e.tags??[],getPublic:e=>e.public,getUploadedAt:e=>e.uploadedAt,getUsageCount:e=>e.usageCount,getTint:e=>e.tint,getMimeType:e=>e.mimeType};function y(e){return{...v,...e??{}}}function b(e){return!e||e<=0?``:e>=1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function x(e,t){let n=t.getWidth(e),r=t.getHeight(e);return!n||!r?``:`${n} x ${r}`}function S(e,t){let n=t.getUploadedAt(e);if(!n)return 0;let r=(n instanceof Date?n:new Date(n)).getTime();return Number.isFinite(r)?r:0}function C(e){return e.type.startsWith(`image/`)?`image`:e.type.startsWith(`video/`)?`video`:`file`}function w(e){if(e.type.startsWith(`image/`)&&!(typeof URL>`u`||typeof URL.createObjectURL!=`function`))return URL.createObjectURL(e)}function T(e){!e||typeof URL>`u`||typeof URL.revokeObjectURL!=`function`||URL.revokeObjectURL(e)}function E(e){return Array.isArray(e)?{items:e,total:e.length}:e}function ee(e,t){return t&&typeof e==`object`&&e?{...e,...t}:e}function te(e,t,n,r,i){let a=n.trim().toLowerCase();return e.filter(e=>r!==`all`&&t.getType(e)!==r||i!==`all`&&t.getCollection(e)!==i?!1:a?[t.getName(e),t.getAlt(e),t.getCollection(e),...t.getTags(e)].filter(Boolean).join(` `).toLowerCase().includes(a):!0)}function ne(e,t,n){let r=e.slice();return n===`name`?r.sort((e,n)=>t.getName(e).localeCompare(t.getName(n))):n===`size`?r.sort((e,n)=>(t.getSize(n)??0)-(t.getSize(e)??0)):n===`usage`?r.sort((e,n)=>(t.getUsageCount(n)??0)-(t.getUsageCount(e)??0)):r.sort((e,n)=>S(n,t)-S(e,t)),r}function D({items:e=_,fetcher:t,accessors:n,selectionMode:r=`multiple`,value:i,defaultValue:a=[],onValueChange:o,onItemUpdate:s,onItemDelete:c,onUpload:l,onError:d,initialTab:f=`library`,defaultView:p=`grid`,defaultQuery:m=``,defaultType:h=`all`,defaultCollection:v=`all`,defaultSort:b=`newest`,defaultUploadOptions:x}={}){let S=(0,u.useMemo)(()=>y(n),[n]),[D,O]=(0,u.useState)(f),[k,A]=(0,u.useState)(p),[j,M]=(0,u.useState)(m),[N,P]=(0,u.useState)(h),[F,I]=(0,u.useState)(v),[L,re]=(0,u.useState)(b),[ie,ae]=(0,u.useState)(null),[R,oe]=(0,u.useState)(()=>[...a]),[se,ce]=(0,u.useState)([]),[le,ue]=(0,u.useState)(),[de,fe]=(0,u.useState)(!1),[pe,z]=(0,u.useState)(null),[me,he]=(0,u.useState)([]),[ge,_e]=(0,u.useState)(()=>new Set),[ve,B]=(0,u.useState)({}),[V,H]=(0,u.useState)([]),[U,W]=(0,u.useState)(!1),[G,ye]=(0,u.useState)({...g,...x,tags:x?.tags??g.tags}),K=i!==void 0,q=(0,u.useMemo)(()=>K?[...i??[]]:R,[R,K,i]),J=(0,u.useMemo)(()=>new Set(q),[q]),Y=(0,u.useRef)(new Set);(0,u.useEffect)(()=>{if(!t)return;let e=new AbortController;return fe(!0),z(null),t({query:j,type:N,collection:F===`all`?void 0:F,sort:L,signal:e.signal}).then(t=>{if(e.signal.aborted)return;let n=E(t);ce(n.items),ue(n.total)}).catch(t=>{e.signal.aborted||(z(t),d?.(t))}).finally(()=>{e.signal.aborted||fe(!1)}),()=>e.abort()},[F,t,d,j,L,N]),(0,u.useEffect)(()=>{let e=Y.current;return()=>{for(let t of e)T(t);e.clear()}},[]);let X=(0,u.useMemo)(()=>t?se:[...me,...e],[me,se,t,e]),Z=(0,u.useMemo)(()=>X.filter(e=>!ge.has(S.getId(e))).map(e=>ee(e,ve[S.getId(e)])),[S,ve,ge,X]),Q=(0,u.useMemo)(()=>{let e=t?Z:te(Z,S,j,N,F);return t?e:ne(e,S,L)},[S,F,t,Z,j,L,N]),be=le??Z.length,xe=Q.length,Se=(0,u.useMemo)(()=>Z.filter(e=>J.has(S.getId(e))),[S,Z,J]),Ce=!!j.trim()||N!==`all`||F!==`all`,$=(0,u.useCallback)(e=>{K||oe(e);let t=new Set(e),n=Z.filter(e=>t.has(S.getId(e)));o?.(e,n)},[S,K,o,Z]),we=(0,u.useCallback)(e=>{let t=new Set(r===`single`?[]:J);J.has(e)&&r!==`single`?t.delete(e):t.add(e),$(Array.from(t))},[$,J,r]),Te=(0,u.useCallback)(()=>$([]),[$]),Ee=(0,u.useCallback)(()=>{M(``),P(`all`),I(`all`)},[]),De=(0,u.useCallback)(e=>{H(t=>[...t,...e.map((e,t)=>{let n=w(e);return n&&Y.current.add(n),{id:`staged-${Date.now()}-${t}`,file:e,name:e.name,size:e.size,type:C(e),src:n,progress:0,status:`staged`}})])},[]),Oe=(0,u.useCallback)(e=>{H(t=>{let n=t.find(t=>t.id===e);return n?.src&&(T(n.src),Y.current.delete(n.src)),t.filter(t=>t.id!==e)})},[]),ke=(0,u.useCallback)(()=>{H(e=>{for(let t of e)t.src&&(T(t.src),Y.current.delete(t.src));return[]})},[]),Ae=(0,u.useCallback)(e=>{ye(t=>({...t,...e}))},[]),je=(0,u.useCallback)((e,t)=>{H(n=>n.map(n=>n.id===e?{...n,...t}:n))},[]);return{tab:D,setTab:O,view:k,setView:A,query:j,setQuery:M,type:N,setType:P,collection:F,setCollection:I,sort:L,setSort:re,detailId:ie,setDetailId:ae,items:Z,visibleItems:Q,selectedIds:q,selectedItems:Se,selectedSet:J,toggleSelection:we,clearSelection:Te,clearFilters:Ee,loading:de,error:pe,hasFilters:Ce,totalCount:be,filteredCount:xe,stagedFiles:V,addFiles:De,removeStagedFile:Oe,clearStagedFiles:ke,updateUploadOptions:Ae,uploadOptions:G,uploading:U,startUpload:(0,u.useCallback)(async()=>{if(U||V.length===0)return;W(!0),H(e=>e.map(e=>({...e,status:`uploading`,progress:0})));let e={setProgress:(e,t)=>{je(e,{progress:Math.max(0,Math.min(100,t))})},setFileStatus:(e,t,n)=>je(e,{status:t,error:n})};try{let t=V.map(e=>e.file),n=await l?.(t,G,e);if(H(e=>e.map(e=>({...e,status:`done`,progress:100}))),n?.length){he(e=>[...n,...e]);let e=n.map(e=>S.getId(e));$(r===`single`?e.slice(0,1):Array.from(new Set([...e,...q])))}ke(),O(`library`)}catch(e){z(e),H(e=>e.map(e=>e.status===`uploading`?{...e,status:`error`,error:`Upload failed`}:e)),d?.(e)}finally{W(!1)}},[S,$,ke,d,l,q,r,je,V,G,U]),updateItem:(0,u.useCallback)((e,t)=>{let n=S.getId(e);B(e=>({...e,[n]:{...e[n],...t}})),s?.(e,t)},[S,s]),removeItem:(0,u.useCallback)(e=>{let t=S.getId(e);_e(e=>new Set(e).add(t)),J.has(t)&&$(q.filter(e=>e!==t)),c?.(e)},[S,$,c,q,J]),accessors:S}}function O(e,t){return e===`image`?(0,d.jsx)(f.ImageIcon,{className:t??`size-4`}):e===`video`?(0,d.jsx)(f.Video,{className:t??`size-4`}):(0,d.jsx)(f.File,{className:t??`size-4`})}function k(e,t){return e===`image`?t.typeImage:e===`video`?t.typeVideo:t.typeFile}function A(e,t){return e?h(t.usedIn,{count:e}):t.notUsed}function j({children:e,tint:n,className:r}){return(0,d.jsx)(`div`,{className:t.cn(`media-library-preview relative overflow-hidden bg-muted`,r),style:n?{background:n}:void 0,children:e})}function M({src:e,alt:t,type:n,className:r,loading:i=`lazy`}){let[a,o]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{o(!1)},[e]),!e||a?(0,d.jsx)(`div`,{className:`media-library-preview--fallback flex size-full items-center justify-center text-muted-foreground`,children:O(n,`size-6`)}):(0,d.jsx)(`img`,{src:e,alt:t,loading:i,className:r,onError:()=>o(!0)})}function N({icon:e,title:n,description:i,action:a,className:o}){return(0,d.jsxs)(`div`,{className:t.cn(`media-library-empty-state--component flex min-h-64 flex-col items-center justify-center rounded-lg border border-dashed border-border bg-muted/20 px-6 py-10 text-center`,o),children:[(0,d.jsx)(`div`,{className:`mb-3 inline-flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:e??(0,d.jsx)(f.ImageIcon,{className:`size-5`})}),(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,children:n}),!!i&&(0,d.jsx)(r.s,{type:`secondary`,size:`xs`,className:`mt-1 max-w-sm`,children:i}),!!a&&(0,d.jsx)(`div`,{className:`mt-4`,children:a})]})}function P({query:e,type:r,typeFilters:i,collection:a,sort:o,view:l,collections:u=[],strings:p,onQueryChange:m,onTypeChange:h,onCollectionChange:g,onSortChange:_,onViewChange:v,onClearFilters:y,toolbarEnd:b}){let x=[{value:`all`,label:p.allTypes,icon:null},{value:`image`,label:p.images,icon:f.ImageIcon},{value:`video`,label:p.videos,icon:f.Video},{value:`file`,label:p.files,icon:f.File}].filter(e=>(i??[`all`,`image`,`video`]).includes(e.value)),S=[{value:`all`,label:p.allCollections},...u.map(e=>({value:e.value,label:String(e.label)}))],C=[{value:`newest`,label:p.sortNewest},{value:`name`,label:p.sortName},{value:`size`,label:p.sortSize},{value:`usage`,label:p.sortUsage}];return(0,d.jsxs)(`div`,{className:`media-library-toolbar--component flex flex-wrap items-center gap-2`,children:[(0,d.jsx)(`div`,{className:`min-w-52 flex-1`,children:(0,d.jsx)(s.t,{value:e,onChange:e=>m(e.target.value),placeholder:p.searchPlaceholder,startIcon:f.Search,clearable:!0,onClear:()=>m(``),strings:{clear:p.clearSearch},className:`rounded-full bg-muted/20`})}),(0,d.jsx)(`div`,{className:`media-library-toolbar--type-toggle flex h-9 items-center rounded-md bg-muted p-0.5`,role:`tablist`,"aria-label":p.typeFilterLabel,children:x.map(e=>{let i=e.icon,a=r===e.value;return(0,d.jsxs)(n.t,{type:`button`,role:`tab`,"aria-selected":a,variant:`secondary`,buttonStyle:`ghost`,className:t.cn(`h-8 rounded-sm px-3 text-xs shadow-none`,a?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>h(e.value),children:[i&&(0,d.jsx)(i,{className:`size-3.5`}),e.label]},e.value)})}),(0,d.jsx)(`div`,{className:`min-w-40`,children:(0,d.jsx)(c.Y,{value:a,options:S,onChange:e=>g(e??`all`),placeholder:p.collectionFilterLabel,"aria-label":p.collectionFilterLabel,className:`bg-background`})}),(0,d.jsx)(`div`,{className:`min-w-32`,children:(0,d.jsx)(c.Y,{value:o,options:C,onChange:e=>_(e??`newest`),placeholder:p.sortLabel,"aria-label":p.sortLabel,className:`bg-background`})}),(0,d.jsxs)(`div`,{className:`media-library-toolbar--view-toggle ml-auto flex h-9 items-center rounded-md bg-muted p-0.5`,children:[(0,d.jsx)(n.t,{type:`button`,variant:l===`grid`?`dark`:`secondary`,buttonStyle:l===`grid`?`solid`:`ghost`,size:`icon-small`,className:t.cn(l===`grid`&&`bg-background text-foreground shadow-xs hover:bg-background`),"aria-label":p.gridView,onClick:()=>v(`grid`),children:(0,d.jsx)(f.Grid2X2,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:l===`table`?`dark`:`secondary`,buttonStyle:l===`table`?`solid`:`ghost`,size:`icon-small`,className:t.cn(l===`table`&&`bg-background text-foreground shadow-xs hover:bg-background`),"aria-label":p.tableView,onClick:()=>v(`table`),children:(0,d.jsx)(f.LayoutList,{className:`size-3.5`})})]}),!!e&&(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:y,children:p.clearFilters}),b]})}function F({item:e,selected:i=!1,density:o=`comfortable`,showMeta:s=!0,accessors:c,strings:l,onToggle:u,onDetails:p,className:m}){let g=c.getType(e),_=c.getName(e),v=c.getSrc(e),y=c.getAlt(e)||_,x=c.getSize(e),S=c.getUsageCount(e),C=c.getPublic(e)===!1,w=c.getDuration(e);return(0,d.jsxs)(`div`,{"data-selected":i||void 0,"data-density":o,className:t.cn(`media-library-card--component group/card overflow-hidden rounded-xl border border-border/70 bg-card text-left shadow-xs transition-all`,`hover:border-primary/30 hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,i&&`media-library-card--selected border-primary ring-1 ring-primary`,m),onClick:u,children:[(0,d.jsxs)(j,{tint:c.getTint(e),className:t.cn(o===`compact`?`aspect-square`:`aspect-[4/3]`),children:[(0,d.jsx)(M,{src:v,alt:y,type:g,className:`size-full object-cover`}),(0,d.jsx)(`span`,{className:t.cn(`media-library-card--check absolute left-2 top-2 inline-flex size-5 items-center justify-center rounded-md border border-border bg-background/95 text-transparent opacity-0 shadow-xs backdrop-blur transition-opacity group-hover/card:opacity-100 group-focus-visible/card:opacity-100`,i&&`bg-primary text-primary-foreground opacity-100`),"aria-hidden":`true`,children:(0,d.jsx)(f.Check,{className:`size-3`})}),!!p&&(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`solid`,size:`icon-small`,className:`media-library-card--details absolute right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100`,"aria-label":h(l.cardDetails,{name:_}),onClick:e=>{e.stopPropagation(),p()},children:(0,d.jsx)(f.Info,{className:`size-3.5`})}),g===`video`&&!!w&&(0,d.jsxs)(a.t,{variant:`secondary`,className:`media-library-card--duration absolute bottom-2 left-2 bg-foreground text-background`,children:[(0,d.jsx)(f.Play,{className:`size-3 fill-current`}),w]}),C&&(0,d.jsx)(a.t,{variant:`secondary`,className:`media-library-card--private absolute bottom-2 right-2 bg-background/90`,children:(0,d.jsx)(f.Lock,{className:`size-3`})})]}),(0,d.jsxs)(`div`,{className:`media-library-card--body grid gap-1 px-3 py-2.5`,children:[(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:_}),s&&(0,d.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,className:`truncate`,children:b(x)||l.unknownSize}),!!S&&(0,d.jsxs)(r.s,{tag:`span`,size:`xxs`,type:`secondary`,className:`ml-auto inline-flex items-center gap-1`,children:[(0,d.jsx)(f.Layers3,{className:`size-3`}),S]})]})]})]})}function I({items:e,selectedSet:i,accessors:o,strings:s,onToggle:c,onDetails:l}){return(0,d.jsxs)(`div`,{className:`media-library-table--component min-w-180`,children:[(0,d.jsxs)(`div`,{className:`sticky top-0 z-10 grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-3 border-b border-border bg-background px-3 py-2`,children:[(0,d.jsx)(`span`,{}),(0,d.jsx)(`span`,{}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,weight:`semibold`,children:s.table.name}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,weight:`semibold`,children:s.table.type}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,weight:`semibold`,children:s.table.size}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,weight:`semibold`,children:s.table.collection}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,weight:`semibold`,children:s.table.used}),(0,d.jsx)(`span`,{})]}),e.map(e=>{let u=o.getId(e),p=i.has(u),m=o.getType(e),g=o.getName(e),_=o.getSrc(e),v=o.getPublic(e)===!1;return(0,d.jsxs)(`div`,{"data-selected":p||void 0,className:t.cn(`media-library-table--row grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-3 border-b border-border/60 px-3 py-2 last:border-b-0`,`cursor-pointer rounded-lg transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,p&&`bg-primary/10`),onClick:()=>c(u),children:[(0,d.jsx)(`span`,{className:t.cn(`inline-flex size-5 items-center justify-center rounded-md border border-border text-transparent`,p&&`border-primary bg-primary text-primary-foreground`),"aria-hidden":`true`,children:(0,d.jsx)(f.Check,{className:`size-3`})}),(0,d.jsx)(j,{tint:o.getTint(e),className:`size-9 rounded-md`,children:_?(0,d.jsx)(`img`,{src:_,alt:``,loading:`lazy`,className:`size-full object-cover`}):(0,d.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:O(m,`size-4`)})}),(0,d.jsxs)(r.s,{tag:`div`,weight:`semibold`,size:`xs`,className:`flex min-w-0 items-center gap-1 truncate`,children:[(0,d.jsx)(`span`,{className:`truncate`,children:g}),v&&(0,d.jsx)(f.Lock,{className:`size-3 shrink-0 text-muted-foreground`})]}),(0,d.jsx)(a.t,{variant:`secondary`,children:k(m,s)}),(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,children:b(o.getSize(e))||s.unknownSize}),(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`truncate`,children:o.getCollection(e)||`-`}),(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,children:o.getUsageCount(e)?o.getUsageCount(e):`-`}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,"aria-label":h(s.cardDetails,{name:g}),onClick:e=>{e.stopPropagation(),l(u)},children:(0,d.jsx)(f.Info,{className:`size-3.5`})})]},u)})]})}function L({item:e,collections:t=[],accessors:i,strings:o,onClose:u,onUpdate:p,onRemove:m,renderDetail:h}){if(!e)return null;let g=i.getName(e),_=i.getType(e),v=i.getSrc(e),y=i.getCollection(e)??t[0]?.value??``,S=i.getTags(e),C=i.getPublic(e)??!0,w=h?.(e,{accessors:i,update:p,remove:m,close:u});return w?(0,d.jsx)(d.Fragment,{children:w}):(0,d.jsxs)(`aside`,{className:`media-library-detail-panel--component flex min-h-0 w-full flex-col border-l border-border bg-background lg:w-72`,children:[(0,d.jsxs)(`div`,{className:`media-library-detail-panel--header flex items-center gap-2 border-b border-border px-3 py-2.5`,children:[(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,"aria-label":o.detail.close,onClick:u,children:(0,d.jsx)(f.ArrowLeft,{className:`size-3.5`})}),(0,d.jsx)(r.s,{weight:`semibold`,children:o.detail.title})]}),(0,d.jsxs)(`div`,{className:`media-library-detail-panel--body grid min-h-0 gap-4 overflow-y-auto p-4`,children:[(0,d.jsxs)(j,{tint:i.getTint(e),className:`aspect-[4/3] rounded-lg border border-border`,children:[(0,d.jsx)(M,{src:v,alt:i.getAlt(e)||g,type:_,className:`size-full object-cover`}),_===`video`&&!!i.getDuration(e)&&(0,d.jsxs)(a.t,{className:`absolute bottom-2 right-2 bg-foreground text-background`,children:[(0,d.jsx)(f.Play,{className:`size-3 fill-current`}),i.getDuration(e)]})]}),(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,className:`break-words`,children:g}),(0,d.jsx)(`dl`,{className:`media-library-detail-panel--facts grid gap-2`,children:[[o.detail.type,k(_,o)],[o.detail.size,b(i.getSize(e))||o.unknownSize],[o.detail.dimensions,x(e,i)||`-`],[o.detail.uploaded,String(i.getUploadedAt(e)??`-`)],[o.detail.usedIn,A(i.getUsageCount(e),o)]].map(([e,t])=>(0,d.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,d.jsx)(`dt`,{children:(0,d.jsx)(r.s,{tag:`span`,size:`xs`,type:`secondary`,children:e})}),(0,d.jsx)(`dd`,{className:`m-0 text-right`,children:(0,d.jsx)(r.s,{tag:`span`,size:`xs`,weight:`medium`,children:t})})]},e))}),(0,d.jsx)(l.D,{label:o.detail.altText,children:(0,d.jsx)(s.t,{value:i.getAlt(e)??``,placeholder:o.detail.altPlaceholder,onChange:e=>p({alt:e.target.value})})}),(0,d.jsx)(l.D,{label:o.detail.collection,children:(0,d.jsx)(c.Y,{value:y,options:t.map(e=>({value:e.value,label:String(e.label)})),"aria-label":o.detail.collection,onChange:e=>p({collection:e})})}),(0,d.jsx)(l.D,{label:o.detail.tags,children:(0,d.jsx)(s.t,{value:S.join(`, `),placeholder:o.detail.tagsPlaceholder,onChange:e=>p({tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})}),(0,d.jsxs)(`div`,{className:`media-library-detail-panel--public flex items-center justify-between gap-4 rounded-lg border border-border bg-muted/20 p-3`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(r.s,{weight:`semibold`,size:`xs`,children:o.detail.public}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,children:C?o.detail.publicHint:o.detail.privateHint})]}),(0,d.jsx)(c.J,{checked:C,onCheckedChange:e=>p({public:e})})]}),(0,d.jsxs)(`div`,{className:`media-library-detail-panel--actions flex flex-wrap gap-2`,children:[(0,d.jsxs)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`outline`,children:[(0,d.jsx)(f.UploadCloud,{className:`size-3.5`}),o.detail.replace]}),(0,d.jsxs)(n.t,{type:`button`,variant:`error`,buttonStyle:`ghost`,onClick:m,children:[(0,d.jsx)(f.Trash2,{className:`size-3.5`}),o.detail.delete]})]})]})]})}function re({stagedFiles:e,uploadOptions:t,collections:i=[],uploading:o=!1,strings:u,onFiles:p,onRemoveFile:m,onOptionsChange:g,empty:_}){return(0,d.jsxs)(`div`,{className:`media-library-upload-panel--component grid gap-4 p-4`,children:[(0,d.jsx)(c.T,{onDrop:p,accept:`image/*,video/*`,multiple:!0,size:`default`,strings:{instruction:u.upload.dropTitle,helper:u.upload.dropHint,dragOver:u.upload.dragOver}}),e.length>0?(0,d.jsx)(`div`,{className:`media-library-upload-panel--staged grid gap-2`,children:e.map(e=>(0,d.jsxs)(`div`,{className:`media-library-upload-panel--staged-file flex items-center gap-3 rounded-lg border border-border bg-card p-2`,children:[(0,d.jsx)(j,{className:`size-10 rounded-md`,children:e.src?(0,d.jsx)(`img`,{src:e.src,alt:e.name,className:`size-full object-cover`}):(0,d.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:O(e.type,`size-4`)})}),(0,d.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,d.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,d.jsx)(r.s,{weight:`semibold`,size:`xs`,className:`truncate`,children:e.name}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,className:`ml-auto shrink-0`,children:b(e.size)})]}),(e.status===`uploading`||e.status===`done`)&&(0,d.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-muted`,children:(0,d.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width]`,style:{width:`${e.progress}%`}})}),e.status===`error`&&(0,d.jsx)(r.s,{size:`xxs`,type:`error`,children:e.error})]}),e.status===`done`?(0,d.jsx)(a.t,{variant:`success`,children:u.upload.done}):e.status===`uploading`?(0,d.jsxs)(r.s,{size:`xxs`,type:`secondary`,className:`tabular-nums`,children:[Math.round(e.progress),`%`]}):(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:o,"aria-label":h(u.upload.removeFile,{name:e.name}),onClick:()=>m(e.id),children:(0,d.jsx)(f.X,{className:`size-3.5`})})]},e.id))}):_,(0,d.jsxs)(`div`,{className:`media-library-upload-panel--options grid gap-3 rounded-lg border border-border bg-muted/20 p-3 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,d.jsx)(l.D,{label:u.upload.collection,children:(0,d.jsx)(c.Y,{value:t.collection??i[0]?.value,options:i.map(e=>({value:e.value,label:String(e.label)})),"aria-label":u.upload.collection,onChange:e=>g({collection:e})})}),(0,d.jsx)(l.D,{label:u.upload.tags,children:(0,d.jsx)(s.t,{value:t.tags.join(`, `),placeholder:u.upload.tagsPlaceholder,onChange:e=>g({tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})}),(0,d.jsxs)(`div`,{className:`flex items-center justify-between gap-4 md:self-end`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(r.s,{weight:`semibold`,size:`xs`,children:u.upload.public}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,children:u.upload.publicHint})]}),(0,d.jsx)(c.J,{checked:t.public,onCheckedChange:e=>g({public:e})})]})]})]})}function ie({tab:e,selectedIds:i,selectionMode:a,stagedFiles:o,strings:s,onClearSelection:c,className:l}){let u=i.length,f=o.reduce((e,t)=>e+t.size,0),p=o.length,m=t.cn(`media-library-footer-summary--component flex min-w-0 items-center gap-3`,l);return e===`upload`?(0,d.jsx)(`div`,{className:m,"aria-live":`polite`,children:(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`truncate`,children:p===0?s.footer.noFiles:h(s.footer.stagedSummary,{count:p,size:b(f)})})}):(0,d.jsx)(`div`,{className:m,"aria-live":`polite`,children:u>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(r.s,{weight:`semibold`,size:`xs`,className:`whitespace-nowrap`,children:h(s.footer.selectedCount,{count:u})}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`small`,onClick:c,children:s.footer.clear})]}):(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`truncate`,children:a===`single`?s.footer.pickOne:s.footer.pickMany})})}function ae({tab:e,selectedItems:r,selectedIds:i,stagedFiles:a,uploading:o=!1,strings:s,confirmLabel:c,cancelLabel:l,onCancel:u,onConfirm:f,onUpload:p,onCancelUpload:m,className:g}){let _=i.length,v=a.length;return e===`upload`?(0,d.jsxs)(`div`,{className:t.cn(`media-library-footer-actions--component flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,g),children:[(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,disabled:o,onClick:m,children:l??s.footer.cancel}),(0,d.jsx)(n.t,{type:`button`,disabled:v===0||o,onClick:p,loading:o,loadingLabels:{loading:s.footer.uploading},children:v<=1?s.footer.upload:h(s.footer.uploadMany,{count:v})})]}):(0,d.jsxs)(`div`,{className:t.cn(`media-library-footer-actions--component flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,g),children:[(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:u,children:l??s.footer.cancel}),(0,d.jsx)(n.t,{type:`button`,disabled:_===0,onClick:f,children:c??(_===0?s.footer.confirmEmpty:r.length===1?s.footer.confirmOne:h(s.footer.confirmMany,{count:_}))})]})}function R({tab:e,selectedItems:n,selectedIds:r,selectionMode:i,stagedFiles:a,uploading:o=!1,strings:s,confirmLabel:c,cancelLabel:l,onCancel:u,onConfirm:f,onClearSelection:p,onUpload:m,onCancelUpload:h,chrome:g=`section`,className:_}){return(0,d.jsxs)(`footer`,{className:t.cn(`media-library-footer--component flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,g===`section`&&`border-t border-border bg-background px-4 py-3`,_),children:[(0,d.jsx)(ie,{tab:e,selectedIds:r,selectionMode:i,stagedFiles:a,strings:s,onClearSelection:p}),(0,d.jsx)(ae,{tab:e,selectedItems:n,selectedIds:r,stagedFiles:a,uploading:o,strings:s,confirmLabel:c,cancelLabel:l,onCancel:u,onConfirm:f,onUpload:m,onCancelUpload:h})]})}var oe=(0,u.createContext)(null);function se(e,t,n){return(0,u.useMemo)(()=>{if(e)return e;let r=new Set;for(let e of t){let t=n(e);t&&r.add(t)}return Array.from(r).map(e=>({value:e,label:e}))},[e,n,t])}function ce({title:i,description:a,confirmLabel:s,cancelLabel:c,selectionMode:l=`multiple`,density:g=`comfortable`,showMeta:_=!0,allowUpload:v=!0,typeFilters:y,confirmOnSelect:b=!1,onConfirm:x,onCancel:S,onClose:C,strings:w,slots:T,heightClassName:E,className:ee,items:te,fetcher:ne,accessors:O,collections:k,value:A,defaultValue:j,onValueChange:M,onItemUpdate:ce,onItemDelete:le,onUpload:ue,onError:de,initialTab:fe,defaultView:pe,defaultQuery:z,defaultType:me,defaultCollection:he,defaultSort:ge,defaultUploadOptions:_e,...ve}){let B=e.useStrings(m,w),V=D({items:te,fetcher:ne,accessors:O,collections:k,selectionMode:l,value:A,defaultValue:j,onValueChange:M,onItemUpdate:ce,onItemDelete:le,onUpload:ue,onError:de,initialTab:fe,defaultView:pe,defaultQuery:z,defaultType:me,defaultCollection:he,defaultSort:ge,defaultUploadOptions:_e}),H=se(k,V.items,V.accessors.getCollection),U=v?V.tab:`library`,W=V.detailId?V.items.find(e=>V.accessors.getId(e)===V.detailId)??null:null,G=(0,u.useContext)(oe),ye=!T?.footer,K=G&&ye?(0,d.jsx)(ie,{tab:U,selectedIds:V.selectedIds,selectionMode:l,stagedFiles:V.stagedFiles,strings:B,onClearSelection:V.clearSelection,className:`media-library-dialog--selection-summary shrink-0 justify-end`}):null,q=!!(i||a||T?.headerStart),J=!!(v||T?.headerEnd||K),Y=q||J,X=()=>{x?.(V.selectedItems,V.selectedIds),C?.()},Z=()=>{S?.(),C?.()},Q=e=>{let t=V.accessors.getId(e);V.toggleSelection(t),b&&(x?.([e],[t]),C?.())},be=V.filteredCount===V.totalCount?h(B.countAll,{count:V.totalCount}):h(B.countFiltered,{count:V.filteredCount,total:V.totalCount}),xe=T?.footer??(G?(0,d.jsx)(ae,{tab:U,selectedItems:V.selectedItems,selectedIds:V.selectedIds,stagedFiles:V.stagedFiles,uploading:V.uploading,strings:B,confirmLabel:s,cancelLabel:c,onCancel:Z,onConfirm:X,onUpload:V.startUpload,onCancelUpload:()=>{V.clearStagedFiles(),V.setTab(`library`)},className:`ml-auto`}):(0,d.jsx)(R,{tab:U,selectedItems:V.selectedItems,selectedIds:V.selectedIds,selectionMode:l,stagedFiles:V.stagedFiles,uploading:V.uploading,strings:B,confirmLabel:s,cancelLabel:c,onCancel:Z,onConfirm:X,onClearSelection:V.clearSelection,onUpload:V.startUpload,onCancelUpload:()=>{V.clearStagedFiles(),V.setTab(`library`)}}));return(0,d.jsxs)(`section`,{className:t.cn(`media-library--component flex min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-background`,E??`h-190 max-h-[calc(100vh-7rem)]`,ee),...ve,children:[Y&&(0,d.jsxs)(`header`,{className:`media-library--header flex flex-col gap-3 border-b border-border px-4 py-3 lg:flex-row lg:items-center lg:justify-between`,children:[q&&(0,d.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[T?.headerStart,(i||a)&&(0,d.jsxs)(`div`,{className:`min-w-0`,children:[!!i&&(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,children:i}),!!a&&(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:a})]})]}),J&&(0,d.jsxs)(`div`,{className:t.cn(`flex min-w-0 flex-wrap items-center gap-2`,K?`flex-1 justify-between`:`lg:justify-end`),children:[(0,d.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[v&&(0,d.jsxs)(`div`,{className:`media-library--tabs flex items-center rounded-md bg-muted p-0.5`,role:`tablist`,children:[(0,d.jsxs)(n.t,{type:`button`,role:`tab`,"aria-selected":U===`library`,variant:`secondary`,buttonStyle:`ghost`,className:t.cn(`h-8 rounded-sm px-3 shadow-none`,U===`library`?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>V.setTab(`library`),children:[(0,d.jsx)(f.ImageIcon,{className:`size-3.5`}),B.tabs.library]}),(0,d.jsxs)(n.t,{type:`button`,role:`tab`,"aria-selected":U===`upload`,variant:`secondary`,buttonStyle:`ghost`,className:t.cn(`h-8 rounded-sm px-3 shadow-none`,U===`upload`?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>V.setTab(`upload`),children:[(0,d.jsx)(f.UploadCloud,{className:`size-3.5`}),B.tabs.upload,V.stagedFiles.length>0&&(0,d.jsx)(`span`,{className:`rounded-full bg-background/20 px-1.5 text-xxs tabular-nums`,children:V.stagedFiles.length})]})]}),T?.headerEnd]}),K]})]}),(0,d.jsxs)(`div`,{className:`media-library--body flex min-h-0 flex-1`,children:[U===`upload`?(0,d.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:(0,d.jsx)(re,{stagedFiles:V.stagedFiles,uploadOptions:V.uploadOptions,collections:H,uploading:V.uploading,strings:B,onFiles:V.addFiles,onRemoveFile:V.removeStagedFile,onOptionsChange:V.updateUploadOptions,empty:T?.uploadEmpty})}):(0,d.jsxs)(`div`,{className:t.cn(`media-library--library min-w-0 flex-1 flex-col`,W?`hidden lg:flex`:`flex`),children:[(0,d.jsxs)(`div`,{className:`media-library--toolbar border-b border-border/70 px-4 py-3`,children:[(0,d.jsx)(P,{query:V.query,type:V.type,typeFilters:y,collection:V.collection,sort:V.sort,view:V.view,collections:H,strings:B,onQueryChange:V.setQuery,onTypeChange:V.setType,onCollectionChange:V.setCollection,onSortChange:V.setSort,onViewChange:V.setView,onClearFilters:V.clearFilters,toolbarEnd:T?.toolbarEnd}),(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-2`,"aria-live":`polite`,children:be})]}),(0,d.jsx)(`div`,{className:`media-library--results min-h-0 flex-1 overflow-y-auto p-4`,children:V.loading?T?.loading??(0,d.jsx)(`div`,{className:`flex min-h-64 items-center justify-center`,children:(0,d.jsx)(r.s,{type:`secondary`,children:B.loading})}):V.error?T?.error??(0,d.jsxs)(o.t,{variant:`destructive`,children:[(0,d.jsx)(o.i,{children:B.errorTitle}),(0,d.jsx)(o.r,{children:B.errorDescription})]}):V.visibleItems.length===0?T?.empty??(0,d.jsx)(N,{title:V.hasFilters?B.emptyFilteredTitle:B.emptyLibraryTitle,description:V.hasFilters?B.emptyFilteredDescription:B.emptyLibraryDescription,action:V.hasFilters?(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`outline`,onClick:V.clearFilters,children:B.clearFilters}):v?(0,d.jsxs)(n.t,{type:`button`,onClick:()=>V.setTab(`upload`),children:[(0,d.jsx)(f.UploadCloud,{className:`size-3.5`}),B.uploadMedia]}):void 0}):V.view===`table`?(0,d.jsx)(`div`,{className:`overflow-x-auto`,children:(0,d.jsx)(I,{items:V.visibleItems,selectedSet:V.selectedSet,selectionMode:l,accessors:V.accessors,strings:B,onToggle:e=>{let t=V.items.find(t=>V.accessors.getId(t)===e);t&&Q(t)},onDetails:V.setDetailId})}):(0,d.jsx)(`div`,{className:t.cn(`media-library--grid grid gap-3`,g===`compact`?`grid-cols-[repeat(auto-fill,minmax(136px,1fr))]`:`grid-cols-[repeat(auto-fill,minmax(168px,1fr))]`),children:V.visibleItems.map(e=>{let t=V.accessors.getId(e),n={id:t,selected:V.selectedSet.has(t),selectionMode:l,accessors:V.accessors,toggle:()=>Q(e),openDetails:()=>V.setDetailId(t)},r=T?.renderItem?.(e,n);return r?(0,d.jsx)(`div`,{children:r},t):(0,d.jsx)(F,{item:e,selected:n.selected,density:g,showMeta:_,selectionMode:l,accessors:V.accessors,strings:B,onToggle:n.toggle,onDetails:n.openDetails},t)})})})]}),U===`library`&&(0,d.jsx)(L,{item:W,collections:H,accessors:V.accessors,strings:B,onClose:()=>V.setDetailId(null),onUpdate:e=>W&&V.updateItem(W,e),onRemove:()=>{W&&(V.removeItem(W),V.setDetailId(null))},renderDetail:T?.renderDetail})]}),G?G.element?(0,p.createPortal)(xe,G.element):null:xe]})}function le({open:n,onOpenChange:r,trigger:a,dialogTitle:o,dialogDescription:s,onClose:c,className:l,dialogClassName:f,contentClassName:p,closeOnEscape:h=!0,closeOnBackdropClick:g=!0,..._}){let v=e.useStrings(m,_.strings),[y,b]=(0,u.useState)(!1),[x,S]=(0,u.useState)(null),C=n!==void 0,w=C?n:y,T=e=>{C||b(e),r?.(e)},E=()=>{T(!1),c?.()};return(0,d.jsx)(oe.Provider,{value:{element:x},children:(0,d.jsx)(i.r,{open:w,onOpenChange:T,onClose:c,trigger:a,title:o??v.title,description:s??v.description,size:`full`,showCancel:!1,showConfirm:!1,footer:(0,d.jsx)(`div`,{ref:S,className:`media-library-dialog--footer`}),className:t.cn(`media-library-dialog--component max-h-[calc(100vh-2rem)] max-w-[min(1060px,calc(100vw-2rem))]`,f),contentClassName:t.cn(`media-library-dialog--body flex min-h-0 flex-col overflow-hidden p-0`,p),closeOnBackdropClick:g,closeOnEscape:h,children:(0,d.jsx)(ce,{..._,onClose:E,className:t.cn(`media-library-dialog--library rounded-none border-0`,l),heightClassName:_.heightClassName??`min-h-0 flex-1`,strings:_.strings})})})}function ue(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return i===void 0||r.splice(n,0,i),r}function de({items:i,accessors:o,title:s,description:c,primaryId:l,onPrimaryChange:u,onRemove:p,onReorder:g,onAdd:_,maxItems:v,layout:x=`field`,density:S=`comfortable`,readOnly:C=!1,empty:w,action:T,renderItem:E,strings:ee,className:te,...ne}){let D=e.useStrings(m,ee),O=y(o),k=i.length,A=l??(k>0?O.getId(i[0]):void 0),j=!C&&!!_&&(v===void 0||k<v),M=j&&(x===`field`||k>0)?(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`outline`,icon:f.Plus,onClick:_,children:D.gallery.add}):v!==void 0&&k>=v?(0,d.jsx)(a.t,{variant:`secondary`,children:D.gallery.maxReached}):null,P=(e,t)=>{if(t<0||t>=k||e===t)return;let n=ue(i,e,t);g?.(n.map(e=>O.getId(e)),n)},F=!!(s||c||T||M),I=k===0&&x!==`field`,L=()=>!j||x!==`field`?null:(0,d.jsxs)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,className:t.cn(`media-resource-gallery--add-tile h-auto min-h-24 w-full flex-col rounded-lg border border-dashed border-border bg-background text-muted-foreground shadow-none`,`aspect-square hover:border-primary/50 hover:bg-primary/5 hover:text-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`),"aria-label":D.gallery.addTile,onClick:_,children:[(0,d.jsx)(f.Plus,{className:`size-4`}),(0,d.jsx)(`span`,{className:`sr-only`,children:D.gallery.addTile})]});return(0,d.jsxs)(`section`,{className:t.cn(`media-resource-gallery--component rounded-lg border border-border bg-card shadow-xs`,te),"data-layout":x,"data-density":S,...ne,children:[F&&(0,d.jsxs)(`header`,{className:`media-resource-gallery--header flex flex-col gap-3 px-4 py-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,d.jsxs)(`div`,{className:`min-w-0`,children:[!!s&&(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,children:s}),!!c&&(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:c})]}),(0,d.jsx)(`div`,{className:`media-resource-gallery--actions flex flex-wrap items-center gap-2`,children:T??M})]}),I?(0,d.jsx)(`div`,{className:`media-resource-gallery--empty p-4 pt-0`,children:w??(0,d.jsx)(N,{title:D.gallery.emptyTitle,description:D.gallery.emptyDescription,action:j?(0,d.jsx)(n.t,{type:`button`,icon:f.ImagePlus,onClick:_,children:D.gallery.add}):void 0})}):(0,d.jsxs)(`div`,{className:t.cn(`media-resource-gallery--items p-4`,F&&`pt-0`,x===`list`?`grid gap-2`:x===`field`?`grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-3 sm:grid-cols-[repeat(auto-fill,minmax(108px,1fr))]`:S===`compact`?`grid grid-cols-[repeat(auto-fill,minmax(132px,1fr))] gap-3`:`grid grid-cols-[repeat(auto-fill,minmax(164px,1fr))] gap-3`),children:[i.map((e,i)=>{let o=O.getId(e),s=O.getName(e),c=O.getType(e),l=O.getSrc(e),m=O.getAlt(e)||s,g=o===A,_=O.getPublic(e)===!1,v=O.getDuration(e),y=i>0,S=i<k-1,w=E?.(e,{id:o,index:i,total:k,primary:g,accessors:O,canMovePrevious:y,canMoveNext:S,setPrimary:()=>u?.(o,e),remove:()=>p?.(o,e),movePrevious:()=>P(i,i-1),moveNext:()=>P(i,i+1)});return w?(0,d.jsx)(`div`,{children:w},o):x===`field`?(0,d.jsxs)(`div`,{className:t.cn(`media-resource-gallery--item group/gallery relative aspect-square overflow-hidden rounded-lg border border-border bg-background shadow-xs`,`transition-colors hover:border-primary/40 focus-within:border-primary/50`,g&&`col-span-2 row-span-2 min-h-52`),"data-primary":g||void 0,children:[l?(0,d.jsx)(`img`,{src:l,alt:m,loading:`lazy`,className:`size-full object-cover`}):(0,d.jsx)(`div`,{className:`flex size-full items-center justify-center bg-muted text-muted-foreground`,children:(0,d.jsx)(f.File,{className:g?`size-7`:`size-5`})}),g&&(0,d.jsx)(a.t,{variant:`secondary`,className:`absolute left-2 top-2 bg-background/90 shadow-xs`,children:D.gallery.cover}),c===`video`&&!!v&&(0,d.jsxs)(a.t,{variant:`secondary`,className:`absolute bottom-2 left-2 bg-foreground text-background`,children:[(0,d.jsx)(f.Play,{className:`size-3 fill-current`}),v]}),_&&(0,d.jsx)(`span`,{className:`absolute bottom-2 right-2 inline-flex size-6 items-center justify-center rounded-full border border-border bg-background/90 text-muted-foreground shadow-xs`,children:(0,d.jsx)(f.Lock,{className:`size-3`})}),!C&&(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`solid`,size:`icon-small`,className:`absolute right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/gallery:opacity-100 group-focus-within/gallery:opacity-100`,"aria-label":D.gallery.remove,onClick:()=>p?.(o,e),children:(0,d.jsx)(f.X,{className:`size-3.5`})})]},o):x===`list`?(0,d.jsxs)(`div`,{className:`media-resource-gallery--item flex min-w-0 items-center gap-3 rounded-lg border border-border bg-background p-2`,"data-primary":g||void 0,children:[(0,d.jsx)(`div`,{className:`relative size-12 shrink-0 overflow-hidden rounded-md bg-muted`,children:l?(0,d.jsx)(`img`,{src:l,alt:m,loading:`lazy`,className:`size-full object-cover`}):(0,d.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:(0,d.jsx)(f.File,{className:`size-4`})})}),(0,d.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,d.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:s}),g&&(0,d.jsx)(a.t,{variant:`info`,children:D.gallery.primary})]}),(0,d.jsxs)(r.s,{size:`xxs`,type:`secondary`,children:[h(D.gallery.itemPosition,{index:i+1,total:k}),` · `,b(O.getSize(e))||D.unknownSize]})]}),!C&&(0,d.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:g,"aria-label":D.gallery.setPrimary,onClick:()=>u?.(o,e),children:(0,d.jsx)(f.Star,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:!y,"aria-label":D.gallery.movePrevious,onClick:()=>P(i,i-1),children:(0,d.jsx)(f.ArrowLeft,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:!S,"aria-label":D.gallery.moveNext,onClick:()=>P(i,i+1),children:(0,d.jsx)(f.ArrowRight,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`error`,buttonStyle:`ghost`,size:`icon-small`,"aria-label":D.gallery.remove,onClick:()=>p?.(o,e),children:(0,d.jsx)(f.Trash2,{className:`size-3.5`})})]})]},o):(0,d.jsxs)(`div`,{className:`media-resource-gallery--item group/gallery overflow-hidden rounded-lg border border-border bg-background shadow-xs transition-colors hover:border-primary/40`,"data-primary":g||void 0,children:[(0,d.jsxs)(`div`,{className:`relative aspect-[4/3] bg-muted`,children:[l?(0,d.jsx)(`img`,{src:l,alt:m,loading:`lazy`,className:`size-full object-cover`}):(0,d.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:(0,d.jsx)(f.File,{className:`size-6`})}),(0,d.jsxs)(`div`,{className:`absolute left-2 top-2 flex flex-wrap gap-1`,children:[g&&(0,d.jsx)(a.t,{variant:`info`,children:D.gallery.primary}),(0,d.jsx)(a.t,{variant:`secondary`,children:h(D.gallery.itemPosition,{index:i+1,total:k})})]})]}),(0,d.jsxs)(`div`,{className:`media-resource-gallery--item-body grid gap-2 p-3`,children:[(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(r.s,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:s}),(0,d.jsx)(r.s,{size:`xxs`,type:`secondary`,children:b(O.getSize(e))||D.unknownSize})]}),!C&&(0,d.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:g,"aria-label":D.gallery.setPrimary,onClick:()=>u?.(o,e),children:(0,d.jsx)(f.Star,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:!y,"aria-label":D.gallery.movePrevious,onClick:()=>P(i,i-1),children:(0,d.jsx)(f.ArrowLeft,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-small`,disabled:!S,"aria-label":D.gallery.moveNext,onClick:()=>P(i,i+1),children:(0,d.jsx)(f.ArrowRight,{className:`size-3.5`})}),(0,d.jsx)(n.t,{type:`button`,variant:`error`,buttonStyle:`ghost`,size:`icon-small`,className:`ml-auto`,"aria-label":D.gallery.remove,onClick:()=>p?.(o,e),children:(0,d.jsx)(f.Trash2,{className:`size-3.5`})})]})]})]},o)}),L()]})]})}exports.MediaLibrary=ce,exports.MediaLibraryCard=F,exports.MediaLibraryDetailPanel=L,exports.MediaLibraryDialog=le,exports.MediaLibraryEmptyState=N,exports.MediaLibraryFooter=R,exports.MediaLibraryTable=I,exports.MediaLibraryToolbar=P,exports.MediaLibraryUploadPanel=re,exports.MediaResourceGallery=de,exports.defaultMediaLibraryStrings=m,exports.formatMediaLibrarySize=b,exports.formatMediaLibraryString=h,exports.getMediaLibraryDimensions=x,exports.resolveMediaLibraryAccessors=y,exports.useMediaLibrary=D;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -2,11 +2,11 @@ import { useStrings as e } from "../../../lib/strings.js";
2
2
  import { cn as t } from "../../../lib/utils.js";
3
3
  import { t as n } from "../../../_shared/button-DHksjMvc.js";
4
4
  import { s as r } from "../../../_shared/typography-DE0NGEIE.js";
5
- import { r as i } from "../../../_shared/overlays-CdtMAkKG.js";
5
+ import { r as i } from "../../../_shared/overlays-DW8OIK5R.js";
6
6
  import { t as a } from "../../../_shared/badge-a2Z3K5aQ.js";
7
7
  import { i as o, r as s, t as c } from "../../../_shared/alert-m-4s0Hqq.js";
8
8
  import { t as l } from "../../../_shared/input-CfnHBT--.js";
9
- import { J as u, T as d, Y as f } from "../../../_shared/forms-qnwoUqxf.js";
9
+ import { J as u, T as d, Y as f } from "../../../_shared/forms-BoquZE2Y.js";
10
10
  import { D as p } from "../../../_shared/display-B0wLVN8t.js";
11
11
  import { createContext as m, useCallback as h, useContext as g, useEffect as _, useMemo as v, useRef as y, useState as b } from "react";
12
12
  import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
@@ -1,3 +1,4 @@
1
1
  export { useNativeDialog, type UseNativeDialogOptions, type UseNativeDialogReturn, } from './use-native-dialog';
2
2
  export { useOverlayActions, type UseOverlayActionsOptions, type UseOverlayActionsReturn, } from './use-overlay-actions';
3
+ export { useOverlayVisibility, useOverlayVisibilityGroup, type OverlayOpenSetter, type OverlayVisibilityGroupState, type OverlayVisibilityProps, type UseOverlayVisibilityGroupOptions, type UseOverlayVisibilityGroupReturn, type UseOverlayVisibilityOptions, type UseOverlayVisibilityReturn, } from './use-overlay-visibility';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/overlays/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC/B,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/overlays/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC7B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACH,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC/B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACH,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,GAClC,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ export type OverlayOpenSetter = Dispatch<SetStateAction<boolean>>;
3
+ export interface OverlayVisibilityProps {
4
+ open: boolean;
5
+ onOpenChange: (open: boolean) => void;
6
+ }
7
+ export interface UseOverlayVisibilityOptions {
8
+ defaultOpen?: boolean;
9
+ open?: boolean;
10
+ onOpenChange?: (open: boolean) => void;
11
+ onOpen?: () => void;
12
+ onClose?: () => void;
13
+ }
14
+ export interface UseOverlayVisibilityReturn {
15
+ open: boolean;
16
+ isOpen: boolean;
17
+ setOpen: OverlayOpenSetter;
18
+ show: () => void;
19
+ hide: () => void;
20
+ toggle: () => void;
21
+ overlayProps: OverlayVisibilityProps;
22
+ }
23
+ export type OverlayVisibilityGroupState<TKey extends string = string> = Record<TKey, boolean>;
24
+ export interface UseOverlayVisibilityGroupOptions<TKey extends string = string> {
25
+ defaultOpen?: Partial<Record<TKey, boolean>>;
26
+ open?: Partial<Record<TKey, boolean>>;
27
+ onOpenChange?: (key: TKey, open: boolean, state: OverlayVisibilityGroupState<TKey>) => void;
28
+ closeOthersOnOpen?: boolean;
29
+ }
30
+ export type UseOverlayVisibilityGroupReturn<TKey extends string = string> = Record<TKey, UseOverlayVisibilityReturn>;
31
+ export declare function useOverlayVisibility({ defaultOpen, open: controlledOpen, onOpenChange, onOpen, onClose, }?: UseOverlayVisibilityOptions): UseOverlayVisibilityReturn;
32
+ export declare function useOverlayVisibilityGroup<const TKeys extends readonly string[]>(keys: TKeys, { defaultOpen, open: controlledOpen, onOpenChange, closeOthersOnOpen, }?: UseOverlayVisibilityGroupOptions<TKeys[number] & string>): UseOverlayVisibilityGroupReturn<TKeys[number] & string>;
33
+ //# sourceMappingURL=use-overlay-visibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-overlay-visibility.d.ts","sourceRoot":"","sources":["../../../../../src/components/features/overlays/hooks/use-overlay-visibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;AAElE,MAAM,WAAW,sBAAsB;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,2BAA2B;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,0BAA0B;IAC1C,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,EAAE,sBAAsB,CAAC;CACrC;AAED,MAAM,MAAM,2BAA2B,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAE9F,MAAM,WAAW,gCAAgC,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IAC7E,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAC7C,IAAI,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACtC,YAAY,CAAC,EAAE,CACd,GAAG,EAAE,IAAI,EACT,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,2BAA2B,CAAC,IAAI,CAAC,KACpC,IAAI,CAAC;IACV,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,+BAA+B,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,CACjF,IAAI,EACJ,0BAA0B,CAC1B,CAAC;AA+BF,wBAAgB,oBAAoB,CAAC,EACpC,WAAmB,EACnB,IAAI,EAAE,cAAc,EACpB,YAAY,EACZ,MAAM,EACN,OAAO,GACP,GAAE,2BAAgC,GAAG,0BAA0B,CA0D/D;AAED,wBAAgB,yBAAyB,CAAC,KAAK,CAAC,KAAK,SAAS,SAAS,MAAM,EAAE,EAC9E,IAAI,EAAE,KAAK,EACX,EACC,WAAW,EACX,IAAI,EAAE,cAAc,EACpB,YAAY,EACZ,iBAAyB,GACzB,GAAE,gCAAgC,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAM,GAC9D,+BAA+B,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAoEzD"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_shared/overlays-Diy_H0Au.cjs");exports.AlertDialog=e.t,exports.Dialog=e.r,exports.Drawer=e.n,exports.defaultAlertDialogStrings=e.a,exports.defaultOverlayStrings=e.o,exports.useNativeDialog=e.s,exports.useOverlayActions=e.i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_shared/overlays-Du65iCkx.cjs");exports.AlertDialog=e.t,exports.Dialog=e.r,exports.Drawer=e.n,exports.defaultAlertDialogStrings=e.s,exports.defaultOverlayStrings=e.c,exports.useNativeDialog=e.l,exports.useOverlayActions=e.o,exports.useOverlayVisibility=e.i,exports.useOverlayVisibilityGroup=e.a;
@@ -1,7 +1,7 @@
1
1
  export { Dialog } from './dialog';
2
2
  export { Drawer } from './drawer';
3
3
  export { AlertDialog } from './alert-dialog';
4
- export { useNativeDialog, type UseNativeDialogOptions, type UseNativeDialogReturn, useOverlayActions, type UseOverlayActionsOptions, type UseOverlayActionsReturn, } from './hooks';
4
+ export { useNativeDialog, type UseNativeDialogOptions, type UseNativeDialogReturn, useOverlayActions, type UseOverlayActionsOptions, type UseOverlayActionsReturn, useOverlayVisibility, useOverlayVisibilityGroup, type OverlayOpenSetter, type OverlayVisibilityGroupState, type OverlayVisibilityProps, type UseOverlayVisibilityGroupOptions, type UseOverlayVisibilityGroupReturn, type UseOverlayVisibilityOptions, type UseOverlayVisibilityReturn, } from './hooks';
5
5
  export type { OverlayTone, OverlaySize, DrawerDirection, ButtonVariant, ButtonStyle, OverlayBaseProps, OverlayActionProps, OverlayEmphasisProps, DialogProps, DrawerProps, AlertDialogProps, } from './overlays.types';
6
6
  export { defaultOverlayStrings, defaultAlertDialogStrings, type OverlayStrings, } from './overlays.strings';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/features/overlays/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EACH,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC/B,MAAM,SAAS,CAAC;AAGjB,YAAY,EACR,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,gBAAgB,GACnB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACH,qBAAqB,EACrB,yBAAyB,EACzB,KAAK,cAAc,GACtB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/features/overlays/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EACH,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,EACpC,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,GAClC,MAAM,SAAS,CAAC;AAGjB,YAAY,EACR,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,gBAAgB,GACnB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACH,qBAAqB,EACrB,yBAAyB,EACzB,KAAK,cAAc,GACtB,MAAM,oBAAoB,CAAC"}
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "../../../_shared/overlays-CdtMAkKG.js";
2
- export { o as AlertDialog, i as Dialog, n as Drawer, e as defaultAlertDialogStrings, r as defaultOverlayStrings, a as useNativeDialog, t as useOverlayActions };
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../../../_shared/overlays-DW8OIK5R.js";
2
+ export { c as AlertDialog, o as Dialog, i as Drawer, s as defaultAlertDialogStrings, t as defaultOverlayStrings, r as useNativeDialog, a as useOverlayActions, n as useOverlayVisibility, e as useOverlayVisibilityGroup };
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../lib/strings.cjs"),t=require("../../../lib/utils.cjs"),n=require("../../../_shared/button-Bd5bEIiB.cjs"),r=require("../../../_shared/typography-CO9uwZhF.cjs"),i=require("../../../_shared/badge-BeSKxX1u.cjs"),a=require("../../../_shared/cards-BKFwMTjM.cjs"),o=require("../../../_shared/input-CB6hxh-5.cjs"),s=require("../../../_shared/forms-rmKcy5uO.cjs"),c=require("../../../_shared/textarea-B24qgdmd.cjs"),l=require("../../../_shared/display-Bin2vVex.cjs"),u=require("../../../_shared/item-eUP9Rtmg.cjs"),d=require("../../../_shared/table-mPchjiRn.cjs"),f=require("../../../_shared/data-display-C_44_V-W.cjs");let p=require("react"),m=require("react/jsx-runtime"),h=require("lucide-react");var g={title:`Readiness`,description:`Publishing checks and operational setup.`,scoreLabel:`Overall readiness`,progressLabel:`Readiness progress`,createLabel:`Add check`,editLabel:`Edit check`,deleteLabel:`Delete check`,actionsLabel:`Check actions`,emptyTitle:`No readiness checks`,emptyDescription:`Pass readiness items from your product workflow to show progress.`,actionLabel:`Open`},_={title:`Structure`,description:`Media, taxonomy, options, and content coverage.`,createLabel:`Add metric`,viewLabel:`Open`,editLabel:`Edit metric`,deleteLabel:`Delete metric`,actionsLabel:`Metric actions`,emptyTitle:`No structure metrics`,emptyDescription:`Pass structure metrics to summarize the product setup.`},v={title:`Operations`,description:`Availability, channels, service rules, and fulfilment signals.`,createLabel:`Add signal`,editLabel:`Edit signal`,deleteLabel:`Delete signal`,actionsLabel:`Signal actions`,emptyTitle:`No operational signals`,emptyDescription:`Pass operational rows to show channel and availability health.`,actionLabel:`Open`},y={title:`Product details`,description:`Core identity and catalogue fields.`,editLabel:`Edit details`,emptyTitle:`No details`,emptyDescription:`Pass metadata rows to render product details.`},b={title:`Contract`,description:`Commercial terms, pricing rules, and customer-facing conditions.`,termsTitle:`Terms`,rulesTitle:`Rules`,actionLabel:`Manage contract`,editLabel:`Edit contract`,createRuleLabel:`Add rule`,viewRuleLabel:`Open rule`,editRuleLabel:`Edit rule`,deleteRuleLabel:`Delete rule`,ruleActionsLabel:`Rule actions`,emptyTitle:`No contract summary`,emptyDescription:`Pass metrics, terms, or rules to summarize the product contract.`},x={title:`Options`,description:`Variant-driving choices and add-ons customers can select.`,manageLabel:`Manage options`,createLabel:`Add option`,viewLabel:`Open option`,editLabel:`Edit option`,deleteLabel:`Delete option`,actionsLabel:`Option actions`,emptyTitle:`No options`,emptyDescription:`Pass option groups to summarize configurable product choices.`},S={viewLabel:`Open option`,editLabel:`Edit option`,deleteLabel:`Delete option`,actionsLabel:`Option actions`},C={title:`Quote preview`,description:`How the product appears in a compact customer quote.`,subtotalLabel:`Subtotal`,taxLabel:`Tax`,discountLabel:`Discount`,totalLabel:`Total`,actionLabel:`Open quote`,createLineLabel:`Add line`,viewLineLabel:`Open line`,editLineLabel:`Edit line`,deleteLineLabel:`Delete line`,lineActionsLabel:`Line actions`,emptyTitle:`No quote lines`,emptyDescription:`Pass quote lines to preview pricing.`},w={title:`Policies`,description:`Cancellation, booking, service, and customer-facing rules.`,createLabel:`Add policy`,viewLabel:`View`,editLabel:`Edit policy`,deleteLabel:`Delete policy`,actionsLabel:`Policy actions`,emptyTitle:`No policies`,emptyDescription:`Pass policies to summarize customer-facing rules.`},T={title:`Variants`,description:`Sellable combinations with price, availability, and SKU.`,createLabel:`Add variant`,viewLabel:`Open variant`,editLabel:`Edit`,duplicateLabel:`Duplicate`,deleteLabel:`Delete`,emptyTitle:`No variants`,emptyDescription:`Create or pass variants to show sellable rows.`,headers:{variant:`Variant`,sku:`SKU`,price:`Price`,inventory:`Available`,channels:`Channels`,updated:`Updated`,actions:`Actions`}},E={viewLabel:`Open variant`,editLabel:`Edit`,duplicateLabel:`Duplicate`,deleteLabel:`Delete`,actionsLabel:`Variant actions`},D={title:`Variant`,description:`Sellable variant details, options, pricing, and fulfilment data.`,backLabel:`Back`,factsTitle:`Variant facts`,selectedOptionsTitle:`Selected options`,relatedOptionsTitle:`Option groups`,viewOptionLabel:`Open option`,emptyTitle:`No variant selected`,emptyDescription:`Pass a variant to render a standalone variant detail surface.`,metadata:{price:`Price`,inventory:`Available`,sku:`SKU`,channels:`Channels`,updated:`Updated`}},O={title:`Edit variant`,description:`Controlled form for variant identity, pricing, inventory, and option values.`,identityTitle:`Identity`,commercialTitle:`Commercial setup`,optionsTitle:`Options`,saveLabel:`Save variant`,savingLabel:`Saving`,cancelLabel:`Cancel`,deleteLabel:`Delete variant`,statusPlaceholder:`Select status`,optionPlaceholder:`Select value`,fields:{name:`Name`,description:`Description`,sku:`SKU`,price:`Price`,inventory:`Inventory`,status:`Status`,channels:`Channels`},placeholders:{name:`750 ml bottle`,description:`Standard retail pack`,sku:`BAL-750-CL`,price:`US$ 24.00`,inventory:`82`,status:`Active`,channels:`Online store, POS`}},k={mainLabel:`Product overview`,railLabel:`Product supporting information`};function A({title:e,description:n,action:r,className:i}){return(0,m.jsx)(f.m,{padding:`small`,border:!0,title:e,description:n,actions:r,className:t.cn(`product-empty-state--component bg-muted/20`,i)})}var j={neutral:`secondary`,primary:`primary`,success:`success`,warning:`warning`,error:`error`,info:`info`},M={neutral:`border-border bg-card text-muted-foreground`,primary:`border-primary/20 bg-primary/5 text-primary`,success:`border-success/20 bg-success/5 text-success`,warning:`border-warning/30 bg-warning/8 text-warning`,error:`border-destructive/25 bg-destructive/8 text-destructive`,info:`border-info/20 bg-info/5 text-info`};function N(e){return Number.isFinite(e)?Math.min(100,Math.max(0,Math.round(e))):0}function P({tone:e=`neutral`}){return(0,m.jsx)(`span`,{"aria-hidden":`true`,className:t.cn(`product-tone-dot--component size-2 rounded-full`,{"bg-muted-foreground":e===`neutral`,"bg-primary":e===`primary`,"bg-success":e===`success`,"bg-warning":e===`warning`,"bg-destructive":e===`error`,"bg-info":e===`info`})})}function F({metric:e}){let n=e.tone??`neutral`;return(0,m.jsxs)(`div`,{className:t.cn(`product-metric-tile--component rounded-md border px-3 py-2.5`,M[n]),children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,m.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,m.jsx)(r.s,{size:`xs`,type:n===`neutral`?`secondary`:`main`,className:`truncate`,children:e.label}),(0,m.jsx)(r.s,{weight:`semibold`,className:`tabular-nums`,children:e.value})]}),`icon`in e&&!!e.icon&&(0,m.jsx)(`div`,{className:`shrink-0 opacity-80`,children:e.icon})]}),!!e.description&&(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-1.5 leading-snug`,children:e.description})]})}function I({item:e,actions:n,menuLabel:r,className:i}){return n.length===0?null:(0,m.jsx)(`div`,{className:t.cn(`product-row-actions--component flex justify-end`,i),children:(0,m.jsx)(d.M,{row:e,actions:n,menuLabel:r,displayMode:`menu`})})}function L({metric:e,actions:n}){let i=e.tone??`neutral`;return(0,m.jsxs)(u.t,{className:`product-structure-metric-row--component product-structure-card--item`,children:[(0,m.jsx)(u.c,{variant:`icon`,className:t.cn(`rounded-full border`,M[i]),children:e.icon??(0,m.jsx)(P,{tone:i})}),(0,m.jsxs)(u.r,{className:`min-w-0 sm:min-w-48`,children:[(0,m.jsx)(u.u,{children:e.label}),!!e.description&&(0,m.jsx)(u.i,{clamp:2,children:e.description})]}),(0,m.jsxs)(u.n,{className:`ml-auto shrink-0 gap-2`,children:[(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,className:`tabular-nums`,children:e.value}),n]})]})}function R({item:e,actionFallback:r,onSelect:a,actions:o}){let s=e.tone??(e.completed?`success`:`neutral`),c=e.onSelect??a;return(0,m.jsxs)(u.t,{className:`product-readiness-row--component product-readiness-card--item`,children:[(0,m.jsx)(u.c,{variant:`icon`,className:t.cn(`rounded-full border`,M[s]),children:(0,m.jsx)(P,{tone:s})}),(0,m.jsxs)(u.r,{className:`min-w-0 sm:min-w-48`,children:[(0,m.jsx)(u.u,{children:e.label}),!!e.description&&(0,m.jsx)(u.i,{clamp:2,children:e.description})]}),!!(e.value||c||o)&&(0,m.jsxs)(u.n,{className:`ml-auto shrink-0 flex-wrap justify-end gap-2`,children:[!!e.value&&(0,m.jsx)(i.t,{variant:j[s],children:e.value}),!!c&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:c,icon:h.ArrowRight,iconPosition:`right`,children:e.actionLabel??r}),o]})]})}function z({item:e,actionFallback:i,onSelect:a,actions:o}){let s=e.tone??`neutral`,c=e.onSelect??a;return(0,m.jsxs)(u.t,{className:`product-operation-row--component product-operations-card--item`,children:[(0,m.jsx)(u.c,{variant:`icon`,className:t.cn(`rounded-full border`,M[s]),children:(0,m.jsx)(P,{tone:s})}),(0,m.jsxs)(u.r,{className:`min-w-0 sm:min-w-48`,children:[(0,m.jsx)(u.u,{children:e.label}),!!e.description&&(0,m.jsx)(u.i,{clamp:2,children:e.description})]}),!!(e.value||c||o)&&(0,m.jsxs)(u.n,{className:`ml-auto shrink-0 flex-wrap justify-end gap-2`,children:[!!e.value&&(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,children:e.value}),!!c&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:c,icon:h.ArrowRight,iconPosition:`right`,children:e.actionLabel??i}),o]})]})}function B({item:e,actionLabel:a,onSelect:o,actions:s}){let c=e.tone??`neutral`,l=`values`in e?e.values:void 0;return(0,m.jsxs)(u.t,{className:`product-summary-row--component`,children:[(0,m.jsx)(u.c,{variant:`icon`,className:t.cn(`rounded-full border`,M[c]),children:(0,m.jsx)(P,{tone:c})}),(0,m.jsxs)(u.r,{className:`min-w-0 sm:min-w-48`,children:[(0,m.jsx)(u.u,{children:e.label}),!!e.description&&(0,m.jsx)(u.i,{clamp:2,children:e.description}),!!l?.length&&(0,m.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:l.map((e,t)=>(0,m.jsx)(i.t,{variant:`secondary`,children:e},t))})]}),!!(e.value||e.badge||o||s)&&(0,m.jsxs)(u.n,{className:`ml-auto shrink-0 flex-wrap justify-end gap-2`,children:[!!e.value&&(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,children:e.value}),!!e.badge&&e.badge,!!o&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:o,icon:h.ArrowRight,iconPosition:`right`,children:a}),s]})]})}function V({metrics:i=[],terms:o=[],rules:s=[],onOpenContract:c,onEditContract:l,onCreateRule:d,onSelectRule:p,onEditRule:g,onDeleteRule:_,renderRuleActions:v,actions:y,footerSlot:x,empty:S,className:C,strings:w}){let T=e.useStrings(b,w),E=i.length>0||o.length>0||s.length>0,D=c||l||d?(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!!d&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:d,icon:h.Plus,children:T.createRuleLabel}),!!l&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:l,icon:h.Pencil,children:T.editLabel}),!!c&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:c,icon:h.ArrowRight,iconPosition:`right`,children:T.actionLabel})]}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.FileText,{className:`size-4`}),title:T.title,description:T.description,actions:y,headerAction:D,footerSlot:x,contentClassName:`mt-1`,className:t.cn(`product-contract-overview--component w-full`,C),children:E?(0,m.jsxs)(`div`,{className:`space-y-4`,children:[i.length>0&&(0,m.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:i.map(e=>(0,m.jsx)(F,{metric:e},e.id))}),o.length>0&&(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(r.s,{size:`xs`,weight:`semibold`,children:T.termsTitle}),(0,m.jsx)(f.a,{items:o,columns:2,dense:!0})]}),s.length>0&&(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(r.s,{size:`xs`,weight:`semibold`,children:T.rulesTitle}),(0,m.jsx)(u.o,{children:s.map((e,t)=>{let n=p?()=>p(e):void 0,r=g?()=>g(e):void 0,i=_?()=>_(e):void 0,a=[...n?[{id:`open`,label:T.viewRuleLabel,icon:(0,m.jsx)(h.Eye,{className:`size-3.5`}),onClick:()=>n(),variant:`ghost`}]:[],...r?[{id:`edit`,label:T.editRuleLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>r(),variant:`ghost`}]:[],...i?[{id:`delete`,label:T.deleteRuleLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>i(),variant:`destructive`}]:[]];return(0,m.jsx)(B,{item:e,actions:v?v(e,{index:t,onSelect:n,onEdit:r,onDelete:i}):(0,m.jsx)(I,{item:e,actions:a,menuLabel:T.ruleActionsLabel})},e.id)})})]})]}):S??(0,m.jsx)(A,{title:T.emptyTitle,description:T.emptyDescription,action:d?(0,m.jsx)(n.t,{type:`button`,onClick:d,icon:h.Plus,children:T.createRuleLabel}):void 0})})}V.displayName=`ProductContractOverview`;function H({title:r,description:i,metadata:o=[],media:s,onEditDetails:c,actions:l,headerEnd:u,footerSlot:d,empty:p,className:g,strings:_}){let v=e.useStrings(y,_),b=c?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:c,icon:h.Pencil,children:v.editLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.Box,{className:`size-4`}),title:r??v.title,description:i===!1?void 0:i??v.description,actions:l,headerAction:b,headerEnd:u,footerSlot:d,contentClassName:`mt-1`,className:t.cn(`product-details-card--component w-full`,g),children:o.length===0?p??(0,m.jsx)(A,{title:v.emptyTitle,description:v.emptyDescription}):(0,m.jsx)(`div`,{className:`@container/product-details`,children:(0,m.jsxs)(`div`,{className:t.cn(`grid gap-4`,s&&`@xl/product-details:grid-cols-[12rem_minmax(0,1fr)]`),children:[!!s&&(0,m.jsx)(`div`,{className:`product-details-card--media overflow-hidden rounded-md border border-border bg-muted/30`,children:s}),(0,m.jsx)(f.a,{items:o,columns:s?1:2,dense:!0,className:`min-w-0`,valueClassName:`break-words`})]})})})}H.displayName=`ProductDetailsCard`;function U({option:n,index:r=0,onSelectOption:i,onEditOption:a,onDeleteOption:o,renderOptionActions:s,menuLabel:c,className:l,strings:u}){let d=e.useStrings(S,u),f=i?()=>i(n):void 0,p=a?()=>a(n):void 0,g=o?()=>o(n):void 0;return f||p||g||s?s?(0,m.jsx)(`div`,{className:t.cn(`product-option-action-menu--component flex justify-end`,l),children:s(n,{index:r,onSelect:f,onEdit:p,onDelete:g})}):(0,m.jsx)(I,{item:n,menuLabel:c??d.actionsLabel,className:t.cn(`product-option-action-menu--component`,l),actions:[...f?[{id:`open`,label:d.viewLabel,icon:(0,m.jsx)(h.Eye,{className:`size-3.5`}),onClick:()=>f(),variant:`ghost`}]:[],...p?[{id:`edit`,label:d.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>p(),variant:`ghost`}]:[],...g?[{id:`delete`,label:d.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>g(),variant:`destructive`}]:[]]}):null}U.displayName=`ProductOptionActionMenu`;function W({items:r=[],onCreateOperation:i,onSelectOperation:o,onEditOperation:s,onDeleteOperation:c,renderOperationActions:l,actions:d,footerSlot:f,renderItem:p,empty:g,className:_,strings:y}){let b=e.useStrings(v,y),x=i?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:i,icon:h.Plus,children:b.createLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.PackageCheck,{className:`size-4`}),title:b.title,description:b.description,actions:d,headerAction:x,footerSlot:f,contentClassName:`mt-1`,className:t.cn(`product-operations-card--component w-full`,_),children:r.length===0?g??(0,m.jsx)(A,{title:b.emptyTitle,description:b.emptyDescription,action:i?(0,m.jsx)(n.t,{type:`button`,onClick:i,icon:h.Plus,children:b.createLabel}):void 0}):(0,m.jsx)(u.o,{children:r.map((e,t)=>{let n=o?()=>o(e):void 0,r=s?()=>s(e):void 0,i=c?()=>c(e):void 0,a=[...r?[{id:`edit`,label:b.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>r(),variant:`ghost`}]:[],...i?[{id:`delete`,label:b.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>i(),variant:`destructive`}]:[]],u=l?l(e,{index:t,onSelect:n,onEdit:r,onDelete:i}):(0,m.jsx)(I,{item:e,actions:a,menuLabel:b.actionsLabel});return p?(0,m.jsx)(`div`,{children:p(e,t)},e.id):(0,m.jsx)(z,{item:e,actionFallback:b.actionLabel,onSelect:n,actions:u},e.id)})})})}W.displayName=`ProductOperationsCard`;function G({options:r=[],onManageOptions:i,onCreateOption:o,onSelectOption:s,onEditOption:c,onDeleteOption:l,renderOptionActions:d,actions:f,footerSlot:p,renderOption:g,empty:_,className:v,strings:y}){let b=e.useStrings(x,y),S=!!(s||c||l||d),C=[...f??[],...o&&i?[{id:`manage-options`,label:b.manageLabel,icon:(0,m.jsx)(h.SlidersHorizontal,{className:`size-3.5`}),onClick:i}]:[]],w=o||i?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:o??i,icon:o?h.Plus:h.SlidersHorizontal,children:o?b.createLabel:b.manageLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.SlidersHorizontal,{className:`size-4`}),title:b.title,description:b.description,actions:C.length>0?C:void 0,headerAction:w,footerSlot:p,contentClassName:`mt-1`,className:t.cn(`product-options-summary--component w-full`,v),children:r.length===0?_??(0,m.jsx)(A,{title:b.emptyTitle,description:b.emptyDescription,action:o?(0,m.jsx)(n.t,{type:`button`,onClick:o,icon:h.Plus,children:b.createLabel}):void 0}):(0,m.jsx)(u.o,{children:r.map((e,t)=>(()=>{let n=S?(0,m.jsx)(U,{option:e,index:t,onSelectOption:s,onEditOption:c,onDeleteOption:l,renderOptionActions:d,menuLabel:b.actionsLabel,strings:{viewLabel:b.viewLabel,editLabel:b.editLabel,deleteLabel:b.deleteLabel,actionsLabel:b.actionsLabel}}):void 0;return g?(0,m.jsx)(`div`,{children:g(e,t)},e.id):(0,m.jsx)(B,{item:e,actions:n},e.id)})())})})}G.displayName=`ProductOptionsSummary`;function K({policies:r=[],onCreatePolicy:i,onSelectPolicy:o,onEditPolicy:s,onDeletePolicy:c,renderPolicyActions:l,actions:d,footerSlot:f,renderPolicy:p,empty:g,className:_,strings:v}){let y=e.useStrings(w,v),b=i?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:i,icon:h.Plus,children:y.createLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.ShieldCheck,{className:`size-4`}),title:y.title,description:y.description,actions:d,headerAction:b,footerSlot:f,contentClassName:`mt-1`,className:t.cn(`product-policies-card--component w-full`,_),children:r.length===0?g??(0,m.jsx)(A,{title:y.emptyTitle,description:y.emptyDescription,action:i?(0,m.jsx)(n.t,{type:`button`,onClick:i,icon:h.Plus,children:y.createLabel}):void 0}):(0,m.jsx)(u.o,{children:r.map((e,t)=>(()=>{let n=o?()=>o(e):void 0,r=s?()=>s(e):void 0,i=c?()=>c(e):void 0,a=[...r?[{id:`edit`,label:y.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>r(),variant:`ghost`}]:[],...i?[{id:`delete`,label:y.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>i(),variant:`destructive`}]:[]],u=l?l(e,{index:t,onSelect:n,onEdit:r,onDelete:i}):(0,m.jsx)(I,{item:e,actions:a,menuLabel:y.actionsLabel});return p?(0,m.jsx)(`div`,{children:p(e,t)},e.id):(0,m.jsx)(B,{item:e,actionLabel:y.viewLabel,onSelect:n,actions:u},e.id)})())})})}K.displayName=`ProductPoliciesCard`;var ee=`-`;function q({lines:i=[],subtotal:o,tax:s,discount:c,total:l,onOpenQuote:u,onCreateLine:d,onSelectLine:p,onEditLine:g,onDeleteLine:_,renderLineActions:v,actions:y,footerSlot:b,empty:x,className:S,strings:w}){let T=e.useStrings(C,w),E=d||u?(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!!d&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:d,icon:h.Plus,children:T.createLineLabel}),!!u&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:u,icon:h.ArrowRight,iconPosition:`right`,children:T.actionLabel})]}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.ReceiptText,{className:`size-4`}),title:T.title,description:T.description,actions:y,headerAction:E,footerSlot:b,contentClassName:`mt-1`,className:t.cn(`product-quote-preview-card--component w-full`,S),children:i.length===0?x??(0,m.jsx)(A,{title:T.emptyTitle,description:T.emptyDescription,action:d?(0,m.jsx)(n.t,{type:`button`,onClick:d,icon:h.Plus,children:T.createLineLabel}):void 0}):(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsx)(`div`,{className:`space-y-2`,children:i.map((e,t)=>{let n=p?()=>p(e):void 0,i=g?()=>g(e):void 0,a=_?()=>_(e):void 0,o=[...n?[{id:`open`,label:T.viewLineLabel,icon:(0,m.jsx)(h.Eye,{className:`size-3.5`}),onClick:()=>n(),variant:`ghost`}]:[],...i?[{id:`edit`,label:T.editLineLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>i(),variant:`ghost`}]:[],...a?[{id:`delete`,label:T.deleteLineLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>a(),variant:`destructive`}]:[]],s=v?v(e,{index:t,onSelect:n,onEdit:i,onDelete:a}):(0,m.jsx)(I,{item:e,actions:o,menuLabel:T.lineActionsLabel});return(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-md border border-border bg-muted/20 px-3 py-2`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(r.s,{weight:`semibold`,className:`truncate`,children:e.label}),!!e.description&&(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:e.description}),!!e.quantity&&(0,m.jsx)(r.s,{size:`xxs`,type:`secondary`,className:`mt-1`,children:e.quantity})]}),(0,m.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,m.jsx)(r.s,{weight:`semibold`,className:`tabular-nums`,children:e.amount}),s]})]},e.id)})}),(0,m.jsxs)(`div`,{className:`space-y-1.5 rounded-md bg-muted/30 px-3 py-2.5`,children:[o!==void 0&&(0,m.jsx)(f.i,{label:T.subtotalLabel,value:o,mono:!0}),s!==void 0&&(0,m.jsx)(f.i,{label:T.taxLabel,value:s,mono:!0}),c!==void 0&&(0,m.jsx)(f.i,{label:T.discountLabel,value:c,mono:!0,valueClassName:`text-success`}),(0,m.jsx)(f.i,{label:T.totalLabel,value:l??`-`,mono:!0,labelClassName:`font-semibold`,valueClassName:`font-semibold`})]})]})})}q.displayName=`ProductQuotePreviewCard`;function J({items:i=[],score:o,scoreLabel:s,summary:c,onCreateReadinessItem:d,onSelectReadinessItem:f,onEditReadinessItem:p,onDeleteReadinessItem:_,renderReadinessItemActions:v,actions:y,footerSlot:b,renderItem:x,empty:S,className:C,strings:w}){let T=e.useStrings(g,w),E=o===void 0?void 0:N(o),D=d?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:d,icon:h.Plus,children:T.createLabel}):void 0;return(0,m.jsxs)(a.t,{icon:(0,m.jsx)(h.ClipboardCheck,{className:`size-4`}),title:T.title,description:T.description,actions:y,headerAction:D,footerSlot:b,contentClassName:`mt-1`,className:t.cn(`product-readiness-card--component w-full`,C),children:[E!==void 0&&(0,m.jsxs)(`div`,{className:`mb-3 rounded-md border border-border bg-muted/20 px-3 py-2.5`,children:[(0,m.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,children:s??T.scoreLabel}),(0,m.jsxs)(r.s,{size:`xs`,weight:`semibold`,className:`tabular-nums`,children:[E,`%`]})]}),(0,m.jsx)(l.n,{value:E,"aria-label":typeof s==`string`?s:T.progressLabel,"aria-valuetext":`${E}%`,className:`h-1.5`})]}),!!c&&(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mb-3 leading-relaxed`,children:c}),i.length===0?S??(0,m.jsx)(A,{title:T.emptyTitle,description:T.emptyDescription,action:d?(0,m.jsx)(n.t,{type:`button`,onClick:d,icon:h.Plus,children:T.createLabel}):void 0}):(0,m.jsx)(u.o,{children:i.map((e,t)=>{let n=f?()=>f(e):void 0,r=p?()=>p(e):void 0,i=_?()=>_(e):void 0,a=[...r?[{id:`edit`,label:T.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>r(),variant:`ghost`}]:[],...i?[{id:`delete`,label:T.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>i(),variant:`destructive`}]:[]],o=v?v(e,{index:t,onSelect:n,onEdit:r,onDelete:i}):(0,m.jsx)(I,{item:e,actions:a,menuLabel:T.actionsLabel});return x?(0,m.jsx)(`div`,{children:x(e,t)},e.id):(0,m.jsx)(R,{item:e,actionFallback:T.actionLabel,onSelect:n,actions:o},e.id)})})]})}J.displayName=`ProductReadinessCard`;function Y({metrics:r=[],onCreateMetric:i,onSelectMetric:o,onEditMetric:s,onDeleteMetric:c,renderMetricActions:l,actions:d,footerSlot:f,empty:p,className:g,strings:v}){let y=e.useStrings(_,v),b=i?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:i,icon:h.Plus,children:y.createLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.Layers3,{className:`size-4`}),title:y.title,description:y.description,actions:d,headerAction:b,footerSlot:f,contentClassName:`mt-1`,className:t.cn(`product-structure-card--component w-full`,g),children:r.length===0?p??(0,m.jsx)(A,{title:y.emptyTitle,description:y.emptyDescription,action:i?(0,m.jsx)(n.t,{type:`button`,onClick:i,icon:h.Plus,children:y.createLabel}):void 0}):(0,m.jsx)(u.o,{children:r.map((e,t)=>{let n=o?()=>o(e):void 0,r=s?()=>s(e):void 0,i=c?()=>c(e):void 0,a=[...n?[{id:`open`,label:y.viewLabel,icon:(0,m.jsx)(h.Eye,{className:`size-3.5`}),onClick:()=>n(),variant:`ghost`}]:[],...r?[{id:`edit`,label:y.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>r(),variant:`ghost`}]:[],...i?[{id:`delete`,label:y.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>i(),variant:`destructive`}]:[]];return(0,m.jsx)(L,{metric:e,actions:l?l(e,{index:t,onSelect:n,onEdit:r,onDelete:i}):(0,m.jsx)(I,{item:e,actions:a,menuLabel:y.actionsLabel})},e.id)})})})}Y.displayName=`ProductStructureCard`;function X({variant:n,index:r=0,onSelectVariant:i,onEditVariant:a,onDuplicateVariant:o,onDeleteVariant:s,renderVariantActions:c,menuLabel:l,className:u,strings:d}){let f=e.useStrings(E,d),p=i?()=>i(n):void 0,g=a?()=>a(n):void 0,_=o?()=>o(n):void 0,v=s?()=>s(n):void 0;return p||g||_||v||c?c?(0,m.jsx)(`div`,{className:t.cn(`product-variant-action-menu--component flex justify-end`,u),children:c(n,{index:r,onSelect:p,onEdit:g,onDuplicate:_,onDelete:v})}):(0,m.jsx)(I,{item:n,menuLabel:l??f.actionsLabel,className:t.cn(`product-variant-action-menu--component`,u),actions:[...p?[{id:`open`,label:f.viewLabel,icon:(0,m.jsx)(h.Eye,{className:`size-3.5`}),onClick:()=>p(),variant:`ghost`}]:[],...g?[{id:`edit`,label:f.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>g(),variant:`ghost`}]:[],..._?[{id:`duplicate`,label:f.duplicateLabel,icon:(0,m.jsx)(h.Copy,{className:`size-3.5`}),onClick:()=>_(),variant:`ghost`}]:[],...v?[{id:`delete`,label:f.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>v(),variant:`destructive`}]:[]]}):null}X.displayName=`ProductVariantActionMenu`;function te({variant:e,index:n,onSelectVariant:r,onEditVariant:i,onDuplicateVariant:a,onDeleteVariant:o,renderVariantActions:s,strings:c,className:l}){return(0,m.jsx)(X,{variant:e,index:n,onSelectVariant:r,onEditVariant:i,onDuplicateVariant:a,onDeleteVariant:o,renderVariantActions:s,menuLabel:c.headers.actions,className:t.cn(`product-variant-actions--component product-variants-table--row-actions`,l),strings:{viewLabel:c.viewLabel,editLabel:c.editLabel,duplicateLabel:c.duplicateLabel,deleteLabel:c.deleteLabel,actionsLabel:c.headers.actions}})}function Z({label:e,children:n,className:i,textClassName:a,weight:o}){return(0,m.jsxs)(`div`,{className:t.cn(`product-variant-cell--component grid min-w-0 grid-cols-[6rem_minmax(0,1fr)] items-center gap-2 lg:block lg:space-y-0.5`,i),children:[(0,m.jsx)(r.s,{size:`xxs`,type:`secondary`,className:`uppercase tracking-wide lg:sr-only`,children:e}),(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,weight:o,className:t.cn(`truncate`,a),children:n})]})}function Q({variants:o=[],onCreateVariant:s,onSelectVariant:c,onEditVariant:l,onDuplicateVariant:u,onDeleteVariant:d,renderVariantActions:f,actions:p,footerSlot:g,empty:_,className:v,strings:y}){let b=e.useStrings(T,y),x=!!(c||l||u||d||f),S=`lg:grid-cols-[minmax(12rem,1.45fr)_minmax(4rem,0.6fr)_minmax(4rem,0.55fr)_minmax(4.75rem,0.7fr)_minmax(4rem,0.55fr)]`,C=s?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:s,icon:h.Plus,children:b.createLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.ListChecks,{className:`size-4`}),title:b.title,description:b.description,actions:p,headerAction:C,footerSlot:g,contentClassName:`mt-1`,className:t.cn(`product-variants-table--component w-full`,v),children:o.length===0?_??(0,m.jsx)(A,{title:b.emptyTitle,description:b.emptyDescription,action:s?(0,m.jsx)(n.t,{type:`button`,onClick:s,icon:h.Plus,children:b.createLabel}):void 0}):(0,m.jsx)(`div`,{className:`product-variants-table--table rounded-md border border-border`,children:(0,m.jsxs)(`div`,{className:`lg:min-w-136`,children:[(0,m.jsxs)(`div`,{className:t.cn(`hidden gap-3 border-b border-border bg-muted/40 px-3 py-2 lg:grid`,S),children:[(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,type:`secondary`,children:b.headers.variant}),(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,type:`secondary`,children:b.headers.price}),(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,type:`secondary`,children:b.headers.inventory}),(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,type:`secondary`,children:b.headers.sku}),(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,type:`secondary`,children:b.headers.updated})]}),(0,m.jsx)(`div`,{className:`divide-y divide-border`,children:o.map((e,n)=>(0,m.jsxs)(`div`,{className:t.cn(`grid gap-2 px-3 py-3 lg:items-center lg:gap-3 lg:py-2.5`,S),children:[(0,m.jsx)(`div`,{className:`min-w-0`,children:(0,m.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,m.jsx)(r.s,{weight:`semibold`,className:`truncate`,children:e.name}),!!e.status&&(0,m.jsx)(i.t,{variant:e.statusVariant??`secondary`,children:e.status})]}),!!e.description&&(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:e.description}),!!(e.options?.length||e.channels)&&(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,children:[e.options?.map((e,t)=>(0,m.jsx)(i.t,{variant:`secondary`,children:e},t)),!!e.channels&&(0,m.jsxs)(r.s,{tag:`span`,size:`xxs`,type:`secondary`,className:`pl-1`,children:[b.headers.channels,`: `,e.channels]})]})]}),!!x&&(0,m.jsx)(X,{variant:e,index:n,onSelectVariant:c,onEditVariant:l,onDuplicateVariant:u,onDeleteVariant:d,renderVariantActions:f,menuLabel:b.headers.actions,className:`shrink-0`,strings:{viewLabel:b.viewLabel,editLabel:b.editLabel,duplicateLabel:b.duplicateLabel,deleteLabel:b.deleteLabel,actionsLabel:b.headers.actions}})]})}),(0,m.jsx)(Z,{label:b.headers.price,weight:`semibold`,textClassName:`tabular-nums text-foreground`,children:e.price??`-`}),(0,m.jsx)(Z,{label:b.headers.inventory,textClassName:`tabular-nums`,children:e.inventory??`-`}),(0,m.jsx)(Z,{label:b.headers.sku,textClassName:`tabular-nums`,children:e.sku??`-`}),(0,m.jsx)(Z,{label:b.headers.updated,children:e.updatedAt??`-`})]},e.id))})]})})})}Q.displayName=`ProductVariantsTable`;function $({details:n,contract:r,options:i,variants:a,readiness:o,structure:s,operations:c,quote:l,policies:u,slots:d,className:f,mainClassName:p,railClassName:h,strings:g}){let _=e.useStrings(k,g),v=!!(o||s||c||l||u||d?.railTop||d?.railBottom);return(0,m.jsxs)(`div`,{className:t.cn(`product-overview--component @container/product-overview space-y-4`,f),children:[d?.before,(0,m.jsxs)(`div`,{className:t.cn(`grid gap-4`,v&&`@5xl/product-overview:grid-cols-[minmax(0,1fr)_22rem]`),children:[(0,m.jsxs)(`section`,{"aria-label":_.mainLabel,className:t.cn(`product-overview--main min-w-0 space-y-4`,p),children:[d?.mainTop,!!n&&(0,m.jsx)(H,{...n}),!!r&&(0,m.jsx)(V,{...r}),!!i&&(0,m.jsx)(G,{...i}),!!a&&(0,m.jsx)(Q,{...a}),d?.mainBottom]}),!!v&&(0,m.jsxs)(`aside`,{"aria-label":_.railLabel,className:t.cn(`product-overview--rail min-w-0 space-y-4`,h),children:[d?.railTop,!!o&&(0,m.jsx)(J,{...o}),!!s&&(0,m.jsx)(Y,{...s}),!!c&&(0,m.jsx)(W,{...c}),!!l&&(0,m.jsx)(q,{...l}),!!u&&(0,m.jsx)(K,{...u}),d?.railBottom]})]}),d?.after]})}$.displayName=`ProductOverview`;var ne=e=>e!=null&&e!==!1&&e!==``;function re(e,t){return[{label:t.price,value:e.price},{label:t.inventory,value:e.inventory},{label:t.sku,value:e.sku},{label:t.channels,value:e.channels},{label:t.updated,value:e.updatedAt}].filter(e=>ne(e.value))}function ie({variant:o,metadata:s,optionItems:c=[],media:l,onBack:d,onSelectVariant:p,onEditVariant:g,onDuplicateVariant:_,onDeleteVariant:v,onSelectOption:y,actions:b,headerEnd:x,footerSlot:S,empty:C,renderActions:w,renderMetadata:T,renderOption:E,className:O,strings:k}){let j=e.useStrings(D,k),M=o?s??re(o,j.metadata):[],N=!!(o&&(p||g||_||v||w)),P=(0,m.jsxs)(`div`,{className:`product-variant-details--header-actions flex items-center gap-2`,children:[!!d&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:d,icon:h.ArrowLeft,children:j.backLabel}),!!N&&o&&(0,m.jsx)(X,{variant:o,onSelectVariant:p,onEditVariant:g,onDuplicateVariant:_,onDeleteVariant:v,renderVariantActions:w})]}),F=o?.options??[];return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.ListChecks,{className:`size-4`}),title:o?.name??j.title,titleSuffix:o?.status?(0,m.jsx)(i.t,{variant:o.statusVariant??`secondary`,children:o.status}):void 0,description:o?.description??j.description,actions:b,headerAction:d||N?P:void 0,headerEnd:x,footerSlot:S,contentClassName:`mt-1`,className:t.cn(`product-variant-details--component w-full`,O),children:o?(0,m.jsxs)(`div`,{className:`product-variant-details--body grid gap-5`,children:[!!l&&(0,m.jsx)(`div`,{className:`product-variant-details--media overflow-hidden rounded-md border border-border bg-muted/30`,children:l}),T?T(o):(0,m.jsx)(f.a,{title:j.factsTitle,items:M,columns:3,dense:!0,className:`product-variant-details--metadata`}),!!F.length&&(0,m.jsxs)(`div`,{className:`product-variant-details--selected-options space-y-2`,children:[(0,m.jsx)(r.s,{weight:`semibold`,children:j.selectedOptionsTitle}),(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:F.map((e,t)=>(0,m.jsx)(i.t,{variant:`secondary`,children:e},t))})]}),!!c.length&&(0,m.jsxs)(`div`,{className:`product-variant-details--related-options space-y-2`,children:[(0,m.jsx)(r.s,{weight:`semibold`,children:j.relatedOptionsTitle}),(0,m.jsx)(u.o,{children:c.map((e,t)=>E?(0,m.jsx)(`div`,{children:E(e,t)},e.id):(0,m.jsx)(B,{item:e,actionLabel:j.viewOptionLabel,onSelect:y?()=>y(e):void 0},e.id))})]})]}):C??(0,m.jsx)(A,{title:j.emptyTitle,description:j.emptyDescription})})}ie.displayName=`ProductVariantDetails`;var ae=e=>e.map(e=>({value:e.value,label:e.label,disabled:e.disabled}));function oe({value:i,defaultValue:u,optionFields:d=[],statusOptions:f=[],onValueChange:g,onSubmit:_,onCancel:v,onDelete:y,actions:b,headerEnd:x,footerSlot:S,disabled:C=!1,isSubmitting:w=!1,className:T,strings:E}){let D=e.useStrings(O,E),k=(0,p.useId)(),A=i!==void 0,[j,M]=(0,p.useState)(u??{}),N=(A?i:j)??{},P=C||w,F=e=>{A||M(e),g?.(e)},I=(e,t)=>{F({...N,[e]:t})},L=(e,t)=>{F({...N,options:{...N.options??{},[e.id]:t}})},R=e=>{e.preventDefault(),_?.(N)},z=(0,m.jsxs)(`div`,{className:`product-variant-editor--footer flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,m.jsx)(`div`,{children:!!y&&(0,m.jsx)(n.t,{type:`button`,variant:`error`,buttonStyle:`ghost`,onClick:()=>y(N),disabled:P,icon:h.Trash2,children:D.deleteLabel})}),(0,m.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,children:[!!v&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:v,disabled:P,icon:h.X,children:D.cancelLabel}),!!_&&(0,m.jsx)(n.t,{type:`submit`,form:k,disabled:P,icon:h.Save,children:w?D.savingLabel:D.saveLabel})]})]}),B=!!(y||v||_);return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.Pencil,{className:`size-4`}),title:D.title,description:D.description,actions:b,headerEnd:x,footerSlot:S??(B?z:void 0),footerDivider:!0,contentClassName:`mt-1`,className:t.cn(`product-variant-editor--component w-full`,T),children:(0,m.jsxs)(`form`,{id:k,className:`product-variant-editor--form grid gap-5`,onSubmit:R,children:[(0,m.jsxs)(`section`,{className:`product-variant-editor--section grid gap-3`,children:[(0,m.jsx)(r.s,{weight:`semibold`,children:D.identityTitle}),(0,m.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,m.jsx)(l.D,{label:D.fields.name,required:!0,children:(0,m.jsx)(o.t,{value:N.name??``,onChange:e=>I(`name`,e.target.value),placeholder:D.placeholders.name,disabled:P})}),(0,m.jsx)(l.D,{label:D.fields.sku,children:(0,m.jsx)(o.t,{value:N.sku??``,onChange:e=>I(`sku`,e.target.value),placeholder:D.placeholders.sku,disabled:P})}),(0,m.jsx)(l.D,{label:D.fields.description,className:`md:col-span-2`,children:(0,m.jsx)(c.t,{value:N.description??``,onChange:e=>I(`description`,e.target.value),placeholder:D.placeholders.description,disabled:P,autoResize:!0,minRows:2})})]})]}),(0,m.jsxs)(`section`,{className:`product-variant-editor--section grid gap-3`,children:[(0,m.jsx)(r.s,{weight:`semibold`,children:D.commercialTitle}),(0,m.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,m.jsx)(l.D,{label:D.fields.price,children:(0,m.jsx)(o.t,{value:N.price??``,onChange:e=>I(`price`,e.target.value),placeholder:D.placeholders.price,disabled:P})}),(0,m.jsx)(l.D,{label:D.fields.inventory,children:(0,m.jsx)(o.t,{value:N.inventory??``,onChange:e=>I(`inventory`,e.target.value),placeholder:D.placeholders.inventory,disabled:P,inputMode:`numeric`})}),(0,m.jsx)(l.D,{label:D.fields.status,children:f.length>0?(0,m.jsx)(s.Y,{options:ae(f),value:N.status??null,onChange:e=>I(`status`,e??``),placeholder:D.statusPlaceholder,disabled:P,"aria-label":D.fields.status}):(0,m.jsx)(o.t,{value:N.status??``,onChange:e=>I(`status`,e.target.value),placeholder:D.placeholders.status,disabled:P})}),(0,m.jsx)(l.D,{label:D.fields.channels,children:(0,m.jsx)(o.t,{value:N.channels??``,onChange:e=>I(`channels`,e.target.value),placeholder:D.placeholders.channels,disabled:P})})]})]}),!!d.length&&(0,m.jsxs)(`section`,{className:`product-variant-editor--section grid gap-3`,children:[(0,m.jsx)(r.s,{weight:`semibold`,children:D.optionsTitle}),(0,m.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:d.map(e=>{let t=e.value??N.options?.[e.id]??``,n=!!e.choices?.length;return(0,m.jsx)(l.D,{label:e.label,helperText:e.helperText,children:n?(0,m.jsx)(s.Y,{options:ae(e.choices??[]),value:t||null,onChange:t=>L(e,t),placeholder:e.placeholder??D.optionPlaceholder,disabled:P,"aria-label":e.label}):(0,m.jsx)(o.t,{value:t,onChange:t=>L(e,t.target.value),placeholder:e.placeholder??D.optionPlaceholder,disabled:P})},e.id)})})]})]})})}oe.displayName=`ProductVariantEditor`;function se({className:e,...n}){return(0,m.jsx)($,{...n,className:t.cn(`products--component`,e)})}se.displayName=`Products`,exports.PRODUCT_EMPTY_VALUE=ee,exports.PRODUCT_TONE_BADGE=j,exports.PRODUCT_TONE_SURFACE=M,exports.ProductContractOverview=V,exports.ProductDetailsCard=H,exports.ProductEmptyState=A,exports.ProductMetricTile=F,exports.ProductOperationRow=z,exports.ProductOperationsCard=W,exports.ProductOptionActionMenu=U,exports.ProductOptionsSummary=G,exports.ProductOverview=$,exports.ProductPoliciesCard=K,exports.ProductQuotePreviewCard=q,exports.ProductReadinessCard=J,exports.ProductReadinessRow=R,exports.ProductRowActions=I,exports.ProductStructureCard=Y,exports.ProductStructureMetricRow=L,exports.ProductSummaryRow=B,exports.ProductToneDot=P,exports.ProductVariantActionMenu=X,exports.ProductVariantActions=te,exports.ProductVariantCell=Z,exports.ProductVariantDetails=ie,exports.ProductVariantEditor=oe,exports.ProductVariantsTable=Q,exports.Products=se,exports.clampProductPercent=N,exports.defaultProductContractOverviewStrings=b,exports.defaultProductDetailsCardStrings=y,exports.defaultProductOperationsCardStrings=v,exports.defaultProductOptionActionMenuStrings=S,exports.defaultProductOptionsSummaryStrings=x,exports.defaultProductOverviewStrings=k,exports.defaultProductPoliciesCardStrings=w,exports.defaultProductQuotePreviewCardStrings=C,exports.defaultProductReadinessCardStrings=g,exports.defaultProductStructureCardStrings=_,exports.defaultProductVariantActionMenuStrings=E,exports.defaultProductVariantDetailsStrings=D,exports.defaultProductVariantEditorStrings=O,exports.defaultProductVariantsTableStrings=T;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../lib/strings.cjs"),t=require("../../../lib/utils.cjs"),n=require("../../../_shared/button-Bd5bEIiB.cjs"),r=require("../../../_shared/typography-CO9uwZhF.cjs"),i=require("../../../_shared/badge-BeSKxX1u.cjs"),a=require("../../../_shared/cards-CbbHly7W.cjs"),o=require("../../../_shared/input-CB6hxh-5.cjs"),s=require("../../../_shared/forms-CzrEYejY.cjs"),c=require("../../../_shared/textarea-B24qgdmd.cjs"),l=require("../../../_shared/display-Bin2vVex.cjs"),u=require("../../../_shared/item-eUP9Rtmg.cjs"),d=require("../../../_shared/table-CGVOXtdv.cjs"),f=require("../../../_shared/data-display-C21skrV4.cjs");let p=require("react"),m=require("react/jsx-runtime"),h=require("lucide-react");var g={title:`Readiness`,description:`Publishing checks and operational setup.`,scoreLabel:`Overall readiness`,progressLabel:`Readiness progress`,createLabel:`Add check`,editLabel:`Edit check`,deleteLabel:`Delete check`,actionsLabel:`Check actions`,emptyTitle:`No readiness checks`,emptyDescription:`Pass readiness items from your product workflow to show progress.`,actionLabel:`Open`},_={title:`Structure`,description:`Media, taxonomy, options, and content coverage.`,createLabel:`Add metric`,viewLabel:`Open`,editLabel:`Edit metric`,deleteLabel:`Delete metric`,actionsLabel:`Metric actions`,emptyTitle:`No structure metrics`,emptyDescription:`Pass structure metrics to summarize the product setup.`},v={title:`Operations`,description:`Availability, channels, service rules, and fulfilment signals.`,createLabel:`Add signal`,editLabel:`Edit signal`,deleteLabel:`Delete signal`,actionsLabel:`Signal actions`,emptyTitle:`No operational signals`,emptyDescription:`Pass operational rows to show channel and availability health.`,actionLabel:`Open`},y={title:`Product details`,description:`Core identity and catalogue fields.`,editLabel:`Edit details`,emptyTitle:`No details`,emptyDescription:`Pass metadata rows to render product details.`},b={title:`Contract`,description:`Commercial terms, pricing rules, and customer-facing conditions.`,termsTitle:`Terms`,rulesTitle:`Rules`,actionLabel:`Manage contract`,editLabel:`Edit contract`,createRuleLabel:`Add rule`,viewRuleLabel:`Open rule`,editRuleLabel:`Edit rule`,deleteRuleLabel:`Delete rule`,ruleActionsLabel:`Rule actions`,emptyTitle:`No contract summary`,emptyDescription:`Pass metrics, terms, or rules to summarize the product contract.`},x={title:`Options`,description:`Variant-driving choices and add-ons customers can select.`,manageLabel:`Manage options`,createLabel:`Add option`,viewLabel:`Open option`,editLabel:`Edit option`,deleteLabel:`Delete option`,actionsLabel:`Option actions`,emptyTitle:`No options`,emptyDescription:`Pass option groups to summarize configurable product choices.`},S={viewLabel:`Open option`,editLabel:`Edit option`,deleteLabel:`Delete option`,actionsLabel:`Option actions`},C={title:`Quote preview`,description:`How the product appears in a compact customer quote.`,subtotalLabel:`Subtotal`,taxLabel:`Tax`,discountLabel:`Discount`,totalLabel:`Total`,actionLabel:`Open quote`,createLineLabel:`Add line`,viewLineLabel:`Open line`,editLineLabel:`Edit line`,deleteLineLabel:`Delete line`,lineActionsLabel:`Line actions`,emptyTitle:`No quote lines`,emptyDescription:`Pass quote lines to preview pricing.`},w={title:`Policies`,description:`Cancellation, booking, service, and customer-facing rules.`,createLabel:`Add policy`,viewLabel:`View`,editLabel:`Edit policy`,deleteLabel:`Delete policy`,actionsLabel:`Policy actions`,emptyTitle:`No policies`,emptyDescription:`Pass policies to summarize customer-facing rules.`},T={title:`Variants`,description:`Sellable combinations with price, availability, and SKU.`,createLabel:`Add variant`,viewLabel:`Open variant`,editLabel:`Edit`,duplicateLabel:`Duplicate`,deleteLabel:`Delete`,emptyTitle:`No variants`,emptyDescription:`Create or pass variants to show sellable rows.`,headers:{variant:`Variant`,sku:`SKU`,price:`Price`,inventory:`Available`,channels:`Channels`,updated:`Updated`,actions:`Actions`}},E={viewLabel:`Open variant`,editLabel:`Edit`,duplicateLabel:`Duplicate`,deleteLabel:`Delete`,actionsLabel:`Variant actions`},D={title:`Variant`,description:`Sellable variant details, options, pricing, and fulfilment data.`,backLabel:`Back`,factsTitle:`Variant facts`,selectedOptionsTitle:`Selected options`,relatedOptionsTitle:`Option groups`,viewOptionLabel:`Open option`,emptyTitle:`No variant selected`,emptyDescription:`Pass a variant to render a standalone variant detail surface.`,metadata:{price:`Price`,inventory:`Available`,sku:`SKU`,channels:`Channels`,updated:`Updated`}},O={title:`Edit variant`,description:`Controlled form for variant identity, pricing, inventory, and option values.`,identityTitle:`Identity`,commercialTitle:`Commercial setup`,optionsTitle:`Options`,saveLabel:`Save variant`,savingLabel:`Saving`,cancelLabel:`Cancel`,deleteLabel:`Delete variant`,statusPlaceholder:`Select status`,optionPlaceholder:`Select value`,fields:{name:`Name`,description:`Description`,sku:`SKU`,price:`Price`,inventory:`Inventory`,status:`Status`,channels:`Channels`},placeholders:{name:`750 ml bottle`,description:`Standard retail pack`,sku:`BAL-750-CL`,price:`US$ 24.00`,inventory:`82`,status:`Active`,channels:`Online store, POS`}},k={mainLabel:`Product overview`,railLabel:`Product supporting information`};function A({title:e,description:n,action:r,className:i}){return(0,m.jsx)(f.m,{padding:`small`,border:!0,title:e,description:n,actions:r,className:t.cn(`product-empty-state--component bg-muted/20`,i)})}var j={neutral:`secondary`,primary:`primary`,success:`success`,warning:`warning`,error:`error`,info:`info`},M={neutral:`border-border bg-card text-muted-foreground`,primary:`border-primary/20 bg-primary/5 text-primary`,success:`border-success/20 bg-success/5 text-success`,warning:`border-warning/30 bg-warning/8 text-warning`,error:`border-destructive/25 bg-destructive/8 text-destructive`,info:`border-info/20 bg-info/5 text-info`};function N(e){return Number.isFinite(e)?Math.min(100,Math.max(0,Math.round(e))):0}function P({tone:e=`neutral`}){return(0,m.jsx)(`span`,{"aria-hidden":`true`,className:t.cn(`product-tone-dot--component size-2 rounded-full`,{"bg-muted-foreground":e===`neutral`,"bg-primary":e===`primary`,"bg-success":e===`success`,"bg-warning":e===`warning`,"bg-destructive":e===`error`,"bg-info":e===`info`})})}function F({metric:e}){let n=e.tone??`neutral`;return(0,m.jsxs)(`div`,{className:t.cn(`product-metric-tile--component rounded-md border px-3 py-2.5`,M[n]),children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,m.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,m.jsx)(r.s,{size:`xs`,type:n===`neutral`?`secondary`:`main`,className:`truncate`,children:e.label}),(0,m.jsx)(r.s,{weight:`semibold`,className:`tabular-nums`,children:e.value})]}),`icon`in e&&!!e.icon&&(0,m.jsx)(`div`,{className:`shrink-0 opacity-80`,children:e.icon})]}),!!e.description&&(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-1.5 leading-snug`,children:e.description})]})}function I({item:e,actions:n,menuLabel:r,className:i}){return n.length===0?null:(0,m.jsx)(`div`,{className:t.cn(`product-row-actions--component flex justify-end`,i),children:(0,m.jsx)(d.M,{row:e,actions:n,menuLabel:r,displayMode:`menu`})})}function L({metric:e,actions:n}){let i=e.tone??`neutral`;return(0,m.jsxs)(u.t,{className:`product-structure-metric-row--component product-structure-card--item`,children:[(0,m.jsx)(u.c,{variant:`icon`,className:t.cn(`rounded-full border`,M[i]),children:e.icon??(0,m.jsx)(P,{tone:i})}),(0,m.jsxs)(u.r,{className:`min-w-0 sm:min-w-48`,children:[(0,m.jsx)(u.u,{children:e.label}),!!e.description&&(0,m.jsx)(u.i,{clamp:2,children:e.description})]}),(0,m.jsxs)(u.n,{className:`ml-auto shrink-0 gap-2`,children:[(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,className:`tabular-nums`,children:e.value}),n]})]})}function R({item:e,actionFallback:r,onSelect:a,actions:o}){let s=e.tone??(e.completed?`success`:`neutral`),c=e.onSelect??a;return(0,m.jsxs)(u.t,{className:`product-readiness-row--component product-readiness-card--item`,children:[(0,m.jsx)(u.c,{variant:`icon`,className:t.cn(`rounded-full border`,M[s]),children:(0,m.jsx)(P,{tone:s})}),(0,m.jsxs)(u.r,{className:`min-w-0 sm:min-w-48`,children:[(0,m.jsx)(u.u,{children:e.label}),!!e.description&&(0,m.jsx)(u.i,{clamp:2,children:e.description})]}),!!(e.value||c||o)&&(0,m.jsxs)(u.n,{className:`ml-auto shrink-0 flex-wrap justify-end gap-2`,children:[!!e.value&&(0,m.jsx)(i.t,{variant:j[s],children:e.value}),!!c&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:c,icon:h.ArrowRight,iconPosition:`right`,children:e.actionLabel??r}),o]})]})}function z({item:e,actionFallback:i,onSelect:a,actions:o}){let s=e.tone??`neutral`,c=e.onSelect??a;return(0,m.jsxs)(u.t,{className:`product-operation-row--component product-operations-card--item`,children:[(0,m.jsx)(u.c,{variant:`icon`,className:t.cn(`rounded-full border`,M[s]),children:(0,m.jsx)(P,{tone:s})}),(0,m.jsxs)(u.r,{className:`min-w-0 sm:min-w-48`,children:[(0,m.jsx)(u.u,{children:e.label}),!!e.description&&(0,m.jsx)(u.i,{clamp:2,children:e.description})]}),!!(e.value||c||o)&&(0,m.jsxs)(u.n,{className:`ml-auto shrink-0 flex-wrap justify-end gap-2`,children:[!!e.value&&(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,children:e.value}),!!c&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:c,icon:h.ArrowRight,iconPosition:`right`,children:e.actionLabel??i}),o]})]})}function B({item:e,actionLabel:a,onSelect:o,actions:s}){let c=e.tone??`neutral`,l=`values`in e?e.values:void 0;return(0,m.jsxs)(u.t,{className:`product-summary-row--component`,children:[(0,m.jsx)(u.c,{variant:`icon`,className:t.cn(`rounded-full border`,M[c]),children:(0,m.jsx)(P,{tone:c})}),(0,m.jsxs)(u.r,{className:`min-w-0 sm:min-w-48`,children:[(0,m.jsx)(u.u,{children:e.label}),!!e.description&&(0,m.jsx)(u.i,{clamp:2,children:e.description}),!!l?.length&&(0,m.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:l.map((e,t)=>(0,m.jsx)(i.t,{variant:`secondary`,children:e},t))})]}),!!(e.value||e.badge||o||s)&&(0,m.jsxs)(u.n,{className:`ml-auto shrink-0 flex-wrap justify-end gap-2`,children:[!!e.value&&(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,children:e.value}),!!e.badge&&e.badge,!!o&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:o,icon:h.ArrowRight,iconPosition:`right`,children:a}),s]})]})}function V({metrics:i=[],terms:o=[],rules:s=[],onOpenContract:c,onEditContract:l,onCreateRule:d,onSelectRule:p,onEditRule:g,onDeleteRule:_,renderRuleActions:v,actions:y,footerSlot:x,empty:S,className:C,strings:w}){let T=e.useStrings(b,w),E=i.length>0||o.length>0||s.length>0,D=c||l||d?(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!!d&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:d,icon:h.Plus,children:T.createRuleLabel}),!!l&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:l,icon:h.Pencil,children:T.editLabel}),!!c&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:c,icon:h.ArrowRight,iconPosition:`right`,children:T.actionLabel})]}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.FileText,{className:`size-4`}),title:T.title,description:T.description,actions:y,headerAction:D,footerSlot:x,contentClassName:`mt-1`,className:t.cn(`product-contract-overview--component w-full`,C),children:E?(0,m.jsxs)(`div`,{className:`space-y-4`,children:[i.length>0&&(0,m.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:i.map(e=>(0,m.jsx)(F,{metric:e},e.id))}),o.length>0&&(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(r.s,{size:`xs`,weight:`semibold`,children:T.termsTitle}),(0,m.jsx)(f.a,{items:o,columns:2,dense:!0})]}),s.length>0&&(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(r.s,{size:`xs`,weight:`semibold`,children:T.rulesTitle}),(0,m.jsx)(u.o,{children:s.map((e,t)=>{let n=p?()=>p(e):void 0,r=g?()=>g(e):void 0,i=_?()=>_(e):void 0,a=[...n?[{id:`open`,label:T.viewRuleLabel,icon:(0,m.jsx)(h.Eye,{className:`size-3.5`}),onClick:()=>n(),variant:`ghost`}]:[],...r?[{id:`edit`,label:T.editRuleLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>r(),variant:`ghost`}]:[],...i?[{id:`delete`,label:T.deleteRuleLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>i(),variant:`destructive`}]:[]];return(0,m.jsx)(B,{item:e,actions:v?v(e,{index:t,onSelect:n,onEdit:r,onDelete:i}):(0,m.jsx)(I,{item:e,actions:a,menuLabel:T.ruleActionsLabel})},e.id)})})]})]}):S??(0,m.jsx)(A,{title:T.emptyTitle,description:T.emptyDescription,action:d?(0,m.jsx)(n.t,{type:`button`,onClick:d,icon:h.Plus,children:T.createRuleLabel}):void 0})})}V.displayName=`ProductContractOverview`;function H({title:r,description:i,metadata:o=[],media:s,onEditDetails:c,actions:l,headerEnd:u,footerSlot:d,empty:p,className:g,strings:_}){let v=e.useStrings(y,_),b=c?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:c,icon:h.Pencil,children:v.editLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.Box,{className:`size-4`}),title:r??v.title,description:i===!1?void 0:i??v.description,actions:l,headerAction:b,headerEnd:u,footerSlot:d,contentClassName:`mt-1`,className:t.cn(`product-details-card--component w-full`,g),children:o.length===0?p??(0,m.jsx)(A,{title:v.emptyTitle,description:v.emptyDescription}):(0,m.jsx)(`div`,{className:`@container/product-details`,children:(0,m.jsxs)(`div`,{className:t.cn(`grid gap-4`,s&&`@xl/product-details:grid-cols-[12rem_minmax(0,1fr)]`),children:[!!s&&(0,m.jsx)(`div`,{className:`product-details-card--media overflow-hidden rounded-md border border-border bg-muted/30`,children:s}),(0,m.jsx)(f.a,{items:o,columns:s?1:2,dense:!0,className:`min-w-0`,valueClassName:`break-words`})]})})})}H.displayName=`ProductDetailsCard`;function U({option:n,index:r=0,onSelectOption:i,onEditOption:a,onDeleteOption:o,renderOptionActions:s,menuLabel:c,className:l,strings:u}){let d=e.useStrings(S,u),f=i?()=>i(n):void 0,p=a?()=>a(n):void 0,g=o?()=>o(n):void 0;return f||p||g||s?s?(0,m.jsx)(`div`,{className:t.cn(`product-option-action-menu--component flex justify-end`,l),children:s(n,{index:r,onSelect:f,onEdit:p,onDelete:g})}):(0,m.jsx)(I,{item:n,menuLabel:c??d.actionsLabel,className:t.cn(`product-option-action-menu--component`,l),actions:[...f?[{id:`open`,label:d.viewLabel,icon:(0,m.jsx)(h.Eye,{className:`size-3.5`}),onClick:()=>f(),variant:`ghost`}]:[],...p?[{id:`edit`,label:d.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>p(),variant:`ghost`}]:[],...g?[{id:`delete`,label:d.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>g(),variant:`destructive`}]:[]]}):null}U.displayName=`ProductOptionActionMenu`;function W({items:r=[],onCreateOperation:i,onSelectOperation:o,onEditOperation:s,onDeleteOperation:c,renderOperationActions:l,actions:d,footerSlot:f,renderItem:p,empty:g,className:_,strings:y}){let b=e.useStrings(v,y),x=i?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:i,icon:h.Plus,children:b.createLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.PackageCheck,{className:`size-4`}),title:b.title,description:b.description,actions:d,headerAction:x,footerSlot:f,contentClassName:`mt-1`,className:t.cn(`product-operations-card--component w-full`,_),children:r.length===0?g??(0,m.jsx)(A,{title:b.emptyTitle,description:b.emptyDescription,action:i?(0,m.jsx)(n.t,{type:`button`,onClick:i,icon:h.Plus,children:b.createLabel}):void 0}):(0,m.jsx)(u.o,{children:r.map((e,t)=>{let n=o?()=>o(e):void 0,r=s?()=>s(e):void 0,i=c?()=>c(e):void 0,a=[...r?[{id:`edit`,label:b.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>r(),variant:`ghost`}]:[],...i?[{id:`delete`,label:b.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>i(),variant:`destructive`}]:[]],u=l?l(e,{index:t,onSelect:n,onEdit:r,onDelete:i}):(0,m.jsx)(I,{item:e,actions:a,menuLabel:b.actionsLabel});return p?(0,m.jsx)(`div`,{children:p(e,t)},e.id):(0,m.jsx)(z,{item:e,actionFallback:b.actionLabel,onSelect:n,actions:u},e.id)})})})}W.displayName=`ProductOperationsCard`;function G({options:r=[],onManageOptions:i,onCreateOption:o,onSelectOption:s,onEditOption:c,onDeleteOption:l,renderOptionActions:d,actions:f,footerSlot:p,renderOption:g,empty:_,className:v,strings:y}){let b=e.useStrings(x,y),S=!!(s||c||l||d),C=[...f??[],...o&&i?[{id:`manage-options`,label:b.manageLabel,icon:(0,m.jsx)(h.SlidersHorizontal,{className:`size-3.5`}),onClick:i}]:[]],w=o||i?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:o??i,icon:o?h.Plus:h.SlidersHorizontal,children:o?b.createLabel:b.manageLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.SlidersHorizontal,{className:`size-4`}),title:b.title,description:b.description,actions:C.length>0?C:void 0,headerAction:w,footerSlot:p,contentClassName:`mt-1`,className:t.cn(`product-options-summary--component w-full`,v),children:r.length===0?_??(0,m.jsx)(A,{title:b.emptyTitle,description:b.emptyDescription,action:o?(0,m.jsx)(n.t,{type:`button`,onClick:o,icon:h.Plus,children:b.createLabel}):void 0}):(0,m.jsx)(u.o,{children:r.map((e,t)=>(()=>{let n=S?(0,m.jsx)(U,{option:e,index:t,onSelectOption:s,onEditOption:c,onDeleteOption:l,renderOptionActions:d,menuLabel:b.actionsLabel,strings:{viewLabel:b.viewLabel,editLabel:b.editLabel,deleteLabel:b.deleteLabel,actionsLabel:b.actionsLabel}}):void 0;return g?(0,m.jsx)(`div`,{children:g(e,t)},e.id):(0,m.jsx)(B,{item:e,actions:n},e.id)})())})})}G.displayName=`ProductOptionsSummary`;function K({policies:r=[],onCreatePolicy:i,onSelectPolicy:o,onEditPolicy:s,onDeletePolicy:c,renderPolicyActions:l,actions:d,footerSlot:f,renderPolicy:p,empty:g,className:_,strings:v}){let y=e.useStrings(w,v),b=i?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:i,icon:h.Plus,children:y.createLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.ShieldCheck,{className:`size-4`}),title:y.title,description:y.description,actions:d,headerAction:b,footerSlot:f,contentClassName:`mt-1`,className:t.cn(`product-policies-card--component w-full`,_),children:r.length===0?g??(0,m.jsx)(A,{title:y.emptyTitle,description:y.emptyDescription,action:i?(0,m.jsx)(n.t,{type:`button`,onClick:i,icon:h.Plus,children:y.createLabel}):void 0}):(0,m.jsx)(u.o,{children:r.map((e,t)=>(()=>{let n=o?()=>o(e):void 0,r=s?()=>s(e):void 0,i=c?()=>c(e):void 0,a=[...r?[{id:`edit`,label:y.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>r(),variant:`ghost`}]:[],...i?[{id:`delete`,label:y.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>i(),variant:`destructive`}]:[]],u=l?l(e,{index:t,onSelect:n,onEdit:r,onDelete:i}):(0,m.jsx)(I,{item:e,actions:a,menuLabel:y.actionsLabel});return p?(0,m.jsx)(`div`,{children:p(e,t)},e.id):(0,m.jsx)(B,{item:e,actionLabel:y.viewLabel,onSelect:n,actions:u},e.id)})())})})}K.displayName=`ProductPoliciesCard`;var ee=`-`;function q({lines:i=[],subtotal:o,tax:s,discount:c,total:l,onOpenQuote:u,onCreateLine:d,onSelectLine:p,onEditLine:g,onDeleteLine:_,renderLineActions:v,actions:y,footerSlot:b,empty:x,className:S,strings:w}){let T=e.useStrings(C,w),E=d||u?(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[!!d&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:d,icon:h.Plus,children:T.createLineLabel}),!!u&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:u,icon:h.ArrowRight,iconPosition:`right`,children:T.actionLabel})]}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.ReceiptText,{className:`size-4`}),title:T.title,description:T.description,actions:y,headerAction:E,footerSlot:b,contentClassName:`mt-1`,className:t.cn(`product-quote-preview-card--component w-full`,S),children:i.length===0?x??(0,m.jsx)(A,{title:T.emptyTitle,description:T.emptyDescription,action:d?(0,m.jsx)(n.t,{type:`button`,onClick:d,icon:h.Plus,children:T.createLineLabel}):void 0}):(0,m.jsxs)(`div`,{className:`space-y-3`,children:[(0,m.jsx)(`div`,{className:`space-y-2`,children:i.map((e,t)=>{let n=p?()=>p(e):void 0,i=g?()=>g(e):void 0,a=_?()=>_(e):void 0,o=[...n?[{id:`open`,label:T.viewLineLabel,icon:(0,m.jsx)(h.Eye,{className:`size-3.5`}),onClick:()=>n(),variant:`ghost`}]:[],...i?[{id:`edit`,label:T.editLineLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>i(),variant:`ghost`}]:[],...a?[{id:`delete`,label:T.deleteLineLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>a(),variant:`destructive`}]:[]],s=v?v(e,{index:t,onSelect:n,onEdit:i,onDelete:a}):(0,m.jsx)(I,{item:e,actions:o,menuLabel:T.lineActionsLabel});return(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-md border border-border bg-muted/20 px-3 py-2`,children:[(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsx)(r.s,{weight:`semibold`,className:`truncate`,children:e.label}),!!e.description&&(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:e.description}),!!e.quantity&&(0,m.jsx)(r.s,{size:`xxs`,type:`secondary`,className:`mt-1`,children:e.quantity})]}),(0,m.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,m.jsx)(r.s,{weight:`semibold`,className:`tabular-nums`,children:e.amount}),s]})]},e.id)})}),(0,m.jsxs)(`div`,{className:`space-y-1.5 rounded-md bg-muted/30 px-3 py-2.5`,children:[o!==void 0&&(0,m.jsx)(f.i,{label:T.subtotalLabel,value:o,mono:!0}),s!==void 0&&(0,m.jsx)(f.i,{label:T.taxLabel,value:s,mono:!0}),c!==void 0&&(0,m.jsx)(f.i,{label:T.discountLabel,value:c,mono:!0,valueClassName:`text-success`}),(0,m.jsx)(f.i,{label:T.totalLabel,value:l??`-`,mono:!0,labelClassName:`font-semibold`,valueClassName:`font-semibold`})]})]})})}q.displayName=`ProductQuotePreviewCard`;function J({items:i=[],score:o,scoreLabel:s,summary:c,onCreateReadinessItem:d,onSelectReadinessItem:f,onEditReadinessItem:p,onDeleteReadinessItem:_,renderReadinessItemActions:v,actions:y,footerSlot:b,renderItem:x,empty:S,className:C,strings:w}){let T=e.useStrings(g,w),E=o===void 0?void 0:N(o),D=d?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:d,icon:h.Plus,children:T.createLabel}):void 0;return(0,m.jsxs)(a.t,{icon:(0,m.jsx)(h.ClipboardCheck,{className:`size-4`}),title:T.title,description:T.description,actions:y,headerAction:D,footerSlot:b,contentClassName:`mt-1`,className:t.cn(`product-readiness-card--component w-full`,C),children:[E!==void 0&&(0,m.jsxs)(`div`,{className:`mb-3 rounded-md border border-border bg-muted/20 px-3 py-2.5`,children:[(0,m.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,children:s??T.scoreLabel}),(0,m.jsxs)(r.s,{size:`xs`,weight:`semibold`,className:`tabular-nums`,children:[E,`%`]})]}),(0,m.jsx)(l.n,{value:E,"aria-label":typeof s==`string`?s:T.progressLabel,"aria-valuetext":`${E}%`,className:`h-1.5`})]}),!!c&&(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mb-3 leading-relaxed`,children:c}),i.length===0?S??(0,m.jsx)(A,{title:T.emptyTitle,description:T.emptyDescription,action:d?(0,m.jsx)(n.t,{type:`button`,onClick:d,icon:h.Plus,children:T.createLabel}):void 0}):(0,m.jsx)(u.o,{children:i.map((e,t)=>{let n=f?()=>f(e):void 0,r=p?()=>p(e):void 0,i=_?()=>_(e):void 0,a=[...r?[{id:`edit`,label:T.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>r(),variant:`ghost`}]:[],...i?[{id:`delete`,label:T.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>i(),variant:`destructive`}]:[]],o=v?v(e,{index:t,onSelect:n,onEdit:r,onDelete:i}):(0,m.jsx)(I,{item:e,actions:a,menuLabel:T.actionsLabel});return x?(0,m.jsx)(`div`,{children:x(e,t)},e.id):(0,m.jsx)(R,{item:e,actionFallback:T.actionLabel,onSelect:n,actions:o},e.id)})})]})}J.displayName=`ProductReadinessCard`;function Y({metrics:r=[],onCreateMetric:i,onSelectMetric:o,onEditMetric:s,onDeleteMetric:c,renderMetricActions:l,actions:d,footerSlot:f,empty:p,className:g,strings:v}){let y=e.useStrings(_,v),b=i?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:i,icon:h.Plus,children:y.createLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.Layers3,{className:`size-4`}),title:y.title,description:y.description,actions:d,headerAction:b,footerSlot:f,contentClassName:`mt-1`,className:t.cn(`product-structure-card--component w-full`,g),children:r.length===0?p??(0,m.jsx)(A,{title:y.emptyTitle,description:y.emptyDescription,action:i?(0,m.jsx)(n.t,{type:`button`,onClick:i,icon:h.Plus,children:y.createLabel}):void 0}):(0,m.jsx)(u.o,{children:r.map((e,t)=>{let n=o?()=>o(e):void 0,r=s?()=>s(e):void 0,i=c?()=>c(e):void 0,a=[...n?[{id:`open`,label:y.viewLabel,icon:(0,m.jsx)(h.Eye,{className:`size-3.5`}),onClick:()=>n(),variant:`ghost`}]:[],...r?[{id:`edit`,label:y.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>r(),variant:`ghost`}]:[],...i?[{id:`delete`,label:y.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>i(),variant:`destructive`}]:[]];return(0,m.jsx)(L,{metric:e,actions:l?l(e,{index:t,onSelect:n,onEdit:r,onDelete:i}):(0,m.jsx)(I,{item:e,actions:a,menuLabel:y.actionsLabel})},e.id)})})})}Y.displayName=`ProductStructureCard`;function X({variant:n,index:r=0,onSelectVariant:i,onEditVariant:a,onDuplicateVariant:o,onDeleteVariant:s,renderVariantActions:c,menuLabel:l,className:u,strings:d}){let f=e.useStrings(E,d),p=i?()=>i(n):void 0,g=a?()=>a(n):void 0,_=o?()=>o(n):void 0,v=s?()=>s(n):void 0;return p||g||_||v||c?c?(0,m.jsx)(`div`,{className:t.cn(`product-variant-action-menu--component flex justify-end`,u),children:c(n,{index:r,onSelect:p,onEdit:g,onDuplicate:_,onDelete:v})}):(0,m.jsx)(I,{item:n,menuLabel:l??f.actionsLabel,className:t.cn(`product-variant-action-menu--component`,u),actions:[...p?[{id:`open`,label:f.viewLabel,icon:(0,m.jsx)(h.Eye,{className:`size-3.5`}),onClick:()=>p(),variant:`ghost`}]:[],...g?[{id:`edit`,label:f.editLabel,icon:(0,m.jsx)(h.Pencil,{className:`size-3.5`}),onClick:()=>g(),variant:`ghost`}]:[],..._?[{id:`duplicate`,label:f.duplicateLabel,icon:(0,m.jsx)(h.Copy,{className:`size-3.5`}),onClick:()=>_(),variant:`ghost`}]:[],...v?[{id:`delete`,label:f.deleteLabel,icon:(0,m.jsx)(h.Trash2,{className:`size-3.5`}),onClick:()=>v(),variant:`destructive`}]:[]]}):null}X.displayName=`ProductVariantActionMenu`;function te({variant:e,index:n,onSelectVariant:r,onEditVariant:i,onDuplicateVariant:a,onDeleteVariant:o,renderVariantActions:s,strings:c,className:l}){return(0,m.jsx)(X,{variant:e,index:n,onSelectVariant:r,onEditVariant:i,onDuplicateVariant:a,onDeleteVariant:o,renderVariantActions:s,menuLabel:c.headers.actions,className:t.cn(`product-variant-actions--component product-variants-table--row-actions`,l),strings:{viewLabel:c.viewLabel,editLabel:c.editLabel,duplicateLabel:c.duplicateLabel,deleteLabel:c.deleteLabel,actionsLabel:c.headers.actions}})}function Z({label:e,children:n,className:i,textClassName:a,weight:o}){return(0,m.jsxs)(`div`,{className:t.cn(`product-variant-cell--component grid min-w-0 grid-cols-[6rem_minmax(0,1fr)] items-center gap-2 lg:block lg:space-y-0.5`,i),children:[(0,m.jsx)(r.s,{size:`xxs`,type:`secondary`,className:`uppercase tracking-wide lg:sr-only`,children:e}),(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,weight:o,className:t.cn(`truncate`,a),children:n})]})}function Q({variants:o=[],onCreateVariant:s,onSelectVariant:c,onEditVariant:l,onDuplicateVariant:u,onDeleteVariant:d,renderVariantActions:f,actions:p,footerSlot:g,empty:_,className:v,strings:y}){let b=e.useStrings(T,y),x=!!(c||l||u||d||f),S=`lg:grid-cols-[minmax(12rem,1.45fr)_minmax(4rem,0.6fr)_minmax(4rem,0.55fr)_minmax(4.75rem,0.7fr)_minmax(4rem,0.55fr)]`,C=s?(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:s,icon:h.Plus,children:b.createLabel}):void 0;return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.ListChecks,{className:`size-4`}),title:b.title,description:b.description,actions:p,headerAction:C,footerSlot:g,contentClassName:`mt-1`,className:t.cn(`product-variants-table--component w-full`,v),children:o.length===0?_??(0,m.jsx)(A,{title:b.emptyTitle,description:b.emptyDescription,action:s?(0,m.jsx)(n.t,{type:`button`,onClick:s,icon:h.Plus,children:b.createLabel}):void 0}):(0,m.jsx)(`div`,{className:`product-variants-table--table rounded-md border border-border`,children:(0,m.jsxs)(`div`,{className:`lg:min-w-136`,children:[(0,m.jsxs)(`div`,{className:t.cn(`hidden gap-3 border-b border-border bg-muted/40 px-3 py-2 lg:grid`,S),children:[(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,type:`secondary`,children:b.headers.variant}),(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,type:`secondary`,children:b.headers.price}),(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,type:`secondary`,children:b.headers.inventory}),(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,type:`secondary`,children:b.headers.sku}),(0,m.jsx)(r.s,{tag:`span`,size:`xs`,weight:`semibold`,type:`secondary`,children:b.headers.updated})]}),(0,m.jsx)(`div`,{className:`divide-y divide-border`,children:o.map((e,n)=>(0,m.jsxs)(`div`,{className:t.cn(`grid gap-2 px-3 py-3 lg:items-center lg:gap-3 lg:py-2.5`,S),children:[(0,m.jsx)(`div`,{className:`min-w-0`,children:(0,m.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,m.jsx)(r.s,{weight:`semibold`,className:`truncate`,children:e.name}),!!e.status&&(0,m.jsx)(i.t,{variant:e.statusVariant??`secondary`,children:e.status})]}),!!e.description&&(0,m.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:e.description}),!!(e.options?.length||e.channels)&&(0,m.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,children:[e.options?.map((e,t)=>(0,m.jsx)(i.t,{variant:`secondary`,children:e},t)),!!e.channels&&(0,m.jsxs)(r.s,{tag:`span`,size:`xxs`,type:`secondary`,className:`pl-1`,children:[b.headers.channels,`: `,e.channels]})]})]}),!!x&&(0,m.jsx)(X,{variant:e,index:n,onSelectVariant:c,onEditVariant:l,onDuplicateVariant:u,onDeleteVariant:d,renderVariantActions:f,menuLabel:b.headers.actions,className:`shrink-0`,strings:{viewLabel:b.viewLabel,editLabel:b.editLabel,duplicateLabel:b.duplicateLabel,deleteLabel:b.deleteLabel,actionsLabel:b.headers.actions}})]})}),(0,m.jsx)(Z,{label:b.headers.price,weight:`semibold`,textClassName:`tabular-nums text-foreground`,children:e.price??`-`}),(0,m.jsx)(Z,{label:b.headers.inventory,textClassName:`tabular-nums`,children:e.inventory??`-`}),(0,m.jsx)(Z,{label:b.headers.sku,textClassName:`tabular-nums`,children:e.sku??`-`}),(0,m.jsx)(Z,{label:b.headers.updated,children:e.updatedAt??`-`})]},e.id))})]})})})}Q.displayName=`ProductVariantsTable`;function $({details:n,contract:r,options:i,variants:a,readiness:o,structure:s,operations:c,quote:l,policies:u,slots:d,className:f,mainClassName:p,railClassName:h,strings:g}){let _=e.useStrings(k,g),v=!!(o||s||c||l||u||d?.railTop||d?.railBottom);return(0,m.jsxs)(`div`,{className:t.cn(`product-overview--component @container/product-overview space-y-4`,f),children:[d?.before,(0,m.jsxs)(`div`,{className:t.cn(`grid gap-4`,v&&`@5xl/product-overview:grid-cols-[minmax(0,1fr)_22rem]`),children:[(0,m.jsxs)(`section`,{"aria-label":_.mainLabel,className:t.cn(`product-overview--main min-w-0 space-y-4`,p),children:[d?.mainTop,!!n&&(0,m.jsx)(H,{...n}),!!r&&(0,m.jsx)(V,{...r}),!!i&&(0,m.jsx)(G,{...i}),!!a&&(0,m.jsx)(Q,{...a}),d?.mainBottom]}),!!v&&(0,m.jsxs)(`aside`,{"aria-label":_.railLabel,className:t.cn(`product-overview--rail min-w-0 space-y-4`,h),children:[d?.railTop,!!o&&(0,m.jsx)(J,{...o}),!!s&&(0,m.jsx)(Y,{...s}),!!c&&(0,m.jsx)(W,{...c}),!!l&&(0,m.jsx)(q,{...l}),!!u&&(0,m.jsx)(K,{...u}),d?.railBottom]})]}),d?.after]})}$.displayName=`ProductOverview`;var ne=e=>e!=null&&e!==!1&&e!==``;function re(e,t){return[{label:t.price,value:e.price},{label:t.inventory,value:e.inventory},{label:t.sku,value:e.sku},{label:t.channels,value:e.channels},{label:t.updated,value:e.updatedAt}].filter(e=>ne(e.value))}function ie({variant:o,metadata:s,optionItems:c=[],media:l,onBack:d,onSelectVariant:p,onEditVariant:g,onDuplicateVariant:_,onDeleteVariant:v,onSelectOption:y,actions:b,headerEnd:x,footerSlot:S,empty:C,renderActions:w,renderMetadata:T,renderOption:E,className:O,strings:k}){let j=e.useStrings(D,k),M=o?s??re(o,j.metadata):[],N=!!(o&&(p||g||_||v||w)),P=(0,m.jsxs)(`div`,{className:`product-variant-details--header-actions flex items-center gap-2`,children:[!!d&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:d,icon:h.ArrowLeft,children:j.backLabel}),!!N&&o&&(0,m.jsx)(X,{variant:o,onSelectVariant:p,onEditVariant:g,onDuplicateVariant:_,onDeleteVariant:v,renderVariantActions:w})]}),F=o?.options??[];return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.ListChecks,{className:`size-4`}),title:o?.name??j.title,titleSuffix:o?.status?(0,m.jsx)(i.t,{variant:o.statusVariant??`secondary`,children:o.status}):void 0,description:o?.description??j.description,actions:b,headerAction:d||N?P:void 0,headerEnd:x,footerSlot:S,contentClassName:`mt-1`,className:t.cn(`product-variant-details--component w-full`,O),children:o?(0,m.jsxs)(`div`,{className:`product-variant-details--body grid gap-5`,children:[!!l&&(0,m.jsx)(`div`,{className:`product-variant-details--media overflow-hidden rounded-md border border-border bg-muted/30`,children:l}),T?T(o):(0,m.jsx)(f.a,{title:j.factsTitle,items:M,columns:3,dense:!0,className:`product-variant-details--metadata`}),!!F.length&&(0,m.jsxs)(`div`,{className:`product-variant-details--selected-options space-y-2`,children:[(0,m.jsx)(r.s,{weight:`semibold`,children:j.selectedOptionsTitle}),(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:F.map((e,t)=>(0,m.jsx)(i.t,{variant:`secondary`,children:e},t))})]}),!!c.length&&(0,m.jsxs)(`div`,{className:`product-variant-details--related-options space-y-2`,children:[(0,m.jsx)(r.s,{weight:`semibold`,children:j.relatedOptionsTitle}),(0,m.jsx)(u.o,{children:c.map((e,t)=>E?(0,m.jsx)(`div`,{children:E(e,t)},e.id):(0,m.jsx)(B,{item:e,actionLabel:j.viewOptionLabel,onSelect:y?()=>y(e):void 0},e.id))})]})]}):C??(0,m.jsx)(A,{title:j.emptyTitle,description:j.emptyDescription})})}ie.displayName=`ProductVariantDetails`;var ae=e=>e.map(e=>({value:e.value,label:e.label,disabled:e.disabled}));function oe({value:i,defaultValue:u,optionFields:d=[],statusOptions:f=[],onValueChange:g,onSubmit:_,onCancel:v,onDelete:y,actions:b,headerEnd:x,footerSlot:S,disabled:C=!1,isSubmitting:w=!1,className:T,strings:E}){let D=e.useStrings(O,E),k=(0,p.useId)(),A=i!==void 0,[j,M]=(0,p.useState)(u??{}),N=(A?i:j)??{},P=C||w,F=e=>{A||M(e),g?.(e)},I=(e,t)=>{F({...N,[e]:t})},L=(e,t)=>{F({...N,options:{...N.options??{},[e.id]:t}})},R=e=>{e.preventDefault(),_?.(N)},z=(0,m.jsxs)(`div`,{className:`product-variant-editor--footer flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,m.jsx)(`div`,{children:!!y&&(0,m.jsx)(n.t,{type:`button`,variant:`error`,buttonStyle:`ghost`,onClick:()=>y(N),disabled:P,icon:h.Trash2,children:D.deleteLabel})}),(0,m.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,children:[!!v&&(0,m.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:v,disabled:P,icon:h.X,children:D.cancelLabel}),!!_&&(0,m.jsx)(n.t,{type:`submit`,form:k,disabled:P,icon:h.Save,children:w?D.savingLabel:D.saveLabel})]})]}),B=!!(y||v||_);return(0,m.jsx)(a.t,{icon:(0,m.jsx)(h.Pencil,{className:`size-4`}),title:D.title,description:D.description,actions:b,headerEnd:x,footerSlot:S??(B?z:void 0),footerDivider:!0,contentClassName:`mt-1`,className:t.cn(`product-variant-editor--component w-full`,T),children:(0,m.jsxs)(`form`,{id:k,className:`product-variant-editor--form grid gap-5`,onSubmit:R,children:[(0,m.jsxs)(`section`,{className:`product-variant-editor--section grid gap-3`,children:[(0,m.jsx)(r.s,{weight:`semibold`,children:D.identityTitle}),(0,m.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,m.jsx)(l.D,{label:D.fields.name,required:!0,children:(0,m.jsx)(o.t,{value:N.name??``,onChange:e=>I(`name`,e.target.value),placeholder:D.placeholders.name,disabled:P})}),(0,m.jsx)(l.D,{label:D.fields.sku,children:(0,m.jsx)(o.t,{value:N.sku??``,onChange:e=>I(`sku`,e.target.value),placeholder:D.placeholders.sku,disabled:P})}),(0,m.jsx)(l.D,{label:D.fields.description,className:`md:col-span-2`,children:(0,m.jsx)(c.t,{value:N.description??``,onChange:e=>I(`description`,e.target.value),placeholder:D.placeholders.description,disabled:P,autoResize:!0,minRows:2})})]})]}),(0,m.jsxs)(`section`,{className:`product-variant-editor--section grid gap-3`,children:[(0,m.jsx)(r.s,{weight:`semibold`,children:D.commercialTitle}),(0,m.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,m.jsx)(l.D,{label:D.fields.price,children:(0,m.jsx)(o.t,{value:N.price??``,onChange:e=>I(`price`,e.target.value),placeholder:D.placeholders.price,disabled:P})}),(0,m.jsx)(l.D,{label:D.fields.inventory,children:(0,m.jsx)(o.t,{value:N.inventory??``,onChange:e=>I(`inventory`,e.target.value),placeholder:D.placeholders.inventory,disabled:P,inputMode:`numeric`})}),(0,m.jsx)(l.D,{label:D.fields.status,children:f.length>0?(0,m.jsx)(s.Y,{options:ae(f),value:N.status??null,onChange:e=>I(`status`,e??``),placeholder:D.statusPlaceholder,disabled:P,"aria-label":D.fields.status}):(0,m.jsx)(o.t,{value:N.status??``,onChange:e=>I(`status`,e.target.value),placeholder:D.placeholders.status,disabled:P})}),(0,m.jsx)(l.D,{label:D.fields.channels,children:(0,m.jsx)(o.t,{value:N.channels??``,onChange:e=>I(`channels`,e.target.value),placeholder:D.placeholders.channels,disabled:P})})]})]}),!!d.length&&(0,m.jsxs)(`section`,{className:`product-variant-editor--section grid gap-3`,children:[(0,m.jsx)(r.s,{weight:`semibold`,children:D.optionsTitle}),(0,m.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:d.map(e=>{let t=e.value??N.options?.[e.id]??``,n=!!e.choices?.length;return(0,m.jsx)(l.D,{label:e.label,helperText:e.helperText,children:n?(0,m.jsx)(s.Y,{options:ae(e.choices??[]),value:t||null,onChange:t=>L(e,t),placeholder:e.placeholder??D.optionPlaceholder,disabled:P,"aria-label":e.label}):(0,m.jsx)(o.t,{value:t,onChange:t=>L(e,t.target.value),placeholder:e.placeholder??D.optionPlaceholder,disabled:P})},e.id)})})]})]})})}oe.displayName=`ProductVariantEditor`;function se({className:e,...n}){return(0,m.jsx)($,{...n,className:t.cn(`products--component`,e)})}se.displayName=`Products`,exports.PRODUCT_EMPTY_VALUE=ee,exports.PRODUCT_TONE_BADGE=j,exports.PRODUCT_TONE_SURFACE=M,exports.ProductContractOverview=V,exports.ProductDetailsCard=H,exports.ProductEmptyState=A,exports.ProductMetricTile=F,exports.ProductOperationRow=z,exports.ProductOperationsCard=W,exports.ProductOptionActionMenu=U,exports.ProductOptionsSummary=G,exports.ProductOverview=$,exports.ProductPoliciesCard=K,exports.ProductQuotePreviewCard=q,exports.ProductReadinessCard=J,exports.ProductReadinessRow=R,exports.ProductRowActions=I,exports.ProductStructureCard=Y,exports.ProductStructureMetricRow=L,exports.ProductSummaryRow=B,exports.ProductToneDot=P,exports.ProductVariantActionMenu=X,exports.ProductVariantActions=te,exports.ProductVariantCell=Z,exports.ProductVariantDetails=ie,exports.ProductVariantEditor=oe,exports.ProductVariantsTable=Q,exports.Products=se,exports.clampProductPercent=N,exports.defaultProductContractOverviewStrings=b,exports.defaultProductDetailsCardStrings=y,exports.defaultProductOperationsCardStrings=v,exports.defaultProductOptionActionMenuStrings=S,exports.defaultProductOptionsSummaryStrings=x,exports.defaultProductOverviewStrings=k,exports.defaultProductPoliciesCardStrings=w,exports.defaultProductQuotePreviewCardStrings=C,exports.defaultProductReadinessCardStrings=g,exports.defaultProductStructureCardStrings=_,exports.defaultProductVariantActionMenuStrings=E,exports.defaultProductVariantDetailsStrings=D,exports.defaultProductVariantEditorStrings=O,exports.defaultProductVariantsTableStrings=T;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -3,14 +3,14 @@ import { cn as t } from "../../../lib/utils.js";
3
3
  import { t as n } from "../../../_shared/button-DHksjMvc.js";
4
4
  import { s as r } from "../../../_shared/typography-DE0NGEIE.js";
5
5
  import { t as i } from "../../../_shared/badge-a2Z3K5aQ.js";
6
- import { t as a } from "../../../_shared/cards-CtBoSZG9.js";
6
+ import { t as a } from "../../../_shared/cards-RZxRLx3f.js";
7
7
  import { t as o } from "../../../_shared/input-CfnHBT--.js";
8
- import { Y as s } from "../../../_shared/forms-qnwoUqxf.js";
8
+ import { Y as s } from "../../../_shared/forms-BoquZE2Y.js";
9
9
  import { t as c } from "../../../_shared/textarea-ChLRmmVU.js";
10
10
  import { D as l, n as u } from "../../../_shared/display-B0wLVN8t.js";
11
11
  import { c as d, i as f, n as p, o as m, r as h, t as g, u as _ } from "../../../_shared/item-Xs-fgzaT.js";
12
- import { M as v } from "../../../_shared/table-CUA_A-oO.js";
13
- import { a as y, i as b, m as x } from "../../../_shared/data-display-CRFaMkxT.js";
12
+ import { M as v } from "../../../_shared/table-B_pqCQxC.js";
13
+ import { a as y, i as b, m as x } from "../../../_shared/data-display-C5-1dZua.js";
14
14
  import { useId as S, useState as C } from "react";
15
15
  import { jsx as w, jsxs as T } from "react/jsx-runtime";
16
16
  import { ArrowLeft as E, ArrowRight as D, Box as O, ClipboardCheck as k, Copy as A, Eye as j, FileText as M, Layers3 as N, ListChecks as P, PackageCheck as F, Pencil as I, Plus as L, ReceiptText as R, Save as ee, ShieldCheck as te, SlidersHorizontal as z, Trash2 as B, X as ne } from "lucide-react";
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../lib/utils.cjs"),t=require("../../../_shared/typography-CO9uwZhF.cjs"),n=require("../../../_shared/icon-badge-CU6ZkcER.cjs"),r=require("../../../_shared/cards-BKFwMTjM.cjs"),i=require("../../../_shared/avatar-BnKM_o2d.cjs"),a=require("../../../_shared/skeleton-D1c5OHXa.cjs"),o=require("../../../_shared/navigation-DAB7uuBj.cjs"),s=require("../../../_shared/data-display-C_44_V-W.cjs");let c=require("react/jsx-runtime");function l(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``)}function u({title:r,description:a,eyebrow:o,media:s,avatarUrl:u,avatarAlt:d,avatarFallback:f,icon:p,iconTone:m=`muted`,badges:h,metadata:g,actions:_,className:v,contentClassName:y,mediaClassName:b}){let x=p,S=typeof r==`string`?r:``,C=s??(u||f?(0,c.jsxs)(i.t,{className:e.cn(`resource-header--avatar size-avatar-lg`,b),children:[!!u&&(0,c.jsx)(i.o,{src:u,alt:d??S}),(0,c.jsx)(i.r,{children:f??l(S)})]}):x?(0,c.jsx)(n.t,{icon:x,shape:`square`,tone:m,className:e.cn(`resource-header--icon size-avatar-lg [&>svg]:size-icon-lg`,b)}):null);return(0,c.jsxs)(`header`,{"data-component":`resource-header`,"data-slot":`resource-header`,className:e.cn(`resource-header--component flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,v),children:[(0,c.jsxs)(`div`,{"data-slot":`resource-header-main`,className:`resource-header--main flex min-w-0 flex-1 items-start gap-3`,children:[C,(0,c.jsxs)(`div`,{"data-slot":`resource-header-content`,className:e.cn(`resource-header--content min-w-0 flex-1`,y),children:[!!o&&(0,c.jsx)(t.s,{size:`xxs`,type:`secondary`,weight:`medium`,className:`resource-header--eyebrow mb-1 uppercase tracking-normal`,children:o}),(0,c.jsxs)(`div`,{"data-slot":`resource-header-title-row`,className:`resource-header--title-row flex min-w-0 flex-wrap items-center gap-2`,children:[(0,c.jsx)(t.o,{tag:`h2`,className:`resource-header--title truncate border-0 pb-0`,children:r}),!!h&&(0,c.jsx)(`div`,{"data-slot":`resource-header-badges`,className:`resource-header--badges flex shrink-0 flex-wrap items-center gap-1.5`,children:h})]}),!!a&&(0,c.jsx)(t.s,{type:`secondary`,className:`resource-header--description mt-1 max-w-3xl`,children:a}),!!g&&(0,c.jsx)(`div`,{"data-slot":`resource-header-metadata`,className:`resource-header--metadata mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:g})]})]}),!!_&&(0,c.jsx)(`div`,{"data-slot":`resource-header-actions`,className:`resource-header--actions flex shrink-0 flex-wrap items-center gap-2`,children:_})]})}function d({children:t,leading:n,trailing:r,sticky:i=!1,className:a}){return(0,c.jsxs)(`div`,{"data-component":`resource-action-bar`,"data-slot":`resource-action-bar`,className:e.cn(`resource-action-bar--component flex min-w-0 flex-col gap-3 rounded-lg border border-border/70 bg-card px-3 py-2.5 shadow-sm sm:flex-row sm:items-center sm:justify-between`,i&&`sticky top-[calc(var(--topbar-height)_+_0.5rem)] z-30`,a),children:[(0,c.jsx)(`div`,{"data-slot":`resource-action-leading`,className:`resource-action-bar--leading flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:n??t}),!!r&&(0,c.jsx)(`div`,{"data-slot":`resource-action-trailing`,className:`resource-action-bar--trailing flex shrink-0 flex-wrap items-center gap-2`,children:r})]})}function f(t){return(0,c.jsx)(s.m,{...t,"data-component":`resource-empty-state`,"data-slot":`resource-empty-state`,className:e.cn(`resource-empty-state--component`,t.className)})}function p({children:t,title:n,description:r,actions:i,toolbar:o,empty:s,isEmpty:l=!1,isLoading:d=!1,error:f,slots:p,className:m,headerClassName:h,contentClassName:g,asideClassName:_,variant:v}){let y=p?.header??(n?(0,c.jsx)(u,{title:n,description:r,actions:i,className:h}):null),b=p?.toolbar??o,x=d?p?.loading??(0,c.jsxs)(`div`,{className:`resource-shell--loading grid gap-3`,children:[(0,c.jsx)(a.t,{className:`h-10 w-full`}),(0,c.jsx)(a.t,{className:`h-28 w-full`})]}):f?p?.error??f:l?s:t;return(0,c.jsxs)(`section`,{"data-component":`resource-${v}-shell`,"data-slot":`resource-${v}-shell`,className:e.cn(`resource-${v}-shell--component grid min-w-0 gap-4`,p?.aside&&`lg:grid-cols-[minmax(0,1fr)_var(--resource-aside-width,20rem)]`,m),children:[(0,c.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[!!y&&(0,c.jsx)(`div`,{"data-slot":`resource-${v}-header`,className:`resource-${v}-shell--header`,children:y}),!!b&&(0,c.jsx)(`div`,{"data-slot":`resource-${v}-toolbar`,className:`resource-${v}-shell--toolbar`,children:b}),(0,c.jsx)(`div`,{"data-slot":`resource-${v}-content`,className:e.cn(`resource-${v}-shell--content min-w-0`,g),children:x}),!!p?.footer&&(0,c.jsx)(`div`,{"data-slot":`resource-${v}-footer`,className:`resource-${v}-shell--footer`,children:p.footer})]}),!!p?.aside&&(0,c.jsx)(`aside`,{"data-slot":`resource-${v}-aside`,className:e.cn(`resource-${v}-shell--aside min-w-0`,_),children:p.aside})]})}function m(e){return(0,c.jsx)(p,{...e,variant:`index`})}function h(e){return(0,c.jsx)(p,{...e,variant:`show`})}function g({tabs:e,activeTab:t,onTabChange:n,tabsClassName:r,moreLabel:i,tabsAriaLabel:a,toolbar:s,slots:l,...u}){let d=(0,c.jsxs)(`div`,{"data-slot":`tabbed-resource-toolbar`,className:`tabbed-resource-shell--toolbar grid gap-3`,children:[(0,c.jsx)(o.t,{items:e,value:t,onChange:n,className:r,moreLabel:i,ariaLabel:a}),s]});return(0,c.jsx)(h,{...u,toolbar:d,slots:{...l,toolbar:l?.toolbar??d}})}function _({title:t,description:n,actions:i,headerAction:a,children:o,footer:s,padding:l=`default`,surface:u=`card`,className:d,contentClassName:f,name:p}){return(0,c.jsx)(r.t,{"data-component":p,"data-slot":p,title:t,description:n,actions:i,headerAction:a,footerSlot:s,padding:l,surface:u,className:e.cn(`${p}--component`,d),contentClassName:f,children:o})}function v(e){return(0,c.jsx)(_,{...e,name:`resource-details-card`})}function y({metadata:n,metadataColumns:r=2,metadataDense:i=!1,body:a,help:o,children:l,contentClassName:u,...d}){return(0,c.jsxs)(_,{...d,name:`resource-details-section`,contentClassName:e.cn(`resource-details-section--content grid gap-4`,u),children:[!!n?.length&&(0,c.jsx)(s.a,{items:n,columns:r,dense:i}),a,l,!!o&&(0,c.jsx)(t.s,{size:`xs`,type:`secondary`,className:`resource-details-section--help`,children:o})]})}var b=u;function x(e){return(0,c.jsx)(_,{...e,name:`resource-related-card`})}function S(e){return(0,c.jsx)(_,{...e,name:`resource-activity-card`})}exports.PersonHeader=b,exports.ResourceActionBar=d,exports.ResourceActivityCard=S,exports.ResourceDetailsCard=v,exports.ResourceDetailsSection=y,exports.ResourceEmptyState=f,exports.ResourceHeader=u,exports.ResourceIndexShell=m,exports.ResourceRelatedCard=x,exports.ResourceShowShell=h,exports.TabbedResourceShell=g;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../lib/utils.cjs"),t=require("../../../_shared/typography-CO9uwZhF.cjs"),n=require("../../../_shared/icon-badge-CU6ZkcER.cjs"),r=require("../../../_shared/cards-CbbHly7W.cjs"),i=require("../../../_shared/avatar-BnKM_o2d.cjs"),a=require("../../../_shared/skeleton-D1c5OHXa.cjs"),o=require("../../../_shared/navigation-DAB7uuBj.cjs"),s=require("../../../_shared/data-display-C21skrV4.cjs");let c=require("react/jsx-runtime");function l(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join(``)}function u({title:r,description:a,eyebrow:o,media:s,avatarUrl:u,avatarAlt:d,avatarFallback:f,icon:p,iconTone:m=`muted`,badges:h,metadata:g,actions:_,className:v,contentClassName:y,mediaClassName:b}){let x=p,S=typeof r==`string`?r:``,C=s??(u||f?(0,c.jsxs)(i.t,{className:e.cn(`resource-header--avatar size-avatar-lg`,b),children:[!!u&&(0,c.jsx)(i.o,{src:u,alt:d??S}),(0,c.jsx)(i.r,{children:f??l(S)})]}):x?(0,c.jsx)(n.t,{icon:x,shape:`square`,tone:m,className:e.cn(`resource-header--icon size-avatar-lg [&>svg]:size-icon-lg`,b)}):null);return(0,c.jsxs)(`header`,{"data-component":`resource-header`,"data-slot":`resource-header`,className:e.cn(`resource-header--component flex min-w-0 flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,v),children:[(0,c.jsxs)(`div`,{"data-slot":`resource-header-main`,className:`resource-header--main flex min-w-0 flex-1 items-start gap-3`,children:[C,(0,c.jsxs)(`div`,{"data-slot":`resource-header-content`,className:e.cn(`resource-header--content min-w-0 flex-1`,y),children:[!!o&&(0,c.jsx)(t.s,{size:`xxs`,type:`secondary`,weight:`medium`,className:`resource-header--eyebrow mb-1 uppercase tracking-normal`,children:o}),(0,c.jsxs)(`div`,{"data-slot":`resource-header-title-row`,className:`resource-header--title-row flex min-w-0 flex-wrap items-center gap-2`,children:[(0,c.jsx)(t.o,{tag:`h2`,className:`resource-header--title truncate border-0 pb-0`,children:r}),!!h&&(0,c.jsx)(`div`,{"data-slot":`resource-header-badges`,className:`resource-header--badges flex shrink-0 flex-wrap items-center gap-1.5`,children:h})]}),!!a&&(0,c.jsx)(t.s,{type:`secondary`,className:`resource-header--description mt-1 max-w-3xl`,children:a}),!!g&&(0,c.jsx)(`div`,{"data-slot":`resource-header-metadata`,className:`resource-header--metadata mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground`,children:g})]})]}),!!_&&(0,c.jsx)(`div`,{"data-slot":`resource-header-actions`,className:`resource-header--actions flex shrink-0 flex-wrap items-center gap-2`,children:_})]})}function d({children:t,leading:n,trailing:r,sticky:i=!1,className:a}){return(0,c.jsxs)(`div`,{"data-component":`resource-action-bar`,"data-slot":`resource-action-bar`,className:e.cn(`resource-action-bar--component flex min-w-0 flex-col gap-3 rounded-lg border border-border/70 bg-card px-3 py-2.5 shadow-sm sm:flex-row sm:items-center sm:justify-between`,i&&`sticky top-[calc(var(--topbar-height)_+_0.5rem)] z-30`,a),children:[(0,c.jsx)(`div`,{"data-slot":`resource-action-leading`,className:`resource-action-bar--leading flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:n??t}),!!r&&(0,c.jsx)(`div`,{"data-slot":`resource-action-trailing`,className:`resource-action-bar--trailing flex shrink-0 flex-wrap items-center gap-2`,children:r})]})}function f(t){return(0,c.jsx)(s.m,{...t,"data-component":`resource-empty-state`,"data-slot":`resource-empty-state`,className:e.cn(`resource-empty-state--component`,t.className)})}function p({children:t,title:n,description:r,actions:i,toolbar:o,empty:s,isEmpty:l=!1,isLoading:d=!1,error:f,slots:p,className:m,headerClassName:h,contentClassName:g,asideClassName:_,variant:v}){let y=p?.header??(n?(0,c.jsx)(u,{title:n,description:r,actions:i,className:h}):null),b=p?.toolbar??o,x=d?p?.loading??(0,c.jsxs)(`div`,{className:`resource-shell--loading grid gap-3`,children:[(0,c.jsx)(a.t,{className:`h-10 w-full`}),(0,c.jsx)(a.t,{className:`h-28 w-full`})]}):f?p?.error??f:l?s:t;return(0,c.jsxs)(`section`,{"data-component":`resource-${v}-shell`,"data-slot":`resource-${v}-shell`,className:e.cn(`resource-${v}-shell--component grid min-w-0 gap-4`,p?.aside&&`lg:grid-cols-[minmax(0,1fr)_var(--resource-aside-width,20rem)]`,m),children:[(0,c.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[!!y&&(0,c.jsx)(`div`,{"data-slot":`resource-${v}-header`,className:`resource-${v}-shell--header`,children:y}),!!b&&(0,c.jsx)(`div`,{"data-slot":`resource-${v}-toolbar`,className:`resource-${v}-shell--toolbar`,children:b}),(0,c.jsx)(`div`,{"data-slot":`resource-${v}-content`,className:e.cn(`resource-${v}-shell--content min-w-0`,g),children:x}),!!p?.footer&&(0,c.jsx)(`div`,{"data-slot":`resource-${v}-footer`,className:`resource-${v}-shell--footer`,children:p.footer})]}),!!p?.aside&&(0,c.jsx)(`aside`,{"data-slot":`resource-${v}-aside`,className:e.cn(`resource-${v}-shell--aside min-w-0`,_),children:p.aside})]})}function m(e){return(0,c.jsx)(p,{...e,variant:`index`})}function h(e){return(0,c.jsx)(p,{...e,variant:`show`})}function g({tabs:e,activeTab:t,onTabChange:n,tabsClassName:r,moreLabel:i,tabsAriaLabel:a,toolbar:s,slots:l,...u}){let d=(0,c.jsxs)(`div`,{"data-slot":`tabbed-resource-toolbar`,className:`tabbed-resource-shell--toolbar grid gap-3`,children:[(0,c.jsx)(o.t,{items:e,value:t,onChange:n,className:r,moreLabel:i,ariaLabel:a}),s]});return(0,c.jsx)(h,{...u,toolbar:d,slots:{...l,toolbar:l?.toolbar??d}})}function _({title:t,description:n,actions:i,headerAction:a,children:o,footer:s,padding:l=`default`,surface:u=`card`,className:d,contentClassName:f,name:p}){return(0,c.jsx)(r.t,{"data-component":p,"data-slot":p,title:t,description:n,actions:i,headerAction:a,footerSlot:s,padding:l,surface:u,className:e.cn(`${p}--component`,d),contentClassName:f,children:o})}function v(e){return(0,c.jsx)(_,{...e,name:`resource-details-card`})}function y({metadata:n,metadataColumns:r=2,metadataDense:i=!1,body:a,help:o,children:l,contentClassName:u,...d}){return(0,c.jsxs)(_,{...d,name:`resource-details-section`,contentClassName:e.cn(`resource-details-section--content grid gap-4`,u),children:[!!n?.length&&(0,c.jsx)(s.a,{items:n,columns:r,dense:i}),a,l,!!o&&(0,c.jsx)(t.s,{size:`xs`,type:`secondary`,className:`resource-details-section--help`,children:o})]})}var b=u;function x(e){return(0,c.jsx)(_,{...e,name:`resource-related-card`})}function S(e){return(0,c.jsx)(_,{...e,name:`resource-activity-card`})}exports.PersonHeader=b,exports.ResourceActionBar=d,exports.ResourceActivityCard=S,exports.ResourceDetailsCard=v,exports.ResourceDetailsSection=y,exports.ResourceEmptyState=f,exports.ResourceHeader=u,exports.ResourceIndexShell=m,exports.ResourceRelatedCard=x,exports.ResourceShowShell=h,exports.TabbedResourceShell=g;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,11 +1,11 @@
1
1
  import { cn as e } from "../../../lib/utils.js";
2
2
  import { o as t, s as n } from "../../../_shared/typography-DE0NGEIE.js";
3
3
  import { t as r } from "../../../_shared/icon-badge-dZQPvuas.js";
4
- import { t as i } from "../../../_shared/cards-CtBoSZG9.js";
4
+ import { t as i } from "../../../_shared/cards-RZxRLx3f.js";
5
5
  import { o as a, r as o, t as s } from "../../../_shared/avatar-BagPbPuD.js";
6
6
  import { t as c } from "../../../_shared/skeleton-CGQMeno1.js";
7
7
  import { t as l } from "../../../_shared/navigation-BcYAwgzo.js";
8
- import { a as u, m as d } from "../../../_shared/data-display-CRFaMkxT.js";
8
+ import { a as u, m as d } from "../../../_shared/data-display-C5-1dZua.js";
9
9
  import { jsx as f, jsxs as p } from "react/jsx-runtime";
10
10
  //#region src/components/features/resource/resource.tsx
11
11
  function m(e) {