admin-ui-starter-kit 0.6.2 → 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.
- package/dist/_shared/{auth-B_KVUjsB.cjs → auth-DdezEtKK.cjs} +2 -2
- package/dist/_shared/{auth-B_KVUjsB.cjs.map → auth-DdezEtKK.cjs.map} +1 -1
- package/dist/_shared/{auth-C_TgyzDl.js → auth-e7yab9pK.js} +2 -2
- package/dist/_shared/{auth-C_TgyzDl.js.map → auth-e7yab9pK.js.map} +1 -1
- package/dist/_shared/{buttons-C8jy-jMd.cjs → buttons-Bek9F7qK.cjs} +2 -2
- package/dist/_shared/{buttons-C8jy-jMd.cjs.map → buttons-Bek9F7qK.cjs.map} +1 -1
- package/dist/_shared/{buttons-MxvdokeK.js → buttons-DcynMPnE.js} +2 -2
- package/dist/_shared/{buttons-MxvdokeK.js.map → buttons-DcynMPnE.js.map} +1 -1
- package/dist/_shared/cards-CbbHly7W.cjs +2 -0
- package/dist/_shared/cards-CbbHly7W.cjs.map +1 -0
- package/dist/_shared/{cards-CtBoSZG9.js → cards-RZxRLx3f.js} +6 -6
- package/dist/_shared/cards-RZxRLx3f.js.map +1 -0
- package/dist/_shared/{comments-DGBxF9fD.js → comments-BJqgvSFY.js} +2 -2
- package/dist/_shared/{comments-DGBxF9fD.js.map → comments-BJqgvSFY.js.map} +1 -1
- package/dist/_shared/{comments-C8iXy9XO.cjs → comments-BjPciQfo.cjs} +2 -2
- package/dist/_shared/{comments-C8iXy9XO.cjs.map → comments-BjPciQfo.cjs.map} +1 -1
- package/dist/_shared/{data-display-C_44_V-W.cjs → data-display-C21skrV4.cjs} +2 -2
- package/dist/_shared/{data-display-C_44_V-W.cjs.map → data-display-C21skrV4.cjs.map} +1 -1
- package/dist/_shared/{data-display-CRFaMkxT.js → data-display-C5-1dZua.js} +71 -71
- package/dist/_shared/{data-display-CRFaMkxT.js.map → data-display-C5-1dZua.js.map} +1 -1
- package/dist/_shared/{forms-qnwoUqxf.js → forms-BoquZE2Y.js} +3 -3
- package/dist/_shared/{forms-qnwoUqxf.js.map → forms-BoquZE2Y.js.map} +1 -1
- package/dist/_shared/{forms-rmKcy5uO.cjs → forms-CzrEYejY.cjs} +2 -2
- package/dist/_shared/{forms-rmKcy5uO.cjs.map → forms-CzrEYejY.cjs.map} +1 -1
- package/dist/_shared/{page-C6EzwvTz.cjs → page-D8UMXREv.cjs} +2 -2
- package/dist/_shared/{page-C6EzwvTz.cjs.map → page-D8UMXREv.cjs.map} +1 -1
- package/dist/_shared/{page-DCW1eWCJ.js → page-D9LNsHMN.js} +2 -2
- package/dist/_shared/{page-DCW1eWCJ.js.map → page-D9LNsHMN.js.map} +1 -1
- package/dist/_shared/{settings-QOBrbgdN.js → settings-BeZOIEJB.js} +2 -2
- package/dist/_shared/{settings-QOBrbgdN.js.map → settings-BeZOIEJB.js.map} +1 -1
- package/dist/_shared/{settings-DbAyxMrX.cjs → settings-DI-K34bW.cjs} +2 -2
- package/dist/_shared/{settings-DbAyxMrX.cjs.map → settings-DI-K34bW.cjs.map} +1 -1
- package/dist/_shared/{table-CUA_A-oO.js → table-B_pqCQxC.js} +3 -3
- package/dist/_shared/table-B_pqCQxC.js.map +1 -0
- package/dist/_shared/table-CGVOXtdv.cjs +2 -0
- package/dist/_shared/table-CGVOXtdv.cjs.map +1 -0
- package/dist/components/base/buttons/index.cjs +1 -1
- package/dist/components/base/buttons/index.js +1 -1
- package/dist/components/base/cards/index.cjs +1 -1
- package/dist/components/base/cards/index.js +1 -1
- package/dist/components/base/forms/index.cjs +1 -1
- package/dist/components/base/forms/index.js +1 -1
- package/dist/components/base/table/index.cjs +1 -1
- package/dist/components/base/table/index.js +1 -1
- package/dist/components/composed/admin/index.cjs +1 -1
- package/dist/components/composed/admin/index.js +2 -2
- package/dist/components/composed/ai/index.cjs +1 -1
- package/dist/components/composed/ai/index.js +2 -2
- package/dist/components/composed/analytics/index.cjs +1 -1
- package/dist/components/composed/analytics/index.js +1 -1
- package/dist/components/composed/cards/index.cjs +1 -1
- package/dist/components/composed/cards/index.js +2 -2
- package/dist/components/composed/commerce/index.cjs +1 -1
- package/dist/components/composed/commerce/index.js +2 -2
- package/dist/components/composed/dark-surfaces/index.cjs +1 -1
- package/dist/components/composed/dark-surfaces/index.js +1 -1
- package/dist/components/composed/data-display/index.cjs +1 -1
- package/dist/components/composed/data-display/index.js +1 -1
- package/dist/components/composed/data-display/metadata/metadata-list.d.ts.map +1 -1
- package/dist/components/composed/navigation/index.cjs +1 -1
- package/dist/components/composed/navigation/index.js +1 -1
- package/dist/components/composed/timelines/index.cjs +1 -1
- package/dist/components/composed/timelines/index.js +1 -1
- package/dist/components/features/activities/index.cjs +1 -1
- package/dist/components/features/activities/index.js +1 -1
- package/dist/components/features/card/index.cjs +1 -1
- package/dist/components/features/card/index.js +1 -1
- package/dist/components/features/comments/index.cjs +1 -1
- package/dist/components/features/comments/index.js +1 -1
- package/dist/components/features/event-log/index.cjs +1 -1
- package/dist/components/features/event-log/index.js +2 -2
- package/dist/components/features/media-library/index.cjs +1 -1
- package/dist/components/features/media-library/index.js +1 -1
- package/dist/components/features/products/index.cjs +1 -1
- package/dist/components/features/products/index.js +4 -4
- package/dist/components/features/resource/index.cjs +1 -1
- package/dist/components/features/resource/index.js +2 -2
- package/dist/components/features/schema-form/index.cjs +1 -1
- package/dist/components/features/schema-form/index.js +2 -2
- package/dist/components/layout/auth/index.cjs +1 -1
- package/dist/components/layout/auth/index.js +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +3 -3
- package/dist/components/layout/page/index.cjs +1 -1
- package/dist/components/layout/page/index.js +1 -1
- package/dist/components/layout/settings/index.cjs +1 -1
- package/dist/components/layout/settings/index.js +1 -1
- package/dist/showcase/assets/{AreaChart-CFYg5vW0.js → AreaChart-Y0ZwblHU.js} +1 -1
- package/dist/showcase/assets/{CompositeItem-C1v8tfgt.js → CompositeItem-BIY_Cp7P.js} +1 -1
- package/dist/showcase/assets/{CompositeRoot-DVtTCBlx.js → CompositeRoot-DSPvBRQr.js} +1 -1
- package/dist/showcase/assets/{DialogTrigger-CiVZgbZe.js → DialogTrigger-DHUp8vXe.js} +1 -1
- package/dist/showcase/assets/{LabelableContext-CNcXHqnK.js → LabelableContext-CasUI4hR.js} +1 -1
- package/dist/showcase/assets/{PreviewLayout-CBTybzKu.js → PreviewLayout-B_l930k0.js} +1 -1
- package/dist/showcase/assets/{RadioGroup-DTNAD-0J.js → RadioGroup-BgZ-UH79.js} +1 -1
- package/dist/showcase/assets/{ScrollAreaCorner-Gau2B-d1.js → ScrollAreaCorner-BbwFElLA.js} +1 -1
- package/dist/showcase/assets/{Separator-DOIh4aar.js → Separator-dQuencsA.js} +1 -1
- package/dist/showcase/assets/{ToolbarRootContext-BbugmthZ.js → ToolbarRootContext-BE0hbejq.js} +1 -1
- package/dist/showcase/assets/{accordion-CB4ePZYm.js → accordion-D93ZNsLn.js} +1 -1
- package/dist/showcase/assets/{accordion-variants-De2q5GIH.js → accordion-variants-Bl4bIQH4.js} +1 -1
- package/dist/showcase/assets/{action-menu-wJVcvfmC.js → action-menu--rEgMzDi.js} +1 -1
- package/dist/showcase/assets/{actions-BL1lpPFC.js → actions-3iedOWD9.js} +1 -1
- package/dist/showcase/assets/{activities-C578ZINa.js → activities-CyrAWFlu.js} +1 -1
- package/dist/showcase/assets/{activities-feed-card-BeXMgsNO.js → activities-feed-card-bhIATc2O.js} +1 -1
- package/dist/showcase/assets/{admin-DKJPb23G.js → admin-CZzNsj2q.js} +1 -1
- package/dist/showcase/assets/{ai-ewP8qLOJ.js → ai-CasHwkW4.js} +1 -1
- package/dist/showcase/assets/{ai-artifact-BaYtjrP5.js → ai-artifact-BgWvrLAb.js} +1 -1
- package/dist/showcase/assets/{ai-chat-DxxlaytU.js → ai-chat-seS9aW-1.js} +1 -1
- package/dist/showcase/assets/{ai-elements-BWraZPyC.js → ai-elements-Tku5_ous.js} +1 -1
- package/dist/showcase/assets/{ai-tool-call-Da4srLLe.js → ai-tool-call-BU6xbmXG.js} +1 -1
- package/dist/showcase/assets/{alert-CQI2pomK.js → alert-6Emt6KX2.js} +1 -1
- package/dist/showcase/assets/{alert-S12iMEhF.js → alert-B6aLWiRW.js} +1 -1
- package/dist/showcase/assets/{alert-xINZmLgm.js → alert-CtoTQ0vN.js} +1 -1
- package/dist/showcase/assets/{api-key-list-CL6je8dF.js → api-key-list-C0glWR3z.js} +1 -1
- package/dist/showcase/assets/{api-key-list-wxmuRN1m.js → api-key-list-DcWSbY3u.js} +1 -1
- package/dist/showcase/assets/{app-sidebar-LVtcgiT_.js → app-sidebar-D_eNP_jh.js} +1 -1
- package/dist/showcase/assets/arrow-down-qyKZ1H5j.js +1 -0
- package/dist/showcase/assets/arrow-left-C9I0h_su.js +1 -0
- package/dist/showcase/assets/arrow-right-DswaRsr6.js +1 -0
- package/dist/showcase/assets/arrow-up-5BijPOxK.js +1 -0
- package/dist/showcase/assets/arrow-up-right-CbVVNT6g.js +1 -0
- package/dist/showcase/assets/{avatar-Bv9x1eBh.js → avatar-BYHVCvVW.js} +1 -1
- package/dist/showcase/assets/{avatar-D29-FL5U.js → avatar-BlLAVC87.js} +1 -1
- package/dist/showcase/assets/{avatar-BEvs3dD_.js → avatar-DQTXjcS4.js} +1 -1
- package/dist/showcase/assets/{avatar-CC3R0R-x.js → avatar-DveZy09C.js} +1 -1
- package/dist/showcase/assets/{badge-B1YIk7bi.js → badge-Bth3mRTh.js} +1 -1
- package/dist/showcase/assets/{badge-check-DGmg0_g_.js → badge-check-DocF8Ho3.js} +1 -1
- package/dist/showcase/assets/{bell-Cq9n0a2v.js → bell-DXBoeAzi.js} +1 -1
- package/dist/showcase/assets/{bot-DxRjlJlO.js → bot-Ch-Y1HK8.js} +1 -1
- package/dist/showcase/assets/{box-CIh-_2DI.js → box-72m9QSDa.js} +1 -1
- package/dist/showcase/assets/{braces-BI_smuFG.js → braces-CC17X3TE.js} +1 -1
- package/dist/showcase/assets/{brain-BCAmDdGT.js → brain-Dvbla_5x.js} +1 -1
- package/dist/showcase/assets/{brand-CYmrK-FI.js → brand-D5ciAq8v.js} +1 -1
- package/dist/showcase/assets/{breadcrumb-DXOwTQNp.js → breadcrumb-BBCaOVyz.js} +1 -1
- package/dist/showcase/assets/{breadcrumb-DdDGc08y.js → breadcrumb-Bt8yVTCj.js} +1 -1
- package/dist/showcase/assets/{breadcrumbs-SwqzwYW_.js → breadcrumbs-CkVWfcAN.js} +1 -1
- package/dist/showcase/assets/{briefcase-CKrv_pkI.js → briefcase-8rQTJwpE.js} +1 -1
- package/dist/showcase/assets/{building-2-4f1nNGpT.js → building-2-CV7gTtXz.js} +1 -1
- package/dist/showcase/assets/{button-B9I1TrfQ.js → button-HGjoBio3.js} +1 -1
- package/dist/showcase/assets/{button-group-DUfRVZy2.js → button-group-LWToSCrp.js} +1 -1
- package/dist/showcase/assets/{buttons-Crl8nJKG.js → buttons-Bn_dX6Kk.js} +1 -1
- package/dist/showcase/assets/{calendar-4Uqeswbn.js → calendar-BTsffmY8.js} +1 -1
- package/dist/showcase/assets/{calendar-DxjW_eNc.js → calendar-Bhpyn4u0.js} +1 -1
- package/dist/showcase/assets/{calendar-Cl5l4Ip1.js → calendar-DjrUTKcD.js} +1 -1
- package/dist/showcase/assets/{calendar-days-DmDuaOAc.js → calendar-days-BKCkzWjV.js} +1 -1
- package/dist/showcase/assets/{camera-j8dT39qf.js → camera-EjpDG3mc.js} +1 -1
- package/dist/showcase/assets/{card-DRalKV4i.js → card-Bp6iGuOF.js} +1 -1
- package/dist/showcase/assets/{card-BQ_zBZlQ.js → card-CHc6AVFt.js} +1 -1
- package/dist/showcase/assets/card-primitives-Bv6XGPJd.js +1 -0
- package/dist/showcase/assets/{card-radio-group-Dq7AUPTp.js → card-radio-group-Ce9FsiSv.js} +1 -1
- package/dist/showcase/assets/{cards-MR2JolOy.js → cards-_CGG9zir.js} +1 -1
- package/dist/showcase/assets/{carousel-DMceNGDq.js → carousel-BVbsKH2W.js} +1 -1
- package/dist/showcase/assets/{cell-renderers-VbI9xEAd.js → cell-renderers-CosD6Gby.js} +1 -1
- package/dist/showcase/assets/{chart-DW4naldz.js → chart-CwOp8Sf8.js} +1 -1
- package/dist/showcase/assets/{chart-column-CbUwWFn7.js → chart-column-sz871NdJ.js} +1 -1
- package/dist/showcase/assets/{checkbox-BqwbtGCF.js → checkbox-BO38TYqr.js} +1 -1
- package/dist/showcase/assets/checkbox-W4MhlPlJ.js +1 -0
- package/dist/showcase/assets/chevron-down-BFh1Fz2P.js +1 -0
- package/dist/showcase/assets/chevron-left-C5_X5glO.js +1 -0
- package/dist/showcase/assets/chevron-up-DPH3boVS.js +1 -0
- package/dist/showcase/assets/chevrons-up-down-CM5mIDaw.js +1 -0
- package/dist/showcase/assets/circle-BFDzL1iF.js +1 -0
- package/dist/showcase/assets/{circle-alert-BObXfzSP.js → circle-alert-C6MbOB0m.js} +1 -1
- package/dist/showcase/assets/circle-check-C0X85t4j.js +1 -0
- package/dist/showcase/assets/circle-check-big-CBaodck_.js +1 -0
- package/dist/showcase/assets/circle-dot-DdRpIhnL.js +1 -0
- package/dist/showcase/assets/{circle-question-mark-BeRdyU_C.js → circle-question-mark-CKlcead7.js} +1 -1
- package/dist/showcase/assets/{circle-x-Dh3sb4UC.js → circle-x-MO44aKHe.js} +1 -1
- package/dist/showcase/assets/clock-3-CXQJFcbh.js +1 -0
- package/dist/showcase/assets/clock-GhBJJ6n1.js +1 -0
- package/dist/showcase/assets/{code-xml-q7JPxij0.js → code-xml-BSX7Qyi5.js} +1 -1
- package/dist/showcase/assets/{collapsible-DDV7VHy5.js → collapsible-CZLTO5EH.js} +1 -1
- package/dist/showcase/assets/{collapsible-BbiGHywy.js → collapsible-LrDO_sSQ.js} +1 -1
- package/dist/showcase/assets/{combobox-Dv_OkynR.js → combobox-TmDBXkM-.js} +1 -1
- package/dist/showcase/assets/{command-BSmiujfZ.js → command-9-r1qrJt.js} +1 -1
- package/dist/showcase/assets/{command-Cw81GF7c.js → command-DGne3l9s.js} +1 -1
- package/dist/showcase/assets/{comment-composer-C09JANlW.js → comment-composer-BI0qnvuY.js} +1 -1
- package/dist/showcase/assets/{comment-item-DsQshj1L.js → comment-item-Cedds6Lm.js} +1 -1
- package/dist/showcase/assets/{comments-CO3QCKyX.js → comments-De02NOns.js} +1 -1
- package/dist/showcase/assets/{commerce-BvnnX8Ui.js → commerce-DldtS83o.js} +1 -1
- package/dist/showcase/assets/{composite-BjZbcKJw.js → composite-BjZZlzzb.js} +1 -1
- package/dist/showcase/assets/{contact-card-Dq50G6UK.js → contact-card-muCZ3uXV.js} +1 -1
- package/dist/showcase/assets/{content-container-BQZdQhX2.js → content-container-BxSLICeL.js} +1 -1
- package/dist/showcase/assets/{copyable-BdfWxV6u.js → copyable-DYhhmTqM.js} +1 -1
- package/dist/showcase/assets/{copyable-lUNYfscm.js → copyable-MNU75-J9.js} +1 -1
- package/dist/showcase/assets/{course-card-BTIFY84q.js → course-card-Dl1wsuJx.js} +1 -1
- package/dist/showcase/assets/{cpu-CzkgJ-zb.js → cpu-CsWq4fcX.js} +1 -1
- package/dist/showcase/assets/{credit-card-D_wnXbTK.js → credit-card-B0AUZiWw.js} +1 -1
- package/dist/showcase/assets/{css-variables-BVjcOHGr.js → css-variables-Be7DzahT.js} +1 -1
- package/dist/showcase/assets/{currency-BCX6yQ2j.js → currency-BtPM_Xtw.js} +1 -1
- package/dist/showcase/assets/{dark-surfaces-BO6sWHrV.js → dark-surfaces-DRFERSEv.js} +1 -1
- package/dist/showcase/assets/{data-view-DqpNNGp5.js → data-view-DmWd0h7G.js} +2 -2
- package/dist/showcase/assets/{data-view-C8ThO9ha.js → data-view-DnLH2o0i.js} +1 -1
- package/dist/showcase/assets/{database-Ad0l2Bjl.js → database-C0YqGaQ_.js} +1 -1
- package/dist/showcase/assets/{date-block-CMKpiRdA.js → date-block-BQH25FLS.js} +1 -1
- package/dist/showcase/assets/{date-picker-CRogiefV.js → date-picker-BF-jevhh.js} +1 -1
- package/dist/showcase/assets/{date-pickers-CuRRGP-F.js → date-pickers-q2v3ajJm.js} +1 -1
- package/dist/showcase/assets/{dense-info-BL_cGFVK.js → dense-info-Cb-roqDU.js} +1 -1
- package/dist/showcase/assets/{design-system-consistency-BarrI2Uj.js → design-system-consistency-DMSJknaM.js} +1 -1
- package/dist/showcase/assets/{dialog-DbEG3v2T.js → dialog-C0ALRmbP.js} +1 -1
- package/dist/showcase/assets/{dialog-BEKecyE3.js → dialog-CbXon08k.js} +1 -1
- package/dist/showcase/assets/{display-utilities-CQRcCpjT.js → display-utilities-kBUVw7o3.js} +1 -1
- package/dist/showcase/assets/{dist-q3PLGr1_.js → dist-CTSkWj_M.js} +1 -1
- package/dist/showcase/assets/{dist-CS2Ky1_m.js → dist-W8bxVfew.js} +1 -1
- package/dist/showcase/assets/{dollar-sign-lghPxE96.js → dollar-sign-VNxVZleW.js} +1 -1
- package/dist/showcase/assets/{download-Cx5kUzHm.js → download-Ds_6eIpx.js} +1 -1
- package/dist/showcase/assets/{dropdown-menu-CXYQqRJA.js → dropdown-menu-C1G_y9dv.js} +1 -1
- package/dist/showcase/assets/{dropzone-DK0kBLfC.js → dropzone-CxOLmdkt.js} +1 -1
- package/dist/showcase/assets/{earth-BgJkqIAs.js → earth-HLyEI1oq.js} +1 -1
- package/dist/showcase/assets/{ellipsis-CP0hyAeS.js → ellipsis-BLyAd9A-.js} +1 -1
- package/dist/showcase/assets/{ellipsis-vertical-BdpRiDbb.js → ellipsis-vertical-TG4mYU2J.js} +1 -1
- package/dist/showcase/assets/{empty-CO_e2e_g.js → empty-B54k9xAG.js} +1 -1
- package/dist/showcase/assets/{empty-item-D39AT9RK.js → empty-item-BmA4rmq7.js} +1 -1
- package/dist/showcase/assets/{empty-state-Luba-tbF.js → empty-state-CH7gjjg7.js} +1 -1
- package/dist/showcase/assets/{empty-state-CTQjlkxC.js → empty-state-hUKvmKa-.js} +1 -1
- package/dist/showcase/assets/{enhanced-activities-e2k5R4sk.js → enhanced-activities-BRDVL9RR.js} +1 -1
- package/dist/showcase/assets/{enhanced-combobox-CY9QcVEl.js → enhanced-combobox-2wbQJS6R.js} +1 -1
- package/dist/showcase/assets/{esm-DPz8A4Wl.js → esm-CUTefMLr.js} +1 -1
- package/dist/showcase/assets/{event-calendar-DuQntfyO.js → event-calendar-Bf9xFZlt.js} +1 -1
- package/dist/showcase/assets/{event-log-B8B_0-q5.js → event-log-CeRDSL-h.js} +1 -1
- package/dist/showcase/assets/{example-Rrx9vj75.js → example-CJMJcnb4.js} +1 -1
- package/dist/showcase/assets/{external-link-BkCjE03j.js → external-link-CvXhYrnd.js} +1 -1
- package/dist/showcase/assets/{eye-BKhfxIeD.js → eye-Cl_GfUKH.js} +1 -1
- package/dist/showcase/assets/{feature-announcement-CRN6kk4B.js → feature-announcement-Dw0SokLo.js} +1 -1
- package/dist/showcase/assets/{file-BBUnjRPN.js → file-CJFWrwy1.js} +1 -1
- package/dist/showcase/assets/{file-text-Clv0qFr3.js → file-text-BTTFP8Jo.js} +1 -1
- package/dist/showcase/assets/{filter-layout-Bskvgeps.js → filter-layout-DUVqG5Ql.js} +1 -1
- package/dist/showcase/assets/{filters-DqE5xQEz.js → filters-BLcCaplV.js} +1 -1
- package/dist/showcase/assets/{flag-BQ0Brbw9.js → flag-BxI3EGPG.js} +1 -1
- package/dist/showcase/assets/{folder-open-CuUaUrxa.js → folder-open-4d8qsiAj.js} +1 -1
- package/dist/showcase/assets/{form-field-Dg_Az7lk.js → form-field-Dhy0eM5B.js} +1 -1
- package/dist/showcase/assets/{format-BnF8gL8z.js → format-zGqa9Olc.js} +1 -1
- package/dist/showcase/assets/{forms-D2SGtkKv.js → forms-D99qG5Gb.js} +1 -1
- package/dist/showcase/assets/{funnel-qCC9cfXa.js → funnel-Cg7SOShf.js} +1 -1
- package/dist/showcase/assets/{generic-0wwhvFWa.js → generic-CfrG943t.js} +1 -1
- package/dist/showcase/assets/{getPseudoElementBounds-DyTpOaBA.js → getPseudoElementBounds-lw5shsdM.js} +1 -1
- package/dist/showcase/assets/{gift-ibO6X3CO.js → gift-BXtKbzvA.js} +1 -1
- package/dist/showcase/assets/{giftcard-cards-BJ0gmgv0.js → giftcard-cards-CqYaN0jC.js} +1 -1
- package/dist/showcase/assets/{git-branch-QLvR3_wX.js → git-branch-BWAuIMOQ.js} +1 -1
- package/dist/showcase/assets/{global-search-BtYqFKyN.js → global-search-CHUva8pR.js} +1 -1
- package/dist/showcase/assets/{global-search-B2zvjiO2.js → global-search-Df7JovOG.js} +1 -1
- package/dist/showcase/assets/{globe-Byoz7QmA.js → globe-CvIW_foU.js} +1 -1
- package/dist/showcase/assets/{gradient-card-CymI8itB.js → gradient-card-CdM2J1Hv.js} +1 -1
- package/dist/showcase/assets/{hash-DL-sHZny.js → hash-wBs5gyr_.js} +1 -1
- package/dist/showcase/assets/{header-C9RMgEgD.js → header-DXPFmpUT.js} +1 -1
- package/dist/showcase/assets/{header-notifications-BT643QVK.js → header-notifications-FsnCJLpe.js} +1 -1
- package/dist/showcase/assets/{heart-gHsYuS4V.js → heart-B4fOMIr6.js} +1 -1
- package/dist/showcase/assets/{hooks-Dj4gswMj.js → hooks-DtMOMalj.js} +1 -1
- package/dist/showcase/assets/{house-Dew9jimg.js → house-hebmAxEE.js} +1 -1
- package/dist/showcase/assets/{icon-badge-GMIN-bca.js → icon-badge-DrZ5qGpa.js} +1 -1
- package/dist/showcase/assets/{icon-badge-C-mGQdGQ.js → icon-badge-JEug_P_U.js} +1 -1
- package/dist/showcase/assets/{image-Cda8layy.js → image-CxNywgkb.js} +1 -1
- package/dist/showcase/assets/{inbox-hJEV8TEx.js → inbox-DqAmGdDd.js} +1 -1
- package/dist/showcase/assets/index-DujM0kEF.css +2 -0
- package/dist/showcase/assets/{index-o71HAmc3.js → index-jD-KSiHu.js} +2 -2
- package/dist/showcase/assets/inertValue-Dg9TwvOb.js +1 -0
- package/dist/showcase/assets/{info-B4aULRpz.js → info-B5fZn_ZC.js} +1 -1
- package/dist/showcase/assets/{inline-stat-CDQocPgN.js → inline-stat-CklKufoA.js} +1 -1
- package/dist/showcase/assets/{inline-stat-BzXB3FNC.js → inline-stat-Dep7oHIi.js} +1 -1
- package/dist/showcase/assets/{input-CYTQ9nWN.js → input-CkNgwwCs.js} +1 -1
- package/dist/showcase/assets/{input-CLysAarX.js → input-DAPMRlKO.js} +1 -1
- package/dist/showcase/assets/{input-group-DYMTMed1.js → input-group-06D68uB6.js} +1 -1
- package/dist/showcase/assets/{input-group-DtkAnPaQ.js → input-group-Bq9aXQPG.js} +1 -1
- package/dist/showcase/assets/{inputs-C2flJn12.js → inputs-C8G3y-zR.js} +1 -1
- package/dist/showcase/assets/{installation-CCvBKDNO.js → installation-BV5xOvoE.js} +1 -1
- package/dist/showcase/assets/{invoice-header-C1G_aVIm.js → invoice-header-BcUxzT68.js} +1 -1
- package/dist/showcase/assets/{invoice-items-Ak0CMjDh.js → invoice-items-B42Jfxl7.js} +1 -1
- package/dist/showcase/assets/{invoice-mini-B7Dda49y.js → invoice-mini-RJGdlErg.js} +1 -1
- package/dist/showcase/assets/{invoice-table-Bl9InDl0.js → invoice-table--MdP6ysv.js} +1 -1
- package/dist/showcase/assets/isSameDay-srttAIjD.js +1 -0
- package/dist/showcase/assets/isToday-BPub5Zvi.js +1 -0
- package/dist/showcase/assets/{italic-CJzEjX5j.js → italic-1BNA_XlU.js} +1 -1
- package/dist/showcase/assets/{item-BL_Y_0ou.js → item-B9KyqUGa.js} +1 -1
- package/dist/showcase/assets/{item-nf1zOtF7.js → item-DoIlPm6J.js} +1 -1
- package/dist/showcase/assets/{item-Oe2aHuvr.js → item-ffIfXEGd.js} +1 -1
- package/dist/showcase/assets/{kanban-CB5Hghoo.js → kanban-Cfad3edR.js} +1 -1
- package/dist/showcase/assets/{key-round-BQwcojkz.js → key-round-J11Zc216.js} +1 -1
- package/dist/showcase/assets/{label-HtkE4eII.js → label-DqaB8ZB2.js} +1 -1
- package/dist/showcase/assets/{languages-69N5-h2e.js → languages-D9UaP3QU.js} +1 -1
- package/dist/showcase/assets/{layers-CBPYgoAb.js → layers-QXZ9Jfej.js} +1 -1
- package/dist/showcase/assets/{layout-app-shell-BfNh8jd0.js → layout-app-shell-CW1eRJmU.js} +1 -1
- package/dist/showcase/assets/{layout-auth-Ct29XkSH.js → layout-auth-j4K6lveg.js} +1 -1
- package/dist/showcase/assets/{layout-containers-DWN4xKbf.js → layout-containers-NclLtsV0.js} +1 -1
- package/dist/showcase/assets/{layout-header-DUX4zFrH.js → layout-header-B8AOTiwL.js} +1 -1
- package/dist/showcase/assets/{layout-page-CsqULW71.js → layout-page-DM79QHyW.js} +1 -1
- package/dist/showcase/assets/{layout-primitives-CQJ0_wTo.js → layout-primitives-Dyop-WMt.js} +1 -1
- package/dist/showcase/assets/{layout-sidebar-la-tC4xZ.js → layout-sidebar-uBNaHqjD.js} +1 -1
- package/dist/showcase/assets/{layout-users-6fAYxZ3Z.js → layout-users-BkhDiOOz.js} +1 -1
- package/dist/showcase/assets/{layout-workspace-BbDOjmrE.js → layout-workspace-C2hSimZW.js} +1 -1
- package/dist/showcase/assets/{lib-C46V0Rr-.js → lib-CDssULuD.js} +1 -1
- package/dist/showcase/assets/{list-checks-BkQYzehf.js → list-checks-DA2jqXdm.js} +1 -1
- package/dist/showcase/assets/{lock-CMrS2EKU.js → lock-BDZLNQLR.js} +1 -1
- package/dist/showcase/assets/{lock-keyhole-B1BEkNvm.js → lock-keyhole-CWYENd9O.js} +1 -1
- package/dist/showcase/assets/{mail-Bo_4xDQw.js → mail-CCdaRmft.js} +1 -1
- package/dist/showcase/assets/{mail-check-BprACMug.js → mail-check-DZF1VbCX.js} +1 -1
- package/dist/showcase/assets/{map-Br-xZYf0.js → map-CDFEmmZH.js} +3 -3
- package/dist/showcase/assets/{map-pin-COrIVMWa.js → map-pin-CdV-R6nt.js} +1 -1
- package/dist/showcase/assets/{media-library-DyPu-kR9.js → media-library-BJyn1s9d.js} +1 -1
- package/dist/showcase/assets/{mention-inline-suggestions-BTunE4RJ.js → mention-inline-suggestions-DPO6FhXx.js} +1 -1
- package/dist/showcase/assets/{mentions-BXSq2eCS.js → mentions-DtWHbcS6.js} +1 -1
- package/dist/showcase/assets/{menus-USrp5qP5.js → menus-BmjngFE4.js} +1 -1
- package/dist/showcase/assets/{message-square-Cyrr-QgJ.js → message-square-bM29txT3.js} +1 -1
- package/dist/showcase/assets/{metadata-list-BJTye3J8.js → metadata-list-DvYTAJri.js} +1 -1
- package/dist/showcase/assets/metadata-list-xVUTVyy9.js +1 -0
- package/dist/showcase/assets/{metric-DdC_pWnF.js → metric-BPNCh4eA.js} +1 -1
- package/dist/showcase/assets/{metric-bar-PGG8KQS0.js → metric-bar-BX4sCMrM.js} +1 -1
- package/dist/showcase/assets/{metric-grid-ZqDufV_5.js → metric-grid-IyHP3nmU.js} +1 -1
- package/dist/showcase/assets/{metric-trend-chip-BhCRReMp.js → metric-trend-chip-Dih8eR17.js} +1 -1
- package/dist/showcase/assets/{metrics-analytics-bar-U3gehGfQ.js → metrics-analytics-bar-DK16RNMs.js} +1 -1
- package/dist/showcase/assets/{metrics-analytics-cards-CzbLGAWi.js → metrics-analytics-cards-Byyl13YT.js} +1 -1
- package/dist/showcase/assets/{metrics-comparison-B1z3nUpo.js → metrics-comparison-DGHFMBL-.js} +1 -1
- package/dist/showcase/assets/{metrics-heatmap-DZeqRxFz.js → metrics-heatmap-Bl6C7i0j.js} +1 -1
- package/dist/showcase/assets/{metrics-inline-badge-CPyhCHXj.js → metrics-inline-badge-Bz79zbNK.js} +1 -1
- package/dist/showcase/assets/{metrics-kpi-row-COVuNReW.js → metrics-kpi-row-DzZ9dRFY.js} +1 -1
- package/dist/showcase/assets/{metrics-micro-grid-BNSrw6sM.js → metrics-micro-grid-DyoQiuzr.js} +1 -1
- package/dist/showcase/assets/{metrics-overview-3IHComMd.js → metrics-overview-DoyHPEZw.js} +1 -1
- package/dist/showcase/assets/{metrics-stat-cards-6Owbjvmc.js → metrics-stat-cards-B1b7NFqW.js} +1 -1
- package/dist/showcase/assets/minus-BE2L5hVc.js +1 -0
- package/dist/showcase/assets/{money-display-CUkeS9k1.js → money-display-CXQ_8LfA.js} +1 -1
- package/dist/showcase/assets/{month-year-picker-CCCTmZHv.js → month-year-picker-ra8FEN8F.js} +1 -1
- package/dist/showcase/assets/{navigation-BUReVn4R.js → navigation-CFfVZQJ1.js} +1 -1
- package/dist/showcase/assets/{navigation-CSzYKdcR.js → navigation-Da0MVkqr.js} +1 -1
- package/dist/showcase/assets/{navigation-extras-DmUhDPMz.js → navigation-extras-LpsdoXfx.js} +1 -1
- package/dist/showcase/assets/{onboarding-checklist-C3JhV5Gb.js → onboarding-checklist-DPNatNOk.js} +1 -1
- package/dist/showcase/assets/{overflow-tab-bar-CEdrls-W.js → overflow-tab-bar-C0vTzcEY.js} +1 -1
- package/dist/showcase/assets/{overlays-C1UodoAu.js → overlays-Blmbun0J.js} +1 -1
- package/dist/showcase/assets/{overlays-BKKEzmF4.js → overlays-t0joc10Y.js} +1 -1
- package/dist/showcase/assets/{overview-Dq0MqK32.js → overview-Ckq8vbOR.js} +1 -1
- package/dist/showcase/assets/{package-BaQGBJmO.js → package-Cjod_a06.js} +1 -1
- package/dist/showcase/assets/{package-check-C8HJfDxS.js → package-check-JRHaNnkl.js} +1 -1
- package/dist/showcase/assets/{page-DvMaeo43.js → page-9xr7xnuW.js} +1 -1
- package/dist/showcase/assets/page-action-button-BRXnfsEx.js +1 -0
- package/dist/showcase/assets/{page-header-Y-96EPMp.js → page-header-Bdlxfn_9.js} +1 -1
- package/dist/showcase/assets/{pagination-yLAHxKpc.js → pagination-CeaYhOvv.js} +1 -1
- package/dist/showcase/assets/{pagination-Br1AfDte.js → pagination-DdZZHvNF.js} +1 -1
- package/dist/showcase/assets/{paperclip-BBDKiZeH.js → paperclip-BRM-yXTB.js} +1 -1
- package/dist/showcase/assets/{password-input-iwrucadb.js → password-input-1FVEugoO.js} +1 -1
- package/dist/showcase/assets/{pencil-BUhkJ_Nn.js → pencil-DiG2dQ8F.js} +1 -1
- package/dist/showcase/assets/{phone-DtJDFH70.js → phone-BREyNZN-.js} +1 -1
- package/dist/showcase/assets/plus-CQcelTNc.js +1 -0
- package/dist/showcase/assets/{popover-C8YAdHfL.js → popover-Czmwspmc.js} +1 -1
- package/dist/showcase/assets/{popover-menu-C5M9Up4M.js → popover-menu-beuCaiLt.js} +1 -1
- package/dist/showcase/assets/{popover-D9ZDWqLl.js → popover-uqk7myG2.js} +1 -1
- package/dist/showcase/assets/{products-DrKTk8Aw.js → products-DGNqIbLs.js} +1 -1
- package/dist/showcase/assets/{progress-CpD58Wl0.js → progress-D76Df908.js} +1 -1
- package/dist/showcase/assets/{progress-C1qKfCZB.js → progress-DjUprSDD.js} +1 -1
- package/dist/showcase/assets/{props-table-C6gPyO49.js → props-table-DoDq8Mvr.js} +1 -1
- package/dist/showcase/assets/{quote-BXTU9evS.js → quote-BvGGgyJ0.js} +1 -1
- package/dist/showcase/assets/{receipt-Dwc4p04P.js → receipt-rgnlMgyi.js} +1 -1
- package/dist/showcase/assets/{receipt-text-DBEu6Gym.js → receipt-text-CBQrVlnU.js} +1 -1
- package/dist/showcase/assets/{refinement-guide-DeO_yM8U.js → refinement-guide-B_BpIMxm.js} +1 -1
- package/dist/showcase/assets/{refresh-cw-BpV3OG_s.js → refresh-cw-C-yHy6B7.js} +1 -1
- package/dist/showcase/assets/{resolveValueLabel-DZTrDdG0.js → resolveValueLabel-0bwEvIG-.js} +1 -1
- package/dist/showcase/assets/{resource-BLGoRFou.js → resource-8f61BZ8t.js} +1 -1
- package/dist/showcase/assets/{resource-D5AQesdN.js → resource-BEh6R0gu.js} +1 -1
- package/dist/showcase/assets/{resource-selector-card-BKzeUE0k.js → resource-selector-card-DJwXY_Ms.js} +1 -1
- package/dist/showcase/assets/{rich-text-editor-k1dtT5bX.js → rich-text-editor-D433iv0N.js} +1 -1
- package/dist/showcase/assets/{rich-text-editor-DYkPamiq.js → rich-text-editor-vTRfWsOK.js} +1 -1
- package/dist/showcase/assets/rotate-ccw-JuE4H14F.js +1 -0
- package/dist/showcase/assets/{route-5uO9C0gV.js → route-eSu1bFNn.js} +1 -1
- package/dist/showcase/assets/{save-DONvClxa.js → save-Bpjj-rBP.js} +1 -1
- package/dist/showcase/assets/{schema-form-BMQmx4JI.js → schema-form-DmOpxd96.js} +1 -1
- package/dist/showcase/assets/{scroll-area-CxwfyjX3.js → scroll-area-B9OdCBy9.js} +1 -1
- package/dist/showcase/assets/{scroll-area-CnAyhKQ_.js → scroll-area-BH80l2As.js} +1 -1
- package/dist/showcase/assets/{section-Dd6X6IKg.js → section-BPNIPavy.js} +1 -1
- package/dist/showcase/assets/{select-CJSyu7sS.js → select-BauiG1a3.js} +1 -1
- package/dist/showcase/assets/{select-Du9VvUxt.js → select-CPopSr5c.js} +1 -1
- package/dist/showcase/assets/{send-3ANJL7UB.js → send-DNCcBKXs.js} +1 -1
- package/dist/showcase/assets/{separator-BiXjWmP-.js → separator-BK0beCOv.js} +1 -1
- package/dist/showcase/assets/{separator-y9i6EG-N.js → separator-CKM9A-mm.js} +1 -1
- package/dist/showcase/assets/{settings-2-Ynd1Lcz4.js → settings-2-B8fz7JZB.js} +1 -1
- package/dist/showcase/assets/{settings-CqdZB-OI.js → settings-Cy2y3sQw.js} +1 -1
- package/dist/showcase/assets/{sheet-CzFOcAwE.js → sheet-C7VWkXE1.js} +1 -1
- package/dist/showcase/assets/{shield-Dmxwcn3w.js → shield-ClPev4gS.js} +1 -1
- package/dist/showcase/assets/{shield-alert-RrMsBuWp.js → shield-alert-6XO5YZ5u.js} +1 -1
- package/dist/showcase/assets/{shield-check-Bnw8RAvI.js → shield-check-DSfGVZq0.js} +1 -1
- package/dist/showcase/assets/{shopping-bag-DGXTQNOf.js → shopping-bag-DzMrGvpF.js} +1 -1
- package/dist/showcase/assets/{showcase-DMRZCqmg.js → showcase-DuZaO6q9.js} +1 -1
- package/dist/showcase/assets/{sidebar-C0tsWnrh.js → sidebar-7y9EQYWf.js} +1 -1
- package/dist/showcase/assets/{sidebar.context-DXGEPgaT.js → sidebar.context-DUheJD8t.js} +1 -1
- package/dist/showcase/assets/{skeleton-BFa4FHSC.js → skeleton-Dgr8Vabr.js} +1 -1
- package/dist/showcase/assets/{skeleton-DOJ1RAcJ.js → skeleton-HSpErFqw.js} +1 -1
- package/dist/showcase/assets/{slider-BjQs0C8N.js → slider-B7f81APg.js} +1 -1
- package/dist/showcase/assets/{smart-card-BwSFemlj.js → smart-card-p97LLZCW.js} +1 -1
- package/dist/showcase/assets/{sonner-BXMIK3eQ.js → sonner-CWazrN19.js} +1 -1
- package/dist/showcase/assets/{sortable.esm-BeBA3gT5.js → sortable.esm-uufol7Mz.js} +1 -1
- package/dist/showcase/assets/{sparkles-Bc0I4qTf.js → sparkles-Z4V23xKK.js} +1 -1
- package/dist/showcase/assets/{spinner-mtwVRe8M.js → spinner-BUgjAjWE.js} +1 -1
- package/dist/showcase/assets/{spinner-HyNCtTyd.js → spinner-CXu7z8-j.js} +1 -1
- package/dist/showcase/assets/{spinner-LskR5l9T.js → spinner-DCwR0mnD.js} +1 -1
- package/dist/showcase/assets/{square-pen-BrZ2OxTe.js → square-pen-jwp_OWMQ.js} +1 -1
- package/dist/showcase/assets/{stacked-avatars-DOAFRjmZ.js → stacked-avatars-CHEpTotO.js} +1 -1
- package/dist/showcase/assets/{star-lUSxI166.js → star-Ck8Lg5hm.js} +1 -1
- package/dist/showcase/assets/startOfDay-BzULZHy4.js +1 -0
- package/dist/showcase/assets/{styles-COpnijXU.js → styles-CNYitflH.js} +1 -1
- package/dist/showcase/assets/{suggestions-ftPYc9p6.js → suggestions-CSF9MlKl.js} +1 -1
- package/dist/showcase/assets/{switch-DirKCDsg.js → switch-BX9KSLIF.js} +1 -1
- package/dist/showcase/assets/{switch-DoPIN_UN.js → switch-Bn0WaWa9.js} +1 -1
- package/dist/showcase/assets/{sync-C2DEiaQz.js → sync-BuKBnqWW.js} +1 -1
- package/dist/showcase/assets/{table-Dex8CcfW.js → table-DNJcLaud.js} +42 -20
- package/dist/showcase/assets/{table-D6GywZEx.js → table-NfpOWGsG.js} +1 -1
- package/dist/showcase/assets/{table-actions-CJg82sW0.js → table-actions-Ci9Yszp0.js} +1 -1
- package/dist/showcase/assets/{tabs-C0fSpkON.js → tabs-CYNFQdIr.js} +1 -1
- package/dist/showcase/assets/{tabs-B9tgdMRD.js → tabs-Cm_p6znb.js} +1 -1
- package/dist/showcase/assets/{tags-input-CJSpILy6.js → tags-input-DE4QZqS_.js} +1 -1
- package/dist/showcase/assets/{text-button-CoPZBQiq.js → text-button-D9llh4pU.js} +1 -1
- package/dist/showcase/assets/{text-link-d9JIRU2N.js → text-link-ZT6QGJOL.js} +1 -1
- package/dist/showcase/assets/{textarea-BN4PUX-V.js → textarea-CgcHuGVq.js} +1 -1
- package/dist/showcase/assets/{textarea-CBhdtg5X.js → textarea-D2uT_GJt.js} +1 -1
- package/dist/showcase/assets/{timelines-F_mzbAPA.js → timelines-BEFO7tJ0.js} +1 -1
- package/dist/showcase/assets/{toggle-group-8ESepeYW.js → toggle-group-oYpa59lN.js} +1 -1
- package/dist/showcase/assets/{toggles-B2Cg5NVG.js → toggles-BL93YmQo.js} +1 -1
- package/dist/showcase/assets/{toggles-group-BTmtSzAa.js → toggles-group-BG-xiQCY.js} +1 -1
- package/dist/showcase/assets/{tooltip-DNsHZ3ZE.js → tooltip-BMI7zHwP.js} +1 -1
- package/dist/showcase/assets/{trash-2-Bf5dpRjn.js → trash-2-CtRtVsCy.js} +1 -1
- package/dist/showcase/assets/trending-up-2NQ-P8vB.js +1 -0
- package/dist/showcase/assets/{truck-CqmeajvP.js → truck-Cl0nyN_j.js} +1 -1
- package/dist/showcase/assets/{typography-DJjQO_Ld.js → typography-C7pCPhg7.js} +1 -1
- package/dist/showcase/assets/{ui-badge-BwkZfeBs.js → ui-badge-BvmuMzSq.js} +1 -1
- package/dist/showcase/assets/{ui-card-B3mtVa60.js → ui-card-B7ziOMAn.js} +1 -1
- package/dist/showcase/assets/{ui-table-DM-avYTi.js → ui-table-BEFHakBU.js} +1 -1
- package/dist/showcase/assets/{upload-tray-CFI_7lcB.js → upload-tray-CMKqTtEp.js} +1 -1
- package/dist/showcase/assets/{use-layout-link-BI4MRSHG.js → use-layout-link-nEU6ctSs.js} +1 -1
- package/dist/showcase/assets/{useAnchoredPopupScrollLock-DRs8fnir.js → useAnchoredPopupScrollLock-B1xyKMh7.js} +1 -1
- package/dist/showcase/assets/{useAriaLabelledBy-DhgmwFn7.js → useAriaLabelledBy-BMlFgz-H.js} +1 -1
- package/dist/showcase/assets/{useCollapsiblePanel-vGthv_MA.js → useCollapsiblePanel-BEzH6TC2.js} +1 -1
- package/dist/showcase/assets/{useCompositeItem-g1FeYTbw.js → useCompositeItem-CIuww7-p.js} +1 -1
- package/dist/showcase/assets/{useCompositeListItem-CyULeWSL.js → useCompositeListItem-PrMTh4tz.js} +1 -1
- package/dist/showcase/assets/{useLabelableId-CBWpOnwZ.js → useLabelableId-BBLkeLGr.js} +1 -1
- package/dist/showcase/assets/{useOpenInteractionType-CQSuD7yw.js → useOpenInteractionType-CW0quo3l.js} +1 -1
- package/dist/showcase/assets/useRender-6NNMHJJU.js +1 -0
- package/dist/showcase/assets/{useTriggerFocusGuards-B6KAsVMk.js → useTriggerFocusGuards-DEza_iee.js} +1 -1
- package/dist/showcase/assets/{useValueChanged-DXek_Wx7.js → useValueChanged-BmWIb3SN.js} +1 -1
- package/dist/showcase/assets/user-BDIP5UPS.js +1 -0
- package/dist/showcase/assets/{user-plus-C69GplWt.js → user-plus-BCqHFh2h.js} +1 -1
- package/dist/showcase/assets/{users-DDgUGkgw.js → users-Bh7xGRX2.js} +1 -1
- package/dist/showcase/assets/{vendor-profile-Zfh99jtA.js → vendor-profile-BlYcRbPI.js} +1 -1
- package/dist/showcase/assets/{video-CDERYmRS.js → video-BucshqNW.js} +1 -1
- package/dist/showcase/assets/{wrench-PjtfaRuJ.js → wrench-DQvhyTEb.js} +1 -1
- package/dist/showcase/assets/x-DyuS4YRT.js +1 -0
- package/dist/showcase/assets/{zap-CzjU6LH0.js → zap-Dpn8_pnQ.js} +1 -1
- package/dist/showcase/index.html +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/_shared/cards-BKFwMTjM.cjs +0 -2
- package/dist/_shared/cards-BKFwMTjM.cjs.map +0 -1
- package/dist/_shared/cards-CtBoSZG9.js.map +0 -1
- package/dist/_shared/table-CUA_A-oO.js.map +0 -1
- package/dist/_shared/table-mPchjiRn.cjs +0 -2
- package/dist/_shared/table-mPchjiRn.cjs.map +0 -1
- package/dist/showcase/assets/arrow-down-JuqwH6gj.js +0 -1
- package/dist/showcase/assets/arrow-left-BFq65-Ch.js +0 -1
- package/dist/showcase/assets/arrow-right-B4iFg3l1.js +0 -1
- package/dist/showcase/assets/arrow-up-RWJP_FHU.js +0 -1
- package/dist/showcase/assets/arrow-up-right-DdWl37XF.js +0 -1
- package/dist/showcase/assets/card-primitives-Bn6nhqUA.js +0 -1
- package/dist/showcase/assets/checkbox-BJ1yDAQ3.js +0 -1
- package/dist/showcase/assets/chevron-down-CBa5t2E0.js +0 -1
- package/dist/showcase/assets/chevron-left-Dqne-r3m.js +0 -1
- package/dist/showcase/assets/chevron-up-DiMFydbr.js +0 -1
- package/dist/showcase/assets/chevrons-up-down-umMKLBIL.js +0 -1
- package/dist/showcase/assets/circle-check-BPhdxh7K.js +0 -1
- package/dist/showcase/assets/circle-check-big-BsQpd0CS.js +0 -1
- package/dist/showcase/assets/circle-dbSBYjvr.js +0 -1
- package/dist/showcase/assets/circle-dot-Bj1an-fp.js +0 -1
- package/dist/showcase/assets/clock-3-R65SwQwa.js +0 -1
- package/dist/showcase/assets/clock-BApGqXwn.js +0 -1
- package/dist/showcase/assets/index-CCxHwV7T.css +0 -2
- package/dist/showcase/assets/inertValue-BRyHstYf.js +0 -1
- package/dist/showcase/assets/isSameDay-Bd_8WAf0.js +0 -1
- package/dist/showcase/assets/isToday-DSGtoEUa.js +0 -1
- package/dist/showcase/assets/metadata-list-CoRYXjEw.js +0 -1
- package/dist/showcase/assets/minus-CwzskYaZ.js +0 -1
- package/dist/showcase/assets/page-action-button-B5ZGYpYy.js +0 -1
- package/dist/showcase/assets/plus-4gOvUk-5.js +0 -1
- package/dist/showcase/assets/rotate-ccw-Dajwztf1.js +0 -1
- package/dist/showcase/assets/startOfDay-BLhx9b6k.js +0 -1
- package/dist/showcase/assets/trending-up-RSklVrcZ.js +0 -1
- package/dist/showcase/assets/useRender-Dm8qJkvr.js +0 -1
- package/dist/showcase/assets/user-B35DABNz.js +0 -1
- package/dist/showcase/assets/x-FNPo6qUv.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-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-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
|
|
@@ -6,7 +6,7 @@ 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-
|
|
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,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-
|
|
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-
|
|
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-
|
|
13
|
-
import { a as y, i as b, m as x } from "../../../_shared/data-display-
|
|
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-
|
|
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-
|
|
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-
|
|
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) {
|
|
@@ -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/cards-BKFwMTjM.cjs"),a=require("../../../_shared/input-CB6hxh-5.cjs"),o=require("../../../_shared/forms-rmKcy5uO.cjs"),s=require("../../../_shared/textarea-B24qgdmd.cjs"),c=require("../../../_shared/display-Bin2vVex.cjs"),l=require("../../../_shared/card-radio-group-C2p_iBal.cjs");let u=require("react"),d=require("react/jsx-runtime");var f={1:`grid grid-cols-1 gap-4`,2:`grid grid-cols-1 gap-4 md:grid-cols-2`,3:`grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`},p={auto:``,half:`md:col-span-1`,third:`xl:col-span-1`,full:`md:col-span-full xl:col-span-full`};function m(e,t,n){if(typeof e.hidden==`function`)try{return e.hidden(t)}catch(e){return n?.(e),!1}return e.hidden??!1}function h(e,t,n){if(typeof e.disabled==`function`)try{return e.disabled(t)}catch(e){return n?.(e),!0}return e.disabled??!1}function g(e,t,n){return e.filter(e=>!m(e,t,n))}function _(e,t,n,r,i){let a=g(e.fields,t,i),o=new Map(a.map(e=>[e.key,e])),s=new Set,c=[];for(let t of e.sections??[]){let e=t.fields?t.fields.map(e=>o.get(e)).filter(e=>e!==void 0):a.filter(e=>e.sectionId===t.id);for(let t of e)s.add(t.key);c.push({id:t.id,title:t.title,description:t.description,icon:t.icon,fields:e,columns:t.columns??r,footerSlot:t.footerSlot,className:t.className})}let l=a.filter(e=>!s.has(e.key));return(l.length>0||c.length===0)&&c.unshift({id:`default`,title:e.sections?.length?n:void 0,fields:l,columns:r}),c.filter(e=>e.fields.length>0)}function v(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e)}function y(e){return Array.isArray(e)?e.map(e=>String(e)):[]}function b(e){return e===!0||e===`true`||e===1}function x(e,t=!1){let n=e.trim();if(n.length===0)return null;let r=t?Number.parseInt(n,10):Number.parseFloat(n);return Number.isNaN(r)?null:r}function S(e,t=2){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,t)}catch{return String(e)}}function C(e){let t=e.trim();if(t.length===0)return{value:null,valid:!0};try{return{value:JSON.parse(t),valid:!0}}catch{return{value:e,valid:!1}}}function w(e,t){let n={...t??{}};for(let t of e)t.defaultValue!==void 0&&n[t.key]===void 0&&(n[t.key]=t.defaultValue);return n}function T(e){return e==null?!0:typeof e==`string`?e.trim().length===0:Array.isArray(e)?e.length===0:!1}function E(e){let t={};for(let[n,r]of Object.entries(e??{}))r&&(t[n]=r);return t}function D({fields:e,value:t,defaultValue:n,errors:r,onValueChange:i,onFieldChange:a,formatRequiredError:o,validationError:s,onError:c}){let l=t!==void 0,d=(0,u.useMemo)(()=>w(e,n),[n,e]),[f,p]=(0,u.useState)(()=>d),[h,g]=(0,u.useState)({}),_=(0,u.useMemo)(()=>l?{...d,...t??{}}:f,[d,f,l,t]),v=(0,u.useMemo)(()=>({...h,...E(r)}),[r,h]),y=(0,u.useCallback)(e=>{l||p(e),i?.(e)},[l,i]),b=(0,u.useCallback)((e,t)=>{let n={..._,[e]:t};l||p(n),g(t=>{if(!t[e])return t;let n={...t};return delete n[e],n}),a?.(e,t,n),i?.(n)},[l,a,i,_]),x=(0,u.useCallback)(()=>{let t=w(e,n);return l||p(t),g({}),i?.(t),t},[n,e,l,i]),S=(0,u.useCallback)(()=>{let t={};for(let n of e){if(m(n,_,c))continue;let e=_[n.key];if(n.required&&T(e)){t[n.key]=o(n.label);continue}let r=Array.isArray(n.validate)?n.validate:n.validate?[n.validate]:[];for(let i of r)try{let r=i(e,_,n);if(typeof r==`string`&&r.length>0){t[n.key]=r;break}}catch(e){c?.(e),t[n.key]=s;break}}return g(t),Object.keys(t).length===0},[e,o,c,s,_]);return{values:_,errors:v,getFieldError:(0,u.useCallback)(e=>v[e],[v]),getFieldValue:(0,u.useCallback)(e=>_[e],[_]),setFieldValue:b,setValues:y,reset:x,validate:S}}function O({submitLabel:e,resetLabel:r,showReset:i=!1,disabled:a=!1,submitDisabled:o=!1,resetDisabled:s=!1,isSubmitting:c=!1,onReset:l,className:u}){return(0,d.jsxs)(`div`,{className:t.cn(`schema-form-actions--component flex items-center justify-end gap-2`,u),children:[!!i&&(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`outline`,disabled:a||s||c,onClick:l,children:r}),(0,d.jsx)(n.t,{type:`submit`,variant:`primary`,loading:c,disabled:a||o,children:e})]})}O.displayName=`SchemaFormActions`;function k({title:e,description:n,className:i}){return(0,d.jsxs)(`div`,{className:t.cn(`schema-form-empty--component rounded-md border border-dashed border-border bg-muted/20 p-6 text-center`,i),children:[(0,d.jsx)(r.s,{weight:`semibold`,children:e}),(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-1`,children:n})]})}k.displayName=`SchemaFormEmpty`;function A(e){return e.hint??e.description}function j(e,t,n,r){if(e.formatValue)try{return e.formatValue(t,n)}catch(e){r?.(e)}return v(t)}function M(e,t,n,r){if(e.parseValue)try{return e.parseValue(t,n)}catch(e){r?.(e)}return t}function N(e,t,n,r,i){if(e.parseValue)try{return e.parseValue(t,n)}catch(e){i?.(e)}return x(t,r)}function P(e,t,n,r){if(e.type===`json`&&e.parseValue)try{return{value:e.parseValue(t,n),valid:!0}}catch(e){return r?.(e),{value:t,valid:!1}}return C(t)}function F(e){if(!e.icon)return;let t=e.icon;return(0,d.jsx)(t,{className:`size-4`,"aria-hidden":`true`})}function I({field:e,value:n,values:r,error:i,disabled:a,fieldId:o,onValueChange:l,onError:f,strings:p}){let m=e.type===`json`?e.jsonIndent??2:2,[h,g]=(0,u.useState)(()=>S(n,m)),[_,v]=(0,u.useState)(),[y,b]=(0,u.useState)(!1);if((0,u.useEffect)(()=>{y||g(S(n,m))},[m,y,n]),e.type!==`json`)return null;let x=t=>{let n=P(e,t,r,f);return v(n.valid?void 0:p.jsonParseError),l(n.value),n};return(0,d.jsx)(c.D,{label:e.label,required:e.required,hint:A(e),helperText:e.helperText,error:i??_,htmlFor:o,className:`schema-form-field--component schema-form-field--json`,children:(0,d.jsx)(s.t,{id:o,name:e.key,value:h,rows:e.rows??6,disabled:a,invalid:!!(i??_),placeholder:e.placeholder,spellCheck:!1,className:t.cn(`font-mono`,e.controlClassName),onFocus:()=>b(!0),onChange:t=>{let n=t.target.value;g(n);let i=P(e,n,r,f);v(i.valid?void 0:p.jsonParseError),l(i.value)},onBlur:()=>{b(!1);let e=x(h);e.valid&&g(S(e.value,m))},...e.textareaProps})})}function L({field:e,value:n,values:r,error:i,disabled:u,required:f,fieldId:p,onValueChange:m,onError:h,strings:g,className:_}){let x=e.type??`text`,S={label:e.label,required:f,hint:A(e),helperText:e.helperText,error:i,htmlFor:p,className:t.cn(`schema-form-field--component`,_)},C=e.controlClassName;if(x===`custom`&&e.type===`custom`)return(0,d.jsx)(`div`,{className:t.cn(`schema-form-field--component schema-form-field--custom`,_),children:e.render({field:e,value:n,values:r,error:i,disabled:u,required:f,fieldId:p,onValueChange:m,onError:h})});if(x===`switch`&&e.type===`switch`){let r=b(n);return e.switchStyle===`card`?(0,d.jsx)(c.D,{error:i,className:t.cn(`schema-form-field--component schema-form-field--switch-card`,_),children:(0,d.jsx)(o.K,{label:e.label,description:e.description,hint:e.hint,name:e.key,value:r,disabled:u,invalid:!!i,className:C,onChange:e=>m(e),...e.switchCardProps})}):(0,d.jsx)(c.D,{error:i,className:t.cn(`schema-form-field--component schema-form-field--switch`,_),children:(0,d.jsx)(o.G,{label:e.label,description:e.description??e.hint,name:e.key,value:r,disabled:u,invalid:!!i,className:C,onChange:e=>m(e),...e.switchProps})})}if(x===`json`)return(0,d.jsx)(I,{field:e,value:n,values:r,error:i,disabled:u,required:f,fieldId:p,onValueChange:m,onError:h,strings:g});if(x===`textarea`&&e.type===`textarea`){let t=j(e,n,r,h);return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(s.t,{id:p,name:e.key,value:t,rows:e.rows,disabled:u,required:f,invalid:!!i,placeholder:e.placeholder,className:C,onChange:t=>m(M(e,t.target.value,r,h)),...e.textareaProps})})}if((x===`number`||x===`integer`||x===`decimal`)&&(e.type===`number`||e.type===`integer`||e.type===`decimal`)){let t=j(e,n,r,h),a=e.type===`integer`,o=a?0:e.decimalPlaces??(e.type===`decimal`?2:4);return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(c.A,{id:p,name:e.key,value:t,min:e.min,max:e.max,step:e.step,decimalPlaces:o,disabled:u,required:f,invalid:!!i,placeholder:e.placeholder,className:C,onChange:t=>{let n=t.target.value;m(N(e,n,r,a,h))},...e.numberProps})})}if(x===`select`&&e.type===`select`){let t=e.options.map(e=>({value:e.value,label:e.label,disabled:e.disabled,icon:F(e)}));return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(o.Y,{name:e.key,value:v(n),options:t,allowClear:e.allowClear,disabled:u,required:f,invalid:!!i,placeholder:e.placeholder,"aria-label":e.label,className:C,onChange:e=>m(e??null),...e.selectProps})})}if(x===`radio-cards`&&e.type===`radio-cards`)return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(l.t,{name:e.key,value:v(n),options:e.options,columns:e.columns,disabled:u,invalid:!!i,className:C,onChange:e=>m(e),...e.radioProps})});if(x===`checkbox-cards`&&e.type===`checkbox-cards`)return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(l.n,{name:e.key,value:y(n),options:e.options,columns:e.columns,disabled:u,invalid:!!i,className:C,onChange:e=>m(e),...e.checkboxProps})});if(x===`tags`&&e.type===`tags`)return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(o.W,{value:y(n),recommendations:e.recommendations,maxTags:e.maxTags,disabled:u,invalid:!!i,placeholder:e.placeholder,className:C,onChange:e=>m(e),...e.tagsProps})});let w=x===`text`?`text`:x,T=j(e,n,r,h);return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(a.t,{id:p,name:e.key,type:w,value:T,disabled:u,required:f,invalid:!!i,placeholder:e.placeholder,className:C,onChange:t=>m(M(e,t.target.value,r,h)),...e.type===void 0||e.type===`text`||e.type===`email`||e.type===`password`||e.type===`url`||e.type===`tel`||e.type===`search`?e.inputProps:{}})})}L.displayName=`SchemaFormFieldRenderer`;var R={submitLabel:`Save changes`,resetLabel:`Reset`,defaultSectionTitle:`General`,emptyTitle:`No fields configured`,emptyDescription:`Add fields to the schema to render a form.`,jsonParseError:`Enter valid JSON.`,validationError:`Invalid value.`,formatRequiredError:e=>`${e} is required.`};function ee(e){return e.replace(/[^a-zA-Z0-9_-]/g,`-`)}function te({section:e}){return!e.title&&!e.description?null:(0,d.jsxs)(`div`,{className:`schema-form--section-heading mb-3 space-y-1`,children:[!!e.title&&(0,d.jsx)(r.s,{weight:`semibold`,className:`schema-form--section-title`,children:e.title}),!!e.description&&(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`schema-form--section-description`,children:e.description})]})}function z({schema:n,value:a,defaultValue:o,errors:s,disabled:c=!1,layout:l=`form`,columns:m=2,id:g,name:v,title:y,description:b,headerSlot:x,footerSlot:S,actionsSlot:C,emptySlot:w,showActions:T,submitLabel:E,resetLabel:A,submitDisabled:j=!1,resetDisabled:M=!1,isSubmitting:N=!1,onValueChange:P,onFieldChange:F,onSubmit:I,onReset:z,onError:B,renderField:V,renderSection:H,strings:ne,className:re,contentClassName:U,sectionClassName:W,fieldClassName:ie}){let ae=(0,u.useId)(),G=g??`schema-form-${ae}`,K=e.useStrings(R,ne),q=D({fields:n.fields,value:a,defaultValue:o,errors:s,onValueChange:P,onFieldChange:F,formatRequiredError:K.formatRequiredError,validationError:K.validationError,onError:B}),J=(0,u.useMemo)(()=>_(n,q.values,K.defaultSectionTitle,m,B),[m,q.values,B,n,K.defaultSectionTitle]),Y=J.some(e=>e.fields.length>0),X={setFieldValue:q.setFieldValue,setValues:q.setValues,reset:q.reset,validate:q.validate},oe=T??!!(I||z||C),se=E??K.submitLabel,ce=A??K.resetLabel,le=e=>{let n=`${G}-${ee(e.key)}`,r=c||h(e,q.values,B),i={field:e,value:q.getFieldValue(e.key),values:q.values,error:q.getFieldError(e.key),disabled:r,required:!!e.required,fieldId:n,onValueChange:t=>q.setFieldValue(e.key,t),onError:B},a=(0,d.jsx)(L,{...i,strings:K});return(0,d.jsx)(`div`,{className:t.cn(`schema-form--field`,p[e.width??`auto`],e.className,ie),children:V?.({...i,defaultField:a})??a},e.key)},Z=e=>(0,d.jsx)(`div`,{className:t.cn(`schema-form--section-fields`,f[e.columns]),children:e.fields.map(le)}),ue=e=>{let n=Z(e),r=H?.({section:e,fields:n,values:q.values});return r==null?(0,d.jsxs)(`section`,{className:t.cn(`schema-form--section`,e.className,W),children:[(0,d.jsx)(te,{section:e}),n,!!e.footerSlot&&(0,d.jsx)(`div`,{className:`schema-form--section-footer mt-3`,children:e.footerSlot})]},e.id):(0,d.jsx)(u.Fragment,{children:r},e.id)},de=e=>{let n=Z(e),r=H?.({section:e,fields:n,values:q.values});return r==null?(0,d.jsx)(i.t,{className:t.cn(`schema-form--section-card`,e.className,W),icon:e.icon,title:e.title,description:e.description,footerSlot:e.footerSlot,headerDivider:!0,children:n},e.id):(0,d.jsx)(u.Fragment,{children:r},e.id)},Q=C??(oe?(0,d.jsx)(O,{submitLabel:se,resetLabel:ce,showReset:!!z,disabled:c,submitDisabled:j,resetDisabled:M,isSubmitting:N,onReset:()=>{let e=q.reset();z?.(e,X)}}):null),$=w??(0,d.jsx)(k,{title:K.emptyTitle,description:K.emptyDescription});return(0,d.jsx)(`form`,{id:G,name:v,noValidate:!0,className:t.cn(`schema-form--component`,re),onSubmit:async e=>{if(e.preventDefault(),!(c||j||N)&&q.validate())try{await I?.(q.values,X,e)}catch(e){B?.(e)}},children:l===`cards`?(0,d.jsxs)(`div`,{className:t.cn(`schema-form--cards space-y-4`,U),children:[!!(y??n.title??b??n.description??x)&&(0,d.jsxs)(`div`,{className:`schema-form--header flex items-start justify-between gap-4`,children:[(0,d.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[!!(y??n.title)&&(0,d.jsx)(r.s,{weight:`semibold`,className:`schema-form--title`,children:y??n.title}),!!(b??n.description)&&(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`schema-form--description`,children:b??n.description})]}),x]}),Y?J.map(de):$,S,Q]}):(0,d.jsx)(i.t,{className:`schema-form--surface`,title:y??n.title,description:b??n.description,headerEnd:x,footerSlot:S||Q?(0,d.jsxs)(`div`,{className:`schema-form--footer flex flex-col gap-3`,children:[S,Q]}):void 0,headerDivider:!!(y??n.title??b??n.description??x),footerDivider:!!(S||Q),children:(0,d.jsx)(`div`,{className:t.cn(`schema-form--content space-y-6`,U),children:Y?J.map(ue):$})})})}z.displayName=`SchemaForm`,exports.SchemaForm=z,exports.SchemaFormActions=O,exports.SchemaFormEmpty=k,exports.SchemaFormFieldRenderer=L,exports.defaultSchemaFormStrings=R,exports.useSchemaForm=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/cards-CbbHly7W.cjs"),a=require("../../../_shared/input-CB6hxh-5.cjs"),o=require("../../../_shared/forms-CzrEYejY.cjs"),s=require("../../../_shared/textarea-B24qgdmd.cjs"),c=require("../../../_shared/display-Bin2vVex.cjs"),l=require("../../../_shared/card-radio-group-C2p_iBal.cjs");let u=require("react"),d=require("react/jsx-runtime");var f={1:`grid grid-cols-1 gap-4`,2:`grid grid-cols-1 gap-4 md:grid-cols-2`,3:`grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`},p={auto:``,half:`md:col-span-1`,third:`xl:col-span-1`,full:`md:col-span-full xl:col-span-full`};function m(e,t,n){if(typeof e.hidden==`function`)try{return e.hidden(t)}catch(e){return n?.(e),!1}return e.hidden??!1}function h(e,t,n){if(typeof e.disabled==`function`)try{return e.disabled(t)}catch(e){return n?.(e),!0}return e.disabled??!1}function g(e,t,n){return e.filter(e=>!m(e,t,n))}function _(e,t,n,r,i){let a=g(e.fields,t,i),o=new Map(a.map(e=>[e.key,e])),s=new Set,c=[];for(let t of e.sections??[]){let e=t.fields?t.fields.map(e=>o.get(e)).filter(e=>e!==void 0):a.filter(e=>e.sectionId===t.id);for(let t of e)s.add(t.key);c.push({id:t.id,title:t.title,description:t.description,icon:t.icon,fields:e,columns:t.columns??r,footerSlot:t.footerSlot,className:t.className})}let l=a.filter(e=>!s.has(e.key));return(l.length>0||c.length===0)&&c.unshift({id:`default`,title:e.sections?.length?n:void 0,fields:l,columns:r}),c.filter(e=>e.fields.length>0)}function v(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e)}function y(e){return Array.isArray(e)?e.map(e=>String(e)):[]}function b(e){return e===!0||e===`true`||e===1}function x(e,t=!1){let n=e.trim();if(n.length===0)return null;let r=t?Number.parseInt(n,10):Number.parseFloat(n);return Number.isNaN(r)?null:r}function S(e,t=2){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,t)}catch{return String(e)}}function C(e){let t=e.trim();if(t.length===0)return{value:null,valid:!0};try{return{value:JSON.parse(t),valid:!0}}catch{return{value:e,valid:!1}}}function w(e,t){let n={...t??{}};for(let t of e)t.defaultValue!==void 0&&n[t.key]===void 0&&(n[t.key]=t.defaultValue);return n}function T(e){return e==null?!0:typeof e==`string`?e.trim().length===0:Array.isArray(e)?e.length===0:!1}function E(e){let t={};for(let[n,r]of Object.entries(e??{}))r&&(t[n]=r);return t}function D({fields:e,value:t,defaultValue:n,errors:r,onValueChange:i,onFieldChange:a,formatRequiredError:o,validationError:s,onError:c}){let l=t!==void 0,d=(0,u.useMemo)(()=>w(e,n),[n,e]),[f,p]=(0,u.useState)(()=>d),[h,g]=(0,u.useState)({}),_=(0,u.useMemo)(()=>l?{...d,...t??{}}:f,[d,f,l,t]),v=(0,u.useMemo)(()=>({...h,...E(r)}),[r,h]),y=(0,u.useCallback)(e=>{l||p(e),i?.(e)},[l,i]),b=(0,u.useCallback)((e,t)=>{let n={..._,[e]:t};l||p(n),g(t=>{if(!t[e])return t;let n={...t};return delete n[e],n}),a?.(e,t,n),i?.(n)},[l,a,i,_]),x=(0,u.useCallback)(()=>{let t=w(e,n);return l||p(t),g({}),i?.(t),t},[n,e,l,i]),S=(0,u.useCallback)(()=>{let t={};for(let n of e){if(m(n,_,c))continue;let e=_[n.key];if(n.required&&T(e)){t[n.key]=o(n.label);continue}let r=Array.isArray(n.validate)?n.validate:n.validate?[n.validate]:[];for(let i of r)try{let r=i(e,_,n);if(typeof r==`string`&&r.length>0){t[n.key]=r;break}}catch(e){c?.(e),t[n.key]=s;break}}return g(t),Object.keys(t).length===0},[e,o,c,s,_]);return{values:_,errors:v,getFieldError:(0,u.useCallback)(e=>v[e],[v]),getFieldValue:(0,u.useCallback)(e=>_[e],[_]),setFieldValue:b,setValues:y,reset:x,validate:S}}function O({submitLabel:e,resetLabel:r,showReset:i=!1,disabled:a=!1,submitDisabled:o=!1,resetDisabled:s=!1,isSubmitting:c=!1,onReset:l,className:u}){return(0,d.jsxs)(`div`,{className:t.cn(`schema-form-actions--component flex items-center justify-end gap-2`,u),children:[!!i&&(0,d.jsx)(n.t,{type:`button`,variant:`secondary`,buttonStyle:`outline`,disabled:a||s||c,onClick:l,children:r}),(0,d.jsx)(n.t,{type:`submit`,variant:`primary`,loading:c,disabled:a||o,children:e})]})}O.displayName=`SchemaFormActions`;function k({title:e,description:n,className:i}){return(0,d.jsxs)(`div`,{className:t.cn(`schema-form-empty--component rounded-md border border-dashed border-border bg-muted/20 p-6 text-center`,i),children:[(0,d.jsx)(r.s,{weight:`semibold`,children:e}),(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`mt-1`,children:n})]})}k.displayName=`SchemaFormEmpty`;function A(e){return e.hint??e.description}function j(e,t,n,r){if(e.formatValue)try{return e.formatValue(t,n)}catch(e){r?.(e)}return v(t)}function M(e,t,n,r){if(e.parseValue)try{return e.parseValue(t,n)}catch(e){r?.(e)}return t}function N(e,t,n,r,i){if(e.parseValue)try{return e.parseValue(t,n)}catch(e){i?.(e)}return x(t,r)}function P(e,t,n,r){if(e.type===`json`&&e.parseValue)try{return{value:e.parseValue(t,n),valid:!0}}catch(e){return r?.(e),{value:t,valid:!1}}return C(t)}function F(e){if(!e.icon)return;let t=e.icon;return(0,d.jsx)(t,{className:`size-4`,"aria-hidden":`true`})}function I({field:e,value:n,values:r,error:i,disabled:a,fieldId:o,onValueChange:l,onError:f,strings:p}){let m=e.type===`json`?e.jsonIndent??2:2,[h,g]=(0,u.useState)(()=>S(n,m)),[_,v]=(0,u.useState)(),[y,b]=(0,u.useState)(!1);if((0,u.useEffect)(()=>{y||g(S(n,m))},[m,y,n]),e.type!==`json`)return null;let x=t=>{let n=P(e,t,r,f);return v(n.valid?void 0:p.jsonParseError),l(n.value),n};return(0,d.jsx)(c.D,{label:e.label,required:e.required,hint:A(e),helperText:e.helperText,error:i??_,htmlFor:o,className:`schema-form-field--component schema-form-field--json`,children:(0,d.jsx)(s.t,{id:o,name:e.key,value:h,rows:e.rows??6,disabled:a,invalid:!!(i??_),placeholder:e.placeholder,spellCheck:!1,className:t.cn(`font-mono`,e.controlClassName),onFocus:()=>b(!0),onChange:t=>{let n=t.target.value;g(n);let i=P(e,n,r,f);v(i.valid?void 0:p.jsonParseError),l(i.value)},onBlur:()=>{b(!1);let e=x(h);e.valid&&g(S(e.value,m))},...e.textareaProps})})}function L({field:e,value:n,values:r,error:i,disabled:u,required:f,fieldId:p,onValueChange:m,onError:h,strings:g,className:_}){let x=e.type??`text`,S={label:e.label,required:f,hint:A(e),helperText:e.helperText,error:i,htmlFor:p,className:t.cn(`schema-form-field--component`,_)},C=e.controlClassName;if(x===`custom`&&e.type===`custom`)return(0,d.jsx)(`div`,{className:t.cn(`schema-form-field--component schema-form-field--custom`,_),children:e.render({field:e,value:n,values:r,error:i,disabled:u,required:f,fieldId:p,onValueChange:m,onError:h})});if(x===`switch`&&e.type===`switch`){let r=b(n);return e.switchStyle===`card`?(0,d.jsx)(c.D,{error:i,className:t.cn(`schema-form-field--component schema-form-field--switch-card`,_),children:(0,d.jsx)(o.K,{label:e.label,description:e.description,hint:e.hint,name:e.key,value:r,disabled:u,invalid:!!i,className:C,onChange:e=>m(e),...e.switchCardProps})}):(0,d.jsx)(c.D,{error:i,className:t.cn(`schema-form-field--component schema-form-field--switch`,_),children:(0,d.jsx)(o.G,{label:e.label,description:e.description??e.hint,name:e.key,value:r,disabled:u,invalid:!!i,className:C,onChange:e=>m(e),...e.switchProps})})}if(x===`json`)return(0,d.jsx)(I,{field:e,value:n,values:r,error:i,disabled:u,required:f,fieldId:p,onValueChange:m,onError:h,strings:g});if(x===`textarea`&&e.type===`textarea`){let t=j(e,n,r,h);return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(s.t,{id:p,name:e.key,value:t,rows:e.rows,disabled:u,required:f,invalid:!!i,placeholder:e.placeholder,className:C,onChange:t=>m(M(e,t.target.value,r,h)),...e.textareaProps})})}if((x===`number`||x===`integer`||x===`decimal`)&&(e.type===`number`||e.type===`integer`||e.type===`decimal`)){let t=j(e,n,r,h),a=e.type===`integer`,o=a?0:e.decimalPlaces??(e.type===`decimal`?2:4);return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(c.A,{id:p,name:e.key,value:t,min:e.min,max:e.max,step:e.step,decimalPlaces:o,disabled:u,required:f,invalid:!!i,placeholder:e.placeholder,className:C,onChange:t=>{let n=t.target.value;m(N(e,n,r,a,h))},...e.numberProps})})}if(x===`select`&&e.type===`select`){let t=e.options.map(e=>({value:e.value,label:e.label,disabled:e.disabled,icon:F(e)}));return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(o.Y,{name:e.key,value:v(n),options:t,allowClear:e.allowClear,disabled:u,required:f,invalid:!!i,placeholder:e.placeholder,"aria-label":e.label,className:C,onChange:e=>m(e??null),...e.selectProps})})}if(x===`radio-cards`&&e.type===`radio-cards`)return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(l.t,{name:e.key,value:v(n),options:e.options,columns:e.columns,disabled:u,invalid:!!i,className:C,onChange:e=>m(e),...e.radioProps})});if(x===`checkbox-cards`&&e.type===`checkbox-cards`)return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(l.n,{name:e.key,value:y(n),options:e.options,columns:e.columns,disabled:u,invalid:!!i,className:C,onChange:e=>m(e),...e.checkboxProps})});if(x===`tags`&&e.type===`tags`)return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(o.W,{value:y(n),recommendations:e.recommendations,maxTags:e.maxTags,disabled:u,invalid:!!i,placeholder:e.placeholder,className:C,onChange:e=>m(e),...e.tagsProps})});let w=x===`text`?`text`:x,T=j(e,n,r,h);return(0,d.jsx)(c.D,{...S,children:(0,d.jsx)(a.t,{id:p,name:e.key,type:w,value:T,disabled:u,required:f,invalid:!!i,placeholder:e.placeholder,className:C,onChange:t=>m(M(e,t.target.value,r,h)),...e.type===void 0||e.type===`text`||e.type===`email`||e.type===`password`||e.type===`url`||e.type===`tel`||e.type===`search`?e.inputProps:{}})})}L.displayName=`SchemaFormFieldRenderer`;var R={submitLabel:`Save changes`,resetLabel:`Reset`,defaultSectionTitle:`General`,emptyTitle:`No fields configured`,emptyDescription:`Add fields to the schema to render a form.`,jsonParseError:`Enter valid JSON.`,validationError:`Invalid value.`,formatRequiredError:e=>`${e} is required.`};function ee(e){return e.replace(/[^a-zA-Z0-9_-]/g,`-`)}function te({section:e}){return!e.title&&!e.description?null:(0,d.jsxs)(`div`,{className:`schema-form--section-heading mb-3 space-y-1`,children:[!!e.title&&(0,d.jsx)(r.s,{weight:`semibold`,className:`schema-form--section-title`,children:e.title}),!!e.description&&(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`schema-form--section-description`,children:e.description})]})}function z({schema:n,value:a,defaultValue:o,errors:s,disabled:c=!1,layout:l=`form`,columns:m=2,id:g,name:v,title:y,description:b,headerSlot:x,footerSlot:S,actionsSlot:C,emptySlot:w,showActions:T,submitLabel:E,resetLabel:A,submitDisabled:j=!1,resetDisabled:M=!1,isSubmitting:N=!1,onValueChange:P,onFieldChange:F,onSubmit:I,onReset:z,onError:B,renderField:V,renderSection:H,strings:ne,className:re,contentClassName:U,sectionClassName:W,fieldClassName:ie}){let ae=(0,u.useId)(),G=g??`schema-form-${ae}`,K=e.useStrings(R,ne),q=D({fields:n.fields,value:a,defaultValue:o,errors:s,onValueChange:P,onFieldChange:F,formatRequiredError:K.formatRequiredError,validationError:K.validationError,onError:B}),J=(0,u.useMemo)(()=>_(n,q.values,K.defaultSectionTitle,m,B),[m,q.values,B,n,K.defaultSectionTitle]),Y=J.some(e=>e.fields.length>0),X={setFieldValue:q.setFieldValue,setValues:q.setValues,reset:q.reset,validate:q.validate},oe=T??!!(I||z||C),se=E??K.submitLabel,ce=A??K.resetLabel,le=e=>{let n=`${G}-${ee(e.key)}`,r=c||h(e,q.values,B),i={field:e,value:q.getFieldValue(e.key),values:q.values,error:q.getFieldError(e.key),disabled:r,required:!!e.required,fieldId:n,onValueChange:t=>q.setFieldValue(e.key,t),onError:B},a=(0,d.jsx)(L,{...i,strings:K});return(0,d.jsx)(`div`,{className:t.cn(`schema-form--field`,p[e.width??`auto`],e.className,ie),children:V?.({...i,defaultField:a})??a},e.key)},Z=e=>(0,d.jsx)(`div`,{className:t.cn(`schema-form--section-fields`,f[e.columns]),children:e.fields.map(le)}),ue=e=>{let n=Z(e),r=H?.({section:e,fields:n,values:q.values});return r==null?(0,d.jsxs)(`section`,{className:t.cn(`schema-form--section`,e.className,W),children:[(0,d.jsx)(te,{section:e}),n,!!e.footerSlot&&(0,d.jsx)(`div`,{className:`schema-form--section-footer mt-3`,children:e.footerSlot})]},e.id):(0,d.jsx)(u.Fragment,{children:r},e.id)},de=e=>{let n=Z(e),r=H?.({section:e,fields:n,values:q.values});return r==null?(0,d.jsx)(i.t,{className:t.cn(`schema-form--section-card`,e.className,W),icon:e.icon,title:e.title,description:e.description,footerSlot:e.footerSlot,headerDivider:!0,children:n},e.id):(0,d.jsx)(u.Fragment,{children:r},e.id)},Q=C??(oe?(0,d.jsx)(O,{submitLabel:se,resetLabel:ce,showReset:!!z,disabled:c,submitDisabled:j,resetDisabled:M,isSubmitting:N,onReset:()=>{let e=q.reset();z?.(e,X)}}):null),$=w??(0,d.jsx)(k,{title:K.emptyTitle,description:K.emptyDescription});return(0,d.jsx)(`form`,{id:G,name:v,noValidate:!0,className:t.cn(`schema-form--component`,re),onSubmit:async e=>{if(e.preventDefault(),!(c||j||N)&&q.validate())try{await I?.(q.values,X,e)}catch(e){B?.(e)}},children:l===`cards`?(0,d.jsxs)(`div`,{className:t.cn(`schema-form--cards space-y-4`,U),children:[!!(y??n.title??b??n.description??x)&&(0,d.jsxs)(`div`,{className:`schema-form--header flex items-start justify-between gap-4`,children:[(0,d.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[!!(y??n.title)&&(0,d.jsx)(r.s,{weight:`semibold`,className:`schema-form--title`,children:y??n.title}),!!(b??n.description)&&(0,d.jsx)(r.s,{size:`xs`,type:`secondary`,className:`schema-form--description`,children:b??n.description})]}),x]}),Y?J.map(de):$,S,Q]}):(0,d.jsx)(i.t,{className:`schema-form--surface`,title:y??n.title,description:b??n.description,headerEnd:x,footerSlot:S||Q?(0,d.jsxs)(`div`,{className:`schema-form--footer flex flex-col gap-3`,children:[S,Q]}):void 0,headerDivider:!!(y??n.title??b??n.description??x),footerDivider:!!(S||Q),children:(0,d.jsx)(`div`,{className:t.cn(`schema-form--content space-y-6`,U),children:Y?J.map(ue):$})})})}z.displayName=`SchemaForm`,exports.SchemaForm=z,exports.SchemaFormActions=O,exports.SchemaFormEmpty=k,exports.SchemaFormFieldRenderer=L,exports.defaultSchemaFormStrings=R,exports.useSchemaForm=D;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -2,9 +2,9 @@ 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 { t as i } from "../../../_shared/cards-
|
|
5
|
+
import { t as i } from "../../../_shared/cards-RZxRLx3f.js";
|
|
6
6
|
import { t as a } from "../../../_shared/input-CfnHBT--.js";
|
|
7
|
-
import { G as o, K as s, W as c, Y as l } from "../../../_shared/forms-
|
|
7
|
+
import { G as o, K as s, W as c, Y as l } from "../../../_shared/forms-BoquZE2Y.js";
|
|
8
8
|
import { t as u } from "../../../_shared/textarea-ChLRmmVU.js";
|
|
9
9
|
import { A as d, D as f } from "../../../_shared/display-B0wLVN8t.js";
|
|
10
10
|
import { n as p, t as m } from "../../../_shared/card-radio-group-Fdi1Cz1j.js";
|