admin-ui-starter-kit 0.4.2 → 0.4.3
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/.agents/skills/component-library-rules/SKILL.md +7 -1
- package/.agents/skills/component-library-rules/references/base-wrapper.md +24 -4
- package/.agents/skills/component-library-rules/references/components/INDEX.json +4 -3
- package/.agents/skills/component-library-rules/references/components/INDEX.md +4 -3
- package/.agents/skills/component-library-rules/references/components/ui__inputs.md +117 -18
- package/.agents/skills/component-library-rules/references/components/ui__layout-primitives.md +71 -0
- package/.agents/skills/component-library-rules/references/components/ui__menus.md +125 -43
- package/.agents/skills/component-library-rules/references/components/ui__overlays.md +117 -42
- package/AGENTS.md +7 -4
- package/README.md +28 -4
- package/dist/_shared/{header-BUAddfdE.js → header-CyBTcM-L.js} +9 -9
- package/dist/_shared/header-CyBTcM-L.js.map +1 -0
- package/dist/_shared/header-kwvkesfq.cjs +2 -0
- package/dist/_shared/header-kwvkesfq.cjs.map +1 -0
- package/dist/_shared/{sidebar-Bl_KRk-S.cjs → sidebar-B_L_dnAe.cjs} +2 -2
- package/dist/_shared/{sidebar-Bl_KRk-S.cjs.map → sidebar-B_L_dnAe.cjs.map} +1 -1
- package/dist/_shared/{sidebar-ux-yk-Ph.js → sidebar-C5DApiDy.js} +26 -19
- package/dist/_shared/{sidebar-ux-yk-Ph.js.map → sidebar-C5DApiDy.js.map} +1 -1
- package/dist/_shared/{sidebar-BML5ZZ5s.js → sidebar-CIlGkVbF.js} +156 -155
- package/dist/_shared/sidebar-CIlGkVbF.js.map +1 -0
- package/dist/_shared/sidebar-D3sK9otF.cjs +2 -0
- package/dist/_shared/sidebar-D3sK9otF.cjs.map +1 -0
- package/dist/components/base/sidebar/index.cjs +1 -1
- package/dist/components/base/sidebar/index.js +2 -2
- package/dist/components/base/sidebar/sidebar.d.ts +5 -3
- package/dist/components/base/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/layout/header/index.cjs +1 -1
- package/dist/components/layout/header/index.js +1 -1
- package/dist/components/layout/header/partials/header-search.d.ts.map +1 -1
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +2 -2
- package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts.map +1 -1
- package/dist/components/layout/sidebar/index.cjs +1 -1
- package/dist/components/layout/sidebar/index.js +1 -1
- package/dist/components/ui/alert-dialog.d.ts +19 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +5 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/carousel.d.ts +29 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.d.ts.map +1 -0
- package/dist/components/ui/drawer.d.ts +14 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/input-otp.d.ts +12 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/menubar.d.ts +30 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/native-select.d.ts +9 -0
- package/dist/components/ui/native-select.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/showcase/assets/{AreaChart-DUe3j5uB.js → AreaChart-BkAbL-UV.js} +1 -1
- package/dist/showcase/assets/CSPContext-B11tftuK.js +1 -0
- package/dist/showcase/assets/CompositeItem-Dzu0MfUC.js +1 -0
- package/dist/showcase/assets/CompositeRoot-CQvQ_uj2.js +1 -0
- package/dist/showcase/assets/DialogTrigger-BxVhSw4D.js +1 -0
- package/dist/showcase/assets/FieldItemContext-BSFHjS7g.js +1 -0
- package/dist/showcase/assets/LabelableContext-DapqaNeY.js +1 -0
- package/dist/showcase/assets/{PreviewLayout-BG1B5TzA.js → PreviewLayout-CGEkbS-i.js} +1 -1
- package/dist/showcase/assets/RadioGroup-DBA3iBQw.js +1 -0
- package/dist/showcase/assets/Separator-BEMr82IS.js +1 -0
- package/dist/showcase/assets/ToolbarRootContext-xN-ruoGR.js +1 -0
- package/dist/showcase/assets/{accordion-BWkuKg77.js → accordion-B-Iy0jKu.js} +3 -3
- package/dist/showcase/assets/accordion-variants-B9GD0oBE.js +1 -0
- package/dist/showcase/assets/{action-menu-BOUHlGba.js → action-menu-CMUF6gPp.js} +1 -1
- package/dist/showcase/assets/{activities-DMDQje7Y.js → activities-C1P9bsJm.js} +2 -2
- package/dist/showcase/assets/{activities-feed-card-B8wpu4F3.js → activities-feed-card-WZUuGHmT.js} +1 -1
- package/dist/showcase/assets/{activity-B-FxNryB.js → activity-BVP5C805.js} +1 -1
- package/dist/showcase/assets/{admin-CAhEeKt_.js → admin-DWOK4sj4.js} +2 -2
- package/dist/showcase/assets/{ai-UioEgJ90.js → ai-Dteb3y6G.js} +2 -2
- package/dist/showcase/assets/{ai-artifact-CUAlhcSX.js → ai-artifact-B0d7GveY.js} +2 -2
- package/dist/showcase/assets/{ai-chat-C_w2PSmy.js → ai-chat-IJ0b2FOw.js} +7 -7
- package/dist/showcase/assets/{ai-elements-DmxqXR6H.js → ai-elements-Cr8GgtEV.js} +3 -3
- package/dist/showcase/assets/{ai-new-PG02TWQq.js → ai-new-BJN9wNvX.js} +2 -2
- package/dist/showcase/assets/{ai-tool-call-BaJx1rR4.js → ai-tool-call-BqlQuR1P.js} +1 -1
- package/dist/showcase/assets/{alert-DIelf1qF.js → alert-2_0J7Vv6.js} +1 -1
- package/dist/showcase/assets/{alert-D7n-kQoO.js → alert-7wEOpEor.js} +1 -1
- package/dist/showcase/assets/{alert-TQCZEcn-.js → alert-C_FOBilU.js} +2 -2
- package/dist/showcase/assets/{api-key-list-CSt4trYG.js → api-key-list-CGV1k52v.js} +2 -2
- package/dist/showcase/assets/app-sidebar-S6oUYO4h.js +1 -0
- package/dist/showcase/assets/arrow-down-VNr82bS3.js +1 -0
- package/dist/showcase/assets/arrow-left-BSVeKWNq.js +1 -0
- package/dist/showcase/assets/arrow-right-D6hTB0Bd.js +1 -0
- package/dist/showcase/assets/arrow-up-p9oA4cIz.js +1 -0
- package/dist/showcase/assets/arrow-up-right-BtlQ62bc.js +1 -0
- package/dist/showcase/assets/{avatar-DLpnivU0.js → avatar-BxcQUuh0.js} +1 -1
- package/dist/showcase/assets/avatar-LGWm52rv.js +1 -0
- package/dist/showcase/assets/{badge-yFoRqbiq.js → badge-COn5psy3.js} +2 -2
- package/dist/showcase/assets/{badge-check-BRAVo7dA.js → badge-check-D2C2BPUT.js} +1 -1
- package/dist/showcase/assets/{bell-Dt3Nz2y2.js → bell-C80n9VRl.js} +1 -1
- package/dist/showcase/assets/{bot-5Ro5Dayc.js → bot-C83bUUi9.js} +1 -1
- package/dist/showcase/assets/{box-mt6TbZO6.js → box-rZ0pA-02.js} +1 -1
- package/dist/showcase/assets/{brain-736080Wh.js → brain-BJtktdVu.js} +1 -1
- package/dist/showcase/assets/{brand-4K8xsJ91.js → brand-CxdIBpyJ.js} +1 -1
- package/dist/showcase/assets/{breadcrumb-CAlApdCw.js → breadcrumb-BZsr_A8k.js} +1 -1
- package/dist/showcase/assets/{breadcrumb-DHeGqoTD.js → breadcrumb-CSU8FvWB.js} +1 -1
- package/dist/showcase/assets/{breadcrumbs-D_lniGJs.js → breadcrumbs-BUm4gHzL.js} +1 -1
- package/dist/showcase/assets/{briefcase-B_Uti-Iu.js → briefcase-0WhUdLn5.js} +1 -1
- package/dist/showcase/assets/{building-2-zgcwuzxP.js → building-2-1D6zVdCI.js} +1 -1
- package/dist/showcase/assets/{button-PmqgeJKm.js → button-C22Gs6y0.js} +2 -2
- package/dist/showcase/assets/{button-group-DAOmmujV.js → button-group-C0Ts4-x3.js} +1 -1
- package/dist/showcase/assets/{buttons-PtpR_v16.js → buttons-Dfn6hmwe.js} +3 -3
- package/dist/showcase/assets/{calendar-DTgagmt7.js → calendar-7a4yQlzJ.js} +1 -1
- package/dist/showcase/assets/{calendar-BiOGjB7a.js → calendar-Bo17POsN.js} +1 -1
- package/dist/showcase/assets/{calendar-C1A98cz0.js → calendar-D6XNDRVQ.js} +1 -1
- package/dist/showcase/assets/{calendar-days-pr8kXiTx.js → calendar-days-C4mG2tOe.js} +1 -1
- package/dist/showcase/assets/{camera-CGKLOOep.js → camera-C16z6v0m.js} +1 -1
- package/dist/showcase/assets/{card-CFIG8Dgg.js → card-BjqRQxxz.js} +1 -1
- package/dist/showcase/assets/{card-CRd07Iun.js → card-IzYmUTpI.js} +2 -2
- package/dist/showcase/assets/{card-primitives-YgCOqVDI.js → card-primitives-BDj4DtS8.js} +1 -1
- package/dist/showcase/assets/{card-radio-group-Du6yaMZ-.js → card-radio-group-7GU9AtWs.js} +1 -1
- package/dist/showcase/assets/{cards-H7ywhTNM.js → cards-DAqpr8CM.js} +8 -8
- package/dist/showcase/assets/{carousel-Dwll5oz1.js → carousel-D1n4Kkoo.js} +4 -4
- package/dist/showcase/assets/{chart-BWnVf-d-.js → chart-D2EGeI3b.js} +5 -5
- package/dist/showcase/assets/{chart-column-DjAyOA-t.js → chart-column-DKcP77Dx.js} +1 -1
- package/dist/showcase/assets/checkbox-BI3gcjED.js +1 -0
- package/dist/showcase/assets/chevron-down-ByPPEdNm.js +1 -0
- package/dist/showcase/assets/chevron-left-BNByuq3g.js +1 -0
- package/dist/showcase/assets/chevron-right-D4pIMCh9.js +1 -0
- package/dist/showcase/assets/chevron-up-Cha879Nz.js +1 -0
- package/dist/showcase/assets/chevrons-up-down-eAgHau5X.js +1 -0
- package/dist/showcase/assets/circle-V5hdlsIn.js +1 -0
- package/dist/showcase/assets/{circle-alert-ysbx8rsZ.js → circle-alert-BW-Btwgh.js} +1 -1
- package/dist/showcase/assets/circle-check-1MSds3Vu.js +1 -0
- package/dist/showcase/assets/circle-check-big-vBWkmhCZ.js +1 -0
- package/dist/showcase/assets/circle-dot-CsD5uXwH.js +1 -0
- package/dist/showcase/assets/{circle-question-mark-Dbi-WTYN.js → circle-question-mark-xYn9p1nL.js} +1 -1
- package/dist/showcase/assets/{circle-x-c5z6-eYV.js → circle-x-VSqZOeGt.js} +1 -1
- package/dist/showcase/assets/clock-3-CP_t59kW.js +1 -0
- package/dist/showcase/assets/clock-9xbB7EnW.js +1 -0
- package/dist/showcase/assets/{code-xml-SoYTMEdm.js → code-xml-CeGA85eB.js} +1 -1
- package/dist/showcase/assets/{collapsible-Cv3oGVkH.js → collapsible-C2W51-wl.js} +2 -2
- package/dist/showcase/assets/collapsible-C4eof15p.js +1 -0
- package/dist/showcase/assets/{combobox-CPC4a_MH.js → combobox-i8o4u6Q0.js} +4 -4
- package/dist/showcase/assets/{command-C37Q471b.js → command-C4F78Ppy.js} +1 -1
- package/dist/showcase/assets/command-wjOXUieO.js +1 -0
- package/dist/showcase/assets/{comment-composer-W0xfh_HP.js → comment-composer-DeURrlgL.js} +1 -1
- package/dist/showcase/assets/comment-item-D07Qk-Nt.js +1 -0
- package/dist/showcase/assets/{comments-BODDdRry.js → comments-Bo-lZU18.js} +2 -2
- package/dist/showcase/assets/{commerce-extras-DsgnTkBH.js → commerce-extras-Cio3xn_B.js} +2 -2
- package/dist/showcase/assets/{commerce-B9MICTY2.js → commerce-jqA58sCZ.js} +2 -2
- package/dist/showcase/assets/{composite-B-19wwf9.js → composite-BQFpnmS9.js} +1 -1
- package/dist/showcase/assets/{contact-card-CqP3YxTq.js → contact-card-4ajPhcd_.js} +2 -2
- package/dist/showcase/assets/{content-container-x2tsQKwH.js → content-container-B83BnjFb.js} +1 -1
- package/dist/showcase/assets/{copyable-DH0w0i_h.js → copyable-DKkroGJ3.js} +3 -3
- package/dist/showcase/assets/{course-card-qpC4JUUM.js → course-card-DShYl03k.js} +2 -2
- package/dist/showcase/assets/{cpu-DjJeD_0Z.js → cpu-BZTsuaUu.js} +1 -1
- package/dist/showcase/assets/{credit-card-CYgRtM77.js → credit-card-CAI3F3HB.js} +1 -1
- package/dist/showcase/assets/{currency-hguqIjWU.js → currency-PXgbngHk.js} +6 -6
- package/dist/showcase/assets/{dark-surfaces-Cj34O9A0.js → dark-surfaces-pSCicdm4.js} +2 -2
- package/dist/showcase/assets/{database-BVwSMeGM.js → database-oHsxHUj-.js} +1 -1
- package/dist/showcase/assets/{date-block-LCTDXG5-.js → date-block-CvCdJr8d.js} +1 -1
- package/dist/showcase/assets/{date-picker-CbYq8wZ7.js → date-picker-Cd5vsEEd.js} +1 -1
- package/dist/showcase/assets/{date-pickers-BaSX23MK.js → date-pickers-CBK-zvSB.js} +4 -4
- package/dist/showcase/assets/{dense-info-kY1QmtaP.js → dense-info-zOdJpez6.js} +2 -2
- package/dist/showcase/assets/{dialog-B85US9Ue.js → dialog-D9-MRCRg.js} +1 -1
- package/dist/showcase/assets/{dialog-iIgfMvTJ.js → dialog-EDw9DvZs.js} +1 -1
- package/dist/showcase/assets/display-CE9JWinr.js +403 -0
- package/dist/showcase/assets/dist-CjZ6RM9v.js +45 -0
- package/dist/showcase/assets/{dollar-sign-DlK6XF_v.js → dollar-sign-BXD_x2mP.js} +1 -1
- package/dist/showcase/assets/{download-B_EY5cGA.js → download-D0ur_d_N.js} +1 -1
- package/dist/showcase/assets/dropdown-menu-Cto8-yDW.js +1 -0
- package/dist/showcase/assets/{dropzone-Bl7RO_Uk.js → dropzone-9Gb4mR4x.js} +1 -1
- package/dist/showcase/assets/{earth-C7n2JAYm.js → earth-BN1w3w7h.js} +1 -1
- package/dist/showcase/assets/{ellipsis-ntuo3ejh.js → ellipsis-DsrebD1Y.js} +1 -1
- package/dist/showcase/assets/{ellipsis-vertical-yH8S83bc.js → ellipsis-vertical-CAiMV7G2.js} +1 -1
- package/dist/showcase/assets/{empty-CY8f7iFe.js → empty-DoJF3uif.js} +1 -1
- package/dist/showcase/assets/{empty-item-Ct7uCr40.js → empty-item-zZ85qI6s.js} +2 -2
- package/dist/showcase/assets/{empty-state-IAAUTn6f.js → empty-state-CGfB7sOE.js} +1 -1
- package/dist/showcase/assets/{empty-state-DlO8SJi8.js → empty-state-Y_4qnNWt.js} +1 -1
- package/dist/showcase/assets/{enhanced-activities-DLwShhof.js → enhanced-activities-B41hAxhb.js} +2 -2
- package/dist/showcase/assets/enhanced-combobox-BOimEW-1.js +1 -0
- package/dist/showcase/assets/{event-calendar-C4KlumlG.js → event-calendar-BjcfC6fM.js} +3 -3
- package/dist/showcase/assets/{event-log-BvUU5Rj8.js → event-log-BhoMXcix.js} +2 -2
- package/dist/showcase/assets/example-Cz_880po.js +1 -0
- package/dist/showcase/assets/{external-link-DuJlM_H4.js → external-link-Cy1-PP8k.js} +1 -1
- package/dist/showcase/assets/{eye-CnRPL_H8.js → eye-C85PNNdH.js} +1 -1
- package/dist/showcase/assets/feature-announcement-_tpahla3.js +34 -0
- package/dist/showcase/assets/{file-Dc5UHkfE.js → file-C8PCBEtY.js} +1 -1
- package/dist/showcase/assets/{file-text-D3AE37vP.js → file-text-DwqbUujq.js} +1 -1
- package/dist/showcase/assets/{filters-CsovNSxS.js → filters-ChqGg_1z.js} +3 -3
- package/dist/showcase/assets/{flag-CJJ43K4x.js → flag-csHQcBml.js} +1 -1
- package/dist/showcase/assets/{folder-open-Dp0sceCi.js → folder-open-BThTng3d.js} +1 -1
- package/dist/showcase/assets/{form-field-Cxm4APa9.js → form-field-B5g_5Zjm.js} +1 -1
- package/dist/showcase/assets/{format-bDaUGCSP.js → format-DrTwpH65.js} +1 -1
- package/dist/showcase/assets/{forms-BrVikK1p.js → forms-BukyUSKs.js} +9 -9
- package/dist/showcase/assets/{frame-CkLEABTd.js → frame-BNKhZVlb.js} +4 -4
- package/dist/showcase/assets/getPseudoElementBounds-DwyQgIj-.js +1 -0
- package/dist/showcase/assets/{gift-Bx8IO1FQ.js → gift-CtM--bDo.js} +1 -1
- package/dist/showcase/assets/{giftcard-cards-CZTXBjv0.js → giftcard-cards-imm4Br0H.js} +2 -2
- package/dist/showcase/assets/{git-branch-D9jt-u1q.js → git-branch-Dl3AzbqP.js} +1 -1
- package/dist/showcase/assets/{global-search-D9XJ747r.js → global-search-Bhl7z_vN.js} +1 -1
- package/dist/showcase/assets/{global-search-C2R_3Pb3.js → global-search-C4yaPFSW.js} +1 -1
- package/dist/showcase/assets/{globe-BJHI134i.js → globe-BCikLfKc.js} +1 -1
- package/dist/showcase/assets/{gradient-card-CV8w2JG5.js → gradient-card-Dh_5ZYv0.js} +2 -2
- package/dist/showcase/assets/{hash-CtBGoIvf.js → hash-C8m0EECO.js} +1 -1
- package/dist/showcase/assets/{header-B3FSlVv4.js → header-BXjw7Lm_.js} +1 -1
- package/dist/showcase/assets/header-notifications-CShSQ8kR.js +1 -0
- package/dist/showcase/assets/{heart-BWZYF4xJ.js → heart-BJVBFZ-j.js} +1 -1
- package/dist/showcase/assets/{house-CAQOnHLO.js → house-C3fXPhlL.js} +1 -1
- package/dist/showcase/assets/{icon-badge-CxvxB8Vd.js → icon-badge-dwVx3Hxf.js} +1 -1
- package/dist/showcase/assets/{image-Byz-p7hT.js → image-gc4qX_7C.js} +1 -1
- package/dist/showcase/assets/{inbox-D4UE_W9O.js → inbox-C0GJ1KEC.js} +1 -1
- package/dist/showcase/assets/{index-Cz4UGUT2.js → index-BQIv1ffM.js} +2 -2
- package/dist/showcase/assets/index-DN3tqopz.css +2 -0
- package/dist/showcase/assets/inertValue-DeVQ2cCe.js +1 -0
- package/dist/showcase/assets/{info-DFu8OfxV.js → info-BimmreJ-.js} +1 -1
- package/dist/showcase/assets/{inline-stat-DqI70yoJ.js → inline-stat-DcNP6bcO.js} +1 -1
- package/dist/showcase/assets/input-DJAWOJEx.js +1 -0
- package/dist/showcase/assets/{input-BPDdWrB1.js → input-NIgvB9CZ.js} +1 -1
- package/dist/showcase/assets/{input-group-BYZYeQ7j.js → input-group-BmqJ20bA.js} +1 -1
- package/dist/showcase/assets/{input-group-YIWmmLJ6.js → input-group-gOUubhee.js} +1 -1
- package/dist/showcase/assets/inputs-Dk8YOVkI.js +155 -0
- package/dist/showcase/assets/{invoice-header-B00JrPAb.js → invoice-header-BnNpWej2.js} +2 -2
- package/dist/showcase/assets/{invoice-items-CUt5D3Wz.js → invoice-items-BdPmW10L.js} +2 -2
- package/dist/showcase/assets/{invoice-mini-CRoaQ9g9.js → invoice-mini-CbSYyHIb.js} +2 -2
- package/dist/showcase/assets/{invoice-table-DYNnDTQl.js → invoice-table-DjnWG3KF.js} +2 -2
- package/dist/showcase/assets/isSameDay-B2KDl_YX.js +1 -0
- package/dist/showcase/assets/isToday-CXNS7ELW.js +1 -0
- package/dist/showcase/assets/{italic-AbetEb3d.js → italic-BRS-PpYL.js} +1 -1
- package/dist/showcase/assets/{item-BJOYyqeO.js → item--6Hx9AXZ.js} +1 -1
- package/dist/showcase/assets/{item-BGA6_5Zh.js → item-BszVRzXj.js} +2 -2
- package/dist/showcase/assets/{item-CbiuwbAN.js → item-YF6wMI9W.js} +1 -1
- package/dist/showcase/assets/{kanban-Br-Yz002.js → kanban-BWBbWLVe.js} +2 -2
- package/dist/showcase/assets/{label-BlCKlLE-.js → label-BgpcD3V6.js} +1 -1
- package/dist/showcase/assets/{languages-CKcUvHnt.js → languages-DDgmIDFe.js} +1 -1
- package/dist/showcase/assets/{layers-CakZLRSD.js → layers-nkkXRmvA.js} +1 -1
- package/dist/showcase/assets/{layout-app-shell-ukDXqPxC.js → layout-app-shell-D3MbPoGC.js} +2 -2
- package/dist/showcase/assets/{layout-auth-BFza65L3.js → layout-auth-DIeRtG0B.js} +4 -4
- package/dist/showcase/assets/{layout-containers-v1jG_b7r.js → layout-containers-Dc3-IAgV.js} +2 -2
- package/dist/showcase/assets/{layout-header-CqBf9wjY.js → layout-header-Cg6GfMST.js} +2 -2
- package/dist/showcase/assets/{layout-page-WJcljCac.js → layout-page-DojPq8S6.js} +2 -2
- package/dist/showcase/assets/layout-primitives-JBSQS72B.js +34 -0
- package/dist/showcase/assets/{layout-sidebar-DL6TLuQC.js → layout-sidebar-C6jUJRhx.js} +2 -2
- package/dist/showcase/assets/{layout-users-B8qpsvV9.js → layout-users-uzPscfo7.js} +2 -2
- package/dist/showcase/assets/{layout-workspace-iOKZ4-9K.js → layout-workspace-B3leaOKl.js} +2 -2
- package/dist/showcase/assets/{lock-Dn4-vUBz.js → lock-DLIcOBUd.js} +1 -1
- package/dist/showcase/assets/{lock-keyhole-M6KZ_7RC.js → lock-keyhole-DY6aV7Mq.js} +1 -1
- package/dist/showcase/assets/{mail-w1nhszbW.js → mail-AES_tOd2.js} +1 -1
- package/dist/showcase/assets/{mail-check-DXqQwivW.js → mail-check-dJTzg2bD.js} +1 -1
- package/dist/showcase/assets/{map-CquesVXo.js → map-CZ2l0iGH.js} +1 -1
- package/dist/showcase/assets/{map-pin-DUl-Lt6t.js → map-pin-0O7GD5Dz.js} +1 -1
- package/dist/showcase/assets/{media-library-CCJBQRPu.js → media-library-CRllxSGQ.js} +3 -3
- package/dist/showcase/assets/mention-inline-suggestions-Dx2Z1GHF.js +1 -0
- package/dist/showcase/assets/{mentions-Ea4pSJqG.js → mentions-CDqqGCE4.js} +2 -2
- package/dist/showcase/assets/menus-CDgE79I5.js +165 -0
- package/dist/showcase/assets/{message-square-B0RnrJV6.js → message-square-CBNI_sf8.js} +1 -1
- package/dist/showcase/assets/{metadata-list-fm8e58ID.js → metadata-list-BoEVt7cX.js} +1 -1
- package/dist/showcase/assets/{metadata-list-DkN9yfTj.js → metadata-list-NtWuY9W8.js} +4 -4
- package/dist/showcase/assets/{metric-guQTLTAa.js → metric-Bx_LWobe.js} +1 -1
- package/dist/showcase/assets/{metric-bar-BydkmggA.js → metric-bar-BldYHNLQ.js} +1 -1
- package/dist/showcase/assets/{metric-grid-BKjrYpt9.js → metric-grid-BDw7w7d2.js} +1 -1
- package/dist/showcase/assets/{metric-trend-chip-DehaJ3nC.js → metric-trend-chip-lSjDkUEo.js} +1 -1
- package/dist/showcase/assets/{metrics-analytics-bar-YjwFT4ae.js → metrics-analytics-bar-CCFhTmQZ.js} +1 -1
- package/dist/showcase/assets/{metrics-analytics-cards-B6DspERM.js → metrics-analytics-cards-C1AjZqJU.js} +2 -2
- package/dist/showcase/assets/{metrics-comparison-Nru5wypZ.js → metrics-comparison-vEE6BtuW.js} +2 -2
- package/dist/showcase/assets/{metrics-heatmap-CcumN0Or.js → metrics-heatmap-DKkz8ibX.js} +2 -2
- package/dist/showcase/assets/{metrics-inline-badge-2WB7w9mz.js → metrics-inline-badge-CZmVnReB.js} +2 -2
- package/dist/showcase/assets/{metrics-kpi-row-jU3hsB3C.js → metrics-kpi-row-s2FYIYB1.js} +2 -2
- package/dist/showcase/assets/{metrics-micro-grid-CaJ99RXL.js → metrics-micro-grid-DDlCl9Ep.js} +2 -2
- package/dist/showcase/assets/{metrics-overview-Sa7z6jct.js → metrics-overview-BgliK2L1.js} +2 -2
- package/dist/showcase/assets/{metrics-stat-cards-PLvMkA0M.js → metrics-stat-cards-Cn5sRZsB.js} +1 -1
- package/dist/showcase/assets/minus-DByvcC8K.js +1 -0
- package/dist/showcase/assets/{money-display-23DKz-jK.js → money-display-DG4IaEaA.js} +1 -1
- package/dist/showcase/assets/{month-year-picker-oEoInnKW.js → month-year-picker-CVurc9L7.js} +1 -1
- package/dist/showcase/assets/{navigation-Dufz6qnF.js → navigation-CHYgQTsY.js} +2 -2
- package/dist/showcase/assets/{navigation-Ds60FMAs.js → navigation-C_6gS4FA.js} +3 -3
- package/dist/showcase/assets/{navigation-extras-DKufT82I.js → navigation-extras-CflOar2P.js} +2 -2
- package/dist/showcase/assets/{onboarding-checklist-DSkS2ktA.js → onboarding-checklist-CYiciKwv.js} +2 -2
- package/dist/showcase/assets/{overlays-BptoR4sm.js → overlays-HrH2wdTK.js} +2 -2
- package/dist/showcase/assets/overlays-cp7VMq3b.js +159 -0
- package/dist/showcase/assets/{package-0ZgMoFm1.js → package-CjcwDJKu.js} +1 -1
- package/dist/showcase/assets/{package-check-CT0dhSM8.js → package-check-CCH3ax-x.js} +1 -1
- package/dist/showcase/assets/{page-action-button-DrHJKFbp.js → page-action-button-Cn5j2_EP.js} +1 -1
- package/dist/showcase/assets/page-header-CkvCF1MQ.js +1 -0
- package/dist/showcase/assets/{pagination-CxuA2zkE.js → pagination-DM5QGPo2.js} +1 -1
- package/dist/showcase/assets/{pagination-DsPLs2Tx.js → pagination-DUzHnhJ6.js} +1 -1
- package/dist/showcase/assets/{paperclip-CDMZ_JAo.js → paperclip-DoqDQQVa.js} +1 -1
- package/dist/showcase/assets/{password-input-BVaUPw7a.js → password-input-CfS4sfCl.js} +1 -1
- package/dist/showcase/assets/{pencil-BouoJ5x7.js → pencil-C2OfFQMj.js} +1 -1
- package/dist/showcase/assets/{phone-DCNFH5yg.js → phone-CLvml_XI.js} +1 -1
- package/dist/showcase/assets/plus-D5swsZCz.js +1 -0
- package/dist/showcase/assets/{popover-menu-CuA8fb7i.js → popover-menu-Bu9q96nE.js} +1 -1
- package/dist/showcase/assets/{popover-CECpX3MQ.js → popover-nCGXR4Yd.js} +1 -1
- package/dist/showcase/assets/popover-xC8qczvP.js +1 -0
- package/dist/showcase/assets/{products-BJHNTW62.js → products-BbSzEFvw.js} +2 -2
- package/dist/showcase/assets/progress-DYfoy7pk.js +1 -0
- package/dist/showcase/assets/{progress-tpxRVOkp.js → progress-ENNwjW3X.js} +1 -1
- package/dist/showcase/assets/{props-table-BR-KjRNe.js → props-table-2pIZzGC-.js} +1 -1
- package/dist/showcase/assets/{props.generated-qdUud3iu.json → props.generated-DggzG-JL.json} +3 -3
- package/dist/showcase/assets/{quote-CN-Sodsj.js → quote-BO1bufuX.js} +1 -1
- package/dist/showcase/assets/{receipt-T8B9lscp.js → receipt-kIVP3kxJ.js} +1 -1
- package/dist/showcase/assets/{receipt-text-CeBruM29.js → receipt-text-BDQIvI4l.js} +1 -1
- package/dist/showcase/assets/{refresh-cw-DnxNcOMm.js → refresh-cw-UdL93poQ.js} +1 -1
- package/dist/showcase/assets/resolveAriaLabelledBy-iFo8AzEr.js +1 -0
- package/dist/showcase/assets/resolveValueLabel-DfiI3G4i.js +1 -0
- package/dist/showcase/assets/{rich-text-editor-Bha0lSKT.js → rich-text-editor-CNtfwLC2.js} +1 -1
- package/dist/showcase/assets/{rich-text-editor-NeOPmoZF.js → rich-text-editor-DB4QWptQ.js} +3 -3
- package/dist/showcase/assets/rotate-ccw-DQPoMfMY.js +1 -0
- package/dist/showcase/assets/{save-AT8JlA8E.js → save-Cd0ZM40i.js} +1 -1
- package/dist/showcase/assets/{schema-form-BpkVygoO.js → schema-form-Cyc6vCVO.js} +2 -2
- package/dist/showcase/assets/{scroll-area-B0wmaMAD.js → scroll-area-B5NZsDdi.js} +1 -1
- package/dist/showcase/assets/scroll-area-BvTq99pz.js +1 -0
- package/dist/showcase/assets/{select-t6dryszf.js → select-BRbyPtx8.js} +1 -1
- package/dist/showcase/assets/select-Dymyvyh6.js +1 -0
- package/dist/showcase/assets/{send-BzGRF4t-.js → send-BWzI7mwi.js} +1 -1
- package/dist/showcase/assets/{separator-BjGdXNcn.js → separator-BsYPzBlF.js} +1 -1
- package/dist/showcase/assets/{separator-DbiGagrP.js → separator-Osp0OJ78.js} +1 -1
- package/dist/showcase/assets/{settings-BSRT_96A.js → settings-DRmWJILI.js} +1 -1
- package/dist/showcase/assets/{sheet-CEuKOBxr.js → sheet-BKsjMYMo.js} +1 -1
- package/dist/showcase/assets/{shield-CcR2q5u_.js → shield-D1EaWJMG.js} +1 -1
- package/dist/showcase/assets/{shield-alert-DhbgXV1X.js → shield-alert-DWsbR2jn.js} +1 -1
- package/dist/showcase/assets/{shield-check-CRbBJXw2.js → shield-check-DUTAPADm.js} +1 -1
- package/dist/showcase/assets/{shopping-bag-B5BzpLV5.js → shopping-bag-XmeqUqk9.js} +1 -1
- package/dist/showcase/assets/sidebar-B5uO9sUB.js +1 -0
- package/dist/showcase/assets/{sidebar.context-BCb20eIt.js → sidebar.context-CRjgeYJL.js} +1 -1
- package/dist/showcase/assets/{skeleton-BeVdks4r.js → skeleton-BtiPkfxB.js} +1 -1
- package/dist/showcase/assets/{skeleton-DijlT51X.js → skeleton-DbybIpkV.js} +1 -1
- package/dist/showcase/assets/slider-vuwVVBby.js +1 -0
- package/dist/showcase/assets/{sliders-horizontal-C8RwUn0S.js → sliders-horizontal-BE_cwUn0.js} +1 -1
- package/dist/showcase/assets/{smart-card-B4P_C0nk.js → smart-card-Dhu_1A_u.js} +1 -1
- package/dist/showcase/assets/{sonner-CLYYRmEW.js → sonner-DZB-G4q5.js} +2 -2
- package/dist/showcase/assets/{sortable.esm-CoekVJlU.js → sortable.esm-YOwRw8Hr.js} +1 -1
- package/dist/showcase/assets/{sparkles-DFJmoAFP.js → sparkles-N8rqKQez.js} +1 -1
- package/dist/showcase/assets/{spinner-DMKANM9S.js → spinner-B5zKCNXu.js} +2 -2
- package/dist/showcase/assets/{spinner-WEI7TMVk.js → spinner-BOjRziLu.js} +1 -1
- package/dist/showcase/assets/{spinner-CeQHboSs.js → spinner-PIr8y8av.js} +1 -1
- package/dist/showcase/assets/{square-pen-CfvmmXYo.js → square-pen-ImRrVwT8.js} +1 -1
- package/dist/showcase/assets/{stacked-avatars-CcCnnUrA.js → stacked-avatars-DnIAc098.js} +1 -1
- package/dist/showcase/assets/{star-DK5onZCp.js → star-BaV-UTPq.js} +1 -1
- package/dist/showcase/assets/startOfDay-CtTeiGV0.js +1 -0
- package/dist/showcase/assets/stringifyLocale-CkHjdQTJ.js +1 -0
- package/dist/showcase/assets/{styles-BStlbPXe.js → styles-Bv0pDLVi.js} +1 -1
- package/dist/showcase/assets/{suggestions-Cd_XUmz3.js → suggestions-QnLPdgnG.js} +2 -2
- package/dist/showcase/assets/switch-DwAS_TXx.js +1 -0
- package/dist/showcase/assets/{switch-arjWj-n7.js → switch-xzxCDtyg.js} +1 -1
- package/dist/showcase/assets/{sync-DorQdMfx.js → sync-LeYxWAap.js} +2 -2
- package/dist/showcase/assets/{table-ClYkDRAk.js → table-BbEFanNu.js} +1 -1
- package/dist/showcase/assets/{table-D9q0odD8.js → table-CVVHBty6.js} +5 -5
- package/dist/showcase/assets/{table-actions-UJbkGb44.js → table-actions-DvI9U67L.js} +1 -1
- package/dist/showcase/assets/tabs-CLcyGwLd.js +1 -0
- package/dist/showcase/assets/{tabs-BENBPFif.js → tabs-ck8y1Bjr.js} +1 -1
- package/dist/showcase/assets/{tags-input-DRlg3zQH.js → tags-input-DmBY2CKI.js} +1 -1
- package/dist/showcase/assets/{text-button-CQvP6Kic.js → text-button-C54O1rZM.js} +1 -1
- package/dist/showcase/assets/{text-link-DT-nOORV.js → text-link-9_mZpq_f.js} +1 -1
- package/dist/showcase/assets/{textarea-BGHGV17m.js → textarea-CHvnWHWH.js} +1 -1
- package/dist/showcase/assets/{textarea-pstF1OBP.js → textarea-jexcMklP.js} +1 -1
- package/dist/showcase/assets/{timelines-D8y-IyxW.js → timelines-uvFVjEQv.js} +2 -2
- package/dist/showcase/assets/toggle-group-B3fORi8i.js +1 -0
- package/dist/showcase/assets/{toggles-dhLpAHSR.js → toggles-Cox6Yk2k.js} +1 -1
- package/dist/showcase/assets/{toggles-group-BJ5Jio2p.js → toggles-group-CSvSPqCB.js} +1 -1
- package/dist/showcase/assets/{trash-2-OsaEm8cc.js → trash-2-CE9bDw49.js} +1 -1
- package/dist/showcase/assets/trending-up-0iJl0XvC.js +1 -0
- package/dist/showcase/assets/{truck-CvvBxBeB.js → truck-DlhOPoCD.js} +1 -1
- package/dist/showcase/assets/{typography-D_99bjSh.js → typography-BotOITw4.js} +17 -17
- package/dist/showcase/assets/{ui-badge-C1bu7wRu.js → ui-badge-hfmO1K3-.js} +2 -2
- package/dist/showcase/assets/{ui-card-Ct1FFUxv.js → ui-card-Aigzxhn3.js} +1 -1
- package/dist/showcase/assets/{ui-table-Dxu9Jjq0.js → ui-table-CKif9sNO.js} +1 -1
- package/dist/showcase/assets/{upload-tray-BeOBVU1z.js → upload-tray-BnKDNrw9.js} +3 -3
- package/dist/showcase/assets/{use-layout-link-BK_oEoBg.js → use-layout-link-BQ6Y9z__.js} +1 -1
- package/dist/showcase/assets/useAnchoredPopupScrollLock-CP1vkwD7.js +1 -0
- package/dist/showcase/assets/useAriaLabelledBy-J_Rvjwx3.js +1 -0
- package/dist/showcase/assets/useCollapsiblePanel-BwUOowW2.js +1 -0
- package/dist/showcase/assets/useCompositeItem-D3XOIML-.js +1 -0
- package/dist/showcase/assets/useCompositeListItem-BWfShNPP.js +1 -0
- package/dist/showcase/assets/useControlled-BF8maje6.js +1 -0
- package/dist/showcase/assets/useLabelableId-DxorZ3YW.js +1 -0
- package/dist/showcase/assets/useOpenInteractionType-DLUX6CcH.js +1 -0
- package/dist/showcase/assets/useRender-B9zzqKA1.js +1 -0
- package/dist/showcase/assets/useTriggerFocusGuards-BSvL8pKg.js +1 -0
- package/dist/showcase/assets/useValueChanged-DSoTBFAJ.js +1 -0
- package/dist/showcase/assets/user-BZog6aIh.js +1 -0
- package/dist/showcase/assets/{user-plus-MMxrhI4h.js → user-plus-CPxlPoxf.js} +1 -1
- package/dist/showcase/assets/{users-ERTaffcv.js → users-BgXAp2UO.js} +1 -1
- package/dist/showcase/assets/valueToPercent-gleKSaFe.js +1 -0
- package/dist/showcase/assets/{vendor-profile-BAwCE0wP.js → vendor-profile-BLYiDIrO.js} +2 -2
- package/dist/showcase/assets/{video-DJm0ubTE.js → video-YBnCbmIb.js} +1 -1
- package/dist/showcase/assets/{wrench-gaXnvr_b.js → wrench-BFTavxzg.js} +1 -1
- package/dist/showcase/assets/x-D8UN9pOu.js +1 -0
- package/dist/showcase/assets/{zap-DHBVTfYZ.js → zap-DIJUAJEb.js} +1 -1
- package/dist/showcase/index.html +2 -2
- package/dist/style.css +1 -1
- package/package.json +5 -2
- package/dist/_shared/header-BUAddfdE.js.map +0 -1
- package/dist/_shared/header-BnxWOiNm.cjs +0 -2
- package/dist/_shared/header-BnxWOiNm.cjs.map +0 -1
- package/dist/_shared/sidebar-BML5ZZ5s.js.map +0 -1
- package/dist/_shared/sidebar-C89O5ho_.cjs +0 -2
- package/dist/_shared/sidebar-C89O5ho_.cjs.map +0 -1
- package/dist/showcase/assets/CSPContext-ImKusJJ_.js +0 -1
- package/dist/showcase/assets/CompositeItem-DleE4kTc.js +0 -1
- package/dist/showcase/assets/CompositeRoot-BbNkvtLz.js +0 -1
- package/dist/showcase/assets/DialogTrigger-C0DB0bXw.js +0 -1
- package/dist/showcase/assets/FieldItemContext-CFTR-INZ.js +0 -1
- package/dist/showcase/assets/FormContext-lmjYAh4E.js +0 -1
- package/dist/showcase/assets/LabelableContext-CDv6gSfU.js +0 -1
- package/dist/showcase/assets/RadioGroup-C-0MNAYY.js +0 -1
- package/dist/showcase/assets/Separator-KsPLUEno.js +0 -1
- package/dist/showcase/assets/ToolbarRootContext-AV8xAl2m.js +0 -1
- package/dist/showcase/assets/accordion-variants-CVT_62VO.js +0 -1
- package/dist/showcase/assets/app-sidebar-DixqrLf2.js +0 -1
- package/dist/showcase/assets/arrow-down-CYh_aUsd.js +0 -1
- package/dist/showcase/assets/arrow-left-pYYsNkZE.js +0 -1
- package/dist/showcase/assets/arrow-right-Bf1Tl6D5.js +0 -1
- package/dist/showcase/assets/arrow-up-BhmQRZs9.js +0 -1
- package/dist/showcase/assets/arrow-up-right-CuAsO3-r.js +0 -1
- package/dist/showcase/assets/avatar-5EFTnHEG.js +0 -1
- package/dist/showcase/assets/checkbox-fwuAAaUZ.js +0 -1
- package/dist/showcase/assets/chevron-down-CSn8HCwf.js +0 -1
- package/dist/showcase/assets/chevron-left-Ddj6-KOu.js +0 -1
- package/dist/showcase/assets/chevron-right-d-umkBru.js +0 -1
- package/dist/showcase/assets/chevron-up-CeFY6O0I.js +0 -1
- package/dist/showcase/assets/chevrons-up-down-Ck3rUZtc.js +0 -1
- package/dist/showcase/assets/circle-Dy08kACD.js +0 -1
- package/dist/showcase/assets/circle-check-TT7cFQrr.js +0 -1
- package/dist/showcase/assets/circle-check-big-4RnJfeaC.js +0 -1
- package/dist/showcase/assets/circle-dot-CvoDXS-W.js +0 -1
- package/dist/showcase/assets/clock-3-DDEsD4Tb.js +0 -1
- package/dist/showcase/assets/clock-DuBsP5t3.js +0 -1
- package/dist/showcase/assets/collapsible-DagkA3To.js +0 -1
- package/dist/showcase/assets/command-BtaMPVtf.js +0 -45
- package/dist/showcase/assets/comment-item-Ctcpx1GX.js +0 -1
- package/dist/showcase/assets/display-DTaQWVJp.js +0 -403
- package/dist/showcase/assets/dropdown-menu-bPWrLPgm.js +0 -1
- package/dist/showcase/assets/enhanced-combobox-Cs_-wq9p.js +0 -1
- package/dist/showcase/assets/example-BIrQab7K.js +0 -1
- package/dist/showcase/assets/feature-announcement-0dOcSH7F.js +0 -34
- package/dist/showcase/assets/getPseudoElementBounds-Bznj386s.js +0 -1
- package/dist/showcase/assets/header-notifications-3VH9lzzJ.js +0 -1
- package/dist/showcase/assets/index-ADfexGMA.css +0 -2
- package/dist/showcase/assets/inertValue-BVXUUuS4.js +0 -1
- package/dist/showcase/assets/input-BzafMIDj.js +0 -1
- package/dist/showcase/assets/inputs-DjzrYJdb.js +0 -49
- package/dist/showcase/assets/isSameDay-DVNkwpSk.js +0 -1
- package/dist/showcase/assets/isToday-DZ1HTCty.js +0 -1
- package/dist/showcase/assets/mention-inline-suggestions-DyW6IwL8.js +0 -1
- package/dist/showcase/assets/menus-CJjtE4fD.js +0 -89
- package/dist/showcase/assets/minus-OyRBql2C.js +0 -1
- package/dist/showcase/assets/overlays-CVGJ_FEg.js +0 -88
- package/dist/showcase/assets/page-header-CikNDnqI.js +0 -1
- package/dist/showcase/assets/plus-DkHZm34I.js +0 -1
- package/dist/showcase/assets/popover-BSB11Qjp.js +0 -1
- package/dist/showcase/assets/progress-DGvRQyPS.js +0 -1
- package/dist/showcase/assets/resolveAriaLabelledBy-B2ZzrlGb.js +0 -1
- package/dist/showcase/assets/resolveValueLabel-CGuVi0Dj.js +0 -1
- package/dist/showcase/assets/rotate-ccw-7aUlKQpX.js +0 -1
- package/dist/showcase/assets/scroll-area-CgXTHlpJ.js +0 -1
- package/dist/showcase/assets/select-BG_Iad8E.js +0 -1
- package/dist/showcase/assets/sidebar--2nHUTn3.js +0 -1
- package/dist/showcase/assets/slider-Cp4m3NTK.js +0 -1
- package/dist/showcase/assets/startOfDay-BuizEr24.js +0 -1
- package/dist/showcase/assets/switch-5f1vwEZ7.js +0 -1
- package/dist/showcase/assets/tabs-ePpje8sU.js +0 -1
- package/dist/showcase/assets/toggle-group-BVyFo04r.js +0 -1
- package/dist/showcase/assets/trending-up-HlQQXTth.js +0 -1
- package/dist/showcase/assets/useAnchoredPopupScrollLock-DLXArfPo.js +0 -1
- package/dist/showcase/assets/useAriaLabelledBy-etINba8U.js +0 -1
- package/dist/showcase/assets/useCollapsiblePanel-BNe9r1t_.js +0 -1
- package/dist/showcase/assets/useCompositeItem-CvG1CBEV.js +0 -1
- package/dist/showcase/assets/useCompositeListItem-CcY0U1bY.js +0 -1
- package/dist/showcase/assets/useControlled-Cpg8gDqb.js +0 -1
- package/dist/showcase/assets/useLabelableId-Czdg4nY8.js +0 -1
- package/dist/showcase/assets/useOpenInteractionType-eyZ6twES.js +0 -1
- package/dist/showcase/assets/useRender-BAZlIYnj.js +0 -1
- package/dist/showcase/assets/useTriggerFocusGuards-C2I8g7TT.js +0 -1
- package/dist/showcase/assets/useValueChanged-Bz3WRSDy.js +0 -1
- package/dist/showcase/assets/user-Bqmz8M16.js +0 -1
- package/dist/showcase/assets/valueToPercent-B5BHWU68.js +0 -1
- package/dist/showcase/assets/x-BqJnRkKw.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./chunk-QTnfLwEv.js";import{n,t as r}from"./react-dom-Bz4cALsF.js";import{Er as i,hr as a,jr as o,mr as s,r as c,t as l,yr as u}from"./example-BIrQab7K.js";import{t as d}from"./arrow-left-pYYsNkZE.js";import{t as f}from"./arrow-right-Bf1Tl6D5.js";import{t as p}from"./circle-check-TT7cFQrr.js";import{n as m,t as h}from"./dropzone-Bl7RO_Uk.js";import{t as g}from"./file-Dc5UHkfE.js";import{t as _}from"./image-Byz-p7hT.js";import{t as v}from"./info-DFu8OfxV.js";import{t as y}from"./layers-CakZLRSD.js";import{t as b}from"./lock-Dn4-vUBz.js";import{t as x}from"./plus-DkHZm34I.js";import{t as ee}from"./star-DK5onZCp.js";import{t as S}from"./trash-2-OsaEm8cc.js";import{t as C}from"./video-DJm0ubTE.js";import{t as w}from"./x-BqJnRkKw.js";import{a as T,i as E,k as te,n as D,s as ne}from"./index-Cz4UGUT2.js";import{t as O}from"./props-table-BR-KjRNe.js";import{i as k,r as A,t as j}from"./alert-DIelf1qF.js";import{t as re}from"./smart-card-B4P_C0nk.js";import{t as M}from"./input-BPDdWrB1.js";import{t as N}from"./select-t6dryszf.js";import{n as P}from"./switch-arjWj-n7.js";import{n as F}from"./form-field-Cxm4APa9.js";import{t as ie}from"./dialog-B85US9Ue.js";var ae=T(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),oe=T(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),se=T(`images`,[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]),ce=T(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),I=T(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),le={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 L(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 R=t(n(),1),z={collection:void 0,tags:[],public:!0},ue=[],B={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 V(e){return{...B,...e??{}}}function H(e){return!e||e<=0?``:e>=1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function U(e,t){let n=t.getWidth(e),r=t.getHeight(e);return!n||!r?``:`${n} x ${r}`}function W(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 de(e){return e.type.startsWith(`image/`)?`image`:e.type.startsWith(`video/`)?`video`:`file`}function fe(e){if(e.type.startsWith(`image/`)&&!(typeof URL>`u`||typeof URL.createObjectURL!=`function`))return URL.createObjectURL(e)}function pe(e){!e||typeof URL>`u`||typeof URL.revokeObjectURL!=`function`||URL.revokeObjectURL(e)}function me(e){return Array.isArray(e)?{items:e,total:e.length}:e}function he(e,t){return t&&typeof e==`object`&&e?{...e,...t}:e}function ge(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 _e(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)=>W(n,t)-W(e,t)),r}function ve({items:e=ue,fetcher:t,accessors:n,selectionMode:r=`multiple`,value:i,defaultValue:a=[],onValueChange:o,onItemUpdate:s,onItemDelete:c,onUpload:l,onError:u,initialTab:d=`library`,defaultView:f=`grid`,defaultQuery:p=``,defaultType:m=`all`,defaultCollection:h=`all`,defaultSort:g=`newest`,defaultUploadOptions:_}={}){let v=(0,R.useMemo)(()=>V(n),[n]),[y,b]=(0,R.useState)(d),[x,ee]=(0,R.useState)(f),[S,C]=(0,R.useState)(p),[w,T]=(0,R.useState)(m),[E,te]=(0,R.useState)(h),[D,ne]=(0,R.useState)(g),[O,k]=(0,R.useState)(null),[A,j]=(0,R.useState)(()=>[...a]),[re,M]=(0,R.useState)([]),[N,P]=(0,R.useState)(),[F,ie]=(0,R.useState)(!1),[ae,oe]=(0,R.useState)(null),[se,ce]=(0,R.useState)([]),[I,le]=(0,R.useState)(()=>new Set),[L,B]=(0,R.useState)({}),[H,U]=(0,R.useState)([]),[W,ve]=(0,R.useState)(!1),[G,ye]=(0,R.useState)({...z,..._,tags:_?.tags??z.tags}),be=i!==void 0,K=(0,R.useMemo)(()=>be?[...i??[]]:A,[A,be,i]),q=(0,R.useMemo)(()=>new Set(K),[K]),xe=(0,R.useRef)(new Set);(0,R.useEffect)(()=>{if(!t)return;let e=new AbortController;return ie(!0),oe(null),t({query:S,type:w,collection:E===`all`?void 0:E,sort:D,signal:e.signal}).then(t=>{if(e.signal.aborted)return;let n=me(t);M(n.items),P(n.total)}).catch(t=>{e.signal.aborted||(oe(t),u?.(t))}).finally(()=>{e.signal.aborted||ie(!1)}),()=>e.abort()},[E,t,u,S,D,w]),(0,R.useEffect)(()=>{let e=xe.current;return()=>{for(let t of e)pe(t);e.clear()}},[]);let Se=(0,R.useMemo)(()=>t?re:[...se,...e],[se,re,t,e]),J=(0,R.useMemo)(()=>Se.filter(e=>!I.has(v.getId(e))).map(e=>he(e,L[v.getId(e)])),[v,L,I,Se]),Ce=(0,R.useMemo)(()=>{let e=t?J:ge(J,v,S,w,E);return t?e:_e(e,v,D)},[v,E,t,J,S,D,w]),we=N??J.length,Te=Ce.length,Ee=(0,R.useMemo)(()=>J.filter(e=>q.has(v.getId(e))),[v,J,q]),De=!!S.trim()||w!==`all`||E!==`all`,Y=(0,R.useCallback)(e=>{be||j(e);let t=new Set(e),n=J.filter(e=>t.has(v.getId(e)));o?.(e,n)},[v,be,o,J]),Oe=(0,R.useCallback)(e=>{let t=new Set(r===`single`?[]:q);q.has(e)&&r!==`single`?t.delete(e):t.add(e),Y(Array.from(t))},[Y,q,r]),ke=(0,R.useCallback)(()=>Y([]),[Y]),Ae=(0,R.useCallback)(()=>{C(``),T(`all`),te(`all`)},[]),je=(0,R.useCallback)(e=>{U(t=>[...t,...e.map((e,t)=>{let n=fe(e);return n&&xe.current.add(n),{id:`staged-${Date.now()}-${t}`,file:e,name:e.name,size:e.size,type:de(e),src:n,progress:0,status:`staged`}})])},[]),Me=(0,R.useCallback)(e=>{U(t=>{let n=t.find(t=>t.id===e);return n?.src&&(pe(n.src),xe.current.delete(n.src)),t.filter(t=>t.id!==e)})},[]),Ne=(0,R.useCallback)(()=>{U(e=>{for(let t of e)t.src&&(pe(t.src),xe.current.delete(t.src));return[]})},[]),Pe=(0,R.useCallback)(e=>{ye(t=>({...t,...e}))},[]),Fe=(0,R.useCallback)((e,t)=>{U(n=>n.map(n=>n.id===e?{...n,...t}:n))},[]);return{tab:y,setTab:b,view:x,setView:ee,query:S,setQuery:C,type:w,setType:T,collection:E,setCollection:te,sort:D,setSort:ne,detailId:O,setDetailId:k,items:J,visibleItems:Ce,selectedIds:K,selectedItems:Ee,selectedSet:q,toggleSelection:Oe,clearSelection:ke,clearFilters:Ae,loading:F,error:ae,hasFilters:De,totalCount:we,filteredCount:Te,stagedFiles:H,addFiles:je,removeStagedFile:Me,clearStagedFiles:Ne,updateUploadOptions:Pe,uploadOptions:G,uploading:W,startUpload:(0,R.useCallback)(async()=>{if(W||H.length===0)return;ve(!0),U(e=>e.map(e=>({...e,status:`uploading`,progress:0})));let e={setProgress:(e,t)=>{Fe(e,{progress:Math.max(0,Math.min(100,t))})},setFileStatus:(e,t,n)=>Fe(e,{status:t,error:n})};try{let t=H.map(e=>e.file),n=await l?.(t,G,e);if(U(e=>e.map(e=>({...e,status:`done`,progress:100}))),n?.length){ce(e=>[...n,...e]);let e=n.map(e=>v.getId(e));Y(r===`single`?e.slice(0,1):Array.from(new Set([...e,...K])))}Ne(),b(`library`)}catch(e){oe(e),U(e=>e.map(e=>e.status===`uploading`?{...e,status:`error`,error:`Upload failed`}:e)),u?.(e)}finally{ve(!1)}},[v,Y,Ne,u,l,K,r,Fe,H,G,W]),updateItem:(0,R.useCallback)((e,t)=>{let n=v.getId(e);B(e=>({...e,[n]:{...e[n],...t}})),s?.(e,t)},[v,s]),removeItem:(0,R.useCallback)(e=>{let t=v.getId(e);le(e=>new Set(e).add(t)),q.has(t)&&Y(K.filter(e=>e!==t)),c?.(e)},[v,Y,c,K,q]),accessors:v}}var G=ne();function ye(e,t){return e===`image`?(0,G.jsx)(_,{className:t??`size-4`}):e===`video`?(0,G.jsx)(C,{className:t??`size-4`}):(0,G.jsx)(g,{className:t??`size-4`})}function be(e,t){return e===`image`?t.typeImage:e===`video`?t.typeVideo:t.typeFile}function K(e,t){return e?L(t.usedIn,{count:e}):t.notUsed}function q({children:e,tint:t,className:n}){return(0,G.jsx)(`div`,{className:D(`media-library-preview relative overflow-hidden bg-muted`,n),style:t?{background:t}:void 0,children:e})}function xe({src:e,alt:t,type:n,className:r,loading:i=`lazy`}){let[a,o]=(0,R.useState)(!1);return(0,R.useEffect)(()=>{o(!1)},[e]),!e||a?(0,G.jsx)(`div`,{className:`media-library-preview--fallback flex size-full items-center justify-center text-muted-foreground`,children:ye(n,`size-6`)}):(0,G.jsx)(`img`,{src:e,alt:t,loading:i,className:r,onError:()=>o(!0)})}function Se({icon:e,title:t,description:n,action:r,className:a}){return(0,G.jsxs)(`div`,{className:D(`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`,a),children:[(0,G.jsx)(`div`,{className:`mb-3 inline-flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:e??(0,G.jsx)(_,{className:`size-5`})}),(0,G.jsx)(i,{tag:`div`,weight:`semibold`,children:t}),!!n&&(0,G.jsx)(i,{type:`secondary`,size:`xs`,className:`mt-1 max-w-sm`,children:n}),!!r&&(0,G.jsx)(`div`,{className:`mt-4`,children:r})]})}function J({query:e,type:t,typeFilters:n,collection:r,sort:i,view:a,collections:o=[],strings:s,onQueryChange:l,onTypeChange:u,onCollectionChange:d,onSortChange:f,onViewChange:p,onClearFilters:m,toolbarEnd:h}){let v=[{value:`all`,label:s.allTypes,icon:null},{value:`image`,label:s.images,icon:_},{value:`video`,label:s.videos,icon:C},{value:`file`,label:s.files,icon:g}].filter(e=>(n??[`all`,`image`,`video`]).includes(e.value)),y=[{value:`all`,label:s.allCollections},...o.map(e=>({value:e.value,label:String(e.label)}))],b=[{value:`newest`,label:s.sortNewest},{value:`name`,label:s.sortName},{value:`size`,label:s.sortSize},{value:`usage`,label:s.sortUsage}];return(0,G.jsxs)(`div`,{className:`media-library-toolbar--component flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`min-w-52 flex-1`,children:(0,G.jsx)(M,{value:e,onChange:e=>l(e.target.value),placeholder:s.searchPlaceholder,startIcon:E,clearable:!0,onClear:()=>l(``),strings:{clear:s.clearSearch},className:`rounded-full bg-muted/20`})}),(0,G.jsx)(`div`,{className:`media-library-toolbar--type-toggle flex h-9 items-center rounded-md bg-muted p-0.5`,role:`tablist`,"aria-label":s.typeFilterLabel,children:v.map(e=>{let n=e.icon,r=t===e.value;return(0,G.jsxs)(c,{type:`button`,role:`tab`,"aria-selected":r,variant:`secondary`,buttonStyle:`ghost`,className:D(`h-8 rounded-sm px-3 text-xs shadow-none`,r?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>u(e.value),children:[n&&(0,G.jsx)(n,{className:`size-3.5`}),e.label]},e.value)})}),(0,G.jsx)(`div`,{className:`min-w-40`,children:(0,G.jsx)(N,{value:r,options:y,onChange:e=>d(e??`all`),placeholder:s.collectionFilterLabel,"aria-label":s.collectionFilterLabel,className:`bg-background`})}),(0,G.jsx)(`div`,{className:`min-w-32`,children:(0,G.jsx)(N,{value:i,options:b,onChange:e=>f(e??`newest`),placeholder:s.sortLabel,"aria-label":s.sortLabel,className:`bg-background`})}),(0,G.jsxs)(`div`,{className:`media-library-toolbar--view-toggle ml-auto flex h-9 items-center rounded-md bg-muted p-0.5`,children:[(0,G.jsx)(c,{type:`button`,variant:a===`grid`?`dark`:`secondary`,buttonStyle:a===`grid`?`solid`:`ghost`,size:`icon-xs`,className:D(a===`grid`&&`bg-background text-foreground shadow-xs hover:bg-background`),"aria-label":s.gridView,onClick:()=>p(`grid`),children:(0,G.jsx)(ae,{className:`size-3.5`})}),(0,G.jsx)(c,{type:`button`,variant:a===`table`?`dark`:`secondary`,buttonStyle:a===`table`?`solid`:`ghost`,size:`icon-xs`,className:D(a===`table`&&`bg-background text-foreground shadow-xs hover:bg-background`),"aria-label":s.tableView,onClick:()=>p(`table`),children:(0,G.jsx)(ce,{className:`size-3.5`})})]}),!!e&&(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:m,children:s.clearFilters}),h]})}function Ce({item:e,selected:t=!1,density:n=`comfortable`,showMeta:r=!0,accessors:a,strings:s,onToggle:l,onDetails:d,className:f}){let p=a.getType(e),m=a.getName(e),h=a.getSrc(e),g=a.getAlt(e)||m,_=a.getSize(e),x=a.getUsageCount(e),ee=a.getPublic(e)===!1,S=a.getDuration(e);return(0,G.jsxs)(`div`,{"data-selected":t||void 0,"data-density":n,className:D(`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`,t&&`media-library-card--selected border-primary ring-1 ring-primary`,f),onClick:l,children:[(0,G.jsxs)(q,{tint:a.getTint(e),className:D(n===`compact`?`aspect-square`:`aspect-[4/3]`),children:[(0,G.jsx)(xe,{src:h,alt:g,type:p,className:`size-full object-cover`}),(0,G.jsx)(`span`,{className:D(`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`,t&&`bg-primary text-primary-foreground opacity-100`),"aria-hidden":`true`,children:(0,G.jsx)(o,{className:`size-3`})}),!!d&&(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`solid`,size:`icon-xs`,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":L(s.cardDetails,{name:m}),onClick:e=>{e.stopPropagation(),d()},children:(0,G.jsx)(v,{className:`size-3.5`})}),p===`video`&&!!S&&(0,G.jsxs)(u,{variant:`secondary`,className:`media-library-card--duration absolute bottom-2 left-2 bg-foreground text-background`,children:[(0,G.jsx)(I,{className:`size-3 fill-current`}),S]}),ee&&(0,G.jsx)(u,{variant:`secondary`,className:`media-library-card--private absolute bottom-2 right-2 bg-background/90`,children:(0,G.jsx)(b,{className:`size-3`})})]}),(0,G.jsxs)(`div`,{className:`media-library-card--body grid gap-1 px-3 py-2.5`,children:[(0,G.jsx)(i,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:m}),r&&(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(i,{size:`xxs`,type:`secondary`,className:`truncate`,children:H(_)||s.unknownSize}),!!x&&(0,G.jsxs)(i,{tag:`span`,size:`xxs`,type:`secondary`,className:`ml-auto inline-flex items-center gap-1`,children:[(0,G.jsx)(y,{className:`size-3`}),x]})]})]})]})}function we({items:e,selectedSet:t,accessors:n,strings:r,onToggle:a,onDetails:s}){return(0,G.jsxs)(`div`,{className:`media-library-table--component min-w-[720px]`,children:[(0,G.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,G.jsx)(`span`,{}),(0,G.jsx)(`span`,{}),(0,G.jsx)(i,{size:`xxs`,type:`secondary`,weight:`semibold`,children:r.table.name}),(0,G.jsx)(i,{size:`xxs`,type:`secondary`,weight:`semibold`,children:r.table.type}),(0,G.jsx)(i,{size:`xxs`,type:`secondary`,weight:`semibold`,children:r.table.size}),(0,G.jsx)(i,{size:`xxs`,type:`secondary`,weight:`semibold`,children:r.table.collection}),(0,G.jsx)(i,{size:`xxs`,type:`secondary`,weight:`semibold`,children:r.table.used}),(0,G.jsx)(`span`,{})]}),e.map(e=>{let l=n.getId(e),d=t.has(l),f=n.getType(e),p=n.getName(e),m=n.getSrc(e),h=n.getPublic(e)===!1;return(0,G.jsxs)(`div`,{"data-selected":d||void 0,className:D(`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`,d&&`bg-primary/10`),onClick:()=>a(l),children:[(0,G.jsx)(`span`,{className:D(`inline-flex size-5 items-center justify-center rounded-md border border-border text-transparent`,d&&`border-primary bg-primary text-primary-foreground`),"aria-hidden":`true`,children:(0,G.jsx)(o,{className:`size-3`})}),(0,G.jsx)(q,{tint:n.getTint(e),className:`size-9 rounded-md`,children:m?(0,G.jsx)(`img`,{src:m,alt:``,loading:`lazy`,className:`size-full object-cover`}):(0,G.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:ye(f,`size-4`)})}),(0,G.jsxs)(i,{tag:`div`,weight:`semibold`,size:`xs`,className:`flex min-w-0 items-center gap-1 truncate`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:p}),h&&(0,G.jsx)(b,{className:`size-3 shrink-0 text-muted-foreground`})]}),(0,G.jsx)(u,{variant:`secondary`,children:be(f,r)}),(0,G.jsx)(i,{size:`xs`,type:`secondary`,children:H(n.getSize(e))||r.unknownSize}),(0,G.jsx)(i,{size:`xs`,type:`secondary`,className:`truncate`,children:n.getCollection(e)||`-`}),(0,G.jsx)(i,{size:`xs`,type:`secondary`,children:n.getUsageCount(e)?n.getUsageCount(e):`-`}),(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,"aria-label":L(r.cardDetails,{name:p}),onClick:e=>{e.stopPropagation(),s(l)},children:(0,G.jsx)(v,{className:`size-3.5`})})]},l)})]})}function Te({item:e,collections:t=[],accessors:n,strings:r,onClose:a,onUpdate:o,onRemove:s,renderDetail:l}){if(!e)return null;let f=n.getName(e),p=n.getType(e),h=n.getSrc(e),g=n.getCollection(e)??t[0]?.value??``,_=n.getTags(e),v=n.getPublic(e)??!0,y=l?.(e,{accessors:n,update:o,remove:s,close:a});return y?(0,G.jsx)(G.Fragment,{children:y}):(0,G.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,G.jsxs)(`div`,{className:`media-library-detail-panel--header flex items-center gap-2 border-b border-border px-3 py-2.5`,children:[(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,"aria-label":r.detail.close,onClick:a,children:(0,G.jsx)(d,{className:`size-3.5`})}),(0,G.jsx)(i,{weight:`semibold`,children:r.detail.title})]}),(0,G.jsxs)(`div`,{className:`media-library-detail-panel--body grid min-h-0 gap-4 overflow-y-auto p-4`,children:[(0,G.jsxs)(q,{tint:n.getTint(e),className:`aspect-[4/3] rounded-lg border border-border`,children:[(0,G.jsx)(xe,{src:h,alt:n.getAlt(e)||f,type:p,className:`size-full object-cover`}),p===`video`&&!!n.getDuration(e)&&(0,G.jsxs)(u,{className:`absolute bottom-2 right-2 bg-foreground text-background`,children:[(0,G.jsx)(I,{className:`size-3 fill-current`}),n.getDuration(e)]})]}),(0,G.jsx)(i,{tag:`div`,weight:`semibold`,className:`break-words`,children:f}),(0,G.jsx)(`dl`,{className:`media-library-detail-panel--facts grid gap-2`,children:[[r.detail.type,be(p,r)],[r.detail.size,H(n.getSize(e))||r.unknownSize],[r.detail.dimensions,U(e,n)||`-`],[r.detail.uploaded,String(n.getUploadedAt(e)??`-`)],[r.detail.usedIn,K(n.getUsageCount(e),r)]].map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,G.jsx)(`dt`,{children:(0,G.jsx)(i,{tag:`span`,size:`xs`,type:`secondary`,children:e})}),(0,G.jsx)(`dd`,{className:`m-0 text-right`,children:(0,G.jsx)(i,{tag:`span`,size:`xs`,weight:`medium`,children:t})})]},e))}),(0,G.jsx)(F,{label:r.detail.altText,children:(0,G.jsx)(M,{value:n.getAlt(e)??``,placeholder:r.detail.altPlaceholder,onChange:e=>o({alt:e.target.value})})}),(0,G.jsx)(F,{label:r.detail.collection,children:(0,G.jsx)(N,{value:g,options:t.map(e=>({value:e.value,label:String(e.label)})),"aria-label":r.detail.collection,onChange:e=>o({collection:e})})}),(0,G.jsx)(F,{label:r.detail.tags,children:(0,G.jsx)(M,{value:_.join(`, `),placeholder:r.detail.tagsPlaceholder,onChange:e=>o({tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})}),(0,G.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,G.jsxs)(`div`,{children:[(0,G.jsx)(i,{weight:`semibold`,size:`xs`,children:r.detail.public}),(0,G.jsx)(i,{size:`xxs`,type:`secondary`,children:v?r.detail.publicHint:r.detail.privateHint})]}),(0,G.jsx)(P,{checked:v,onCheckedChange:e=>o({public:e})})]}),(0,G.jsxs)(`div`,{className:`media-library-detail-panel--actions flex flex-wrap gap-2`,children:[(0,G.jsxs)(c,{type:`button`,variant:`secondary`,buttonStyle:`outline`,children:[(0,G.jsx)(m,{className:`size-3.5`}),r.detail.replace]}),(0,G.jsxs)(c,{type:`button`,variant:`error`,buttonStyle:`ghost`,onClick:s,children:[(0,G.jsx)(S,{className:`size-3.5`}),r.detail.delete]})]})]})]})}function Ee({stagedFiles:e,uploadOptions:t,collections:n=[],uploading:r=!1,strings:a,onFiles:o,onRemoveFile:s,onOptionsChange:l,empty:d}){return(0,G.jsxs)(`div`,{className:`media-library-upload-panel--component grid gap-4 p-4`,children:[(0,G.jsx)(h,{onDrop:o,accept:`image/*,video/*`,multiple:!0,size:`base`,strings:{instruction:a.upload.dropTitle,helper:a.upload.dropHint,dragOver:a.upload.dragOver}}),e.length>0?(0,G.jsx)(`div`,{className:`media-library-upload-panel--staged grid gap-2`,children:e.map(e=>(0,G.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,G.jsx)(q,{className:`size-10 rounded-md`,children:e.src?(0,G.jsx)(`img`,{src:e.src,alt:e.name,className:`size-full object-cover`}):(0,G.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:ye(e.type,`size-4`)})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,G.jsx)(i,{weight:`semibold`,size:`xs`,className:`truncate`,children:e.name}),(0,G.jsx)(i,{size:`xxs`,type:`secondary`,className:`ml-auto shrink-0`,children:H(e.size)})]}),(e.status===`uploading`||e.status===`done`)&&(0,G.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-muted`,children:(0,G.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width]`,style:{width:`${e.progress}%`}})}),e.status===`error`&&(0,G.jsx)(i,{size:`xxs`,type:`error`,children:e.error})]}),e.status===`done`?(0,G.jsx)(u,{variant:`success`,children:a.upload.done}):e.status===`uploading`?(0,G.jsxs)(i,{size:`xxs`,type:`secondary`,className:`tabular-nums`,children:[Math.round(e.progress),`%`]}):(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:r,"aria-label":L(a.upload.removeFile,{name:e.name}),onClick:()=>s(e.id),children:(0,G.jsx)(w,{className:`size-3.5`})})]},e.id))}):d,(0,G.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,G.jsx)(F,{label:a.upload.collection,children:(0,G.jsx)(N,{value:t.collection??n[0]?.value,options:n.map(e=>({value:e.value,label:String(e.label)})),"aria-label":a.upload.collection,onChange:e=>l({collection:e})})}),(0,G.jsx)(F,{label:a.upload.tags,children:(0,G.jsx)(M,{value:t.tags.join(`, `),placeholder:a.upload.tagsPlaceholder,onChange:e=>l({tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 md:self-end`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(i,{weight:`semibold`,size:`xs`,children:a.upload.public}),(0,G.jsx)(i,{size:`xxs`,type:`secondary`,children:a.upload.publicHint})]}),(0,G.jsx)(P,{checked:t.public,onCheckedChange:e=>l({public:e})})]})]})]})}function De({tab:e,selectedIds:t,selectionMode:n,stagedFiles:r,strings:a,onClearSelection:o,className:s}){let l=t.length,u=r.reduce((e,t)=>e+t.size,0),d=r.length,f=D(`media-library-footer-summary--component flex min-w-0 items-center gap-3`,s);return e===`upload`?(0,G.jsx)(`div`,{className:f,"aria-live":`polite`,children:(0,G.jsx)(i,{size:`xs`,type:`secondary`,className:`truncate`,children:d===0?a.footer.noFiles:L(a.footer.stagedSummary,{count:d,size:H(u)})})}):(0,G.jsx)(`div`,{className:f,"aria-live":`polite`,children:l>0?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(i,{weight:`semibold`,size:`xs`,className:`whitespace-nowrap`,children:L(a.footer.selectedCount,{count:l})}),(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`xs`,onClick:o,children:a.footer.clear})]}):(0,G.jsx)(i,{size:`xs`,type:`secondary`,className:`truncate`,children:n===`single`?a.footer.pickOne:a.footer.pickMany})})}function Y({tab:e,selectedItems:t,selectedIds:n,stagedFiles:r,uploading:i=!1,strings:a,confirmLabel:o,cancelLabel:s,onCancel:l,onConfirm:u,onUpload:d,onCancelUpload:f,className:p}){let m=n.length,h=r.length;return e===`upload`?(0,G.jsxs)(`div`,{className:D(`media-library-footer-actions--component flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,p),children:[(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,disabled:i,onClick:f,children:s??a.footer.cancel}),(0,G.jsx)(c,{type:`button`,disabled:h===0||i,onClick:d,loading:i,loadingLabels:{loading:a.footer.uploading},children:h<=1?a.footer.upload:L(a.footer.uploadMany,{count:h})})]}):(0,G.jsxs)(`div`,{className:D(`media-library-footer-actions--component flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,p),children:[(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:l,children:s??a.footer.cancel}),(0,G.jsx)(c,{type:`button`,disabled:m===0,onClick:u,children:o??(m===0?a.footer.confirmEmpty:t.length===1?a.footer.confirmOne:L(a.footer.confirmMany,{count:m}))})]})}function Oe({tab:e,selectedItems:t,selectedIds:n,selectionMode:r,stagedFiles:i,uploading:a=!1,strings:o,confirmLabel:s,cancelLabel:c,onCancel:l,onConfirm:u,onClearSelection:d,onUpload:f,onCancelUpload:p,chrome:m=`section`,className:h}){return(0,G.jsxs)(`footer`,{className:D(`media-library-footer--component flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,m===`section`&&`border-t border-border bg-background px-4 py-3`,h),children:[(0,G.jsx)(De,{tab:e,selectedIds:n,selectionMode:r,stagedFiles:i,strings:o,onClearSelection:d}),(0,G.jsx)(Y,{tab:e,selectedItems:t,selectedIds:n,stagedFiles:i,uploading:a,strings:o,confirmLabel:s,cancelLabel:c,onCancel:l,onConfirm:u,onUpload:f,onCancelUpload:p})]})}var ke=t(r(),1),Ae=(0,R.createContext)(null);function je(e,t,n){return(0,R.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 Me({title:e,description:t,confirmLabel:n,cancelLabel:r,selectionMode:a=`multiple`,density:o=`comfortable`,showMeta:s=!0,allowUpload:l=!0,typeFilters:u,confirmOnSelect:d=!1,onConfirm:f,onCancel:p,onClose:h,strings:g,slots:v,heightClassName:y,className:b,items:x,fetcher:ee,accessors:S,collections:C,value:w,defaultValue:T,onValueChange:E,onItemUpdate:ne,onItemDelete:O,onUpload:re,onError:M,initialTab:N,defaultView:P,defaultQuery:F,defaultType:ie,defaultCollection:ae,defaultSort:oe,defaultUploadOptions:se,...ce}){let I=te(le,g),z=ve({items:x,fetcher:ee,accessors:S,collections:C,selectionMode:a,value:w,defaultValue:T,onValueChange:E,onItemUpdate:ne,onItemDelete:O,onUpload:re,onError:M,initialTab:N,defaultView:P,defaultQuery:F,defaultType:ie,defaultCollection:ae,defaultSort:oe,defaultUploadOptions:se}),ue=je(C,z.items,z.accessors.getCollection),B=l?z.tab:`library`,V=z.detailId?z.items.find(e=>z.accessors.getId(e)===z.detailId)??null:null,H=(0,R.useContext)(Ae),U=!v?.footer,W=H&&U?(0,G.jsx)(De,{tab:B,selectedIds:z.selectedIds,selectionMode:a,stagedFiles:z.stagedFiles,strings:I,onClearSelection:z.clearSelection,className:`media-library-dialog--selection-summary shrink-0 justify-end`}):null,de=!!(e||t||v?.headerStart),fe=!!(l||v?.headerEnd||W),pe=de||fe,me=()=>{f?.(z.selectedItems,z.selectedIds),h?.()},he=()=>{p?.(),h?.()},ge=e=>{let t=z.accessors.getId(e);z.toggleSelection(t),d&&(f?.([e],[t]),h?.())},_e=z.filteredCount===z.totalCount?L(I.countAll,{count:z.totalCount}):L(I.countFiltered,{count:z.filteredCount,total:z.totalCount}),ye=v?.footer??(H?(0,G.jsx)(Y,{tab:B,selectedItems:z.selectedItems,selectedIds:z.selectedIds,stagedFiles:z.stagedFiles,uploading:z.uploading,strings:I,confirmLabel:n,cancelLabel:r,onCancel:he,onConfirm:me,onUpload:z.startUpload,onCancelUpload:()=>{z.clearStagedFiles(),z.setTab(`library`)},className:`ml-auto`}):(0,G.jsx)(Oe,{tab:B,selectedItems:z.selectedItems,selectedIds:z.selectedIds,selectionMode:a,stagedFiles:z.stagedFiles,uploading:z.uploading,strings:I,confirmLabel:n,cancelLabel:r,onCancel:he,onConfirm:me,onClearSelection:z.clearSelection,onUpload:z.startUpload,onCancelUpload:()=>{z.clearStagedFiles(),z.setTab(`library`)}}));return(0,G.jsxs)(`section`,{className:D(`media-library--component flex min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-background`,y??`h-[min(760px,calc(100vh-7rem))]`,b),...ce,children:[pe&&(0,G.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:[de&&(0,G.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[v?.headerStart,(e||t)&&(0,G.jsxs)(`div`,{className:`min-w-0`,children:[!!e&&(0,G.jsx)(i,{tag:`div`,weight:`semibold`,children:e}),!!t&&(0,G.jsx)(i,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:t})]})]}),fe&&(0,G.jsxs)(`div`,{className:D(`flex min-w-0 flex-wrap items-center gap-2`,W?`flex-1 justify-between`:`lg:justify-end`),children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[l&&(0,G.jsxs)(`div`,{className:`media-library--tabs flex items-center rounded-md bg-muted p-0.5`,role:`tablist`,children:[(0,G.jsxs)(c,{type:`button`,role:`tab`,"aria-selected":B===`library`,variant:`secondary`,buttonStyle:`ghost`,className:D(`h-8 rounded-sm px-3 shadow-none`,B===`library`?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>z.setTab(`library`),children:[(0,G.jsx)(_,{className:`size-3.5`}),I.tabs.library]}),(0,G.jsxs)(c,{type:`button`,role:`tab`,"aria-selected":B===`upload`,variant:`secondary`,buttonStyle:`ghost`,className:D(`h-8 rounded-sm px-3 shadow-none`,B===`upload`?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>z.setTab(`upload`),children:[(0,G.jsx)(m,{className:`size-3.5`}),I.tabs.upload,z.stagedFiles.length>0&&(0,G.jsx)(`span`,{className:`rounded-full bg-background/20 px-1.5 text-xxs tabular-nums`,children:z.stagedFiles.length})]})]}),v?.headerEnd]}),W]})]}),(0,G.jsxs)(`div`,{className:`media-library--body flex min-h-0 flex-1`,children:[B===`upload`?(0,G.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:(0,G.jsx)(Ee,{stagedFiles:z.stagedFiles,uploadOptions:z.uploadOptions,collections:ue,uploading:z.uploading,strings:I,onFiles:z.addFiles,onRemoveFile:z.removeStagedFile,onOptionsChange:z.updateUploadOptions,empty:v?.uploadEmpty})}):(0,G.jsxs)(`div`,{className:D(`media-library--library min-w-0 flex-1 flex-col`,V?`hidden lg:flex`:`flex`),children:[(0,G.jsxs)(`div`,{className:`media-library--toolbar border-b border-border/70 px-4 py-3`,children:[(0,G.jsx)(J,{query:z.query,type:z.type,typeFilters:u,collection:z.collection,sort:z.sort,view:z.view,collections:ue,strings:I,onQueryChange:z.setQuery,onTypeChange:z.setType,onCollectionChange:z.setCollection,onSortChange:z.setSort,onViewChange:z.setView,onClearFilters:z.clearFilters,toolbarEnd:v?.toolbarEnd}),(0,G.jsx)(i,{size:`xs`,type:`secondary`,className:`mt-2`,"aria-live":`polite`,children:_e})]}),(0,G.jsx)(`div`,{className:`media-library--results min-h-0 flex-1 overflow-y-auto p-4`,children:z.loading?v?.loading??(0,G.jsx)(`div`,{className:`flex min-h-64 items-center justify-center`,children:(0,G.jsx)(i,{type:`secondary`,children:I.loading})}):z.error?v?.error??(0,G.jsxs)(j,{variant:`destructive`,children:[(0,G.jsx)(k,{children:I.errorTitle}),(0,G.jsx)(A,{children:I.errorDescription})]}):z.visibleItems.length===0?v?.empty??(0,G.jsx)(Se,{title:z.hasFilters?I.emptyFilteredTitle:I.emptyLibraryTitle,description:z.hasFilters?I.emptyFilteredDescription:I.emptyLibraryDescription,action:z.hasFilters?(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`outline`,onClick:z.clearFilters,children:I.clearFilters}):l?(0,G.jsxs)(c,{type:`button`,onClick:()=>z.setTab(`upload`),children:[(0,G.jsx)(m,{className:`size-3.5`}),I.uploadMedia]}):void 0}):z.view===`table`?(0,G.jsx)(`div`,{className:`overflow-x-auto`,children:(0,G.jsx)(we,{items:z.visibleItems,selectedSet:z.selectedSet,selectionMode:a,accessors:z.accessors,strings:I,onToggle:e=>{let t=z.items.find(t=>z.accessors.getId(t)===e);t&&ge(t)},onDetails:z.setDetailId})}):(0,G.jsx)(`div`,{className:D(`media-library--grid grid gap-3`,o===`compact`?`grid-cols-[repeat(auto-fill,minmax(136px,1fr))]`:`grid-cols-[repeat(auto-fill,minmax(168px,1fr))]`),children:z.visibleItems.map(e=>{let t=z.accessors.getId(e),n={id:t,selected:z.selectedSet.has(t),selectionMode:a,accessors:z.accessors,toggle:()=>ge(e),openDetails:()=>z.setDetailId(t)},r=v?.renderItem?.(e,n);return r?(0,G.jsx)(`div`,{children:r},t):(0,G.jsx)(Ce,{item:e,selected:n.selected,density:o,showMeta:s,selectionMode:a,accessors:z.accessors,strings:I,onToggle:n.toggle,onDetails:n.openDetails},t)})})})]}),B===`library`&&(0,G.jsx)(Te,{item:V,collections:ue,accessors:z.accessors,strings:I,onClose:()=>z.setDetailId(null),onUpdate:e=>V&&z.updateItem(V,e),onRemove:()=>{V&&(z.removeItem(V),z.setDetailId(null))},renderDetail:v?.renderDetail})]}),H?H.element?(0,ke.createPortal)(ye,H.element):null:ye]})}function Ne({open:e,onOpenChange:t,trigger:n,dialogTitle:r,dialogDescription:i,onClose:a,className:o,dialogClassName:s,contentClassName:c,closeOnEscape:l=!0,closeOnBackdropClick:u=!0,...d}){let f=te(le,d.strings),[p,m]=(0,R.useState)(!1),[h,g]=(0,R.useState)(null),_=e!==void 0,v=_?e:p,y=e=>{_||m(e),t?.(e)},b=()=>{y(!1),a?.()};return(0,G.jsx)(Ae.Provider,{value:{element:h},children:(0,G.jsx)(ie,{open:v,onOpenChange:y,onClose:a,trigger:n,title:r??f.title,description:i??f.description,size:`full`,showCancel:!1,showConfirm:!1,footer:(0,G.jsx)(`div`,{ref:g,className:`media-library-dialog--footer`}),className:D(`media-library-dialog--component max-h-[calc(100vh-2rem)] max-w-[min(1060px,calc(100vw-2rem))]`,s),contentClassName:D(`media-library-dialog--body flex min-h-0 flex-col overflow-hidden p-0`,c),closeOnBackdropClick:u,closeOnEscape:l,children:(0,G.jsx)(Me,{...d,onClose:b,className:D(`media-library-dialog--library rounded-none border-0`,o),heightClassName:d.heightClassName??`min-h-0 flex-1`,strings:d.strings})})})}function Pe(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return i===void 0||r.splice(n,0,i),r}function Fe({items:e,accessors:t,title:n,description:r,primaryId:a,onPrimaryChange:o,onRemove:s,onReorder:l,onAdd:p,maxItems:m,layout:h=`field`,density:_=`comfortable`,readOnly:v=!1,empty:y,action:C,renderItem:T,strings:E,className:ne,...O}){let k=te(le,E),A=V(t),j=e.length,re=a??(j>0?A.getId(e[0]):void 0),M=!v&&!!p&&(m===void 0||j<m),N=M&&(h===`field`||j>0)?(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`outline`,icon:x,onClick:p,children:k.gallery.add}):m!==void 0&&j>=m?(0,G.jsx)(u,{variant:`secondary`,children:k.gallery.maxReached}):null,P=(t,n)=>{if(n<0||n>=j||t===n)return;let r=Pe(e,t,n);l?.(r.map(e=>A.getId(e)),r)},F=!!(n||r||C||N),ie=j===0&&h!==`field`,ae=()=>!M||h!==`field`?null:(0,G.jsxs)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,className:D(`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":k.gallery.addTile,onClick:p,children:[(0,G.jsx)(x,{className:`size-4`}),(0,G.jsx)(`span`,{className:`sr-only`,children:k.gallery.addTile})]});return(0,G.jsxs)(`section`,{className:D(`media-resource-gallery--component rounded-lg border border-border bg-card shadow-xs`,ne),"data-layout":h,"data-density":_,...O,children:[F&&(0,G.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,G.jsxs)(`div`,{className:`min-w-0`,children:[!!n&&(0,G.jsx)(i,{tag:`div`,weight:`semibold`,children:n}),!!r&&(0,G.jsx)(i,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:r})]}),(0,G.jsx)(`div`,{className:`media-resource-gallery--actions flex flex-wrap items-center gap-2`,children:C??N})]}),ie?(0,G.jsx)(`div`,{className:`media-resource-gallery--empty p-4 pt-0`,children:y??(0,G.jsx)(Se,{title:k.gallery.emptyTitle,description:k.gallery.emptyDescription,action:M?(0,G.jsx)(c,{type:`button`,icon:oe,onClick:p,children:k.gallery.add}):void 0})}):(0,G.jsxs)(`div`,{className:D(`media-resource-gallery--items p-4`,F&&`pt-0`,h===`list`?`grid gap-2`:h===`field`?`grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-3 sm:grid-cols-[repeat(auto-fill,minmax(108px,1fr))]`:_===`compact`?`grid grid-cols-[repeat(auto-fill,minmax(132px,1fr))] gap-3`:`grid grid-cols-[repeat(auto-fill,minmax(164px,1fr))] gap-3`),children:[e.map((e,t)=>{let n=A.getId(e),r=A.getName(e),a=A.getType(e),l=A.getSrc(e),p=A.getAlt(e)||r,m=n===re,_=A.getPublic(e)===!1,y=A.getDuration(e),x=t>0,C=t<j-1,E=T?.(e,{id:n,index:t,total:j,primary:m,accessors:A,canMovePrevious:x,canMoveNext:C,setPrimary:()=>o?.(n,e),remove:()=>s?.(n,e),movePrevious:()=>P(t,t-1),moveNext:()=>P(t,t+1)});return E?(0,G.jsx)(`div`,{children:E},n):h===`field`?(0,G.jsxs)(`div`,{className:D(`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`,m&&`col-span-2 row-span-2 min-h-52`),"data-primary":m||void 0,children:[l?(0,G.jsx)(`img`,{src:l,alt:p,loading:`lazy`,className:`size-full object-cover`}):(0,G.jsx)(`div`,{className:`flex size-full items-center justify-center bg-muted text-muted-foreground`,children:(0,G.jsx)(g,{className:m?`size-7`:`size-5`})}),m&&(0,G.jsx)(u,{variant:`secondary`,className:`absolute left-2 top-2 bg-background/90 shadow-xs`,children:k.gallery.cover}),a===`video`&&!!y&&(0,G.jsxs)(u,{variant:`secondary`,className:`absolute bottom-2 left-2 bg-foreground text-background`,children:[(0,G.jsx)(I,{className:`size-3 fill-current`}),y]}),_&&(0,G.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,G.jsx)(b,{className:`size-3`})}),!v&&(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`solid`,size:`icon-xs`,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":k.gallery.remove,onClick:()=>s?.(n,e),children:(0,G.jsx)(w,{className:`size-3.5`})})]},n):h===`list`?(0,G.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":m||void 0,children:[(0,G.jsx)(`div`,{className:`relative size-12 shrink-0 overflow-hidden rounded-md bg-muted`,children:l?(0,G.jsx)(`img`,{src:l,alt:p,loading:`lazy`,className:`size-full object-cover`}):(0,G.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:(0,G.jsx)(g,{className:`size-4`})})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(i,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:r}),m&&(0,G.jsx)(u,{variant:`info`,children:k.gallery.primary})]}),(0,G.jsxs)(i,{size:`xxs`,type:`secondary`,children:[L(k.gallery.itemPosition,{index:t+1,total:j}),` · `,H(A.getSize(e))||k.unknownSize]})]}),!v&&(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:m,"aria-label":k.gallery.setPrimary,onClick:()=>o?.(n,e),children:(0,G.jsx)(ee,{className:`size-3.5`})}),(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:!x,"aria-label":k.gallery.movePrevious,onClick:()=>P(t,t-1),children:(0,G.jsx)(d,{className:`size-3.5`})}),(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:!C,"aria-label":k.gallery.moveNext,onClick:()=>P(t,t+1),children:(0,G.jsx)(f,{className:`size-3.5`})}),(0,G.jsx)(c,{type:`button`,variant:`error`,buttonStyle:`ghost`,size:`icon-xs`,"aria-label":k.gallery.remove,onClick:()=>s?.(n,e),children:(0,G.jsx)(S,{className:`size-3.5`})})]})]},n):(0,G.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":m||void 0,children:[(0,G.jsxs)(`div`,{className:`relative aspect-[4/3] bg-muted`,children:[l?(0,G.jsx)(`img`,{src:l,alt:p,loading:`lazy`,className:`size-full object-cover`}):(0,G.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:(0,G.jsx)(g,{className:`size-6`})}),(0,G.jsxs)(`div`,{className:`absolute left-2 top-2 flex flex-wrap gap-1`,children:[m&&(0,G.jsx)(u,{variant:`info`,children:k.gallery.primary}),(0,G.jsx)(u,{variant:`secondary`,children:L(k.gallery.itemPosition,{index:t+1,total:j})})]})]}),(0,G.jsxs)(`div`,{className:`media-resource-gallery--item-body grid gap-2 p-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(i,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:r}),(0,G.jsx)(i,{size:`xxs`,type:`secondary`,children:H(A.getSize(e))||k.unknownSize})]}),!v&&(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:m,"aria-label":k.gallery.setPrimary,onClick:()=>o?.(n,e),children:(0,G.jsx)(ee,{className:`size-3.5`})}),(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:!x,"aria-label":k.gallery.movePrevious,onClick:()=>P(t,t-1),children:(0,G.jsx)(d,{className:`size-3.5`})}),(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:!C,"aria-label":k.gallery.moveNext,onClick:()=>P(t,t+1),children:(0,G.jsx)(f,{className:`size-3.5`})}),(0,G.jsx)(c,{type:`button`,variant:`error`,buttonStyle:`ghost`,size:`icon-xs`,className:`ml-auto`,"aria-label":k.gallery.remove,onClick:()=>s?.(n,e),children:(0,G.jsx)(S,{className:`size-3.5`})})]})]})]},n)}),ae()]})]})}var Ie=e({AsyncFetcherLibrary:()=>Ye,ConfirmOnSelectDialog:()=>Je,EmbeddedLibrary:()=>We,EmptyAndErrorStates:()=>Xe,ExternalResourceGallery:()=>qe,HeadlessSelection:()=>Ze,ProductMediaDialog:()=>Ge,ResourceGalleryList:()=>Ke}),Le=[{value:`Products`,label:`Products`},{value:`Lifestyle`,label:`Lifestyle`},{value:`Banners`,label:`Banners`}];function X(e,t,n){let r=`
|
|
1
|
+
import{n as e,r as t}from"./chunk-QTnfLwEv.js";import{n,t as r}from"./react-dom-Bz4cALsF.js";import{Dr as i,Er as a,Rr as o,Ur as s,jr as c,r as l,t as u}from"./example-Cz_880po.js";import{t as d}from"./arrow-left-BSVeKWNq.js";import{t as f}from"./arrow-right-D6hTB0Bd.js";import{t as p}from"./circle-check-1MSds3Vu.js";import{n as m,t as h}from"./dropzone-9Gb4mR4x.js";import{t as g}from"./file-C8PCBEtY.js";import{t as _}from"./image-gc4qX_7C.js";import{t as v}from"./info-BimmreJ-.js";import{t as y}from"./layers-nkkXRmvA.js";import{t as b}from"./lock-DLIcOBUd.js";import{t as x}from"./plus-D5swsZCz.js";import{t as ee}from"./star-BaV-UTPq.js";import{t as S}from"./trash-2-CE9bDw49.js";import{t as C}from"./video-YBnCbmIb.js";import{t as w}from"./x-D8UN9pOu.js";import{a as T,i as E,k as te,n as D,s as ne}from"./index-BQIv1ffM.js";import{t as O}from"./props-table-2pIZzGC-.js";import{i as k,r as A,t as j}from"./alert-2_0J7Vv6.js";import{t as re}from"./smart-card-Dhu_1A_u.js";import{t as M}from"./input-NIgvB9CZ.js";import{t as N}from"./select-BRbyPtx8.js";import{n as P}from"./switch-xzxCDtyg.js";import{n as F}from"./form-field-B5g_5Zjm.js";import{t as ie}from"./dialog-D9-MRCRg.js";var ae=T(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),oe=T(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),se=T(`images`,[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]),ce=T(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),I=T(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),le={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 L(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 R=t(n(),1),z={collection:void 0,tags:[],public:!0},ue=[],B={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 V(e){return{...B,...e??{}}}function H(e){return!e||e<=0?``:e>=1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`}function U(e,t){let n=t.getWidth(e),r=t.getHeight(e);return!n||!r?``:`${n} x ${r}`}function W(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 de(e){return e.type.startsWith(`image/`)?`image`:e.type.startsWith(`video/`)?`video`:`file`}function fe(e){if(e.type.startsWith(`image/`)&&!(typeof URL>`u`||typeof URL.createObjectURL!=`function`))return URL.createObjectURL(e)}function pe(e){!e||typeof URL>`u`||typeof URL.revokeObjectURL!=`function`||URL.revokeObjectURL(e)}function me(e){return Array.isArray(e)?{items:e,total:e.length}:e}function he(e,t){return t&&typeof e==`object`&&e?{...e,...t}:e}function ge(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 _e(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)=>W(n,t)-W(e,t)),r}function ve({items:e=ue,fetcher:t,accessors:n,selectionMode:r=`multiple`,value:i,defaultValue:a=[],onValueChange:o,onItemUpdate:s,onItemDelete:c,onUpload:l,onError:u,initialTab:d=`library`,defaultView:f=`grid`,defaultQuery:p=``,defaultType:m=`all`,defaultCollection:h=`all`,defaultSort:g=`newest`,defaultUploadOptions:_}={}){let v=(0,R.useMemo)(()=>V(n),[n]),[y,b]=(0,R.useState)(d),[x,ee]=(0,R.useState)(f),[S,C]=(0,R.useState)(p),[w,T]=(0,R.useState)(m),[E,te]=(0,R.useState)(h),[D,ne]=(0,R.useState)(g),[O,k]=(0,R.useState)(null),[A,j]=(0,R.useState)(()=>[...a]),[re,M]=(0,R.useState)([]),[N,P]=(0,R.useState)(),[F,ie]=(0,R.useState)(!1),[ae,oe]=(0,R.useState)(null),[se,ce]=(0,R.useState)([]),[I,le]=(0,R.useState)(()=>new Set),[L,B]=(0,R.useState)({}),[H,U]=(0,R.useState)([]),[W,ve]=(0,R.useState)(!1),[G,ye]=(0,R.useState)({...z,..._,tags:_?.tags??z.tags}),be=i!==void 0,K=(0,R.useMemo)(()=>be?[...i??[]]:A,[A,be,i]),q=(0,R.useMemo)(()=>new Set(K),[K]),xe=(0,R.useRef)(new Set);(0,R.useEffect)(()=>{if(!t)return;let e=new AbortController;return ie(!0),oe(null),t({query:S,type:w,collection:E===`all`?void 0:E,sort:D,signal:e.signal}).then(t=>{if(e.signal.aborted)return;let n=me(t);M(n.items),P(n.total)}).catch(t=>{e.signal.aborted||(oe(t),u?.(t))}).finally(()=>{e.signal.aborted||ie(!1)}),()=>e.abort()},[E,t,u,S,D,w]),(0,R.useEffect)(()=>{let e=xe.current;return()=>{for(let t of e)pe(t);e.clear()}},[]);let Se=(0,R.useMemo)(()=>t?re:[...se,...e],[se,re,t,e]),J=(0,R.useMemo)(()=>Se.filter(e=>!I.has(v.getId(e))).map(e=>he(e,L[v.getId(e)])),[v,L,I,Se]),Ce=(0,R.useMemo)(()=>{let e=t?J:ge(J,v,S,w,E);return t?e:_e(e,v,D)},[v,E,t,J,S,D,w]),we=N??J.length,Te=Ce.length,Ee=(0,R.useMemo)(()=>J.filter(e=>q.has(v.getId(e))),[v,J,q]),De=!!S.trim()||w!==`all`||E!==`all`,Y=(0,R.useCallback)(e=>{be||j(e);let t=new Set(e),n=J.filter(e=>t.has(v.getId(e)));o?.(e,n)},[v,be,o,J]),Oe=(0,R.useCallback)(e=>{let t=new Set(r===`single`?[]:q);q.has(e)&&r!==`single`?t.delete(e):t.add(e),Y(Array.from(t))},[Y,q,r]),ke=(0,R.useCallback)(()=>Y([]),[Y]),Ae=(0,R.useCallback)(()=>{C(``),T(`all`),te(`all`)},[]),je=(0,R.useCallback)(e=>{U(t=>[...t,...e.map((e,t)=>{let n=fe(e);return n&&xe.current.add(n),{id:`staged-${Date.now()}-${t}`,file:e,name:e.name,size:e.size,type:de(e),src:n,progress:0,status:`staged`}})])},[]),Me=(0,R.useCallback)(e=>{U(t=>{let n=t.find(t=>t.id===e);return n?.src&&(pe(n.src),xe.current.delete(n.src)),t.filter(t=>t.id!==e)})},[]),Ne=(0,R.useCallback)(()=>{U(e=>{for(let t of e)t.src&&(pe(t.src),xe.current.delete(t.src));return[]})},[]),Pe=(0,R.useCallback)(e=>{ye(t=>({...t,...e}))},[]),Fe=(0,R.useCallback)((e,t)=>{U(n=>n.map(n=>n.id===e?{...n,...t}:n))},[]);return{tab:y,setTab:b,view:x,setView:ee,query:S,setQuery:C,type:w,setType:T,collection:E,setCollection:te,sort:D,setSort:ne,detailId:O,setDetailId:k,items:J,visibleItems:Ce,selectedIds:K,selectedItems:Ee,selectedSet:q,toggleSelection:Oe,clearSelection:ke,clearFilters:Ae,loading:F,error:ae,hasFilters:De,totalCount:we,filteredCount:Te,stagedFiles:H,addFiles:je,removeStagedFile:Me,clearStagedFiles:Ne,updateUploadOptions:Pe,uploadOptions:G,uploading:W,startUpload:(0,R.useCallback)(async()=>{if(W||H.length===0)return;ve(!0),U(e=>e.map(e=>({...e,status:`uploading`,progress:0})));let e={setProgress:(e,t)=>{Fe(e,{progress:Math.max(0,Math.min(100,t))})},setFileStatus:(e,t,n)=>Fe(e,{status:t,error:n})};try{let t=H.map(e=>e.file),n=await l?.(t,G,e);if(U(e=>e.map(e=>({...e,status:`done`,progress:100}))),n?.length){ce(e=>[...n,...e]);let e=n.map(e=>v.getId(e));Y(r===`single`?e.slice(0,1):Array.from(new Set([...e,...K])))}Ne(),b(`library`)}catch(e){oe(e),U(e=>e.map(e=>e.status===`uploading`?{...e,status:`error`,error:`Upload failed`}:e)),u?.(e)}finally{ve(!1)}},[v,Y,Ne,u,l,K,r,Fe,H,G,W]),updateItem:(0,R.useCallback)((e,t)=>{let n=v.getId(e);B(e=>({...e,[n]:{...e[n],...t}})),s?.(e,t)},[v,s]),removeItem:(0,R.useCallback)(e=>{let t=v.getId(e);le(e=>new Set(e).add(t)),q.has(t)&&Y(K.filter(e=>e!==t)),c?.(e)},[v,Y,c,K,q]),accessors:v}}var G=ne();function ye(e,t){return e===`image`?(0,G.jsx)(_,{className:t??`size-4`}):e===`video`?(0,G.jsx)(C,{className:t??`size-4`}):(0,G.jsx)(g,{className:t??`size-4`})}function be(e,t){return e===`image`?t.typeImage:e===`video`?t.typeVideo:t.typeFile}function K(e,t){return e?L(t.usedIn,{count:e}):t.notUsed}function q({children:e,tint:t,className:n}){return(0,G.jsx)(`div`,{className:D(`media-library-preview relative overflow-hidden bg-muted`,n),style:t?{background:t}:void 0,children:e})}function xe({src:e,alt:t,type:n,className:r,loading:i=`lazy`}){let[a,o]=(0,R.useState)(!1);return(0,R.useEffect)(()=>{o(!1)},[e]),!e||a?(0,G.jsx)(`div`,{className:`media-library-preview--fallback flex size-full items-center justify-center text-muted-foreground`,children:ye(n,`size-6`)}):(0,G.jsx)(`img`,{src:e,alt:t,loading:i,className:r,onError:()=>o(!0)})}function Se({icon:e,title:t,description:n,action:r,className:i}){return(0,G.jsxs)(`div`,{className:D(`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`,i),children:[(0,G.jsx)(`div`,{className:`mb-3 inline-flex size-10 items-center justify-center rounded-full bg-muted text-muted-foreground`,children:e??(0,G.jsx)(_,{className:`size-5`})}),(0,G.jsx)(o,{tag:`div`,weight:`semibold`,children:t}),!!n&&(0,G.jsx)(o,{type:`secondary`,size:`xs`,className:`mt-1 max-w-sm`,children:n}),!!r&&(0,G.jsx)(`div`,{className:`mt-4`,children:r})]})}function J({query:e,type:t,typeFilters:n,collection:r,sort:i,view:a,collections:o=[],strings:s,onQueryChange:c,onTypeChange:u,onCollectionChange:d,onSortChange:f,onViewChange:p,onClearFilters:m,toolbarEnd:h}){let v=[{value:`all`,label:s.allTypes,icon:null},{value:`image`,label:s.images,icon:_},{value:`video`,label:s.videos,icon:C},{value:`file`,label:s.files,icon:g}].filter(e=>(n??[`all`,`image`,`video`]).includes(e.value)),y=[{value:`all`,label:s.allCollections},...o.map(e=>({value:e.value,label:String(e.label)}))],b=[{value:`newest`,label:s.sortNewest},{value:`name`,label:s.sortName},{value:`size`,label:s.sortSize},{value:`usage`,label:s.sortUsage}];return(0,G.jsxs)(`div`,{className:`media-library-toolbar--component flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`min-w-52 flex-1`,children:(0,G.jsx)(M,{value:e,onChange:e=>c(e.target.value),placeholder:s.searchPlaceholder,startIcon:E,clearable:!0,onClear:()=>c(``),strings:{clear:s.clearSearch},className:`rounded-full bg-muted/20`})}),(0,G.jsx)(`div`,{className:`media-library-toolbar--type-toggle flex h-9 items-center rounded-md bg-muted p-0.5`,role:`tablist`,"aria-label":s.typeFilterLabel,children:v.map(e=>{let n=e.icon,r=t===e.value;return(0,G.jsxs)(l,{type:`button`,role:`tab`,"aria-selected":r,variant:`secondary`,buttonStyle:`ghost`,className:D(`h-8 rounded-sm px-3 text-xs shadow-none`,r?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>u(e.value),children:[n&&(0,G.jsx)(n,{className:`size-3.5`}),e.label]},e.value)})}),(0,G.jsx)(`div`,{className:`min-w-40`,children:(0,G.jsx)(N,{value:r,options:y,onChange:e=>d(e??`all`),placeholder:s.collectionFilterLabel,"aria-label":s.collectionFilterLabel,className:`bg-background`})}),(0,G.jsx)(`div`,{className:`min-w-32`,children:(0,G.jsx)(N,{value:i,options:b,onChange:e=>f(e??`newest`),placeholder:s.sortLabel,"aria-label":s.sortLabel,className:`bg-background`})}),(0,G.jsxs)(`div`,{className:`media-library-toolbar--view-toggle ml-auto flex h-9 items-center rounded-md bg-muted p-0.5`,children:[(0,G.jsx)(l,{type:`button`,variant:a===`grid`?`dark`:`secondary`,buttonStyle:a===`grid`?`solid`:`ghost`,size:`icon-xs`,className:D(a===`grid`&&`bg-background text-foreground shadow-xs hover:bg-background`),"aria-label":s.gridView,onClick:()=>p(`grid`),children:(0,G.jsx)(ae,{className:`size-3.5`})}),(0,G.jsx)(l,{type:`button`,variant:a===`table`?`dark`:`secondary`,buttonStyle:a===`table`?`solid`:`ghost`,size:`icon-xs`,className:D(a===`table`&&`bg-background text-foreground shadow-xs hover:bg-background`),"aria-label":s.tableView,onClick:()=>p(`table`),children:(0,G.jsx)(ce,{className:`size-3.5`})})]}),!!e&&(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:m,children:s.clearFilters}),h]})}function Ce({item:e,selected:t=!1,density:n=`comfortable`,showMeta:r=!0,accessors:i,strings:a,onToggle:u,onDetails:d,className:f}){let p=i.getType(e),m=i.getName(e),h=i.getSrc(e),g=i.getAlt(e)||m,_=i.getSize(e),x=i.getUsageCount(e),ee=i.getPublic(e)===!1,S=i.getDuration(e);return(0,G.jsxs)(`div`,{"data-selected":t||void 0,"data-density":n,className:D(`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`,t&&`media-library-card--selected border-primary ring-1 ring-primary`,f),onClick:u,children:[(0,G.jsxs)(q,{tint:i.getTint(e),className:D(n===`compact`?`aspect-square`:`aspect-[4/3]`),children:[(0,G.jsx)(xe,{src:h,alt:g,type:p,className:`size-full object-cover`}),(0,G.jsx)(`span`,{className:D(`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`,t&&`bg-primary text-primary-foreground opacity-100`),"aria-hidden":`true`,children:(0,G.jsx)(s,{className:`size-3`})}),!!d&&(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`solid`,size:`icon-xs`,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":L(a.cardDetails,{name:m}),onClick:e=>{e.stopPropagation(),d()},children:(0,G.jsx)(v,{className:`size-3.5`})}),p===`video`&&!!S&&(0,G.jsxs)(c,{variant:`secondary`,className:`media-library-card--duration absolute bottom-2 left-2 bg-foreground text-background`,children:[(0,G.jsx)(I,{className:`size-3 fill-current`}),S]}),ee&&(0,G.jsx)(c,{variant:`secondary`,className:`media-library-card--private absolute bottom-2 right-2 bg-background/90`,children:(0,G.jsx)(b,{className:`size-3`})})]}),(0,G.jsxs)(`div`,{className:`media-library-card--body grid gap-1 px-3 py-2.5`,children:[(0,G.jsx)(o,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:m}),r&&(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(o,{size:`xxs`,type:`secondary`,className:`truncate`,children:H(_)||a.unknownSize}),!!x&&(0,G.jsxs)(o,{tag:`span`,size:`xxs`,type:`secondary`,className:`ml-auto inline-flex items-center gap-1`,children:[(0,G.jsx)(y,{className:`size-3`}),x]})]})]})]})}function we({items:e,selectedSet:t,accessors:n,strings:r,onToggle:i,onDetails:a}){return(0,G.jsxs)(`div`,{className:`media-library-table--component min-w-[720px]`,children:[(0,G.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,G.jsx)(`span`,{}),(0,G.jsx)(`span`,{}),(0,G.jsx)(o,{size:`xxs`,type:`secondary`,weight:`semibold`,children:r.table.name}),(0,G.jsx)(o,{size:`xxs`,type:`secondary`,weight:`semibold`,children:r.table.type}),(0,G.jsx)(o,{size:`xxs`,type:`secondary`,weight:`semibold`,children:r.table.size}),(0,G.jsx)(o,{size:`xxs`,type:`secondary`,weight:`semibold`,children:r.table.collection}),(0,G.jsx)(o,{size:`xxs`,type:`secondary`,weight:`semibold`,children:r.table.used}),(0,G.jsx)(`span`,{})]}),e.map(e=>{let u=n.getId(e),d=t.has(u),f=n.getType(e),p=n.getName(e),m=n.getSrc(e),h=n.getPublic(e)===!1;return(0,G.jsxs)(`div`,{"data-selected":d||void 0,className:D(`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`,d&&`bg-primary/10`),onClick:()=>i(u),children:[(0,G.jsx)(`span`,{className:D(`inline-flex size-5 items-center justify-center rounded-md border border-border text-transparent`,d&&`border-primary bg-primary text-primary-foreground`),"aria-hidden":`true`,children:(0,G.jsx)(s,{className:`size-3`})}),(0,G.jsx)(q,{tint:n.getTint(e),className:`size-9 rounded-md`,children:m?(0,G.jsx)(`img`,{src:m,alt:``,loading:`lazy`,className:`size-full object-cover`}):(0,G.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:ye(f,`size-4`)})}),(0,G.jsxs)(o,{tag:`div`,weight:`semibold`,size:`xs`,className:`flex min-w-0 items-center gap-1 truncate`,children:[(0,G.jsx)(`span`,{className:`truncate`,children:p}),h&&(0,G.jsx)(b,{className:`size-3 shrink-0 text-muted-foreground`})]}),(0,G.jsx)(c,{variant:`secondary`,children:be(f,r)}),(0,G.jsx)(o,{size:`xs`,type:`secondary`,children:H(n.getSize(e))||r.unknownSize}),(0,G.jsx)(o,{size:`xs`,type:`secondary`,className:`truncate`,children:n.getCollection(e)||`-`}),(0,G.jsx)(o,{size:`xs`,type:`secondary`,children:n.getUsageCount(e)?n.getUsageCount(e):`-`}),(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,"aria-label":L(r.cardDetails,{name:p}),onClick:e=>{e.stopPropagation(),a(u)},children:(0,G.jsx)(v,{className:`size-3.5`})})]},u)})]})}function Te({item:e,collections:t=[],accessors:n,strings:r,onClose:i,onUpdate:a,onRemove:s,renderDetail:u}){if(!e)return null;let f=n.getName(e),p=n.getType(e),h=n.getSrc(e),g=n.getCollection(e)??t[0]?.value??``,_=n.getTags(e),v=n.getPublic(e)??!0,y=u?.(e,{accessors:n,update:a,remove:s,close:i});return y?(0,G.jsx)(G.Fragment,{children:y}):(0,G.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,G.jsxs)(`div`,{className:`media-library-detail-panel--header flex items-center gap-2 border-b border-border px-3 py-2.5`,children:[(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,"aria-label":r.detail.close,onClick:i,children:(0,G.jsx)(d,{className:`size-3.5`})}),(0,G.jsx)(o,{weight:`semibold`,children:r.detail.title})]}),(0,G.jsxs)(`div`,{className:`media-library-detail-panel--body grid min-h-0 gap-4 overflow-y-auto p-4`,children:[(0,G.jsxs)(q,{tint:n.getTint(e),className:`aspect-[4/3] rounded-lg border border-border`,children:[(0,G.jsx)(xe,{src:h,alt:n.getAlt(e)||f,type:p,className:`size-full object-cover`}),p===`video`&&!!n.getDuration(e)&&(0,G.jsxs)(c,{className:`absolute bottom-2 right-2 bg-foreground text-background`,children:[(0,G.jsx)(I,{className:`size-3 fill-current`}),n.getDuration(e)]})]}),(0,G.jsx)(o,{tag:`div`,weight:`semibold`,className:`break-words`,children:f}),(0,G.jsx)(`dl`,{className:`media-library-detail-panel--facts grid gap-2`,children:[[r.detail.type,be(p,r)],[r.detail.size,H(n.getSize(e))||r.unknownSize],[r.detail.dimensions,U(e,n)||`-`],[r.detail.uploaded,String(n.getUploadedAt(e)??`-`)],[r.detail.usedIn,K(n.getUsageCount(e),r)]].map(([e,t])=>(0,G.jsxs)(`div`,{className:`flex justify-between gap-4`,children:[(0,G.jsx)(`dt`,{children:(0,G.jsx)(o,{tag:`span`,size:`xs`,type:`secondary`,children:e})}),(0,G.jsx)(`dd`,{className:`m-0 text-right`,children:(0,G.jsx)(o,{tag:`span`,size:`xs`,weight:`medium`,children:t})})]},e))}),(0,G.jsx)(F,{label:r.detail.altText,children:(0,G.jsx)(M,{value:n.getAlt(e)??``,placeholder:r.detail.altPlaceholder,onChange:e=>a({alt:e.target.value})})}),(0,G.jsx)(F,{label:r.detail.collection,children:(0,G.jsx)(N,{value:g,options:t.map(e=>({value:e.value,label:String(e.label)})),"aria-label":r.detail.collection,onChange:e=>a({collection:e})})}),(0,G.jsx)(F,{label:r.detail.tags,children:(0,G.jsx)(M,{value:_.join(`, `),placeholder:r.detail.tagsPlaceholder,onChange:e=>a({tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})}),(0,G.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,G.jsxs)(`div`,{children:[(0,G.jsx)(o,{weight:`semibold`,size:`xs`,children:r.detail.public}),(0,G.jsx)(o,{size:`xxs`,type:`secondary`,children:v?r.detail.publicHint:r.detail.privateHint})]}),(0,G.jsx)(P,{checked:v,onCheckedChange:e=>a({public:e})})]}),(0,G.jsxs)(`div`,{className:`media-library-detail-panel--actions flex flex-wrap gap-2`,children:[(0,G.jsxs)(l,{type:`button`,variant:`secondary`,buttonStyle:`outline`,children:[(0,G.jsx)(m,{className:`size-3.5`}),r.detail.replace]}),(0,G.jsxs)(l,{type:`button`,variant:`error`,buttonStyle:`ghost`,onClick:s,children:[(0,G.jsx)(S,{className:`size-3.5`}),r.detail.delete]})]})]})]})}function Ee({stagedFiles:e,uploadOptions:t,collections:n=[],uploading:r=!1,strings:i,onFiles:a,onRemoveFile:s,onOptionsChange:u,empty:d}){return(0,G.jsxs)(`div`,{className:`media-library-upload-panel--component grid gap-4 p-4`,children:[(0,G.jsx)(h,{onDrop:a,accept:`image/*,video/*`,multiple:!0,size:`base`,strings:{instruction:i.upload.dropTitle,helper:i.upload.dropHint,dragOver:i.upload.dragOver}}),e.length>0?(0,G.jsx)(`div`,{className:`media-library-upload-panel--staged grid gap-2`,children:e.map(e=>(0,G.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,G.jsx)(q,{className:`size-10 rounded-md`,children:e.src?(0,G.jsx)(`img`,{src:e.src,alt:e.name,className:`size-full object-cover`}):(0,G.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:ye(e.type,`size-4`)})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,G.jsx)(o,{weight:`semibold`,size:`xs`,className:`truncate`,children:e.name}),(0,G.jsx)(o,{size:`xxs`,type:`secondary`,className:`ml-auto shrink-0`,children:H(e.size)})]}),(e.status===`uploading`||e.status===`done`)&&(0,G.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-muted`,children:(0,G.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-[width]`,style:{width:`${e.progress}%`}})}),e.status===`error`&&(0,G.jsx)(o,{size:`xxs`,type:`error`,children:e.error})]}),e.status===`done`?(0,G.jsx)(c,{variant:`success`,children:i.upload.done}):e.status===`uploading`?(0,G.jsxs)(o,{size:`xxs`,type:`secondary`,className:`tabular-nums`,children:[Math.round(e.progress),`%`]}):(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:r,"aria-label":L(i.upload.removeFile,{name:e.name}),onClick:()=>s(e.id),children:(0,G.jsx)(w,{className:`size-3.5`})})]},e.id))}):d,(0,G.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,G.jsx)(F,{label:i.upload.collection,children:(0,G.jsx)(N,{value:t.collection??n[0]?.value,options:n.map(e=>({value:e.value,label:String(e.label)})),"aria-label":i.upload.collection,onChange:e=>u({collection:e})})}),(0,G.jsx)(F,{label:i.upload.tags,children:(0,G.jsx)(M,{value:t.tags.join(`, `),placeholder:i.upload.tagsPlaceholder,onChange:e=>u({tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 md:self-end`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(o,{weight:`semibold`,size:`xs`,children:i.upload.public}),(0,G.jsx)(o,{size:`xxs`,type:`secondary`,children:i.upload.publicHint})]}),(0,G.jsx)(P,{checked:t.public,onCheckedChange:e=>u({public:e})})]})]})]})}function De({tab:e,selectedIds:t,selectionMode:n,stagedFiles:r,strings:i,onClearSelection:a,className:s}){let c=t.length,u=r.reduce((e,t)=>e+t.size,0),d=r.length,f=D(`media-library-footer-summary--component flex min-w-0 items-center gap-3`,s);return e===`upload`?(0,G.jsx)(`div`,{className:f,"aria-live":`polite`,children:(0,G.jsx)(o,{size:`xs`,type:`secondary`,className:`truncate`,children:d===0?i.footer.noFiles:L(i.footer.stagedSummary,{count:d,size:H(u)})})}):(0,G.jsx)(`div`,{className:f,"aria-live":`polite`,children:c>0?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(o,{weight:`semibold`,size:`xs`,className:`whitespace-nowrap`,children:L(i.footer.selectedCount,{count:c})}),(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`xs`,onClick:a,children:i.footer.clear})]}):(0,G.jsx)(o,{size:`xs`,type:`secondary`,className:`truncate`,children:n===`single`?i.footer.pickOne:i.footer.pickMany})})}function Y({tab:e,selectedItems:t,selectedIds:n,stagedFiles:r,uploading:i=!1,strings:a,confirmLabel:o,cancelLabel:s,onCancel:c,onConfirm:u,onUpload:d,onCancelUpload:f,className:p}){let m=n.length,h=r.length;return e===`upload`?(0,G.jsxs)(`div`,{className:D(`media-library-footer-actions--component flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,p),children:[(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,disabled:i,onClick:f,children:s??a.footer.cancel}),(0,G.jsx)(l,{type:`button`,disabled:h===0||i,onClick:d,loading:i,loadingLabels:{loading:a.footer.uploading},children:h<=1?a.footer.upload:L(a.footer.uploadMany,{count:h})})]}):(0,G.jsxs)(`div`,{className:D(`media-library-footer-actions--component flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,p),children:[(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,onClick:c,children:s??a.footer.cancel}),(0,G.jsx)(l,{type:`button`,disabled:m===0,onClick:u,children:o??(m===0?a.footer.confirmEmpty:t.length===1?a.footer.confirmOne:L(a.footer.confirmMany,{count:m}))})]})}function Oe({tab:e,selectedItems:t,selectedIds:n,selectionMode:r,stagedFiles:i,uploading:a=!1,strings:o,confirmLabel:s,cancelLabel:c,onCancel:l,onConfirm:u,onClearSelection:d,onUpload:f,onCancelUpload:p,chrome:m=`section`,className:h}){return(0,G.jsxs)(`footer`,{className:D(`media-library-footer--component flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,m===`section`&&`border-t border-border bg-background px-4 py-3`,h),children:[(0,G.jsx)(De,{tab:e,selectedIds:n,selectionMode:r,stagedFiles:i,strings:o,onClearSelection:d}),(0,G.jsx)(Y,{tab:e,selectedItems:t,selectedIds:n,stagedFiles:i,uploading:a,strings:o,confirmLabel:s,cancelLabel:c,onCancel:l,onConfirm:u,onUpload:f,onCancelUpload:p})]})}var ke=t(r(),1),Ae=(0,R.createContext)(null);function je(e,t,n){return(0,R.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 Me({title:e,description:t,confirmLabel:n,cancelLabel:r,selectionMode:i=`multiple`,density:a=`comfortable`,showMeta:s=!0,allowUpload:c=!0,typeFilters:u,confirmOnSelect:d=!1,onConfirm:f,onCancel:p,onClose:h,strings:g,slots:v,heightClassName:y,className:b,items:x,fetcher:ee,accessors:S,collections:C,value:w,defaultValue:T,onValueChange:E,onItemUpdate:ne,onItemDelete:O,onUpload:re,onError:M,initialTab:N,defaultView:P,defaultQuery:F,defaultType:ie,defaultCollection:ae,defaultSort:oe,defaultUploadOptions:se,...ce}){let I=te(le,g),z=ve({items:x,fetcher:ee,accessors:S,collections:C,selectionMode:i,value:w,defaultValue:T,onValueChange:E,onItemUpdate:ne,onItemDelete:O,onUpload:re,onError:M,initialTab:N,defaultView:P,defaultQuery:F,defaultType:ie,defaultCollection:ae,defaultSort:oe,defaultUploadOptions:se}),ue=je(C,z.items,z.accessors.getCollection),B=c?z.tab:`library`,V=z.detailId?z.items.find(e=>z.accessors.getId(e)===z.detailId)??null:null,H=(0,R.useContext)(Ae),U=!v?.footer,W=H&&U?(0,G.jsx)(De,{tab:B,selectedIds:z.selectedIds,selectionMode:i,stagedFiles:z.stagedFiles,strings:I,onClearSelection:z.clearSelection,className:`media-library-dialog--selection-summary shrink-0 justify-end`}):null,de=!!(e||t||v?.headerStart),fe=!!(c||v?.headerEnd||W),pe=de||fe,me=()=>{f?.(z.selectedItems,z.selectedIds),h?.()},he=()=>{p?.(),h?.()},ge=e=>{let t=z.accessors.getId(e);z.toggleSelection(t),d&&(f?.([e],[t]),h?.())},_e=z.filteredCount===z.totalCount?L(I.countAll,{count:z.totalCount}):L(I.countFiltered,{count:z.filteredCount,total:z.totalCount}),ye=v?.footer??(H?(0,G.jsx)(Y,{tab:B,selectedItems:z.selectedItems,selectedIds:z.selectedIds,stagedFiles:z.stagedFiles,uploading:z.uploading,strings:I,confirmLabel:n,cancelLabel:r,onCancel:he,onConfirm:me,onUpload:z.startUpload,onCancelUpload:()=>{z.clearStagedFiles(),z.setTab(`library`)},className:`ml-auto`}):(0,G.jsx)(Oe,{tab:B,selectedItems:z.selectedItems,selectedIds:z.selectedIds,selectionMode:i,stagedFiles:z.stagedFiles,uploading:z.uploading,strings:I,confirmLabel:n,cancelLabel:r,onCancel:he,onConfirm:me,onClearSelection:z.clearSelection,onUpload:z.startUpload,onCancelUpload:()=>{z.clearStagedFiles(),z.setTab(`library`)}}));return(0,G.jsxs)(`section`,{className:D(`media-library--component flex min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-background`,y??`h-[min(760px,calc(100vh-7rem))]`,b),...ce,children:[pe&&(0,G.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:[de&&(0,G.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[v?.headerStart,(e||t)&&(0,G.jsxs)(`div`,{className:`min-w-0`,children:[!!e&&(0,G.jsx)(o,{tag:`div`,weight:`semibold`,children:e}),!!t&&(0,G.jsx)(o,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:t})]})]}),fe&&(0,G.jsxs)(`div`,{className:D(`flex min-w-0 flex-wrap items-center gap-2`,W?`flex-1 justify-between`:`lg:justify-end`),children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[c&&(0,G.jsxs)(`div`,{className:`media-library--tabs flex items-center rounded-md bg-muted p-0.5`,role:`tablist`,children:[(0,G.jsxs)(l,{type:`button`,role:`tab`,"aria-selected":B===`library`,variant:`secondary`,buttonStyle:`ghost`,className:D(`h-8 rounded-sm px-3 shadow-none`,B===`library`?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>z.setTab(`library`),children:[(0,G.jsx)(_,{className:`size-3.5`}),I.tabs.library]}),(0,G.jsxs)(l,{type:`button`,role:`tab`,"aria-selected":B===`upload`,variant:`secondary`,buttonStyle:`ghost`,className:D(`h-8 rounded-sm px-3 shadow-none`,B===`upload`?`bg-background text-foreground shadow-xs hover:bg-background`:`text-muted-foreground hover:bg-transparent hover:text-foreground`),onClick:()=>z.setTab(`upload`),children:[(0,G.jsx)(m,{className:`size-3.5`}),I.tabs.upload,z.stagedFiles.length>0&&(0,G.jsx)(`span`,{className:`rounded-full bg-background/20 px-1.5 text-xxs tabular-nums`,children:z.stagedFiles.length})]})]}),v?.headerEnd]}),W]})]}),(0,G.jsxs)(`div`,{className:`media-library--body flex min-h-0 flex-1`,children:[B===`upload`?(0,G.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:(0,G.jsx)(Ee,{stagedFiles:z.stagedFiles,uploadOptions:z.uploadOptions,collections:ue,uploading:z.uploading,strings:I,onFiles:z.addFiles,onRemoveFile:z.removeStagedFile,onOptionsChange:z.updateUploadOptions,empty:v?.uploadEmpty})}):(0,G.jsxs)(`div`,{className:D(`media-library--library min-w-0 flex-1 flex-col`,V?`hidden lg:flex`:`flex`),children:[(0,G.jsxs)(`div`,{className:`media-library--toolbar border-b border-border/70 px-4 py-3`,children:[(0,G.jsx)(J,{query:z.query,type:z.type,typeFilters:u,collection:z.collection,sort:z.sort,view:z.view,collections:ue,strings:I,onQueryChange:z.setQuery,onTypeChange:z.setType,onCollectionChange:z.setCollection,onSortChange:z.setSort,onViewChange:z.setView,onClearFilters:z.clearFilters,toolbarEnd:v?.toolbarEnd}),(0,G.jsx)(o,{size:`xs`,type:`secondary`,className:`mt-2`,"aria-live":`polite`,children:_e})]}),(0,G.jsx)(`div`,{className:`media-library--results min-h-0 flex-1 overflow-y-auto p-4`,children:z.loading?v?.loading??(0,G.jsx)(`div`,{className:`flex min-h-64 items-center justify-center`,children:(0,G.jsx)(o,{type:`secondary`,children:I.loading})}):z.error?v?.error??(0,G.jsxs)(j,{variant:`destructive`,children:[(0,G.jsx)(k,{children:I.errorTitle}),(0,G.jsx)(A,{children:I.errorDescription})]}):z.visibleItems.length===0?v?.empty??(0,G.jsx)(Se,{title:z.hasFilters?I.emptyFilteredTitle:I.emptyLibraryTitle,description:z.hasFilters?I.emptyFilteredDescription:I.emptyLibraryDescription,action:z.hasFilters?(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`outline`,onClick:z.clearFilters,children:I.clearFilters}):c?(0,G.jsxs)(l,{type:`button`,onClick:()=>z.setTab(`upload`),children:[(0,G.jsx)(m,{className:`size-3.5`}),I.uploadMedia]}):void 0}):z.view===`table`?(0,G.jsx)(`div`,{className:`overflow-x-auto`,children:(0,G.jsx)(we,{items:z.visibleItems,selectedSet:z.selectedSet,selectionMode:i,accessors:z.accessors,strings:I,onToggle:e=>{let t=z.items.find(t=>z.accessors.getId(t)===e);t&&ge(t)},onDetails:z.setDetailId})}):(0,G.jsx)(`div`,{className:D(`media-library--grid grid gap-3`,a===`compact`?`grid-cols-[repeat(auto-fill,minmax(136px,1fr))]`:`grid-cols-[repeat(auto-fill,minmax(168px,1fr))]`),children:z.visibleItems.map(e=>{let t=z.accessors.getId(e),n={id:t,selected:z.selectedSet.has(t),selectionMode:i,accessors:z.accessors,toggle:()=>ge(e),openDetails:()=>z.setDetailId(t)},r=v?.renderItem?.(e,n);return r?(0,G.jsx)(`div`,{children:r},t):(0,G.jsx)(Ce,{item:e,selected:n.selected,density:a,showMeta:s,selectionMode:i,accessors:z.accessors,strings:I,onToggle:n.toggle,onDetails:n.openDetails},t)})})})]}),B===`library`&&(0,G.jsx)(Te,{item:V,collections:ue,accessors:z.accessors,strings:I,onClose:()=>z.setDetailId(null),onUpdate:e=>V&&z.updateItem(V,e),onRemove:()=>{V&&(z.removeItem(V),z.setDetailId(null))},renderDetail:v?.renderDetail})]}),H?H.element?(0,ke.createPortal)(ye,H.element):null:ye]})}function Ne({open:e,onOpenChange:t,trigger:n,dialogTitle:r,dialogDescription:i,onClose:a,className:o,dialogClassName:s,contentClassName:c,closeOnEscape:l=!0,closeOnBackdropClick:u=!0,...d}){let f=te(le,d.strings),[p,m]=(0,R.useState)(!1),[h,g]=(0,R.useState)(null),_=e!==void 0,v=_?e:p,y=e=>{_||m(e),t?.(e)},b=()=>{y(!1),a?.()};return(0,G.jsx)(Ae.Provider,{value:{element:h},children:(0,G.jsx)(ie,{open:v,onOpenChange:y,onClose:a,trigger:n,title:r??f.title,description:i??f.description,size:`full`,showCancel:!1,showConfirm:!1,footer:(0,G.jsx)(`div`,{ref:g,className:`media-library-dialog--footer`}),className:D(`media-library-dialog--component max-h-[calc(100vh-2rem)] max-w-[min(1060px,calc(100vw-2rem))]`,s),contentClassName:D(`media-library-dialog--body flex min-h-0 flex-col overflow-hidden p-0`,c),closeOnBackdropClick:u,closeOnEscape:l,children:(0,G.jsx)(Me,{...d,onClose:b,className:D(`media-library-dialog--library rounded-none border-0`,o),heightClassName:d.heightClassName??`min-h-0 flex-1`,strings:d.strings})})})}function Pe(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return i===void 0||r.splice(n,0,i),r}function Fe({items:e,accessors:t,title:n,description:r,primaryId:i,onPrimaryChange:a,onRemove:s,onReorder:u,onAdd:p,maxItems:m,layout:h=`field`,density:_=`comfortable`,readOnly:v=!1,empty:y,action:C,renderItem:T,strings:E,className:ne,...O}){let k=te(le,E),A=V(t),j=e.length,re=i??(j>0?A.getId(e[0]):void 0),M=!v&&!!p&&(m===void 0||j<m),N=M&&(h===`field`||j>0)?(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`outline`,icon:x,onClick:p,children:k.gallery.add}):m!==void 0&&j>=m?(0,G.jsx)(c,{variant:`secondary`,children:k.gallery.maxReached}):null,P=(t,n)=>{if(n<0||n>=j||t===n)return;let r=Pe(e,t,n);u?.(r.map(e=>A.getId(e)),r)},F=!!(n||r||C||N),ie=j===0&&h!==`field`,ae=()=>!M||h!==`field`?null:(0,G.jsxs)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,className:D(`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":k.gallery.addTile,onClick:p,children:[(0,G.jsx)(x,{className:`size-4`}),(0,G.jsx)(`span`,{className:`sr-only`,children:k.gallery.addTile})]});return(0,G.jsxs)(`section`,{className:D(`media-resource-gallery--component rounded-lg border border-border bg-card shadow-xs`,ne),"data-layout":h,"data-density":_,...O,children:[F&&(0,G.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,G.jsxs)(`div`,{className:`min-w-0`,children:[!!n&&(0,G.jsx)(o,{tag:`div`,weight:`semibold`,children:n}),!!r&&(0,G.jsx)(o,{size:`xs`,type:`secondary`,className:`mt-0.5`,children:r})]}),(0,G.jsx)(`div`,{className:`media-resource-gallery--actions flex flex-wrap items-center gap-2`,children:C??N})]}),ie?(0,G.jsx)(`div`,{className:`media-resource-gallery--empty p-4 pt-0`,children:y??(0,G.jsx)(Se,{title:k.gallery.emptyTitle,description:k.gallery.emptyDescription,action:M?(0,G.jsx)(l,{type:`button`,icon:oe,onClick:p,children:k.gallery.add}):void 0})}):(0,G.jsxs)(`div`,{className:D(`media-resource-gallery--items p-4`,F&&`pt-0`,h===`list`?`grid gap-2`:h===`field`?`grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-3 sm:grid-cols-[repeat(auto-fill,minmax(108px,1fr))]`:_===`compact`?`grid grid-cols-[repeat(auto-fill,minmax(132px,1fr))] gap-3`:`grid grid-cols-[repeat(auto-fill,minmax(164px,1fr))] gap-3`),children:[e.map((e,t)=>{let n=A.getId(e),r=A.getName(e),i=A.getType(e),u=A.getSrc(e),p=A.getAlt(e)||r,m=n===re,_=A.getPublic(e)===!1,y=A.getDuration(e),x=t>0,C=t<j-1,E=T?.(e,{id:n,index:t,total:j,primary:m,accessors:A,canMovePrevious:x,canMoveNext:C,setPrimary:()=>a?.(n,e),remove:()=>s?.(n,e),movePrevious:()=>P(t,t-1),moveNext:()=>P(t,t+1)});return E?(0,G.jsx)(`div`,{children:E},n):h===`field`?(0,G.jsxs)(`div`,{className:D(`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`,m&&`col-span-2 row-span-2 min-h-52`),"data-primary":m||void 0,children:[u?(0,G.jsx)(`img`,{src:u,alt:p,loading:`lazy`,className:`size-full object-cover`}):(0,G.jsx)(`div`,{className:`flex size-full items-center justify-center bg-muted text-muted-foreground`,children:(0,G.jsx)(g,{className:m?`size-7`:`size-5`})}),m&&(0,G.jsx)(c,{variant:`secondary`,className:`absolute left-2 top-2 bg-background/90 shadow-xs`,children:k.gallery.cover}),i===`video`&&!!y&&(0,G.jsxs)(c,{variant:`secondary`,className:`absolute bottom-2 left-2 bg-foreground text-background`,children:[(0,G.jsx)(I,{className:`size-3 fill-current`}),y]}),_&&(0,G.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,G.jsx)(b,{className:`size-3`})}),!v&&(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`solid`,size:`icon-xs`,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":k.gallery.remove,onClick:()=>s?.(n,e),children:(0,G.jsx)(w,{className:`size-3.5`})})]},n):h===`list`?(0,G.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":m||void 0,children:[(0,G.jsx)(`div`,{className:`relative size-12 shrink-0 overflow-hidden rounded-md bg-muted`,children:u?(0,G.jsx)(`img`,{src:u,alt:p,loading:`lazy`,className:`size-full object-cover`}):(0,G.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:(0,G.jsx)(g,{className:`size-4`})})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(o,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:r}),m&&(0,G.jsx)(c,{variant:`info`,children:k.gallery.primary})]}),(0,G.jsxs)(o,{size:`xxs`,type:`secondary`,children:[L(k.gallery.itemPosition,{index:t+1,total:j}),` · `,H(A.getSize(e))||k.unknownSize]})]}),!v&&(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:m,"aria-label":k.gallery.setPrimary,onClick:()=>a?.(n,e),children:(0,G.jsx)(ee,{className:`size-3.5`})}),(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:!x,"aria-label":k.gallery.movePrevious,onClick:()=>P(t,t-1),children:(0,G.jsx)(d,{className:`size-3.5`})}),(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:!C,"aria-label":k.gallery.moveNext,onClick:()=>P(t,t+1),children:(0,G.jsx)(f,{className:`size-3.5`})}),(0,G.jsx)(l,{type:`button`,variant:`error`,buttonStyle:`ghost`,size:`icon-xs`,"aria-label":k.gallery.remove,onClick:()=>s?.(n,e),children:(0,G.jsx)(S,{className:`size-3.5`})})]})]},n):(0,G.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":m||void 0,children:[(0,G.jsxs)(`div`,{className:`relative aspect-[4/3] bg-muted`,children:[u?(0,G.jsx)(`img`,{src:u,alt:p,loading:`lazy`,className:`size-full object-cover`}):(0,G.jsx)(`div`,{className:`flex size-full items-center justify-center text-muted-foreground`,children:(0,G.jsx)(g,{className:`size-6`})}),(0,G.jsxs)(`div`,{className:`absolute left-2 top-2 flex flex-wrap gap-1`,children:[m&&(0,G.jsx)(c,{variant:`info`,children:k.gallery.primary}),(0,G.jsx)(c,{variant:`secondary`,children:L(k.gallery.itemPosition,{index:t+1,total:j})})]})]}),(0,G.jsxs)(`div`,{className:`media-resource-gallery--item-body grid gap-2 p-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(o,{tag:`div`,weight:`semibold`,size:`xs`,className:`truncate`,children:r}),(0,G.jsx)(o,{size:`xxs`,type:`secondary`,children:H(A.getSize(e))||k.unknownSize})]}),!v&&(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:m,"aria-label":k.gallery.setPrimary,onClick:()=>a?.(n,e),children:(0,G.jsx)(ee,{className:`size-3.5`})}),(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:!x,"aria-label":k.gallery.movePrevious,onClick:()=>P(t,t-1),children:(0,G.jsx)(d,{className:`size-3.5`})}),(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`icon-xs`,disabled:!C,"aria-label":k.gallery.moveNext,onClick:()=>P(t,t+1),children:(0,G.jsx)(f,{className:`size-3.5`})}),(0,G.jsx)(l,{type:`button`,variant:`error`,buttonStyle:`ghost`,size:`icon-xs`,className:`ml-auto`,"aria-label":k.gallery.remove,onClick:()=>s?.(n,e),children:(0,G.jsx)(S,{className:`size-3.5`})})]})]})]},n)}),ae()]})]})}var Ie=e({AsyncFetcherLibrary:()=>Ye,ConfirmOnSelectDialog:()=>Je,EmbeddedLibrary:()=>We,EmptyAndErrorStates:()=>Xe,ExternalResourceGallery:()=>qe,HeadlessSelection:()=>Ze,ProductMediaDialog:()=>Ge,ResourceGalleryList:()=>Ke}),Le=[{value:`Products`,label:`Products`},{value:`Lifestyle`,label:`Lifestyle`},{value:`Banners`,label:`Banners`}];function X(e,t,n){let r=`
|
|
2
2
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 360">
|
|
3
3
|
<defs>
|
|
4
4
|
<linearGradient id="g" x1="0" x2="1" y1="0" y2="1">
|
|
@@ -12,7 +12,7 @@ import{n as e,r as t}from"./chunk-QTnfLwEv.js";import{n,t as r}from"./react-dom-
|
|
|
12
12
|
<path d="M42 270c68-54 126-58 176-12s111 42 220-12v114H42V270Z" fill="rgba(255,255,255,.18)"/>
|
|
13
13
|
<text x="40" y="58" fill="rgba(255,255,255,.92)" font-family="Inter, ui-sans-serif, system-ui" font-size="28" font-weight="700">${e}</text>
|
|
14
14
|
<text x="40" y="91" fill="rgba(255,255,255,.72)" font-family="Inter, ui-sans-serif, system-ui" font-size="15" font-weight="500">Preview asset</text>
|
|
15
|
-
</svg>`;return`data:image/svg+xml,${encodeURIComponent(r)}`}var Z=[{id:`m01`,name:`balsamic-bottle-front.jpg`,type:`image`,src:X(`Bottle front`,`#a16207`,`#f5d0a9`),alt:`Front view of aged balsamic bottle on white`,size:318500,width:1600,height:2e3,collection:`Products`,tags:[`bottle`,`primary`],public:!0,uploadedAt:`May 28, 2026`,usageCount:5},{id:`m02`,name:`balsamic-bottle-back.jpg`,type:`image`,src:X(`Bottle back`,`#78350f`,`#d6a15f`),alt:`Back label with ingredients`,size:287200,width:1600,height:2e3,collection:`Products`,tags:[`bottle`,`label`],public:!0,uploadedAt:`May 28, 2026`,usageCount:2},{id:`m03`,name:`label-detail-macro.jpg`,type:`image`,src:X(`Label detail`,`#7f1d1d`,`#fca5a5`),alt:`Macro shot of embossed label`,size:412800,width:2e3,height:1500,collection:`Products`,tags:[`label`,`macro`],public:!0,uploadedAt:`May 26, 2026`,usageCount:3},{id:`m04`,name:`olive-grove-hero.jpg`,type:`image`,src:X(`Olive grove`,`#365314`,`#bef264`),alt:`Olive grove at golden hour`,size:1228800,width:2400,height:1600,collection:`Lifestyle`,tags:[`hero`,`estate`],public:!0,uploadedAt:`May 24, 2026`,usageCount:3},{id:`m05`,name:`tasting-set-overhead.jpg`,type:`image`,src:X(`Tasting set`,`#334155`,`#cbd5e1`),alt:`Overhead tasting set on linen`,size:689400,width:2e3,height:2e3,collection:`Lifestyle`,tags:[`tasting`,`flat-lay`],public:!0,uploadedAt:`May 22, 2026`,usageCount:1},{id:`m06`,name:`harvest-table.mp4`,type:`video`,src:X(`Harvest table`,`#166534`,`#86efac`),alt:``,size:155e5,width:1920,height:1080,duration:`0:42`,collection:`Lifestyle`,tags:[`harvest`,`b-roll`],public:!1,uploadedAt:`May 20, 2026`,usageCount:0},{id:`m07`,name:`press-room-tour.mp4`,type:`video`,src:X(`Press room`,`#1e3a8a`,`#93c5fd`),alt:``,size:3796e4,width:1920,height:1080,duration:`1:58`,collection:`Lifestyle`,tags:[`tour`,`process`],public:!0,uploadedAt:`May 18, 2026`,usageCount:1},{id:`m08`,name:`gift-box-closed.jpg`,type:`image`,src:X(`Gift closed`,`#581c87`,`#d8b4fe`),alt:`Closed gift box with ribbon`,size:254100,width:1600,height:1200,collection:`Products`,tags:[`gift`,`packaging`],public:!0,uploadedAt:`May 15, 2026`,usageCount:2},{id:`m09`,name:`gift-box-open.jpg`,type:`image`,src:X(`Gift open`,`#831843`,`#f9a8d4`),alt:`Open gift box showing two bottles`,size:301700,width:1600,height:1200,collection:`Products`,tags:[`gift`,`packaging`],public:!0,uploadedAt:`May 15, 2026`,usageCount:2},{id:`m10`,name:`vineyard-autumn.jpg`,type:`image`,src:X(`Vineyard autumn`,`#7c2d12`,`#fdba74`),alt:`Wide autumn vineyard banner`,size:2867200,width:2880,height:1200,collection:`Banners`,tags:[`banner`,`seasonal`],public:!0,uploadedAt:`May 12, 2026`,usageCount:1},{id:`m11`,name:`spring-menu-banner.jpg`,type:`image`,src:X(`Spring menu`,`#14532d`,`#bbf7d0`),alt:`Spring menu campaign banner`,size:1945600,width:2880,height:1200,collection:`Banners`,tags:[`banner`,`campaign`],public:!1,uploadedAt:`May 10, 2026`,usageCount:0},{id:`m12`,name:`pour-shot-slowmo.mp4`,type:`video`,src:X(`Pour shot`,`#4c0519`,`#fb7185`),alt:``,size:829e4,width:1080,height:1350,duration:`0:15`,collection:`Products`,tags:[`pour`,`social`],public:!0,uploadedAt:`May 8, 2026`,usageCount:4},{id:`m13`,name:`cellar-barrels.jpg`,type:`image`,src:X(`Cellar barrels`,`#3f2a1d`,`#a16207`),alt:`Oak barrels in the aging cellar`,size:874500,width:2400,height:1600,collection:`Lifestyle`,tags:[`cellar`,`aging`],public:!0,uploadedAt:`May 5, 2026`,usageCount:1},{id:`m14`,name:`chef-pairing-event.jpg`,type:`image`,src:X(`Chef pairing`,`#111827`,`#9ca3af`),alt:`Chef plating at pairing event`,size:763900,width:2e3,height:1334,collection:`Lifestyle`,tags:[`event`,`pairing`],public:!1,uploadedAt:`May 2, 2026`,usageCount:0},{id:`m15`,name:`bottle-trio-white.jpg`,type:`image`,src:X(`Bottle trio`,`#f8fafc`,`#64748b`),alt:`Three bottles on white backdrop`,size:356200,width:2e3,height:1500,collection:`Products`,tags:[`trio`,`primary`],public:!0,uploadedAt:`Apr 29, 2026`,usageCount:6},{id:`m16`,name:`cork-and-wax-seal.jpg`,type:`image`,src:X(`Wax seal`,`#7f1d1d`,`#f87171`),alt:`Wax seal close-up`,size:298300,width:1600,height:1600,collection:`Products`,tags:[`detail`,`seal`],public:!0,uploadedAt:`Apr 25, 2026`,usageCount:1},{id:`m17`,name:`estate-map-illustrated.png`,type:`image`,src:X(`Estate map`,`#0f766e`,`#99f6e4`),alt:`Illustrated map of the estate`,size:1126400,width:2400,height:1800,collection:`Banners`,tags:[`map`,`illustration`],public:!0,uploadedAt:`Apr 20, 2026`,usageCount:1},{id:`m18`,name:`winter-campaign.jpg`,type:`image`,src:X(`Winter campaign`,`#1e3a8a`,`#bfdbfe`),alt:`Winter campaign banner`,size:2150400,width:2880,height:1200,collection:`Banners`,tags:[`banner`,`seasonal`],public:!1,uploadedAt:`Apr 14, 2026`,usageCount:0}],Re=[{assetKey:`dam:landing-hero`,label:`landing-page-hero.avif`,kind:`image`,previewUrl:X(`DAM hero`,`#0f172a`,`#38bdf8`),altText:`Hero image prepared by the external DAM`,bytes:124e4,folder:`DAM / Marketing`,references:14},{assetKey:`dam:press-kit`,label:`brand-press-kit.zip`,kind:`file`,bytes:462e4,folder:`DAM / Documents`,references:6}];function ze(e){return e.type.startsWith(`image/`)?`image`:e.type.startsWith(`video/`)?`video`:`file`}function Be(e){if(e.type.startsWith(`image/`)&&!(typeof URL>`u`||typeof URL.createObjectURL!=`function`))return URL.createObjectURL(e)}function Ve(e,t){return e.map((e,n)=>({id:`uploaded-${Date.now()}-${n}`,name:e.name,type:ze(e),src:Be(e),size:e.size,collection:t.collection??`Products`,tags:t.tags,public:t.public,uploadedAt:new Date().toISOString(),usageCount:0}))}function He(e,t){let n=t.query.trim().toLowerCase();return e.filter(e=>t.type!==`all`&&e.type!==t.type||t.collection&&e.collection!==t.collection?!1:n?[e.name,e.alt,e.collection,...e.tags??[]].filter(Boolean).join(` `).toLowerCase().includes(n):!0).sort((e,n)=>t.sort===`name`?e.name.localeCompare(n.name):t.sort===`size`?(n.size??0)-(e.size??0):t.sort===`usage`?(n.usageCount??0)-(e.usageCount??0):new Date(n.uploadedAt??0).getTime()-new Date(e.uploadedAt??0).getTime())}function Ue(e,t){let n=new Map(t.map((e,t)=>[e.id,t]));return e.slice().sort((e,t)=>(n.get(e)??0)-(n.get(t)??0))}function We(){let[e,t]=(0,R.useState)([`m01`]);return(0,G.jsx)(Me,{title:`Campaign media`,description:`Search, inspect metadata, edit alt text, and stage uploads from one surface.`,items:Z,collections:Le,value:e,onValueChange:t,onUpload:(e,t)=>Ve(e,t),onConfirm:e=>{t(e.map(e=>e.id))},onItemUpdate:()=>void 0,onItemDelete:()=>void 0,defaultUploadOptions:{collection:`Products`,tags:[`product`]},slots:{headerEnd:(0,G.jsxs)(u,{variant:`info`,children:[(0,G.jsx)(p,{className:`size-3`}),`Admin ready`]})}})}function Ge(){let[e,t]=(0,R.useState)(!1),[n,r]=(0,R.useState)([`m01`,`m03`]),[i,a]=(0,R.useState)(`m01`),o=(0,R.useMemo)(()=>Z.filter(e=>n.includes(e.id)),[n]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Fe,{items:o,primaryId:i,title:`Media`,description:`Images and videos shown on the product page`,onAdd:()=>t(!0),onPrimaryChange:a,onRemove:e=>{r(t=>{let n=t.filter(t=>t!==e);return i===e&&a(n[0]??``),n})},onReorder:(e,t)=>r(e=>Ue(e,t)),maxItems:5}),(0,G.jsx)(Ne,{open:e,onOpenChange:t,dialogTitle:`Add media`,dialogDescription:`Pick from the library, or upload new files`,items:Z,collections:Le,value:n,onValueChange:r,onConfirm:(e,n)=>{r(n),a(e=>n.includes(e)?e:n[0]??``),t(!1)},onClose:()=>t(!1),onUpload:(e,t)=>Ve(e,t),defaultUploadOptions:{collection:`Products`,public:!0}})]})}function Ke(){let[e,t]=(0,R.useState)([`m04`,`m06`,`m15`]),[n,r]=(0,R.useState)(`m04`);return(0,G.jsx)(Fe,{items:(0,R.useMemo)(()=>Z.filter(t=>e.includes(t.id)),[e]),primaryId:n,title:`CMS resource gallery`,description:`List mode keeps filenames, position, size, cover state, and row actions scannable in dense admin forms.`,layout:`list`,onAdd:()=>void 0,onPrimaryChange:r,onRemove:e=>t(t=>t.filter(t=>t!==e)),onReorder:(e,n)=>t(e=>Ue(e,n)),maxItems:3,strings:{gallery:{maxReached:`3 of 3 attached`}}})}function qe(){return(0,G.jsx)(Fe,{items:Re,title:`External DAM attachments`,description:`Accessors let app-owned media records render without reshaping API responses.`,layout:`grid`,primaryId:`dam:landing-hero`,readOnly:!0,accessors:{getId:e=>e.assetKey,getName:e=>e.label,getType:e=>e.kind,getSrc:e=>e.previewUrl,getAlt:e=>e.altText,getSize:e=>e.bytes,getCollection:e=>e.folder,getUsageCount:e=>e.references}})}function Je(){let[e,t]=(0,R.useState)(null);return(0,G.jsx)(re,{icon:(0,G.jsx)(ee,{className:`size-4`}),title:`Single-pick strategy`,description:`Use confirmOnSelect for avatar, cover, or logo pickers where clicking one asset should commit and close.`,headerEnd:e?(0,G.jsx)(u,{variant:`success`,children:e.name}):(0,G.jsx)(u,{variant:`secondary`,children:`No asset`}),children:(0,G.jsx)(Ne,{trigger:(0,G.jsx)(c,{type:`button`,icon:oe,children:`Pick cover`}),items:Z,collections:Le,selectionMode:`single`,confirmOnSelect:!0,allowUpload:!1,dialogTitle:`Pick cover media`,dialogDescription:`The dialog closes immediately after the selected item is confirmed.`,onConfirm:e=>t(e[0]??null)})})}function Ye(){return(0,G.jsx)(Me,{title:`Remote media source`,description:`The fetcher receives query, type, collection, sort, and abort signal; the consumer owns the API call.`,fetcher:(0,R.useCallback)(async e=>{await new Promise(e=>window.setTimeout(e,240));let t=He(Z,e);return{items:t,total:t.length}},[]),collections:Le,selectionMode:`single`,allowUpload:!1,defaultView:`table`,slots:{headerStart:(0,G.jsx)(`span`,{className:`inline-flex size-9 items-center justify-center rounded-lg bg-info/10 text-info`,children:(0,G.jsx)(E,{className:`size-4`})})}})}function Xe(){let e=(0,R.useCallback)(async()=>{throw await new Promise(e=>window.setTimeout(e,120)),Error(`Preview fetch failed`)},[]);return(0,G.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,G.jsx)(Me,{title:`Empty asset library`,description:`Empty state gives users a route into upload when no assets exist yet.`,items:[],collections:Le,heightClassName:`h-[520px]`}),(0,G.jsx)(Me,{title:`Remote error`,description:`Fetcher errors render a tokenized alert while the consumer handles retry strategy.`,fetcher:e,collections:Le,allowUpload:!1,heightClassName:`h-[520px]`})]})}function Ze(){let e=ve({items:Z,selectionMode:`single`,defaultValue:[`m04`],defaultType:`image`});return(0,G.jsxs)(re,{icon:(0,G.jsx)(se,{className:`size-4`}),title:`Headless selection`,description:`useMediaLibrary exposes the same filtering, selection, and accessors for custom layouts.`,headerEnd:(0,G.jsxs)(u,{variant:`secondary`,children:[e.visibleItems.length,` images`]}),children:[(0,G.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-4`,children:e.visibleItems.slice(0,4).map(t=>{let n=e.accessors.getId(t);return(0,G.jsx)(Ce,{item:t,selected:e.selectedSet.has(n),selectionMode:`single`,accessors:e.accessors,strings:le,onToggle:()=>e.toggleSelection(n),onDetails:()=>e.setDetailId(n)},n)})}),(0,G.jsxs)(`div`,{className:`mt-3 flex items-center justify-between rounded-lg border border-border bg-muted/20 px-3 py-2`,children:[(0,G.jsxs)(i,{size:`xs`,type:`secondary`,children:[`Selected: `,e.selectedItems[0]?e.accessors.getName(e.selectedItems[0]):`None`]}),(0,G.jsx)(c,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,icon:m,onClick:e.clearSelection,children:`Clear`})]})]})}var Q=`import { useCallback, useMemo, useState } from 'react';
|
|
15
|
+
</svg>`;return`data:image/svg+xml,${encodeURIComponent(r)}`}var Z=[{id:`m01`,name:`balsamic-bottle-front.jpg`,type:`image`,src:X(`Bottle front`,`#a16207`,`#f5d0a9`),alt:`Front view of aged balsamic bottle on white`,size:318500,width:1600,height:2e3,collection:`Products`,tags:[`bottle`,`primary`],public:!0,uploadedAt:`May 28, 2026`,usageCount:5},{id:`m02`,name:`balsamic-bottle-back.jpg`,type:`image`,src:X(`Bottle back`,`#78350f`,`#d6a15f`),alt:`Back label with ingredients`,size:287200,width:1600,height:2e3,collection:`Products`,tags:[`bottle`,`label`],public:!0,uploadedAt:`May 28, 2026`,usageCount:2},{id:`m03`,name:`label-detail-macro.jpg`,type:`image`,src:X(`Label detail`,`#7f1d1d`,`#fca5a5`),alt:`Macro shot of embossed label`,size:412800,width:2e3,height:1500,collection:`Products`,tags:[`label`,`macro`],public:!0,uploadedAt:`May 26, 2026`,usageCount:3},{id:`m04`,name:`olive-grove-hero.jpg`,type:`image`,src:X(`Olive grove`,`#365314`,`#bef264`),alt:`Olive grove at golden hour`,size:1228800,width:2400,height:1600,collection:`Lifestyle`,tags:[`hero`,`estate`],public:!0,uploadedAt:`May 24, 2026`,usageCount:3},{id:`m05`,name:`tasting-set-overhead.jpg`,type:`image`,src:X(`Tasting set`,`#334155`,`#cbd5e1`),alt:`Overhead tasting set on linen`,size:689400,width:2e3,height:2e3,collection:`Lifestyle`,tags:[`tasting`,`flat-lay`],public:!0,uploadedAt:`May 22, 2026`,usageCount:1},{id:`m06`,name:`harvest-table.mp4`,type:`video`,src:X(`Harvest table`,`#166534`,`#86efac`),alt:``,size:155e5,width:1920,height:1080,duration:`0:42`,collection:`Lifestyle`,tags:[`harvest`,`b-roll`],public:!1,uploadedAt:`May 20, 2026`,usageCount:0},{id:`m07`,name:`press-room-tour.mp4`,type:`video`,src:X(`Press room`,`#1e3a8a`,`#93c5fd`),alt:``,size:3796e4,width:1920,height:1080,duration:`1:58`,collection:`Lifestyle`,tags:[`tour`,`process`],public:!0,uploadedAt:`May 18, 2026`,usageCount:1},{id:`m08`,name:`gift-box-closed.jpg`,type:`image`,src:X(`Gift closed`,`#581c87`,`#d8b4fe`),alt:`Closed gift box with ribbon`,size:254100,width:1600,height:1200,collection:`Products`,tags:[`gift`,`packaging`],public:!0,uploadedAt:`May 15, 2026`,usageCount:2},{id:`m09`,name:`gift-box-open.jpg`,type:`image`,src:X(`Gift open`,`#831843`,`#f9a8d4`),alt:`Open gift box showing two bottles`,size:301700,width:1600,height:1200,collection:`Products`,tags:[`gift`,`packaging`],public:!0,uploadedAt:`May 15, 2026`,usageCount:2},{id:`m10`,name:`vineyard-autumn.jpg`,type:`image`,src:X(`Vineyard autumn`,`#7c2d12`,`#fdba74`),alt:`Wide autumn vineyard banner`,size:2867200,width:2880,height:1200,collection:`Banners`,tags:[`banner`,`seasonal`],public:!0,uploadedAt:`May 12, 2026`,usageCount:1},{id:`m11`,name:`spring-menu-banner.jpg`,type:`image`,src:X(`Spring menu`,`#14532d`,`#bbf7d0`),alt:`Spring menu campaign banner`,size:1945600,width:2880,height:1200,collection:`Banners`,tags:[`banner`,`campaign`],public:!1,uploadedAt:`May 10, 2026`,usageCount:0},{id:`m12`,name:`pour-shot-slowmo.mp4`,type:`video`,src:X(`Pour shot`,`#4c0519`,`#fb7185`),alt:``,size:829e4,width:1080,height:1350,duration:`0:15`,collection:`Products`,tags:[`pour`,`social`],public:!0,uploadedAt:`May 8, 2026`,usageCount:4},{id:`m13`,name:`cellar-barrels.jpg`,type:`image`,src:X(`Cellar barrels`,`#3f2a1d`,`#a16207`),alt:`Oak barrels in the aging cellar`,size:874500,width:2400,height:1600,collection:`Lifestyle`,tags:[`cellar`,`aging`],public:!0,uploadedAt:`May 5, 2026`,usageCount:1},{id:`m14`,name:`chef-pairing-event.jpg`,type:`image`,src:X(`Chef pairing`,`#111827`,`#9ca3af`),alt:`Chef plating at pairing event`,size:763900,width:2e3,height:1334,collection:`Lifestyle`,tags:[`event`,`pairing`],public:!1,uploadedAt:`May 2, 2026`,usageCount:0},{id:`m15`,name:`bottle-trio-white.jpg`,type:`image`,src:X(`Bottle trio`,`#f8fafc`,`#64748b`),alt:`Three bottles on white backdrop`,size:356200,width:2e3,height:1500,collection:`Products`,tags:[`trio`,`primary`],public:!0,uploadedAt:`Apr 29, 2026`,usageCount:6},{id:`m16`,name:`cork-and-wax-seal.jpg`,type:`image`,src:X(`Wax seal`,`#7f1d1d`,`#f87171`),alt:`Wax seal close-up`,size:298300,width:1600,height:1600,collection:`Products`,tags:[`detail`,`seal`],public:!0,uploadedAt:`Apr 25, 2026`,usageCount:1},{id:`m17`,name:`estate-map-illustrated.png`,type:`image`,src:X(`Estate map`,`#0f766e`,`#99f6e4`),alt:`Illustrated map of the estate`,size:1126400,width:2400,height:1800,collection:`Banners`,tags:[`map`,`illustration`],public:!0,uploadedAt:`Apr 20, 2026`,usageCount:1},{id:`m18`,name:`winter-campaign.jpg`,type:`image`,src:X(`Winter campaign`,`#1e3a8a`,`#bfdbfe`),alt:`Winter campaign banner`,size:2150400,width:2880,height:1200,collection:`Banners`,tags:[`banner`,`seasonal`],public:!1,uploadedAt:`Apr 14, 2026`,usageCount:0}],Re=[{assetKey:`dam:landing-hero`,label:`landing-page-hero.avif`,kind:`image`,previewUrl:X(`DAM hero`,`#0f172a`,`#38bdf8`),altText:`Hero image prepared by the external DAM`,bytes:124e4,folder:`DAM / Marketing`,references:14},{assetKey:`dam:press-kit`,label:`brand-press-kit.zip`,kind:`file`,bytes:462e4,folder:`DAM / Documents`,references:6}];function ze(e){return e.type.startsWith(`image/`)?`image`:e.type.startsWith(`video/`)?`video`:`file`}function Be(e){if(e.type.startsWith(`image/`)&&!(typeof URL>`u`||typeof URL.createObjectURL!=`function`))return URL.createObjectURL(e)}function Ve(e,t){return e.map((e,n)=>({id:`uploaded-${Date.now()}-${n}`,name:e.name,type:ze(e),src:Be(e),size:e.size,collection:t.collection??`Products`,tags:t.tags,public:t.public,uploadedAt:new Date().toISOString(),usageCount:0}))}function He(e,t){let n=t.query.trim().toLowerCase();return e.filter(e=>t.type!==`all`&&e.type!==t.type||t.collection&&e.collection!==t.collection?!1:n?[e.name,e.alt,e.collection,...e.tags??[]].filter(Boolean).join(` `).toLowerCase().includes(n):!0).sort((e,n)=>t.sort===`name`?e.name.localeCompare(n.name):t.sort===`size`?(n.size??0)-(e.size??0):t.sort===`usage`?(n.usageCount??0)-(e.usageCount??0):new Date(n.uploadedAt??0).getTime()-new Date(e.uploadedAt??0).getTime())}function Ue(e,t){let n=new Map(t.map((e,t)=>[e.id,t]));return e.slice().sort((e,t)=>(n.get(e)??0)-(n.get(t)??0))}function We(){let[e,t]=(0,R.useState)([`m01`]);return(0,G.jsx)(Me,{title:`Campaign media`,description:`Search, inspect metadata, edit alt text, and stage uploads from one surface.`,items:Z,collections:Le,value:e,onValueChange:t,onUpload:(e,t)=>Ve(e,t),onConfirm:e=>{t(e.map(e=>e.id))},onItemUpdate:()=>void 0,onItemDelete:()=>void 0,defaultUploadOptions:{collection:`Products`,tags:[`product`]},slots:{headerEnd:(0,G.jsxs)(c,{variant:`info`,children:[(0,G.jsx)(p,{className:`size-3`}),`Admin ready`]})}})}function Ge(){let[e,t]=(0,R.useState)(!1),[n,r]=(0,R.useState)([`m01`,`m03`]),[i,a]=(0,R.useState)(`m01`),o=(0,R.useMemo)(()=>Z.filter(e=>n.includes(e.id)),[n]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Fe,{items:o,primaryId:i,title:`Media`,description:`Images and videos shown on the product page`,onAdd:()=>t(!0),onPrimaryChange:a,onRemove:e=>{r(t=>{let n=t.filter(t=>t!==e);return i===e&&a(n[0]??``),n})},onReorder:(e,t)=>r(e=>Ue(e,t)),maxItems:5}),(0,G.jsx)(Ne,{open:e,onOpenChange:t,dialogTitle:`Add media`,dialogDescription:`Pick from the library, or upload new files`,items:Z,collections:Le,value:n,onValueChange:r,onConfirm:(e,n)=>{r(n),a(e=>n.includes(e)?e:n[0]??``),t(!1)},onClose:()=>t(!1),onUpload:(e,t)=>Ve(e,t),defaultUploadOptions:{collection:`Products`,public:!0}})]})}function Ke(){let[e,t]=(0,R.useState)([`m04`,`m06`,`m15`]),[n,r]=(0,R.useState)(`m04`);return(0,G.jsx)(Fe,{items:(0,R.useMemo)(()=>Z.filter(t=>e.includes(t.id)),[e]),primaryId:n,title:`CMS resource gallery`,description:`List mode keeps filenames, position, size, cover state, and row actions scannable in dense admin forms.`,layout:`list`,onAdd:()=>void 0,onPrimaryChange:r,onRemove:e=>t(t=>t.filter(t=>t!==e)),onReorder:(e,n)=>t(e=>Ue(e,n)),maxItems:3,strings:{gallery:{maxReached:`3 of 3 attached`}}})}function qe(){return(0,G.jsx)(Fe,{items:Re,title:`External DAM attachments`,description:`Accessors let app-owned media records render without reshaping API responses.`,layout:`grid`,primaryId:`dam:landing-hero`,readOnly:!0,accessors:{getId:e=>e.assetKey,getName:e=>e.label,getType:e=>e.kind,getSrc:e=>e.previewUrl,getAlt:e=>e.altText,getSize:e=>e.bytes,getCollection:e=>e.folder,getUsageCount:e=>e.references}})}function Je(){let[e,t]=(0,R.useState)(null);return(0,G.jsx)(re,{icon:(0,G.jsx)(ee,{className:`size-4`}),title:`Single-pick strategy`,description:`Use confirmOnSelect for avatar, cover, or logo pickers where clicking one asset should commit and close.`,headerEnd:e?(0,G.jsx)(c,{variant:`success`,children:e.name}):(0,G.jsx)(c,{variant:`secondary`,children:`No asset`}),children:(0,G.jsx)(Ne,{trigger:(0,G.jsx)(l,{type:`button`,icon:oe,children:`Pick cover`}),items:Z,collections:Le,selectionMode:`single`,confirmOnSelect:!0,allowUpload:!1,dialogTitle:`Pick cover media`,dialogDescription:`The dialog closes immediately after the selected item is confirmed.`,onConfirm:e=>t(e[0]??null)})})}function Ye(){return(0,G.jsx)(Me,{title:`Remote media source`,description:`The fetcher receives query, type, collection, sort, and abort signal; the consumer owns the API call.`,fetcher:(0,R.useCallback)(async e=>{await new Promise(e=>window.setTimeout(e,240));let t=He(Z,e);return{items:t,total:t.length}},[]),collections:Le,selectionMode:`single`,allowUpload:!1,defaultView:`table`,slots:{headerStart:(0,G.jsx)(`span`,{className:`inline-flex size-9 items-center justify-center rounded-lg bg-info/10 text-info`,children:(0,G.jsx)(E,{className:`size-4`})})}})}function Xe(){let e=(0,R.useCallback)(async()=>{throw await new Promise(e=>window.setTimeout(e,120)),Error(`Preview fetch failed`)},[]);return(0,G.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,G.jsx)(Me,{title:`Empty asset library`,description:`Empty state gives users a route into upload when no assets exist yet.`,items:[],collections:Le,heightClassName:`h-[520px]`}),(0,G.jsx)(Me,{title:`Remote error`,description:`Fetcher errors render a tokenized alert while the consumer handles retry strategy.`,fetcher:e,collections:Le,allowUpload:!1,heightClassName:`h-[520px]`})]})}function Ze(){let e=ve({items:Z,selectionMode:`single`,defaultValue:[`m04`],defaultType:`image`});return(0,G.jsxs)(re,{icon:(0,G.jsx)(se,{className:`size-4`}),title:`Headless selection`,description:`useMediaLibrary exposes the same filtering, selection, and accessors for custom layouts.`,headerEnd:(0,G.jsxs)(c,{variant:`secondary`,children:[e.visibleItems.length,` images`]}),children:[(0,G.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-4`,children:e.visibleItems.slice(0,4).map(t=>{let n=e.accessors.getId(t);return(0,G.jsx)(Ce,{item:t,selected:e.selectedSet.has(n),selectionMode:`single`,accessors:e.accessors,strings:le,onToggle:()=>e.toggleSelection(n),onDetails:()=>e.setDetailId(n)},n)})}),(0,G.jsxs)(`div`,{className:`mt-3 flex items-center justify-between rounded-lg border border-border bg-muted/20 px-3 py-2`,children:[(0,G.jsxs)(o,{size:`xs`,type:`secondary`,children:[`Selected: `,e.selectedItems[0]?e.accessors.getName(e.selectedItems[0]):`None`]}),(0,G.jsx)(l,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,icon:m,onClick:e.clearSelection,children:`Clear`})]})]})}var Q=`import { useCallback, useMemo, useState } from 'react';
|
|
16
16
|
import {
|
|
17
17
|
CheckCircle2,
|
|
18
18
|
ImagePlus,
|
|
@@ -692,4 +692,4 @@ export function HeadlessSelection() {
|
|
|
692
692
|
</SmartCard>
|
|
693
693
|
);
|
|
694
694
|
}
|
|
695
|
-
`;function Qe(e){let t={code:`code`,h4:`h4`,p:`p`,...e.components};return Ie||$(`Examples`,!1),Ye||$(`Examples.AsyncFetcherLibrary`,!0),Je||$(`Examples.ConfirmOnSelectDialog`,!0),We||$(`Examples.EmbeddedLibrary`,!0),Xe||$(`Examples.EmptyAndErrorStates`,!0),qe||$(`Examples.ExternalResourceGallery`,!0),Ze||$(`Examples.HeadlessSelection`,!0),Ge||$(`Examples.ProductMediaDialog`,!0),Ke||$(`Examples.ResourceGalleryList`,!0),(0,G.jsxs)(
|
|
695
|
+
`;function Qe(e){let t={code:`code`,h4:`h4`,p:`p`,...e.components};return Ie||$(`Examples`,!1),Ye||$(`Examples.AsyncFetcherLibrary`,!0),Je||$(`Examples.ConfirmOnSelectDialog`,!0),We||$(`Examples.EmbeddedLibrary`,!0),Xe||$(`Examples.EmptyAndErrorStates`,!0),qe||$(`Examples.ExternalResourceGallery`,!0),Ze||$(`Examples.HeadlessSelection`,!0),Ge||$(`Examples.ProductMediaDialog`,!0),Ke||$(`Examples.ResourceGalleryList`,!0),(0,G.jsxs)(i,{title:`Features · Media Library`,description:`Framework-agnostic media picker for admin product, CMS, and campaign flows. Provides an embeddable library surface, a Dialog-backed picker wrapper, upload staging, details editing, controlled selection, async fetching, slots, render hooks, and headless state through useMediaLibrary.`,layer:`features`,status:`ready`,children:[(0,G.jsx)(a,{title:`Embedded library`,id:`embedded`,children:(0,G.jsx)(u,{name:`EmbeddedLibrary`,source:Q,children:(0,G.jsx)(We,{})})}),(0,G.jsxs)(a,{title:`Dialog picker`,id:`dialog`,children:[(0,G.jsx)(u,{name:`ProductMediaDialog`,source:Q,children:(0,G.jsx)(Ge,{})}),(0,G.jsx)(u,{name:`ConfirmOnSelectDialog`,source:Q,children:(0,G.jsx)(Je,{})})]}),(0,G.jsxs)(a,{title:`Resource galleries`,id:`resource-galleries`,children:[(0,G.jsx)(u,{name:`ResourceGalleryList`,source:Q,children:(0,G.jsx)(Ke,{})}),(0,G.jsx)(u,{name:`ExternalResourceGallery`,source:Q,children:(0,G.jsx)(qe,{})})]}),(0,G.jsxs)(a,{title:`Async and states`,id:`async-states`,children:[(0,G.jsx)(u,{name:`AsyncFetcherLibrary`,source:Q,children:(0,G.jsx)(Ye,{})}),(0,G.jsx)(u,{name:`EmptyAndErrorStates`,source:Q,children:(0,G.jsx)(Xe,{})})]}),(0,G.jsx)(a,{title:`Headless selection`,id:`headless-selection`,children:(0,G.jsx)(u,{name:`HeadlessSelection`,source:Q,children:(0,G.jsx)(Ze,{})})}),(0,G.jsxs)(a,{title:`Usage Notes`,id:`usage-notes`,children:[(0,G.jsxs)(t.p,{children:[`Use `,(0,G.jsx)(t.code,{children:`MediaLibrary`}),` when the picker is part of a page, drawer, or feature shell. Use `,(0,G.jsx)(t.code,{children:`MediaLibraryDialog`}),` only when you need modal behavior; it delegates to `,(0,G.jsx)(t.code,{children:`features/overlays/Dialog`}),` for portal, backdrop, escape handling, trigger support, and overlay chrome.`]}),(0,G.jsxs)(t.p,{children:[`Use `,(0,G.jsx)(t.code,{children:`MediaResourceGallery`}),` for the resource field that sits beside the picker: selected media order, primary/cover asset, remove controls, and add-more entry points. Its default `,(0,G.jsx)(t.code,{children:`layout="field"`}),` is the product-form shape with a cover tile and inline add tile; use `,(0,G.jsx)(t.code,{children:`layout="list"`}),` for dense CMS/resource rows and `,(0,G.jsx)(t.code,{children:`layout="grid"`}),` when filenames and metadata should remain visible.`]}),(0,G.jsxs)(t.p,{children:[`Consumers own persistence and routing. Pass `,(0,G.jsx)(t.code,{children:`items`}),` for local collections or `,(0,G.jsx)(t.code,{children:`fetcher`}),` for remote search. Pass `,(0,G.jsx)(t.code,{children:`value`}),` and `,(0,G.jsx)(t.code,{children:`onValueChange`}),` for controlled form fields, `,(0,G.jsx)(t.code,{children:`onConfirm`}),` to commit the selected items, `,(0,G.jsx)(t.code,{children:`onUpload`}),` to stage uploads into your storage flow, and `,(0,G.jsx)(t.code,{children:`onItemUpdate`}),` / `,(0,G.jsx)(t.code,{children:`onItemDelete`}),` for metadata actions.`]}),(0,G.jsxs)(t.p,{children:[`The picker toolbar uses segmented type filters. By default it shows `,(0,G.jsx)(t.code,{children:`all`}),`, `,(0,G.jsx)(t.code,{children:`image`}),`, and `,(0,G.jsx)(t.code,{children:`video`}),`; pass `,(0,G.jsx)(t.code,{children:`typeFilters={['all', 'image', 'video', 'file']}`}),` when documents or generic files should be filterable.`]}),(0,G.jsxs)(t.p,{children:[`The feature is generic. Use `,(0,G.jsx)(t.code,{children:`accessors`}),` to adapt app-owned media records without reshaping data before render.`]})]}),(0,G.jsxs)(a,{title:`API`,id:`api`,children:[(0,G.jsx)(t.h4,{children:`MediaLibrary`}),(0,G.jsx)(O,{component:`MediaLibrary`}),(0,G.jsx)(t.h4,{children:`MediaLibraryDialog`}),(0,G.jsx)(O,{component:`MediaLibraryDialog`}),(0,G.jsx)(t.h4,{children:`MediaLibraryCard`}),(0,G.jsx)(O,{component:`MediaLibraryCard`}),(0,G.jsx)(t.h4,{children:`MediaResourceGallery`}),(0,G.jsx)(O,{component:`MediaResourceGallery`})]})]})}function $e(e={}){let{wrapper:t}=e.components||{};return t?(0,G.jsx)(t,{...e,children:(0,G.jsx)(Qe,{...e})}):Qe(e)}function $(e,t){throw Error(`Expected `+(t?`component`:`object`)+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}export{$e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Rr as e,Vr as t,jr as n,r}from"./example-Cz_880po.js";import{k as i,n as a,s as o}from"./index-BQIv1ffM.js";import{t as s}from"./popover-nCGXR4Yd.js";import{i as c}from"./command-wjOXUieO.js";import{a as l,i as u,n as d,r as f,t as p}from"./command-C4F78Ppy.js";var m=o(),h={primary:`secondary`,success:`success`,warning:`warning`,destructive:`destructive`,info:`info`,secondary:`secondary`},g=({mention:e,resource:t,asLink:r=!0,onClick:i,trailing:o,className:s})=>{if(t?.renderChip)return(0,m.jsx)(m.Fragment,{children:t.renderChip(e)});let c=h[t?.tone??`secondary`]??h.secondary,l=t?.icon,u=(0,m.jsxs)(n,{variant:c,inline:!0,"data-ref-id":e.id,"data-ref-kind":e.kind,className:a(`mention-chip--component`,`align-[-0.15em] cursor-default whitespace-nowrap`,s),children:[l?(0,m.jsx)(l,{className:`size-3 shrink-0`,"aria-hidden":!0}):null,(0,m.jsx)(`span`,{className:`truncate max-w-[14rem]`,children:e.label}),o]});return r&&e.href?(0,m.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer noopener`,onClick:i,className:`inline align-baseline no-underline hover:opacity-90`,children:u}):i?(0,m.jsx)(`span`,{onClick:i,className:`inline align-baseline`,children:u}):u},_={title:`Insert reference`,searchPlaceholder:`Search…`,empty:`No matches.`,loading:`Searching…`},v={title:`Insert reference`,empty:`No matches.`,loading:`Searching…`};function y({open:n,activeKind:o,setActiveKind:h,kinds:g,resources:v,query:y,setQuery:b,suggestions:x,isLoading:S,onSelect:C,strings:w,className:T}){let E=i(_,w);return n?(0,m.jsxs)(s,{align:`start`,className:a(`mention-picker--component`,`w-72 overflow-hidden p-0`,T),children:[(0,m.jsxs)(`div`,{className:`border-b border-border/60 px-3 py-2`,children:[(0,m.jsx)(e,{size:`xxs`,type:`secondary`,weight:`medium`,className:`uppercase tracking-wide`,children:E.title}),g.length>1&&(0,m.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:g.map(e=>{let t=v?.[e],n=t?.icon,i=e===o;return(0,m.jsxs)(r,{type:`button`,variant:i?`primary`:`secondary`,buttonStyle:i?`solid`:`ghost`,size:`xs`,onClick:()=>h(e),className:a(`h-auto gap-1 rounded px-1.5 py-0.5 text-xxs font-medium ring-1 ring-inset transition-colors`,i?`bg-primary text-primary-foreground ring-primary`:`bg-muted text-muted-foreground ring-border/60 hover:bg-muted/80`),children:[n?(0,m.jsx)(n,{className:`size-3`}):null,(0,m.jsx)(`span`,{children:t?.label??String(e)})]},e)})})]}),(0,m.jsxs)(p,{shouldFilter:!1,children:[(0,m.jsx)(c,{placeholder:E.searchPlaceholder,value:y,onValueChange:b}),(0,m.jsxs)(l,{children:[S?(0,m.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-center gap-2 py-3`,children:[(0,m.jsx)(t,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),(0,m.jsx)(e,{tag:`span`,size:`xs`,type:`secondary`,children:E.loading})]}):null,(0,m.jsx)(d,{children:E.empty}),(0,m.jsx)(f,{children:x.map(t=>{let n=t.kind??o??``;return(0,m.jsx)(u,{value:`${n}:${t.id}`,onSelect:()=>C(t),children:(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,m.jsx)(e,{tag:`span`,size:`xs`,weight:`medium`,className:`truncate`,children:t.label}),t.description?(0,m.jsx)(e,{tag:`span`,size:`xxs`,type:`secondary`,className:`mt-0.5 truncate`,children:t.description}):null]})},`${n}:${t.id}`)})})]})]})]}):null}function b({open:n,activeKind:o,setActiveKind:s,kinds:c,resources:l,suggestionsByKind:u,suggestions:d,isLoading:f,query:p,onManualKindChange:h,onSelect:g,strings:_,className:y}){let b=i(v,_);return n?(0,m.jsxs)(`div`,{onMouseDown:e=>e.preventDefault(),className:a(`mention-inline-suggestions--component`,`bg-popover text-popover-foreground absolute left-0 top-full z-40 mt-1 w-80 max-w-[min(theme(spacing.96),100%)]`,`border-border/60 rounded-md border shadow-md ring-1 ring-foreground/[0.04]`,`overflow-hidden`,y),children:[(0,m.jsxs)(`div`,{className:`border-b border-border/60 px-3 py-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,m.jsx)(e,{size:`xxs`,type:`secondary`,weight:`medium`,className:`uppercase tracking-wide`,children:b.title}),p?(0,m.jsxs)(e,{tag:`span`,size:`xxs`,type:`secondary`,className:`truncate font-mono`,children:[`“`,p,`”`]}):null]}),c.length>1&&(0,m.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:c.map(e=>{let t=l?.[e],n=t?.icon,i=e===o,c=u?.[e]?.length??0;return(0,m.jsxs)(r,{type:`button`,variant:i?`primary`:`secondary`,buttonStyle:i?`solid`:`ghost`,size:`xs`,onClick:()=>{s(e),h?.()},className:a(`h-auto gap-1 rounded px-1.5 py-0.5 text-xxs font-medium ring-1 ring-inset transition-colors`,i?`bg-primary text-primary-foreground ring-primary`:c>0?`bg-muted text-foreground ring-border/60 hover:bg-muted/80`:`bg-muted/40 text-muted-foreground ring-border/40 hover:bg-muted/60`),children:[n?(0,m.jsx)(n,{className:`size-3`}):null,(0,m.jsx)(`span`,{children:t?.label??String(e)}),c>0&&(0,m.jsx)(`span`,{className:a(`tabular-nums`,i?`opacity-90`:`opacity-70`),children:c})]},e)})})]}),(0,m.jsxs)(`div`,{className:`max-h-72 overflow-y-auto py-1`,...d.length>0?{role:`listbox`,"aria-label":b.title}:{},children:[f?(0,m.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-center gap-2 py-3`,children:[(0,m.jsx)(t,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),(0,m.jsx)(e,{tag:`span`,size:`xs`,type:`secondary`,children:b.loading})]}):null,!f&&d.length===0?(0,m.jsx)(`div`,{className:`px-3 py-3`,children:(0,m.jsx)(e,{size:`xs`,type:`secondary`,children:b.empty})}):null,d.map(t=>{let n=t.kind??o??``;return(0,m.jsx)(r,{type:`button`,variant:`secondary`,buttonStyle:`ghost`,size:`sm`,role:`option`,"data-ref-id":`${n}:${t.id}`,onClick:()=>g(t),className:a(`h-auto w-full min-w-0 justify-start gap-2 rounded-none px-3 py-1.5 text-left`,`hover:bg-muted/60 focus-visible:bg-muted/60 transition-colors`),children:(0,m.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,m.jsx)(e,{tag:`span`,size:`xs`,weight:`medium`,className:`truncate`,children:t.label}),t.description?(0,m.jsx)(e,{tag:`span`,size:`xxs`,type:`secondary`,className:`mt-0.5 truncate`,children:t.description}):null]})},`${n}:${t.id}`)})]})]}):null}export{y as n,g as r,b as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./chunk-QTnfLwEv.js";import{n}from"./react-dom-Bz4cALsF.js";import{
|
|
1
|
+
import{n as e,r as t}from"./chunk-QTnfLwEv.js";import{n}from"./react-dom-Bz4cALsF.js";import{Dr as r,Er as i,Rr as a,jr as o,r as s,t as c}from"./example-Cz_880po.js";import{t as l}from"./calendar-days-C4mG2tOe.js";import{t as u}from"./hash-C8m0EECO.js";import{a as d,s as f}from"./index-BQIv1ffM.js";import{t as p}from"./props-table-2pIZzGC-.js";import{i as m,t as h}from"./popover-xC8qczvP.js";import{n as g,r as _,t as v}from"./mention-inline-suggestions-Dx2Z1GHF.js";var y=d(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),b=e({InlineMentionSuggestions:()=>T,MentionPickerPopover:()=>E}),x=t(n(),1),S=f(),C={user:{label:`People`,icon:y,trigger:`@`,tone:`primary`},booking:{label:`Bookings`,icon:l,trigger:`#`,tone:`info`}},w=[{id:`user-1`,kind:`user`,label:`Maya Chen`,description:`Account owner`},{id:`booking-1048`,kind:`booking`,label:`Booking #1048`,description:`Chef table, Jun 24`}];function T(){let[e,t]=(0,x.useState)(`user`),[n,r]=(0,x.useState)(null),i=w.filter(t=>t.kind===e);return(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsxs)(`div`,{className:`relative min-h-44 rounded-md border border-border/60 bg-card p-3`,children:[(0,S.jsxs)(a,{size:`sm`,children:[`Loop `,(0,S.jsx)(`span`,{className:`font-medium text-primary`,children:`@ma`}),` into the booking note.`]}),(0,S.jsx)(v,{open:!0,activeKind:e,setActiveKind:t,kinds:[`user`,`booking`],resources:C,query:`ma`,suggestions:i,suggestionsByKind:{user:w.filter(e=>e.kind===`user`),booking:w.filter(e=>e.kind===`booking`)},isLoading:!1,onSelect:r})]}),n?(0,S.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,S.jsx)(a,{size:`xs`,type:`secondary`,children:`Selected`}),(0,S.jsx)(o,{variant:`secondary`,children:n.label})]}):null]})}function E(){let[e,t]=(0,x.useState)(!1),[n,r]=(0,x.useState)(`user`),[i,o]=(0,x.useState)(``),[c,l]=(0,x.useState)(null),d=w.filter(e=>{let t=n===null||e.kind===n,r=e.label.toLowerCase().includes(i.toLowerCase());return t&&r});return(0,S.jsxs)(`div`,{className:`space-y-3`,children:[(0,S.jsxs)(h,{open:e,onOpenChange:t,children:[(0,S.jsx)(m,{asChild:!0,children:(0,S.jsx)(s,{type:`button`,variant:`secondary`,icon:u,children:`Add reference`})}),(0,S.jsx)(g,{open:e,activeKind:n,setActiveKind:r,kinds:[`user`,`booking`],resources:C,query:i,setQuery:o,suggestions:d,isLoading:!1,onSelect:e=>{l(e),t(!1)}})]}),c?(0,S.jsx)(_,{mention:{id:c.id,kind:c.kind??`user`,label:c.label},resource:C[c.kind??`user`]}):(0,S.jsx)(a,{size:`xs`,type:`secondary`,children:`No reference selected.`})]})}var D=`import { useState } from 'react';
|
|
2
2
|
import { CalendarDays, Hash, UserRound } from 'lucide-react';
|
|
3
3
|
|
|
4
4
|
import { Badge } from '@/components/base/badge';
|
|
@@ -135,4 +135,4 @@ export function MentionPickerPopover() {
|
|
|
135
135
|
</div>
|
|
136
136
|
);
|
|
137
137
|
}
|
|
138
|
-
`;function O(e){let t={h4:`h4`,...e.components};return b||A(`Examples`,!1),T||A(`Examples.InlineMentionSuggestions`,!0),E||A(`Examples.MentionPickerPopover`,!0),(0,S.jsxs)(
|
|
138
|
+
`;function O(e){let t={h4:`h4`,...e.components};return b||A(`Examples`,!1),T||A(`Examples.InlineMentionSuggestions`,!0),E||A(`Examples.MentionPickerPopover`,!0),(0,S.jsxs)(r,{title:`Features · Mentions`,description:`Inline resource references for editors, comments, and event logs. Consumers provide resource registries and search callbacks; the package provides chips, picker UI, inline suggestions, parsing helpers, and headless hooks.`,layer:`features`,status:`ready`,sourcePath:`src/components/features/mentions`,children:[(0,S.jsxs)(i,{title:`Examples`,id:`examples`,children:[(0,S.jsx)(c,{name:`InlineMentionSuggestions`,source:D,children:(0,S.jsx)(T,{})}),(0,S.jsx)(c,{name:`MentionPickerPopover`,source:D,children:(0,S.jsx)(E,{})})]}),(0,S.jsxs)(i,{title:`API`,id:`api`,children:[(0,S.jsx)(t.h4,{children:`MentionInlineSuggestions`}),(0,S.jsx)(p,{component:`MentionInlineSuggestions`}),(0,S.jsx)(t.h4,{children:`MentionPicker`}),(0,S.jsx)(p,{component:`MentionPicker`}),(0,S.jsx)(t.h4,{children:`MentionChip`}),(0,S.jsx)(p,{component:`MentionChip`})]})]})}function k(e={}){let{wrapper:t}=e.components||{};return t?(0,S.jsx)(t,{...e,children:(0,S.jsx)(O,{...e})}):O(e)}function A(e,t){throw Error(`Expected `+(t?`component`:`object`)+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}export{k as default};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import{n as e,r as t}from"./chunk-QTnfLwEv.js";import{n,t as r}from"./react-dom-Bz4cALsF.js";import{C as i,Cn as a,Ct as o,Dr as s,Dt as c,E as l,Er as u,Hr as d,Ht as f,J as p,Jt as m,K as h,Kt as g,M as _,Mn as v,Nn as y,Nr as b,O as x,Ot as S,Qt as C,S as w,Sr as T,T as E,Tt as D,Ut as O,Vn as ee,X as te,Xt as k,Y as A,Yn as j,Yt as ne,Zt as M,_r as N,_t as re,ar as ie,br as ae,bt as oe,ct as P,d as F,dt as se,en as ce,er as le,f as ue,fr as I,ft as de,g as L,gn as fe,hn as R,hr as z,ir as pe,jn as me,jt as he,kt as ge,lr as _e,lt as ve,m as ye,mr as be,mt as xe,nr as Se,ot as Ce,p as we,pr as Te,q as Ee,sn as De,t as B,u as Oe,ut as V,v as H,vt as ke,w as Ae,wn as je,wt as Me,x as Ne,y as Pe,yn as Fe,yt as Ie}from"./example-Cz_880po.js";import{t as Le}from"./chevron-down-ByPPEdNm.js";import{t as Re}from"./external-link-Cy1-PP8k.js";import{t as ze}from"./square-pen-ImRrVwT8.js";import{t as Be}from"./trash-2-CE9bDw49.js";import{n as U,s as Ve}from"./index-BQIv1ffM.js";import{a as He}from"./useOpenInteractionType-DLUX6CcH.js";import{t as W}from"./inertValue-DeVQ2cCe.js";import{t as Ue}from"./useControlled-BF8maje6.js";import{S as We,_ as G,a as Ge,b as Ke,c as qe,d as K,f as Je,g as Ye,h as Xe,l as Ze,m as Qe,o as $e,p as et,r as tt,t as q,u as J,v as nt,x as rt,y as it}from"./dropdown-menu-Cto8-yDW.js";import{t as at}from"./CompositeItem-Dzu0MfUC.js";import{t as ot}from"./Separator-BEMr82IS.js";import{t as st}from"./CompositeRoot-CQvQ_uj2.js";import{a as ct,i as lt,n as ut,o as dt,r as ft,t as pt}from"./command-wjOXUieO.js";function mt(e){let t=N(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=T(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r;return(f(n)!==a||f(r)!==o)&&(n=a,r=o),{width:n,height:r}}var Y=t(n(),1),X=Ve();function ht(e){let[t,n]=Y.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),r=Y.useRef(null),i=Y.useRef(null),a=Y.useRef(null),o=Y.useRef(null),s=Y.useRef(!0),c=Y.useRef(null),l=oe(),u=Y.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:a,backdropRef:r,internalBackdropRef:i,positionerRef:o,allowMouseUpTriggerRef:s,initialCursorPointRef:c,rootId:l}),[t,l]);return(0,X.jsx)(it.Provider,{value:u,children:(0,X.jsx)(rt.Provider,{value:void 0,children:(0,X.jsx)(K,{...e})})})}var gt=500,_t=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{setAnchor:o,actionsRef:s,internalBackdropRef:c,backdropRef:l,positionerRef:u,allowMouseUpTriggerRef:d,initialCursorPointRef:f,rootId:p}=Ke(!1),{store:m}=We(!1),h=m.useState(`open`),_=m.useState(`disabled`),b=Y.useRef(null),x=Y.useRef(null),S=j(),w=j(),T=Y.useRef(!1);function E(e,t,n){let r=n.type.startsWith(`touch`);f.current={x:e,y:t},o({getBoundingClientRect(){return DOMRect.fromRect({width:r?10:0,height:r?10:0,x:e,y:t})}}),T.current=!1,s.current?.setOpen(!0,C(je,n)),w.start(gt,()=>{T.current=!0})}function D(e){_||(d.current=!0,ee(e),E(e.clientX,e.clientY,e.nativeEvent),M(g(b.current),`mouseup`,e=>{if(d.current=!1,!T.current)return;w.clear(),T.current=!1;let t=y(e);v(u.current,t)||p&&t&&J(t)===p||s.current?.setOpen(!1,C(ce,e))},{once:!0}))}function O(e){if(!_&&(d.current=!1,e.touches.length===1)){e.stopPropagation();let t=e.touches[0];x.current={x:t.clientX,y:t.clientY},S.start(gt,()=>{x.current&&E(x.current.x,x.current.y,e.nativeEvent)})}}function te(e){if(S.isStarted()&&x.current&&e.touches.length===1){let t=e.touches[0],n=Math.abs(t.clientX-x.current.x),r=Math.abs(t.clientY-x.current.y);(n>10||r>10)&&S.clear()}}function k(){S.clear(),x.current=null}return Y.useEffect(()=>{function e(e){if(_)return;let t=y(e);(v(b.current,t)||v(c.current,t)||v(l.current,t))&&e.preventDefault()}return M(g(b.current),`contextmenu`,e)},[l,_,c]),Se(`div`,e,{state:{open:h},ref:[b,t],props:[{onContextMenu:D,onTouchStart:O,onTouchMove:te,onTouchEnd:k,onTouchCancel:k,style:{WebkitTouchCallout:`none`}},a],stateAttributesMapping:Pe})});function vt({...e}){return(0,X.jsx)(ht,{"data-slot":`context-menu`,...e})}function yt({className:e,...t}){return(0,X.jsx)(_t,{"data-slot":`context-menu-trigger`,className:U(`select-none`,e),...t})}function bt({className:e,align:t=`start`,alignOffset:n=4,side:r=`right`,sideOffset:i=0,...a}){return(0,X.jsx)(Xe,{children:(0,X.jsx)(Qe,{className:`isolate z-50 outline-none`,align:t,alignOffset:n,side:r,sideOffset:i,children:(0,X.jsx)(Ye,{"data-slot":`context-menu-content`,className:U(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-36 rounded-md p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 max-h-(--available-height) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none`,e),...a})})})}function xt({className:e,inset:t,...n}){return(0,X.jsx)(nt,{"data-slot":`context-menu-label`,"data-inset":t,className:U(`text-muted-foreground px-2 py-1.5 text-xs font-medium data-[inset]:pl-8`,e),...n})}function St({className:e,inset:t,variant:n=`default`,...r}){return(0,X.jsx)(G,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:U(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive focus:*:[svg]:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0`,e),...r})}function Ct({className:e,...t}){return(0,X.jsx)(ot,{"data-slot":`context-menu-separator`,className:U(`bg-border -mx-1 my-1 h-px`,e),...t})}var wt=function(e){return e.modal=`data-modal`,e.orientation=`data-orientation`,e.hasSubmenuOpen=`data-has-submenu-open`,e}({}),Tt={hasSubmenuOpen(e){return e?{[wt.hasSubmenuOpen]:``}:null}},Et=Y.forwardRef(function(e,t){let{orientation:n=`horizontal`,loopFocus:r=!0,render:i,className:a,modal:o=!0,disabled:s=!1,id:c,style:l,...u}=e,[d,f]=Y.useState(null),[p,m]=Y.useState(!1),h=L(c),g={orientation:n,modal:o,hasSubmenuOpen:p},_=Y.useRef(null),v=Y.useRef(!1),y=Y.useMemo(()=>({contentElement:d,setContentElement:f,setHasSubmenuOpen:m,hasSubmenuOpen:p,modal:o,disabled:s,orientation:n,allowMouseUpTriggerRef:v,rootId:h}),[d,p,o,s,n,h]);return(0,X.jsx)(Je.Provider,{value:y,children:(0,X.jsx)(ve,{children:(0,X.jsx)(Dt,{children:(0,X.jsx)(st,{render:i,className:a,style:l,state:g,stateAttributesMapping:Tt,refs:[t,f,_],props:[{role:`menubar`,id:h,"aria-orientation":n},u],orientation:n,loopFocus:r,enableHomeAndEndKeys:!0,highlightItemOnHover:p})})})})});function Dt(e){let t=V(),{events:n}=de(),r=et();return Y.useEffect(()=>{function e(e){!e.nodeId||e.parentNodeId!==t||(e.open?r.hasSubmenuOpen||r.setHasSubmenuOpen(!0):e.reason!==`sibling-open`&&e.reason!==`list-navigation`&&r.setHasSubmenuOpen(!1))}return n.on(`menuopenchange`,e),()=>{n.off(`menuopenchange`,e)}},[n,t,r]),(0,X.jsx)(P,{id:t,children:e.children})}function Ot({className:e,...t}){return(0,X.jsx)(Et,{"data-slot":`menubar`,className:U(`flex h-9 items-center rounded-3xl border p-1`,e),...t})}function kt({...e}){return(0,X.jsx)(q,{"data-slot":`menubar-menu`,...e})}function At({className:e,...t}){return(0,X.jsx)(Ze,{"data-slot":`menubar-trigger`,className:U(`flex items-center rounded-2xl px-2 py-0.75 text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted`,e),...t})}function jt({className:e,align:t=`start`,alignOffset:n=-4,sideOffset:r=8,...i}){return(0,X.jsx)(tt,{"data-slot":`menubar-content`,align:t,alignOffset:n,sideOffset:r,className:U(`dark min-w-48 rounded-3xl p-1.5 text-popover-foreground shadow-lg ring-1 ring-foreground/5 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 animate-none! relative bg-popover/70 before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-item]:data-highlighted:bg-foreground/10 **:data-[slot$=-separator]:bg-foreground/5 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[variant=destructive]:focus:bg-foreground/10! **:data-[variant=destructive]:text-accent-foreground! **:data-[variant=destructive]:**:text-accent-foreground!`,e),...i})}function Mt({className:e,inset:t,variant:n=`default`,...r}){return(0,X.jsx)(Ge,{"data-slot":`menubar-item`,"data-inset":t,"data-variant":n,className:U(`group/menubar-item gap-2.5 rounded-2xl px-3 py-2 text-sm font-medium focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-9.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Nt({className:e,...t}){return(0,X.jsx)(qe,{"data-slot":`menubar-separator`,className:U(`-mx-1 my-1 h-px bg-border/50`,e),...t})}var Pt=Y.createContext(void 0);function Z(e){let t=Y.useContext(Pt);if(t===void 0&&!e)throw Error(I(41));return t}var Ft=Y.createContext(void 0);function It(){return Y.useContext(Ft)}var Q=function(e){return e.availableWidth=`--available-width`,e.availableHeight=`--available-height`,e.anchorWidth=`--anchor-width`,e.anchorHeight=`--anchor-height`,e.transformOrigin=`--transform-origin`,e.positionerWidth=`--positioner-width`,e.positionerHeight=`--positioner-height`,e}({}),$=function(e){return e.popupWidth=`--popup-width`,e.popupHeight=`--popup-height`,e}({});function Lt(e,t,n,r){e.style.setProperty($.popupWidth,`${n}px`),e.style.setProperty($.popupHeight,`${r}px`),t.style.setProperty(Q.positionerWidth,`${n}px`),t.style.setProperty(Q.positionerHeight,`${r}px`)}var Rt=new Set([a,Fe,De]);function zt(e){let t=parseFloat(e.style.getPropertyValue(Q.positionerWidth))||0,n=parseFloat(e.style.getPropertyValue(Q.positionerHeight))||0;return t<=0||n<=0?null:{width:t,height:n}}var Bt=Y.forwardRef(function(e,t){let{defaultValue:n=null,value:r,onValueChange:i,actionsRef:a,delay:o=50,closeDelay:s=50,orientation:c=`horizontal`,onOpenChangeComplete:l}=e,u=se()!=null,d=Z(!0),[f,p]=Ue({controlled:r,default:n,name:`NavigationMenu`,state:`value`}),m=f!=null,_=Y.useRef(void 0),y=Y.useRef(null),[b,x]=Y.useState(null),[S,C]=Y.useState(null),[w,E]=Y.useState(null),[D,O]=Y.useState(null),[ee,k]=Y.useState(null),[A,j]=Y.useState(void 0),[ne,M]=Y.useState(!1),N=Y.useRef(null),re=Y.useRef(null),ie=Y.useRef(null),ae=Y.useRef(null),oe=Y.useRef(null),P=Y.useRef(null),F=Y.useRef({abortController:null,owner:null}),{mounted:ce,setMounted:le,transitionStatus:ue}=te(m);be(()=>{if(m||!b||!S)return;let e=zt(b);e&&Lt(S,b,e.width,e.height)},[m,S,b]),Y.useEffect(()=>{M(!1)},[f]);let I=z((e,t)=>{e??(_.current=t.reason),e!==f&&i?.(e,t),!t.isCanceled&&(e??(k(null),j(void 0)),p(e),u&&e==null&&t.reason===`link-press`&&d&&d.setValue(null,t))}),de=z(()=>{let e=me(g(y.current));!(_.current&&Rt.has(_.current))&&T(N.current)&&(e===g(S).body||v(S,e))&&S&&(N.current.focus({preventScroll:!0}),N.current=void 0),le(!1),l?.(!1),k(null),j(void 0),re.current=null,_.current=void 0});Y.useImperativeHandle(a,()=>({unmount:de}),[de]),h({enabled:!a,open:m,ref:{current:S},onComplete(){m||de()}}),h({enabled:!a,open:m,ref:{current:D},onComplete(){m||de()}});let L=m?ee:null,fe=Y.useMemo(()=>({open:m,value:f,setValue:I,mounted:ce,transitionStatus:ue,positionerElement:b,setPositionerElement:x,popupElement:S,setPopupElement:C,viewportElement:w,setViewportElement:E,viewportTargetElement:D,setViewportTargetElement:O,activationDirection:L,setActivationDirection:k,floatingRootContext:A,setFloatingRootContext:j,currentContentRef:re,nested:u,rootRef:y,beforeInsideRef:ie,afterInsideRef:ae,beforeOutsideRef:oe,afterOutsideRef:P,prevTriggerElementRef:N,popupAutoSizeResetRef:F,delay:o,closeDelay:s,orientation:c,viewportInert:ne,setViewportInert:M}),[m,f,I,ce,ue,b,S,w,D,L,A,u,o,s,c,ne]),R=(0,X.jsx)(Pt.Provider,{value:fe,children:(0,X.jsx)(Vt,{componentProps:e,forwardedRef:t,children:e.children})});return u?R:(0,X.jsx)(ve,{children:R})});function Vt(e){let{className:t,render:n,defaultValue:r,value:i,onValueChange:a,actionsRef:o,delay:s,closeDelay:c,orientation:l,onOpenChangeComplete:u,style:d,...f}=e.componentProps,p=V(),{rootRef:m,nested:h,open:g}=Z(),_={open:g,nested:h},v=Se(h?`div`:`nav`,e.componentProps,{state:_,ref:[e.forwardedRef,m],props:f});return(0,X.jsx)(Ft.Provider,{value:p,children:(0,X.jsx)(P,{id:p,children:v})})}var Ht=`data-base-ui-navigation-menu-trigger`,Ut=Y.createContext(void 0);function Wt(){return Y.useContext(Ut)}var Gt=Y.forwardRef(function(e,t){let{render:n,className:r,style:a,...o}=e,s=It(),{orientation:c,open:l,floatingRootContext:u,positionerElement:d,value:f,closeDelay:p,viewportElement:m,nested:h}=Z(),g=Y.useMemo(()=>_(),[]),v=u||g,b=d!=null||f==null;i(v,{enabled:!!u&&(d!=null||m!=null||f==null),closeDelay:p,nodeId:s});let x=Ce(v,{enabled:b,outsidePressEvent:`intentional`,outsidePress(e){return y(e)?.closest(`[${Ht}]`)===null}}),S=u?x:void 0,C={open:l},w=h?ie:{onKeyDown(e){(c===`horizontal`&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)||c===`vertical`&&(e.key===`ArrowUp`||e.key===`ArrowDown`))&&e.stopPropagation()}},T=[S?.floating||ie,w,o],E=Se(`ul`,e,{state:C,ref:t,props:T,enabled:h});return h?(0,X.jsx)(Ut.Provider,{value:S,children:E}):(0,X.jsx)(Ut.Provider,{value:S,children:(0,X.jsx)(st,{render:n,className:r,style:a,state:C,refs:[t],props:T,loopFocus:!1,orientation:c,tag:`ul`})})}),Kt=Y.createContext(void 0);function qt(){let e=Y.useContext(Kt);if(!e)throw Error(I(39));return e}var Jt=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a,...o}=e,s=L(),c=a??s,l=Se(`li`,e,{ref:t,props:o}),u=Y.useMemo(()=>({value:c}),[c]);return(0,X.jsx)(Kt.Provider,{value:u,children:l})}),Yt=t(r(),1),Xt={...H,...A,activationDirection(e){return e?{"data-activation-direction":e}:null}},Zt=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,{mounted:s,viewportElement:c,value:l,activationDirection:u,currentContentRef:d,viewportTargetElement:f}=Z(),{value:p}=qt(),m=It(),g=s&&l===p,_=Y.useRef(null),[b,x]=Y.useState(!1),[S,C]=Y.useState(!1),{mounted:w,setMounted:T,transitionStatus:E}=te(g);w&&!s&&T(!1),h({ref:_,open:g,onComplete(){g||T(!1)}}),be(()=>{g&&_.current&&(d.current=_.current)},[g,d]);let D={open:g,transitionStatus:E,activationDirection:u},O=z(e=>{e&&g&&(d.current=e)}),ee={onFocus(e){y(e.nativeEvent)?.hasAttribute(`data-base-ui-focus-guard`)||C(!0)},onBlur(e){v(e.currentTarget,e.relatedTarget)||C(!1)}},k=!g&&w?{style:{position:`absolute`,top:0,left:0},inert:W(!S),...ee}:ee,A=f||c,j=a&&!w,ne=a&&!A&&!b;return a&&A&&!b&&x(!0),ne?(0,X.jsx)(st,{render:n,className:r,style:i,state:D,refs:[t],props:[k,{hidden:!0},o],stateAttributesMapping:Xt}):!A||!w&&!a?null:Yt.createPortal((0,X.jsx)(P,{id:m,children:(0,X.jsx)(st,{render:n,className:r,style:i,state:D,refs:[t,_,O],props:[k,j?{hidden:!0}:ie,o],stateAttributesMapping:Xt})}),A)});function Qt({currentTarget:e,relatedTarget:t},n){let{popupElement:r,rootRef:i,tree:a,nodeId:s}=n,c=a?o(a.nodesRef.current,s).some(e=>v(e.context?.elements.floating,t)):[];return r?!v(r,e)&&!v(r,t)&&!v(i.current,t)&&!c&&!(v(r,t)&&t?.hasAttribute(`data-base-ui-focus-guard`)):!v(i.current,t)&&!c}var $t={width:0,height:0},en=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,nativeButton:o=!0,disabled:s,...u}=e,{value:d,setValue:f,mounted:h,open:g,positionerElement:_,setActivationDirection:y,setFloatingRootContext:b,popupElement:D,viewportElement:te,transitionStatus:k,rootRef:A,beforeOutsideRef:N,afterOutsideRef:re,afterInsideRef:ie,beforeInsideRef:oe,prevTriggerElementRef:P,popupAutoSizeResetRef:F,currentContentRef:se,delay:ce,closeDelay:le,orientation:ue,setViewportInert:I,nested:L}=Z(),{value:R}=qt(),me=It(),ve=de(),xe=Wt(),Se=ye(),Ce=j(),we=m(),B=m(),Oe=m(),V=m(),[H,ke]=Y.useState(null),[Me,Fe]=Y.useState(!0),[Le,Re]=Y.useState(``),ze=Y.useRef(null),Be=Y.useRef(!1),U=Y.useRef($t),Ve=Y.useRef(!1),W=g&&d===R,Ue=ne(W),We=(_!=null||d==null)&&!s,G=_||te,Ge=(G!=null||d==null)&&!s,Ke=Ee(D,!1,!1),qe=Y.useCallback(e=>{ze.current=e,ke(e)},[]),K=z((e=!1)=>{!e&&F.current.owner!==R||(F.current.abortController?.abort(),F.current.abortController=null,F.current.owner=null)});be(()=>{W||(B.cancel(),V.cancel(),K())},[W,B,V,K]);function Je(){D&&(D.style.setProperty($.popupWidth,`auto`),D.style.setProperty($.popupHeight,`auto`))}function Ye(){!D||!_||(D.style.removeProperty($.popupWidth),D.style.removeProperty($.popupHeight),_.style.removeProperty(Q.positionerWidth),_.style.removeProperty(Q.positionerHeight))}function Xe(){K(!0);let e=new AbortController;F.current.abortController=e,F.current.owner=R,Ke(()=>{F.current.abortController!==e||F.current.owner!==R||(F.current.abortController=null,F.current.owner=null,Je())},e.signal)}let Ze=z((e,t,n={})=>{if(!D||!_)return;K(!0);let{syncPositioner:r=!1}=n;Ye();let{width:i,height:a}=mt(D),o=i||U.current.width,s=a||U.current.height;(t===0||e===0)&&(e=o,t=s),D.style.setProperty($.popupWidth,`${e}px`),D.style.setProperty($.popupHeight,`${t}px`),_.style.setProperty(Q.positionerWidth,`${r?e:o}px`),_.style.setProperty(Q.positionerHeight,`${r?t:s}px`),V.request(()=>{Ue.current&&(D.style.setProperty($.popupWidth,`${o}px`),D.style.setProperty($.popupHeight,`${s}px`),r&&(_.style.setProperty(Q.positionerWidth,`${o}px`),_.style.setProperty(Q.positionerHeight,`${s}px`)),Xe())})}),Qe=z((e,t)=>{!D||!_||(V.cancel(),B.cancel(),K(!0),!(e===0||t===0)&&(Lt(D,_,e,t),B.request(()=>{B.request(()=>{Ye();let{width:n,height:r}=mt(D),i=n||e||U.current.width,a=r||t||U.current.height;Lt(D,_,e,t),V.request(()=>{Ue.current&&(Lt(D,_,i,a),Xe())})})})))}),$e=z(()=>{if(!D||!_)return;V.cancel(),K(!0),Ye();let{width:e,height:t}=mt(D);e===0||t===0||(U.current={width:e,height:t},Je(),_.style.setProperty(Q.positionerWidth,`${e}px`),_.style.setProperty(Q.positionerHeight,`${t}px`))}),et=z(()=>{if(!D)return{size:U.current,syncPositioner:!1};let e=D.style.getPropertyValue($.popupWidth),t=D.style.getPropertyValue($.popupHeight);return e!==``&&e!==`auto`&&t!==``&&t!==`auto`?{size:{width:D.offsetWidth||U.current.width,height:D.offsetHeight||U.current.height},syncPositioner:!0}:{size:U.current,syncPositioner:!1}});Y.useEffect(()=>{g||(Ce.clear(),B.cancel(),Oe.cancel(),V.cancel(),K(!0),Ve.current=!1,Re(``))},[Ce,g,B,Oe,V,K]),Y.useEffect(()=>{h||(U.current=$t)},[h]),be(()=>{if(!D||typeof ResizeObserver!=`function`)return;let e=new ResizeObserver(()=>{U.current={width:D.offsetWidth,height:D.offsetHeight}});return e.observe(D),()=>{e.disconnect()}},[D]),Y.useEffect(()=>{if(!g||!W||!D||!_)return;let e=ae(_);function t(){Oe.cancel(),Oe.request($e)}let n=M(e,`resize`,t);return()=>{Oe.cancel(),n()}},[g,W,D,_,Oe,$e]),Y.useEffect(()=>{let e=se.current;if(!e||!D||!W||typeof MutationObserver!=`function`)return;let t=new MutationObserver(()=>{if(k===`starting`||D.hasAttribute(p.startingStyle)){$e();return}let{size:e,syncPositioner:t}=et();if(t){Qe(e.width,e.height);return}Ze(e.width,e.height)});return t.observe(e,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:[`hidden`]}),()=>{t.disconnect()}},[se,D,W,k,et,Qe,Ze,$e]),Y.useEffect(()=>(W&&g&&D&&Be.current&&(Be.current=!1,we.request(()=>{N.current?.focus()})),()=>{we.cancel()}),[N,we,W,g,D]),be(()=>{if(Ue.current&&g&&D){let e=se.current?.querySelector(`[data-nested]`)!=null;if(k===`starting`&&e)return V.request($e),()=>{V.cancel()};if(Ve.current){Ve.current=!1;return}let{width:t,height:n}=mt(D);Ze(t,n)}},[se,Ze,Ue,g,D,V,$e,k]);function tt(e,t){let n=t.reason===a;if(!We||Le===`touch`&&n||!e&&d!==R)return;function r(){n&&(Fe(!0),Ce.clear(),Ce.start(500,()=>{Fe(!1)})),e?f(R,t):(f(null,t),Re(``))}n?Yt.flushSync(r):r()}let q=x({open:g,onOpenChange:tt,elements:{reference:H,floating:G}}),J=l(q),nt=Le!==`touch`;Y.useEffect(()=>{g||(q.context.dataRef.current.openEvent=void 0,J.pointerType=void 0,J.interactedInside=!1,J.restTimeoutPending=!1,J.openChangeTimeout.clear(),J.restTimeout.clear(),E(J))},[q,J,g]);let rt=z(()=>!L||_||!ze.current||!G?null:nn(ze.current,G,me));function it(){return!L||!_?ze.current?.closest(`ul`)??null:null}let ot=w(q,{enabled:Ge,move:!1,handleClose:Ne({blockPointerEvents:nt,getScope:it}),restMs:h&&_?0:ce,delay:{close:le},triggerElementRef:ze,getHandleCloseContext:rt}),st=Y.useMemo(()=>ot?{reference:ot}:void 0,[ot]),ct=He(q,{enabled:We,stickIfOpen:Me,toggle:W}),lt=Y.useMemo(()=>Te(ct.reference,st?.reference),[ct.reference,st]);be(()=>{W&&(b(q),P.current=H)},[W,q,b,P,H]);function ut(e){Yt.flushSync(()=>{let t=T(e.currentTarget)?e.currentTarget:null,n=P.current?.getBoundingClientRect();if(h&&n&&H){let e=H.getBoundingClientRect(),t=e.left>n.left,r=e.top>n.top;ue===`horizontal`&&e.left!==n.left?y(t?`right`:`left`):ue===`vertical`&&e.top!==n.top&&y(r?`down`:`up`)}if(e.type!==`click`&&d!=null&&(q.context.dataRef.current.openEvent=void 0),!(Le===`touch`&&e.type!==`click`)&&(d!=null&&e.type!==`keydown`&&f(R,C(e.type===`mouseenter`?a:je,e.nativeEvent)),e.type===`mouseenter`&&nt&&(!L||!_)&&G&&t)){let e=()=>{Ae(J,{scopeElement:it()??t.ownerDocument.body,referenceElement:t,floatingElement:G})};d!=null&&d!==R?queueMicrotask(e):e()}})}let dt=z(e=>{if(s)return;if(!D||!_){ut(e);return}let{width:t,height:n}=mt(D),r=d!=null&&d!==R&&(e.type===`click`||Le!==`touch`);ut(e),r&&(Ve.current=!0),Ze(t,n)}),ft={open:W};function pt(e){Re(e.pointerType)}function ht(e){pt(e),E(J)}let gt={tabIndex:0,onMouseEnter:dt,onClick:dt,onPointerEnter:pt,onPointerDown:ht,"aria-expanded":W,"aria-controls":W?D?.id:void 0,[Ht]:``,onFocus(){W&&I(!1)},onMouseMove(){Be.current=!1},onKeyDown(e){if(Be.current=!0,L)return;let t=Se===`rtl`?`ArrowLeft`:`ArrowRight`,n=ue===`horizontal`&&e.key===`ArrowDown`,r=ue===`vertical`&&e.key===t;(n||r)&&(f(R,C(fe,e.nativeEvent)),dt(e),ee(e))},onBlur(e){_&&D&&Qt({currentTarget:e.currentTarget,relatedTarget:e.relatedTarget},{popupElement:D,rootRef:A,tree:ve,nodeId:me})&&f(null,C(De,e.nativeEvent))}},{getButtonProps:_t,buttonRef:vt}=_e({disabled:s,focusableWhenDisabled:!0,native:o}),yt=G;return(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsx)(at,{tag:`button`,render:n,className:r,style:i,state:ft,stateAttributesMapping:Pe,refs:[t,qe,vt],props:[lt,xe?.reference||pe,gt,u,_t]}),W&&(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsx)(O,{ref:N,onFocus:e=>{yt&&he(e,yt)?oe.current?.focus():S(H)?.focus()}}),(0,X.jsx)(`span`,{"aria-owns":te?.id,style:Ie}),(0,X.jsx)(O,{ref:re,onFocus:e=>{if(yt&&he(e,yt))Yt.flushSync(()=>{I(!1)}),(ie.current||H)?.focus();else{let t=c(H);L&&!_&&yt&&t&&v(yt,t)&&(t=ge(ie.current)),t?.focus(),(!L||_)&&!v(A.current,t)&&f(null,C(`focus-out`,e.nativeEvent))}}})]})]})});function tn(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.left+n.width/2,a=n.top+n.height/2,o=r.left+r.width/2,s=r.top+r.height/2,c=o-i,l=s-a;return Math.abs(c)>=Math.abs(l)?c>=0?`right`:`left`:l>=0?`bottom`:`top`}function nn(e,t,n){return{placement:tn(e,t),elements:{domReference:e,floating:t},nodeId:n}}var rn=Y.createContext(void 0);function an(){let e=Y.useContext(rn);if(e===void 0)throw Error(I(40));return e}var on=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{mounted:i}=Z();return i||n?(0,X.jsx)(rn.Provider,{value:n,children:(0,X.jsx)(xe,{ref:t,...r})}):null}),sn=Y.createContext(void 0);function cn(e=!1){let t=Y.useContext(sn);if(!t&&!e)throw Error(I(42));return t}var ln=_(),un=Y.forwardRef(function(e,t){let{open:n,mounted:r,positionerElement:i,setPositionerElement:a,floatingRootContext:o,nested:s,transitionStatus:c}=Z(),{className:l,render:u,anchor:d,positionMethod:f=`absolute`,side:p=`bottom`,align:m=`center`,sideOffset:h=0,alignOffset:g=0,collisionBoundary:_=`clipping-ancestors`,collisionPadding:v=5,collisionAvoidance:y=s?ke:re,arrowPadding:b=5,sticky:x=!1,disableAnchorTracking:S=!1,style:C,...w}=e,T=an(),E=It(),O=j(),ee=j(),[te,A]=Y.useState(n),ne=Y.useRef(n),N=Y.useRef(null),ie=Y.useRef(null);Y.useEffect(()=>{if(!i)return;function e(e){i&&he(e)&&(e.type===`focusin`?D:Me)(i)}return k(M(i,`focusin`,e,!0),M(i,`focusout`,e,!0))},[i]);let oe=(o||ln).useState(`domReferenceElement`),P=ue({anchor:d??oe??ie,positionMethod:f,mounted:r,side:p,sideOffset:h,align:m,alignOffset:g,arrowPadding:b,collisionBoundary:_,collisionPadding:v,sticky:x,disableAnchorTracking:S,keepMounted:T,floatingRootContext:o,collisionAvoidance:y,nodeId:E,adaptiveOrigin:we}),F={open:n,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:te};Y.useEffect(()=>{if(!n)return;ne.current&&O.start(0,()=>{ne.current=!1,ee.isStarted()||A(!1)});function e(){Yt.flushSync(()=>{A(!0)}),ee.start(100,()=>{A(!1)})}return M(ae(i),`resize`,e)},[n,O,ee,i]);let se=Oe(e,F,{styles:P.positionerStyles,transitionStatus:c,props:w,refs:[t,a,N],hidden:!r,inert:!n});return(0,X.jsx)(sn.Provider,{value:P,children:se})}),dn=_();function fn({children:e}){let{beforeInsideRef:t,beforeOutsideRef:n,afterInsideRef:r,afterOutsideRef:i,positionerElement:a,viewportElement:o,floatingRootContext:s}=Z(),l=!!cn(!0),u=a||o;return!s&&!l?e:(0,X.jsxs)(Y.Fragment,{children:[(0,X.jsx)(O,{ref:t,onFocus:e=>{u&&he(e,u)?c(u)?.focus():n.current?.focus()}}),e,(0,X.jsx)(O,{ref:r,onFocus:e=>{u&&he(e,u)?S(u)?.focus():i.current?.focus()}})]})}var pn=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,id:o,...s}=e,c=oe(o),{setViewportElement:l,setViewportTargetElement:u,floatingRootContext:d,prevTriggerElementRef:f,viewportInert:p,setViewportInert:m}=Z(),h=!!cn(!0),g=(d||dn).useState(`domReferenceElement`);be(()=>{g&&(f.current=g)},[g,f]);let _=Se(`div`,e,{ref:[t,l],props:[{id:c,onBlur(e){let t=e.relatedTarget,n=e.currentTarget;t&&!v(n,t)&&t!==g&&m(!0)},...!h&&p&&{inert:W(!0)},children:h?a:(0,X.jsx)(fn,{children:(0,X.jsx)(`div`,{ref:u,children:a})})},s]});return h?(0,X.jsx)(fn,{children:_}):_}),mn={...H,...A},hn=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{open:s,transitionStatus:c,setPopupElement:l}=Z(),u=cn(),d=ye(),f=L(a),p={open:s,transitionStatus:c,side:u.side,align:u.align,anchorHidden:u.anchorHidden},m=u.side===`left`;d===`rtl`?m||=u.side===`inline-end`:m||=u.side===`inline-start`;let h=u.side===`top`||m;return Se(`nav`,e,{state:p,ref:[t,l],props:[{id:f,tabIndex:-1,style:h?{position:`absolute`,[u.side===`top`?`bottom`:`top`]:`0`,[m?`right`:`left`]:`0`}:{}},F(c),o],stateAttributesMapping:mn})}),gn=Y.forwardRef(function(e,t){let{className:n,render:r,active:i=!1,closeOnClick:a=!1,style:o,...s}=e,{setValue:c,popupElement:l,positionerElement:u,rootRef:d}=Z(),f=It(),p=de();return(0,X.jsx)(at,{tag:`a`,render:r,className:n,style:o,state:{active:i},refs:[t],props:[{"aria-current":i?`page`:void 0,tabIndex:void 0,onClick(e){a&&c(null,C(R,e.nativeEvent))},onBlur(e){u&&l&&Qt({currentTarget:e.currentTarget,relatedTarget:e.relatedTarget},{popupElement:l,rootRef:d,tree:p,nodeId:f})&&c(null,C(De,e.nativeEvent))}},s]})});function _n({align:e=`start`,className:t,children:n,...r}){return(0,X.jsxs)(Bt,{"data-slot":`navigation-menu`,className:U(`group/navigation-menu relative flex max-w-max flex-1 items-center justify-center`,t),...r,children:[n,(0,X.jsx)(Cn,{align:e})]})}function vn({className:e,...t}){return(0,X.jsx)(Gt,{"data-slot":`navigation-menu-list`,className:U(`group flex flex-1 list-none items-center justify-center gap-0`,e),...t})}function yn({className:e,...t}){return(0,X.jsx)(Jt,{"data-slot":`navigation-menu-item`,className:U(`relative`,e),...t})}var bn=b(`group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-3xl px-4.5 py-2.5 text-sm font-medium transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted data-open:bg-muted/50 data-open:hover:bg-muted data-open:focus:bg-muted`);function xn({className:e,children:t,...n}){return(0,X.jsxs)(en,{"data-slot":`navigation-menu-trigger`,className:U(bn(),`group`,e),...n,children:[t,` `,(0,X.jsx)(Le,{className:`relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180`,"aria-hidden":`true`})]})}function Sn({className:e,...t}){return(0,X.jsx)(Zt,{"data-slot":`navigation-menu-content`,className:U(`data-ending-style:data-activation-direction=left:translate-x-[50%] data-ending-style:data-activation-direction=right:translate-x-[-50%] data-starting-style:data-activation-direction=left:translate-x-[-50%] data-starting-style:data-activation-direction=right:translate-x-[50%] h-full w-auto p-2.5 pr-3 transition-[opacity,transform,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:rounded-3xl group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow-lg group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/5 group-data-[viewport=false]/navigation-menu:duration-300 data-ending-style:opacity-0 data-starting-style:opacity-0 data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:dark:ring-foreground/10 group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95`,e),...t})}function Cn({className:e,side:t=`bottom`,sideOffset:n=8,align:r=`start`,alignOffset:i=0,...a}){return(0,X.jsx)(on,{children:(0,X.jsx)(un,{side:t,sideOffset:n,align:r,alignOffset:i,className:U(`isolate z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-instant:transition-none data-[side=bottom]:before:top-[-10px] data-[side=bottom]:before:right-0 data-[side=bottom]:before:left-0`,e),...a,children:(0,X.jsx)(hn,{className:`data-[ending-style]:easing-[ease] xs:w-(--popup-width) relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin) rounded-3xl bg-popover text-popover-foreground shadow-lg ring-1 ring-foreground/5 transition-[opacity,transform,width,height,scale,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] outline-none data-ending-style:scale-90 data-ending-style:opacity-0 data-ending-style:duration-150 data-starting-style:scale-90 data-starting-style:opacity-0 dark:ring-foreground/10`,children:(0,X.jsx)(pn,{className:`relative size-full overflow-hidden`})})})})}function wn({className:e,...t}){return(0,X.jsx)(gn,{"data-slot":`navigation-menu-link`,className:U(`flex items-center gap-1.5 rounded-3xl p-3 text-sm transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-1 in-data-[slot=navigation-menu-content]:rounded-2xl data-[active=true]:bg-muted/50 data-[active=true]:hover:bg-muted data-[active=true]:focus:bg-muted [&_svg:not([class*='size-'])]:size-4`,e),...t})}var Tn=e({CommandPalette:()=>An,ContextMenuRightClick:()=>kn,DropdownMenuExample:()=>En,MenubarExample:()=>Dn,NavigationMenuExample:()=>On});function En(){return(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(q,{children:[(0,X.jsx)(Ze,{render:e=>(0,X.jsx)(le,{variant:`outline`,...e,children:`Open menu`})}),(0,X.jsxs)(tt,{children:[(0,X.jsx)($e,{children:`Actions`}),(0,X.jsx)(qe,{}),(0,X.jsxs)(Ge,{children:[(0,X.jsx)(ze,{className:`size-3.5`}),` Edit`]}),(0,X.jsxs)(Ge,{children:[(0,X.jsx)(d,{className:`size-3.5`}),` Duplicate`]}),(0,X.jsx)(qe,{}),(0,X.jsxs)(Ge,{variant:`destructive`,children:[(0,X.jsx)(Be,{className:`size-3.5`}),` Delete`]})]})]})})}function Dn(){return(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(Ot,{children:[(0,X.jsxs)(kt,{children:[(0,X.jsx)(At,{children:`File`}),(0,X.jsxs)(jt,{children:[(0,X.jsx)(Mt,{children:`New workspace`}),(0,X.jsx)(Mt,{children:`Import data`}),(0,X.jsx)(Nt,{}),(0,X.jsx)(Mt,{variant:`destructive`,children:`Archive`})]})]}),(0,X.jsxs)(kt,{children:[(0,X.jsx)(At,{children:`View`}),(0,X.jsxs)(jt,{children:[(0,X.jsx)(Mt,{children:`Compact rows`}),(0,X.jsx)(Mt,{children:`Show filters`})]})]})]})})}function On(){return(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(_n,{children:(0,X.jsxs)(vn,{children:[(0,X.jsxs)(yn,{children:[(0,X.jsx)(xn,{children:`Operations`}),(0,X.jsx)(Sn,{children:(0,X.jsxs)(`div`,{className:`grid w-[360px] gap-1`,children:[(0,X.jsxs)(wn,{href:`#orders`,children:[(0,X.jsx)(Re,{className:`size-4`}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`font-medium`,children:`Orders`}),(0,X.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Review active fulfillment queues.`})]})]}),(0,X.jsxs)(wn,{href:`#inventory`,children:[(0,X.jsx)(Re,{className:`size-4`}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`div`,{className:`font-medium`,children:`Inventory`}),(0,X.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Monitor low-stock and replenishment signals.`})]})]})]})})]}),(0,X.jsx)(yn,{children:(0,X.jsx)(wn,{href:`#reports`,children:`Reports`})})]})})})}function kn(){return(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(vt,{children:[(0,X.jsx)(yt,{children:(0,X.jsx)(`div`,{className:`flex h-24 w-full items-center justify-center rounded-md border border-dashed border-border text-sm text-muted-foreground`,children:`Right-click here`})}),(0,X.jsxs)(bt,{children:[(0,X.jsx)(xt,{children:`File`}),(0,X.jsx)(Ct,{}),(0,X.jsxs)(St,{children:[(0,X.jsx)(ze,{className:`size-3.5`}),` Rename`]}),(0,X.jsxs)(St,{children:[(0,X.jsx)(d,{className:`size-3.5`}),` Copy`]}),(0,X.jsx)(Ct,{}),(0,X.jsxs)(St,{variant:`destructive`,children:[(0,X.jsx)(Be,{className:`size-3.5`}),` Delete`]})]})]})})}function An(){return(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(pt,{className:`rounded-md border border-border`,children:[(0,X.jsx)(lt,{placeholder:`Type a command…`}),(0,X.jsxs)(dt,{children:[(0,X.jsx)(ut,{children:`No results.`}),(0,X.jsxs)(ft,{heading:`Actions`,children:[(0,X.jsx)(ct,{children:`Create order`}),(0,X.jsx)(ct,{children:`Add customer`}),(0,X.jsx)(ct,{children:`Generate invoice`})]}),(0,X.jsxs)(ft,{heading:`Navigation`,children:[(0,X.jsx)(ct,{children:`Go to Orders`}),(0,X.jsx)(ct,{children:`Go to Settings`})]})]})]})})}var jn=`import { Copy, Edit, ExternalLink, Trash2 } from 'lucide-react';
|
|
2
|
+
import { Button } from '@/components/ui/button';
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenu,
|
|
5
|
+
DropdownMenuContent,
|
|
6
|
+
DropdownMenuItem,
|
|
7
|
+
DropdownMenuLabel,
|
|
8
|
+
DropdownMenuSeparator,
|
|
9
|
+
DropdownMenuTrigger,
|
|
10
|
+
} from '@/components/ui/dropdown-menu';
|
|
11
|
+
import {
|
|
12
|
+
ContextMenu,
|
|
13
|
+
ContextMenuContent,
|
|
14
|
+
ContextMenuItem,
|
|
15
|
+
ContextMenuLabel,
|
|
16
|
+
ContextMenuSeparator,
|
|
17
|
+
ContextMenuTrigger,
|
|
18
|
+
} from '@/components/ui/context-menu';
|
|
19
|
+
import {
|
|
20
|
+
Command,
|
|
21
|
+
CommandEmpty,
|
|
22
|
+
CommandGroup,
|
|
23
|
+
CommandInput,
|
|
24
|
+
CommandItem,
|
|
25
|
+
CommandList,
|
|
26
|
+
} from '@/components/ui/command';
|
|
27
|
+
import {
|
|
28
|
+
Menubar,
|
|
29
|
+
MenubarContent,
|
|
30
|
+
MenubarItem,
|
|
31
|
+
MenubarMenu,
|
|
32
|
+
MenubarSeparator,
|
|
33
|
+
MenubarTrigger,
|
|
34
|
+
} from '@/components/ui/menubar';
|
|
35
|
+
import {
|
|
36
|
+
NavigationMenu,
|
|
37
|
+
NavigationMenuContent,
|
|
38
|
+
NavigationMenuItem,
|
|
39
|
+
NavigationMenuLink,
|
|
40
|
+
NavigationMenuList,
|
|
41
|
+
NavigationMenuTrigger,
|
|
42
|
+
} from '@/components/ui/navigation-menu';
|
|
43
|
+
|
|
44
|
+
export function DropdownMenuExample() {
|
|
45
|
+
return (
|
|
46
|
+
<>
|
|
47
|
+
<DropdownMenu>
|
|
48
|
+
<DropdownMenuTrigger render={(p) => <Button variant="outline" {...p}>Open menu</Button>} />
|
|
49
|
+
<DropdownMenuContent>
|
|
50
|
+
<DropdownMenuLabel>Actions</DropdownMenuLabel>
|
|
51
|
+
<DropdownMenuSeparator />
|
|
52
|
+
<DropdownMenuItem><Edit className="size-3.5" /> Edit</DropdownMenuItem>
|
|
53
|
+
<DropdownMenuItem><Copy className="size-3.5" /> Duplicate</DropdownMenuItem>
|
|
54
|
+
<DropdownMenuSeparator />
|
|
55
|
+
<DropdownMenuItem variant="destructive"><Trash2 className="size-3.5" /> Delete</DropdownMenuItem>
|
|
56
|
+
</DropdownMenuContent>
|
|
57
|
+
</DropdownMenu>
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function MenubarExample() {
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<Menubar>
|
|
66
|
+
<MenubarMenu>
|
|
67
|
+
<MenubarTrigger>File</MenubarTrigger>
|
|
68
|
+
<MenubarContent>
|
|
69
|
+
<MenubarItem>New workspace</MenubarItem>
|
|
70
|
+
<MenubarItem>Import data</MenubarItem>
|
|
71
|
+
<MenubarSeparator />
|
|
72
|
+
<MenubarItem variant="destructive">Archive</MenubarItem>
|
|
73
|
+
</MenubarContent>
|
|
74
|
+
</MenubarMenu>
|
|
75
|
+
<MenubarMenu>
|
|
76
|
+
<MenubarTrigger>View</MenubarTrigger>
|
|
77
|
+
<MenubarContent>
|
|
78
|
+
<MenubarItem>Compact rows</MenubarItem>
|
|
79
|
+
<MenubarItem>Show filters</MenubarItem>
|
|
80
|
+
</MenubarContent>
|
|
81
|
+
</MenubarMenu>
|
|
82
|
+
</Menubar>
|
|
83
|
+
</>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function NavigationMenuExample() {
|
|
88
|
+
return (
|
|
89
|
+
<>
|
|
90
|
+
<NavigationMenu>
|
|
91
|
+
<NavigationMenuList>
|
|
92
|
+
<NavigationMenuItem>
|
|
93
|
+
<NavigationMenuTrigger>Operations</NavigationMenuTrigger>
|
|
94
|
+
<NavigationMenuContent>
|
|
95
|
+
<div className="grid w-[360px] gap-1">
|
|
96
|
+
<NavigationMenuLink href="#orders">
|
|
97
|
+
<ExternalLink className="size-4" />
|
|
98
|
+
<div>
|
|
99
|
+
<div className="font-medium">Orders</div>
|
|
100
|
+
<div className="text-xs text-muted-foreground">Review active fulfillment queues.</div>
|
|
101
|
+
</div>
|
|
102
|
+
</NavigationMenuLink>
|
|
103
|
+
<NavigationMenuLink href="#inventory">
|
|
104
|
+
<ExternalLink className="size-4" />
|
|
105
|
+
<div>
|
|
106
|
+
<div className="font-medium">Inventory</div>
|
|
107
|
+
<div className="text-xs text-muted-foreground">Monitor low-stock and replenishment signals.</div>
|
|
108
|
+
</div>
|
|
109
|
+
</NavigationMenuLink>
|
|
110
|
+
</div>
|
|
111
|
+
</NavigationMenuContent>
|
|
112
|
+
</NavigationMenuItem>
|
|
113
|
+
<NavigationMenuItem>
|
|
114
|
+
<NavigationMenuLink href="#reports">Reports</NavigationMenuLink>
|
|
115
|
+
</NavigationMenuItem>
|
|
116
|
+
</NavigationMenuList>
|
|
117
|
+
</NavigationMenu>
|
|
118
|
+
</>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function ContextMenuRightClick() {
|
|
123
|
+
return (
|
|
124
|
+
<>
|
|
125
|
+
<ContextMenu>
|
|
126
|
+
<ContextMenuTrigger>
|
|
127
|
+
<div className="flex h-24 w-full items-center justify-center rounded-md border border-dashed border-border text-sm text-muted-foreground">
|
|
128
|
+
Right-click here
|
|
129
|
+
</div>
|
|
130
|
+
</ContextMenuTrigger>
|
|
131
|
+
<ContextMenuContent>
|
|
132
|
+
<ContextMenuLabel>File</ContextMenuLabel>
|
|
133
|
+
<ContextMenuSeparator />
|
|
134
|
+
<ContextMenuItem><Edit className="size-3.5" /> Rename</ContextMenuItem>
|
|
135
|
+
<ContextMenuItem><Copy className="size-3.5" /> Copy</ContextMenuItem>
|
|
136
|
+
<ContextMenuSeparator />
|
|
137
|
+
<ContextMenuItem variant="destructive"><Trash2 className="size-3.5" /> Delete</ContextMenuItem>
|
|
138
|
+
</ContextMenuContent>
|
|
139
|
+
</ContextMenu>
|
|
140
|
+
</>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function CommandPalette() {
|
|
145
|
+
return (
|
|
146
|
+
<>
|
|
147
|
+
<Command className="rounded-md border border-border">
|
|
148
|
+
<CommandInput placeholder="Type a command…" />
|
|
149
|
+
<CommandList>
|
|
150
|
+
<CommandEmpty>No results.</CommandEmpty>
|
|
151
|
+
<CommandGroup heading="Actions">
|
|
152
|
+
<CommandItem>Create order</CommandItem>
|
|
153
|
+
<CommandItem>Add customer</CommandItem>
|
|
154
|
+
<CommandItem>Generate invoice</CommandItem>
|
|
155
|
+
</CommandGroup>
|
|
156
|
+
<CommandGroup heading="Navigation">
|
|
157
|
+
<CommandItem>Go to Orders</CommandItem>
|
|
158
|
+
<CommandItem>Go to Settings</CommandItem>
|
|
159
|
+
</CommandGroup>
|
|
160
|
+
</CommandList>
|
|
161
|
+
</Command>
|
|
162
|
+
</>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
`;function Mn(e){return Tn||Pn(`Examples`,!1),An||Pn(`Examples.CommandPalette`,!0),kn||Pn(`Examples.ContextMenuRightClick`,!0),En||Pn(`Examples.DropdownMenuExample`,!0),Dn||Pn(`Examples.MenubarExample`,!0),On||Pn(`Examples.NavigationMenuExample`,!0),(0,X.jsx)(s,{title:`UI · Menus`,description:`DropdownMenu, Menubar, NavigationMenu, ContextMenu, and Command palette.`,layer:`ui`,status:`ready`,children:(0,X.jsxs)(u,{title:`Examples`,id:`examples`,children:[(0,X.jsx)(B,{name:`DropdownMenuExample`,source:jn,children:(0,X.jsx)(En,{})}),(0,X.jsx)(B,{name:`MenubarExample`,source:jn,children:(0,X.jsx)(Dn,{})}),(0,X.jsx)(B,{name:`NavigationMenuExample`,source:jn,children:(0,X.jsx)(On,{})}),(0,X.jsx)(B,{name:`ContextMenuRightClick`,source:jn,children:(0,X.jsx)(kn,{})}),(0,X.jsx)(B,{name:`CommandPalette`,source:jn,children:(0,X.jsx)(An,{})})]})})}function Nn(e={}){let{wrapper:t}=e.components||{};return t?(0,X.jsx)(t,{...e,children:(0,X.jsx)(Mn,{...e})}):Mn(e)}function Pn(e,t){throw Error(`Expected `+(t?`component`:`object`)+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}export{Nn as default};
|