From 629da715a9049147fbc1b4be84981ad9bbb3ecf7 Mon Sep 17 00:00:00 2001 From: Friederich Loheide Date: Sat, 26 Sep 2026 20:23:18 +0000 Subject: [PATCH] Mediathek in den Beitrags-Editor eingebunden, Version 0.18.0 Co-Authored-By: Claude Opus 5.5 (1M context) --- CHANGELOG.md | 9 + app/Version.php | 2 +- .../news/resources/js/pages/Editor.vue | 55 +- .../Http/Controllers/NewsEditorController.php | 18 +- ...dion-P-5h5nD1.js => Accordion-Cp213i2r.js} | 2 +- public/build/assets/AppIcon-0N56IC2z.js | 1 - public/build/assets/AppIcon-nlhvQfK7.js | 1 + ...yout-BxsYt2ib.js => AppLayout-esQiy2nD.js} | 2 +- .../{Areas-ByqCHRYS.js => Areas-CDCEZN1-.js} | 2 +- ...m-CI_wVS_D.js => BirthdayItem-ELeKwOyJ.js} | 2 +- ...Brn3I9AH.js => BirthdaysBlock-Cw6hWs98.js} | 2 +- .../{Box-Cdw55XJf.js => Box-NgwHFvBv.js} | 2 +- ...Logo-1xuP9ByR.js => BrandLogo-B9g_TCsV.js} | 2 +- public/build/assets/Builder-C8khIh0O.js | 1 - public/build/assets/Builder-CNJagWI1.js | 1 + ...uttons-CPTycmqE.js => Buttons-Dzm5lp7N.js} | 2 +- ...tacts-DoWMe0PE.js => Contacts-fiSJBaQP.js} | 2 +- ...ile-CA8hCJ2g.js => CustomTile-BGjBhIVE.js} | 2 +- ...oard-DDRG4hPZ.js => Dashboard-CSKyh0Uo.js} | 2 +- .../assets/DialogDescription-BxaIqmag.js | 1 - .../assets/DialogDescription-CaB-9xpp.js | 1 + .../assets/DialogDescription-Cf3zbHQX.js | 1 + ...Dv1jxmzh.js => DirectoryLogin-DMGjY_5j.js} | 2 +- ...oads-CBwE2am1.js => Downloads-CLgaI6MO.js} | 2 +- .../{Edit-CpWBr8mw.js => Edit-D7IMdWK_.js} | 4 +- public/build/assets/Editor-8SdMFOv_.js | 1 - public/build/assets/Editor-BKM9pJGo.js | 1 + public/build/assets/Editor-BhJCzJD1.js | 1 + public/build/assets/Editor-DhqamJ3d.js | 1 - .../build/assets/EditorBlockList-C9b3fqvQ.js | 1 - ...Xe2D8QAP.js => EditorialForms-CbjA1btN.js} | 2 +- .../build/assets/EditorialMedia-DaL3QIsH.js | 1 + ...-D_r1x5FJ.js => EditorialNews-AsssE4tU.js} | 2 +- ...iK1WfX4x.js => EditorialPages-C4uXxskK.js} | 2 +- ...-D1yV2ddA.js => EventListItem-B744Ks6-.js} | 2 +- ...eIcon-B6dfvt48.js => FileIcon-BctWLKDw.js} | 2 +- public/build/assets/Folder-Bi6XxhES.js | 1 - public/build/assets/Folder-DhP4Kqlb.js | 1 + ...ck-Cgeb2aeH.js => FolderBlock-fKv65pVH.js} | 2 +- public/build/assets/FolderTile-B1Q0k_YL.js | 1 + public/build/assets/FolderTile-_J6uRwiD.js | 1 - ...DBBKbJ8d.js => ForgotPassword-D3igZp7Q.js} | 2 +- ...lock-CT3QsLOf.js => FormBlock-BHsQr-qn.js} | 2 +- ...r-BEg0886q.js => FormRenderer-CoNVx1AS.js} | 2 +- ...allery-BB6gBCuJ.js => Gallery-DUd_nJKW.js} | 2 +- ...eting-DWCRBmCo.js => Greeting-BqqUXd60.js} | 2 +- ...eting-K-a792Bo.js => Greeting-DFGlck2e.js} | 2 +- ...ut-CAwpgUCY.js => GuestLayout-B2rtJjbh.js} | 2 +- .../{Hero-VuaFLBZ6.js => Hero-DoAmerYi.js} | 2 +- .../{Hero-CJbbm1yG.js => Hero-KYOmvKSH.js} | 2 +- ...nList-CCXxiN3s.js => IconList-yxArjGGl.js} | 2 +- .../{Image-BWiA3tKS.js => Image-ZW9EqjPK.js} | 2 +- .../{Index-BYeL_mJs.js => Index-BC3mnuyy.js} | 2 +- .../{Index-DKsXZOQc.js => Index-BDNjv7bZ.js} | 2 +- .../{Index-BcmYQkcJ.js => Index-BIQaJQNR.js} | 2 +- public/build/assets/Index-BYRiOW5j.js | 2 + .../{Index-Cr7HhjGR.js => Index-Bh8jiaJi.js} | 2 +- .../{Index-Cb5ksNXA.js => Index-BjNLv6WL.js} | 2 +- public/build/assets/Index-CEVOUwPe.js | 2 - .../{Index-OH77dt1V.js => Index-CLoLvBQV.js} | 2 +- .../{Index-stioZgWd.js => Index-CaaVYsb2.js} | 2 +- public/build/assets/Index-CjQCdvt-.js | 1 + .../{Index-LjDUx_tK.js => Index-CppAWUIo.js} | 2 +- .../{Index-HU3KGFXQ.js => Index-D1NjDzqB.js} | 4 +- .../{Index-n_s429m8.js => Index-DJEXwOyO.js} | 2 +- .../{Index-BVnuDp-X.js => Index-Q18G3mVK.js} | 4 +- .../{Index-DB_ZZ8w1.js => Index-vuwnPxDO.js} | 2 +- ...{Latest-BSAp6xac.js => Latest-BLQzvFw2.js} | 2 +- ...ews-DjjPja1-.js => LatestNews-CD2sRcmN.js} | 2 +- .../{Loans-Dl8zdae9.js => Loans-DRzgaqxB.js} | 2 +- .../{Login-HwVm9O9q.js => Login-LD01sd0o.js} | 2 +- ...ds-DbYaOnA1.js => MyDownloads-DMU40SUE.js} | 2 +- .../{MyIt-CRI1MUT9.js => MyIt-C-wd9M34.js} | 2 +- ...t-BGasRaNs.js => NativeSelect-G3km7PmI.js} | 2 +- ...-BMV90TrO.js => NewColleagues-Dl9znv_Q.js} | 2 +- ...-BJuo8o_M.js => NewPageDialog-CGV-jwsW.js} | 2 +- ...sCard-DpbfyO9M.js => NewsCard-Cxl6vjIa.js} | 2 +- ...mage-DgRoe0H1.js => NewsImage-C1RPeE33.js} | 2 +- ...m-rvZKO5MT.js => NewsListItem-DKC4VK9G.js} | 2 +- ...ram-B8RSJdkM.js => Organigram-DZSdBh0y.js} | 2 +- ...nt-bQ_WRrV_.js => PageContent-22GSNgo9.js} | 2 +- ...der-Ybe7qDu5.js => PageHeader-BMzzCXfT.js} | 2 +- .../{Panel-BASB8Xb9.js => Panel-Dr-NcUuS.js} | 2 +- ...h-CLQYjJiH.js => PeopleSearch-D-_1m-bo.js} | 2 +- .../{Print-DlAwSvIZ.js => Print-B52yJ-oY.js} | 2 +- ...xtdAtvE.js => ProfileBirthday-BTcaZfOC.js} | 2 +- ...d3qyC.js => ProfileIncomplete-BxjghKzG.js} | 2 +- ...ox-Ri1YCTQc.js => QmSearchBox-BW950raa.js} | 2 +- ...nks-CSSpapKm.js => QuickLinks-DV6deS27.js} | 2 +- ...-n5gAPufN.js => ResetPassword-BMgqvD7X.js} | 2 +- .../build/assets/RichTextEditor-CT-rIT4q.js | 129 +++ .../build/assets/RichTextEditor-qslPmeeg.js | 129 --- ...{Sample-DoS7xL8V.js => Sample-CfzueD_V.js} | 2 +- public/build/assets/Search-BlIKvXB-.js | 1 - public/build/assets/Search-DfTUuPsS.js | 1 + .../{Show-DWEMstwB.js => Show-BY2_D8bu.js} | 2 +- .../{Show-C6LzXbnd.js => Show-Cn1r8GQI.js} | 2 +- .../{Show-DTMG6TUr.js => Show-D7IyxymP.js} | 2 +- .../{Show-BNFnLRmU.js => Show-DHgGJJKJ.js} | 2 +- .../{Show-BHs_GqKb.js => Show-oCIt-pUC.js} | 2 +- ...pages-xPi82WYF.js => Subpages-BaNB0mvB.js} | 2 +- public/build/assets/Switch-CWN1_5O7.js | 1 - public/build/assets/Switch-DtqyAsXz.js | 1 + public/build/assets/Text-BEgy2ho_.js | 2 - public/build/assets/Text-z90Y59eg.js | 2 + ...{Ticket-oyqxLk_w.js => Ticket-DQFll5zs.js} | 2 +- ...e-D0MGa9W5.js => TicketCreate-UMEMz3xd.js} | 2 +- ...oming-CqA1fba6.js => Upcoming-B8HALD0a.js} | 2 +- ...oming-OBguJie2.js => Upcoming-CgTH3-xJ.js} | 2 +- ...PAkPjGQe.js => UpcomingEvents-C3jR0Ycw.js} | 2 +- .../{Video-ANYz6xeT.js => Video-BCiRhytl.js} | 2 +- public/build/assets/Viewer-CRtgYcl6.js | 2 + public/build/assets/Viewer-aK9tWVFU.js | 2 - .../{app-Bu3kn8yd.js => app-BNwrc_lv.js} | 4 +- public/build/assets/app-Bv2m9wnk.css | 2 + public/build/assets/app-CL30rx2M.css | 2 - ...{button-ZHC5mKey.js => button-CwUSbS9X.js} | 2 +- public/build/assets/copy-DsLby0sm.js | 1 + ...{dialog-uBUhf8w7.js => dialog-RK2mTeqi.js} | 2 +- public/build/assets/external-link-8-VtmLK9.js | 1 + public/build/assets/format-20VMi8w8.js | 1 + public/build/assets/format-uZU1H-69.js | 1 - .../{http-DmyDwIce.js => http-CAG9BrJF.js} | 2 +- public/build/assets/image-off-IDPmIoA8.js | 1 + public/build/assets/image-plus-C1A_7CFG.js | 1 + public/build/assets/images-47Nc0alu.js | 1 + .../{pdf-xi5Hl50h.js => pdf-DDPLWCRM.js} | 2 +- ...l-DzhCPy2_.js => pdfThumbnail-FYC4VfyJ.js} | 4 +- public/build/assets/registry-ZZ5qL5ag.js | 2 - public/build/assets/registry-w73v-fJQ.js | 2 + public/build/assets/useMediaList-Cpw6m1Nv.js | 1 + .../build/assets/useMediaPicker-BtFVt5Ui.js | 1 + ...CaLfE4.css => useMediaPicker-D8CaLfE4.css} | 0 public/build/assets/widgets-BmL-pPiO.js | 2 - public/build/assets/widgets-D5Uy4PcL.js | 2 + public/build/manifest.json | 999 ++++++++++-------- vendor/composer/autoload_classmap.php | 7 + vendor/composer/autoload_static.php | 7 + vendor/composer/installed.php | 4 +- 139 files changed, 891 insertions(+), 703 deletions(-) rename public/build/assets/{Accordion-P-5h5nD1.js => Accordion-Cp213i2r.js} (99%) delete mode 100644 public/build/assets/AppIcon-0N56IC2z.js create mode 100644 public/build/assets/AppIcon-nlhvQfK7.js rename public/build/assets/{AppLayout-BxsYt2ib.js => AppLayout-esQiy2nD.js} (96%) rename public/build/assets/{Areas-ByqCHRYS.js => Areas-CDCEZN1-.js} (91%) rename public/build/assets/{BirthdayItem-CI_wVS_D.js => BirthdayItem-ELeKwOyJ.js} (90%) rename public/build/assets/{BirthdaysBlock-Brn3I9AH.js => BirthdaysBlock-Cw6hWs98.js} (91%) rename public/build/assets/{Box-Cdw55XJf.js => Box-NgwHFvBv.js} (86%) rename public/build/assets/{BrandLogo-1xuP9ByR.js => BrandLogo-B9g_TCsV.js} (95%) delete mode 100644 public/build/assets/Builder-C8khIh0O.js create mode 100644 public/build/assets/Builder-CNJagWI1.js rename public/build/assets/{Buttons-CPTycmqE.js => Buttons-Dzm5lp7N.js} (94%) rename public/build/assets/{Contacts-DoWMe0PE.js => Contacts-fiSJBaQP.js} (89%) rename public/build/assets/{CustomTile-CA8hCJ2g.js => CustomTile-BGjBhIVE.js} (88%) rename public/build/assets/{Dashboard-DDRG4hPZ.js => Dashboard-CSKyh0Uo.js} (93%) delete mode 100644 public/build/assets/DialogDescription-BxaIqmag.js create mode 100644 public/build/assets/DialogDescription-CaB-9xpp.js create mode 100644 public/build/assets/DialogDescription-Cf3zbHQX.js rename public/build/assets/{DirectoryLogin-Dv1jxmzh.js => DirectoryLogin-DMGjY_5j.js} (90%) rename public/build/assets/{Downloads-CBwE2am1.js => Downloads-CLgaI6MO.js} (95%) rename public/build/assets/{Edit-CpWBr8mw.js => Edit-D7IMdWK_.js} (90%) delete mode 100644 public/build/assets/Editor-8SdMFOv_.js create mode 100644 public/build/assets/Editor-BKM9pJGo.js create mode 100644 public/build/assets/Editor-BhJCzJD1.js delete mode 100644 public/build/assets/Editor-DhqamJ3d.js delete mode 100644 public/build/assets/EditorBlockList-C9b3fqvQ.js rename public/build/assets/{EditorialForms-Xe2D8QAP.js => EditorialForms-CbjA1btN.js} (91%) create mode 100644 public/build/assets/EditorialMedia-DaL3QIsH.js rename public/build/assets/{EditorialNews-D_r1x5FJ.js => EditorialNews-AsssE4tU.js} (92%) rename public/build/assets/{EditorialPages-iK1WfX4x.js => EditorialPages-C4uXxskK.js} (88%) rename public/build/assets/{EventListItem-D1yV2ddA.js => EventListItem-B744Ks6-.js} (92%) rename public/build/assets/{FileIcon-B6dfvt48.js => FileIcon-BctWLKDw.js} (98%) delete mode 100644 public/build/assets/Folder-Bi6XxhES.js create mode 100644 public/build/assets/Folder-DhP4Kqlb.js rename public/build/assets/{FolderBlock-Cgeb2aeH.js => FolderBlock-fKv65pVH.js} (93%) create mode 100644 public/build/assets/FolderTile-B1Q0k_YL.js delete mode 100644 public/build/assets/FolderTile-_J6uRwiD.js rename public/build/assets/{ForgotPassword-DBBKbJ8d.js => ForgotPassword-D3igZp7Q.js} (85%) rename public/build/assets/{FormBlock-CT3QsLOf.js => FormBlock-BHsQr-qn.js} (93%) rename public/build/assets/{FormRenderer-BEg0886q.js => FormRenderer-CoNVx1AS.js} (95%) rename public/build/assets/{Gallery-BB6gBCuJ.js => Gallery-DUd_nJKW.js} (96%) rename public/build/assets/{Greeting-DWCRBmCo.js => Greeting-BqqUXd60.js} (92%) rename public/build/assets/{Greeting-K-a792Bo.js => Greeting-DFGlck2e.js} (93%) rename public/build/assets/{GuestLayout-CAwpgUCY.js => GuestLayout-B2rtJjbh.js} (96%) rename public/build/assets/{Hero-VuaFLBZ6.js => Hero-DoAmerYi.js} (90%) rename public/build/assets/{Hero-CJbbm1yG.js => Hero-KYOmvKSH.js} (96%) rename public/build/assets/{IconList-CCXxiN3s.js => IconList-yxArjGGl.js} (94%) rename public/build/assets/{Image-BWiA3tKS.js => Image-ZW9EqjPK.js} (93%) rename public/build/assets/{Index-BYeL_mJs.js => Index-BC3mnuyy.js} (93%) rename public/build/assets/{Index-DKsXZOQc.js => Index-BDNjv7bZ.js} (87%) rename public/build/assets/{Index-BcmYQkcJ.js => Index-BIQaJQNR.js} (84%) create mode 100644 public/build/assets/Index-BYRiOW5j.js rename public/build/assets/{Index-Cr7HhjGR.js => Index-Bh8jiaJi.js} (92%) rename public/build/assets/{Index-Cb5ksNXA.js => Index-BjNLv6WL.js} (91%) delete mode 100644 public/build/assets/Index-CEVOUwPe.js rename public/build/assets/{Index-OH77dt1V.js => Index-CLoLvBQV.js} (91%) rename public/build/assets/{Index-stioZgWd.js => Index-CaaVYsb2.js} (96%) create mode 100644 public/build/assets/Index-CjQCdvt-.js rename public/build/assets/{Index-LjDUx_tK.js => Index-CppAWUIo.js} (93%) rename public/build/assets/{Index-HU3KGFXQ.js => Index-D1NjDzqB.js} (93%) rename public/build/assets/{Index-n_s429m8.js => Index-DJEXwOyO.js} (87%) rename public/build/assets/{Index-BVnuDp-X.js => Index-Q18G3mVK.js} (92%) rename public/build/assets/{Index-DB_ZZ8w1.js => Index-vuwnPxDO.js} (85%) rename public/build/assets/{Latest-BSAp6xac.js => Latest-BLQzvFw2.js} (82%) rename public/build/assets/{LatestNews-DjjPja1-.js => LatestNews-CD2sRcmN.js} (90%) rename public/build/assets/{Loans-Dl8zdae9.js => Loans-DRzgaqxB.js} (80%) rename public/build/assets/{Login-HwVm9O9q.js => Login-LD01sd0o.js} (96%) rename public/build/assets/{MyDownloads-DbYaOnA1.js => MyDownloads-DMU40SUE.js} (85%) rename public/build/assets/{MyIt-CRI1MUT9.js => MyIt-C-wd9M34.js} (89%) rename public/build/assets/{NativeSelect-BGasRaNs.js => NativeSelect-G3km7PmI.js} (94%) rename public/build/assets/{NewColleagues-BMV90TrO.js => NewColleagues-Dl9znv_Q.js} (87%) rename public/build/assets/{NewPageDialog-BJuo8o_M.js => NewPageDialog-CGV-jwsW.js} (63%) rename public/build/assets/{NewsCard-DpbfyO9M.js => NewsCard-Cxl6vjIa.js} (88%) rename public/build/assets/{NewsImage-DgRoe0H1.js => NewsImage-C1RPeE33.js} (85%) rename public/build/assets/{NewsListItem-rvZKO5MT.js => NewsListItem-DKC4VK9G.js} (84%) rename public/build/assets/{Organigram-B8RSJdkM.js => Organigram-DZSdBh0y.js} (96%) rename public/build/assets/{PageContent-bQ_WRrV_.js => PageContent-22GSNgo9.js} (93%) rename public/build/assets/{PageHeader-Ybe7qDu5.js => PageHeader-BMzzCXfT.js} (95%) rename public/build/assets/{Panel-BASB8Xb9.js => Panel-Dr-NcUuS.js} (93%) rename public/build/assets/{PeopleSearch-CLQYjJiH.js => PeopleSearch-D-_1m-bo.js} (93%) rename public/build/assets/{Print-DlAwSvIZ.js => Print-B52yJ-oY.js} (94%) rename public/build/assets/{ProfileBirthday-qxtdAtvE.js => ProfileBirthday-BTcaZfOC.js} (85%) rename public/build/assets/{ProfileIncomplete-_03d3qyC.js => ProfileIncomplete-BxjghKzG.js} (82%) rename public/build/assets/{QmSearchBox-Ri1YCTQc.js => QmSearchBox-BW950raa.js} (85%) rename public/build/assets/{QuickLinks-CSSpapKm.js => QuickLinks-DV6deS27.js} (95%) rename public/build/assets/{ResetPassword-n5gAPufN.js => ResetPassword-BMgqvD7X.js} (87%) create mode 100644 public/build/assets/RichTextEditor-CT-rIT4q.js delete mode 100644 public/build/assets/RichTextEditor-qslPmeeg.js rename public/build/assets/{Sample-DoS7xL8V.js => Sample-CfzueD_V.js} (84%) delete mode 100644 public/build/assets/Search-BlIKvXB-.js create mode 100644 public/build/assets/Search-DfTUuPsS.js rename public/build/assets/{Show-DWEMstwB.js => Show-BY2_D8bu.js} (94%) rename public/build/assets/{Show-C6LzXbnd.js => Show-Cn1r8GQI.js} (98%) rename public/build/assets/{Show-DTMG6TUr.js => Show-D7IyxymP.js} (81%) rename public/build/assets/{Show-BNFnLRmU.js => Show-DHgGJJKJ.js} (90%) rename public/build/assets/{Show-BHs_GqKb.js => Show-oCIt-pUC.js} (91%) rename public/build/assets/{Subpages-xPi82WYF.js => Subpages-BaNB0mvB.js} (90%) delete mode 100644 public/build/assets/Switch-CWN1_5O7.js create mode 100644 public/build/assets/Switch-DtqyAsXz.js delete mode 100644 public/build/assets/Text-BEgy2ho_.js create mode 100644 public/build/assets/Text-z90Y59eg.js rename public/build/assets/{Ticket-oyqxLk_w.js => Ticket-DQFll5zs.js} (96%) rename public/build/assets/{TicketCreate-D0MGa9W5.js => TicketCreate-UMEMz3xd.js} (93%) rename public/build/assets/{Upcoming-CqA1fba6.js => Upcoming-B8HALD0a.js} (89%) rename public/build/assets/{Upcoming-OBguJie2.js => Upcoming-CgTH3-xJ.js} (74%) rename public/build/assets/{UpcomingEvents-PAkPjGQe.js => UpcomingEvents-C3jR0Ycw.js} (88%) rename public/build/assets/{Video-ANYz6xeT.js => Video-BCiRhytl.js} (96%) create mode 100644 public/build/assets/Viewer-CRtgYcl6.js delete mode 100644 public/build/assets/Viewer-aK9tWVFU.js rename public/build/assets/{app-Bu3kn8yd.js => app-BNwrc_lv.js} (92%) create mode 100644 public/build/assets/app-Bv2m9wnk.css delete mode 100644 public/build/assets/app-CL30rx2M.css rename public/build/assets/{button-ZHC5mKey.js => button-CwUSbS9X.js} (98%) create mode 100644 public/build/assets/copy-DsLby0sm.js rename public/build/assets/{dialog-uBUhf8w7.js => dialog-RK2mTeqi.js} (96%) create mode 100644 public/build/assets/external-link-8-VtmLK9.js create mode 100644 public/build/assets/format-20VMi8w8.js delete mode 100644 public/build/assets/format-uZU1H-69.js rename public/build/assets/{http-DmyDwIce.js => http-CAG9BrJF.js} (99%) create mode 100644 public/build/assets/image-off-IDPmIoA8.js create mode 100644 public/build/assets/image-plus-C1A_7CFG.js create mode 100644 public/build/assets/images-47Nc0alu.js rename public/build/assets/{pdf-xi5Hl50h.js => pdf-DDPLWCRM.js} (99%) rename public/build/assets/{pdfThumbnail-DzhCPy2_.js => pdfThumbnail-FYC4VfyJ.js} (70%) delete mode 100644 public/build/assets/registry-ZZ5qL5ag.js create mode 100644 public/build/assets/registry-w73v-fJQ.js create mode 100644 public/build/assets/useMediaList-Cpw6m1Nv.js create mode 100644 public/build/assets/useMediaPicker-BtFVt5Ui.js rename public/build/assets/{EditorBlockList-D8CaLfE4.css => useMediaPicker-D8CaLfE4.css} (100%) delete mode 100644 public/build/assets/widgets-BmL-pPiO.js create mode 100644 public/build/assets/widgets-D5Uy4PcL.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e5f86f0..7d93e7b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ Neueste Version oben. Jeder Abschnitt beginnt mit `## MAJOR.MINOR.PATCH` und enthält kurze Stichpunkte für Anwenderinnen und Anwender – keine Commit-Texte. Der Self-Updater zeigt diese Abschnitte bei neuen Versionen an. +## 0.18.0 + +- **Mediathek** (Redaktion → Mediathek, im Backend unter „Inhalte → Mediathek“): alle Bilder aus Beiträgen, Seiten, Terminen und Kacheln an einem Ort + - Raster mit Suche und Filtern (hochgeladen von, Zeitraum, verwendet in, „nicht verwendet“), Hochladen mehrerer Bilder per Ziehen und Ablegen + - Je Bild: große Vorschau, Maße, Größe, Alternativtext und Bildunterschrift bearbeiten und „Eingebunden in“ mit Links zu jeder Fundstelle + - Bild ersetzen (gilt sofort überall), löschen mit Warnung und Liste der Fundstellen, ungenutzte Bilder aufräumen (Recht „Mediathek verwalten“) + - Bereits vorhandene Bilder werden beim Update automatisch übernommen +- **Bildauswahl in den Editoren:** In Seiten und Beiträgen lassen sich Bilder für Bild-, Galerie- und Hero-Blöcke sowie das Titelbild hochladen oder aus der Mediathek wählen – mit Suche, Filter „schon in diesem Beitrag“, Mehrfachauswahl für Galerien und Alternativtext direkt im Dialog + ## 0.17.1 - IT-Service: Ist nur die Serveradresse eingetragen, wird „/api/ex“ automatisch ergänzt. Liefert die Adresse keine API-Antwort (z. B. eine Webseite), erscheint ein klarer Hinweis statt leerer Listen; „Verbindung testen“ zeigt die Anzahl von Kategorien, Standorten, Gerätetypen und Leihgeräten diff --git a/app/Version.php b/app/Version.php index 8768b441..90971513 100644 --- a/app/Version.php +++ b/app/Version.php @@ -9,5 +9,5 @@ namespace App; */ final class Version { - public const VERSION = '0.17.1'; + public const VERSION = '0.18.0'; } diff --git a/plugins-core/news/resources/js/pages/Editor.vue b/plugins-core/news/resources/js/pages/Editor.vue index bb5f5a0e..d462c3d3 100644 --- a/plugins-core/news/resources/js/pages/Editor.vue +++ b/plugins-core/news/resources/js/pages/Editor.vue @@ -7,6 +7,7 @@ import { EllipsisVertical, Eye, ImagePlus, + Images, LoaderCircle, MessageSquareWarning, Monitor, @@ -35,6 +36,9 @@ import BlockSettings from '@/pagebuilder/editor/BlockSettings.vue'; import EditorBlockList from '@/pagebuilder/editor/EditorBlockList.vue'; import { clone, createBlock, duplicate as duplicateBlock, locate, walk } from '@/pagebuilder/editor/tree'; import { http } from '@/lib/http'; +import MediaPickerHost from '@/components/media/MediaPickerHost.vue'; +import { collectImagePaths, uploadWithProgress } from '@/components/media/api'; +import { useMediaPicker } from '@/components/media/useMediaPicker'; /** * Beitrag schreiben – mit demselben Baukasten wie die Seiten. Titelbild, Titel @@ -70,6 +74,7 @@ const form = useForm({ teaser: props.post?.teaser ?? '', category_id: props.post?.category_id ?? (props.categories.length === 1 ? props.categories[0].id : null), cover: null, + cover_media: null, remove_cover: false, is_featured: props.post?.is_featured ?? false, published_at: localValue(props.post?.published_at), @@ -155,18 +160,22 @@ function containsActive(item) { return candidates.some((block) => block.items?.includes(item) || locate(item.blocks, block.id)); } -async function uploadImage(file) { - const body = new FormData(); - body.append('image', file); - +// Bilder landen zugleich in der Mediathek +async function uploadImage(file, onProgress) { try { - return await http.post('/redaktion/neuigkeiten/bilder', body); + return await uploadWithProgress('/redaktion/neuigkeiten/bilder', file, { onProgress }); } catch (error) { toast.error(error.fieldErrors?.image ?? error.message); throw error; } } +const mediaPicker = useMediaPicker({ + upload: uploadImage, + contextLabel: 'In diesem Beitrag', + contextPaths: () => collectImagePaths(working.content), +}); + async function uploadFile() { toast.error('Dateien zum Herunterladen gehören in den Bereich „Downloads“ – dort hochladen und hier mit dem Downloads-Block verlinken.'); throw new Error('not supported'); @@ -190,6 +199,7 @@ provide('pagebuilder:editor', { containsActive, uploadImage, uploadFile, + pickMedia: (options) => mediaPicker.pick(options), imageUrl: (path) => `${props.uploadsUrl}/${path}`, }); provide('pagebuilder:list', EditorBlockList); @@ -339,12 +349,25 @@ function chooseCover(event) { if (!file) return; form.cover = file; + form.cover_media = null; form.remove_cover = false; coverPreview.value = URL.createObjectURL(file); } +async function pickCover() { + const picked = await mediaPicker.pick({ title: 'Titelbild wählen' }); + + if (!picked?.length) return; + + form.cover = null; + form.cover_media = picked[0].path; + form.remove_cover = false; + coverPreview.value = picked[0].url; +} + function removeCover() { form.cover = null; + form.cover_media = null; form.remove_cover = true; coverPreview.value = null; } @@ -519,20 +542,24 @@ function autoGrow(event) {
- + +
- + + Querformat, am besten 1600 × 900 Pixel - +

{{ form.errors.cover }}

@@ -620,7 +647,8 @@ function autoGrow(event) {
Titelbild
- + +

Wird auf 16:9 zugeschnitten.

@@ -670,5 +698,6 @@ function autoGrow(event) {
+ diff --git a/plugins-core/news/src/Http/Controllers/NewsEditorController.php b/plugins-core/news/src/Http/Controllers/NewsEditorController.php index 49cd455f..019dc027 100644 --- a/plugins-core/news/src/Http/Controllers/NewsEditorController.php +++ b/plugins-core/news/src/Http/Controllers/NewsEditorController.php @@ -3,12 +3,12 @@ namespace Inhaus\Plugins\News\Http\Controllers; use App\Http\Controllers\Controller; +use App\Media\MediaLibrary; use App\Models\Role; use App\Models\User; use App\Pagebuilder\Blocks; use App\Pagebuilder\Content; use App\Support\Audit; -use App\Support\Images; use Illuminate\Http\JsonResponse; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; @@ -109,15 +109,15 @@ class NewsEditorController extends Controller return to_route('editorial')->with('status', 'Beitrag gelöscht.'); } - public function uploadImage(Request $request, Images $images): JsonResponse + public function uploadImage(Request $request, MediaLibrary $library): JsonResponse { Gate::authorize('create', NewsPost::class); $request->validate(['image' => ['required', File::image()->types(['jpg', 'jpeg', 'png', 'webp', 'gif'])->max(15 * 1024)]]); - // Unter pagebuilder/, damit Bild-Blöcke den Pfad annehmen - $path = $images->storeContentImage($request->file('image'), 'pagebuilder/news'); + // Landet zugleich in der Mediathek. + $media = $library->store($request->file('image'), 'pagebuilder/news', $request->user()); - return response()->json(['path' => $path, 'url' => Storage::disk('uploads')->url($path)]); + return response()->json(['path' => $media->path, 'url' => Blocks::imageUrl($media->path), 'media' => $media->toLibraryArray()]); } /** Vorschau dynamischer Blöcke (aktuelle Beiträge, Termine, Personen …) im Editor */ @@ -149,6 +149,8 @@ class NewsEditorController extends Controller 'category_id' => [$user->can('news.manage') ? 'nullable' : 'required', 'integer', Rule::in($writable === true ? NewsCategory::query()->pluck('id')->all() : $writable)], 'cover' => ['nullable', File::image()->types(['jpg', 'jpeg', 'png', 'webp'])->max(10 * 1024)], 'remove_cover' => ['boolean'], + // Titelbild aus der Mediathek + 'cover_media' => ['nullable', 'string', 'max:500', Rule::exists('media', 'path')], 'is_featured' => ['boolean'], 'comments_enabled' => ['boolean'], 'published_at' => ['nullable', 'date'], @@ -184,8 +186,12 @@ class NewsEditorController extends Controller $post->cover_path = null; } + if (filled($data['cover_media'] ?? null) && ! $request->hasFile('cover')) { + $post->cover_path = $data['cover_media']; + } + if ($request->hasFile('cover')) { - $post->cover_path = $request->file('cover')->store('news', 'uploads'); + $post->cover_path = app(MediaLibrary::class)->store($request->file('cover'), 'news', $user)->path; } if ($data['action'] === 'draft') { diff --git a/public/build/assets/Accordion-P-5h5nD1.js b/public/build/assets/Accordion-Cp213i2r.js similarity index 99% rename from public/build/assets/Accordion-P-5h5nD1.js rename to public/build/assets/Accordion-Cp213i2r.js index 03c4dd63..a8861b5b 100644 --- a/public/build/assets/Accordion-P-5h5nD1.js +++ b/public/build/assets/Accordion-Cp213i2r.js @@ -1 +1 @@ -import{d as e,n as t,r as n,s as r}from"./usePrimitiveElement-DC7UloPZ.js";import{D as i,E as a,Ht as o,J as s,On as c,Tn as l,_ as u,b as d,bt as f,ct as p,et as m,g as h,k as g,mt as _,o as v,qt as y,tr as b,tt as x,v as S,vn as C,wt as w,xt as T,y as E}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as D}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{b as O,d as k,p as A,v as j}from"./dist-DtGNiYlK.js";import{T as M}from"./AppIcon-0N56IC2z.js";import{C as N}from"./http-DmyDwIce.js";import{n as P,t as F}from"./isValueEqualOrExist-BmxVVt-T.js";var[I,L]=e(`CollapsibleRoot`),R=g({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=O(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=l(r);return L({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),A(),(e,t)=>(_(),S(c(k),{as:e.as,"as-child":r.asChild,"data-state":c(i)?`open`:`closed`,"data-disabled":c(a)?``:void 0},{default:y(()=>[T(e.$slots,`default`,{open:c(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),z=g({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:r}){let a=e,s=r,l=I();l.contentId||=n(void 0,`reka-collapsible-content`);let u=C(),{forwardRef:d,currentElement:f}=A(),g=C(0),v=C(0),b=h(()=>l.open.value),w=C(b.value),D=C();o(()=>[b.value,u.value?.present],async()=>{await x();let e=f.value;if(!e)return;D.value=D.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();v.value=t.height,g.value=t.width,w.value||(e.style.transitionDuration=D.value.transitionDuration,e.style.animationName=D.value.animationName)},{immediate:!0});let O=h(()=>w.value&&l.open.value);return p(()=>{requestAnimationFrame(()=>{w.value=!1})}),j(f,`beforematch`,e=>{requestAnimationFrame(()=>{l.onOpenToggle(),s(`contentFound`)})}),(e,n)=>(_(),S(c(t),{ref_key:`presentRef`,ref:u,present:e.forceMount||c(l).open.value,"force-mount":!0},{default:y(({present:t})=>[i(c(k),m(e.$attrs,{id:c(l).contentId,ref:c(d),"as-child":a.asChild,as:e.as,hidden:t?void 0:c(l).unmountOnHide.value?``:`until-found`,"data-state":O.value?void 0:c(l).open.value?`open`:`closed`,"data-disabled":c(l).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${v.value}px`,"--reka-collapsible-content-width":`${g.value}px`}}),{default:y(()=>[!c(l).unmountOnHide.value||t?T(e.$slots,`default`,{key:0}):E(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),B=g({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;A();let n=I();return(e,r)=>(_(),S(c(k),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":c(n).contentId,"aria-expanded":c(n).open.value,"data-state":c(n).open.value?`open`:`closed`,"data-disabled":c(n).disabled?.value?``:void 0,disabled:c(n).disabled?.value,onClick:c(n).onOpenToggle},{default:y(()=>[T(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function V({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function H({type:e,defaultValue:t,modelValue:n}){return e||V({type:e,defaultValue:t,modelValue:n})}function U({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function W(e,t){let n=h(()=>H(e)),r=O(e,`modelValue`,t,{defaultValue:U(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=P(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(F(t,e)){let n=t.findIndex(t=>P(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:h(()=>n.value===`single`)}}var[G,K]=e(`AccordionRoot`),q=g({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:`vertical`},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,i=t,{dir:a,disabled:o,unmountOnHide:s}=l(n),u=r(a),{modelValue:d,changeModelValue:f,isSingle:p}=W(n,i),{forwardRef:m,currentElement:h}=A();return K({disabled:o,direction:u,orientation:n.orientation,parentElement:h,isSingle:p,collapsible:n.collapsible,modelValue:d,changeModelValue:f,unmountOnHide:s}),(e,t)=>(_(),S(c(k),{ref:c(m),"as-child":e.asChild,as:e.as},{default:y(()=>[T(e.$slots,`default`,{modelValue:c(d)})]),_:3},8,[`as-child`,`as`]))}}),J=function(e){return e.Open=`open`,e.Closed=`closed`,e}(J||{}),[Y,X]=e(`AccordionItem`),Z=g({__name:`AccordionItem`,props:{disabled:{type:Boolean,required:!1},value:{type:String,required:!0},unmountOnHide:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=G(),i=h(()=>r.isSingle.value?n.value===r.modelValue.value:Array.isArray(r.modelValue.value)&&r.modelValue.value.includes(n.value)),a=h(()=>r.disabled.value||n.disabled),o=h(()=>a.value?``:void 0),s=h(()=>i.value?J.Open:J.Closed);t({open:i,dataDisabled:o});let{currentRef:l,currentElement:u}=A();X({open:i,dataState:s,disabled:a,dataDisabled:o,triggerId:``,currentRef:l,currentElement:u,value:h(()=>n.value)});function d(e){let t=e.target;if(Array.from(r.parentElement.value?.querySelectorAll(`[data-reka-collection-item]`)??[]).findIndex(e=>e===t)===-1)return null;M(e,t,r.parentElement.value,{arrowKeyOptions:r.orientation,dir:r.direction.value,focus:!0})}return(e,t)=>(_(),S(c(R),{"data-orientation":c(r).orientation,"data-disabled":o.value,"data-state":s.value,disabled:a.value,open:i.value,as:n.as,"as-child":n.asChild,"unmount-on-hide":n.unmountOnHide??c(r).unmountOnHide.value,onKeydown:D(d,[`up`,`down`,`left`,`right`,`home`,`end`])},{default:y(()=>[T(e.$slots,`default`,{open:i.value})]),_:3},8,[`data-orientation`,`data-disabled`,`data-state`,`disabled`,`open`,`as`,`as-child`,`unmount-on-hide`]))}}),Q=g({__name:`AccordionContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=G(),r=Y();return A(),(e,i)=>(_(),S(c(z),{role:`region`,"as-child":t.asChild,as:e.as,"force-mount":t.forceMount,"aria-labelledby":c(r).triggerId,"data-state":c(r).dataState.value,"data-disabled":c(r).dataDisabled.value,"data-orientation":c(n).orientation,style:{"--reka-accordion-content-width":`var(--reka-collapsible-content-width)`,"--reka-accordion-content-height":`var(--reka-collapsible-content-height)`},onContentFound:i[0]||=e=>c(n).changeModelValue(c(r).value.value)},{default:y(()=>[T(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`force-mount`,`aria-labelledby`,`data-state`,`data-disabled`,`data-orientation`]))}}),$=g({__name:`AccordionHeader`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h3`}},setup(e){let t=e,n=G(),r=Y();return A(),(e,i)=>(_(),S(c(k),{as:t.as,"as-child":t.asChild,"data-orientation":c(n).orientation,"data-state":c(r).dataState.value,"data-disabled":c(r).dataDisabled.value},{default:y(()=>[T(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-orientation`,`data-state`,`data-disabled`]))}}),ee=g({__name:`AccordionTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,r=G(),i=Y();i.triggerId||=n(void 0,`reka-accordion-trigger`);function a(){let e=r.isSingle.value&&i.open.value&&!r.collapsible;i.disabled.value||e||r.changeModelValue(i.value.value)}return(e,n)=>(_(),S(c(B),{id:c(i).triggerId,ref:c(i).currentRef,"data-reka-collection-item":``,as:t.as,"as-child":t.asChild,"aria-disabled":c(i).disabled.value||void 0,"aria-expanded":c(i).open.value||!1,"data-disabled":c(i).dataDisabled.value,"data-orientation":c(r).orientation,"data-state":c(i).dataState.value,disabled:c(i).disabled.value,onClick:a},{default:y(()=>[T(e.$slots,`default`)]),_:3},8,[`id`,`as`,`as-child`,`aria-disabled`,`aria-expanded`,`data-disabled`,`data-orientation`,`data-state`,`disabled`]))}}),te={class:`px-5 pt-1 pb-5`},ne={__name:`Accordion`,props:{block:{type:Object,required:!0}},setup(e){let t=e,n=s(`pagebuilder:list`),r=s(`pagebuilder:editing`,!1),o=h(()=>{let e=t.block.items[0]?.id;return t.block.data.multiple?t.block.data.first_open&&e?[e]:[]:t.block.data.first_open?e:void 0});return(t,s)=>(_(),S(c(q),{key:`${e.block.data.multiple}-${c(r)}`,type:e.block.data.multiple?`multiple`:`single`,"default-value":o.value,collapsible:``,class:`divide-y rounded-lg border bg-card`},{default:y(()=>[(_(!0),d(v,null,f(e.block.items,(e,t)=>(_(),S(c(Z),{key:e.id,value:e.id},{default:y(()=>[i(c($),{as:`h3`},{default:y(()=>[i(c(ee),{class:`group flex w-full items-center justify-between gap-4 px-5 py-4 text-left text-[15px] font-medium hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/30`},{default:y(()=>[a(b(e.title||`Abschnitt ${t+1}`)+` `,1),i(c(N),{class:`size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]),_:2},1024)]),_:2},1024),i(c(Q),{class:`overflow-hidden data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`},{default:y(()=>[u(`div`,te,[(_(),S(w(c(n)),{item:e},null,8,[`item`]))])]),_:2},1024)]),_:2},1032,[`value`]))),128))]),_:1},8,[`type`,`default-value`]))}};export{ne as default}; \ No newline at end of file +import{d as e,n as t,r as n,s as r}from"./usePrimitiveElement-DC7UloPZ.js";import{D as i,E as a,Ht as o,J as s,On as c,Tn as l,_ as u,b as d,bt as f,ct as p,et as m,g as h,k as g,mt as _,o as v,qt as y,tr as b,tt as x,v as S,vn as C,wt as w,xt as T,y as E}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as D}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{b as O,d as k,p as A,v as j}from"./dist-DtGNiYlK.js";import{T as M}from"./AppIcon-nlhvQfK7.js";import{w as N}from"./http-CAG9BrJF.js";import{n as P,t as F}from"./isValueEqualOrExist-BmxVVt-T.js";var[I,L]=e(`CollapsibleRoot`),R=g({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=O(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=l(r);return L({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),A(),(e,t)=>(_(),S(c(k),{as:e.as,"as-child":r.asChild,"data-state":c(i)?`open`:`closed`,"data-disabled":c(a)?``:void 0},{default:y(()=>[T(e.$slots,`default`,{open:c(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),z=g({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:r}){let a=e,s=r,l=I();l.contentId||=n(void 0,`reka-collapsible-content`);let u=C(),{forwardRef:d,currentElement:f}=A(),g=C(0),v=C(0),b=h(()=>l.open.value),w=C(b.value),D=C();o(()=>[b.value,u.value?.present],async()=>{await x();let e=f.value;if(!e)return;D.value=D.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();v.value=t.height,g.value=t.width,w.value||(e.style.transitionDuration=D.value.transitionDuration,e.style.animationName=D.value.animationName)},{immediate:!0});let O=h(()=>w.value&&l.open.value);return p(()=>{requestAnimationFrame(()=>{w.value=!1})}),j(f,`beforematch`,e=>{requestAnimationFrame(()=>{l.onOpenToggle(),s(`contentFound`)})}),(e,n)=>(_(),S(c(t),{ref_key:`presentRef`,ref:u,present:e.forceMount||c(l).open.value,"force-mount":!0},{default:y(({present:t})=>[i(c(k),m(e.$attrs,{id:c(l).contentId,ref:c(d),"as-child":a.asChild,as:e.as,hidden:t?void 0:c(l).unmountOnHide.value?``:`until-found`,"data-state":O.value?void 0:c(l).open.value?`open`:`closed`,"data-disabled":c(l).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${v.value}px`,"--reka-collapsible-content-width":`${g.value}px`}}),{default:y(()=>[!c(l).unmountOnHide.value||t?T(e.$slots,`default`,{key:0}):E(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),B=g({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;A();let n=I();return(e,r)=>(_(),S(c(k),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":c(n).contentId,"aria-expanded":c(n).open.value,"data-state":c(n).open.value?`open`:`closed`,"data-disabled":c(n).disabled?.value?``:void 0,disabled:c(n).disabled?.value,onClick:c(n).onOpenToggle},{default:y(()=>[T(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function V({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function H({type:e,defaultValue:t,modelValue:n}){return e||V({type:e,defaultValue:t,modelValue:n})}function U({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function W(e,t){let n=h(()=>H(e)),r=O(e,`modelValue`,t,{defaultValue:U(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=P(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(F(t,e)){let n=t.findIndex(t=>P(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:h(()=>n.value===`single`)}}var[G,K]=e(`AccordionRoot`),q=g({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:`vertical`},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,i=t,{dir:a,disabled:o,unmountOnHide:s}=l(n),u=r(a),{modelValue:d,changeModelValue:f,isSingle:p}=W(n,i),{forwardRef:m,currentElement:h}=A();return K({disabled:o,direction:u,orientation:n.orientation,parentElement:h,isSingle:p,collapsible:n.collapsible,modelValue:d,changeModelValue:f,unmountOnHide:s}),(e,t)=>(_(),S(c(k),{ref:c(m),"as-child":e.asChild,as:e.as},{default:y(()=>[T(e.$slots,`default`,{modelValue:c(d)})]),_:3},8,[`as-child`,`as`]))}}),J=function(e){return e.Open=`open`,e.Closed=`closed`,e}(J||{}),[Y,X]=e(`AccordionItem`),Z=g({__name:`AccordionItem`,props:{disabled:{type:Boolean,required:!1},value:{type:String,required:!0},unmountOnHide:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=G(),i=h(()=>r.isSingle.value?n.value===r.modelValue.value:Array.isArray(r.modelValue.value)&&r.modelValue.value.includes(n.value)),a=h(()=>r.disabled.value||n.disabled),o=h(()=>a.value?``:void 0),s=h(()=>i.value?J.Open:J.Closed);t({open:i,dataDisabled:o});let{currentRef:l,currentElement:u}=A();X({open:i,dataState:s,disabled:a,dataDisabled:o,triggerId:``,currentRef:l,currentElement:u,value:h(()=>n.value)});function d(e){let t=e.target;if(Array.from(r.parentElement.value?.querySelectorAll(`[data-reka-collection-item]`)??[]).findIndex(e=>e===t)===-1)return null;M(e,t,r.parentElement.value,{arrowKeyOptions:r.orientation,dir:r.direction.value,focus:!0})}return(e,t)=>(_(),S(c(R),{"data-orientation":c(r).orientation,"data-disabled":o.value,"data-state":s.value,disabled:a.value,open:i.value,as:n.as,"as-child":n.asChild,"unmount-on-hide":n.unmountOnHide??c(r).unmountOnHide.value,onKeydown:D(d,[`up`,`down`,`left`,`right`,`home`,`end`])},{default:y(()=>[T(e.$slots,`default`,{open:i.value})]),_:3},8,[`data-orientation`,`data-disabled`,`data-state`,`disabled`,`open`,`as`,`as-child`,`unmount-on-hide`]))}}),Q=g({__name:`AccordionContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=G(),r=Y();return A(),(e,i)=>(_(),S(c(z),{role:`region`,"as-child":t.asChild,as:e.as,"force-mount":t.forceMount,"aria-labelledby":c(r).triggerId,"data-state":c(r).dataState.value,"data-disabled":c(r).dataDisabled.value,"data-orientation":c(n).orientation,style:{"--reka-accordion-content-width":`var(--reka-collapsible-content-width)`,"--reka-accordion-content-height":`var(--reka-collapsible-content-height)`},onContentFound:i[0]||=e=>c(n).changeModelValue(c(r).value.value)},{default:y(()=>[T(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`force-mount`,`aria-labelledby`,`data-state`,`data-disabled`,`data-orientation`]))}}),$=g({__name:`AccordionHeader`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h3`}},setup(e){let t=e,n=G(),r=Y();return A(),(e,i)=>(_(),S(c(k),{as:t.as,"as-child":t.asChild,"data-orientation":c(n).orientation,"data-state":c(r).dataState.value,"data-disabled":c(r).dataDisabled.value},{default:y(()=>[T(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-orientation`,`data-state`,`data-disabled`]))}}),ee=g({__name:`AccordionTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,r=G(),i=Y();i.triggerId||=n(void 0,`reka-accordion-trigger`);function a(){let e=r.isSingle.value&&i.open.value&&!r.collapsible;i.disabled.value||e||r.changeModelValue(i.value.value)}return(e,n)=>(_(),S(c(B),{id:c(i).triggerId,ref:c(i).currentRef,"data-reka-collection-item":``,as:t.as,"as-child":t.asChild,"aria-disabled":c(i).disabled.value||void 0,"aria-expanded":c(i).open.value||!1,"data-disabled":c(i).dataDisabled.value,"data-orientation":c(r).orientation,"data-state":c(i).dataState.value,disabled:c(i).disabled.value,onClick:a},{default:y(()=>[T(e.$slots,`default`)]),_:3},8,[`id`,`as`,`as-child`,`aria-disabled`,`aria-expanded`,`data-disabled`,`data-orientation`,`data-state`,`disabled`]))}}),te={class:`px-5 pt-1 pb-5`},ne={__name:`Accordion`,props:{block:{type:Object,required:!0}},setup(e){let t=e,n=s(`pagebuilder:list`),r=s(`pagebuilder:editing`,!1),o=h(()=>{let e=t.block.items[0]?.id;return t.block.data.multiple?t.block.data.first_open&&e?[e]:[]:t.block.data.first_open?e:void 0});return(t,s)=>(_(),S(c(q),{key:`${e.block.data.multiple}-${c(r)}`,type:e.block.data.multiple?`multiple`:`single`,"default-value":o.value,collapsible:``,class:`divide-y rounded-lg border bg-card`},{default:y(()=>[(_(!0),d(v,null,f(e.block.items,(e,t)=>(_(),S(c(Z),{key:e.id,value:e.id},{default:y(()=>[i(c($),{as:`h3`},{default:y(()=>[i(c(ee),{class:`group flex w-full items-center justify-between gap-4 px-5 py-4 text-left text-[15px] font-medium hover:bg-accent/60 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/30`},{default:y(()=>[a(b(e.title||`Abschnitt ${t+1}`)+` `,1),i(c(N),{class:`size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]),_:2},1024)]),_:2},1024),i(c(Q),{class:`overflow-hidden data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`},{default:y(()=>[u(`div`,te,[(_(),S(w(c(n)),{item:e},null,8,[`item`]))])]),_:2},1024)]),_:2},1032,[`value`]))),128))]),_:1},8,[`type`,`default-value`]))}};export{ne as default}; \ No newline at end of file diff --git a/public/build/assets/AppIcon-0N56IC2z.js b/public/build/assets/AppIcon-0N56IC2z.js deleted file mode 100644 index 58ec4503..00000000 --- a/public/build/assets/AppIcon-0N56IC2z.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e,d as t,i as n,n as r,o as i,r as a,s as o,u as s}from"./usePrimitiveElement-DC7UloPZ.js";import{$n as c,D as l,E as u,Ht as d,On as f,Q as p,Tn as m,Ut as h,Yt as g,Zn as _,_ as v,b as y,ct as b,et as x,ft as ee,g as S,k as C,mt as w,qt as T,tr as te,tt as E,un as ne,v as D,vn as O,wt as re,xn as k,xt as A,y as j,z as M}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as ie,S as N,w as P}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{s as ae}from"./app-Bu3kn8yd.js";import{C as F,E as oe,S as se,b as I,d as L,k as R,l as z,p as B,s as V,v as ce}from"./dist-DtGNiYlK.js";import{c as le,l as ue,o as de,s as fe,t as pe}from"./RovingFocusGroup-D88K7krN.js";import{_ as me,b as he,c as ge,d as H,f as U,g as W,h as _e,l as ve,m as ye,p as be,s as xe,u as Se,x as Ce,y as we}from"./http-DmyDwIce.js";var Te=R({name:`accessibility`,size:24,node:[[`circle`,{cx:`16`,cy:`4`,r:`1`,key:`1grugj`}],[`path`,{d:`m18 19 1-7-6 1`,key:`r0i19z`}],[`path`,{d:`m5 8 3-3 5.5 3-2.36 3.5`,key:`9ptxx2`}],[`path`,{d:`M4.24 14.5a5 5 0 0 0 6.88 6`,key:`10kmtu`}],[`path`,{d:`M13.76 17.5a5 5 0 0 0-6.88-6`,key:`2qq6rc`}]]}),Ee=R({name:`baby`,size:24,node:[[`path`,{d:`M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5`,key:`1u7htd`}],[`path`,{d:`M15 12h.01`,key:`1k8ypt`}],[`path`,{d:`M19.38 6.813A9 9 0 0 1 20.8 10.2a2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1`,key:`11xh7x`}],[`path`,{d:`M9 12h.01`,key:`157uk2`}]]}),De=R({name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]}),Oe=R({name:`bike`,size:24,node:[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]}),ke=R({name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]}),Ae=R({name:`briefcase`,size:24,node:[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]}),je=R({name:`bus`,size:24,node:[[`path`,{d:`M8 6v6`,key:`18i7km`}],[`path`,{d:`M15 6v6`,key:`1sg6z9`}],[`path`,{d:`M2 12h19.6`,key:`de5uta`}],[`path`,{d:`M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3`,key:`1wwztk`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}],[`path`,{d:`M9 18h5`,key:`lrx6i`}],[`circle`,{cx:`16`,cy:`18`,r:`2`,key:`1v4tcr`}]]}),Me=R({name:`cake`,size:24,node:[[`path`,{d:`M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8`,key:`1w3rig`}],[`path`,{d:`M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1`,key:`n2jgmb`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}],[`path`,{d:`M7 8v3`,key:`1qtyvj`}],[`path`,{d:`M12 8v3`,key:`hwp4zt`}],[`path`,{d:`M17 8v3`,key:`1i6e5u`}],[`path`,{d:`M7 4h.01`,key:`1bh4kh`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M17 4h.01`,key:`1upcoc`}]]}),Ne=R({name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]}),Pe=R({name:`car`,size:24,node:[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]}),Fe=R({name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]}),Ie=R({name:`church`,size:24,node:[[`path`,{d:`M10 9h4`,key:`u4k05v`}],[`path`,{d:`M12 7v5`,key:`ma6bk`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`m18 9 3.52 2.147a1 1 0 0 1 .48.854V19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-6.999a1 1 0 0 1 .48-.854L6 9`,key:`flvdwo`}],[`path`,{d:`M6 21V7a1 1 0 0 1 .376-.782l5-3.999a1 1 0 0 1 1.249.001l5 4A1 1 0 0 1 18 7v14`,key:`a5i0n2`}]]}),Le=R({name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]}),Re=R({name:`clipboard-list`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]}),ze=R({name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]}),Be=R({name:`coffee`,size:24,node:[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]}),Ve=R({name:`euro`,size:24,node:[[`path`,{d:`M4 10h12`,key:`1y6xl8`}],[`path`,{d:`M4 14h9`,key:`1loblj`}],[`path`,{d:`M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2`,key:`1j6lzo`}]]}),He=R({name:`file-down`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]}),Ue=R({name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]}),We=R({name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]}),Ge=R({name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]}),Ke=R({name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]}),qe=R({name:`graduation-cap`,size:24,node:[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]}),Je=R({name:`hammer`,size:24,node:[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]}),Ye=R({name:`handshake`,size:24,node:[[`path`,{d:`m11 17 2 2a1 1 0 1 0 3-3`,key:`efffak`}],[`path`,{d:`m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4`,key:`9pr0kb`}],[`path`,{d:`m21 3 1 11h-2`,key:`1tisrp`}],[`path`,{d:`M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3`,key:`1uvwmv`}],[`path`,{d:`M3 4h8`,key:`1ep09j`}]]}),Xe=R({name:`headset`,size:24,node:[[`path`,{d:`M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z`,key:`12oyoe`}],[`path`,{d:`M21 16v2a4 4 0 0 1-4 4h-5`,key:`1x7m43`}]]}),Ze=R({name:`heart-handshake`,size:24,node:[[`path`,{d:`M19.414 14.414C21 12.828 22 11.5 22 9.5a5.5 5.5 0 0 0-9.591-3.676.6.6 0 0 1-.818.001A5.5 5.5 0 0 0 2 9.5c0 2.3 1.5 4 3 5.5l5.535 5.362a2 2 0 0 0 2.879.052 2.12 2.12 0 0 0-.004-3 2.124 2.124 0 1 0 3-3 2.124 2.124 0 0 0 3.004 0 2 2 0 0 0 0-2.828l-1.881-1.882a2.41 2.41 0 0 0-3.409 0l-1.71 1.71a2 2 0 0 1-2.828 0 2 2 0 0 1 0-2.828l2.823-2.762`,key:`17lmqv`}]]}),Qe=R({name:`heart`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]}),$e=R({name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]}),et=R({name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]}),tt=R({name:`landmark`,size:24,node:[[`path`,{d:`M10 18v-7`,key:`wt116b`}],[`path`,{d:`M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z`,key:`yxxwt6`}],[`path`,{d:`M14 18v-7`,key:`vav6t3`}],[`path`,{d:`M18 18v-7`,key:`aexdmj`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M6 18v-7`,key:`1ivflk`}]]}),nt=R({name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]}),rt=R({name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]}),it=R({name:`leaf`,size:24,node:[[`path`,{d:`M11 20a10 10 0 0010-10 25.9 25.9 0 00-1.04-7.281 1 1 0 00-1.755-.325C15.833 5.5 13 5.5 9.8 6.1A7 7 0 0011 20`,key:`1wjnjv`}],[`path`,{d:`M2 21a5 5 0 012.911-4.544C7.613 15.212 8.351 15.24 11 13`,key:`c1ejpn`}]]}),at=R({name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]}),ot=R({name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]}),st=R({name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]}),ct=R({name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]}),G=R({name:`megaphone`,size:24,node:[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]}),lt=R({name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]}),ut=R({name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]}),dt=R({name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]}),ft=R({name:`newspaper`,size:24,node:[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]}),pt=R({name:`plane`,size:24,node:[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]}),mt=R({name:`printer`,size:24,node:[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]}),ht=R({name:`receipt`,size:24,node:[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]}),gt=R({name:`scale`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]}),_t=R({name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]}),vt=R({name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]}),yt=R({name:`shopping-cart`,size:24,node:[[`path`,{d:`m2.05 2.05 1.099-.028a1 1 0 0 1 1.008.815l2.69 14.347A1 1 0 0 0 7.83 18H18`,key:`uebgi3`}],[`path`,{d:`M4.563 5h16.435a1 1 0 0 1 .981 1.204l-1.026 6.226A2 2 0 0 1 18.962 14H6.25`,key:`1j7c9p`}],[`circle`,{cx:`18`,cy:`20`,r:`2`,key:`t9985n`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]}),bt=R({name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]}),xt=R({name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]}),St=R({name:`stethoscope`,size:24,node:[[`path`,{d:`M11 2v2`,key:`1539x4`}],[`path`,{d:`M5 2v2`,key:`1yf1q8`}],[`path`,{d:`M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1`,key:`rb5t3r`}],[`path`,{d:`M8 15a6 6 0 0 0 12 0v-3`,key:`x18d4x`}],[`circle`,{cx:`20`,cy:`10`,r:`2`,key:`ts1r5v`}]]}),Ct=R({name:`trophy`,size:24,node:[[`path`,{d:`M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2`,key:`pwuv1l`}],[`path`,{d:`M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2`,key:`1y54w1`}],[`path`,{d:`M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3`,key:`e30mpu`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3`,key:`i0yafy`}]]}),wt=R({name:`truck`,size:24,node:[[`path`,{d:`M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2`,key:`wrbu53`}],[`path`,{d:`M15 18H9`,key:`1lyqi6`}],[`path`,{d:`M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14`,key:`lysw3i`}],[`circle`,{cx:`17`,cy:`18`,r:`2`,key:`332jqn`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}]]}),Tt=R({name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]}),Et=R({name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]}),Dt=R({name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]}),Ot=R({name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]}),kt=R({name:`utensils`,size:24,node:[[`path`,{d:`M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2`,key:`cjf0a3`}],[`path`,{d:`M7 2v20`,key:`1473qp`}],[`path`,{d:`M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7`,key:`j28e5`}]],aliases:[`fork-knife`]}),At=R({name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]}),jt=R({name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]}),Mt=[`INPUT`,`TEXTAREA`];function K(e,t,n,r={}){if(!t||r.enableIgnoredElement&&Mt.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-reka-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=Nt(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function Nt(e,t,n,r=e.includes(t)?e.length:e.length+1){if(--r===0)return null;let i=e.indexOf(t),a;if(a=i===-1?n.goForward?0:e.length-1:n.goForward?i+1:i-1,!n.loop&&(a<0||a>=e.length))return null;let o=e[(a+e.length)%e.length];return o?o.hasAttribute(`disabled`)&&o.getAttribute(`disabled`)!==`false`?Nt(e,o,n,r):o:null}function Pt(e){let t=oe(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(t.value+=n,e)e(n);else{let e=s(),n=r.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),i=n.find(t=>t.ref===e),a=It(n.map(e=>e.textValue),t.value,i?.textValue),o=n.find(e=>e.textValue===a);return o&&o.ref.focus(),o?.ref}},resetTypeahead:()=>{t.value=``}}}function Ft(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function It(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ft(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}var[q,Lt]=t(`DialogRoot`),Rt=C({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=I(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=O(),a=O(),{modal:o,unmountOnHide:s}=m(n);return Lt({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>A(e.$slots,`default`,{open:f(r),close:()=>r.value=!1})}}),zt=C({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;B();let n=q();return(e,r)=>(w(),D(f(L),x(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>f(n).onOpenChange(!1)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`type`]))}}),Bt=`menu.itemSelect`,J=[`Enter`,` `],Vt=[`ArrowDown`,`PageUp`,`Home`],Ht=[`ArrowUp`,`PageDown`,`End`],Ut=[...Vt,...Ht];[...J],[...J];function Wt(e){return e?`open`:`closed`}function Gt(e){return e===`indeterminate`}function Kt(e){return Gt(e)?`indeterminate`:e?`checked`:`unchecked`}function qt(e){let t=s();for(let n of e)if(n===t||(n.focus(),s()!==t))return}function Jt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Yt(e,t){return t?Jt({x:e.clientX,y:e.clientY},t):!1}function Y(e){return e.pointerType===`mouse`}var Xt=C({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=q(),{forwardRef:o,currentElement:c}=B();return i.titleId||=a(void 0,`reka-dialog-title`),i.descriptionId||=a(void 0,`reka-dialog-description`),b(()=>{i.contentElement=c,s()!==document.body&&(i.triggerElement.value=s())}),(e,t)=>(w(),D(f(U),{"as-child":``,loop:``,trapped:n.trapFocus,present:n.present,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:T(()=>[l(f(be),x({id:f(i).contentId,ref:f(o),as:e.as,"as-child":e.asChild,present:n.present,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":f(i).descriptionId,"aria-labelledby":f(i).titleId,"data-state":f(Wt)(f(i).open.value)},e.$attrs,{onDismiss:t[0]||=e=>f(i).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>r(`focusOutside`,e),onInteractOutside:t[3]||=e=>r(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>r(`pointerDownOutside`,e)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),Zt=C({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,a=q(),o=i(r),{forwardRef:s,currentElement:c}=B(),l=S(()=>n.present?c.value:void 0);ye(l);let u=S(()=>{let{present:e,...t}=n;return t});return d(()=>n.present,(e,t)=>{!e&&t&&a.triggerElement.value?.focus()}),(e,t)=>(w(),D(Xt,x({...u.value,...f(o)},{ref:f(s),present:e.present,"trap-focus":f(a).open.value,"disable-outside-pointer-events":n.disableOutsidePointerEvents,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),f(a).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),Qt=C({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=i(t);B();let a=q(),o=O(!1),s=O(!1),c=S(()=>{let{present:e,...t}=n;return t});return d(()=>n.present,(e,t)=>{!e&&t&&(o.value||a.triggerElement.value?.focus(),o.value=!1,s.value=!1)}),(e,t)=>(w(),D(Xt,x({...c.value,...f(r)},{present:e.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(o.value||f(a).triggerElement.value?.focus(),e.preventDefault()),o.value=!1,s.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(o.value=!0,e.detail.originalEvent.type===`pointerdown`&&(s.value=!0));let t=e.target;f(a).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&s.value&&e.preventDefault()}}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`present`]))}}),$t=C({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,a=t,o=q(),s=i(a),{forwardRef:c}=B(),l=S(()=>n.forceMount||!o.unmountOnHide.value);return(e,t)=>(w(),D(f(r),{present:f(o).open.value,"force-mount":l.value},{default:T(({present:t})=>[f(o).modal.value?g((w(),D(Zt,x({key:0,ref:f(c),present:!l.value||t},{...n,...f(s),...e.$attrs}),{default:T(()=>[A(e.$slots,`default`)]),_:2},1040,[`present`])),[[N,e.forceMount||f(o).unmountOnHide.value||t]]):g((w(),D(Qt,x({key:1,ref:f(c),present:!l.value||t},{...n,...f(s),...e.$attrs}),{default:T(()=>[A(e.$slots,`default`)]),_:2},1040,[`present`])),[[N,e.forceMount||f(o).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),en=C({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(e){let t=e,n=q(),r=W(t.present);return d(()=>t.present,e=>r.value=e),B(),(e,t)=>(w(),D(f(L),{as:e.as,"as-child":e.asChild,"data-state":f(n).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=P(()=>{},[`left`,`self`,`prevent`])},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),tn=C({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=q(),{forwardRef:i}=B(),a=S(()=>t.forceMount||!n.unmountOnHide.value);return(e,t)=>f(n)?.modal.value?(w(),D(f(r),{key:0,present:f(n).open.value,"force-mount":a.value},{default:T(({present:t})=>[g(l(en,x(e.$attrs,{ref:f(i),as:e.as,"as-child":e.asChild,present:!a.value||t}),{default:T(()=>[A(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[N,e.forceMount||f(n).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`])):j(`v-if`,!0)}}),nn=C({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(w(),D(f(H),c(M(t)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),rn=C({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=q();return B(),(e,r)=>(w(),D(f(L),x(t,{id:f(n).titleId}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`id`]))}}),[an,on]=t(`AvatarRoot`),sn=C({__name:`AvatarRoot`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return B(),on({imageLoadingStatus:O(`idle`)}),(e,t)=>(w(),D(f(L),{"as-child":e.asChild,as:e.as},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),cn=C({__name:`AvatarFallback`,props:{delayMs:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=an();B();let r=O(t.delayMs===void 0);return h(e=>{if(t.delayMs&&F){let n=window.setTimeout(()=>{r.value=!0},t.delayMs);e(()=>{window.clearTimeout(n)})}}),(e,t)=>r.value&&f(n).imageLoadingStatus.value!==`loaded`?(w(),D(f(L),{key:0,"as-child":e.asChild,as:e.as},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`as-child`,`as`])):j(`v-if`,!0)}});function ln(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?`loaded`:`loading`):`error`:`idle`}function un(e,{referrerPolicy:t,crossOrigin:n}={}){let r=O(!1),i=O(null),a=S(()=>r.value?(!i.value&&F&&(i.value=new window.Image),i.value):null),o=O(ln(a.value,e.value)),s=e=>()=>{r.value&&(o.value=e)};return b(()=>{r.value=!0,h(r=>{let i=a.value;if(!i)return;o.value=ln(i,e.value);let c=s(`loaded`),l=s(`error`);i.addEventListener(`load`,c),i.addEventListener(`error`,l),t?.value&&(i.referrerPolicy=t.value),typeof n?.value==`string`&&(i.crossOrigin=n.value),r(()=>{i.removeEventListener(`load`,c),i.removeEventListener(`error`,l)})})}),ee(()=>{r.value=!1}),o}var dn=C({__name:`AvatarImage`,props:{src:{type:String,required:!0},referrerPolicy:{type:null,required:!1},crossOrigin:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`img`}},emits:[`loadingStatusChange`],setup(e,{emit:t}){let n=e,r=t,{src:i,referrerPolicy:a,crossOrigin:o}=m(n);B();let s=an(),c=un(i,{referrerPolicy:a,crossOrigin:o});return d(c,e=>{r(`loadingStatusChange`,e),e!==`idle`&&(s.imageLoadingStatus.value=e)},{immediate:!0}),(e,t)=>g((w(),D(f(L),{role:`img`,"as-child":e.asChild,as:e.as,src:f(i),referrerpolicy:f(a),crossorigin:f(o)},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`src`,`referrerpolicy`,`crossorigin`])),[[N,f(c)===`loaded`]])}}),fn=C({__name:`MenuAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(w(),D(f(ve),c(M(t)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}});function pn(){let e=O(!1);return b(()=>{ce(`keydown`,()=>{e.value=!0},{capture:!0,passive:!0}),ce([`pointerdown`,`pointermove`],()=>{e.value=!1},{capture:!0,passive:!0})}),e}var mn=se(pn),[X,hn]=t([`MenuRoot`,`MenuSub`],`MenuContext`),[Z,gn]=t(`MenuRoot`),_n=C({__name:`MenuRoot`,props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i,dir:a}=m(n),s=o(a),c=I(n,`open`,r),l=O(),u=mn();return hn({open:c,onOpenChange:e=>{c.value=e},content:l,onContentChange:e=>{l.value=e}}),gn({onClose:()=>{c.value=!1},isUsingKeyboardRef:u,dir:s,modal:i}),(e,t)=>(w(),D(f(Se),null,{default:T(()=>[A(e.$slots,`default`)]),_:3}))}}),[vn,yn]=t(`MenuContent`),bn=C({__name:`MenuContentImpl`,props:p({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...xe}),emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,i=X(),a=Z(),{trapFocus:o,disableOutsidePointerEvents:c,loop:u}=m(n);_e(),W(c.value);let p=O(``),h=O(0),g=O(0),_=O(null),v=O(`right`),y=O(0),b=O(null),x=O(),{forwardRef:S,currentElement:C}=B(),{handleTypeaheadSearch:te}=Pt(),E=O();function ne(e){let t=K(e,E.value||s(),C.value,{loop:u.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!1,attributeName:`[data-reka-collection-item]:not([data-disabled])`});t&&(E.value=t,t.scrollIntoView({block:`nearest`}))}function re(){E.value&&E.value.click()}let k=O(),j=O();d(E,e=>{if(j.value&&(e===void 0||e!==j.value.trigger.value)){if(e===void 0)return;j.value.onOpenChange(!1),j.value=void 0}}),d(C,e=>{i.onContentChange(e)}),ee(()=>{window.clearTimeout(h.value)});function M(e){return v.value===_.value?.side&&Yt(e,_.value?.area)}async function ie(e){r(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),C.value?.focus({preventScroll:!0}))}function N(e){if(e.defaultPrevented)return;let t=e.target,n=t.closest(`[data-reka-menu-content]`)===e.currentTarget,r=[`input`,`textarea`].includes(t.tagName.toLowerCase()),i=e.ctrlKey||e.altKey||e.metaKey,o=e.key.length===1,c=K(e,s(),C.value,{loop:u.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!0,attributeName:`[data-reka-collection-item]:not([data-disabled])`});if(c)return c?.focus();if(e.code===`Space`)return;let l=x.value?.getItems()??[];if(n&&(e.key===`Tab`&&a.modal.value&&e.preventDefault(),!i&&o&&!r&&te(e.key,l)),e.target!==C.value||!Ut.includes(e.key))return;e.preventDefault();let d=[...l.map(e=>e.ref)];Ht.includes(e.key)&&d.reverse(),qt(d)}function P(e){e?.currentTarget?.contains?.(e.target)||(window.clearTimeout(h.value),p.value=``)}function ae(e){if(!Y(e))return;let t=e.target,n=y.value!==e.clientX;if((e?.currentTarget)?.contains(t)&&n){let t=e.clientX>y.value?`right`:`left`;v.value=t,y.value=e.clientX}}function F(e){Y(e)&&k.value&&k.value.focus()}return yn({onItemEnter:e=>!!M(e),onItemLeave:e=>M(e)?!0:([`INPUT`,`TEXTAREA`].includes(s()?.tagName||``)||C.value?.focus(),b.value=null,!1),onTriggerLeave:e=>!!M(e),searchRef:p,highlightedElement:E,onKeydownNavigation:ne,onKeydownEnter:re,filterElement:k,onFilterElementChange:e=>{k.value=e},activeSubmenuContext:j,pointerGraceTimerRef:g,onPointerGraceIntentChange:e=>{_.value=e}}),(e,t)=>(w(),D(f(U),{"as-child":``,trapped:f(o),onMountAutoFocus:ie,onUnmountAutoFocus:t[7]||=e=>r(`closeAutoFocus`,e)},{default:T(()=>[l(f(be),{"as-child":``,"disable-outside-pointer-events":f(c),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[3]||=e=>r(`pointerDownOutside`,e),onFocusOutside:t[4]||=e=>r(`focusOutside`,e),onInteractOutside:t[5]||=e=>r(`interactOutside`,e),onDismiss:t[6]||=e=>r(`dismiss`)},{default:T(()=>[l(f(pe),{ref_key:`rovingFocusGroupRef`,ref:x,"current-tab-stop-id":b.value,"onUpdate:currentTabStopId":t[0]||=e=>b.value=e,"as-child":``,orientation:`vertical`,dir:f(a).dir.value,loop:f(u),onEntryFocus:t[1]||=e=>{r(`entryFocus`,e),f(a).isUsingKeyboardRef.value||e.preventDefault()}},{default:T(()=>[l(f(ge),{ref:f(S),role:`menu`,as:e.as,"as-child":e.asChild,"aria-orientation":`vertical`,"data-reka-menu-content":``,"data-state":f(Wt)(f(i).open.value),dir:f(a).dir.value,side:e.side,"side-offset":e.sideOffset,align:e.align,"align-offset":e.alignOffset,"avoid-collisions":e.avoidCollisions,"collision-boundary":e.collisionBoundary,"collision-padding":e.collisionPadding,"arrow-padding":e.arrowPadding,"prioritize-position":e.prioritizePosition,"position-strategy":e.positionStrategy,"update-position-strategy":e.updatePositionStrategy,sticky:e.sticky,"hide-when-detached":e.hideWhenDetached,reference:e.reference,onKeydown:N,onBlur:P,onPointermove:ae,onPointerenter:F},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`,`dir`,`side`,`side-offset`,`align`,`align-offset`,`avoid-collisions`,`collision-boundary`,`collision-padding`,`arrow-padding`,`prioritize-position`,`position-strategy`,`update-position-strategy`,`sticky`,`hide-when-detached`,`reference`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),xn=C({inheritAttrs:!1,__name:`MenuItemImpl`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=vn(),{forwardRef:r,currentElement:i}=B(),{CollectionItem:a}=de(),o=O(!1),c=S(()=>o.value||i.value!=null&&n.highlightedElement.value===i.value);async function u(e){if(!e.defaultPrevented&&Y(e)){if(t.disabled)n.onItemLeave(e);else if(!n.onItemEnter(e)){let t=e.currentTarget;n.highlightedElement.value=t,[`INPUT`,`TEXTAREA`].includes(s()?.tagName||``)||t.focus({preventScroll:!0})}}}async function d(e){await E(),!e.defaultPrevented&&Y(e)&&n.highlightedElement.value===i.value&&!n.onItemLeave(e)&&n.highlightedElement.value===i.value&&(n.highlightedElement.value=void 0)}return(e,t)=>(w(),D(f(a),{value:{textValue:e.textValue}},{default:T(()=>[l(f(L),x({ref:f(r),role:`menuitem`,tabindex:`-1`},e.$attrs,{as:e.as,"as-child":e.asChild,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-highlighted":c.value?``:void 0,onPointermove:u,onPointerleave:d,onFocus:t[0]||=async t=>{let r=t.currentTarget;await E(),!(t.defaultPrevented||e.disabled)&&(o.value=!0,f(n).highlightedElement.value=r)},onBlur:t[1]||=async e=>{await E(),!e.defaultPrevented&&(o.value=!1)}}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`aria-disabled`,`data-disabled`,`data-highlighted`])]),_:3},8,[`value`]))}}),Sn=C({__name:`MenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=B(),o=Z(),s=vn(),c=O(!1);async function l(){let e=a.value;if(!n.disabled&&e){let e=new CustomEvent(Bt,{bubbles:!0,cancelable:!0});r(`select`,e),await E(),e.defaultPrevented?c.value=!1:o.onClose()}}return(e,t)=>(w(),D(xn,x(n,{ref:f(i),onClick:l,onPointerdown:t[0]||=()=>{c.value=!0},onPointerup:t[1]||=async e=>{await E(),!e.defaultPrevented&&(c.value||e.currentTarget?.click())},onKeydown:t[2]||=async t=>{let n=f(s).searchRef.value!==``;e.disabled||n&&t.key===` `||f(J).includes(t.key)&&(t.currentTarget?.click(),t.preventDefault())}}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),Cn=C({__name:`MenuRootContentModal`,props:{loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let r=e,i=t,a=n(r,i),o=X(),{forwardRef:s,currentElement:c}=B();return ye(c),(e,t)=>(w(),D(bn,x(f(a),{ref:f(s),"trap-focus":f(o).open.value,"disable-outside-pointer-events":f(o).open.value,"disable-outside-scroll":!0,onDismiss:t[0]||=e=>f(o).onOpenChange(!1),onFocusOutside:t[1]||=P(e=>i(`focusOutside`,e),[`prevent`])}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`]))}}),wn=C({__name:`MenuRootContentNonModal`,props:{loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let r=n(e,t),i=X();return(e,t)=>(w(),D(bn,x(f(r),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:t[0]||=e=>f(i).onOpenChange(!1)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),Tn=C({__name:`MenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let i=n(e,t),a=X(),o=Z();return(e,t)=>(w(),D(f(r),{present:e.forceMount||f(a).open.value},{default:T(()=>[f(o).modal.value?(w(),D(Cn,c(x({key:0},{...e.$attrs,...f(i)})),{default:T(()=>[A(e.$slots,`default`)]),_:3},16)):(w(),D(wn,c(x({key:1},{...e.$attrs,...f(i)})),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),En=C({__name:`MenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(w(),D(f(H),c(M(t)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),Dn=C({__name:`MenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(w(),D(f(L),x(t,{role:`separator`,"aria-orientation":`horizontal`}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),[On,kn]=t(`DropdownMenuRoot`),An=C({__name:`DropdownMenuRoot`,props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;B();let i=I(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),a=O(),{modal:s,dir:c}=m(n),l=o(c);return kn({open:i,onOpenChange:e=>{i.value=e},onOpenToggle:()=>{i.value=!i.value},triggerId:``,triggerElement:a,contentId:``,modal:s,dir:l}),(e,t)=>(w(),D(f(_n),{open:f(i),"onUpdate:open":t[0]||=e=>ne(i)?i.value=e:null,dir:f(l),modal:f(s)},{default:T(()=>[A(e.$slots,`default`,{open:f(i)})]),_:3},8,[`open`,`dir`,`modal`]))}}),jn=C({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let r=n(e,t);B();let i=On(),o=O(!1);function s(e){e.defaultPrevented||(o.value||setTimeout(()=>{i.triggerElement.value?.focus()},0),o.value=!1,e.preventDefault())}return i.contentId||=a(void 0,`reka-dropdown-menu-content`),(e,t)=>(w(),D(f(Tn),x(f(r),{id:f(i).contentId,"aria-labelledby":f(i)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-dropdown-menu-content-available-width":`var(--reka-popper-available-width)`,"--reka-dropdown-menu-content-available-height":`var(--reka-popper-available-height)`,"--reka-dropdown-menu-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-dropdown-menu-trigger-height":`var(--reka-popper-anchor-height)`},onCloseAutoFocus:s,onInteractOutside:t[0]||=e=>{if(e.defaultPrevented)return;let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!f(i).modal.value||r)&&(o.value=!0),f(i).triggerElement.value?.contains(e.target)&&e.preventDefault()}}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`]))}}),Mn=C({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=i(t);return B(),(e,t)=>(w(),D(f(Sn),c(M({...n,...f(r)})),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),Nn=C({__name:`DropdownMenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(w(),D(f(En),c(M(t)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),Pn=C({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return B(),(e,n)=>(w(),D(f(Dn),c(M(t)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),Fn=C({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=On(),{forwardRef:r,currentElement:i}=B();return b(()=>{n.triggerElement=i}),n.triggerId||=a(void 0,`reka-dropdown-menu-trigger`),(e,i)=>(w(),D(f(fn),{"as-child":``},{default:T(()=>[l(f(L),{id:f(n).triggerId,ref:f(r),type:e.as===`button`?`button`:void 0,"as-child":t.asChild,as:e.as,"aria-haspopup":`menu`,"aria-expanded":f(n).open.value,"aria-controls":f(n).open.value?f(n).contentId:void 0,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,"data-state":f(n).open.value?`open`:`closed`,onClick:i[0]||=async t=>{!e.disabled&&t.button===0&&t.ctrlKey===!1&&(f(n)?.onOpenToggle(),await E(),f(n).open.value&&t.preventDefault())},onKeydown:i[1]||=ie(t=>{e.disabled||([`Enter`,` `].includes(t.key)&&f(n).onOpenToggle(),t.key===`ArrowDown`&&f(n).onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(t.key)&&t.preventDefault())},[`enter`,`space`,`arrow-down`])},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as-child`,`as`,`aria-expanded`,`aria-controls`,`data-disabled`,`disabled`,`data-state`])]),_:3}))}}),In=C({__name:`Avatar`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(w(),D(f(sn),{"data-slot":`avatar`,class:_(f(z)(`relative flex size-8 shrink-0 overflow-hidden rounded-full`,t.class))},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`class`]))}}),Ln=C({__name:`AvatarFallback`,props:{delayMs:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=V(t,`class`);return(e,r)=>(w(),D(f(cn),x({"data-slot":`avatar-fallback`},f(n),{class:f(z)(`bg-muted flex size-full items-center justify-center rounded-full`,t.class)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`class`]))}}),Rn=C({__name:`AvatarImage`,props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(w(),D(f(dn),x({"data-slot":`avatar-image`},t,{class:`aspect-square size-full`}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),zn=[{soft:`bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200`,bar:`bg-sky-500`,text:`text-sky-700 dark:text-sky-300`},{soft:`bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200`,bar:`bg-emerald-500`,text:`text-emerald-700 dark:text-emerald-300`},{soft:`bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-200`,bar:`bg-amber-500`,text:`text-amber-700 dark:text-amber-300`},{soft:`bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200`,bar:`bg-rose-500`,text:`text-rose-700 dark:text-rose-300`},{soft:`bg-violet-100 text-violet-800 dark:bg-violet-950 dark:text-violet-200`,bar:`bg-violet-500`,text:`text-violet-700 dark:text-violet-300`},{soft:`bg-teal-100 text-teal-800 dark:bg-teal-950 dark:text-teal-200`,bar:`bg-teal-500`,text:`text-teal-700 dark:text-teal-300`},{soft:`bg-orange-100 text-orange-800 dark:bg-orange-950 dark:text-orange-200`,bar:`bg-orange-500`,text:`text-orange-700 dark:text-orange-300`},{soft:`bg-indigo-100 text-indigo-800 dark:bg-indigo-950 dark:text-indigo-200`,bar:`bg-indigo-500`,text:`text-indigo-700 dark:text-indigo-300`}],Bn={soft:`bg-muted text-muted-foreground`,bar:`bg-border`,text:`text-muted-foreground`};function Vn(e){let t=0;for(let n of String(e))t=t*31+n.codePointAt(0)>>>0;return t}function Hn(e){return e==null||e===``?Bn:zn[Vn(typeof e==`string`?e.trim().toLowerCase():e)%zn.length]}var Un={__name:`PersonAvatar`,props:{person:{type:Object,required:!0},class:{type:[String,Array,Object],default:``}},setup(e){let t=e,n=S(()=>Hn(t.person.id??t.person.name));return(t,r)=>(w(),D(f(In),{class:_(f(z)(`size-10`,t.$props.class))},{default:T(()=>[e.person.avatar_url?(w(),D(f(Rn),{key:0,src:e.person.avatar_url,alt:e.person.name},null,8,[`src`,`alt`])):j(``,!0),l(f(Ln),{class:_([`font-semibold`,n.value.soft])},{default:T(()=>[u(te(e.person.initials),1)]),_:1},8,[`class`])]),_:1},8,[`class`]))}},Wn=C({__name:`Sheet`,props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean},unmountOnHide:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let r=n(e,t);return(e,t)=>(w(),D(f(Rt),x({"data-slot":`sheet`},f(r)),{default:T(t=>[A(e.$slots,`default`,c(M(t)))]),_:3},16))}}),Gn=C({__name:`SheetOverlay`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=V(t,`class`);return(e,r)=>(w(),D(f(tn),x({"data-slot":`sheet-overlay`,class:f(z)(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80`,t.class)},f(n)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`class`]))}}),Kn=C({inheritAttrs:!1,__name:`SheetContent`,props:{class:{type:[Boolean,null,String,Object,Array]},side:{default:`right`},forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let r=e,i=t,a=V(r,`class`,`side`),o=n(a,i);return(t,n)=>(w(),D(f(nn),null,{default:T(()=>[l(Gn),l(f($t),x({"data-slot":`sheet-content`,class:f(z)(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,e.side===`right`&&`data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm`,e.side===`left`&&`data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm`,e.side===`top`&&`data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b`,e.side===`bottom`&&`data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t`,r.class)},{...t.$attrs,...f(o)}),{default:T(()=>[A(t.$slots,`default`),l(f(zt),{class:`ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none`},{default:T(()=>[l(f(me),{class:`size-4`}),n[0]||=v(`span`,{class:`sr-only`},`Schließen`,-1)]),_:1})]),_:3},16,[`class`])]),_:3}))}}),qn=C({__name:`SheetHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(w(),y(`div`,{"data-slot":`sheet-header`,class:_(f(z)(`flex flex-col gap-1.5 p-4`,t.class))},[A(e.$slots,`default`)],2))}}),Jn=C({__name:`SheetTitle`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=V(t,`class`);return(e,r)=>(w(),D(f(rn),x({"data-slot":`sheet-title`,class:f(z)(`text-foreground font-semibold`,t.class)},f(n)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`class`]))}}),Yn=C({__name:`DropdownMenu`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},dir:{},modal:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let r=n(e,t);return(e,t)=>(w(),D(f(An),x({"data-slot":`dropdown-menu`},f(r)),{default:T(t=>[A(e.$slots,`default`,c(M(t)))]),_:3},16))}}),Xn=C({inheritAttrs:!1,__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},memoDependencies:{},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let r=e,i=t,a=V(r,`class`),o=n(a,i);return(e,t)=>(w(),D(f(Nn),null,{default:T(()=>[l(f(jn),x({"data-slot":`dropdown-menu-content`},{...e.$attrs,...f(o)},{class:f(z)(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--reka-dropdown-menu-content-available-height) min-w-[8rem] origin-(--reka-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md`,r.class)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),Zn=C({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},inset:{type:Boolean},variant:{default:`default`}},setup(t){let n=t,r=V(n,`inset`,`variant`,`class`),i=e(r);return(e,r)=>(w(),D(f(Mn),x({"data-slot":`dropdown-menu-item`,"data-inset":t.inset?``:void 0,"data-variant":t.variant},f(i),{class:f(z)(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,n.class)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`data-inset`,`data-variant`,`class`]))}}),Qn=C({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=V(t,`class`);return(e,r)=>(w(),D(f(Pn),x({"data-slot":`dropdown-menu-separator`},f(n),{class:f(z)(`bg-border -mx-1 my-1 h-px`,t.class)}),null,16,[`class`]))}}),$n=C({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){let n=e(t);return(e,t)=>(w(),D(f(Fn),x({"data-slot":`dropdown-menu-trigger`},f(n)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),er={house:$e,newspaper:ft,"calendar-days":Ne,folder:Ge,"folder-open":We,"file-text":Ue,"file-down":He,"clipboard-list":Re,users:Ot,network:dt,"user-round":Dt,"user-plus":Et,cake:Me,"layout-grid":rt,info:Ce,"circle-help":Le,settings:vt,star:xt,bell:De,megaphone:G,clock:ze,plane:pt,receipt:ht,"graduation-cap":qe,briefcase:Ae,"list-checks":he,"book-open":ke,scale:gt,euro:Ve,"chart-column":Fe,landmark:tt,"building-2":ue,"map-pin":ct,"key-round":le,"shopping-cart":yt,truck:wt,monitor:ut,laptop:nt,headset:Xe,printer:mt,globe:Ke,mail:st,phone:we,"message-square":lt,link:ot,image:et,video:At,"heart-handshake":Ze,handshake:Ye,heart:Qe,stethoscope:St,baby:Ee,church:Ie,accessibility:Te,"shield-check":fe,lightbulb:at,sparkles:bt,trophy:Ct,leaf:it,utensils:kt,coffee:Be,car:Pe,bus:je,bike:Oe,wrench:jt,hammer:Je},Q=k(null),tr=null;function $(){return tr??=ae(()=>import(`./icon-set-B_oGzY3h.js`).then(e=>(Q.value={icons:e.default,aliases:e.aliases},Q.value)),[]),tr}function nr(e){let t=Q.value;return!t||!e?null:t.icons[e]??t.icons[t.aliases[e]]??null}var rr=[`stroke-width`,`innerHTML`],ir={__name:`AppIcon`,props:{name:{type:String,default:null},strokeWidth:{type:[Number,String],default:2}},setup(e){let t=e,n=S(()=>t.name?er[t.name]:null),r=S(()=>n.value?null:nr(t.name));return h(()=>{t.name&&!n.value&&$()}),(t,i)=>n.value?(w(),D(re(n.value),{key:0,"stroke-width":e.strokeWidth,"aria-hidden":`true`},null,8,[`stroke-width`])):e.name?(w(),y(`svg`,{key:1,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":e.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,innerHTML:r.value??``},null,8,rr)):j(``,!0)}};export{Re as $,xt as A,ct as B,Rt as C,Ot as D,At as E,ft as F,nt as G,ot as H,dt as I,Ge as J,et as K,ut as L,vt as M,_t as N,Dt as O,mt as P,ze as Q,lt as R,zt as S,K as T,at as U,st as V,rt as W,Ue as X,We as Y,He as Z,nn as _,Qn as a,Kt as b,Yn as c,Kn as d,Le as et,Wn as f,rn as g,Sn as h,$n as i,bt as j,Tt as k,Jn as l,Hn as m,Q as n,Me as nt,Zn as o,Un as p,Xe as q,$ as r,De as rt,Xn as s,ir as t,Ne as tt,qn as u,tn as v,q as w,Gt as x,$t as y,G as z}; \ No newline at end of file diff --git a/public/build/assets/AppIcon-nlhvQfK7.js b/public/build/assets/AppIcon-nlhvQfK7.js new file mode 100644 index 00000000..1842ec8a --- /dev/null +++ b/public/build/assets/AppIcon-nlhvQfK7.js @@ -0,0 +1 @@ +import{a as e,d as t,i as n,n as r,o as i,r as a,s as o,u as s}from"./usePrimitiveElement-DC7UloPZ.js";import{$n as c,D as l,E as u,Ht as d,On as f,Q as p,Tn as m,Ut as h,Yt as g,Zn as _,_ as v,b as y,ct as b,et as x,ft as ee,g as S,k as C,mt as w,qt as T,tr as te,tt as E,un as ne,v as D,vn as O,wt as re,xn as k,xt as A,y as j,z as M}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as ie,S as N,w as P}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{s as ae}from"./app-BNwrc_lv.js";import{C as F,E as oe,S as se,b as I,d as L,k as R,l as z,p as B,s as V,v as ce}from"./dist-DtGNiYlK.js";import{c as le,l as ue,o as de,s as fe,t as pe}from"./RovingFocusGroup-D88K7krN.js";import{S as me,_ as H,b as he,c as ge,d as _e,f as U,g as ve,h as W,l as ye,m as G,p as be,u as xe,v as Se,x as Ce}from"./http-CAG9BrJF.js";var we=R({name:`accessibility`,size:24,node:[[`circle`,{cx:`16`,cy:`4`,r:`1`,key:`1grugj`}],[`path`,{d:`m18 19 1-7-6 1`,key:`r0i19z`}],[`path`,{d:`m5 8 3-3 5.5 3-2.36 3.5`,key:`9ptxx2`}],[`path`,{d:`M4.24 14.5a5 5 0 0 0 6.88 6`,key:`10kmtu`}],[`path`,{d:`M13.76 17.5a5 5 0 0 0-6.88-6`,key:`2qq6rc`}]]}),Te=R({name:`baby`,size:24,node:[[`path`,{d:`M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5`,key:`1u7htd`}],[`path`,{d:`M15 12h.01`,key:`1k8ypt`}],[`path`,{d:`M19.38 6.813A9 9 0 0 1 20.8 10.2a2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1`,key:`11xh7x`}],[`path`,{d:`M9 12h.01`,key:`157uk2`}]]}),Ee=R({name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]}),De=R({name:`bike`,size:24,node:[[`circle`,{cx:`18.5`,cy:`17.5`,r:`3.5`,key:`15x4ox`}],[`circle`,{cx:`5.5`,cy:`17.5`,r:`3.5`,key:`1noe27`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`path`,{d:`M12 17.5V14l-3-3 4-3 2 3h2`,key:`1npguv`}]]}),Oe=R({name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]}),ke=R({name:`briefcase`,size:24,node:[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]}),Ae=R({name:`bus`,size:24,node:[[`path`,{d:`M8 6v6`,key:`18i7km`}],[`path`,{d:`M15 6v6`,key:`1sg6z9`}],[`path`,{d:`M2 12h19.6`,key:`de5uta`}],[`path`,{d:`M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3`,key:`1wwztk`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}],[`path`,{d:`M9 18h5`,key:`lrx6i`}],[`circle`,{cx:`16`,cy:`18`,r:`2`,key:`1v4tcr`}]]}),je=R({name:`cake`,size:24,node:[[`path`,{d:`M20 21v-8a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8`,key:`1w3rig`}],[`path`,{d:`M4 16s.5-1 2-1 2.5 2 4 2 2.5-2 4-2 2.5 2 4 2 2-1 2-1`,key:`n2jgmb`}],[`path`,{d:`M2 21h20`,key:`1nyx9w`}],[`path`,{d:`M7 8v3`,key:`1qtyvj`}],[`path`,{d:`M12 8v3`,key:`hwp4zt`}],[`path`,{d:`M17 8v3`,key:`1i6e5u`}],[`path`,{d:`M7 4h.01`,key:`1bh4kh`}],[`path`,{d:`M12 4h.01`,key:`1ujb9j`}],[`path`,{d:`M17 4h.01`,key:`1upcoc`}]]}),Me=R({name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]}),Ne=R({name:`car`,size:24,node:[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]}),Pe=R({name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]}),Fe=R({name:`church`,size:24,node:[[`path`,{d:`M10 9h4`,key:`u4k05v`}],[`path`,{d:`M12 7v5`,key:`ma6bk`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`m18 9 3.52 2.147a1 1 0 0 1 .48.854V19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-6.999a1 1 0 0 1 .48-.854L6 9`,key:`flvdwo`}],[`path`,{d:`M6 21V7a1 1 0 0 1 .376-.782l5-3.999a1 1 0 0 1 1.249.001l5 4A1 1 0 0 1 18 7v14`,key:`a5i0n2`}]]}),Ie=R({name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]}),Le=R({name:`clipboard-list`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]}),Re=R({name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]}),ze=R({name:`coffee`,size:24,node:[[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1`,key:`pwadti`}],[`path`,{d:`M6 2v2`,key:`colzsn`}]]}),Be=R({name:`euro`,size:24,node:[[`path`,{d:`M4 10h12`,key:`1y6xl8`}],[`path`,{d:`M4 14h9`,key:`1loblj`}],[`path`,{d:`M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2`,key:`1j6lzo`}]]}),Ve=R({name:`file-down`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`m9 15 3 3 3-3`,key:`1npd3o`}]]}),He=R({name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]}),Ue=R({name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]}),We=R({name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]}),Ge=R({name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]}),Ke=R({name:`graduation-cap`,size:24,node:[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]}),qe=R({name:`hammer`,size:24,node:[[`path`,{d:`m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9`,key:`1hayfq`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`15ts47`}]]}),Je=R({name:`handshake`,size:24,node:[[`path`,{d:`m11 17 2 2a1 1 0 1 0 3-3`,key:`efffak`}],[`path`,{d:`m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4`,key:`9pr0kb`}],[`path`,{d:`m21 3 1 11h-2`,key:`1tisrp`}],[`path`,{d:`M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3`,key:`1uvwmv`}],[`path`,{d:`M3 4h8`,key:`1ep09j`}]]}),Ye=R({name:`headset`,size:24,node:[[`path`,{d:`M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z`,key:`12oyoe`}],[`path`,{d:`M21 16v2a4 4 0 0 1-4 4h-5`,key:`1x7m43`}]]}),Xe=R({name:`heart-handshake`,size:24,node:[[`path`,{d:`M19.414 14.414C21 12.828 22 11.5 22 9.5a5.5 5.5 0 0 0-9.591-3.676.6.6 0 0 1-.818.001A5.5 5.5 0 0 0 2 9.5c0 2.3 1.5 4 3 5.5l5.535 5.362a2 2 0 0 0 2.879.052 2.12 2.12 0 0 0-.004-3 2.124 2.124 0 1 0 3-3 2.124 2.124 0 0 0 3.004 0 2 2 0 0 0 0-2.828l-1.881-1.882a2.41 2.41 0 0 0-3.409 0l-1.71 1.71a2 2 0 0 1-2.828 0 2 2 0 0 1 0-2.828l2.823-2.762`,key:`17lmqv`}]]}),Ze=R({name:`heart`,size:24,node:[[`path`,{d:`M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5`,key:`mvr1a0`}]]}),Qe=R({name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]}),$e=R({name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]}),et=R({name:`landmark`,size:24,node:[[`path`,{d:`M10 18v-7`,key:`wt116b`}],[`path`,{d:`M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z`,key:`yxxwt6`}],[`path`,{d:`M14 18v-7`,key:`vav6t3`}],[`path`,{d:`M18 18v-7`,key:`aexdmj`}],[`path`,{d:`M3 22h18`,key:`8prr45`}],[`path`,{d:`M6 18v-7`,key:`1ivflk`}]]}),tt=R({name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]}),nt=R({name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]}),rt=R({name:`leaf`,size:24,node:[[`path`,{d:`M11 20a10 10 0 0010-10 25.9 25.9 0 00-1.04-7.281 1 1 0 00-1.755-.325C15.833 5.5 13 5.5 9.8 6.1A7 7 0 0011 20`,key:`1wjnjv`}],[`path`,{d:`M2 21a5 5 0 012.911-4.544C7.613 15.212 8.351 15.24 11 13`,key:`c1ejpn`}]]}),it=R({name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]}),at=R({name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]}),ot=R({name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]}),st=R({name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]}),K=R({name:`megaphone`,size:24,node:[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]}),ct=R({name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]}),lt=R({name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]}),ut=R({name:`network`,size:24,node:[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]}),dt=R({name:`newspaper`,size:24,node:[[`path`,{d:`M15 18h-5`,key:`95g1m2`}],[`path`,{d:`M18 14h-8`,key:`sponae`}],[`path`,{d:`M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2`,key:`39pd36`}],[`rect`,{width:`8`,height:`4`,x:`10`,y:`6`,rx:`1`,key:`aywv1n`}]]}),ft=R({name:`plane`,size:24,node:[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]}),pt=R({name:`printer`,size:24,node:[[`path`,{d:`M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2`,key:`143wyd`}],[`path`,{d:`M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6`,key:`1itne7`}],[`rect`,{x:`6`,y:`14`,width:`12`,height:`8`,rx:`1`,key:`1ue0tg`}]]}),mt=R({name:`receipt`,size:24,node:[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]}),ht=R({name:`scale`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`,key:`zcdpyk`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`,key:`1yorad`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`,key:`eua70x`}],[`path`,{d:`M7 21h10`,key:`1b0cd5`}]]}),gt=R({name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]}),_t=R({name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]}),vt=R({name:`shopping-cart`,size:24,node:[[`path`,{d:`m2.05 2.05 1.099-.028a1 1 0 0 1 1.008.815l2.69 14.347A1 1 0 0 0 7.83 18H18`,key:`uebgi3`}],[`path`,{d:`M4.563 5h16.435a1 1 0 0 1 .981 1.204l-1.026 6.226A2 2 0 0 1 18.962 14H6.25`,key:`1j7c9p`}],[`circle`,{cx:`18`,cy:`20`,r:`2`,key:`t9985n`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]}),yt=R({name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]}),bt=R({name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]}),xt=R({name:`stethoscope`,size:24,node:[[`path`,{d:`M11 2v2`,key:`1539x4`}],[`path`,{d:`M5 2v2`,key:`1yf1q8`}],[`path`,{d:`M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1`,key:`rb5t3r`}],[`path`,{d:`M8 15a6 6 0 0 0 12 0v-3`,key:`x18d4x`}],[`circle`,{cx:`20`,cy:`10`,r:`2`,key:`ts1r5v`}]]}),St=R({name:`trophy`,size:24,node:[[`path`,{d:`M10 14.66V17a1 1 0 0 1-1 1 2 2 0 0 0-2 2v2`,key:`pwuv1l`}],[`path`,{d:`M14 14.66V17a1 1 0 0 0 1 1 2 2 0 0 1 2 2v2`,key:`1y54w1`}],[`path`,{d:`M17.916 10H19.5A2.5 2.5 0 0 0 22 7.5V5a1 1 0 0 0-1-1h-3`,key:`e30mpu`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6.084 10H4.5A2.5 2.5 0 0 1 2 7.5V5a1 1 0 0 1 1-1h3`,key:`i0yafy`}]]}),Ct=R({name:`truck`,size:24,node:[[`path`,{d:`M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2`,key:`wrbu53`}],[`path`,{d:`M15 18H9`,key:`1lyqi6`}],[`path`,{d:`M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14`,key:`lysw3i`}],[`circle`,{cx:`17`,cy:`18`,r:`2`,key:`332jqn`}],[`circle`,{cx:`7`,cy:`18`,r:`2`,key:`19iecd`}]]}),wt=R({name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]}),Tt=R({name:`user-plus`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]}),Et=R({name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]}),Dt=R({name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]}),Ot=R({name:`utensils`,size:24,node:[[`path`,{d:`M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2`,key:`cjf0a3`}],[`path`,{d:`M7 2v20`,key:`1473qp`}],[`path`,{d:`M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7`,key:`j28e5`}]],aliases:[`fork-knife`]}),kt=R({name:`video`,size:24,node:[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]}),At=R({name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]}),jt=[`INPUT`,`TEXTAREA`];function q(e,t,n,r={}){if(!t||r.enableIgnoredElement&&jt.includes(t.nodeName))return null;let{arrowKeyOptions:i=`both`,attributeName:a=`[data-reka-collection-item]`,itemsArray:o=[],loop:s=!0,dir:c=`ltr`,preventScroll:l=!0,focus:u=!1}=r,[d,f,p,m,h,g]=[e.key===`ArrowRight`,e.key===`ArrowLeft`,e.key===`ArrowUp`,e.key===`ArrowDown`,e.key===`Home`,e.key===`End`],_=p||m,v=d||f;if(!h&&!g&&(!_&&!v||i===`vertical`&&v||i===`horizontal`&&_))return null;let y=n?Array.from(n.querySelectorAll(a)):o;if(!y.length)return null;l&&e.preventDefault();let b=null;return v||_?b=Mt(y,t,{goForward:_?m:c===`ltr`?d:f,loop:s}):h?b=y.at(0)||null:g&&(b=y.at(-1)||null),u&&b?.focus(),b}function Mt(e,t,n,r=e.includes(t)?e.length:e.length+1){if(--r===0)return null;let i=e.indexOf(t),a;if(a=i===-1?n.goForward?0:e.length-1:n.goForward?i+1:i-1,!n.loop&&(a<0||a>=e.length))return null;let o=e[(a+e.length)%e.length];return o?o.hasAttribute(`disabled`)&&o.getAttribute(`disabled`)!==`false`?Mt(e,o,n,r):o:null}function Nt(e){let t=oe(``,1e3);return{search:t,handleTypeaheadSearch:(n,r)=>{if(t.value+=n,e)e(n);else{let e=s(),n=r.map(e=>({...e,textValue:e.value?.textValue??e.ref.textContent?.trim()??``})),i=n.find(t=>t.ref===e),a=Ft(n.map(e=>e.textValue),t.value,i?.textValue),o=n.find(e=>e.textValue===a);return o&&o.ref.focus(),o?.ref}},resetTypeahead:()=>{t.value=``}}}function Pt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Ft(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Pt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}var[J,It]=t(`DialogRoot`),Lt=C({inheritAttrs:!1,__name:`DialogRoot`,props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=I(n,`open`,t,{defaultValue:n.defaultOpen,passive:n.open===void 0}),i=O(),a=O(),{modal:o,unmountOnHide:s}=m(n);return It({open:r,modal:o,unmountOnHide:s,openModal:()=>{r.value=!0},onOpenChange:e=>{r.value=e},onOpenToggle:()=>{r.value=!r.value},contentId:``,titleId:``,descriptionId:``,triggerElement:i,contentElement:a}),(e,t)=>A(e.$slots,`default`,{open:f(r),close:()=>r.value=!1})}}),Rt=C({__name:`DialogClose`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;B();let n=J();return(e,r)=>(w(),D(f(L),x(t,{type:e.as===`button`?`button`:void 0,onClick:r[0]||=e=>f(n).onOpenChange(!1)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`type`]))}}),zt=`menu.itemSelect`,Y=[`Enter`,` `],Bt=[`ArrowDown`,`PageUp`,`Home`],Vt=[`ArrowUp`,`PageDown`,`End`],Ht=[...Bt,...Vt];[...Y],[...Y];function Ut(e){return e?`open`:`closed`}function Wt(e){return e===`indeterminate`}function Gt(e){return Wt(e)?`indeterminate`:e?`checked`:`unchecked`}function Kt(e){let t=s();for(let n of e)if(n===t||(n.focus(),s()!==t))return}function qt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Jt(e,t){return t?qt({x:e.clientX,y:e.clientY},t):!1}function X(e){return e.pointerType===`mouse`}var Yt=C({__name:`DialogContentImpl`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,i=J(),{forwardRef:o,currentElement:c}=B();return i.titleId||=a(void 0,`reka-dialog-title`),i.descriptionId||=a(void 0,`reka-dialog-description`),b(()=>{i.contentElement=c,s()!==document.body&&(i.triggerElement.value=s())}),(e,t)=>(w(),D(f(be),{"as-child":``,loop:``,trapped:n.trapFocus,present:n.present,onMountAutoFocus:t[5]||=e=>r(`openAutoFocus`,e),onUnmountAutoFocus:t[6]||=e=>r(`closeAutoFocus`,e)},{default:T(()=>[l(f(G),x({id:f(i).contentId,ref:f(o),as:e.as,"as-child":e.asChild,present:n.present,"disable-outside-pointer-events":e.disableOutsidePointerEvents,role:`dialog`,"aria-describedby":f(i).descriptionId,"aria-labelledby":f(i).titleId,"data-state":f(Ut)(f(i).open.value)},e.$attrs,{onDismiss:t[0]||=e=>f(i).onOpenChange(!1),onEscapeKeyDown:t[1]||=e=>r(`escapeKeyDown`,e),onFocusOutside:t[2]||=e=>r(`focusOutside`,e),onInteractOutside:t[3]||=e=>r(`interactOutside`,e),onPointerDownOutside:t[4]||=e=>r(`pointerDownOutside`,e)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`id`,`as`,`as-child`,`present`,`disable-outside-pointer-events`,`aria-describedby`,`aria-labelledby`,`data-state`])]),_:3},8,[`trapped`,`present`]))}}),Xt=C({__name:`DialogContentModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=t,a=J(),o=i(r),{forwardRef:s,currentElement:c}=B(),l=S(()=>n.present?c.value:void 0);W(l);let u=S(()=>{let{present:e,...t}=n;return t});return d(()=>n.present,(e,t)=>{!e&&t&&a.triggerElement.value?.focus()}),(e,t)=>(w(),D(Yt,x({...u.value,...f(o)},{ref:f(s),present:e.present,"trap-focus":f(a).open.value,"disable-outside-pointer-events":n.disableOutsidePointerEvents,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(e.preventDefault(),f(a).triggerElement.value?.focus())},onPointerDownOutside:t[1]||=e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()},onFocusOutside:t[2]||=e=>{e.preventDefault()}}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`present`,`trap-focus`,`disable-outside-pointer-events`]))}}),Zt=C({__name:`DialogContentNonModal`,props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,r=i(t);B();let a=J(),o=O(!1),s=O(!1),c=S(()=>{let{present:e,...t}=n;return t});return d(()=>n.present,(e,t)=>{!e&&t&&(o.value||a.triggerElement.value?.focus(),o.value=!1,s.value=!1)}),(e,t)=>(w(),D(Yt,x({...c.value,...f(r)},{present:e.present,"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:t[0]||=e=>{e.defaultPrevented||(o.value||f(a).triggerElement.value?.focus(),e.preventDefault()),o.value=!1,s.value=!1},onInteractOutside:t[1]||=e=>{e.defaultPrevented||(o.value=!0,e.detail.originalEvent.type===`pointerdown`&&(s.value=!0));let t=e.target;f(a).triggerElement.value?.contains(t)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&s.value&&e.preventDefault()}}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`present`]))}}),Qt=C({__name:`DialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let n=e,a=t,o=J(),s=i(a),{forwardRef:c}=B(),l=S(()=>n.forceMount||!o.unmountOnHide.value);return(e,t)=>(w(),D(f(r),{present:f(o).open.value,"force-mount":l.value},{default:T(({present:t})=>[f(o).modal.value?g((w(),D(Xt,x({key:0,ref:f(c),present:!l.value||t},{...n,...f(s),...e.$attrs}),{default:T(()=>[A(e.$slots,`default`)]),_:2},1040,[`present`])),[[N,e.forceMount||f(o).unmountOnHide.value||t]]):g((w(),D(Zt,x({key:1,ref:f(c),present:!l.value||t},{...n,...f(s),...e.$attrs}),{default:T(()=>[A(e.$slots,`default`)]),_:2},1040,[`present`])),[[N,e.forceMount||f(o).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`]))}}),$t=C({__name:`DialogOverlayImpl`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},setup(e){let t=e,n=J(),r=H(t.present);return d(()=>t.present,e=>r.value=e),B(),(e,t)=>(w(),D(f(L),{as:e.as,"as-child":e.asChild,"data-state":f(n).open.value?`open`:`closed`,style:{"pointer-events":`auto`},onPointerdown:t[0]||=P(()=>{},[`left`,`self`,`prevent`])},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`]))}}),en=C({__name:`DialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=J(),{forwardRef:i}=B(),a=S(()=>t.forceMount||!n.unmountOnHide.value);return(e,t)=>f(n)?.modal.value?(w(),D(f(r),{key:0,present:f(n).open.value,"force-mount":a.value},{default:T(({present:t})=>[g(l($t,x(e.$attrs,{ref:f(i),as:e.as,"as-child":e.asChild,present:!a.value||t}),{default:T(()=>[A(e.$slots,`default`)]),_:2},1040,[`as`,`as-child`,`present`]),[[N,e.forceMount||f(n).unmountOnHide.value||t]])]),_:3},8,[`present`,`force-mount`])):j(`v-if`,!0)}}),tn=C({__name:`DialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(w(),D(f(U),c(M(t)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),nn=C({__name:`DialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e,n=J();return B(),(e,r)=>(w(),D(f(L),x(t,{id:f(n).titleId}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`id`]))}}),[rn,an]=t(`AvatarRoot`),on=C({__name:`AvatarRoot`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){return B(),an({imageLoadingStatus:O(`idle`)}),(e,t)=>(w(),D(f(L),{"as-child":e.asChild,as:e.as},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`as-child`,`as`]))}}),sn=C({__name:`AvatarFallback`,props:{delayMs:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=e,n=rn();B();let r=O(t.delayMs===void 0);return h(e=>{if(t.delayMs&&F){let n=window.setTimeout(()=>{r.value=!0},t.delayMs);e(()=>{window.clearTimeout(n)})}}),(e,t)=>r.value&&f(n).imageLoadingStatus.value!==`loaded`?(w(),D(f(L),{key:0,"as-child":e.asChild,as:e.as},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`as-child`,`as`])):j(`v-if`,!0)}});function cn(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?`loaded`:`loading`):`error`:`idle`}function ln(e,{referrerPolicy:t,crossOrigin:n}={}){let r=O(!1),i=O(null),a=S(()=>r.value?(!i.value&&F&&(i.value=new window.Image),i.value):null),o=O(cn(a.value,e.value)),s=e=>()=>{r.value&&(o.value=e)};return b(()=>{r.value=!0,h(r=>{let i=a.value;if(!i)return;o.value=cn(i,e.value);let c=s(`loaded`),l=s(`error`);i.addEventListener(`load`,c),i.addEventListener(`error`,l),t?.value&&(i.referrerPolicy=t.value),typeof n?.value==`string`&&(i.crossOrigin=n.value),r(()=>{i.removeEventListener(`load`,c),i.removeEventListener(`error`,l)})})}),ee(()=>{r.value=!1}),o}var un=C({__name:`AvatarImage`,props:{src:{type:String,required:!0},referrerPolicy:{type:null,required:!1},crossOrigin:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`img`}},emits:[`loadingStatusChange`],setup(e,{emit:t}){let n=e,r=t,{src:i,referrerPolicy:a,crossOrigin:o}=m(n);B();let s=rn(),c=ln(i,{referrerPolicy:a,crossOrigin:o});return d(c,e=>{r(`loadingStatusChange`,e),e!==`idle`&&(s.imageLoadingStatus.value=e)},{immediate:!0}),(e,t)=>g((w(),D(f(L),{role:`img`,"as-child":e.asChild,as:e.as,src:f(i),referrerpolicy:f(a),crossorigin:f(o)},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`src`,`referrerpolicy`,`crossorigin`])),[[N,f(c)===`loaded`]])}}),dn=C({__name:`MenuAnchor`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(w(),D(f(xe),c(M(t)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}});function fn(){let e=O(!1);return b(()=>{ce(`keydown`,()=>{e.value=!0},{capture:!0,passive:!0}),ce([`pointerdown`,`pointermove`],()=>{e.value=!1},{capture:!0,passive:!0})}),e}var pn=se(fn),[Z,mn]=t([`MenuRoot`,`MenuSub`],`MenuContext`),[Q,hn]=t(`MenuRoot`),gn=C({__name:`MenuRoot`,props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,{modal:i,dir:a}=m(n),s=o(a),c=I(n,`open`,r),l=O(),u=pn();return mn({open:c,onOpenChange:e=>{c.value=e},content:l,onContentChange:e=>{l.value=e}}),hn({onClose:()=>{c.value=!1},isUsingKeyboardRef:u,dir:s,modal:i}),(e,t)=>(w(),D(f(_e),null,{default:T(()=>[A(e.$slots,`default`)]),_:3}))}}),[_n,vn]=t(`MenuContent`),yn=C({__name:`MenuContentImpl`,props:p({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...ge}),emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,i=Z(),a=Q(),{trapFocus:o,disableOutsidePointerEvents:c,loop:u}=m(n);ve(),H(c.value);let p=O(``),h=O(0),g=O(0),_=O(null),v=O(`right`),y=O(0),b=O(null),x=O(),{forwardRef:S,currentElement:C}=B(),{handleTypeaheadSearch:te}=Nt(),E=O();function ne(e){let t=q(e,E.value||s(),C.value,{loop:u.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!1,attributeName:`[data-reka-collection-item]:not([data-disabled])`});t&&(E.value=t,t.scrollIntoView({block:`nearest`}))}function re(){E.value&&E.value.click()}let k=O(),j=O();d(E,e=>{if(j.value&&(e===void 0||e!==j.value.trigger.value)){if(e===void 0)return;j.value.onOpenChange(!1),j.value=void 0}}),d(C,e=>{i.onContentChange(e)}),ee(()=>{window.clearTimeout(h.value)});function M(e){return v.value===_.value?.side&&Jt(e,_.value?.area)}async function ie(e){r(`openAutoFocus`,e),!e.defaultPrevented&&(e.preventDefault(),C.value?.focus({preventScroll:!0}))}function N(e){if(e.defaultPrevented)return;let t=e.target,n=t.closest(`[data-reka-menu-content]`)===e.currentTarget,r=[`input`,`textarea`].includes(t.tagName.toLowerCase()),i=e.ctrlKey||e.altKey||e.metaKey,o=e.key.length===1,c=q(e,s(),C.value,{loop:u.value,arrowKeyOptions:`vertical`,dir:a?.dir.value,focus:!0,attributeName:`[data-reka-collection-item]:not([data-disabled])`});if(c)return c?.focus();if(e.code===`Space`)return;let l=x.value?.getItems()??[];if(n&&(e.key===`Tab`&&a.modal.value&&e.preventDefault(),!i&&o&&!r&&te(e.key,l)),e.target!==C.value||!Ht.includes(e.key))return;e.preventDefault();let d=[...l.map(e=>e.ref)];Vt.includes(e.key)&&d.reverse(),Kt(d)}function P(e){e?.currentTarget?.contains?.(e.target)||(window.clearTimeout(h.value),p.value=``)}function ae(e){if(!X(e))return;let t=e.target,n=y.value!==e.clientX;if((e?.currentTarget)?.contains(t)&&n){let t=e.clientX>y.value?`right`:`left`;v.value=t,y.value=e.clientX}}function F(e){X(e)&&k.value&&k.value.focus()}return vn({onItemEnter:e=>!!M(e),onItemLeave:e=>M(e)?!0:([`INPUT`,`TEXTAREA`].includes(s()?.tagName||``)||C.value?.focus(),b.value=null,!1),onTriggerLeave:e=>!!M(e),searchRef:p,highlightedElement:E,onKeydownNavigation:ne,onKeydownEnter:re,filterElement:k,onFilterElementChange:e=>{k.value=e},activeSubmenuContext:j,pointerGraceTimerRef:g,onPointerGraceIntentChange:e=>{_.value=e}}),(e,t)=>(w(),D(f(be),{"as-child":``,trapped:f(o),onMountAutoFocus:ie,onUnmountAutoFocus:t[7]||=e=>r(`closeAutoFocus`,e)},{default:T(()=>[l(f(G),{"as-child":``,"disable-outside-pointer-events":f(c),onEscapeKeyDown:t[2]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[3]||=e=>r(`pointerDownOutside`,e),onFocusOutside:t[4]||=e=>r(`focusOutside`,e),onInteractOutside:t[5]||=e=>r(`interactOutside`,e),onDismiss:t[6]||=e=>r(`dismiss`)},{default:T(()=>[l(f(pe),{ref_key:`rovingFocusGroupRef`,ref:x,"current-tab-stop-id":b.value,"onUpdate:currentTabStopId":t[0]||=e=>b.value=e,"as-child":``,orientation:`vertical`,dir:f(a).dir.value,loop:f(u),onEntryFocus:t[1]||=e=>{r(`entryFocus`,e),f(a).isUsingKeyboardRef.value||e.preventDefault()}},{default:T(()=>[l(f(ye),{ref:f(S),role:`menu`,as:e.as,"as-child":e.asChild,"aria-orientation":`vertical`,"data-reka-menu-content":``,"data-state":f(Ut)(f(i).open.value),dir:f(a).dir.value,side:e.side,"side-offset":e.sideOffset,align:e.align,"align-offset":e.alignOffset,"avoid-collisions":e.avoidCollisions,"collision-boundary":e.collisionBoundary,"collision-padding":e.collisionPadding,"arrow-padding":e.arrowPadding,"prioritize-position":e.prioritizePosition,"position-strategy":e.positionStrategy,"update-position-strategy":e.updatePositionStrategy,sticky:e.sticky,"hide-when-detached":e.hideWhenDetached,reference:e.reference,onKeydown:N,onBlur:P,onPointermove:ae,onPointerenter:F},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`,`dir`,`side`,`side-offset`,`align`,`align-offset`,`avoid-collisions`,`collision-boundary`,`collision-padding`,`arrow-padding`,`prioritize-position`,`position-strategy`,`update-position-strategy`,`sticky`,`hide-when-detached`,`reference`])]),_:3},8,[`current-tab-stop-id`,`dir`,`loop`])]),_:3},8,[`disable-outside-pointer-events`])]),_:3},8,[`trapped`]))}}),bn=C({inheritAttrs:!1,__name:`MenuItemImpl`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=_n(),{forwardRef:r,currentElement:i}=B(),{CollectionItem:a}=de(),o=O(!1),c=S(()=>o.value||i.value!=null&&n.highlightedElement.value===i.value);async function u(e){if(!e.defaultPrevented&&X(e)){if(t.disabled)n.onItemLeave(e);else if(!n.onItemEnter(e)){let t=e.currentTarget;n.highlightedElement.value=t,[`INPUT`,`TEXTAREA`].includes(s()?.tagName||``)||t.focus({preventScroll:!0})}}}async function d(e){await E(),!e.defaultPrevented&&X(e)&&n.highlightedElement.value===i.value&&!n.onItemLeave(e)&&n.highlightedElement.value===i.value&&(n.highlightedElement.value=void 0)}return(e,t)=>(w(),D(f(a),{value:{textValue:e.textValue}},{default:T(()=>[l(f(L),x({ref:f(r),role:`menuitem`,tabindex:`-1`},e.$attrs,{as:e.as,"as-child":e.asChild,"aria-disabled":e.disabled||void 0,"data-disabled":e.disabled?``:void 0,"data-highlighted":c.value?``:void 0,onPointermove:u,onPointerleave:d,onFocus:t[0]||=async t=>{let r=t.currentTarget;await E(),!(t.defaultPrevented||e.disabled)&&(o.value=!0,f(n).highlightedElement.value=r)},onBlur:t[1]||=async e=>{await E(),!e.defaultPrevented&&(o.value=!1)}}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`as`,`as-child`,`aria-disabled`,`data-disabled`,`data-highlighted`])]),_:3},8,[`value`]))}}),xn=C({__name:`MenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=B(),o=Q(),s=_n(),c=O(!1);async function l(){let e=a.value;if(!n.disabled&&e){let e=new CustomEvent(zt,{bubbles:!0,cancelable:!0});r(`select`,e),await E(),e.defaultPrevented?c.value=!1:o.onClose()}}return(e,t)=>(w(),D(bn,x(n,{ref:f(i),onClick:l,onPointerdown:t[0]||=()=>{c.value=!0},onPointerup:t[1]||=async e=>{await E(),!e.defaultPrevented&&(c.value||e.currentTarget?.click())},onKeydown:t[2]||=async t=>{let n=f(s).searchRef.value!==``;e.disabled||n&&t.key===` `||f(Y).includes(t.key)&&(t.currentTarget?.click(),t.preventDefault())}}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),Sn=C({__name:`MenuRootContentModal`,props:{loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let r=e,i=t,a=n(r,i),o=Z(),{forwardRef:s,currentElement:c}=B();return W(c),(e,t)=>(w(),D(yn,x(f(a),{ref:f(s),"trap-focus":f(o).open.value,"disable-outside-pointer-events":f(o).open.value,"disable-outside-scroll":!0,onDismiss:t[0]||=e=>f(o).onOpenChange(!1),onFocusOutside:t[1]||=P(e=>i(`focusOutside`,e),[`prevent`])}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`trap-focus`,`disable-outside-pointer-events`]))}}),Cn=C({__name:`MenuRootContentNonModal`,props:{loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let r=n(e,t),i=Z();return(e,t)=>(w(),D(yn,x(f(r),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:t[0]||=e=>f(i).onOpenChange(!1)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),wn=C({__name:`MenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`entryFocus`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let i=n(e,t),a=Z(),o=Q();return(e,t)=>(w(),D(f(r),{present:e.forceMount||f(a).open.value},{default:T(()=>[f(o).modal.value?(w(),D(Sn,c(x({key:0},{...e.$attrs,...f(i)})),{default:T(()=>[A(e.$slots,`default`)]),_:3},16)):(w(),D(Cn,c(x({key:1},{...e.$attrs,...f(i)})),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Tn=C({__name:`MenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(w(),D(f(U),c(M(t)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),En=C({__name:`MenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(w(),D(f(L),x(t,{role:`separator`,"aria-orientation":`horizontal`}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),[Dn,On]=t(`DropdownMenuRoot`),kn=C({__name:`DropdownMenuRoot`,props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;B();let i=I(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0}),a=O(),{modal:s,dir:c}=m(n),l=o(c);return On({open:i,onOpenChange:e=>{i.value=e},onOpenToggle:()=>{i.value=!i.value},triggerId:``,triggerElement:a,contentId:``,modal:s,dir:l}),(e,t)=>(w(),D(f(gn),{open:f(i),"onUpdate:open":t[0]||=e=>ne(i)?i.value=e:null,dir:f(l),modal:f(s)},{default:T(()=>[A(e.$slots,`default`,{open:f(i)})]),_:3},8,[`open`,`dir`,`modal`]))}}),An=C({__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},memoDependencies:{type:Array,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let r=n(e,t);B();let i=Dn(),o=O(!1);function s(e){e.defaultPrevented||(o.value||setTimeout(()=>{i.triggerElement.value?.focus()},0),o.value=!1,e.preventDefault())}return i.contentId||=a(void 0,`reka-dropdown-menu-content`),(e,t)=>(w(),D(f(wn),x(f(r),{id:f(i).contentId,"aria-labelledby":f(i)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-dropdown-menu-content-available-width":`var(--reka-popper-available-width)`,"--reka-dropdown-menu-content-available-height":`var(--reka-popper-available-height)`,"--reka-dropdown-menu-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-dropdown-menu-trigger-height":`var(--reka-popper-anchor-height)`},onCloseAutoFocus:s,onInteractOutside:t[0]||=e=>{if(e.defaultPrevented)return;let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!f(i).modal.value||r)&&(o.value=!0),f(i).triggerElement.value?.contains(e.target)&&e.preventDefault()}}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`id`,`aria-labelledby`]))}}),jn=C({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let n=e,r=i(t);return B(),(e,t)=>(w(),D(f(xn),c(M({...n,...f(r)})),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),Mn=C({__name:`DropdownMenuPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(w(),D(f(Tn),c(M(t)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),Nn=C({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return B(),(e,n)=>(w(),D(f(En),c(M(t)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),Pn=C({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Dn(),{forwardRef:r,currentElement:i}=B();return b(()=>{n.triggerElement=i}),n.triggerId||=a(void 0,`reka-dropdown-menu-trigger`),(e,i)=>(w(),D(f(dn),{"as-child":``},{default:T(()=>[l(f(L),{id:f(n).triggerId,ref:f(r),type:e.as===`button`?`button`:void 0,"as-child":t.asChild,as:e.as,"aria-haspopup":`menu`,"aria-expanded":f(n).open.value,"aria-controls":f(n).open.value?f(n).contentId:void 0,"data-disabled":e.disabled?``:void 0,disabled:e.disabled,"data-state":f(n).open.value?`open`:`closed`,onClick:i[0]||=async t=>{!e.disabled&&t.button===0&&t.ctrlKey===!1&&(f(n)?.onOpenToggle(),await E(),f(n).open.value&&t.preventDefault())},onKeydown:i[1]||=ie(t=>{e.disabled||([`Enter`,` `].includes(t.key)&&f(n).onOpenToggle(),t.key===`ArrowDown`&&f(n).onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(t.key)&&t.preventDefault())},[`enter`,`space`,`arrow-down`])},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as-child`,`as`,`aria-expanded`,`aria-controls`,`data-disabled`,`disabled`,`data-state`])]),_:3}))}}),Fn=C({__name:`Avatar`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(w(),D(f(on),{"data-slot":`avatar`,class:_(f(z)(`relative flex size-8 shrink-0 overflow-hidden rounded-full`,t.class))},{default:T(()=>[A(e.$slots,`default`)]),_:3},8,[`class`]))}}),In=C({__name:`AvatarFallback`,props:{delayMs:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=V(t,`class`);return(e,r)=>(w(),D(f(sn),x({"data-slot":`avatar-fallback`},f(n),{class:f(z)(`bg-muted flex size-full items-center justify-center rounded-full`,t.class)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`class`]))}}),Ln=C({__name:`AvatarImage`,props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(w(),D(f(un),x({"data-slot":`avatar-image`},t,{class:`aspect-square size-full`}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),Rn=[{soft:`bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-200`,bar:`bg-sky-500`,text:`text-sky-700 dark:text-sky-300`},{soft:`bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-200`,bar:`bg-emerald-500`,text:`text-emerald-700 dark:text-emerald-300`},{soft:`bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-200`,bar:`bg-amber-500`,text:`text-amber-700 dark:text-amber-300`},{soft:`bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-200`,bar:`bg-rose-500`,text:`text-rose-700 dark:text-rose-300`},{soft:`bg-violet-100 text-violet-800 dark:bg-violet-950 dark:text-violet-200`,bar:`bg-violet-500`,text:`text-violet-700 dark:text-violet-300`},{soft:`bg-teal-100 text-teal-800 dark:bg-teal-950 dark:text-teal-200`,bar:`bg-teal-500`,text:`text-teal-700 dark:text-teal-300`},{soft:`bg-orange-100 text-orange-800 dark:bg-orange-950 dark:text-orange-200`,bar:`bg-orange-500`,text:`text-orange-700 dark:text-orange-300`},{soft:`bg-indigo-100 text-indigo-800 dark:bg-indigo-950 dark:text-indigo-200`,bar:`bg-indigo-500`,text:`text-indigo-700 dark:text-indigo-300`}],zn={soft:`bg-muted text-muted-foreground`,bar:`bg-border`,text:`text-muted-foreground`};function Bn(e){let t=0;for(let n of String(e))t=t*31+n.codePointAt(0)>>>0;return t}function Vn(e){return e==null||e===``?zn:Rn[Bn(typeof e==`string`?e.trim().toLowerCase():e)%Rn.length]}var Hn={__name:`PersonAvatar`,props:{person:{type:Object,required:!0},class:{type:[String,Array,Object],default:``}},setup(e){let t=e,n=S(()=>Vn(t.person.id??t.person.name));return(t,r)=>(w(),D(f(Fn),{class:_(f(z)(`size-10`,t.$props.class))},{default:T(()=>[e.person.avatar_url?(w(),D(f(Ln),{key:0,src:e.person.avatar_url,alt:e.person.name},null,8,[`src`,`alt`])):j(``,!0),l(f(In),{class:_([`font-semibold`,n.value.soft])},{default:T(()=>[u(te(e.person.initials),1)]),_:1},8,[`class`])]),_:1},8,[`class`]))}},Un=C({__name:`Sheet`,props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean},unmountOnHide:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let r=n(e,t);return(e,t)=>(w(),D(f(Lt),x({"data-slot":`sheet`},f(r)),{default:T(t=>[A(e.$slots,`default`,c(M(t)))]),_:3},16))}}),Wn=C({__name:`SheetOverlay`,props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=V(t,`class`);return(e,r)=>(w(),D(f(en),x({"data-slot":`sheet-overlay`,class:f(z)(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80`,t.class)},f(n)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`class`]))}}),Gn=C({inheritAttrs:!1,__name:`SheetContent`,props:{class:{type:[Boolean,null,String,Object,Array]},side:{default:`right`},forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let r=e,i=t,a=V(r,`class`,`side`),o=n(a,i);return(t,n)=>(w(),D(f(tn),null,{default:T(()=>[l(Wn),l(f(Qt),x({"data-slot":`sheet-content`,class:f(z)(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500`,e.side===`right`&&`data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm`,e.side===`left`&&`data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm`,e.side===`top`&&`data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b`,e.side===`bottom`&&`data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t`,r.class)},{...t.$attrs,...f(o)}),{default:T(()=>[A(t.$slots,`default`),l(f(Rt),{class:`ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none`},{default:T(()=>[l(f(Se),{class:`size-4`}),n[0]||=v(`span`,{class:`sr-only`},`Schließen`,-1)]),_:1})]),_:3},16,[`class`])]),_:3}))}}),Kn=C({__name:`SheetHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(w(),y(`div`,{"data-slot":`sheet-header`,class:_(f(z)(`flex flex-col gap-1.5 p-4`,t.class))},[A(e.$slots,`default`)],2))}}),qn=C({__name:`SheetTitle`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=V(t,`class`);return(e,r)=>(w(),D(f(nn),x({"data-slot":`sheet-title`,class:f(z)(`text-foreground font-semibold`,t.class)},f(n)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`class`]))}}),Jn=C({__name:`DropdownMenu`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},dir:{},modal:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let r=n(e,t);return(e,t)=>(w(),D(f(kn),x({"data-slot":`dropdown-menu`},f(r)),{default:T(t=>[A(e.$slots,`default`,c(M(t)))]),_:3},16))}}),Yn=C({inheritAttrs:!1,__name:`DropdownMenuContent`,props:{forceMount:{type:Boolean},loop:{type:Boolean},memoDependencies:{},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`closeAutoFocus`],setup(e,{emit:t}){let r=e,i=t,a=V(r,`class`),o=n(a,i);return(e,t)=>(w(),D(f(Mn),null,{default:T(()=>[l(f(An),x({"data-slot":`dropdown-menu-content`},{...e.$attrs,...f(o)},{class:f(z)(`bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--reka-dropdown-menu-content-available-height) min-w-[8rem] origin-(--reka-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md`,r.class)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),Xn=C({__name:`DropdownMenuItem`,props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},inset:{type:Boolean},variant:{default:`default`}},setup(t){let n=t,r=V(n,`inset`,`variant`,`class`),i=e(r);return(e,r)=>(w(),D(f(jn),x({"data-slot":`dropdown-menu-item`,"data-inset":t.inset?``:void 0,"data-variant":t.variant},f(i),{class:f(z)(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,n.class)}),{default:T(()=>[A(e.$slots,`default`)]),_:3},16,[`data-inset`,`data-variant`,`class`]))}}),Zn=C({__name:`DropdownMenuSeparator`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=V(t,`class`);return(e,r)=>(w(),D(f(Nn),x({"data-slot":`dropdown-menu-separator`},f(n),{class:f(z)(`bg-border -mx-1 my-1 h-px`,t.class)}),null,16,[`class`]))}}),Qn=C({__name:`DropdownMenuTrigger`,props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){let n=e(t);return(e,t)=>(w(),D(f(Pn),x({"data-slot":`dropdown-menu-trigger`},f(n)),{default:T(()=>[A(e.$slots,`default`)]),_:3},16))}}),$n={house:Qe,newspaper:dt,"calendar-days":Me,folder:We,"folder-open":Ue,"file-text":He,"file-down":Ve,"clipboard-list":Le,users:Dt,network:ut,"user-round":Et,"user-plus":Tt,cake:je,"layout-grid":nt,info:me,"circle-help":Ie,settings:_t,star:bt,bell:Ee,megaphone:K,clock:Re,plane:ft,receipt:mt,"graduation-cap":Ke,briefcase:ke,"list-checks":Ce,"book-open":Oe,scale:ht,euro:Be,"chart-column":Pe,landmark:et,"building-2":ue,"map-pin":st,"key-round":le,"shopping-cart":vt,truck:Ct,monitor:lt,laptop:tt,headset:Ye,printer:pt,globe:Ge,mail:ot,phone:he,"message-square":ct,link:at,image:$e,video:kt,"heart-handshake":Xe,handshake:Je,heart:Ze,stethoscope:xt,baby:Te,church:Fe,accessibility:we,"shield-check":fe,lightbulb:it,sparkles:yt,trophy:St,leaf:rt,utensils:Ot,coffee:ze,car:Ne,bus:Ae,bike:De,wrench:At,hammer:qe},$=k(null),er=null;function tr(){return er??=ae(()=>import(`./icon-set-B_oGzY3h.js`).then(e=>($.value={icons:e.default,aliases:e.aliases},$.value)),[]),er}function nr(e){let t=$.value;return!t||!e?null:t.icons[e]??t.icons[t.aliases[e]]??null}var rr=[`stroke-width`,`innerHTML`],ir={__name:`AppIcon`,props:{name:{type:String,default:null},strokeWidth:{type:[Number,String],default:2}},setup(e){let t=e,n=S(()=>t.name?$n[t.name]:null),r=S(()=>n.value?null:nr(t.name));return h(()=>{t.name&&!n.value&&tr()}),(t,i)=>n.value?(w(),D(re(n.value),{key:0,"stroke-width":e.strokeWidth,"aria-hidden":`true`},null,8,[`stroke-width`])):e.name?(w(),y(`svg`,{key:1,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":e.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,innerHTML:r.value??``},null,8,rr)):j(``,!0)}};export{Le as $,bt as A,st as B,Lt as C,Dt as D,kt as E,dt as F,tt as G,at as H,ut as I,We as J,$e as K,lt as L,_t as M,gt as N,Et as O,pt as P,Re as Q,ct as R,Rt as S,q as T,it as U,ot as V,nt as W,He as X,Ue as Y,Ve as Z,tn as _,Zn as a,Gt as b,Jn as c,Gn as d,Ie as et,Un as f,nn as g,xn as h,Qn as i,yt as j,wt as k,qn as l,Vn as m,$ as n,je as nt,Xn as o,Hn as p,Ye as q,tr as r,Ee as rt,Yn as s,ir as t,Me as tt,Kn as u,en as v,J as w,Wt as x,Qt as y,K as z}; \ No newline at end of file diff --git a/public/build/assets/AppLayout-BxsYt2ib.js b/public/build/assets/AppLayout-esQiy2nD.js similarity index 96% rename from public/build/assets/AppLayout-BxsYt2ib.js rename to public/build/assets/AppLayout-esQiy2nD.js index d5acc442..17e57b22 100644 --- a/public/build/assets/AppLayout-BxsYt2ib.js +++ b/public/build/assets/AppLayout-esQiy2nD.js @@ -1 +1 @@ -import{a as e,d as t,i as n,n as r,o as i,r as a}from"./usePrimitiveElement-DC7UloPZ.js";import{$n as o,D as s,E as c,Ht as l,On as u,Tn as d,Yt as f,Zn as p,_ as m,b as h,bt as g,ct as _,et as v,g as y,it as b,k as x,mt as S,o as C,qt as w,tr as T,tt as ee,v as E,vn as D,wt as O,xt as k,y as A,z as j}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as M,w as N,x as te}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as P,n as F,o as I,r as L}from"./app-Bu3kn8yd.js";import{O as R,T as z,b as ne,c as re,d as B,k as V,l as ie,p as H,s as ae,t as oe}from"./dist-DtGNiYlK.js";import{F as se,L as ce,M as le,N as ue,O as de,R as fe,a as U,b as pe,c as W,d as me,f as he,h as ge,i as G,k as _e,l as ve,o as K,p as ye,rt as be,s as q,t as J,u as xe,w as Se,x as Ce}from"./AppIcon-0N56IC2z.js";import{C as Y,a as we,i as Te,n as Ee,r as De,t as X}from"./http-DmyDwIce.js";import{t as Oe}from"./FileIcon-B6dfvt48.js";import{t as ke}from"./BrandLogo-1xuP9ByR.js";import{a as Ae}from"./format-BsuBtvUs.js";var je=V({name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]}),Me=V({name:`check-check`,size:24,node:[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]}),Ne=V({name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]}),Pe=V({name:`file-check`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]}),Fe=V({name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]}),Ie=V({name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]}),Le=V({name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]}),Re=V({name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]}),ze=V({name:`user-round-pen`,size:24,node:[[`path`,{d:`M2 21a8 8 0 0 1 10.821-7.487`,key:`1c8h7z`}],[`path`,{d:`M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`1817ys`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}]]}),Be=x({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Se(),{forwardRef:r,currentElement:i}=H();return n.contentId||=a(void 0,`reka-dialog-content`),_(()=>{n.triggerElement.value=i.value}),(e,i)=>(S(),E(u(B),v(t,{ref:u(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":u(n).open.value||!1,"aria-controls":u(n).open.value?u(n).contentId:void 0,"data-state":u(n).open.value?`open`:`closed`,onClick:u(n).onOpenToggle}),{default:w(()=>[k(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}}),[Ve,He]=t([`MenuCheckboxItem`,`MenuRadioItem`],`MenuItemIndicatorContext`),Ue=x({__name:`MenuItemIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=Ve({modelValue:D(!1)});return(e,n)=>(S(),E(u(r),{present:e.forceMount||u(Ce)(u(t).modelValue.value)||u(t).modelValue.value===!0},{default:w(()=>[s(u(B),{as:e.as,"as-child":e.asChild,"data-state":u(pe)(u(t).modelValue.value)},{default:w(()=>[k(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`])]),_:3},8,[`present`]))}}),[We,Ge]=t(`MenuGroup`),Ke=x({__name:`MenuGroup`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=a(void 0,`reka-menu-group`);return Ge({id:n}),(e,r)=>(S(),E(u(B),v({role:`group`},t,{"aria-labelledby":u(n)}),{default:w(()=>[k(e.$slots,`default`)]),_:3},16,[`aria-labelledby`]))}}),qe=x({__name:`MenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=We({id:``});return(e,r)=>(S(),E(u(B),v(t,{id:u(n).id||void 0}),{default:w(()=>[k(e.$slots,`default`)]),_:3},16,[`id`]))}}),[Je,Ye]=t(`MenuRadioGroup`),Xe=x({__name:`MenuRadioGroup`,props:{modelValue:{type:null,required:!1,default:``},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(t,{emit:n}){let r=t,i=n,a=z(r,[`modelValue`]),s=e(a),c=ne(r,`modelValue`,i);return Ye({modelValue:c,onValueChange:e=>{c.value=e}}),(e,t)=>(S(),E(Ke,o(j(u(s))),{default:w(()=>[k(e.$slots,`default`,{modelValue:u(c)})]),_:3},16))}}),Ze=x({__name:`MenuRadioItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(t,{emit:n}){let r=t,i=n,a=z(r,[`value`]),o=e(a),{value:s}=d(r),c=Je(),l=y(()=>c.modelValue.value===s?.value);return He({modelValue:l}),(e,t)=>(S(),E(ge,v({role:`menuitemradio`},u(o),{"aria-checked":l.value,"data-state":u(pe)(l.value),onSelect:t[0]||=async e=>{i(`select`,e),u(c).onValueChange(u(s))}}),{default:w(()=>[k(e.$slots,`default`)]),_:3},16,[`aria-checked`,`data-state`]))}}),Qe=x({__name:`DropdownMenuItemIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return H(),(e,n)=>(S(),E(u(Ue),o(j(t)),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),$e=x({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return H(),(e,n)=>(S(),E(u(qe),o(j(t)),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),et=x({__name:`DropdownMenuRadioGroup`,props:{modelValue:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=i(t);return H(),(e,t)=>(S(),E(u(Xe),o(j({...n,...u(r)})),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),tt=x({__name:`DropdownMenuRadioItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let r=n(e,t);return H(),(e,t)=>(S(),E(u(Ze),o(j(u(r))),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),nt=x({__name:`SheetTrigger`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(S(),E(u(Be),v({"data-slot":`sheet-trigger`},t),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),Z=x({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},inset:{type:Boolean}},setup(t){let n=t,r=ae(n,`class`,`inset`),i=e(r);return(e,r)=>(S(),E(u($e),v({"data-slot":`dropdown-menu-label`,"data-inset":t.inset?``:void 0},u(i),{class:u(ie)(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,n.class)}),{default:w(()=>[k(e.$slots,`default`)]),_:3},16,[`data-inset`,`class`]))}}),rt=x({__name:`DropdownMenuRadioGroup`,props:{modelValue:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let r=n(e,t);return(e,t)=>(S(),E(u(et),v({"data-slot":`dropdown-menu-radio-group`},u(r)),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),it={class:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`},at=x({__name:`DropdownMenuRadioItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`select`],setup(e,{emit:t}){let r=e,i=t,a=ae(r,`class`),o=n(a,i);return(e,t)=>(S(),E(u(tt),v({"data-slot":`dropdown-menu-radio-item`},u(o),{class:u(ie)(`focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r.class)}),{default:w(()=>[m(`span`,it,[s(u(Qe),null,{default:w(()=>[k(e.$slots,`indicator-icon`,{},()=>[s(u(Ne),{class:`size-2 fill-current`})])]),_:3})]),k(e.$slots,`default`)]),_:3},16,[`class`]))}}),ot={key:0,class:`absolute top-1.5 right-1.5 grid h-4 min-w-4 place-items-center rounded-full bg-brand px-1 text-[10px] leading-none font-semibold text-brand-foreground`},st={class:`flex items-center justify-between border-b px-4 py-3`},ct={class:`max-h-[60vh] overflow-y-auto`},lt={key:0,class:`grid place-items-center py-8`},ut={key:1,class:`px-4 py-8 text-center text-sm text-muted-foreground`},dt={key:2,class:`divide-y`},ft=[`onClick`],pt={class:`min-w-0 flex-1`},mt={key:0,class:`mt-0.5 line-clamp-2 block text-[13px] text-muted-foreground`},ht={class:`mt-1 block text-xs text-muted-foreground`},gt={key:0,class:`mt-2 size-2 shrink-0 rounded-full bg-brand`,"aria-label":`ungelesen`},_t={__name:`NotificationBell`,setup(e){let t=P(),n=y(()=>t.props.notifications?.unread??0),r=D(null),i=D(null),a=y(()=>i.value??n.value),o={"file-check":Pe,newspaper:se,undo:_e,message:fe};async function l(e){if(!e)return;r.value=null;let t=await X.get(`/benachrichtigungen`);r.value=t.notifications,i.value=t.unread}async function d(){await X.post(`/benachrichtigungen/gelesen`),r.value=r.value.map(e=>({...e,read:!0})),i.value=0}function f(e){i.value=null,I.visit(`/benachrichtigungen/${e.id}`)}return(e,t)=>(S(),E(u(Te),{"onUpdate:open":l},{default:w(()=>[s(u(Ee),{class:`relative grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground`,"aria-label":a.value?`Benachrichtigungen, ${a.value} ungelesen`:`Benachrichtigungen`},{default:w(()=>[s(u(be),{class:`size-5`}),a.value?(S(),h(`span`,ot,T(a.value>9?`9+`:a.value),1)):A(``,!0)]),_:1},8,[`aria-label`]),s(u(De),{align:`end`,class:`w-[22rem] p-0`},{default:w(()=>[m(`div`,st,[t[1]||=m(`h2`,{class:`text-sm font-semibold`},`Benachrichtigungen`,-1),a.value?(S(),h(`button`,{key:0,type:`button`,class:`inline-flex items-center gap-1 text-xs font-medium text-brand-text hover:underline`,onClick:d},[s(u(Me),{class:`size-3.5`}),t[0]||=c(` Alle gelesen `,-1)])):A(``,!0)]),m(`div`,ct,[r.value===null?(S(),h(`div`,lt,[s(u(R),{class:`size-5 animate-spin text-muted-foreground`})])):r.value.length?(S(),h(`ul`,dt,[(S(!0),h(C,null,g(r.value,e=>(S(),h(`li`,{key:e.id},[m(`button`,{type:`button`,class:`flex w-full gap-3 px-4 py-3 text-left hover:bg-accent/60`,onClick:t=>f(e)},[m(`span`,{class:p([`mt-0.5 grid size-8 shrink-0 place-items-center rounded-full`,e.read?`bg-muted text-muted-foreground`:`bg-brand-soft text-brand-text`])},[(S(),E(O(o[e.icon]??u(be)),{class:`size-4`}))],2),m(`span`,pt,[m(`span`,{class:p([`block text-sm`,e.read?`text-foreground/80`:`font-semibold`])},T(e.title),3),e.body?(S(),h(`span`,mt,T(e.body),1)):A(``,!0),m(`span`,ht,T(u(Ae)(e.created_at)),1)]),e.read?A(``,!0):(S(),h(`span`,gt))],8,ft)]))),128))])):(S(),h(`p`,ut,`Keine Benachrichtigungen.`))])]),_:1})]),_:1}))}},vt=[`href`,`target`,`rel`],Q={__name:`NavLink`,props:{item:{type:Object,required:!0}},setup(e){return(t,n)=>e.item.new_tab||!e.item.href.startsWith(`/`)?(S(),h(`a`,{key:0,href:e.item.href,target:e.item.new_tab?`_blank`:void 0,rel:e.item.new_tab?`noopener`:void 0},[k(t.$slots,`default`)],8,vt)):(S(),E(u(L),{key:1,href:e.item.href},{default:w(()=>[k(t.$slots,`default`)]),_:3},8,[`href`]))}},yt=e=>String(e??``).replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e]);function $(e,t){let n=yt(e),r=String(t??``).trim().split(/\s+/).filter(e=>e.length>=2).map(e=>yt(e).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`));return r.length?n.replace(RegExp(`(${r.join(`|`)})`,`gi`),`$1`):n}var bt={class:`relative block`},xt=[`aria-expanded`],St={key:0,id:`global-search-results`,class:`absolute top-full right-0 z-50 mt-2 max-h-[min(70vh,560px)] w-[min(92vw,30rem)] overflow-y-auto rounded-lg border bg-popover text-popover-foreground shadow-lg`},Ct={class:`flex items-center gap-2 px-4 pt-3 pb-1 text-[11px] font-semibold tracking-wider text-muted-foreground uppercase`},wt={class:`pb-2`},Tt=[`src`],Et={class:`min-w-0 flex-1`},Dt=[`innerHTML`],Ot={key:0,class:`block truncate text-xs text-muted-foreground`},kt=[`innerHTML`],At={key:1,class:`px-4 py-6 text-center text-sm text-muted-foreground`},jt={key:2,class:`px-4 py-6 text-center text-sm text-muted-foreground`},Mt={__name:`GlobalSearchBox`,props:{initial:{type:String,default:``}},setup(e){let t=e,n=D(null),r=D(null),i=D(t.initial),a=D([]),o=D(!1),d=D(!1),_=D(-1),v=0,b=y(()=>a.value.flatMap(e=>e.items)),x=(e,t)=>b.value.indexOf(t),ee=re(async e=>{let t=++v;try{let n=await X.get(`/suche/live?q=${encodeURIComponent(e)}`);t===v&&(a.value=n.groups,_.value=-1)}catch{t===v&&(a.value=[])}finally{t===v&&(o.value=!1)}},220);l(i,e=>{if(e.trim().length<2){v++,a.value=[],o.value=!1;return}o.value=!0,d.value=!0,ee(e.trim())}),oe(n,()=>d.value=!1);function k(e){b.value.length&&(d.value=!0,_.value=(_.value+e+b.value.length)%b.value.length)}function j(e){d.value=!1,e.external?window.location.href=e.url:I.visit(e.url)}function P(){let e=b.value[_.value];if(e)return j(e);i.value.trim().length<2||(d.value=!1,I.get(`/suche`,{q:i.value.trim()}))}let F=y(()=>d.value&&i.value.trim().length>=2);return(e,t)=>(S(),h(`div`,{ref_key:`root`,ref:n,class:`relative`},[m(`form`,{role:`search`,onSubmit:N(P,[`prevent`])},[m(`label`,bt,[t[7]||=m(`span`,{class:`sr-only`},`Portal durchsuchen`,-1),s(u(ue),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),f(m(`input`,{ref_key:`input`,ref:r,"onUpdate:modelValue":t[0]||=e=>i.value=e,type:`search`,placeholder:`Portal durchsuchen …`,autocomplete:`off`,role:`combobox`,"aria-expanded":F.value,"aria-controls":`global-search-results`,class:`h-10 w-full rounded-md border border-input bg-card pr-9 pl-9 text-sm shadow-xs placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`,onFocus:t[1]||=e=>d.value=!0,onKeydown:[t[2]||=M(N(e=>k(1),[`prevent`]),[`down`]),t[3]||=M(N(e=>k(-1),[`prevent`]),[`up`]),t[4]||=M(e=>d.value=!1,[`esc`])]},null,40,xt),[[te,i.value]]),o.value?(S(),E(u(R),{key:0,class:`absolute top-1/2 right-3 size-4 -translate-y-1/2 animate-spin text-muted-foreground`})):A(``,!0)])],32),F.value?(S(),h(`div`,St,[a.value.length?(S(!0),h(C,{key:0},g(a.value,e=>(S(),h(`section`,{key:e.key,class:`border-b last:border-b-0`},[m(`h3`,Ct,[s(J,{name:e.icon,class:`size-3.5`},null,8,[`name`]),c(` `+T(e.label),1)]),m(`ul`,wt,[(S(!0),h(C,null,g(e.items,n=>(S(),h(`li`,{key:n.url},[(S(),E(O(n.external?`a`:u(L)),{href:n.url,class:p([`flex items-start gap-3 px-4 py-2 transition-colors`,x(e,n)===_.value?`bg-accent`:`hover:bg-accent/60`]),onClick:t[5]||=e=>d.value=!1,onMouseenter:t=>_.value=x(e,n)},{default:w(()=>[n.image?(S(),h(`img`,{key:0,src:n.image,alt:``,class:`mt-0.5 size-10 shrink-0 rounded-md object-cover`},null,8,Tt)):n.file?(S(),E(Oe,{key:1,extension:n.file,size:`sm`,class:`mt-0.5`},null,8,[`extension`])):A(``,!0),m(`span`,Et,[m(`span`,{class:`block truncate text-sm font-medium`,innerHTML:u($)(n.title,i.value)},null,8,Dt),n.meta?(S(),h(`span`,Ot,T(n.meta),1)):A(``,!0),n.excerpt?(S(),h(`span`,{key:1,class:`mt-0.5 line-clamp-1 text-xs text-muted-foreground`,innerHTML:u($)(n.excerpt,i.value)},null,8,kt)):A(``,!0)])]),_:2},1064,[`href`,`class`,`onMouseenter`]))]))),128))])]))),128)):o.value?(S(),h(`p`,jt,`Suche läuft …`)):(S(),h(`p`,At,`Keine Treffer für „`+T(i.value.trim())+`“.`,1)),s(u(L),{href:`/suche?q=${encodeURIComponent(i.value.trim())}`,class:`sticky bottom-0 flex items-center justify-between gap-2 border-t bg-muted/60 px-4 py-2.5 text-sm font-medium text-brand-text backdrop-blur hover:bg-muted`,onClick:t[6]||=e=>d.value=!1},{default:w(()=>[c(` Alle Ergebnisse für „`+T(i.value.trim())+`“ `,1),s(u(je),{class:`size-4`})]),_:1},8,[`href`])])):A(``,!0)],512))}},Nt=typeof window<`u`?window.matchMedia(`(prefers-color-scheme: dark)`):null;function Pt(e){let t=e===`dark`||e===`system`&&Nt?.matches;document.documentElement.classList.toggle(`dark`,t),document.documentElement.dataset.theme=e}Nt?.addEventListener(`change`,()=>Pt(document.documentElement.dataset.theme??`system`));function Ft(){let e=P(),t=y(()=>e.props.auth.user?.theme??`system`);function n(e){Pt(e),I.put(`/profil/darstellung`,{theme:e},{preserveScroll:!0,preserveState:!0})}return{preference:t,setPreference:n}}var It={class:`flex min-h-screen flex-col`},Lt={key:0,class:`flex flex-wrap items-center justify-center gap-x-3 gap-y-1 bg-amber-400 px-4 py-1.5 text-center text-[13px] font-medium text-amber-950`},Rt=[`data-header`],zt={class:`mx-auto flex h-16 max-w-[1440px] items-center gap-2 px-4 lg:gap-6 lg:px-6`},Bt={class:`grid gap-1 overflow-y-auto p-3`,"aria-label":`Hauptnavigation`},Vt={key:1,class:`px-3 pt-3 pb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},Ht={key:2,class:`mb-1 ml-3 grid gap-0.5 border-l pl-2`},Ut={class:`pointer-events-none invisible absolute inset-0 overflow-hidden`,"aria-hidden":`true`},Wt={class:`flex h-full items-stretch gap-1`},Gt={key:1,class:`nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand`},Kt={key:1,class:`nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand`},qt={key:0,class:`flex`},Jt={key:0,class:`nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand`},Yt={class:`ml-auto flex shrink-0 items-center gap-1`},Xt={key:0,href:`/admin`,class:`grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground`,"aria-label":`Administration`,title:`Administration`},Zt={class:`min-w-0`},Qt={class:`truncate text-sm font-semibold`},$t={class:`truncate text-xs text-muted-foreground`},en={href:`/admin`},tn={class:`mx-auto w-full max-w-[1440px] flex-1 px-4 py-6 lg:px-6 lg:py-7`},nn={key:1,class:`border-t`},rn={class:`mx-auto flex max-w-[1440px] flex-wrap items-center justify-between gap-x-6 gap-y-2 px-4 py-5 text-[13px] text-muted-foreground lg:px-6`},an={key:0},on={key:1,class:`flex flex-wrap gap-x-5 gap-y-1`,"aria-label":`Fußzeile`},sn=[`href`],cn=84,ln={__name:`AppLayout`,props:{title:{type:String,default:``}},setup(e){let t=P(),n=y(()=>t.props.auth.user),r=y(()=>t.props.branding),i=y(()=>r.value.header_style??`light`),a=y(()=>t.props.navigation),o=D(null),d=D(null),f=D(a.value.length);function v(){let e=o.value,t=d.value?[...d.value.children]:[];if(!e||!t.length)return;let n=t.map(e=>e.getBoundingClientRect().width+4),r=e.clientWidth;if(n.reduce((e,t)=>e+t,0)<=r){f.value=n.length;return}let i=cn,a=0;for(let e of n){if(i+e>r)break;i+=e,a++}f.value=Math.max(1,a)}let x;_(()=>{x=new ResizeObserver(v),o.value&&x.observe(o.value),ee(v),document.fonts?.ready.then(v)}),b(()=>x?.disconnect()),l(a,()=>ee(v));let j=y(()=>a.value.slice(0,f.value)),M=y(()=>a.value.slice(f.value)),{preference:N,setPreference:te}=Ft(),I=D(!1),R=t.url.startsWith(`/suche?`)?new URLSearchParams(t.url.split(`?`)[1]).get(`q`)??``:``,z=[{value:`system`,label:`Wie im System`,icon:ce},{value:`light`,label:`Hell`,icon:Re},{value:`dark`,label:`Dunkel`,icon:Le}];return(t,l)=>(S(),h(C,null,[e.title?(S(),E(u(F),{key:0,title:e.title},null,8,[`title`])):A(``,!0),m(`div`,It,[r.value.preview?(S(),h(`div`,Lt,[...l[3]||=[c(` Vorschau des Entwurfs – so sieht das Portal nach dem Veröffentlichen aus. `,-1),m(`a`,{href:`?vorschau=aus`,class:`underline`},`Vorschau beenden`,-1)]])):A(``,!0),m(`header`,{class:p([`sticky top-0 z-40 border-b`,i.value===`light`?`bg-card/95 backdrop-blur supports-[backdrop-filter]:bg-card/85`:``]),"data-header":i.value},[m(`div`,zt,[s(u(he),{open:I.value,"onUpdate:open":l[2]||=e=>I.value=e},{default:w(()=>[s(u(nt),{class:`-ml-2 grid size-10 place-items-center rounded-md text-foreground/80 hover:bg-accent lg:hidden`,"aria-label":`Menü öffnen`},{default:w(()=>[s(u(Ie),{class:`size-5`})]),_:1}),s(u(me),{side:`left`,class:`w-72 p-0`},{default:w(()=>[s(u(xe),{class:`border-b px-5 py-4`},{default:w(()=>[s(u(ve),{class:`text-left`},{default:w(()=>[s(ke)]),_:1})]),_:1}),m(`nav`,Bt,[(S(!0),h(C,null,g(a.value,e=>(S(),h(C,{key:e.key},[e.href?(S(),E(Q,{key:0,item:e,class:p([`flex items-center gap-2.5 rounded-md px-3 py-2.5 text-[15px] font-medium`,e.active&&!e.children.some(e=>e.active)?`bg-brand-soft text-brand-soft-foreground`:`text-foreground/80 hover:bg-accent`]),onClick:l[0]||=e=>I.value=!1},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-[18px] opacity-80`},null,8,[`name`])):A(``,!0),c(T(e.label),1)]),_:2},1032,[`item`,`class`])):(S(),h(`p`,Vt,T(e.label),1)),e.children.length?(S(),h(`div`,Ht,[(S(!0),h(C,null,g(e.children,e=>(S(),E(Q,{key:e.key,item:e,class:p([`flex items-center gap-2 rounded-md px-3 py-2 text-sm`,e.active?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-foreground/75 hover:bg-accent`]),onClick:l[1]||=e=>I.value=!1},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 opacity-70`},null,8,[`name`])):A(``,!0),c(T(e.label),1)]),_:2},1032,[`item`,`class`]))),128))])):A(``,!0)],64))),128))])]),_:1})]),_:1},8,[`open`]),s(u(L),{href:`/`,class:`shrink-0 text-foreground`,"aria-label":`Startseite`},{default:w(()=>[s(ke,{inverted:i.value!==`light`,compact:``},null,8,[`inverted`])]),_:1}),m(`nav`,{ref_key:`navBox`,ref:o,class:`relative hidden h-full min-w-0 flex-1 lg:block`,"aria-label":`Hauptnavigation`},[m(`div`,Ut,[m(`ul`,{ref_key:`navMeasure`,ref:d,class:`flex w-max gap-1`},[(S(!0),h(C,null,g(a.value,e=>(S(),h(`li`,{key:e.key,class:`flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap`},[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4`},null,8,[`name`])):A(``,!0),c(T(e.label),1),e.children.length?(S(),E(u(Y),{key:1,class:`size-4`})):A(``,!0)]))),128))],512)]),m(`ul`,Wt,[(S(!0),h(C,null,g(j.value,e=>(S(),h(`li`,{key:e.key,class:`flex`},[e.children.length?(S(),E(u(W),{key:0},{default:w(()=>[s(u(G),{class:p([`relative flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none`,e.active?`text-foreground`:`text-foreground/70 hover:text-foreground`])},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 opacity-80`},null,8,[`name`])):A(``,!0),c(T(e.label)+` `,1),s(u(Y),{class:`size-4 opacity-70`}),e.active?(S(),h(`span`,Gt)):A(``,!0)]),_:2},1032,[`class`]),s(u(q),{align:`start`,class:`min-w-56`},{default:w(()=>[e.href?(S(),h(C,{key:0},[s(u(K),{"as-child":``},{default:w(()=>[s(Q,{item:e,class:p(e.active&&!e.children.some(e=>e.active)?`font-semibold text-brand-text`:`font-medium`)},{default:w(()=>[c(T(e.label)+` – Übersicht`,1)]),_:2},1032,[`item`,`class`])]),_:2},1024),s(u(U))],64)):A(``,!0),(S(!0),h(C,null,g(e.children,e=>(S(),E(u(K),{key:e.key,"as-child":``},{default:w(()=>[s(Q,{item:e,class:p(e.active?`font-semibold text-brand-text`:``)},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 text-muted-foreground`},null,8,[`name`])):A(``,!0),c(T(e.label),1)]),_:2},1032,[`item`,`class`])]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)):(S(),E(Q,{key:1,item:e,class:p([`relative flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap transition-colors`,e.active?`text-foreground`:`text-foreground/70 hover:text-foreground`]),"aria-current":e.active?`page`:void 0},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 opacity-80`},null,8,[`name`])):A(``,!0),c(T(e.label)+` `,1),e.active?(S(),h(`span`,Kt)):A(``,!0)]),_:2},1032,[`item`,`class`,`aria-current`]))]))),128)),M.value.length?(S(),h(`li`,qt,[s(u(W),null,{default:w(()=>[s(u(G),{class:p([`relative flex items-center gap-1 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none`,M.value.some(e=>e.active)?`text-foreground`:`text-foreground/70 hover:text-foreground`])},{default:w(()=>[l[4]||=c(` Mehr `,-1),s(u(Y),{class:`size-4`}),M.value.some(e=>e.active)?(S(),h(`span`,Jt)):A(``,!0)]),_:1},8,[`class`]),s(u(q),{align:`start`,class:`min-w-48`},{default:w(()=>[(S(!0),h(C,null,g(M.value,(e,t)=>(S(),h(C,{key:e.key},[e.children.length?(S(),h(C,{key:0},[t?(S(),E(u(U),{key:0})):A(``,!0),s(u(Z),{class:`text-xs text-muted-foreground`},{default:w(()=>[c(T(e.label),1)]),_:2},1024),e.href?(S(),E(u(K),{key:1,"as-child":``},{default:w(()=>[s(Q,{item:e},{default:w(()=>[...l[5]||=[c(`Übersicht`,-1)]]),_:1},8,[`item`])]),_:2},1024)):A(``,!0),(S(!0),h(C,null,g(e.children,e=>(S(),E(u(K),{key:e.key,"as-child":``},{default:w(()=>[s(Q,{item:e,class:p(e.active?`font-semibold text-brand-text`:``)},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 text-muted-foreground`},null,8,[`name`])):A(``,!0),c(T(e.label),1)]),_:2},1032,[`item`,`class`])]),_:2},1024))),128))],64)):(S(),E(u(K),{key:1,"as-child":``},{default:w(()=>[s(Q,{item:e,class:p(e.active?`font-semibold text-brand-text`:``)},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 text-muted-foreground`},null,8,[`name`])):A(``,!0),c(T(e.label),1)]),_:2},1032,[`item`,`class`])]),_:2},1024))],64))),128))]),_:1})]),_:1})])):A(``,!0)])],512),m(`div`,Yt,[s(Mt,{initial:u(R),class:`mr-2 hidden w-64 md:block xl:w-80`},null,8,[`initial`]),s(u(L),{href:`/suche`,class:`grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground md:hidden`,"aria-label":`Portal durchsuchen`},{default:w(()=>[s(u(ue),{class:`size-5`})]),_:1}),s(_t),n.value.can_admin?(S(),h(`a`,Xt,[s(u(le),{class:`size-5`})])):A(``,!0),s(u(W),null,{default:w(()=>[s(u(G),{class:`ml-1 flex items-center gap-1.5 rounded-full py-1 pr-1.5 pl-1 hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none`,"aria-label":`Menü für ${n.value.name}`},{default:w(()=>[s(ye,{person:n.value,class:`size-9`},null,8,[`person`]),s(u(Y),{class:`size-4 text-muted-foreground`})]),_:1},8,[`aria-label`]),s(u(q),{align:`end`,class:`w-72`},{default:w(()=>[s(u(Z),{class:`flex items-center gap-3 py-2 font-normal`},{default:w(()=>[s(ye,{person:n.value,class:`size-10`},null,8,[`person`]),m(`div`,Zt,[m(`div`,Qt,T(n.value.name),1),m(`div`,$t,T(n.value.email),1)])]),_:1}),s(u(U)),s(u(K),{"as-child":``},{default:w(()=>[s(u(L),{href:`/personen/${n.value.id}`},{default:w(()=>[s(u(de)),l[6]||=c(` Mein Profil`,-1)]),_:1},8,[`href`])]),_:1}),s(u(K),{"as-child":``},{default:w(()=>[s(u(L),{href:`/profil/bearbeiten`},{default:w(()=>[s(u(ze)),l[7]||=c(` Profil bearbeiten`,-1)]),_:1})]),_:1}),n.value.can_admin?(S(),E(u(K),{key:0,"as-child":``},{default:w(()=>[m(`a`,en,[s(u(le)),l[8]||=c(` Administration`,-1)])]),_:1})):A(``,!0),r.value.color_mode?A(``,!0):(S(),h(C,{key:1},[s(u(U)),s(u(Z),{class:`text-xs font-medium text-muted-foreground`},{default:w(()=>[...l[9]||=[c(`Darstellung`,-1)]]),_:1}),s(u(rt),{"model-value":u(N),"onUpdate:modelValue":u(te)},{default:w(()=>[(S(),h(C,null,g(z,e=>s(u(at),{key:e.value,value:e.value},{default:w(()=>[(S(),E(O(e.icon),{class:`size-4 text-muted-foreground`})),c(` `+T(e.label),1)]),_:2},1032,[`value`])),64))]),_:1},8,[`model-value`,`onUpdate:modelValue`])],64)),s(u(U)),s(u(K),{"as-child":``},{default:w(()=>[s(u(L),{href:`/logout`,method:`post`,as:`button`,class:`w-full`},{default:w(()=>[s(u(Fe)),l[10]||=c(` Abmelden`,-1)]),_:1})]),_:1})]),_:1})]),_:1})])])],10,Rt),m(`main`,tn,[k(t.$slots,`default`)]),r.value.footer.text||r.value.footer.links.length?(S(),h(`footer`,nn,[m(`div`,rn,[r.value.footer.text?(S(),h(`p`,an,T(r.value.footer.text),1)):A(``,!0),r.value.footer.links.length?(S(),h(`nav`,on,[(S(!0),h(C,null,g(r.value.footer.links,e=>(S(),h(`a`,{key:e.url,href:e.url,class:`hover:text-foreground hover:underline`},T(e.label),9,sn))),128))])):A(``,!0)])])):A(``,!0)]),s(u(we),{position:`bottom-right`})],64))}};export{je as a,Fe as i,$ as n,ze as r,ln as t}; \ No newline at end of file +import{a as e,d as t,i as n,n as r,o as i,r as a}from"./usePrimitiveElement-DC7UloPZ.js";import{$n as o,D as s,E as c,Ht as l,On as u,Tn as d,Yt as f,Zn as p,_ as m,b as h,bt as g,ct as _,et as v,g as y,it as b,k as x,mt as S,o as C,qt as w,tr as T,tt as ee,v as E,vn as D,wt as O,xt as k,y as A,z as j}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as M,w as N,x as te}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as P,n as F,o as I,r as L}from"./app-BNwrc_lv.js";import{O as R,T as z,b as ne,c as re,d as B,k as V,l as ie,p as H,s as ae,t as oe}from"./dist-DtGNiYlK.js";import{F as se,L as ce,M as le,N as ue,O as de,R as fe,a as U,b as pe,c as W,d as me,f as he,h as ge,i as G,k as _e,l as ve,o as K,p as ye,rt as be,s as q,t as J,u as xe,w as Se,x as Ce}from"./AppIcon-nlhvQfK7.js";import{a as we,i as Te,n as Y,o as Ee,r as De,w as X}from"./http-CAG9BrJF.js";import{t as Oe}from"./FileIcon-BctWLKDw.js";import{t as ke}from"./BrandLogo-B9g_TCsV.js";import{a as Ae}from"./format-BsuBtvUs.js";var je=V({name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]}),Me=V({name:`check-check`,size:24,node:[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]}),Ne=V({name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]}),Pe=V({name:`file-check`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m9 15 2 2 4-4`,key:`1grp1n`}]]}),Fe=V({name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]}),Ie=V({name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]}),Le=V({name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]}),Re=V({name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]}),ze=V({name:`user-round-pen`,size:24,node:[[`path`,{d:`M2 21a8 8 0 0 1 10.821-7.487`,key:`1c8h7z`}],[`path`,{d:`M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`1817ys`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}]]}),Be=x({__name:`DialogTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=Se(),{forwardRef:r,currentElement:i}=H();return n.contentId||=a(void 0,`reka-dialog-content`),_(()=>{n.triggerElement.value=i.value}),(e,i)=>(S(),E(u(B),v(t,{ref:u(r),type:e.as===`button`?`button`:void 0,"aria-haspopup":`dialog`,"aria-expanded":u(n).open.value||!1,"aria-controls":u(n).open.value?u(n).contentId:void 0,"data-state":u(n).open.value?`open`:`closed`,onClick:u(n).onOpenToggle}),{default:w(()=>[k(e.$slots,`default`)]),_:3},16,[`type`,`aria-expanded`,`aria-controls`,`data-state`,`onClick`]))}}),[Ve,He]=t([`MenuCheckboxItem`,`MenuRadioItem`],`MenuItemIndicatorContext`),Ue=x({__name:`MenuItemIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=Ve({modelValue:D(!1)});return(e,n)=>(S(),E(u(r),{present:e.forceMount||u(Ce)(u(t).modelValue.value)||u(t).modelValue.value===!0},{default:w(()=>[s(u(B),{as:e.as,"as-child":e.asChild,"data-state":u(pe)(u(t).modelValue.value)},{default:w(()=>[k(e.$slots,`default`)]),_:3},8,[`as`,`as-child`,`data-state`])]),_:3},8,[`present`]))}}),[We,Ge]=t(`MenuGroup`),Ke=x({__name:`MenuGroup`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=a(void 0,`reka-menu-group`);return Ge({id:n}),(e,r)=>(S(),E(u(B),v({role:`group`},t,{"aria-labelledby":u(n)}),{default:w(()=>[k(e.$slots,`default`)]),_:3},16,[`aria-labelledby`]))}}),qe=x({__name:`MenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`div`}},setup(e){let t=e,n=We({id:``});return(e,r)=>(S(),E(u(B),v(t,{id:u(n).id||void 0}),{default:w(()=>[k(e.$slots,`default`)]),_:3},16,[`id`]))}}),[Je,Ye]=t(`MenuRadioGroup`),Xe=x({__name:`MenuRadioGroup`,props:{modelValue:{type:null,required:!1,default:``},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(t,{emit:n}){let r=t,i=n,a=z(r,[`modelValue`]),s=e(a),c=ne(r,`modelValue`,i);return Ye({modelValue:c,onValueChange:e=>{c.value=e}}),(e,t)=>(S(),E(Ke,o(j(u(s))),{default:w(()=>[k(e.$slots,`default`,{modelValue:u(c)})]),_:3},16))}}),Ze=x({__name:`MenuRadioItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(t,{emit:n}){let r=t,i=n,a=z(r,[`value`]),o=e(a),{value:s}=d(r),c=Je(),l=y(()=>c.modelValue.value===s?.value);return He({modelValue:l}),(e,t)=>(S(),E(ge,v({role:`menuitemradio`},u(o),{"aria-checked":l.value,"data-state":u(pe)(l.value),onSelect:t[0]||=async e=>{i(`select`,e),u(c).onValueChange(u(s))}}),{default:w(()=>[k(e.$slots,`default`)]),_:3},16,[`aria-checked`,`data-state`]))}}),Qe=x({__name:`DropdownMenuItemIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return H(),(e,n)=>(S(),E(u(Ue),o(j(t)),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),$e=x({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return H(),(e,n)=>(S(),E(u(qe),o(j(t)),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),et=x({__name:`DropdownMenuRadioGroup`,props:{modelValue:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=i(t);return H(),(e,t)=>(S(),E(u(Xe),o(j({...n,...u(r)})),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),tt=x({__name:`DropdownMenuRadioItem`,props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`select`],setup(e,{emit:t}){let r=n(e,t);return H(),(e,t)=>(S(),E(u(Ze),o(j(u(r))),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),nt=x({__name:`SheetTrigger`,props:{asChild:{type:Boolean},as:{}},setup(e){let t=e;return(e,n)=>(S(),E(u(Be),v({"data-slot":`sheet-trigger`},t),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),Z=x({__name:`DropdownMenuLabel`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},inset:{type:Boolean}},setup(t){let n=t,r=ae(n,`class`,`inset`),i=e(r);return(e,r)=>(S(),E(u($e),v({"data-slot":`dropdown-menu-label`,"data-inset":t.inset?``:void 0},u(i),{class:u(ie)(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,n.class)}),{default:w(()=>[k(e.$slots,`default`)]),_:3},16,[`data-inset`,`class`]))}}),rt=x({__name:`DropdownMenuRadioGroup`,props:{modelValue:{},asChild:{type:Boolean},as:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let r=n(e,t);return(e,t)=>(S(),E(u(et),v({"data-slot":`dropdown-menu-radio-group`},u(r)),{default:w(()=>[k(e.$slots,`default`)]),_:3},16))}}),it={class:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`},at=x({__name:`DropdownMenuRadioItem`,props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`select`],setup(e,{emit:t}){let r=e,i=t,a=ae(r,`class`),o=n(a,i);return(e,t)=>(S(),E(u(tt),v({"data-slot":`dropdown-menu-radio-item`},u(o),{class:u(ie)(`focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r.class)}),{default:w(()=>[m(`span`,it,[s(u(Qe),null,{default:w(()=>[k(e.$slots,`indicator-icon`,{},()=>[s(u(Ne),{class:`size-2 fill-current`})])]),_:3})]),k(e.$slots,`default`)]),_:3},16,[`class`]))}}),ot={key:0,class:`absolute top-1.5 right-1.5 grid h-4 min-w-4 place-items-center rounded-full bg-brand px-1 text-[10px] leading-none font-semibold text-brand-foreground`},st={class:`flex items-center justify-between border-b px-4 py-3`},ct={class:`max-h-[60vh] overflow-y-auto`},lt={key:0,class:`grid place-items-center py-8`},ut={key:1,class:`px-4 py-8 text-center text-sm text-muted-foreground`},dt={key:2,class:`divide-y`},ft=[`onClick`],pt={class:`min-w-0 flex-1`},mt={key:0,class:`mt-0.5 line-clamp-2 block text-[13px] text-muted-foreground`},ht={class:`mt-1 block text-xs text-muted-foreground`},gt={key:0,class:`mt-2 size-2 shrink-0 rounded-full bg-brand`,"aria-label":`ungelesen`},_t={__name:`NotificationBell`,setup(e){let t=P(),n=y(()=>t.props.notifications?.unread??0),r=D(null),i=D(null),a=y(()=>i.value??n.value),o={"file-check":Pe,newspaper:se,undo:_e,message:fe};async function l(e){if(!e)return;r.value=null;let t=await Y.get(`/benachrichtigungen`);r.value=t.notifications,i.value=t.unread}async function d(){await Y.post(`/benachrichtigungen/gelesen`),r.value=r.value.map(e=>({...e,read:!0})),i.value=0}function f(e){i.value=null,I.visit(`/benachrichtigungen/${e.id}`)}return(e,t)=>(S(),E(u(we),{"onUpdate:open":l},{default:w(()=>[s(u(De),{class:`relative grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground`,"aria-label":a.value?`Benachrichtigungen, ${a.value} ungelesen`:`Benachrichtigungen`},{default:w(()=>[s(u(be),{class:`size-5`}),a.value?(S(),h(`span`,ot,T(a.value>9?`9+`:a.value),1)):A(``,!0)]),_:1},8,[`aria-label`]),s(u(Te),{align:`end`,class:`w-[22rem] p-0`},{default:w(()=>[m(`div`,st,[t[1]||=m(`h2`,{class:`text-sm font-semibold`},`Benachrichtigungen`,-1),a.value?(S(),h(`button`,{key:0,type:`button`,class:`inline-flex items-center gap-1 text-xs font-medium text-brand-text hover:underline`,onClick:d},[s(u(Me),{class:`size-3.5`}),t[0]||=c(` Alle gelesen `,-1)])):A(``,!0)]),m(`div`,ct,[r.value===null?(S(),h(`div`,lt,[s(u(R),{class:`size-5 animate-spin text-muted-foreground`})])):r.value.length?(S(),h(`ul`,dt,[(S(!0),h(C,null,g(r.value,e=>(S(),h(`li`,{key:e.id},[m(`button`,{type:`button`,class:`flex w-full gap-3 px-4 py-3 text-left hover:bg-accent/60`,onClick:t=>f(e)},[m(`span`,{class:p([`mt-0.5 grid size-8 shrink-0 place-items-center rounded-full`,e.read?`bg-muted text-muted-foreground`:`bg-brand-soft text-brand-text`])},[(S(),E(O(o[e.icon]??u(be)),{class:`size-4`}))],2),m(`span`,pt,[m(`span`,{class:p([`block text-sm`,e.read?`text-foreground/80`:`font-semibold`])},T(e.title),3),e.body?(S(),h(`span`,mt,T(e.body),1)):A(``,!0),m(`span`,ht,T(u(Ae)(e.created_at)),1)]),e.read?A(``,!0):(S(),h(`span`,gt))],8,ft)]))),128))])):(S(),h(`p`,ut,`Keine Benachrichtigungen.`))])]),_:1})]),_:1}))}},vt=[`href`,`target`,`rel`],Q={__name:`NavLink`,props:{item:{type:Object,required:!0}},setup(e){return(t,n)=>e.item.new_tab||!e.item.href.startsWith(`/`)?(S(),h(`a`,{key:0,href:e.item.href,target:e.item.new_tab?`_blank`:void 0,rel:e.item.new_tab?`noopener`:void 0},[k(t.$slots,`default`)],8,vt)):(S(),E(u(L),{key:1,href:e.item.href},{default:w(()=>[k(t.$slots,`default`)]),_:3},8,[`href`]))}},yt=e=>String(e??``).replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e]);function $(e,t){let n=yt(e),r=String(t??``).trim().split(/\s+/).filter(e=>e.length>=2).map(e=>yt(e).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`));return r.length?n.replace(RegExp(`(${r.join(`|`)})`,`gi`),`$1`):n}var bt={class:`relative block`},xt=[`aria-expanded`],St={key:0,id:`global-search-results`,class:`absolute top-full right-0 z-50 mt-2 max-h-[min(70vh,560px)] w-[min(92vw,30rem)] overflow-y-auto rounded-lg border bg-popover text-popover-foreground shadow-lg`},Ct={class:`flex items-center gap-2 px-4 pt-3 pb-1 text-[11px] font-semibold tracking-wider text-muted-foreground uppercase`},wt={class:`pb-2`},Tt=[`src`],Et={class:`min-w-0 flex-1`},Dt=[`innerHTML`],Ot={key:0,class:`block truncate text-xs text-muted-foreground`},kt=[`innerHTML`],At={key:1,class:`px-4 py-6 text-center text-sm text-muted-foreground`},jt={key:2,class:`px-4 py-6 text-center text-sm text-muted-foreground`},Mt={__name:`GlobalSearchBox`,props:{initial:{type:String,default:``}},setup(e){let t=e,n=D(null),r=D(null),i=D(t.initial),a=D([]),o=D(!1),d=D(!1),_=D(-1),v=0,b=y(()=>a.value.flatMap(e=>e.items)),x=(e,t)=>b.value.indexOf(t),ee=re(async e=>{let t=++v;try{let n=await Y.get(`/suche/live?q=${encodeURIComponent(e)}`);t===v&&(a.value=n.groups,_.value=-1)}catch{t===v&&(a.value=[])}finally{t===v&&(o.value=!1)}},220);l(i,e=>{if(e.trim().length<2){v++,a.value=[],o.value=!1;return}o.value=!0,d.value=!0,ee(e.trim())}),oe(n,()=>d.value=!1);function k(e){b.value.length&&(d.value=!0,_.value=(_.value+e+b.value.length)%b.value.length)}function j(e){d.value=!1,e.external?window.location.href=e.url:I.visit(e.url)}function P(){let e=b.value[_.value];if(e)return j(e);i.value.trim().length<2||(d.value=!1,I.get(`/suche`,{q:i.value.trim()}))}let F=y(()=>d.value&&i.value.trim().length>=2);return(e,t)=>(S(),h(`div`,{ref_key:`root`,ref:n,class:`relative`},[m(`form`,{role:`search`,onSubmit:N(P,[`prevent`])},[m(`label`,bt,[t[7]||=m(`span`,{class:`sr-only`},`Portal durchsuchen`,-1),s(u(ue),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),f(m(`input`,{ref_key:`input`,ref:r,"onUpdate:modelValue":t[0]||=e=>i.value=e,type:`search`,placeholder:`Portal durchsuchen …`,autocomplete:`off`,role:`combobox`,"aria-expanded":F.value,"aria-controls":`global-search-results`,class:`h-10 w-full rounded-md border border-input bg-card pr-9 pl-9 text-sm shadow-xs placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`,onFocus:t[1]||=e=>d.value=!0,onKeydown:[t[2]||=M(N(e=>k(1),[`prevent`]),[`down`]),t[3]||=M(N(e=>k(-1),[`prevent`]),[`up`]),t[4]||=M(e=>d.value=!1,[`esc`])]},null,40,xt),[[te,i.value]]),o.value?(S(),E(u(R),{key:0,class:`absolute top-1/2 right-3 size-4 -translate-y-1/2 animate-spin text-muted-foreground`})):A(``,!0)])],32),F.value?(S(),h(`div`,St,[a.value.length?(S(!0),h(C,{key:0},g(a.value,e=>(S(),h(`section`,{key:e.key,class:`border-b last:border-b-0`},[m(`h3`,Ct,[s(J,{name:e.icon,class:`size-3.5`},null,8,[`name`]),c(` `+T(e.label),1)]),m(`ul`,wt,[(S(!0),h(C,null,g(e.items,n=>(S(),h(`li`,{key:n.url},[(S(),E(O(n.external?`a`:u(L)),{href:n.url,class:p([`flex items-start gap-3 px-4 py-2 transition-colors`,x(e,n)===_.value?`bg-accent`:`hover:bg-accent/60`]),onClick:t[5]||=e=>d.value=!1,onMouseenter:t=>_.value=x(e,n)},{default:w(()=>[n.image?(S(),h(`img`,{key:0,src:n.image,alt:``,class:`mt-0.5 size-10 shrink-0 rounded-md object-cover`},null,8,Tt)):n.file?(S(),E(Oe,{key:1,extension:n.file,size:`sm`,class:`mt-0.5`},null,8,[`extension`])):A(``,!0),m(`span`,Et,[m(`span`,{class:`block truncate text-sm font-medium`,innerHTML:u($)(n.title,i.value)},null,8,Dt),n.meta?(S(),h(`span`,Ot,T(n.meta),1)):A(``,!0),n.excerpt?(S(),h(`span`,{key:1,class:`mt-0.5 line-clamp-1 text-xs text-muted-foreground`,innerHTML:u($)(n.excerpt,i.value)},null,8,kt)):A(``,!0)])]),_:2},1064,[`href`,`class`,`onMouseenter`]))]))),128))])]))),128)):o.value?(S(),h(`p`,jt,`Suche läuft …`)):(S(),h(`p`,At,`Keine Treffer für „`+T(i.value.trim())+`“.`,1)),s(u(L),{href:`/suche?q=${encodeURIComponent(i.value.trim())}`,class:`sticky bottom-0 flex items-center justify-between gap-2 border-t bg-muted/60 px-4 py-2.5 text-sm font-medium text-brand-text backdrop-blur hover:bg-muted`,onClick:t[6]||=e=>d.value=!1},{default:w(()=>[c(` Alle Ergebnisse für „`+T(i.value.trim())+`“ `,1),s(u(je),{class:`size-4`})]),_:1},8,[`href`])])):A(``,!0)],512))}},Nt=typeof window<`u`?window.matchMedia(`(prefers-color-scheme: dark)`):null;function Pt(e){let t=e===`dark`||e===`system`&&Nt?.matches;document.documentElement.classList.toggle(`dark`,t),document.documentElement.dataset.theme=e}Nt?.addEventListener(`change`,()=>Pt(document.documentElement.dataset.theme??`system`));function Ft(){let e=P(),t=y(()=>e.props.auth.user?.theme??`system`);function n(e){Pt(e),I.put(`/profil/darstellung`,{theme:e},{preserveScroll:!0,preserveState:!0})}return{preference:t,setPreference:n}}var It={class:`flex min-h-screen flex-col`},Lt={key:0,class:`flex flex-wrap items-center justify-center gap-x-3 gap-y-1 bg-amber-400 px-4 py-1.5 text-center text-[13px] font-medium text-amber-950`},Rt=[`data-header`],zt={class:`mx-auto flex h-16 max-w-[1440px] items-center gap-2 px-4 lg:gap-6 lg:px-6`},Bt={class:`grid gap-1 overflow-y-auto p-3`,"aria-label":`Hauptnavigation`},Vt={key:1,class:`px-3 pt-3 pb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},Ht={key:2,class:`mb-1 ml-3 grid gap-0.5 border-l pl-2`},Ut={class:`pointer-events-none invisible absolute inset-0 overflow-hidden`,"aria-hidden":`true`},Wt={class:`flex h-full items-stretch gap-1`},Gt={key:1,class:`nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand`},Kt={key:1,class:`nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand`},qt={key:0,class:`flex`},Jt={key:0,class:`nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand`},Yt={class:`ml-auto flex shrink-0 items-center gap-1`},Xt={key:0,href:`/admin`,class:`grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground`,"aria-label":`Administration`,title:`Administration`},Zt={class:`min-w-0`},Qt={class:`truncate text-sm font-semibold`},$t={class:`truncate text-xs text-muted-foreground`},en={href:`/admin`},tn={class:`mx-auto w-full max-w-[1440px] flex-1 px-4 py-6 lg:px-6 lg:py-7`},nn={key:1,class:`border-t`},rn={class:`mx-auto flex max-w-[1440px] flex-wrap items-center justify-between gap-x-6 gap-y-2 px-4 py-5 text-[13px] text-muted-foreground lg:px-6`},an={key:0},on={key:1,class:`flex flex-wrap gap-x-5 gap-y-1`,"aria-label":`Fußzeile`},sn=[`href`],cn=84,ln={__name:`AppLayout`,props:{title:{type:String,default:``}},setup(e){let t=P(),n=y(()=>t.props.auth.user),r=y(()=>t.props.branding),i=y(()=>r.value.header_style??`light`),a=y(()=>t.props.navigation),o=D(null),d=D(null),f=D(a.value.length);function v(){let e=o.value,t=d.value?[...d.value.children]:[];if(!e||!t.length)return;let n=t.map(e=>e.getBoundingClientRect().width+4),r=e.clientWidth;if(n.reduce((e,t)=>e+t,0)<=r){f.value=n.length;return}let i=cn,a=0;for(let e of n){if(i+e>r)break;i+=e,a++}f.value=Math.max(1,a)}let x;_(()=>{x=new ResizeObserver(v),o.value&&x.observe(o.value),ee(v),document.fonts?.ready.then(v)}),b(()=>x?.disconnect()),l(a,()=>ee(v));let j=y(()=>a.value.slice(0,f.value)),M=y(()=>a.value.slice(f.value)),{preference:N,setPreference:te}=Ft(),I=D(!1),R=t.url.startsWith(`/suche?`)?new URLSearchParams(t.url.split(`?`)[1]).get(`q`)??``:``,z=[{value:`system`,label:`Wie im System`,icon:ce},{value:`light`,label:`Hell`,icon:Re},{value:`dark`,label:`Dunkel`,icon:Le}];return(t,l)=>(S(),h(C,null,[e.title?(S(),E(u(F),{key:0,title:e.title},null,8,[`title`])):A(``,!0),m(`div`,It,[r.value.preview?(S(),h(`div`,Lt,[...l[3]||=[c(` Vorschau des Entwurfs – so sieht das Portal nach dem Veröffentlichen aus. `,-1),m(`a`,{href:`?vorschau=aus`,class:`underline`},`Vorschau beenden`,-1)]])):A(``,!0),m(`header`,{class:p([`sticky top-0 z-40 border-b`,i.value===`light`?`bg-card/95 backdrop-blur supports-[backdrop-filter]:bg-card/85`:``]),"data-header":i.value},[m(`div`,zt,[s(u(he),{open:I.value,"onUpdate:open":l[2]||=e=>I.value=e},{default:w(()=>[s(u(nt),{class:`-ml-2 grid size-10 place-items-center rounded-md text-foreground/80 hover:bg-accent lg:hidden`,"aria-label":`Menü öffnen`},{default:w(()=>[s(u(Ie),{class:`size-5`})]),_:1}),s(u(me),{side:`left`,class:`w-72 p-0`},{default:w(()=>[s(u(xe),{class:`border-b px-5 py-4`},{default:w(()=>[s(u(ve),{class:`text-left`},{default:w(()=>[s(ke)]),_:1})]),_:1}),m(`nav`,Bt,[(S(!0),h(C,null,g(a.value,e=>(S(),h(C,{key:e.key},[e.href?(S(),E(Q,{key:0,item:e,class:p([`flex items-center gap-2.5 rounded-md px-3 py-2.5 text-[15px] font-medium`,e.active&&!e.children.some(e=>e.active)?`bg-brand-soft text-brand-soft-foreground`:`text-foreground/80 hover:bg-accent`]),onClick:l[0]||=e=>I.value=!1},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-[18px] opacity-80`},null,8,[`name`])):A(``,!0),c(T(e.label),1)]),_:2},1032,[`item`,`class`])):(S(),h(`p`,Vt,T(e.label),1)),e.children.length?(S(),h(`div`,Ht,[(S(!0),h(C,null,g(e.children,e=>(S(),E(Q,{key:e.key,item:e,class:p([`flex items-center gap-2 rounded-md px-3 py-2 text-sm`,e.active?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-foreground/75 hover:bg-accent`]),onClick:l[1]||=e=>I.value=!1},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 opacity-70`},null,8,[`name`])):A(``,!0),c(T(e.label),1)]),_:2},1032,[`item`,`class`]))),128))])):A(``,!0)],64))),128))])]),_:1})]),_:1},8,[`open`]),s(u(L),{href:`/`,class:`shrink-0 text-foreground`,"aria-label":`Startseite`},{default:w(()=>[s(ke,{inverted:i.value!==`light`,compact:``},null,8,[`inverted`])]),_:1}),m(`nav`,{ref_key:`navBox`,ref:o,class:`relative hidden h-full min-w-0 flex-1 lg:block`,"aria-label":`Hauptnavigation`},[m(`div`,Ut,[m(`ul`,{ref_key:`navMeasure`,ref:d,class:`flex w-max gap-1`},[(S(!0),h(C,null,g(a.value,e=>(S(),h(`li`,{key:e.key,class:`flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap`},[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4`},null,8,[`name`])):A(``,!0),c(T(e.label),1),e.children.length?(S(),E(u(X),{key:1,class:`size-4`})):A(``,!0)]))),128))],512)]),m(`ul`,Wt,[(S(!0),h(C,null,g(j.value,e=>(S(),h(`li`,{key:e.key,class:`flex`},[e.children.length?(S(),E(u(W),{key:0},{default:w(()=>[s(u(G),{class:p([`relative flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none`,e.active?`text-foreground`:`text-foreground/70 hover:text-foreground`])},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 opacity-80`},null,8,[`name`])):A(``,!0),c(T(e.label)+` `,1),s(u(X),{class:`size-4 opacity-70`}),e.active?(S(),h(`span`,Gt)):A(``,!0)]),_:2},1032,[`class`]),s(u(q),{align:`start`,class:`min-w-56`},{default:w(()=>[e.href?(S(),h(C,{key:0},[s(u(K),{"as-child":``},{default:w(()=>[s(Q,{item:e,class:p(e.active&&!e.children.some(e=>e.active)?`font-semibold text-brand-text`:`font-medium`)},{default:w(()=>[c(T(e.label)+` – Übersicht`,1)]),_:2},1032,[`item`,`class`])]),_:2},1024),s(u(U))],64)):A(``,!0),(S(!0),h(C,null,g(e.children,e=>(S(),E(u(K),{key:e.key,"as-child":``},{default:w(()=>[s(Q,{item:e,class:p(e.active?`font-semibold text-brand-text`:``)},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 text-muted-foreground`},null,8,[`name`])):A(``,!0),c(T(e.label),1)]),_:2},1032,[`item`,`class`])]),_:2},1024))),128))]),_:2},1024)]),_:2},1024)):(S(),E(Q,{key:1,item:e,class:p([`relative flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap transition-colors`,e.active?`text-foreground`:`text-foreground/70 hover:text-foreground`]),"aria-current":e.active?`page`:void 0},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 opacity-80`},null,8,[`name`])):A(``,!0),c(T(e.label)+` `,1),e.active?(S(),h(`span`,Kt)):A(``,!0)]),_:2},1032,[`item`,`class`,`aria-current`]))]))),128)),M.value.length?(S(),h(`li`,qt,[s(u(W),null,{default:w(()=>[s(u(G),{class:p([`relative flex items-center gap-1 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none`,M.value.some(e=>e.active)?`text-foreground`:`text-foreground/70 hover:text-foreground`])},{default:w(()=>[l[4]||=c(` Mehr `,-1),s(u(X),{class:`size-4`}),M.value.some(e=>e.active)?(S(),h(`span`,Jt)):A(``,!0)]),_:1},8,[`class`]),s(u(q),{align:`start`,class:`min-w-48`},{default:w(()=>[(S(!0),h(C,null,g(M.value,(e,t)=>(S(),h(C,{key:e.key},[e.children.length?(S(),h(C,{key:0},[t?(S(),E(u(U),{key:0})):A(``,!0),s(u(Z),{class:`text-xs text-muted-foreground`},{default:w(()=>[c(T(e.label),1)]),_:2},1024),e.href?(S(),E(u(K),{key:1,"as-child":``},{default:w(()=>[s(Q,{item:e},{default:w(()=>[...l[5]||=[c(`Übersicht`,-1)]]),_:1},8,[`item`])]),_:2},1024)):A(``,!0),(S(!0),h(C,null,g(e.children,e=>(S(),E(u(K),{key:e.key,"as-child":``},{default:w(()=>[s(Q,{item:e,class:p(e.active?`font-semibold text-brand-text`:``)},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 text-muted-foreground`},null,8,[`name`])):A(``,!0),c(T(e.label),1)]),_:2},1032,[`item`,`class`])]),_:2},1024))),128))],64)):(S(),E(u(K),{key:1,"as-child":``},{default:w(()=>[s(Q,{item:e,class:p(e.active?`font-semibold text-brand-text`:``)},{default:w(()=>[e.icon?(S(),E(J,{key:0,name:e.icon,class:`size-4 text-muted-foreground`},null,8,[`name`])):A(``,!0),c(T(e.label),1)]),_:2},1032,[`item`,`class`])]),_:2},1024))],64))),128))]),_:1})]),_:1})])):A(``,!0)])],512),m(`div`,Yt,[s(Mt,{initial:u(R),class:`mr-2 hidden w-64 md:block xl:w-80`},null,8,[`initial`]),s(u(L),{href:`/suche`,class:`grid size-10 place-items-center rounded-md text-foreground/70 hover:bg-accent hover:text-foreground md:hidden`,"aria-label":`Portal durchsuchen`},{default:w(()=>[s(u(ue),{class:`size-5`})]),_:1}),s(_t),n.value.can_admin?(S(),h(`a`,Xt,[s(u(le),{class:`size-5`})])):A(``,!0),s(u(W),null,{default:w(()=>[s(u(G),{class:`ml-1 flex items-center gap-1.5 rounded-full py-1 pr-1.5 pl-1 hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none`,"aria-label":`Menü für ${n.value.name}`},{default:w(()=>[s(ye,{person:n.value,class:`size-9`},null,8,[`person`]),s(u(X),{class:`size-4 text-muted-foreground`})]),_:1},8,[`aria-label`]),s(u(q),{align:`end`,class:`w-72`},{default:w(()=>[s(u(Z),{class:`flex items-center gap-3 py-2 font-normal`},{default:w(()=>[s(ye,{person:n.value,class:`size-10`},null,8,[`person`]),m(`div`,Zt,[m(`div`,Qt,T(n.value.name),1),m(`div`,$t,T(n.value.email),1)])]),_:1}),s(u(U)),s(u(K),{"as-child":``},{default:w(()=>[s(u(L),{href:`/personen/${n.value.id}`},{default:w(()=>[s(u(de)),l[6]||=c(` Mein Profil`,-1)]),_:1},8,[`href`])]),_:1}),s(u(K),{"as-child":``},{default:w(()=>[s(u(L),{href:`/profil/bearbeiten`},{default:w(()=>[s(u(ze)),l[7]||=c(` Profil bearbeiten`,-1)]),_:1})]),_:1}),n.value.can_admin?(S(),E(u(K),{key:0,"as-child":``},{default:w(()=>[m(`a`,en,[s(u(le)),l[8]||=c(` Administration`,-1)])]),_:1})):A(``,!0),r.value.color_mode?A(``,!0):(S(),h(C,{key:1},[s(u(U)),s(u(Z),{class:`text-xs font-medium text-muted-foreground`},{default:w(()=>[...l[9]||=[c(`Darstellung`,-1)]]),_:1}),s(u(rt),{"model-value":u(N),"onUpdate:modelValue":u(te)},{default:w(()=>[(S(),h(C,null,g(z,e=>s(u(at),{key:e.value,value:e.value},{default:w(()=>[(S(),E(O(e.icon),{class:`size-4 text-muted-foreground`})),c(` `+T(e.label),1)]),_:2},1032,[`value`])),64))]),_:1},8,[`model-value`,`onUpdate:modelValue`])],64)),s(u(U)),s(u(K),{"as-child":``},{default:w(()=>[s(u(L),{href:`/logout`,method:`post`,as:`button`,class:`w-full`},{default:w(()=>[s(u(Fe)),l[10]||=c(` Abmelden`,-1)]),_:1})]),_:1})]),_:1})]),_:1})])])],10,Rt),m(`main`,tn,[k(t.$slots,`default`)]),r.value.footer.text||r.value.footer.links.length?(S(),h(`footer`,nn,[m(`div`,rn,[r.value.footer.text?(S(),h(`p`,an,T(r.value.footer.text),1)):A(``,!0),r.value.footer.links.length?(S(),h(`nav`,on,[(S(!0),h(C,null,g(r.value.footer.links,e=>(S(),h(`a`,{key:e.url,href:e.url,class:`hover:text-foreground hover:underline`},T(e.label),9,sn))),128))])):A(``,!0)])])):A(``,!0)]),s(u(Ee),{position:`bottom-right`})],64))}};export{je as a,Fe as i,$ as n,ze as r,ln as t}; \ No newline at end of file diff --git a/public/build/assets/Areas-ByqCHRYS.js b/public/build/assets/Areas-CDCEZN1-.js similarity index 91% rename from public/build/assets/Areas-ByqCHRYS.js rename to public/build/assets/Areas-CDCEZN1-.js index fb3bf5aa..7b7bb3e2 100644 --- a/public/build/assets/Areas-ByqCHRYS.js +++ b/public/build/assets/Areas-CDCEZN1-.js @@ -1 +1 @@ -import{_ as e,b as t,bt as n,mt as r,o as i,qt as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as s}from"./Panel-BASB8Xb9.js";import{t as c}from"./NewsCard-DpbfyO9M.js";var l={class:`-mx-5 flex snap-x scroll-px-5 gap-4 overflow-x-auto px-5 pb-1 [scrollbar-width:none] sm:mx-0 sm:grid sm:grid-cols-2 sm:overflow-visible sm:px-0 sm:pb-0 xl:grid-cols-4 [&::-webkit-scrollbar]:hidden`},u={__name:`Areas`,props:{posts:{type:Array,required:!0}},setup(u){return(d,f)=>(r(),o(s,{title:`Aktuelles aus den Bereichen`,"action-label":`Alle`,"action-href":`/neuigkeiten`},{default:a(()=>[e(`div`,l,[(r(!0),t(i,null,n(u.posts,e=>(r(),o(c,{key:e.id,post:e,class:`w-[78%] shrink-0 snap-start sm:w-auto`},null,8,[`post`]))),128))])]),_:1}))}};export{u as default}; \ No newline at end of file +import{_ as e,b as t,bt as n,mt as r,o as i,qt as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as s}from"./Panel-Dr-NcUuS.js";import{t as c}from"./NewsCard-Cxl6vjIa.js";var l={class:`-mx-5 flex snap-x scroll-px-5 gap-4 overflow-x-auto px-5 pb-1 [scrollbar-width:none] sm:mx-0 sm:grid sm:grid-cols-2 sm:overflow-visible sm:px-0 sm:pb-0 xl:grid-cols-4 [&::-webkit-scrollbar]:hidden`},u={__name:`Areas`,props:{posts:{type:Array,required:!0}},setup(u){return(d,f)=>(r(),o(s,{title:`Aktuelles aus den Bereichen`,"action-label":`Alle`,"action-href":`/neuigkeiten`},{default:a(()=>[e(`div`,l,[(r(!0),t(i,null,n(u.posts,e=>(r(),o(c,{key:e.id,post:e,class:`w-[78%] shrink-0 snap-start sm:w-auto`},null,8,[`post`]))),128))])]),_:1}))}};export{u as default}; \ No newline at end of file diff --git a/public/build/assets/BirthdayItem-CI_wVS_D.js b/public/build/assets/BirthdayItem-ELeKwOyJ.js similarity index 90% rename from public/build/assets/BirthdayItem-CI_wVS_D.js rename to public/build/assets/BirthdayItem-ELeKwOyJ.js index 43b16d4e..1a4029a5 100644 --- a/public/build/assets/BirthdayItem-CI_wVS_D.js +++ b/public/build/assets/BirthdayItem-ELeKwOyJ.js @@ -1 +1 @@ -import{D as e,On as t,Zn as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as u}from"./app-Bu3kn8yd.js";import{nt as d,p as f}from"./AppIcon-0N56IC2z.js";var p={class:`relative shrink-0`},m={key:0,class:`absolute -right-1 -bottom-1 grid size-5 place-items-center rounded-full bg-brand text-brand-foreground ring-2 ring-card`},h={class:`min-w-0 flex-1`},g={class:`block truncate text-sm font-medium group-hover:underline`},_={class:`block truncate text-xs text-muted-foreground`},v={__name:`BirthdayItem`,props:{item:{type:Object,required:!0}},setup(v){let y=e=>new Intl.DateTimeFormat(`de-DE`,{day:`numeric`,month:`long`}).format(new Date(`${e}T12:00:00`)),b=e=>new Intl.DateTimeFormat(`de-DE`,{weekday:`short`}).format(new Date(`${e}T12:00:00`));return(x,S)=>(a(),c(t(u),{href:`/personen/${v.item.person.id}`,class:`group flex items-center gap-3 py-2.5`},{default:o(()=>[r(`span`,p,[e(f,{person:v.item.person,class:`size-10`},null,8,[`person`]),v.item.today?(a(),i(`span`,m,[e(t(d),{class:`size-3`})])):l(``,!0)]),r(`span`,h,[r(`span`,g,s(v.item.person.name),1),r(`span`,_,s(v.item.person.job_title||v.item.person.department),1)]),r(`span`,{class:n([`shrink-0 text-right text-xs`,v.item.today?`font-semibold text-brand-text`:`text-muted-foreground`])},s(v.item.today?`Heute`:`${b(v.item.date)}, ${y(v.item.date)}`),3)]),_:1},8,[`href`]))}};export{v as t}; \ No newline at end of file +import{D as e,On as t,Zn as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as u}from"./app-BNwrc_lv.js";import{nt as d,p as f}from"./AppIcon-nlhvQfK7.js";var p={class:`relative shrink-0`},m={key:0,class:`absolute -right-1 -bottom-1 grid size-5 place-items-center rounded-full bg-brand text-brand-foreground ring-2 ring-card`},h={class:`min-w-0 flex-1`},g={class:`block truncate text-sm font-medium group-hover:underline`},_={class:`block truncate text-xs text-muted-foreground`},v={__name:`BirthdayItem`,props:{item:{type:Object,required:!0}},setup(v){let y=e=>new Intl.DateTimeFormat(`de-DE`,{day:`numeric`,month:`long`}).format(new Date(`${e}T12:00:00`)),b=e=>new Intl.DateTimeFormat(`de-DE`,{weekday:`short`}).format(new Date(`${e}T12:00:00`));return(x,S)=>(a(),c(t(u),{href:`/personen/${v.item.person.id}`,class:`group flex items-center gap-3 py-2.5`},{default:o(()=>[r(`span`,p,[e(f,{person:v.item.person,class:`size-10`},null,8,[`person`]),v.item.today?(a(),i(`span`,m,[e(t(d),{class:`size-3`})])):l(``,!0)]),r(`span`,h,[r(`span`,g,s(v.item.person.name),1),r(`span`,_,s(v.item.person.job_title||v.item.person.department),1)]),r(`span`,{class:n([`shrink-0 text-right text-xs`,v.item.today?`font-semibold text-brand-text`:`text-muted-foreground`])},s(v.item.today?`Heute`:`${b(v.item.date)}, ${y(v.item.date)}`),3)]),_:1},8,[`href`]))}};export{v as t}; \ No newline at end of file diff --git a/public/build/assets/BirthdaysBlock-Brn3I9AH.js b/public/build/assets/BirthdaysBlock-Cw6hWs98.js similarity index 91% rename from public/build/assets/BirthdaysBlock-Brn3I9AH.js rename to public/build/assets/BirthdaysBlock-Cw6hWs98.js index a37ecc40..56d1afc8 100644 --- a/public/build/assets/BirthdaysBlock-Brn3I9AH.js +++ b/public/build/assets/BirthdaysBlock-Cw6hWs98.js @@ -1 +1 @@ -import{_ as e,b as t,bt as n,mt as r,o as i,tr as a,v as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as c}from"./BirthdayItem-CI_wVS_D.js";var l={key:0,class:`mb-3 text-lg font-semibold`},u={class:`divide-y rounded-lg border bg-card px-4`},d={key:0,class:`py-3 text-sm text-muted-foreground`},f={__name:`BirthdaysBlock`,props:{block:{type:Object,required:!0}},setup(f){return(p,m)=>(r(),t(`section`,null,[f.block.data.title?(r(),t(`h3`,l,a(f.block.data.title),1)):s(``,!0),e(`div`,u,[(r(!0),t(i,null,n(f.block.props?.birthdays??[],e=>(r(),o(c,{key:`${e.person.id}-${e.date}`,item:e},null,8,[`item`]))),128)),(f.block.props?.birthdays??[]).length?s(``,!0):(r(),t(`p`,d,`Keine anstehenden Geburtstage.`))])]))}};export{f as default}; \ No newline at end of file +import{_ as e,b as t,bt as n,mt as r,o as i,tr as a,v as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as c}from"./BirthdayItem-ELeKwOyJ.js";var l={key:0,class:`mb-3 text-lg font-semibold`},u={class:`divide-y rounded-lg border bg-card px-4`},d={key:0,class:`py-3 text-sm text-muted-foreground`},f={__name:`BirthdaysBlock`,props:{block:{type:Object,required:!0}},setup(f){return(p,m)=>(r(),t(`section`,null,[f.block.data.title?(r(),t(`h3`,l,a(f.block.data.title),1)):s(``,!0),e(`div`,u,[(r(!0),t(i,null,n(f.block.props?.birthdays??[],e=>(r(),o(c,{key:`${e.person.id}-${e.date}`,item:e},null,8,[`item`]))),128)),(f.block.props?.birthdays??[]).length?s(``,!0):(r(),t(`p`,d,`Keine anstehenden Geburtstage.`))])]))}};export{f as default}; \ No newline at end of file diff --git a/public/build/assets/Box-Cdw55XJf.js b/public/build/assets/Box-NgwHFvBv.js similarity index 86% rename from public/build/assets/Box-Cdw55XJf.js rename to public/build/assets/Box-NgwHFvBv.js index ca40e57c..4a548ddc 100644 --- a/public/build/assets/Box-Cdw55XJf.js +++ b/public/build/assets/Box-NgwHFvBv.js @@ -1 +1 @@ -import{J as e,On as t,Zn as n,_ as r,b as i,mt as a,tr as o,v as s,wt as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{A as u,U as d}from"./AppIcon-0N56IC2z.js";import{S as f,v as p,x as m}from"./http-DmyDwIce.js";import{t as h}from"./circle-alert-D8SqHL0j.js";var g=[`role`],_={class:`min-w-0 flex-1`},v={key:0,class:`mb-2 font-semibold`},y={__name:`Box`,props:{block:{type:Object,required:!0}},setup(y){let b=e(`pagebuilder:list`),x={info:{icon:m,class:`border-sky-200 bg-sky-50 text-sky-950 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-100`,iconClass:`text-sky-600 dark:text-sky-400`},note:{icon:d,class:`border-amber-200 bg-amber-50 text-amber-950 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100`,iconClass:`text-amber-600 dark:text-amber-400`},warning:{icon:p,class:`border-red-200 bg-red-50 text-red-950 dark:border-red-900 dark:bg-red-950/40 dark:text-red-100`,iconClass:`text-red-600 dark:text-red-400`},success:{icon:f,class:`border-emerald-200 bg-emerald-50 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100`,iconClass:`text-emerald-600 dark:text-emerald-400`},neutral:{icon:h,class:`border-border bg-muted text-foreground`,iconClass:`text-muted-foreground`},highlight:{icon:u,class:`border-brand-200 bg-brand-soft text-foreground`,iconClass:`text-brand-text`}};return(e,u)=>(a(),i(`aside`,{class:n([`pb-box flex gap-3 rounded-lg border p-4 @xl:p-5`,x[y.block.data.variant]?.class]),role:y.block.data.variant===`warning`?`alert`:`note`},[y.block.data.show_icon?(a(),s(c(x[y.block.data.variant]?.icon),{key:0,class:n([`mt-0.5 size-5 shrink-0`,x[y.block.data.variant]?.iconClass])},null,8,[`class`])):l(``,!0),r(`div`,_,[y.block.data.title?(a(),i(`p`,v,o(y.block.data.title),1)):l(``,!0),(a(),s(c(t(b)),{item:y.block.items[0]},null,8,[`item`]))])],10,g))}};export{y as default}; \ No newline at end of file +import{J as e,On as t,Zn as n,_ as r,b as i,mt as a,tr as o,v as s,wt as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{A as u,U as d}from"./AppIcon-nlhvQfK7.js";import{C as f,S as p,y as m}from"./http-CAG9BrJF.js";import{t as h}from"./circle-alert-D8SqHL0j.js";var g=[`role`],_={class:`min-w-0 flex-1`},v={key:0,class:`mb-2 font-semibold`},y={__name:`Box`,props:{block:{type:Object,required:!0}},setup(y){let b=e(`pagebuilder:list`),x={info:{icon:p,class:`border-sky-200 bg-sky-50 text-sky-950 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-100`,iconClass:`text-sky-600 dark:text-sky-400`},note:{icon:d,class:`border-amber-200 bg-amber-50 text-amber-950 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100`,iconClass:`text-amber-600 dark:text-amber-400`},warning:{icon:m,class:`border-red-200 bg-red-50 text-red-950 dark:border-red-900 dark:bg-red-950/40 dark:text-red-100`,iconClass:`text-red-600 dark:text-red-400`},success:{icon:f,class:`border-emerald-200 bg-emerald-50 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100`,iconClass:`text-emerald-600 dark:text-emerald-400`},neutral:{icon:h,class:`border-border bg-muted text-foreground`,iconClass:`text-muted-foreground`},highlight:{icon:u,class:`border-brand-200 bg-brand-soft text-foreground`,iconClass:`text-brand-text`}};return(e,u)=>(a(),i(`aside`,{class:n([`pb-box flex gap-3 rounded-lg border p-4 @xl:p-5`,x[y.block.data.variant]?.class]),role:y.block.data.variant===`warning`?`alert`:`note`},[y.block.data.show_icon?(a(),s(c(x[y.block.data.variant]?.icon),{key:0,class:n([`mt-0.5 size-5 shrink-0`,x[y.block.data.variant]?.iconClass])},null,8,[`class`])):l(``,!0),r(`div`,_,[y.block.data.title?(a(),i(`p`,v,o(y.block.data.title),1)):l(``,!0),(a(),s(c(t(b)),{item:y.block.items[0]},null,8,[`item`]))])],10,g))}};export{y as default}; \ No newline at end of file diff --git a/public/build/assets/BrandLogo-1xuP9ByR.js b/public/build/assets/BrandLogo-B9g_TCsV.js similarity index 95% rename from public/build/assets/BrandLogo-1xuP9ByR.js rename to public/build/assets/BrandLogo-B9g_TCsV.js index 3de1800f..0b09bcf4 100644 --- a/public/build/assets/BrandLogo-1xuP9ByR.js +++ b/public/build/assets/BrandLogo-B9g_TCsV.js @@ -1 +1 @@ -import{Zn as e,_ as t,b as n,g as r,mt as i,o as a,tr as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{a as c}from"./app-Bu3kn8yd.js";var l={class:`flex items-center gap-3`},u=[`src`,`alt`],d=[`src`,`alt`],f=[`src`,`alt`],p=[`src`,`alt`],m=[`src`],h={class:`text-[17px] font-semibold tracking-tight`},g={__name:`BrandLogo`,props:{inverted:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},setup(g){let _=g,v=r(()=>c().props.branding),y=r(()=>v.value.portal_name.trim().charAt(0).toUpperCase()),b=r(()=>v.value.logo_dark_url??v.value.logo_url);return(r,c)=>(i(),n(`span`,l,[v.value.logo_url?(i(),n(a,{key:0},[g.compact&&v.value.logo_mark_url?(i(),n(`img`,{key:0,src:v.value.logo_mark_url,alt:v.value.portal_name,class:`size-8 sm:hidden`},null,8,u)):s(``,!0),t(`span`,{class:e(g.compact&&v.value.logo_mark_url?`hidden sm:contents`:`contents`)},[_.inverted?(i(),n(`img`,{key:0,src:b.value,alt:v.value.portal_name,class:`h-8 w-auto`},null,8,d)):(i(),n(a,{key:1},[t(`img`,{src:v.value.logo_url,alt:v.value.portal_name,class:`h-8 w-auto dark:hidden`},null,8,f),t(`img`,{src:b.value,alt:v.value.portal_name,class:`hidden h-8 w-auto dark:block`},null,8,p)],64))],2)],64)):(i(),n(a,{key:1},[v.value.logo_mark_url?(i(),n(`img`,{key:0,src:v.value.logo_mark_url,alt:``,class:`size-8`},null,8,m)):(i(),n(`span`,{key:1,class:e([`grid size-8 place-items-center rounded-md text-base font-bold`,_.inverted?`bg-white/15 text-current`:`bg-brand text-brand-foreground`])},o(y.value),3)),t(`span`,h,o(v.value.portal_name),1)],64))]))}};export{g as t}; \ No newline at end of file +import{Zn as e,_ as t,b as n,g as r,mt as i,o as a,tr as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{a as c}from"./app-BNwrc_lv.js";var l={class:`flex items-center gap-3`},u=[`src`,`alt`],d=[`src`,`alt`],f=[`src`,`alt`],p=[`src`,`alt`],m=[`src`],h={class:`text-[17px] font-semibold tracking-tight`},g={__name:`BrandLogo`,props:{inverted:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},setup(g){let _=g,v=r(()=>c().props.branding),y=r(()=>v.value.portal_name.trim().charAt(0).toUpperCase()),b=r(()=>v.value.logo_dark_url??v.value.logo_url);return(r,c)=>(i(),n(`span`,l,[v.value.logo_url?(i(),n(a,{key:0},[g.compact&&v.value.logo_mark_url?(i(),n(`img`,{key:0,src:v.value.logo_mark_url,alt:v.value.portal_name,class:`size-8 sm:hidden`},null,8,u)):s(``,!0),t(`span`,{class:e(g.compact&&v.value.logo_mark_url?`hidden sm:contents`:`contents`)},[_.inverted?(i(),n(`img`,{key:0,src:b.value,alt:v.value.portal_name,class:`h-8 w-auto`},null,8,d)):(i(),n(a,{key:1},[t(`img`,{src:v.value.logo_url,alt:v.value.portal_name,class:`h-8 w-auto dark:hidden`},null,8,f),t(`img`,{src:b.value,alt:v.value.portal_name,class:`hidden h-8 w-auto dark:block`},null,8,p)],64))],2)],64)):(i(),n(a,{key:1},[v.value.logo_mark_url?(i(),n(`img`,{key:0,src:v.value.logo_mark_url,alt:``,class:`size-8`},null,8,m)):(i(),n(`span`,{key:1,class:e([`grid size-8 place-items-center rounded-md text-base font-bold`,_.inverted?`bg-white/15 text-current`:`bg-brand text-brand-foreground`])},o(y.value),3)),t(`span`,h,o(v.value.portal_name),1)],64))]))}};export{g as t}; \ No newline at end of file diff --git a/public/build/assets/Builder-C8khIh0O.js b/public/build/assets/Builder-C8khIh0O.js deleted file mode 100644 index a37d3e81..00000000 --- a/public/build/assets/Builder-C8khIh0O.js +++ /dev/null @@ -1 +0,0 @@ -import{D as e,E as t,Ht as n,J as r,On as i,Yt as a,Zn as o,_ as s,b as c,bt as l,ct as u,er as d,g as f,gn as p,gt as m,it as h,mt as g,o as _,qt as v,tr as y,v as b,vn as x,wt as S,y as C}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w,x as T}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{n as E,o as D,r as O}from"./app-Bu3kn8yd.js";import{O as k,k as A}from"./dist-DtGNiYlK.js";import{n as j,t as M}from"./arrow-up-Djq_2Npz.js";import{t as ee}from"./arrow-left-BMImfTf2.js";import{C as N,S as te,_ as P,a as ne,b as F,i as re,n as ie,o as I,r as ae,t as oe,x as L,y as R}from"./http-DmyDwIce.js";import{a as z,i as B,n as se,o as ce,r as le,t as V}from"./Switch-CWN1_5O7.js";import{t as ue}from"./eye-CFNQcvaV.js";import{t as H}from"./lock-H7FAhSBr.js";import{t as U}from"./paperclip-DmVAQ5Y5.js";import{t as de}from"./pencil-line-CmAbFj4f.js";import{t as W}from"./plus-B_ij2ng2.js";import{t as fe}from"./save-aFVYiCIj.js";import{t as pe}from"./settings-2-L4P6usDq.js";import{t as me}from"./table-properties-BPjlj2dD.js";import{t as G}from"./trash-DUqnVIgb.js";import{t as K}from"./button-ZHC5mKey.js";import{t as q}from"./NativeSelect-BGasRaNs.js";import{t as J}from"./Input-FGSb2-yK.js";import{t as he}from"./Textarea-DEFXqC2w.js";import{t as ge}from"./FormRenderer-BEg0886q.js";var _e=A({name:`asterisk`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m18.065 8.496-12.125 7`,key:`1h26g9`}],[`path`,{d:`m5.94 8.504 12.125 7`,key:`k77sdm`}]]}),ve=A({name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]}),ye=A({name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]}),be=A({name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]}),xe=A({name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]}),Se=A({name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]}),Ce=A({name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]}),we=A({name:`square-check-big`,size:24,node:[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-square`]}),Y={text:{icon:A({name:`text-cursor-input`,size:24,node:[[`path`,{d:`M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6`,key:`1528k5`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`,key:`13ksps`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`,key:`1n9rhb`}],[`path`,{d:`M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1`,key:`1mj8rg`}],[`path`,{d:`M9 6v12`,key:`velyjx`}]]}),group:`Eingabe`,defaults:{label:`Textzeile`,width:`full`}},textarea:{icon:le,group:`Eingabe`,defaults:{label:`Mehrzeiliger Text`,rows:4,width:`full`}},email:{icon:ve,group:`Eingabe`,defaults:{label:`E-Mail-Adresse`,width:`half`}},phone:{icon:R,group:`Eingabe`,defaults:{label:`Telefonnummer`,width:`half`}},number:{icon:Ce,group:`Eingabe`,defaults:{label:`Zahl`,width:`half`}},date:{icon:ye,group:`Eingabe`,defaults:{label:`Datum`,width:`half`}},select:{icon:be,group:`Auswahl`,defaults:{label:`Auswahlliste`,options:[`Option 1`,`Option 2`],width:`full`}},radio:{icon:xe,group:`Auswahl`,defaults:{label:`Einfachauswahl`,options:[`Ja`,`Nein`],width:`full`}},checkboxes:{icon:F,group:`Auswahl`,defaults:{label:`Mehrfachauswahl`,options:[`Option 1`,`Option 2`,`Option 3`],width:`full`}},checkbox:{icon:we,group:`Auswahl`,defaults:{label:`Ich stimme zu.`,width:`full`}},file:{icon:U,group:`Sonstiges`,defaults:{label:`Datei`,accept:`any`,max_size:10,width:`full`}},heading:{icon:B,group:`Gestaltung`,defaults:{text:`Zwischenüberschrift`}},paragraph:{icon:L,group:`Gestaltung`,defaults:{text:`Hinweistext`}}},X=[`heading`,`paragraph`],Z=[`select`,`radio`,`checkboxes`];function Te(e){return String(e??``).toLowerCase().replace(/ä/g,`ae`).replace(/ö/g,`oe`).replace(/ü/g,`ue`).replace(/ß/g,`ss`).normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/@/g,`_at_`).replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).slice(0,60)}function Q(){return Math.random().toString(36).slice(2,10)}function Ee(e){let t=new Set(e.filter(e=>!e._new&&e.data.key).map(e=>e.data.key));for(let n of e){if(!n._new)continue;let e=Te(n.data.label||n.data.text||n.type)||n.type,r=e;for(let n=2;t.has(r);n++)r=`${e}_${n}`;n.data.key=r,t.add(r)}}function De(e){return{_id:Q(),_new:!0,type:e,data:structuredClone(Y[e].defaults)}}function Oe(e){let t={documents:`.pdf,.doc,.docx,.xls,.xlsx,.odt,.ods,.ppt,.pptx,.txt,.csv,.rtf`,images:`.jpg,.jpeg,.png,.webp,.gif,.heic`,any:``};return e.map(({type:e,data:n})=>({type:e,key:n.key,label:n.label,text:n.text,help:n.help,placeholder:n.placeholder,required:!!n.required,options:(n.options??[]).filter(e=>e!==``),width:n.width??`full`,min:n.min,max:n.max,rows:n.rows,multiple:!!n.multiple,accept:t[n.accept??`any`]||void 0,max_size:n.max_size,locked:!!(n.locked&&n.prefill&&[`text`,`email`,`phone`].includes(e)),condition:n.condition_field?{field:n.condition_field,operator:n.condition_operator??`equals`,value:String(n.condition_value??``)}:null}))}var ke={equals:`ist gleich`,not_equals:`ist nicht`,contains:`enthält`,filled:`ist ausgefüllt`,empty:`ist leer`},Ae=[`data-field-id`],je={class:`fb-handle flex cursor-grab items-center gap-1 px-1 py-0.5 font-medium text-muted-foreground active:cursor-grabbing`,title:`Ziehen zum Verschieben`},Me=[`aria-pressed`],Ne=[`title`],Pe={key:0,class:`mb-1.5 mr-1 inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground`},Fe={key:1,class:`mb-1.5 inline-flex items-center gap-1 rounded bg-amber-100 px-1.5 py-0.5 text-[11px] text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`},Ie={key:4,class:`flex items-start gap-2.5`},Le={key:0,class:`text-destructive`},Re={key:5,class:`grid gap-1.5`},ze={class:`flex items-center gap-0.5 text-[13px] font-medium`},Be={key:0,class:`text-destructive`},Ve={key:1,class:`grid gap-1.5`},He={key:0,class:`grid gap-1 rounded-md border border-dashed p-2`},Ue={class:`w-5 text-right text-xs text-muted-foreground`},We=[`onUpdate:modelValue`,`data-option`,`onKeydown`],Ge=[`onClick`],Ke={key:2,class:`grid gap-1.5`},qe=[`onUpdate:modelValue`,`data-option`,`onKeydown`],Je=[`onClick`],Ye={key:3,class:`flex h-10 items-center justify-center gap-2 rounded-md border border-dashed text-sm text-muted-foreground`},Xe={key:5,class:`flex h-9 items-center gap-2 rounded-md border border-input bg-muted/60 px-3 text-sm text-muted-foreground`},Ze={key:6,class:`rounded-md border border-input bg-card shadow-xs`},Qe=[`placeholder`,`disabled`],$=`w-full min-w-0 rounded-sm bg-transparent outline-none placeholder:text-muted-foreground/60 focus:bg-brand-soft/40`,$e=`field-sizing-content min-w-6 max-w-full rounded-sm bg-transparent outline-none placeholder:text-muted-foreground/60 focus:bg-brand-soft/40`,et=`flex h-9 w-full items-center rounded-md border border-input bg-card px-3 text-sm text-muted-foreground shadow-xs`,tt={__name:`BuilderField`,props:{field:{type:Object,required:!0},index:{type:Number,required:!0}},setup(n){let u=n,p=r(`forms:builder`),m=f(()=>p.selectedId.value===u.field._id),h=f(()=>p.errorIndex.value===u.index),v=f(()=>X.includes(u.field.type)),x=f(()=>u.field.data),E=f(()=>{if(!x.value.condition_field)return null;let e=p.fields.find(e=>e.data.key===x.value.condition_field)?.data.label??x.value.condition_field,t=ke[x.value.condition_operator??`equals`];return[`filled`,`empty`].includes(x.value.condition_operator)?`${e} ${t}`:`${e} ${t} „${x.value.condition_value??``}“`});function D(){x.value.options=[...x.value.options??[],`Option ${(x.value.options?.length??0)+1}`],requestAnimationFrame(()=>document.querySelector(`[data-option="${u.field._id}-${x.value.options.length-1}"]`)?.select())}function O(e){x.value.options=x.value.options.filter((t,n)=>n!==e)}function k(e,t){e.key===`Enter`?(e.preventDefault(),x.value.options.splice(t+1,0,``),requestAnimationFrame(()=>document.querySelector(`[data-option="${u.field._id}-${t+1}"]`)?.focus())):e.key===`Backspace`&&x.value.options[t]===``&&x.value.options.length>1&&(e.preventDefault(),O(t),requestAnimationFrame(()=>document.querySelector(`[data-option="${u.field._id}-${Math.max(0,t-1)}"]`)?.focus()))}return(r,u)=>(g(),c(`div`,{class:o([`group relative rounded-md p-3 outline-offset-2 transition-[outline-color]`,[n.field.data.width===`half`&&!v.value?``:`@xl:col-span-2`,m.value?`bg-brand-soft/30 outline-2 outline-brand-500`:h.value?`outline-2 outline-destructive`:`outline-1 outline-transparent hover:outline-brand-300`]]),"data-field-id":n.field._id,onClick:u[13]||=w(e=>i(p).select(n.field._id),[`stop`])},[s(`div`,{class:o([`absolute -top-3.5 right-2 z-10 items-center gap-0.5 rounded-md border bg-card px-1 py-0.5 text-xs shadow-sm`,m.value?`flex`:`hidden group-hover:flex`]),onClick:u[4]||=w(()=>{},[`stop`])},[s(`span`,je,[e(i(z),{class:`size-3.5`}),(g(),b(S(i(Y)[n.field.type].icon),{class:`size-3.5`})),t(` `+y(i(p).types[n.field.type]),1)]),v.value?C(``,!0):(g(),c(_,{key:0},[u[15]||=s(`span`,{class:`mx-0.5 h-4 w-px bg-border`},null,-1),s(`button`,{type:`button`,class:o([`flex h-6 items-center gap-1 rounded px-1.5`,x.value.required?`bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),"aria-pressed":!!x.value.required,title:`Pflichtfeld`,onClick:u[0]||=e=>x.value.required=!x.value.required},[e(i(_e),{class:`size-3.5`}),u[14]||=t(` Pflicht `,-1)],10,Me),s(`button`,{type:`button`,class:`h-6 rounded px-1.5 text-muted-foreground hover:bg-accent`,title:x.value.width===`half`?`Volle Breite`:`Halbe Breite`,onClick:u[1]||=e=>x.value.width=x.value.width===`half`?`full`:`half`},y(x.value.width===`half`?`½`:`1/1`),9,Ne)],64)),u[16]||=s(`span`,{class:`mx-0.5 h-4 w-px bg-border`},null,-1),s(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Duplizieren`,onClick:u[2]||=e=>i(p).duplicate(n.field._id)},[e(i(ce),{class:`size-3.5`})]),s(`button`,{type:`button`,class:`grid size-6 place-items-center rounded text-destructive hover:bg-destructive/10`,title:`Entfernen`,onClick:u[3]||=e=>i(p).remove(n.field._id)},[e(i(G),{class:`size-3.5`})])],2),x.value.prefill&&!x.value.locked&&!v.value?(g(),c(`p`,Pe,` Vorbelegt: `+y(i(p).prefillOptions.find(e=>e.value===x.value.prefill)?.label??x.value.prefill),1)):C(``,!0),E.value?(g(),c(`p`,Fe,[e(i(Se),{class:`size-3`}),t(` Nur wenn `+y(E.value),1)])):C(``,!0),n.field.type===`heading`?a((g(),c(`input`,{key:2,"onUpdate:modelValue":u[5]||=e=>x.value.text=e,class:o([$,`text-lg font-semibold`]),placeholder:`Zwischenüberschrift`,"aria-label":`Zwischenüberschrift`},null,2)),[[T,x.value.text]]):n.field.type===`paragraph`?a((g(),c(`textarea`,{key:3,"onUpdate:modelValue":u[6]||=e=>x.value.text=e,class:o([$,`field-sizing-content resize-none text-sm leading-relaxed text-muted-foreground`]),rows:`1`,placeholder:`Hinweistext`,"aria-label":`Hinweistext`},null,2)),[[T,x.value.text]]):n.field.type===`checkbox`?(g(),c(`div`,Ie,[u[17]||=s(`span`,{class:`mt-0.5 size-4 shrink-0 rounded-[4px] border border-input bg-card`},null,-1),a(s(`input`,{"onUpdate:modelValue":u[7]||=e=>x.value.label=e,class:o([$e,`text-sm`]),placeholder:`Text neben dem Kästchen`,"aria-label":`Bezeichnung`},null,2),[[T,x.value.label]]),x.value.required?(g(),c(`span`,Le,`*`)):C(``,!0)])):(g(),c(`div`,Re,[s(`div`,ze,[a(s(`input`,{"onUpdate:modelValue":u[8]||=e=>x.value.label=e,class:o($e),placeholder:`Bezeichnung`,"aria-label":`Bezeichnung`},null,512),[[T,x.value.label]]),x.value.required?(g(),c(`span`,Be,`*`)):C(``,!0)]),n.field.type===`textarea`?(g(),c(`div`,{key:0,class:`rounded-md border border-input bg-card shadow-xs`,style:d({height:`${(x.value.rows??4)*1.5+1}rem`})},[a(s(`input`,{"onUpdate:modelValue":u[9]||=e=>x.value.placeholder=e,class:`w-full bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted-foreground/50`,placeholder:`Platzhalter (optional)`,"aria-label":`Platzhalter`},null,512),[[T,x.value.placeholder]])],4)):n.field.type===`select`?(g(),c(`div`,Ve,[s(`div`,{class:o([et,`justify-between`])},[u[18]||=t(`Bitte wählen … `,-1),e(i(N),{class:`size-4`})],2),m.value?(g(),c(`div`,He,[u[20]||=s(`p`,{class:`text-xs text-muted-foreground`},`Auswahlmöglichkeiten`,-1),(g(!0),c(_,null,l(x.value.options,(t,r)=>(g(),c(`div`,{key:r,class:`flex items-center gap-2`},[s(`span`,Ue,y(r+1)+`.`,1),a(s(`input`,{"onUpdate:modelValue":e=>x.value.options[r]=e,"data-option":`${n.field._id}-${r}`,class:o([$,`text-sm`]),placeholder:`Auswahlmöglichkeit`,onKeydown:e=>k(e,r)},null,42,We),[[T,x.value.options[r]]]),s(`button`,{type:`button`,class:`grid size-6 place-items-center rounded text-muted-foreground hover:bg-accent`,title:`Entfernen`,onClick:w(e=>O(r),[`stop`])},[e(i(P),{class:`size-3.5`})],8,Ge)]))),128)),s(`button`,{type:`button`,class:`inline-flex items-center gap-1 justify-self-start text-[13px] font-medium text-brand-text hover:underline`,onClick:w(D,[`stop`])},[e(i(W),{class:`size-3.5`}),u[19]||=t(` Auswahlmöglichkeit`,-1)])])):C(``,!0)])):i(Z).includes(n.field.type)?(g(),c(`div`,Ke,[(g(!0),c(_,null,l(x.value.options,(t,r)=>(g(),c(`div`,{key:r,class:`flex items-center gap-2.5`},[s(`span`,{class:o([`size-4 shrink-0 border border-input bg-card`,n.field.type===`radio`?`rounded-full`:`rounded-[4px]`])},null,2),a(s(`input`,{"onUpdate:modelValue":e=>x.value.options[r]=e,"data-option":`${n.field._id}-${r}`,class:o([$,`text-sm`]),placeholder:`Auswahlmöglichkeit`,onKeydown:e=>k(e,r),onFocus:u[10]||=e=>i(p).select(n.field._id)},null,42,qe),[[T,x.value.options[r]]]),m.value?(g(),c(`button`,{key:0,type:`button`,class:`grid size-6 shrink-0 place-items-center rounded text-muted-foreground hover:bg-accent`,title:`Entfernen`,onClick:w(e=>O(r),[`stop`])},[e(i(P),{class:`size-3.5`})],8,Je)):C(``,!0)]))),128)),m.value?(g(),c(`button`,{key:0,type:`button`,class:`ml-6.5 inline-flex items-center gap-1 justify-self-start text-[13px] font-medium text-brand-text hover:underline`,onClick:w(D,[`stop`])},[e(i(W),{class:`size-3.5`}),u[21]||=t(` Auswahlmöglichkeit`,-1)])):C(``,!0)])):n.field.type===`file`?(g(),c(`div`,Ye,[e(i(U),{class:`size-4`}),t(` `+y(x.value.multiple?`Dateien auswählen`:`Datei auswählen`),1)])):n.field.type===`date`?(g(),c(`div`,{key:4,class:o([et,`justify-between`])},[u[22]||=t(`TT.MM.JJJJ `,-1),e(i(ye),{class:`size-4`})],2)):x.value.locked&&x.value.prefill?(g(),c(`div`,Xe,[e(i(H),{class:`size-3.5`}),t(` Aus dem Profil: `+y(i(p).prefillOptions.find(e=>e.value===x.value.prefill)?.label??x.value.prefill)+` – nicht änderbar `,1)])):(g(),c(`div`,Ze,[a(s(`input`,{"onUpdate:modelValue":u[11]||=e=>x.value.placeholder=e,class:`h-9 w-full bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50`,placeholder:n.field.type===`text`?`Platzhalter (optional)`:``,disabled:n.field.type!==`text`,"aria-label":`Platzhalter`},null,8,Qe),[[T,x.value.placeholder]])])),m.value||x.value.help?a((g(),c(`input`,{key:7,"onUpdate:modelValue":u[12]||=e=>x.value.help=e,class:o([$,`text-[13px] text-muted-foreground`]),placeholder:`Hinweis unter dem Feld hinzufügen …`,"aria-label":`Hinweis`},null,2)),[[T,x.value.help]]):C(``,!0)]))],10,Ae))}},nt={class:`grid gap-5`},rt={class:`flex items-center gap-3`},it={class:`grid size-9 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},at={class:`min-w-0`},ot={class:`font-semibold`},st={key:0,class:`grid gap-1.5`},ct={class:`grid gap-1.5`},lt={class:`flex items-center justify-between gap-3 text-[13px] font-medium`},ut={class:`grid gap-1.5`},dt={class:`grid grid-cols-2 rounded-md border p-0.5 text-[13px]`,role:`group`},ft=[`aria-pressed`,`onClick`],pt={class:`grid gap-1.5`},mt={key:0,class:`grid gap-1.5`},ht={key:1,class:`grid gap-1.5 rounded-md border p-3`},gt={class:`flex items-center justify-between gap-3 text-[13px] font-medium`},_t={class:`text-xs text-muted-foreground`},vt={key:0,class:`text-xs text-amber-700 dark:text-amber-300`},yt={key:2,class:`grid grid-cols-2 gap-3`},bt={key:0,class:`grid gap-1.5`},xt={class:`text-[13px] font-medium`},St={class:`grid gap-1.5`},Ct={class:`text-[13px] font-medium`},wt={key:1,class:`grid gap-1.5`},Tt={class:`grid gap-1.5`},Et={class:`grid gap-1.5`},Dt={class:`flex items-center justify-between gap-3 text-[13px] font-medium`},Ot={key:4,class:`grid gap-1.5`},kt=[`onClick`],At=[`onClick`],jt=[`onClick`],Mt=[`open`],Nt={class:`grid gap-3 border-t px-3 py-3`},Pt={key:0,class:`text-xs text-muted-foreground`},Ft={key:2,class:`grid gap-1.5`},It={__name:`FieldSettings`,props:{field:{type:Object,required:!0}},setup(n){let a=n,u=r(`forms:builder`),d=f(()=>a.field.data),p=f(()=>X.includes(a.field.type)),m=f(()=>{let e=u.fields.findIndex(e=>e._id===a.field._id);return u.fields.slice(0,e).filter(e=>!X.includes(e.type)).map(e=>({value:e.data.key,label:e.data.label||e.data.key}))}),h=f(()=>u.fields.find(e=>e.data.key===d.value.condition_field)),v=f(()=>{let e=h.value;return e?e.type===`checkbox`?[{value:`1`,label:`angehakt`}]:Z.includes(e.type)?(e.data.options??[]).filter(Boolean).map(e=>({value:e,label:e})):null:null});function x(e){if(!e){delete d.value.condition_field,delete d.value.condition_operator,delete d.value.condition_value;return}d.value.condition_field=e,d.value.condition_operator??=`equals`}function w(e,t){let n=[...d.value.options],r=e+t;r<0||r>=n.length||([n[e],n[r]]=[n[r],n[e]],d.value.options=n)}let T=e=>({get:()=>d.value[e]??``,set:t=>t===``||t===null?delete d.value[e]:d.value[e]=Number(t)}),E=f(T(`min`)),D=f(T(`max`)),O=f(T(`rows`)),k=f(T(`max_size`));return(r,a)=>(g(),c(`div`,nt,[s(`header`,rt,[s(`span`,it,[(g(),b(S(i(Y)[n.field.type].icon),{class:`size-4.5`}))]),s(`div`,at,[s(`h2`,ot,y(i(u).types[n.field.type]),1),a[17]||=s(`p`,{class:`text-xs text-muted-foreground`},`Bezeichnung und Auswahlmöglichkeiten bearbeiten Sie direkt im Formular.`,-1)])]),p.value?(g(),c(`label`,st,[a[18]||=s(`span`,{class:`text-[13px] font-medium`},`Text`,-1),n.field.type===`paragraph`?(g(),b(i(he),{key:0,modelValue:d.value.text,"onUpdate:modelValue":a[0]||=e=>d.value.text=e,rows:`4`,maxlength:`3000`},null,8,[`modelValue`])):(g(),b(i(J),{key:1,modelValue:d.value.text,"onUpdate:modelValue":a[1]||=e=>d.value.text=e,maxlength:`200`},null,8,[`modelValue`]))])):(g(),c(_,{key:1},[s(`label`,ct,[a[19]||=s(`span`,{class:`text-[13px] font-medium`},`Bezeichnung`,-1),e(i(J),{modelValue:d.value.label,"onUpdate:modelValue":a[2]||=e=>d.value.label=e,maxlength:`200`},null,8,[`modelValue`])]),s(`label`,lt,[a[20]||=t(` Pflichtfeld `,-1),e(i(V),{"model-value":!!d.value.required,"onUpdate:modelValue":a[3]||=e=>d.value.required=e},null,8,[`model-value`])]),s(`div`,ut,[a[21]||=s(`span`,{class:`text-[13px] font-medium`},`Breite`,-1),s(`div`,dt,[(g(),c(_,null,l([{value:`full`,label:`Volle Breite`},{value:`half`,label:`Halbe Breite`}],e=>s(`button`,{key:e.value,type:`button`,class:o([`rounded py-1.5`,(d.value.width??`full`)===e.value?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),"aria-pressed":(d.value.width??`full`)===e.value,onClick:t=>d.value.width=e.value},y(e.label),11,ft)),64))])]),s(`label`,pt,[a[22]||=s(`span`,{class:`text-[13px] font-medium`},`Hinweis unter dem Feld`,-1),e(i(J),{modelValue:d.value.help,"onUpdate:modelValue":a[4]||=e=>d.value.help=e,maxlength:`300`},null,8,[`modelValue`])]),[`text`,`email`,`phone`].includes(n.field.type)?(g(),c(`label`,mt,[a[23]||=s(`span`,{class:`text-[13px] font-medium`},`Vorbelegen mit`,-1),e(q,{"model-value":d.value.prefill??null,options:i(u).prefillOptions,placeholder:`– nicht vorbelegen –`,"onUpdate:modelValue":a[5]||=e=>e?d.value.prefill=e:(delete d.value.prefill,delete d.value.locked)},null,8,[`model-value`,`options`])])):C(``,!0),[`text`,`email`,`phone`].includes(n.field.type)&&d.value.prefill?(g(),c(`div`,ht,[s(`label`,gt,[a[24]||=t(` Nicht änderbar `,-1),e(i(V),{"model-value":!!d.value.locked,"onUpdate:modelValue":a[6]||=e=>e?d.value.locked=!0:delete d.value.locked},null,8,[`model-value`])]),s(`span`,_t,y(d.value.locked?`Das Feld zeigt den Wert aus dem Profil und kann nicht geändert werden. Beim Absenden wird immer der Profilwert gespeichert.`:`Das Feld ist mit dem Profilwert vorausgefüllt, kann aber geändert werden.`),1),d.value.locked&&i(u).anonymous?(g(),c(`span`,vt,`Achtung: Das Formular ist anonym – diese Profilangabe wird trotzdem mit der Einsendung gespeichert.`)):C(``,!0)])):C(``,!0),[`text`,`textarea`,`number`,`checkboxes`].includes(n.field.type)?(g(),c(`div`,yt,[[`number`,`checkboxes`].includes(n.field.type)?(g(),c(`label`,bt,[s(`span`,xt,y(n.field.type===`checkboxes`?`Mindestens wählen`:`Mindestens`),1),e(i(J),{modelValue:E.value,"onUpdate:modelValue":a[7]||=e=>E.value=e,type:`number`},null,8,[`modelValue`])])):C(``,!0),s(`label`,St,[s(`span`,Ct,y({text:`Höchstlänge`,textarea:`Höchstlänge`,number:`Höchstens`,checkboxes:`Höchstens wählen`}[n.field.type]),1),e(i(J),{modelValue:D.value,"onUpdate:modelValue":a[8]||=e=>D.value=e,type:`number`,min:`1`},null,8,[`modelValue`])]),n.field.type===`textarea`?(g(),c(`label`,wt,[a[25]||=s(`span`,{class:`text-[13px] font-medium`},`Zeilen`,-1),e(i(J),{modelValue:O.value,"onUpdate:modelValue":a[9]||=e=>O.value=e,type:`number`,min:`2`,max:`20`},null,8,[`modelValue`])])):C(``,!0)])):C(``,!0),n.field.type===`file`?(g(),c(_,{key:3},[s(`label`,Tt,[a[26]||=s(`span`,{class:`text-[13px] font-medium`},`Erlaubte Dateien`,-1),e(q,{modelValue:d.value.accept,"onUpdate:modelValue":a[10]||=e=>d.value.accept=e,options:[{value:`documents`,label:`Dokumente (PDF, Office …)`},{value:`images`,label:`Bilder`},{value:`any`,label:`Dokumente und Bilder`}]},null,8,[`modelValue`])]),s(`label`,Et,[a[27]||=s(`span`,{class:`text-[13px] font-medium`},`Höchstgröße in MB`,-1),e(i(J),{modelValue:k.value,"onUpdate:modelValue":a[11]||=e=>k.value=e,type:`number`,min:`1`,max:`50`},null,8,[`modelValue`])]),s(`label`,Dt,[a[28]||=t(` Mehrere Dateien (bis 10) `,-1),e(i(V),{"model-value":!!d.value.multiple,"onUpdate:modelValue":a[12]||=e=>d.value.multiple=e},null,8,[`model-value`])])],64)):C(``,!0),i(Z).includes(n.field.type)?(g(),c(`div`,Ot,[a[30]||=s(`span`,{class:`text-[13px] font-medium`},`Auswahlmöglichkeiten`,-1),(g(!0),c(_,null,l(d.value.options,(t,n)=>(g(),c(`div`,{key:n,class:`flex items-center gap-1`},[e(i(J),{modelValue:d.value.options[n],"onUpdate:modelValue":e=>d.value.options[n]=e,class:`h-8`,maxlength:`200`},null,8,[`modelValue`,`onUpdate:modelValue`]),s(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:e=>w(n,-1)},[e(i(M),{class:`size-3.5`})],8,kt),s(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Nach unten`,onClick:e=>w(n,1)},[e(i(j),{class:`size-3.5`})],8,At),s(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Entfernen`,onClick:e=>d.value.options=d.value.options.filter((e,t)=>t!==n)},[e(i(P),{class:`size-3.5`})],8,jt)]))),128)),s(`button`,{type:`button`,class:`inline-flex items-center gap-1 justify-self-start text-[13px] font-medium text-brand-text hover:underline`,onClick:a[13]||=e=>d.value.options=[...d.value.options??[],``]},[e(i(W),{class:`size-3.5`}),a[29]||=t(` Hinzufügen`,-1)])])):C(``,!0)],64)),s(`details`,{class:`rounded-md border`,open:!!d.value.condition_field},[a[31]||=s(`summary`,{class:`cursor-pointer px-3 py-2 text-[13px] font-medium`},`Nur anzeigen, wenn …`,-1),s(`div`,Nt,[m.value.length?(g(),c(_,{key:1},[e(q,{"model-value":d.value.condition_field??null,options:m.value,placeholder:`– immer anzeigen –`,"aria-label":`Feld`,"onUpdate:modelValue":x},null,8,[`model-value`,`options`]),d.value.condition_field?(g(),c(_,{key:0},[e(q,{modelValue:d.value.condition_operator,"onUpdate:modelValue":a[14]||=e=>d.value.condition_operator=e,options:Object.entries(i(ke)).map(([e,t])=>({value:e,label:t})),"aria-label":`Bedingung`},null,8,[`modelValue`,`options`]),[`filled`,`empty`].includes(d.value.condition_operator)?C(``,!0):(g(),c(_,{key:0},[v.value?(g(),b(q,{key:0,modelValue:d.value.condition_value,"onUpdate:modelValue":a[15]||=e=>d.value.condition_value=e,options:v.value,placeholder:`Wert wählen …`,"aria-label":`Wert`},null,8,[`modelValue`,`options`])):(g(),b(i(J),{key:1,modelValue:d.value.condition_value,"onUpdate:modelValue":a[16]||=e=>d.value.condition_value=e,placeholder:`Wert`,"aria-label":`Wert`},null,8,[`modelValue`]))],64))],64)):C(``,!0)],64)):(g(),c(`p`,Pt,`Bedingungen beziehen sich auf Felder weiter oben im Formular.`))])],8,Mt),p.value?C(``,!0):(g(),c(`label`,Ft,[a[32]||=s(`span`,{class:`text-[13px] font-medium`},`Technischer Schlüssel`,-1),e(i(J),{"model-value":d.value.key,disabled:``,class:`font-mono text-xs`},null,8,[`model-value`]),a[33]||=s(`span`,{class:`text-xs text-muted-foreground`},`Für Export und Bedingungen. Wird aus der Bezeichnung gebildet und bleibt danach gleich.`,-1)]))]))}},Lt={class:`flex h-dvh flex-col bg-background`},Rt={class:`z-30 flex h-14 shrink-0 items-center gap-2 border-b bg-card px-2 sm:px-3`},zt={class:`min-w-0 flex-1`},Bt={class:`truncate text-sm font-semibold`},Vt={class:`flex items-center gap-1 truncate text-xs text-muted-foreground`,"aria-live":`polite`},Ht={class:`flex rounded-md border p-0.5 text-sm`,role:`group`,"aria-label":`Ansicht`},Ut=[`href`],Wt=[`href`],Gt={class:`flex min-h-0 flex-1`},Kt={class:`mx-auto max-w-3xl px-4 py-8`},qt={key:0,class:`mb-4 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-[13px] text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100`},Jt={class:`@container mt-8 rounded-lg border bg-card p-5 sm:p-8`},Yt={key:0,class:`rounded-md border border-dashed p-6 text-center text-sm text-muted-foreground`},Xt={class:`grid grid-cols-2 gap-2`},Zt=[`onClick`],Qt={class:`truncate`},$t={class:`text-3xl font-semibold tracking-tight`},en={key:0,class:`mt-3 leading-relaxed whitespace-pre-line text-muted-foreground`},tn={class:`@container mt-8 rounded-lg border bg-card p-5 sm:p-8`},nn={key:0,class:`hidden w-[340px] shrink-0 flex-col border-l bg-card lg:flex`},rn={class:`min-h-0 flex-1 overflow-y-auto p-4`},an={class:`mb-2 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},on=[`onClick`],sn={class:`truncate`},cn={__name:`Builder`,props:{form:{type:Object,required:!0},types:{type:Object,required:!0},prefillOptions:{type:Array,required:!0},settingsUrl:{type:String,required:!0},resultsUrl:{type:String,default:null}},setup(r){let d=r,A=p({title:d.form.title,description:d.form.description??``,fields:d.form.fields.map(e=>({_id:Q(),type:e.type,data:{...e.data}}))}),j=x(null),M=x(null),N=x(`edit`),P=x(!1),F=x(JSON.stringify(A)),L=f(()=>JSON.stringify(A)!==F.value),R=f(()=>A.fields.find(e=>e._id===j.value)??null);n(()=>A.fields.map(e=>[e._new,e.data.label,e.data.text]),()=>Ee(A.fields),{deep:!0,immediate:!0});function z(e){j.value=e}function B(e,t=null){let n=De(e),r=A.fields.findIndex(e=>e._id===j.value),i=t??(r>=0?r+1:A.fields.length);A.fields.splice(i,0,n),z(n._id),requestAnimationFrame(()=>{let e=document.querySelector(`[data-field-id="${n._id}"]`);e?.scrollIntoView({behavior:`smooth`,block:`center`}),e?.querySelector(`input, textarea`)?.select()})}function ce(e){let t=A.fields.find(t=>t._id===e),n=A.fields.filter(e=>e.data.condition_field&&e.data.condition_field===t?.data.key);(!n.length||window.confirm(`${n.length} Feld(er) hängen von diesem Feld ab. Die Bedingung wird dort entfernt. Trotzdem löschen?`))&&(n.forEach(e=>{delete e.data.condition_field,delete e.data.condition_operator,delete e.data.condition_value}),A.fields=A.fields.filter(t=>t._id!==e),j.value===e&&z(null))}function le(e){let t=A.fields.findIndex(t=>t._id===e),n={_id:Q(),_new:!0,type:A.fields[t].type,data:structuredClone({...A.fields[t].data,key:void 0})};A.fields.splice(t+1,0,n),z(n._id)}m(`forms:builder`,{get fields(){return A.fields},types:d.types,prefillOptions:d.prefillOptions,anonymous:d.form.anonymous,selectedId:j,errorIndex:M,select:z,remove:ce,duplicate:le});async function V(){if(!P.value){P.value=!0,M.value=null;try{let e={title:A.title,description:A.description,fields:A.fields.map(({type:e,data:t})=>({type:e,data:t}))};(await oe.put(`/redaktion/formulare/${d.form.id}`,e)).fields.forEach((e,t)=>{A.fields[t]&&(A.fields[t].data.key=e.data.key,delete A.fields[t]._new)}),F.value=JSON.stringify(A),I.success(`Formular gespeichert`)}catch(e){let[t,n]=Object.entries(e.fieldErrors??{})[0]??[],r=t?.match(/^fields\.(\d+)/);r&&(M.value=Number(r[1]),z(A.fields[M.value]?._id),document.querySelector(`[data-field-id="${j.value}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`})),I.error(n??e.message)}finally{P.value=!1}}}function H(e){(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`?(e.preventDefault(),V()):e.key===`Escape`&&z(null)}function U(e){L.value&&(e.preventDefault(),e.returnValue=``)}let G;u(()=>{window.addEventListener(`keydown`,H),window.addEventListener(`beforeunload`,U),G=D.on(`before`,e=>{if(L.value&&e.detail.visit.method===`get`&&!window.confirm(`Es gibt ungespeicherte Änderungen. Seite trotzdem verlassen?`))return!1})}),h(()=>{window.removeEventListener(`keydown`,H),window.removeEventListener(`beforeunload`,U),G?.()});let q=f(()=>({id:-1,title:A.title,description:A.description,url:`#`,fields:Oe(A.fields),prefill:{},submit_label:`Absenden`,confirmation:``,open:!0})),J=f(()=>{let e={};for(let[t,n]of Object.entries(Y))(e[n.group]??=[]).push({type:t,label:d.types[t],icon:n.icon});return Object.entries(e)});return(n,u)=>(g(),c(_,null,[e(i(E),{title:`Formular: ${A.title}`},null,8,[`title`]),s(`div`,Lt,[s(`header`,Rt,[e(i(O),{href:`/redaktion`,class:`grid size-9 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:`Zurück zur Redaktion`},{default:v(()=>[e(i(ee),{class:`size-5`})]),_:1}),s(`div`,zt,[s(`p`,Bt,y(A.title||`Ohne Titel`),1),s(`p`,Vt,[P.value?(g(),c(_,{key:0},[e(i(k),{class:`size-3 animate-spin`}),u[11]||=t(` Speichert …`,-1)],64)):L.value?(g(),c(_,{key:1},[t(`Ungespeicherte Änderungen`)],64)):(g(),c(_,{key:2},[e(i(te),{class:`size-3`}),t(` Gespeichert · `+y(r.form.submissions)+` Einsendungen`,1)],64))])]),s(`div`,Ht,[s(`button`,{type:`button`,class:o([`flex items-center gap-1.5 rounded px-2.5 py-1`,N.value===`edit`?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),onClick:u[0]||=e=>N.value=`edit`},[e(i(de),{class:`size-4`}),u[12]||=t(),u[13]||=s(`span`,{class:`hidden sm:inline`},`Bearbeiten`,-1)],2),s(`button`,{type:`button`,class:o([`flex items-center gap-1.5 rounded px-2.5 py-1`,N.value===`preview`?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),onClick:u[1]||=e=>{N.value=`preview`,z(null)}},[e(i(ue),{class:`size-4`}),u[14]||=t(),u[15]||=s(`span`,{class:`hidden sm:inline`},`Vorschau`,-1)],2)]),e(i(K),{variant:`ghost`,size:`icon`,"as-child":``,title:`Einstellungen, Benachrichtigung und Zugriff`},{default:v(()=>[s(`a`,{href:r.settingsUrl},[e(i(pe))],8,Ut)]),_:1}),r.resultsUrl?(g(),b(i(K),{key:0,variant:`ghost`,size:`icon`,"as-child":``,title:`Ergebnisse`},{default:v(()=>[s(`a`,{href:r.resultsUrl},[e(i(me))],8,Wt)]),_:1})):C(``,!0),e(i(K),{disabled:P.value||!L.value,onClick:V},{default:v(()=>[e(i(fe)),u[16]||=t(),u[17]||=s(`span`,{class:`hidden sm:inline`},`Speichern`,-1)]),_:1},8,[`disabled`])]),s(`div`,Gt,[s(`main`,{class:`min-w-0 flex-1 overflow-y-auto`,onClick:u[10]||=e=>z(null)},[s(`div`,Kt,[r.form.submissions&&N.value===`edit`?(g(),c(`p`,qt,` Es gibt bereits `+y(r.form.submissions)+` Einsendungen. Umbenennen ist unproblematisch – gelöschte Felder fehlen nur in neuen Einsendungen. `,1)):C(``,!0),N.value===`edit`?(g(),c(_,{key:1},[a(s(`input`,{"onUpdate:modelValue":u[2]||=e=>A.title=e,class:`w-full rounded-sm bg-transparent text-3xl font-semibold tracking-tight outline-none focus:bg-brand-soft/40`,placeholder:`Titel des Formulars`,"aria-label":`Titel`,maxlength:`200`,onClick:u[3]||=w(()=>{},[`stop`])},null,512),[[T,A.title]]),a(s(`textarea`,{"onUpdate:modelValue":u[4]||=e=>A.description=e,class:`field-sizing-content mt-3 w-full resize-none rounded-sm bg-transparent leading-relaxed text-muted-foreground outline-none placeholder:text-muted-foreground/50 focus:bg-brand-soft/40`,placeholder:`Einleitung (optional) – z. B. wofür das Formular gedacht ist und wer es bearbeitet`,"aria-label":`Einleitung`,rows:`1`,maxlength:`2000`,onClick:u[5]||=w(()=>{},[`stop`])},null,512),[[T,A.description]]),s(`div`,Jt,[e(i(se),{modelValue:A.fields,"onUpdate:modelValue":u[6]||=e=>A.fields=e,group:{name:`form-fields`},handle:`.fb-handle`,animation:150,"ghost-class":`pb-ghost`,class:`grid min-h-24 gap-x-5 gap-y-3 @xl:grid-cols-2`,onAdd:u[7]||=e=>z(A.fields[e.newIndex]?._id)},{default:v(()=>[(g(!0),c(_,null,l(A.fields,(e,t)=>(g(),b(tt,{key:e._id,field:e,index:t},null,8,[`field`,`index`]))),128))]),_:1},8,[`modelValue`]),A.fields.length?C(``,!0):(g(),c(`p`,Yt,` Noch keine Felder. Felder aus der rechten Spalte hierher ziehen oder anklicken. `)),e(i(re),null,{default:v(()=>[e(i(ie),{class:`mt-4 flex h-9 w-full items-center justify-center gap-1.5 rounded-md border border-dashed text-sm font-medium text-muted-foreground hover:border-brand-300 hover:bg-brand-soft hover:text-brand-soft-foreground`,onClick:u[8]||=w(()=>{},[`stop`])},{default:v(()=>[e(i(W),{class:`size-4`}),u[18]||=t(` Feld hinzufügen `,-1)]),_:1}),e(i(ae),{class:`w-[22rem] p-3`,onClick:u[9]||=w(()=>{},[`stop`])},{default:v(()=>[s(`div`,Xt,[(g(!0),c(_,null,l(r.types,(e,n)=>(g(),c(`button`,{key:n,type:`button`,class:`flex items-center gap-2 rounded-md border px-2.5 py-2 text-left text-[13px] font-medium hover:border-brand-300 hover:bg-brand-soft/60`,onClick:e=>B(n,A.fields.length)},[(g(),b(S(i(Y)[n].icon),{class:`size-4 shrink-0 text-brand-text`})),u[19]||=t(),s(`span`,Qt,y(e),1)],8,Zt))),128))])]),_:1})]),_:1}),u[20]||=s(`div`,{class:`mt-5 flex items-center gap-4 border-t pt-5`},[s(`span`,{class:`inline-flex h-9 items-center rounded-md bg-brand px-4 text-sm font-medium text-brand-foreground opacity-80`},`Absenden`),s(`span`,{class:`text-xs text-muted-foreground`},`Beschriftung und Bestätigungstext unter „Einstellungen“`)],-1)])],64)):(g(),c(_,{key:2},[s(`h1`,$t,y(A.title),1),A.description?(g(),c(`p`,en,y(A.description),1)):C(``,!0),s(`div`,tn,[(g(),b(ge,{key:JSON.stringify(q.value.fields),form:q.value,preview:``},null,8,[`form`]))]),u[21]||=s(`p`,{class:`mt-3 text-center text-xs text-muted-foreground`},`Vorschau: Bedingungen und Pflichtfelder funktionieren wie im Portal, gesendet wird nichts.`,-1)],64))])]),N.value===`edit`?(g(),c(`aside`,nn,[s(`div`,rn,[R.value?(g(),b(It,{key:R.value._id,field:R.value},null,8,[`field`])):(g(),c(_,{key:1},[u[22]||=s(`p`,{class:`mb-4 text-xs text-muted-foreground`},`Klicken fügt das Feld unter dem ausgewählten ein. Felder lassen sich auch an jede Stelle ziehen.`,-1),(g(!0),c(_,null,l(J.value,([t,n])=>(g(),c(`section`,{key:t,class:`mb-4`},[s(`h3`,an,y(t),1),e(i(se),{"model-value":n,group:{name:`form-fields`,pull:`clone`,put:!1},clone:e=>i(De)(e.type),sort:!1,class:`grid grid-cols-2 gap-2`},{default:v(()=>[(g(!0),c(_,null,l(n,e=>(g(),c(`button`,{key:e.type,type:`button`,class:`flex cursor-grab items-center gap-2 rounded-md border bg-card px-2.5 py-2 text-left text-[13px] font-medium hover:border-brand-300 hover:bg-brand-soft/60 active:cursor-grabbing`,onClick:t=>B(e.type)},[(g(),b(S(e.icon),{class:`size-4 shrink-0 text-brand-text`})),s(`span`,sn,y(e.label),1)],8,on))),128))]),_:2},1032,[`model-value`,`clone`])]))),128))],64))])])):C(``,!0)])]),e(i(ne),{position:`bottom-left`})],64))}};export{cn as default}; \ No newline at end of file diff --git a/public/build/assets/Builder-CNJagWI1.js b/public/build/assets/Builder-CNJagWI1.js new file mode 100644 index 00000000..afb40008 --- /dev/null +++ b/public/build/assets/Builder-CNJagWI1.js @@ -0,0 +1 @@ +import{D as e,E as t,Ht as n,J as r,On as i,Yt as a,Zn as o,_ as s,b as c,bt as l,ct as u,er as d,g as f,gn as p,gt as m,it as h,mt as g,o as _,qt as v,tr as y,v as b,vn as x,wt as S,y as C}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w,x as T}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{n as E,o as D,r as O}from"./app-BNwrc_lv.js";import{O as k,k as A}from"./dist-DtGNiYlK.js";import{n as j,t as M}from"./arrow-up-Djq_2Npz.js";import{t as ee}from"./arrow-left-BMImfTf2.js";import{C as te,S as N,a as ne,b as P,i as re,n as ie,o as ae,r as oe,s as se,v as F,w as I,x as L}from"./http-CAG9BrJF.js";import{t as R}from"./copy-DsLby0sm.js";import{t as ce}from"./eye-CFNQcvaV.js";import{a as z,i as le,n as ue,r as B,t as V}from"./Switch-DtqyAsXz.js";import{t as H}from"./lock-H7FAhSBr.js";import{t as U}from"./paperclip-DmVAQ5Y5.js";import{t as de}from"./pencil-line-CmAbFj4f.js";import{t as W}from"./plus-B_ij2ng2.js";import{t as fe}from"./save-aFVYiCIj.js";import{t as pe}from"./settings-2-L4P6usDq.js";import{t as me}from"./table-properties-BPjlj2dD.js";import{t as G}from"./trash-DUqnVIgb.js";import{n as K}from"./button-CwUSbS9X.js";import{t as q}from"./NativeSelect-G3km7PmI.js";import{t as J}from"./Input-FGSb2-yK.js";import{t as he}from"./Textarea-DEFXqC2w.js";import{t as ge}from"./FormRenderer-CoNVx1AS.js";var _e=A({name:`asterisk`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m18.065 8.496-12.125 7`,key:`1h26g9`}],[`path`,{d:`m5.94 8.504 12.125 7`,key:`k77sdm`}]]}),ve=A({name:`at-sign`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]}),ye=A({name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]}),be=A({name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]}),xe=A({name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]}),Se=A({name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]}),Ce=A({name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]}),we=A({name:`square-check-big`,size:24,node:[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-square`]}),Y={text:{icon:A({name:`text-cursor-input`,size:24,node:[[`path`,{d:`M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6`,key:`1528k5`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`,key:`13ksps`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`,key:`1n9rhb`}],[`path`,{d:`M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1`,key:`1mj8rg`}],[`path`,{d:`M9 6v12`,key:`velyjx`}]]}),group:`Eingabe`,defaults:{label:`Textzeile`,width:`full`}},textarea:{icon:B,group:`Eingabe`,defaults:{label:`Mehrzeiliger Text`,rows:4,width:`full`}},email:{icon:ve,group:`Eingabe`,defaults:{label:`E-Mail-Adresse`,width:`half`}},phone:{icon:P,group:`Eingabe`,defaults:{label:`Telefonnummer`,width:`half`}},number:{icon:Ce,group:`Eingabe`,defaults:{label:`Zahl`,width:`half`}},date:{icon:ye,group:`Eingabe`,defaults:{label:`Datum`,width:`half`}},select:{icon:be,group:`Auswahl`,defaults:{label:`Auswahlliste`,options:[`Option 1`,`Option 2`],width:`full`}},radio:{icon:xe,group:`Auswahl`,defaults:{label:`Einfachauswahl`,options:[`Ja`,`Nein`],width:`full`}},checkboxes:{icon:L,group:`Auswahl`,defaults:{label:`Mehrfachauswahl`,options:[`Option 1`,`Option 2`,`Option 3`],width:`full`}},checkbox:{icon:we,group:`Auswahl`,defaults:{label:`Ich stimme zu.`,width:`full`}},file:{icon:U,group:`Sonstiges`,defaults:{label:`Datei`,accept:`any`,max_size:10,width:`full`}},heading:{icon:le,group:`Gestaltung`,defaults:{text:`Zwischenüberschrift`}},paragraph:{icon:N,group:`Gestaltung`,defaults:{text:`Hinweistext`}}},X=[`heading`,`paragraph`],Z=[`select`,`radio`,`checkboxes`];function Te(e){return String(e??``).toLowerCase().replace(/ä/g,`ae`).replace(/ö/g,`oe`).replace(/ü/g,`ue`).replace(/ß/g,`ss`).normalize(`NFKD`).replace(/[̀-ͯ]/g,``).replace(/@/g,`_at_`).replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).slice(0,60)}function Q(){return Math.random().toString(36).slice(2,10)}function Ee(e){let t=new Set(e.filter(e=>!e._new&&e.data.key).map(e=>e.data.key));for(let n of e){if(!n._new)continue;let e=Te(n.data.label||n.data.text||n.type)||n.type,r=e;for(let n=2;t.has(r);n++)r=`${e}_${n}`;n.data.key=r,t.add(r)}}function De(e){return{_id:Q(),_new:!0,type:e,data:structuredClone(Y[e].defaults)}}function Oe(e){let t={documents:`.pdf,.doc,.docx,.xls,.xlsx,.odt,.ods,.ppt,.pptx,.txt,.csv,.rtf`,images:`.jpg,.jpeg,.png,.webp,.gif,.heic`,any:``};return e.map(({type:e,data:n})=>({type:e,key:n.key,label:n.label,text:n.text,help:n.help,placeholder:n.placeholder,required:!!n.required,options:(n.options??[]).filter(e=>e!==``),width:n.width??`full`,min:n.min,max:n.max,rows:n.rows,multiple:!!n.multiple,accept:t[n.accept??`any`]||void 0,max_size:n.max_size,locked:!!(n.locked&&n.prefill&&[`text`,`email`,`phone`].includes(e)),condition:n.condition_field?{field:n.condition_field,operator:n.condition_operator??`equals`,value:String(n.condition_value??``)}:null}))}var ke={equals:`ist gleich`,not_equals:`ist nicht`,contains:`enthält`,filled:`ist ausgefüllt`,empty:`ist leer`},Ae=[`data-field-id`],je={class:`fb-handle flex cursor-grab items-center gap-1 px-1 py-0.5 font-medium text-muted-foreground active:cursor-grabbing`,title:`Ziehen zum Verschieben`},Me=[`aria-pressed`],Ne=[`title`],Pe={key:0,class:`mb-1.5 mr-1 inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground`},Fe={key:1,class:`mb-1.5 inline-flex items-center gap-1 rounded bg-amber-100 px-1.5 py-0.5 text-[11px] text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`},Ie={key:4,class:`flex items-start gap-2.5`},Le={key:0,class:`text-destructive`},Re={key:5,class:`grid gap-1.5`},ze={class:`flex items-center gap-0.5 text-[13px] font-medium`},Be={key:0,class:`text-destructive`},Ve={key:1,class:`grid gap-1.5`},He={key:0,class:`grid gap-1 rounded-md border border-dashed p-2`},Ue={class:`w-5 text-right text-xs text-muted-foreground`},We=[`onUpdate:modelValue`,`data-option`,`onKeydown`],Ge=[`onClick`],Ke={key:2,class:`grid gap-1.5`},qe=[`onUpdate:modelValue`,`data-option`,`onKeydown`],Je=[`onClick`],Ye={key:3,class:`flex h-10 items-center justify-center gap-2 rounded-md border border-dashed text-sm text-muted-foreground`},Xe={key:5,class:`flex h-9 items-center gap-2 rounded-md border border-input bg-muted/60 px-3 text-sm text-muted-foreground`},Ze={key:6,class:`rounded-md border border-input bg-card shadow-xs`},Qe=[`placeholder`,`disabled`],$=`w-full min-w-0 rounded-sm bg-transparent outline-none placeholder:text-muted-foreground/60 focus:bg-brand-soft/40`,$e=`field-sizing-content min-w-6 max-w-full rounded-sm bg-transparent outline-none placeholder:text-muted-foreground/60 focus:bg-brand-soft/40`,et=`flex h-9 w-full items-center rounded-md border border-input bg-card px-3 text-sm text-muted-foreground shadow-xs`,tt={__name:`BuilderField`,props:{field:{type:Object,required:!0},index:{type:Number,required:!0}},setup(n){let u=n,p=r(`forms:builder`),m=f(()=>p.selectedId.value===u.field._id),h=f(()=>p.errorIndex.value===u.index),v=f(()=>X.includes(u.field.type)),x=f(()=>u.field.data),E=f(()=>{if(!x.value.condition_field)return null;let e=p.fields.find(e=>e.data.key===x.value.condition_field)?.data.label??x.value.condition_field,t=ke[x.value.condition_operator??`equals`];return[`filled`,`empty`].includes(x.value.condition_operator)?`${e} ${t}`:`${e} ${t} „${x.value.condition_value??``}“`});function D(){x.value.options=[...x.value.options??[],`Option ${(x.value.options?.length??0)+1}`],requestAnimationFrame(()=>document.querySelector(`[data-option="${u.field._id}-${x.value.options.length-1}"]`)?.select())}function O(e){x.value.options=x.value.options.filter((t,n)=>n!==e)}function k(e,t){e.key===`Enter`?(e.preventDefault(),x.value.options.splice(t+1,0,``),requestAnimationFrame(()=>document.querySelector(`[data-option="${u.field._id}-${t+1}"]`)?.focus())):e.key===`Backspace`&&x.value.options[t]===``&&x.value.options.length>1&&(e.preventDefault(),O(t),requestAnimationFrame(()=>document.querySelector(`[data-option="${u.field._id}-${Math.max(0,t-1)}"]`)?.focus()))}return(r,u)=>(g(),c(`div`,{class:o([`group relative rounded-md p-3 outline-offset-2 transition-[outline-color]`,[n.field.data.width===`half`&&!v.value?``:`@xl:col-span-2`,m.value?`bg-brand-soft/30 outline-2 outline-brand-500`:h.value?`outline-2 outline-destructive`:`outline-1 outline-transparent hover:outline-brand-300`]]),"data-field-id":n.field._id,onClick:u[13]||=w(e=>i(p).select(n.field._id),[`stop`])},[s(`div`,{class:o([`absolute -top-3.5 right-2 z-10 items-center gap-0.5 rounded-md border bg-card px-1 py-0.5 text-xs shadow-sm`,m.value?`flex`:`hidden group-hover:flex`]),onClick:u[4]||=w(()=>{},[`stop`])},[s(`span`,je,[e(i(z),{class:`size-3.5`}),(g(),b(S(i(Y)[n.field.type].icon),{class:`size-3.5`})),t(` `+y(i(p).types[n.field.type]),1)]),v.value?C(``,!0):(g(),c(_,{key:0},[u[15]||=s(`span`,{class:`mx-0.5 h-4 w-px bg-border`},null,-1),s(`button`,{type:`button`,class:o([`flex h-6 items-center gap-1 rounded px-1.5`,x.value.required?`bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),"aria-pressed":!!x.value.required,title:`Pflichtfeld`,onClick:u[0]||=e=>x.value.required=!x.value.required},[e(i(_e),{class:`size-3.5`}),u[14]||=t(` Pflicht `,-1)],10,Me),s(`button`,{type:`button`,class:`h-6 rounded px-1.5 text-muted-foreground hover:bg-accent`,title:x.value.width===`half`?`Volle Breite`:`Halbe Breite`,onClick:u[1]||=e=>x.value.width=x.value.width===`half`?`full`:`half`},y(x.value.width===`half`?`½`:`1/1`),9,Ne)],64)),u[16]||=s(`span`,{class:`mx-0.5 h-4 w-px bg-border`},null,-1),s(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Duplizieren`,onClick:u[2]||=e=>i(p).duplicate(n.field._id)},[e(i(R),{class:`size-3.5`})]),s(`button`,{type:`button`,class:`grid size-6 place-items-center rounded text-destructive hover:bg-destructive/10`,title:`Entfernen`,onClick:u[3]||=e=>i(p).remove(n.field._id)},[e(i(G),{class:`size-3.5`})])],2),x.value.prefill&&!x.value.locked&&!v.value?(g(),c(`p`,Pe,` Vorbelegt: `+y(i(p).prefillOptions.find(e=>e.value===x.value.prefill)?.label??x.value.prefill),1)):C(``,!0),E.value?(g(),c(`p`,Fe,[e(i(Se),{class:`size-3`}),t(` Nur wenn `+y(E.value),1)])):C(``,!0),n.field.type===`heading`?a((g(),c(`input`,{key:2,"onUpdate:modelValue":u[5]||=e=>x.value.text=e,class:o([$,`text-lg font-semibold`]),placeholder:`Zwischenüberschrift`,"aria-label":`Zwischenüberschrift`},null,2)),[[T,x.value.text]]):n.field.type===`paragraph`?a((g(),c(`textarea`,{key:3,"onUpdate:modelValue":u[6]||=e=>x.value.text=e,class:o([$,`field-sizing-content resize-none text-sm leading-relaxed text-muted-foreground`]),rows:`1`,placeholder:`Hinweistext`,"aria-label":`Hinweistext`},null,2)),[[T,x.value.text]]):n.field.type===`checkbox`?(g(),c(`div`,Ie,[u[17]||=s(`span`,{class:`mt-0.5 size-4 shrink-0 rounded-[4px] border border-input bg-card`},null,-1),a(s(`input`,{"onUpdate:modelValue":u[7]||=e=>x.value.label=e,class:o([$e,`text-sm`]),placeholder:`Text neben dem Kästchen`,"aria-label":`Bezeichnung`},null,2),[[T,x.value.label]]),x.value.required?(g(),c(`span`,Le,`*`)):C(``,!0)])):(g(),c(`div`,Re,[s(`div`,ze,[a(s(`input`,{"onUpdate:modelValue":u[8]||=e=>x.value.label=e,class:o($e),placeholder:`Bezeichnung`,"aria-label":`Bezeichnung`},null,512),[[T,x.value.label]]),x.value.required?(g(),c(`span`,Be,`*`)):C(``,!0)]),n.field.type===`textarea`?(g(),c(`div`,{key:0,class:`rounded-md border border-input bg-card shadow-xs`,style:d({height:`${(x.value.rows??4)*1.5+1}rem`})},[a(s(`input`,{"onUpdate:modelValue":u[9]||=e=>x.value.placeholder=e,class:`w-full bg-transparent px-3 py-2 text-sm outline-none placeholder:text-muted-foreground/50`,placeholder:`Platzhalter (optional)`,"aria-label":`Platzhalter`},null,512),[[T,x.value.placeholder]])],4)):n.field.type===`select`?(g(),c(`div`,Ve,[s(`div`,{class:o([et,`justify-between`])},[u[18]||=t(`Bitte wählen … `,-1),e(i(I),{class:`size-4`})],2),m.value?(g(),c(`div`,He,[u[20]||=s(`p`,{class:`text-xs text-muted-foreground`},`Auswahlmöglichkeiten`,-1),(g(!0),c(_,null,l(x.value.options,(t,r)=>(g(),c(`div`,{key:r,class:`flex items-center gap-2`},[s(`span`,Ue,y(r+1)+`.`,1),a(s(`input`,{"onUpdate:modelValue":e=>x.value.options[r]=e,"data-option":`${n.field._id}-${r}`,class:o([$,`text-sm`]),placeholder:`Auswahlmöglichkeit`,onKeydown:e=>k(e,r)},null,42,We),[[T,x.value.options[r]]]),s(`button`,{type:`button`,class:`grid size-6 place-items-center rounded text-muted-foreground hover:bg-accent`,title:`Entfernen`,onClick:w(e=>O(r),[`stop`])},[e(i(F),{class:`size-3.5`})],8,Ge)]))),128)),s(`button`,{type:`button`,class:`inline-flex items-center gap-1 justify-self-start text-[13px] font-medium text-brand-text hover:underline`,onClick:w(D,[`stop`])},[e(i(W),{class:`size-3.5`}),u[19]||=t(` Auswahlmöglichkeit`,-1)])])):C(``,!0)])):i(Z).includes(n.field.type)?(g(),c(`div`,Ke,[(g(!0),c(_,null,l(x.value.options,(t,r)=>(g(),c(`div`,{key:r,class:`flex items-center gap-2.5`},[s(`span`,{class:o([`size-4 shrink-0 border border-input bg-card`,n.field.type===`radio`?`rounded-full`:`rounded-[4px]`])},null,2),a(s(`input`,{"onUpdate:modelValue":e=>x.value.options[r]=e,"data-option":`${n.field._id}-${r}`,class:o([$,`text-sm`]),placeholder:`Auswahlmöglichkeit`,onKeydown:e=>k(e,r),onFocus:u[10]||=e=>i(p).select(n.field._id)},null,42,qe),[[T,x.value.options[r]]]),m.value?(g(),c(`button`,{key:0,type:`button`,class:`grid size-6 shrink-0 place-items-center rounded text-muted-foreground hover:bg-accent`,title:`Entfernen`,onClick:w(e=>O(r),[`stop`])},[e(i(F),{class:`size-3.5`})],8,Je)):C(``,!0)]))),128)),m.value?(g(),c(`button`,{key:0,type:`button`,class:`ml-6.5 inline-flex items-center gap-1 justify-self-start text-[13px] font-medium text-brand-text hover:underline`,onClick:w(D,[`stop`])},[e(i(W),{class:`size-3.5`}),u[21]||=t(` Auswahlmöglichkeit`,-1)])):C(``,!0)])):n.field.type===`file`?(g(),c(`div`,Ye,[e(i(U),{class:`size-4`}),t(` `+y(x.value.multiple?`Dateien auswählen`:`Datei auswählen`),1)])):n.field.type===`date`?(g(),c(`div`,{key:4,class:o([et,`justify-between`])},[u[22]||=t(`TT.MM.JJJJ `,-1),e(i(ye),{class:`size-4`})],2)):x.value.locked&&x.value.prefill?(g(),c(`div`,Xe,[e(i(H),{class:`size-3.5`}),t(` Aus dem Profil: `+y(i(p).prefillOptions.find(e=>e.value===x.value.prefill)?.label??x.value.prefill)+` – nicht änderbar `,1)])):(g(),c(`div`,Ze,[a(s(`input`,{"onUpdate:modelValue":u[11]||=e=>x.value.placeholder=e,class:`h-9 w-full bg-transparent px-3 text-sm outline-none placeholder:text-muted-foreground/50`,placeholder:n.field.type===`text`?`Platzhalter (optional)`:``,disabled:n.field.type!==`text`,"aria-label":`Platzhalter`},null,8,Qe),[[T,x.value.placeholder]])])),m.value||x.value.help?a((g(),c(`input`,{key:7,"onUpdate:modelValue":u[12]||=e=>x.value.help=e,class:o([$,`text-[13px] text-muted-foreground`]),placeholder:`Hinweis unter dem Feld hinzufügen …`,"aria-label":`Hinweis`},null,2)),[[T,x.value.help]]):C(``,!0)]))],10,Ae))}},nt={class:`grid gap-5`},rt={class:`flex items-center gap-3`},it={class:`grid size-9 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},at={class:`min-w-0`},ot={class:`font-semibold`},st={key:0,class:`grid gap-1.5`},ct={class:`grid gap-1.5`},lt={class:`flex items-center justify-between gap-3 text-[13px] font-medium`},ut={class:`grid gap-1.5`},dt={class:`grid grid-cols-2 rounded-md border p-0.5 text-[13px]`,role:`group`},ft=[`aria-pressed`,`onClick`],pt={class:`grid gap-1.5`},mt={key:0,class:`grid gap-1.5`},ht={key:1,class:`grid gap-1.5 rounded-md border p-3`},gt={class:`flex items-center justify-between gap-3 text-[13px] font-medium`},_t={class:`text-xs text-muted-foreground`},vt={key:0,class:`text-xs text-amber-700 dark:text-amber-300`},yt={key:2,class:`grid grid-cols-2 gap-3`},bt={key:0,class:`grid gap-1.5`},xt={class:`text-[13px] font-medium`},St={class:`grid gap-1.5`},Ct={class:`text-[13px] font-medium`},wt={key:1,class:`grid gap-1.5`},Tt={class:`grid gap-1.5`},Et={class:`grid gap-1.5`},Dt={class:`flex items-center justify-between gap-3 text-[13px] font-medium`},Ot={key:4,class:`grid gap-1.5`},kt=[`onClick`],At=[`onClick`],jt=[`onClick`],Mt=[`open`],Nt={class:`grid gap-3 border-t px-3 py-3`},Pt={key:0,class:`text-xs text-muted-foreground`},Ft={key:2,class:`grid gap-1.5`},It={__name:`FieldSettings`,props:{field:{type:Object,required:!0}},setup(n){let a=n,u=r(`forms:builder`),d=f(()=>a.field.data),p=f(()=>X.includes(a.field.type)),m=f(()=>{let e=u.fields.findIndex(e=>e._id===a.field._id);return u.fields.slice(0,e).filter(e=>!X.includes(e.type)).map(e=>({value:e.data.key,label:e.data.label||e.data.key}))}),h=f(()=>u.fields.find(e=>e.data.key===d.value.condition_field)),v=f(()=>{let e=h.value;return e?e.type===`checkbox`?[{value:`1`,label:`angehakt`}]:Z.includes(e.type)?(e.data.options??[]).filter(Boolean).map(e=>({value:e,label:e})):null:null});function x(e){if(!e){delete d.value.condition_field,delete d.value.condition_operator,delete d.value.condition_value;return}d.value.condition_field=e,d.value.condition_operator??=`equals`}function w(e,t){let n=[...d.value.options],r=e+t;r<0||r>=n.length||([n[e],n[r]]=[n[r],n[e]],d.value.options=n)}let T=e=>({get:()=>d.value[e]??``,set:t=>t===``||t===null?delete d.value[e]:d.value[e]=Number(t)}),E=f(T(`min`)),D=f(T(`max`)),O=f(T(`rows`)),k=f(T(`max_size`));return(r,a)=>(g(),c(`div`,nt,[s(`header`,rt,[s(`span`,it,[(g(),b(S(i(Y)[n.field.type].icon),{class:`size-4.5`}))]),s(`div`,at,[s(`h2`,ot,y(i(u).types[n.field.type]),1),a[17]||=s(`p`,{class:`text-xs text-muted-foreground`},`Bezeichnung und Auswahlmöglichkeiten bearbeiten Sie direkt im Formular.`,-1)])]),p.value?(g(),c(`label`,st,[a[18]||=s(`span`,{class:`text-[13px] font-medium`},`Text`,-1),n.field.type===`paragraph`?(g(),b(i(he),{key:0,modelValue:d.value.text,"onUpdate:modelValue":a[0]||=e=>d.value.text=e,rows:`4`,maxlength:`3000`},null,8,[`modelValue`])):(g(),b(i(J),{key:1,modelValue:d.value.text,"onUpdate:modelValue":a[1]||=e=>d.value.text=e,maxlength:`200`},null,8,[`modelValue`]))])):(g(),c(_,{key:1},[s(`label`,ct,[a[19]||=s(`span`,{class:`text-[13px] font-medium`},`Bezeichnung`,-1),e(i(J),{modelValue:d.value.label,"onUpdate:modelValue":a[2]||=e=>d.value.label=e,maxlength:`200`},null,8,[`modelValue`])]),s(`label`,lt,[a[20]||=t(` Pflichtfeld `,-1),e(i(V),{"model-value":!!d.value.required,"onUpdate:modelValue":a[3]||=e=>d.value.required=e},null,8,[`model-value`])]),s(`div`,ut,[a[21]||=s(`span`,{class:`text-[13px] font-medium`},`Breite`,-1),s(`div`,dt,[(g(),c(_,null,l([{value:`full`,label:`Volle Breite`},{value:`half`,label:`Halbe Breite`}],e=>s(`button`,{key:e.value,type:`button`,class:o([`rounded py-1.5`,(d.value.width??`full`)===e.value?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),"aria-pressed":(d.value.width??`full`)===e.value,onClick:t=>d.value.width=e.value},y(e.label),11,ft)),64))])]),s(`label`,pt,[a[22]||=s(`span`,{class:`text-[13px] font-medium`},`Hinweis unter dem Feld`,-1),e(i(J),{modelValue:d.value.help,"onUpdate:modelValue":a[4]||=e=>d.value.help=e,maxlength:`300`},null,8,[`modelValue`])]),[`text`,`email`,`phone`].includes(n.field.type)?(g(),c(`label`,mt,[a[23]||=s(`span`,{class:`text-[13px] font-medium`},`Vorbelegen mit`,-1),e(q,{"model-value":d.value.prefill??null,options:i(u).prefillOptions,placeholder:`– nicht vorbelegen –`,"onUpdate:modelValue":a[5]||=e=>e?d.value.prefill=e:(delete d.value.prefill,delete d.value.locked)},null,8,[`model-value`,`options`])])):C(``,!0),[`text`,`email`,`phone`].includes(n.field.type)&&d.value.prefill?(g(),c(`div`,ht,[s(`label`,gt,[a[24]||=t(` Nicht änderbar `,-1),e(i(V),{"model-value":!!d.value.locked,"onUpdate:modelValue":a[6]||=e=>e?d.value.locked=!0:delete d.value.locked},null,8,[`model-value`])]),s(`span`,_t,y(d.value.locked?`Das Feld zeigt den Wert aus dem Profil und kann nicht geändert werden. Beim Absenden wird immer der Profilwert gespeichert.`:`Das Feld ist mit dem Profilwert vorausgefüllt, kann aber geändert werden.`),1),d.value.locked&&i(u).anonymous?(g(),c(`span`,vt,`Achtung: Das Formular ist anonym – diese Profilangabe wird trotzdem mit der Einsendung gespeichert.`)):C(``,!0)])):C(``,!0),[`text`,`textarea`,`number`,`checkboxes`].includes(n.field.type)?(g(),c(`div`,yt,[[`number`,`checkboxes`].includes(n.field.type)?(g(),c(`label`,bt,[s(`span`,xt,y(n.field.type===`checkboxes`?`Mindestens wählen`:`Mindestens`),1),e(i(J),{modelValue:E.value,"onUpdate:modelValue":a[7]||=e=>E.value=e,type:`number`},null,8,[`modelValue`])])):C(``,!0),s(`label`,St,[s(`span`,Ct,y({text:`Höchstlänge`,textarea:`Höchstlänge`,number:`Höchstens`,checkboxes:`Höchstens wählen`}[n.field.type]),1),e(i(J),{modelValue:D.value,"onUpdate:modelValue":a[8]||=e=>D.value=e,type:`number`,min:`1`},null,8,[`modelValue`])]),n.field.type===`textarea`?(g(),c(`label`,wt,[a[25]||=s(`span`,{class:`text-[13px] font-medium`},`Zeilen`,-1),e(i(J),{modelValue:O.value,"onUpdate:modelValue":a[9]||=e=>O.value=e,type:`number`,min:`2`,max:`20`},null,8,[`modelValue`])])):C(``,!0)])):C(``,!0),n.field.type===`file`?(g(),c(_,{key:3},[s(`label`,Tt,[a[26]||=s(`span`,{class:`text-[13px] font-medium`},`Erlaubte Dateien`,-1),e(q,{modelValue:d.value.accept,"onUpdate:modelValue":a[10]||=e=>d.value.accept=e,options:[{value:`documents`,label:`Dokumente (PDF, Office …)`},{value:`images`,label:`Bilder`},{value:`any`,label:`Dokumente und Bilder`}]},null,8,[`modelValue`])]),s(`label`,Et,[a[27]||=s(`span`,{class:`text-[13px] font-medium`},`Höchstgröße in MB`,-1),e(i(J),{modelValue:k.value,"onUpdate:modelValue":a[11]||=e=>k.value=e,type:`number`,min:`1`,max:`50`},null,8,[`modelValue`])]),s(`label`,Dt,[a[28]||=t(` Mehrere Dateien (bis 10) `,-1),e(i(V),{"model-value":!!d.value.multiple,"onUpdate:modelValue":a[12]||=e=>d.value.multiple=e},null,8,[`model-value`])])],64)):C(``,!0),i(Z).includes(n.field.type)?(g(),c(`div`,Ot,[a[30]||=s(`span`,{class:`text-[13px] font-medium`},`Auswahlmöglichkeiten`,-1),(g(!0),c(_,null,l(d.value.options,(t,n)=>(g(),c(`div`,{key:n,class:`flex items-center gap-1`},[e(i(J),{modelValue:d.value.options[n],"onUpdate:modelValue":e=>d.value.options[n]=e,class:`h-8`,maxlength:`200`},null,8,[`modelValue`,`onUpdate:modelValue`]),s(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:e=>w(n,-1)},[e(i(M),{class:`size-3.5`})],8,kt),s(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Nach unten`,onClick:e=>w(n,1)},[e(i(j),{class:`size-3.5`})],8,At),s(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Entfernen`,onClick:e=>d.value.options=d.value.options.filter((e,t)=>t!==n)},[e(i(F),{class:`size-3.5`})],8,jt)]))),128)),s(`button`,{type:`button`,class:`inline-flex items-center gap-1 justify-self-start text-[13px] font-medium text-brand-text hover:underline`,onClick:a[13]||=e=>d.value.options=[...d.value.options??[],``]},[e(i(W),{class:`size-3.5`}),a[29]||=t(` Hinzufügen`,-1)])])):C(``,!0)],64)),s(`details`,{class:`rounded-md border`,open:!!d.value.condition_field},[a[31]||=s(`summary`,{class:`cursor-pointer px-3 py-2 text-[13px] font-medium`},`Nur anzeigen, wenn …`,-1),s(`div`,Nt,[m.value.length?(g(),c(_,{key:1},[e(q,{"model-value":d.value.condition_field??null,options:m.value,placeholder:`– immer anzeigen –`,"aria-label":`Feld`,"onUpdate:modelValue":x},null,8,[`model-value`,`options`]),d.value.condition_field?(g(),c(_,{key:0},[e(q,{modelValue:d.value.condition_operator,"onUpdate:modelValue":a[14]||=e=>d.value.condition_operator=e,options:Object.entries(i(ke)).map(([e,t])=>({value:e,label:t})),"aria-label":`Bedingung`},null,8,[`modelValue`,`options`]),[`filled`,`empty`].includes(d.value.condition_operator)?C(``,!0):(g(),c(_,{key:0},[v.value?(g(),b(q,{key:0,modelValue:d.value.condition_value,"onUpdate:modelValue":a[15]||=e=>d.value.condition_value=e,options:v.value,placeholder:`Wert wählen …`,"aria-label":`Wert`},null,8,[`modelValue`,`options`])):(g(),b(i(J),{key:1,modelValue:d.value.condition_value,"onUpdate:modelValue":a[16]||=e=>d.value.condition_value=e,placeholder:`Wert`,"aria-label":`Wert`},null,8,[`modelValue`]))],64))],64)):C(``,!0)],64)):(g(),c(`p`,Pt,`Bedingungen beziehen sich auf Felder weiter oben im Formular.`))])],8,Mt),p.value?C(``,!0):(g(),c(`label`,Ft,[a[32]||=s(`span`,{class:`text-[13px] font-medium`},`Technischer Schlüssel`,-1),e(i(J),{"model-value":d.value.key,disabled:``,class:`font-mono text-xs`},null,8,[`model-value`]),a[33]||=s(`span`,{class:`text-xs text-muted-foreground`},`Für Export und Bedingungen. Wird aus der Bezeichnung gebildet und bleibt danach gleich.`,-1)]))]))}},Lt={class:`flex h-dvh flex-col bg-background`},Rt={class:`z-30 flex h-14 shrink-0 items-center gap-2 border-b bg-card px-2 sm:px-3`},zt={class:`min-w-0 flex-1`},Bt={class:`truncate text-sm font-semibold`},Vt={class:`flex items-center gap-1 truncate text-xs text-muted-foreground`,"aria-live":`polite`},Ht={class:`flex rounded-md border p-0.5 text-sm`,role:`group`,"aria-label":`Ansicht`},Ut=[`href`],Wt=[`href`],Gt={class:`flex min-h-0 flex-1`},Kt={class:`mx-auto max-w-3xl px-4 py-8`},qt={key:0,class:`mb-4 rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-[13px] text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100`},Jt={class:`@container mt-8 rounded-lg border bg-card p-5 sm:p-8`},Yt={key:0,class:`rounded-md border border-dashed p-6 text-center text-sm text-muted-foreground`},Xt={class:`grid grid-cols-2 gap-2`},Zt=[`onClick`],Qt={class:`truncate`},$t={class:`text-3xl font-semibold tracking-tight`},en={key:0,class:`mt-3 leading-relaxed whitespace-pre-line text-muted-foreground`},tn={class:`@container mt-8 rounded-lg border bg-card p-5 sm:p-8`},nn={key:0,class:`hidden w-[340px] shrink-0 flex-col border-l bg-card lg:flex`},rn={class:`min-h-0 flex-1 overflow-y-auto p-4`},an={class:`mb-2 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},on=[`onClick`],sn={class:`truncate`},cn={__name:`Builder`,props:{form:{type:Object,required:!0},types:{type:Object,required:!0},prefillOptions:{type:Array,required:!0},settingsUrl:{type:String,required:!0},resultsUrl:{type:String,default:null}},setup(r){let d=r,A=p({title:d.form.title,description:d.form.description??``,fields:d.form.fields.map(e=>({_id:Q(),type:e.type,data:{...e.data}}))}),j=x(null),M=x(null),N=x(`edit`),P=x(!1),F=x(JSON.stringify(A)),I=f(()=>JSON.stringify(A)!==F.value),L=f(()=>A.fields.find(e=>e._id===j.value)??null);n(()=>A.fields.map(e=>[e._new,e.data.label,e.data.text]),()=>Ee(A.fields),{deep:!0,immediate:!0});function R(e){j.value=e}function z(e,t=null){let n=De(e),r=A.fields.findIndex(e=>e._id===j.value),i=t??(r>=0?r+1:A.fields.length);A.fields.splice(i,0,n),R(n._id),requestAnimationFrame(()=>{let e=document.querySelector(`[data-field-id="${n._id}"]`);e?.scrollIntoView({behavior:`smooth`,block:`center`}),e?.querySelector(`input, textarea`)?.select()})}function le(e){let t=A.fields.find(t=>t._id===e),n=A.fields.filter(e=>e.data.condition_field&&e.data.condition_field===t?.data.key);(!n.length||window.confirm(`${n.length} Feld(er) hängen von diesem Feld ab. Die Bedingung wird dort entfernt. Trotzdem löschen?`))&&(n.forEach(e=>{delete e.data.condition_field,delete e.data.condition_operator,delete e.data.condition_value}),A.fields=A.fields.filter(t=>t._id!==e),j.value===e&&R(null))}function B(e){let t=A.fields.findIndex(t=>t._id===e),n={_id:Q(),_new:!0,type:A.fields[t].type,data:structuredClone({...A.fields[t].data,key:void 0})};A.fields.splice(t+1,0,n),R(n._id)}m(`forms:builder`,{get fields(){return A.fields},types:d.types,prefillOptions:d.prefillOptions,anonymous:d.form.anonymous,selectedId:j,errorIndex:M,select:R,remove:le,duplicate:B});async function V(){if(!P.value){P.value=!0,M.value=null;try{let e={title:A.title,description:A.description,fields:A.fields.map(({type:e,data:t})=>({type:e,data:t}))};(await ie.put(`/redaktion/formulare/${d.form.id}`,e)).fields.forEach((e,t)=>{A.fields[t]&&(A.fields[t].data.key=e.data.key,delete A.fields[t]._new)}),F.value=JSON.stringify(A),se.success(`Formular gespeichert`)}catch(e){let[t,n]=Object.entries(e.fieldErrors??{})[0]??[],r=t?.match(/^fields\.(\d+)/);r&&(M.value=Number(r[1]),R(A.fields[M.value]?._id),document.querySelector(`[data-field-id="${j.value}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`})),se.error(n??e.message)}finally{P.value=!1}}}function H(e){(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`?(e.preventDefault(),V()):e.key===`Escape`&&R(null)}function U(e){I.value&&(e.preventDefault(),e.returnValue=``)}let G;u(()=>{window.addEventListener(`keydown`,H),window.addEventListener(`beforeunload`,U),G=D.on(`before`,e=>{if(I.value&&e.detail.visit.method===`get`&&!window.confirm(`Es gibt ungespeicherte Änderungen. Seite trotzdem verlassen?`))return!1})}),h(()=>{window.removeEventListener(`keydown`,H),window.removeEventListener(`beforeunload`,U),G?.()});let q=f(()=>({id:-1,title:A.title,description:A.description,url:`#`,fields:Oe(A.fields),prefill:{},submit_label:`Absenden`,confirmation:``,open:!0})),J=f(()=>{let e={};for(let[t,n]of Object.entries(Y))(e[n.group]??=[]).push({type:t,label:d.types[t],icon:n.icon});return Object.entries(e)});return(n,u)=>(g(),c(_,null,[e(i(E),{title:`Formular: ${A.title}`},null,8,[`title`]),s(`div`,Lt,[s(`header`,Rt,[e(i(O),{href:`/redaktion`,class:`grid size-9 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:`Zurück zur Redaktion`},{default:v(()=>[e(i(ee),{class:`size-5`})]),_:1}),s(`div`,zt,[s(`p`,Bt,y(A.title||`Ohne Titel`),1),s(`p`,Vt,[P.value?(g(),c(_,{key:0},[e(i(k),{class:`size-3 animate-spin`}),u[11]||=t(` Speichert …`,-1)],64)):I.value?(g(),c(_,{key:1},[t(`Ungespeicherte Änderungen`)],64)):(g(),c(_,{key:2},[e(i(te),{class:`size-3`}),t(` Gespeichert · `+y(r.form.submissions)+` Einsendungen`,1)],64))])]),s(`div`,Ht,[s(`button`,{type:`button`,class:o([`flex items-center gap-1.5 rounded px-2.5 py-1`,N.value===`edit`?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),onClick:u[0]||=e=>N.value=`edit`},[e(i(de),{class:`size-4`}),u[12]||=t(),u[13]||=s(`span`,{class:`hidden sm:inline`},`Bearbeiten`,-1)],2),s(`button`,{type:`button`,class:o([`flex items-center gap-1.5 rounded px-2.5 py-1`,N.value===`preview`?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),onClick:u[1]||=e=>{N.value=`preview`,R(null)}},[e(i(ce),{class:`size-4`}),u[14]||=t(),u[15]||=s(`span`,{class:`hidden sm:inline`},`Vorschau`,-1)],2)]),e(i(K),{variant:`ghost`,size:`icon`,"as-child":``,title:`Einstellungen, Benachrichtigung und Zugriff`},{default:v(()=>[s(`a`,{href:r.settingsUrl},[e(i(pe))],8,Ut)]),_:1}),r.resultsUrl?(g(),b(i(K),{key:0,variant:`ghost`,size:`icon`,"as-child":``,title:`Ergebnisse`},{default:v(()=>[s(`a`,{href:r.resultsUrl},[e(i(me))],8,Wt)]),_:1})):C(``,!0),e(i(K),{disabled:P.value||!I.value,onClick:V},{default:v(()=>[e(i(fe)),u[16]||=t(),u[17]||=s(`span`,{class:`hidden sm:inline`},`Speichern`,-1)]),_:1},8,[`disabled`])]),s(`div`,Gt,[s(`main`,{class:`min-w-0 flex-1 overflow-y-auto`,onClick:u[10]||=e=>R(null)},[s(`div`,Kt,[r.form.submissions&&N.value===`edit`?(g(),c(`p`,qt,` Es gibt bereits `+y(r.form.submissions)+` Einsendungen. Umbenennen ist unproblematisch – gelöschte Felder fehlen nur in neuen Einsendungen. `,1)):C(``,!0),N.value===`edit`?(g(),c(_,{key:1},[a(s(`input`,{"onUpdate:modelValue":u[2]||=e=>A.title=e,class:`w-full rounded-sm bg-transparent text-3xl font-semibold tracking-tight outline-none focus:bg-brand-soft/40`,placeholder:`Titel des Formulars`,"aria-label":`Titel`,maxlength:`200`,onClick:u[3]||=w(()=>{},[`stop`])},null,512),[[T,A.title]]),a(s(`textarea`,{"onUpdate:modelValue":u[4]||=e=>A.description=e,class:`field-sizing-content mt-3 w-full resize-none rounded-sm bg-transparent leading-relaxed text-muted-foreground outline-none placeholder:text-muted-foreground/50 focus:bg-brand-soft/40`,placeholder:`Einleitung (optional) – z. B. wofür das Formular gedacht ist und wer es bearbeitet`,"aria-label":`Einleitung`,rows:`1`,maxlength:`2000`,onClick:u[5]||=w(()=>{},[`stop`])},null,512),[[T,A.description]]),s(`div`,Jt,[e(i(ue),{modelValue:A.fields,"onUpdate:modelValue":u[6]||=e=>A.fields=e,group:{name:`form-fields`},handle:`.fb-handle`,animation:150,"ghost-class":`pb-ghost`,class:`grid min-h-24 gap-x-5 gap-y-3 @xl:grid-cols-2`,onAdd:u[7]||=e=>R(A.fields[e.newIndex]?._id)},{default:v(()=>[(g(!0),c(_,null,l(A.fields,(e,t)=>(g(),b(tt,{key:e._id,field:e,index:t},null,8,[`field`,`index`]))),128))]),_:1},8,[`modelValue`]),A.fields.length?C(``,!0):(g(),c(`p`,Yt,` Noch keine Felder. Felder aus der rechten Spalte hierher ziehen oder anklicken. `)),e(i(ne),null,{default:v(()=>[e(i(oe),{class:`mt-4 flex h-9 w-full items-center justify-center gap-1.5 rounded-md border border-dashed text-sm font-medium text-muted-foreground hover:border-brand-300 hover:bg-brand-soft hover:text-brand-soft-foreground`,onClick:u[8]||=w(()=>{},[`stop`])},{default:v(()=>[e(i(W),{class:`size-4`}),u[18]||=t(` Feld hinzufügen `,-1)]),_:1}),e(i(re),{class:`w-[22rem] p-3`,onClick:u[9]||=w(()=>{},[`stop`])},{default:v(()=>[s(`div`,Xt,[(g(!0),c(_,null,l(r.types,(e,n)=>(g(),c(`button`,{key:n,type:`button`,class:`flex items-center gap-2 rounded-md border px-2.5 py-2 text-left text-[13px] font-medium hover:border-brand-300 hover:bg-brand-soft/60`,onClick:e=>z(n,A.fields.length)},[(g(),b(S(i(Y)[n].icon),{class:`size-4 shrink-0 text-brand-text`})),u[19]||=t(),s(`span`,Qt,y(e),1)],8,Zt))),128))])]),_:1})]),_:1}),u[20]||=s(`div`,{class:`mt-5 flex items-center gap-4 border-t pt-5`},[s(`span`,{class:`inline-flex h-9 items-center rounded-md bg-brand px-4 text-sm font-medium text-brand-foreground opacity-80`},`Absenden`),s(`span`,{class:`text-xs text-muted-foreground`},`Beschriftung und Bestätigungstext unter „Einstellungen“`)],-1)])],64)):(g(),c(_,{key:2},[s(`h1`,$t,y(A.title),1),A.description?(g(),c(`p`,en,y(A.description),1)):C(``,!0),s(`div`,tn,[(g(),b(ge,{key:JSON.stringify(q.value.fields),form:q.value,preview:``},null,8,[`form`]))]),u[21]||=s(`p`,{class:`mt-3 text-center text-xs text-muted-foreground`},`Vorschau: Bedingungen und Pflichtfelder funktionieren wie im Portal, gesendet wird nichts.`,-1)],64))])]),N.value===`edit`?(g(),c(`aside`,nn,[s(`div`,rn,[L.value?(g(),b(It,{key:L.value._id,field:L.value},null,8,[`field`])):(g(),c(_,{key:1},[u[22]||=s(`p`,{class:`mb-4 text-xs text-muted-foreground`},`Klicken fügt das Feld unter dem ausgewählten ein. Felder lassen sich auch an jede Stelle ziehen.`,-1),(g(!0),c(_,null,l(J.value,([t,n])=>(g(),c(`section`,{key:t,class:`mb-4`},[s(`h3`,an,y(t),1),e(i(ue),{"model-value":n,group:{name:`form-fields`,pull:`clone`,put:!1},clone:e=>i(De)(e.type),sort:!1,class:`grid grid-cols-2 gap-2`},{default:v(()=>[(g(!0),c(_,null,l(n,e=>(g(),c(`button`,{key:e.type,type:`button`,class:`flex cursor-grab items-center gap-2 rounded-md border bg-card px-2.5 py-2 text-left text-[13px] font-medium hover:border-brand-300 hover:bg-brand-soft/60 active:cursor-grabbing`,onClick:t=>z(e.type)},[(g(),b(S(e.icon),{class:`size-4 shrink-0 text-brand-text`})),s(`span`,sn,y(e.label),1)],8,on))),128))]),_:2},1032,[`model-value`,`clone`])]))),128))],64))])])):C(``,!0)])]),e(i(ae),{position:`bottom-left`})],64))}};export{cn as default}; \ No newline at end of file diff --git a/public/build/assets/Buttons-CPTycmqE.js b/public/build/assets/Buttons-Dzm5lp7N.js similarity index 94% rename from public/build/assets/Buttons-CPTycmqE.js rename to public/build/assets/Buttons-Dzm5lp7N.js index 1706f170..a964132a 100644 --- a/public/build/assets/Buttons-CPTycmqE.js +++ b/public/build/assets/Buttons-Dzm5lp7N.js @@ -1 +1 @@ -import{E as e,J as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{k as p}from"./dist-DtGNiYlK.js";import{t as m}from"./button-ZHC5mKey.js";var h=p({name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]}),g=[`href`,`target`,`rel`],_={key:0,class:`text-sm text-muted-foreground`},v={__name:`Buttons`,props:{block:{type:Object,required:!0}},setup(p){let v={primary:`default`,outline:`outline`,link:`link`},y=t(`pagebuilder:editing`,!1);return(t,b)=>(s(),a(`div`,{class:r([`flex flex-wrap gap-3`,{"justify-center":p.block.data.align===`center`}])},[(s(!0),a(c,null,o(p.block.data.buttons,(t,r)=>(s(),d(n(m),{key:r,variant:v[t.variant]??`default`,"as-child":``},{default:l(()=>[i(`a`,{href:t.url||`#`,target:t.new_tab?`_blank`:void 0,rel:t.new_tab?`noopener`:void 0},[e(u(t.label||`Schaltfläche`)+` `,1),t.new_tab?(s(),d(n(h),{key:0})):f(``,!0)],8,g)]),_:2},1032,[`variant`]))),128)),n(y)&&!p.block.data.buttons.length?(s(),a(`p`,_,`Noch keine Schaltflächen.`)):f(``,!0)],2))}};export{v as default}; \ No newline at end of file +import{E as e,J as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{k as p}from"./dist-DtGNiYlK.js";import{n as m}from"./button-CwUSbS9X.js";var h=p({name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]}),g=[`href`,`target`,`rel`],_={key:0,class:`text-sm text-muted-foreground`},v={__name:`Buttons`,props:{block:{type:Object,required:!0}},setup(p){let v={primary:`default`,outline:`outline`,link:`link`},y=t(`pagebuilder:editing`,!1);return(t,b)=>(s(),a(`div`,{class:r([`flex flex-wrap gap-3`,{"justify-center":p.block.data.align===`center`}])},[(s(!0),a(c,null,o(p.block.data.buttons,(t,r)=>(s(),d(n(m),{key:r,variant:v[t.variant]??`default`,"as-child":``},{default:l(()=>[i(`a`,{href:t.url||`#`,target:t.new_tab?`_blank`:void 0,rel:t.new_tab?`noopener`:void 0},[e(u(t.label||`Schaltfläche`)+` `,1),t.new_tab?(s(),d(n(h),{key:0})):f(``,!0)],8,g)]),_:2},1032,[`variant`]))),128)),n(y)&&!p.block.data.buttons.length?(s(),a(`p`,_,`Noch keine Schaltflächen.`)):f(``,!0)],2))}};export{v as default}; \ No newline at end of file diff --git a/public/build/assets/Contacts-DoWMe0PE.js b/public/build/assets/Contacts-fiSJBaQP.js similarity index 89% rename from public/build/assets/Contacts-DoWMe0PE.js rename to public/build/assets/Contacts-fiSJBaQP.js index 82822d68..9d444eb5 100644 --- a/public/build/assets/Contacts-DoWMe0PE.js +++ b/public/build/assets/Contacts-fiSJBaQP.js @@ -1 +1 @@ -import{D as e,E as t,J as n,On as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as p}from"./app-Bu3kn8yd.js";import{V as m,p as h}from"./AppIcon-0N56IC2z.js";import{y as g}from"./http-DmyDwIce.js";var _={key:0,class:`mb-3 text-lg font-semibold`},v={class:`min-w-0`},y={key:0,class:`truncate text-[13px] text-muted-foreground`},b={class:`mt-1.5 flex flex-wrap gap-x-4 gap-y-1 text-[13px]`},x=[`href`],S=[`href`],C={class:`truncate`},w={key:0,class:`text-sm text-muted-foreground`},T={__name:`Contacts`,props:{block:{type:Object,required:!0}},setup(T){let E=n(`pagebuilder:editing`,!1);return(n,D)=>(c(),o(`section`,null,[T.block.data.title?(c(),o(`h3`,_,d(T.block.data.title),1)):f(``,!0),a(`div`,{class:i(T.block.data.layout===`list`?`divide-y rounded-lg border bg-card`:`grid gap-4 @xl:grid-cols-2 @4xl:grid-cols-3`)},[(c(!0),o(l,null,s(T.block.props?.people??[],n=>(c(),o(`div`,{key:n.id,class:i([`flex gap-3`,T.block.data.layout===`list`?`items-center px-4 py-3`:`rounded-lg border bg-card p-4`])},[e(h,{person:n,class:`size-12 shrink-0`},null,8,[`person`]),a(`div`,v,[e(r(p),{href:`/personen/${n.id}`,class:`block truncate font-semibold hover:underline`},{default:u(()=>[t(d(n.name),1)]),_:2},1032,[`href`]),n.job_title?(c(),o(`p`,y,d(n.job_title),1)):f(``,!0),a(`div`,b,[n.phone?(c(),o(`a`,{key:0,href:`tel:${n.phone}`,class:`inline-flex items-center gap-1 text-brand-text hover:underline`},[e(r(g),{class:`size-3.5`}),t(` `+d(n.phone),1)],8,x)):f(``,!0),a(`a`,{href:`mailto:${n.email}`,class:`inline-flex min-w-0 items-center gap-1 text-brand-text hover:underline`},[e(r(m),{class:`size-3.5 shrink-0`}),D[0]||=t(),a(`span`,C,d(n.email),1)],8,S)])])],2))),128)),r(E)&&!(T.block.props?.people??[]).length?(c(),o(`p`,w,`Noch keine Personen ausgewählt.`)):f(``,!0)],2)]))}};export{T as default}; \ No newline at end of file +import{D as e,E as t,J as n,On as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as p}from"./app-BNwrc_lv.js";import{V as m,p as h}from"./AppIcon-nlhvQfK7.js";import{b as g}from"./http-CAG9BrJF.js";var _={key:0,class:`mb-3 text-lg font-semibold`},v={class:`min-w-0`},y={key:0,class:`truncate text-[13px] text-muted-foreground`},b={class:`mt-1.5 flex flex-wrap gap-x-4 gap-y-1 text-[13px]`},x=[`href`],S=[`href`],C={class:`truncate`},w={key:0,class:`text-sm text-muted-foreground`},T={__name:`Contacts`,props:{block:{type:Object,required:!0}},setup(T){let E=n(`pagebuilder:editing`,!1);return(n,D)=>(c(),o(`section`,null,[T.block.data.title?(c(),o(`h3`,_,d(T.block.data.title),1)):f(``,!0),a(`div`,{class:i(T.block.data.layout===`list`?`divide-y rounded-lg border bg-card`:`grid gap-4 @xl:grid-cols-2 @4xl:grid-cols-3`)},[(c(!0),o(l,null,s(T.block.props?.people??[],n=>(c(),o(`div`,{key:n.id,class:i([`flex gap-3`,T.block.data.layout===`list`?`items-center px-4 py-3`:`rounded-lg border bg-card p-4`])},[e(h,{person:n,class:`size-12 shrink-0`},null,8,[`person`]),a(`div`,v,[e(r(p),{href:`/personen/${n.id}`,class:`block truncate font-semibold hover:underline`},{default:u(()=>[t(d(n.name),1)]),_:2},1032,[`href`]),n.job_title?(c(),o(`p`,y,d(n.job_title),1)):f(``,!0),a(`div`,b,[n.phone?(c(),o(`a`,{key:0,href:`tel:${n.phone}`,class:`inline-flex items-center gap-1 text-brand-text hover:underline`},[e(r(g),{class:`size-3.5`}),t(` `+d(n.phone),1)],8,x)):f(``,!0),a(`a`,{href:`mailto:${n.email}`,class:`inline-flex min-w-0 items-center gap-1 text-brand-text hover:underline`},[e(r(m),{class:`size-3.5 shrink-0`}),D[0]||=t(),a(`span`,C,d(n.email),1)],8,S)])])],2))),128)),r(E)&&!(T.block.props?.people??[]).length?(c(),o(`p`,w,`Noch keine Personen ausgewählt.`)):f(``,!0)],2)]))}};export{T as default}; \ No newline at end of file diff --git a/public/build/assets/CustomTile-CA8hCJ2g.js b/public/build/assets/CustomTile-BGjBhIVE.js similarity index 88% rename from public/build/assets/CustomTile-CA8hCJ2g.js rename to public/build/assets/CustomTile-BGjBhIVE.js index 6e352dbe..96c9c660 100644 --- a/public/build/assets/CustomTile-CA8hCJ2g.js +++ b/public/build/assets/CustomTile-BGjBhIVE.js @@ -1 +1 @@ -import{On as e,Zn as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,wt as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{z as u}from"./AppIcon-0N56IC2z.js";import{S as d,v as f,x as p}from"./http-DmyDwIce.js";import{t as m}from"./circle-alert-D8SqHL0j.js";import{t as h}from"./Panel-BASB8Xb9.js";var g=[`src`,`alt`],_={key:0,class:`block px-4 py-3 text-sm font-semibold group-hover:underline`},v={class:`min-w-0 flex-1`},y={key:0,class:`font-semibold`},b=[`innerHTML`],x=[`href`,`target`],S=[`innerHTML`],C=[`href`,`target`],w={__name:`CustomTile`,props:{tile:{type:Object,required:!0}},setup(w){let T={brand:{icon:u,class:`border-brand bg-brand text-brand-foreground`},info:{icon:p,class:`border-sky-200 bg-sky-50 text-sky-950 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-100`},success:{icon:d,class:`border-emerald-200 bg-emerald-50 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100`},warning:{icon:f,class:`border-red-200 bg-red-50 text-red-950 dark:border-red-900 dark:bg-red-950/40 dark:text-red-100`},neutral:{icon:m,class:`border-border bg-card text-foreground`}};return(d,f)=>w.tile.type===`image`&&w.tile.image_url?(i(),s(c(w.tile.url?`a`:`figure`),{key:0,href:w.tile.url||void 0,target:w.tile.url&&w.tile.new_tab?`_blank`:void 0,rel:w.tile.url&&w.tile.new_tab?`noopener`:void 0,class:`group block overflow-hidden rounded-lg border bg-card`},{default:a(()=>[n(`img`,{src:w.tile.image_url,alt:w.tile.alt||w.tile.title||``,loading:`lazy`,class:`w-full object-cover transition-transform duration-300 group-hover:scale-[1.02]`},null,8,g),w.tile.title?(i(),r(`span`,_,o(w.tile.title),1)):l(``,!0)]),_:1},8,[`href`,`target`,`rel`])):w.tile.type===`notice`?(i(),r(`section`,{key:1,class:t([`pb-box flex gap-3 rounded-lg border p-4 sm:p-5`,T[w.tile.variant]?.class??T.brand.class])},[(i(),s(c(T[w.tile.variant]?.icon??e(u)),{class:`mt-0.5 size-5 shrink-0`})),n(`div`,v,[w.tile.title?(i(),r(`p`,y,o(w.tile.title),1)):l(``,!0),w.tile.html?(i(),r(`div`,{key:1,class:t([`prose prose-sm max-w-none [&_a]:underline`,w.tile.title?`mt-1`:``]),innerHTML:w.tile.html},null,10,b)):l(``,!0),w.tile.url?(i(),r(`a`,{key:2,href:w.tile.url,target:w.tile.new_tab?`_blank`:void 0,class:`mt-2 inline-block text-sm font-medium underline`},`Mehr erfahren`,8,x)):l(``,!0)])],2)):(i(),s(h,{key:2,title:w.tile.title||``},{default:a(()=>[n(`div`,{class:`prose prose-sm prose-neutral max-w-none prose-img:rounded-md`,innerHTML:w.tile.html},null,8,S),w.tile.url?(i(),r(`a`,{key:0,href:w.tile.url,target:w.tile.new_tab?`_blank`:void 0,class:`mt-3 inline-block text-[13px] font-medium text-brand-text hover:underline`},`Mehr erfahren`,8,C)):l(``,!0)]),_:1},8,[`title`]))}};export{w as default}; \ No newline at end of file +import{On as e,Zn as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,wt as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{z as u}from"./AppIcon-nlhvQfK7.js";import{C as d,S as f,y as p}from"./http-CAG9BrJF.js";import{t as m}from"./circle-alert-D8SqHL0j.js";import{t as h}from"./Panel-Dr-NcUuS.js";var g=[`src`,`alt`],_={key:0,class:`block px-4 py-3 text-sm font-semibold group-hover:underline`},v={class:`min-w-0 flex-1`},y={key:0,class:`font-semibold`},b=[`innerHTML`],x=[`href`,`target`],S=[`innerHTML`],C=[`href`,`target`],w={__name:`CustomTile`,props:{tile:{type:Object,required:!0}},setup(w){let T={brand:{icon:u,class:`border-brand bg-brand text-brand-foreground`},info:{icon:f,class:`border-sky-200 bg-sky-50 text-sky-950 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-100`},success:{icon:d,class:`border-emerald-200 bg-emerald-50 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100`},warning:{icon:p,class:`border-red-200 bg-red-50 text-red-950 dark:border-red-900 dark:bg-red-950/40 dark:text-red-100`},neutral:{icon:m,class:`border-border bg-card text-foreground`}};return(d,f)=>w.tile.type===`image`&&w.tile.image_url?(i(),s(c(w.tile.url?`a`:`figure`),{key:0,href:w.tile.url||void 0,target:w.tile.url&&w.tile.new_tab?`_blank`:void 0,rel:w.tile.url&&w.tile.new_tab?`noopener`:void 0,class:`group block overflow-hidden rounded-lg border bg-card`},{default:a(()=>[n(`img`,{src:w.tile.image_url,alt:w.tile.alt||w.tile.title||``,loading:`lazy`,class:`w-full object-cover transition-transform duration-300 group-hover:scale-[1.02]`},null,8,g),w.tile.title?(i(),r(`span`,_,o(w.tile.title),1)):l(``,!0)]),_:1},8,[`href`,`target`,`rel`])):w.tile.type===`notice`?(i(),r(`section`,{key:1,class:t([`pb-box flex gap-3 rounded-lg border p-4 sm:p-5`,T[w.tile.variant]?.class??T.brand.class])},[(i(),s(c(T[w.tile.variant]?.icon??e(u)),{class:`mt-0.5 size-5 shrink-0`})),n(`div`,v,[w.tile.title?(i(),r(`p`,y,o(w.tile.title),1)):l(``,!0),w.tile.html?(i(),r(`div`,{key:1,class:t([`prose prose-sm max-w-none [&_a]:underline`,w.tile.title?`mt-1`:``]),innerHTML:w.tile.html},null,10,b)):l(``,!0),w.tile.url?(i(),r(`a`,{key:2,href:w.tile.url,target:w.tile.new_tab?`_blank`:void 0,class:`mt-2 inline-block text-sm font-medium underline`},`Mehr erfahren`,8,x)):l(``,!0)])],2)):(i(),s(h,{key:2,title:w.tile.title||``},{default:a(()=>[n(`div`,{class:`prose prose-sm prose-neutral max-w-none prose-img:rounded-md`,innerHTML:w.tile.html},null,8,S),w.tile.url?(i(),r(`a`,{key:0,href:w.tile.url,target:w.tile.new_tab?`_blank`:void 0,class:`mt-3 inline-block text-[13px] font-medium text-brand-text hover:underline`},`Mehr erfahren`,8,C)):l(``,!0)]),_:1},8,[`title`]))}};export{w as default}; \ No newline at end of file diff --git a/public/build/assets/Dashboard-DDRG4hPZ.js b/public/build/assets/Dashboard-CSKyh0Uo.js similarity index 93% rename from public/build/assets/Dashboard-DDRG4hPZ.js rename to public/build/assets/Dashboard-CSKyh0Uo.js index 05c3b591..ca826a85 100644 --- a/public/build/assets/Dashboard-DDRG4hPZ.js +++ b/public/build/assets/Dashboard-CSKyh0Uo.js @@ -1 +1 @@ -import{On as e,_ as t,b as n,bt as r,et as i,g as a,mt as o,o as s,qt as c,v as l,wt as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./dist-DtGNiYlK.js";import{t as p}from"./AppLayout-BxsYt2ib.js";import{t as m}from"./widgets-BmL-pPiO.js";var h={key:0,class:`mb-6 grid gap-6`},g={key:1,class:`grid grid-cols-12 gap-6`},_={class:`col-span-8 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-9 xl:grid-cols-3`},v={class:`col-span-4 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-3`},y={key:2,class:`grid min-w-0 grid-cols-1 gap-6`},b={__name:`Dashboard`,props:{widgets:{type:Array,required:!0}},setup(b){let x=b,S=f(`(min-width: 1024px)`),C=a(()=>x.widgets.filter(e=>m(e.component))),w=e=>C.value.filter(t=>t.area===e),T=a(()=>w(`hero`)[0]??null),E=a(()=>[...C.value].sort((e,t)=>e.mobileSort-t.mobileSort));return(a,f)=>(o(),l(p,{title:`Startseite`},{default:c(()=>[e(S)&&w(`top`).length?(o(),n(`div`,h,[(o(!0),n(s,null,r(w(`top`),t=>(o(),l(u(e(m)(t.component)),i({key:t.key},{ref_for:!0},t.props),null,16))),128))])):d(``,!0),e(S)?(o(),n(`div`,g,[t(`div`,_,[T.value?(o(),l(u(e(m)(T.value.component)),i({key:0},T.value.props,{class:`xl:col-span-2`}),null,16)):d(``,!0),(o(!0),n(s,null,r(w(`feed`),t=>(o(),l(u(e(m)(t.component)),i({key:t.key},{ref_for:!0},t.props,{wide:!T.value,class:T.value?`xl:col-span-1`:`xl:col-span-3`}),null,16,[`wide`,`class`]))),128)),(o(!0),n(s,null,r(w(`main`),t=>(o(),l(u(e(m)(t.component)),i({key:t.key},{ref_for:!0},t.props,{class:`xl:col-span-3`}),null,16))),128))]),t(`aside`,v,[(o(!0),n(s,null,r(w(`aside`),t=>(o(),l(u(e(m)(t.component)),i({key:t.key},{ref_for:!0},t.props),null,16))),128))])])):(o(),n(`div`,y,[(o(!0),n(s,null,r(E.value,t=>(o(),l(u(e(m)(t.component)),i({key:t.key},{ref_for:!0},t.props),null,16))),128))]))]),_:1}))}};export{b as default}; \ No newline at end of file +import{On as e,_ as t,b as n,bt as r,et as i,g as a,mt as o,o as s,qt as c,v as l,wt as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./dist-DtGNiYlK.js";import{t as p}from"./AppLayout-esQiy2nD.js";import{t as m}from"./widgets-D5Uy4PcL.js";var h={key:0,class:`mb-6 grid gap-6`},g={key:1,class:`grid grid-cols-12 gap-6`},_={class:`col-span-8 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-9 xl:grid-cols-3`},v={class:`col-span-4 grid min-w-0 grid-cols-1 content-start gap-6 xl:col-span-3`},y={key:2,class:`grid min-w-0 grid-cols-1 gap-6`},b={__name:`Dashboard`,props:{widgets:{type:Array,required:!0}},setup(b){let x=b,S=f(`(min-width: 1024px)`),C=a(()=>x.widgets.filter(e=>m(e.component))),w=e=>C.value.filter(t=>t.area===e),T=a(()=>w(`hero`)[0]??null),E=a(()=>[...C.value].sort((e,t)=>e.mobileSort-t.mobileSort));return(a,f)=>(o(),l(p,{title:`Startseite`},{default:c(()=>[e(S)&&w(`top`).length?(o(),n(`div`,h,[(o(!0),n(s,null,r(w(`top`),t=>(o(),l(u(e(m)(t.component)),i({key:t.key},{ref_for:!0},t.props),null,16))),128))])):d(``,!0),e(S)?(o(),n(`div`,g,[t(`div`,_,[T.value?(o(),l(u(e(m)(T.value.component)),i({key:0},T.value.props,{class:`xl:col-span-2`}),null,16)):d(``,!0),(o(!0),n(s,null,r(w(`feed`),t=>(o(),l(u(e(m)(t.component)),i({key:t.key},{ref_for:!0},t.props,{wide:!T.value,class:T.value?`xl:col-span-1`:`xl:col-span-3`}),null,16,[`wide`,`class`]))),128)),(o(!0),n(s,null,r(w(`main`),t=>(o(),l(u(e(m)(t.component)),i({key:t.key},{ref_for:!0},t.props,{class:`xl:col-span-3`}),null,16))),128))]),t(`aside`,v,[(o(!0),n(s,null,r(w(`aside`),t=>(o(),l(u(e(m)(t.component)),i({key:t.key},{ref_for:!0},t.props),null,16))),128))])])):(o(),n(`div`,y,[(o(!0),n(s,null,r(E.value,t=>(o(),l(u(e(m)(t.component)),i({key:t.key},{ref_for:!0},t.props),null,16))),128))]))]),_:1}))}};export{b as default}; \ No newline at end of file diff --git a/public/build/assets/DialogDescription-BxaIqmag.js b/public/build/assets/DialogDescription-BxaIqmag.js deleted file mode 100644 index b6b40922..00000000 --- a/public/build/assets/DialogDescription-BxaIqmag.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e}from"./usePrimitiveElement-DC7UloPZ.js";import{On as t,et as n,k as r,mt as i,qt as a,v as o,xt as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{d as c,l,p as u,s as d}from"./dist-DtGNiYlK.js";import{w as f}from"./AppIcon-0N56IC2z.js";var p=r({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let r=e;u();let l=f();return(e,u)=>(i(),o(t(c),n(r,{id:t(l).descriptionId}),{default:a(()=>[s(e.$slots,`default`)]),_:3},16,[`id`]))}}),m=r({__name:`DialogDescription`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(r){let c=r,u=d(c,`class`),f=e(u);return(e,r)=>(i(),o(t(p),n({"data-slot":`dialog-description`},t(f),{class:t(l)(`text-muted-foreground text-sm`,c.class)}),{default:a(()=>[s(e.$slots,`default`)]),_:3},16,[`class`]))}});export{m as t}; \ No newline at end of file diff --git a/public/build/assets/DialogDescription-CaB-9xpp.js b/public/build/assets/DialogDescription-CaB-9xpp.js new file mode 100644 index 00000000..55b8e845 --- /dev/null +++ b/public/build/assets/DialogDescription-CaB-9xpp.js @@ -0,0 +1 @@ +import{a as e}from"./usePrimitiveElement-DC7UloPZ.js";import{On as t,et as n,k as r,mt as i,qt as a,v as o,xt as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{l as c,s as l}from"./dist-DtGNiYlK.js";import{t as u}from"./DialogDescription-Cf3zbHQX.js";var d=r({__name:`DialogDescription`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(r){let d=r,f=l(d,`class`),p=e(f);return(e,r)=>(i(),o(t(u),n({"data-slot":`dialog-description`},t(p),{class:t(c)(`text-muted-foreground text-sm`,d.class)}),{default:a(()=>[s(e.$slots,`default`)]),_:3},16,[`class`]))}});export{d as t}; \ No newline at end of file diff --git a/public/build/assets/DialogDescription-Cf3zbHQX.js b/public/build/assets/DialogDescription-Cf3zbHQX.js new file mode 100644 index 00000000..ab1abf52 --- /dev/null +++ b/public/build/assets/DialogDescription-Cf3zbHQX.js @@ -0,0 +1 @@ +import{On as e,et as t,k as n,mt as r,qt as i,v as a,xt as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{d as s,p as c}from"./dist-DtGNiYlK.js";import{w as l}from"./AppIcon-nlhvQfK7.js";var u=n({__name:`DialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(n){let u=n;c();let d=l();return(n,c)=>(r(),a(e(s),t(u,{id:e(d).descriptionId}),{default:i(()=>[o(n.$slots,`default`)]),_:3},16,[`id`]))}});export{u as t}; \ No newline at end of file diff --git a/public/build/assets/DirectoryLogin-Dv1jxmzh.js b/public/build/assets/DirectoryLogin-DMGjY_5j.js similarity index 90% rename from public/build/assets/DirectoryLogin-Dv1jxmzh.js rename to public/build/assets/DirectoryLogin-DMGjY_5j.js index a039185e..f6f0faeb 100644 --- a/public/build/assets/DirectoryLogin-Dv1jxmzh.js +++ b/public/build/assets/DirectoryLogin-DMGjY_5j.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,mt as i,qt as a,v as o,vn as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as l}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as u,r as d}from"./app-Bu3kn8yd.js";import{O as f}from"./dist-DtGNiYlK.js";import{t as p}from"./arrow-left-BMImfTf2.js";import{t as m}from"./eye-off-myis3scV.js";import{t as h}from"./eye-CFNQcvaV.js";import{t as g}from"./FormField-BoFAO4pm.js";import{t as _}from"./button-ZHC5mKey.js";import{t as v}from"./Input-FGSb2-yK.js";import{t as y}from"./GuestLayout-CAwpgUCY.js";var b={class:`relative`},x=[`aria-label`],S={__name:`DirectoryLogin`,props:{provider:{type:Object,required:!0}},setup(S){let C=S,w=s(!1),T=u({username:``,password:``});function E(){T.post(C.provider.action,{onFinish:()=>T.reset(`password`)})}return(s,u)=>(i(),o(y,{title:S.provider.label,description:`Mit dem Benutzernamen und Passwort, mit dem Sie sich auch am Arbeitsplatz anmelden.`},{default:a(()=>[r(`form`,{class:`grid gap-5`,onSubmit:l(E,[`prevent`])},[e(g,{id:`username`,label:S.provider.username_label,error:n(T).errors.username},{default:a(()=>[e(n(v),{id:`username`,modelValue:n(T).username,"onUpdate:modelValue":u[0]||=e=>n(T).username=e,autocomplete:`username`,autocapitalize:`none`,spellcheck:`false`,autofocus:``,class:`h-10`,"aria-invalid":!!n(T).errors.username},null,8,[`modelValue`,`aria-invalid`])]),_:1},8,[`label`,`error`]),e(g,{id:`password`,label:`Passwort`,error:n(T).errors.password},{default:a(()=>[r(`div`,b,[e(n(v),{id:`password`,modelValue:n(T).password,"onUpdate:modelValue":u[1]||=e=>n(T).password=e,type:w.value?`text`:`password`,autocomplete:`current-password`,class:`h-10 pr-10`,"aria-invalid":!!n(T).errors.password},null,8,[`modelValue`,`type`,`aria-invalid`]),r(`button`,{type:`button`,class:`absolute inset-y-0 right-0 grid w-10 place-items-center text-muted-foreground hover:text-foreground`,"aria-label":w.value?`Passwort verbergen`:`Passwort anzeigen`,onClick:u[2]||=e=>w.value=!w.value},[w.value?(i(),o(n(m),{key:0,class:`size-4`})):(i(),o(n(h),{key:1,class:`size-4`}))],8,x)])]),_:1},8,[`error`]),e(n(_),{type:`submit`,size:`lg`,class:`mt-2 h-10 w-full`,disabled:n(T).processing},{default:a(()=>[n(T).processing?(i(),o(n(f),{key:0,class:`animate-spin`})):c(``,!0),u[3]||=t(` Anmelden `,-1)]),_:1},8,[`disabled`]),e(n(d),{href:`/login`,class:`inline-flex items-center justify-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`},{default:a(()=>[e(n(p),{class:`size-4`}),u[4]||=t(` Andere Anmeldung wählen `,-1)]),_:1})],32)]),_:1},8,[`title`]))}};export{S as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,mt as i,qt as a,v as o,vn as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as l}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as u,r as d}from"./app-BNwrc_lv.js";import{O as f}from"./dist-DtGNiYlK.js";import{t as p}from"./arrow-left-BMImfTf2.js";import{t as m}from"./eye-off-myis3scV.js";import{t as h}from"./eye-CFNQcvaV.js";import{t as g}from"./FormField-BoFAO4pm.js";import{n as _}from"./button-CwUSbS9X.js";import{t as v}from"./Input-FGSb2-yK.js";import{t as y}from"./GuestLayout-B2rtJjbh.js";var b={class:`relative`},x=[`aria-label`],S={__name:`DirectoryLogin`,props:{provider:{type:Object,required:!0}},setup(S){let C=S,w=s(!1),T=u({username:``,password:``});function E(){T.post(C.provider.action,{onFinish:()=>T.reset(`password`)})}return(s,u)=>(i(),o(y,{title:S.provider.label,description:`Mit dem Benutzernamen und Passwort, mit dem Sie sich auch am Arbeitsplatz anmelden.`},{default:a(()=>[r(`form`,{class:`grid gap-5`,onSubmit:l(E,[`prevent`])},[e(g,{id:`username`,label:S.provider.username_label,error:n(T).errors.username},{default:a(()=>[e(n(v),{id:`username`,modelValue:n(T).username,"onUpdate:modelValue":u[0]||=e=>n(T).username=e,autocomplete:`username`,autocapitalize:`none`,spellcheck:`false`,autofocus:``,class:`h-10`,"aria-invalid":!!n(T).errors.username},null,8,[`modelValue`,`aria-invalid`])]),_:1},8,[`label`,`error`]),e(g,{id:`password`,label:`Passwort`,error:n(T).errors.password},{default:a(()=>[r(`div`,b,[e(n(v),{id:`password`,modelValue:n(T).password,"onUpdate:modelValue":u[1]||=e=>n(T).password=e,type:w.value?`text`:`password`,autocomplete:`current-password`,class:`h-10 pr-10`,"aria-invalid":!!n(T).errors.password},null,8,[`modelValue`,`type`,`aria-invalid`]),r(`button`,{type:`button`,class:`absolute inset-y-0 right-0 grid w-10 place-items-center text-muted-foreground hover:text-foreground`,"aria-label":w.value?`Passwort verbergen`:`Passwort anzeigen`,onClick:u[2]||=e=>w.value=!w.value},[w.value?(i(),o(n(m),{key:0,class:`size-4`})):(i(),o(n(h),{key:1,class:`size-4`}))],8,x)])]),_:1},8,[`error`]),e(n(_),{type:`submit`,size:`lg`,class:`mt-2 h-10 w-full`,disabled:n(T).processing},{default:a(()=>[n(T).processing?(i(),o(n(f),{key:0,class:`animate-spin`})):c(``,!0),u[3]||=t(` Anmelden `,-1)]),_:1},8,[`disabled`]),e(n(d),{href:`/login`,class:`inline-flex items-center justify-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`},{default:a(()=>[e(n(p),{class:`size-4`}),u[4]||=t(` Andere Anmeldung wählen `,-1)]),_:1})],32)]),_:1},8,[`title`]))}};export{S as default}; \ No newline at end of file diff --git a/public/build/assets/Downloads-CBwE2am1.js b/public/build/assets/Downloads-CLgaI6MO.js similarity index 95% rename from public/build/assets/Downloads-CBwE2am1.js rename to public/build/assets/Downloads-CLgaI6MO.js index 7dd480a4..b2cd52a6 100644 --- a/public/build/assets/Downloads-CBwE2am1.js +++ b/public/build/assets/Downloads-CLgaI6MO.js @@ -1 +1 @@ -import{D as e,On as t,_ as n,b as r,bt as i,mt as a,o,tr as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{X as l}from"./AppIcon-0N56IC2z.js";import{t as u}from"./download-UAAY3N2F.js";var d={key:0,class:`mb-3 text-lg font-semibold`},f={class:`divide-y rounded-lg border bg-card`},p=[`href`],m={class:`grid size-10 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},h={class:`min-w-0 flex-1`},g={class:`block truncate text-sm font-medium group-hover:underline`},_={class:`block text-xs text-muted-foreground`},v={key:0,class:`px-4 py-3 text-sm text-muted-foreground`},y={__name:`Downloads`,props:{block:{type:Object,required:!0}},setup(y){let b=e=>e>1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;return(x,S)=>(a(),r(`section`,null,[y.block.data.title?(a(),r(`h3`,d,s(y.block.data.title),1)):c(``,!0),n(`ul`,f,[(a(!0),r(o,null,i(y.block.props?.files??[],i=>(a(),r(`li`,{key:i.id},[n(`a`,{href:i.url,class:`group flex items-center gap-3 px-4 py-3 hover:bg-accent/50`},[n(`span`,m,[e(t(l),{class:`size-5`})]),n(`span`,h,[n(`span`,g,s(i.name),1),n(`span`,_,s(i.extension||`Datei`)+` · `+s(b(i.size)),1)]),e(t(u),{class:`size-4 shrink-0 text-muted-foreground`})],8,p)]))),128)),(y.block.props?.files??[]).length?c(``,!0):(a(),r(`li`,v,`Noch keine Dateien.`))])]))}};export{y as default}; \ No newline at end of file +import{D as e,On as t,_ as n,b as r,bt as i,mt as a,o,tr as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{X as l}from"./AppIcon-nlhvQfK7.js";import{t as u}from"./download-UAAY3N2F.js";var d={key:0,class:`mb-3 text-lg font-semibold`},f={class:`divide-y rounded-lg border bg-card`},p=[`href`],m={class:`grid size-10 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},h={class:`min-w-0 flex-1`},g={class:`block truncate text-sm font-medium group-hover:underline`},_={class:`block text-xs text-muted-foreground`},v={key:0,class:`px-4 py-3 text-sm text-muted-foreground`},y={__name:`Downloads`,props:{block:{type:Object,required:!0}},setup(y){let b=e=>e>1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;return(x,S)=>(a(),r(`section`,null,[y.block.data.title?(a(),r(`h3`,d,s(y.block.data.title),1)):c(``,!0),n(`ul`,f,[(a(!0),r(o,null,i(y.block.props?.files??[],i=>(a(),r(`li`,{key:i.id},[n(`a`,{href:i.url,class:`group flex items-center gap-3 px-4 py-3 hover:bg-accent/50`},[n(`span`,m,[e(t(l),{class:`size-5`})]),n(`span`,h,[n(`span`,g,s(i.name),1),n(`span`,_,s(i.extension||`Datei`)+` · `+s(b(i.size)),1)]),e(t(u),{class:`size-4 shrink-0 text-muted-foreground`})],8,p)]))),128)),(y.block.props?.files??[]).length?c(``,!0):(a(),r(`li`,v,`Noch keine Dateien.`))])]))}};export{y as default}; \ No newline at end of file diff --git a/public/build/assets/Edit-CpWBr8mw.js b/public/build/assets/Edit-D7IMdWK_.js similarity index 90% rename from public/build/assets/Edit-CpWBr8mw.js rename to public/build/assets/Edit-D7IMdWK_.js index d0704b97..5a1c3885 100644 --- a/public/build/assets/Edit-CpWBr8mw.js +++ b/public/build/assets/Edit-D7IMdWK_.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProfileBirthday-qxtdAtvE.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-Bu3kn8yd.js","assets/app-CL30rx2M.css","assets/dist-DtGNiYlK.js","assets/AppIcon-0N56IC2z.js","assets/usePrimitiveElement-DC7UloPZ.js","assets/RovingFocusGroup-D88K7krN.js","assets/http-DmyDwIce.js","assets/FormField-BoFAO4pm.js","assets/button-ZHC5mKey.js","assets/NativeSelect-BGasRaNs.js","assets/Panel-BASB8Xb9.js","assets/chevron-right-C9w5cb2q.js"])))=>i.map(i=>d[i]); -import{D as e,E as t,O as ee,On as n,Zn as r,_ as i,b as a,bt as o,et as s,mt as c,o as l,qt as u,tr as d,v as f,vn as p,wt as m,y as h}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as g}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as _,o as v,s as y}from"./app-Bu3kn8yd.js";import{O as b,k as x}from"./dist-DtGNiYlK.js";import{p as te}from"./AppIcon-0N56IC2z.js";import{t as S}from"./AppLayout-BxsYt2ib.js";import{o as C}from"./http-DmyDwIce.js";import{t as w}from"./trash-DUqnVIgb.js";import{t as T}from"./FormField-BoFAO4pm.js";import{t as E}from"./button-ZHC5mKey.js";import{t as D}from"./Panel-BASB8Xb9.js";import{t as O}from"./Input-FGSb2-yK.js";import{t as k}from"./Textarea-DEFXqC2w.js";var A=x({name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]}),j={class:`grid gap-6 lg:grid-cols-12`},M={class:`lg:col-span-4`},N={class:`flex flex-col items-center text-center`},P={class:`mt-5 flex flex-wrap justify-center gap-2`},F={key:0,class:`mt-3 text-[13px] text-destructive`},I={class:`grid content-start gap-6 lg:col-span-8`},L={class:`grid gap-5 sm:grid-cols-2`},R={key:0,class:`grid gap-5 border-t pt-5`},z={class:`grid gap-5 sm:grid-cols-2`},B={class:`flex justify-end border-t pt-5`},V={class:`grid gap-5 sm:grid-cols-2`},H={class:`flex justify-end border-t pt-5`},U={__name:`Edit`,props:{profile:{type:Object,required:!0},managed:{type:Array,default:()=>[]},customFields:{type:Array,default:()=>[]},sections:{type:Array,default:()=>[]}},setup(x){let U=x,W=Object.fromEntries(Object.entries(Object.assign({"../../../../plugins-core/birthdays/resources/js/profile/ProfileBirthday.vue":()=>y(()=>import(`./ProfileBirthday-qxtdAtvE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))})).map(([e,t])=>[`${e.match(/plugins-core\/([^/]+)\//)[1]}::${e.split(`/`).pop().replace(`.vue`,``)}`,ee(t)])),G=e=>U.managed.includes(e),K=_({first_name:U.profile.first_name??``,last_name:U.profile.last_name??``,email:U.profile.email,job_title:U.profile.job_title??``,department:U.profile.department??``,location:U.profile.location??``,phone:U.profile.phone??``,mobile:U.profile.mobile??``,about:U.profile.about??``,custom_fields:Object.fromEntries(U.customFields.map(e=>[e.key,e.value??``]))}),q={email:`email`,phone:`tel`,url:`url`,date:`date`};function J(e){let t=[];return e.managed?t.push(`Wird aus Microsoft Entra ID übernommen.`):e.readonly&&t.push(`Wird von der Personalverwaltung gepflegt.`),e.restricted&&t.push(`Nur für Sie und die Personalverwaltung sichtbar.`),e.help&&t.push(e.help),t.join(` `)}function Y(){K.put(`/profil`,{preserveScroll:!0,onSuccess:()=>{K.defaults(),C.success(`Profil gespeichert`)}})}let X=[{key:`first_name`,label:`Vorname`,autocomplete:`given-name`},{key:`last_name`,label:`Nachname`,autocomplete:`family-name`},{key:`email`,label:`E-Mail-Adresse`,type:`email`,autocomplete:`email`,wide:!0},{key:`job_title`,label:`Funktion`,autocomplete:`organization-title`},{key:`department`,label:`Abteilung`},{key:`location`,label:`Standort`},{key:`phone`,label:`Telefon`,type:`tel`,autocomplete:`tel`},{key:`mobile`,label:`Mobil`,type:`tel`}],Z=p(null),Q=_({avatar:null});function ne(e){let t=e.target.files?.[0];t&&(Q.avatar=t,Q.post(`/profil/bild`,{preserveScroll:!0,forceFormData:!0,onSuccess:()=>C.success(`Profilbild aktualisiert`),onFinish:()=>{e.target.value=``}}))}function re(){v.delete(`/profil/bild`,{preserveScroll:!0,onSuccess:()=>C.success(`Profilbild entfernt`)})}let $=_({current_password:``,password:``,password_confirmation:``});function ie(){$.put(`/user/password`,{preserveScroll:!0,errorBag:`updatePassword`,onSuccess:()=>{$.reset(),C.success(`Passwort geändert`)}})}return(ee,p)=>(c(),f(S,{title:`Profil bearbeiten`},{default:u(()=>[p[10]||=i(`h1`,{class:`mb-6 text-2xl font-semibold tracking-tight`},`Profil bearbeiten`,-1),i(`div`,j,[i(`div`,M,[e(D,{title:`Profilbild`},{default:u(()=>[i(`div`,N,[e(te,{person:x.profile,class:`size-32 text-3xl`},null,8,[`person`]),i(`input`,{ref_key:`avatarInput`,ref:Z,type:`file`,accept:`image/jpeg,image/png,image/webp`,class:`hidden`,onChange:ne},null,544),i(`div`,P,[e(n(E),{variant:`outline`,disabled:n(Q).processing,onClick:p[0]||=e=>Z.value?.click()},{default:u(()=>[n(Q).processing?(c(),f(n(b),{key:0,class:`animate-spin`})):(c(),f(n(A),{key:1})),t(` `+d(x.profile.avatar_url?`Bild ändern`:`Bild hochladen`),1)]),_:1},8,[`disabled`]),x.profile.avatar_url?(c(),f(n(E),{key:0,variant:`ghost`,class:`text-destructive hover:text-destructive`,onClick:re},{default:u(()=>[e(n(w)),p[5]||=t(` Entfernen `,-1)]),_:1})):h(``,!0)]),n(Q).errors.avatar?(c(),a(`p`,F,d(n(Q).errors.avatar),1)):h(``,!0),p[6]||=i(`p`,{class:`mt-3 text-[13px] text-muted-foreground`},`JPG, PNG oder WebP, höchstens 8 MB. Das Bild wird quadratisch zugeschnitten.`,-1)])]),_:1})]),i(`div`,I,[e(D,{title:`Persönliche Angaben`},{default:u(()=>[i(`form`,{class:`grid gap-5`,onSubmit:g(Y,[`prevent`])},[i(`div`,L,[(c(),a(l,null,o(X,t=>e(T,{id:t.key,key:t.key,label:t.label,error:n(K).errors[t.key],hint:G(t.key)?`Wird aus Microsoft Entra ID übernommen.`:``,class:r({"sm:col-span-2":t.wide})},{default:u(()=>[e(n(O),{id:t.key,modelValue:n(K)[t.key],"onUpdate:modelValue":e=>n(K)[t.key]=e,type:t.type??`text`,autocomplete:t.autocomplete,disabled:G(t.key),"aria-invalid":!!n(K).errors[t.key]},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`type`,`autocomplete`,`disabled`,`aria-invalid`])]),_:2},1032,[`id`,`label`,`error`,`hint`,`class`])),64)),e(T,{id:`about`,label:`Über mich`,error:n(K).errors.about,hint:`Aufgaben, Themen, bei denen man Sie ansprechen kann.`,class:`sm:col-span-2`},{default:u(()=>[e(n(k),{id:`about`,modelValue:n(K).about,"onUpdate:modelValue":p[1]||=e=>n(K).about=e,rows:`4`,maxlength:`2000`},null,8,[`modelValue`])]),_:1},8,[`error`])]),x.customFields.length?(c(),a(`div`,R,[p[7]||=i(`h3`,{class:`text-sm font-semibold`},`Weitere Angaben`,-1),i(`div`,z,[(c(!0),a(l,null,o(x.customFields,e=>(c(),f(T,{id:`custom-${e.key}`,key:e.key,label:e.label,error:n(K).errors[`custom_fields.${e.key}`],hint:J(e),class:r({"sm:col-span-2":e.type===`textarea`})},{default:u(()=>[e.type===`textarea`?(c(),f(n(k),{key:0,id:`custom-${e.key}`,modelValue:n(K).custom_fields[e.key],"onUpdate:modelValue":t=>n(K).custom_fields[e.key]=t,rows:`3`,disabled:e.readonly},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`disabled`])):(c(),f(n(O),{key:1,id:`custom-${e.key}`,modelValue:n(K).custom_fields[e.key],"onUpdate:modelValue":t=>n(K).custom_fields[e.key]=t,type:q[e.type]??`text`,disabled:e.readonly,"aria-invalid":!!n(K).errors[`custom_fields.${e.key}`]},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`type`,`disabled`,`aria-invalid`]))]),_:2},1032,[`id`,`label`,`error`,`hint`,`class`]))),128))])])):h(``,!0),i(`div`,B,[e(n(E),{type:`submit`,disabled:n(K).processing||!n(K).isDirty},{default:u(()=>[n(K).processing?(c(),f(n(b),{key:0,class:`animate-spin`})):h(``,!0),p[8]||=t(` Speichern `,-1)]),_:1},8,[`disabled`])])],32)]),_:1}),(c(!0),a(l,null,o(x.sections,e=>(c(),f(m(n(W)[e.component]),s({key:e.key},{ref_for:!0},e.props),null,16))),128)),x.profile.has_password?(c(),f(D,{key:0,title:`Passwort ändern`},{default:u(()=>[i(`form`,{class:`grid gap-5`,onSubmit:g(ie,[`prevent`])},[e(T,{id:`current_password`,label:`Aktuelles Passwort`,error:n($).errors.current_password,class:`sm:max-w-sm`},{default:u(()=>[e(n(O),{id:`current_password`,modelValue:n($).current_password,"onUpdate:modelValue":p[2]||=e=>n($).current_password=e,type:`password`,autocomplete:`current-password`},null,8,[`modelValue`])]),_:1},8,[`error`]),i(`div`,V,[e(T,{id:`password`,label:`Neues Passwort`,error:n($).errors.password,hint:`Mindestens 10 Zeichen, mit Buchstaben und Ziffern.`},{default:u(()=>[e(n(O),{id:`password`,modelValue:n($).password,"onUpdate:modelValue":p[3]||=e=>n($).password=e,type:`password`,autocomplete:`new-password`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(T,{id:`password_confirmation`,label:`Neues Passwort wiederholen`},{default:u(()=>[e(n(O),{id:`password_confirmation`,modelValue:n($).password_confirmation,"onUpdate:modelValue":p[4]||=e=>n($).password_confirmation=e,type:`password`,autocomplete:`new-password`},null,8,[`modelValue`])]),_:1})]),i(`div`,H,[e(n(E),{type:`submit`,disabled:n($).processing},{default:u(()=>[n($).processing?(c(),f(n(b),{key:0,class:`animate-spin`})):h(``,!0),p[9]||=t(` Passwort ändern `,-1)]),_:1},8,[`disabled`])])],32)]),_:1})):h(``,!0)])])]),_:1}))}};export{U as default}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProfileBirthday-BTcaZfOC.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-BNwrc_lv.js","assets/app-Bv2m9wnk.css","assets/dist-DtGNiYlK.js","assets/AppIcon-nlhvQfK7.js","assets/usePrimitiveElement-DC7UloPZ.js","assets/RovingFocusGroup-D88K7krN.js","assets/http-CAG9BrJF.js","assets/FormField-BoFAO4pm.js","assets/button-CwUSbS9X.js","assets/NativeSelect-G3km7PmI.js","assets/Panel-Dr-NcUuS.js","assets/chevron-right-C9w5cb2q.js"])))=>i.map(i=>d[i]); +import{D as e,E as t,O as ee,On as n,Zn as r,_ as i,b as a,bt as o,et as s,mt as c,o as l,qt as u,tr as d,v as f,vn as p,wt as m,y as h}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as g}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as _,o as v,s as y}from"./app-BNwrc_lv.js";import{O as b,k as x}from"./dist-DtGNiYlK.js";import{p as te}from"./AppIcon-nlhvQfK7.js";import{t as S}from"./AppLayout-esQiy2nD.js";import{s as C}from"./http-CAG9BrJF.js";import{t as w}from"./trash-DUqnVIgb.js";import{t as T}from"./FormField-BoFAO4pm.js";import{n as E}from"./button-CwUSbS9X.js";import{t as D}from"./Panel-Dr-NcUuS.js";import{t as O}from"./Input-FGSb2-yK.js";import{t as k}from"./Textarea-DEFXqC2w.js";var A=x({name:`camera`,size:24,node:[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]}),j={class:`grid gap-6 lg:grid-cols-12`},M={class:`lg:col-span-4`},N={class:`flex flex-col items-center text-center`},P={class:`mt-5 flex flex-wrap justify-center gap-2`},F={key:0,class:`mt-3 text-[13px] text-destructive`},I={class:`grid content-start gap-6 lg:col-span-8`},L={class:`grid gap-5 sm:grid-cols-2`},R={key:0,class:`grid gap-5 border-t pt-5`},z={class:`grid gap-5 sm:grid-cols-2`},B={class:`flex justify-end border-t pt-5`},V={class:`grid gap-5 sm:grid-cols-2`},H={class:`flex justify-end border-t pt-5`},U={__name:`Edit`,props:{profile:{type:Object,required:!0},managed:{type:Array,default:()=>[]},customFields:{type:Array,default:()=>[]},sections:{type:Array,default:()=>[]}},setup(x){let U=x,W=Object.fromEntries(Object.entries(Object.assign({"../../../../plugins-core/birthdays/resources/js/profile/ProfileBirthday.vue":()=>y(()=>import(`./ProfileBirthday-BTcaZfOC.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))})).map(([e,t])=>[`${e.match(/plugins-core\/([^/]+)\//)[1]}::${e.split(`/`).pop().replace(`.vue`,``)}`,ee(t)])),G=e=>U.managed.includes(e),K=_({first_name:U.profile.first_name??``,last_name:U.profile.last_name??``,email:U.profile.email,job_title:U.profile.job_title??``,department:U.profile.department??``,location:U.profile.location??``,phone:U.profile.phone??``,mobile:U.profile.mobile??``,about:U.profile.about??``,custom_fields:Object.fromEntries(U.customFields.map(e=>[e.key,e.value??``]))}),q={email:`email`,phone:`tel`,url:`url`,date:`date`};function J(e){let t=[];return e.managed?t.push(`Wird aus Microsoft Entra ID übernommen.`):e.readonly&&t.push(`Wird von der Personalverwaltung gepflegt.`),e.restricted&&t.push(`Nur für Sie und die Personalverwaltung sichtbar.`),e.help&&t.push(e.help),t.join(` `)}function Y(){K.put(`/profil`,{preserveScroll:!0,onSuccess:()=>{K.defaults(),C.success(`Profil gespeichert`)}})}let X=[{key:`first_name`,label:`Vorname`,autocomplete:`given-name`},{key:`last_name`,label:`Nachname`,autocomplete:`family-name`},{key:`email`,label:`E-Mail-Adresse`,type:`email`,autocomplete:`email`,wide:!0},{key:`job_title`,label:`Funktion`,autocomplete:`organization-title`},{key:`department`,label:`Abteilung`},{key:`location`,label:`Standort`},{key:`phone`,label:`Telefon`,type:`tel`,autocomplete:`tel`},{key:`mobile`,label:`Mobil`,type:`tel`}],Z=p(null),Q=_({avatar:null});function ne(e){let t=e.target.files?.[0];t&&(Q.avatar=t,Q.post(`/profil/bild`,{preserveScroll:!0,forceFormData:!0,onSuccess:()=>C.success(`Profilbild aktualisiert`),onFinish:()=>{e.target.value=``}}))}function re(){v.delete(`/profil/bild`,{preserveScroll:!0,onSuccess:()=>C.success(`Profilbild entfernt`)})}let $=_({current_password:``,password:``,password_confirmation:``});function ie(){$.put(`/user/password`,{preserveScroll:!0,errorBag:`updatePassword`,onSuccess:()=>{$.reset(),C.success(`Passwort geändert`)}})}return(ee,p)=>(c(),f(S,{title:`Profil bearbeiten`},{default:u(()=>[p[10]||=i(`h1`,{class:`mb-6 text-2xl font-semibold tracking-tight`},`Profil bearbeiten`,-1),i(`div`,j,[i(`div`,M,[e(D,{title:`Profilbild`},{default:u(()=>[i(`div`,N,[e(te,{person:x.profile,class:`size-32 text-3xl`},null,8,[`person`]),i(`input`,{ref_key:`avatarInput`,ref:Z,type:`file`,accept:`image/jpeg,image/png,image/webp`,class:`hidden`,onChange:ne},null,544),i(`div`,P,[e(n(E),{variant:`outline`,disabled:n(Q).processing,onClick:p[0]||=e=>Z.value?.click()},{default:u(()=>[n(Q).processing?(c(),f(n(b),{key:0,class:`animate-spin`})):(c(),f(n(A),{key:1})),t(` `+d(x.profile.avatar_url?`Bild ändern`:`Bild hochladen`),1)]),_:1},8,[`disabled`]),x.profile.avatar_url?(c(),f(n(E),{key:0,variant:`ghost`,class:`text-destructive hover:text-destructive`,onClick:re},{default:u(()=>[e(n(w)),p[5]||=t(` Entfernen `,-1)]),_:1})):h(``,!0)]),n(Q).errors.avatar?(c(),a(`p`,F,d(n(Q).errors.avatar),1)):h(``,!0),p[6]||=i(`p`,{class:`mt-3 text-[13px] text-muted-foreground`},`JPG, PNG oder WebP, höchstens 8 MB. Das Bild wird quadratisch zugeschnitten.`,-1)])]),_:1})]),i(`div`,I,[e(D,{title:`Persönliche Angaben`},{default:u(()=>[i(`form`,{class:`grid gap-5`,onSubmit:g(Y,[`prevent`])},[i(`div`,L,[(c(),a(l,null,o(X,t=>e(T,{id:t.key,key:t.key,label:t.label,error:n(K).errors[t.key],hint:G(t.key)?`Wird aus Microsoft Entra ID übernommen.`:``,class:r({"sm:col-span-2":t.wide})},{default:u(()=>[e(n(O),{id:t.key,modelValue:n(K)[t.key],"onUpdate:modelValue":e=>n(K)[t.key]=e,type:t.type??`text`,autocomplete:t.autocomplete,disabled:G(t.key),"aria-invalid":!!n(K).errors[t.key]},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`type`,`autocomplete`,`disabled`,`aria-invalid`])]),_:2},1032,[`id`,`label`,`error`,`hint`,`class`])),64)),e(T,{id:`about`,label:`Über mich`,error:n(K).errors.about,hint:`Aufgaben, Themen, bei denen man Sie ansprechen kann.`,class:`sm:col-span-2`},{default:u(()=>[e(n(k),{id:`about`,modelValue:n(K).about,"onUpdate:modelValue":p[1]||=e=>n(K).about=e,rows:`4`,maxlength:`2000`},null,8,[`modelValue`])]),_:1},8,[`error`])]),x.customFields.length?(c(),a(`div`,R,[p[7]||=i(`h3`,{class:`text-sm font-semibold`},`Weitere Angaben`,-1),i(`div`,z,[(c(!0),a(l,null,o(x.customFields,e=>(c(),f(T,{id:`custom-${e.key}`,key:e.key,label:e.label,error:n(K).errors[`custom_fields.${e.key}`],hint:J(e),class:r({"sm:col-span-2":e.type===`textarea`})},{default:u(()=>[e.type===`textarea`?(c(),f(n(k),{key:0,id:`custom-${e.key}`,modelValue:n(K).custom_fields[e.key],"onUpdate:modelValue":t=>n(K).custom_fields[e.key]=t,rows:`3`,disabled:e.readonly},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`disabled`])):(c(),f(n(O),{key:1,id:`custom-${e.key}`,modelValue:n(K).custom_fields[e.key],"onUpdate:modelValue":t=>n(K).custom_fields[e.key]=t,type:q[e.type]??`text`,disabled:e.readonly,"aria-invalid":!!n(K).errors[`custom_fields.${e.key}`]},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`type`,`disabled`,`aria-invalid`]))]),_:2},1032,[`id`,`label`,`error`,`hint`,`class`]))),128))])])):h(``,!0),i(`div`,B,[e(n(E),{type:`submit`,disabled:n(K).processing||!n(K).isDirty},{default:u(()=>[n(K).processing?(c(),f(n(b),{key:0,class:`animate-spin`})):h(``,!0),p[8]||=t(` Speichern `,-1)]),_:1},8,[`disabled`])])],32)]),_:1}),(c(!0),a(l,null,o(x.sections,e=>(c(),f(m(n(W)[e.component]),s({key:e.key},{ref_for:!0},e.props),null,16))),128)),x.profile.has_password?(c(),f(D,{key:0,title:`Passwort ändern`},{default:u(()=>[i(`form`,{class:`grid gap-5`,onSubmit:g(ie,[`prevent`])},[e(T,{id:`current_password`,label:`Aktuelles Passwort`,error:n($).errors.current_password,class:`sm:max-w-sm`},{default:u(()=>[e(n(O),{id:`current_password`,modelValue:n($).current_password,"onUpdate:modelValue":p[2]||=e=>n($).current_password=e,type:`password`,autocomplete:`current-password`},null,8,[`modelValue`])]),_:1},8,[`error`]),i(`div`,V,[e(T,{id:`password`,label:`Neues Passwort`,error:n($).errors.password,hint:`Mindestens 10 Zeichen, mit Buchstaben und Ziffern.`},{default:u(()=>[e(n(O),{id:`password`,modelValue:n($).password,"onUpdate:modelValue":p[3]||=e=>n($).password=e,type:`password`,autocomplete:`new-password`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(T,{id:`password_confirmation`,label:`Neues Passwort wiederholen`},{default:u(()=>[e(n(O),{id:`password_confirmation`,modelValue:n($).password_confirmation,"onUpdate:modelValue":p[4]||=e=>n($).password_confirmation=e,type:`password`,autocomplete:`new-password`},null,8,[`modelValue`])]),_:1})]),i(`div`,H,[e(n(E),{type:`submit`,disabled:n($).processing},{default:u(()=>[n($).processing?(c(),f(n(b),{key:0,class:`animate-spin`})):h(``,!0),p[9]||=t(` Passwort ändern `,-1)]),_:1},8,[`disabled`])])],32)]),_:1})):h(``,!0)])])]),_:1}))}};export{U as default}; \ No newline at end of file diff --git a/public/build/assets/Editor-8SdMFOv_.js b/public/build/assets/Editor-8SdMFOv_.js deleted file mode 100644 index 52beae4a..00000000 --- a/public/build/assets/Editor-8SdMFOv_.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,D as t,E as n,Ft as r,Ht as i,On as a,Yt as o,Zn as s,_ as c,b as l,bt as u,ct as d,g as f,gn as p,gt as m,it as h,mt as g,o as _,qt as v,tr as y,v as b,vn as x,wt as S,y as C}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w,x as ee,y as T}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{n as te,o as ne,r as re}from"./app-Bu3kn8yd.js";import{O as ie,k as E}from"./dist-DtGNiYlK.js";import{L as ae,a as oe,c as se,d as ce,f as le,i as ue,k as de,l as fe,o as D,s as pe,u as me}from"./AppIcon-0N56IC2z.js";import{t as he}from"./arrow-left-BMImfTf2.js";import{r as ge}from"./RichTextEditor-qslPmeeg.js";import{a as _e,c as ve,i as ye,l as be,n as xe,o as Se,r as Ce,s as O,t as we}from"./EditorBlockList-C9b3fqvQ.js";import{t as Te}from"./calendar-clock-8H2IkjP5.js";import{S as Ee,a as De,o as k,t as A}from"./http-DmyDwIce.js";import{t as j}from"./Switch-CWN1_5O7.js";import{t as Oe}from"./ellipsis-vertical-B9wuHo-w.js";import{t as ke}from"./eye-CFNQcvaV.js";import{t as Ae}from"./file-plus-corner-Z8xo1q-K.js";import{t as je}from"./lock-H7FAhSBr.js";import{t as Me}from"./rotate-ccw-clock-DRYS-TO2.js";import{t as Ne}from"./send-6fmdiUe6.js";import{t as Pe}from"./settings-2-L4P6usDq.js";import{t as Fe}from"./smartphone-BE2l7T-2.js";import{t as Ie}from"./trash-DUqnVIgb.js";import{t as M}from"./DialogDescription-BxaIqmag.js";import{a as N,s as Le}from"./format-BsuBtvUs.js";import{t as P}from"./button-ZHC5mKey.js";import{t as F}from"./Input-FGSb2-yK.js";import{t as I}from"./Textarea-DEFXqC2w.js";import{i as L,n as R,r as z,t as B}from"./dialog-uBUhf8w7.js";import{t as V}from"./DialogHeader-DuqiL3ry.js";import{t as H}from"./PageContent-bQ_WRrV_.js";import{t as Re}from"./NewPageDialog-BJuo8o_M.js";var ze=E({name:`cloud-alert`,size:24,node:[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]}),U={key:0,class:`rounded-md bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:bg-amber-950/50 dark:text-amber-100`},W={class:`grid gap-2`},Be={class:`flex cursor-pointer items-start gap-3 rounded-md border p-3 has-checked:border-brand-400 has-checked:bg-brand-soft/60`},Ve={class:`flex cursor-pointer items-start gap-3 rounded-md border p-3 has-checked:border-brand-400 has-checked:bg-brand-soft/60`},He={class:`grid flex-1 gap-2`},Ue={__name:`PublishDialog`,props:e({scheduledAt:{type:String,default:null}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`publish`],[`update:open`]),setup(e,{emit:s}){let u=e,d=r(e,`open`),f=s,p=x(`now`),m=x(``),h=x(!1);function _(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`}i(d,e=>{if(e){p.value=`now`;let e=new Date(Date.now()+864e5);e.setHours(7,0,0,0),m.value=_(e),h.value=!1}});async function S(){h.value=!0,f(`publish`,p.value===`later`?new Date(m.value).toISOString():null),setTimeout(()=>h.value=!1,800)}return(e,r)=>(g(),b(a(L),{open:d.value,"onUpdate:open":r[4]||=e=>d.value=e},{default:v(()=>[t(a(z),{class:`sm:max-w-md`},{default:v(()=>[t(a(V),null,{default:v(()=>[t(a(B),null,{default:v(()=>[...r[5]||=[n(`Seite veröffentlichen`,-1)]]),_:1}),t(a(M),null,{default:v(()=>[...r[6]||=[n(`Der aktuelle Stand wird für alle sichtbar, die die Seite sehen dürfen. Frühere Stände bleiben unter „Versionen“ erhalten.`,-1)]]),_:1})]),_:1}),u.scheduledAt?(g(),l(`p`,U,` Es ist bereits eine Veröffentlichung geplant. Sie wird durch diese ersetzt. `)):C(``,!0),c(`fieldset`,W,[r[9]||=c(`legend`,{class:`sr-only`},`Zeitpunkt`,-1),c(`label`,Be,[o(c(`input`,{"onUpdate:modelValue":r[0]||=e=>p.value=e,type:`radio`,value:`now`,class:`mt-1 accent-[var(--brand)]`},null,512),[[T,p.value]]),r[7]||=c(`span`,null,[c(`span`,{class:`block text-sm font-medium`},`Jetzt veröffentlichen`),c(`span`,{class:`block text-xs text-muted-foreground`},`Sofort sichtbar.`)],-1)]),c(`label`,Ve,[o(c(`input`,{"onUpdate:modelValue":r[1]||=e=>p.value=e,type:`radio`,value:`later`,class:`mt-1 accent-[var(--brand)]`},null,512),[[T,p.value]]),c(`span`,He,[r[8]||=c(`span`,null,[c(`span`,{class:`block text-sm font-medium`},`Zeitgesteuert`),c(`span`,{class:`block text-xs text-muted-foreground`},`Der aktuelle Stand geht zum gewählten Zeitpunkt online.`)],-1),p.value===`later`?(g(),b(a(F),{key:0,modelValue:m.value,"onUpdate:modelValue":r[2]||=e=>m.value=e,type:`datetime-local`,min:_(new Date),"aria-label":`Zeitpunkt der Veröffentlichung`},null,8,[`modelValue`,`min`])):C(``,!0)])])]),t(a(R),null,{default:v(()=>[t(a(P),{variant:`outline`,onClick:r[3]||=e=>d.value=!1},{default:v(()=>[...r[10]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(P),{disabled:h.value||p.value===`later`&&!m.value,onClick:S},{default:v(()=>[p.value===`later`?(g(),b(a(Te),{key:0})):(g(),b(a(Ne),{key:1})),n(` `+y(p.value===`later`?`Planen`:`Veröffentlichen`),1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}},We={class:`flex min-h-0 flex-1`},Ge={class:`w-64 shrink-0 overflow-y-auto border-r p-2`},Ke={key:0,class:`grid place-items-center py-10`},qe={key:1,class:`px-3 py-6 text-center text-sm text-muted-foreground`},Je=[`onClick`],Ye={class:`block text-sm font-medium`},G={class:`block truncate text-xs text-muted-foreground`},Xe={class:`flex min-w-0 flex-1 flex-col`},Ze={class:`min-h-0 flex-1 overflow-y-auto bg-background p-6`},K={key:0,class:`grid place-items-center py-16`},Qe={class:`mb-6 text-2xl font-semibold tracking-tight`},q={key:0,class:`flex items-center justify-between gap-3 border-t px-5 py-3`},J={class:`text-xs text-muted-foreground`},$e={__name:`RevisionsDialog`,props:e({base:{type:String,required:!0},readOnly:{type:Boolean,default:!1}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`restored`],[`update:open`]),setup(e,{emit:o}){let d=e,f=r(e,`open`),p=o,m=x(null),h=x(null),S=x(null),w=x(!1);i(f,async e=>{e&&(m.value=null,S.value=null,h.value=null,m.value=(await A.get(`${d.base}/versionen`)).revisions,m.value.length&&ee(m.value[0]))});async function ee(e){h.value=e,w.value=!0;try{S.value=await A.get(`${d.base}/versionen/${e.id}`)}finally{w.value=!1}}async function T(){try{p(`restored`,await A.post(`${d.base}/versionen/${h.value.id}/wiederherstellen`))}catch(e){k.error(e.message)}}return(r,i)=>(g(),b(a(L),{open:f.value,"onUpdate:open":i[0]||=e=>f.value=e},{default:v(()=>[t(a(z),{class:`flex h-[85vh] max-w-5xl flex-col gap-0 p-0 sm:max-w-5xl`},{default:v(()=>[t(a(V),{class:`border-b px-5 py-4`},{default:v(()=>[t(a(B),null,{default:v(()=>[...i[1]||=[n(`Versionen`,-1)]]),_:1}),t(a(M),null,{default:v(()=>[...i[2]||=[n(`Jede Veröffentlichung wird gespeichert. Eine ältere Version lässt sich als Entwurf zurückholen.`,-1)]]),_:1})]),_:1}),c(`div`,We,[c(`ul`,Ge,[m.value===null?(g(),l(`li`,Ke,[t(a(ie),{class:`size-5 animate-spin text-muted-foreground`})])):m.value.length?C(``,!0):(g(),l(`li`,qe,`Noch keine veröffentlichten Versionen.`)),(g(!0),l(_,null,u(m.value??[],e=>(g(),l(`li`,{key:e.id},[c(`button`,{type:`button`,class:s([`w-full rounded-md px-3 py-2 text-left`,h.value?.id===e.id?`bg-brand-soft text-brand-soft-foreground`:`hover:bg-accent`]),onClick:t=>ee(e)},[c(`span`,Ye,y(a(N)(e.created_at)),1),c(`span`,G,[n(y(e.action),1),e.user?(g(),l(_,{key:0},[n(` · `+y(e.user),1)],64)):C(``,!0)])],10,Je)]))),128))]),c(`div`,Xe,[c(`div`,Ze,[w.value?(g(),l(`div`,K,[t(a(ie),{class:`size-6 animate-spin text-muted-foreground`})])):S.value?(g(),l(_,{key:1},[c(`h1`,Qe,y(S.value.title),1),t(H,{content:S.value.content},null,8,[`content`])],64)):C(``,!0)]),h.value?(g(),l(`div`,q,[c(`span`,J,y(new Date(h.value.created_at).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`})),1),t(a(P),{disabled:e.readOnly,onClick:T},{default:v(()=>[t(a(Me)),i[3]||=n(` Als Entwurf wiederherstellen`,-1)]),_:1},8,[`disabled`])])):C(``,!0)])])]),_:1})]),_:1},8,[`open`]))}},et={class:`grid gap-1.5`},Y={key:0,class:`text-[13px] text-destructive`},tt={key:1,class:`text-xs text-muted-foreground`},nt={key:0,class:`flex items-center justify-between gap-3 text-[13px] font-medium`},rt={__name:`PageSettingsDialog`,props:e({page:{type:Object,required:!0},base:{type:String,required:!0}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`saved`],[`update:open`]),setup(e,{emit:o}){let s=e,u=r(e,`open`),d=o,f=x({slug:``,in_navigation:!1}),p=x({}),m=x(!1);i(u,e=>{e&&(f.value={slug:s.page.slug,in_navigation:s.page.in_navigation},p.value={})});async function h(){m.value=!0;try{d(`saved`,await A.put(`${s.base}/einstellungen`,f.value)),u.value=!1}catch(e){p.value=e.fieldErrors??{}}finally{m.value=!1}}return(r,i)=>(g(),b(a(L),{open:u.value,"onUpdate:open":i[3]||=e=>u.value=e},{default:v(()=>[t(a(z),{class:`sm:max-w-md`},{default:v(()=>[t(a(V),null,{default:v(()=>[t(a(B),null,{default:v(()=>[...i[4]||=[n(`Seiteneinstellungen`,-1)]]),_:1}),t(a(M),null,{default:v(()=>[...i[5]||=[n(`Sichtbarkeit und Rechte pflegen Sie in der Administration unter „Seiten“.`,-1)]]),_:1})]),_:1}),c(`form`,{class:`grid gap-4`,onSubmit:w(h,[`prevent`])},[c(`label`,et,[i[6]||=c(`span`,{class:`text-[13px] font-medium`},`Kürzel in der Adresse`,-1),t(a(F),{modelValue:f.value.slug,"onUpdate:modelValue":i[0]||=e=>f.value.slug=e,maxlength:`120`,"aria-invalid":!!p.value.slug},null,8,[`modelValue`,`aria-invalid`]),p.value.slug?(g(),l(`span`,Y,y(p.value.slug),1)):(g(),l(`span`,tt,`Ändert auch die Adressen aller Unterseiten. Alte Links funktionieren dann nicht mehr.`))]),e.page.can.navigation?(g(),l(`label`,nt,[i[7]||=n(` In der Hauptnavigation anzeigen `,-1),t(a(j),{modelValue:f.value.in_navigation,"onUpdate:modelValue":i[1]||=e=>f.value.in_navigation=e},null,8,[`modelValue`])])):C(``,!0),t(a(R),null,{default:v(()=>[t(a(P),{type:`button`,variant:`outline`,onClick:i[2]||=e=>u.value=!1},{default:v(()=>[...i[8]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(P),{type:`submit`,disabled:m.value},{default:v(()=>[...i[9]||=[n(`Speichern`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]))}},X={class:`grid gap-1.5`},it={__name:`ReviewDialog`,props:{open:{type:Boolean,default:!1},openModifiers:{}},emits:e([`submit`],[`update:open`]),setup(e,{emit:o}){let s=r(e,`open`),l=o,u=x(``),d=x(!1);i(s,e=>e&&(u.value=``,d.value=!1));function f(){d.value=!0,l(`submit`,u.value),setTimeout(()=>d.value=!1,1500)}return(e,r)=>(g(),b(a(L),{open:s.value,"onUpdate:open":r[2]||=e=>s.value=e},{default:v(()=>[t(a(z),{class:`sm:max-w-md`},{default:v(()=>[t(a(V),null,{default:v(()=>[t(a(B),null,{default:v(()=>[...r[3]||=[n(`Freigabe anfordern`,-1)]]),_:1}),t(a(M),null,{default:v(()=>[...r[4]||=[n(`Ihre Änderungen sind als Entwurf gespeichert. Die Personen, die diese Seite veröffentlichen dürfen, werden benachrichtigt.`,-1)]]),_:1})]),_:1}),c(`label`,X,[r[5]||=c(`span`,{class:`text-[13px] font-medium`},`Nachricht (freiwillig)`,-1),t(a(I),{modelValue:u.value,"onUpdate:modelValue":r[0]||=e=>u.value=e,rows:`3`,maxlength:`1000`,placeholder:`z. B. Bitte bis Freitag veröffentlichen.`},null,8,[`modelValue`])]),t(a(R),null,{default:v(()=>[t(a(P),{variant:`outline`,onClick:r[1]||=e=>s.value=!1},{default:v(()=>[...r[6]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(P),{disabled:d.value,onClick:f},{default:v(()=>[t(a(Ne)),r[7]||=n(` Anfordern`,-1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}},at={class:`flex h-dvh flex-col bg-background`},ot={class:`z-30 flex h-14 shrink-0 items-center gap-2 border-b bg-card px-2 sm:px-3`},st={class:`min-w-0 flex-1`},ct={class:`flex items-center gap-2`},lt={class:`truncate text-sm font-semibold`},ut={class:`flex items-center gap-1 truncate text-xs text-muted-foreground`,"aria-live":`polite`},dt={class:`hidden items-center gap-0.5 md:flex`},ft=[`disabled`],pt=[`disabled`],mt={class:`flex rounded-md border p-0.5`,role:`group`,"aria-label":`Vorschau`},ht=[`title`,`aria-pressed`,`onClick`],gt=[`href`],_t={key:0,class:`flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-amber-200 bg-amber-50 px-4 py-2.5 text-sm text-amber-900 dark:border-amber-900 dark:bg-amber-950/50 dark:text-amber-100`},vt={class:`flex-1`},yt={class:`flex min-h-0 flex-1`},bt={key:0,class:`mb-2 flex flex-wrap gap-1 text-xs text-muted-foreground`,"aria-label":`Brotkrumen`},xt=[`readonly`],St={class:`@container`},Ct={class:`hidden w-[340px] shrink-0 flex-col border-l bg-card lg:flex`},wt={class:`flex shrink-0 border-b px-2`,role:`tablist`},Tt=[`aria-selected`,`disabled`,`onClick`],Et={key:0,class:`absolute inset-x-2 bottom-0 h-[3px] rounded-t-full bg-brand`},Dt={class:`min-h-0 flex-1 overflow-y-auto p-4`},Ot={class:`fixed right-4 bottom-4 z-30 flex gap-2 lg:hidden`},Z={__name:`Editor`,props:{page:{type:Object,required:!0},working:{type:Object,required:!0},lockedBy:{type:Object,default:null},blockTypes:{type:Array,required:!0},blockGroups:{type:Object,required:!0},files:{type:Array,default:()=>[]},audienceOptions:{type:Object,required:!0},breadcrumbs:{type:Array,default:()=>[]},uploadsUrl:{type:String,required:!0}},setup(e){let r=e,T=`/redaktion/seiten/${r.page.id}`,E=Object.fromEntries(r.blockTypes.map(e=>[e.key,e])),j=x(r.page),M=p(ye(r.working)),N=x(null),F=x(null),I=p({}),L=x(r.files),R=x(!!r.lockedBy),z=x(r.lockedBy),B=x(`desktop`),V=x(!1),H=x(`blocks`),U=f(()=>N.value?O(M.content.blocks,N.value)?.block??null:null);i(N,e=>{H.value=e?`block`:`blocks`});function W(e){N.value=e??null}function Be(e,t,n){if(R.value)return;let r=_e(n);e.splice(t,0,r),W(r.id)}function Ve(e){let t=U.value?O(M.content.blocks,U.value.id):null;t?Be(t.list,t.index+1,e):Be(M.content.blocks,M.content.blocks.length,e),V.value=!1,requestAnimationFrame(()=>document.querySelector(`[data-block-id="${N.value}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}))}function He(e){let t=O(M.content.blocks,e);t&&(t.list.splice(t.index,1),N.value===e&&W(null))}function We(e,t){let n=O(M.content.blocks,e),r=n?n.index+t:-1;n&&r>=0&&rt.items?.includes(e)||O(e.blocks,t.id))}async function qe(e){let t=new FormData;return t.append(`image`,e),A.post(`${T}/bilder`,t)}async function Je(e){let t=new FormData;t.append(`file`,e);let n=await A.post(`${T}/dateien`,t);return L.value=[n.file,...L.value],n.file}let Ye=p({});m(`pagebuilder:editor`,{types:E,groups:r.blockGroups,selectedId:N,hoveredId:F,previews:I,readOnly:R,files:L,peopleCache:Ye,audienceOptions:r.audienceOptions,select:W,insert:Be,remove:He,move:We,duplicate:Ge,containsActive:Ke,uploadImage:qe,uploadFile:Je,imageUrl:e=>`${r.uploadsUrl}/${e}`}),m(`pagebuilder:list`,we),m(`pagebuilder:types`,E),m(`pagebuilder:editing`,f(()=>!R.value));let G={},Xe;function Ze(){let e=[];ve(M.content.blocks,t=>{if(!E[t.type]?.dynamic)return;let n=JSON.stringify(t.data);G[t.id]!==n&&(G[t.id]=n,e.push({id:t.id,type:t.type,data:t.data}))}),e.length&&A.post(`${T}/vorschau`,{blocks:e.slice(0,100)}).then(e=>Object.assign(I,e.props)).catch(()=>{})}let K=x(`saved`),Qe=x(j.value.draft_updated_at),q,J=JSON.stringify(M);function et(){return{title:M.title,content:M.content}}async function Y(){if(clearTimeout(q),R.value)return;let e=JSON.stringify(M);if(e===J){K.value=`saved`;return}K.value=`saving`;try{let t=await A.put(`${T}/entwurf`,et());J=e,j.value=t.page,Qe.value=new Date().toISOString(),K.value=JSON.stringify(M)===J?`saved`:`dirty`,K.value===`dirty`&&tt()}catch(e){nt(e),K.value=`error`}}function tt(e=1200){clearTimeout(q),q=setTimeout(Y,e)}function nt(e){e.status===423?(R.value=!0,z.value=e.data.lockedBy,k.error(e.message)):e.status===422&&e.data?.errors?.title?k.error(e.data.errors.title[0]):k.error(e.message||`Speichern fehlgeschlagen. Bitte die Verbindung prüfen.`)}let X=x([]),Z=x([]),kt=JSON.stringify(M),At=!1,jt;function Mt(){let e=JSON.stringify(M);e!==kt&&(X.value=[...X.value.slice(-49),kt],Z.value=[],kt=e)}function Nt(e){At=!0;let t=JSON.parse(e);M.title=t.title,M.content=t.content,kt=e,N.value&&!O(M.content.blocks,N.value)&&W(null),setTimeout(()=>At=!1)}function Pt(){Mt(),X.value.length&&(Z.value=[...Z.value,JSON.stringify(M)],Nt(X.value.at(-1)),X.value=X.value.slice(0,-1))}function Ft(){Z.value.length&&(X.value=[...X.value,JSON.stringify(M)],Nt(Z.value.at(-1)),Z.value=Z.value.slice(0,-1))}i(M,()=>{R.value||(K.value=`dirty`,tt(),clearTimeout(Xe),Xe=setTimeout(Ze,500),At||(clearTimeout(jt),jt=setTimeout(Mt,700)))},{deep:!0});function It(e){let t=e.target.closest?.(`input, textarea, select, [contenteditable="true"]`);(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`?(e.preventDefault(),Y()):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`z`?(e.preventDefault(),e.shiftKey?Ft():Pt()):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`y`?(e.preventDefault(),Ft()):e.key===`Escape`&&!t&&W(null)}let Lt;async function Rt(e=!1){try{await A.post(`${T}/sperre`,{takeover:e}),e&&(R.value=!1,z.value=null,k.success(`Sie bearbeiten die Seite jetzt.`))}catch(e){e.status===423&&(R.value=!0,z.value=e.data.lockedBy)}}async function zt(){await Rt(!0),ne.reload({only:[`working`,`page`],onSuccess:()=>Object.assign(M,ye(r.working))})}function Bt(){R.value||(JSON.stringify(M)!==J&&fetch(`${T}/entwurf`,{method:`PUT`,keepalive:!0,credentials:`same-origin`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"X-XSRF-TOKEN":decodeURIComponent(document.cookie.match(/XSRF-TOKEN=([^;]*)/)?.[1]??``)},body:JSON.stringify(et())}),A.post(`${T}/sperre/freigeben`,{},{keepalive:!0}).catch(()=>{}))}d(()=>{Ze(),window.addEventListener(`keydown`,It),window.addEventListener(`pagehide`,Bt),Lt=setInterval(()=>!R.value&&Rt(),45e3)}),h(()=>{window.removeEventListener(`keydown`,It),window.removeEventListener(`pagehide`,Bt),clearInterval(Lt),clearTimeout(q),Bt()});let Q=p({publish:!1,review:!1,revisions:!1,settings:!1,newPage:!1});async function Vt(e){clearTimeout(q);try{let t=await A.post(`${T}/veroeffentlichen`,{...et(),scheduled_at:e||null});j.value=t.page,J=JSON.stringify(M),K.value=`saved`,Q.publish=!1,k.success(e?`Veröffentlichung geplant für ${new Date(e).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`})}`:`Seite veröffentlicht`,{action:e?void 0:{label:`Ansehen`,onClick:()=>ne.visit(j.value.url)}})}catch(e){nt(e)}}async function Ht(e){await Y();try{let t=await A.post(`${T}/freigabe`,{message:e});Q.review=!1,k.success(`Freigabe angefordert – ${t.recipients} ${t.recipients===1?`Person wurde`:`Personen wurden`} benachrichtigt.`)}catch(e){k.error(e.message)}}async function $(e,t,n,r){if(!n||window.confirm(n))try{let n=await A[e](t);if(n.page&&(j.value=n.page),n.working&&(Nt(JSON.stringify(n.working)),J=JSON.stringify(M)),n.redirect){ne.visit(n.redirect);return}k.success(r)}catch(e){k.error(e.message)}}function Ut(e){j.value=e.page,Nt(JSON.stringify(e.working)),J=JSON.stringify(M),Object.keys(G).forEach(e=>delete G[e]),Ze(),Q.revisions=!1,k.success(`Version als Entwurf wiederhergestellt`)}let Wt=f(()=>j.value.scheduled_at?{label:`Geplant: ${new Date(j.value.scheduled_at).toLocaleString(`de-DE`,{dateStyle:`short`,timeStyle:`short`})}`,class:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`}:j.value.is_published?j.value.has_draft?{label:`Entwurf mit Änderungen`,class:`bg-brand-soft text-brand-soft-foreground`}:{label:`Veröffentlicht`,class:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`}:{label:`Nicht veröffentlicht`,class:`bg-muted text-muted-foreground`}),Gt=[{key:`desktop`,label:`Desktop`,icon:ae,width:`max-w-[1100px]`},{key:`tablet`,label:`Tablet`,icon:be,width:`max-w-[768px]`},{key:`mobile`,label:`Smartphone`,icon:Fe,width:`max-w-[390px]`}],Kt=f(()=>Gt.find(e=>e.key===B.value).width);return(r,i)=>(g(),l(_,null,[t(a(te),{title:`Bearbeiten: ${M.title}`},null,8,[`title`]),c(`div`,at,[c(`header`,ot,[t(a(re),{href:j.value.is_published?j.value.url:`/redaktion`,class:`grid size-9 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:`Zurück`},{default:v(()=>[t(a(he),{class:`size-5`})]),_:1},8,[`href`]),c(`div`,st,[c(`div`,ct,[c(`span`,lt,y(M.title||`Ohne Titel`),1),c(`span`,{class:s([`hidden shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium sm:inline`,Wt.value.class])},y(Wt.value.label),3)]),c(`p`,ut,[R.value?(g(),l(_,{key:0},[t(a(je),{class:`size-3`}),i[21]||=n(` Nur lesen`,-1)],64)):K.value===`saving`?(g(),l(_,{key:1},[t(a(ie),{class:`size-3 animate-spin`}),i[22]||=n(` Speichert …`,-1)],64)):K.value===`error`?(g(),l(_,{key:2},[t(a(ze),{class:`size-3 text-destructive`}),i[23]||=n(` Nicht gespeichert`,-1)],64)):K.value===`dirty`?(g(),l(_,{key:3},[n(`Ungespeicherte Änderungen`)],64)):Qe.value?(g(),l(_,{key:4},[t(a(Ee),{class:`size-3`}),n(` Entwurf gespeichert `+y(a(Le)(Qe.value)),1)],64)):(g(),l(_,{key:5},[n(y(j.value.url),1)],64))])]),c(`div`,dt,[c(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Rückgängig (Strg+Z)`,disabled:!X.value.length||R.value,onClick:Pt},[t(a(de),{class:`size-4`})],8,ft),c(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Wiederholen (Strg+Y)`,disabled:!Z.value.length||R.value,onClick:Ft},[t(a(ge),{class:`size-4`})],8,pt),i[24]||=c(`span`,{class:`mx-1 h-6 w-px bg-border`},null,-1),c(`div`,mt,[(g(),l(_,null,u(Gt,e=>c(`button`,{key:e.key,type:`button`,class:s([`grid size-8 place-items-center rounded`,B.value===e.key?`bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),title:e.label,"aria-pressed":B.value===e.key,onClick:t=>B.value=e.key},[(g(),b(S(e.icon),{class:`size-4`}))],10,ht)),64))])]),t(a(se),null,{default:v(()=>[t(a(ue),{class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent`,"aria-label":`Weitere Aktionen`},{default:v(()=>[t(a(Oe),{class:`size-5`})]),_:1}),t(a(pe),{align:`end`,class:`w-64`},{default:v(()=>[j.value.is_published?(g(),b(a(D),{key:0,"as-child":``},{default:v(()=>[c(`a`,{href:j.value.url,target:`_blank`},[t(a(ke)),i[25]||=n(` Veröffentlichte Seite ansehen`,-1)],8,gt)]),_:1})):C(``,!0),t(a(D),{onSelect:i[0]||=e=>Q.revisions=!0},{default:v(()=>[t(a(Me)),i[26]||=n(` Versionen`,-1)]),_:1}),j.value.can.configure?(g(),b(a(D),{key:1,onSelect:i[1]||=e=>Q.settings=!0},{default:v(()=>[t(a(Pe)),i[27]||=n(` Seiteneinstellungen`,-1)]),_:1})):C(``,!0),j.value.can.create_child?(g(),b(a(D),{key:2,onSelect:i[2]||=e=>Q.newPage=!0},{default:v(()=>[t(a(Ae)),i[28]||=n(` Unterseite anlegen`,-1)]),_:1})):C(``,!0),t(a(oe)),j.value.has_draft&&j.value.is_published&&!R.value?(g(),b(a(D),{key:3,onSelect:i[3]||=e=>$(`delete`,`${T}/entwurf`,`Alle Änderungen seit der letzten Veröffentlichung verwerfen?`,`Entwurf verworfen`)},{default:v(()=>[t(a(de)),i[29]||=n(` Entwurf verwerfen `,-1)]),_:1})):C(``,!0),j.value.scheduled_at&&j.value.can.publish?(g(),b(a(D),{key:4,onSelect:i[4]||=e=>$(`delete`,`${T}/planung`,null,`Planung aufgehoben – der Stand ist wieder ein Entwurf`)},{default:v(()=>[t(a(Te)),i[30]||=n(` Geplante Veröffentlichung aufheben `,-1)]),_:1})):C(``,!0),j.value.is_published&&j.value.can.publish?(g(),b(a(D),{key:5,onSelect:i[5]||=e=>$(`post`,`${T}/zurueckziehen`,`Seite offline nehmen? Der Inhalt bleibt als Entwurf erhalten.`,`Seite ist offline`)},{default:v(()=>[t(a(je)),i[31]||=n(` Veröffentlichung zurückziehen `,-1)]),_:1})):C(``,!0),j.value.can.delete?(g(),b(a(D),{key:6,class:`text-destructive`,onSelect:i[6]||=e=>$(`delete`,T,`Seite endgültig löschen? Versionen und Dateien werden entfernt.`,`Seite gelöscht`)},{default:v(()=>[t(a(Ie)),i[32]||=n(` Seite löschen `,-1)]),_:1})):C(``,!0)]),_:1})]),_:1}),j.value.can.publish?(g(),b(a(P),{key:0,disabled:R.value,onClick:i[7]||=e=>Q.publish=!0},{default:v(()=>[t(a(Ne)),i[33]||=n(),i[34]||=c(`span`,{class:`hidden sm:inline`},`Veröffentlichen`,-1)]),_:1},8,[`disabled`])):(g(),b(a(P),{key:1,disabled:R.value,onClick:i[8]||=e=>Q.review=!0},{default:v(()=>[t(a(Ne)),i[35]||=n(),i[36]||=c(`span`,{class:`hidden sm:inline`},`Freigabe anfordern`,-1)]),_:1},8,[`disabled`]))]),R.value?(g(),l(`div`,_t,[t(a(je),{class:`size-4 shrink-0`}),c(`span`,vt,y(z.value?.name??`Jemand anderes`)+` bearbeitet diese Seite gerade. Sie sehen den zuletzt gespeicherten Stand.`,1),t(a(P),{size:`sm`,variant:`outline`,class:`bg-card`,onClick:zt},{default:v(()=>[...i[37]||=[n(`Bearbeitung übernehmen`,-1)]]),_:1})])):C(``,!0),c(`div`,yt,[c(`main`,{class:`min-w-0 flex-1 overflow-y-auto`,onClick:i[11]||=e=>W(null)},[c(`div`,{class:s([`mx-auto px-4 py-8 transition-[max-width] duration-300 sm:px-8`,Kt.value])},[e.breadcrumbs.length?(g(),l(`nav`,bt,[(g(!0),l(_,null,u(e.breadcrumbs,e=>(g(),l(`span`,{key:e.url},y(e.title)+` /`,1))),128))])):C(``,!0),o(c(`input`,{"onUpdate:modelValue":i[9]||=e=>M.title=e,class:`mb-6 w-full bg-transparent text-3xl font-semibold tracking-tight outline-none placeholder:text-muted-foreground/60`,placeholder:`Titel der Seite`,maxlength:`200`,"aria-label":`Titel der Seite`,readonly:R.value,onClick:i[10]||=w(()=>{},[`stop`])},null,8,xt),[[ee,M.title]]),c(`div`,St,[t(we,{item:M.content,root:``},null,8,[`item`])])],2)]),c(`aside`,Ct,[c(`div`,wt,[(g(),l(_,null,u([{key:`blocks`,label:`Blöcke`},{key:`block`,label:`Ausgewählter Block`}],e=>c(`button`,{key:e.key,type:`button`,role:`tab`,class:s([`relative px-3 py-3 text-sm font-medium disabled:opacity-40`,H.value===e.key?`text-foreground`:`text-muted-foreground hover:text-foreground`]),"aria-selected":H.value===e.key,disabled:e.key===`block`&&!U.value,onClick:t=>H.value=e.key},[n(y(e.label)+` `,1),H.value===e.key?(g(),l(`span`,Et)):C(``,!0)],10,Tt)),64))]),c(`div`,Dt,[H.value===`block`&&U.value?(g(),b(xe,{key:U.value.id,block:U.value},null,8,[`block`])):(g(),l(_,{key:1},[i[38]||=c(`p`,{class:`mb-4 text-xs text-muted-foreground`},`Klicken fügt den Block unter dem ausgewählten ein. Blöcke lassen sich auch an jede Stelle ziehen.`,-1),t(Ce,{onPick:Ve})],64))])])]),c(`div`,Ot,[t(a(P),{variant:`outline`,class:`bg-card shadow-md`,disabled:R.value,onClick:i[12]||=e=>{H.value=`blocks`,V.value=!0}},{default:v(()=>[...i[39]||=[n(`Block hinzufügen`,-1)]]),_:1},8,[`disabled`]),U.value?(g(),b(a(P),{key:0,class:`shadow-md`,onClick:i[13]||=e=>{H.value=`block`,V.value=!0}},{default:v(()=>[...i[40]||=[n(`Einstellungen`,-1)]]),_:1})):C(``,!0)]),t(a(le),{open:V.value,"onUpdate:open":i[14]||=e=>V.value=e},{default:v(()=>[t(a(ce),{side:`right`,class:`w-[340px] overflow-y-auto p-4 sm:max-w-[340px]`},{default:v(()=>[t(a(me),{class:`p-0`},{default:v(()=>[t(a(fe),null,{default:v(()=>[n(y(H.value===`block`?`Block`:`Blöcke`),1)]),_:1})]),_:1}),H.value===`block`&&U.value?(g(),b(xe,{key:U.value.id,block:U.value},null,8,[`block`])):(g(),b(Ce,{key:1,onPick:Ve}))]),_:1})]),_:1},8,[`open`]),t(Ue,{open:Q.publish,"onUpdate:open":i[15]||=e=>Q.publish=e,"scheduled-at":j.value.scheduled_at,onPublish:Vt},null,8,[`open`,`scheduled-at`]),t(it,{open:Q.review,"onUpdate:open":i[16]||=e=>Q.review=e,onSubmit:Ht},null,8,[`open`]),t($e,{open:Q.revisions,"onUpdate:open":i[17]||=e=>Q.revisions=e,base:T,"read-only":R.value,onRestored:Ut},null,8,[`open`,`read-only`]),t(rt,{open:Q.settings,"onUpdate:open":i[18]||=e=>Q.settings=e,page:j.value,base:T,onSaved:i[19]||=e=>j.value=e.page},null,8,[`open`,`page`]),t(Re,{open:Q.newPage,"onUpdate:open":i[20]||=e=>Q.newPage=e,"parent-id":j.value.id,"parent-title":j.value.title,onBeforeCreate:Y},null,8,[`open`,`parent-id`,`parent-title`])]),t(a(De),{position:`bottom-left`})],64))}};export{Z as default}; \ No newline at end of file diff --git a/public/build/assets/Editor-BKM9pJGo.js b/public/build/assets/Editor-BKM9pJGo.js new file mode 100644 index 00000000..6abecba7 --- /dev/null +++ b/public/build/assets/Editor-BKM9pJGo.js @@ -0,0 +1 @@ +import{$ as e,D as t,E as n,Ft as r,Ht as i,On as a,Yt as o,Zn as s,_ as c,b as l,bt as u,ct as d,g as f,gn as p,gt as m,it as h,mt as g,o as _,qt as v,tr as y,v as b,vn as x,wt as S,y as C}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w,x as ee,y as T}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{n as te,o as ne,r as re}from"./app-BNwrc_lv.js";import{O as ie,k as E}from"./dist-DtGNiYlK.js";import{L as ae,a as oe,c as se,d as ce,f as le,i as ue,k as de,l as fe,o as D,s as pe,u as me}from"./AppIcon-nlhvQfK7.js";import{t as he}from"./arrow-left-BMImfTf2.js";import{r as ge}from"./RichTextEditor-CT-rIT4q.js";import{a as _e,c as ve,d as ye,i as be,l as O,n as xe,o as Se,r as Ce,s as we,t as Te,u as Ee}from"./useMediaPicker-BtFVt5Ui.js";import{t as De}from"./calendar-clock-8H2IkjP5.js";import{C as Oe,n as k,o as ke,s as A}from"./http-CAG9BrJF.js";import{d as Ae,o as je}from"./useMediaList-Cpw6m1Nv.js";import{t as Me}from"./ellipsis-vertical-B9wuHo-w.js";import{t as Ne}from"./eye-CFNQcvaV.js";import{t as Pe}from"./file-plus-corner-Z8xo1q-K.js";import{t as j}from"./Switch-DtqyAsXz.js";import{t as Fe}from"./lock-H7FAhSBr.js";import{t as Ie}from"./rotate-ccw-clock-DRYS-TO2.js";import{t as Le}from"./send-6fmdiUe6.js";import{t as Re}from"./settings-2-L4P6usDq.js";import{t as ze}from"./smartphone-BE2l7T-2.js";import{t as Be}from"./trash-DUqnVIgb.js";import{a as M,s as Ve}from"./format-BsuBtvUs.js";import{n as N}from"./button-CwUSbS9X.js";import{t as P}from"./Input-FGSb2-yK.js";import{t as He}from"./Textarea-DEFXqC2w.js";import{i as F,n as I,r as L,t as R}from"./dialog-RK2mTeqi.js";import{t as z}from"./DialogDescription-CaB-9xpp.js";import{t as B}from"./DialogHeader-DuqiL3ry.js";import{t as V}from"./PageContent-22GSNgo9.js";import{t as Ue}from"./NewPageDialog-CGV-jwsW.js";var We=E({name:`cloud-alert`,size:24,node:[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]]}),H={key:0,class:`rounded-md bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:bg-amber-950/50 dark:text-amber-100`},U={class:`grid gap-2`},W={class:`flex cursor-pointer items-start gap-3 rounded-md border p-3 has-checked:border-brand-400 has-checked:bg-brand-soft/60`},Ge={class:`flex cursor-pointer items-start gap-3 rounded-md border p-3 has-checked:border-brand-400 has-checked:bg-brand-soft/60`},Ke={class:`grid flex-1 gap-2`},qe={__name:`PublishDialog`,props:e({scheduledAt:{type:String,default:null}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`publish`],[`update:open`]),setup(e,{emit:s}){let u=e,d=r(e,`open`),f=s,p=x(`now`),m=x(``),h=x(!1);function _(e){let t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`}i(d,e=>{if(e){p.value=`now`;let e=new Date(Date.now()+864e5);e.setHours(7,0,0,0),m.value=_(e),h.value=!1}});async function S(){h.value=!0,f(`publish`,p.value===`later`?new Date(m.value).toISOString():null),setTimeout(()=>h.value=!1,800)}return(e,r)=>(g(),b(a(F),{open:d.value,"onUpdate:open":r[4]||=e=>d.value=e},{default:v(()=>[t(a(L),{class:`sm:max-w-md`},{default:v(()=>[t(a(B),null,{default:v(()=>[t(a(R),null,{default:v(()=>[...r[5]||=[n(`Seite veröffentlichen`,-1)]]),_:1}),t(a(z),null,{default:v(()=>[...r[6]||=[n(`Der aktuelle Stand wird für alle sichtbar, die die Seite sehen dürfen. Frühere Stände bleiben unter „Versionen“ erhalten.`,-1)]]),_:1})]),_:1}),u.scheduledAt?(g(),l(`p`,H,` Es ist bereits eine Veröffentlichung geplant. Sie wird durch diese ersetzt. `)):C(``,!0),c(`fieldset`,U,[r[9]||=c(`legend`,{class:`sr-only`},`Zeitpunkt`,-1),c(`label`,W,[o(c(`input`,{"onUpdate:modelValue":r[0]||=e=>p.value=e,type:`radio`,value:`now`,class:`mt-1 accent-[var(--brand)]`},null,512),[[T,p.value]]),r[7]||=c(`span`,null,[c(`span`,{class:`block text-sm font-medium`},`Jetzt veröffentlichen`),c(`span`,{class:`block text-xs text-muted-foreground`},`Sofort sichtbar.`)],-1)]),c(`label`,Ge,[o(c(`input`,{"onUpdate:modelValue":r[1]||=e=>p.value=e,type:`radio`,value:`later`,class:`mt-1 accent-[var(--brand)]`},null,512),[[T,p.value]]),c(`span`,Ke,[r[8]||=c(`span`,null,[c(`span`,{class:`block text-sm font-medium`},`Zeitgesteuert`),c(`span`,{class:`block text-xs text-muted-foreground`},`Der aktuelle Stand geht zum gewählten Zeitpunkt online.`)],-1),p.value===`later`?(g(),b(a(P),{key:0,modelValue:m.value,"onUpdate:modelValue":r[2]||=e=>m.value=e,type:`datetime-local`,min:_(new Date),"aria-label":`Zeitpunkt der Veröffentlichung`},null,8,[`modelValue`,`min`])):C(``,!0)])])]),t(a(I),null,{default:v(()=>[t(a(N),{variant:`outline`,onClick:r[3]||=e=>d.value=!1},{default:v(()=>[...r[10]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(N),{disabled:h.value||p.value===`later`&&!m.value,onClick:S},{default:v(()=>[p.value===`later`?(g(),b(a(De),{key:0})):(g(),b(a(Le),{key:1})),n(` `+y(p.value===`later`?`Planen`:`Veröffentlichen`),1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}},Je={class:`flex min-h-0 flex-1`},Ye={class:`w-64 shrink-0 overflow-y-auto border-r p-2`},Xe={key:0,class:`grid place-items-center py-10`},Ze={key:1,class:`px-3 py-6 text-center text-sm text-muted-foreground`},Qe=[`onClick`],$e={class:`block text-sm font-medium`},et={class:`block truncate text-xs text-muted-foreground`},G={class:`flex min-w-0 flex-1 flex-col`},tt={class:`min-h-0 flex-1 overflow-y-auto bg-background p-6`},nt={key:0,class:`grid place-items-center py-16`},K={class:`mb-6 text-2xl font-semibold tracking-tight`},rt={key:0,class:`flex items-center justify-between gap-3 border-t px-5 py-3`},q={class:`text-xs text-muted-foreground`},it={__name:`RevisionsDialog`,props:e({base:{type:String,required:!0},readOnly:{type:Boolean,default:!1}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`restored`],[`update:open`]),setup(e,{emit:o}){let d=e,f=r(e,`open`),p=o,m=x(null),h=x(null),S=x(null),w=x(!1);i(f,async e=>{e&&(m.value=null,S.value=null,h.value=null,m.value=(await k.get(`${d.base}/versionen`)).revisions,m.value.length&&ee(m.value[0]))});async function ee(e){h.value=e,w.value=!0;try{S.value=await k.get(`${d.base}/versionen/${e.id}`)}finally{w.value=!1}}async function T(){try{p(`restored`,await k.post(`${d.base}/versionen/${h.value.id}/wiederherstellen`))}catch(e){A.error(e.message)}}return(r,i)=>(g(),b(a(F),{open:f.value,"onUpdate:open":i[0]||=e=>f.value=e},{default:v(()=>[t(a(L),{class:`flex h-[85vh] max-w-5xl flex-col gap-0 p-0 sm:max-w-5xl`},{default:v(()=>[t(a(B),{class:`border-b px-5 py-4`},{default:v(()=>[t(a(R),null,{default:v(()=>[...i[1]||=[n(`Versionen`,-1)]]),_:1}),t(a(z),null,{default:v(()=>[...i[2]||=[n(`Jede Veröffentlichung wird gespeichert. Eine ältere Version lässt sich als Entwurf zurückholen.`,-1)]]),_:1})]),_:1}),c(`div`,Je,[c(`ul`,Ye,[m.value===null?(g(),l(`li`,Xe,[t(a(ie),{class:`size-5 animate-spin text-muted-foreground`})])):m.value.length?C(``,!0):(g(),l(`li`,Ze,`Noch keine veröffentlichten Versionen.`)),(g(!0),l(_,null,u(m.value??[],e=>(g(),l(`li`,{key:e.id},[c(`button`,{type:`button`,class:s([`w-full rounded-md px-3 py-2 text-left`,h.value?.id===e.id?`bg-brand-soft text-brand-soft-foreground`:`hover:bg-accent`]),onClick:t=>ee(e)},[c(`span`,$e,y(a(M)(e.created_at)),1),c(`span`,et,[n(y(e.action),1),e.user?(g(),l(_,{key:0},[n(` · `+y(e.user),1)],64)):C(``,!0)])],10,Qe)]))),128))]),c(`div`,G,[c(`div`,tt,[w.value?(g(),l(`div`,nt,[t(a(ie),{class:`size-6 animate-spin text-muted-foreground`})])):S.value?(g(),l(_,{key:1},[c(`h1`,K,y(S.value.title),1),t(V,{content:S.value.content},null,8,[`content`])],64)):C(``,!0)]),h.value?(g(),l(`div`,rt,[c(`span`,q,y(new Date(h.value.created_at).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`})),1),t(a(N),{disabled:e.readOnly,onClick:T},{default:v(()=>[t(a(Ie)),i[3]||=n(` Als Entwurf wiederherstellen`,-1)]),_:1},8,[`disabled`])])):C(``,!0)])])]),_:1})]),_:1},8,[`open`]))}},J={class:`grid gap-1.5`},at={key:0,class:`text-[13px] text-destructive`},Y={key:1,class:`text-xs text-muted-foreground`},ot={key:0,class:`flex items-center justify-between gap-3 text-[13px] font-medium`},st={__name:`PageSettingsDialog`,props:e({page:{type:Object,required:!0},base:{type:String,required:!0}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`saved`],[`update:open`]),setup(e,{emit:o}){let s=e,u=r(e,`open`),d=o,f=x({slug:``,in_navigation:!1}),p=x({}),m=x(!1);i(u,e=>{e&&(f.value={slug:s.page.slug,in_navigation:s.page.in_navigation},p.value={})});async function h(){m.value=!0;try{d(`saved`,await k.put(`${s.base}/einstellungen`,f.value)),u.value=!1}catch(e){p.value=e.fieldErrors??{}}finally{m.value=!1}}return(r,i)=>(g(),b(a(F),{open:u.value,"onUpdate:open":i[3]||=e=>u.value=e},{default:v(()=>[t(a(L),{class:`sm:max-w-md`},{default:v(()=>[t(a(B),null,{default:v(()=>[t(a(R),null,{default:v(()=>[...i[4]||=[n(`Seiteneinstellungen`,-1)]]),_:1}),t(a(z),null,{default:v(()=>[...i[5]||=[n(`Sichtbarkeit und Rechte pflegen Sie in der Administration unter „Seiten“.`,-1)]]),_:1})]),_:1}),c(`form`,{class:`grid gap-4`,onSubmit:w(h,[`prevent`])},[c(`label`,J,[i[6]||=c(`span`,{class:`text-[13px] font-medium`},`Kürzel in der Adresse`,-1),t(a(P),{modelValue:f.value.slug,"onUpdate:modelValue":i[0]||=e=>f.value.slug=e,maxlength:`120`,"aria-invalid":!!p.value.slug},null,8,[`modelValue`,`aria-invalid`]),p.value.slug?(g(),l(`span`,at,y(p.value.slug),1)):(g(),l(`span`,Y,`Ändert auch die Adressen aller Unterseiten. Alte Links funktionieren dann nicht mehr.`))]),e.page.can.navigation?(g(),l(`label`,ot,[i[7]||=n(` In der Hauptnavigation anzeigen `,-1),t(a(j),{modelValue:f.value.in_navigation,"onUpdate:modelValue":i[1]||=e=>f.value.in_navigation=e},null,8,[`modelValue`])])):C(``,!0),t(a(I),null,{default:v(()=>[t(a(N),{type:`button`,variant:`outline`,onClick:i[2]||=e=>u.value=!1},{default:v(()=>[...i[8]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(N),{type:`submit`,disabled:m.value},{default:v(()=>[...i[9]||=[n(`Speichern`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]))}},ct={class:`grid gap-1.5`},lt={__name:`ReviewDialog`,props:{open:{type:Boolean,default:!1},openModifiers:{}},emits:e([`submit`],[`update:open`]),setup(e,{emit:o}){let s=r(e,`open`),l=o,u=x(``),d=x(!1);i(s,e=>e&&(u.value=``,d.value=!1));function f(){d.value=!0,l(`submit`,u.value),setTimeout(()=>d.value=!1,1500)}return(e,r)=>(g(),b(a(F),{open:s.value,"onUpdate:open":r[2]||=e=>s.value=e},{default:v(()=>[t(a(L),{class:`sm:max-w-md`},{default:v(()=>[t(a(B),null,{default:v(()=>[t(a(R),null,{default:v(()=>[...r[3]||=[n(`Freigabe anfordern`,-1)]]),_:1}),t(a(z),null,{default:v(()=>[...r[4]||=[n(`Ihre Änderungen sind als Entwurf gespeichert. Die Personen, die diese Seite veröffentlichen dürfen, werden benachrichtigt.`,-1)]]),_:1})]),_:1}),c(`label`,ct,[r[5]||=c(`span`,{class:`text-[13px] font-medium`},`Nachricht (freiwillig)`,-1),t(a(He),{modelValue:u.value,"onUpdate:modelValue":r[0]||=e=>u.value=e,rows:`3`,maxlength:`1000`,placeholder:`z. B. Bitte bis Freitag veröffentlichen.`},null,8,[`modelValue`])]),t(a(I),null,{default:v(()=>[t(a(N),{variant:`outline`,onClick:r[1]||=e=>s.value=!1},{default:v(()=>[...r[6]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(N),{disabled:d.value,onClick:f},{default:v(()=>[t(a(Le)),r[7]||=n(` Anfordern`,-1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`]))}},ut={class:`flex h-dvh flex-col bg-background`},dt={class:`z-30 flex h-14 shrink-0 items-center gap-2 border-b bg-card px-2 sm:px-3`},ft={class:`min-w-0 flex-1`},pt={class:`flex items-center gap-2`},mt={class:`truncate text-sm font-semibold`},ht={class:`flex items-center gap-1 truncate text-xs text-muted-foreground`,"aria-live":`polite`},gt={class:`hidden items-center gap-0.5 md:flex`},_t=[`disabled`],vt=[`disabled`],yt={class:`flex rounded-md border p-0.5`,role:`group`,"aria-label":`Vorschau`},bt=[`title`,`aria-pressed`,`onClick`],xt=[`href`],St={key:0,class:`flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-amber-200 bg-amber-50 px-4 py-2.5 text-sm text-amber-900 dark:border-amber-900 dark:bg-amber-950/50 dark:text-amber-100`},Ct={class:`flex-1`},wt={class:`flex min-h-0 flex-1`},Tt={key:0,class:`mb-2 flex flex-wrap gap-1 text-xs text-muted-foreground`,"aria-label":`Brotkrumen`},Et=[`readonly`],Dt={class:`@container`},Ot={class:`hidden w-[340px] shrink-0 flex-col border-l bg-card lg:flex`},kt={class:`flex shrink-0 border-b px-2`,role:`tablist`},At=[`aria-selected`,`disabled`,`onClick`],jt={key:0,class:`absolute inset-x-2 bottom-0 h-[3px] rounded-t-full bg-brand`},Mt={class:`min-h-0 flex-1 overflow-y-auto p-4`},Nt={class:`fixed right-4 bottom-4 z-30 flex gap-2 lg:hidden`},X={__name:`Editor`,props:{page:{type:Object,required:!0},working:{type:Object,required:!0},lockedBy:{type:Object,default:null},blockTypes:{type:Array,required:!0},blockGroups:{type:Object,required:!0},files:{type:Array,default:()=>[]},audienceOptions:{type:Object,required:!0},breadcrumbs:{type:Array,default:()=>[]},uploadsUrl:{type:String,required:!0}},setup(e){let r=e,T=`/redaktion/seiten/${r.page.id}`,E=Object.fromEntries(r.blockTypes.map(e=>[e.key,e])),j=x(r.page),M=p(Se(r.working)),P=x(null),He=x(null),F=p({}),I=x(r.files),L=x(!!r.lockedBy),R=x(r.lockedBy),z=x(`desktop`),B=x(!1),V=x(`blocks`),H=f(()=>P.value?O(M.content.blocks,P.value)?.block??null:null);i(P,e=>{V.value=e?`block`:`blocks`});function U(e){P.value=e??null}function W(e,t,n){if(L.value)return;let r=we(n);e.splice(t,0,r),U(r.id)}function Ge(e){let t=H.value?O(M.content.blocks,H.value.id):null;t?W(t.list,t.index+1,e):W(M.content.blocks,M.content.blocks.length,e),B.value=!1,requestAnimationFrame(()=>document.querySelector(`[data-block-id="${P.value}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}))}function Ke(e){let t=O(M.content.blocks,e);t&&(t.list.splice(t.index,1),P.value===e&&U(null))}function Je(e,t){let n=O(M.content.blocks,e),r=n?n.index+t:-1;n&&r>=0&&rt.items?.includes(e)||O(e.blocks,t.id))}async function Ze(e,t){return Ae(`${T}/bilder`,e,{onProgress:t})}let Qe=Te({upload:Ze,contextLabel:`Auf dieser Seite`,contextPaths:()=>je(M.content)});async function $e(e){let t=new FormData;t.append(`file`,e);let n=await k.post(`${T}/dateien`,t);return I.value=[n.file,...I.value],n.file}let et=p({});m(`pagebuilder:editor`,{types:E,groups:r.blockGroups,selectedId:P,hoveredId:He,previews:F,readOnly:L,files:I,peopleCache:et,audienceOptions:r.audienceOptions,select:U,insert:W,remove:Ke,move:Je,duplicate:Ye,containsActive:Xe,uploadImage:Ze,uploadFile:$e,pickMedia:e=>Qe.pick(e),imageUrl:e=>`${r.uploadsUrl}/${e}`}),m(`pagebuilder:list`,Ce),m(`pagebuilder:types`,E),m(`pagebuilder:editing`,f(()=>!L.value));let G={},tt;function nt(){let e=[];Ee(M.content.blocks,t=>{if(!E[t.type]?.dynamic)return;let n=JSON.stringify(t.data);G[t.id]!==n&&(G[t.id]=n,e.push({id:t.id,type:t.type,data:t.data}))}),e.length&&k.post(`${T}/vorschau`,{blocks:e.slice(0,100)}).then(e=>Object.assign(F,e.props)).catch(()=>{})}let K=x(`saved`),rt=x(j.value.draft_updated_at),q,J=JSON.stringify(M);function at(){return{title:M.title,content:M.content}}async function Y(){if(clearTimeout(q),L.value)return;let e=JSON.stringify(M);if(e===J){K.value=`saved`;return}K.value=`saving`;try{let t=await k.put(`${T}/entwurf`,at());J=e,j.value=t.page,rt.value=new Date().toISOString(),K.value=JSON.stringify(M)===J?`saved`:`dirty`,K.value===`dirty`&&ot()}catch(e){ct(e),K.value=`error`}}function ot(e=1200){clearTimeout(q),q=setTimeout(Y,e)}function ct(e){e.status===423?(L.value=!0,R.value=e.data.lockedBy,A.error(e.message)):e.status===422&&e.data?.errors?.title?A.error(e.data.errors.title[0]):A.error(e.message||`Speichern fehlgeschlagen. Bitte die Verbindung prüfen.`)}let X=x([]),Z=x([]),Pt=JSON.stringify(M),Ft=!1,It;function Lt(){let e=JSON.stringify(M);e!==Pt&&(X.value=[...X.value.slice(-49),Pt],Z.value=[],Pt=e)}function Rt(e){Ft=!0;let t=JSON.parse(e);M.title=t.title,M.content=t.content,Pt=e,P.value&&!O(M.content.blocks,P.value)&&U(null),setTimeout(()=>Ft=!1)}function zt(){Lt(),X.value.length&&(Z.value=[...Z.value,JSON.stringify(M)],Rt(X.value.at(-1)),X.value=X.value.slice(0,-1))}function Bt(){Z.value.length&&(X.value=[...X.value,JSON.stringify(M)],Rt(Z.value.at(-1)),Z.value=Z.value.slice(0,-1))}i(M,()=>{L.value||(K.value=`dirty`,ot(),clearTimeout(tt),tt=setTimeout(nt,500),Ft||(clearTimeout(It),It=setTimeout(Lt,700)))},{deep:!0});function Vt(e){let t=e.target.closest?.(`input, textarea, select, [contenteditable="true"]`);(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`?(e.preventDefault(),Y()):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`z`?(e.preventDefault(),e.shiftKey?Bt():zt()):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`y`?(e.preventDefault(),Bt()):e.key===`Escape`&&!t&&U(null)}let Ht;async function Ut(e=!1){try{await k.post(`${T}/sperre`,{takeover:e}),e&&(L.value=!1,R.value=null,A.success(`Sie bearbeiten die Seite jetzt.`))}catch(e){e.status===423&&(L.value=!0,R.value=e.data.lockedBy)}}async function Wt(){await Ut(!0),ne.reload({only:[`working`,`page`],onSuccess:()=>Object.assign(M,Se(r.working))})}function Gt(){L.value||(JSON.stringify(M)!==J&&fetch(`${T}/entwurf`,{method:`PUT`,keepalive:!0,credentials:`same-origin`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"X-XSRF-TOKEN":decodeURIComponent(document.cookie.match(/XSRF-TOKEN=([^;]*)/)?.[1]??``)},body:JSON.stringify(at())}),k.post(`${T}/sperre/freigeben`,{},{keepalive:!0}).catch(()=>{}))}d(()=>{nt(),window.addEventListener(`keydown`,Vt),window.addEventListener(`pagehide`,Gt),Ht=setInterval(()=>!L.value&&Ut(),45e3)}),h(()=>{window.removeEventListener(`keydown`,Vt),window.removeEventListener(`pagehide`,Gt),clearInterval(Ht),clearTimeout(q),Gt()});let Q=p({publish:!1,review:!1,revisions:!1,settings:!1,newPage:!1});async function Kt(e){clearTimeout(q);try{let t=await k.post(`${T}/veroeffentlichen`,{...at(),scheduled_at:e||null});j.value=t.page,J=JSON.stringify(M),K.value=`saved`,Q.publish=!1,A.success(e?`Veröffentlichung geplant für ${new Date(e).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`})}`:`Seite veröffentlicht`,{action:e?void 0:{label:`Ansehen`,onClick:()=>ne.visit(j.value.url)}})}catch(e){ct(e)}}async function qt(e){await Y();try{let t=await k.post(`${T}/freigabe`,{message:e});Q.review=!1,A.success(`Freigabe angefordert – ${t.recipients} ${t.recipients===1?`Person wurde`:`Personen wurden`} benachrichtigt.`)}catch(e){A.error(e.message)}}async function $(e,t,n,r){if(!n||window.confirm(n))try{let n=await k[e](t);if(n.page&&(j.value=n.page),n.working&&(Rt(JSON.stringify(n.working)),J=JSON.stringify(M)),n.redirect){ne.visit(n.redirect);return}A.success(r)}catch(e){A.error(e.message)}}function Jt(e){j.value=e.page,Rt(JSON.stringify(e.working)),J=JSON.stringify(M),Object.keys(G).forEach(e=>delete G[e]),nt(),Q.revisions=!1,A.success(`Version als Entwurf wiederhergestellt`)}let Yt=f(()=>j.value.scheduled_at?{label:`Geplant: ${new Date(j.value.scheduled_at).toLocaleString(`de-DE`,{dateStyle:`short`,timeStyle:`short`})}`,class:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`}:j.value.is_published?j.value.has_draft?{label:`Entwurf mit Änderungen`,class:`bg-brand-soft text-brand-soft-foreground`}:{label:`Veröffentlicht`,class:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`}:{label:`Nicht veröffentlicht`,class:`bg-muted text-muted-foreground`}),Xt=[{key:`desktop`,label:`Desktop`,icon:ae,width:`max-w-[1100px]`},{key:`tablet`,label:`Tablet`,icon:ye,width:`max-w-[768px]`},{key:`mobile`,label:`Smartphone`,icon:ze,width:`max-w-[390px]`}],Zt=f(()=>Xt.find(e=>e.key===z.value).width);return(r,i)=>(g(),l(_,null,[t(a(te),{title:`Bearbeiten: ${M.title}`},null,8,[`title`]),c(`div`,ut,[c(`header`,dt,[t(a(re),{href:j.value.is_published?j.value.url:`/redaktion`,class:`grid size-9 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:`Zurück`},{default:v(()=>[t(a(he),{class:`size-5`})]),_:1},8,[`href`]),c(`div`,ft,[c(`div`,pt,[c(`span`,mt,y(M.title||`Ohne Titel`),1),c(`span`,{class:s([`hidden shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium sm:inline`,Yt.value.class])},y(Yt.value.label),3)]),c(`p`,ht,[L.value?(g(),l(_,{key:0},[t(a(Fe),{class:`size-3`}),i[21]||=n(` Nur lesen`,-1)],64)):K.value===`saving`?(g(),l(_,{key:1},[t(a(ie),{class:`size-3 animate-spin`}),i[22]||=n(` Speichert …`,-1)],64)):K.value===`error`?(g(),l(_,{key:2},[t(a(We),{class:`size-3 text-destructive`}),i[23]||=n(` Nicht gespeichert`,-1)],64)):K.value===`dirty`?(g(),l(_,{key:3},[n(`Ungespeicherte Änderungen`)],64)):rt.value?(g(),l(_,{key:4},[t(a(Oe),{class:`size-3`}),n(` Entwurf gespeichert `+y(a(Ve)(rt.value)),1)],64)):(g(),l(_,{key:5},[n(y(j.value.url),1)],64))])]),c(`div`,gt,[c(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Rückgängig (Strg+Z)`,disabled:!X.value.length||L.value,onClick:zt},[t(a(de),{class:`size-4`})],8,_t),c(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Wiederholen (Strg+Y)`,disabled:!Z.value.length||L.value,onClick:Bt},[t(a(ge),{class:`size-4`})],8,vt),i[24]||=c(`span`,{class:`mx-1 h-6 w-px bg-border`},null,-1),c(`div`,yt,[(g(),l(_,null,u(Xt,e=>c(`button`,{key:e.key,type:`button`,class:s([`grid size-8 place-items-center rounded`,z.value===e.key?`bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),title:e.label,"aria-pressed":z.value===e.key,onClick:t=>z.value=e.key},[(g(),b(S(e.icon),{class:`size-4`}))],10,bt)),64))])]),t(a(se),null,{default:v(()=>[t(a(ue),{class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent`,"aria-label":`Weitere Aktionen`},{default:v(()=>[t(a(Me),{class:`size-5`})]),_:1}),t(a(pe),{align:`end`,class:`w-64`},{default:v(()=>[j.value.is_published?(g(),b(a(D),{key:0,"as-child":``},{default:v(()=>[c(`a`,{href:j.value.url,target:`_blank`},[t(a(Ne)),i[25]||=n(` Veröffentlichte Seite ansehen`,-1)],8,xt)]),_:1})):C(``,!0),t(a(D),{onSelect:i[0]||=e=>Q.revisions=!0},{default:v(()=>[t(a(Ie)),i[26]||=n(` Versionen`,-1)]),_:1}),j.value.can.configure?(g(),b(a(D),{key:1,onSelect:i[1]||=e=>Q.settings=!0},{default:v(()=>[t(a(Re)),i[27]||=n(` Seiteneinstellungen`,-1)]),_:1})):C(``,!0),j.value.can.create_child?(g(),b(a(D),{key:2,onSelect:i[2]||=e=>Q.newPage=!0},{default:v(()=>[t(a(Pe)),i[28]||=n(` Unterseite anlegen`,-1)]),_:1})):C(``,!0),t(a(oe)),j.value.has_draft&&j.value.is_published&&!L.value?(g(),b(a(D),{key:3,onSelect:i[3]||=e=>$(`delete`,`${T}/entwurf`,`Alle Änderungen seit der letzten Veröffentlichung verwerfen?`,`Entwurf verworfen`)},{default:v(()=>[t(a(de)),i[29]||=n(` Entwurf verwerfen `,-1)]),_:1})):C(``,!0),j.value.scheduled_at&&j.value.can.publish?(g(),b(a(D),{key:4,onSelect:i[4]||=e=>$(`delete`,`${T}/planung`,null,`Planung aufgehoben – der Stand ist wieder ein Entwurf`)},{default:v(()=>[t(a(De)),i[30]||=n(` Geplante Veröffentlichung aufheben `,-1)]),_:1})):C(``,!0),j.value.is_published&&j.value.can.publish?(g(),b(a(D),{key:5,onSelect:i[5]||=e=>$(`post`,`${T}/zurueckziehen`,`Seite offline nehmen? Der Inhalt bleibt als Entwurf erhalten.`,`Seite ist offline`)},{default:v(()=>[t(a(Fe)),i[31]||=n(` Veröffentlichung zurückziehen `,-1)]),_:1})):C(``,!0),j.value.can.delete?(g(),b(a(D),{key:6,class:`text-destructive`,onSelect:i[6]||=e=>$(`delete`,T,`Seite endgültig löschen? Versionen und Dateien werden entfernt.`,`Seite gelöscht`)},{default:v(()=>[t(a(Be)),i[32]||=n(` Seite löschen `,-1)]),_:1})):C(``,!0)]),_:1})]),_:1}),j.value.can.publish?(g(),b(a(N),{key:0,disabled:L.value,onClick:i[7]||=e=>Q.publish=!0},{default:v(()=>[t(a(Le)),i[33]||=n(),i[34]||=c(`span`,{class:`hidden sm:inline`},`Veröffentlichen`,-1)]),_:1},8,[`disabled`])):(g(),b(a(N),{key:1,disabled:L.value,onClick:i[8]||=e=>Q.review=!0},{default:v(()=>[t(a(Le)),i[35]||=n(),i[36]||=c(`span`,{class:`hidden sm:inline`},`Freigabe anfordern`,-1)]),_:1},8,[`disabled`]))]),L.value?(g(),l(`div`,St,[t(a(Fe),{class:`size-4 shrink-0`}),c(`span`,Ct,y(R.value?.name??`Jemand anderes`)+` bearbeitet diese Seite gerade. Sie sehen den zuletzt gespeicherten Stand.`,1),t(a(N),{size:`sm`,variant:`outline`,class:`bg-card`,onClick:Wt},{default:v(()=>[...i[37]||=[n(`Bearbeitung übernehmen`,-1)]]),_:1})])):C(``,!0),c(`div`,wt,[c(`main`,{class:`min-w-0 flex-1 overflow-y-auto`,onClick:i[11]||=e=>U(null)},[c(`div`,{class:s([`mx-auto px-4 py-8 transition-[max-width] duration-300 sm:px-8`,Zt.value])},[e.breadcrumbs.length?(g(),l(`nav`,Tt,[(g(!0),l(_,null,u(e.breadcrumbs,e=>(g(),l(`span`,{key:e.url},y(e.title)+` /`,1))),128))])):C(``,!0),o(c(`input`,{"onUpdate:modelValue":i[9]||=e=>M.title=e,class:`mb-6 w-full bg-transparent text-3xl font-semibold tracking-tight outline-none placeholder:text-muted-foreground/60`,placeholder:`Titel der Seite`,maxlength:`200`,"aria-label":`Titel der Seite`,readonly:L.value,onClick:i[10]||=w(()=>{},[`stop`])},null,8,Et),[[ee,M.title]]),c(`div`,Dt,[t(Ce,{item:M.content,root:``},null,8,[`item`])])],2)]),c(`aside`,Ot,[c(`div`,kt,[(g(),l(_,null,u([{key:`blocks`,label:`Blöcke`},{key:`block`,label:`Ausgewählter Block`}],e=>c(`button`,{key:e.key,type:`button`,role:`tab`,class:s([`relative px-3 py-3 text-sm font-medium disabled:opacity-40`,V.value===e.key?`text-foreground`:`text-muted-foreground hover:text-foreground`]),"aria-selected":V.value===e.key,disabled:e.key===`block`&&!H.value,onClick:t=>V.value=e.key},[n(y(e.label)+` `,1),V.value===e.key?(g(),l(`span`,jt)):C(``,!0)],10,At)),64))]),c(`div`,Mt,[V.value===`block`&&H.value?(g(),b(be,{key:H.value.id,block:H.value},null,8,[`block`])):(g(),l(_,{key:1},[i[38]||=c(`p`,{class:`mb-4 text-xs text-muted-foreground`},`Klicken fügt den Block unter dem ausgewählten ein. Blöcke lassen sich auch an jede Stelle ziehen.`,-1),t(_e,{onPick:Ge})],64))])])]),c(`div`,Nt,[t(a(N),{variant:`outline`,class:`bg-card shadow-md`,disabled:L.value,onClick:i[12]||=e=>{V.value=`blocks`,B.value=!0}},{default:v(()=>[...i[39]||=[n(`Block hinzufügen`,-1)]]),_:1},8,[`disabled`]),H.value?(g(),b(a(N),{key:0,class:`shadow-md`,onClick:i[13]||=e=>{V.value=`block`,B.value=!0}},{default:v(()=>[...i[40]||=[n(`Einstellungen`,-1)]]),_:1})):C(``,!0)]),t(a(le),{open:B.value,"onUpdate:open":i[14]||=e=>B.value=e},{default:v(()=>[t(a(ce),{side:`right`,class:`w-[340px] overflow-y-auto p-4 sm:max-w-[340px]`},{default:v(()=>[t(a(me),{class:`p-0`},{default:v(()=>[t(a(fe),null,{default:v(()=>[n(y(V.value===`block`?`Block`:`Blöcke`),1)]),_:1})]),_:1}),V.value===`block`&&H.value?(g(),b(be,{key:H.value.id,block:H.value},null,8,[`block`])):(g(),b(_e,{key:1,onPick:Ge}))]),_:1})]),_:1},8,[`open`]),t(qe,{open:Q.publish,"onUpdate:open":i[15]||=e=>Q.publish=e,"scheduled-at":j.value.scheduled_at,onPublish:Kt},null,8,[`open`,`scheduled-at`]),t(lt,{open:Q.review,"onUpdate:open":i[16]||=e=>Q.review=e,onSubmit:qt},null,8,[`open`]),t(it,{open:Q.revisions,"onUpdate:open":i[17]||=e=>Q.revisions=e,base:T,"read-only":L.value,onRestored:Jt},null,8,[`open`,`read-only`]),t(st,{open:Q.settings,"onUpdate:open":i[18]||=e=>Q.settings=e,page:j.value,base:T,onSaved:i[19]||=e=>j.value=e.page},null,8,[`open`,`page`]),t(Ue,{open:Q.newPage,"onUpdate:open":i[20]||=e=>Q.newPage=e,"parent-id":j.value.id,"parent-title":j.value.title,onBeforeCreate:Y},null,8,[`open`,`parent-id`,`parent-title`])]),t(xe,{picker:a(Qe)},null,8,[`picker`]),t(a(ke),{position:`bottom-left`})],64))}};export{X as default}; \ No newline at end of file diff --git a/public/build/assets/Editor-BhJCzJD1.js b/public/build/assets/Editor-BhJCzJD1.js new file mode 100644 index 00000000..b19179c1 --- /dev/null +++ b/public/build/assets/Editor-BhJCzJD1.js @@ -0,0 +1 @@ +import{D as e,E as t,Ht as n,On as r,Yt as ee,Zn as i,_ as a,b as o,bt as te,ct as s,g as c,gn as ne,gt as l,it as re,mt as u,o as d,qt as f,tr as p,v as m,vn as h,wt as ie,y as g}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as _,x as ae}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as oe,i as se,n as ce,o as v,r as le}from"./app-BNwrc_lv.js";import{O as ue}from"./dist-DtGNiYlK.js";import{L as de,a as fe,c as pe,d as me,f as he,i as ge,k as _e,l as ve,o as ye,s as be,u as xe}from"./AppIcon-nlhvQfK7.js";import{t as Se}from"./arrow-left-BMImfTf2.js";import{r as Ce}from"./RichTextEditor-CT-rIT4q.js";import{a as we,c as Te,d as Ee,i as De,l as y,n as Oe,o as ke,r as Ae,s as je,t as Me,u as Ne}from"./useMediaPicker-BtFVt5Ui.js";import{t as Pe}from"./calendar-clock-8H2IkjP5.js";import{n as Fe,o as Ie,s as b,v as Le}from"./http-CAG9BrJF.js";import{d as Re,o as ze}from"./useMediaList-Cpw6m1Nv.js";import{t as Be}from"./ellipsis-vertical-B9wuHo-w.js";import{t as Ve}from"./eye-CFNQcvaV.js";import{t as x}from"./Switch-DtqyAsXz.js";import{t as S}from"./image-plus-C1A_7CFG.js";import{t as C}from"./images-47Nc0alu.js";import{t as He}from"./message-square-warning-BFfa_vqd.js";import{t as Ue}from"./save-aFVYiCIj.js";import{t as We}from"./send-6fmdiUe6.js";import{t as Ge}from"./smartphone-BE2l7T-2.js";import{t as Ke}from"./trash-DUqnVIgb.js";import{t as w}from"./FormField-BoFAO4pm.js";import{n as T}from"./button-CwUSbS9X.js";import{t as E}from"./NativeSelect-G3km7PmI.js";import{t as qe}from"./Input-FGSb2-yK.js";import{t as Je}from"./Textarea-DEFXqC2w.js";import{i as Ye,n as Xe,r as Ze,t as Qe}from"./dialog-RK2mTeqi.js";import{t as $e}from"./DialogDescription-CaB-9xpp.js";import{t as et}from"./DialogHeader-DuqiL3ry.js";var tt={class:`flex h-dvh flex-col bg-background`},nt={class:`z-30 flex h-14 shrink-0 items-center gap-2 border-b bg-card px-2 sm:px-3`},rt={class:`min-w-0 flex-1`},it={class:`flex items-center gap-2`},at={class:`truncate text-sm font-semibold`},ot={class:`truncate text-xs text-muted-foreground`,"aria-live":`polite`},st={class:`hidden items-center gap-0.5 md:flex`},ct=[`disabled`],lt=[`disabled`],ut={class:`flex rounded-md border p-0.5`,role:`group`,"aria-label":`Vorschau`},dt=[`title`,`aria-pressed`,`onClick`],ft=[`href`],pt={class:`hidden sm:inline`},mt={class:`hidden sm:inline`},ht={key:0,class:`flex gap-3 border-b border-amber-200 bg-amber-50 px-4 py-2.5 text-sm text-amber-950 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100`},gt={class:`whitespace-pre-line`},_t={key:1,class:`flex flex-wrap items-center gap-3 border-b bg-brand-soft px-4 py-2.5 text-sm`},vt={class:`flex-1`},yt={class:`flex min-h-0 flex-1`},bt=[`src`],xt={class:`absolute top-3 right-3 flex gap-2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100`},St={class:`flex gap-2`},Ct={key:2,class:`-mt-4 mb-4 text-[13px] text-destructive`},wt={class:`@container`},Tt={key:3,class:`mt-4 text-center text-sm text-muted-foreground`},Et={class:`hidden w-[340px] shrink-0 flex-col border-l bg-card lg:flex`},Dt={class:`flex shrink-0 border-b px-2`,role:`tablist`},Ot=[`aria-selected`,`disabled`,`onClick`],kt={key:0,class:`absolute inset-x-2 bottom-0 h-[3px] rounded-t-full bg-brand`},At={class:`min-h-0 flex-1 overflow-y-auto p-4`},jt={key:2,class:`grid gap-4`},Mt={class:`flex items-center justify-between gap-3 text-[13px] font-medium`},Nt={key:1,class:`rounded-md bg-muted px-3 py-2 text-[13px] text-muted-foreground`},Pt={class:`flex items-center justify-between gap-3 text-[13px] font-medium`},Ft={class:`grid gap-2 border-t pt-4`},It={class:`flex gap-2`},Lt={class:`fixed right-4 bottom-4 z-30 flex gap-2 lg:hidden`},Rt={key:2,class:`grid gap-4`},zt={key:1,class:`flex items-center justify-between gap-3 text-[13px] font-medium`},D={__name:`Editor`,props:{post:{type:Object,default:null},content:{type:Object,default:()=>({blocks:[]})},categories:{type:Array,required:!0},canPublishWithoutCategory:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},forms:{type:Array,default:()=>[]},blockTypes:{type:Array,required:!0},blockGroups:{type:Object,required:!0},audienceOptions:{type:Object,required:!0},uploadsUrl:{type:String,required:!0}},setup(D){let O=D,Bt=oe(),k=Object.fromEntries(O.blockTypes.map(e=>[e.key,e]));function Vt(e){if(!e)return``;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}let A=se({title:O.post?.title??``,teaser:O.post?.teaser??``,category_id:O.post?.category_id??(O.categories.length===1?O.categories[0].id:null),cover:null,cover_media:null,remove_cover:!1,is_featured:O.post?.is_featured??!1,published_at:Vt(O.post?.published_at),form_id:O.post?.form_id??null,comments_enabled:O.post?.comments_enabled??!0,action:`draft`}),j=ne({content:ke(O.content??{blocks:[]})}),Ht=c(()=>O.categories.find(e=>e.id===Number(A.category_id))),M=c(()=>Ht.value?Ht.value.can_publish:O.canPublishWithoutCategory),Ut=c(()=>O.post?.status===`pending`),N=c(()=>O.post?.status===`published`),Wt=c(()=>O.categories.map(e=>({value:e.id,label:e.name}))),P=c(()=>A.published_at&&new Date(A.published_at)>new Date),F=h(null),I=h(null),L=ne({}),Gt=h(!1),R=h(`post`),z=h(!1),B=h(`desktop`),V=c(()=>F.value?y(j.content.blocks,F.value)?.block??null:null);n(F,e=>{R.value=e?`block`:R.value===`block`?`blocks`:R.value});function H(e){F.value=e??null}function U(e,t,n){let r=je(n);e.splice(t,0,r),H(r.id)}function Kt(e){let t=V.value?y(j.content.blocks,V.value.id):null;t?U(t.list,t.index+1,e):U(j.content.blocks,j.content.blocks.length,e),z.value=!1,requestAnimationFrame(()=>document.querySelector(`[data-block-id="${F.value}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}))}function qt(e){let t=y(j.content.blocks,e);t&&(t.list.splice(t.index,1),F.value===e&&H(null))}function Jt(e,t){let n=y(j.content.blocks,e),r=n?n.index+t:-1;n&&r>=0&&rt.items?.includes(e)||y(e.blocks,t.id))}async function Zt(e,t){try{return await Re(`/redaktion/neuigkeiten/bilder`,e,{onProgress:t})}catch(e){throw b.error(e.fieldErrors?.image??e.message),e}}let W=Me({upload:Zt,contextLabel:`In diesem Beitrag`,contextPaths:()=>ze(j.content)});async function Qt(){throw b.error(`Dateien zum Herunterladen gehören in den Bereich „Downloads“ – dort hochladen und hier mit dem Downloads-Block verlinken.`),Error(`not supported`)}l(`pagebuilder:editor`,{types:k,groups:O.blockGroups,selectedId:F,hoveredId:I,previews:L,readOnly:Gt,files:h([]),peopleCache:ne({}),audienceOptions:O.audienceOptions,select:H,insert:U,remove:qt,move:Jt,duplicate:Yt,containsActive:Xt,uploadImage:Zt,uploadFile:Qt,pickMedia:e=>W.pick(e),imageUrl:e=>`${O.uploadsUrl}/${e}`}),l(`pagebuilder:list`,Ae),l(`pagebuilder:types`,k),l(`pagebuilder:editing`,c(()=>!0));let $t={},en;function tn(){let e=[];Ne(j.content.blocks,t=>{if(!k[t.type]?.dynamic)return;let n=JSON.stringify(t.data);$t[t.id]!==n&&($t[t.id]=n,e.push({id:t.id,type:t.type,data:t.data}))}),e.length&&Fe.post(`/redaktion/neuigkeiten/vorschau`,{blocks:e.slice(0,100)}).then(e=>Object.assign(L,e.props)).catch(()=>{})}let G=h([]),K=h([]),q=JSON.stringify(j.content),nn=!1,rn;function an(){let e=JSON.stringify(j.content);e!==q&&(G.value=[...G.value.slice(-49),q],K.value=[],q=e)}function on(e){nn=!0,j.content=JSON.parse(e),q=e,F.value&&!y(j.content.blocks,F.value)&&H(null),setTimeout(()=>nn=!1)}function sn(){an(),G.value.length&&(K.value=[...K.value,JSON.stringify(j.content)],on(G.value.at(-1)),G.value=G.value.slice(0,-1))}function cn(){K.value.length&&(G.value=[...G.value,JSON.stringify(j.content)],on(K.value.at(-1)),K.value=K.value.slice(0,-1))}let ln=JSON.stringify(j.content),J=h(!1),un=c(()=>J.value||A.isDirty);n(()=>j.content,()=>{J.value=JSON.stringify(j.content)!==ln,clearTimeout(en),en=setTimeout(tn,500),nn||(clearTimeout(rn),rn=setTimeout(an,700))},{deep:!0});function dn(e){un.value&&!A.processing&&(e.preventDefault(),e.returnValue=``)}let fn=v.on(`before`,e=>{un.value&&!A.processing&&e.detail.visit.method===`get`&&!window.confirm(`Ungespeicherte Änderungen verwerfen?`)&&e.preventDefault()});function pn(e){let t=e.target.closest?.(`input, textarea, select, [contenteditable="true"]`);(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`?(e.preventDefault(),Z(N.value&&M.value?`publish`:N.value?`submit`:`draft`)):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`z`?(e.preventDefault(),e.shiftKey?cn():sn()):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`y`?(e.preventDefault(),cn()):e.key===`Escape`&&!t&&H(null)}s(()=>{tn(),window.addEventListener(`keydown`,pn),window.addEventListener(`beforeunload`,dn)}),re(()=>{window.removeEventListener(`keydown`,pn),window.removeEventListener(`beforeunload`,dn),fn()});let Y=h(O.post?.cover_url??null),X=h(null);function mn(e){let t=e.target.files?.[0];e.target.value=``,t&&(A.cover=t,A.cover_media=null,A.remove_cover=!1,Y.value=URL.createObjectURL(t))}async function hn(){let e=await W.pick({title:`Titelbild wählen`});e?.length&&(A.cover=null,A.cover_media=e[0].path,A.remove_cover=!1,Y.value=e[0].url)}function gn(){A.cover=null,A.cover_media=null,A.remove_cover=!0,Y.value=null}function Z(e){if(!A.title.trim()){b.error(`Bitte zuerst einen Titel eingeben.`);return}A.action=e,A.transform(e=>({...e,content:JSON.stringify(j.content),published_at:e.published_at?new Date(e.published_at).toISOString():null,category_id:e.category_id?Number(e.category_id):null,form_id:e.form_id?Number(e.form_id):``,...O.post?{_method:`put`}:{}})).post(O.post?`/redaktion/neuigkeiten/${O.post.id}`:`/redaktion/neuigkeiten`,{forceFormData:!0,preserveScroll:!0,onSuccess:()=>{ln=JSON.stringify(j.content),J.value=!1,A.cover=null,A.defaults()},onError:e=>b.error(e.action??e.title??e.category_id??e.content??Object.values(e)[0]??`Speichern fehlgeschlagen.`)})}n(()=>Bt.props.flash.status,e=>e&&b.success(e),{immediate:!0});let Q=h(!1),$=se({note:``});function _n(){v.post(`/redaktion/neuigkeiten/${O.post.id}/freigeben`,{published_at:A.published_at?new Date(A.published_at).toISOString():null})}function vn(){$.post(`/redaktion/neuigkeiten/${O.post.id}/zurueckgeben`,{onSuccess:()=>Q.value=!1})}function yn(){window.confirm(`Beitrag endgültig löschen?`)&&(J.value=!1,A.defaults(),v.delete(`/redaktion/neuigkeiten/${O.post.id}`))}let bn=c(()=>O.post?O.post.status===`pending`||O.post.status_label===`Geplant`?{label:O.post.status_label,class:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`}:O.post.status_label===`Veröffentlicht`?{label:`Veröffentlicht`,class:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`}:{label:O.post.status_label??`Entwurf`,class:`bg-muted text-muted-foreground`}:{label:`Neu`,class:`bg-muted text-muted-foreground`}),xn=[{key:`desktop`,label:`Desktop`,icon:de,width:`max-w-[900px]`},{key:`tablet`,label:`Tablet`,icon:Ee,width:`max-w-[768px]`},{key:`mobile`,label:`Smartphone`,icon:Ge,width:`max-w-[390px]`}],Sn=c(()=>xn.find(e=>e.key===B.value).width),Cn=c(()=>[{key:`post`,label:`Beitrag`},{key:`blocks`,label:`Blöcke`},{key:`block`,label:`Block`,disabled:!V.value}]);function wn(e){e.target.style.height=`auto`,e.target.style.height=`${e.target.scrollHeight}px`}return(n,s)=>(u(),o(d,null,[e(r(ce),{title:D.post?`Bearbeiten: ${r(A).title||D.post.title}`:`Neuer Beitrag`},null,8,[`title`]),a(`div`,tt,[a(`header`,nt,[e(r(le),{href:`/redaktion`,class:`grid size-9 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:`Zur Redaktion`},{default:f(()=>[e(r(Se),{class:`size-5`})]),_:1}),a(`div`,rt,[a(`div`,it,[a(`span`,at,p(r(A).title||`Neuer Beitrag`),1),a(`span`,{class:i([`hidden shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium sm:inline`,bn.value.class])},p(bn.value.label),3)]),a(`p`,ot,[r(A).processing?(u(),o(d,{key:0},[e(r(ue),{class:`inline size-3 animate-spin`}),s[30]||=t(` Speichert …`,-1)],64)):un.value?(u(),o(d,{key:1},[t(`Ungespeicherte Änderungen`)],64)):D.post?(u(),o(d,{key:2},[t(`Alle Änderungen gespeichert`)],64)):(u(),o(d,{key:3},[t(`Noch nicht gespeichert`)],64))])]),a(`div`,st,[a(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Rückgängig (Strg+Z)`,disabled:!G.value.length,onClick:sn},[e(r(_e),{class:`size-4`})],8,ct),a(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Wiederholen (Strg+Y)`,disabled:!K.value.length,onClick:cn},[e(r(Ce),{class:`size-4`})],8,lt),s[31]||=a(`span`,{class:`mx-1 h-6 w-px bg-border`},null,-1),a(`div`,ut,[(u(),o(d,null,te(xn,e=>a(`button`,{key:e.key,type:`button`,class:i([`grid size-8 place-items-center rounded`,B.value===e.key?`bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),title:e.label,"aria-pressed":B.value===e.key,onClick:t=>B.value=e.key},[(u(),m(ie(e.icon),{class:`size-4`}))],10,dt)),64))])]),e(r(pe),null,{default:f(()=>[e(r(ge),{class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent`,"aria-label":`Weitere Aktionen`},{default:f(()=>[e(r(Be),{class:`size-5`})]),_:1}),e(r(be),{align:`end`,class:`w-60`},{default:f(()=>[D.post?.url?(u(),m(r(ye),{key:0,"as-child":``},{default:f(()=>[a(`a`,{href:D.post.url,target:`_blank`},[e(r(Ve)),s[32]||=t(` Veröffentlichten Beitrag ansehen`,-1)],8,ft)]),_:1})):g(``,!0),!N.value||M.value?(u(),m(r(ye),{key:1,disabled:r(A).processing,onSelect:s[0]||=e=>Z(`draft`)},{default:f(()=>[e(r(Ue)),t(` `+p(N.value?`Offline nehmen (Entwurf)`:`Als Entwurf speichern`),1)]),_:1},8,[`disabled`])):g(``,!0),D.canDelete?(u(),o(d,{key:2},[e(r(fe)),e(r(ye),{class:`text-destructive`,onSelect:yn},{default:f(()=>[e(r(Ke)),s[33]||=t(` Beitrag löschen`,-1)]),_:1})],64)):g(``,!0)]),_:1})]),_:1}),N.value?g(``,!0):(u(),m(r(T),{key:0,variant:`outline`,class:`hidden sm:inline-flex`,disabled:r(A).processing,onClick:s[1]||=e=>Z(`draft`)},{default:f(()=>[e(r(Ue)),s[34]||=t(` Entwurf speichern `,-1)]),_:1},8,[`disabled`])),M.value?(u(),m(r(T),{key:1,disabled:r(A).processing,onClick:s[2]||=e=>Z(`publish`)},{default:f(()=>[r(A).processing&&r(A).action===`publish`?(u(),m(r(ue),{key:0,class:`animate-spin`})):P.value?(u(),m(r(Pe),{key:1})):(u(),m(r(We),{key:2})),a(`span`,pt,p(P.value?`Planen`:N.value?`Aktualisieren`:`Veröffentlichen`),1)]),_:1},8,[`disabled`])):(u(),m(r(T),{key:2,disabled:r(A).processing||Ut.value,onClick:s[3]||=e=>Z(`submit`)},{default:f(()=>[e(r(We)),s[35]||=t(),a(`span`,mt,p(Ut.value?`Liegt zur Freigabe vor`:`Zur Freigabe einreichen`),1)]),_:1},8,[`disabled`]))]),D.post?.review_note?(u(),o(`div`,ht,[e(r(He),{class:`mt-0.5 size-4 shrink-0`}),a(`p`,null,[s[36]||=a(`span`,{class:`font-medium`},`Zurückgegeben mit Anmerkung:`,-1),s[37]||=t(),a(`span`,gt,p(D.post.review_note),1)])])):g(``,!0),Ut.value&&M.value?(u(),o(`div`,_t,[a(`p`,vt,p(D.post.author)+` hat diesen Beitrag zur Freigabe eingereicht.`,1),e(r(T),{size:`sm`,variant:`outline`,class:`bg-card`,onClick:s[4]||=e=>Q.value=!0},{default:f(()=>[e(r(_e)),s[38]||=t(` Zurückgeben`,-1)]),_:1}),e(r(T),{size:`sm`,onClick:_n},{default:f(()=>[e(r(We)),t(` `+p(P.value?`Freigeben und planen`:`Freigeben`),1)]),_:1})])):g(``,!0),a(`div`,yt,[a(`main`,{class:`min-w-0 flex-1 overflow-y-auto`,onClick:s[13]||=e=>H(null)},[a(`div`,{class:i([`mx-auto px-4 py-8 transition-[max-width] duration-300 sm:px-8`,Sn.value])},[Y.value?(u(),o(`div`,{key:0,class:`group relative mb-6 overflow-hidden rounded-xl border`,onClick:s[6]||=_(()=>{},[`stop`])},[a(`img`,{src:Y.value,alt:``,class:`aspect-video w-full object-cover`},null,8,bt),a(`div`,xt,[e(r(T),{size:`sm`,variant:`outline`,class:`bg-card/95`,onClick:s[5]||=e=>X.value?.click()},{default:f(()=>[e(r(S)),s[39]||=t(` Hochladen`,-1)]),_:1}),e(r(T),{size:`sm`,variant:`outline`,class:`bg-card/95`,onClick:hn},{default:f(()=>[e(r(C)),s[40]||=t(` Aus Mediathek`,-1)]),_:1}),e(r(T),{size:`icon`,variant:`outline`,class:`size-8 bg-card/95`,title:`Titelbild entfernen`,onClick:gn},{default:f(()=>[e(r(Le))]),_:1})])])):(u(),o(`div`,{key:1,class:`mb-6 flex aspect-[21/9] w-full flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed text-sm text-muted-foreground`,onClick:s[8]||=_(()=>{},[`stop`])},[e(r(S),{class:`size-7`}),s[43]||=a(`span`,{class:`font-medium text-foreground`},`Titelbild hinzufügen`,-1),a(`div`,St,[e(r(T),{size:`sm`,variant:`outline`,onClick:s[7]||=e=>X.value?.click()},{default:f(()=>[e(r(S)),s[41]||=t(` Hochladen`,-1)]),_:1}),e(r(T),{size:`sm`,variant:`outline`,onClick:hn},{default:f(()=>[e(r(C)),s[42]||=t(` Aus Mediathek`,-1)]),_:1})]),s[44]||=a(`span`,{class:`text-xs`},`Querformat, am besten 1600 × 900 Pixel`,-1)])),a(`input`,{ref_key:`coverInput`,ref:X,type:`file`,accept:`image/jpeg,image/png,image/webp`,class:`hidden`,onChange:mn},null,544),r(A).errors.cover?(u(),o(`p`,Ct,p(r(A).errors.cover),1)):g(``,!0),ee(a(`input`,{"onUpdate:modelValue":s[9]||=e=>r(A).title=e,class:`w-full bg-transparent text-3xl leading-tight font-semibold tracking-tight outline-none placeholder:text-muted-foreground/60 sm:text-4xl`,placeholder:`Titel des Beitrags`,maxlength:`160`,"aria-label":`Titel`,onClick:s[10]||=_(()=>{},[`stop`])},null,512),[[ae,r(A).title]]),ee(a(`textarea`,{"onUpdate:modelValue":s[11]||=e=>r(A).teaser=e,rows:`1`,maxlength:`300`,placeholder:`Kurztext – erscheint in Listen und auf der Startseite (1–2 Sätze)`,"aria-label":`Kurztext`,class:`mt-3 mb-8 w-full resize-none overflow-hidden bg-transparent text-lg leading-relaxed text-muted-foreground outline-none placeholder:text-muted-foreground/50`,onInput:wn,onFocus:wn,onClick:s[12]||=_(()=>{},[`stop`])},null,544),[[ae,r(A).teaser]]),a(`div`,wt,[e(Ae,{item:j.content,root:``},null,8,[`item`])]),j.content.blocks.length?g(``,!0):(u(),o(`p`,Tt,` Rechts unter „Blöcke“ Text, Bilder, Galerien und mehr hinzufügen. `))],2)]),a(`aside`,Et,[a(`div`,Dt,[(u(!0),o(d,null,te(Cn.value,e=>(u(),o(`button`,{key:e.key,type:`button`,role:`tab`,class:i([`relative px-3 py-3 text-sm font-medium disabled:opacity-40`,R.value===e.key?`text-foreground`:`text-muted-foreground hover:text-foreground`]),"aria-selected":R.value===e.key,disabled:e.disabled,onClick:t=>R.value=e.key},[t(p(e.label)+` `,1),R.value===e.key?(u(),o(`span`,kt)):g(``,!0)],10,Ot))),128))]),a(`div`,At,[R.value===`block`&&V.value?(u(),m(De,{key:V.value.id,block:V.value},null,8,[`block`])):R.value===`blocks`?(u(),o(d,{key:1},[s[45]||=a(`p`,{class:`mb-4 text-xs text-muted-foreground`},`Klicken fügt den Block unter dem ausgewählten ein. Blöcke lassen sich auch an jede Stelle ziehen.`,-1),e(we,{onPick:Kt})],64)):(u(),o(`div`,jt,[e(w,{id:`category`,label:`Kategorie`,error:r(A).errors.category_id},{default:f(()=>[e(E,{id:`category`,modelValue:r(A).category_id,"onUpdate:modelValue":s[14]||=e=>r(A).category_id=e,options:Wt.value,placeholder:D.canPublishWithoutCategory?`Ohne Kategorie`:`Kategorie wählen …`},null,8,[`modelValue`,`options`,`placeholder`])]),_:1},8,[`error`]),M.value?(u(),o(d,{key:0},[e(w,{id:`published_at`,label:`Veröffentlichen am`,error:r(A).errors.published_at,hint:`Leer = sofort. Ein Datum in der Zukunft plant den Beitrag.`},{default:f(()=>[e(r(qe),{id:`published_at`,modelValue:r(A).published_at,"onUpdate:modelValue":s[15]||=e=>r(A).published_at=e,type:`datetime-local`},null,8,[`modelValue`])]),_:1},8,[`error`]),a(`label`,Mt,[s[46]||=t(` Auf der Startseite hervorheben `,-1),e(r(x),{modelValue:r(A).is_featured,"onUpdate:modelValue":s[16]||=e=>r(A).is_featured=e},null,8,[`modelValue`])]),s[47]||=a(`p`,{class:`-mt-2 text-xs text-muted-foreground`},`Hervorgehobene Beiträge mit Titelbild erscheinen groß im Slider.`,-1)],64)):(u(),o(`p`,Nt,` In dieser Kategorie veröffentlicht die Redaktion. Reichen Sie den Beitrag zur Freigabe ein, wenn er fertig ist. `)),a(`label`,Pt,[s[48]||=t(` Kommentare erlauben `,-1),e(r(x),{modelValue:r(A).comments_enabled,"onUpdate:modelValue":s[17]||=e=>r(A).comments_enabled=e},null,8,[`modelValue`])]),D.forms.length?(u(),m(w,{key:2,id:`form_id`,label:`Formular unter dem Beitrag`,error:r(A).errors.form_id,hint:`Z. B. Anmeldung oder Rückmeldung zum Beitrag.`},{default:f(()=>[e(E,{id:`form_id`,modelValue:r(A).form_id,"onUpdate:modelValue":s[18]||=e=>r(A).form_id=e,options:D.forms,placeholder:`– kein Formular –`},null,8,[`modelValue`,`options`])]),_:1},8,[`error`])):g(``,!0),a(`div`,Ft,[s[52]||=a(`span`,{class:`text-[13px] font-medium`},`Titelbild`,-1),a(`div`,It,[e(r(T),{variant:`outline`,size:`sm`,onClick:s[19]||=e=>X.value?.click()},{default:f(()=>[e(r(S)),s[49]||=t(` Hochladen`,-1)]),_:1}),e(r(T),{variant:`outline`,size:`sm`,onClick:hn},{default:f(()=>[e(r(C)),s[50]||=t(` Mediathek`,-1)]),_:1}),Y.value?(u(),m(r(T),{key:0,variant:`ghost`,size:`sm`,onClick:gn},{default:f(()=>[e(r(Le)),s[51]||=t(` Entfernen`,-1)]),_:1})):g(``,!0)]),s[53]||=a(`p`,{class:`text-xs text-muted-foreground`},`Wird auf 16:9 zugeschnitten.`,-1)])]))])])]),a(`div`,Lt,[e(r(T),{variant:`outline`,class:`bg-card shadow-md`,onClick:s[20]||=e=>{R.value=`post`,z.value=!0}},{default:f(()=>[...s[54]||=[t(`Beitrag`,-1)]]),_:1}),e(r(T),{variant:`outline`,class:`bg-card shadow-md`,onClick:s[21]||=e=>{R.value=`blocks`,z.value=!0}},{default:f(()=>[...s[55]||=[t(`Block hinzufügen`,-1)]]),_:1}),V.value?(u(),m(r(T),{key:0,class:`shadow-md`,onClick:s[22]||=e=>{R.value=`block`,z.value=!0}},{default:f(()=>[...s[56]||=[t(`Einstellungen`,-1)]]),_:1})):g(``,!0)]),e(r(he),{open:z.value,"onUpdate:open":s[26]||=e=>z.value=e},{default:f(()=>[e(r(me),{side:`right`,class:`w-[340px] overflow-y-auto p-4 sm:max-w-[340px]`},{default:f(()=>[e(r(xe),{class:`p-0`},{default:f(()=>[e(r(ve),null,{default:f(()=>[t(p(R.value===`block`?`Block`:R.value===`blocks`?`Blöcke`:`Beitrag`),1)]),_:1})]),_:1}),R.value===`block`&&V.value?(u(),m(De,{key:V.value.id,block:V.value},null,8,[`block`])):R.value===`blocks`?(u(),m(we,{key:1,onPick:Kt})):(u(),o(`div`,Rt,[e(w,{id:`category-m`,label:`Kategorie`},{default:f(()=>[e(E,{id:`category-m`,modelValue:r(A).category_id,"onUpdate:modelValue":s[23]||=e=>r(A).category_id=e,options:Wt.value,placeholder:D.canPublishWithoutCategory?`Ohne Kategorie`:`Kategorie wählen …`},null,8,[`modelValue`,`options`,`placeholder`])]),_:1}),M.value?(u(),m(w,{key:0,id:`published_at-m`,label:`Veröffentlichen am`},{default:f(()=>[e(r(qe),{id:`published_at-m`,modelValue:r(A).published_at,"onUpdate:modelValue":s[24]||=e=>r(A).published_at=e,type:`datetime-local`},null,8,[`modelValue`])]),_:1})):g(``,!0),M.value?(u(),o(`label`,zt,[s[57]||=t(`Auf der Startseite hervorheben `,-1),e(r(x),{modelValue:r(A).is_featured,"onUpdate:modelValue":s[25]||=e=>r(A).is_featured=e},null,8,[`modelValue`])])):g(``,!0)]))]),_:1})]),_:1},8,[`open`]),e(r(Ye),{open:Q.value,"onUpdate:open":s[29]||=e=>Q.value=e},{default:f(()=>[e(r(Ze),{class:`sm:max-w-md`},{default:f(()=>[e(r(et),null,{default:f(()=>[e(r(Qe),null,{default:f(()=>[...s[58]||=[t(`Beitrag zurückgeben`,-1)]]),_:1}),e(r($e),null,{default:f(()=>[t(p(D.post?.author)+` wird benachrichtigt und sieht Ihre Anmerkung.`,1)]),_:1})]),_:1}),e(w,{id:`note`,label:`Was soll geändert werden?`,error:r($).errors.note},{default:f(()=>[e(r(Je),{id:`note`,modelValue:r($).note,"onUpdate:modelValue":s[27]||=e=>r($).note=e,rows:`4`,maxlength:`1000`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(r(Xe),null,{default:f(()=>[e(r(T),{variant:`outline`,onClick:s[28]||=e=>Q.value=!1},{default:f(()=>[...s[59]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(T),{disabled:r($).processing||!r($).note.trim(),onClick:vn},{default:f(()=>[e(r(_e)),s[60]||=t(` Zurückgeben`,-1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])]),e(Oe,{picker:r(W)},null,8,[`picker`]),e(r(Ie),{position:`bottom-left`})],64))}};export{D as default}; \ No newline at end of file diff --git a/public/build/assets/Editor-DhqamJ3d.js b/public/build/assets/Editor-DhqamJ3d.js deleted file mode 100644 index 78fc9ac8..00000000 --- a/public/build/assets/Editor-DhqamJ3d.js +++ /dev/null @@ -1 +0,0 @@ -import{D as e,E as t,Ht as n,On as r,Yt as ee,Zn as i,_ as a,b as o,bt as te,ct as s,g as c,gn as ne,gt as l,it as re,mt as u,o as d,qt as f,tr as p,v as m,vn as h,wt as ie,y as g}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as _,x as ae}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as oe,i as se,n as ce,o as v,r as le}from"./app-Bu3kn8yd.js";import{O as ue}from"./dist-DtGNiYlK.js";import{L as de,a as fe,c as pe,d as me,f as he,i as ge,k as y,l as _e,o as ve,s as ye,u as be}from"./AppIcon-0N56IC2z.js";import{t as xe}from"./arrow-left-BMImfTf2.js";import{i as Se,r as Ce}from"./RichTextEditor-qslPmeeg.js";import{a as we,c as Te,i as Ee,l as De,n as Oe,o as ke,r as Ae,s as b,t as je}from"./EditorBlockList-C9b3fqvQ.js";import{t as Me}from"./calendar-clock-8H2IkjP5.js";import{_ as Ne,a as Pe,o as x,t as Fe}from"./http-DmyDwIce.js";import{t as S}from"./Switch-CWN1_5O7.js";import{t as Ie}from"./ellipsis-vertical-B9wuHo-w.js";import{t as Le}from"./eye-CFNQcvaV.js";import{t as Re}from"./message-square-warning-BFfa_vqd.js";import{t as ze}from"./save-aFVYiCIj.js";import{t as C}from"./send-6fmdiUe6.js";import{t as Be}from"./smartphone-BE2l7T-2.js";import{t as Ve}from"./trash-DUqnVIgb.js";import{t as He}from"./DialogDescription-BxaIqmag.js";import{t as w}from"./FormField-BoFAO4pm.js";import{t as T}from"./button-ZHC5mKey.js";import{t as E}from"./NativeSelect-BGasRaNs.js";import{t as Ue}from"./Input-FGSb2-yK.js";import{t as We}from"./Textarea-DEFXqC2w.js";import{i as Ge,n as Ke,r as qe,t as Je}from"./dialog-uBUhf8w7.js";import{t as Ye}from"./DialogHeader-DuqiL3ry.js";var Xe={class:`flex h-dvh flex-col bg-background`},Ze={class:`z-30 flex h-14 shrink-0 items-center gap-2 border-b bg-card px-2 sm:px-3`},Qe={class:`min-w-0 flex-1`},$e={class:`flex items-center gap-2`},et={class:`truncate text-sm font-semibold`},tt={class:`truncate text-xs text-muted-foreground`,"aria-live":`polite`},nt={class:`hidden items-center gap-0.5 md:flex`},rt=[`disabled`],it=[`disabled`],at={class:`flex rounded-md border p-0.5`,role:`group`,"aria-label":`Vorschau`},ot=[`title`,`aria-pressed`,`onClick`],st=[`href`],ct={class:`hidden sm:inline`},lt={class:`hidden sm:inline`},ut={key:0,class:`flex gap-3 border-b border-amber-200 bg-amber-50 px-4 py-2.5 text-sm text-amber-950 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100`},dt={class:`whitespace-pre-line`},ft={key:1,class:`flex flex-wrap items-center gap-3 border-b bg-brand-soft px-4 py-2.5 text-sm`},pt={class:`flex-1`},mt={class:`flex min-h-0 flex-1`},ht=[`src`],gt={class:`absolute top-3 right-3 flex gap-2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100`},_t={key:2,class:`-mt-4 mb-4 text-[13px] text-destructive`},vt={class:`@container`},yt={key:3,class:`mt-4 text-center text-sm text-muted-foreground`},bt={class:`hidden w-[340px] shrink-0 flex-col border-l bg-card lg:flex`},xt={class:`flex shrink-0 border-b px-2`,role:`tablist`},St=[`aria-selected`,`disabled`,`onClick`],Ct={key:0,class:`absolute inset-x-2 bottom-0 h-[3px] rounded-t-full bg-brand`},wt={class:`min-h-0 flex-1 overflow-y-auto p-4`},Tt={key:2,class:`grid gap-4`},Et={class:`flex items-center justify-between gap-3 text-[13px] font-medium`},Dt={key:1,class:`rounded-md bg-muted px-3 py-2 text-[13px] text-muted-foreground`},Ot={class:`flex items-center justify-between gap-3 text-[13px] font-medium`},kt={class:`grid gap-2 border-t pt-4`},At={class:`flex gap-2`},jt={class:`fixed right-4 bottom-4 z-30 flex gap-2 lg:hidden`},Mt={key:2,class:`grid gap-4`},Nt={key:1,class:`flex items-center justify-between gap-3 text-[13px] font-medium`},D={__name:`Editor`,props:{post:{type:Object,default:null},content:{type:Object,default:()=>({blocks:[]})},categories:{type:Array,required:!0},canPublishWithoutCategory:{type:Boolean,default:!1},canDelete:{type:Boolean,default:!1},forms:{type:Array,default:()=>[]},blockTypes:{type:Array,required:!0},blockGroups:{type:Object,required:!0},audienceOptions:{type:Object,required:!0},uploadsUrl:{type:String,required:!0}},setup(D){let O=D,Pt=oe(),k=Object.fromEntries(O.blockTypes.map(e=>[e.key,e]));function Ft(e){if(!e)return``;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())}T${n(t.getHours())}:${n(t.getMinutes())}`}let A=se({title:O.post?.title??``,teaser:O.post?.teaser??``,category_id:O.post?.category_id??(O.categories.length===1?O.categories[0].id:null),cover:null,remove_cover:!1,is_featured:O.post?.is_featured??!1,published_at:Ft(O.post?.published_at),form_id:O.post?.form_id??null,comments_enabled:O.post?.comments_enabled??!0,action:`draft`}),j=ne({content:Ee(O.content??{blocks:[]})}),It=c(()=>O.categories.find(e=>e.id===Number(A.category_id))),M=c(()=>It.value?It.value.can_publish:O.canPublishWithoutCategory),Lt=c(()=>O.post?.status===`pending`),N=c(()=>O.post?.status===`published`),Rt=c(()=>O.categories.map(e=>({value:e.id,label:e.name}))),P=c(()=>A.published_at&&new Date(A.published_at)>new Date),F=h(null),I=h(null),L=ne({}),zt=h(!1),R=h(`post`),z=h(!1),B=h(`desktop`),V=c(()=>F.value?b(j.content.blocks,F.value)?.block??null:null);n(F,e=>{R.value=e?`block`:R.value===`block`?`blocks`:R.value});function H(e){F.value=e??null}function U(e,t,n){let r=we(n);e.splice(t,0,r),H(r.id)}function Bt(e){let t=V.value?b(j.content.blocks,V.value.id):null;t?U(t.list,t.index+1,e):U(j.content.blocks,j.content.blocks.length,e),z.value=!1,requestAnimationFrame(()=>document.querySelector(`[data-block-id="${F.value}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}))}function Vt(e){let t=b(j.content.blocks,e);t&&(t.list.splice(t.index,1),F.value===e&&H(null))}function Ht(e,t){let n=b(j.content.blocks,e),r=n?n.index+t:-1;n&&r>=0&&rt.items?.includes(e)||b(e.blocks,t.id))}async function Gt(e){let t=new FormData;t.append(`image`,e);try{return await Fe.post(`/redaktion/neuigkeiten/bilder`,t)}catch(e){throw x.error(e.fieldErrors?.image??e.message),e}}async function Kt(){throw x.error(`Dateien zum Herunterladen gehören in den Bereich „Downloads“ – dort hochladen und hier mit dem Downloads-Block verlinken.`),Error(`not supported`)}l(`pagebuilder:editor`,{types:k,groups:O.blockGroups,selectedId:F,hoveredId:I,previews:L,readOnly:zt,files:h([]),peopleCache:ne({}),audienceOptions:O.audienceOptions,select:H,insert:U,remove:Vt,move:Ht,duplicate:Ut,containsActive:Wt,uploadImage:Gt,uploadFile:Kt,imageUrl:e=>`${O.uploadsUrl}/${e}`}),l(`pagebuilder:list`,je),l(`pagebuilder:types`,k),l(`pagebuilder:editing`,c(()=>!0));let qt={},Jt;function Yt(){let e=[];Te(j.content.blocks,t=>{if(!k[t.type]?.dynamic)return;let n=JSON.stringify(t.data);qt[t.id]!==n&&(qt[t.id]=n,e.push({id:t.id,type:t.type,data:t.data}))}),e.length&&Fe.post(`/redaktion/neuigkeiten/vorschau`,{blocks:e.slice(0,100)}).then(e=>Object.assign(L,e.props)).catch(()=>{})}let W=h([]),G=h([]),K=JSON.stringify(j.content),q=!1,Xt;function Zt(){let e=JSON.stringify(j.content);e!==K&&(W.value=[...W.value.slice(-49),K],G.value=[],K=e)}function Qt(e){q=!0,j.content=JSON.parse(e),K=e,F.value&&!b(j.content.blocks,F.value)&&H(null),setTimeout(()=>q=!1)}function $t(){Zt(),W.value.length&&(G.value=[...G.value,JSON.stringify(j.content)],Qt(W.value.at(-1)),W.value=W.value.slice(0,-1))}function en(){G.value.length&&(W.value=[...W.value,JSON.stringify(j.content)],Qt(G.value.at(-1)),G.value=G.value.slice(0,-1))}let tn=JSON.stringify(j.content),J=h(!1),nn=c(()=>J.value||A.isDirty);n(()=>j.content,()=>{J.value=JSON.stringify(j.content)!==tn,clearTimeout(Jt),Jt=setTimeout(Yt,500),q||(clearTimeout(Xt),Xt=setTimeout(Zt,700))},{deep:!0});function rn(e){nn.value&&!A.processing&&(e.preventDefault(),e.returnValue=``)}let an=v.on(`before`,e=>{nn.value&&!A.processing&&e.detail.visit.method===`get`&&!window.confirm(`Ungespeicherte Änderungen verwerfen?`)&&e.preventDefault()});function on(e){let t=e.target.closest?.(`input, textarea, select, [contenteditable="true"]`);(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`s`?(e.preventDefault(),Z(N.value&&M.value?`publish`:N.value?`submit`:`draft`)):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`z`?(e.preventDefault(),e.shiftKey?en():$t()):!t&&(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`y`?(e.preventDefault(),en()):e.key===`Escape`&&!t&&H(null)}s(()=>{Yt(),window.addEventListener(`keydown`,on),window.addEventListener(`beforeunload`,rn)}),re(()=>{window.removeEventListener(`keydown`,on),window.removeEventListener(`beforeunload`,rn),an()});let Y=h(O.post?.cover_url??null),X=h(null);function sn(e){let t=e.target.files?.[0];e.target.value=``,t&&(A.cover=t,A.remove_cover=!1,Y.value=URL.createObjectURL(t))}function cn(){A.cover=null,A.remove_cover=!0,Y.value=null}function Z(e){if(!A.title.trim()){x.error(`Bitte zuerst einen Titel eingeben.`);return}A.action=e,A.transform(e=>({...e,content:JSON.stringify(j.content),published_at:e.published_at?new Date(e.published_at).toISOString():null,category_id:e.category_id?Number(e.category_id):null,form_id:e.form_id?Number(e.form_id):``,...O.post?{_method:`put`}:{}})).post(O.post?`/redaktion/neuigkeiten/${O.post.id}`:`/redaktion/neuigkeiten`,{forceFormData:!0,preserveScroll:!0,onSuccess:()=>{tn=JSON.stringify(j.content),J.value=!1,A.cover=null,A.defaults()},onError:e=>x.error(e.action??e.title??e.category_id??e.content??Object.values(e)[0]??`Speichern fehlgeschlagen.`)})}n(()=>Pt.props.flash.status,e=>e&&x.success(e),{immediate:!0});let Q=h(!1),$=se({note:``});function ln(){v.post(`/redaktion/neuigkeiten/${O.post.id}/freigeben`,{published_at:A.published_at?new Date(A.published_at).toISOString():null})}function un(){$.post(`/redaktion/neuigkeiten/${O.post.id}/zurueckgeben`,{onSuccess:()=>Q.value=!1})}function dn(){window.confirm(`Beitrag endgültig löschen?`)&&(J.value=!1,A.defaults(),v.delete(`/redaktion/neuigkeiten/${O.post.id}`))}let fn=c(()=>O.post?O.post.status===`pending`||O.post.status_label===`Geplant`?{label:O.post.status_label,class:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`}:O.post.status_label===`Veröffentlicht`?{label:`Veröffentlicht`,class:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`}:{label:O.post.status_label??`Entwurf`,class:`bg-muted text-muted-foreground`}:{label:`Neu`,class:`bg-muted text-muted-foreground`}),pn=[{key:`desktop`,label:`Desktop`,icon:de,width:`max-w-[900px]`},{key:`tablet`,label:`Tablet`,icon:De,width:`max-w-[768px]`},{key:`mobile`,label:`Smartphone`,icon:Be,width:`max-w-[390px]`}],mn=c(()=>pn.find(e=>e.key===B.value).width),hn=c(()=>[{key:`post`,label:`Beitrag`},{key:`blocks`,label:`Blöcke`},{key:`block`,label:`Block`,disabled:!V.value}]);function gn(e){e.target.style.height=`auto`,e.target.style.height=`${e.target.scrollHeight}px`}return(n,s)=>(u(),o(d,null,[e(r(ce),{title:D.post?`Bearbeiten: ${r(A).title||D.post.title}`:`Neuer Beitrag`},null,8,[`title`]),a(`div`,Xe,[a(`header`,Ze,[e(r(le),{href:`/redaktion`,class:`grid size-9 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:`Zur Redaktion`},{default:f(()=>[e(r(xe),{class:`size-5`})]),_:1}),a(`div`,Qe,[a(`div`,$e,[a(`span`,et,p(r(A).title||`Neuer Beitrag`),1),a(`span`,{class:i([`hidden shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium sm:inline`,fn.value.class])},p(fn.value.label),3)]),a(`p`,tt,[r(A).processing?(u(),o(d,{key:0},[e(r(ue),{class:`inline size-3 animate-spin`}),s[29]||=t(` Speichert …`,-1)],64)):nn.value?(u(),o(d,{key:1},[t(`Ungespeicherte Änderungen`)],64)):D.post?(u(),o(d,{key:2},[t(`Alle Änderungen gespeichert`)],64)):(u(),o(d,{key:3},[t(`Noch nicht gespeichert`)],64))])]),a(`div`,nt,[a(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Rückgängig (Strg+Z)`,disabled:!W.value.length,onClick:$t},[e(r(y),{class:`size-4`})],8,rt),a(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent disabled:opacity-40`,title:`Wiederholen (Strg+Y)`,disabled:!G.value.length,onClick:en},[e(r(Ce),{class:`size-4`})],8,it),s[30]||=a(`span`,{class:`mx-1 h-6 w-px bg-border`},null,-1),a(`div`,at,[(u(),o(d,null,te(pn,e=>a(`button`,{key:e.key,type:`button`,class:i([`grid size-8 place-items-center rounded`,B.value===e.key?`bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),title:e.label,"aria-pressed":B.value===e.key,onClick:t=>B.value=e.key},[(u(),m(ie(e.icon),{class:`size-4`}))],10,ot)),64))])]),e(r(pe),null,{default:f(()=>[e(r(ge),{class:`grid size-9 place-items-center rounded-md text-muted-foreground hover:bg-accent`,"aria-label":`Weitere Aktionen`},{default:f(()=>[e(r(Ie),{class:`size-5`})]),_:1}),e(r(ye),{align:`end`,class:`w-60`},{default:f(()=>[D.post?.url?(u(),m(r(ve),{key:0,"as-child":``},{default:f(()=>[a(`a`,{href:D.post.url,target:`_blank`},[e(r(Le)),s[31]||=t(` Veröffentlichten Beitrag ansehen`,-1)],8,st)]),_:1})):g(``,!0),!N.value||M.value?(u(),m(r(ve),{key:1,disabled:r(A).processing,onSelect:s[0]||=e=>Z(`draft`)},{default:f(()=>[e(r(ze)),t(` `+p(N.value?`Offline nehmen (Entwurf)`:`Als Entwurf speichern`),1)]),_:1},8,[`disabled`])):g(``,!0),D.canDelete?(u(),o(d,{key:2},[e(r(fe)),e(r(ve),{class:`text-destructive`,onSelect:dn},{default:f(()=>[e(r(Ve)),s[32]||=t(` Beitrag löschen`,-1)]),_:1})],64)):g(``,!0)]),_:1})]),_:1}),N.value?g(``,!0):(u(),m(r(T),{key:0,variant:`outline`,class:`hidden sm:inline-flex`,disabled:r(A).processing,onClick:s[1]||=e=>Z(`draft`)},{default:f(()=>[e(r(ze)),s[33]||=t(` Entwurf speichern `,-1)]),_:1},8,[`disabled`])),M.value?(u(),m(r(T),{key:1,disabled:r(A).processing,onClick:s[2]||=e=>Z(`publish`)},{default:f(()=>[r(A).processing&&r(A).action===`publish`?(u(),m(r(ue),{key:0,class:`animate-spin`})):P.value?(u(),m(r(Me),{key:1})):(u(),m(r(C),{key:2})),a(`span`,ct,p(P.value?`Planen`:N.value?`Aktualisieren`:`Veröffentlichen`),1)]),_:1},8,[`disabled`])):(u(),m(r(T),{key:2,disabled:r(A).processing||Lt.value,onClick:s[3]||=e=>Z(`submit`)},{default:f(()=>[e(r(C)),s[34]||=t(),a(`span`,lt,p(Lt.value?`Liegt zur Freigabe vor`:`Zur Freigabe einreichen`),1)]),_:1},8,[`disabled`]))]),D.post?.review_note?(u(),o(`div`,ut,[e(r(Re),{class:`mt-0.5 size-4 shrink-0`}),a(`p`,null,[s[35]||=a(`span`,{class:`font-medium`},`Zurückgegeben mit Anmerkung:`,-1),s[36]||=t(),a(`span`,dt,p(D.post.review_note),1)])])):g(``,!0),Lt.value&&M.value?(u(),o(`div`,ft,[a(`p`,pt,p(D.post.author)+` hat diesen Beitrag zur Freigabe eingereicht.`,1),e(r(T),{size:`sm`,variant:`outline`,class:`bg-card`,onClick:s[4]||=e=>Q.value=!0},{default:f(()=>[e(r(y)),s[37]||=t(` Zurückgeben`,-1)]),_:1}),e(r(T),{size:`sm`,onClick:ln},{default:f(()=>[e(r(C)),t(` `+p(P.value?`Freigeben und planen`:`Freigeben`),1)]),_:1})])):g(``,!0),a(`div`,mt,[a(`main`,{class:`min-w-0 flex-1 overflow-y-auto`,onClick:s[12]||=e=>H(null)},[a(`div`,{class:i([`mx-auto px-4 py-8 transition-[max-width] duration-300 sm:px-8`,mn.value])},[Y.value?(u(),o(`div`,{key:0,class:`group relative mb-6 overflow-hidden rounded-xl border`,onClick:s[6]||=_(()=>{},[`stop`])},[a(`img`,{src:Y.value,alt:``,class:`aspect-video w-full object-cover`},null,8,ht),a(`div`,gt,[e(r(T),{size:`sm`,variant:`outline`,class:`bg-card/95`,onClick:s[5]||=e=>X.value?.click()},{default:f(()=>[e(r(Se)),s[38]||=t(` Ändern`,-1)]),_:1}),e(r(T),{size:`icon`,variant:`outline`,class:`size-8 bg-card/95`,title:`Titelbild entfernen`,onClick:cn},{default:f(()=>[e(r(Ne))]),_:1})])])):(u(),o(`button`,{key:1,type:`button`,class:`mb-6 flex aspect-[21/9] w-full flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed text-sm text-muted-foreground transition-colors hover:border-brand-300 hover:bg-brand-soft/40 hover:text-foreground`,onClick:s[7]||=_(e=>X.value?.click(),[`stop`])},[e(r(Se),{class:`size-7`}),s[39]||=a(`span`,{class:`font-medium`},`Titelbild hinzufügen`,-1),s[40]||=a(`span`,{class:`text-xs`},`Querformat, am besten 1600 × 900 Pixel`,-1)])),a(`input`,{ref_key:`coverInput`,ref:X,type:`file`,accept:`image/jpeg,image/png,image/webp`,class:`hidden`,onChange:sn},null,544),r(A).errors.cover?(u(),o(`p`,_t,p(r(A).errors.cover),1)):g(``,!0),ee(a(`input`,{"onUpdate:modelValue":s[8]||=e=>r(A).title=e,class:`w-full bg-transparent text-3xl leading-tight font-semibold tracking-tight outline-none placeholder:text-muted-foreground/60 sm:text-4xl`,placeholder:`Titel des Beitrags`,maxlength:`160`,"aria-label":`Titel`,onClick:s[9]||=_(()=>{},[`stop`])},null,512),[[ae,r(A).title]]),ee(a(`textarea`,{"onUpdate:modelValue":s[10]||=e=>r(A).teaser=e,rows:`1`,maxlength:`300`,placeholder:`Kurztext – erscheint in Listen und auf der Startseite (1–2 Sätze)`,"aria-label":`Kurztext`,class:`mt-3 mb-8 w-full resize-none overflow-hidden bg-transparent text-lg leading-relaxed text-muted-foreground outline-none placeholder:text-muted-foreground/50`,onInput:gn,onFocus:gn,onClick:s[11]||=_(()=>{},[`stop`])},null,544),[[ae,r(A).teaser]]),a(`div`,vt,[e(je,{item:j.content,root:``},null,8,[`item`])]),j.content.blocks.length?g(``,!0):(u(),o(`p`,yt,` Rechts unter „Blöcke“ Text, Bilder, Galerien und mehr hinzufügen. `))],2)]),a(`aside`,bt,[a(`div`,xt,[(u(!0),o(d,null,te(hn.value,e=>(u(),o(`button`,{key:e.key,type:`button`,role:`tab`,class:i([`relative px-3 py-3 text-sm font-medium disabled:opacity-40`,R.value===e.key?`text-foreground`:`text-muted-foreground hover:text-foreground`]),"aria-selected":R.value===e.key,disabled:e.disabled,onClick:t=>R.value=e.key},[t(p(e.label)+` `,1),R.value===e.key?(u(),o(`span`,Ct)):g(``,!0)],10,St))),128))]),a(`div`,wt,[R.value===`block`&&V.value?(u(),m(Oe,{key:V.value.id,block:V.value},null,8,[`block`])):R.value===`blocks`?(u(),o(d,{key:1},[s[41]||=a(`p`,{class:`mb-4 text-xs text-muted-foreground`},`Klicken fügt den Block unter dem ausgewählten ein. Blöcke lassen sich auch an jede Stelle ziehen.`,-1),e(Ae,{onPick:Bt})],64)):(u(),o(`div`,Tt,[e(w,{id:`category`,label:`Kategorie`,error:r(A).errors.category_id},{default:f(()=>[e(E,{id:`category`,modelValue:r(A).category_id,"onUpdate:modelValue":s[13]||=e=>r(A).category_id=e,options:Rt.value,placeholder:D.canPublishWithoutCategory?`Ohne Kategorie`:`Kategorie wählen …`},null,8,[`modelValue`,`options`,`placeholder`])]),_:1},8,[`error`]),M.value?(u(),o(d,{key:0},[e(w,{id:`published_at`,label:`Veröffentlichen am`,error:r(A).errors.published_at,hint:`Leer = sofort. Ein Datum in der Zukunft plant den Beitrag.`},{default:f(()=>[e(r(Ue),{id:`published_at`,modelValue:r(A).published_at,"onUpdate:modelValue":s[14]||=e=>r(A).published_at=e,type:`datetime-local`},null,8,[`modelValue`])]),_:1},8,[`error`]),a(`label`,Et,[s[42]||=t(` Auf der Startseite hervorheben `,-1),e(r(S),{modelValue:r(A).is_featured,"onUpdate:modelValue":s[15]||=e=>r(A).is_featured=e},null,8,[`modelValue`])]),s[43]||=a(`p`,{class:`-mt-2 text-xs text-muted-foreground`},`Hervorgehobene Beiträge mit Titelbild erscheinen groß im Slider.`,-1)],64)):(u(),o(`p`,Dt,` In dieser Kategorie veröffentlicht die Redaktion. Reichen Sie den Beitrag zur Freigabe ein, wenn er fertig ist. `)),a(`label`,Ot,[s[44]||=t(` Kommentare erlauben `,-1),e(r(S),{modelValue:r(A).comments_enabled,"onUpdate:modelValue":s[16]||=e=>r(A).comments_enabled=e},null,8,[`modelValue`])]),D.forms.length?(u(),m(w,{key:2,id:`form_id`,label:`Formular unter dem Beitrag`,error:r(A).errors.form_id,hint:`Z. B. Anmeldung oder Rückmeldung zum Beitrag.`},{default:f(()=>[e(E,{id:`form_id`,modelValue:r(A).form_id,"onUpdate:modelValue":s[17]||=e=>r(A).form_id=e,options:D.forms,placeholder:`– kein Formular –`},null,8,[`modelValue`,`options`])]),_:1},8,[`error`])):g(``,!0),a(`div`,kt,[s[46]||=a(`span`,{class:`text-[13px] font-medium`},`Titelbild`,-1),a(`div`,At,[e(r(T),{variant:`outline`,size:`sm`,onClick:s[18]||=e=>X.value?.click()},{default:f(()=>[e(r(Se)),t(` `+p(Y.value?`Anderes Bild`:`Bild hochladen`),1)]),_:1}),Y.value?(u(),m(r(T),{key:0,variant:`ghost`,size:`sm`,onClick:cn},{default:f(()=>[e(r(Ne)),s[45]||=t(` Entfernen`,-1)]),_:1})):g(``,!0)]),s[47]||=a(`p`,{class:`text-xs text-muted-foreground`},`Wird auf 16:9 zugeschnitten.`,-1)])]))])])]),a(`div`,jt,[e(r(T),{variant:`outline`,class:`bg-card shadow-md`,onClick:s[19]||=e=>{R.value=`post`,z.value=!0}},{default:f(()=>[...s[48]||=[t(`Beitrag`,-1)]]),_:1}),e(r(T),{variant:`outline`,class:`bg-card shadow-md`,onClick:s[20]||=e=>{R.value=`blocks`,z.value=!0}},{default:f(()=>[...s[49]||=[t(`Block hinzufügen`,-1)]]),_:1}),V.value?(u(),m(r(T),{key:0,class:`shadow-md`,onClick:s[21]||=e=>{R.value=`block`,z.value=!0}},{default:f(()=>[...s[50]||=[t(`Einstellungen`,-1)]]),_:1})):g(``,!0)]),e(r(he),{open:z.value,"onUpdate:open":s[25]||=e=>z.value=e},{default:f(()=>[e(r(me),{side:`right`,class:`w-[340px] overflow-y-auto p-4 sm:max-w-[340px]`},{default:f(()=>[e(r(be),{class:`p-0`},{default:f(()=>[e(r(_e),null,{default:f(()=>[t(p(R.value===`block`?`Block`:R.value===`blocks`?`Blöcke`:`Beitrag`),1)]),_:1})]),_:1}),R.value===`block`&&V.value?(u(),m(Oe,{key:V.value.id,block:V.value},null,8,[`block`])):R.value===`blocks`?(u(),m(Ae,{key:1,onPick:Bt})):(u(),o(`div`,Mt,[e(w,{id:`category-m`,label:`Kategorie`},{default:f(()=>[e(E,{id:`category-m`,modelValue:r(A).category_id,"onUpdate:modelValue":s[22]||=e=>r(A).category_id=e,options:Rt.value,placeholder:D.canPublishWithoutCategory?`Ohne Kategorie`:`Kategorie wählen …`},null,8,[`modelValue`,`options`,`placeholder`])]),_:1}),M.value?(u(),m(w,{key:0,id:`published_at-m`,label:`Veröffentlichen am`},{default:f(()=>[e(r(Ue),{id:`published_at-m`,modelValue:r(A).published_at,"onUpdate:modelValue":s[23]||=e=>r(A).published_at=e,type:`datetime-local`},null,8,[`modelValue`])]),_:1})):g(``,!0),M.value?(u(),o(`label`,Nt,[s[51]||=t(`Auf der Startseite hervorheben `,-1),e(r(S),{modelValue:r(A).is_featured,"onUpdate:modelValue":s[24]||=e=>r(A).is_featured=e},null,8,[`modelValue`])])):g(``,!0)]))]),_:1})]),_:1},8,[`open`]),e(r(Ge),{open:Q.value,"onUpdate:open":s[28]||=e=>Q.value=e},{default:f(()=>[e(r(qe),{class:`sm:max-w-md`},{default:f(()=>[e(r(Ye),null,{default:f(()=>[e(r(Je),null,{default:f(()=>[...s[52]||=[t(`Beitrag zurückgeben`,-1)]]),_:1}),e(r(He),null,{default:f(()=>[t(p(D.post?.author)+` wird benachrichtigt und sieht Ihre Anmerkung.`,1)]),_:1})]),_:1}),e(w,{id:`note`,label:`Was soll geändert werden?`,error:r($).errors.note},{default:f(()=>[e(r(We),{id:`note`,modelValue:r($).note,"onUpdate:modelValue":s[26]||=e=>r($).note=e,rows:`4`,maxlength:`1000`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(r(Ke),null,{default:f(()=>[e(r(T),{variant:`outline`,onClick:s[27]||=e=>Q.value=!1},{default:f(()=>[...s[53]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(T),{disabled:r($).processing||!r($).note.trim(),onClick:un},{default:f(()=>[e(r(y)),s[54]||=t(` Zurückgeben`,-1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])]),e(r(Pe),{position:`bottom-left`})],64))}};export{D as default}; \ No newline at end of file diff --git a/public/build/assets/EditorBlockList-C9b3fqvQ.js b/public/build/assets/EditorBlockList-C9b3fqvQ.js deleted file mode 100644 index c1eeb2c5..00000000 --- a/public/build/assets/EditorBlockList-C9b3fqvQ.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,D as t,E as n,Ft as r,Ht as i,J as a,On as o,St as s,Zn as c,_ as l,b as u,bt as d,g as f,mt as p,o as m,qt as h,tr as g,v as _,vn as v,wt as y,y as b}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as x}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{O as S,k as C}from"./dist-DtGNiYlK.js";import{$ as w,F as T,K as E,N as ee,Z as te,n as ne,nt as D,p as O,r as re,t as ie,tt as ae}from"./AppIcon-0N56IC2z.js";import{n as k,t as A}from"./arrow-up-Djq_2Npz.js";import{i as oe,n as se}from"./RichTextEditor-qslPmeeg.js";import{C as j,_ as M,b as N,i as P,n as F,o as ce,r as le,t as I}from"./http-DmyDwIce.js";import{t as L}from"./chevron-up-DJvyZPom.js";import{a as R,i as ue,n as z,o as de,r as fe,t as pe}from"./Switch-CWN1_5O7.js";import{t as B}from"./eye-off-myis3scV.js";import{t as me}from"./folder-tree-ZY-sbGXb.js";import{t as he}from"./message-square-warning-BFfa_vqd.js";import{t as V}from"./minus-CmsbcqBG.js";import{t as H}from"./play-GbhjcPFH.js";import{t as U}from"./plus-B_ij2ng2.js";import{t as W}from"./quote-CAgJDpoy.js";import{t as G}from"./trash-DUqnVIgb.js";import{t as ge}from"./upload-M7dd6qr8.js";import{t as _e}from"./NativeSelect-BGasRaNs.js";import{t as K}from"./Input-FGSb2-yK.js";import{t as ve}from"./Textarea-DEFXqC2w.js";import{t as q}from"./registry-ZZ5qL5ag.js";var ye=C({name:`box`,size:24,node:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]}),J=C({name:`columns-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`panels-left-right`]}),Y=C({name:`contact`,size:24,node:[[`path`,{d:`M16 2v2`,key:`scm5qe`}],[`path`,{d:`M7 21v-2a2 2 0 012-2h6a2 2 0 012 2v2`,key:`k82dct`}],[`path`,{d:`M8 2v2`,key:`pbkmx`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]}),be=C({name:`gallery-horizontal-end`,size:24,node:[[`path`,{d:`M2 7v10`,key:`a2pl2d`}],[`path`,{d:`M6 5v14`,key:`1kq3d7`}],[`rect`,{width:`12`,height:`18`,x:`10`,y:`3`,rx:`2`,key:`13i7bc`}]]}),xe=C({name:`images`,size:24,node:[[`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`}]]}),Se=C({name:`list-collapse`,size:24,node:[[`path`,{d:`M10 5h11`,key:`1hkqpe`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 19h11`,key:`14g2nv`}],[`path`,{d:`m3 10 3-3-3-3`,key:`i7pm08`}],[`path`,{d:`m3 20 3-3-3-3`,key:`20gx1n`}]]}),Ce=C({name:`mouse-pointer-click`,size:24,node:[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]}),we=C({name:`move-vertical`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m8 18 4 4 4-4`,key:`bh5tu3`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}]]}),Te=C({name:`panel-top`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]}),Ee=C({name:`square-dashed`,size:24,node:[[`path`,{d:`M5 3a2 2 0 0 0-2 2`,key:`y57alp`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`,key:`18rm91`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`,key:`1j7049`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`,key:`sbafld`}],[`path`,{d:`M9 3h1`,key:`1yesri`}],[`path`,{d:`M9 21h1`,key:`15o7lz`}],[`path`,{d:`M14 3h1`,key:`1ec4yj`}],[`path`,{d:`M14 21h1`,key:`v9vybs`}],[`path`,{d:`M3 9v1`,key:`1r0deq`}],[`path`,{d:`M21 9v1`,key:`mxsmne`}],[`path`,{d:`M3 14v1`,key:`vnatye`}],[`path`,{d:`M21 14v1`,key:`169vum`}]],aliases:[`box-select`]}),De=C({name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]}),Oe=C({name:`tablet`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]}),ke={"square-dashed":Ee,"columns-3":J,"panel-top":Te,"list-collapse":Se,"message-square-warning":he,heading:ue,text:fe,quote:W,"mouse-pointer-click":Ce,"list-checks":N,table:De,minus:V,"move-vertical":we,image:E,images:xe,play:H,panorama:be,contact:Y,"file-down":te,"folder-tree":me,newspaper:T,"calendar-days":ae,"clipboard-list":w,cake:D};function X(e){return ke[e]??ye}function Z(){return Math.random().toString(36).slice(2,8)+Date.now().toString(36).slice(-6)}function Q(e){return JSON.parse(JSON.stringify(e))}function Ae(e,t){return e.container?e.key===`columns`?(t.layout??`1-1`).split(`-`).length:e.key===`tabs`?2:e.key===`accordion`?3:e.container.min:0}function $(e){let t=Q(e.defaults??{}),n={id:Z(),type:e.key,data:t};return e.container&&(n.items=Array.from({length:Ae(e,t)},(t,n)=>({id:Z(),title:e.container.titled?`${e.container.label} ${n+1}`:void 0,blocks:[]}))),n}function je(e){let t=Q(e),n=e=>{e.id=Z(),(e.items??[]).forEach(e=>{e.id=Z(),e.blocks.forEach(n)})};return n(t),t}function Me(e,t,n=null){for(let r=0;rNe(e.blocks,t))}function Pe(e){let t=(e.data.layout??`1-1`).split(`-`).length;for(;e.items.lengtht){let n=e.items.splice(t).flatMap(e=>e.blocks);e.items[t-1].blocks.push(...n)}}var Fe={class:`grid gap-4`},Ie={class:`mb-2 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},Le=[`title`,`disabled`,`onClick`],Re={class:`truncate`},ze={__name:`BlockPalette`,props:{compact:{type:Boolean,default:!1}},emits:[`pick`],setup(e,{emit:n}){let r=n,i=a(`pagebuilder:editor`),s=f(()=>Object.entries(i.groups).map(([e,t])=>({key:e,label:t,types:Object.values(i.types).filter(t=>t.group===e)})).filter(e=>e.types.length));return(n,a)=>(p(),u(`div`,Fe,[(p(!0),u(m,null,d(s.value,n=>(p(),u(`section`,{key:n.key},[l(`h3`,Ie,g(n.label),1),t(o(z),{"model-value":n.types,group:{name:`pagebuilder`,pull:`clone`,put:!1},clone:e=>o($)(e),sort:!1,disabled:e.compact||o(i).readOnly.value,class:`grid grid-cols-2 gap-2`},{default:h(()=>[(p(!0),u(m,null,d(n.types,t=>(p(),u(`button`,{key:t.key,type:`button`,class:c([`flex items-center gap-2 rounded-md border bg-card px-2.5 py-2 text-left text-[13px] font-medium transition-colors hover:border-brand-300 hover:bg-brand-soft/60`,e.compact?``:`cursor-grab active:cursor-grabbing`]),title:t.description||t.label,disabled:o(i).readOnly.value,onClick:e=>r(`pick`,t)},[(p(),_(y(o(X)(t.icon)),{class:`size-4 shrink-0 text-brand-text`})),l(`span`,Re,g(t.label),1)],10,Le))),128))]),_:2},1032,[`model-value`,`clone`,`disabled`])]))),128))]))}},Be={class:`grid gap-1.5`},Ve=[`for`],He=[`for`],Ue={key:8,class:`grid gap-2`},We={class:`grid max-h-56 grid-cols-6 gap-1.5 overflow-y-auto`},Ge=[`title`,`aria-pressed`,`onClick`],Ke={key:0,class:`col-span-6 py-2 text-center text-xs text-muted-foreground`},qe={key:9,class:`grid gap-2`},Je={key:0,class:`relative overflow-hidden rounded-md border bg-muted`},Ye=[`src`],Xe=[`disabled`],Ze={key:10,class:`grid gap-2`},Qe={key:0,class:`grid gap-1`},$e={class:`min-w-0 flex-1 truncate text-[13px]`},et=[`onClick`],tt=[`onClick`],nt={class:`relative`},rt={key:0,class:`absolute inset-x-0 top-full z-30 mt-1 max-h-60 overflow-y-auto rounded-md border bg-popover p-1 shadow-md`},it=[`onClick`],at={class:`min-w-0`},ot={class:`block truncate font-medium`},st={class:`block truncate text-xs text-muted-foreground`},ct={key:11,class:`grid gap-2`},lt={class:`overflow-x-auto rounded-md border`},ut={class:`w-full text-[13px]`},dt=[`value`,`aria-label`,`onInput`],ft={class:`w-7 p-0 text-center`},pt=[`onClick`],mt=[`onClick`],ht={class:`flex gap-2`},gt={key:12,class:`grid gap-2`},_t=[`open`],vt={class:`flex cursor-pointer list-none items-center gap-2 px-3 py-2 text-[13px] font-medium`},yt={class:`min-w-0 flex-1 truncate`},bt=[`onClick`],xt=[`onClick`],St=[`onClick`],Ct={class:`grid gap-3 border-t px-3 py-3`},wt={key:13,class:`grid gap-2`},Tt={key:0,class:`grid gap-1`},Et={class:`min-w-0 flex-1 truncate`},Dt={key:0,class:`shrink-0 text-xs text-muted-foreground`},Ot=[`onClick`],kt=[`onClick`],At=[`disabled`],jt={key:14,class:`text-xs text-muted-foreground`},Mt={__name:`FieldInput`,props:e({field:{type:Object,required:!0},id:{type:String,required:!0}},{modelValue:{default:null},modelModifiers:{}}),emits:e([`image-uploaded`],[`update:modelValue`]),setup(e,{emit:h}){let y=e,C=r(e,`modelValue`),w=a(`pagebuilder:editor`),T=h,E=v(!1),D=v(null);async function ae(e){let t=e.target.files?.[0];if(e.target.value=``,t){E.value=!0;try{let e=await w.uploadImage(t);C.value=e.path,T(`image-uploaded`,e)}catch(e){ce.error(e.fieldErrors?.image??e.message)}finally{E.value=!1}}}let j=v(``),N=v([]),P=w.peopleCache,F;if(i(j,e=>{if(clearTimeout(F),e.trim().length<2){N.value=[];return}F=setTimeout(async()=>{let t=await I.get(`/personen/suche?q=${encodeURIComponent(e.trim())}`);t.people.forEach(e=>P[e.id]=e),N.value=t.people.filter(e=>!(C.value??[]).includes(e.id))},250)}),y.field.type===`people`&&(C.value??[]).some(e=>!P[e])){let e=C.value.filter(e=>!P[e]);I.get(`/personen/suche?${e.map(e=>`ids[]=${e}`).join(`&`)}`).then(e=>e.people.forEach(e=>P[e.id]=e))}function le(e){C.value=[...C.value??[],e.id],j.value=``,N.value=[]}function L(e,t,n){let r=t+n;if(r<0||r>=e.length)return;let i=[...e];[i[t],i[r]]=[i[r],i[t]],C.value=i}function R(e){C.value=C.value.filter((t,n)=>n!==e)}function ue(){let e=Object.fromEntries(y.field.fields.map(e=>[e.name,structuredClone(e.default??(e.type===`toggle`?!1:e.type===`repeater`?[]:``))]));C.value=[...C.value??[],e]}let z=f(()=>C.value??[[``]]);function de(e,t,n){let r=z.value.map(e=>[...e]);r[e][t]=n,C.value=r}function fe(){C.value=[...z.value,Array(z.value[0]?.length??1).fill(``)]}function B(){C.value=z.value.map(e=>[...e,``])}function me(e){z.value.length>1&&(C.value=z.value.filter((t,n)=>n!==e))}function he(e){(z.value[0]?.length??1)>1&&(C.value=z.value.map(t=>t.filter((t,n)=>n!==e)))}let V=v(null),H=f(()=>Object.fromEntries(w.files.value.map(e=>[e.id,e])));async function W(e){let t=[...e.target.files??[]];e.target.value=``,E.value=!0;try{for(let e of t){let t=await w.uploadFile(e);C.value=[...C.value??[],t.id]}}catch(e){ce.error(e.fieldErrors?.file??e.message)}finally{E.value=!1}}let q=f(()=>w.files.value.filter(e=>!(C.value??[]).includes(e.id))),ye=e=>e>1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`,J=v(``),Y=f(()=>{let e=J.value.trim().toLowerCase(),t=(y.field.choices??[]).map(e=>({value:e.value,label:e.label}));if(!e)return C.value&&!t.some(e=>e.value===C.value)?[{value:C.value,label:C.value},...t]:t;let n=t.filter(t=>t.label.toLowerCase().includes(e)||t.value.includes(e)),r=ne.value?Object.keys(ne.value.icons).filter(t=>t.includes(e)&&!n.some(e=>e.value===t)):[];return[...n,...r.map(e=>({value:e,label:e}))].slice(0,60)});return i(J,e=>e.trim()&&re()),(r,i)=>{let a=s(`FieldInput`,!0);return p(),u(`div`,Be,[e.field.type===`toggle`?b(``,!0):(p(),u(`label`,{key:0,for:e.id,class:`text-[13px] font-medium`},g(e.field.label),9,Ve)),e.field.type===`text`?(p(),_(o(K),{key:1,id:e.id,modelValue:C.value,"onUpdate:modelValue":i[0]||=e=>C.value=e,maxlength:e.field.max,placeholder:e.field.placeholder??``},null,8,[`id`,`modelValue`,`maxlength`,`placeholder`])):e.field.type===`url`?(p(),_(o(K),{key:2,id:e.id,modelValue:C.value,"onUpdate:modelValue":i[1]||=e=>C.value=e,type:`text`,inputmode:`url`,placeholder:`https://… oder /seiten/…`},null,8,[`id`,`modelValue`])):e.field.type===`textarea`?(p(),_(o(ve),{key:3,id:e.id,modelValue:C.value,"onUpdate:modelValue":i[2]||=e=>C.value=e,maxlength:e.field.max,rows:`3`},null,8,[`id`,`modelValue`,`maxlength`])):e.field.type===`html`?(p(),_(se,{key:4,modelValue:C.value,"onUpdate:modelValue":i[3]||=e=>C.value=e,bordered:``,"min-height":`[&_.tiptap]:min-h-24`},null,8,[`modelValue`])):e.field.type===`number`?(p(),_(o(K),{key:5,id:e.id,modelValue:C.value,"onUpdate:modelValue":i[4]||=e=>C.value=e,modelModifiers:{number:!0},type:`number`,min:e.field.min,max:e.field.max},null,8,[`id`,`modelValue`,`min`,`max`])):e.field.type===`select`?(p(),_(_e,{key:6,id:e.id,modelValue:C.value,"onUpdate:modelValue":i[5]||=e=>C.value=e,options:e.field.choices},null,8,[`id`,`modelValue`,`options`])):e.field.type===`toggle`?(p(),u(`label`,{key:7,for:e.id,class:`flex items-center justify-between gap-3 py-0.5 text-[13px] font-medium`},[n(g(e.field.label)+` `,1),t(o(pe),{id:e.id,modelValue:C.value,"onUpdate:modelValue":i[6]||=e=>C.value=e},null,8,[`id`,`modelValue`])],8,He)):e.field.type===`icon`?(p(),u(`div`,Ue,[t(o(K),{modelValue:J.value,"onUpdate:modelValue":i[7]||=e=>J.value=e,type:`search`,placeholder:`Alle Symbole durchsuchen (englisch, z. B. calendar)`,class:`h-8 text-[13px]`},null,8,[`modelValue`]),l(`div`,We,[(p(!0),u(m,null,d(Y.value,e=>(p(),u(`button`,{key:e.value,type:`button`,class:c([`grid aspect-square place-items-center rounded-md border transition-colors`,C.value===e.value?`border-brand-400 bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent`]),title:e.label,"aria-pressed":C.value===e.value,onClick:t=>C.value=e.value},[t(ie,{name:e.value,class:`size-4`},null,8,[`name`])],10,Ge))),128)),J.value&&!Y.value.length?(p(),u(`p`,Ke,`Kein Symbol gefunden.`)):b(``,!0)])])):e.field.type===`image`?(p(),u(`div`,qe,[C.value?(p(),u(`div`,Je,[l(`img`,{src:o(w).imageUrl(C.value),alt:``,class:`aspect-video w-full object-cover`},null,8,Ye),l(`button`,{type:`button`,class:`absolute top-1.5 right-1.5 grid size-7 place-items-center rounded-md bg-card/90 shadow-sm hover:bg-card`,title:`Bild entfernen`,onClick:i[8]||=e=>C.value=null},[t(o(M),{class:`size-4`})])])):b(``,!0),l(`button`,{type:`button`,class:`flex h-9 items-center justify-center gap-2 rounded-md border border-dashed text-[13px] font-medium text-muted-foreground hover:border-brand-300 hover:text-foreground`,disabled:E.value,onClick:i[9]||=e=>D.value?.click()},[E.value?(p(),_(o(S),{key:0,class:`size-4 animate-spin`})):(p(),_(o(oe),{key:1,class:`size-4`})),n(` `+g(C.value?`Anderes Bild wählen`:`Bild hochladen`),1)],8,Xe),l(`input`,{ref_key:`imageInput`,ref:D,type:`file`,accept:`image/jpeg,image/png,image/webp,image/gif`,class:`hidden`,onChange:ae},null,544)])):e.field.type===`people`?(p(),u(`div`,Ze,[(C.value??[]).length?(p(),u(`ul`,Qe,[(p(!0),u(m,null,d(C.value,(e,n)=>(p(),u(`li`,{key:e,class:`flex items-center gap-2 rounded-md border bg-card px-2 py-1.5`},[o(P)[e]?(p(),_(O,{key:0,person:o(P)[e],class:`size-7 text-[10px]`},null,8,[`person`])):b(``,!0),l(`span`,$e,g(o(P)[e]?.name??`…`),1),l(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:e=>L(C.value,n,-1)},[t(o(A),{class:`size-3.5`})],8,et),l(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Entfernen`,onClick:e=>R(n)},[t(o(M),{class:`size-3.5`})],8,tt)]))),128))])):b(``,!0),l(`div`,nt,[t(o(ee),{class:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),t(o(K),{id:e.id,modelValue:j.value,"onUpdate:modelValue":i[10]||=e=>j.value=e,class:`pl-8`,placeholder:`Person suchen …`,autocomplete:`off`},null,8,[`id`,`modelValue`]),N.value.length?(p(),u(`ul`,rt,[(p(!0),u(m,null,d(N.value,e=>(p(),u(`li`,{key:e.id},[l(`button`,{type:`button`,class:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[13px] hover:bg-accent`,onClick:t=>le(e)},[t(O,{person:e,class:`size-7 text-[10px]`},null,8,[`person`]),l(`span`,at,[l(`span`,ot,g(e.name),1),l(`span`,st,g(e.job_title),1)])],8,it)]))),128))])):b(``,!0)])])):e.field.type===`table`?(p(),u(`div`,ct,[l(`div`,lt,[l(`table`,ut,[l(`tbody`,null,[(p(!0),u(m,null,d(z.value,(e,n)=>(p(),u(`tr`,{key:n,class:`border-b last:border-0`},[(p(!0),u(m,null,d(e,(e,t)=>(p(),u(`td`,{key:t,class:`border-r p-0 last:border-r-0`},[l(`input`,{value:e,class:`h-8 w-full min-w-20 bg-transparent px-2 focus:bg-brand-soft/50 focus:outline-none`,"aria-label":`Zeile ${n+1}, Spalte ${t+1}`,onInput:e=>de(n,t,e.target.value)},null,40,dt)]))),128)),l(`td`,ft,[l(`button`,{type:`button`,class:`grid size-7 place-items-center text-muted-foreground hover:text-destructive`,title:`Zeile entfernen`,onClick:e=>me(n)},[t(o(M),{class:`size-3.5`})],8,pt)])]))),128)),l(`tr`,null,[(p(!0),u(m,null,d(z.value[0],(e,n)=>(p(),u(`td`,{key:n,class:`p-0 text-center`},[l(`button`,{type:`button`,class:`mx-auto grid size-7 place-items-center text-muted-foreground hover:text-destructive`,title:`Spalte entfernen`,onClick:e=>he(n)},[t(o(M),{class:`size-3.5`})],8,mt)]))),128)),i[13]||=l(`td`,null,null,-1)])])])]),l(`div`,ht,[l(`button`,{type:`button`,class:`inline-flex items-center gap-1 text-[13px] font-medium text-brand-text hover:underline`,onClick:fe},[t(o(U),{class:`size-3.5`}),i[14]||=n(` Zeile`,-1)]),l(`button`,{type:`button`,class:`inline-flex items-center gap-1 text-[13px] font-medium text-brand-text hover:underline`,onClick:B},[t(o(U),{class:`size-3.5`}),i[15]||=n(` Spalte`,-1)])])])):e.field.type===`repeater`?(p(),u(`div`,gt,[(p(!0),u(m,null,d(C.value??[],(n,r)=>(p(),u(`details`,{key:r,class:`group rounded-md border bg-card`,open:r===(C.value??[]).length-1},[l(`summary`,vt,[l(`span`,yt,g(n.label||n.title||n.alt||`${e.field.itemLabel} ${r+1}`),1),l(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:x(e=>L(C.value,r,-1),[`prevent`])},[t(o(A),{class:`size-3.5`})],8,bt),l(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach unten`,onClick:x(e=>L(C.value,r,1),[`prevent`])},[t(o(k),{class:`size-3.5`})],8,xt),l(`button`,{type:`button`,class:`grid size-6 place-items-center rounded text-destructive hover:bg-destructive/10`,title:`Entfernen`,onClick:x(e=>R(r),[`prevent`])},[t(o(G),{class:`size-3.5`})],8,St)]),l(`div`,Ct,[(p(!0),u(m,null,d(e.field.fields,t=>(p(),_(a,{id:`${e.id}-${r}-${t.name}`,key:t.name,modelValue:n[t.name],"onUpdate:modelValue":e=>n[t.name]=e,field:t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`field`]))),128))])],8,_t))),128)),(C.value??[]).length(p(),u(`li`,{key:e,class:`flex items-center gap-2 rounded-md border bg-card px-2 py-1.5 text-[13px]`},[t(o(te),{class:`size-4 shrink-0 text-muted-foreground`}),l(`span`,Et,g(H.value[e]?.name??`Datei nicht mehr vorhanden`),1),H.value[e]?(p(),u(`span`,Dt,g(ye(H.value[e].size)),1)):b(``,!0),l(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:e=>L(C.value,n,-1)},[t(o(A),{class:`size-3.5`})],8,Ot),l(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Entfernen`,onClick:e=>R(n)},[t(o(M),{class:`size-3.5`})],8,kt)]))),128))])):b(``,!0),l(`button`,{type:`button`,class:`flex h-9 items-center justify-center gap-2 rounded-md border border-dashed text-[13px] font-medium text-muted-foreground hover:border-brand-300 hover:text-foreground`,disabled:E.value,onClick:i[11]||=e=>V.value?.click()},[E.value?(p(),_(o(S),{key:0,class:`size-4 animate-spin`})):(p(),_(o(ge),{key:1,class:`size-4`})),i[16]||=n(` Dateien hochladen `,-1)],8,At),l(`input`,{ref_key:`fileInput`,ref:V,type:`file`,multiple:``,class:`hidden`,onChange:W},null,544),q.value.length?(p(),_(_e,{key:1,"model-value":null,options:q.value.map(e=>({value:e.id,label:e.name})),placeholder:`Bereits hochgeladene Datei wählen …`,"onUpdate:modelValue":i[12]||=e=>e&&(C.value=[...C.value??[],e])},null,8,[`options`])):b(``,!0)])):b(``,!0),e.field.help?(p(),u(`p`,jt,g(e.field.help),1)):b(``,!0)])}}},Nt={key:0,class:`grid gap-5`},Pt={class:`flex items-start gap-3`},Ft={class:`grid size-9 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},It={class:`min-w-0`},Lt={class:`font-semibold`},Rt={key:0,class:`text-xs text-muted-foreground`},zt={key:0,class:`rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground`},Bt={key:1,class:`grid gap-2`},Vt={class:`text-[13px] font-medium`},Ht={key:1,class:`flex-1 text-[13px]`},Ut=[`onClick`],Wt=[`onClick`],Gt=[`disabled`,`onClick`],Kt=[`open`],qt={class:`flex cursor-pointer items-center gap-2 px-3 py-2 text-[13px] font-medium`},Jt={key:0,class:`ml-auto rounded bg-amber-100 px-1.5 py-0.5 text-[11px] text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`},Yt={class:`grid gap-3 border-t px-3 py-3`},Xt={class:`mb-1 text-xs font-semibold text-muted-foreground`},Zt={key:0,class:`-mt-1 mb-1 text-[11px] text-muted-foreground`},Qt={class:`grid max-h-36 gap-0.5 overflow-y-auto`},$t=[`checked`,`onChange`],en={__name:`BlockSettings`,props:{block:{type:Object,required:!0}},setup(e){let r=e,s=a(`pagebuilder:editor`),c=f(()=>s.types[r.block.type]),h=f(()=>(c.value?.fields??[]).filter(e=>e.type!==`html`));i(()=>r.block.data.layout,()=>{r.block.type===`columns`&&Pe(r.block)});function v(){r.block.items.push({id:Z(),title:`${c.value.container.label} ${r.block.items.length+1}`,blocks:[]})}function x(e,t){let n=r.block.items,i=e+t;i>=0&&ir.block.visibility??{}),w=f(()=>Object.values(C.value).some(e=>e?.length));function T(e,t){let n=new Set(C.value[e]??[]);n.has(t)?n.delete(t):n.add(t),r.block.visibility={...C.value,[e]:[...n]}}let E=f(()=>[{key:`role`,label:`Rollen`,options:s.audienceOptions.role},{key:`department`,label:`Abteilungen`,options:s.audienceOptions.department.map(e=>({value:e,label:e}))},{key:`location`,label:`Standorte`,options:s.audienceOptions.location.map(e=>({value:e,label:e}))},{key:`exclude_role`,label:`Ausgeschlossene Rollen`,hint:`Sehen den Block nie – auch wenn oben etwas passt.`,options:s.audienceOptions.role}].filter(e=>e.options.length));return(r,i)=>c.value?(p(),u(`div`,Nt,[l(`header`,Pt,[l(`span`,Ft,[(p(),_(y(o(X)(c.value.icon)),{class:`size-4.5`}))]),l(`div`,It,[l(`h2`,Lt,g(c.value.label),1),c.value.description?(p(),u(`p`,Rt,g(c.value.description),1)):b(``,!0)])]),c.value.fields.some(e=>e.type===`html`)?(p(),u(`p`,zt,` Den Text bearbeiten Sie direkt im Block. Markieren Sie Text für Fettdruck, Links und Listen. `)):b(``,!0),(p(!0),u(m,null,d(h.value,t=>(p(),_(Mt,{id:`field-${e.block.id}-${t.name}`,key:`${e.block.id}-${t.name}`,modelValue:e.block.data[t.name],"onUpdate:modelValue":n=>e.block.data[t.name]=n,field:t},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`field`]))),128)),c.value.container&&c.value.container.max>1&&c.value.key!==`columns`?(p(),u(`section`,Bt,[l(`h3`,Vt,g(c.value.container.label)+`s`,1),(p(!0),u(m,null,d(e.block.items,(n,r)=>(p(),u(`div`,{key:n.id,class:`flex items-center gap-1`},[c.value.container.titled?(p(),_(o(K),{key:0,modelValue:n.title,"onUpdate:modelValue":e=>n.title=e,class:`h-8`,"aria-label":`Titel ${r+1}`,maxlength:`120`},null,8,[`modelValue`,`onUpdate:modelValue`,`aria-label`])):(p(),u(`span`,Ht,g(c.value.container.label)+` `+g(r+1),1)),l(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:e=>x(r,-1)},[t(o(A),{class:`size-3.5`})],8,Ut),l(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded hover:bg-accent`,title:`Nach unten`,onClick:e=>x(r,1)},[t(o(k),{class:`size-3.5`})],8,Wt),l(`button`,{type:`button`,class:`grid size-7 shrink-0 place-items-center rounded text-destructive hover:bg-destructive/10 disabled:opacity-30`,title:`Entfernen`,disabled:e.block.items.length<=c.value.container.min,onClick:e=>S(r)},[t(o(G),{class:`size-3.5`})],8,Gt)]))),128)),e.block.items.length(p(),u(`fieldset`,{key:e.key,class:`grid gap-1`},[l(`legend`,Xt,g(e.label),1),e.hint?(p(),u(`p`,Zt,g(e.hint),1)):b(``,!0),l(`div`,Qt,[(p(!0),u(m,null,d(e.options,t=>(p(),u(`label`,{key:t.value,class:`flex items-center gap-2 rounded px-1 py-0.5 text-[13px] hover:bg-accent`},[l(`input`,{type:`checkbox`,class:`size-4 accent-[var(--brand)]`,checked:(C.value[e.key]??[]).includes(t.value),onChange:n=>T(e.key,t.value)},null,40,$t),n(` `+g(t.label),1)]))),128))])]))),128))])],8,Kt)):b(``,!0)])):b(``,!0)}},tn=[`data-block-id`],nn={class:`pb-handle flex cursor-grab items-center gap-1 rounded px-1 py-0.5 font-medium text-muted-foreground active:cursor-grabbing`,title:`Ziehen zum Verschieben`},rn={key:2,class:`rounded-md border border-dashed p-4 text-sm text-muted-foreground`},an={__name:`EditorBlock`,props:{block:{type:Object,required:!0}},setup(e){let r=e,i=a(`pagebuilder:editor`),s=f(()=>i.types[r.block.type]),d=f(()=>i.selectedId.value===r.block.id),m=f(()=>i.hoveredId.value===r.block.id),h=f(()=>Object.values(r.block.visibility??{}).some(e=>e?.length)),v=f(()=>({...r.block,props:i.previews[r.block.id]??r.block.props}));return(r,a)=>(p(),u(`div`,{class:c([`relative rounded-md outline-offset-4 transition-[outline-color]`,[d.value?`outline-2 outline-brand-500`:m.value?`outline-1 outline-brand-300`:`outline-1 outline-transparent`,s.value?``:`opacity-60`]]),"data-block-id":e.block.id,onClick:a[5]||=x(t=>o(i).select(e.block.id),[`stop`]),onMouseover:a[6]||=x(t=>o(i).hoveredId.value=e.block.id,[`stop`]),onMouseleave:a[7]||=t=>o(i).hoveredId.value===e.block.id&&(o(i).hoveredId.value=null)},[(d.value||m.value)&&!o(i).readOnly.value?(p(),u(`div`,{key:0,class:`absolute -top-3.5 right-2 z-20 flex items-center gap-0.5 rounded-md border bg-card px-1 py-0.5 text-xs shadow-sm`,onClick:a[4]||=x(()=>{},[`stop`])},[l(`span`,nn,[t(o(R),{class:`size-3.5`}),(p(),_(y(o(X)(s.value?.icon)),{class:`size-3.5`})),n(` `+g(s.value?.label??e.block.type),1)]),h.value?(p(),_(o(B),{key:0,class:`mx-1 size-3.5 text-amber-600`,title:`Nur für bestimmte Personen sichtbar`})):b(``,!0),a[8]||=l(`span`,{class:`mx-0.5 h-4 w-px bg-border`},null,-1),l(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach oben`,onClick:a[0]||=t=>o(i).move(e.block.id,-1)},[t(o(L),{class:`size-3.5`})]),l(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Nach unten`,onClick:a[1]||=t=>o(i).move(e.block.id,1)},[t(o(j),{class:`size-3.5`})]),l(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,title:`Duplizieren`,onClick:a[2]||=t=>o(i).duplicate(e.block.id)},[t(o(de),{class:`size-3.5`})]),l(`button`,{type:`button`,class:`grid size-6 place-items-center rounded text-destructive hover:bg-destructive/10`,title:`Entfernen`,onClick:a[3]||=t=>o(i).remove(e.block.id)},[t(o(G),{class:`size-3.5`})])])):b(``,!0),s.value&&o(q)(s.value.component)?(p(),_(y(o(q)(s.value.component)),{key:1,block:v.value},null,8,[`block`])):(p(),u(`div`,rn,` Dieser Block (`+g(e.block.type)+`) ist nicht verfügbar – vermutlich ist das zugehörige Plugin deaktiviert. Er wird nicht angezeigt. `,1))],42,tn))}},on={key:0,class:`pointer-events-none text-center text-xs text-muted-foreground`},sn={__name:`EditorBlockList`,props:{item:{type:Object,required:!0},root:{type:Boolean,default:!1}},setup(e){let r=e,i=a(`pagebuilder:editor`),s=f(()=>r.root||i.containsActive(r.item));return(r,a)=>(p(),u(`div`,{class:c([`grid`,e.root?`gap-6`:`gap-4`])},[t(o(z),{modelValue:e.item.blocks,"onUpdate:modelValue":a[0]||=t=>e.item.blocks=t,group:{name:`pagebuilder`},handle:`.pb-handle`,animation:150,disabled:o(i).readOnly.value,"ghost-class":`pb-ghost`,class:c([`grid min-h-6`,[e.root?`gap-6`:`gap-4`,e.item.blocks.length?``:`rounded-md border border-dashed border-border bg-muted/40 p-3`]]),onAdd:a[1]||=t=>o(i).select(e.item.blocks[t.newIndex]?.id)},{default:h(()=>[(p(!0),u(m,null,d(e.item.blocks,e=>(p(),_(an,{key:e.id,block:e},null,8,[`block`]))),128)),e.item.blocks.length?b(``,!0):(p(),u(`p`,on,g(e.root?`Noch keine Inhalte. Blöcke aus der rechten Spalte hierher ziehen oder hinzufügen.`:`Blöcke hierher ziehen`),1))]),_:1},8,[`modelValue`,`disabled`,`class`]),!o(i).readOnly.value&&(s.value||!e.item.blocks.length)?(p(),_(o(P),{key:0},{default:h(()=>[t(o(F),{class:`flex h-8 items-center justify-center gap-1.5 rounded-md border border-dashed text-xs font-medium text-muted-foreground transition-colors hover:border-brand-300 hover:bg-brand-soft hover:text-brand-soft-foreground`,onClick:a[2]||=x(()=>{},[`stop`])},{default:h(()=>[t(o(U),{class:`size-3.5`}),a[5]||=n(` Block hinzufügen `,-1)]),_:1}),t(o(le),{class:`max-h-[70vh] w-[22rem] overflow-y-auto p-3`,align:`center`,onClick:a[4]||=x(()=>{},[`stop`])},{default:h(()=>[t(ze,{compact:``,onPick:a[3]||=t=>o(i).insert(e.item.blocks,e.item.blocks.length,t)})]),_:1})]),_:1})):b(``,!0)],2))}};export{$ as a,Ne as c,Q as i,Oe as l,en as n,je as o,ze as r,Me as s,sn as t}; \ No newline at end of file diff --git a/public/build/assets/EditorialForms-Xe2D8QAP.js b/public/build/assets/EditorialForms-CbjA1btN.js similarity index 91% rename from public/build/assets/EditorialForms-Xe2D8QAP.js rename to public/build/assets/EditorialForms-CbjA1btN.js index 087784eb..9d0c36ce 100644 --- a/public/build/assets/EditorialForms-Xe2D8QAP.js +++ b/public/build/assets/EditorialForms-CbjA1btN.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./app-Bu3kn8yd.js";import{t as p}from"./download-UAAY3N2F.js";import{t as m}from"./pencil-line-CmAbFj4f.js";import{t as h}from"./plus-B_ij2ng2.js";import{t as g}from"./table-properties-BPjlj2dD.js";import{t as _}from"./button-ZHC5mKey.js";import{t as v}from"./Panel-BASB8Xb9.js";var y=[`href`],b={key:0,class:`-mx-5 divide-y border-t`},x={class:`min-w-0 flex-1`},S={class:`text-xs text-muted-foreground`},C={class:`font-medium text-brand-text`},w=[`href`],T=[`href`],E={key:1,class:`text-sm text-muted-foreground`},D={__name:`EditorialForms`,props:{forms:{type:Array,required:!0},createUrl:{type:String,default:null}},setup(D){return(O,k)=>(o(),u(v,{title:`Formulare`},{actions:c(()=>[D.createUrl?(o(),u(n(_),{key:0,size:`sm`,variant:`outline`,"as-child":``},{default:c(()=>[r(`a`,{href:D.createUrl},[e(n(h)),k[0]||=t(` Neues Formular`,-1)],8,y)]),_:1})):d(``,!0)]),default:c(()=>[D.forms.length?(o(),i(`ul`,b,[(o(!0),i(s,null,a(D.forms,a=>(o(),i(`li`,{key:a.id,class:`flex items-center gap-3 px-5 py-2.5`},[r(`div`,x,[e(n(f),{href:a.url,class:`block truncate text-sm font-medium hover:underline`},{default:c(()=>[t(l(a.title),1)]),_:2},1032,[`href`]),r(`p`,S,[t(l(a.open?`offen`:`geschlossen`)+` · `+l(a.submissions)+` Einsendungen`,1),a.unread?(o(),i(s,{key:0},[k[1]||=t(`, `,-1),r(`span`,C,l(a.unread)+` neu`,1)],64)):d(``,!0)])]),a.builder_url?(o(),u(n(_),{key:0,size:`icon`,variant:`ghost`,"as-child":``,title:`Felder bearbeiten`},{default:c(()=>[e(n(f),{href:a.builder_url},{default:c(()=>[e(n(m))]),_:1},8,[`href`])]),_:2},1024)):d(``,!0),a.results_url?(o(),u(n(_),{key:1,size:`icon`,variant:`ghost`,"as-child":``,title:`Ergebnisse`},{default:c(()=>[r(`a`,{href:a.results_url},[e(n(g))],8,w)]),_:2},1024)):d(``,!0),a.csv_url?(o(),u(n(_),{key:2,size:`icon`,variant:`ghost`,"as-child":``,title:`Ergebnisse als CSV herunterladen`},{default:c(()=>[r(`a`,{href:a.csv_url},[e(n(p))],8,T)]),_:2},1024)):d(``,!0)]))),128))])):(o(),i(`p`,E,`Noch keine Formulare.`))]),_:1}))}};export{D as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./app-BNwrc_lv.js";import{t as p}from"./download-UAAY3N2F.js";import{t as m}from"./pencil-line-CmAbFj4f.js";import{t as h}from"./plus-B_ij2ng2.js";import{t as g}from"./table-properties-BPjlj2dD.js";import{n as _}from"./button-CwUSbS9X.js";import{t as v}from"./Panel-Dr-NcUuS.js";var y=[`href`],b={key:0,class:`-mx-5 divide-y border-t`},x={class:`min-w-0 flex-1`},S={class:`text-xs text-muted-foreground`},C={class:`font-medium text-brand-text`},w=[`href`],T=[`href`],E={key:1,class:`text-sm text-muted-foreground`},D={__name:`EditorialForms`,props:{forms:{type:Array,required:!0},createUrl:{type:String,default:null}},setup(D){return(O,k)=>(o(),u(v,{title:`Formulare`},{actions:c(()=>[D.createUrl?(o(),u(n(_),{key:0,size:`sm`,variant:`outline`,"as-child":``},{default:c(()=>[r(`a`,{href:D.createUrl},[e(n(h)),k[0]||=t(` Neues Formular`,-1)],8,y)]),_:1})):d(``,!0)]),default:c(()=>[D.forms.length?(o(),i(`ul`,b,[(o(!0),i(s,null,a(D.forms,a=>(o(),i(`li`,{key:a.id,class:`flex items-center gap-3 px-5 py-2.5`},[r(`div`,x,[e(n(f),{href:a.url,class:`block truncate text-sm font-medium hover:underline`},{default:c(()=>[t(l(a.title),1)]),_:2},1032,[`href`]),r(`p`,S,[t(l(a.open?`offen`:`geschlossen`)+` · `+l(a.submissions)+` Einsendungen`,1),a.unread?(o(),i(s,{key:0},[k[1]||=t(`, `,-1),r(`span`,C,l(a.unread)+` neu`,1)],64)):d(``,!0)])]),a.builder_url?(o(),u(n(_),{key:0,size:`icon`,variant:`ghost`,"as-child":``,title:`Felder bearbeiten`},{default:c(()=>[e(n(f),{href:a.builder_url},{default:c(()=>[e(n(m))]),_:1},8,[`href`])]),_:2},1024)):d(``,!0),a.results_url?(o(),u(n(_),{key:1,size:`icon`,variant:`ghost`,"as-child":``,title:`Ergebnisse`},{default:c(()=>[r(`a`,{href:a.results_url},[e(n(g))],8,w)]),_:2},1024)):d(``,!0),a.csv_url?(o(),u(n(_),{key:2,size:`icon`,variant:`ghost`,"as-child":``,title:`Ergebnisse als CSV herunterladen`},{default:c(()=>[r(`a`,{href:a.csv_url},[e(n(p))],8,T)]),_:2},1024)):d(``,!0)]))),128))])):(o(),i(`p`,E,`Noch keine Formulare.`))]),_:1}))}};export{D as default}; \ No newline at end of file diff --git a/public/build/assets/EditorialMedia-DaL3QIsH.js b/public/build/assets/EditorialMedia-DaL3QIsH.js new file mode 100644 index 00000000..8f773635 --- /dev/null +++ b/public/build/assets/EditorialMedia-DaL3QIsH.js @@ -0,0 +1 @@ +import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./app-BNwrc_lv.js";import{t as p}from"./image-off-IDPmIoA8.js";import{t as m}from"./images-47Nc0alu.js";import{t as h}from"./Panel-Dr-NcUuS.js";var g={class:`-mt-1 mb-3 text-[13px] text-muted-foreground`},_={key:0,class:`grid grid-cols-4 gap-2`},v=[`src`,`alt`],y={key:1,class:`grid aspect-[4/3] place-items-center text-muted-foreground`},b={key:1,class:`grid place-items-center rounded-md border border-dashed py-8 text-center text-[13px] text-muted-foreground`},x={__name:`EditorialMedia`,props:{total:{type:Number,default:0},unused:{type:Number,default:null},recent:{type:Array,default:()=>[]}},setup(x){return(S,C)=>(o(),u(h,{title:`Mediathek`,"action-label":`Mediathek öffnen`,"action-href":`/redaktion/mediathek`},{default:c(()=>[r(`p`,g,[t(l(x.total.toLocaleString(`de-DE`))+` `+l(x.total===1?`Bild`:`Bilder`)+` `,1),x.unused?(o(),i(s,{key:0},[C[0]||=t(` · `,-1),e(n(f),{href:`/redaktion/mediathek?status=unbenutzt`,class:`font-medium text-brand-text hover:underline`},{default:c(()=>[t(l(x.unused)+` nicht verwendet`,1)]),_:1})],64)):d(``,!0)]),x.recent.length?(o(),i(`ul`,_,[(o(!0),i(s,null,a(x.recent,t=>(o(),i(`li`,{key:t.id},[e(n(f),{href:`/redaktion/mediathek?q=${encodeURIComponent(t.name)}`,class:`block overflow-hidden rounded-md border bg-muted hover:border-brand-300`,title:t.alt||t.name},{default:c(()=>[t.thumb_url?(o(),i(`img`,{key:0,src:t.thumb_url,alt:t.alt,loading:`lazy`,class:`aspect-[4/3] w-full object-cover`},null,8,v)):(o(),i(`span`,y,[e(n(p),{class:`size-5`,"stroke-width":1.5})]))]),_:2},1032,[`href`,`title`])]))),128))])):(o(),i(`div`,b,[e(n(m),{class:`mb-2 size-6`,"stroke-width":1.5}),C[1]||=t(` Noch keine Bilder hochgeladen. `,-1)]))]),_:1}))}};export{x as default}; \ No newline at end of file diff --git a/public/build/assets/EditorialNews-D_r1x5FJ.js b/public/build/assets/EditorialNews-AsssE4tU.js similarity index 92% rename from public/build/assets/EditorialNews-D_r1x5FJ.js rename to public/build/assets/EditorialNews-AsssE4tU.js index 0d14e483..2edab4f5 100644 --- a/public/build/assets/EditorialNews-D_r1x5FJ.js +++ b/public/build/assets/EditorialNews-AsssE4tU.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as p}from"./app-Bu3kn8yd.js";import{t as m}from"./message-square-warning-BFfa_vqd.js";import{t as h}from"./plus-B_ij2ng2.js";import{a as g}from"./format-BsuBtvUs.js";import{t as _}from"./button-ZHC5mKey.js";import{t as v}from"./Panel-BASB8Xb9.js";var y={class:`grid gap-5`},b={class:`mb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},x={key:0,class:`ml-1 rounded-full bg-brand px-1.5 py-0.5 text-[10px] text-brand-foreground`},S={key:0,class:`-mx-5 divide-y border-y`},C={class:`min-w-0 flex-1`},w={class:`truncate text-xs text-muted-foreground`},T={key:1,class:`text-sm text-muted-foreground`},E={__name:`EditorialNews`,props:{review:{type:Array,required:!0},mine:{type:Array,required:!0},scheduled:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(E){let D=e=>({pending:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`,published:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`,draft:`bg-muted text-muted-foreground`})[e.status];return(O,k)=>(s(),d(v,{title:`Neuigkeiten`},{actions:l(()=>[E.canCreate?(s(),d(n(_),{key:0,size:`sm`,"as-child":``},{default:l(()=>[e(n(p),{href:`/redaktion/neuigkeiten/neu`},{default:l(()=>[e(n(h)),k[0]||=t(` Neuer Beitrag`,-1)]),_:1})]),_:1})):f(``,!0)]),default:l(()=>[i(`div`,y,[(s(!0),a(c,null,o([{key:`review`,title:`Zur Freigabe`,items:E.review,empty:null},{key:`mine`,title:`Meine Entwürfe`,items:E.mine,empty:`Keine offenen Entwürfe.`},{key:`scheduled`,title:`Geplant`,items:E.scheduled,empty:null}].filter(e=>e.items.length||e.empty),h=>(s(),a(`section`,{key:h.key},[i(`h3`,b,[t(u(h.title)+` `,1),h.key===`review`?(s(),a(`span`,x,u(h.items.length),1)):f(``,!0)]),h.items.length?(s(),a(`ul`,S,[(s(!0),a(c,null,o(h.items,o=>(s(),a(`li`,{key:o.id,class:`flex items-center gap-3 px-5 py-2.5`},[i(`div`,C,[e(n(p),{href:o.edit_url,class:`block truncate text-sm font-medium hover:underline`},{default:l(()=>[t(u(o.title),1)]),_:2},1032,[`href`]),i(`p`,w,[t(u(o.category??`Ohne Kategorie`),1),h.key!==`mine`&&o.author?(s(),a(c,{key:0},[t(` · `+u(o.author),1)],64)):f(``,!0),o.date?(s(),a(c,{key:1},[t(` · `+u(n(g)(o.date)),1)],64)):f(``,!0)])]),o.review_note?(s(),d(n(m),{key:0,class:`size-4 shrink-0 text-amber-600`,title:`Mit Anmerkung zurückgegeben`})):f(``,!0),i(`span`,{class:r([`shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium`,D(o)])},u(o.status_label),3)]))),128))])):(s(),a(`p`,T,u(h.empty),1))]))),128))])]),_:1}))}};export{E as default}; \ No newline at end of file +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as p}from"./app-BNwrc_lv.js";import{t as m}from"./message-square-warning-BFfa_vqd.js";import{t as h}from"./plus-B_ij2ng2.js";import{a as g}from"./format-BsuBtvUs.js";import{n as _}from"./button-CwUSbS9X.js";import{t as v}from"./Panel-Dr-NcUuS.js";var y={class:`grid gap-5`},b={class:`mb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase`},x={key:0,class:`ml-1 rounded-full bg-brand px-1.5 py-0.5 text-[10px] text-brand-foreground`},S={key:0,class:`-mx-5 divide-y border-y`},C={class:`min-w-0 flex-1`},w={class:`truncate text-xs text-muted-foreground`},T={key:1,class:`text-sm text-muted-foreground`},E={__name:`EditorialNews`,props:{review:{type:Array,required:!0},mine:{type:Array,required:!0},scheduled:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(E){let D=e=>({pending:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`,published:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`,draft:`bg-muted text-muted-foreground`})[e.status];return(O,k)=>(s(),d(v,{title:`Neuigkeiten`},{actions:l(()=>[E.canCreate?(s(),d(n(_),{key:0,size:`sm`,"as-child":``},{default:l(()=>[e(n(p),{href:`/redaktion/neuigkeiten/neu`},{default:l(()=>[e(n(h)),k[0]||=t(` Neuer Beitrag`,-1)]),_:1})]),_:1})):f(``,!0)]),default:l(()=>[i(`div`,y,[(s(!0),a(c,null,o([{key:`review`,title:`Zur Freigabe`,items:E.review,empty:null},{key:`mine`,title:`Meine Entwürfe`,items:E.mine,empty:`Keine offenen Entwürfe.`},{key:`scheduled`,title:`Geplant`,items:E.scheduled,empty:null}].filter(e=>e.items.length||e.empty),h=>(s(),a(`section`,{key:h.key},[i(`h3`,b,[t(u(h.title)+` `,1),h.key===`review`?(s(),a(`span`,x,u(h.items.length),1)):f(``,!0)]),h.items.length?(s(),a(`ul`,S,[(s(!0),a(c,null,o(h.items,o=>(s(),a(`li`,{key:o.id,class:`flex items-center gap-3 px-5 py-2.5`},[i(`div`,C,[e(n(p),{href:o.edit_url,class:`block truncate text-sm font-medium hover:underline`},{default:l(()=>[t(u(o.title),1)]),_:2},1032,[`href`]),i(`p`,w,[t(u(o.category??`Ohne Kategorie`),1),h.key!==`mine`&&o.author?(s(),a(c,{key:0},[t(` · `+u(o.author),1)],64)):f(``,!0),o.date?(s(),a(c,{key:1},[t(` · `+u(n(g)(o.date)),1)],64)):f(``,!0)])]),o.review_note?(s(),d(n(m),{key:0,class:`size-4 shrink-0 text-amber-600`,title:`Mit Anmerkung zurückgegeben`})):f(``,!0),i(`span`,{class:r([`shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium`,D(o)])},u(o.status_label),3)]))),128))])):(s(),a(`p`,T,u(h.empty),1))]))),128))])]),_:1}))}};export{E as default}; \ No newline at end of file diff --git a/public/build/assets/EditorialPages-iK1WfX4x.js b/public/build/assets/EditorialPages-C4uXxskK.js similarity index 88% rename from public/build/assets/EditorialPages-iK1WfX4x.js rename to public/build/assets/EditorialPages-C4uXxskK.js index fa23f932..88c75e8e 100644 --- a/public/build/assets/EditorialPages-iK1WfX4x.js +++ b/public/build/assets/EditorialPages-C4uXxskK.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,er as s,mt as c,o as l,qt as u,tr as d,v as f,vn as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as h}from"./app-Bu3kn8yd.js";import{t as g}from"./lock-H7FAhSBr.js";import{t as _}from"./plus-B_ij2ng2.js";import{a as v}from"./format-BsuBtvUs.js";import{t as y}from"./button-ZHC5mKey.js";import{t as b}from"./Panel-BASB8Xb9.js";import{t as x}from"./NewPageDialog-BJuo8o_M.js";var S={key:0,class:`-mx-5 divide-y border-t`},C={class:`text-xs text-muted-foreground`},w=[`title`],T={key:1,class:`text-sm text-muted-foreground`},E={__name:`EditorialPages`,props:{pages:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(E){let D=p(!1),O={published:{label:`Veröffentlicht`,class:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`},draft:{label:`Entwurf`,class:`bg-brand-soft text-brand-soft-foreground`},scheduled:{label:`Geplant`,class:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`},new:{label:`Neu`,class:`bg-muted text-muted-foreground`}};return(p,k)=>(c(),f(b,{title:`Seiten`},{actions:u(()=>[E.canCreate?(c(),f(n(y),{key:0,size:`sm`,variant:`outline`,onClick:k[0]||=e=>D.value=!0},{default:u(()=>[e(n(_)),k[2]||=t(` Neue Seite`,-1)]),_:1})):m(``,!0)]),default:u(()=>[E.pages.length?(c(),a(`ul`,S,[(c(!0),a(l,null,o(E.pages,o=>(c(),a(`li`,{key:o.id,class:`flex items-center gap-3 py-2.5 pr-5`,style:s({paddingLeft:`${1.25+Math.min(o.depth,4)*1.25}rem`})},[i(`div`,{class:r([`min-w-0 flex-1`,o.depth?`border-l pl-3`:``])},[e(n(h),{href:o.edit_url,class:`block truncate text-sm font-medium hover:underline`},{default:u(()=>[t(d(o.title),1)]),_:2},1032,[`href`]),i(`p`,C,[t(d(o.url),1),o.changed_at?(c(),a(l,{key:0},[t(` · `+d(n(v)(o.changed_at)),1)],64)):m(``,!0)])],2),o.locked_by?(c(),a(`span`,{key:0,class:`inline-flex items-center gap-1 text-xs text-muted-foreground`,title:`${o.locked_by} bearbeitet gerade`},[e(n(g),{class:`size-3.5`}),t(` `+d(o.locked_by),1)],8,w)):m(``,!0),i(`span`,{class:r([`shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium`,O[o.status].class])},d(O[o.status].label),3)],4))),128))])):(c(),a(`p`,T,`Sie dürfen noch keine Seiten bearbeiten.`)),e(x,{open:D.value,"onUpdate:open":k[1]||=e=>D.value=e},null,8,[`open`])]),_:1}))}};export{E as default}; \ No newline at end of file +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,er as s,mt as c,o as l,qt as u,tr as d,v as f,vn as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as h}from"./app-BNwrc_lv.js";import{t as g}from"./lock-H7FAhSBr.js";import{t as _}from"./plus-B_ij2ng2.js";import{a as v}from"./format-BsuBtvUs.js";import{n as y}from"./button-CwUSbS9X.js";import{t as b}from"./Panel-Dr-NcUuS.js";import{t as x}from"./NewPageDialog-CGV-jwsW.js";var S={key:0,class:`-mx-5 divide-y border-t`},C={class:`text-xs text-muted-foreground`},w=[`title`],T={key:1,class:`text-sm text-muted-foreground`},E={__name:`EditorialPages`,props:{pages:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(E){let D=p(!1),O={published:{label:`Veröffentlicht`,class:`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`},draft:{label:`Entwurf`,class:`bg-brand-soft text-brand-soft-foreground`},scheduled:{label:`Geplant`,class:`bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-200`},new:{label:`Neu`,class:`bg-muted text-muted-foreground`}};return(p,k)=>(c(),f(b,{title:`Seiten`},{actions:u(()=>[E.canCreate?(c(),f(n(y),{key:0,size:`sm`,variant:`outline`,onClick:k[0]||=e=>D.value=!0},{default:u(()=>[e(n(_)),k[2]||=t(` Neue Seite`,-1)]),_:1})):m(``,!0)]),default:u(()=>[E.pages.length?(c(),a(`ul`,S,[(c(!0),a(l,null,o(E.pages,o=>(c(),a(`li`,{key:o.id,class:`flex items-center gap-3 py-2.5 pr-5`,style:s({paddingLeft:`${1.25+Math.min(o.depth,4)*1.25}rem`})},[i(`div`,{class:r([`min-w-0 flex-1`,o.depth?`border-l pl-3`:``])},[e(n(h),{href:o.edit_url,class:`block truncate text-sm font-medium hover:underline`},{default:u(()=>[t(d(o.title),1)]),_:2},1032,[`href`]),i(`p`,C,[t(d(o.url),1),o.changed_at?(c(),a(l,{key:0},[t(` · `+d(n(v)(o.changed_at)),1)],64)):m(``,!0)])],2),o.locked_by?(c(),a(`span`,{key:0,class:`inline-flex items-center gap-1 text-xs text-muted-foreground`,title:`${o.locked_by} bearbeitet gerade`},[e(n(g),{class:`size-3.5`}),t(` `+d(o.locked_by),1)],8,w)):m(``,!0),i(`span`,{class:r([`shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium`,O[o.status].class])},d(O[o.status].label),3)],4))),128))])):(c(),a(`p`,T,`Sie dürfen noch keine Seiten bearbeiten.`)),e(x,{open:D.value,"onUpdate:open":k[1]||=e=>D.value=e},null,8,[`open`])]),_:1}))}};export{E as default}; \ No newline at end of file diff --git a/public/build/assets/EventListItem-D1yV2ddA.js b/public/build/assets/EventListItem-B744Ks6-.js similarity index 92% rename from public/build/assets/EventListItem-D1yV2ddA.js rename to public/build/assets/EventListItem-B744Ks6-.js index 3d518f82..40805ed9 100644 --- a/public/build/assets/EventListItem-D1yV2ddA.js +++ b/public/build/assets/EventListItem-B744Ks6-.js @@ -1 +1 @@ -import{D as e,On as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as l}from"./app-Bu3kn8yd.js";import{r as u}from"./format-BsuBtvUs.js";import{t as d}from"./EventDateBlock-_E5XlLto.js";var f={class:`min-w-0 pt-0.5`},p={class:`line-clamp-2 text-sm leading-snug font-semibold group-hover:underline`},m={class:`mt-0.5 text-xs text-muted-foreground`},h={key:0,class:`truncate text-xs text-muted-foreground`},g={__name:`EventListItem`,props:{event:{type:Object,required:!0}},setup(g){return(_,v)=>(i(),s(t(l),{href:`/termine/${g.event.id}`,class:`group flex items-start gap-3.5 py-3`},{default:a(()=>[e(d,{date:g.event.starts_at},null,8,[`date`]),n(`div`,f,[n(`h3`,p,o(g.event.title),1),n(`p`,m,o(t(u)(g.event)),1),g.event.location?(i(),r(`p`,h,o(g.event.location),1)):c(``,!0)])]),_:1},8,[`href`]))}};export{g as t}; \ No newline at end of file +import{D as e,On as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as l}from"./app-BNwrc_lv.js";import{r as u}from"./format-BsuBtvUs.js";import{t as d}from"./EventDateBlock-_E5XlLto.js";var f={class:`min-w-0 pt-0.5`},p={class:`line-clamp-2 text-sm leading-snug font-semibold group-hover:underline`},m={class:`mt-0.5 text-xs text-muted-foreground`},h={key:0,class:`truncate text-xs text-muted-foreground`},g={__name:`EventListItem`,props:{event:{type:Object,required:!0}},setup(g){return(_,v)=>(i(),s(t(l),{href:`/termine/${g.event.id}`,class:`group flex items-start gap-3.5 py-3`},{default:a(()=>[e(d,{date:g.event.starts_at},null,8,[`date`]),n(`div`,f,[n(`h3`,p,o(g.event.title),1),n(`p`,m,o(t(u)(g.event)),1),g.event.location?(i(),r(`p`,h,o(g.event.location),1)):c(``,!0)])]),_:1},8,[`href`]))}};export{g as t}; \ No newline at end of file diff --git a/public/build/assets/FileIcon-B6dfvt48.js b/public/build/assets/FileIcon-BctWLKDw.js similarity index 98% rename from public/build/assets/FileIcon-B6dfvt48.js rename to public/build/assets/FileIcon-BctWLKDw.js index 0b8b5535..36d2c4a3 100644 --- a/public/build/assets/FileIcon-B6dfvt48.js +++ b/public/build/assets/FileIcon-BctWLKDw.js @@ -1 +1 @@ -import{Zn as e,b as t,g as n,mt as r,tr as i,v as a,wt as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{k as c}from"./dist-DtGNiYlK.js";import{X as l}from"./AppIcon-0N56IC2z.js";var u=c({name:`file-archive`,size:24,node:[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]}),d=c({name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]}),f=c({name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]}),p=c({name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]}),m=c({name:`presentation`,size:24,node:[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]}),h=[`title`],g={key:0,class:`absolute -bottom-1.5 rounded-[3px] bg-card px-1 text-[9px] leading-tight font-bold tracking-wide text-current ring-1 ring-border`},_={__name:`FileIcon`,props:{extension:{type:String,default:``},size:{type:String,default:`md`}},setup(c){let _=c,v={icon:l},y={icon:f},b={PDF:{...v,class:`bg-red-50 text-red-700 dark:bg-red-950/50 dark:text-red-300`},DOC:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},DOCX:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},ODT:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},RTF:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},TXT:{...v,class:`bg-muted text-muted-foreground`},XLS:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},XLSX:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},CSV:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},ODS:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},PPT:{icon:m,class:`bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300`},PPTX:{icon:m,class:`bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300`},JPG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},JPEG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},PNG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},ZIP:{icon:u,class:`bg-amber-50 text-amber-700 dark:bg-amber-950/50 dark:text-amber-300`}},x=n(()=>b[_.extension?.toUpperCase()]??{icon:p,class:`bg-muted text-muted-foreground`}),S=n(()=>({sm:`size-8 rounded-md`,md:`size-10 rounded-md`,lg:`size-14 rounded-lg`})[_.size]),C=n(()=>({sm:`size-4`,md:`size-5`,lg:`size-7`})[_.size]);return(n,l)=>(r(),t(`span`,{class:e([`relative grid shrink-0 place-items-center`,[S.value,x.value.class]]),title:c.extension||void 0},[(r(),a(o(x.value.icon),{class:e(C.value),"stroke-width":1.75},null,8,[`class`])),c.extension&&c.size!==`sm`?(r(),t(`span`,g,i(c.extension),1)):s(``,!0)],10,h))}};export{_ as t}; \ No newline at end of file +import{Zn as e,b as t,g as n,mt as r,tr as i,v as a,wt as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{k as c}from"./dist-DtGNiYlK.js";import{X as l}from"./AppIcon-nlhvQfK7.js";var u=c({name:`file-archive`,size:24,node:[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]}),d=c({name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]}),f=c({name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]}),p=c({name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]}),m=c({name:`presentation`,size:24,node:[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]}),h=[`title`],g={key:0,class:`absolute -bottom-1.5 rounded-[3px] bg-card px-1 text-[9px] leading-tight font-bold tracking-wide text-current ring-1 ring-border`},_={__name:`FileIcon`,props:{extension:{type:String,default:``},size:{type:String,default:`md`}},setup(c){let _=c,v={icon:l},y={icon:f},b={PDF:{...v,class:`bg-red-50 text-red-700 dark:bg-red-950/50 dark:text-red-300`},DOC:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},DOCX:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},ODT:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},RTF:{...v,class:`bg-sky-50 text-sky-700 dark:bg-sky-950/50 dark:text-sky-300`},TXT:{...v,class:`bg-muted text-muted-foreground`},XLS:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},XLSX:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},CSV:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},ODS:{...y,class:`bg-emerald-50 text-emerald-700 dark:bg-emerald-950/50 dark:text-emerald-300`},PPT:{icon:m,class:`bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300`},PPTX:{icon:m,class:`bg-orange-50 text-orange-700 dark:bg-orange-950/50 dark:text-orange-300`},JPG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},JPEG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},PNG:{icon:d,class:`bg-violet-50 text-violet-700 dark:bg-violet-950/50 dark:text-violet-300`},ZIP:{icon:u,class:`bg-amber-50 text-amber-700 dark:bg-amber-950/50 dark:text-amber-300`}},x=n(()=>b[_.extension?.toUpperCase()]??{icon:p,class:`bg-muted text-muted-foreground`}),S=n(()=>({sm:`size-8 rounded-md`,md:`size-10 rounded-md`,lg:`size-14 rounded-lg`})[_.size]),C=n(()=>({sm:`size-4`,md:`size-5`,lg:`size-7`})[_.size]);return(n,l)=>(r(),t(`span`,{class:e([`relative grid shrink-0 place-items-center`,[S.value,x.value.class]]),title:c.extension||void 0},[(r(),a(o(x.value.icon),{class:e(C.value),"stroke-width":1.75},null,8,[`class`])),c.extension&&c.size!==`sm`?(r(),t(`span`,g,i(c.extension),1)):s(``,!0)],10,h))}};export{_ as t}; \ No newline at end of file diff --git a/public/build/assets/Folder-Bi6XxhES.js b/public/build/assets/Folder-Bi6XxhES.js deleted file mode 100644 index 4afd80b1..00000000 --- a/public/build/assets/Folder-Bi6XxhES.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as e,D as t,E as n,Ft as r,Ht as i,On as a,Yt as o,Zn as s,_ as c,b as l,bt as u,er as d,g as f,mt as p,o as m,qt as h,tr as g,v as _,vn as v,wt as y,y as b}from"./runtime-core.esm-bundler-B8D2lM98.js";import{_ as x,w as S}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as C,i as w,o as T,r as E}from"./app-Bu3kn8yd.js";import{O as D,k as O}from"./dist-DtGNiYlK.js";import{$ as k,D as A,X as ee,a as j,c as te,i as ne,o as M,s as re}from"./AppIcon-0N56IC2z.js";import{t as ie}from"./AppLayout-BxsYt2ib.js";import{_ as ae,o as oe,t as se}from"./http-DmyDwIce.js";import{t as N}from"./download-UAAY3N2F.js";import{t as ce}from"./ellipsis-vertical-B9wuHo-w.js";import{n as P,r as F,t as I}from"./format-uZU1H-69.js";import{t as le}from"./FileIcon-B6dfvt48.js";import{t as ue}from"./file-plus-corner-Z8xo1q-K.js";import{i as L,n as R,r as z,t as B}from"./FolderTile-_J6uRwiD.js";import{t as V}from"./link-2-DbrWevIe.js";import{t as H}from"./paperclip-DmVAQ5Y5.js";import{t as U}from"./pencil-line-CmAbFj4f.js";import{t as de}from"./trash-DUqnVIgb.js";import{t as W}from"./DialogDescription-BxaIqmag.js";import{t as G}from"./FormField-BoFAO4pm.js";import{t as fe}from"./EmptyState-Ceq4v8mE.js";import{t as pe}from"./PageHeader-Ybe7qDu5.js";import{t as K}from"./button-ZHC5mKey.js";import{t as me}from"./NativeSelect-BGasRaNs.js";import{t as q}from"./Input-FGSb2-yK.js";import{t as he}from"./Skeleton-fJgmuUSB.js";import{i as J,n as ge,r as Y,t as X}from"./dialog-uBUhf8w7.js";import{t as Z}from"./DialogHeader-DuqiL3ry.js";import{t as _e}from"./colors-RDOJqd57.js";import{t as ve}from"./QmSearchBox-Ri1YCTQc.js";var ye=O({name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]}),be=O({name:`file-up`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]}),xe=O({name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]}),Se=O({name:`scan-text`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}]]}),Ce={key:0,class:`grid gap-2`,"aria-busy":`true`},we={key:1,class:`-mx-2 divide-y`},Te={class:`min-w-0 flex-1`},Ee={class:`truncate text-sm`},De={key:0,class:`ml-1 text-[11px] text-muted-foreground`},Oe={class:`text-xs text-muted-foreground`},ke=[`href`],Ae={__name:`ArchiveDialog`,props:{open:{type:Boolean,default:!1},entry:{type:Object,default:null}},emits:[`update:open`],setup(e){let r=e,o=v(null);return i(()=>r.open,async e=>{e&&r.entry&&(o.value=null,o.value=(await se.get(`/qm/eintraege/${r.entry.id}/archiv`)).files)}),(r,i)=>(p(),_(a(J),{open:e.open,"onUpdate:open":i[0]||=e=>r.$emit(`update:open`,e)},{default:h(()=>[t(a(Y),{class:`sm:max-w-2xl`},{default:h(()=>[t(a(Z),null,{default:h(()=>[t(a(X),null,{default:h(()=>[...i[1]||=[n(`Fassungen`,-1)]]),_:1}),t(a(W),null,{default:h(()=>[n(g(e.entry?.title)+` – frühere Fassungen sieht nur das QM-Team.`,1)]),_:1})]),_:1}),o.value?(p(),l(`ul`,we,[(p(!0),l(m,null,u(o.value,e=>(p(),l(`li`,{key:e.id,class:`flex items-center gap-3 px-2 py-2.5`},[c(`div`,Te,[c(`p`,Ee,[n(g(e.name)+` `,1),c(`span`,{class:s([`ml-1 rounded px-1.5 py-0.5 text-[11px]`,e.archived?`bg-muted text-muted-foreground`:`bg-brand-soft text-brand-soft-foreground`])},g(e.archived?`Archiv`:`aktuell`),3),e.kind===`editable`?(p(),l(`span`,De,`Vorlage`)):b(``,!0)]),c(`p`,Oe,[n(` Version `+g(e.version||`–`)+` · Stand `+g(a(P)(e.valid_from))+` · `+g(a(I)(e.size)),1),e.uploader?(p(),l(m,{key:0},[n(` · `+g(e.uploader),1)],64)):b(``,!0)])]),t(a(K),{variant:`ghost`,size:`icon`,"as-child":``,title:`${e.name} herunterladen`},{default:h(()=>[c(`a`,{href:e.url},[t(a(N))],8,ke)]),_:2},1032,[`title`])]))),128))])):(p(),l(`div`,Ce,[(p(),l(m,null,u(3,e=>t(a(he),{key:e,class:`h-10`})),64))]))]),_:1})]),_:1},8,[`open`]))}},je={class:`flex min-w-0 items-center gap-2`},Me=[`id`,`accept`],Ne={key:0,class:`flex min-w-0 items-center gap-1 text-[13px]`},Pe={class:`truncate`},Fe={key:1,class:`text-[13px] text-muted-foreground`},Q={__name:`FilePick`,props:e({id:{type:String,required:!0},accept:{type:String,default:``}},{modelValue:{type:[Object,null],default:null},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let i=r(e,`modelValue`),o=v(null);function s(e){i.value=e.target.files[0]??null}function u(){i.value=null,o.value&&(o.value.value=``)}return(r,d)=>(p(),l(`div`,je,[c(`input`,{id:e.id,ref_key:`input`,ref:o,type:`file`,class:`sr-only`,accept:e.accept,onChange:s},null,40,Me),t(a(K),{type:`button`,variant:`outline`,size:`sm`,onClick:d[0]||=e=>o.value?.click()},{default:h(()=>[t(a(H)),d[1]||=n(` Datei auswählen`,-1)]),_:1}),i.value?(p(),l(`span`,Ne,[c(`span`,Pe,g(i.value.name),1),c(`button`,{type:`button`,class:`grid size-6 shrink-0 place-items-center rounded text-muted-foreground hover:bg-accent`,"aria-label":`Auswahl entfernen`,onClick:u},[t(a(ae),{class:`size-3.5`})])])):(p(),l(`span`,Fe,`Keine Datei ausgewählt`))]))}},Ie={key:0,class:`grid grid-cols-3 gap-2`,role:`radiogroup`,"aria-label":`Art des Eintrags`},Le=[`aria-checked`,`onClick`],Re={class:`grid gap-4 sm:grid-cols-2`},ze={key:0,class:`flex items-center gap-2 text-[13px]`},Be={class:`text-xs text-muted-foreground`},Ve={key:4,class:`h-1 overflow-hidden rounded-full bg-muted`},He={__name:`EntryDialog`,props:{open:{type:Boolean,default:!1},mode:{type:String,default:`create`},entry:{type:Object,default:null},folderId:{type:Number,required:!0},forms:{type:Array,default:()=>[]},maxUploadMb:{type:Number,default:20}},emits:[`update:open`],setup(e,{emit:r}){let v=e,C=r,T=()=>new Date().toISOString().slice(0,10),E=w({type:`file`,title:``,description:``,version:``,valid_from:T(),url:``,form_id:null,reading:null,editable:null,remove_editable:!1});i(()=>v.open,e=>{if(!e)return;E.clearErrors();let t=v.entry;E.defaults({type:t?.type??`file`,title:t?.title??``,description:t?.description??``,version:t?.version??``,valid_from:v.mode===`version`?T():t?.valid_from??T(),url:t?.url??``,form_id:t?.form_id??null,reading:null,editable:null,remove_editable:!1}),E.reset()});let O=[{value:`file`,label:`Datei`,icon:ee},{value:`link`,label:`Link`,icon:V},{value:`form`,label:`Online-Formular`,icon:k}],A=f(()=>({create:`Eintrag hinzufügen`,edit:`Eintrag bearbeiten`,version:`Neue Fassung hochladen`})[v.mode]);function j(){let e=v.mode===`create`?`/qm/ordner/${v.folderId}/eintraege`:`/qm/eintraege/${v.entry.id}`;E.post(e,{forceFormData:!0,preserveScroll:!0,onSuccess:()=>C(`update:open`,!1)})}return(r,i)=>(p(),_(a(J),{open:e.open,"onUpdate:open":i[10]||=e=>C(`update:open`,e)},{default:h(()=>[t(a(Y),{class:`sm:max-w-xl`},{default:h(()=>[t(a(Z),null,{default:h(()=>[t(a(X),null,{default:h(()=>[n(g(A.value),1)]),_:1}),e.mode===`version`?(p(),_(a(W),{key:0},{default:h(()=>[n(`„`+g(e.entry?.title)+`“ – die bisherige Fassung kommt ins Archiv und bleibt für das QM-Team abrufbar.`,1)]),_:1})):b(``,!0)]),_:1}),c(`form`,{class:`grid gap-4`,onSubmit:S(j,[`prevent`])},[e.mode===`create`?(p(),l(`div`,Ie,[(p(),l(m,null,u(O,e=>c(`button`,{key:e.value,type:`button`,role:`radio`,"aria-checked":a(E).type===e.value,class:s([`flex items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm`,a(E).type===e.value?`border-brand-400 bg-brand-soft font-medium text-brand-soft-foreground`:`hover:bg-accent`]),onClick:t=>a(E).type=e.value},[(p(),_(y(e.icon),{class:`size-4`})),n(` `+g(e.label),1)],10,Le)),64))])):b(``,!0),t(G,{id:`qm-title`,label:`Titel`,error:a(E).errors.title},{default:h(()=>[t(a(q),{id:`qm-title`,modelValue:a(E).title,"onUpdate:modelValue":i[0]||=e=>a(E).title=e,maxlength:`250`,placeholder:`z. B. Urlaubsantrag`},null,8,[`modelValue`])]),_:1},8,[`error`]),c(`div`,Re,[t(G,{id:`qm-version`,label:`Version`,error:a(E).errors.version},{default:h(()=>[t(a(q),{id:`qm-version`,modelValue:a(E).version,"onUpdate:modelValue":i[1]||=e=>a(E).version=e,maxlength:`30`,placeholder:`z. B. 2.1`},null,8,[`modelValue`])]),_:1},8,[`error`]),t(G,{id:`qm-valid`,label:`Stand (gültig ab)`,error:a(E).errors.valid_from},{default:h(()=>[t(a(q),{id:`qm-valid`,modelValue:a(E).valid_from,"onUpdate:modelValue":i[2]||=e=>a(E).valid_from=e,type:`date`},null,8,[`modelValue`])]),_:1},8,[`error`])]),t(G,{id:`qm-description`,label:`Beschreibung (optional)`,error:a(E).errors.description},{default:h(()=>[t(a(q),{id:`qm-description`,modelValue:a(E).description,"onUpdate:modelValue":i[3]||=e=>a(E).description=e,maxlength:`1000`},null,8,[`modelValue`])]),_:1},8,[`error`]),a(E).type===`file`?(p(),l(m,{key:1},[t(G,{id:`qm-reading`,label:e.mode===`edit`?`Datei ersetzen (optional – neue Fassung)`:`Datei (PDF empfohlen – öffnet sich direkt zum Lesen)`,error:a(E).errors.reading},{default:h(()=>[t(Q,{id:`qm-reading`,modelValue:a(E).reading,"onUpdate:modelValue":i[4]||=e=>a(E).reading=e,accept:`.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.odt,.ods,.odp,.rtf,.txt,.csv,.png,.jpg,.jpeg,.gif,.webp,.zip`},null,8,[`modelValue`])]),_:1},8,[`label`,`error`]),t(G,{id:`qm-editable`,label:`Bearbeitbare Vorlage (optional, z. B. Word oder Excel zum Ausfüllen)`,error:a(E).errors.editable},{default:h(()=>[t(Q,{id:`qm-editable`,modelValue:a(E).editable,"onUpdate:modelValue":i[5]||=e=>a(E).editable=e,accept:`.doc,.docx,.xls,.xlsx,.ppt,.pptx,.odt,.ods,.odp,.rtf,.txt,.csv,.pdf,.zip`},null,8,[`modelValue`])]),_:1},8,[`error`]),e.mode!==`create`&&e.entry?.editable&&!a(E).editable?(p(),l(`label`,ze,[o(c(`input`,{"onUpdate:modelValue":i[6]||=e=>a(E).remove_editable=e,type:`checkbox`},null,512),[[x,a(E).remove_editable]]),n(` Bisherige Vorlage „`+g(e.entry.editable.name)+`“ entfernen `,1)])):b(``,!0),c(`p`,Be,`Bis `+g(e.maxUploadMb)+` MB je Datei. Der Inhalt wird für die Suche erfasst.`,1)],64)):b(``,!0),a(E).type===`link`?(p(),_(G,{key:2,id:`qm-url`,label:`Adresse`,error:a(E).errors.url},{default:h(()=>[t(a(q),{id:`qm-url`,modelValue:a(E).url,"onUpdate:modelValue":i[7]||=e=>a(E).url=e,placeholder:`https://… oder /seiten/…`},null,8,[`modelValue`])]),_:1},8,[`error`])):b(``,!0),a(E).type===`form`?(p(),_(G,{key:3,id:`qm-form`,label:`Formular`,error:a(E).errors.form_id},{default:h(()=>[t(me,{id:`qm-form`,modelValue:a(E).form_id,"onUpdate:modelValue":i[8]||=e=>a(E).form_id=e,options:[{value:null,label:`Bitte wählen …`},...e.forms]},null,8,[`modelValue`,`options`])]),_:1},8,[`error`])):b(``,!0),t(a(ge),null,{default:h(()=>[t(a(K),{type:`button`,variant:`outline`,onClick:i[9]||=e=>C(`update:open`,!1)},{default:h(()=>[...i[11]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(K),{type:`submit`,disabled:a(E).processing||e.mode===`version`&&!a(E).reading&&!a(E).editable},{default:h(()=>[a(E).processing?(p(),_(a(D),{key:0,class:`animate-spin`})):b(``,!0),i[12]||=n(` Speichern `,-1)]),_:1},8,[`disabled`])]),_:1}),a(E).progress?(p(),l(`div`,Ve,[c(`div`,{class:`h-full bg-brand`,style:d({width:`${a(E).progress.percentage}%`})},null,4)])):b(``,!0)],32)]),_:1})]),_:1},8,[`open`]))}},Ue={class:`overflow-hidden rounded-lg border bg-card`},We={class:`divide-y`},Ge={class:`flex min-w-0 items-center gap-3`},Ke={key:1,class:`grid size-8 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground`},qe={class:`min-w-0`},Je={key:1,class:`block truncate text-sm font-medium`},Ye={key:2,class:`truncate text-xs text-muted-foreground`},Xe={class:`flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground`},Ze={class:`md:hidden`},Qe=[`href`,`title`],$e={key:1,class:`inline-flex items-center gap-1 text-amber-700 dark:text-amber-400`,title:`Eingescanntes PDF – Inhalt erst nach Texterkennung durchsuchbar`},et={class:`hidden text-[13px] md:block`},tt={class:`hidden text-[13px] tabular-nums md:block`},nt={class:`hidden text-right text-[13px] text-muted-foreground tabular-nums md:block`},rt={class:`flex items-center justify-end gap-1`},it=[`href`,`aria-label`],at={key:2,class:`hidden size-8 md:block`,"aria-hidden":`true`},ot={__name:`EntryTable`,props:{entries:{type:Array,required:!0},canManage:{type:Boolean,default:!1}},emits:[`edit`,`new-version`,`archive`,`remove`],setup(e){let r={view:`Lesen`,download:`Herunterladen`,link:`Öffnen`,form:`Ausfüllen`},i=e=>e.open_kind===`link`||e.open_kind===`download`;return(o,d)=>(p(),l(`div`,Ue,[c(`div`,{class:s([`hidden grid-cols-[minmax(0,1fr)_6rem_7rem_6rem_9.5rem] items-center gap-4 border-b bg-muted/40 px-4 py-2 text-xs font-medium text-muted-foreground md:grid`,{"md:grid-cols-[minmax(0,1fr)_6rem_7rem_6rem_11.5rem]":e.canManage}])},[...d[0]||=[c(`span`,null,`Dokument`,-1),c(`span`,null,`Version`,-1),c(`span`,null,`Stand`,-1),c(`span`,{class:`text-right`},`Größe`,-1),c(`span`,{class:`sr-only`},`Aktion`,-1)]],2),c(`ul`,We,[(p(!0),l(m,null,u(e.entries,u=>(p(),l(`li`,{key:u.id,class:s([`grid items-center gap-x-4 gap-y-1 px-4 py-2.5 hover:bg-accent/50 md:grid-cols-[minmax(0,1fr)_6rem_7rem_6rem_9.5rem]`,{"md:grid-cols-[minmax(0,1fr)_6rem_7rem_6rem_11.5rem]":e.canManage}])},[c(`div`,Ge,[u.type===`file`?(p(),_(le,{key:0,extension:u.extension,size:`sm`},null,8,[`extension`])):(p(),l(`span`,Ke,[u.type===`form`?(p(),_(a(k),{key:0,class:`size-4`})):(p(),_(a(F),{key:1,class:`size-4`}))])),c(`div`,qe,[u.open_url?(p(),_(y(i(u)?`a`:a(E)),{key:0,href:u.open_url,target:u.open_kind===`link`?`_blank`:void 0,rel:u.open_kind===`link`?`noopener`:void 0,class:`block truncate text-sm font-medium hover:underline`},{default:h(()=>[n(g(u.title),1)]),_:2},1032,[`href`,`target`,`rel`])):(p(),l(`span`,Je,g(u.title),1)),u.description?(p(),l(`p`,Ye,g(u.description),1)):b(``,!0),c(`p`,Xe,[c(`span`,Ze,g(u.version?`Version ${u.version} · `:``)+`Stand `+g(a(P)(u.valid_from)),1),u.editable?(p(),l(`a`,{key:0,href:u.editable.url,class:`inline-flex items-center gap-1 text-brand-text hover:underline`,title:u.editable.name},[t(a(N),{class:`size-3`}),n(` Vorlage (`+g(u.editable.extension)+`) `,1)],8,Qe)):b(``,!0),e.canManage&&u.text_status===`needs_ocr`?(p(),l(`span`,$e,[t(a(Se),{class:`size-3`}),d[1]||=n(` Scan, Inhalt nicht durchsuchbar `,-1)])):b(``,!0)])])]),c(`span`,et,g(u.version||`–`),1),c(`span`,tt,g(a(P)(u.valid_from)),1),c(`span`,nt,g(u.type===`file`?a(I)(u.size):`–`),1),c(`div`,rt,[u.open_url?(p(),_(a(K),{key:0,size:`sm`,variant:`outline`,class:`h-8 min-w-28`,"as-child":``},{default:h(()=>[(p(),_(y(i(u)?`a`:a(E)),{href:u.open_url,target:u.open_kind===`link`?`_blank`:void 0,rel:u.open_kind===`link`?`noopener`:void 0},{default:h(()=>[u.open_kind===`link`?(p(),_(a(F),{key:0})):u.open_kind===`form`?(p(),_(a(k),{key:1})):u.open_kind===`download`?(p(),_(a(N),{key:2})):b(``,!0),n(` `+g(r[u.open_kind]),1)]),_:2},1032,[`href`,`target`,`rel`]))]),_:2},1024)):b(``,!0),u.open_kind===`view`&&u.download_url?(p(),_(a(K),{key:1,size:`icon`,variant:`ghost`,class:`size-8 text-muted-foreground`,"as-child":``,title:`${u.title} herunterladen`},{default:h(()=>[c(`a`,{href:u.download_url,"aria-label":`${u.title} herunterladen`},[t(a(N))],8,it)]),_:2},1032,[`title`])):(p(),l(`span`,at)),e.canManage?(p(),_(a(te),{key:3},{default:h(()=>[t(a(ne),{"as-child":``},{default:h(()=>[t(a(K),{variant:`ghost`,size:`icon`,class:`size-8 text-muted-foreground`,"aria-label":`Aktionen für ${u.title}`},{default:h(()=>[t(a(ce))]),_:1},8,[`aria-label`])]),_:2},1024),t(a(re),{align:`end`,class:`w-56`},{default:h(()=>[t(a(M),{onSelect:e=>o.$emit(`edit`,u)},{default:h(()=>[t(a(U)),d[2]||=n(` Bearbeiten`,-1)]),_:1},8,[`onSelect`]),u.type===`file`?(p(),_(a(M),{key:0,onSelect:e=>o.$emit(`new-version`,u)},{default:h(()=>[t(a(be)),d[3]||=n(` Neue Fassung hochladen`,-1)]),_:1},8,[`onSelect`])):b(``,!0),u.type===`file`?(p(),_(a(M),{key:1,onSelect:e=>o.$emit(`archive`,u)},{default:h(()=>[t(a(ye)),d[4]||=n(` Archiv (frühere Fassungen)`,-1)]),_:1},8,[`onSelect`])):b(``,!0),t(a(j)),t(a(M),{class:`text-destructive`,onSelect:e=>o.$emit(`remove`,u)},{default:h(()=>[t(a(de)),d[5]||=n(` Löschen`,-1)]),_:1},8,[`onSelect`])]),_:2},1024)]),_:2},1024)):b(``,!0)])],2))),128))])]))}},st=[`href`],ct={class:`grid min-w-0 gap-6`},lt={key:0,class:`relative overflow-hidden rounded-lg border bg-card p-5 pl-6`},ut=[`innerHTML`],dt={key:1},ft={class:`grid grid-cols-[repeat(auto-fill,minmax(11.5rem,1fr))] gap-3`},$={class:`mb-3 flex items-center justify-between gap-3`},pt={class:`text-sm font-semibold text-muted-foreground`},mt={key:0,class:`font-normal`},ht={key:1,class:`rounded-lg border border-dashed bg-card`},gt={key:0,class:`rounded-lg border bg-card`},_t={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},vt={class:`grid gap-4 p-4`},yt={__name:`Folder`,props:{folder:{type:Object,required:!0},breadcrumbs:{type:Array,default:()=>[]},children:{type:Array,default:()=>[]},entries:{type:Array,default:()=>[]},canManage:{type:Boolean,default:!1},forms:{type:Array,default:()=>[]},maxUploadMb:{type:Number,default:20},adminUrl:{type:String,default:null}},setup(e){let r=e,o=C();i(()=>o.props.flash.status,e=>e&&oe.success(e),{immediate:!0});let d=f(()=>_e(r.folder.color)),y=f(()=>[{label:`Qualitätsmanagement`,href:`/qm`},...r.breadcrumbs.map(e=>({label:e.name,href:`/qm/ordner/${e.id}`}))]),x=f(()=>r.folder.contacts.length>0),S=v({open:!1,mode:`create`,entry:null}),w=v({open:!1,entry:null}),E=(e,t=null)=>S.value={open:!0,mode:e,entry:t};function D(e){window.confirm(`„${e.title}“ mit allen Fassungen löschen?`)&&T.delete(`/qm/eintraege/${e.id}`,{preserveScroll:!0})}return(r,i)=>(p(),_(ie,{title:e.folder.name},{default:h(()=>[t(pe,{title:e.folder.name,breadcrumbs:y.value},{leading:h(()=>[c(`span`,{class:s([`grid size-12 shrink-0 place-items-center rounded-lg text-white shadow-xs`,d.value.tile])},[t(R,{icon:e.folder.icon,class:`size-6`},null,8,[`icon`])],2)]),actions:h(()=>[e.adminUrl?(p(),_(a(K),{key:0,variant:`outline`,class:`h-10`,"as-child":``},{default:h(()=>[c(`a`,{href:e.adminUrl},[t(a(L)),i[6]||=n(` Ordner bearbeiten`,-1)],8,st)]),_:1})):b(``,!0),t(ve)]),_:1},8,[`title`,`breadcrumbs`]),c(`div`,{class:s([`grid items-start gap-6`,{"lg:grid-cols-[minmax(0,1fr)_20rem]":x.value}])},[c(`div`,ct,[e.folder.intro?(p(),l(`section`,lt,[c(`span`,{class:s([`absolute inset-y-0 left-0 w-1.5`,d.value.tile]),"aria-hidden":`true`},null,2),c(`div`,{class:`prose prose-sm max-w-none dark:prose-invert`,innerHTML:e.folder.intro},null,8,ut)])):b(``,!0),e.children.length?(p(),l(`section`,dt,[i[7]||=c(`h2`,{class:`mb-3 text-sm font-semibold text-muted-foreground`},`Unterordner`,-1),c(`div`,ft,[(p(!0),l(m,null,u(e.children,e=>(p(),_(B,{key:e.id,folder:e,small:``},null,8,[`folder`]))),128))])])):b(``,!0),c(`section`,null,[c(`div`,$,[c(`h2`,pt,[i[8]||=n(`Dokumente `,-1),e.entries.length?(p(),l(`span`,mt,`(`+g(e.entries.length)+`)`,1)):b(``,!0)]),e.canManage?(p(),_(a(K),{key:0,size:`sm`,onClick:i[0]||=e=>E(`create`)},{default:h(()=>[t(a(ue)),i[9]||=n(` Eintrag hinzufügen`,-1)]),_:1})):b(``,!0)]),e.entries.length?(p(),_(ot,{key:0,entries:e.entries,"can-manage":e.canManage,onEdit:i[1]||=e=>E(`edit`,e),onNewVersion:i[2]||=e=>E(`version`,e),onArchive:i[3]||=e=>w.value={open:!0,entry:e},onRemove:D},null,8,[`entries`,`can-manage`])):(p(),l(`div`,ht,[t(fe,{icon:a(xe),title:`Noch keine Dokumente`,text:e.canManage?`Mit „Eintrag hinzufügen“ Dateien, Links oder Formulare ergänzen.`:``},null,8,[`icon`,`text`])]))])]),x.value?(p(),l(`aside`,gt,[c(`h2`,_t,[t(a(A),{class:s([`size-4`,d.value.text])},null,8,[`class`]),n(` `+g(e.folder.contacts.length===1?`Ansprechpartner*in`:`Ansprechpartner*innen`),1)]),c(`div`,vt,[(p(!0),l(m,null,u(e.folder.contacts,e=>(p(),_(z,{key:e.id,contact:e},null,8,[`contact`]))),128))])])):b(``,!0)],2),e.canManage?(p(),_(He,{key:0,open:S.value.open,"onUpdate:open":i[4]||=e=>S.value.open=e,mode:S.value.mode,entry:S.value.entry,"folder-id":e.folder.id,forms:e.forms,"max-upload-mb":e.maxUploadMb},null,8,[`open`,`mode`,`entry`,`folder-id`,`forms`,`max-upload-mb`])):b(``,!0),e.canManage?(p(),_(Ae,{key:1,open:w.value.open,"onUpdate:open":i[5]||=e=>w.value.open=e,entry:w.value.entry},null,8,[`open`,`entry`])):b(``,!0)]),_:1},8,[`title`]))}};export{yt as default}; \ No newline at end of file diff --git a/public/build/assets/Folder-DhP4Kqlb.js b/public/build/assets/Folder-DhP4Kqlb.js new file mode 100644 index 00000000..f85a9e80 --- /dev/null +++ b/public/build/assets/Folder-DhP4Kqlb.js @@ -0,0 +1 @@ +import{$ as e,D as t,E as n,Ft as r,Ht as i,On as a,Yt as o,Zn as s,_ as c,b as l,bt as u,er as d,g as f,mt as p,o as m,qt as h,tr as g,v as _,vn as v,wt as y,y as b}from"./runtime-core.esm-bundler-B8D2lM98.js";import{_ as x,w as S}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as C,i as w,o as T,r as E}from"./app-BNwrc_lv.js";import{O as D,k as O}from"./dist-DtGNiYlK.js";import{$ as k,D as A,X as j,a as M,c as ee,i as te,o as N,s as ne}from"./AppIcon-nlhvQfK7.js";import{t as re}from"./AppLayout-esQiy2nD.js";import{n as ie,s as ae,v as oe}from"./http-CAG9BrJF.js";import{t as P}from"./download-UAAY3N2F.js";import{t as se}from"./ellipsis-vertical-B9wuHo-w.js";import{t as F}from"./external-link-8-VtmLK9.js";import{t as ce}from"./FileIcon-BctWLKDw.js";import{t as le}from"./file-plus-corner-Z8xo1q-K.js";import{i as ue,n as de,r as I,t as L}from"./FolderTile-B1Q0k_YL.js";import{t as R}from"./link-2-DbrWevIe.js";import{t as z}from"./paperclip-DmVAQ5Y5.js";import{t as B}from"./pencil-line-CmAbFj4f.js";import{t as V}from"./trash-DUqnVIgb.js";import{t as H}from"./FormField-BoFAO4pm.js";import{t as fe}from"./EmptyState-Ceq4v8mE.js";import{t as pe}from"./PageHeader-BMzzCXfT.js";import{n as U}from"./button-CwUSbS9X.js";import{t as me}from"./NativeSelect-G3km7PmI.js";import{t as W}from"./Input-FGSb2-yK.js";import{t as he}from"./Skeleton-fJgmuUSB.js";import{i as G,n as ge,r as K,t as q}from"./dialog-RK2mTeqi.js";import{t as J}from"./DialogDescription-CaB-9xpp.js";import{t as Y}from"./DialogHeader-DuqiL3ry.js";import{t as _e}from"./colors-RDOJqd57.js";import{n as X,t as Z}from"./format-20VMi8w8.js";import{t as ve}from"./QmSearchBox-BW950raa.js";var ye=O({name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]}),be=O({name:`file-up`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]}),xe=O({name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]}),Se=O({name:`scan-text`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`path`,{d:`M7 8h8`,key:`1jbsf9`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`path`,{d:`M7 16h6`,key:`1vyc9m`}]]}),Ce={key:0,class:`grid gap-2`,"aria-busy":`true`},we={key:1,class:`-mx-2 divide-y`},Te={class:`min-w-0 flex-1`},Ee={class:`truncate text-sm`},De={key:0,class:`ml-1 text-[11px] text-muted-foreground`},Oe={class:`text-xs text-muted-foreground`},ke=[`href`],Ae={__name:`ArchiveDialog`,props:{open:{type:Boolean,default:!1},entry:{type:Object,default:null}},emits:[`update:open`],setup(e){let r=e,o=v(null);return i(()=>r.open,async e=>{e&&r.entry&&(o.value=null,o.value=(await ie.get(`/qm/eintraege/${r.entry.id}/archiv`)).files)}),(r,i)=>(p(),_(a(G),{open:e.open,"onUpdate:open":i[0]||=e=>r.$emit(`update:open`,e)},{default:h(()=>[t(a(K),{class:`sm:max-w-2xl`},{default:h(()=>[t(a(Y),null,{default:h(()=>[t(a(q),null,{default:h(()=>[...i[1]||=[n(`Fassungen`,-1)]]),_:1}),t(a(J),null,{default:h(()=>[n(g(e.entry?.title)+` – frühere Fassungen sieht nur das QM-Team.`,1)]),_:1})]),_:1}),o.value?(p(),l(`ul`,we,[(p(!0),l(m,null,u(o.value,e=>(p(),l(`li`,{key:e.id,class:`flex items-center gap-3 px-2 py-2.5`},[c(`div`,Te,[c(`p`,Ee,[n(g(e.name)+` `,1),c(`span`,{class:s([`ml-1 rounded px-1.5 py-0.5 text-[11px]`,e.archived?`bg-muted text-muted-foreground`:`bg-brand-soft text-brand-soft-foreground`])},g(e.archived?`Archiv`:`aktuell`),3),e.kind===`editable`?(p(),l(`span`,De,`Vorlage`)):b(``,!0)]),c(`p`,Oe,[n(` Version `+g(e.version||`–`)+` · Stand `+g(a(X)(e.valid_from))+` · `+g(a(Z)(e.size)),1),e.uploader?(p(),l(m,{key:0},[n(` · `+g(e.uploader),1)],64)):b(``,!0)])]),t(a(U),{variant:`ghost`,size:`icon`,"as-child":``,title:`${e.name} herunterladen`},{default:h(()=>[c(`a`,{href:e.url},[t(a(P))],8,ke)]),_:2},1032,[`title`])]))),128))])):(p(),l(`div`,Ce,[(p(),l(m,null,u(3,e=>t(a(he),{key:e,class:`h-10`})),64))]))]),_:1})]),_:1},8,[`open`]))}},je={class:`flex min-w-0 items-center gap-2`},Me=[`id`,`accept`],Ne={key:0,class:`flex min-w-0 items-center gap-1 text-[13px]`},Pe={class:`truncate`},Fe={key:1,class:`text-[13px] text-muted-foreground`},Q={__name:`FilePick`,props:e({id:{type:String,required:!0},accept:{type:String,default:``}},{modelValue:{type:[Object,null],default:null},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let i=r(e,`modelValue`),o=v(null);function s(e){i.value=e.target.files[0]??null}function u(){i.value=null,o.value&&(o.value.value=``)}return(r,d)=>(p(),l(`div`,je,[c(`input`,{id:e.id,ref_key:`input`,ref:o,type:`file`,class:`sr-only`,accept:e.accept,onChange:s},null,40,Me),t(a(U),{type:`button`,variant:`outline`,size:`sm`,onClick:d[0]||=e=>o.value?.click()},{default:h(()=>[t(a(z)),d[1]||=n(` Datei auswählen`,-1)]),_:1}),i.value?(p(),l(`span`,Ne,[c(`span`,Pe,g(i.value.name),1),c(`button`,{type:`button`,class:`grid size-6 shrink-0 place-items-center rounded text-muted-foreground hover:bg-accent`,"aria-label":`Auswahl entfernen`,onClick:u},[t(a(oe),{class:`size-3.5`})])])):(p(),l(`span`,Fe,`Keine Datei ausgewählt`))]))}},Ie={key:0,class:`grid grid-cols-3 gap-2`,role:`radiogroup`,"aria-label":`Art des Eintrags`},Le=[`aria-checked`,`onClick`],Re={class:`grid gap-4 sm:grid-cols-2`},ze={key:0,class:`flex items-center gap-2 text-[13px]`},Be={class:`text-xs text-muted-foreground`},Ve={key:4,class:`h-1 overflow-hidden rounded-full bg-muted`},He={__name:`EntryDialog`,props:{open:{type:Boolean,default:!1},mode:{type:String,default:`create`},entry:{type:Object,default:null},folderId:{type:Number,required:!0},forms:{type:Array,default:()=>[]},maxUploadMb:{type:Number,default:20}},emits:[`update:open`],setup(e,{emit:r}){let v=e,C=r,T=()=>new Date().toISOString().slice(0,10),E=w({type:`file`,title:``,description:``,version:``,valid_from:T(),url:``,form_id:null,reading:null,editable:null,remove_editable:!1});i(()=>v.open,e=>{if(!e)return;E.clearErrors();let t=v.entry;E.defaults({type:t?.type??`file`,title:t?.title??``,description:t?.description??``,version:t?.version??``,valid_from:v.mode===`version`?T():t?.valid_from??T(),url:t?.url??``,form_id:t?.form_id??null,reading:null,editable:null,remove_editable:!1}),E.reset()});let O=[{value:`file`,label:`Datei`,icon:j},{value:`link`,label:`Link`,icon:R},{value:`form`,label:`Online-Formular`,icon:k}],A=f(()=>({create:`Eintrag hinzufügen`,edit:`Eintrag bearbeiten`,version:`Neue Fassung hochladen`})[v.mode]);function M(){let e=v.mode===`create`?`/qm/ordner/${v.folderId}/eintraege`:`/qm/eintraege/${v.entry.id}`;E.post(e,{forceFormData:!0,preserveScroll:!0,onSuccess:()=>C(`update:open`,!1)})}return(r,i)=>(p(),_(a(G),{open:e.open,"onUpdate:open":i[10]||=e=>C(`update:open`,e)},{default:h(()=>[t(a(K),{class:`sm:max-w-xl`},{default:h(()=>[t(a(Y),null,{default:h(()=>[t(a(q),null,{default:h(()=>[n(g(A.value),1)]),_:1}),e.mode===`version`?(p(),_(a(J),{key:0},{default:h(()=>[n(`„`+g(e.entry?.title)+`“ – die bisherige Fassung kommt ins Archiv und bleibt für das QM-Team abrufbar.`,1)]),_:1})):b(``,!0)]),_:1}),c(`form`,{class:`grid gap-4`,onSubmit:S(M,[`prevent`])},[e.mode===`create`?(p(),l(`div`,Ie,[(p(),l(m,null,u(O,e=>c(`button`,{key:e.value,type:`button`,role:`radio`,"aria-checked":a(E).type===e.value,class:s([`flex items-center justify-center gap-2 rounded-md border px-3 py-2 text-sm`,a(E).type===e.value?`border-brand-400 bg-brand-soft font-medium text-brand-soft-foreground`:`hover:bg-accent`]),onClick:t=>a(E).type=e.value},[(p(),_(y(e.icon),{class:`size-4`})),n(` `+g(e.label),1)],10,Le)),64))])):b(``,!0),t(H,{id:`qm-title`,label:`Titel`,error:a(E).errors.title},{default:h(()=>[t(a(W),{id:`qm-title`,modelValue:a(E).title,"onUpdate:modelValue":i[0]||=e=>a(E).title=e,maxlength:`250`,placeholder:`z. B. Urlaubsantrag`},null,8,[`modelValue`])]),_:1},8,[`error`]),c(`div`,Re,[t(H,{id:`qm-version`,label:`Version`,error:a(E).errors.version},{default:h(()=>[t(a(W),{id:`qm-version`,modelValue:a(E).version,"onUpdate:modelValue":i[1]||=e=>a(E).version=e,maxlength:`30`,placeholder:`z. B. 2.1`},null,8,[`modelValue`])]),_:1},8,[`error`]),t(H,{id:`qm-valid`,label:`Stand (gültig ab)`,error:a(E).errors.valid_from},{default:h(()=>[t(a(W),{id:`qm-valid`,modelValue:a(E).valid_from,"onUpdate:modelValue":i[2]||=e=>a(E).valid_from=e,type:`date`},null,8,[`modelValue`])]),_:1},8,[`error`])]),t(H,{id:`qm-description`,label:`Beschreibung (optional)`,error:a(E).errors.description},{default:h(()=>[t(a(W),{id:`qm-description`,modelValue:a(E).description,"onUpdate:modelValue":i[3]||=e=>a(E).description=e,maxlength:`1000`},null,8,[`modelValue`])]),_:1},8,[`error`]),a(E).type===`file`?(p(),l(m,{key:1},[t(H,{id:`qm-reading`,label:e.mode===`edit`?`Datei ersetzen (optional – neue Fassung)`:`Datei (PDF empfohlen – öffnet sich direkt zum Lesen)`,error:a(E).errors.reading},{default:h(()=>[t(Q,{id:`qm-reading`,modelValue:a(E).reading,"onUpdate:modelValue":i[4]||=e=>a(E).reading=e,accept:`.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.odt,.ods,.odp,.rtf,.txt,.csv,.png,.jpg,.jpeg,.gif,.webp,.zip`},null,8,[`modelValue`])]),_:1},8,[`label`,`error`]),t(H,{id:`qm-editable`,label:`Bearbeitbare Vorlage (optional, z. B. Word oder Excel zum Ausfüllen)`,error:a(E).errors.editable},{default:h(()=>[t(Q,{id:`qm-editable`,modelValue:a(E).editable,"onUpdate:modelValue":i[5]||=e=>a(E).editable=e,accept:`.doc,.docx,.xls,.xlsx,.ppt,.pptx,.odt,.ods,.odp,.rtf,.txt,.csv,.pdf,.zip`},null,8,[`modelValue`])]),_:1},8,[`error`]),e.mode!==`create`&&e.entry?.editable&&!a(E).editable?(p(),l(`label`,ze,[o(c(`input`,{"onUpdate:modelValue":i[6]||=e=>a(E).remove_editable=e,type:`checkbox`},null,512),[[x,a(E).remove_editable]]),n(` Bisherige Vorlage „`+g(e.entry.editable.name)+`“ entfernen `,1)])):b(``,!0),c(`p`,Be,`Bis `+g(e.maxUploadMb)+` MB je Datei. Der Inhalt wird für die Suche erfasst.`,1)],64)):b(``,!0),a(E).type===`link`?(p(),_(H,{key:2,id:`qm-url`,label:`Adresse`,error:a(E).errors.url},{default:h(()=>[t(a(W),{id:`qm-url`,modelValue:a(E).url,"onUpdate:modelValue":i[7]||=e=>a(E).url=e,placeholder:`https://… oder /seiten/…`},null,8,[`modelValue`])]),_:1},8,[`error`])):b(``,!0),a(E).type===`form`?(p(),_(H,{key:3,id:`qm-form`,label:`Formular`,error:a(E).errors.form_id},{default:h(()=>[t(me,{id:`qm-form`,modelValue:a(E).form_id,"onUpdate:modelValue":i[8]||=e=>a(E).form_id=e,options:[{value:null,label:`Bitte wählen …`},...e.forms]},null,8,[`modelValue`,`options`])]),_:1},8,[`error`])):b(``,!0),t(a(ge),null,{default:h(()=>[t(a(U),{type:`button`,variant:`outline`,onClick:i[9]||=e=>C(`update:open`,!1)},{default:h(()=>[...i[11]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(U),{type:`submit`,disabled:a(E).processing||e.mode===`version`&&!a(E).reading&&!a(E).editable},{default:h(()=>[a(E).processing?(p(),_(a(D),{key:0,class:`animate-spin`})):b(``,!0),i[12]||=n(` Speichern `,-1)]),_:1},8,[`disabled`])]),_:1}),a(E).progress?(p(),l(`div`,Ve,[c(`div`,{class:`h-full bg-brand`,style:d({width:`${a(E).progress.percentage}%`})},null,4)])):b(``,!0)],32)]),_:1})]),_:1},8,[`open`]))}},Ue={class:`overflow-hidden rounded-lg border bg-card`},We={class:`divide-y`},Ge={class:`flex min-w-0 items-center gap-3`},Ke={key:1,class:`grid size-8 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground`},qe={class:`min-w-0`},Je={key:1,class:`block truncate text-sm font-medium`},Ye={key:2,class:`truncate text-xs text-muted-foreground`},Xe={class:`flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground`},Ze={class:`md:hidden`},Qe=[`href`,`title`],$e={key:1,class:`inline-flex items-center gap-1 text-amber-700 dark:text-amber-400`,title:`Eingescanntes PDF – Inhalt erst nach Texterkennung durchsuchbar`},et={class:`hidden text-[13px] md:block`},tt={class:`hidden text-[13px] tabular-nums md:block`},nt={class:`hidden text-right text-[13px] text-muted-foreground tabular-nums md:block`},rt={class:`flex items-center justify-end gap-1`},it=[`href`,`aria-label`],at={key:2,class:`hidden size-8 md:block`,"aria-hidden":`true`},ot={__name:`EntryTable`,props:{entries:{type:Array,required:!0},canManage:{type:Boolean,default:!1}},emits:[`edit`,`new-version`,`archive`,`remove`],setup(e){let r={view:`Lesen`,download:`Herunterladen`,link:`Öffnen`,form:`Ausfüllen`},i=e=>e.open_kind===`link`||e.open_kind===`download`;return(o,d)=>(p(),l(`div`,Ue,[c(`div`,{class:s([`hidden grid-cols-[minmax(0,1fr)_6rem_7rem_6rem_9.5rem] items-center gap-4 border-b bg-muted/40 px-4 py-2 text-xs font-medium text-muted-foreground md:grid`,{"md:grid-cols-[minmax(0,1fr)_6rem_7rem_6rem_11.5rem]":e.canManage}])},[...d[0]||=[c(`span`,null,`Dokument`,-1),c(`span`,null,`Version`,-1),c(`span`,null,`Stand`,-1),c(`span`,{class:`text-right`},`Größe`,-1),c(`span`,{class:`sr-only`},`Aktion`,-1)]],2),c(`ul`,We,[(p(!0),l(m,null,u(e.entries,u=>(p(),l(`li`,{key:u.id,class:s([`grid items-center gap-x-4 gap-y-1 px-4 py-2.5 hover:bg-accent/50 md:grid-cols-[minmax(0,1fr)_6rem_7rem_6rem_9.5rem]`,{"md:grid-cols-[minmax(0,1fr)_6rem_7rem_6rem_11.5rem]":e.canManage}])},[c(`div`,Ge,[u.type===`file`?(p(),_(ce,{key:0,extension:u.extension,size:`sm`},null,8,[`extension`])):(p(),l(`span`,Ke,[u.type===`form`?(p(),_(a(k),{key:0,class:`size-4`})):(p(),_(a(F),{key:1,class:`size-4`}))])),c(`div`,qe,[u.open_url?(p(),_(y(i(u)?`a`:a(E)),{key:0,href:u.open_url,target:u.open_kind===`link`?`_blank`:void 0,rel:u.open_kind===`link`?`noopener`:void 0,class:`block truncate text-sm font-medium hover:underline`},{default:h(()=>[n(g(u.title),1)]),_:2},1032,[`href`,`target`,`rel`])):(p(),l(`span`,Je,g(u.title),1)),u.description?(p(),l(`p`,Ye,g(u.description),1)):b(``,!0),c(`p`,Xe,[c(`span`,Ze,g(u.version?`Version ${u.version} · `:``)+`Stand `+g(a(X)(u.valid_from)),1),u.editable?(p(),l(`a`,{key:0,href:u.editable.url,class:`inline-flex items-center gap-1 text-brand-text hover:underline`,title:u.editable.name},[t(a(P),{class:`size-3`}),n(` Vorlage (`+g(u.editable.extension)+`) `,1)],8,Qe)):b(``,!0),e.canManage&&u.text_status===`needs_ocr`?(p(),l(`span`,$e,[t(a(Se),{class:`size-3`}),d[1]||=n(` Scan, Inhalt nicht durchsuchbar `,-1)])):b(``,!0)])])]),c(`span`,et,g(u.version||`–`),1),c(`span`,tt,g(a(X)(u.valid_from)),1),c(`span`,nt,g(u.type===`file`?a(Z)(u.size):`–`),1),c(`div`,rt,[u.open_url?(p(),_(a(U),{key:0,size:`sm`,variant:`outline`,class:`h-8 min-w-28`,"as-child":``},{default:h(()=>[(p(),_(y(i(u)?`a`:a(E)),{href:u.open_url,target:u.open_kind===`link`?`_blank`:void 0,rel:u.open_kind===`link`?`noopener`:void 0},{default:h(()=>[u.open_kind===`link`?(p(),_(a(F),{key:0})):u.open_kind===`form`?(p(),_(a(k),{key:1})):u.open_kind===`download`?(p(),_(a(P),{key:2})):b(``,!0),n(` `+g(r[u.open_kind]),1)]),_:2},1032,[`href`,`target`,`rel`]))]),_:2},1024)):b(``,!0),u.open_kind===`view`&&u.download_url?(p(),_(a(U),{key:1,size:`icon`,variant:`ghost`,class:`size-8 text-muted-foreground`,"as-child":``,title:`${u.title} herunterladen`},{default:h(()=>[c(`a`,{href:u.download_url,"aria-label":`${u.title} herunterladen`},[t(a(P))],8,it)]),_:2},1032,[`title`])):(p(),l(`span`,at)),e.canManage?(p(),_(a(ee),{key:3},{default:h(()=>[t(a(te),{"as-child":``},{default:h(()=>[t(a(U),{variant:`ghost`,size:`icon`,class:`size-8 text-muted-foreground`,"aria-label":`Aktionen für ${u.title}`},{default:h(()=>[t(a(se))]),_:1},8,[`aria-label`])]),_:2},1024),t(a(ne),{align:`end`,class:`w-56`},{default:h(()=>[t(a(N),{onSelect:e=>o.$emit(`edit`,u)},{default:h(()=>[t(a(B)),d[2]||=n(` Bearbeiten`,-1)]),_:1},8,[`onSelect`]),u.type===`file`?(p(),_(a(N),{key:0,onSelect:e=>o.$emit(`new-version`,u)},{default:h(()=>[t(a(be)),d[3]||=n(` Neue Fassung hochladen`,-1)]),_:1},8,[`onSelect`])):b(``,!0),u.type===`file`?(p(),_(a(N),{key:1,onSelect:e=>o.$emit(`archive`,u)},{default:h(()=>[t(a(ye)),d[4]||=n(` Archiv (frühere Fassungen)`,-1)]),_:1},8,[`onSelect`])):b(``,!0),t(a(M)),t(a(N),{class:`text-destructive`,onSelect:e=>o.$emit(`remove`,u)},{default:h(()=>[t(a(V)),d[5]||=n(` Löschen`,-1)]),_:1},8,[`onSelect`])]),_:2},1024)]),_:2},1024)):b(``,!0)])],2))),128))])]))}},st=[`href`],ct={class:`grid min-w-0 gap-6`},lt={key:0,class:`relative overflow-hidden rounded-lg border bg-card p-5 pl-6`},ut=[`innerHTML`],dt={key:1},ft={class:`grid grid-cols-[repeat(auto-fill,minmax(11.5rem,1fr))] gap-3`},$={class:`mb-3 flex items-center justify-between gap-3`},pt={class:`text-sm font-semibold text-muted-foreground`},mt={key:0,class:`font-normal`},ht={key:1,class:`rounded-lg border border-dashed bg-card`},gt={key:0,class:`rounded-lg border bg-card`},_t={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},vt={class:`grid gap-4 p-4`},yt={__name:`Folder`,props:{folder:{type:Object,required:!0},breadcrumbs:{type:Array,default:()=>[]},children:{type:Array,default:()=>[]},entries:{type:Array,default:()=>[]},canManage:{type:Boolean,default:!1},forms:{type:Array,default:()=>[]},maxUploadMb:{type:Number,default:20},adminUrl:{type:String,default:null}},setup(e){let r=e,o=C();i(()=>o.props.flash.status,e=>e&&ae.success(e),{immediate:!0});let d=f(()=>_e(r.folder.color)),y=f(()=>[{label:`Qualitätsmanagement`,href:`/qm`},...r.breadcrumbs.map(e=>({label:e.name,href:`/qm/ordner/${e.id}`}))]),x=f(()=>r.folder.contacts.length>0),S=v({open:!1,mode:`create`,entry:null}),w=v({open:!1,entry:null}),E=(e,t=null)=>S.value={open:!0,mode:e,entry:t};function D(e){window.confirm(`„${e.title}“ mit allen Fassungen löschen?`)&&T.delete(`/qm/eintraege/${e.id}`,{preserveScroll:!0})}return(r,i)=>(p(),_(re,{title:e.folder.name},{default:h(()=>[t(pe,{title:e.folder.name,breadcrumbs:y.value},{leading:h(()=>[c(`span`,{class:s([`grid size-12 shrink-0 place-items-center rounded-lg text-white shadow-xs`,d.value.tile])},[t(de,{icon:e.folder.icon,class:`size-6`},null,8,[`icon`])],2)]),actions:h(()=>[e.adminUrl?(p(),_(a(U),{key:0,variant:`outline`,class:`h-10`,"as-child":``},{default:h(()=>[c(`a`,{href:e.adminUrl},[t(a(ue)),i[6]||=n(` Ordner bearbeiten`,-1)],8,st)]),_:1})):b(``,!0),t(ve)]),_:1},8,[`title`,`breadcrumbs`]),c(`div`,{class:s([`grid items-start gap-6`,{"lg:grid-cols-[minmax(0,1fr)_20rem]":x.value}])},[c(`div`,ct,[e.folder.intro?(p(),l(`section`,lt,[c(`span`,{class:s([`absolute inset-y-0 left-0 w-1.5`,d.value.tile]),"aria-hidden":`true`},null,2),c(`div`,{class:`prose prose-sm max-w-none dark:prose-invert`,innerHTML:e.folder.intro},null,8,ut)])):b(``,!0),e.children.length?(p(),l(`section`,dt,[i[7]||=c(`h2`,{class:`mb-3 text-sm font-semibold text-muted-foreground`},`Unterordner`,-1),c(`div`,ft,[(p(!0),l(m,null,u(e.children,e=>(p(),_(L,{key:e.id,folder:e,small:``},null,8,[`folder`]))),128))])])):b(``,!0),c(`section`,null,[c(`div`,$,[c(`h2`,pt,[i[8]||=n(`Dokumente `,-1),e.entries.length?(p(),l(`span`,mt,`(`+g(e.entries.length)+`)`,1)):b(``,!0)]),e.canManage?(p(),_(a(U),{key:0,size:`sm`,onClick:i[0]||=e=>E(`create`)},{default:h(()=>[t(a(le)),i[9]||=n(` Eintrag hinzufügen`,-1)]),_:1})):b(``,!0)]),e.entries.length?(p(),_(ot,{key:0,entries:e.entries,"can-manage":e.canManage,onEdit:i[1]||=e=>E(`edit`,e),onNewVersion:i[2]||=e=>E(`version`,e),onArchive:i[3]||=e=>w.value={open:!0,entry:e},onRemove:D},null,8,[`entries`,`can-manage`])):(p(),l(`div`,ht,[t(fe,{icon:a(xe),title:`Noch keine Dokumente`,text:e.canManage?`Mit „Eintrag hinzufügen“ Dateien, Links oder Formulare ergänzen.`:``},null,8,[`icon`,`text`])]))])]),x.value?(p(),l(`aside`,gt,[c(`h2`,_t,[t(a(A),{class:s([`size-4`,d.value.text])},null,8,[`class`]),n(` `+g(e.folder.contacts.length===1?`Ansprechpartner*in`:`Ansprechpartner*innen`),1)]),c(`div`,vt,[(p(!0),l(m,null,u(e.folder.contacts,e=>(p(),_(I,{key:e.id,contact:e},null,8,[`contact`]))),128))])])):b(``,!0)],2),e.canManage?(p(),_(He,{key:0,open:S.value.open,"onUpdate:open":i[4]||=e=>S.value.open=e,mode:S.value.mode,entry:S.value.entry,"folder-id":e.folder.id,forms:e.forms,"max-upload-mb":e.maxUploadMb},null,8,[`open`,`mode`,`entry`,`folder-id`,`forms`,`max-upload-mb`])):b(``,!0),e.canManage?(p(),_(Ae,{key:1,open:w.value.open,"onUpdate:open":i[5]||=e=>w.value.open=e,entry:w.value.entry},null,8,[`open`,`entry`])):b(``,!0)]),_:1},8,[`title`]))}};export{yt as default}; \ No newline at end of file diff --git a/public/build/assets/FolderBlock-Cgeb2aeH.js b/public/build/assets/FolderBlock-fKv65pVH.js similarity index 93% rename from public/build/assets/FolderBlock-Cgeb2aeH.js rename to public/build/assets/FolderBlock-fKv65pVH.js index 0f12f1c4..5afa3db7 100644 --- a/public/build/assets/FolderBlock-Cgeb2aeH.js +++ b/public/build/assets/FolderBlock-fKv65pVH.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,y as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as d}from"./app-Bu3kn8yd.js";import{t as f}from"./chevron-right-C9w5cb2q.js";import{t as p}from"./download-UAAY3N2F.js";import{t as m}from"./FileIcon-B6dfvt48.js";var h={key:0},g={key:0,class:`mb-3 flex items-center justify-between gap-4`},_={class:`text-lg font-semibold`},v={class:`divide-y rounded-lg border bg-card`},y=[`href`],b={class:`min-w-0 flex-1`},x={class:`block truncate text-sm font-medium group-hover:underline`},S={key:0,class:`block truncate text-[13px] text-muted-foreground`},C={class:`block text-xs text-muted-foreground`},w={key:0,class:`px-4 py-3 text-sm text-muted-foreground`},T={__name:`FolderBlock`,props:{block:{type:Object,required:!0}},setup(T){let E=e=>e>=1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;return(D,O)=>T.block.props?(o(),i(`section`,h,[T.block.data.title?(o(),i(`div`,g,[r(`h3`,_,l(T.block.data.title),1),e(n(d),{href:T.block.props.folder_url,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:c(()=>[O[0]||=t(`Zum Ordner `,-1),e(n(f),{class:`size-3.5`})]),_:1},8,[`href`])])):u(``,!0),r(`ul`,v,[(o(!0),i(s,null,a(T.block.props.downloads,t=>(o(),i(`li`,{key:t.id},[r(`a`,{href:t.download_url,class:`group flex items-center gap-3 px-4 py-3 hover:bg-accent/50`},[e(m,{extension:t.extension},null,8,[`extension`]),r(`span`,b,[r(`span`,x,l(t.title),1),T.block.data.show_description&&t.description?(o(),i(`span`,S,l(t.description),1)):u(``,!0),r(`span`,C,l(t.extension)+` · `+l(E(t.size)),1)]),e(n(p),{class:`size-4 shrink-0 text-muted-foreground`})],8,y)]))),128)),T.block.props.downloads.length?u(``,!0):(o(),i(`li`,w,`Keine Dateien in diesem Ordner.`))])])):u(``,!0)}};export{T as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,y as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as d}from"./app-BNwrc_lv.js";import{t as f}from"./chevron-right-C9w5cb2q.js";import{t as p}from"./download-UAAY3N2F.js";import{t as m}from"./FileIcon-BctWLKDw.js";var h={key:0},g={key:0,class:`mb-3 flex items-center justify-between gap-4`},_={class:`text-lg font-semibold`},v={class:`divide-y rounded-lg border bg-card`},y=[`href`],b={class:`min-w-0 flex-1`},x={class:`block truncate text-sm font-medium group-hover:underline`},S={key:0,class:`block truncate text-[13px] text-muted-foreground`},C={class:`block text-xs text-muted-foreground`},w={key:0,class:`px-4 py-3 text-sm text-muted-foreground`},T={__name:`FolderBlock`,props:{block:{type:Object,required:!0}},setup(T){let E=e=>e>=1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`;return(D,O)=>T.block.props?(o(),i(`section`,h,[T.block.data.title?(o(),i(`div`,g,[r(`h3`,_,l(T.block.data.title),1),e(n(d),{href:T.block.props.folder_url,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:c(()=>[O[0]||=t(`Zum Ordner `,-1),e(n(f),{class:`size-3.5`})]),_:1},8,[`href`])])):u(``,!0),r(`ul`,v,[(o(!0),i(s,null,a(T.block.props.downloads,t=>(o(),i(`li`,{key:t.id},[r(`a`,{href:t.download_url,class:`group flex items-center gap-3 px-4 py-3 hover:bg-accent/50`},[e(m,{extension:t.extension},null,8,[`extension`]),r(`span`,b,[r(`span`,x,l(t.title),1),T.block.data.show_description&&t.description?(o(),i(`span`,S,l(t.description),1)):u(``,!0),r(`span`,C,l(t.extension)+` · `+l(E(t.size)),1)]),e(n(p),{class:`size-4 shrink-0 text-muted-foreground`})],8,y)]))),128)),T.block.props.downloads.length?u(``,!0):(o(),i(`li`,w,`Keine Dateien in diesem Ordner.`))])])):u(``,!0)}};export{T as default}; \ No newline at end of file diff --git a/public/build/assets/FolderTile-B1Q0k_YL.js b/public/build/assets/FolderTile-B1Q0k_YL.js new file mode 100644 index 00000000..1bd570a7 --- /dev/null +++ b/public/build/assets/FolderTile-B1Q0k_YL.js @@ -0,0 +1 @@ +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,er as s,mt as c,o as l,qt as u,tr as d,v as f,wt as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as h}from"./app-BNwrc_lv.js";import{k as g}from"./dist-DtGNiYlK.js";import{V as _,p as v,t as y}from"./AppIcon-nlhvQfK7.js";import{b}from"./http-CAG9BrJF.js";import{t as x}from"./smartphone-BE2l7T-2.js";import{t as S}from"./colors-RDOJqd57.js";var C=g({name:`folder-cog`,size:24,node:[[`path`,{d:`M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3`,key:`128dxu`}],[`path`,{d:`m14.305 19.53.923-.382`,key:`3m78fa`}],[`path`,{d:`m15.228 16.852-.923-.383`,key:`npixar`}],[`path`,{d:`m16.852 15.228-.383-.923`,key:`5xggr7`}],[`path`,{d:`m16.852 20.772-.383.924`,key:`dpfhf9`}],[`path`,{d:`m19.148 15.228.383-.923`,key:`1reyyz`}],[`path`,{d:`m19.53 21.696-.382-.924`,key:`1goivc`}],[`path`,{d:`m20.772 16.852.924-.383`,key:`htqkph`}],[`path`,{d:`m20.772 19.148.924.383`,key:`9w9pjp`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]],aliases:[`folder-cog-2`]}),w={class:`flex gap-3`},T={class:`min-w-0 pt-0.5`},E={class:`mt-1 grid gap-0.5 text-[13px]`},D=[`href`],O={key:2,class:`truncate text-muted-foreground`},k={__name:`ContactCard`,props:{contact:{type:Object,required:!0}},setup(r){let s=e=>e.type===`phone`?`tel:${e.value}`:e.type===`email`?`mailto:${e.value}`:null,g=e=>e.key===`mobile`?x:e.type===`phone`?b:e.type===`email`?_:null;return(_,y)=>(c(),a(`div`,w,[e(n(h),{href:`/personen/${r.contact.id}`,class:`shrink-0`},{default:u(()=>[e(v,{person:r.contact,class:`size-14 text-base`},null,8,[`person`])]),_:1},8,[`href`]),i(`div`,T,[e(n(h),{href:`/personen/${r.contact.id}`,class:`block truncate text-sm font-semibold hover:underline`},{default:u(()=>[t(d(r.contact.name),1)]),_:1},8,[`href`]),i(`ul`,E,[(c(!0),a(l,null,o(r.contact.fields,e=>(c(),a(`li`,{key:e.key,class:`flex min-w-0 items-center gap-1.5`},[g(e)?(c(),f(p(g(e)),{key:0,class:`size-3.5 shrink-0 text-muted-foreground`})):m(``,!0),s(e)?(c(),a(`a`,{key:1,href:s(e),class:`truncate text-brand-text hover:underline`},d(e.value),9,D)):(c(),a(`span`,O,d(e.value),1))]))),128))])])]))}},A=[`src`],j={__name:`QmIcon`,props:{icon:{type:Object,default:()=>({name:`folder`})},strokeWidth:{type:[Number,String],default:1.75}},setup(e){return(t,n)=>e.icon?.name?(c(),f(y,{key:0,name:e.icon.name,"stroke-width":e.strokeWidth},null,8,[`name`,`stroke-width`])):e.icon?.url&&e.icon.mono?(c(),a(`span`,{key:1,class:`inline-block bg-current`,style:s({maskImage:`url('${e.icon.url}')`,WebkitMaskImage:`url('${e.icon.url}')`,maskSize:`contain`,WebkitMaskSize:`contain`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`,maskPosition:`center`,WebkitMaskPosition:`center`}),"aria-hidden":`true`},null,4)):e.icon?.url?(c(),a(`img`,{key:2,src:e.icon.url,alt:``,class:`object-contain`},null,8,A)):(c(),f(y,{key:3,name:`folder`,"stroke-width":e.strokeWidth},null,8,[`stroke-width`]))}},M={class:`pointer-events-none absolute -right-4 -bottom-5 opacity-15 transition-transform group-hover:scale-105`,"aria-hidden":`true`},N={class:`relative mt-3`},P={class:`mt-0.5 block text-xs text-white/80`},F={__name:`FolderTile`,props:{folder:{type:Object,required:!0},small:{type:Boolean,default:!1}},setup(t){let a=t,o=()=>{let e=[];return a.folder.folders&&e.push(`${a.folder.folders} ${a.folder.folders,`Ordner`}`),a.folder.entries&&e.push(`${a.folder.entries} ${a.folder.entries===1?`Dokument`:`Dokumente`}`),e.join(` · `)||`Noch leer`};return(a,s)=>(c(),f(n(h),{href:t.folder.url,class:r([`group relative flex flex-col justify-between overflow-hidden rounded-lg text-white shadow-xs transition hover:shadow-md hover:brightness-110 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,[n(S)(t.folder.color).tile,t.small?`min-h-24 p-3.5`:`min-h-32 p-4`]])},{default:u(()=>[i(`span`,M,[e(j,{icon:t.folder.icon,class:r(t.small?`size-20`:`size-24`)},null,8,[`icon`,`class`])]),i(`span`,{class:r([`grid place-items-center rounded-md bg-white/15`,t.small?`size-9`:`size-11`])},[e(j,{icon:t.folder.icon,class:r(t.small?`size-5`:`size-6`)},null,8,[`icon`,`class`])],2),i(`span`,N,[i(`span`,{class:r([`block leading-tight font-semibold`,t.small?`text-sm`:`text-[15px]`])},d(t.folder.name),3),i(`span`,P,d(o()),1)])]),_:1},8,[`href`,`class`]))}};export{C as i,j as n,k as r,F as t}; \ No newline at end of file diff --git a/public/build/assets/FolderTile-_J6uRwiD.js b/public/build/assets/FolderTile-_J6uRwiD.js deleted file mode 100644 index 710cab1f..00000000 --- a/public/build/assets/FolderTile-_J6uRwiD.js +++ /dev/null @@ -1 +0,0 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,er as s,mt as c,o as l,qt as u,tr as d,v as f,wt as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as h}from"./app-Bu3kn8yd.js";import{k as g}from"./dist-DtGNiYlK.js";import{V as _,p as v,t as y}from"./AppIcon-0N56IC2z.js";import{y as b}from"./http-DmyDwIce.js";import{t as x}from"./smartphone-BE2l7T-2.js";import{t as S}from"./colors-RDOJqd57.js";var C=g({name:`folder-cog`,size:24,node:[[`path`,{d:`M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3`,key:`128dxu`}],[`path`,{d:`m14.305 19.53.923-.382`,key:`3m78fa`}],[`path`,{d:`m15.228 16.852-.923-.383`,key:`npixar`}],[`path`,{d:`m16.852 15.228-.383-.923`,key:`5xggr7`}],[`path`,{d:`m16.852 20.772-.383.924`,key:`dpfhf9`}],[`path`,{d:`m19.148 15.228.383-.923`,key:`1reyyz`}],[`path`,{d:`m19.53 21.696-.382-.924`,key:`1goivc`}],[`path`,{d:`m20.772 16.852.924-.383`,key:`htqkph`}],[`path`,{d:`m20.772 19.148.924.383`,key:`9w9pjp`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]],aliases:[`folder-cog-2`]}),w={class:`flex gap-3`},T={class:`min-w-0 pt-0.5`},E={class:`mt-1 grid gap-0.5 text-[13px]`},D=[`href`],O={key:2,class:`truncate text-muted-foreground`},k={__name:`ContactCard`,props:{contact:{type:Object,required:!0}},setup(r){let s=e=>e.type===`phone`?`tel:${e.value}`:e.type===`email`?`mailto:${e.value}`:null,g=e=>e.key===`mobile`?x:e.type===`phone`?b:e.type===`email`?_:null;return(_,y)=>(c(),a(`div`,w,[e(n(h),{href:`/personen/${r.contact.id}`,class:`shrink-0`},{default:u(()=>[e(v,{person:r.contact,class:`size-14 text-base`},null,8,[`person`])]),_:1},8,[`href`]),i(`div`,T,[e(n(h),{href:`/personen/${r.contact.id}`,class:`block truncate text-sm font-semibold hover:underline`},{default:u(()=>[t(d(r.contact.name),1)]),_:1},8,[`href`]),i(`ul`,E,[(c(!0),a(l,null,o(r.contact.fields,e=>(c(),a(`li`,{key:e.key,class:`flex min-w-0 items-center gap-1.5`},[g(e)?(c(),f(p(g(e)),{key:0,class:`size-3.5 shrink-0 text-muted-foreground`})):m(``,!0),s(e)?(c(),a(`a`,{key:1,href:s(e),class:`truncate text-brand-text hover:underline`},d(e.value),9,D)):(c(),a(`span`,O,d(e.value),1))]))),128))])])]))}},A=[`src`],j={__name:`QmIcon`,props:{icon:{type:Object,default:()=>({name:`folder`})},strokeWidth:{type:[Number,String],default:1.75}},setup(e){return(t,n)=>e.icon?.name?(c(),f(y,{key:0,name:e.icon.name,"stroke-width":e.strokeWidth},null,8,[`name`,`stroke-width`])):e.icon?.url&&e.icon.mono?(c(),a(`span`,{key:1,class:`inline-block bg-current`,style:s({maskImage:`url('${e.icon.url}')`,WebkitMaskImage:`url('${e.icon.url}')`,maskSize:`contain`,WebkitMaskSize:`contain`,maskRepeat:`no-repeat`,WebkitMaskRepeat:`no-repeat`,maskPosition:`center`,WebkitMaskPosition:`center`}),"aria-hidden":`true`},null,4)):e.icon?.url?(c(),a(`img`,{key:2,src:e.icon.url,alt:``,class:`object-contain`},null,8,A)):(c(),f(y,{key:3,name:`folder`,"stroke-width":e.strokeWidth},null,8,[`stroke-width`]))}},M={class:`pointer-events-none absolute -right-4 -bottom-5 opacity-15 transition-transform group-hover:scale-105`,"aria-hidden":`true`},N={class:`relative mt-3`},P={class:`mt-0.5 block text-xs text-white/80`},F={__name:`FolderTile`,props:{folder:{type:Object,required:!0},small:{type:Boolean,default:!1}},setup(t){let a=t,o=()=>{let e=[];return a.folder.folders&&e.push(`${a.folder.folders} ${a.folder.folders,`Ordner`}`),a.folder.entries&&e.push(`${a.folder.entries} ${a.folder.entries===1?`Dokument`:`Dokumente`}`),e.join(` · `)||`Noch leer`};return(a,s)=>(c(),f(n(h),{href:t.folder.url,class:r([`group relative flex flex-col justify-between overflow-hidden rounded-lg text-white shadow-xs transition hover:shadow-md hover:brightness-110 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,[n(S)(t.folder.color).tile,t.small?`min-h-24 p-3.5`:`min-h-32 p-4`]])},{default:u(()=>[i(`span`,M,[e(j,{icon:t.folder.icon,class:r(t.small?`size-20`:`size-24`)},null,8,[`icon`,`class`])]),i(`span`,{class:r([`grid place-items-center rounded-md bg-white/15`,t.small?`size-9`:`size-11`])},[e(j,{icon:t.folder.icon,class:r(t.small?`size-5`:`size-6`)},null,8,[`icon`,`class`])],2),i(`span`,N,[i(`span`,{class:r([`block leading-tight font-semibold`,t.small?`text-sm`:`text-[15px]`])},d(t.folder.name),3),i(`span`,P,d(o()),1)])]),_:1},8,[`href`,`class`]))}};export{C as i,j as n,k as r,F as t}; \ No newline at end of file diff --git a/public/build/assets/ForgotPassword-DBBKbJ8d.js b/public/build/assets/ForgotPassword-D3igZp7Q.js similarity index 85% rename from public/build/assets/ForgotPassword-DBBKbJ8d.js rename to public/build/assets/ForgotPassword-D3igZp7Q.js index 80d7f06b..c757195a 100644 --- a/public/build/assets/ForgotPassword-DBBKbJ8d.js +++ b/public/build/assets/ForgotPassword-D3igZp7Q.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as u}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as d,r as f}from"./app-Bu3kn8yd.js";import{O as p}from"./dist-DtGNiYlK.js";import{t as m}from"./arrow-left-BMImfTf2.js";import{t as h}from"./FormField-BoFAO4pm.js";import{t as g}from"./button-ZHC5mKey.js";import{t as _}from"./Input-FGSb2-yK.js";import{t as v}from"./GuestLayout-CAwpgUCY.js";var y={key:0,class:`mb-6 rounded-md border border-brand-200 bg-brand-soft px-4 py-3 text-sm text-brand-soft-foreground`},b={__name:`ForgotPassword`,props:{status:{type:String,default:null}},setup(b){let x=d({email:``});return(d,S)=>(a(),c(v,{title:`Passwort vergessen`,description:`Wir senden Ihnen einen Link, mit dem Sie ein neues Passwort festlegen können.`},{default:o(()=>[b.status?(a(),i(`div`,y,s(b.status),1)):l(``,!0),r(`form`,{class:`grid gap-5`,onSubmit:S[1]||=u(e=>n(x).post(`/forgot-password`),[`prevent`])},[e(h,{id:`email`,label:`E-Mail-Adresse`,error:n(x).errors.email},{default:o(()=>[e(n(_),{id:`email`,modelValue:n(x).email,"onUpdate:modelValue":S[0]||=e=>n(x).email=e,type:`email`,autocomplete:`username`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(n(g),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:n(x).processing},{default:o(()=>[n(x).processing?(a(),c(n(p),{key:0,class:`animate-spin`})):l(``,!0),S[2]||=t(` Link senden `,-1)]),_:1},8,[`disabled`]),e(n(f),{href:`/login`,class:`inline-flex items-center justify-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:o(()=>[e(n(m),{class:`size-4`}),S[3]||=t(` Zurück zur Anmeldung `,-1)]),_:1})],32)]),_:1}))}};export{b as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as u}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as d,r as f}from"./app-BNwrc_lv.js";import{O as p}from"./dist-DtGNiYlK.js";import{t as m}from"./arrow-left-BMImfTf2.js";import{t as h}from"./FormField-BoFAO4pm.js";import{n as g}from"./button-CwUSbS9X.js";import{t as _}from"./Input-FGSb2-yK.js";import{t as v}from"./GuestLayout-B2rtJjbh.js";var y={key:0,class:`mb-6 rounded-md border border-brand-200 bg-brand-soft px-4 py-3 text-sm text-brand-soft-foreground`},b={__name:`ForgotPassword`,props:{status:{type:String,default:null}},setup(b){let x=d({email:``});return(d,S)=>(a(),c(v,{title:`Passwort vergessen`,description:`Wir senden Ihnen einen Link, mit dem Sie ein neues Passwort festlegen können.`},{default:o(()=>[b.status?(a(),i(`div`,y,s(b.status),1)):l(``,!0),r(`form`,{class:`grid gap-5`,onSubmit:S[1]||=u(e=>n(x).post(`/forgot-password`),[`prevent`])},[e(h,{id:`email`,label:`E-Mail-Adresse`,error:n(x).errors.email},{default:o(()=>[e(n(_),{id:`email`,modelValue:n(x).email,"onUpdate:modelValue":S[0]||=e=>n(x).email=e,type:`email`,autocomplete:`username`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(n(g),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:n(x).processing},{default:o(()=>[n(x).processing?(a(),c(n(p),{key:0,class:`animate-spin`})):l(``,!0),S[2]||=t(` Link senden `,-1)]),_:1},8,[`disabled`]),e(n(f),{href:`/login`,class:`inline-flex items-center justify-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:o(()=>[e(n(m),{class:`size-4`}),S[3]||=t(` Zurück zur Anmeldung `,-1)]),_:1})],32)]),_:1}))}};export{b as default}; \ No newline at end of file diff --git a/public/build/assets/FormBlock-CT3QsLOf.js b/public/build/assets/FormBlock-BHsQr-qn.js similarity index 93% rename from public/build/assets/FormBlock-CT3QsLOf.js rename to public/build/assets/FormBlock-BHsQr-qn.js index 62b006e8..6513f561 100644 --- a/public/build/assets/FormBlock-CT3QsLOf.js +++ b/public/build/assets/FormBlock-BHsQr-qn.js @@ -1 +1 @@ -import{J as e,On as t,Zn as n,_ as r,b as i,mt as a,o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as u}from"./FormRenderer-BEg0886q.js";var d={key:0,class:`rounded-lg border bg-card p-5 @3xl:p-8`},f={class:`text-xl font-semibold tracking-tight`},p={key:0,class:`mt-2 mb-6 text-sm leading-relaxed whitespace-pre-line text-muted-foreground`},m={key:1,class:`rounded-lg border border-dashed p-4 text-sm text-muted-foreground`},h={__name:`FormBlock`,props:{block:{type:Object,required:!0}},setup(h){let g=e(`pagebuilder:editing`,!1);return(e,_)=>h.block.props?(a(),i(`section`,d,[h.block.data.show_title?(a(),i(o,{key:0},[r(`h3`,f,s(h.block.props.title),1),h.block.props.description?(a(),i(`p`,p,s(h.block.props.description),1)):l(``,!0)],64)):l(``,!0),r(`div`,{class:n({"pointer-events-none opacity-80":t(g)})},[(a(),c(u,{key:h.block.props.id,form:h.block.props},null,8,[`form`]))],2)])):t(g)?(a(),i(`p`,m,`Bitte rechts ein Formular auswählen.`)):l(``,!0)}};export{h as default}; \ No newline at end of file +import{J as e,On as t,Zn as n,_ as r,b as i,mt as a,o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as u}from"./FormRenderer-CoNVx1AS.js";var d={key:0,class:`rounded-lg border bg-card p-5 @3xl:p-8`},f={class:`text-xl font-semibold tracking-tight`},p={key:0,class:`mt-2 mb-6 text-sm leading-relaxed whitespace-pre-line text-muted-foreground`},m={key:1,class:`rounded-lg border border-dashed p-4 text-sm text-muted-foreground`},h={__name:`FormBlock`,props:{block:{type:Object,required:!0}},setup(h){let g=e(`pagebuilder:editing`,!1);return(e,_)=>h.block.props?(a(),i(`section`,d,[h.block.data.show_title?(a(),i(o,{key:0},[r(`h3`,f,s(h.block.props.title),1),h.block.props.description?(a(),i(`p`,p,s(h.block.props.description),1)):l(``,!0)],64)):l(``,!0),r(`div`,{class:n({"pointer-events-none opacity-80":t(g)})},[(a(),c(u,{key:h.block.props.id,form:h.block.props},null,8,[`form`]))],2)])):t(g)?(a(),i(`p`,m,`Bitte rechts ein Formular auswählen.`)):l(``,!0)}};export{h as default}; \ No newline at end of file diff --git a/public/build/assets/FormRenderer-BEg0886q.js b/public/build/assets/FormRenderer-CoNVx1AS.js similarity index 95% rename from public/build/assets/FormRenderer-BEg0886q.js rename to public/build/assets/FormRenderer-CoNVx1AS.js index 89011de5..4337c223 100644 --- a/public/build/assets/FormRenderer-BEg0886q.js +++ b/public/build/assets/FormRenderer-CoNVx1AS.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Yt as r,Zn as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,wt as ee,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{_ as h,w as te,y as ne}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as g,i as re}from"./app-Bu3kn8yd.js";import{O as ie}from"./dist-DtGNiYlK.js";import{S as ae,_ as oe,o as se}from"./http-DmyDwIce.js";import{t as ce}from"./eye-off-myis3scV.js";import{t as _}from"./lock-H7FAhSBr.js";import{t as v}from"./paperclip-DmVAQ5Y5.js";import{t as y}from"./send-6fmdiUe6.js";import{t as b}from"./button-ZHC5mKey.js";import{t as x}from"./NativeSelect-BGasRaNs.js";import{t as S}from"./Input-FGSb2-yK.js";import{t as C}from"./Textarea-DEFXqC2w.js";var w={key:0,class:`flex gap-3 rounded-lg border border-emerald-200 bg-emerald-50 p-5 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100`,role:`status`},T={class:`font-medium whitespace-pre-line`},E={key:0,class:`mt-1 text-sm opacity-80`},D={key:1,class:`rounded-lg border bg-muted px-5 py-4 text-sm`},O={key:2,class:`rounded-lg border bg-muted px-5 py-4 text-sm`},k={key:0,class:`flex items-start gap-2 rounded-md bg-muted px-3 py-2 text-[13px] text-muted-foreground @xl:col-span-2`},A={key:1,class:`rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive @xl:col-span-2`},j={key:0,class:`pt-2 text-lg font-semibold @xl:col-span-2`},M={key:1,class:`text-sm leading-relaxed whitespace-pre-line text-muted-foreground @xl:col-span-2`},N=[`for`],P=[`id`,`onUpdate:modelValue`,`aria-invalid`],F={key:0,class:`text-destructive`},I={key:0,class:`text-destructive`},L=[`aria-labelledby`],R=[`onUpdate:modelValue`,`name`,`value`],z=[`checked`,`onChange`],B={key:3,class:`grid gap-2`},le={key:0,class:`grid gap-1`},V={class:`min-w-0 flex-1 truncate`},H={class:`text-xs text-muted-foreground`},U=[`aria-label`,`onClick`],W={key:1,class:`flex h-10 cursor-pointer items-center justify-center gap-2 rounded-md border border-dashed text-sm text-muted-foreground hover:border-brand-300 hover:text-foreground`},ue=[`id`,`accept`,`multiple`,`onChange`],de=[`aria-describedby`],fe=[`id`],pe={key:1,class:`text-muted-foreground italic`},me={key:2,class:`text-[13px] text-destructive`},he={key:0,href:`/profil/bearbeiten`,class:`font-medium underline`},ge=[`id`],_e={key:4,class:`text-[13px] text-muted-foreground`},ve={class:`flex items-center gap-4 border-t pt-5 @xl:col-span-2`},G={__name:`FormRenderer`,props:{form:{type:Object,required:!0},compact:{type:Boolean,default:!1},preview:{type:Boolean,default:!1}},setup(G){let K=G,q=g(),ye=[`text`,`textarea`,`email`,`phone`,`number`,`date`,`select`,`radio`,`checkboxes`,`checkbox`,`file`];function be(e){let t=K.form.prefill?.[e.key];return e.type===`checkboxes`||e.type===`file`?[]:e.type===`checkbox`?!1:t??``}let J=re({answers:Object.fromEntries(K.form.fields.filter(e=>ye.includes(e.type)).map(e=>[e.key,be(e)]))}),xe=c(()=>q.props.flash?.form_submitted===K.form.id);function Y(e,t=0){if(!e.condition||t>10)return!0;let n=K.form.fields.find(t=>t.key===e.condition.field);if(!n||!Y(n,t+1))return!1;let r=J.answers[e.condition.field],i=(Array.isArray(r)?r:r===!0?[`1`]:r===!1||r===``||r==null?[]:[String(r)]).map(String),a=e.condition.value??``;switch(e.condition.operator){case`not_equals`:return!i.includes(a);case`filled`:return i.length>0;case`empty`:return i.length===0;default:return i.includes(a)}}let X=c(()=>K.form.fields.filter(e=>Y(e)));function Z(e){return J.errors[`answers.${e.key}`]??Object.entries(J.errors).find(([t])=>t.startsWith(`answers.${e.key}.`))?.[1]}function Q(e,t){let n=new Set(J.answers[e.key]);n.has(t)?n.delete(t):n.add(t),J.answers[e.key]=[...n]}function Se(e,t){let n=[...t.target.files??[]];J.answers[e.key]=e.multiple?[...J.answers[e.key],...n].slice(0,10):n.slice(0,1),t.target.value=``}function Ce(e,t){J.answers[e.key]=J.answers[e.key].filter((e,n)=>n!==t)}function we(){if(K.preview){se.info(`Vorschau – es wird nichts gesendet.`);return}let e=new Set(X.value.map(e=>e.key));J.transform(t=>({answers:Object.fromEntries(Object.entries(t.answers).filter(([t])=>e.has(t)))})).post(K.form.url,{forceFormData:!0,preserveScroll:!0,onSuccess:()=>{q.props.flash?.form_submitted===K.form.id&&J.reset()}})}let Te=e=>e>1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`,$=e=>`f${K.form.id}-${e.key}`;return(c,g)=>xe.value?(l(),o(`div`,w,[e(n(ae),{class:`mt-0.5 size-5 shrink-0 text-emerald-600`}),a(`div`,null,[a(`p`,T,f(G.form.confirmation),1),G.form.send_copy?(l(),o(`p`,E,`Eine Kopie Ihrer Angaben ist per E-Mail unterwegs.`)):m(``,!0)])])):G.form.already_submitted?(l(),o(`p`,D,`Sie haben dieses Formular bereits ausgefüllt. Vielen Dank!`)):G.form.open?(l(),o(`form`,{key:3,class:`grid gap-5 @xl:grid-cols-2`,novalidate:``,onSubmit:te(we,[`prevent`])},[G.form.anonymous?(l(),o(`p`,k,[e(n(ce),{class:`mt-0.5 size-4 shrink-0`}),g[0]||=t(` Anonym: Ihr Name und Ihre E-Mail-Adresse werden nicht gespeichert. `,-1)])):m(``,!0),n(J).errors.form?(l(),o(`p`,A,f(n(J).errors.form),1)):m(``,!0),(l(!0),o(u,null,s(X.value,c=>(l(),o(u,{key:c.key},[c.type===`heading`?(l(),o(`h3`,j,f(c.text),1)):c.type===`paragraph`?(l(),o(`p`,M,f(c.text),1)):(l(),o(`div`,{key:2,class:i([`grid content-start gap-1.5`,c.width===`half`?``:`@xl:col-span-2`])},[c.type===`checkbox`?(l(),o(`label`,{key:0,for:$(c),class:`flex items-start gap-2.5 text-sm`},[r(a(`input`,{id:$(c),"onUpdate:modelValue":e=>n(J).answers[c.key]=e,type:`checkbox`,class:`mt-0.5 size-4 shrink-0 accent-[var(--brand)]`,"aria-invalid":!!Z(c)},null,8,P),[[h,n(J).answers[c.key]]]),a(`span`,null,[t(f(c.label),1),c.required?(l(),o(`span`,F,` *`)):m(``,!0)])],8,N)):(l(),o(u,{key:1},[(l(),p(ee([`radio`,`checkboxes`].includes(c.type)?`span`:`label`),{for:$(c),class:`text-[13px] font-medium`,id:`${$(c)}-label`},{default:d(()=>[t(f(c.label),1),c.required?(l(),o(`span`,I,` *`)):m(``,!0)]),_:2},1032,[`for`,`id`])),c.type===`textarea`?(l(),p(n(C),{key:0,id:$(c),modelValue:n(J).answers[c.key],"onUpdate:modelValue":e=>n(J).answers[c.key]=e,rows:c.rows??4,maxlength:c.max,"aria-invalid":!!Z(c)},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`rows`,`maxlength`,`aria-invalid`])):c.type===`select`?(l(),p(x,{key:1,id:$(c),modelValue:n(J).answers[c.key],"onUpdate:modelValue":e=>n(J).answers[c.key]=e,options:c.options.map(e=>({value:e,label:e})),placeholder:`Bitte wählen …`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`options`])):c.type===`radio`||c.type===`checkboxes`?(l(),o(`div`,{key:2,class:`grid gap-1.5`,role:`group`,"aria-labelledby":`${$(c)}-label`},[(l(!0),o(u,null,s(c.options,e=>(l(),o(`label`,{key:e,class:`flex items-center gap-2.5 text-sm`},[c.type===`radio`?r((l(),o(`input`,{key:0,"onUpdate:modelValue":e=>n(J).answers[c.key]=e,type:`radio`,name:$(c),value:e,class:`size-4 accent-[var(--brand)]`},null,8,R)),[[ne,n(J).answers[c.key]]]):(l(),o(`input`,{key:1,type:`checkbox`,checked:n(J).answers[c.key].includes(e),class:`size-4 accent-[var(--brand)]`,onChange:t=>Q(c,e)},null,40,z)),t(` `+f(e),1)]))),128))],8,L)):c.type===`file`?(l(),o(`div`,B,[n(J).answers[c.key].length?(l(),o(`ul`,le,[(l(!0),o(u,null,s(n(J).answers[c.key],(t,r)=>(l(),o(`li`,{key:r,class:`flex items-center gap-2 rounded-md border bg-card px-3 py-1.5 text-sm`},[e(n(v),{class:`size-4 shrink-0 text-muted-foreground`}),a(`span`,V,f(t.name),1),a(`span`,H,f(Te(t.size)),1),a(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,"aria-label":`${t.name} entfernen`,onClick:e=>Ce(c,r)},[e(n(oe),{class:`size-3.5`})],8,U)]))),128))])):m(``,!0),c.multiple||!n(J).answers[c.key].length?(l(),o(`label`,W,[e(n(v),{class:`size-4`}),t(` `+f(c.multiple?`Dateien auswählen`:`Datei auswählen`)+` `,1),a(`input`,{id:$(c),type:`file`,class:`sr-only`,accept:c.accept,multiple:c.multiple,onChange:e=>Se(c,e)},null,40,ue)])):m(``,!0)])):c.locked?(l(),o(`div`,{key:4,class:`flex h-9 items-center gap-2 rounded-md border border-input bg-muted/60 px-3 text-sm`,"aria-describedby":`${$(c)}-locked`},[e(n(_),{class:`size-3.5 shrink-0 text-muted-foreground`}),n(J).answers[c.key]?(l(),o(`span`,{key:0,id:$(c),class:`truncate`},f(n(J).answers[c.key]),9,fe)):(l(),o(`span`,pe,f(G.preview?`wird aus dem Profil übernommen`:`nicht im Profil hinterlegt`),1))],8,de)):(l(),p(n(S),{key:5,id:$(c),modelValue:n(J).answers[c.key],"onUpdate:modelValue":e=>n(J).answers[c.key]=e,type:{email:`email`,phone:`tel`,number:`number`,date:`date`}[c.type]??`text`,placeholder:c.placeholder,maxlength:c.type===`text`?c.max:void 0,min:c.type===`number`?c.min:void 0,max:c.type===`number`?c.max:void 0,"aria-invalid":!!Z(c)},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`type`,`placeholder`,`maxlength`,`min`,`max`,`aria-invalid`]))],64)),Z(c)?(l(),o(`p`,me,[t(f(Z(c))+` `,1),c.locked?(l(),o(`a`,he,`Profil öffnen`)):m(``,!0)])):c.locked?(l(),o(`p`,{key:3,id:`${$(c)}-locked`,class:`text-[13px] text-muted-foreground`},`Aus Ihrem Profil – nicht änderbar.`,8,ge)):c.help?(l(),o(`p`,_e,[t(f(c.help),1),c.type===`file`&&c.max_size?(l(),o(u,{key:0},[t(` (höchstens `+f(c.max_size)+` MB)`,1)],64)):m(``,!0)])):m(``,!0)],2))],64))),128)),a(`div`,ve,[e(n(b),{type:`submit`,disabled:n(J).processing},{default:d(()=>[n(J).processing?(l(),p(n(ie),{key:0,class:`animate-spin`})):(l(),p(n(y),{key:1})),t(` `+f(G.form.submit_label),1)]),_:1},8,[`disabled`]),g[1]||=a(`span`,{class:`text-xs text-muted-foreground`},`* Pflichtfeld`,-1)])],32)):(l(),o(`p`,O,`Dieses Formular nimmt keine Einsendungen mehr an.`))}};export{G as t}; \ No newline at end of file +import{D as e,E as t,On as n,Yt as r,Zn as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,wt as ee,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{_ as h,w as te,y as ne}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as g,i as re}from"./app-BNwrc_lv.js";import{O as ie}from"./dist-DtGNiYlK.js";import{C as ae,s as oe,v as se}from"./http-CAG9BrJF.js";import{t as ce}from"./eye-off-myis3scV.js";import{t as _}from"./lock-H7FAhSBr.js";import{t as v}from"./paperclip-DmVAQ5Y5.js";import{t as y}from"./send-6fmdiUe6.js";import{n as b}from"./button-CwUSbS9X.js";import{t as x}from"./NativeSelect-G3km7PmI.js";import{t as S}from"./Input-FGSb2-yK.js";import{t as C}from"./Textarea-DEFXqC2w.js";var w={key:0,class:`flex gap-3 rounded-lg border border-emerald-200 bg-emerald-50 p-5 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100`,role:`status`},T={class:`font-medium whitespace-pre-line`},E={key:0,class:`mt-1 text-sm opacity-80`},D={key:1,class:`rounded-lg border bg-muted px-5 py-4 text-sm`},O={key:2,class:`rounded-lg border bg-muted px-5 py-4 text-sm`},k={key:0,class:`flex items-start gap-2 rounded-md bg-muted px-3 py-2 text-[13px] text-muted-foreground @xl:col-span-2`},A={key:1,class:`rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive @xl:col-span-2`},j={key:0,class:`pt-2 text-lg font-semibold @xl:col-span-2`},M={key:1,class:`text-sm leading-relaxed whitespace-pre-line text-muted-foreground @xl:col-span-2`},N=[`for`],P=[`id`,`onUpdate:modelValue`,`aria-invalid`],F={key:0,class:`text-destructive`},I={key:0,class:`text-destructive`},L=[`aria-labelledby`],R=[`onUpdate:modelValue`,`name`,`value`],z=[`checked`,`onChange`],B={key:3,class:`grid gap-2`},le={key:0,class:`grid gap-1`},V={class:`min-w-0 flex-1 truncate`},H={class:`text-xs text-muted-foreground`},U=[`aria-label`,`onClick`],W={key:1,class:`flex h-10 cursor-pointer items-center justify-center gap-2 rounded-md border border-dashed text-sm text-muted-foreground hover:border-brand-300 hover:text-foreground`},ue=[`id`,`accept`,`multiple`,`onChange`],de=[`aria-describedby`],fe=[`id`],pe={key:1,class:`text-muted-foreground italic`},me={key:2,class:`text-[13px] text-destructive`},he={key:0,href:`/profil/bearbeiten`,class:`font-medium underline`},ge=[`id`],_e={key:4,class:`text-[13px] text-muted-foreground`},ve={class:`flex items-center gap-4 border-t pt-5 @xl:col-span-2`},G={__name:`FormRenderer`,props:{form:{type:Object,required:!0},compact:{type:Boolean,default:!1},preview:{type:Boolean,default:!1}},setup(G){let K=G,q=g(),ye=[`text`,`textarea`,`email`,`phone`,`number`,`date`,`select`,`radio`,`checkboxes`,`checkbox`,`file`];function be(e){let t=K.form.prefill?.[e.key];return e.type===`checkboxes`||e.type===`file`?[]:e.type===`checkbox`?!1:t??``}let J=re({answers:Object.fromEntries(K.form.fields.filter(e=>ye.includes(e.type)).map(e=>[e.key,be(e)]))}),xe=c(()=>q.props.flash?.form_submitted===K.form.id);function Y(e,t=0){if(!e.condition||t>10)return!0;let n=K.form.fields.find(t=>t.key===e.condition.field);if(!n||!Y(n,t+1))return!1;let r=J.answers[e.condition.field],i=(Array.isArray(r)?r:r===!0?[`1`]:r===!1||r===``||r==null?[]:[String(r)]).map(String),a=e.condition.value??``;switch(e.condition.operator){case`not_equals`:return!i.includes(a);case`filled`:return i.length>0;case`empty`:return i.length===0;default:return i.includes(a)}}let X=c(()=>K.form.fields.filter(e=>Y(e)));function Z(e){return J.errors[`answers.${e.key}`]??Object.entries(J.errors).find(([t])=>t.startsWith(`answers.${e.key}.`))?.[1]}function Q(e,t){let n=new Set(J.answers[e.key]);n.has(t)?n.delete(t):n.add(t),J.answers[e.key]=[...n]}function Se(e,t){let n=[...t.target.files??[]];J.answers[e.key]=e.multiple?[...J.answers[e.key],...n].slice(0,10):n.slice(0,1),t.target.value=``}function Ce(e,t){J.answers[e.key]=J.answers[e.key].filter((e,n)=>n!==t)}function we(){if(K.preview){oe.info(`Vorschau – es wird nichts gesendet.`);return}let e=new Set(X.value.map(e=>e.key));J.transform(t=>({answers:Object.fromEntries(Object.entries(t.answers).filter(([t])=>e.has(t)))})).post(K.form.url,{forceFormData:!0,preserveScroll:!0,onSuccess:()=>{q.props.flash?.form_submitted===K.form.id&&J.reset()}})}let Te=e=>e>1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`,$=e=>`f${K.form.id}-${e.key}`;return(c,g)=>xe.value?(l(),o(`div`,w,[e(n(ae),{class:`mt-0.5 size-5 shrink-0 text-emerald-600`}),a(`div`,null,[a(`p`,T,f(G.form.confirmation),1),G.form.send_copy?(l(),o(`p`,E,`Eine Kopie Ihrer Angaben ist per E-Mail unterwegs.`)):m(``,!0)])])):G.form.already_submitted?(l(),o(`p`,D,`Sie haben dieses Formular bereits ausgefüllt. Vielen Dank!`)):G.form.open?(l(),o(`form`,{key:3,class:`grid gap-5 @xl:grid-cols-2`,novalidate:``,onSubmit:te(we,[`prevent`])},[G.form.anonymous?(l(),o(`p`,k,[e(n(ce),{class:`mt-0.5 size-4 shrink-0`}),g[0]||=t(` Anonym: Ihr Name und Ihre E-Mail-Adresse werden nicht gespeichert. `,-1)])):m(``,!0),n(J).errors.form?(l(),o(`p`,A,f(n(J).errors.form),1)):m(``,!0),(l(!0),o(u,null,s(X.value,c=>(l(),o(u,{key:c.key},[c.type===`heading`?(l(),o(`h3`,j,f(c.text),1)):c.type===`paragraph`?(l(),o(`p`,M,f(c.text),1)):(l(),o(`div`,{key:2,class:i([`grid content-start gap-1.5`,c.width===`half`?``:`@xl:col-span-2`])},[c.type===`checkbox`?(l(),o(`label`,{key:0,for:$(c),class:`flex items-start gap-2.5 text-sm`},[r(a(`input`,{id:$(c),"onUpdate:modelValue":e=>n(J).answers[c.key]=e,type:`checkbox`,class:`mt-0.5 size-4 shrink-0 accent-[var(--brand)]`,"aria-invalid":!!Z(c)},null,8,P),[[h,n(J).answers[c.key]]]),a(`span`,null,[t(f(c.label),1),c.required?(l(),o(`span`,F,` *`)):m(``,!0)])],8,N)):(l(),o(u,{key:1},[(l(),p(ee([`radio`,`checkboxes`].includes(c.type)?`span`:`label`),{for:$(c),class:`text-[13px] font-medium`,id:`${$(c)}-label`},{default:d(()=>[t(f(c.label),1),c.required?(l(),o(`span`,I,` *`)):m(``,!0)]),_:2},1032,[`for`,`id`])),c.type===`textarea`?(l(),p(n(C),{key:0,id:$(c),modelValue:n(J).answers[c.key],"onUpdate:modelValue":e=>n(J).answers[c.key]=e,rows:c.rows??4,maxlength:c.max,"aria-invalid":!!Z(c)},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`rows`,`maxlength`,`aria-invalid`])):c.type===`select`?(l(),p(x,{key:1,id:$(c),modelValue:n(J).answers[c.key],"onUpdate:modelValue":e=>n(J).answers[c.key]=e,options:c.options.map(e=>({value:e,label:e})),placeholder:`Bitte wählen …`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`options`])):c.type===`radio`||c.type===`checkboxes`?(l(),o(`div`,{key:2,class:`grid gap-1.5`,role:`group`,"aria-labelledby":`${$(c)}-label`},[(l(!0),o(u,null,s(c.options,e=>(l(),o(`label`,{key:e,class:`flex items-center gap-2.5 text-sm`},[c.type===`radio`?r((l(),o(`input`,{key:0,"onUpdate:modelValue":e=>n(J).answers[c.key]=e,type:`radio`,name:$(c),value:e,class:`size-4 accent-[var(--brand)]`},null,8,R)),[[ne,n(J).answers[c.key]]]):(l(),o(`input`,{key:1,type:`checkbox`,checked:n(J).answers[c.key].includes(e),class:`size-4 accent-[var(--brand)]`,onChange:t=>Q(c,e)},null,40,z)),t(` `+f(e),1)]))),128))],8,L)):c.type===`file`?(l(),o(`div`,B,[n(J).answers[c.key].length?(l(),o(`ul`,le,[(l(!0),o(u,null,s(n(J).answers[c.key],(t,r)=>(l(),o(`li`,{key:r,class:`flex items-center gap-2 rounded-md border bg-card px-3 py-1.5 text-sm`},[e(n(v),{class:`size-4 shrink-0 text-muted-foreground`}),a(`span`,V,f(t.name),1),a(`span`,H,f(Te(t.size)),1),a(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,"aria-label":`${t.name} entfernen`,onClick:e=>Ce(c,r)},[e(n(se),{class:`size-3.5`})],8,U)]))),128))])):m(``,!0),c.multiple||!n(J).answers[c.key].length?(l(),o(`label`,W,[e(n(v),{class:`size-4`}),t(` `+f(c.multiple?`Dateien auswählen`:`Datei auswählen`)+` `,1),a(`input`,{id:$(c),type:`file`,class:`sr-only`,accept:c.accept,multiple:c.multiple,onChange:e=>Se(c,e)},null,40,ue)])):m(``,!0)])):c.locked?(l(),o(`div`,{key:4,class:`flex h-9 items-center gap-2 rounded-md border border-input bg-muted/60 px-3 text-sm`,"aria-describedby":`${$(c)}-locked`},[e(n(_),{class:`size-3.5 shrink-0 text-muted-foreground`}),n(J).answers[c.key]?(l(),o(`span`,{key:0,id:$(c),class:`truncate`},f(n(J).answers[c.key]),9,fe)):(l(),o(`span`,pe,f(G.preview?`wird aus dem Profil übernommen`:`nicht im Profil hinterlegt`),1))],8,de)):(l(),p(n(S),{key:5,id:$(c),modelValue:n(J).answers[c.key],"onUpdate:modelValue":e=>n(J).answers[c.key]=e,type:{email:`email`,phone:`tel`,number:`number`,date:`date`}[c.type]??`text`,placeholder:c.placeholder,maxlength:c.type===`text`?c.max:void 0,min:c.type===`number`?c.min:void 0,max:c.type===`number`?c.max:void 0,"aria-invalid":!!Z(c)},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`type`,`placeholder`,`maxlength`,`min`,`max`,`aria-invalid`]))],64)),Z(c)?(l(),o(`p`,me,[t(f(Z(c))+` `,1),c.locked?(l(),o(`a`,he,`Profil öffnen`)):m(``,!0)])):c.locked?(l(),o(`p`,{key:3,id:`${$(c)}-locked`,class:`text-[13px] text-muted-foreground`},`Aus Ihrem Profil – nicht änderbar.`,8,ge)):c.help?(l(),o(`p`,_e,[t(f(c.help),1),c.type===`file`&&c.max_size?(l(),o(u,{key:0},[t(` (höchstens `+f(c.max_size)+` MB)`,1)],64)):m(``,!0)])):m(``,!0)],2))],64))),128)),a(`div`,ve,[e(n(b),{type:`submit`,disabled:n(J).processing},{default:d(()=>[n(J).processing?(l(),p(n(ie),{key:0,class:`animate-spin`})):(l(),p(n(y),{key:1})),t(` `+f(G.form.submit_label),1)]),_:1},8,[`disabled`]),g[1]||=a(`span`,{class:`text-xs text-muted-foreground`},`* Pflichtfeld`,-1)])],32)):(l(),o(`p`,O,`Dieses Formular nimmt keine Einsendungen mehr an.`))}};export{G as t}; \ No newline at end of file diff --git a/public/build/assets/Gallery-BB6gBCuJ.js b/public/build/assets/Gallery-DUd_nJKW.js similarity index 96% rename from public/build/assets/Gallery-BB6gBCuJ.js rename to public/build/assets/Gallery-DUd_nJKW.js index 0d462ea0..cba643a4 100644 --- a/public/build/assets/Gallery-BB6gBCuJ.js +++ b/public/build/assets/Gallery-DUd_nJKW.js @@ -1 +1 @@ -import{D as e,E as t,J as n,On as r,Zn as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,vn as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{K as h}from"./AppIcon-0N56IC2z.js";import{t as g}from"./chevron-left-8GGLVOvJ.js";import{t as _}from"./chevron-right-C9w5cb2q.js";import{i as v,r as y,t as b}from"./dialog-uBUhf8w7.js";var x=[`aria-label`,`onClick`],S=[`src`,`alt`],C={key:1,class:`grid aspect-[4/3] place-items-center rounded-lg border border-dashed bg-muted text-muted-foreground`},w={key:2,class:`mt-1.5 text-xs text-muted-foreground`},T={key:0,class:`col-span-full text-sm text-muted-foreground`},E=[`src`,`alt`],D={class:`flex items-center justify-between gap-4 px-4 pt-1 pb-3 text-sm`},O={class:`text-white/80`},k={key:0,class:`shrink-0 text-white/60 tabular-nums`},A={__name:`Gallery`,props:{block:{type:Object,required:!0}},setup(A){let j=A,M=n(`pagebuilder:editing`,!1),N={2:`@xl:grid-cols-2`,3:`@xl:grid-cols-2 @3xl:grid-cols-3`,4:`@xl:grid-cols-3 @3xl:grid-cols-4`},P=c(()=>j.block.data.images.map((e,t)=>({...e,url:j.block.props?.urls?.[t]??null}))),F=c(()=>P.value.filter(e=>e.url)),I=p(null),L=c(()=>I.value===null?null:F.value[I.value]);function R(e){I.value=F.value.indexOf(e)}function z(e){I.value===null||F.value.length<2||(I.value=(I.value+e+F.value.length)%F.value.length)}function B(e){e.key===`ArrowRight`&&z(1),e.key===`ArrowLeft`&&z(-1)}let V=null,H=e=>V=e.touches[0].clientX;function U(e){if(V===null)return;let t=e.changedTouches[0].clientX-V;Math.abs(t)>50&&z(t<0?1:-1),V=null}return(n,c)=>(l(),o(u,null,[a(`div`,{class:i([`grid grid-cols-2 gap-3`,N[A.block.data.columns]])},[(l(!0),o(u,null,s(P.value,(t,n)=>(l(),o(`figure`,{key:n},[t.url?(l(),o(`button`,{key:0,type:`button`,class:`block w-full cursor-zoom-in overflow-hidden rounded-lg focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none`,"aria-label":`${t.alt||`Bild`} vergrößern`,onClick:e=>R(t)},[a(`img`,{src:t.url,alt:t.alt,loading:`lazy`,class:`aspect-[4/3] w-full object-cover transition-transform duration-300 hover:scale-[1.03]`},null,8,S)],8,x)):(l(),o(`div`,C,[e(r(h),{class:`size-6`})])),t.caption?(l(),o(`figcaption`,w,f(t.caption),1)):m(``,!0)]))),128)),r(M)&&!P.value.length?(l(),o(`p`,T,`Noch keine Bilder.`)):m(``,!0)],2),e(r(v),{open:L.value!==null,"onUpdate:open":c[2]||=e=>!e&&(I.value=null)},{default:d(()=>[e(r(y),{class:`max-w-6xl border-0 bg-black/95 p-0 text-white sm:max-w-6xl`,onKeydown:B},{default:d(()=>[e(r(b),{class:`sr-only`},{default:d(()=>[t(f(L.value?.alt||`Bild`),1)]),_:1}),a(`div`,{class:`relative`,onTouchstartPassive:H,onTouchend:U},[L.value?(l(),o(`img`,{key:L.value.url,src:L.value.url,alt:L.value.alt,class:`max-h-[82vh] w-full object-contain`},null,8,E)):m(``,!0),F.value.length>1?(l(),o(u,{key:1},[a(`button`,{type:`button`,class:`absolute top-1/2 left-3 grid size-11 -translate-y-1/2 place-items-center rounded-full bg-black/50 text-white hover:bg-black/75`,"aria-label":`Vorheriges Bild`,onClick:c[0]||=e=>z(-1)},[e(r(g),{class:`size-6`})]),a(`button`,{type:`button`,class:`absolute top-1/2 right-3 grid size-11 -translate-y-1/2 place-items-center rounded-full bg-black/50 text-white hover:bg-black/75`,"aria-label":`Nächstes Bild`,onClick:c[1]||=e=>z(1)},[e(r(_),{class:`size-6`})])],64)):m(``,!0)],32),a(`div`,D,[a(`p`,O,f(L.value?.caption),1),F.value.length>1?(l(),o(`span`,k,f(I.value+1)+` / `+f(F.value.length),1)):m(``,!0)])]),_:1})]),_:1},8,[`open`])],64))}};export{A as default}; \ No newline at end of file +import{D as e,E as t,J as n,On as r,Zn as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,vn as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{K as h}from"./AppIcon-nlhvQfK7.js";import{t as g}from"./chevron-left-8GGLVOvJ.js";import{t as _}from"./chevron-right-C9w5cb2q.js";import{i as v,r as y,t as b}from"./dialog-RK2mTeqi.js";var x=[`aria-label`,`onClick`],S=[`src`,`alt`],C={key:1,class:`grid aspect-[4/3] place-items-center rounded-lg border border-dashed bg-muted text-muted-foreground`},w={key:2,class:`mt-1.5 text-xs text-muted-foreground`},T={key:0,class:`col-span-full text-sm text-muted-foreground`},E=[`src`,`alt`],D={class:`flex items-center justify-between gap-4 px-4 pt-1 pb-3 text-sm`},O={class:`text-white/80`},k={key:0,class:`shrink-0 text-white/60 tabular-nums`},A={__name:`Gallery`,props:{block:{type:Object,required:!0}},setup(A){let j=A,M=n(`pagebuilder:editing`,!1),N={2:`@xl:grid-cols-2`,3:`@xl:grid-cols-2 @3xl:grid-cols-3`,4:`@xl:grid-cols-3 @3xl:grid-cols-4`},P=c(()=>j.block.data.images.map((e,t)=>({...e,url:j.block.props?.urls?.[t]??null}))),F=c(()=>P.value.filter(e=>e.url)),I=p(null),L=c(()=>I.value===null?null:F.value[I.value]);function R(e){I.value=F.value.indexOf(e)}function z(e){I.value===null||F.value.length<2||(I.value=(I.value+e+F.value.length)%F.value.length)}function B(e){e.key===`ArrowRight`&&z(1),e.key===`ArrowLeft`&&z(-1)}let V=null,H=e=>V=e.touches[0].clientX;function U(e){if(V===null)return;let t=e.changedTouches[0].clientX-V;Math.abs(t)>50&&z(t<0?1:-1),V=null}return(n,c)=>(l(),o(u,null,[a(`div`,{class:i([`grid grid-cols-2 gap-3`,N[A.block.data.columns]])},[(l(!0),o(u,null,s(P.value,(t,n)=>(l(),o(`figure`,{key:n},[t.url?(l(),o(`button`,{key:0,type:`button`,class:`block w-full cursor-zoom-in overflow-hidden rounded-lg focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none`,"aria-label":`${t.alt||`Bild`} vergrößern`,onClick:e=>R(t)},[a(`img`,{src:t.url,alt:t.alt,loading:`lazy`,class:`aspect-[4/3] w-full object-cover transition-transform duration-300 hover:scale-[1.03]`},null,8,S)],8,x)):(l(),o(`div`,C,[e(r(h),{class:`size-6`})])),t.caption?(l(),o(`figcaption`,w,f(t.caption),1)):m(``,!0)]))),128)),r(M)&&!P.value.length?(l(),o(`p`,T,`Noch keine Bilder.`)):m(``,!0)],2),e(r(v),{open:L.value!==null,"onUpdate:open":c[2]||=e=>!e&&(I.value=null)},{default:d(()=>[e(r(y),{class:`max-w-6xl border-0 bg-black/95 p-0 text-white sm:max-w-6xl`,onKeydown:B},{default:d(()=>[e(r(b),{class:`sr-only`},{default:d(()=>[t(f(L.value?.alt||`Bild`),1)]),_:1}),a(`div`,{class:`relative`,onTouchstartPassive:H,onTouchend:U},[L.value?(l(),o(`img`,{key:L.value.url,src:L.value.url,alt:L.value.alt,class:`max-h-[82vh] w-full object-contain`},null,8,E)):m(``,!0),F.value.length>1?(l(),o(u,{key:1},[a(`button`,{type:`button`,class:`absolute top-1/2 left-3 grid size-11 -translate-y-1/2 place-items-center rounded-full bg-black/50 text-white hover:bg-black/75`,"aria-label":`Vorheriges Bild`,onClick:c[0]||=e=>z(-1)},[e(r(g),{class:`size-6`})]),a(`button`,{type:`button`,class:`absolute top-1/2 right-3 grid size-11 -translate-y-1/2 place-items-center rounded-full bg-black/50 text-white hover:bg-black/75`,"aria-label":`Nächstes Bild`,onClick:c[1]||=e=>z(1)},[e(r(_),{class:`size-6`})])],64)):m(``,!0)],32),a(`div`,D,[a(`p`,O,f(L.value?.caption),1),F.value.length>1?(l(),o(`span`,k,f(I.value+1)+` / `+f(F.value.length),1)):m(``,!0)])]),_:1})]),_:1},8,[`open`])],64))}};export{A as default}; \ No newline at end of file diff --git a/public/build/assets/Greeting-DWCRBmCo.js b/public/build/assets/Greeting-BqqUXd60.js similarity index 92% rename from public/build/assets/Greeting-DWCRBmCo.js rename to public/build/assets/Greeting-BqqUXd60.js index 02c604e2..5dcdb08e 100644 --- a/public/build/assets/Greeting-DWCRBmCo.js +++ b/public/build/assets/Greeting-BqqUXd60.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,b as i,g as a,mt as o,qt as s,tr as c,v as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{a as u,r as d}from"./app-Bu3kn8yd.js";import{M as f,O as p,p as m}from"./AppIcon-0N56IC2z.js";import{i as h,r as g}from"./AppLayout-BxsYt2ib.js";var _={class:`overflow-hidden rounded-lg border bg-card`},v={class:`flex items-center justify-between gap-4 bg-brand px-6 py-6 text-brand-foreground`},y={class:`min-w-0`},b={class:`text-sm opacity-85`},x={class:`mt-0.5 text-[22px] leading-tight font-semibold tracking-tight break-words`},S={class:`mt-1.5 line-clamp-2 text-[13px] opacity-85`},C={class:`grid grid-cols-3 divide-x`,"aria-label":`Mein Bereich`},w={key:0,href:`/admin`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},T={__name:`GreetingCard`,props:{user:{type:Object,required:!0},profile:{type:Object,required:!0},greeting:{type:String,required:!0}},setup(a){return(u,T)=>(o(),i(`section`,_,[r(`div`,v,[r(`div`,y,[r(`div`,b,c(a.greeting)+`,`,1),r(`div`,x,c(a.user.name),1),r(`div`,S,c(a.profile.job_title||`Schön, dass Sie da sind!`),1)]),e(m,{person:a.user,class:`size-16 shrink-0 text-lg ring-4 ring-white/25 xl:size-20 xl:text-xl`},null,8,[`person`])]),r(`nav`,C,[e(n(d),{href:`/personen/${a.user.id}`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(p),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[0]||=t(` Mein Profil `,-1)]),_:1},8,[`href`]),e(n(d),{href:`/profil/bearbeiten`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(g),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[1]||=t(` Profil bearbeiten `,-1)]),_:1}),a.user.can_admin?(o(),i(`a`,w,[e(n(f),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[2]||=t(` Administration `,-1)])):(o(),l(n(d),{key:1,href:`/logout`,method:`post`,as:`button`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(h),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[3]||=t(` Abmelden `,-1)]),_:1}))])]))}},E={__name:`Greeting`,props:{profile:{type:Object,required:!0}},setup(e){let t=e,n=u(),r=a(()=>({...n.props.auth.user,avatar_url:t.profile.avatar_url})),i=a(()=>{let e=new Date().getHours();return e<11?`Guten Morgen`:e<18?`Guten Tag`:`Guten Abend`});return(t,n)=>(o(),l(T,{user:r.value,profile:e.profile,greeting:i.value},null,8,[`user`,`profile`,`greeting`]))}};export{E as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,b as i,g as a,mt as o,qt as s,tr as c,v as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{a as u,r as d}from"./app-BNwrc_lv.js";import{M as f,O as p,p as m}from"./AppIcon-nlhvQfK7.js";import{i as h,r as g}from"./AppLayout-esQiy2nD.js";var _={class:`overflow-hidden rounded-lg border bg-card`},v={class:`flex items-center justify-between gap-4 bg-brand px-6 py-6 text-brand-foreground`},y={class:`min-w-0`},b={class:`text-sm opacity-85`},x={class:`mt-0.5 text-[22px] leading-tight font-semibold tracking-tight break-words`},S={class:`mt-1.5 line-clamp-2 text-[13px] opacity-85`},C={class:`grid grid-cols-3 divide-x`,"aria-label":`Mein Bereich`},w={key:0,href:`/admin`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},T={__name:`GreetingCard`,props:{user:{type:Object,required:!0},profile:{type:Object,required:!0},greeting:{type:String,required:!0}},setup(a){return(u,T)=>(o(),i(`section`,_,[r(`div`,v,[r(`div`,y,[r(`div`,b,c(a.greeting)+`,`,1),r(`div`,x,c(a.user.name),1),r(`div`,S,c(a.profile.job_title||`Schön, dass Sie da sind!`),1)]),e(m,{person:a.user,class:`size-16 shrink-0 text-lg ring-4 ring-white/25 xl:size-20 xl:text-xl`},null,8,[`person`])]),r(`nav`,C,[e(n(d),{href:`/personen/${a.user.id}`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(p),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[0]||=t(` Mein Profil `,-1)]),_:1},8,[`href`]),e(n(d),{href:`/profil/bearbeiten`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(g),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[1]||=t(` Profil bearbeiten `,-1)]),_:1}),a.user.can_admin?(o(),i(`a`,w,[e(n(f),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[2]||=t(` Administration `,-1)])):(o(),l(n(d),{key:1,href:`/logout`,method:`post`,as:`button`,class:`flex flex-col items-center gap-2 px-2 py-4 text-center text-xs font-medium text-foreground/80 hover:bg-accent hover:text-foreground`},{default:s(()=>[e(n(h),{class:`size-5 text-brand-text`,"stroke-width":1.75}),T[3]||=t(` Abmelden `,-1)]),_:1}))])]))}},E={__name:`Greeting`,props:{profile:{type:Object,required:!0}},setup(e){let t=e,n=u(),r=a(()=>({...n.props.auth.user,avatar_url:t.profile.avatar_url})),i=a(()=>{let e=new Date().getHours();return e<11?`Guten Morgen`:e<18?`Guten Tag`:`Guten Abend`});return(t,n)=>(o(),l(T,{user:r.value,profile:e.profile,greeting:i.value},null,8,[`user`,`profile`,`greeting`]))}};export{E as default}; \ No newline at end of file diff --git a/public/build/assets/Greeting-K-a792Bo.js b/public/build/assets/Greeting-DFGlck2e.js similarity index 93% rename from public/build/assets/Greeting-K-a792Bo.js rename to public/build/assets/Greeting-DFGlck2e.js index 18bb79d2..4b3b19b2 100644 --- a/public/build/assets/Greeting-K-a792Bo.js +++ b/public/build/assets/Greeting-DFGlck2e.js @@ -1 +1 @@ -import{D as e,On as t,T as n,_ as r,b as i,mt as a,tr as o,vn as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{nt as l}from"./AppIcon-0N56IC2z.js";import{_ as u}from"./http-DmyDwIce.js";var d={key:0,class:`relative overflow-hidden rounded-lg bg-brand text-brand-foreground`,role:`status`},f={class:`relative flex items-center gap-4 px-5 py-5 sm:px-8`},p={class:`grid size-12 shrink-0 place-items-center rounded-full bg-white/15`},m={class:`min-w-0 flex-1`},h={class:`text-xl font-semibold tracking-tight`},g={__name:`Greeting`,props:{name:{type:String,required:!0}},setup(g){let _=g,v=`inhaus.birthday-greeting.${new Date().toISOString().slice(0,10)}`,y=s(!1);try{y.value=localStorage.getItem(v)===`1`}catch{}function b(){y.value=!0;try{localStorage.setItem(v,`1`)}catch{}}return(s,g)=>y.value?c(``,!0):(a(),i(`section`,d,[g[1]||=n(``,1),r(`div`,f,[r(`span`,p,[e(t(l),{class:`size-6`})]),r(`div`,m,[r(`p`,h,`Alles Gute zum Geburtstag, `+o(_.name)+`!`,1),g[0]||=r(`p`,{class:`mt-0.5 text-sm opacity-90`},`Wir wünschen Ihnen einen schönen Tag.`,-1)]),r(`button`,{type:`button`,class:`grid size-9 shrink-0 place-items-center rounded-md hover:bg-white/15`,"aria-label":`Glückwunsch ausblenden`,onClick:b},[e(t(u),{class:`size-5`})])])]))}};export{g as default}; \ No newline at end of file +import{D as e,On as t,T as n,_ as r,b as i,mt as a,tr as o,vn as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{nt as l}from"./AppIcon-nlhvQfK7.js";import{v as u}from"./http-CAG9BrJF.js";var d={key:0,class:`relative overflow-hidden rounded-lg bg-brand text-brand-foreground`,role:`status`},f={class:`relative flex items-center gap-4 px-5 py-5 sm:px-8`},p={class:`grid size-12 shrink-0 place-items-center rounded-full bg-white/15`},m={class:`min-w-0 flex-1`},h={class:`text-xl font-semibold tracking-tight`},g={__name:`Greeting`,props:{name:{type:String,required:!0}},setup(g){let _=g,v=`inhaus.birthday-greeting.${new Date().toISOString().slice(0,10)}`,y=s(!1);try{y.value=localStorage.getItem(v)===`1`}catch{}function b(){y.value=!0;try{localStorage.setItem(v,`1`)}catch{}}return(s,g)=>y.value?c(``,!0):(a(),i(`section`,d,[g[1]||=n(``,1),r(`div`,f,[r(`span`,p,[e(t(l),{class:`size-6`})]),r(`div`,m,[r(`p`,h,`Alles Gute zum Geburtstag, `+o(_.name)+`!`,1),g[0]||=r(`p`,{class:`mt-0.5 text-sm opacity-90`},`Wir wünschen Ihnen einen schönen Tag.`,-1)]),r(`button`,{type:`button`,class:`grid size-9 shrink-0 place-items-center rounded-md hover:bg-white/15`,"aria-label":`Glückwunsch ausblenden`,onClick:b},[e(t(u),{class:`size-5`})])])]))}};export{g as default}; \ No newline at end of file diff --git a/public/build/assets/GuestLayout-CAwpgUCY.js b/public/build/assets/GuestLayout-B2rtJjbh.js similarity index 96% rename from public/build/assets/GuestLayout-CAwpgUCY.js rename to public/build/assets/GuestLayout-B2rtJjbh.js index 7c337486..bb8c1c71 100644 --- a/public/build/assets/GuestLayout-CAwpgUCY.js +++ b/public/build/assets/GuestLayout-B2rtJjbh.js @@ -1 +1 @@ -import{D as e,On as t,Zn as n,_ as r,b as i,g as a,mt as o,o as s,tr as c,xt as l,y as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{a as d,n as f}from"./app-Bu3kn8yd.js";import{t as p}from"./BrandLogo-1xuP9ByR.js";var m={key:0,class:`bg-amber-400 px-4 py-1.5 text-center text-[13px] font-medium text-amber-950`},h={key:1,class:`relative grid min-h-screen place-items-center bg-brand px-4 py-12`},g=[`src`],_={key:1,class:`absolute inset-0 bg-black/35`},v={class:`relative w-full max-w-[440px]`},y={class:`rounded-xl border bg-card p-8 text-card-foreground shadow-xl sm:p-10`},b={class:`mb-8`},x={class:`text-2xl font-semibold tracking-tight`},S={key:0,class:`mt-2 text-sm text-muted-foreground`},C={class:`mt-8`},w={key:0,class:`mt-6 text-center text-sm text-white/90 [text-shadow:0_1px_2px_rgb(0_0_0/0.4)]`},T={key:2,class:`grid min-h-screen lg:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]`},E={class:`relative hidden overflow-hidden bg-brand text-brand-foreground lg:flex lg:flex-col lg:justify-between lg:p-12`},D=[`src`],O={key:1,class:`pointer-events-none absolute inset-0 opacity-[0.12]`,style:{"background-image":`radial-gradient(circle at 20% 20%, white 0, transparent 45%), radial-gradient(circle at 90% 80%, white 0, transparent 40%)`}},k={key:0,class:`text-3xl leading-tight font-semibold tracking-tight`},A={class:`mt-4 text-[15px] opacity-85`},j={class:`flex items-center justify-center bg-background px-4 py-12 sm:px-8`},M={class:`w-full max-w-[400px]`},N={class:`mb-10 lg:hidden`},P={class:`text-2xl font-semibold tracking-tight`},F={key:0,class:`mt-2 text-sm text-muted-foreground`},I={class:`mt-8`},L={__name:`GuestLayout`,props:{title:{type:String,default:``},description:{type:String,default:``}},setup(L){let R=L,z=a(()=>d().props.branding),B=a(()=>z.value.login??{layout:`split`});return(a,d)=>(o(),i(s,null,[e(t(f),{title:R.title},null,8,[`title`]),z.value.preview?(o(),i(`div`,m,`Vorschau des Entwurfs`)):u(``,!0),B.value.layout===`centered`?(o(),i(`div`,h,[B.value.image_url?(o(),i(`img`,{key:0,src:B.value.image_url,alt:``,class:`absolute inset-0 size-full object-cover`},null,8,g)):u(``,!0),B.value.image_url?(o(),i(`div`,_)):u(``,!0),r(`div`,v,[r(`div`,y,[r(`div`,b,[e(p)]),r(`h1`,x,c(R.title),1),R.description?(o(),i(`p`,S,c(R.description),1)):u(``,!0),r(`div`,C,[l(a.$slots,`default`)])]),B.value.title?(o(),i(`p`,w,c(B.value.title),1)):u(``,!0)])])):(o(),i(`div`,T,[r(`aside`,E,[B.value.image_url?(o(),i(s,{key:0},[r(`img`,{src:B.value.image_url,alt:``,class:`absolute inset-0 size-full object-cover`},null,8,D),d[0]||=r(`div`,{class:`absolute inset-0 bg-gradient-to-t from-black/70 via-black/25 to-black/10`},null,-1)],64)):(o(),i(`div`,O)),e(p,{inverted:``,class:n([`relative`,B.value.image_url?`text-white`:``])},null,8,[`class`]),r(`div`,{class:n([`relative max-w-md`,B.value.image_url?`text-white`:``])},[B.value.title?(o(),i(`p`,k,c(B.value.title),1)):u(``,!0),r(`p`,A,c(B.value.text||`Neuigkeiten, Ansprechpartner und Anwendungen von ${z.value.portal_name}.`),1)],2),r(`p`,{class:n([`relative text-xs opacity-70`,B.value.image_url?`text-white`:``])},`© `+c(new Date().getFullYear())+` `+c(z.value.portal_name),3)]),r(`main`,j,[r(`div`,M,[r(`div`,N,[e(p)]),r(`h1`,P,c(R.title),1),R.description?(o(),i(`p`,F,c(R.description),1)):u(``,!0),r(`div`,I,[l(a.$slots,`default`)])])])]))],64))}};export{L as t}; \ No newline at end of file +import{D as e,On as t,Zn as n,_ as r,b as i,g as a,mt as o,o as s,tr as c,xt as l,y as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{a as d,n as f}from"./app-BNwrc_lv.js";import{t as p}from"./BrandLogo-B9g_TCsV.js";var m={key:0,class:`bg-amber-400 px-4 py-1.5 text-center text-[13px] font-medium text-amber-950`},h={key:1,class:`relative grid min-h-screen place-items-center bg-brand px-4 py-12`},g=[`src`],_={key:1,class:`absolute inset-0 bg-black/35`},v={class:`relative w-full max-w-[440px]`},y={class:`rounded-xl border bg-card p-8 text-card-foreground shadow-xl sm:p-10`},b={class:`mb-8`},x={class:`text-2xl font-semibold tracking-tight`},S={key:0,class:`mt-2 text-sm text-muted-foreground`},C={class:`mt-8`},w={key:0,class:`mt-6 text-center text-sm text-white/90 [text-shadow:0_1px_2px_rgb(0_0_0/0.4)]`},T={key:2,class:`grid min-h-screen lg:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]`},E={class:`relative hidden overflow-hidden bg-brand text-brand-foreground lg:flex lg:flex-col lg:justify-between lg:p-12`},D=[`src`],O={key:1,class:`pointer-events-none absolute inset-0 opacity-[0.12]`,style:{"background-image":`radial-gradient(circle at 20% 20%, white 0, transparent 45%), radial-gradient(circle at 90% 80%, white 0, transparent 40%)`}},k={key:0,class:`text-3xl leading-tight font-semibold tracking-tight`},A={class:`mt-4 text-[15px] opacity-85`},j={class:`flex items-center justify-center bg-background px-4 py-12 sm:px-8`},M={class:`w-full max-w-[400px]`},N={class:`mb-10 lg:hidden`},P={class:`text-2xl font-semibold tracking-tight`},F={key:0,class:`mt-2 text-sm text-muted-foreground`},I={class:`mt-8`},L={__name:`GuestLayout`,props:{title:{type:String,default:``},description:{type:String,default:``}},setup(L){let R=L,z=a(()=>d().props.branding),B=a(()=>z.value.login??{layout:`split`});return(a,d)=>(o(),i(s,null,[e(t(f),{title:R.title},null,8,[`title`]),z.value.preview?(o(),i(`div`,m,`Vorschau des Entwurfs`)):u(``,!0),B.value.layout===`centered`?(o(),i(`div`,h,[B.value.image_url?(o(),i(`img`,{key:0,src:B.value.image_url,alt:``,class:`absolute inset-0 size-full object-cover`},null,8,g)):u(``,!0),B.value.image_url?(o(),i(`div`,_)):u(``,!0),r(`div`,v,[r(`div`,y,[r(`div`,b,[e(p)]),r(`h1`,x,c(R.title),1),R.description?(o(),i(`p`,S,c(R.description),1)):u(``,!0),r(`div`,C,[l(a.$slots,`default`)])]),B.value.title?(o(),i(`p`,w,c(B.value.title),1)):u(``,!0)])])):(o(),i(`div`,T,[r(`aside`,E,[B.value.image_url?(o(),i(s,{key:0},[r(`img`,{src:B.value.image_url,alt:``,class:`absolute inset-0 size-full object-cover`},null,8,D),d[0]||=r(`div`,{class:`absolute inset-0 bg-gradient-to-t from-black/70 via-black/25 to-black/10`},null,-1)],64)):(o(),i(`div`,O)),e(p,{inverted:``,class:n([`relative`,B.value.image_url?`text-white`:``])},null,8,[`class`]),r(`div`,{class:n([`relative max-w-md`,B.value.image_url?`text-white`:``])},[B.value.title?(o(),i(`p`,k,c(B.value.title),1)):u(``,!0),r(`p`,A,c(B.value.text||`Neuigkeiten, Ansprechpartner und Anwendungen von ${z.value.portal_name}.`),1)],2),r(`p`,{class:n([`relative text-xs opacity-70`,B.value.image_url?`text-white`:``])},`© `+c(new Date().getFullYear())+` `+c(z.value.portal_name),3)]),r(`main`,j,[r(`div`,M,[r(`div`,N,[e(p)]),r(`h1`,P,c(R.title),1),R.description?(o(),i(`p`,F,c(R.description),1)):u(``,!0),r(`div`,I,[l(a.$slots,`default`)])])])]))],64))}};export{L as t}; \ No newline at end of file diff --git a/public/build/assets/Hero-VuaFLBZ6.js b/public/build/assets/Hero-DoAmerYi.js similarity index 90% rename from public/build/assets/Hero-VuaFLBZ6.js rename to public/build/assets/Hero-DoAmerYi.js index ef53c480..70f6b562 100644 --- a/public/build/assets/Hero-VuaFLBZ6.js +++ b/public/build/assets/Hero-DoAmerYi.js @@ -1 +1 @@ -import{On as e,Zn as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as l}from"./button-ZHC5mKey.js";var u=[`src`],d={class:`relative max-w-2xl p-6 @3xl:p-10`},f={key:0,class:`text-2xl font-semibold tracking-tight @3xl:text-3xl`},p={key:1,class:`mt-2 text-[15px] leading-relaxed text-white/90 @3xl:text-base`},m=[`href`],h={__name:`Hero`,props:{block:{type:Object,required:!0}},setup(h){let g={small:`min-h-48`,medium:`min-h-72`,large:`min-h-96`};return(_,v)=>(i(),r(`section`,{class:t([`relative flex items-end overflow-hidden rounded-lg bg-brand text-white`,g[h.block.data.height]])},[h.block.props?.url?(i(),r(`img`,{key:0,src:h.block.props.url,alt:``,class:`absolute inset-0 size-full object-cover`},null,8,u)):c(``,!0),v[0]||=n(`div`,{class:`absolute inset-0 bg-gradient-to-t from-black/70 via-black/30 to-transparent`},null,-1),n(`div`,d,[h.block.data.title?(i(),r(`h2`,f,o(h.block.data.title),1)):c(``,!0),h.block.data.text?(i(),r(`p`,p,o(h.block.data.text),1)):c(``,!0),h.block.data.button_label&&h.block.data.button_url?(i(),s(e(l),{key:2,"as-child":``,class:`mt-5 bg-white text-neutral-900 hover:bg-white/90`},{default:a(()=>[n(`a`,{href:h.block.data.button_url},o(h.block.data.button_label),9,m)]),_:1})):c(``,!0)])],2))}};export{h as default}; \ No newline at end of file +import{On as e,Zn as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as l}from"./button-CwUSbS9X.js";var u=[`src`],d={class:`relative max-w-2xl p-6 @3xl:p-10`},f={key:0,class:`text-2xl font-semibold tracking-tight @3xl:text-3xl`},p={key:1,class:`mt-2 text-[15px] leading-relaxed text-white/90 @3xl:text-base`},m=[`href`],h={__name:`Hero`,props:{block:{type:Object,required:!0}},setup(h){let g={small:`min-h-48`,medium:`min-h-72`,large:`min-h-96`};return(_,v)=>(i(),r(`section`,{class:t([`relative flex items-end overflow-hidden rounded-lg bg-brand text-white`,g[h.block.data.height]])},[h.block.props?.url?(i(),r(`img`,{key:0,src:h.block.props.url,alt:``,class:`absolute inset-0 size-full object-cover`},null,8,u)):c(``,!0),v[0]||=n(`div`,{class:`absolute inset-0 bg-gradient-to-t from-black/70 via-black/30 to-transparent`},null,-1),n(`div`,d,[h.block.data.title?(i(),r(`h2`,f,o(h.block.data.title),1)):c(``,!0),h.block.data.text?(i(),r(`p`,p,o(h.block.data.text),1)):c(``,!0),h.block.data.button_label&&h.block.data.button_url?(i(),s(e(l),{key:2,"as-child":``,class:`mt-5 bg-white text-neutral-900 hover:bg-white/90`},{default:a(()=>[n(`a`,{href:h.block.data.button_url},o(h.block.data.button_label),9,m)]),_:1})):c(``,!0)])],2))}};export{h as default}; \ No newline at end of file diff --git a/public/build/assets/Hero-CJbbm1yG.js b/public/build/assets/Hero-KYOmvKSH.js similarity index 96% rename from public/build/assets/Hero-CJbbm1yG.js rename to public/build/assets/Hero-KYOmvKSH.js index b1f3f97a..8513fb90 100644 --- a/public/build/assets/Hero-CJbbm1yG.js +++ b/public/build/assets/Hero-KYOmvKSH.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,ct as s,g as c,it as l,mt as u,o as d,qt as f,tr as p,v as m,vn as h,y as g}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as _}from"./app-Bu3kn8yd.js";import{k as v}from"./dist-DtGNiYlK.js";import{a as y}from"./AppLayout-BxsYt2ib.js";import{t as b}from"./chevron-left-8GGLVOvJ.js";import{t as x}from"./chevron-right-C9w5cb2q.js";import{t as S}from"./play-GbhjcPFH.js";var C=v({name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]}),w=[`src`,`aria-hidden`,`loading`],T={class:`flex h-full flex-col justify-end p-6 sm:max-w-[65%] sm:justify-center sm:p-10`,"aria-live":`polite`},E={key:0,class:`mb-3 w-fit rounded-sm bg-brand px-2 py-0.5 text-[11px] font-semibold tracking-wide text-brand-foreground uppercase`},D={class:`text-2xl leading-tight font-semibold tracking-tight sm:text-[32px]`},O={key:1,class:`mt-3 line-clamp-3 hidden text-[15px] text-white/85 sm:block`},k={key:0,class:`absolute right-4 bottom-4 flex items-center gap-2 sm:right-6 sm:bottom-6`},A={class:`flex items-center gap-1.5 px-1`},j=[`aria-label`,`aria-current`,`onClick`],M=[`aria-label`],N={__name:`HeroSlider`,props:{posts:{type:Array,required:!0}},setup(v){let N=v,P=h(0),F=h(!1),I=c(()=>N.posts[P.value]),L=null;function R(e){P.value=(e+N.posts.length)%N.posts.length}function z(){B(),N.posts.length>1&&!F.value&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&(L=setInterval(()=>R(P.value+1),7e3))}function B(){clearInterval(L)}function V(){F.value=!F.value,z()}return s(z),l(B),(s,c)=>(u(),a(`section`,{class:`relative isolate aspect-[16/10] overflow-hidden rounded-lg bg-brand-950 text-white sm:aspect-[16/9] lg:aspect-auto lg:h-full lg:min-h-[400px]`,"aria-roledescription":`Karussell`,"aria-label":`Hervorgehobene Neuigkeiten`,onMouseenter:B,onMouseleave:z,onFocusin:B,onFocusout:z},[(u(!0),a(d,null,o(v.posts,(e,t)=>(u(),a(`img`,{key:e.id,src:e.cover_url,alt:``,"aria-hidden":t!==P.value,loading:t===0?`eager`:`lazy`,class:r([`absolute inset-0 -z-10 size-full object-cover transition-opacity duration-700`,t===P.value?`opacity-100`:`opacity-0`])},null,10,w))),128)),c[3]||=i(`div`,{class:`absolute inset-0 -z-10 bg-gradient-to-t from-black/80 via-black/35 to-black/5 sm:bg-gradient-to-r sm:from-black/75 sm:via-black/40 sm:to-transparent`},null,-1),i(`div`,T,[I.value.category?(u(),a(`span`,E,p(I.value.category.name),1)):g(``,!0),i(`h2`,D,p(I.value.title),1),I.value.teaser?(u(),a(`p`,O,p(I.value.teaser),1)):g(``,!0),e(n(_),{href:`/neuigkeiten/${I.value.slug}`,class:`mt-5 inline-flex w-fit items-center gap-2 rounded-md bg-brand px-4 py-2.5 text-sm font-medium text-brand-foreground transition-colors hover:bg-brand-700`},{default:f(()=>[c[2]||=t(` Mehr erfahren `,-1),e(n(y),{class:`size-4`})]),_:1},8,[`href`])]),v.posts.length>1?(u(),a(`div`,k,[i(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":`Vorheriger Beitrag`,onClick:c[0]||=e=>R(P.value-1)},[e(n(b),{class:`size-5`})]),i(`div`,A,[(u(!0),a(d,null,o(v.posts,(e,t)=>(u(),a(`button`,{key:e.id,type:`button`,class:r([`h-1.5 rounded-full transition-all`,t===P.value?`w-6 bg-white`:`w-1.5 bg-white/50 hover:bg-white/80`]),"aria-label":`Beitrag ${t+1} von ${v.posts.length}`,"aria-current":t===P.value,onClick:e=>R(t)},null,10,j))),128))]),i(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":`Nächster Beitrag`,onClick:c[1]||=e=>R(P.value+1)},[e(n(x),{class:`size-5`})]),i(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":F.value?`Automatisch weiterblättern`:`Anhalten`,onClick:V},[F.value?(u(),m(n(S),{key:0,class:`size-4`})):(u(),m(n(C),{key:1,class:`size-4`}))],8,M)])):g(``,!0)],32))}},P={__name:`Hero`,props:{posts:{type:Array,required:!0}},setup(e){return(t,n)=>(u(),m(N,{posts:e.posts,class:`h-full`},null,8,[`posts`]))}};export{P as default}; \ No newline at end of file +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,ct as s,g as c,it as l,mt as u,o as d,qt as f,tr as p,v as m,vn as h,y as g}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as _}from"./app-BNwrc_lv.js";import{k as v}from"./dist-DtGNiYlK.js";import{a as y}from"./AppLayout-esQiy2nD.js";import{t as b}from"./chevron-left-8GGLVOvJ.js";import{t as x}from"./chevron-right-C9w5cb2q.js";import{t as S}from"./play-GbhjcPFH.js";var C=v({name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]}),w=[`src`,`aria-hidden`,`loading`],T={class:`flex h-full flex-col justify-end p-6 sm:max-w-[65%] sm:justify-center sm:p-10`,"aria-live":`polite`},E={key:0,class:`mb-3 w-fit rounded-sm bg-brand px-2 py-0.5 text-[11px] font-semibold tracking-wide text-brand-foreground uppercase`},D={class:`text-2xl leading-tight font-semibold tracking-tight sm:text-[32px]`},O={key:1,class:`mt-3 line-clamp-3 hidden text-[15px] text-white/85 sm:block`},k={key:0,class:`absolute right-4 bottom-4 flex items-center gap-2 sm:right-6 sm:bottom-6`},A={class:`flex items-center gap-1.5 px-1`},j=[`aria-label`,`aria-current`,`onClick`],M=[`aria-label`],N={__name:`HeroSlider`,props:{posts:{type:Array,required:!0}},setup(v){let N=v,P=h(0),F=h(!1),I=c(()=>N.posts[P.value]),L=null;function R(e){P.value=(e+N.posts.length)%N.posts.length}function z(){B(),N.posts.length>1&&!F.value&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&(L=setInterval(()=>R(P.value+1),7e3))}function B(){clearInterval(L)}function V(){F.value=!F.value,z()}return s(z),l(B),(s,c)=>(u(),a(`section`,{class:`relative isolate aspect-[16/10] overflow-hidden rounded-lg bg-brand-950 text-white sm:aspect-[16/9] lg:aspect-auto lg:h-full lg:min-h-[400px]`,"aria-roledescription":`Karussell`,"aria-label":`Hervorgehobene Neuigkeiten`,onMouseenter:B,onMouseleave:z,onFocusin:B,onFocusout:z},[(u(!0),a(d,null,o(v.posts,(e,t)=>(u(),a(`img`,{key:e.id,src:e.cover_url,alt:``,"aria-hidden":t!==P.value,loading:t===0?`eager`:`lazy`,class:r([`absolute inset-0 -z-10 size-full object-cover transition-opacity duration-700`,t===P.value?`opacity-100`:`opacity-0`])},null,10,w))),128)),c[3]||=i(`div`,{class:`absolute inset-0 -z-10 bg-gradient-to-t from-black/80 via-black/35 to-black/5 sm:bg-gradient-to-r sm:from-black/75 sm:via-black/40 sm:to-transparent`},null,-1),i(`div`,T,[I.value.category?(u(),a(`span`,E,p(I.value.category.name),1)):g(``,!0),i(`h2`,D,p(I.value.title),1),I.value.teaser?(u(),a(`p`,O,p(I.value.teaser),1)):g(``,!0),e(n(_),{href:`/neuigkeiten/${I.value.slug}`,class:`mt-5 inline-flex w-fit items-center gap-2 rounded-md bg-brand px-4 py-2.5 text-sm font-medium text-brand-foreground transition-colors hover:bg-brand-700`},{default:f(()=>[c[2]||=t(` Mehr erfahren `,-1),e(n(y),{class:`size-4`})]),_:1},8,[`href`])]),v.posts.length>1?(u(),a(`div`,k,[i(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":`Vorheriger Beitrag`,onClick:c[0]||=e=>R(P.value-1)},[e(n(b),{class:`size-5`})]),i(`div`,A,[(u(!0),a(d,null,o(v.posts,(e,t)=>(u(),a(`button`,{key:e.id,type:`button`,class:r([`h-1.5 rounded-full transition-all`,t===P.value?`w-6 bg-white`:`w-1.5 bg-white/50 hover:bg-white/80`]),"aria-label":`Beitrag ${t+1} von ${v.posts.length}`,"aria-current":t===P.value,onClick:e=>R(t)},null,10,j))),128))]),i(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":`Nächster Beitrag`,onClick:c[1]||=e=>R(P.value+1)},[e(n(x),{class:`size-5`})]),i(`button`,{type:`button`,class:`grid size-9 place-items-center rounded-full bg-black/35 hover:bg-black/55`,"aria-label":F.value?`Automatisch weiterblättern`:`Anhalten`,onClick:V},[F.value?(u(),m(n(S),{key:0,class:`size-4`})):(u(),m(n(C),{key:1,class:`size-4`}))],8,M)])):g(``,!0)],32))}},P={__name:`Hero`,props:{posts:{type:Array,required:!0}},setup(e){return(t,n)=>(u(),m(N,{posts:e.posts,class:`h-full`},null,8,[`posts`]))}};export{P as default}; \ No newline at end of file diff --git a/public/build/assets/IconList-CCXxiN3s.js b/public/build/assets/IconList-yxArjGGl.js similarity index 94% rename from public/build/assets/IconList-CCXxiN3s.js rename to public/build/assets/IconList-yxArjGGl.js index 45514fd2..a206e70e 100644 --- a/public/build/assets/IconList-CCXxiN3s.js +++ b/public/build/assets/IconList-yxArjGGl.js @@ -1 +1 @@ -import{D as e,Zn as t,_ as n,b as r,bt as i,mt as a,o,qt as s,tr as c,v as l,wt as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as f}from"./AppIcon-0N56IC2z.js";var p={class:`grid size-10 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-text`},m={class:`min-w-0`},h={key:0,class:`mt-0.5 block text-sm leading-relaxed whitespace-pre-line text-muted-foreground`},g={__name:`IconList`,props:{block:{type:Object,required:!0}},setup(g){return(_,v)=>(a(),r(`ul`,{class:t(g.block.data.layout===`grid`?`grid gap-4 @xl:grid-cols-2 @4xl:grid-cols-3`:`grid gap-4`)},[(a(!0),r(o,null,i(g.block.data.items,(i,o)=>(a(),r(`li`,{key:o},[(a(),l(u(i.url?`a`:`div`),{href:i.url||void 0,class:t([`flex gap-4`,[g.block.data.layout===`grid`?`h-full rounded-lg border bg-card p-4`:``,i.url?`group`:``]])},{default:s(()=>[n(`span`,p,[e(f,{name:i.icon||`link`,class:`size-5`},null,8,[`name`])]),n(`span`,m,[n(`span`,{class:t([`block font-medium`,{"group-hover:underline":i.url}])},c(i.title),3),i.text?(a(),r(`span`,h,c(i.text),1)):d(``,!0)])]),_:2},1032,[`href`,`class`]))]))),128))],2))}};export{g as default}; \ No newline at end of file +import{D as e,Zn as t,_ as n,b as r,bt as i,mt as a,o,qt as s,tr as c,v as l,wt as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as f}from"./AppIcon-nlhvQfK7.js";var p={class:`grid size-10 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-text`},m={class:`min-w-0`},h={key:0,class:`mt-0.5 block text-sm leading-relaxed whitespace-pre-line text-muted-foreground`},g={__name:`IconList`,props:{block:{type:Object,required:!0}},setup(g){return(_,v)=>(a(),r(`ul`,{class:t(g.block.data.layout===`grid`?`grid gap-4 @xl:grid-cols-2 @4xl:grid-cols-3`:`grid gap-4`)},[(a(!0),r(o,null,i(g.block.data.items,(i,o)=>(a(),r(`li`,{key:o},[(a(),l(u(i.url?`a`:`div`),{href:i.url||void 0,class:t([`flex gap-4`,[g.block.data.layout===`grid`?`h-full rounded-lg border bg-card p-4`:``,i.url?`group`:``]])},{default:s(()=>[n(`span`,p,[e(f,{name:i.icon||`link`,class:`size-5`},null,8,[`name`])]),n(`span`,m,[n(`span`,{class:t([`block font-medium`,{"group-hover:underline":i.url}])},c(i.title),3),i.text?(a(),r(`span`,h,c(i.text),1)):d(``,!0)])]),_:2},1032,[`href`,`class`]))]))),128))],2))}};export{g as default}; \ No newline at end of file diff --git a/public/build/assets/Image-BWiA3tKS.js b/public/build/assets/Image-ZW9EqjPK.js similarity index 93% rename from public/build/assets/Image-BWiA3tKS.js rename to public/build/assets/Image-ZW9EqjPK.js index eebf52b5..50daf372 100644 --- a/public/build/assets/Image-BWiA3tKS.js +++ b/public/build/assets/Image-ZW9EqjPK.js @@ -1 +1 @@ -import{D as e,On as t,Zn as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,wt as l,y as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{K as d}from"./AppIcon-0N56IC2z.js";var f=[`src`,`alt`],p={key:1,class:`grid aspect-video place-items-center rounded-lg border border-dashed bg-muted text-muted-foreground`},m={key:2,class:`mt-2 text-sm text-muted-foreground`},h={__name:`Image`,props:{block:{type:Object,required:!0}},setup(h){let g={full:`w-full`,medium:`mx-auto w-full @3xl:w-2/3`,small:`mx-auto w-full @xl:w-1/2 @3xl:w-1/3`};return(_,v)=>(a(),i(`figure`,{class:n(g[h.block.data.size])},[h.block.props?.url?(a(),c(l(h.block.data.url?`a`:`div`),{key:0,href:h.block.data.url||void 0},{default:o(()=>[r(`img`,{src:h.block.props.url,alt:h.block.data.alt,loading:`lazy`,class:`w-full rounded-lg`},null,8,f)]),_:1},8,[`href`])):(a(),i(`div`,p,[e(t(d),{class:`size-8`})])),h.block.data.caption?(a(),i(`figcaption`,m,s(h.block.data.caption),1)):u(``,!0)],2))}};export{h as default}; \ No newline at end of file +import{D as e,On as t,Zn as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,wt as l,y as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{K as d}from"./AppIcon-nlhvQfK7.js";var f=[`src`,`alt`],p={key:1,class:`grid aspect-video place-items-center rounded-lg border border-dashed bg-muted text-muted-foreground`},m={key:2,class:`mt-2 text-sm text-muted-foreground`},h={__name:`Image`,props:{block:{type:Object,required:!0}},setup(h){let g={full:`w-full`,medium:`mx-auto w-full @3xl:w-2/3`,small:`mx-auto w-full @xl:w-1/2 @3xl:w-1/3`};return(_,v)=>(a(),i(`figure`,{class:n(g[h.block.data.size])},[h.block.props?.url?(a(),c(l(h.block.data.url?`a`:`div`),{key:0,href:h.block.data.url||void 0},{default:o(()=>[r(`img`,{src:h.block.props.url,alt:h.block.data.alt,loading:`lazy`,class:`w-full rounded-lg`},null,8,f)]),_:1},8,[`href`])):(a(),i(`div`,p,[e(t(d),{class:`size-8`})])),h.block.data.caption?(a(),i(`figcaption`,m,s(h.block.data.caption),1)):u(``,!0)],2))}};export{h as default}; \ No newline at end of file diff --git a/public/build/assets/Index-BYeL_mJs.js b/public/build/assets/Index-BC3mnuyy.js similarity index 93% rename from public/build/assets/Index-BYeL_mJs.js rename to public/build/assets/Index-BC3mnuyy.js index 0c0b3ea9..8cd4d04a 100644 --- a/public/build/assets/Index-BYeL_mJs.js +++ b/public/build/assets/Index-BC3mnuyy.js @@ -1 +1 @@ -import{D as e,E as t,Ht as n,On as r,Yt as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,vn as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{b as h,x as g}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{o as _,r as v}from"./app-Bu3kn8yd.js";import{c as y}from"./dist-DtGNiYlK.js";import{N as b,V as x,p as S}from"./AppIcon-0N56IC2z.js";import{t as C}from"./AppLayout-BxsYt2ib.js";import{y as w}from"./http-DmyDwIce.js";import{t as T}from"./chevron-left-8GGLVOvJ.js";import{t as E}from"./chevron-right-C9w5cb2q.js";import{t as D}from"./search-x-BVofHEe_.js";import{t as O}from"./PageHeader-Ybe7qDu5.js";import{t as k}from"./button-ZHC5mKey.js";var A={class:`flex w-full flex-col gap-3 sm:w-auto sm:flex-row`},j={class:`relative block sm:w-80`},M=[`value`],N={key:0,class:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4`},P={class:`min-w-0`},F={class:`truncate text-[15px] font-semibold hover:underline`},I={class:`truncate text-[13px] text-muted-foreground`},L={class:`px-4 pb-3 text-[13px] text-muted-foreground`},R={key:0,class:`font-medium text-brand-text`},z={key:1},B={key:2},V={class:`mt-auto flex border-t text-[13px]`},H=[`href`],U=[`href`],W={key:1,class:`grid place-items-center rounded-lg border border-dashed bg-card px-6 py-16 text-center`},G={key:2,class:`mt-6 flex items-center justify-between`,"aria-label":`Seiten`},K={class:`text-sm text-muted-foreground`},q={class:`flex gap-2`},J={__name:`Index`,props:{people:{type:Object,required:!0},filters:{type:Object,required:!0},departments:{type:Array,required:!0}},setup(J){let Y=J,X=p(Y.filters.q??``),Z=p(Y.filters.abteilung??``);function Q(){let e={};X.value&&(e.q=X.value),Z.value&&(e.abteilung=Z.value),_.get(`/personen`,e,{preserveState:!0,preserveScroll:!0,replace:!0})}return n(X,y(Q,300)),n(Z,Q),(n,p)=>(c(),f(C,{title:`Personen`},{default:u(()=>[e(O,{title:`Personen`},{description:u(()=>[t(d(J.people.meta.total.toLocaleString(`de-DE`))+` `+d(J.people.meta.total===1?`Person`:`Personen`)+d(J.filters.q||J.filters.abteilung?` gefunden`:` im Verzeichnis`)+` · `,1),e(r(v),{href:`/personen/organigramm`,class:`font-medium text-brand-text hover:underline`},{default:u(()=>[...p[4]||=[t(`Organigramm`,-1)]]),_:1})]),actions:u(()=>[a(`div`,A,[a(`label`,j,[p[5]||=a(`span`,{class:`sr-only`},`Suchen`,-1),e(r(b),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),i(a(`input`,{"onUpdate:modelValue":p[0]||=e=>X.value=e,type:`search`,placeholder:`Name, Funktion, Standort …`,class:`h-10 w-full rounded-md border border-input bg-card pr-3 pl-9 text-sm placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`},null,512),[[g,X.value]])]),i(a(`select`,{"onUpdate:modelValue":p[1]||=e=>Z.value=e,class:`h-10 rounded-md border border-input bg-card px-3 text-sm focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none sm:w-56`,"aria-label":`Abteilung`},[p[6]||=a(`option`,{value:``},`Alle Abteilungen`,-1),(c(!0),o(l,null,s(J.departments,e=>(c(),o(`option`,{key:e,value:e},d(e),9,M))),128))],512),[[h,Z.value]])])]),_:1}),J.people.data.length?(c(),o(`ul`,N,[(c(!0),o(l,null,s(J.people.data,n=>(c(),o(`li`,{key:n.id,class:`flex flex-col rounded-lg border bg-card`},[e(r(v),{href:`/personen/${n.id}`,class:`flex items-center gap-3 p-4 pb-3`},{default:u(()=>[e(S,{person:n,class:`size-12`},null,8,[`person`]),a(`div`,P,[a(`div`,F,d(n.name),1),a(`div`,I,d(n.job_title||`–`),1)])]),_:2},1032,[`href`]),a(`div`,L,[n.department?(c(),o(`span`,R,d(n.department),1)):m(``,!0),n.department&&n.location?(c(),o(`span`,z,` · `)):m(``,!0),n.location?(c(),o(`span`,B,d(n.location),1)):m(``,!0)]),a(`div`,V,[a(`a`,{href:`mailto:${n.email}`,class:`flex flex-1 items-center justify-center gap-1.5 py-2.5 text-muted-foreground hover:bg-accent hover:text-foreground`},[e(r(x),{class:`size-4`}),p[7]||=t(` E-Mail `,-1)],8,H),n.phone?(c(),o(`a`,{key:0,href:`tel:${n.phone}`,class:`flex flex-1 items-center justify-center gap-1.5 border-l py-2.5 text-muted-foreground hover:bg-accent hover:text-foreground`},[e(r(w),{class:`size-4`}),p[8]||=t(` Anrufen `,-1)],8,U)):m(``,!0)])]))),128))])):(c(),o(`div`,W,[e(r(D),{class:`size-8 text-muted-foreground`}),p[9]||=a(`p`,{class:`mt-3 font-medium`},`Niemand gefunden`,-1),p[10]||=a(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Versuchen Sie einen anderen Suchbegriff oder eine andere Abteilung.`,-1)])),J.people.meta.last_page>1?(c(),o(`nav`,G,[a(`p`,K,`Seite `+d(J.people.meta.current_page)+` von `+d(J.people.meta.last_page),1),a(`div`,q,[e(r(k),{variant:`outline`,size:`sm`,disabled:!J.people.links.prev,onClick:p[2]||=e=>r(_).get(J.people.links.prev,{},{preserveScroll:!1})},{default:u(()=>[e(r(T)),p[11]||=t(` Zurück `,-1)]),_:1},8,[`disabled`]),e(r(k),{variant:`outline`,size:`sm`,disabled:!J.people.links.next,onClick:p[3]||=e=>r(_).get(J.people.links.next,{},{preserveScroll:!1})},{default:u(()=>[p[12]||=t(` Weiter `,-1),e(r(E))]),_:1},8,[`disabled`])])])):m(``,!0)]),_:1}))}};export{J as default}; \ No newline at end of file +import{D as e,E as t,Ht as n,On as r,Yt as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,vn as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{b as h,x as g}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{o as _,r as v}from"./app-BNwrc_lv.js";import{c as y}from"./dist-DtGNiYlK.js";import{N as b,V as x,p as S}from"./AppIcon-nlhvQfK7.js";import{t as C}from"./AppLayout-esQiy2nD.js";import{b as w}from"./http-CAG9BrJF.js";import{t as T}from"./chevron-left-8GGLVOvJ.js";import{t as E}from"./chevron-right-C9w5cb2q.js";import{t as D}from"./search-x-BVofHEe_.js";import{t as O}from"./PageHeader-BMzzCXfT.js";import{n as k}from"./button-CwUSbS9X.js";var A={class:`flex w-full flex-col gap-3 sm:w-auto sm:flex-row`},j={class:`relative block sm:w-80`},M=[`value`],N={key:0,class:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4`},P={class:`min-w-0`},F={class:`truncate text-[15px] font-semibold hover:underline`},I={class:`truncate text-[13px] text-muted-foreground`},L={class:`px-4 pb-3 text-[13px] text-muted-foreground`},R={key:0,class:`font-medium text-brand-text`},z={key:1},B={key:2},V={class:`mt-auto flex border-t text-[13px]`},H=[`href`],U=[`href`],W={key:1,class:`grid place-items-center rounded-lg border border-dashed bg-card px-6 py-16 text-center`},G={key:2,class:`mt-6 flex items-center justify-between`,"aria-label":`Seiten`},K={class:`text-sm text-muted-foreground`},q={class:`flex gap-2`},J={__name:`Index`,props:{people:{type:Object,required:!0},filters:{type:Object,required:!0},departments:{type:Array,required:!0}},setup(J){let Y=J,X=p(Y.filters.q??``),Z=p(Y.filters.abteilung??``);function Q(){let e={};X.value&&(e.q=X.value),Z.value&&(e.abteilung=Z.value),_.get(`/personen`,e,{preserveState:!0,preserveScroll:!0,replace:!0})}return n(X,y(Q,300)),n(Z,Q),(n,p)=>(c(),f(C,{title:`Personen`},{default:u(()=>[e(O,{title:`Personen`},{description:u(()=>[t(d(J.people.meta.total.toLocaleString(`de-DE`))+` `+d(J.people.meta.total===1?`Person`:`Personen`)+d(J.filters.q||J.filters.abteilung?` gefunden`:` im Verzeichnis`)+` · `,1),e(r(v),{href:`/personen/organigramm`,class:`font-medium text-brand-text hover:underline`},{default:u(()=>[...p[4]||=[t(`Organigramm`,-1)]]),_:1})]),actions:u(()=>[a(`div`,A,[a(`label`,j,[p[5]||=a(`span`,{class:`sr-only`},`Suchen`,-1),e(r(b),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),i(a(`input`,{"onUpdate:modelValue":p[0]||=e=>X.value=e,type:`search`,placeholder:`Name, Funktion, Standort …`,class:`h-10 w-full rounded-md border border-input bg-card pr-3 pl-9 text-sm placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`},null,512),[[g,X.value]])]),i(a(`select`,{"onUpdate:modelValue":p[1]||=e=>Z.value=e,class:`h-10 rounded-md border border-input bg-card px-3 text-sm focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none sm:w-56`,"aria-label":`Abteilung`},[p[6]||=a(`option`,{value:``},`Alle Abteilungen`,-1),(c(!0),o(l,null,s(J.departments,e=>(c(),o(`option`,{key:e,value:e},d(e),9,M))),128))],512),[[h,Z.value]])])]),_:1}),J.people.data.length?(c(),o(`ul`,N,[(c(!0),o(l,null,s(J.people.data,n=>(c(),o(`li`,{key:n.id,class:`flex flex-col rounded-lg border bg-card`},[e(r(v),{href:`/personen/${n.id}`,class:`flex items-center gap-3 p-4 pb-3`},{default:u(()=>[e(S,{person:n,class:`size-12`},null,8,[`person`]),a(`div`,P,[a(`div`,F,d(n.name),1),a(`div`,I,d(n.job_title||`–`),1)])]),_:2},1032,[`href`]),a(`div`,L,[n.department?(c(),o(`span`,R,d(n.department),1)):m(``,!0),n.department&&n.location?(c(),o(`span`,z,` · `)):m(``,!0),n.location?(c(),o(`span`,B,d(n.location),1)):m(``,!0)]),a(`div`,V,[a(`a`,{href:`mailto:${n.email}`,class:`flex flex-1 items-center justify-center gap-1.5 py-2.5 text-muted-foreground hover:bg-accent hover:text-foreground`},[e(r(x),{class:`size-4`}),p[7]||=t(` E-Mail `,-1)],8,H),n.phone?(c(),o(`a`,{key:0,href:`tel:${n.phone}`,class:`flex flex-1 items-center justify-center gap-1.5 border-l py-2.5 text-muted-foreground hover:bg-accent hover:text-foreground`},[e(r(w),{class:`size-4`}),p[8]||=t(` Anrufen `,-1)],8,U)):m(``,!0)])]))),128))])):(c(),o(`div`,W,[e(r(D),{class:`size-8 text-muted-foreground`}),p[9]||=a(`p`,{class:`mt-3 font-medium`},`Niemand gefunden`,-1),p[10]||=a(`p`,{class:`mt-1 text-sm text-muted-foreground`},`Versuchen Sie einen anderen Suchbegriff oder eine andere Abteilung.`,-1)])),J.people.meta.last_page>1?(c(),o(`nav`,G,[a(`p`,K,`Seite `+d(J.people.meta.current_page)+` von `+d(J.people.meta.last_page),1),a(`div`,q,[e(r(k),{variant:`outline`,size:`sm`,disabled:!J.people.links.prev,onClick:p[2]||=e=>r(_).get(J.people.links.prev,{},{preserveScroll:!1})},{default:u(()=>[e(r(T)),p[11]||=t(` Zurück `,-1)]),_:1},8,[`disabled`]),e(r(k),{variant:`outline`,size:`sm`,disabled:!J.people.links.next,onClick:p[3]||=e=>r(_).get(J.people.links.next,{},{preserveScroll:!1})},{default:u(()=>[p[12]||=t(` Weiter `,-1),e(r(E))]),_:1},8,[`disabled`])])])):m(``,!0)]),_:1}))}};export{J as default}; \ No newline at end of file diff --git a/public/build/assets/Index-DKsXZOQc.js b/public/build/assets/Index-BDNjv7bZ.js similarity index 87% rename from public/build/assets/Index-DKsXZOQc.js rename to public/build/assets/Index-BDNjv7bZ.js index cf4c60e3..3e3d5c2a 100644 --- a/public/build/assets/Index-DKsXZOQc.js +++ b/public/build/assets/Index-BDNjv7bZ.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,w as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o as m,r as h}from"./app-Bu3kn8yd.js";import{F as g}from"./AppIcon-0N56IC2z.js";import{t as _}from"./AppLayout-BxsYt2ib.js";import{t as v}from"./chevron-left-8GGLVOvJ.js";import{t as y}from"./chevron-right-C9w5cb2q.js";import{t as b}from"./pen-line-22hyV1yp.js";import{t as x}from"./EmptyState-Ceq4v8mE.js";import{t as S}from"./PageHeader-Ybe7qDu5.js";import{t as C}from"./button-ZHC5mKey.js";import{t as w}from"./NewsCard-DpbfyO9M.js";var T={key:0,class:`mb-6 flex flex-wrap gap-2`,"aria-label":`Kategorien`},E={key:1,class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4`},D={key:2,class:`rounded-lg border border-dashed bg-card`},O={key:3,class:`mt-8 flex items-center justify-between`,"aria-label":`Seiten`},k={class:`text-sm text-muted-foreground`},A={class:`flex gap-2`},j={__name:`Index`,props:{posts:{type:Object,required:!0},categories:{type:Array,required:!0},activeCategory:{type:String,default:null},canWrite:{type:Boolean,default:!1}},setup(j){return(M,N)=>(s(),d(_,{title:`Neuigkeiten`},{default:l(()=>[e(S,{title:`Neuigkeiten`,description:`Aktuelles aus dem Unternehmen und den Bereichen.`},f({_:2},[j.canWrite?{name:`actions`,fn:l(()=>[e(n(C),{"as-child":``},{default:l(()=>[e(n(h),{href:`/redaktion/neuigkeiten/neu`},{default:l(()=>[e(n(b)),N[2]||=t(` Beitrag schreiben`,-1)]),_:1})]),_:1})]),key:`0`}:void 0]),1024),j.categories.length?(s(),a(`nav`,T,[e(n(h),{href:`/neuigkeiten`,class:r([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,j.activeCategory?`bg-card hover:bg-accent`:`border-brand bg-brand text-brand-foreground`]),"preserve-scroll":``},{default:l(()=>[...N[3]||=[t(` Alle `,-1)]]),_:1},8,[`class`]),(s(!0),a(c,null,o(j.categories,e=>(s(),d(n(h),{key:e.slug,href:`/neuigkeiten?kategorie=${e.slug}`,class:r([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,j.activeCategory===e.slug?`border-brand bg-brand text-brand-foreground`:`bg-card hover:bg-accent`]),"preserve-scroll":``},{default:l(()=>[t(u(e.name),1)]),_:2},1032,[`href`,`class`]))),128))])):p(``,!0),j.posts.data.length?(s(),a(`div`,E,[(s(!0),a(c,null,o(j.posts.data,e=>(s(),d(w,{key:e.id,post:e},null,8,[`post`]))),128))])):(s(),a(`div`,D,[e(x,{icon:n(g),title:`Keine Beiträge`,text:`In dieser Kategorie ist noch nichts veröffentlicht.`},null,8,[`icon`])])),j.posts.meta.last_page>1?(s(),a(`nav`,O,[i(`p`,k,`Seite `+u(j.posts.meta.current_page)+` von `+u(j.posts.meta.last_page),1),i(`div`,A,[e(n(C),{variant:`outline`,size:`sm`,disabled:!j.posts.links.prev,onClick:N[0]||=e=>n(m).get(j.posts.links.prev)},{default:l(()=>[e(n(v)),N[4]||=t(` Neuere`,-1)]),_:1},8,[`disabled`]),e(n(C),{variant:`outline`,size:`sm`,disabled:!j.posts.links.next,onClick:N[1]||=e=>n(m).get(j.posts.links.next)},{default:l(()=>[N[5]||=t(`Ältere `,-1),e(n(y))]),_:1},8,[`disabled`])])])):p(``,!0)]),_:1}))}};export{j as default}; \ No newline at end of file +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,w as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o as m,r as h}from"./app-BNwrc_lv.js";import{F as g}from"./AppIcon-nlhvQfK7.js";import{t as _}from"./AppLayout-esQiy2nD.js";import{t as v}from"./chevron-left-8GGLVOvJ.js";import{t as y}from"./chevron-right-C9w5cb2q.js";import{t as b}from"./pen-line-22hyV1yp.js";import{t as x}from"./EmptyState-Ceq4v8mE.js";import{t as S}from"./PageHeader-BMzzCXfT.js";import{n as C}from"./button-CwUSbS9X.js";import{t as w}from"./NewsCard-Cxl6vjIa.js";var T={key:0,class:`mb-6 flex flex-wrap gap-2`,"aria-label":`Kategorien`},E={key:1,class:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4`},D={key:2,class:`rounded-lg border border-dashed bg-card`},O={key:3,class:`mt-8 flex items-center justify-between`,"aria-label":`Seiten`},k={class:`text-sm text-muted-foreground`},A={class:`flex gap-2`},j={__name:`Index`,props:{posts:{type:Object,required:!0},categories:{type:Array,required:!0},activeCategory:{type:String,default:null},canWrite:{type:Boolean,default:!1}},setup(j){return(M,N)=>(s(),d(_,{title:`Neuigkeiten`},{default:l(()=>[e(S,{title:`Neuigkeiten`,description:`Aktuelles aus dem Unternehmen und den Bereichen.`},f({_:2},[j.canWrite?{name:`actions`,fn:l(()=>[e(n(C),{"as-child":``},{default:l(()=>[e(n(h),{href:`/redaktion/neuigkeiten/neu`},{default:l(()=>[e(n(b)),N[2]||=t(` Beitrag schreiben`,-1)]),_:1})]),_:1})]),key:`0`}:void 0]),1024),j.categories.length?(s(),a(`nav`,T,[e(n(h),{href:`/neuigkeiten`,class:r([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,j.activeCategory?`bg-card hover:bg-accent`:`border-brand bg-brand text-brand-foreground`]),"preserve-scroll":``},{default:l(()=>[...N[3]||=[t(` Alle `,-1)]]),_:1},8,[`class`]),(s(!0),a(c,null,o(j.categories,e=>(s(),d(n(h),{key:e.slug,href:`/neuigkeiten?kategorie=${e.slug}`,class:r([`rounded-full border px-3.5 py-1.5 text-[13px] font-medium transition-colors`,j.activeCategory===e.slug?`border-brand bg-brand text-brand-foreground`:`bg-card hover:bg-accent`]),"preserve-scroll":``},{default:l(()=>[t(u(e.name),1)]),_:2},1032,[`href`,`class`]))),128))])):p(``,!0),j.posts.data.length?(s(),a(`div`,E,[(s(!0),a(c,null,o(j.posts.data,e=>(s(),d(w,{key:e.id,post:e},null,8,[`post`]))),128))])):(s(),a(`div`,D,[e(x,{icon:n(g),title:`Keine Beiträge`,text:`In dieser Kategorie ist noch nichts veröffentlicht.`},null,8,[`icon`])])),j.posts.meta.last_page>1?(s(),a(`nav`,O,[i(`p`,k,`Seite `+u(j.posts.meta.current_page)+` von `+u(j.posts.meta.last_page),1),i(`div`,A,[e(n(C),{variant:`outline`,size:`sm`,disabled:!j.posts.links.prev,onClick:N[0]||=e=>n(m).get(j.posts.links.prev)},{default:l(()=>[e(n(v)),N[4]||=t(` Neuere`,-1)]),_:1},8,[`disabled`]),e(n(C),{variant:`outline`,size:`sm`,disabled:!j.posts.links.next,onClick:N[1]||=e=>n(m).get(j.posts.links.next)},{default:l(()=>[N[5]||=t(`Ältere `,-1),e(n(y))]),_:1},8,[`disabled`])])])):p(``,!0)]),_:1}))}};export{j as default}; \ No newline at end of file diff --git a/public/build/assets/Index-BcmYQkcJ.js b/public/build/assets/Index-BIQaJQNR.js similarity index 84% rename from public/build/assets/Index-BcmYQkcJ.js rename to public/build/assets/Index-BIQaJQNR.js index 19b06475..77bc42c3 100644 --- a/public/build/assets/Index-BcmYQkcJ.js +++ b/public/build/assets/Index-BIQaJQNR.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,g as s,mt as c,o as l,qt as u,tr as d,v as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-Bu3kn8yd.js";import{nt as h}from"./AppIcon-0N56IC2z.js";import{t as g}from"./AppLayout-BxsYt2ib.js";import{t as _}from"./BirthdayItem-CI_wVS_D.js";import{t as v}from"./EmptyState-Ceq4v8mE.js";import{t as y}from"./PageHeader-Ybe7qDu5.js";var b={class:`mx-auto max-w-3xl`},x={key:0,class:`mb-6 rounded-lg border bg-card px-4 py-3 text-sm`},S={key:1,class:`grid gap-5`},C={class:`divide-y px-5`},w={key:2,class:`rounded-lg border bg-card`},T={__name:`Index`,props:{birthdays:{type:Array,required:!0},scope:{type:String,required:!0},registered:{type:Boolean,default:!1}},setup(T){let E=T,D=s(()=>{let e=[];for(let t of E.birthdays){let n=e.at(-1);n&&n.date===t.date?n.items.push(t):e.push({date:t.date,today:t.today,items:[t]})}return e}),O=e=>e.today?`Heute`:new Intl.DateTimeFormat(`de-DE`,{weekday:`long`,day:`numeric`,month:`long`}).format(new Date(`${e.date}T12:00:00`));return(s,E)=>(c(),f(g,{title:`Geburtstage`},{default:u(()=>[i(`div`,b,[e(y,{title:`Geburtstage`,description:`Die nächsten 30 Tage · ${T.scope}`},null,8,[`description`]),T.registered?p(``,!0):(c(),a(`p`,x,[E[1]||=t(` Sie möchten auch in der Liste stehen? Tragen Sie Tag und Monat unter `,-1),e(n(m),{href:`/profil/bearbeiten`,class:`font-medium text-brand-text hover:underline`},{default:u(()=>[...E[0]||=[t(`Profil bearbeiten`,-1)]]),_:1}),E[2]||=t(` ein. `,-1)])),D.value.length?(c(),a(`div`,S,[(c(!0),a(l,null,o(D.value,e=>(c(),a(`section`,{key:e.date,class:`rounded-lg border bg-card`},[i(`h2`,{class:r([`border-b px-5 py-3 text-sm font-semibold`,e.today?`text-brand-text`:``])},d(O(e)),3),i(`div`,C,[(c(!0),a(l,null,o(e.items,e=>(c(),f(_,{key:e.person.id,item:e},null,8,[`item`]))),128))])]))),128))])):(c(),a(`div`,w,[e(v,{icon:n(h),title:`Keine Geburtstage in den nächsten 30 Tagen`},null,8,[`icon`])]))])]),_:1}))}};export{T as default}; \ No newline at end of file +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,g as s,mt as c,o as l,qt as u,tr as d,v as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-BNwrc_lv.js";import{nt as h}from"./AppIcon-nlhvQfK7.js";import{t as g}from"./AppLayout-esQiy2nD.js";import{t as _}from"./BirthdayItem-ELeKwOyJ.js";import{t as v}from"./EmptyState-Ceq4v8mE.js";import{t as y}from"./PageHeader-BMzzCXfT.js";var b={class:`mx-auto max-w-3xl`},x={key:0,class:`mb-6 rounded-lg border bg-card px-4 py-3 text-sm`},S={key:1,class:`grid gap-5`},C={class:`divide-y px-5`},w={key:2,class:`rounded-lg border bg-card`},T={__name:`Index`,props:{birthdays:{type:Array,required:!0},scope:{type:String,required:!0},registered:{type:Boolean,default:!1}},setup(T){let E=T,D=s(()=>{let e=[];for(let t of E.birthdays){let n=e.at(-1);n&&n.date===t.date?n.items.push(t):e.push({date:t.date,today:t.today,items:[t]})}return e}),O=e=>e.today?`Heute`:new Intl.DateTimeFormat(`de-DE`,{weekday:`long`,day:`numeric`,month:`long`}).format(new Date(`${e.date}T12:00:00`));return(s,E)=>(c(),f(g,{title:`Geburtstage`},{default:u(()=>[i(`div`,b,[e(y,{title:`Geburtstage`,description:`Die nächsten 30 Tage · ${T.scope}`},null,8,[`description`]),T.registered?p(``,!0):(c(),a(`p`,x,[E[1]||=t(` Sie möchten auch in der Liste stehen? Tragen Sie Tag und Monat unter `,-1),e(n(m),{href:`/profil/bearbeiten`,class:`font-medium text-brand-text hover:underline`},{default:u(()=>[...E[0]||=[t(`Profil bearbeiten`,-1)]]),_:1}),E[2]||=t(` ein. `,-1)])),D.value.length?(c(),a(`div`,S,[(c(!0),a(l,null,o(D.value,e=>(c(),a(`section`,{key:e.date,class:`rounded-lg border bg-card`},[i(`h2`,{class:r([`border-b px-5 py-3 text-sm font-semibold`,e.today?`text-brand-text`:``])},d(O(e)),3),i(`div`,C,[(c(!0),a(l,null,o(e.items,e=>(c(),f(_,{key:e.person.id,item:e},null,8,[`item`]))),128))])]))),128))])):(c(),a(`div`,w,[e(v,{icon:n(h),title:`Keine Geburtstage in den nächsten 30 Tagen`},null,8,[`icon`])]))])]),_:1}))}};export{T as default}; \ No newline at end of file diff --git a/public/build/assets/Index-BYRiOW5j.js b/public/build/assets/Index-BYRiOW5j.js new file mode 100644 index 00000000..f804ccd3 --- /dev/null +++ b/public/build/assets/Index-BYRiOW5j.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EditorialForms-CbjA1btN.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/app-BNwrc_lv.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-Bv2m9wnk.css","assets/download-UAAY3N2F.js","assets/dist-DtGNiYlK.js","assets/pencil-line-CmAbFj4f.js","assets/plus-B_ij2ng2.js","assets/table-properties-BPjlj2dD.js","assets/button-CwUSbS9X.js","assets/Panel-Dr-NcUuS.js","assets/chevron-right-C9w5cb2q.js","assets/EditorialNews-AsssE4tU.js","assets/message-square-warning-BFfa_vqd.js","assets/format-BsuBtvUs.js","assets/EditorialPages-C4uXxskK.js","assets/lock-H7FAhSBr.js","assets/NewPageDialog-CGV-jwsW.js","assets/Input-FGSb2-yK.js","assets/dialog-RK2mTeqi.js","assets/usePrimitiveElement-DC7UloPZ.js","assets/AppIcon-nlhvQfK7.js","assets/RovingFocusGroup-D88K7krN.js","assets/http-CAG9BrJF.js","assets/DialogDescription-CaB-9xpp.js","assets/DialogDescription-Cf3zbHQX.js","assets/DialogHeader-DuqiL3ry.js","assets/EditorialMedia-DaL3QIsH.js","assets/image-off-IDPmIoA8.js","assets/images-47Nc0alu.js"])))=>i.map(i=>d[i]); +import{D as e,O as t,_ as n,b as r,bt as i,et as a,mt as o,o as s,qt as c,v as l,wt as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{s as d}from"./app-BNwrc_lv.js";import{t as f}from"./AppLayout-esQiy2nD.js";import{t as p}from"./PageHeader-BMzzCXfT.js";var m={class:`grid items-start gap-6 xl:grid-cols-2`},h={__name:`Index`,props:{sections:{type:Array,required:!0}},setup(h){let g=Object.assign({"../../../../plugins-core/forms/resources/js/editorial/EditorialForms.vue":()=>d(()=>import(`./EditorialForms-CbjA1btN.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),"../../../../plugins-core/news/resources/js/editorial/EditorialNews.vue":()=>d(()=>import(`./EditorialNews-AsssE4tU.js`),__vite__mapDeps([13,1,2,3,4,14,6,8,15,10,11,12])),"../../../../plugins-core/pages/resources/js/editorial/EditorialPages.vue":()=>d(()=>import(`./EditorialPages-C4uXxskK.js`),__vite__mapDeps([16,1,2,3,4,17,6,8,15,10,11,12,18,19,20,21,22,23,24,25,26,27]))}),_={};for(let[e,n]of Object.entries(g)){let[,r]=e.match(/plugins-core\/([^/]+)\//);_[`${r}::${e.split(`/`).pop().replace(`.vue`,``)}`]=t(n)}for(let[e,n]of Object.entries(Object.assign({"../../components/editorial/EditorialMedia.vue":()=>d(()=>import(`./EditorialMedia-DaL3QIsH.js`),__vite__mapDeps([28,1,2,3,4,29,6,30,11,12]))})))_[`core::${e.split(`/`).pop().replace(`.vue`,``)}`]=t(n);return(t,d)=>(o(),l(f,{title:`Redaktion`},{default:c(()=>[e(p,{title:`Redaktion`,description:`Ihre Seiten und Beiträge – Entwürfe, Freigaben und Geplantes.`}),n(`div`,m,[(o(!0),r(s,null,i(h.sections,e=>(o(),l(u(_[e.component]),a({key:e.key},{ref_for:!0},e.props),null,16))),128))])]),_:1}))}};export{h as default}; \ No newline at end of file diff --git a/public/build/assets/Index-Cr7HhjGR.js b/public/build/assets/Index-Bh8jiaJi.js similarity index 92% rename from public/build/assets/Index-Cr7HhjGR.js rename to public/build/assets/Index-Bh8jiaJi.js index 6acd737d..d426d68e 100644 --- a/public/build/assets/Index-Cr7HhjGR.js +++ b/public/build/assets/Index-Bh8jiaJi.js @@ -1 +1 @@ -import{D as e,E as t,Ht as n,On as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,w as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{a as h,o as g,r as _,t as v}from"./app-Bu3kn8yd.js";import{k as y}from"./dist-DtGNiYlK.js";import{G as ee}from"./AppIcon-0N56IC2z.js";import{t as te}from"./AppLayout-BxsYt2ib.js";import{s as b}from"./RovingFocusGroup-D88K7krN.js";import{t as x}from"./calendar-clock-8H2IkjP5.js";import{_ as S,o as C}from"./http-DmyDwIce.js";import{t as w}from"./circle-alert-D8SqHL0j.js";import{n as ne,t as T}from"./message-square-plus-89qxGe_b.js";import{t as E}from"./EmptyState-Ceq4v8mE.js";import{t as D}from"./PageHeader-Ybe7qDu5.js";import{t as O}from"./button-ZHC5mKey.js";import{t as k}from"./Panel-BASB8Xb9.js";import{t as A}from"./Skeleton-fJgmuUSB.js";import{t as j}from"./StatusBadge-udDF6Kfz.js";import{n as M,r as N,t as P}from"./status-p0CPKwc2.js";var F=y({name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]}),I=y({name:`ticket-check`,size:24,node:[[`path`,{d:`M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z`,key:`qn84l0`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]}),L={key:0,class:`rounded-lg border bg-card`},R=[`innerHTML`],z={class:`grid grid-cols-1 gap-6 lg:grid-cols-12`},B={class:`grid gap-2`},V={key:0,class:`flex items-center gap-2 text-sm text-destructive`},H={key:2,class:`-mx-2 divide-y`},U={class:`min-w-0 flex-1`},W={class:`block text-xs text-muted-foreground`},G={class:`grid content-start gap-6 lg:col-span-5 xl:col-span-4`},K={class:`grid gap-2`},re={key:0,class:`flex items-center gap-2 text-sm text-destructive`},q={key:1,class:`text-[13px] text-muted-foreground`},J={key:2,class:`grid gap-3`},Y={class:`flex items-start gap-3`},X={class:`grid size-10 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},ie={class:`min-w-0 flex-1`},ae={class:`font-medium leading-tight`},oe={class:`mt-0.5 text-xs text-muted-foreground`},se={class:`mt-2 grid gap-0.5 text-xs`},ce={key:0,class:`flex gap-1.5`},le={class:`font-mono`},ue={key:1,class:`flex gap-1.5`},de={class:`font-mono`},fe={class:`grid gap-2`},pe={key:0,class:`flex items-center gap-2 text-sm text-destructive`},me={key:1,class:`text-[13px] text-muted-foreground`},he={key:2,class:`-mx-1 divide-y`},Z={class:`min-w-0 flex-1`},ge={class:`truncate text-sm font-medium`},_e={class:`text-xs text-muted-foreground tabular-nums`},ve=[`title`,`onClick`],Q={__name:`Index`,props:{configured:{type:Boolean,default:!1},intro:{type:String,default:null},assets:{type:Object,default:null},tickets:{type:Object,default:null},loans:{type:Object,default:null}},setup(y){let Q=h();n(()=>Q.props.flash.status,e=>e&&C.success(e),{immediate:!0}),n(()=>Q.props.errors?.loan,e=>e&&C.error(e));function $(e){if(!e.warranty_end)return null;let t=new Date(e.warranty_end),n=Math.round((t-new Date)/864e5);return Number.isNaN(n)?{text:`Garantie bis ${e.warranty_end}`,tone:``}:n<0?{text:`Garantie abgelaufen (${P(e.warranty_end)})`,tone:`text-muted-foreground`}:n<90?{text:`Garantie endet am ${P(e.warranty_end)}`,tone:`text-amber-700 dark:text-amber-300`}:{text:`Garantie bis ${P(e.warranty_end)}`,tone:`text-muted-foreground`}}function ye(e){window.confirm(`Ausleihe „${e.device}“ stornieren?`)&&g.post(`/it-service/ausleihen/${e.id}/stornieren`,{},{preserveScroll:!0})}return(n,h)=>(c(),f(te,{title:`Meine IT`},{default:u(()=>[e(D,{title:`Meine IT`,description:`Ihre Geräte, Tickets und Leihgeräte an einem Ort.`},p({_:2},[y.configured?{name:`actions`,fn:u(()=>[e(r(O),{variant:`outline`,"as-child":``},{default:u(()=>[e(r(_),{href:`/it-service/leihgeraete`},{default:u(()=>[e(r(x)),h[0]||=t(` Leihgerät ausleihen`,-1)]),_:1})]),_:1}),e(r(O),{"as-child":``},{default:u(()=>[e(r(_),{href:`/it-service/tickets/neu`},{default:u(()=>[e(r(T)),h[1]||=t(` Ticket erstellen`,-1)]),_:1})]),_:1})]),key:`0`}:void 0]),1024),y.configured?(c(),o(l,{key:1},[y.intro?(c(),o(`div`,{key:0,class:`prose prose-sm mb-6 max-w-none rounded-lg border border-brand-200 bg-brand-soft/60 px-5 py-4 dark:prose-invert`,innerHTML:y.intro},null,8,R)):m(``,!0),a(`div`,z,[e(k,{title:`Meine Tickets`,class:`min-w-0 lg:col-span-7 xl:col-span-8`},{default:u(()=>[e(r(v),{data:`tickets`},{fallback:u(()=>[a(`div`,B,[(c(),o(l,null,s(4,t=>e(r(A),{key:t,class:`h-14`})),64))])]),default:u(()=>[y.tickets.ok?y.tickets.data.length?(c(),o(`ul`,H,[(c(!0),o(l,null,s(y.tickets.data,n=>(c(),o(`li`,{key:n.id},[e(r(_),{href:`/it-service/tickets/${n.id}`,class:`flex items-center gap-3 rounded-md px-2 py-3 hover:bg-accent/60`},{default:u(()=>[a(`span`,{class:i([`grid size-9 shrink-0 place-items-center rounded-md`,n.open?`bg-brand-soft text-brand-text`:`bg-muted text-muted-foreground`])},[e(r(ne),{class:`size-4`})],2),a(`span`,U,[a(`span`,{class:i([`block truncate text-sm font-medium`,{"text-muted-foreground":!n.open}])},d(n.subject),3),a(`span`,W,[n.number?(c(),o(l,{key:0},[t(`#`+d(n.number)+` · `,1)],64)):m(``,!0),t(`erstellt `+d(r(P)(n.created_at,!0)),1)])]),e(j,{label:n.status_label,tone:r(N)(n)},null,8,[`label`,`tone`])]),_:2},1032,[`href`])]))),128))])):(c(),f(E,{key:1,icon:r(I),title:`Keine Tickets`,text:`Wenn etwas nicht funktioniert: „Ticket erstellen“ – die IT kümmert sich darum.`},null,8,[`icon`])):(c(),o(`p`,V,[e(r(w),{class:`size-4`}),t(` `+d(y.tickets.error),1)]))]),_:1})]),_:1}),a(`div`,G,[e(k,{title:`Meine Geräte`},{default:u(()=>[e(r(v),{data:`assets`},{fallback:u(()=>[a(`div`,K,[(c(),o(l,null,s(2,t=>e(r(A),{key:t,class:`h-20`})),64))])]),default:u(()=>[y.assets.ok?y.assets.data.length?(c(),o(`ul`,J,[(c(!0),o(l,null,s(y.assets.data,n=>(c(),o(`li`,{key:n.id,class:`rounded-lg border p-3`},[a(`div`,Y,[a(`span`,X,[e(r(ee),{class:`size-5`})]),a(`div`,ie,[a(`p`,ae,d(n.name),1),a(`p`,oe,d([n.type,n.manufacturer&&n.model?`${n.manufacturer} ${n.model}`:n.model].filter(Boolean).join(` · `)),1),a(`dl`,se,[n.inventory?(c(),o(`div`,ce,[h[2]||=a(`dt`,{class:`text-muted-foreground`},`Inventar-Nr.`,-1),a(`dd`,le,d(n.inventory),1)])):m(``,!0),n.serial?(c(),o(`div`,ue,[h[3]||=a(`dt`,{class:`text-muted-foreground`},`Seriennummer`,-1),a(`dd`,de,d(n.serial),1)])):m(``,!0),$(n)?(c(),o(`div`,{key:2,class:i([`flex items-center gap-1.5`,$(n).tone])},[e(r(b),{class:`size-3.5`}),t(` `+d($(n).text),1)],2)):m(``,!0)])])]),e(r(O),{variant:`outline`,size:`sm`,class:`mt-3 w-full`,"as-child":``},{default:u(()=>[e(r(_),{href:`/it-service/tickets/neu?geraet=${n.id}`},{default:u(()=>[e(r(T)),h[4]||=t(` Problem mit diesem Gerät melden`,-1)]),_:1},8,[`href`])]),_:2},1024)]))),128))])):(c(),o(`p`,q,`Ihnen sind keine Geräte zugeordnet.`)):(c(),o(`p`,re,[e(r(w),{class:`size-4`}),t(` `+d(y.assets.error),1)]))]),_:1})]),_:1}),e(k,{title:`Meine Ausleihen`,"action-label":`Leihgeräte`,"action-href":`/it-service/leihgeraete`},{default:u(()=>[e(r(v),{data:`loans`},{fallback:u(()=>[a(`div`,fe,[(c(),o(l,null,s(2,t=>e(r(A),{key:t,class:`h-12`})),64))])]),default:u(()=>[y.loans.ok?y.loans.data.length?(c(),o(`ul`,he,[(c(!0),o(l,null,s(y.loans.data,t=>(c(),o(`li`,{key:t.id,class:`flex items-center gap-3 px-1 py-2.5`},[a(`div`,Z,[a(`p`,ge,d(t.device),1),a(`p`,_e,d(r(P)(t.start))+` – `+d(r(P)(t.end)),1)]),e(j,{label:t.status_label,tone:r(M)(t)},null,8,[`label`,`tone`]),t.cancellable?(c(),o(`button`,{key:0,type:`button`,class:`grid size-7 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-destructive`,title:`„${t.device}“ stornieren`,onClick:e=>ye(t)},[e(r(S),{class:`size-4`})],8,ve)):m(``,!0)]))),128))])):(c(),o(`p`,me,`Keine laufenden Ausleihen oder Anfragen.`)):(c(),o(`p`,pe,[e(r(w),{class:`size-4`}),t(` `+d(y.loans.error),1)]))]),_:1})]),_:1})])])],64)):(c(),o(`div`,L,[e(E,{icon:r(F),title:`Der IT-Service ist noch nicht eingerichtet`,text:`Die Administration verbindet das Portal unter „Portal → IT-Service“ mit OpenNIT.`},null,8,[`icon`])]))]),_:1}))}};export{Q as default}; \ No newline at end of file +import{D as e,E as t,Ht as n,On as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,w as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{a as h,o as g,r as _,t as v}from"./app-BNwrc_lv.js";import{k as y}from"./dist-DtGNiYlK.js";import{G as ee}from"./AppIcon-nlhvQfK7.js";import{t as te}from"./AppLayout-esQiy2nD.js";import{s as b}from"./RovingFocusGroup-D88K7krN.js";import{t as x}from"./calendar-clock-8H2IkjP5.js";import{s as S,v as C}from"./http-CAG9BrJF.js";import{t as w}from"./circle-alert-D8SqHL0j.js";import{n as ne,t as T}from"./message-square-plus-89qxGe_b.js";import{t as E}from"./EmptyState-Ceq4v8mE.js";import{t as D}from"./PageHeader-BMzzCXfT.js";import{n as O}from"./button-CwUSbS9X.js";import{t as k}from"./Panel-Dr-NcUuS.js";import{t as A}from"./Skeleton-fJgmuUSB.js";import{t as j}from"./StatusBadge-udDF6Kfz.js";import{n as M,r as N,t as P}from"./status-p0CPKwc2.js";var F=y({name:`plug`,size:24,node:[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]}),I=y({name:`ticket-check`,size:24,node:[[`path`,{d:`M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z`,key:`qn84l0`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]}),L={key:0,class:`rounded-lg border bg-card`},R=[`innerHTML`],z={class:`grid grid-cols-1 gap-6 lg:grid-cols-12`},B={class:`grid gap-2`},V={key:0,class:`flex items-center gap-2 text-sm text-destructive`},H={key:2,class:`-mx-2 divide-y`},U={class:`min-w-0 flex-1`},W={class:`block text-xs text-muted-foreground`},G={class:`grid content-start gap-6 lg:col-span-5 xl:col-span-4`},K={class:`grid gap-2`},re={key:0,class:`flex items-center gap-2 text-sm text-destructive`},q={key:1,class:`text-[13px] text-muted-foreground`},J={key:2,class:`grid gap-3`},Y={class:`flex items-start gap-3`},X={class:`grid size-10 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},ie={class:`min-w-0 flex-1`},ae={class:`font-medium leading-tight`},oe={class:`mt-0.5 text-xs text-muted-foreground`},se={class:`mt-2 grid gap-0.5 text-xs`},ce={key:0,class:`flex gap-1.5`},le={class:`font-mono`},ue={key:1,class:`flex gap-1.5`},de={class:`font-mono`},fe={class:`grid gap-2`},pe={key:0,class:`flex items-center gap-2 text-sm text-destructive`},me={key:1,class:`text-[13px] text-muted-foreground`},he={key:2,class:`-mx-1 divide-y`},Z={class:`min-w-0 flex-1`},ge={class:`truncate text-sm font-medium`},_e={class:`text-xs text-muted-foreground tabular-nums`},ve=[`title`,`onClick`],Q={__name:`Index`,props:{configured:{type:Boolean,default:!1},intro:{type:String,default:null},assets:{type:Object,default:null},tickets:{type:Object,default:null},loans:{type:Object,default:null}},setup(y){let Q=h();n(()=>Q.props.flash.status,e=>e&&S.success(e),{immediate:!0}),n(()=>Q.props.errors?.loan,e=>e&&S.error(e));function $(e){if(!e.warranty_end)return null;let t=new Date(e.warranty_end),n=Math.round((t-new Date)/864e5);return Number.isNaN(n)?{text:`Garantie bis ${e.warranty_end}`,tone:``}:n<0?{text:`Garantie abgelaufen (${P(e.warranty_end)})`,tone:`text-muted-foreground`}:n<90?{text:`Garantie endet am ${P(e.warranty_end)}`,tone:`text-amber-700 dark:text-amber-300`}:{text:`Garantie bis ${P(e.warranty_end)}`,tone:`text-muted-foreground`}}function ye(e){window.confirm(`Ausleihe „${e.device}“ stornieren?`)&&g.post(`/it-service/ausleihen/${e.id}/stornieren`,{},{preserveScroll:!0})}return(n,h)=>(c(),f(te,{title:`Meine IT`},{default:u(()=>[e(D,{title:`Meine IT`,description:`Ihre Geräte, Tickets und Leihgeräte an einem Ort.`},p({_:2},[y.configured?{name:`actions`,fn:u(()=>[e(r(O),{variant:`outline`,"as-child":``},{default:u(()=>[e(r(_),{href:`/it-service/leihgeraete`},{default:u(()=>[e(r(x)),h[0]||=t(` Leihgerät ausleihen`,-1)]),_:1})]),_:1}),e(r(O),{"as-child":``},{default:u(()=>[e(r(_),{href:`/it-service/tickets/neu`},{default:u(()=>[e(r(T)),h[1]||=t(` Ticket erstellen`,-1)]),_:1})]),_:1})]),key:`0`}:void 0]),1024),y.configured?(c(),o(l,{key:1},[y.intro?(c(),o(`div`,{key:0,class:`prose prose-sm mb-6 max-w-none rounded-lg border border-brand-200 bg-brand-soft/60 px-5 py-4 dark:prose-invert`,innerHTML:y.intro},null,8,R)):m(``,!0),a(`div`,z,[e(k,{title:`Meine Tickets`,class:`min-w-0 lg:col-span-7 xl:col-span-8`},{default:u(()=>[e(r(v),{data:`tickets`},{fallback:u(()=>[a(`div`,B,[(c(),o(l,null,s(4,t=>e(r(A),{key:t,class:`h-14`})),64))])]),default:u(()=>[y.tickets.ok?y.tickets.data.length?(c(),o(`ul`,H,[(c(!0),o(l,null,s(y.tickets.data,n=>(c(),o(`li`,{key:n.id},[e(r(_),{href:`/it-service/tickets/${n.id}`,class:`flex items-center gap-3 rounded-md px-2 py-3 hover:bg-accent/60`},{default:u(()=>[a(`span`,{class:i([`grid size-9 shrink-0 place-items-center rounded-md`,n.open?`bg-brand-soft text-brand-text`:`bg-muted text-muted-foreground`])},[e(r(ne),{class:`size-4`})],2),a(`span`,U,[a(`span`,{class:i([`block truncate text-sm font-medium`,{"text-muted-foreground":!n.open}])},d(n.subject),3),a(`span`,W,[n.number?(c(),o(l,{key:0},[t(`#`+d(n.number)+` · `,1)],64)):m(``,!0),t(`erstellt `+d(r(P)(n.created_at,!0)),1)])]),e(j,{label:n.status_label,tone:r(N)(n)},null,8,[`label`,`tone`])]),_:2},1032,[`href`])]))),128))])):(c(),f(E,{key:1,icon:r(I),title:`Keine Tickets`,text:`Wenn etwas nicht funktioniert: „Ticket erstellen“ – die IT kümmert sich darum.`},null,8,[`icon`])):(c(),o(`p`,V,[e(r(w),{class:`size-4`}),t(` `+d(y.tickets.error),1)]))]),_:1})]),_:1}),a(`div`,G,[e(k,{title:`Meine Geräte`},{default:u(()=>[e(r(v),{data:`assets`},{fallback:u(()=>[a(`div`,K,[(c(),o(l,null,s(2,t=>e(r(A),{key:t,class:`h-20`})),64))])]),default:u(()=>[y.assets.ok?y.assets.data.length?(c(),o(`ul`,J,[(c(!0),o(l,null,s(y.assets.data,n=>(c(),o(`li`,{key:n.id,class:`rounded-lg border p-3`},[a(`div`,Y,[a(`span`,X,[e(r(ee),{class:`size-5`})]),a(`div`,ie,[a(`p`,ae,d(n.name),1),a(`p`,oe,d([n.type,n.manufacturer&&n.model?`${n.manufacturer} ${n.model}`:n.model].filter(Boolean).join(` · `)),1),a(`dl`,se,[n.inventory?(c(),o(`div`,ce,[h[2]||=a(`dt`,{class:`text-muted-foreground`},`Inventar-Nr.`,-1),a(`dd`,le,d(n.inventory),1)])):m(``,!0),n.serial?(c(),o(`div`,ue,[h[3]||=a(`dt`,{class:`text-muted-foreground`},`Seriennummer`,-1),a(`dd`,de,d(n.serial),1)])):m(``,!0),$(n)?(c(),o(`div`,{key:2,class:i([`flex items-center gap-1.5`,$(n).tone])},[e(r(b),{class:`size-3.5`}),t(` `+d($(n).text),1)],2)):m(``,!0)])])]),e(r(O),{variant:`outline`,size:`sm`,class:`mt-3 w-full`,"as-child":``},{default:u(()=>[e(r(_),{href:`/it-service/tickets/neu?geraet=${n.id}`},{default:u(()=>[e(r(T)),h[4]||=t(` Problem mit diesem Gerät melden`,-1)]),_:1},8,[`href`])]),_:2},1024)]))),128))])):(c(),o(`p`,q,`Ihnen sind keine Geräte zugeordnet.`)):(c(),o(`p`,re,[e(r(w),{class:`size-4`}),t(` `+d(y.assets.error),1)]))]),_:1})]),_:1}),e(k,{title:`Meine Ausleihen`,"action-label":`Leihgeräte`,"action-href":`/it-service/leihgeraete`},{default:u(()=>[e(r(v),{data:`loans`},{fallback:u(()=>[a(`div`,fe,[(c(),o(l,null,s(2,t=>e(r(A),{key:t,class:`h-12`})),64))])]),default:u(()=>[y.loans.ok?y.loans.data.length?(c(),o(`ul`,he,[(c(!0),o(l,null,s(y.loans.data,t=>(c(),o(`li`,{key:t.id,class:`flex items-center gap-3 px-1 py-2.5`},[a(`div`,Z,[a(`p`,ge,d(t.device),1),a(`p`,_e,d(r(P)(t.start))+` – `+d(r(P)(t.end)),1)]),e(j,{label:t.status_label,tone:r(M)(t)},null,8,[`label`,`tone`]),t.cancellable?(c(),o(`button`,{key:0,type:`button`,class:`grid size-7 place-items-center rounded-md text-muted-foreground hover:bg-accent hover:text-destructive`,title:`„${t.device}“ stornieren`,onClick:e=>ye(t)},[e(r(C),{class:`size-4`})],8,ve)):m(``,!0)]))),128))])):(c(),o(`p`,me,`Keine laufenden Ausleihen oder Anfragen.`)):(c(),o(`p`,pe,[e(r(w),{class:`size-4`}),t(` `+d(y.loans.error),1)]))]),_:1})]),_:1})])])],64)):(c(),o(`div`,L,[e(E,{icon:r(F),title:`Der IT-Service ist noch nicht eingerichtet`,text:`Die Administration verbindet das Portal unter „Portal → IT-Service“ mit OpenNIT.`},null,8,[`icon`])]))]),_:1}))}};export{Q as default}; \ No newline at end of file diff --git a/public/build/assets/Index-Cb5ksNXA.js b/public/build/assets/Index-BjNLv6WL.js similarity index 91% rename from public/build/assets/Index-Cb5ksNXA.js rename to public/build/assets/Index-BjNLv6WL.js index 0c9ec714..82c6dfb5 100644 --- a/public/build/assets/Index-Cb5ksNXA.js +++ b/public/build/assets/Index-BjNLv6WL.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,et as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,wt as m,y as h}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as g}from"./app-Bu3kn8yd.js";import{B as _,E as v,tt as y}from"./AppIcon-0N56IC2z.js";import{t as b}from"./AppLayout-BxsYt2ib.js";import{t as x}from"./EmptyState-Ceq4v8mE.js";import{t as S}from"./PageHeader-Ybe7qDu5.js";import{i as C,r as w}from"./format-BsuBtvUs.js";import{t as T}from"./EventDateBlock-_E5XlLto.js";import{t as E}from"./widgets-BmL-pPiO.js";var D={class:`grid min-w-0 grid-cols-1 content-start gap-6`},O={__name:`DashboardSidebar`,props:{widgets:{type:Array,required:!0}},setup(e){return(t,r)=>(l(),a(`aside`,D,[(l(!0),a(u,null,o(e.widgets,e=>(l(),a(u,{key:e.key},[n(E)(e.component)?(l(),p(m(n(E)(e.component)),s({key:0,ref_for:!0},e.props),null,16)):h(``,!0)],64))),128))]))}},k={class:`grid gap-6 lg:grid-cols-12`},A={key:0,class:`grid gap-8`},j={class:`mb-3 text-sm font-semibold text-muted-foreground`},M={class:`divide-y rounded-lg border bg-card`},N={class:`min-w-0 flex-1`},P={class:`text-[15px] font-semibold group-hover:underline`},F={class:`mt-0.5 text-[13px] text-muted-foreground`},I={key:0,class:`mt-0.5 flex items-center gap-1.5 text-[13px] text-muted-foreground`},L=[`src`],R={key:1,class:`rounded-lg border border-dashed bg-card`},z={__name:`Index`,props:{events:{type:Object,required:!0},sidebar:{type:Array,default:()=>[]}},setup(s){let m=s,E=c(()=>{let e=[];for(let t of m.events.data){let n=new Date(t.starts_at),r=C((n(l(),p(b,{title:`Termine`},{default:d(()=>[e(S,{title:`Termine`,description:`Veranstaltungen, Fortbildungen und Treffen.`}),i(`div`,k,[i(`div`,{class:r([`min-w-0`,s.sidebar.length?`lg:col-span-8 xl:col-span-9`:`lg:col-span-12`])},[E.value.length?(l(),a(`div`,A,[(l(!0),a(u,null,o(E.value,r=>(l(),a(`section`,{key:r.label},[i(`h2`,j,f(r.label),1),i(`ul`,M,[(l(!0),a(u,null,o(r.events,r=>(l(),a(`li`,{key:r.id},[e(n(g),{href:`/termine/${r.id}`,class:`group flex items-center gap-4 p-4 transition-colors hover:bg-accent/60`},{default:d(()=>[e(T,{date:r.starts_at,class:`w-14`},null,8,[`date`]),i(`div`,N,[i(`h3`,P,f(r.title),1),i(`p`,F,f(n(w)(r)),1),r.location||r.online_url?(l(),a(`p`,I,[r.location?(l(),p(n(_),{key:0,class:`size-3.5`})):(l(),p(n(v),{key:1,class:`size-3.5`})),t(` `+f(r.location||`Online`),1)])):h(``,!0)]),r.thumb_url?(l(),a(`img`,{key:0,src:r.thumb_url,alt:``,loading:`lazy`,class:`hidden h-16 w-28 shrink-0 rounded-md object-cover sm:block`},null,8,L)):h(``,!0)]),_:2},1032,[`href`])]))),128))])]))),128))])):(l(),a(`div`,R,[e(x,{icon:n(y),title:`Keine anstehenden Termine`,text:`Neue Termine erscheinen hier, sobald sie eingetragen sind.`},null,8,[`icon`])]))],2),s.sidebar.length?(l(),p(O,{key:0,widgets:s.sidebar,class:`lg:col-span-4 xl:col-span-3`},null,8,[`widgets`])):h(``,!0)])]),_:1}))}};export{z as default}; \ No newline at end of file +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,et as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,wt as m,y as h}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as g}from"./app-BNwrc_lv.js";import{B as _,E as v,tt as y}from"./AppIcon-nlhvQfK7.js";import{t as b}from"./AppLayout-esQiy2nD.js";import{t as x}from"./EmptyState-Ceq4v8mE.js";import{t as S}from"./PageHeader-BMzzCXfT.js";import{i as C,r as w}from"./format-BsuBtvUs.js";import{t as T}from"./EventDateBlock-_E5XlLto.js";import{t as E}from"./widgets-D5Uy4PcL.js";var D={class:`grid min-w-0 grid-cols-1 content-start gap-6`},O={__name:`DashboardSidebar`,props:{widgets:{type:Array,required:!0}},setup(e){return(t,r)=>(l(),a(`aside`,D,[(l(!0),a(u,null,o(e.widgets,e=>(l(),a(u,{key:e.key},[n(E)(e.component)?(l(),p(m(n(E)(e.component)),s({key:0,ref_for:!0},e.props),null,16)):h(``,!0)],64))),128))]))}},k={class:`grid gap-6 lg:grid-cols-12`},A={key:0,class:`grid gap-8`},j={class:`mb-3 text-sm font-semibold text-muted-foreground`},M={class:`divide-y rounded-lg border bg-card`},N={class:`min-w-0 flex-1`},P={class:`text-[15px] font-semibold group-hover:underline`},F={class:`mt-0.5 text-[13px] text-muted-foreground`},I={key:0,class:`mt-0.5 flex items-center gap-1.5 text-[13px] text-muted-foreground`},L=[`src`],R={key:1,class:`rounded-lg border border-dashed bg-card`},z={__name:`Index`,props:{events:{type:Object,required:!0},sidebar:{type:Array,default:()=>[]}},setup(s){let m=s,E=c(()=>{let e=[];for(let t of m.events.data){let n=new Date(t.starts_at),r=C((n(l(),p(b,{title:`Termine`},{default:d(()=>[e(S,{title:`Termine`,description:`Veranstaltungen, Fortbildungen und Treffen.`}),i(`div`,k,[i(`div`,{class:r([`min-w-0`,s.sidebar.length?`lg:col-span-8 xl:col-span-9`:`lg:col-span-12`])},[E.value.length?(l(),a(`div`,A,[(l(!0),a(u,null,o(E.value,r=>(l(),a(`section`,{key:r.label},[i(`h2`,j,f(r.label),1),i(`ul`,M,[(l(!0),a(u,null,o(r.events,r=>(l(),a(`li`,{key:r.id},[e(n(g),{href:`/termine/${r.id}`,class:`group flex items-center gap-4 p-4 transition-colors hover:bg-accent/60`},{default:d(()=>[e(T,{date:r.starts_at,class:`w-14`},null,8,[`date`]),i(`div`,N,[i(`h3`,P,f(r.title),1),i(`p`,F,f(n(w)(r)),1),r.location||r.online_url?(l(),a(`p`,I,[r.location?(l(),p(n(_),{key:0,class:`size-3.5`})):(l(),p(n(v),{key:1,class:`size-3.5`})),t(` `+f(r.location||`Online`),1)])):h(``,!0)]),r.thumb_url?(l(),a(`img`,{key:0,src:r.thumb_url,alt:``,loading:`lazy`,class:`hidden h-16 w-28 shrink-0 rounded-md object-cover sm:block`},null,8,L)):h(``,!0)]),_:2},1032,[`href`])]))),128))])]))),128))])):(l(),a(`div`,R,[e(x,{icon:n(y),title:`Keine anstehenden Termine`,text:`Neue Termine erscheinen hier, sobald sie eingetragen sind.`},null,8,[`icon`])]))],2),s.sidebar.length?(l(),p(O,{key:0,widgets:s.sidebar,class:`lg:col-span-4 xl:col-span-3`},null,8,[`widgets`])):h(``,!0)])]),_:1}))}};export{z as default}; \ No newline at end of file diff --git a/public/build/assets/Index-CEVOUwPe.js b/public/build/assets/Index-CEVOUwPe.js deleted file mode 100644 index 73b51aaf..00000000 --- a/public/build/assets/Index-CEVOUwPe.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EditorialForms-Xe2D8QAP.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/app-Bu3kn8yd.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-CL30rx2M.css","assets/download-UAAY3N2F.js","assets/dist-DtGNiYlK.js","assets/pencil-line-CmAbFj4f.js","assets/plus-B_ij2ng2.js","assets/table-properties-BPjlj2dD.js","assets/button-ZHC5mKey.js","assets/Panel-BASB8Xb9.js","assets/chevron-right-C9w5cb2q.js","assets/EditorialNews-D_r1x5FJ.js","assets/message-square-warning-BFfa_vqd.js","assets/format-BsuBtvUs.js","assets/EditorialPages-iK1WfX4x.js","assets/lock-H7FAhSBr.js","assets/NewPageDialog-BJuo8o_M.js","assets/DialogDescription-BxaIqmag.js","assets/usePrimitiveElement-DC7UloPZ.js","assets/AppIcon-0N56IC2z.js","assets/RovingFocusGroup-D88K7krN.js","assets/http-DmyDwIce.js","assets/Input-FGSb2-yK.js","assets/dialog-uBUhf8w7.js","assets/DialogHeader-DuqiL3ry.js"])))=>i.map(i=>d[i]); -import{D as e,O as t,_ as n,b as r,bt as i,et as a,mt as o,o as s,qt as c,v as l,wt as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{s as d}from"./app-Bu3kn8yd.js";import{t as f}from"./AppLayout-BxsYt2ib.js";import{t as p}from"./PageHeader-Ybe7qDu5.js";var m={class:`grid items-start gap-6 xl:grid-cols-2`},h={__name:`Index`,props:{sections:{type:Array,required:!0}},setup(h){let g=Object.assign({"../../../../plugins-core/forms/resources/js/editorial/EditorialForms.vue":()=>d(()=>import(`./EditorialForms-Xe2D8QAP.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),"../../../../plugins-core/news/resources/js/editorial/EditorialNews.vue":()=>d(()=>import(`./EditorialNews-D_r1x5FJ.js`),__vite__mapDeps([13,1,2,3,4,14,6,8,15,10,11,12])),"../../../../plugins-core/pages/resources/js/editorial/EditorialPages.vue":()=>d(()=>import(`./EditorialPages-iK1WfX4x.js`),__vite__mapDeps([16,1,2,3,4,17,6,8,15,10,11,12,18,19,20,21,22,23,24,25,26]))}),_={};for(let[e,n]of Object.entries(g)){let[,r]=e.match(/plugins-core\/([^/]+)\//);_[`${r}::${e.split(`/`).pop().replace(`.vue`,``)}`]=t(n)}return(t,d)=>(o(),l(f,{title:`Redaktion`},{default:c(()=>[e(p,{title:`Redaktion`,description:`Ihre Seiten und Beiträge – Entwürfe, Freigaben und Geplantes.`}),n(`div`,m,[(o(!0),r(s,null,i(h.sections,e=>(o(),l(u(_[e.component]),a({key:e.key},{ref_for:!0},e.props),null,16))),128))])]),_:1}))}};export{h as default}; \ No newline at end of file diff --git a/public/build/assets/Index-OH77dt1V.js b/public/build/assets/Index-CLoLvBQV.js similarity index 91% rename from public/build/assets/Index-OH77dt1V.js rename to public/build/assets/Index-CLoLvBQV.js index b362a312..2b0a2c0f 100644 --- a/public/build/assets/Index-OH77dt1V.js +++ b/public/build/assets/Index-CLoLvBQV.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as p}from"./app-Bu3kn8yd.js";import{D as m}from"./AppIcon-0N56IC2z.js";import{t as h}from"./AppLayout-BxsYt2ib.js";import{s as g}from"./RovingFocusGroup-D88K7krN.js";import{i as _,r as v,t as y}from"./FolderTile-_J6uRwiD.js";import{t as b}from"./EmptyState-Ceq4v8mE.js";import{t as x}from"./PageHeader-Ybe7qDu5.js";import{t as S}from"./button-ZHC5mKey.js";import{t as C}from"./colors-RDOJqd57.js";import{t as w}from"./QmSearchBox-Ri1YCTQc.js";var T=[`href`],E={key:0,class:`relative overflow-hidden rounded-lg border bg-card p-5 pl-6`},D=[`innerHTML`],O={key:1,class:`rounded-lg border bg-card`},k={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},A={key:1,class:`grid gap-8`},j={class:`mb-3 flex items-center gap-3`},M={class:`text-sm font-semibold tracking-wide whitespace-nowrap text-muted-foreground uppercase`},N={class:`grid grid-cols-[repeat(auto-fill,minmax(13rem,1fr))] gap-4`},P={key:2,class:`mt-10`},F={class:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`},I={class:`mb-3 flex flex-wrap items-center gap-2`},L={key:0,class:`rounded bg-brand-soft px-2 py-0.5 text-xs font-medium text-brand-soft-foreground`},R={key:3,class:`rounded-lg border bg-card`},z=[`href`],B={__name:`Index`,props:{intro:{type:String,default:``},contacts:{type:Array,default:()=>[]},officers:{type:Array,default:()=>[]},categories:{type:Array,required:!0},canManage:{type:Boolean,default:!1},adminUrl:{type:String,default:null}},setup(B){return(V,H)=>(s(),d(h,{title:`Qualitätsmanagement`},{default:l(()=>[e(x,{title:`Qualitätsmanagement`,description:`Verfahrensanweisungen, Standards und Formulare – immer in der gültigen Fassung.`},{actions:l(()=>[B.adminUrl?(s(),d(n(S),{key:0,variant:`outline`,class:`h-10`,"as-child":``},{default:l(()=>[i(`a`,{href:B.adminUrl},[e(n(_)),H[0]||=t(` Ordner verwalten`,-1)],8,T)]),_:1})):f(``,!0),e(w)]),_:1}),B.intro||B.contacts.length?(s(),a(`div`,{key:0,class:r([`mb-8 grid items-start gap-6`,{"lg:grid-cols-[minmax(0,1fr)_20rem]":B.intro&&B.contacts.length}])},[B.intro?(s(),a(`section`,E,[H[1]||=i(`span`,{class:`absolute inset-y-0 left-0 w-1.5 bg-brand`,"aria-hidden":`true`},null,-1),i(`div`,{class:`prose prose-sm max-w-none dark:prose-invert`,innerHTML:B.intro},null,8,D)])):f(``,!0),B.contacts.length?(s(),a(`aside`,O,[i(`h2`,k,[e(n(m),{class:`size-4 text-brand-text`}),t(` `+u(B.contacts.length===1?`Ansprechpartner*in QM`:`Ansprechpartner*innen QM`),1)]),i(`div`,{class:r([`grid gap-4 p-4`,{"sm:grid-cols-2 lg:grid-cols-1":!B.intro}])},[(s(!0),a(c,null,o(B.contacts,e=>(s(),d(v,{key:e.id,contact:e},null,8,[`contact`]))),128))],2)])):f(``,!0)],2)):f(``,!0),B.categories.length?(s(),a(`div`,A,[(s(!0),a(c,null,o(B.categories,e=>(s(),a(`section`,{key:e.id??`rest`},[i(`div`,j,[i(`h2`,M,u(e.name),1),H[2]||=i(`span`,{class:`h-px flex-1 bg-border`,"aria-hidden":`true`},null,-1)]),i(`div`,N,[(s(!0),a(c,null,o(e.folders,e=>(s(),d(y,{key:e.id,folder:e},null,8,[`folder`]))),128))])]))),128))])):f(``,!0),B.officers.length?(s(),a(`section`,P,[H[3]||=i(`div`,{class:`mb-3 flex items-center gap-3`},[i(`h2`,{class:`text-sm font-semibold tracking-wide whitespace-nowrap text-muted-foreground uppercase`},`QM-Beauftragte`),i(`span`,{class:`h-px flex-1 bg-border`,"aria-hidden":`true`})],-1),i(`ul`,F,[(s(!0),a(c,null,o(B.officers,(o,c)=>(s(),a(`li`,{key:`${o.id}-${c}`,class:`rounded-lg border bg-card p-4`},[i(`div`,I,[o.area?(s(),a(`span`,L,u(o.area),1)):f(``,!0),o.folder?(s(),d(n(p),{key:1,href:o.folder.url,class:`inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground hover:underline`},{default:l(()=>[i(`span`,{class:r([`size-2 rounded-sm`,n(C)(o.folder.color).dot])},null,2),t(u(o.folder.path),1)]),_:2},1032,[`href`])):f(``,!0)]),e(v,{contact:o},null,8,[`contact`])]))),128))])])):f(``,!0),B.categories.length?f(``,!0):(s(),a(`div`,R,[e(b,{icon:n(g),title:`Noch keine Ordner`,text:B.canManage?`Legen Sie Kategorien und Ordner im Admin-Bereich unter „Qualitätsmanagement“ an.`:`Hier erscheinen bald die QM-Dokumente.`},{default:l(()=>[B.adminUrl?(s(),d(n(S),{key:0,class:`mt-4`,"as-child":``},{default:l(()=>[i(`a`,{href:B.adminUrl},`Ordner anlegen`,8,z)]),_:1})):f(``,!0)]),_:1},8,[`icon`,`text`])]))]),_:1}))}};export{B as default}; \ No newline at end of file +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as p}from"./app-BNwrc_lv.js";import{D as m}from"./AppIcon-nlhvQfK7.js";import{t as h}from"./AppLayout-esQiy2nD.js";import{s as g}from"./RovingFocusGroup-D88K7krN.js";import{i as _,r as v,t as y}from"./FolderTile-B1Q0k_YL.js";import{t as b}from"./EmptyState-Ceq4v8mE.js";import{t as x}from"./PageHeader-BMzzCXfT.js";import{n as S}from"./button-CwUSbS9X.js";import{t as C}from"./colors-RDOJqd57.js";import{t as w}from"./QmSearchBox-BW950raa.js";var T=[`href`],E={key:0,class:`relative overflow-hidden rounded-lg border bg-card p-5 pl-6`},D=[`innerHTML`],O={key:1,class:`rounded-lg border bg-card`},k={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},A={key:1,class:`grid gap-8`},j={class:`mb-3 flex items-center gap-3`},M={class:`text-sm font-semibold tracking-wide whitespace-nowrap text-muted-foreground uppercase`},N={class:`grid grid-cols-[repeat(auto-fill,minmax(13rem,1fr))] gap-4`},P={key:2,class:`mt-10`},F={class:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`},I={class:`mb-3 flex flex-wrap items-center gap-2`},L={key:0,class:`rounded bg-brand-soft px-2 py-0.5 text-xs font-medium text-brand-soft-foreground`},R={key:3,class:`rounded-lg border bg-card`},z=[`href`],B={__name:`Index`,props:{intro:{type:String,default:``},contacts:{type:Array,default:()=>[]},officers:{type:Array,default:()=>[]},categories:{type:Array,required:!0},canManage:{type:Boolean,default:!1},adminUrl:{type:String,default:null}},setup(B){return(V,H)=>(s(),d(h,{title:`Qualitätsmanagement`},{default:l(()=>[e(x,{title:`Qualitätsmanagement`,description:`Verfahrensanweisungen, Standards und Formulare – immer in der gültigen Fassung.`},{actions:l(()=>[B.adminUrl?(s(),d(n(S),{key:0,variant:`outline`,class:`h-10`,"as-child":``},{default:l(()=>[i(`a`,{href:B.adminUrl},[e(n(_)),H[0]||=t(` Ordner verwalten`,-1)],8,T)]),_:1})):f(``,!0),e(w)]),_:1}),B.intro||B.contacts.length?(s(),a(`div`,{key:0,class:r([`mb-8 grid items-start gap-6`,{"lg:grid-cols-[minmax(0,1fr)_20rem]":B.intro&&B.contacts.length}])},[B.intro?(s(),a(`section`,E,[H[1]||=i(`span`,{class:`absolute inset-y-0 left-0 w-1.5 bg-brand`,"aria-hidden":`true`},null,-1),i(`div`,{class:`prose prose-sm max-w-none dark:prose-invert`,innerHTML:B.intro},null,8,D)])):f(``,!0),B.contacts.length?(s(),a(`aside`,O,[i(`h2`,k,[e(n(m),{class:`size-4 text-brand-text`}),t(` `+u(B.contacts.length===1?`Ansprechpartner*in QM`:`Ansprechpartner*innen QM`),1)]),i(`div`,{class:r([`grid gap-4 p-4`,{"sm:grid-cols-2 lg:grid-cols-1":!B.intro}])},[(s(!0),a(c,null,o(B.contacts,e=>(s(),d(v,{key:e.id,contact:e},null,8,[`contact`]))),128))],2)])):f(``,!0)],2)):f(``,!0),B.categories.length?(s(),a(`div`,A,[(s(!0),a(c,null,o(B.categories,e=>(s(),a(`section`,{key:e.id??`rest`},[i(`div`,j,[i(`h2`,M,u(e.name),1),H[2]||=i(`span`,{class:`h-px flex-1 bg-border`,"aria-hidden":`true`},null,-1)]),i(`div`,N,[(s(!0),a(c,null,o(e.folders,e=>(s(),d(y,{key:e.id,folder:e},null,8,[`folder`]))),128))])]))),128))])):f(``,!0),B.officers.length?(s(),a(`section`,P,[H[3]||=i(`div`,{class:`mb-3 flex items-center gap-3`},[i(`h2`,{class:`text-sm font-semibold tracking-wide whitespace-nowrap text-muted-foreground uppercase`},`QM-Beauftragte`),i(`span`,{class:`h-px flex-1 bg-border`,"aria-hidden":`true`})],-1),i(`ul`,F,[(s(!0),a(c,null,o(B.officers,(o,c)=>(s(),a(`li`,{key:`${o.id}-${c}`,class:`rounded-lg border bg-card p-4`},[i(`div`,I,[o.area?(s(),a(`span`,L,u(o.area),1)):f(``,!0),o.folder?(s(),d(n(p),{key:1,href:o.folder.url,class:`inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground hover:underline`},{default:l(()=>[i(`span`,{class:r([`size-2 rounded-sm`,n(C)(o.folder.color).dot])},null,2),t(u(o.folder.path),1)]),_:2},1032,[`href`])):f(``,!0)]),e(v,{contact:o},null,8,[`contact`])]))),128))])])):f(``,!0),B.categories.length?f(``,!0):(s(),a(`div`,R,[e(b,{icon:n(g),title:`Noch keine Ordner`,text:B.canManage?`Legen Sie Kategorien und Ordner im Admin-Bereich unter „Qualitätsmanagement“ an.`:`Hier erscheinen bald die QM-Dokumente.`},{default:l(()=>[B.adminUrl?(s(),d(n(S),{key:0,class:`mt-4`,"as-child":``},{default:l(()=>[i(`a`,{href:B.adminUrl},`Ordner anlegen`,8,z)]),_:1})):f(``,!0)]),_:1},8,[`icon`,`text`])]))]),_:1}))}};export{B as default}; \ No newline at end of file diff --git a/public/build/assets/Index-stioZgWd.js b/public/build/assets/Index-CaaVYsb2.js similarity index 96% rename from public/build/assets/Index-stioZgWd.js rename to public/build/assets/Index-CaaVYsb2.js index dcc4419e..06465df2 100644 --- a/public/build/assets/Index-stioZgWd.js +++ b/public/build/assets/Index-CaaVYsb2.js @@ -1 +1 @@ -import{D as e,E as t,Ht as n,On as r,Zn as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,vn as m,wt as h,y as g}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as _}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as v,i as y,o as b,r as x}from"./app-Bu3kn8yd.js";import{O as S,k as C}from"./dist-DtGNiYlK.js";import{c as w,i as T,j as E,nt as D,o as O,p as k,s as A}from"./AppIcon-0N56IC2z.js";import{t as j}from"./AppLayout-BxsYt2ib.js";import{_ as M,o as N,t as P}from"./http-DmyDwIce.js";import{t as F}from"./chevron-left-8GGLVOvJ.js";import{t as I}from"./chevron-right-C9w5cb2q.js";import{t as ee}from"./ellipsis-vertical-B9wuHo-w.js";import{t as L}from"./pencil-line-CmAbFj4f.js";import{t as R}from"./plus-B_ij2ng2.js";import{t as te}from"./trash-DUqnVIgb.js";import{t as z}from"./FormField-BoFAO4pm.js";import{t as B}from"./EmptyState-Ceq4v8mE.js";import{t as V}from"./PageHeader-Ybe7qDu5.js";import{t as H}from"./button-ZHC5mKey.js";import{t as U}from"./Input-FGSb2-yK.js";import{t as W}from"./Textarea-DEFXqC2w.js";import{i as G,n as K,r as q,t as J}from"./dialog-uBUhf8w7.js";import{t as Y}from"./DialogHeader-DuqiL3ry.js";var X=C({name:`arrow-right-left`,size:24,node:[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]}),Z=C({name:`award`,size:24,node:[[`path`,{d:`m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526`,key:`1yiouv`}],[`circle`,{cx:`12`,cy:`8`,r:`6`,key:`1vp47v`}]]}),Q=C({name:`flower-2`,size:24,node:[[`path`,{d:`M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1`,key:`3pnvol`}],[`circle`,{cx:`12`,cy:`8`,r:`2`,key:`1822b1`}],[`path`,{d:`M12 10v12`,key:`6ubwww`}],[`path`,{d:`M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z`,key:`9hd38g`}],[`path`,{d:`M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z`,key:`ufn41s`}]]}),ne=C({name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]}),re={key:0},ie={key:0,class:`flex items-center gap-2 rounded-md border px-2 py-1.5`},ae={class:`min-w-0 flex-1 truncate text-sm`},oe={key:1,class:`relative`},se={key:0,class:`absolute inset-x-0 top-full z-30 mt-1 max-h-60 overflow-y-auto rounded-md border bg-popover p-1 shadow-md`},ce=[`onClick`],le={class:`truncate`},ue={class:`grid gap-4 sm:grid-cols-2`},de={key:0,class:`-mt-2 text-xs text-muted-foreground`},fe={__name:`EntryDialog`,props:{open:{type:Boolean,default:!1},section:{type:Object,default:null},entry:{type:Object,default:null},month:{type:String,required:!0}},emits:[`update:open`],setup(i,{emit:h}){let v=i,b=h,x={welcome:{date:`Eintritt am`,fields:[`department`,`location`,`text`]},transfer:{date:`Wechsel ab`,fields:[`from`,`to`,`text`]},jubilee:{date:`Jubiläum am`,fields:[`label`,`department`,`text`],label:`Jubiläum`,labelPlaceholder:`z. B. 25 Jahre`},farewell:{date:`Letzter Arbeitstag`,fields:[`department`,`label`,`text`],label:`Anlass (optional)`,labelPlaceholder:`z. B. Ruhestand`},memoriam:{date:`Verstorben am`,fields:[`born_on`,`department`,`text`]}},C=c(()=>x[v.section?.key]??x.welcome),w=e=>C.value.fields.includes(e),T=y({section:``,user_id:null,name:``,date:``,born_on:``,department:``,location:``,from:``,to:``,label:``,text:``}),E=m(null),D=m(!1),O=m(``),A=m([]);n(()=>v.open,e=>{if(!e)return;let t=v.entry;T.clearErrors(),T.defaults({section:v.section.key,user_id:t?.user_id??null,name:t?.free_name??``,date:t?.date??`${v.month}-01`,born_on:t?.born_on??``,department:t?.raw?.department??``,location:t?.raw?.location??``,from:t?.from??``,to:t?.to??``,label:t?.label??``,text:t?.text??``}),T.reset(),E.value=t?.person??null,D.value=!!t&&!t.user_id,O.value=``,A.value=[]});let j;n(O,e=>{if(clearTimeout(j),e.trim().length<2)return A.value=[];j=setTimeout(async()=>A.value=(await P.get(`/personen/suche?q=${encodeURIComponent(e.trim())}`)).people,250)});function N(e){E.value=e,T.user_id=e.id,O.value=``,A.value=[]}function F(){E.value=null,T.user_id=null}function I(){D.value&&(T.user_id=null);let e={preserveScroll:!0,onSuccess:()=>b(`update:open`,!1)};v.entry?T.put(`/gemeinsam/eintraege/${v.entry.id}`,e):T.post(`/gemeinsam/eintraege`,e)}return(n,c)=>(l(),p(r(G),{open:i.open,"onUpdate:open":c[12]||=e=>b(`update:open`,e)},{default:d(()=>[e(r(q),{class:`sm:max-w-lg`},{default:d(()=>[e(r(Y),null,{default:d(()=>[e(r(J),null,{default:d(()=>[t(f(i.section?.title),1)]),_:1})]),_:1}),a(`form`,{class:`grid gap-4`,onSubmit:_(I,[`prevent`])},[e(z,{id:`g-person`,label:`Person`,error:r(T).errors.name||r(T).errors.user_id},{default:d(()=>[D.value?(l(),p(r(U),{key:1,id:`g-person`,modelValue:r(T).name,"onUpdate:modelValue":c[1]||=e=>r(T).name=e,maxlength:`150`,placeholder:`Vor- und Nachname`},null,8,[`modelValue`])):(l(),o(`div`,re,[E.value?(l(),o(`div`,ie,[e(k,{person:E.value,class:`size-7 text-[10px]`},null,8,[`person`]),a(`span`,ae,f(E.value.name),1),a(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,"aria-label":`Auswahl entfernen`,onClick:F},[e(r(M),{class:`size-3.5`})])])):(l(),o(`div`,oe,[e(r(U),{id:`g-person`,modelValue:O.value,"onUpdate:modelValue":c[0]||=e=>O.value=e,placeholder:`Name im Portal suchen …`,autocomplete:`off`},null,8,[`modelValue`]),A.value.length?(l(),o(`ul`,se,[(l(!0),o(u,null,s(A.value,n=>(l(),o(`li`,{key:n.id},[a(`button`,{type:`button`,class:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm hover:bg-accent`,onClick:e=>N(n)},[e(k,{person:n,class:`size-7 text-[10px]`},null,8,[`person`]),c[13]||=t(),a(`span`,le,f(n.name),1)],8,ce)]))),128))])):g(``,!0)]))])),a(`button`,{type:`button`,class:`mt-1 justify-self-start text-xs text-brand-text hover:underline`,onClick:c[2]||=e=>D.value=!D.value},f(D.value?`Stattdessen Person aus dem Portal wählen`:`Nicht im Portal? Namen frei eintragen`),1)]),_:1},8,[`error`]),a(`div`,ue,[e(z,{id:`g-date`,label:C.value.date,error:r(T).errors.date},{default:d(()=>[e(r(U),{id:`g-date`,modelValue:r(T).date,"onUpdate:modelValue":c[3]||=e=>r(T).date=e,type:`date`},null,8,[`modelValue`])]),_:1},8,[`label`,`error`]),w(`born_on`)?(l(),p(z,{key:0,id:`g-born`,label:`Geboren am (optional)`,error:r(T).errors.born_on},{default:d(()=>[e(r(U),{id:`g-born`,modelValue:r(T).born_on,"onUpdate:modelValue":c[4]||=e=>r(T).born_on=e,type:`date`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),w(`label`)?(l(),p(z,{key:1,id:`g-label`,label:C.value.label,error:r(T).errors.label},{default:d(()=>[e(r(U),{id:`g-label`,modelValue:r(T).label,"onUpdate:modelValue":c[5]||=e=>r(T).label=e,maxlength:`150`,placeholder:C.value.labelPlaceholder},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`,`error`])):g(``,!0),w(`from`)?(l(),p(z,{key:2,id:`g-from`,label:`Bisher`,error:r(T).errors.from},{default:d(()=>[e(r(U),{id:`g-from`,modelValue:r(T).from,"onUpdate:modelValue":c[6]||=e=>r(T).from=e,maxlength:`150`,placeholder:`z. B. Werkstatt Nord`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),w(`to`)?(l(),p(z,{key:3,id:`g-to`,label:`Künftig`,error:r(T).errors.to},{default:d(()=>[e(r(U),{id:`g-to`,modelValue:r(T).to,"onUpdate:modelValue":c[7]||=e=>r(T).to=e,maxlength:`150`,placeholder:`z. B. Verwaltung`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),w(`department`)?(l(),p(z,{key:4,id:`g-dep`,label:`Bereich`,error:r(T).errors.department},{default:d(()=>[e(r(U),{id:`g-dep`,modelValue:r(T).department,"onUpdate:modelValue":c[8]||=e=>r(T).department=e,maxlength:`150`,placeholder:E.value?.department||``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`error`])):g(``,!0),w(`location`)?(l(),p(z,{key:5,id:`g-loc`,label:`Standort`,error:r(T).errors.location},{default:d(()=>[e(r(U),{id:`g-loc`,modelValue:r(T).location,"onUpdate:modelValue":c[9]||=e=>r(T).location=e,maxlength:`150`,placeholder:E.value?.location||``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`error`])):g(``,!0)]),E.value&&(w(`department`)||w(`location`))?(l(),o(`p`,de,`Leer gelassen, gilt die Angabe aus dem Profil.`)):g(``,!0),w(`text`)?(l(),p(z,{key:1,id:`g-text`,label:`Text (optional)`,error:r(T).errors.text},{default:d(()=>[e(r(W),{id:`g-text`,modelValue:r(T).text,"onUpdate:modelValue":c[10]||=e=>r(T).text=e,rows:`2`,maxlength:`1000`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),e(r(K),null,{default:d(()=>[e(r(H),{type:`button`,variant:`outline`,onClick:c[11]||=e=>b(`update:open`,!1)},{default:d(()=>[...c[14]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(H),{type:`submit`,disabled:r(T).processing},{default:d(()=>[r(T).processing?(l(),p(r(S),{key:0,class:`animate-spin`})):g(``,!0),c[15]||=t(` Speichern`,-1)]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]))}},pe={class:`flex min-w-0 items-center gap-3`},me={class:`min-w-0`},he={key:1,class:`block truncate text-sm font-medium`},ge={key:2,class:`block truncate text-xs text-muted-foreground`},_e={__name:`PersonCell`,props:{entry:{type:Object,required:!0},muted:{type:Boolean,default:!1}},setup(n){let s=e=>e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]).join(``).toUpperCase();return(c,u)=>(l(),o(`div`,pe,[e(k,{person:n.entry.person??{id:n.entry.name,name:n.entry.name,initials:s(n.entry.name)},class:i([`size-9 shrink-0`,{grayscale:n.muted}])},null,8,[`person`,`class`]),a(`div`,me,[n.entry.person?.url?(l(),p(r(x),{key:0,href:n.entry.person.url,class:`block truncate text-sm font-medium hover:underline`},{default:d(()=>[t(f(n.entry.name),1)]),_:1},8,[`href`])):(l(),o(`span`,he,f(n.entry.name),1)),n.entry.person?.job_title?(l(),o(`span`,ge,f(n.entry.person.job_title),1)):g(``,!0)])]))}},ve={class:`flex items-center gap-1 rounded-md border bg-card p-0.5`},ye={class:`min-w-32 text-center text-sm font-medium`},be={key:0,class:`grid gap-6`},xe={class:`flex items-center justify-between gap-3 border-b px-5 py-3`},Se={key:1,class:`text-xs text-muted-foreground`},Ce={key:0,class:`overflow-x-auto`},we={class:`w-full text-sm`},Te={class:`bg-muted/40 text-left text-xs text-muted-foreground`},Ee={key:0,class:`w-12`},De={class:`divide-y`},Oe={class:`px-5 py-2.5`},$={key:0,class:`pr-3 text-right`},ke={key:0},Ae=[`colspan`],je={key:1,class:`px-5 py-4 text-[13px] text-muted-foreground`},Me={key:1,class:`rounded-lg border bg-card`},Ne={__name:`Index`,props:{month:{type:String,required:!0},monthLabel:{type:String,required:!0},previous:{type:String,required:!0},next:{type:String,required:!0},isCurrent:{type:Boolean,default:!0},sections:{type:Array,required:!0},canManage:{type:Boolean,default:!1}},setup(_){let y=_,S=v();n(()=>S.props.flash.status,e=>e&&N.success(e),{immediate:!0});let C={welcome:E,transfer:X,birthdays:D,jubilee:Z,farewell:ne,memoriam:Q},k={welcome:[[`department`,`Bereich`],[`location`,`Standort`],[`date`,`Eintritt`]],transfer:[[`from`,`Bisher`],[`to`,`Künftig`],[`date`,`Ab`]],birthdays:[[`department`,`Bereich`],[`location`,`Standort`],[`date`,`Geburtstag`]],jubilee:[[`label`,`Jubiläum`],[`department`,`Bereich`],[`date`,`Datum`]],farewell:[[`department`,`Bereich`],[`label`,`Anlass`],[`date`,`Letzter Arbeitstag`]],memoriam:[[`lifespan`,`Lebensdaten`],[`department`,`Bereich`]]},M=new Intl.DateTimeFormat(`de-DE`,{day:`2-digit`,month:`2-digit`,year:`numeric`}),P=new Intl.DateTimeFormat(`de-DE`,{day:`numeric`,month:`long`}),z=(e,t)=>e?(t===`birthdays`?P:M).format(new Date(`${e}T12:00:00`)):`–`;function U(e,t,n){return t===`date`?z(e.date,n):t===`lifespan`?[e.born_on&&`* ${z(e.born_on)}`,`† ${z(e.date)}`].filter(Boolean).join(` `):e[t]||`–`}let W=c(()=>y.sections.filter(e=>e.entries.length||y.canManage&&!e.automatic)),G=c(()=>y.sections.every(e=>!e.entries.length)),K=m({open:!1,section:null,entry:null}),q=e=>K.value={open:!0,section:e,entry:null},J=(e,t)=>K.value={open:!0,section:e,entry:t};function Y(e){window.confirm(`Eintrag „${e.name}“ entfernen?`)&&b.delete(`/gemeinsam/eintraege/${e.id}`,{preserveScroll:!0})}return(n,c)=>(l(),p(j,{title:`Gemeinsam feiern, erinnern und willkommen heißen`},{default:d(()=>[e(V,{title:`Gemeinsam feiern, erinnern und willkommen heißen`,description:_.monthLabel},{actions:d(()=>[a(`div`,ve,[e(r(H),{variant:`ghost`,size:`icon`,class:`size-8`,"as-child":``},{default:d(()=>[e(r(x),{href:`/gemeinsam?monat=${_.previous}`,"aria-label":`Vorheriger Monat`,"preserve-scroll":``},{default:d(()=>[e(r(F))]),_:1},8,[`href`])]),_:1}),a(`span`,ye,f(_.monthLabel),1),e(r(H),{variant:`ghost`,size:`icon`,class:`size-8`,"as-child":``},{default:d(()=>[e(r(x),{href:`/gemeinsam?monat=${_.next}`,"aria-label":`Nächster Monat`,"preserve-scroll":``},{default:d(()=>[e(r(I))]),_:1},8,[`href`])]),_:1})]),_.isCurrent?g(``,!0):(l(),p(r(H),{key:0,variant:`outline`,"as-child":``},{default:d(()=>[e(r(x),{href:`/gemeinsam`},{default:d(()=>[...c[1]||=[t(`Aktueller Monat`,-1)]]),_:1})]),_:1}))]),_:1},8,[`description`]),W.value.length&&(!G.value||_.canManage)?(l(),o(`div`,be,[(l(!0),o(u,null,s(W.value,n=>(l(),o(`section`,{key:n.key,class:i([`overflow-hidden rounded-lg border bg-card`,n.key===`memoriam`?`border-t-4 border-t-foreground/70`:`border-t-4 border-t-brand`])},[a(`header`,xe,[a(`h2`,{class:i([`flex items-center gap-2.5 text-base font-semibold`,{"text-foreground/85":n.key===`memoriam`}])},[(l(),p(h(C[n.key]),{class:i([`size-5`,n.key===`memoriam`?`text-muted-foreground`:`text-brand-text`])},null,8,[`class`])),t(` `+f(n.title),1)],2),_.canManage&&!n.automatic?(l(),p(r(H),{key:0,size:`sm`,variant:`outline`,onClick:e=>q(n)},{default:d(()=>[e(r(R)),c[2]||=t(` Hinzufügen`,-1)]),_:1},8,[`onClick`])):n.automatic&&_.canManage?(l(),o(`span`,Se,`aus dem Geburtstagskalender`)):g(``,!0)]),n.entries.length?(l(),o(`div`,Ce,[a(`table`,we,[a(`thead`,Te,[a(`tr`,null,[c[4]||=a(`th`,{class:`px-5 py-2 font-medium`},`Name`,-1),(l(!0),o(u,null,s(k[n.key],([e,t])=>(l(),o(`th`,{key:e,class:`px-3 py-2 font-medium whitespace-nowrap`},f(t),1))),128)),_.canManage&&!n.automatic?(l(),o(`th`,Ee,[...c[3]||=[a(`span`,{class:`sr-only`},`Aktionen`,-1)]])):g(``,!0)])]),a(`tbody`,De,[(l(!0),o(u,null,s(n.entries,p=>(l(),o(u,{key:p.id},[a(`tr`,null,[a(`td`,Oe,[e(_e,{entry:p,muted:n.key===`memoriam`},null,8,[`entry`,`muted`])]),(l(!0),o(u,null,s(k[n.key],([e])=>(l(),o(`td`,{key:e,class:i([`px-3 py-2.5 whitespace-nowrap`,{"tabular-nums":e===`date`||e===`lifespan`}])},f(U(p,e,n.key)),3))),128)),_.canManage&&!n.automatic?(l(),o(`td`,$,[e(r(w),null,{default:d(()=>[e(r(T),{"as-child":``},{default:d(()=>[e(r(H),{variant:`ghost`,size:`icon`,class:`size-8 text-muted-foreground`,"aria-label":`Aktionen für ${p.name}`},{default:d(()=>[e(r(ee))]),_:1},8,[`aria-label`])]),_:2},1024),e(r(A),{align:`end`},{default:d(()=>[e(r(O),{onSelect:e=>J(n,p)},{default:d(()=>[e(r(L)),c[5]||=t(` Bearbeiten`,-1)]),_:1},8,[`onSelect`]),e(r(O),{class:`text-destructive`,onSelect:e=>Y(p)},{default:d(()=>[e(r(te)),c[6]||=t(` Entfernen`,-1)]),_:1},8,[`onSelect`])]),_:2},1024)]),_:2},1024)])):g(``,!0)]),p.text?(l(),o(`tr`,ke,[a(`td`,{colspan:k[n.key].length+2,class:i([`-mt-1 px-5 pb-3 text-[13px] text-muted-foreground`,{italic:n.key===`memoriam`}])},f(p.text),11,Ae)])):g(``,!0)],64))),128))])])])):(l(),o(`p`,je,`Noch keine Einträge in diesem Monat.`))],2))),128))])):(l(),o(`div`,Me,[e(B,{icon:r(E),title:`Keine Einträge in diesem Monat`,text:`Hier stehen neue Kolleginnen und Kollegen, Wechsel, Geburtstage, Jubiläen, Verabschiedungen und Gedenken.`},null,8,[`icon`])])),_.canManage?(l(),p(fe,{key:2,open:K.value.open,"onUpdate:open":c[0]||=e=>K.value.open=e,section:K.value.section,entry:K.value.entry,month:_.month},null,8,[`open`,`section`,`entry`,`month`])):g(``,!0)]),_:1}))}};export{Ne as default}; \ No newline at end of file +import{D as e,E as t,Ht as n,On as r,Zn as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,vn as m,wt as h,y as g}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as _}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as v,i as y,o as b,r as x}from"./app-BNwrc_lv.js";import{O as S,k as C}from"./dist-DtGNiYlK.js";import{c as w,i as T,j as E,nt as D,o as O,p as k,s as A}from"./AppIcon-nlhvQfK7.js";import{t as j}from"./AppLayout-esQiy2nD.js";import{n as M,s as N,v as P}from"./http-CAG9BrJF.js";import{t as F}from"./chevron-left-8GGLVOvJ.js";import{t as I}from"./chevron-right-C9w5cb2q.js";import{t as ee}from"./ellipsis-vertical-B9wuHo-w.js";import{t as L}from"./pencil-line-CmAbFj4f.js";import{t as R}from"./plus-B_ij2ng2.js";import{t as te}from"./trash-DUqnVIgb.js";import{t as z}from"./FormField-BoFAO4pm.js";import{t as B}from"./EmptyState-Ceq4v8mE.js";import{t as V}from"./PageHeader-BMzzCXfT.js";import{n as H}from"./button-CwUSbS9X.js";import{t as U}from"./Input-FGSb2-yK.js";import{t as W}from"./Textarea-DEFXqC2w.js";import{i as G,n as K,r as q,t as J}from"./dialog-RK2mTeqi.js";import{t as Y}from"./DialogHeader-DuqiL3ry.js";var X=C({name:`arrow-right-left`,size:24,node:[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]}),Z=C({name:`award`,size:24,node:[[`path`,{d:`m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526`,key:`1yiouv`}],[`circle`,{cx:`12`,cy:`8`,r:`6`,key:`1vp47v`}]]}),Q=C({name:`flower-2`,size:24,node:[[`path`,{d:`M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1`,key:`3pnvol`}],[`circle`,{cx:`12`,cy:`8`,r:`2`,key:`1822b1`}],[`path`,{d:`M12 10v12`,key:`6ubwww`}],[`path`,{d:`M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z`,key:`9hd38g`}],[`path`,{d:`M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z`,key:`ufn41s`}]]}),ne=C({name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]}),re={key:0},ie={key:0,class:`flex items-center gap-2 rounded-md border px-2 py-1.5`},ae={class:`min-w-0 flex-1 truncate text-sm`},oe={key:1,class:`relative`},se={key:0,class:`absolute inset-x-0 top-full z-30 mt-1 max-h-60 overflow-y-auto rounded-md border bg-popover p-1 shadow-md`},ce=[`onClick`],le={class:`truncate`},ue={class:`grid gap-4 sm:grid-cols-2`},de={key:0,class:`-mt-2 text-xs text-muted-foreground`},fe={__name:`EntryDialog`,props:{open:{type:Boolean,default:!1},section:{type:Object,default:null},entry:{type:Object,default:null},month:{type:String,required:!0}},emits:[`update:open`],setup(i,{emit:h}){let v=i,b=h,x={welcome:{date:`Eintritt am`,fields:[`department`,`location`,`text`]},transfer:{date:`Wechsel ab`,fields:[`from`,`to`,`text`]},jubilee:{date:`Jubiläum am`,fields:[`label`,`department`,`text`],label:`Jubiläum`,labelPlaceholder:`z. B. 25 Jahre`},farewell:{date:`Letzter Arbeitstag`,fields:[`department`,`label`,`text`],label:`Anlass (optional)`,labelPlaceholder:`z. B. Ruhestand`},memoriam:{date:`Verstorben am`,fields:[`born_on`,`department`,`text`]}},C=c(()=>x[v.section?.key]??x.welcome),w=e=>C.value.fields.includes(e),T=y({section:``,user_id:null,name:``,date:``,born_on:``,department:``,location:``,from:``,to:``,label:``,text:``}),E=m(null),D=m(!1),O=m(``),A=m([]);n(()=>v.open,e=>{if(!e)return;let t=v.entry;T.clearErrors(),T.defaults({section:v.section.key,user_id:t?.user_id??null,name:t?.free_name??``,date:t?.date??`${v.month}-01`,born_on:t?.born_on??``,department:t?.raw?.department??``,location:t?.raw?.location??``,from:t?.from??``,to:t?.to??``,label:t?.label??``,text:t?.text??``}),T.reset(),E.value=t?.person??null,D.value=!!t&&!t.user_id,O.value=``,A.value=[]});let j;n(O,e=>{if(clearTimeout(j),e.trim().length<2)return A.value=[];j=setTimeout(async()=>A.value=(await M.get(`/personen/suche?q=${encodeURIComponent(e.trim())}`)).people,250)});function N(e){E.value=e,T.user_id=e.id,O.value=``,A.value=[]}function F(){E.value=null,T.user_id=null}function I(){D.value&&(T.user_id=null);let e={preserveScroll:!0,onSuccess:()=>b(`update:open`,!1)};v.entry?T.put(`/gemeinsam/eintraege/${v.entry.id}`,e):T.post(`/gemeinsam/eintraege`,e)}return(n,c)=>(l(),p(r(G),{open:i.open,"onUpdate:open":c[12]||=e=>b(`update:open`,e)},{default:d(()=>[e(r(q),{class:`sm:max-w-lg`},{default:d(()=>[e(r(Y),null,{default:d(()=>[e(r(J),null,{default:d(()=>[t(f(i.section?.title),1)]),_:1})]),_:1}),a(`form`,{class:`grid gap-4`,onSubmit:_(I,[`prevent`])},[e(z,{id:`g-person`,label:`Person`,error:r(T).errors.name||r(T).errors.user_id},{default:d(()=>[D.value?(l(),p(r(U),{key:1,id:`g-person`,modelValue:r(T).name,"onUpdate:modelValue":c[1]||=e=>r(T).name=e,maxlength:`150`,placeholder:`Vor- und Nachname`},null,8,[`modelValue`])):(l(),o(`div`,re,[E.value?(l(),o(`div`,ie,[e(k,{person:E.value,class:`size-7 text-[10px]`},null,8,[`person`]),a(`span`,ae,f(E.value.name),1),a(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,"aria-label":`Auswahl entfernen`,onClick:F},[e(r(P),{class:`size-3.5`})])])):(l(),o(`div`,oe,[e(r(U),{id:`g-person`,modelValue:O.value,"onUpdate:modelValue":c[0]||=e=>O.value=e,placeholder:`Name im Portal suchen …`,autocomplete:`off`},null,8,[`modelValue`]),A.value.length?(l(),o(`ul`,se,[(l(!0),o(u,null,s(A.value,n=>(l(),o(`li`,{key:n.id},[a(`button`,{type:`button`,class:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm hover:bg-accent`,onClick:e=>N(n)},[e(k,{person:n,class:`size-7 text-[10px]`},null,8,[`person`]),c[13]||=t(),a(`span`,le,f(n.name),1)],8,ce)]))),128))])):g(``,!0)]))])),a(`button`,{type:`button`,class:`mt-1 justify-self-start text-xs text-brand-text hover:underline`,onClick:c[2]||=e=>D.value=!D.value},f(D.value?`Stattdessen Person aus dem Portal wählen`:`Nicht im Portal? Namen frei eintragen`),1)]),_:1},8,[`error`]),a(`div`,ue,[e(z,{id:`g-date`,label:C.value.date,error:r(T).errors.date},{default:d(()=>[e(r(U),{id:`g-date`,modelValue:r(T).date,"onUpdate:modelValue":c[3]||=e=>r(T).date=e,type:`date`},null,8,[`modelValue`])]),_:1},8,[`label`,`error`]),w(`born_on`)?(l(),p(z,{key:0,id:`g-born`,label:`Geboren am (optional)`,error:r(T).errors.born_on},{default:d(()=>[e(r(U),{id:`g-born`,modelValue:r(T).born_on,"onUpdate:modelValue":c[4]||=e=>r(T).born_on=e,type:`date`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),w(`label`)?(l(),p(z,{key:1,id:`g-label`,label:C.value.label,error:r(T).errors.label},{default:d(()=>[e(r(U),{id:`g-label`,modelValue:r(T).label,"onUpdate:modelValue":c[5]||=e=>r(T).label=e,maxlength:`150`,placeholder:C.value.labelPlaceholder},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`,`error`])):g(``,!0),w(`from`)?(l(),p(z,{key:2,id:`g-from`,label:`Bisher`,error:r(T).errors.from},{default:d(()=>[e(r(U),{id:`g-from`,modelValue:r(T).from,"onUpdate:modelValue":c[6]||=e=>r(T).from=e,maxlength:`150`,placeholder:`z. B. Werkstatt Nord`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),w(`to`)?(l(),p(z,{key:3,id:`g-to`,label:`Künftig`,error:r(T).errors.to},{default:d(()=>[e(r(U),{id:`g-to`,modelValue:r(T).to,"onUpdate:modelValue":c[7]||=e=>r(T).to=e,maxlength:`150`,placeholder:`z. B. Verwaltung`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),w(`department`)?(l(),p(z,{key:4,id:`g-dep`,label:`Bereich`,error:r(T).errors.department},{default:d(()=>[e(r(U),{id:`g-dep`,modelValue:r(T).department,"onUpdate:modelValue":c[8]||=e=>r(T).department=e,maxlength:`150`,placeholder:E.value?.department||``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`error`])):g(``,!0),w(`location`)?(l(),p(z,{key:5,id:`g-loc`,label:`Standort`,error:r(T).errors.location},{default:d(()=>[e(r(U),{id:`g-loc`,modelValue:r(T).location,"onUpdate:modelValue":c[9]||=e=>r(T).location=e,maxlength:`150`,placeholder:E.value?.location||``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`error`])):g(``,!0)]),E.value&&(w(`department`)||w(`location`))?(l(),o(`p`,de,`Leer gelassen, gilt die Angabe aus dem Profil.`)):g(``,!0),w(`text`)?(l(),p(z,{key:1,id:`g-text`,label:`Text (optional)`,error:r(T).errors.text},{default:d(()=>[e(r(W),{id:`g-text`,modelValue:r(T).text,"onUpdate:modelValue":c[10]||=e=>r(T).text=e,rows:`2`,maxlength:`1000`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),e(r(K),null,{default:d(()=>[e(r(H),{type:`button`,variant:`outline`,onClick:c[11]||=e=>b(`update:open`,!1)},{default:d(()=>[...c[14]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(H),{type:`submit`,disabled:r(T).processing},{default:d(()=>[r(T).processing?(l(),p(r(S),{key:0,class:`animate-spin`})):g(``,!0),c[15]||=t(` Speichern`,-1)]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]))}},pe={class:`flex min-w-0 items-center gap-3`},me={class:`min-w-0`},he={key:1,class:`block truncate text-sm font-medium`},ge={key:2,class:`block truncate text-xs text-muted-foreground`},_e={__name:`PersonCell`,props:{entry:{type:Object,required:!0},muted:{type:Boolean,default:!1}},setup(n){let s=e=>e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]).join(``).toUpperCase();return(c,u)=>(l(),o(`div`,pe,[e(k,{person:n.entry.person??{id:n.entry.name,name:n.entry.name,initials:s(n.entry.name)},class:i([`size-9 shrink-0`,{grayscale:n.muted}])},null,8,[`person`,`class`]),a(`div`,me,[n.entry.person?.url?(l(),p(r(x),{key:0,href:n.entry.person.url,class:`block truncate text-sm font-medium hover:underline`},{default:d(()=>[t(f(n.entry.name),1)]),_:1},8,[`href`])):(l(),o(`span`,he,f(n.entry.name),1)),n.entry.person?.job_title?(l(),o(`span`,ge,f(n.entry.person.job_title),1)):g(``,!0)])]))}},ve={class:`flex items-center gap-1 rounded-md border bg-card p-0.5`},ye={class:`min-w-32 text-center text-sm font-medium`},be={key:0,class:`grid gap-6`},xe={class:`flex items-center justify-between gap-3 border-b px-5 py-3`},Se={key:1,class:`text-xs text-muted-foreground`},Ce={key:0,class:`overflow-x-auto`},we={class:`w-full text-sm`},Te={class:`bg-muted/40 text-left text-xs text-muted-foreground`},Ee={key:0,class:`w-12`},De={class:`divide-y`},Oe={class:`px-5 py-2.5`},$={key:0,class:`pr-3 text-right`},ke={key:0},Ae=[`colspan`],je={key:1,class:`px-5 py-4 text-[13px] text-muted-foreground`},Me={key:1,class:`rounded-lg border bg-card`},Ne={__name:`Index`,props:{month:{type:String,required:!0},monthLabel:{type:String,required:!0},previous:{type:String,required:!0},next:{type:String,required:!0},isCurrent:{type:Boolean,default:!0},sections:{type:Array,required:!0},canManage:{type:Boolean,default:!1}},setup(_){let y=_,S=v();n(()=>S.props.flash.status,e=>e&&N.success(e),{immediate:!0});let C={welcome:E,transfer:X,birthdays:D,jubilee:Z,farewell:ne,memoriam:Q},k={welcome:[[`department`,`Bereich`],[`location`,`Standort`],[`date`,`Eintritt`]],transfer:[[`from`,`Bisher`],[`to`,`Künftig`],[`date`,`Ab`]],birthdays:[[`department`,`Bereich`],[`location`,`Standort`],[`date`,`Geburtstag`]],jubilee:[[`label`,`Jubiläum`],[`department`,`Bereich`],[`date`,`Datum`]],farewell:[[`department`,`Bereich`],[`label`,`Anlass`],[`date`,`Letzter Arbeitstag`]],memoriam:[[`lifespan`,`Lebensdaten`],[`department`,`Bereich`]]},M=new Intl.DateTimeFormat(`de-DE`,{day:`2-digit`,month:`2-digit`,year:`numeric`}),P=new Intl.DateTimeFormat(`de-DE`,{day:`numeric`,month:`long`}),z=(e,t)=>e?(t===`birthdays`?P:M).format(new Date(`${e}T12:00:00`)):`–`;function U(e,t,n){return t===`date`?z(e.date,n):t===`lifespan`?[e.born_on&&`* ${z(e.born_on)}`,`† ${z(e.date)}`].filter(Boolean).join(` `):e[t]||`–`}let W=c(()=>y.sections.filter(e=>e.entries.length||y.canManage&&!e.automatic)),G=c(()=>y.sections.every(e=>!e.entries.length)),K=m({open:!1,section:null,entry:null}),q=e=>K.value={open:!0,section:e,entry:null},J=(e,t)=>K.value={open:!0,section:e,entry:t};function Y(e){window.confirm(`Eintrag „${e.name}“ entfernen?`)&&b.delete(`/gemeinsam/eintraege/${e.id}`,{preserveScroll:!0})}return(n,c)=>(l(),p(j,{title:`Gemeinsam feiern, erinnern und willkommen heißen`},{default:d(()=>[e(V,{title:`Gemeinsam feiern, erinnern und willkommen heißen`,description:_.monthLabel},{actions:d(()=>[a(`div`,ve,[e(r(H),{variant:`ghost`,size:`icon`,class:`size-8`,"as-child":``},{default:d(()=>[e(r(x),{href:`/gemeinsam?monat=${_.previous}`,"aria-label":`Vorheriger Monat`,"preserve-scroll":``},{default:d(()=>[e(r(F))]),_:1},8,[`href`])]),_:1}),a(`span`,ye,f(_.monthLabel),1),e(r(H),{variant:`ghost`,size:`icon`,class:`size-8`,"as-child":``},{default:d(()=>[e(r(x),{href:`/gemeinsam?monat=${_.next}`,"aria-label":`Nächster Monat`,"preserve-scroll":``},{default:d(()=>[e(r(I))]),_:1},8,[`href`])]),_:1})]),_.isCurrent?g(``,!0):(l(),p(r(H),{key:0,variant:`outline`,"as-child":``},{default:d(()=>[e(r(x),{href:`/gemeinsam`},{default:d(()=>[...c[1]||=[t(`Aktueller Monat`,-1)]]),_:1})]),_:1}))]),_:1},8,[`description`]),W.value.length&&(!G.value||_.canManage)?(l(),o(`div`,be,[(l(!0),o(u,null,s(W.value,n=>(l(),o(`section`,{key:n.key,class:i([`overflow-hidden rounded-lg border bg-card`,n.key===`memoriam`?`border-t-4 border-t-foreground/70`:`border-t-4 border-t-brand`])},[a(`header`,xe,[a(`h2`,{class:i([`flex items-center gap-2.5 text-base font-semibold`,{"text-foreground/85":n.key===`memoriam`}])},[(l(),p(h(C[n.key]),{class:i([`size-5`,n.key===`memoriam`?`text-muted-foreground`:`text-brand-text`])},null,8,[`class`])),t(` `+f(n.title),1)],2),_.canManage&&!n.automatic?(l(),p(r(H),{key:0,size:`sm`,variant:`outline`,onClick:e=>q(n)},{default:d(()=>[e(r(R)),c[2]||=t(` Hinzufügen`,-1)]),_:1},8,[`onClick`])):n.automatic&&_.canManage?(l(),o(`span`,Se,`aus dem Geburtstagskalender`)):g(``,!0)]),n.entries.length?(l(),o(`div`,Ce,[a(`table`,we,[a(`thead`,Te,[a(`tr`,null,[c[4]||=a(`th`,{class:`px-5 py-2 font-medium`},`Name`,-1),(l(!0),o(u,null,s(k[n.key],([e,t])=>(l(),o(`th`,{key:e,class:`px-3 py-2 font-medium whitespace-nowrap`},f(t),1))),128)),_.canManage&&!n.automatic?(l(),o(`th`,Ee,[...c[3]||=[a(`span`,{class:`sr-only`},`Aktionen`,-1)]])):g(``,!0)])]),a(`tbody`,De,[(l(!0),o(u,null,s(n.entries,p=>(l(),o(u,{key:p.id},[a(`tr`,null,[a(`td`,Oe,[e(_e,{entry:p,muted:n.key===`memoriam`},null,8,[`entry`,`muted`])]),(l(!0),o(u,null,s(k[n.key],([e])=>(l(),o(`td`,{key:e,class:i([`px-3 py-2.5 whitespace-nowrap`,{"tabular-nums":e===`date`||e===`lifespan`}])},f(U(p,e,n.key)),3))),128)),_.canManage&&!n.automatic?(l(),o(`td`,$,[e(r(w),null,{default:d(()=>[e(r(T),{"as-child":``},{default:d(()=>[e(r(H),{variant:`ghost`,size:`icon`,class:`size-8 text-muted-foreground`,"aria-label":`Aktionen für ${p.name}`},{default:d(()=>[e(r(ee))]),_:1},8,[`aria-label`])]),_:2},1024),e(r(A),{align:`end`},{default:d(()=>[e(r(O),{onSelect:e=>J(n,p)},{default:d(()=>[e(r(L)),c[5]||=t(` Bearbeiten`,-1)]),_:1},8,[`onSelect`]),e(r(O),{class:`text-destructive`,onSelect:e=>Y(p)},{default:d(()=>[e(r(te)),c[6]||=t(` Entfernen`,-1)]),_:1},8,[`onSelect`])]),_:2},1024)]),_:2},1024)])):g(``,!0)]),p.text?(l(),o(`tr`,ke,[a(`td`,{colspan:k[n.key].length+2,class:i([`-mt-1 px-5 pb-3 text-[13px] text-muted-foreground`,{italic:n.key===`memoriam`}])},f(p.text),11,Ae)])):g(``,!0)],64))),128))])])])):(l(),o(`p`,je,`Noch keine Einträge in diesem Monat.`))],2))),128))])):(l(),o(`div`,Me,[e(B,{icon:r(E),title:`Keine Einträge in diesem Monat`,text:`Hier stehen neue Kolleginnen und Kollegen, Wechsel, Geburtstage, Jubiläen, Verabschiedungen und Gedenken.`},null,8,[`icon`])])),_.canManage?(l(),p(fe,{key:2,open:K.value.open,"onUpdate:open":c[0]||=e=>K.value.open=e,section:K.value.section,entry:K.value.entry,month:_.month},null,8,[`open`,`section`,`entry`,`month`])):g(``,!0)]),_:1}))}};export{Ne as default}; \ No newline at end of file diff --git a/public/build/assets/Index-CjQCdvt-.js b/public/build/assets/Index-CjQCdvt-.js new file mode 100644 index 00000000..2c034a1c --- /dev/null +++ b/public/build/assets/Index-CjQCdvt-.js @@ -0,0 +1 @@ +import{d as e,i as t,o as n}from"./usePrimitiveElement-DC7UloPZ.js";import{$n as r,D as i,E as a,Ht as o,On as s,Yt as c,Zn as l,_ as u,b as d,bt as f,ct as p,et as m,g as h,k as g,mt as _,o as v,qt as y,tr as b,tt as x,v as S,vn as C,wt as w,xt as T,y as E,z as D}from"./runtime-core.esm-bundler-B8D2lM98.js";import{b as O,w as k,x as A}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{O as j,k as M,l as N,p as P,s as F}from"./dist-DtGNiYlK.js";import{C as I,N as ee,S as L,c as te,d as ne,f as re,g as R,i as ie,l as ae,o as oe,s as se,u as ce,v as z,y as B}from"./AppIcon-nlhvQfK7.js";import{t as le}from"./AppLayout-esQiy2nD.js";import{f as ue,s as V,v as de,y as fe}from"./http-CAG9BrJF.js";import{a as H,c as U,i as pe,l as W,n as G,r as me,s as K,t as he}from"./useMediaList-Cpw6m1Nv.js";import{t as ge}from"./copy-DsLby0sm.js";import{t as q}from"./download-UAAY3N2F.js";import{t as _e}from"./ellipsis-vertical-B9wuHo-w.js";import{t as J}from"./image-off-IDPmIoA8.js";import{t as ve}from"./image-plus-C1A_7CFG.js";import{t as ye}from"./images-47Nc0alu.js";import{t as be}from"./search-x-BVofHEe_.js";import{t as Y}from"./trash-DUqnVIgb.js";import{t as X}from"./DialogDescription-Cf3zbHQX.js";import{t as xe}from"./PageHeader-BMzzCXfT.js";import{n as Z}from"./format-BsuBtvUs.js";import{n as Q,t as Se}from"./button-CwUSbS9X.js";import{t as Ce}from"./Input-FGSb2-yK.js";import{t as we}from"./Textarea-DEFXqC2w.js";var Te=M({name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]}),Ee=M({name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]}),[De,Oe]=e(`AlertDialogContent`),ke=g({__name:`AlertDialogContent`,props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:t}){let r=e,i=n(t);P();let a=C();return Oe({onCancelElementChange:e=>{a.value=e}}),(e,t)=>(_(),S(s(B),m({...r,...s(i)},{role:`alertdialog`,onPointerDownOutside:t[0]||=k(()=>{},[`prevent`]),onInteractOutside:t[1]||=k(()=>{},[`prevent`]),onOpenAutoFocus:t[2]||=()=>{x(()=>{a.value?.focus({preventScroll:!0})})}}),{default:y(()=>[T(e.$slots,`default`)]),_:3},16))}}),Ae=g({__name:`AlertDialogCancel`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=De(),{forwardRef:r,currentElement:i}=P();return p(()=>{n.onCancelElementChange(i.value)}),(e,n)=>(_(),S(s(L),m(t,{ref:s(r)}),{default:y(()=>[T(e.$slots,`default`)]),_:3},16))}}),je=g({__name:`AlertDialogDescription`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`p`}},setup(e){let t=e;return P(),(e,n)=>(_(),S(s(X),r(D(t)),{default:y(()=>[T(e.$slots,`default`)]),_:3},16))}}),Me=g({__name:`AlertDialogOverlay`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return P(),(e,n)=>(_(),S(s(z),r(D(t)),{default:y(()=>[T(e.$slots,`default`)]),_:3},16))}}),Ne=g({__name:`AlertDialogPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(_(),S(s(ue),r(D(t)),{default:y(()=>[T(e.$slots,`default`)]),_:3},16))}}),Pe=g({__name:`AlertDialogRoot`,props:{open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1}},emits:[`update:open`],setup(e,{emit:n}){let i=t(e,n);return P(),(e,t)=>(_(),S(s(I),m(s(i),{modal:!0}),{default:y(t=>[T(e.$slots,`default`,r(D(t)))]),_:3},16))}}),Fe=g({__name:`AlertDialogTitle`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`h2`}},setup(e){let t=e;return P(),(e,n)=>(_(),S(s(R),r(D(t)),{default:y(()=>[T(e.$slots,`default`)]),_:3},16))}}),Ie=g({__name:`SheetDescription`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=F(t,`class`);return(e,r)=>(_(),S(s(X),m({"data-slot":`sheet-description`,class:s(N)(`text-muted-foreground text-sm`,t.class)},s(n)),{default:y(()=>[T(e.$slots,`default`)]),_:3},16,[`class`]))}}),Le=g({__name:`AlertDialog`,props:{open:{type:Boolean},defaultOpen:{type:Boolean},unmountOnHide:{type:Boolean}},emits:[`update:open`],setup(e,{emit:n}){let i=t(e,n);return(e,t)=>(_(),S(s(Pe),m({"data-slot":`alert-dialog`},s(i)),{default:y(t=>[T(e.$slots,`default`,r(D(t)))]),_:3},16))}}),Re=g({__name:`AlertDialogCancel`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=F(t,`class`);return(e,r)=>(_(),S(s(Ae),m(s(n),{class:s(N)(s(Se)({variant:`outline`}),`mt-2 sm:mt-0`,t.class)}),{default:y(()=>[T(e.$slots,`default`)]),_:3},16,[`class`]))}}),ze=g({inheritAttrs:!1,__name:`AlertDialogContent`,props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`openAutoFocus`,`closeAutoFocus`],setup(e,{emit:n}){let r=e,a=n,o=F(r,`class`),c=t(o,a);return(e,t)=>(_(),S(s(Ne),null,{default:y(()=>[i(s(Me),{"data-slot":`alert-dialog-overlay`,class:`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80`}),i(s(ke),m({"data-slot":`alert-dialog-content`},{...e.$attrs,...s(c)},{class:s(N)(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg`,r.class)}),{default:y(()=>[T(e.$slots,`default`)]),_:3},16,[`class`])]),_:3}))}}),Be=g({__name:`AlertDialogDescription`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=F(t,`class`);return(e,r)=>(_(),S(s(je),m({"data-slot":`alert-dialog-description`},s(n),{class:s(N)(`text-muted-foreground text-sm`,t.class)}),{default:y(()=>[T(e.$slots,`default`)]),_:3},16,[`class`]))}}),Ve=g({__name:`AlertDialogFooter`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(_(),d(`div`,{"data-slot":`alert-dialog-footer`,class:l(s(N)(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,t.class))},[T(e.$slots,`default`)],2))}}),He=g({__name:`AlertDialogHeader`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(_(),d(`div`,{"data-slot":`alert-dialog-header`,class:l(s(N)(`flex flex-col gap-2 text-center sm:text-left`,t.class))},[T(e.$slots,`default`)],2))}}),Ue=g({__name:`AlertDialogTitle`,props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=F(t,`class`);return(e,r)=>(_(),S(s(Fe),m({"data-slot":`alert-dialog-title`},s(n),{class:s(N)(`text-lg font-semibold`,t.class)}),{default:y(()=>[T(e.$slots,`default`)]),_:3},16,[`class`]))}}),We={key:0,class:`grid place-items-center py-24 text-muted-foreground`},Ge={key:1,class:`grid gap-5`},Ke={class:`relative grid min-h-48 place-items-center overflow-hidden rounded-lg border bg-[repeating-conic-gradient(var(--muted)_0_25%,transparent_0_50%)] bg-[length:16px_16px]`},qe=[`src`,`alt`],Je={key:1,class:`grid justify-items-center gap-2 py-12 text-sm text-muted-foreground`},Ye={key:2,class:`absolute inset-0 grid place-items-center bg-card/80 text-sm font-medium`},Xe={class:`inline-flex items-center gap-2`},Ze={class:`text-base font-semibold break-all`},Qe={class:`mt-2 grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-[13px]`},$e={class:`flex flex-wrap gap-2`},et=[`href`],tt=[`accept`],nt={class:`grid gap-1.5`},rt={class:`grid gap-1.5`},it={class:`grid gap-1.5`},at={class:`flex justify-end gap-2`},ot={class:`mb-2 text-sm font-semibold`},st={class:`font-normal text-muted-foreground`},ct={key:1,class:`rounded-md border border-dashed px-3 py-3 text-[13px] text-muted-foreground`},lt={key:0,class:`grid gap-2`},ut={class:`flex items-start gap-2 rounded-md bg-amber-50 px-3 py-2 text-[13px] text-amber-900 dark:bg-amber-950/50 dark:text-amber-100`},dt={class:`max-h-48 overflow-y-auto`},ft={__name:`MediaDetails`,props:{id:{type:Number,required:!0},canManage:{type:Boolean,default:!1}},emits:[`updated`,`deleted`],setup(e,{emit:t}){let n=e,r=t,c=C(null),l=C([]),f=C(!0),p=C({alt:``,caption:``,tags:``}),m=C(!1);async function g(){f.value=!0;try{let e=await U.show(n.id);c.value=e.media,l.value=e.usages,x()}catch(e){V.error(e.message)}finally{f.value=!1}}function x(){p.value={alt:c.value.alt??``,caption:c.value.caption??``,tags:(c.value.tags??[]).join(`, `)}}o(()=>n.id,g,{immediate:!0});let w=h(()=>p.value.tags.split(`,`).map(e=>e.trim()).filter(Boolean)),T=h(()=>c.value&&(p.value.alt!==(c.value.alt??``)||p.value.caption!==(c.value.caption??``)||w.value.join(`|`)!==(c.value.tags??[]).join(`|`)));async function D(){m.value=!0;try{let e=await U.update(c.value.id,{alt:p.value.alt,caption:p.value.caption,tags:w.value});c.value=e.media,x(),r(`updated`,e.media),V.success(`Gespeichert.`)}catch(e){V.error(e.message)}finally{m.value=!1}}async function O(){let e=new URL(c.value.url,window.location.origin).toString();try{await navigator.clipboard.writeText(e),V.success(`Adresse kopiert.`)}catch{window.prompt(`Adresse des Bilds:`,e)}}let A=C(null),M=C(null);async function N(e){let t=e.target.files?.[0];if(e.target.value=``,t){M.value=0;try{let e=await U.replace(c.value.id,t,e=>M.value=e);c.value=e,r(`updated`,e),V.success(l.value.length?`Bild ersetzt – alle Einbindungen zeigen jetzt das neue Bild.`:`Bild ersetzt.`)}catch(e){V.error(e.fieldErrors?.image??e.message)}finally{M.value=null}}}let P=C(!1),F=C(!1);async function I(){F.value=!0;try{await U.remove(c.value.id),P.value=!1,r(`deleted`,c.value.id),V.success(`Bild gelöscht.`)}catch(e){V.error(e.message)}finally{F.value=!1}}return(t,n)=>f.value&&!c.value?(_(),d(`div`,We,[i(s(j),{class:`size-6 animate-spin`})])):c.value?(_(),d(`div`,Ge,[u(`div`,Ke,[c.value.url?(_(),d(`img`,{key:0,src:c.value.url,alt:c.value.alt,class:`max-h-[46vh] w-auto max-w-full object-contain`},null,8,qe)):(_(),d(`div`,Je,[i(s(J),{class:`size-8`,"stroke-width":1.5}),n[6]||=a(` Die Datei fehlt.`,-1)])),M.value===null?E(``,!0):(_(),d(`div`,Ye,[u(`span`,Xe,[i(s(j),{class:`size-4 animate-spin`}),a(` Wird ersetzt … `+b(Math.round(M.value*100))+` %`,1)])]))]),u(`div`,null,[u(`h2`,Ze,b(c.value.name),1),u(`dl`,Qe,[n[7]||=u(`dt`,{class:`text-muted-foreground`},`Abmessungen`,-1),u(`dd`,null,b(c.value.width&&c.value.height?`${c.value.width} × ${c.value.height} Pixel`:`–`),1),n[8]||=u(`dt`,{class:`text-muted-foreground`},`Größe, Format`,-1),u(`dd`,null,b(s(K)(c.value.size))+` · `+b(s(W)(c.value.mime)),1),n[9]||=u(`dt`,{class:`text-muted-foreground`},`Hochgeladen`,-1),u(`dd`,null,[a(b(c.value.created_at?s(Z)(c.value.created_at):`–`),1),c.value.uploader?(_(),d(v,{key:0},[a(` von `+b(c.value.uploader.name),1)],64)):E(``,!0)])])]),u(`div`,$e,[i(s(Q),{variant:`outline`,size:`sm`,disabled:!c.value.url,onClick:O},{default:y(()=>[i(s(ge)),n[10]||=a(` Adresse kopieren`,-1)]),_:1},8,[`disabled`]),i(s(Q),{variant:`outline`,size:`sm`,"as-child":``,disabled:!c.value.url},{default:y(()=>[u(`a`,{href:s(U).downloadUrl(c.value.id)},[i(s(q)),n[11]||=a(` Original`,-1)],8,et)]),_:1},8,[`disabled`]),e.canManage?(_(),d(v,{key:0},[i(s(Q),{variant:`outline`,size:`sm`,disabled:M.value!==null,onClick:n[0]||=e=>A.value?.click()},{default:y(()=>[i(s(Te)),n[12]||=a(` Ersetzen`,-1)]),_:1},8,[`disabled`]),i(s(Q),{variant:`outline`,size:`sm`,class:`text-destructive hover:text-destructive`,onClick:n[1]||=e=>P.value=!0},{default:y(()=>[i(s(Y)),n[13]||=a(` Löschen`,-1)]),_:1}),u(`input`,{ref_key:`replaceInput`,ref:A,type:`file`,accept:s(H),class:`hidden`,onChange:N},null,40,tt)],64)):E(``,!0)]),u(`form`,{class:`grid gap-3 rounded-lg border bg-card p-4`,onSubmit:k(D,[`prevent`])},[u(`label`,nt,[n[14]||=u(`span`,{class:`text-[13px] font-medium`},`Alternativtext`,-1),i(s(Ce),{modelValue:p.value.alt,"onUpdate:modelValue":n[2]||=e=>p.value.alt=e,maxlength:`300`,placeholder:`Was ist auf dem Bild zu sehen?`},null,8,[`modelValue`]),n[15]||=u(`span`,{class:`text-xs text-muted-foreground`},`Beschreibt das Bild für Screenreader. Wird beim Einfügen vorgeschlagen.`,-1)]),u(`label`,rt,[n[16]||=u(`span`,{class:`text-[13px] font-medium`},`Bildunterschrift`,-1),i(s(we),{modelValue:p.value.caption,"onUpdate:modelValue":n[3]||=e=>p.value.caption=e,maxlength:`500`,rows:`2`},null,8,[`modelValue`])]),u(`label`,it,[n[17]||=u(`span`,{class:`text-[13px] font-medium`},`Schlagwörter`,-1),i(s(Ce),{modelValue:p.value.tags,"onUpdate:modelValue":n[4]||=e=>p.value.tags=e,placeholder:`z. B. Sommerfest, Team, Standort Nord`},null,8,[`modelValue`]),n[18]||=u(`span`,{class:`text-xs text-muted-foreground`},`Mit Komma trennen. Helfen beim Wiederfinden.`,-1)]),u(`div`,at,[T.value?(_(),S(s(Q),{key:0,type:`button`,variant:`ghost`,size:`sm`,onClick:x},{default:y(()=>[...n[19]||=[a(`Verwerfen`,-1)]]),_:1})):E(``,!0),i(s(Q),{type:`submit`,size:`sm`,disabled:!T.value||m.value},{default:y(()=>[m.value?(_(),S(s(j),{key:0,class:`animate-spin`})):E(``,!0),n[20]||=a(` Speichern`,-1)]),_:1},8,[`disabled`])])],32),u(`section`,null,[u(`h3`,ot,[n[21]||=a(`Eingebunden in `,-1),u(`span`,st,`(`+b(l.value.length)+`)`,1)]),l.value.length?(_(),S(G,{key:0,usages:l.value},null,8,[`usages`])):(_(),d(`p`,ct,`Nirgends eingebunden.`))]),i(s(Le),{open:P.value,"onUpdate:open":n[5]||=e=>P.value=e},{default:y(()=>[i(s(ze),null,{default:y(()=>[i(s(He),null,{default:y(()=>[i(s(Ue),null,{default:y(()=>[...n[22]||=[a(`Bild löschen?`,-1)]]),_:1}),i(s(Be),null,{default:y(()=>[a(` „`+b(c.value.name)+`“ wird endgültig gelöscht. `,1)]),_:1})]),_:1}),l.value.length?(_(),d(`div`,lt,[u(`p`,ut,[i(s(fe),{class:`mt-0.5 size-4 shrink-0`}),a(` Das Bild ist noch an `+b(l.value.length)+` `+b(l.value.length===1?`Stelle`:`Stellen`)+` eingebunden. Dort erscheint danach ein Platzhalter. `,1)]),u(`div`,dt,[i(G,{usages:l.value},null,8,[`usages`])])])):E(``,!0),i(s(Ve),null,{default:y(()=>[i(s(Re),null,{default:y(()=>[...n[23]||=[a(`Abbrechen`,-1)]]),_:1}),i(s(Q),{variant:`destructive`,disabled:F.value,onClick:I},{default:y(()=>[F.value?(_(),S(s(j),{key:0,class:`animate-spin`})):E(``,!0),n[24]||=a(` Endgültig löschen`,-1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])])):E(``,!0)}},pt={key:0,class:`mb-5 rounded-lg border bg-card p-4`},mt={class:`mb-3 flex items-center justify-between`},ht={class:`mb-4 flex flex-wrap items-center gap-2 rounded-lg border bg-card p-2.5`},gt={class:`relative min-w-56 flex-1`},_t=[`value`],vt=[`value`],yt={key:1,class:`sticky top-16 z-20 mb-4 flex flex-wrap items-center gap-2 rounded-lg border border-brand-200 bg-brand-soft px-3 py-2 text-sm text-brand-soft-foreground shadow-sm`},bt={class:`font-medium`},xt={key:0,class:`text-[13px]`},St={key:2,class:`grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 2xl:grid-cols-6`},Ct={key:3,class:`grid place-items-center rounded-lg border border-dashed bg-card px-6 py-16 text-center`},wt={class:`mt-3 font-medium`},Tt={class:`mt-1 max-w-sm text-sm text-muted-foreground`},Et={class:`px-5 pb-6`},Dt={key:0,class:`grid gap-2`},Ot={class:`flex items-start gap-2 rounded-md bg-amber-50 px-3 py-2 text-[13px] text-amber-900 dark:bg-amber-950/50 dark:text-amber-100`},kt={class:`max-h-40 overflow-y-auto rounded-md border text-[13px]`},At=[`src`],jt={class:`min-w-0 flex-1 truncate`},Mt=[`onClick`],$=`h-9 rounded-md border border-input bg-card px-2.5 text-sm focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`,Nt={__name:`Index`,props:{filters:{type:Object,default:()=>({})},uploaders:{type:Array,default:()=>[]},sources:{type:Array,default:()=>[]},canManage:{type:Boolean,default:!1}},setup(e){let t=e,n=C({q:t.filters.q??``,von:t.filters.von??``,zeitraum:t.filters.zeitraum??``,status:t.filters.status??``,in:t.filters.in??``,sortierung:`neu`}),{items:r,total:m,loading:g,nextPage:x,load:T,observe:D,replaceItem:k,removeItems:M,prepend:N}=he(n),P=C(null);p(()=>{T(!0),D(P.value)}),o(n,e=>{let t=new URLSearchParams(Object.entries(e).filter(([e,t])=>t&&e!==`sortierung`));window.history.replaceState(window.history.state,``,`${window.location.pathname}${t.toString()?`?${t}`:``}`)},{deep:!0});let F=h(()=>[`q`,`von`,`zeitraum`,`status`,`in`].some(e=>n.value[e]));function I(){Object.assign(n.value,{q:``,von:``,zeitraum:``,status:``,in:``})}let L=C(!1);function R(e){N(e.map(e=>({...e,usage_count:e.usage_count??0}))),V.success(e.length===1?`Bild hochgeladen.`:`${e.length} Bilder hochgeladen.`)}let z=C(null),B=h({get:()=>z.value!==null,set:e=>!e&&(z.value=null)});function ue(e){M([e]),z.value=null}let H=C(new Set),W=h(()=>r.value.filter(e=>H.value.has(e.id))),G=h(()=>W.value.filter(e=>e.usage_count>0));function K(e){let t=new Set(H.value);t.has(e.id)?t.delete(e.id):t.add(e.id),H.value=t}function ge(e,t){H.value.size||t?.ctrlKey||t?.metaKey||t?.shiftKey?K(e):z.value=e.id}let q=C(!1),J=C(!1);async function X(e){J.value=!0;let t=(e?W.value.filter(e=>!e.usage_count):W.value).map(e=>e.id);try{let n=await U.bulkRemove(t,e);M(t),H.value=new Set,q.value=!1,V.success(n.deleted===1?`1 Bild gelöscht.`:`${n.deleted} Bilder gelöscht.`)}catch(e){V.error(e.message)}finally{J.value=!1}}let Z=C(!1);async function Se(){Z.value=!0;try{let e=await U.rebuild();V.success(`Neu eingelesen: ${e.sources} Inhalte durchsucht.`),T(!0)}catch(e){V.error(e.message)}finally{Z.value=!1}}return(t,o)=>(_(),S(le,{title:`Mediathek`},{default:y(()=>[i(xe,{title:`Mediathek`,breadcrumbs:[{label:`Redaktion`,href:`/redaktion`}]},{description:y(()=>[s(m)===null?E(``,!0):(_(),d(v,{key:0},[a(b(s(m).toLocaleString(`de-DE`))+` `+b(s(m)===1?`Bild`:`Bilder`)+b(F.value?` gefunden`:``)+` · `,1)],64)),o[17]||=a(` Alle Bilder aus Seiten, Neuigkeiten, Terminen und Kacheln an einem Ort. `,-1)]),actions:y(()=>[i(s(Q),{onClick:o[0]||=e=>L.value=!L.value},{default:y(()=>[i(s(ve)),o[18]||=a(` Hochladen`,-1)]),_:1}),e.canManage?(_(),S(s(te),{key:0},{default:y(()=>[i(s(ie),{"as-child":``},{default:y(()=>[i(s(Q),{variant:`outline`,size:`icon`,"aria-label":`Weitere Aktionen`},{default:y(()=>[i(s(_e))]),_:1})]),_:1}),i(s(se),{align:`end`,class:`w-64`},{default:y(()=>[i(s(oe),{disabled:Z.value,onSelect:Se},{default:y(()=>[i(s(Ee),{class:l(Z.value&&`animate-spin`)},null,8,[`class`]),o[19]||=a(` Verwendungen neu einlesen `,-1)]),_:1},8,[`disabled`]),i(s(oe),{onSelect:o[1]||=e=>n.value.status=`unbenutzt`},{default:y(()=>[i(s(Y)),o[20]||=a(` Nicht verwendete Bilder anzeigen`,-1)]),_:1})]),_:1})]),_:1})):E(``,!0)]),_:1}),L.value?(_(),d(`section`,pt,[u(`div`,mt,[o[21]||=u(`h2`,{class:`text-sm font-semibold`},`Bilder hochladen`,-1),u(`button`,{type:`button`,class:`grid size-7 place-items-center rounded-md text-muted-foreground hover:bg-accent`,"aria-label":`Schließen`,onClick:o[2]||=e=>L.value=!1},[i(s(de),{class:`size-4`})])]),i(me,{compact:``,onDone:R})])):E(``,!0),u(`div`,ht,[u(`label`,gt,[o[22]||=u(`span`,{class:`sr-only`},`Suchen`,-1),i(s(ee),{class:`pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),c(u(`input`,{"onUpdate:modelValue":o[3]||=e=>n.value.q=e,type:`search`,placeholder:`Dateiname, Alternativtext, Bildunterschrift, Schlagwort …`,class:`h-9 w-full rounded-md border border-input bg-card pr-3 pl-8 text-sm placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`},null,512),[[A,n.value.q]])]),c(u(`select`,{"onUpdate:modelValue":o[4]||=e=>n.value.status=e,class:l($),"aria-label":`Verwendung`},[...o[23]||=[u(`option`,{value:``},`Verwendet und unbenutzt`,-1),u(`option`,{value:`verwendet`},`Verwendet`,-1),u(`option`,{value:`unbenutzt`},`Nicht verwendet`,-1)]],512),[[O,n.value.status]]),e.sources.length?c((_(),d(`select`,{key:0,"onUpdate:modelValue":o[5]||=e=>n.value.in=e,class:l($),"aria-label":`Verwendet in`},[o[24]||=u(`option`,{value:``},`Verwendet in: überall`,-1),(_(!0),d(v,null,f(e.sources,e=>(_(),d(`option`,{key:e.value,value:e.value},`Verwendet in: `+b(e.label),9,_t))),128))],512)),[[O,n.value.in]]):E(``,!0),c(u(`select`,{"onUpdate:modelValue":o[6]||=e=>n.value.zeitraum=e,class:l($),"aria-label":`Zeitraum`},[...o[25]||=[u(`option`,{value:``},`Jederzeit hochgeladen`,-1),u(`option`,{value:`7`},`Letzte 7 Tage`,-1),u(`option`,{value:`30`},`Letzte 30 Tage`,-1),u(`option`,{value:`365`},`Letztes Jahr`,-1)]],512),[[O,n.value.zeitraum]]),e.uploaders.length?c((_(),d(`select`,{key:1,"onUpdate:modelValue":o[7]||=e=>n.value.von=e,class:l($),"aria-label":`Hochgeladen von`},[o[26]||=u(`option`,{value:``},`Von allen`,-1),(_(!0),d(v,null,f(e.uploaders,e=>(_(),d(`option`,{key:e.value,value:e.value},b(e.label),9,vt))),128))],512)),[[O,n.value.von]]):E(``,!0),c(u(`select`,{"onUpdate:modelValue":o[8]||=e=>n.value.sortierung=e,class:l($),"aria-label":`Sortierung`},[...o[27]||=[u(`option`,{value:`neu`},`Neueste zuerst`,-1),u(`option`,{value:`verwendet`},`Zuletzt verwendet`,-1),u(`option`,{value:`name`},`Nach Name`,-1)]],512),[[O,n.value.sortierung]]),F.value?(_(),S(s(Q),{key:2,variant:`ghost`,size:`sm`,onClick:I},{default:y(()=>[i(s(de)),o[28]||=a(` Filter zurücksetzen`,-1)]),_:1})):E(``,!0)]),H.value.size?(_(),d(`div`,yt,[u(`span`,bt,b(H.value.size)+` ausgewählt`,1),G.value.length?(_(),d(`span`,xt,`· davon `+b(G.value.length)+` verwendet`,1)):E(``,!0),o[31]||=u(`span`,{class:`flex-1`},null,-1),i(s(Q),{variant:`ghost`,size:`sm`,onClick:o[9]||=e=>H.value=new Set},{default:y(()=>[...o[29]||=[a(`Auswahl aufheben`,-1)]]),_:1}),e.canManage?(_(),S(s(Q),{key:1,variant:`destructive`,size:`sm`,onClick:o[10]||=e=>q.value=!0},{default:y(()=>[i(s(Y)),o[30]||=a(` Löschen`,-1)]),_:1})):E(``,!0)])):E(``,!0),s(r).length?(_(),d(`ul`,St,[(_(!0),d(v,null,f(s(r),e=>(_(),d(`li`,{key:e.id},[i(pe,{item:e,selected:H.value.has(e.id),checkable:H.value.size>0,onOpen:ge,onToggle:K},null,8,[`item`,`selected`,`checkable`])]))),128))])):s(g)?E(``,!0):(_(),d(`div`,Ct,[(_(),S(w(F.value?s(be):s(ye)),{class:`size-8 text-muted-foreground`,"stroke-width":1.5})),u(`p`,wt,b(F.value?`Keine Bilder gefunden`:`Noch keine Bilder`),1),u(`p`,Tt,b(F.value?`Versuchen Sie einen anderen Suchbegriff oder andere Filter.`:`Laden Sie Bilder hoch – oder fügen Sie sie direkt in Seiten und Beiträge ein, sie landen automatisch hier.`),1),F.value?E(``,!0):(_(),S(s(Q),{key:0,class:`mt-4`,onClick:o[11]||=e=>L.value=!0},{default:y(()=>[i(s(ve)),o[32]||=a(` Bilder hochladen`,-1)]),_:1}))])),u(`div`,{ref_key:`sentinel`,ref:P,class:`grid h-16 place-items-center`},[s(g)?(_(),S(s(j),{key:0,class:`size-5 animate-spin text-muted-foreground`})):s(x)&&s(r).length?(_(),S(s(Q),{key:1,variant:`outline`,size:`sm`,onClick:o[12]||=e=>s(T)()},{default:y(()=>[...o[33]||=[a(`Weitere laden`,-1)]]),_:1})):E(``,!0)],512),i(s(re),{open:B.value,"onUpdate:open":o[13]||=e=>B.value=e},{default:y(()=>[i(s(ne),{class:`w-full overflow-y-auto sm:max-w-xl`},{default:y(()=>[i(s(ce),{class:`px-5 pt-5 pb-0`},{default:y(()=>[i(s(ae),null,{default:y(()=>[...o[34]||=[a(`Bilddetails`,-1)]]),_:1}),i(s(Ie),{class:`sr-only`},{default:y(()=>[...o[35]||=[a(`Angaben, Verwendung und Aktionen für das Bild`,-1)]]),_:1})]),_:1}),u(`div`,Et,[z.value?(_(),S(ft,{key:0,id:z.value,"can-manage":e.canManage,onUpdated:s(k),onDeleted:ue},null,8,[`id`,`can-manage`,`onUpdated`])):E(``,!0)])]),_:1})]),_:1},8,[`open`]),i(s(Le),{open:q.value,"onUpdate:open":o[16]||=e=>q.value=e},{default:y(()=>[i(s(ze),null,{default:y(()=>[i(s(He),null,{default:y(()=>[i(s(Ue),null,{default:y(()=>[a(b(H.value.size===1?`Bild löschen?`:`${H.value.size} Bilder löschen?`),1)]),_:1}),i(s(Be),null,{default:y(()=>[...o[36]||=[a(`Gelöschte Bilder lassen sich nicht wiederherstellen.`,-1)]]),_:1})]),_:1}),G.value.length?(_(),d(`div`,Dt,[u(`p`,Ot,[i(s(fe),{class:`mt-0.5 size-4 shrink-0`}),a(` `+b(G.value.length)+` der ausgewählten Bilder `+b(G.value.length===1?`ist`:`sind`)+` noch eingebunden. Dort erscheint nach dem Löschen ein Platzhalter. `,1)]),u(`ul`,kt,[(_(!0),d(v,null,f(G.value,e=>(_(),d(`li`,{key:e.id,class:`flex items-center gap-2 border-b px-2 py-1.5 last:border-0`},[e.thumb_url?(_(),d(`img`,{key:0,src:e.thumb_url,alt:``,class:`size-8 rounded object-cover`},null,8,At)):E(``,!0),u(`span`,jt,b(e.alt||e.name),1),u(`button`,{type:`button`,class:`shrink-0 text-xs font-medium text-brand-text hover:underline`,onClick:t=>{q.value=!1,z.value=e.id}},b(e.usage_count)+`× verwendet`,9,Mt)]))),128))])])):E(``,!0),i(s(Ve),{class:`flex-wrap gap-2`},{default:y(()=>[i(s(Re),null,{default:y(()=>[...o[37]||=[a(`Abbrechen`,-1)]]),_:1}),G.value.length&&G.value.lengthX(!0)},{default:y(()=>[a(` Nur nicht verwendete (`+b(H.value.size-G.value.length)+`) `,1)]),_:1},8,[`disabled`])):E(``,!0),i(s(Q),{variant:`destructive`,disabled:J.value,onClick:o[15]||=e=>X(!1)},{default:y(()=>[J.value?(_(),S(s(j),{key:0,class:`animate-spin`})):E(``,!0),a(` `+b(G.value.length?`Trotzdem alle löschen`:`Löschen`),1)]),_:1},8,[`disabled`])]),_:1})]),_:1})]),_:1},8,[`open`])]),_:1}))}};export{Nt as default}; \ No newline at end of file diff --git a/public/build/assets/Index-LjDUx_tK.js b/public/build/assets/Index-CppAWUIo.js similarity index 93% rename from public/build/assets/Index-LjDUx_tK.js rename to public/build/assets/Index-CppAWUIo.js index f7318e13..5eac1bd4 100644 --- a/public/build/assets/Index-LjDUx_tK.js +++ b/public/build/assets/Index-CppAWUIo.js @@ -1 +1 @@ -import{D as e,E as t,Ht as n,On as r,Yt as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,vn as m,wt as h,y as g}from"./runtime-core.esm-bundler-B8D2lM98.js";import{x as _}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{o as v,r as y}from"./app-Bu3kn8yd.js";import{c as b}from"./dist-DtGNiYlK.js";import{N as x,t as S}from"./AppIcon-0N56IC2z.js";import{n as C,t as w}from"./AppLayout-BxsYt2ib.js";import{t as T}from"./FileIcon-B6dfvt48.js";import{t as E}from"./search-x-BVofHEe_.js";import{t as D}from"./EmptyState-Ceq4v8mE.js";import{t as O}from"./PageHeader-Ybe7qDu5.js";var k={class:`grid gap-6 lg:grid-cols-12`},A={class:`grid content-start gap-6 lg:col-span-9`},j={class:`relative block`},M=[`id`],N={class:`flex items-center gap-2.5 border-b px-5 py-3`},P={class:`grid size-8 place-items-center rounded-md bg-brand-soft text-brand-text`},F={class:`text-base font-semibold`},I={class:`ml-auto text-xs text-muted-foreground`},L={class:`divide-y`},R=[`src`],z={class:`min-w-0 flex-1`},B=[`innerHTML`],V={key:0,class:`mt-0.5 text-xs text-muted-foreground`},H=[`innerHTML`],U={key:0,class:`rounded-lg border bg-card`},W={key:0,class:`hidden lg:col-span-3 lg:block`},G={class:`sticky top-20 rounded-lg border bg-card p-4`},K={class:`grid gap-0.5 text-sm`},q=[`href`],J={class:`ml-auto text-xs text-muted-foreground tabular-nums`},Y={__name:`Index`,props:{query:{type:String,default:``},groups:{type:Array,required:!0},minLength:{type:Number,default:2}},setup(Y){let X=Y,Z=m(X.query),Q=c(()=>X.groups.reduce((e,t)=>e+t.items.length,0));return n(Z,b(e=>v.get(`/suche`,e.trim()?{q:e.trim()}:{},{preserveState:!0,preserveScroll:!0,replace:!0}),300)),(n,c)=>(l(),p(w,{title:`Suche`},{default:d(()=>[e(O,{title:`Suche`},{description:d(()=>[Y.query.length>=Y.minLength?(l(),o(u,{key:0},[t(f(Q.value?`${Q.value} Treffer für „${Y.query}“`:`Keine Treffer für „${Y.query}“`),1)],64)):(l(),o(u,{key:1},[t(`Neuigkeiten, Termine, Seiten, Downloads und Dokumente durchsuchen`)],64))]),_:1}),a(`div`,k,[a(`div`,A,[a(`label`,j,[c[1]||=a(`span`,{class:`sr-only`},`Suchbegriff`,-1),e(r(x),{class:`pointer-events-none absolute top-1/2 left-4 size-5 -translate-y-1/2 text-muted-foreground`}),i(a(`input`,{"onUpdate:modelValue":c[0]||=e=>Z.value=e,type:`search`,autofocus:``,placeholder:`Wonach suchen Sie?`,class:`h-12 w-full rounded-lg border border-input bg-card pr-4 pl-12 text-base shadow-xs placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`},null,512),[[_,Z.value]])]),(l(!0),o(u,null,s(Y.groups,t=>(l(),o(`section`,{id:`treffer-${t.key}`,key:t.key,class:`overflow-hidden rounded-lg border bg-card`},[a(`header`,N,[a(`span`,P,[e(S,{name:t.icon,class:`size-4`},null,8,[`name`])]),a(`h2`,F,f(t.label),1),a(`span`,I,f(t.items.length===20?`20+`:t.items.length)+` Treffer`,1)]),a(`ul`,L,[(l(!0),o(u,null,s(t.items,e=>(l(),o(`li`,{key:e.url},[(l(),p(h(e.external?`a`:r(y)),{href:e.url,class:`group flex items-start gap-4 px-5 py-3.5 transition-colors hover:bg-accent/50`},{default:d(()=>[e.image?(l(),o(`img`,{key:0,src:e.image,alt:``,loading:`lazy`,class:`hidden h-14 w-20 shrink-0 rounded-md object-cover sm:block`},null,8,R)):e.file?(l(),p(T,{key:1,extension:e.file,class:`shrink-0`},null,8,[`extension`])):g(``,!0),a(`div`,z,[a(`h3`,{class:`text-[15px] font-semibold group-hover:underline`,innerHTML:r(C)(e.title,Y.query)},null,8,B),e.meta?(l(),o(`p`,V,f(e.meta),1)):g(``,!0),e.excerpt?(l(),o(`p`,{key:1,class:`mt-1 line-clamp-2 text-[13px] text-muted-foreground`,innerHTML:r(C)(e.excerpt,Y.query)},null,8,H)):g(``,!0)])]),_:2},1032,[`href`]))]))),128))])],8,M))),128)),Y.query.length>=Y.minLength&&!Y.groups.length?(l(),o(`div`,U,[e(D,{icon:r(E),title:`Nichts gefunden`,text:`Andere Schreibweise oder weniger Begriffe versuchen. Personen finden Sie im Personenverzeichnis.`},null,8,[`icon`])])):g(``,!0)]),Y.groups.length>1?(l(),o(`aside`,W,[a(`nav`,G,[c[2]||=a(`h2`,{class:`mb-2 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Bereiche`,-1),a(`ul`,K,[(l(!0),o(u,null,s(Y.groups,n=>(l(),o(`li`,{key:n.key},[a(`a`,{href:`#treffer-${n.key}`,class:`flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent`},[e(S,{name:n.icon,class:`size-4 text-muted-foreground`},null,8,[`name`]),t(` `+f(n.label)+` `,1),a(`span`,J,f(n.items.length),1)],8,q)]))),128))]),e(r(y),{href:Y.query?`/personen?q=${encodeURIComponent(Y.query)}`:`/personen`,class:`mt-3 block border-t pt-3 text-[13px] text-brand-text hover:underline`},{default:d(()=>[t(`„`+f(Y.query)+`“ im Personenverzeichnis suchen`,1)]),_:1},8,[`href`])])])):g(``,!0)])]),_:1}))}};export{Y as default}; \ No newline at end of file +import{D as e,E as t,Ht as n,On as r,Yt as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,vn as m,wt as h,y as g}from"./runtime-core.esm-bundler-B8D2lM98.js";import{x as _}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{o as v,r as y}from"./app-BNwrc_lv.js";import{c as b}from"./dist-DtGNiYlK.js";import{N as x,t as S}from"./AppIcon-nlhvQfK7.js";import{n as C,t as w}from"./AppLayout-esQiy2nD.js";import{t as T}from"./FileIcon-BctWLKDw.js";import{t as E}from"./search-x-BVofHEe_.js";import{t as D}from"./EmptyState-Ceq4v8mE.js";import{t as O}from"./PageHeader-BMzzCXfT.js";var k={class:`grid gap-6 lg:grid-cols-12`},A={class:`grid content-start gap-6 lg:col-span-9`},j={class:`relative block`},M=[`id`],N={class:`flex items-center gap-2.5 border-b px-5 py-3`},P={class:`grid size-8 place-items-center rounded-md bg-brand-soft text-brand-text`},F={class:`text-base font-semibold`},I={class:`ml-auto text-xs text-muted-foreground`},L={class:`divide-y`},R=[`src`],z={class:`min-w-0 flex-1`},B=[`innerHTML`],V={key:0,class:`mt-0.5 text-xs text-muted-foreground`},H=[`innerHTML`],U={key:0,class:`rounded-lg border bg-card`},W={key:0,class:`hidden lg:col-span-3 lg:block`},G={class:`sticky top-20 rounded-lg border bg-card p-4`},K={class:`grid gap-0.5 text-sm`},q=[`href`],J={class:`ml-auto text-xs text-muted-foreground tabular-nums`},Y={__name:`Index`,props:{query:{type:String,default:``},groups:{type:Array,required:!0},minLength:{type:Number,default:2}},setup(Y){let X=Y,Z=m(X.query),Q=c(()=>X.groups.reduce((e,t)=>e+t.items.length,0));return n(Z,b(e=>v.get(`/suche`,e.trim()?{q:e.trim()}:{},{preserveState:!0,preserveScroll:!0,replace:!0}),300)),(n,c)=>(l(),p(w,{title:`Suche`},{default:d(()=>[e(O,{title:`Suche`},{description:d(()=>[Y.query.length>=Y.minLength?(l(),o(u,{key:0},[t(f(Q.value?`${Q.value} Treffer für „${Y.query}“`:`Keine Treffer für „${Y.query}“`),1)],64)):(l(),o(u,{key:1},[t(`Neuigkeiten, Termine, Seiten, Downloads und Dokumente durchsuchen`)],64))]),_:1}),a(`div`,k,[a(`div`,A,[a(`label`,j,[c[1]||=a(`span`,{class:`sr-only`},`Suchbegriff`,-1),e(r(x),{class:`pointer-events-none absolute top-1/2 left-4 size-5 -translate-y-1/2 text-muted-foreground`}),i(a(`input`,{"onUpdate:modelValue":c[0]||=e=>Z.value=e,type:`search`,autofocus:``,placeholder:`Wonach suchen Sie?`,class:`h-12 w-full rounded-lg border border-input bg-card pr-4 pl-12 text-base shadow-xs placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`},null,512),[[_,Z.value]])]),(l(!0),o(u,null,s(Y.groups,t=>(l(),o(`section`,{id:`treffer-${t.key}`,key:t.key,class:`overflow-hidden rounded-lg border bg-card`},[a(`header`,N,[a(`span`,P,[e(S,{name:t.icon,class:`size-4`},null,8,[`name`])]),a(`h2`,F,f(t.label),1),a(`span`,I,f(t.items.length===20?`20+`:t.items.length)+` Treffer`,1)]),a(`ul`,L,[(l(!0),o(u,null,s(t.items,e=>(l(),o(`li`,{key:e.url},[(l(),p(h(e.external?`a`:r(y)),{href:e.url,class:`group flex items-start gap-4 px-5 py-3.5 transition-colors hover:bg-accent/50`},{default:d(()=>[e.image?(l(),o(`img`,{key:0,src:e.image,alt:``,loading:`lazy`,class:`hidden h-14 w-20 shrink-0 rounded-md object-cover sm:block`},null,8,R)):e.file?(l(),p(T,{key:1,extension:e.file,class:`shrink-0`},null,8,[`extension`])):g(``,!0),a(`div`,z,[a(`h3`,{class:`text-[15px] font-semibold group-hover:underline`,innerHTML:r(C)(e.title,Y.query)},null,8,B),e.meta?(l(),o(`p`,V,f(e.meta),1)):g(``,!0),e.excerpt?(l(),o(`p`,{key:1,class:`mt-1 line-clamp-2 text-[13px] text-muted-foreground`,innerHTML:r(C)(e.excerpt,Y.query)},null,8,H)):g(``,!0)])]),_:2},1032,[`href`]))]))),128))])],8,M))),128)),Y.query.length>=Y.minLength&&!Y.groups.length?(l(),o(`div`,U,[e(D,{icon:r(E),title:`Nichts gefunden`,text:`Andere Schreibweise oder weniger Begriffe versuchen. Personen finden Sie im Personenverzeichnis.`},null,8,[`icon`])])):g(``,!0)]),Y.groups.length>1?(l(),o(`aside`,W,[a(`nav`,G,[c[2]||=a(`h2`,{class:`mb-2 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Bereiche`,-1),a(`ul`,K,[(l(!0),o(u,null,s(Y.groups,n=>(l(),o(`li`,{key:n.key},[a(`a`,{href:`#treffer-${n.key}`,class:`flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent`},[e(S,{name:n.icon,class:`size-4 text-muted-foreground`},null,8,[`name`]),t(` `+f(n.label)+` `,1),a(`span`,J,f(n.items.length),1)],8,q)]))),128))]),e(r(y),{href:Y.query?`/personen?q=${encodeURIComponent(Y.query)}`:`/personen`,class:`mt-3 block border-t pt-3 text-[13px] text-brand-text hover:underline`},{default:d(()=>[t(`„`+f(Y.query)+`“ im Personenverzeichnis suchen`,1)]),_:1},8,[`href`])])])):g(``,!0)])]),_:1}))}};export{Y as default}; \ No newline at end of file diff --git a/public/build/assets/Index-HU3KGFXQ.js b/public/build/assets/Index-D1NjDzqB.js similarity index 93% rename from public/build/assets/Index-HU3KGFXQ.js rename to public/build/assets/Index-D1NjDzqB.js index 00767652..a2f9c99c 100644 --- a/public/build/assets/Index-HU3KGFXQ.js +++ b/public/build/assets/Index-D1NjDzqB.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdfThumbnail-DzhCPy2_.js","assets/app-Bu3kn8yd.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-CL30rx2M.css"])))=>i.map(i=>d[i]); -import{D as e,E as t,Ht as n,On as r,St as i,Zn as a,_ as o,b as s,bt as c,ct as l,er as u,et as d,g as f,it as p,jt as ee,mt as m,o as h,qt as g,tr as _,v,vn as y,wt as b,xt as te,y as x}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as S}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as ne,i as C,o as w,r as T,s as E}from"./app-Bu3kn8yd.js";import{O as re,k as D}from"./dist-DtGNiYlK.js";import{A as ie,J as O,N as ae,Q as oe,W as se,Y as ce,a as le,c as ue,i as de,o as k,s as fe}from"./AppIcon-0N56IC2z.js";import{n as pe,t as A}from"./arrow-up-Djq_2Npz.js";import{t as me}from"./AppLayout-BxsYt2ib.js";import{o as he,t as ge,x as _e}from"./http-DmyDwIce.js";import{t as ve}from"./download-UAAY3N2F.js";import{t as ye}from"./ellipsis-vertical-B9wuHo-w.js";import{t as j}from"./FileIcon-B6dfvt48.js";import{t as be}from"./file-plus-corner-Z8xo1q-K.js";import{t as xe}from"./folder-tree-ZY-sbGXb.js";import{t as Se}from"./list-DHYGZ2vt.js";import{t as Ce}from"./pencil-line-CmAbFj4f.js";import{t as M}from"./rotate-ccw-clock-DRYS-TO2.js";import{t as we}from"./trash-DUqnVIgb.js";import{t as Te}from"./upload-M7dd6qr8.js";import{t as Ee}from"./DialogDescription-BxaIqmag.js";import{t as N}from"./FormField-BoFAO4pm.js";import{t as De}from"./EmptyState-Ceq4v8mE.js";import{t as Oe}from"./PageHeader-Ybe7qDu5.js";import{a as P,o as ke}from"./format-BsuBtvUs.js";import{t as F}from"./button-ZHC5mKey.js";import{t as Ae}from"./NativeSelect-BGasRaNs.js";import{t as I}from"./Input-FGSb2-yK.js";import{t as je}from"./Skeleton-fJgmuUSB.js";import{t as Me}from"./Textarea-DEFXqC2w.js";import{i as L,n as Ne,r as R,t as z}from"./dialog-uBUhf8w7.js";import{t as B}from"./DialogHeader-DuqiL3ry.js";import{t as Pe}from"./useStoredChoice-BAacDiWy.js";var Fe=D({name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]}),Ie=D({name:`library-big`,size:24,node:[[`rect`,{width:`8`,height:`18`,x:`3`,y:`3`,rx:`1`,key:`oynpb5`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z`,key:`1qboyk`}]]}),Le=D({name:`trending-up`,size:24,node:[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]}),V=e=>e?e>=1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`:`–`,H=(e,t,n)=>`${e.toLocaleString(`de-DE`)} ${e===1?t:n}`;function Re(e){let t=[];return e.folders&&t.push(H(e.folders,`Ordner`,`Ordner`)),e.downloads&&t.push(H(e.downloads,`Datei`,`Dateien`)),t.join(` · `)||`Noch leer`}var U={__name:`DownloadMenu`,props:{download:{type:Object,required:!0},canEdit:{type:Boolean,default:!1}},emits:[`versions`,`new-version`,`edit`,`remove`],setup(n){return(i,a)=>(m(),v(r(ue),null,{default:g(()=>[e(r(de),{"as-child":``},{default:g(()=>[e(r(F),{variant:`ghost`,size:`icon`,class:`size-8 text-muted-foreground`,"aria-label":`Aktionen für ${n.download.title}`},{default:g(()=>[e(r(ye))]),_:1},8,[`aria-label`])]),_:1}),e(r(fe),{align:`end`,class:`w-60`},{default:g(()=>[e(r(k),{onSelect:a[0]||=e=>i.$emit(`versions`,n.download)},{default:g(()=>[e(r(M)),a[4]||=t(` Fassungen anzeigen`,-1)]),_:1}),n.canEdit?(m(),s(h,{key:0},[e(r(k),{onSelect:a[1]||=e=>i.$emit(`new-version`,n.download)},{default:g(()=>[e(r(be)),a[5]||=t(` Neue Fassung hochladen`,-1)]),_:1}),e(r(k),{onSelect:a[2]||=e=>i.$emit(`edit`,n.download)},{default:g(()=>[e(r(Ce)),a[6]||=t(` Bearbeiten oder verschieben`,-1)]),_:1}),e(r(le)),e(r(k),{class:`text-destructive`,onSelect:a[3]||=e=>i.$emit(`remove`,n.download)},{default:g(()=>[e(r(we)),a[7]||=t(` Löschen`,-1)]),_:1})],64)):x(``,!0)]),_:1})]),_:1}))}},ze=[`aria-pressed`,`title`,`aria-label`],W={__name:`FavoriteButton`,props:{download:{type:Object,required:!0}},emits:[`toggle`],setup(t){return(n,i)=>(m(),s(`button`,{type:`button`,class:a([`grid size-8 place-items-center rounded-md hover:bg-accent`,t.download.favorite?`text-amber-500`:`text-muted-foreground hover:text-foreground`]),"aria-pressed":t.download.favorite,title:t.download.favorite?`Aus „Meine Downloads“ entfernen`:`In „Meine Downloads“ merken`,"aria-label":t.download.favorite?`${t.download.title} nicht mehr merken`:`${t.download.title} merken`,onClick:i[0]||=e=>n.$emit(`toggle`,t.download)},[e(r(ie),{class:a([`size-4`,{"fill-current":t.download.favorite}])},null,8,[`class`])],10,ze))}},G=[`src`],Be={key:1,class:`grid size-full place-items-center`},Ve={__name:`DownloadThumb`,props:{download:{type:Object,required:!0}},setup(t){let n=t,r=y(null),i=y(null),a=y(!1),o;async function c(){if(n.download.preview_kind===`image`){i.value=n.download.preview_url;return}try{let{pdfThumbnail:e}=await E(async()=>{let{pdfThumbnail:e}=await import(`./pdfThumbnail-DzhCPy2_.js`);return{pdfThumbnail:e}},__vite__mapDeps([0,1,2,3,4]));i.value=await e(n.download.preview_url)}catch{a.value=!0}}return l(()=>{n.download.preview_url&&typeof IntersectionObserver<`u`&&(o=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(o.disconnect(),c())},{rootMargin:`200px`}),o.observe(r.value))}),p(()=>o?.disconnect()),(n,o)=>(m(),s(`div`,{ref_key:`root`,ref:r,class:`relative h-32 overflow-hidden rounded-t-lg border-b bg-muted/40`},[i.value&&!a.value?(m(),s(`img`,{key:0,src:i.value,alt:``,class:`size-full object-cover object-top`,loading:`lazy`,onError:o[0]||=e=>a.value=!0},null,40,G)):(m(),s(`div`,Be,[e(j,{extension:t.download.extension,size:`lg`},null,8,[`extension`])])),te(n.$slots,`default`)],512))}},He={class:`grid gap-6`},K={key:0,class:`grid grid-cols-[repeat(auto-fill,minmax(12.5rem,1fr))] gap-3`},q={class:`grid size-10 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},Ue={class:`min-w-0`},J={class:`block truncate text-xs text-muted-foreground`},Y={key:1,class:`grid grid-cols-[repeat(auto-fill,minmax(12.5rem,1fr))] gap-3`},We={key:0,class:`absolute bottom-2 left-2 rounded bg-card px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground ring-1 ring-border`},Ge={key:1,class:`absolute right-2 bottom-2 rounded bg-card px-1.5 py-0.5 text-[10px] font-bold tracking-wide text-muted-foreground uppercase ring-1 ring-border`},Ke={class:`flex min-h-0 flex-1 flex-col p-3`},X=[`href`,`title`],Z={key:1,class:`line-clamp-2 text-sm leading-snug font-medium`},qe={class:`mt-auto pt-2 text-xs text-muted-foreground`},Q={key:0,class:`absolute top-2 left-2 z-10 text-amber-500`},$={class:`absolute top-1.5 right-1.5 z-10 flex gap-0.5 rounded-md bg-card/90 opacity-0 shadow-xs ring-1 ring-border transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 max-md:opacity-100`},Je=[`href`,`aria-label`],Ye={__name:`DownloadGrid`,props:{folders:{type:Array,default:()=>[]},downloads:{type:Array,default:()=>[]},canEdit:{type:Boolean,default:!1}},emits:[`versions`,`new-version`,`edit`,`remove`,`favorite`],setup(n){return(i,a)=>(m(),s(`div`,He,[n.folders.length?(m(),s(`ul`,K,[(m(!0),s(h,null,c(n.folders,n=>(m(),s(`li`,{key:n.id,class:`group relative flex items-center gap-3 rounded-lg border bg-card p-3 hover:border-brand-300 hover:shadow-xs`},[o(`span`,q,[e(r(O),{class:`size-5`,"stroke-width":1.75})]),o(`span`,Ue,[e(r(T),{href:`/downloads/ordner/${n.id}`,class:`block truncate text-sm font-medium after:absolute after:inset-0 group-hover:underline`},{default:g(()=>[t(_(n.name),1)]),_:2},1032,[`href`]),o(`span`,J,_(r(Re)(n)),1)])]))),128))])):x(``,!0),n.downloads.length?(m(),s(`ul`,Y,[(m(!0),s(h,null,c(n.downloads,t=>(m(),s(`li`,{key:t.id,class:`group relative flex flex-col rounded-lg border bg-card hover:border-brand-300 hover:shadow-xs`},[e(Ve,{download:t},{default:g(()=>[t.version>1?(m(),s(`span`,We,`Fassung `+_(t.version),1)):x(``,!0),t.preview_url?(m(),s(`span`,Ge,_(t.extension),1)):x(``,!0)]),_:2},1032,[`download`]),o(`div`,Ke,[t.download_url?(m(),s(`a`,{key:0,href:t.download_url,class:`line-clamp-2 text-sm leading-snug font-medium after:absolute after:inset-0 hover:underline`,title:t.name},_(t.title),9,X)):(m(),s(`span`,Z,_(t.title),1)),o(`p`,qe,_(r(ke)(t.updated_at))+` · `+_(r(V)(t.size)),1)]),t.favorite?(m(),s(`div`,Q,[e(r(ie),{class:`size-4 fill-current`})])):x(``,!0),o(`div`,$,[e(W,{download:t,onToggle:a[0]||=e=>i.$emit(`favorite`,e)},null,8,[`download`]),t.download_url?(m(),v(r(F),{key:0,variant:`ghost`,size:`icon`,class:`size-8 text-muted-foreground`,"as-child":``,title:`${t.title} herunterladen`},{default:g(()=>[o(`a`,{href:t.download_url,"aria-label":`${t.title} herunterladen`},[e(r(ve))],8,Je)]),_:2},1032,[`title`])):x(``,!0),e(U,{download:t,"can-edit":n.canEdit,onVersions:a[1]||=e=>i.$emit(`versions`,e),onNewVersion:a[2]||=e=>i.$emit(`new-version`,e),onEdit:a[3]||=e=>i.$emit(`edit`,e),onRemove:a[4]||=e=>i.$emit(`remove`,e)},null,8,[`download`,`can-edit`])])]))),128))])):x(``,!0)]))}},Xe={class:`rounded-lg border bg-card`},Ze={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},Qe={key:0,class:`p-2`},$e=[`href`],et={class:`min-w-0 flex-1`},tt={class:`block truncate text-[13px] font-medium`},nt={class:`block truncate text-xs text-muted-foreground`},rt={key:1,class:`px-4 py-3 text-[13px] text-muted-foreground`},it={__name:`DownloadMiniList`,props:{title:{type:String,required:!0},icon:{type:[Object,Function],required:!0},downloads:{type:Array,required:!0},empty:{type:String,default:``},showDownloads:{type:Boolean,default:!1}},setup(n){return(r,i)=>(m(),s(`section`,Xe,[o(`h2`,Ze,[(m(),v(b(n.icon),{class:`size-4 text-brand-text`})),t(` `+_(n.title),1)]),n.downloads.length?(m(),s(`ul`,Qe,[(m(!0),s(h,null,c(n.downloads,r=>(m(),s(`li`,{key:r.id},[o(`a`,{href:r.download_url,class:`flex items-center gap-3 rounded-md px-2 py-1.5 hover:bg-accent`},[e(j,{extension:r.extension,size:`sm`},null,8,[`extension`]),o(`span`,et,[o(`span`,tt,_(r.title),1),o(`span`,nt,[t(_(r.folder_name),1),n.showDownloads?(m(),s(h,{key:0},[t(` · `+_(r.download_count.toLocaleString(`de-DE`))+`× geladen`,1)],64)):x(``,!0)])])],8,$e)]))),128))])):(m(),s(`p`,rt,_(n.empty),1))]))}},at={class:`overflow-hidden rounded-lg border bg-card`},ot={key:1},st={key:2},ct={key:4},lt={key:1,class:`text-right`},ut={class:`divide-y`},dt={class:`flex min-w-0 items-center gap-3`},ft={class:`grid size-8 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},pt={class:`min-w-0`},mt={class:`truncate text-xs text-muted-foreground`},ht={key:0,class:`hidden md:block`},gt={key:1,class:`hidden md:block`},_t={class:`flex min-w-0 items-center gap-3`},vt={class:`min-w-0`},yt={class:`flex min-w-0 items-baseline gap-2`},bt=[`href`,`title`],xt={key:1,class:`truncate text-sm font-medium`},St={class:`hidden shrink-0 text-[11px] font-medium text-muted-foreground uppercase sm:inline`},Ct={key:0,class:`truncate text-xs text-muted-foreground`},wt={class:`truncate text-xs text-muted-foreground md:hidden`},Tt={class:`hidden min-w-0 text-[13px] md:block`},Et={class:`truncate leading-tight`},Dt={class:`truncate text-xs leading-tight text-muted-foreground`},Ot={key:1,class:`hidden text-right text-[13px] text-muted-foreground tabular-nums md:block`},kt={class:`absolute top-1/2 right-2 flex -translate-y-1/2 items-center justify-end gap-0.5 md:static md:translate-y-0`},At=[`href`,`aria-label`],jt={__name:`DownloadTable`,props:{folders:{type:Array,default:()=>[]},downloads:{type:Array,default:()=>[]},canEdit:{type:Boolean,default:!1},showFolder:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},compact:{type:Boolean,default:!1}},emits:[`versions`,`new-version`,`edit`,`remove`,`favorite`],setup(n){let i=n,l=y({key:`title`,dir:1});function u(e){l.value=l.value.key===e?{key:e,dir:-l.value.dir}:{key:e,dir:e===`title`?1:-1}}let d=f(()=>{if(!i.sortable)return i.downloads;let{key:e,dir:t}=l.value,n=t=>e===`title`?t.title.toLocaleLowerCase(`de`):e===`size`?t.size:t.updated_at??``;return[...i.downloads].sort((e,r)=>n(e)>n(r)?t:n(e)i.compact?i.showFolder?`md:grid-cols-[minmax(0,1fr)_8rem_9.5rem_6.5rem]`:`md:grid-cols-[minmax(0,1fr)_9.5rem_6.5rem]`:i.showFolder?`md:grid-cols-[minmax(0,1fr)_12rem_11rem_5.5rem_6.5rem]`:`md:grid-cols-[minmax(0,1fr)_11rem_5.5rem_6.5rem]`);return(i,f)=>(m(),s(`div`,at,[o(`div`,{class:a([`hidden border-b bg-muted/40 px-4 py-2 text-xs font-medium text-muted-foreground md:grid md:items-center md:gap-4`,p.value]),role:`row`},[n.sortable?(m(),s(`button`,{key:0,type:`button`,class:`inline-flex items-center gap-1 text-left hover:text-foreground`,onClick:f[0]||=e=>u(`title`)},[f[8]||=t(` Name `,-1),l.value.key===`title`?(m(),v(b(l.value.dir>0?r(A):r(pe)),{key:0,class:`size-3.5`})):x(``,!0)])):(m(),s(`span`,ot,`Name`)),n.showFolder?(m(),s(`span`,st,`Ordner`)):x(``,!0),n.sortable?(m(),s(`button`,{key:3,type:`button`,class:`inline-flex items-center gap-1 text-left hover:text-foreground`,onClick:f[1]||=e=>u(`updated_at`)},[f[9]||=t(` Geändert `,-1),l.value.key===`updated_at`?(m(),v(b(l.value.dir>0?r(A):r(pe)),{key:0,class:`size-3.5`})):x(``,!0)])):(m(),s(`span`,ct,`Geändert`)),n.compact?x(``,!0):(m(),s(h,{key:5},[n.sortable?(m(),s(`button`,{key:0,type:`button`,class:`inline-flex items-center justify-end gap-1 hover:text-foreground`,onClick:f[2]||=e=>u(`size`)},[f[10]||=t(` Größe `,-1),l.value.key===`size`?(m(),v(b(l.value.dir>0?r(A):r(pe)),{key:0,class:`size-3.5`})):x(``,!0)])):(m(),s(`span`,lt,`Größe`))],64)),f[11]||=o(`span`,{class:`sr-only`},`Aktionen`,-1)],2),o(`ul`,ut,[(m(!0),s(h,null,c(n.folders,i=>(m(),s(`li`,{key:`f${i.id}`,class:a([`group relative grid items-center gap-x-4 px-4 py-2 hover:bg-accent/60`,p.value])},[o(`div`,dt,[o(`span`,ft,[e(r(O),{class:`size-4`,"stroke-width":1.75})]),o(`div`,pt,[e(r(T),{href:`/downloads/ordner/${i.id}`,class:`block truncate text-sm font-medium after:absolute after:inset-0 group-hover:underline`},{default:g(()=>[t(_(i.name),1)]),_:2},1032,[`href`]),o(`p`,mt,_(r(Re)(i)),1)])]),n.showFolder?(m(),s(`span`,ht)):x(``,!0),f[12]||=o(`span`,{class:`hidden text-[13px] text-muted-foreground md:block`},`–`,-1),n.compact?x(``,!0):(m(),s(`span`,gt)),f[13]||=o(`span`,{class:`hidden md:block`},null,-1)],2))),128)),(m(!0),s(h,null,c(d.value,c=>(m(),s(`li`,{key:c.id,class:a([`group relative grid items-center gap-x-4 py-2 pr-32 pl-4 hover:bg-accent/60 md:pr-4`,p.value])},[o(`div`,_t,[e(j,{extension:c.extension,size:`sm`},null,8,[`extension`]),o(`div`,vt,[o(`div`,yt,[c.download_url?(m(),s(`a`,{key:0,href:c.download_url,class:`truncate text-sm font-medium hover:underline`,title:c.name},_(c.title),9,bt)):(m(),s(`span`,xt,_(c.title),1)),o(`span`,St,_(c.extension),1)]),c.description?(m(),s(`p`,Ct,_(c.description),1)):x(``,!0),o(`p`,wt,[t(_(r(P)(c.updated_at))+` · `+_(r(V)(c.size)),1),n.showFolder&&c.folder_name?(m(),s(h,{key:0},[t(` · `+_(c.folder_name),1)],64)):x(``,!0)])])]),n.showFolder?(m(),v(r(T),{key:0,href:`/downloads/ordner/${c.folder_id}`,class:`hidden truncate text-[13px] text-muted-foreground hover:text-foreground hover:underline md:block`},{default:g(()=>[t(_(c.folder_name),1)]),_:2},1032,[`href`])):x(``,!0),o(`div`,Tt,[o(`div`,Et,_(r(P)(c.updated_at)),1),o(`div`,Dt,[c.updated_by?(m(),s(h,{key:0},[t(_(c.updated_by),1)],64)):x(``,!0),c.version>1?(m(),s(h,{key:1},[t(_(c.updated_by?` · `:``)+`Fassung `+_(c.version),1)],64)):x(``,!0)])]),n.compact?x(``,!0):(m(),s(`span`,Ot,_(r(V)(c.size)),1)),o(`div`,kt,[e(W,{download:c,onToggle:f[3]||=e=>i.$emit(`favorite`,e)},null,8,[`download`]),c.download_url?(m(),v(r(F),{key:0,variant:`ghost`,size:`icon`,class:`size-8 text-muted-foreground`,"as-child":``,title:`${c.title} herunterladen`},{default:g(()=>[o(`a`,{href:c.download_url,"aria-label":`${c.title} herunterladen`},[e(r(ve))],8,At)]),_:2},1032,[`title`])):x(``,!0),e(U,{download:c,"can-edit":n.canEdit,onVersions:f[4]||=e=>i.$emit(`versions`,e),onNewVersion:f[5]||=e=>i.$emit(`new-version`,e),onEdit:f[6]||=e=>i.$emit(`edit`,e),onRemove:f[7]||=e=>i.$emit(`remove`,e)},null,8,[`download`,`can-edit`])])],2))),128))])]))}},Mt={class:`truncate`},Nt={__name:`FolderTreeNav`,props:{items:{type:Array,required:!0},currentId:{type:Number,default:null},openIds:{type:Array,default:()=>[]},depth:{type:Number,default:0}},setup(t){return(n,l)=>{let u=i(`FolderTreeNav`,!0);return m(),s(`ul`,{class:a([`grid gap-0.5`,t.depth?`ml-3 border-l pl-2`:``])},[(m(!0),s(h,null,c(t.items,n=>(m(),s(`li`,{key:n.id},[e(r(T),{href:`/downloads/ordner/${n.id}`,class:a([`flex items-center gap-2 rounded-md px-2.5 py-1.5 text-sm`,n.id===t.currentId?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-foreground/80 hover:bg-accent hover:text-foreground`]),"preserve-scroll":``},{default:g(()=>[n.id===t.currentId||t.openIds.includes(n.id)?(m(),v(r(ce),{key:0,class:`size-4 shrink-0`})):(m(),v(r(O),{key:1,class:`size-4 shrink-0`})),o(`span`,Mt,_(n.name),1)]),_:2},1032,[`href`,`class`]),n.children.length&&(n.id===t.currentId||t.openIds.includes(n.id))?(m(),v(u,{key:0,items:n.children,"current-id":t.currentId,"open-ids":t.openIds,depth:t.depth+1},null,8,[`items`,`current-id`,`open-ids`,`depth`])):x(``,!0)]))),128))],2)}}},Pt={class:`grid gap-6 lg:grid-cols-[240px_minmax(0,1fr)]`},Ft={class:`hidden lg:block`},It={class:`sticky top-20 rounded-lg border bg-card`,"aria-label":`Ordner`},Lt={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},Rt={class:`max-h-[calc(100vh-12rem)] overflow-y-auto p-2`},zt={key:0,class:`px-2.5 py-2 text-[13px] text-muted-foreground`},Bt={key:0,class:`mb-7 grid grid-cols-[repeat(auto-fill,minmax(17rem,1fr))] gap-4`},Vt={class:`flex items-start gap-3 p-4`},Ht={class:`grid size-10 shrink-0 place-items-center rounded-md bg-brand text-white`},Ut={class:`min-w-0`},Wt={key:0,class:`mt-0.5 line-clamp-2 text-[13px] leading-snug text-muted-foreground`},Gt={key:1,class:`relative z-10 mt-1 truncate text-xs text-muted-foreground`},Kt={key:0},qt={class:`mt-auto border-t bg-muted/30 px-4 py-2 text-xs font-medium text-brand-text`},Jt={key:1,class:`mb-5 rounded-lg border bg-card`},Yt={class:`grid items-start gap-5 xl:grid-cols-[minmax(0,1fr)_18rem]`},Xt={key:0,class:`min-w-0`},Zt={class:`mb-3 flex items-center gap-2 text-sm font-semibold`},Qt={class:`grid gap-5 xl:pt-8`},$t={class:`mb-4 flex flex-wrap items-center justify-between gap-3`},en={class:`text-[13px] text-muted-foreground`},tn={class:`flex items-center gap-2`},nn={class:`inline-flex rounded-md border bg-card p-0.5`,role:`group`,"aria-label":`Ansicht`},rn=[`aria-pressed`,`onClick`],an={class:`hidden sm:inline`},on=[`aria-valuenow`],sn={class:`min-w-0`},cn={key:1,class:`rounded-lg border bg-card`},ln={class:`mt-1 text-[13px] text-muted-foreground`},un={key:3,class:`rounded-lg border bg-card`},dn={key:0,class:`hidden overflow-hidden rounded-lg border bg-card text-[13px] xl:block`},fn={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},pn={class:`grid gap-3 p-4`},mn={class:`grid grid-cols-2 gap-2`},hn={class:`rounded-md bg-muted/50 px-3 py-2`},gn={class:`text-lg font-semibold tabular-nums`},_n={class:`rounded-md bg-muted/50 px-3 py-2`},vn={class:`text-lg font-semibold tabular-nums`},yn={key:0},bn={key:0,class:`mt-1 flex flex-wrap gap-1`},xn={key:1},Sn={key:1,class:`rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground`},Cn={class:`mt-2 text-sm font-semibold text-brand-soft-foreground`},wn={key:0,class:`-mx-2 divide-y`,"aria-busy":`true`},Tn={class:`grid flex-1 gap-1.5`},En={key:1,class:`-mx-2 divide-y`},Dn={class:`grid size-8 place-items-center rounded-md bg-muted text-xs font-semibold`},On={class:`min-w-0 flex-1`},kn={class:`truncate text-sm`},An={key:0,class:`ml-1 rounded bg-brand-soft px-1.5 py-0.5 text-[11px] text-brand-soft-foreground`},jn={class:`text-xs text-muted-foreground`},Mn={key:0,class:`text-xs`},Nn=[`href`],Pn={__name:`Index`,props:{tree:{type:Array,required:!0},folder:{type:Object,default:null},breadcrumbs:{type:Array,default:()=>[]},children:{type:Array,default:()=>[]},downloads:{type:Array,default:()=>[]},recent:{type:Array,default:()=>[]},favorites:{type:Array,default:()=>[]},popular:{type:Array,default:()=>[]},search:{type:String,default:``},canCreateRoot:{type:Boolean,default:!1},folderOptions:{type:Array,default:()=>[]},maxUploadMb:{type:Number,default:20}},setup(i){let l=i,p=ne();n(()=>p.props.flash.status,e=>e&&he.success(e),{immediate:!0});let te=f(()=>l.breadcrumbs.map(e=>e.id)),E=f(()=>!!l.folder?.can_edit),D=f(()=>l.search?`Suche: ${l.search}`:l.folder?.name??`Downloads`),ce=f(()=>l.downloads.map(e=>e.updated_at).filter(Boolean).sort().at(-1)??null),pe=f(()=>A.value?[]:[{label:`Downloads`,href:`/downloads`},...l.breadcrumbs.map(e=>({label:e.name,href:`/downloads/ordner/${e.id}`}))]),A=f(()=>!l.folder&&!l.search),j=Pe(`downloads.view`,`list`,[`list`,`grid`]),be=f(()=>{let e=[];return l.children.length&&!l.search&&e.push(H(l.children.length,`Ordner`,`Ordner`)),e.push(H(l.downloads.length,l.search?`Treffer`:`Datei`,l.search?`Treffer`:`Dateien`)),e.join(` · `)}),M={versions:e=>qe(e),"new-version":e=>{K.value=e,q.reset()},edit:e=>We(e),remove:e=>Ke(e),favorite:e=>ke(e)};function ke(e){let t=`/downloads/${e.id}/favorit`,n={preserveScroll:!0,preserveState:!0};e.favorite?w.delete(t,n):w.post(t,{},n)}let U=y(l.search);function ze(){w.get(l.folder?`/downloads/ordner/${l.folder.id}`:`/downloads`,U.value.trim()?{q:U.value.trim()}:{},{preserveState:!0})}let W=C({files:[]}),G=y(!1),Be=y(null);function Ve(e){if(!E.value||!e.length)return;let t=e.find(e=>e.size>l.maxUploadMb*1024*1024);if(t){he.error(`„${t.name}“ ist größer als ${l.maxUploadMb} MB.`);return}W.files=e,W.post(`/downloads/ordner/${l.folder.id}/dateien`,{forceFormData:!0,preserveScroll:!0,onError:e=>he.error(Object.values(e)[0]),onFinish:()=>W.reset()})}function He(e){G.value=!1,Ve([...e.dataTransfer?.files??[]])}let K=y(null),q=C({file:null,note:``});function Ue(){q.post(`/downloads/${K.value.id}/versionen`,{forceFormData:!0,preserveScroll:!0,onSuccess:()=>{K.value=null,q.reset()}})}let J=y(null),Y=C({title:``,description:``,folder_id:null});function We(e){J.value=e,Y.defaults({title:e.title,description:e.description??``,folder_id:e.folder_id}),Y.reset(),Y.clearErrors()}function Ge(){Y.put(`/downloads/${J.value.id}`,{preserveScroll:!0,onSuccess:()=>J.value=null})}function Ke(e){window.confirm(`„${e.title}“ mit allen Fassungen löschen?`)&&w.delete(`/downloads/${e.id}`,{preserveScroll:!0})}let X=y(null),Z=y([]);async function qe(e){X.value=e,Z.value=[],Z.value=(await ge.get(`/downloads/${e.id}/versionen`)).versions}let Q=y(null),$=C({name:``,parent_id:null});function Je(e){Q.value=e,$.clearErrors(),$.name=e===`rename`?l.folder.name:``,$.parent_id=e===`new`?l.folder?.id??null:null}function Xe(){Q.value===`rename`?$.transform(e=>({name:e.name,description:l.folder.description})).put(`/downloads/ordner/${l.folder.id}`,{onSuccess:()=>Q.value=null}):$.transform(e=>e).post(`/downloads/ordner`,{onSuccess:()=>Q.value=null})}function Ze(){window.confirm(`Ordner „${l.folder.name}“ löschen?`)&&w.delete(`/downloads/ordner/${l.folder.id}`,{onError:e=>he.error(Object.values(e)[0])})}return(n,l)=>(m(),v(me,{title:D.value},{default:g(()=>[o(`div`,Pt,[o(`aside`,Ft,[o(`nav`,It,[o(`div`,Lt,[e(r(xe),{class:`size-4 text-brand-text`}),l[22]||=t(` Ablage`,-1)]),o(`div`,Rt,[e(r(T),{href:`/downloads`,class:a([`mb-0.5 flex items-center gap-2 rounded-md px-2.5 py-1.5 text-sm`,A.value?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-foreground/80 hover:bg-accent hover:text-foreground`])},{default:g(()=>[e(r(Ie),{class:`size-4 shrink-0`}),l[23]||=t(` Übersicht `,-1)]),_:1},8,[`class`]),e(Nt,{items:i.tree,"current-id":i.folder?.id??null,"open-ids":te.value},null,8,[`items`,`current-id`,`open-ids`]),i.tree.length?x(``,!0):(m(),s(`p`,zt,`Noch keine Ordner.`))])])]),o(`section`,{class:`relative min-w-0`,onDragover:l[8]||=S(e=>E.value&&(G.value=!0),[`prevent`]),onDrop:S(He,[`prevent`])},[e(Oe,{title:D.value,breadcrumbs:pe.value,description:A.value?`Vorlagen, Anträge und Infomaterial – immer in der aktuellen Fassung.`:i.search?``:i.folder?.description??``},{actions:g(()=>[A.value&&i.canCreateRoot?(m(),v(r(F),{key:0,variant:`outline`,class:`h-10`,onClick:l[0]||=e=>Je(`new`)},{default:g(()=>[e(r(Fe)),l[24]||=t(` Ordner anlegen`,-1)]),_:1})):x(``,!0),o(`form`,{class:`relative w-full sm:w-72`,role:`search`,onSubmit:S(ze,[`prevent`])},[e(r(ae),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),e(r(I),{modelValue:U.value,"onUpdate:modelValue":l[1]||=e=>U.value=e,type:`search`,class:`h-10 bg-card pl-9`,placeholder:`Downloads durchsuchen …`,"aria-label":`Downloads durchsuchen`},null,8,[`modelValue`])],32)]),_:1},8,[`title`,`breadcrumbs`,`description`]),A.value?(m(),s(h,{key:0},[i.children.length?(m(),s(`ul`,Bt,[(m(!0),s(h,null,c(i.children,n=>(m(),s(`li`,{key:n.id,class:`group relative flex flex-col rounded-lg border bg-card hover:border-brand-300`},[o(`div`,Vt,[o(`span`,Ht,[e(r(O),{class:`size-5`,"stroke-width":1.75})]),o(`div`,Ut,[e(r(T),{href:`/downloads/ordner/${n.id}`,class:`text-[15px] leading-tight font-semibold after:absolute after:inset-0 group-hover:underline`},{default:g(()=>[t(_(n.name),1)]),_:2},1032,[`href`]),n.description?(m(),s(`p`,Wt,_(n.description),1)):x(``,!0),n.subfolders.length?(m(),s(`p`,Gt,[(m(!0),s(h,null,c(n.subfolders,(n,i)=>(m(),s(h,{key:n.id},[i?(m(),s(`span`,Kt,` · `)):x(``,!0),e(r(T),{href:`/downloads/ordner/${n.id}`,class:`hover:text-foreground hover:underline`},{default:g(()=>[t(_(n.name),1)]),_:2},1032,[`href`])],64))),128))])):x(``,!0)])]),o(`div`,qt,_(r(Re)(n)),1)]))),128))])):(m(),s(`div`,Jt,[e(De,{icon:r(O),title:`Noch keine Downloads`,text:`Sobald Ordner angelegt sind, erscheinen sie hier.`},null,8,[`icon`])])),o(`div`,Yt,[i.recent.length?(m(),s(`div`,Xt,[o(`h2`,Zt,[e(r(oe),{class:`size-4 text-brand-text`}),l[25]||=t(` Zuletzt aktualisiert`,-1)]),e(jt,d({downloads:i.recent,"show-folder":``,compact:``,sortable:!1},ee(M)),null,16,[`downloads`])])):x(``,!0),o(`aside`,Qt,[e(it,{title:`Meine Downloads`,icon:r(ie),downloads:i.favorites,empty:`Mit dem Stern merken Sie sich Dateien – sie erscheinen hier und auf der Startseite.`},null,8,[`icon`,`downloads`]),i.popular.length?(m(),v(it,{key:0,title:`Häufig genutzt`,icon:r(Le),downloads:i.popular,"show-downloads":``},null,8,[`icon`,`downloads`])):x(``,!0)])])],64)):(m(),s(h,{key:1},[o(`div`,$t,[o(`p`,en,_(be.value),1),o(`div`,tn,[o(`div`,nn,[(m(!0),s(h,null,c([{key:`list`,icon:r(Se),label:`Liste`},{key:`grid`,icon:r(se),label:`Kacheln`}],e=>(m(),s(`button`,{key:e.key,type:`button`,class:a([`inline-flex h-8 items-center gap-1.5 rounded px-2.5 text-[13px]`,r(j)===e.key?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-muted-foreground hover:text-foreground`]),"aria-pressed":r(j)===e.key,onClick:t=>j.value=e.key},[(m(),v(b(e.icon),{class:`size-4`})),l[26]||=t(),o(`span`,an,_(e.label),1)],10,rn))),128))]),E.value?(m(),v(r(F),{key:0,disabled:r(W).processing,onClick:l[2]||=e=>Be.value?.click()},{default:g(()=>[r(W).processing?(m(),v(r(re),{key:0,class:`animate-spin`})):(m(),v(r(Te),{key:1})),l[27]||=t(` Hochladen `,-1)]),_:1},8,[`disabled`])):x(``,!0),o(`input`,{ref_key:`fileInput`,ref:Be,type:`file`,multiple:``,class:`hidden`,onChange:l[3]||=e=>{Ve([...e.target.files]),e.target.value=``}},null,544),E.value?(m(),v(r(ue),{key:1},{default:g(()=>[e(r(de),{"as-child":``},{default:g(()=>[e(r(F),{variant:`outline`,size:`icon`,"aria-label":`Ordner-Aktionen`},{default:g(()=>[e(r(ye))]),_:1})]),_:1}),e(r(fe),{align:`end`},{default:g(()=>[e(r(k),{onSelect:l[4]||=e=>Je(`new`)},{default:g(()=>[e(r(Fe)),l[28]||=t(` Unterordner anlegen`,-1)]),_:1}),e(r(k),{onSelect:l[5]||=e=>Je(`rename`)},{default:g(()=>[e(r(Ce)),l[29]||=t(` Ordner umbenennen`,-1)]),_:1}),i.folder.can_delete?(m(),v(r(le),{key:0})):x(``,!0),i.folder.can_delete?(m(),v(r(k),{key:1,class:`text-destructive`,onSelect:Ze},{default:g(()=>[e(r(we)),l[30]||=t(` Ordner löschen`,-1)]),_:1})):x(``,!0)]),_:1})]),_:1})):x(``,!0)])]),r(W).processing&&r(W).progress?(m(),s(`div`,{key:0,class:`mb-3 h-1.5 overflow-hidden rounded-full bg-muted`,role:`progressbar`,"aria-valuenow":r(W).progress.percentage},[o(`div`,{class:`h-full bg-brand transition-all`,style:u({width:`${r(W).progress.percentage}%`})},null,4)],8,on)):x(``,!0),o(`div`,{class:a([`grid items-start gap-5`,{"xl:grid-cols-[minmax(0,1fr)_16rem]":i.folder&&!i.search}])},[o(`div`,sn,[i.children.length&&!i.search||i.downloads.length?(m(),s(h,{key:0},[r(j)===`list`?(m(),v(jt,d({key:0,folders:i.search?[]:i.children,downloads:i.downloads,"can-edit":E.value,"show-folder":!!i.search},ee(M)),null,16,[`folders`,`downloads`,`can-edit`,`show-folder`])):(m(),v(Ye,d({key:1,folders:i.search?[]:i.children,downloads:i.downloads,"can-edit":E.value},ee(M)),null,16,[`folders`,`downloads`,`can-edit`]))],64)):i.search?(m(),s(`div`,cn,[e(De,{icon:r(ae),title:`Keine Treffer`,text:`Nichts gefunden zu „${i.search}“. Gesucht wird in Titeln, Beschreibungen und Dateinamen.`},null,8,[`icon`,`text`])])):E.value?(m(),s(`button`,{key:2,type:`button`,class:`grid w-full place-items-center rounded-lg border-2 border-dashed bg-card px-6 py-14 text-center hover:border-brand-300`,onClick:l[6]||=e=>Be.value?.click()},[e(r(Te),{class:`size-8 text-muted-foreground`,"stroke-width":1.5}),l[31]||=o(`span`,{class:`mt-3 text-sm font-medium`},`Dieser Ordner ist leer`,-1),o(`span`,ln,`Dateien hierher ziehen oder klicken, um sie auszuwählen – bis `+_(i.maxUploadMb)+` MB je Datei.`,1)])):(m(),s(`div`,un,[e(De,{icon:r(O),title:`Dieser Ordner ist leer`},null,8,[`icon`])]))]),i.folder&&!i.search?(m(),s(`aside`,dn,[o(`h2`,fn,[e(r(_e),{class:`size-4 text-brand-text`}),l[32]||=t(` Über diesen Ordner`,-1)]),o(`dl`,pn,[o(`div`,mn,[o(`div`,hn,[l[33]||=o(`dt`,{class:`text-xs text-muted-foreground`},`Dateien`,-1),o(`dd`,gn,_(i.downloads.length),1)]),o(`div`,_n,[l[34]||=o(`dt`,{class:`text-xs text-muted-foreground`},`Ordner`,-1),o(`dd`,vn,_(i.children.length),1)])]),ce.value?(m(),s(`div`,yn,[l[35]||=o(`dt`,{class:`text-xs text-muted-foreground`},`Zuletzt geändert`,-1),o(`dd`,null,_(r(P)(ce.value)),1)])):x(``,!0),o(`div`,null,[l[36]||=o(`dt`,{class:`text-xs text-muted-foreground`},`Gepflegt von`,-1),i.folder.editors.length?(m(),s(`dd`,bn,[(m(!0),s(h,null,c(i.folder.editors,e=>(m(),s(`span`,{key:e,class:`rounded bg-brand-soft px-1.5 py-0.5 text-xs text-brand-soft-foreground`},_(e),1))),128))])):(m(),s(`dd`,xn,`Administration`))]),E.value?(m(),s(`div`,Sn,` Dateien einfach in die Liste ziehen. Bis `+_(i.maxUploadMb)+` MB je Datei, ältere Fassungen bleiben erhalten. `,1)):x(``,!0)])])):x(``,!0)],2)],64)),G.value&&E.value?(m(),s(`div`,{key:2,class:`absolute inset-0 z-20 grid place-items-center rounded-lg border-2 border-dashed border-brand-400 bg-brand-soft/90 text-center backdrop-blur-[1px]`,onDragleave:l[7]||=S(e=>G.value=!1,[`self`])},[o(`div`,null,[e(r(Te),{class:`mx-auto size-8 text-brand-text`}),o(`p`,Cn,`Loslassen, um in „`+_(i.folder.name)+`“ hochzuladen`,1)])],32)):x(``,!0)],32)]),e(r(L),{open:!!K.value,"onUpdate:open":l[12]||=e=>!e&&(K.value=null)},{default:g(()=>[e(r(R),{class:`sm:max-w-md`},{default:g(()=>[e(r(B),null,{default:g(()=>[e(r(z),null,{default:g(()=>[...l[37]||=[t(`Neue Fassung`,-1)]]),_:1}),e(r(Ee),null,{default:g(()=>[t(`„`+_(K.value?.title)+`“ – die bisherige Fassung bleibt unter „Fassungen“ abrufbar.`,1)]),_:1})]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:S(Ue,[`prevent`])},[e(N,{id:`version-file`,label:`Datei`,error:r(q).errors.file},{default:g(()=>[o(`input`,{id:`version-file`,type:`file`,class:`text-sm`,onChange:l[9]||=e=>r(q).file=e.target.files[0]},null,32)]),_:1},8,[`error`]),e(N,{id:`version-note`,label:`Was hat sich geändert? (optional)`,error:r(q).errors.note},{default:g(()=>[e(r(I),{id:`version-note`,modelValue:r(q).note,"onUpdate:modelValue":l[10]||=e=>r(q).note=e,maxlength:`500`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(r(Ne),null,{default:g(()=>[e(r(F),{type:`button`,variant:`outline`,onClick:l[11]||=e=>K.value=null},{default:g(()=>[...l[38]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(F),{type:`submit`,disabled:!r(q).file||r(q).processing},{default:g(()=>[...l[39]||=[t(`Hochladen`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]),e(r(L),{open:!!J.value,"onUpdate:open":l[17]||=e=>!e&&(J.value=null)},{default:g(()=>[e(r(R),{class:`sm:max-w-lg`},{default:g(()=>[e(r(B),null,{default:g(()=>[e(r(z),null,{default:g(()=>[...l[40]||=[t(`Datei bearbeiten`,-1)]]),_:1})]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:S(Ge,[`prevent`])},[e(N,{id:`doc-title`,label:`Titel`,error:r(Y).errors.title},{default:g(()=>[e(r(I),{id:`doc-title`,modelValue:r(Y).title,"onUpdate:modelValue":l[13]||=e=>r(Y).title=e,maxlength:`250`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(N,{id:`doc-description`,label:`Beschreibung`,error:r(Y).errors.description},{default:g(()=>[e(r(Me),{id:`doc-description`,modelValue:r(Y).description,"onUpdate:modelValue":l[14]||=e=>r(Y).description=e,rows:`3`,maxlength:`2000`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(N,{id:`doc-folder`,label:`Ordner`,error:r(Y).errors.folder_id},{default:g(()=>[e(Ae,{id:`doc-folder`,modelValue:r(Y).folder_id,"onUpdate:modelValue":l[15]||=e=>r(Y).folder_id=e,options:i.folderOptions},null,8,[`modelValue`,`options`])]),_:1},8,[`error`]),e(r(Ne),null,{default:g(()=>[e(r(F),{type:`button`,variant:`outline`,onClick:l[16]||=e=>J.value=null},{default:g(()=>[...l[41]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(F),{type:`submit`,disabled:r(Y).processing},{default:g(()=>[...l[42]||=[t(`Speichern`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]),e(r(L),{open:!!X.value,"onUpdate:open":l[18]||=e=>!e&&(X.value=null)},{default:g(()=>[e(r(R),{class:`sm:max-w-lg`},{default:g(()=>[e(r(B),null,{default:g(()=>[e(r(z),null,{default:g(()=>[...l[43]||=[t(`Fassungen`,-1)]]),_:1}),e(r(Ee),null,{default:g(()=>[t(_(X.value?.title),1)]),_:1})]),_:1}),Z.value.length?(m(),s(`ul`,En,[(m(!0),s(h,null,c(Z.value,n=>(m(),s(`li`,{key:n.version,class:`flex items-center gap-3 px-2 py-2.5`},[o(`span`,Dn,_(n.version),1),o(`div`,On,[o(`p`,kn,[t(_(n.name)+` `,1),n.current?(m(),s(`span`,An,`aktuell`)):x(``,!0)]),o(`p`,jn,[t(_(r(P)(n.created_at)),1),n.uploader?(m(),s(h,{key:0},[t(` · `+_(n.uploader),1)],64)):x(``,!0),t(` · `+_(r(V)(n.size)),1)]),n.note?(m(),s(`p`,Mn,_(n.note),1)):x(``,!0)]),e(r(F),{variant:`ghost`,size:`icon`,"as-child":``,title:`Fassung ${n.version} herunterladen`},{default:g(()=>[o(`a`,{href:n.download_url},[e(r(ve))],8,Nn)]),_:2},1032,[`title`])]))),128))])):(m(),s(`ul`,wn,[(m(),s(h,null,c(3,t=>o(`li`,{key:t,class:`flex items-center gap-3 px-2 py-2.5`},[e(r(je),{class:`size-8`}),o(`div`,Tn,[e(r(je),{class:`h-3.5 w-2/3`}),e(r(je),{class:`h-3 w-1/3`})])])),64))]))]),_:1})]),_:1},8,[`open`]),e(r(L),{open:!!Q.value,"onUpdate:open":l[21]||=e=>!e&&(Q.value=null)},{default:g(()=>[e(r(R),{class:`sm:max-w-md`},{default:g(()=>[e(r(B),null,{default:g(()=>[e(r(z),null,{default:g(()=>[t(_(Q.value===`rename`?`Ordner umbenennen`:i.folder?`Unterordner in „${i.folder.name}“`:`Neuer Ordner`),1)]),_:1})]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:S(Xe,[`prevent`])},[e(N,{id:`folder-name`,label:`Name`,error:r($).errors.name},{default:g(()=>[e(r(I),{id:`folder-name`,modelValue:r($).name,"onUpdate:modelValue":l[19]||=e=>r($).name=e,maxlength:`120`,autofocus:``},null,8,[`modelValue`])]),_:1},8,[`error`]),e(r(Ne),null,{default:g(()=>[e(r(F),{type:`button`,variant:`outline`,onClick:l[20]||=e=>Q.value=null},{default:g(()=>[...l[44]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(F),{type:`submit`,disabled:r($).processing||!r($).name.trim()},{default:g(()=>[...l[45]||=[t(`Speichern`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`])]),_:1},8,[`title`]))}};export{Pn as default}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdfThumbnail-FYC4VfyJ.js","assets/app-BNwrc_lv.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-Bv2m9wnk.css"])))=>i.map(i=>d[i]); +import{D as e,E as t,Ht as n,On as r,St as i,Zn as a,_ as o,b as s,bt as c,ct as l,er as u,et as d,g as f,it as p,jt as ee,mt as m,o as h,qt as g,tr as _,v,vn as y,wt as b,xt as te,y as x}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as S}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as ne,i as C,o as w,r as T,s as E}from"./app-BNwrc_lv.js";import{O as re,k as D}from"./dist-DtGNiYlK.js";import{A as ie,J as O,N as ae,Q as oe,W as se,Y as ce,a as le,c as ue,i as de,o as k,s as fe}from"./AppIcon-nlhvQfK7.js";import{n as pe,t as A}from"./arrow-up-Djq_2Npz.js";import{t as me}from"./AppLayout-esQiy2nD.js";import{S as he,n as ge,s as _e}from"./http-CAG9BrJF.js";import{t as ve}from"./download-UAAY3N2F.js";import{t as ye}from"./ellipsis-vertical-B9wuHo-w.js";import{t as j}from"./FileIcon-BctWLKDw.js";import{t as be}from"./file-plus-corner-Z8xo1q-K.js";import{t as xe}from"./folder-tree-ZY-sbGXb.js";import{t as Se}from"./list-DHYGZ2vt.js";import{t as Ce}from"./pencil-line-CmAbFj4f.js";import{t as M}from"./rotate-ccw-clock-DRYS-TO2.js";import{t as we}from"./trash-DUqnVIgb.js";import{t as Te}from"./upload-M7dd6qr8.js";import{t as N}from"./FormField-BoFAO4pm.js";import{t as Ee}from"./EmptyState-Ceq4v8mE.js";import{t as De}from"./PageHeader-BMzzCXfT.js";import{a as P,o as Oe}from"./format-BsuBtvUs.js";import{n as F}from"./button-CwUSbS9X.js";import{t as ke}from"./NativeSelect-G3km7PmI.js";import{t as I}from"./Input-FGSb2-yK.js";import{t as Ae}from"./Skeleton-fJgmuUSB.js";import{t as je}from"./Textarea-DEFXqC2w.js";import{i as L,n as Me,r as R,t as z}from"./dialog-RK2mTeqi.js";import{t as Ne}from"./DialogDescription-CaB-9xpp.js";import{t as B}from"./DialogHeader-DuqiL3ry.js";import{t as Pe}from"./useStoredChoice-BAacDiWy.js";var Fe=D({name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]}),Ie=D({name:`library-big`,size:24,node:[[`rect`,{width:`8`,height:`18`,x:`3`,y:`3`,rx:`1`,key:`oynpb5`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z`,key:`1qboyk`}]]}),Le=D({name:`trending-up`,size:24,node:[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]}),V=e=>e?e>=1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`:`–`,H=(e,t,n)=>`${e.toLocaleString(`de-DE`)} ${e===1?t:n}`;function Re(e){let t=[];return e.folders&&t.push(H(e.folders,`Ordner`,`Ordner`)),e.downloads&&t.push(H(e.downloads,`Datei`,`Dateien`)),t.join(` · `)||`Noch leer`}var U={__name:`DownloadMenu`,props:{download:{type:Object,required:!0},canEdit:{type:Boolean,default:!1}},emits:[`versions`,`new-version`,`edit`,`remove`],setup(n){return(i,a)=>(m(),v(r(ue),null,{default:g(()=>[e(r(de),{"as-child":``},{default:g(()=>[e(r(F),{variant:`ghost`,size:`icon`,class:`size-8 text-muted-foreground`,"aria-label":`Aktionen für ${n.download.title}`},{default:g(()=>[e(r(ye))]),_:1},8,[`aria-label`])]),_:1}),e(r(fe),{align:`end`,class:`w-60`},{default:g(()=>[e(r(k),{onSelect:a[0]||=e=>i.$emit(`versions`,n.download)},{default:g(()=>[e(r(M)),a[4]||=t(` Fassungen anzeigen`,-1)]),_:1}),n.canEdit?(m(),s(h,{key:0},[e(r(k),{onSelect:a[1]||=e=>i.$emit(`new-version`,n.download)},{default:g(()=>[e(r(be)),a[5]||=t(` Neue Fassung hochladen`,-1)]),_:1}),e(r(k),{onSelect:a[2]||=e=>i.$emit(`edit`,n.download)},{default:g(()=>[e(r(Ce)),a[6]||=t(` Bearbeiten oder verschieben`,-1)]),_:1}),e(r(le)),e(r(k),{class:`text-destructive`,onSelect:a[3]||=e=>i.$emit(`remove`,n.download)},{default:g(()=>[e(r(we)),a[7]||=t(` Löschen`,-1)]),_:1})],64)):x(``,!0)]),_:1})]),_:1}))}},ze=[`aria-pressed`,`title`,`aria-label`],W={__name:`FavoriteButton`,props:{download:{type:Object,required:!0}},emits:[`toggle`],setup(t){return(n,i)=>(m(),s(`button`,{type:`button`,class:a([`grid size-8 place-items-center rounded-md hover:bg-accent`,t.download.favorite?`text-amber-500`:`text-muted-foreground hover:text-foreground`]),"aria-pressed":t.download.favorite,title:t.download.favorite?`Aus „Meine Downloads“ entfernen`:`In „Meine Downloads“ merken`,"aria-label":t.download.favorite?`${t.download.title} nicht mehr merken`:`${t.download.title} merken`,onClick:i[0]||=e=>n.$emit(`toggle`,t.download)},[e(r(ie),{class:a([`size-4`,{"fill-current":t.download.favorite}])},null,8,[`class`])],10,ze))}},G=[`src`],Be={key:1,class:`grid size-full place-items-center`},Ve={__name:`DownloadThumb`,props:{download:{type:Object,required:!0}},setup(t){let n=t,r=y(null),i=y(null),a=y(!1),o;async function c(){if(n.download.preview_kind===`image`){i.value=n.download.preview_url;return}try{let{pdfThumbnail:e}=await E(async()=>{let{pdfThumbnail:e}=await import(`./pdfThumbnail-FYC4VfyJ.js`);return{pdfThumbnail:e}},__vite__mapDeps([0,1,2,3,4]));i.value=await e(n.download.preview_url)}catch{a.value=!0}}return l(()=>{n.download.preview_url&&typeof IntersectionObserver<`u`&&(o=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(o.disconnect(),c())},{rootMargin:`200px`}),o.observe(r.value))}),p(()=>o?.disconnect()),(n,o)=>(m(),s(`div`,{ref_key:`root`,ref:r,class:`relative h-32 overflow-hidden rounded-t-lg border-b bg-muted/40`},[i.value&&!a.value?(m(),s(`img`,{key:0,src:i.value,alt:``,class:`size-full object-cover object-top`,loading:`lazy`,onError:o[0]||=e=>a.value=!0},null,40,G)):(m(),s(`div`,Be,[e(j,{extension:t.download.extension,size:`lg`},null,8,[`extension`])])),te(n.$slots,`default`)],512))}},He={class:`grid gap-6`},K={key:0,class:`grid grid-cols-[repeat(auto-fill,minmax(12.5rem,1fr))] gap-3`},q={class:`grid size-10 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},Ue={class:`min-w-0`},J={class:`block truncate text-xs text-muted-foreground`},Y={key:1,class:`grid grid-cols-[repeat(auto-fill,minmax(12.5rem,1fr))] gap-3`},We={key:0,class:`absolute bottom-2 left-2 rounded bg-card px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground ring-1 ring-border`},Ge={key:1,class:`absolute right-2 bottom-2 rounded bg-card px-1.5 py-0.5 text-[10px] font-bold tracking-wide text-muted-foreground uppercase ring-1 ring-border`},Ke={class:`flex min-h-0 flex-1 flex-col p-3`},X=[`href`,`title`],Z={key:1,class:`line-clamp-2 text-sm leading-snug font-medium`},qe={class:`mt-auto pt-2 text-xs text-muted-foreground`},Q={key:0,class:`absolute top-2 left-2 z-10 text-amber-500`},$={class:`absolute top-1.5 right-1.5 z-10 flex gap-0.5 rounded-md bg-card/90 opacity-0 shadow-xs ring-1 ring-border transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 max-md:opacity-100`},Je=[`href`,`aria-label`],Ye={__name:`DownloadGrid`,props:{folders:{type:Array,default:()=>[]},downloads:{type:Array,default:()=>[]},canEdit:{type:Boolean,default:!1}},emits:[`versions`,`new-version`,`edit`,`remove`,`favorite`],setup(n){return(i,a)=>(m(),s(`div`,He,[n.folders.length?(m(),s(`ul`,K,[(m(!0),s(h,null,c(n.folders,n=>(m(),s(`li`,{key:n.id,class:`group relative flex items-center gap-3 rounded-lg border bg-card p-3 hover:border-brand-300 hover:shadow-xs`},[o(`span`,q,[e(r(O),{class:`size-5`,"stroke-width":1.75})]),o(`span`,Ue,[e(r(T),{href:`/downloads/ordner/${n.id}`,class:`block truncate text-sm font-medium after:absolute after:inset-0 group-hover:underline`},{default:g(()=>[t(_(n.name),1)]),_:2},1032,[`href`]),o(`span`,J,_(r(Re)(n)),1)])]))),128))])):x(``,!0),n.downloads.length?(m(),s(`ul`,Y,[(m(!0),s(h,null,c(n.downloads,t=>(m(),s(`li`,{key:t.id,class:`group relative flex flex-col rounded-lg border bg-card hover:border-brand-300 hover:shadow-xs`},[e(Ve,{download:t},{default:g(()=>[t.version>1?(m(),s(`span`,We,`Fassung `+_(t.version),1)):x(``,!0),t.preview_url?(m(),s(`span`,Ge,_(t.extension),1)):x(``,!0)]),_:2},1032,[`download`]),o(`div`,Ke,[t.download_url?(m(),s(`a`,{key:0,href:t.download_url,class:`line-clamp-2 text-sm leading-snug font-medium after:absolute after:inset-0 hover:underline`,title:t.name},_(t.title),9,X)):(m(),s(`span`,Z,_(t.title),1)),o(`p`,qe,_(r(Oe)(t.updated_at))+` · `+_(r(V)(t.size)),1)]),t.favorite?(m(),s(`div`,Q,[e(r(ie),{class:`size-4 fill-current`})])):x(``,!0),o(`div`,$,[e(W,{download:t,onToggle:a[0]||=e=>i.$emit(`favorite`,e)},null,8,[`download`]),t.download_url?(m(),v(r(F),{key:0,variant:`ghost`,size:`icon`,class:`size-8 text-muted-foreground`,"as-child":``,title:`${t.title} herunterladen`},{default:g(()=>[o(`a`,{href:t.download_url,"aria-label":`${t.title} herunterladen`},[e(r(ve))],8,Je)]),_:2},1032,[`title`])):x(``,!0),e(U,{download:t,"can-edit":n.canEdit,onVersions:a[1]||=e=>i.$emit(`versions`,e),onNewVersion:a[2]||=e=>i.$emit(`new-version`,e),onEdit:a[3]||=e=>i.$emit(`edit`,e),onRemove:a[4]||=e=>i.$emit(`remove`,e)},null,8,[`download`,`can-edit`])])]))),128))])):x(``,!0)]))}},Xe={class:`rounded-lg border bg-card`},Ze={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},Qe={key:0,class:`p-2`},$e=[`href`],et={class:`min-w-0 flex-1`},tt={class:`block truncate text-[13px] font-medium`},nt={class:`block truncate text-xs text-muted-foreground`},rt={key:1,class:`px-4 py-3 text-[13px] text-muted-foreground`},it={__name:`DownloadMiniList`,props:{title:{type:String,required:!0},icon:{type:[Object,Function],required:!0},downloads:{type:Array,required:!0},empty:{type:String,default:``},showDownloads:{type:Boolean,default:!1}},setup(n){return(r,i)=>(m(),s(`section`,Xe,[o(`h2`,Ze,[(m(),v(b(n.icon),{class:`size-4 text-brand-text`})),t(` `+_(n.title),1)]),n.downloads.length?(m(),s(`ul`,Qe,[(m(!0),s(h,null,c(n.downloads,r=>(m(),s(`li`,{key:r.id},[o(`a`,{href:r.download_url,class:`flex items-center gap-3 rounded-md px-2 py-1.5 hover:bg-accent`},[e(j,{extension:r.extension,size:`sm`},null,8,[`extension`]),o(`span`,et,[o(`span`,tt,_(r.title),1),o(`span`,nt,[t(_(r.folder_name),1),n.showDownloads?(m(),s(h,{key:0},[t(` · `+_(r.download_count.toLocaleString(`de-DE`))+`× geladen`,1)],64)):x(``,!0)])])],8,$e)]))),128))])):(m(),s(`p`,rt,_(n.empty),1))]))}},at={class:`overflow-hidden rounded-lg border bg-card`},ot={key:1},st={key:2},ct={key:4},lt={key:1,class:`text-right`},ut={class:`divide-y`},dt={class:`flex min-w-0 items-center gap-3`},ft={class:`grid size-8 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},pt={class:`min-w-0`},mt={class:`truncate text-xs text-muted-foreground`},ht={key:0,class:`hidden md:block`},gt={key:1,class:`hidden md:block`},_t={class:`flex min-w-0 items-center gap-3`},vt={class:`min-w-0`},yt={class:`flex min-w-0 items-baseline gap-2`},bt=[`href`,`title`],xt={key:1,class:`truncate text-sm font-medium`},St={class:`hidden shrink-0 text-[11px] font-medium text-muted-foreground uppercase sm:inline`},Ct={key:0,class:`truncate text-xs text-muted-foreground`},wt={class:`truncate text-xs text-muted-foreground md:hidden`},Tt={class:`hidden min-w-0 text-[13px] md:block`},Et={class:`truncate leading-tight`},Dt={class:`truncate text-xs leading-tight text-muted-foreground`},Ot={key:1,class:`hidden text-right text-[13px] text-muted-foreground tabular-nums md:block`},kt={class:`absolute top-1/2 right-2 flex -translate-y-1/2 items-center justify-end gap-0.5 md:static md:translate-y-0`},At=[`href`,`aria-label`],jt={__name:`DownloadTable`,props:{folders:{type:Array,default:()=>[]},downloads:{type:Array,default:()=>[]},canEdit:{type:Boolean,default:!1},showFolder:{type:Boolean,default:!1},sortable:{type:Boolean,default:!0},compact:{type:Boolean,default:!1}},emits:[`versions`,`new-version`,`edit`,`remove`,`favorite`],setup(n){let i=n,l=y({key:`title`,dir:1});function u(e){l.value=l.value.key===e?{key:e,dir:-l.value.dir}:{key:e,dir:e===`title`?1:-1}}let d=f(()=>{if(!i.sortable)return i.downloads;let{key:e,dir:t}=l.value,n=t=>e===`title`?t.title.toLocaleLowerCase(`de`):e===`size`?t.size:t.updated_at??``;return[...i.downloads].sort((e,r)=>n(e)>n(r)?t:n(e)i.compact?i.showFolder?`md:grid-cols-[minmax(0,1fr)_8rem_9.5rem_6.5rem]`:`md:grid-cols-[minmax(0,1fr)_9.5rem_6.5rem]`:i.showFolder?`md:grid-cols-[minmax(0,1fr)_12rem_11rem_5.5rem_6.5rem]`:`md:grid-cols-[minmax(0,1fr)_11rem_5.5rem_6.5rem]`);return(i,f)=>(m(),s(`div`,at,[o(`div`,{class:a([`hidden border-b bg-muted/40 px-4 py-2 text-xs font-medium text-muted-foreground md:grid md:items-center md:gap-4`,p.value]),role:`row`},[n.sortable?(m(),s(`button`,{key:0,type:`button`,class:`inline-flex items-center gap-1 text-left hover:text-foreground`,onClick:f[0]||=e=>u(`title`)},[f[8]||=t(` Name `,-1),l.value.key===`title`?(m(),v(b(l.value.dir>0?r(A):r(pe)),{key:0,class:`size-3.5`})):x(``,!0)])):(m(),s(`span`,ot,`Name`)),n.showFolder?(m(),s(`span`,st,`Ordner`)):x(``,!0),n.sortable?(m(),s(`button`,{key:3,type:`button`,class:`inline-flex items-center gap-1 text-left hover:text-foreground`,onClick:f[1]||=e=>u(`updated_at`)},[f[9]||=t(` Geändert `,-1),l.value.key===`updated_at`?(m(),v(b(l.value.dir>0?r(A):r(pe)),{key:0,class:`size-3.5`})):x(``,!0)])):(m(),s(`span`,ct,`Geändert`)),n.compact?x(``,!0):(m(),s(h,{key:5},[n.sortable?(m(),s(`button`,{key:0,type:`button`,class:`inline-flex items-center justify-end gap-1 hover:text-foreground`,onClick:f[2]||=e=>u(`size`)},[f[10]||=t(` Größe `,-1),l.value.key===`size`?(m(),v(b(l.value.dir>0?r(A):r(pe)),{key:0,class:`size-3.5`})):x(``,!0)])):(m(),s(`span`,lt,`Größe`))],64)),f[11]||=o(`span`,{class:`sr-only`},`Aktionen`,-1)],2),o(`ul`,ut,[(m(!0),s(h,null,c(n.folders,i=>(m(),s(`li`,{key:`f${i.id}`,class:a([`group relative grid items-center gap-x-4 px-4 py-2 hover:bg-accent/60`,p.value])},[o(`div`,dt,[o(`span`,ft,[e(r(O),{class:`size-4`,"stroke-width":1.75})]),o(`div`,pt,[e(r(T),{href:`/downloads/ordner/${i.id}`,class:`block truncate text-sm font-medium after:absolute after:inset-0 group-hover:underline`},{default:g(()=>[t(_(i.name),1)]),_:2},1032,[`href`]),o(`p`,mt,_(r(Re)(i)),1)])]),n.showFolder?(m(),s(`span`,ht)):x(``,!0),f[12]||=o(`span`,{class:`hidden text-[13px] text-muted-foreground md:block`},`–`,-1),n.compact?x(``,!0):(m(),s(`span`,gt)),f[13]||=o(`span`,{class:`hidden md:block`},null,-1)],2))),128)),(m(!0),s(h,null,c(d.value,c=>(m(),s(`li`,{key:c.id,class:a([`group relative grid items-center gap-x-4 py-2 pr-32 pl-4 hover:bg-accent/60 md:pr-4`,p.value])},[o(`div`,_t,[e(j,{extension:c.extension,size:`sm`},null,8,[`extension`]),o(`div`,vt,[o(`div`,yt,[c.download_url?(m(),s(`a`,{key:0,href:c.download_url,class:`truncate text-sm font-medium hover:underline`,title:c.name},_(c.title),9,bt)):(m(),s(`span`,xt,_(c.title),1)),o(`span`,St,_(c.extension),1)]),c.description?(m(),s(`p`,Ct,_(c.description),1)):x(``,!0),o(`p`,wt,[t(_(r(P)(c.updated_at))+` · `+_(r(V)(c.size)),1),n.showFolder&&c.folder_name?(m(),s(h,{key:0},[t(` · `+_(c.folder_name),1)],64)):x(``,!0)])])]),n.showFolder?(m(),v(r(T),{key:0,href:`/downloads/ordner/${c.folder_id}`,class:`hidden truncate text-[13px] text-muted-foreground hover:text-foreground hover:underline md:block`},{default:g(()=>[t(_(c.folder_name),1)]),_:2},1032,[`href`])):x(``,!0),o(`div`,Tt,[o(`div`,Et,_(r(P)(c.updated_at)),1),o(`div`,Dt,[c.updated_by?(m(),s(h,{key:0},[t(_(c.updated_by),1)],64)):x(``,!0),c.version>1?(m(),s(h,{key:1},[t(_(c.updated_by?` · `:``)+`Fassung `+_(c.version),1)],64)):x(``,!0)])]),n.compact?x(``,!0):(m(),s(`span`,Ot,_(r(V)(c.size)),1)),o(`div`,kt,[e(W,{download:c,onToggle:f[3]||=e=>i.$emit(`favorite`,e)},null,8,[`download`]),c.download_url?(m(),v(r(F),{key:0,variant:`ghost`,size:`icon`,class:`size-8 text-muted-foreground`,"as-child":``,title:`${c.title} herunterladen`},{default:g(()=>[o(`a`,{href:c.download_url,"aria-label":`${c.title} herunterladen`},[e(r(ve))],8,At)]),_:2},1032,[`title`])):x(``,!0),e(U,{download:c,"can-edit":n.canEdit,onVersions:f[4]||=e=>i.$emit(`versions`,e),onNewVersion:f[5]||=e=>i.$emit(`new-version`,e),onEdit:f[6]||=e=>i.$emit(`edit`,e),onRemove:f[7]||=e=>i.$emit(`remove`,e)},null,8,[`download`,`can-edit`])])],2))),128))])]))}},Mt={class:`truncate`},Nt={__name:`FolderTreeNav`,props:{items:{type:Array,required:!0},currentId:{type:Number,default:null},openIds:{type:Array,default:()=>[]},depth:{type:Number,default:0}},setup(t){return(n,l)=>{let u=i(`FolderTreeNav`,!0);return m(),s(`ul`,{class:a([`grid gap-0.5`,t.depth?`ml-3 border-l pl-2`:``])},[(m(!0),s(h,null,c(t.items,n=>(m(),s(`li`,{key:n.id},[e(r(T),{href:`/downloads/ordner/${n.id}`,class:a([`flex items-center gap-2 rounded-md px-2.5 py-1.5 text-sm`,n.id===t.currentId?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-foreground/80 hover:bg-accent hover:text-foreground`]),"preserve-scroll":``},{default:g(()=>[n.id===t.currentId||t.openIds.includes(n.id)?(m(),v(r(ce),{key:0,class:`size-4 shrink-0`})):(m(),v(r(O),{key:1,class:`size-4 shrink-0`})),o(`span`,Mt,_(n.name),1)]),_:2},1032,[`href`,`class`]),n.children.length&&(n.id===t.currentId||t.openIds.includes(n.id))?(m(),v(u,{key:0,items:n.children,"current-id":t.currentId,"open-ids":t.openIds,depth:t.depth+1},null,8,[`items`,`current-id`,`open-ids`,`depth`])):x(``,!0)]))),128))],2)}}},Pt={class:`grid gap-6 lg:grid-cols-[240px_minmax(0,1fr)]`},Ft={class:`hidden lg:block`},It={class:`sticky top-20 rounded-lg border bg-card`,"aria-label":`Ordner`},Lt={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},Rt={class:`max-h-[calc(100vh-12rem)] overflow-y-auto p-2`},zt={key:0,class:`px-2.5 py-2 text-[13px] text-muted-foreground`},Bt={key:0,class:`mb-7 grid grid-cols-[repeat(auto-fill,minmax(17rem,1fr))] gap-4`},Vt={class:`flex items-start gap-3 p-4`},Ht={class:`grid size-10 shrink-0 place-items-center rounded-md bg-brand text-white`},Ut={class:`min-w-0`},Wt={key:0,class:`mt-0.5 line-clamp-2 text-[13px] leading-snug text-muted-foreground`},Gt={key:1,class:`relative z-10 mt-1 truncate text-xs text-muted-foreground`},Kt={key:0},qt={class:`mt-auto border-t bg-muted/30 px-4 py-2 text-xs font-medium text-brand-text`},Jt={key:1,class:`mb-5 rounded-lg border bg-card`},Yt={class:`grid items-start gap-5 xl:grid-cols-[minmax(0,1fr)_18rem]`},Xt={key:0,class:`min-w-0`},Zt={class:`mb-3 flex items-center gap-2 text-sm font-semibold`},Qt={class:`grid gap-5 xl:pt-8`},$t={class:`mb-4 flex flex-wrap items-center justify-between gap-3`},en={class:`text-[13px] text-muted-foreground`},tn={class:`flex items-center gap-2`},nn={class:`inline-flex rounded-md border bg-card p-0.5`,role:`group`,"aria-label":`Ansicht`},rn=[`aria-pressed`,`onClick`],an={class:`hidden sm:inline`},on=[`aria-valuenow`],sn={class:`min-w-0`},cn={key:1,class:`rounded-lg border bg-card`},ln={class:`mt-1 text-[13px] text-muted-foreground`},un={key:3,class:`rounded-lg border bg-card`},dn={key:0,class:`hidden overflow-hidden rounded-lg border bg-card text-[13px] xl:block`},fn={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},pn={class:`grid gap-3 p-4`},mn={class:`grid grid-cols-2 gap-2`},hn={class:`rounded-md bg-muted/50 px-3 py-2`},gn={class:`text-lg font-semibold tabular-nums`},_n={class:`rounded-md bg-muted/50 px-3 py-2`},vn={class:`text-lg font-semibold tabular-nums`},yn={key:0},bn={key:0,class:`mt-1 flex flex-wrap gap-1`},xn={key:1},Sn={key:1,class:`rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground`},Cn={class:`mt-2 text-sm font-semibold text-brand-soft-foreground`},wn={key:0,class:`-mx-2 divide-y`,"aria-busy":`true`},Tn={class:`grid flex-1 gap-1.5`},En={key:1,class:`-mx-2 divide-y`},Dn={class:`grid size-8 place-items-center rounded-md bg-muted text-xs font-semibold`},On={class:`min-w-0 flex-1`},kn={class:`truncate text-sm`},An={key:0,class:`ml-1 rounded bg-brand-soft px-1.5 py-0.5 text-[11px] text-brand-soft-foreground`},jn={class:`text-xs text-muted-foreground`},Mn={key:0,class:`text-xs`},Nn=[`href`],Pn={__name:`Index`,props:{tree:{type:Array,required:!0},folder:{type:Object,default:null},breadcrumbs:{type:Array,default:()=>[]},children:{type:Array,default:()=>[]},downloads:{type:Array,default:()=>[]},recent:{type:Array,default:()=>[]},favorites:{type:Array,default:()=>[]},popular:{type:Array,default:()=>[]},search:{type:String,default:``},canCreateRoot:{type:Boolean,default:!1},folderOptions:{type:Array,default:()=>[]},maxUploadMb:{type:Number,default:20}},setup(i){let l=i,p=ne();n(()=>p.props.flash.status,e=>e&&_e.success(e),{immediate:!0});let te=f(()=>l.breadcrumbs.map(e=>e.id)),E=f(()=>!!l.folder?.can_edit),D=f(()=>l.search?`Suche: ${l.search}`:l.folder?.name??`Downloads`),ce=f(()=>l.downloads.map(e=>e.updated_at).filter(Boolean).sort().at(-1)??null),pe=f(()=>A.value?[]:[{label:`Downloads`,href:`/downloads`},...l.breadcrumbs.map(e=>({label:e.name,href:`/downloads/ordner/${e.id}`}))]),A=f(()=>!l.folder&&!l.search),j=Pe(`downloads.view`,`list`,[`list`,`grid`]),be=f(()=>{let e=[];return l.children.length&&!l.search&&e.push(H(l.children.length,`Ordner`,`Ordner`)),e.push(H(l.downloads.length,l.search?`Treffer`:`Datei`,l.search?`Treffer`:`Dateien`)),e.join(` · `)}),M={versions:e=>qe(e),"new-version":e=>{K.value=e,q.reset()},edit:e=>We(e),remove:e=>Ke(e),favorite:e=>Oe(e)};function Oe(e){let t=`/downloads/${e.id}/favorit`,n={preserveScroll:!0,preserveState:!0};e.favorite?w.delete(t,n):w.post(t,{},n)}let U=y(l.search);function ze(){w.get(l.folder?`/downloads/ordner/${l.folder.id}`:`/downloads`,U.value.trim()?{q:U.value.trim()}:{},{preserveState:!0})}let W=C({files:[]}),G=y(!1),Be=y(null);function Ve(e){if(!E.value||!e.length)return;let t=e.find(e=>e.size>l.maxUploadMb*1024*1024);if(t){_e.error(`„${t.name}“ ist größer als ${l.maxUploadMb} MB.`);return}W.files=e,W.post(`/downloads/ordner/${l.folder.id}/dateien`,{forceFormData:!0,preserveScroll:!0,onError:e=>_e.error(Object.values(e)[0]),onFinish:()=>W.reset()})}function He(e){G.value=!1,Ve([...e.dataTransfer?.files??[]])}let K=y(null),q=C({file:null,note:``});function Ue(){q.post(`/downloads/${K.value.id}/versionen`,{forceFormData:!0,preserveScroll:!0,onSuccess:()=>{K.value=null,q.reset()}})}let J=y(null),Y=C({title:``,description:``,folder_id:null});function We(e){J.value=e,Y.defaults({title:e.title,description:e.description??``,folder_id:e.folder_id}),Y.reset(),Y.clearErrors()}function Ge(){Y.put(`/downloads/${J.value.id}`,{preserveScroll:!0,onSuccess:()=>J.value=null})}function Ke(e){window.confirm(`„${e.title}“ mit allen Fassungen löschen?`)&&w.delete(`/downloads/${e.id}`,{preserveScroll:!0})}let X=y(null),Z=y([]);async function qe(e){X.value=e,Z.value=[],Z.value=(await ge.get(`/downloads/${e.id}/versionen`)).versions}let Q=y(null),$=C({name:``,parent_id:null});function Je(e){Q.value=e,$.clearErrors(),$.name=e===`rename`?l.folder.name:``,$.parent_id=e===`new`?l.folder?.id??null:null}function Xe(){Q.value===`rename`?$.transform(e=>({name:e.name,description:l.folder.description})).put(`/downloads/ordner/${l.folder.id}`,{onSuccess:()=>Q.value=null}):$.transform(e=>e).post(`/downloads/ordner`,{onSuccess:()=>Q.value=null})}function Ze(){window.confirm(`Ordner „${l.folder.name}“ löschen?`)&&w.delete(`/downloads/ordner/${l.folder.id}`,{onError:e=>_e.error(Object.values(e)[0])})}return(n,l)=>(m(),v(me,{title:D.value},{default:g(()=>[o(`div`,Pt,[o(`aside`,Ft,[o(`nav`,It,[o(`div`,Lt,[e(r(xe),{class:`size-4 text-brand-text`}),l[22]||=t(` Ablage`,-1)]),o(`div`,Rt,[e(r(T),{href:`/downloads`,class:a([`mb-0.5 flex items-center gap-2 rounded-md px-2.5 py-1.5 text-sm`,A.value?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-foreground/80 hover:bg-accent hover:text-foreground`])},{default:g(()=>[e(r(Ie),{class:`size-4 shrink-0`}),l[23]||=t(` Übersicht `,-1)]),_:1},8,[`class`]),e(Nt,{items:i.tree,"current-id":i.folder?.id??null,"open-ids":te.value},null,8,[`items`,`current-id`,`open-ids`]),i.tree.length?x(``,!0):(m(),s(`p`,zt,`Noch keine Ordner.`))])])]),o(`section`,{class:`relative min-w-0`,onDragover:l[8]||=S(e=>E.value&&(G.value=!0),[`prevent`]),onDrop:S(He,[`prevent`])},[e(De,{title:D.value,breadcrumbs:pe.value,description:A.value?`Vorlagen, Anträge und Infomaterial – immer in der aktuellen Fassung.`:i.search?``:i.folder?.description??``},{actions:g(()=>[A.value&&i.canCreateRoot?(m(),v(r(F),{key:0,variant:`outline`,class:`h-10`,onClick:l[0]||=e=>Je(`new`)},{default:g(()=>[e(r(Fe)),l[24]||=t(` Ordner anlegen`,-1)]),_:1})):x(``,!0),o(`form`,{class:`relative w-full sm:w-72`,role:`search`,onSubmit:S(ze,[`prevent`])},[e(r(ae),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),e(r(I),{modelValue:U.value,"onUpdate:modelValue":l[1]||=e=>U.value=e,type:`search`,class:`h-10 bg-card pl-9`,placeholder:`Downloads durchsuchen …`,"aria-label":`Downloads durchsuchen`},null,8,[`modelValue`])],32)]),_:1},8,[`title`,`breadcrumbs`,`description`]),A.value?(m(),s(h,{key:0},[i.children.length?(m(),s(`ul`,Bt,[(m(!0),s(h,null,c(i.children,n=>(m(),s(`li`,{key:n.id,class:`group relative flex flex-col rounded-lg border bg-card hover:border-brand-300`},[o(`div`,Vt,[o(`span`,Ht,[e(r(O),{class:`size-5`,"stroke-width":1.75})]),o(`div`,Ut,[e(r(T),{href:`/downloads/ordner/${n.id}`,class:`text-[15px] leading-tight font-semibold after:absolute after:inset-0 group-hover:underline`},{default:g(()=>[t(_(n.name),1)]),_:2},1032,[`href`]),n.description?(m(),s(`p`,Wt,_(n.description),1)):x(``,!0),n.subfolders.length?(m(),s(`p`,Gt,[(m(!0),s(h,null,c(n.subfolders,(n,i)=>(m(),s(h,{key:n.id},[i?(m(),s(`span`,Kt,` · `)):x(``,!0),e(r(T),{href:`/downloads/ordner/${n.id}`,class:`hover:text-foreground hover:underline`},{default:g(()=>[t(_(n.name),1)]),_:2},1032,[`href`])],64))),128))])):x(``,!0)])]),o(`div`,qt,_(r(Re)(n)),1)]))),128))])):(m(),s(`div`,Jt,[e(Ee,{icon:r(O),title:`Noch keine Downloads`,text:`Sobald Ordner angelegt sind, erscheinen sie hier.`},null,8,[`icon`])])),o(`div`,Yt,[i.recent.length?(m(),s(`div`,Xt,[o(`h2`,Zt,[e(r(oe),{class:`size-4 text-brand-text`}),l[25]||=t(` Zuletzt aktualisiert`,-1)]),e(jt,d({downloads:i.recent,"show-folder":``,compact:``,sortable:!1},ee(M)),null,16,[`downloads`])])):x(``,!0),o(`aside`,Qt,[e(it,{title:`Meine Downloads`,icon:r(ie),downloads:i.favorites,empty:`Mit dem Stern merken Sie sich Dateien – sie erscheinen hier und auf der Startseite.`},null,8,[`icon`,`downloads`]),i.popular.length?(m(),v(it,{key:0,title:`Häufig genutzt`,icon:r(Le),downloads:i.popular,"show-downloads":``},null,8,[`icon`,`downloads`])):x(``,!0)])])],64)):(m(),s(h,{key:1},[o(`div`,$t,[o(`p`,en,_(be.value),1),o(`div`,tn,[o(`div`,nn,[(m(!0),s(h,null,c([{key:`list`,icon:r(Se),label:`Liste`},{key:`grid`,icon:r(se),label:`Kacheln`}],e=>(m(),s(`button`,{key:e.key,type:`button`,class:a([`inline-flex h-8 items-center gap-1.5 rounded px-2.5 text-[13px]`,r(j)===e.key?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-muted-foreground hover:text-foreground`]),"aria-pressed":r(j)===e.key,onClick:t=>j.value=e.key},[(m(),v(b(e.icon),{class:`size-4`})),l[26]||=t(),o(`span`,an,_(e.label),1)],10,rn))),128))]),E.value?(m(),v(r(F),{key:0,disabled:r(W).processing,onClick:l[2]||=e=>Be.value?.click()},{default:g(()=>[r(W).processing?(m(),v(r(re),{key:0,class:`animate-spin`})):(m(),v(r(Te),{key:1})),l[27]||=t(` Hochladen `,-1)]),_:1},8,[`disabled`])):x(``,!0),o(`input`,{ref_key:`fileInput`,ref:Be,type:`file`,multiple:``,class:`hidden`,onChange:l[3]||=e=>{Ve([...e.target.files]),e.target.value=``}},null,544),E.value?(m(),v(r(ue),{key:1},{default:g(()=>[e(r(de),{"as-child":``},{default:g(()=>[e(r(F),{variant:`outline`,size:`icon`,"aria-label":`Ordner-Aktionen`},{default:g(()=>[e(r(ye))]),_:1})]),_:1}),e(r(fe),{align:`end`},{default:g(()=>[e(r(k),{onSelect:l[4]||=e=>Je(`new`)},{default:g(()=>[e(r(Fe)),l[28]||=t(` Unterordner anlegen`,-1)]),_:1}),e(r(k),{onSelect:l[5]||=e=>Je(`rename`)},{default:g(()=>[e(r(Ce)),l[29]||=t(` Ordner umbenennen`,-1)]),_:1}),i.folder.can_delete?(m(),v(r(le),{key:0})):x(``,!0),i.folder.can_delete?(m(),v(r(k),{key:1,class:`text-destructive`,onSelect:Ze},{default:g(()=>[e(r(we)),l[30]||=t(` Ordner löschen`,-1)]),_:1})):x(``,!0)]),_:1})]),_:1})):x(``,!0)])]),r(W).processing&&r(W).progress?(m(),s(`div`,{key:0,class:`mb-3 h-1.5 overflow-hidden rounded-full bg-muted`,role:`progressbar`,"aria-valuenow":r(W).progress.percentage},[o(`div`,{class:`h-full bg-brand transition-all`,style:u({width:`${r(W).progress.percentage}%`})},null,4)],8,on)):x(``,!0),o(`div`,{class:a([`grid items-start gap-5`,{"xl:grid-cols-[minmax(0,1fr)_16rem]":i.folder&&!i.search}])},[o(`div`,sn,[i.children.length&&!i.search||i.downloads.length?(m(),s(h,{key:0},[r(j)===`list`?(m(),v(jt,d({key:0,folders:i.search?[]:i.children,downloads:i.downloads,"can-edit":E.value,"show-folder":!!i.search},ee(M)),null,16,[`folders`,`downloads`,`can-edit`,`show-folder`])):(m(),v(Ye,d({key:1,folders:i.search?[]:i.children,downloads:i.downloads,"can-edit":E.value},ee(M)),null,16,[`folders`,`downloads`,`can-edit`]))],64)):i.search?(m(),s(`div`,cn,[e(Ee,{icon:r(ae),title:`Keine Treffer`,text:`Nichts gefunden zu „${i.search}“. Gesucht wird in Titeln, Beschreibungen und Dateinamen.`},null,8,[`icon`,`text`])])):E.value?(m(),s(`button`,{key:2,type:`button`,class:`grid w-full place-items-center rounded-lg border-2 border-dashed bg-card px-6 py-14 text-center hover:border-brand-300`,onClick:l[6]||=e=>Be.value?.click()},[e(r(Te),{class:`size-8 text-muted-foreground`,"stroke-width":1.5}),l[31]||=o(`span`,{class:`mt-3 text-sm font-medium`},`Dieser Ordner ist leer`,-1),o(`span`,ln,`Dateien hierher ziehen oder klicken, um sie auszuwählen – bis `+_(i.maxUploadMb)+` MB je Datei.`,1)])):(m(),s(`div`,un,[e(Ee,{icon:r(O),title:`Dieser Ordner ist leer`},null,8,[`icon`])]))]),i.folder&&!i.search?(m(),s(`aside`,dn,[o(`h2`,fn,[e(r(he),{class:`size-4 text-brand-text`}),l[32]||=t(` Über diesen Ordner`,-1)]),o(`dl`,pn,[o(`div`,mn,[o(`div`,hn,[l[33]||=o(`dt`,{class:`text-xs text-muted-foreground`},`Dateien`,-1),o(`dd`,gn,_(i.downloads.length),1)]),o(`div`,_n,[l[34]||=o(`dt`,{class:`text-xs text-muted-foreground`},`Ordner`,-1),o(`dd`,vn,_(i.children.length),1)])]),ce.value?(m(),s(`div`,yn,[l[35]||=o(`dt`,{class:`text-xs text-muted-foreground`},`Zuletzt geändert`,-1),o(`dd`,null,_(r(P)(ce.value)),1)])):x(``,!0),o(`div`,null,[l[36]||=o(`dt`,{class:`text-xs text-muted-foreground`},`Gepflegt von`,-1),i.folder.editors.length?(m(),s(`dd`,bn,[(m(!0),s(h,null,c(i.folder.editors,e=>(m(),s(`span`,{key:e,class:`rounded bg-brand-soft px-1.5 py-0.5 text-xs text-brand-soft-foreground`},_(e),1))),128))])):(m(),s(`dd`,xn,`Administration`))]),E.value?(m(),s(`div`,Sn,` Dateien einfach in die Liste ziehen. Bis `+_(i.maxUploadMb)+` MB je Datei, ältere Fassungen bleiben erhalten. `,1)):x(``,!0)])])):x(``,!0)],2)],64)),G.value&&E.value?(m(),s(`div`,{key:2,class:`absolute inset-0 z-20 grid place-items-center rounded-lg border-2 border-dashed border-brand-400 bg-brand-soft/90 text-center backdrop-blur-[1px]`,onDragleave:l[7]||=S(e=>G.value=!1,[`self`])},[o(`div`,null,[e(r(Te),{class:`mx-auto size-8 text-brand-text`}),o(`p`,Cn,`Loslassen, um in „`+_(i.folder.name)+`“ hochzuladen`,1)])],32)):x(``,!0)],32)]),e(r(L),{open:!!K.value,"onUpdate:open":l[12]||=e=>!e&&(K.value=null)},{default:g(()=>[e(r(R),{class:`sm:max-w-md`},{default:g(()=>[e(r(B),null,{default:g(()=>[e(r(z),null,{default:g(()=>[...l[37]||=[t(`Neue Fassung`,-1)]]),_:1}),e(r(Ne),null,{default:g(()=>[t(`„`+_(K.value?.title)+`“ – die bisherige Fassung bleibt unter „Fassungen“ abrufbar.`,1)]),_:1})]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:S(Ue,[`prevent`])},[e(N,{id:`version-file`,label:`Datei`,error:r(q).errors.file},{default:g(()=>[o(`input`,{id:`version-file`,type:`file`,class:`text-sm`,onChange:l[9]||=e=>r(q).file=e.target.files[0]},null,32)]),_:1},8,[`error`]),e(N,{id:`version-note`,label:`Was hat sich geändert? (optional)`,error:r(q).errors.note},{default:g(()=>[e(r(I),{id:`version-note`,modelValue:r(q).note,"onUpdate:modelValue":l[10]||=e=>r(q).note=e,maxlength:`500`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(r(Me),null,{default:g(()=>[e(r(F),{type:`button`,variant:`outline`,onClick:l[11]||=e=>K.value=null},{default:g(()=>[...l[38]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(F),{type:`submit`,disabled:!r(q).file||r(q).processing},{default:g(()=>[...l[39]||=[t(`Hochladen`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]),e(r(L),{open:!!J.value,"onUpdate:open":l[17]||=e=>!e&&(J.value=null)},{default:g(()=>[e(r(R),{class:`sm:max-w-lg`},{default:g(()=>[e(r(B),null,{default:g(()=>[e(r(z),null,{default:g(()=>[...l[40]||=[t(`Datei bearbeiten`,-1)]]),_:1})]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:S(Ge,[`prevent`])},[e(N,{id:`doc-title`,label:`Titel`,error:r(Y).errors.title},{default:g(()=>[e(r(I),{id:`doc-title`,modelValue:r(Y).title,"onUpdate:modelValue":l[13]||=e=>r(Y).title=e,maxlength:`250`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(N,{id:`doc-description`,label:`Beschreibung`,error:r(Y).errors.description},{default:g(()=>[e(r(je),{id:`doc-description`,modelValue:r(Y).description,"onUpdate:modelValue":l[14]||=e=>r(Y).description=e,rows:`3`,maxlength:`2000`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(N,{id:`doc-folder`,label:`Ordner`,error:r(Y).errors.folder_id},{default:g(()=>[e(ke,{id:`doc-folder`,modelValue:r(Y).folder_id,"onUpdate:modelValue":l[15]||=e=>r(Y).folder_id=e,options:i.folderOptions},null,8,[`modelValue`,`options`])]),_:1},8,[`error`]),e(r(Me),null,{default:g(()=>[e(r(F),{type:`button`,variant:`outline`,onClick:l[16]||=e=>J.value=null},{default:g(()=>[...l[41]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(F),{type:`submit`,disabled:r(Y).processing},{default:g(()=>[...l[42]||=[t(`Speichern`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]),e(r(L),{open:!!X.value,"onUpdate:open":l[18]||=e=>!e&&(X.value=null)},{default:g(()=>[e(r(R),{class:`sm:max-w-lg`},{default:g(()=>[e(r(B),null,{default:g(()=>[e(r(z),null,{default:g(()=>[...l[43]||=[t(`Fassungen`,-1)]]),_:1}),e(r(Ne),null,{default:g(()=>[t(_(X.value?.title),1)]),_:1})]),_:1}),Z.value.length?(m(),s(`ul`,En,[(m(!0),s(h,null,c(Z.value,n=>(m(),s(`li`,{key:n.version,class:`flex items-center gap-3 px-2 py-2.5`},[o(`span`,Dn,_(n.version),1),o(`div`,On,[o(`p`,kn,[t(_(n.name)+` `,1),n.current?(m(),s(`span`,An,`aktuell`)):x(``,!0)]),o(`p`,jn,[t(_(r(P)(n.created_at)),1),n.uploader?(m(),s(h,{key:0},[t(` · `+_(n.uploader),1)],64)):x(``,!0),t(` · `+_(r(V)(n.size)),1)]),n.note?(m(),s(`p`,Mn,_(n.note),1)):x(``,!0)]),e(r(F),{variant:`ghost`,size:`icon`,"as-child":``,title:`Fassung ${n.version} herunterladen`},{default:g(()=>[o(`a`,{href:n.download_url},[e(r(ve))],8,Nn)]),_:2},1032,[`title`])]))),128))])):(m(),s(`ul`,wn,[(m(),s(h,null,c(3,t=>o(`li`,{key:t,class:`flex items-center gap-3 px-2 py-2.5`},[e(r(Ae),{class:`size-8`}),o(`div`,Tn,[e(r(Ae),{class:`h-3.5 w-2/3`}),e(r(Ae),{class:`h-3 w-1/3`})])])),64))]))]),_:1})]),_:1},8,[`open`]),e(r(L),{open:!!Q.value,"onUpdate:open":l[21]||=e=>!e&&(Q.value=null)},{default:g(()=>[e(r(R),{class:`sm:max-w-md`},{default:g(()=>[e(r(B),null,{default:g(()=>[e(r(z),null,{default:g(()=>[t(_(Q.value===`rename`?`Ordner umbenennen`:i.folder?`Unterordner in „${i.folder.name}“`:`Neuer Ordner`),1)]),_:1})]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:S(Xe,[`prevent`])},[e(N,{id:`folder-name`,label:`Name`,error:r($).errors.name},{default:g(()=>[e(r(I),{id:`folder-name`,modelValue:r($).name,"onUpdate:modelValue":l[19]||=e=>r($).name=e,maxlength:`120`,autofocus:``},null,8,[`modelValue`])]),_:1},8,[`error`]),e(r(Me),null,{default:g(()=>[e(r(F),{type:`button`,variant:`outline`,onClick:l[20]||=e=>Q.value=null},{default:g(()=>[...l[44]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(F),{type:`submit`,disabled:r($).processing||!r($).name.trim()},{default:g(()=>[...l[45]||=[t(`Speichern`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`])]),_:1},8,[`title`]))}};export{Pn as default}; \ No newline at end of file diff --git a/public/build/assets/Index-n_s429m8.js b/public/build/assets/Index-DJEXwOyO.js similarity index 87% rename from public/build/assets/Index-n_s429m8.js rename to public/build/assets/Index-DJEXwOyO.js index 3ccd6625..c43d2a78 100644 --- a/public/build/assets/Index-n_s429m8.js +++ b/public/build/assets/Index-DJEXwOyO.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,vn as d,w as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-Bu3kn8yd.js";import{X as h,Y as g}from"./AppIcon-0N56IC2z.js";import{t as _}from"./AppLayout-BxsYt2ib.js";import{t as v}from"./chevron-right-C9w5cb2q.js";import{t as y}from"./plus-B_ij2ng2.js";import{t as b}from"./EmptyState-Ceq4v8mE.js";import{t as x}from"./PageHeader-Ybe7qDu5.js";import{t as S}from"./button-ZHC5mKey.js";import{t as C}from"./NewPageDialog-BJuo8o_M.js";var w={key:0,class:`grid gap-5 md:grid-cols-2 xl:grid-cols-3`},T={class:`grid size-10 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-text`},E={class:`min-w-0 flex-1 truncate font-semibold`},D={key:0,class:`grid p-2`},O={class:`truncate`},k={key:0,class:`text-xs text-muted-foreground`},A={key:0,class:`px-3 py-1.5 text-[13px]`},j={key:1,class:`rounded-lg border bg-card`},M={__name:`Index`,props:{tree:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(M){let N=d(!1);return(d,P)=>(o(),u(_,{title:`Seiten`},{default:c(()=>[e(x,{title:`Seiten`,description:`Informationen der Bereiche, Abteilungen und Gremien.`},f({_:2},[M.canCreate?{name:`actions`,fn:c(()=>[e(n(S),{onClick:P[0]||=e=>N.value=!0},{default:c(()=>[e(n(y)),P[2]||=t(` Neue Seite`,-1)]),_:1})]),key:`0`}:void 0]),1024),M.tree.length?(o(),i(`div`,w,[(o(!0),i(s,null,a(M.tree,d=>(o(),i(`section`,{key:d.id,class:`rounded-lg border bg-card`},[e(n(m),{href:d.url,class:`flex items-center gap-3 border-b px-5 py-4 hover:bg-accent/50`},{default:c(()=>[r(`span`,T,[d.children.length?(o(),u(n(g),{key:0,class:`size-5`})):(o(),u(n(h),{key:1,class:`size-5`}))]),r(`span`,E,l(d.title),1),e(n(v),{class:`size-4 text-muted-foreground`})]),_:2},1032,[`href`]),d.children.length?(o(),i(`ul`,D,[(o(!0),i(s,null,a(d.children.slice(0,8),t=>(o(),i(`li`,{key:t.id},[e(n(m),{href:t.url,class:`flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-accent`},{default:c(()=>[r(`span`,O,l(t.title),1),t.children.length?(o(),i(`span`,k,l(t.children.length),1)):p(``,!0)]),_:2},1032,[`href`])]))),128)),d.children.length>8?(o(),i(`li`,A,[e(n(m),{href:d.url,class:`font-medium text-brand-text hover:underline`},{default:c(()=>[t(`Alle `+l(d.children.length)+` Seiten`,1)]),_:2},1032,[`href`])])):p(``,!0)])):p(``,!0)]))),128))])):(o(),i(`div`,j,[e(b,{icon:n(h),title:`Noch keine Seiten`,text:`Hier erscheinen Seiten, sobald sie veröffentlicht sind.`},null,8,[`icon`])])),e(C,{open:N.value,"onUpdate:open":P[1]||=e=>N.value=e},null,8,[`open`])]),_:1}))}};export{M as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,vn as d,w as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-BNwrc_lv.js";import{X as h,Y as g}from"./AppIcon-nlhvQfK7.js";import{t as _}from"./AppLayout-esQiy2nD.js";import{t as v}from"./chevron-right-C9w5cb2q.js";import{t as y}from"./plus-B_ij2ng2.js";import{t as b}from"./EmptyState-Ceq4v8mE.js";import{t as x}from"./PageHeader-BMzzCXfT.js";import{n as S}from"./button-CwUSbS9X.js";import{t as C}from"./NewPageDialog-CGV-jwsW.js";var w={key:0,class:`grid gap-5 md:grid-cols-2 xl:grid-cols-3`},T={class:`grid size-10 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-text`},E={class:`min-w-0 flex-1 truncate font-semibold`},D={key:0,class:`grid p-2`},O={class:`truncate`},k={key:0,class:`text-xs text-muted-foreground`},A={key:0,class:`px-3 py-1.5 text-[13px]`},j={key:1,class:`rounded-lg border bg-card`},M={__name:`Index`,props:{tree:{type:Array,required:!0},canCreate:{type:Boolean,default:!1}},setup(M){let N=d(!1);return(d,P)=>(o(),u(_,{title:`Seiten`},{default:c(()=>[e(x,{title:`Seiten`,description:`Informationen der Bereiche, Abteilungen und Gremien.`},f({_:2},[M.canCreate?{name:`actions`,fn:c(()=>[e(n(S),{onClick:P[0]||=e=>N.value=!0},{default:c(()=>[e(n(y)),P[2]||=t(` Neue Seite`,-1)]),_:1})]),key:`0`}:void 0]),1024),M.tree.length?(o(),i(`div`,w,[(o(!0),i(s,null,a(M.tree,d=>(o(),i(`section`,{key:d.id,class:`rounded-lg border bg-card`},[e(n(m),{href:d.url,class:`flex items-center gap-3 border-b px-5 py-4 hover:bg-accent/50`},{default:c(()=>[r(`span`,T,[d.children.length?(o(),u(n(g),{key:0,class:`size-5`})):(o(),u(n(h),{key:1,class:`size-5`}))]),r(`span`,E,l(d.title),1),e(n(v),{class:`size-4 text-muted-foreground`})]),_:2},1032,[`href`]),d.children.length?(o(),i(`ul`,D,[(o(!0),i(s,null,a(d.children.slice(0,8),t=>(o(),i(`li`,{key:t.id},[e(n(m),{href:t.url,class:`flex items-center justify-between rounded-md px-3 py-2 text-sm hover:bg-accent`},{default:c(()=>[r(`span`,O,l(t.title),1),t.children.length?(o(),i(`span`,k,l(t.children.length),1)):p(``,!0)]),_:2},1032,[`href`])]))),128)),d.children.length>8?(o(),i(`li`,A,[e(n(m),{href:d.url,class:`font-medium text-brand-text hover:underline`},{default:c(()=>[t(`Alle `+l(d.children.length)+` Seiten`,1)]),_:2},1032,[`href`])])):p(``,!0)])):p(``,!0)]))),128))])):(o(),i(`div`,j,[e(b,{icon:n(h),title:`Noch keine Seiten`,text:`Hier erscheinen Seiten, sobald sie veröffentlicht sind.`},null,8,[`icon`])])),e(C,{open:N.value,"onUpdate:open":P[1]||=e=>N.value=e},null,8,[`open`])]),_:1}))}};export{M as default}; \ No newline at end of file diff --git a/public/build/assets/Index-BVnuDp-X.js b/public/build/assets/Index-Q18G3mVK.js similarity index 92% rename from public/build/assets/Index-BVnuDp-X.js rename to public/build/assets/Index-Q18G3mVK.js index 7da8229a..97f8e102 100644 --- a/public/build/assets/Index-BVnuDp-X.js +++ b/public/build/assets/Index-Q18G3mVK.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-xi5Hl50h.js","assets/app-Bu3kn8yd.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-CL30rx2M.css"])))=>i.map(i=>d[i]); -import{D as e,E as t,Ht as n,On as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,vn as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as h}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as g,i as _,o as v,s as y}from"./app-Bu3kn8yd.js";import{O as b,k as x}from"./dist-DtGNiYlK.js";import{P as S,X as C}from"./AppIcon-0N56IC2z.js";import{t as w}from"./AppLayout-BxsYt2ib.js";import{o as T}from"./http-DmyDwIce.js";import{t as E}from"./trash-DUqnVIgb.js";import{t as D}from"./upload-M7dd6qr8.js";import{t as O}from"./FormField-BoFAO4pm.js";import{t as k}from"./PageHeader-Ybe7qDu5.js";import{t as A}from"./button-ZHC5mKey.js";import{t as j}from"./NativeSelect-BGasRaNs.js";var M=x({name:`utensils-crossed`,size:24,node:[[`path`,{d:`m16 2-2.3 2.3a3 3 0 0 0 0 4.2l1.8 1.8a3 3 0 0 0 4.2 0L22 8`,key:`n7qcjb`}],[`path`,{d:`M15 15 3.3 3.3a4.2 4.2 0 0 0 0 6l7.3 7.3c.7.7 2 .7 2.8 0L15 15Zm0 0 7 7`,key:`d0u48b`}],[`path`,{d:`m2.1 21.8 6.4-6.3`,key:`yn04lh`}],[`path`,{d:`m19 5-7 7`,key:`194lzd`}]],aliases:[`fork-knife-crossed`]});async function N(e,t=1654){let[n,r]=await Promise.all([y(()=>import(`./pdf-xi5Hl50h.js`),__vite__mapDeps([0,1,2,3,4])),y(()=>import(`./pdf.worker.min-D00xlTFB.js`),[])]);n.GlobalWorkerOptions.workerSrc=r.default;let i=await n.getDocument({data:await e.arrayBuffer(),isEvalSupported:!1,enableXfa:!1}).promise;try{let n=await i.getPage(1),r=n.getViewport({scale:t/n.getViewport({scale:1}).width}),a=document.createElement(`canvas`);a.width=Math.round(r.width),a.height=Math.round(r.height);let o=a.getContext(`2d`);o.fillStyle=`#ffffff`,o.fillRect(0,0,a.width,a.height),await n.render({canvasContext:o,viewport:r}).promise;let s=await new Promise(e=>a.toBlob(e,`image/jpeg`,.9));return new File([s],e.name.replace(/\.pdf$/i,``)+`.jpg`,{type:`image/jpeg`})}finally{i.destroy()}}var P={class:`mt-10 rounded-lg border bg-card print:hidden`},F={class:`grid gap-6 p-5 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`},I={class:`grid content-start gap-4`},L=[`disabled`],R={class:`mt-2 text-sm font-medium`},z={class:`flex flex-wrap items-center gap-3 rounded-md bg-muted/50 px-3 py-2.5 text-sm`},B={class:`min-w-0 flex-1 truncate`},V={key:0,class:`grid grid-cols-[repeat(auto-fill,minmax(7rem,1fr))] gap-3`},H=[`href`],U=[`src`,`alt`],W={class:`mt-1 text-xs font-medium`},G={class:`text-[11px] text-muted-foreground`},K=[`aria-label`,`onClick`],q={key:1,class:`text-sm text-muted-foreground`},J={class:`mt-3 text-xs text-muted-foreground`},Y={__name:`ManagePanel`,props:{manage:{type:Object,required:!0},allergens:{type:Object,default:null}},setup(n){let g=n,y=_({week:g.manage.suggested,image:null}),x=p(!1),S=p(!1),w=p(null),k=p(null);async function M(e){if(!e)return;let t=e;if(e.type===`application/pdf`||/\.pdf$/i.test(e.name)){x.value=!0;try{t=await N(e)}catch{T.error(`Das PDF ließ sich nicht umwandeln. Bitte als Bild hochladen.`);return}finally{x.value=!1}}y.image=t,y.post(`/speiseplan/wochen`,{forceFormData:!0,preserveScroll:!0,onError:e=>T.error(Object.values(e)[0]),onSuccess:()=>{y.image=null,y.week=g.manage.suggested}})}function Y(e){e&&v.post(`/speiseplan/allergene`,{file:e},{forceFormData:!0,preserveScroll:!0,onError:e=>T.error(Object.values(e)[0])})}function X(e){window.confirm(`Speiseplan ${e.label} entfernen?`)&&v.delete(`/speiseplan/wochen/${e.id}`,{preserveScroll:!0})}return(p,g)=>(c(),o(`section`,P,[g[11]||=a(`h2`,{class:`border-b px-5 py-3 text-base font-semibold`},`Speiseplan hochladen`,-1),a(`div`,F,[a(`div`,I,[e(O,{id:`sp-week`,label:`Woche`,error:r(y).errors.week},{default:u(()=>[e(j,{id:`sp-week`,modelValue:r(y).week,"onUpdate:modelValue":g[0]||=e=>r(y).week=e,options:n.manage.options},null,8,[`modelValue`,`options`])]),_:1},8,[`error`]),a(`button`,{type:`button`,class:i([`grid place-items-center rounded-lg border-2 border-dashed px-6 py-10 text-center transition-colors`,S.value?`border-brand-400 bg-brand-soft/60`:`hover:border-brand-300`]),disabled:r(y).processing||x.value,onClick:g[1]||=e=>w.value?.click(),onDragover:g[2]||=h(e=>S.value=!0,[`prevent`]),onDragleave:g[3]||=h(e=>S.value=!1,[`prevent`]),onDrop:g[4]||=h(e=>{S.value=!1,M(e.dataTransfer.files[0])},[`prevent`])},[r(y).processing||x.value?(c(),f(r(b),{key:0,class:`size-7 animate-spin text-muted-foreground`})):(c(),f(r(D),{key:1,class:`size-7 text-muted-foreground`})),a(`span`,R,d(x.value?`PDF wird umgewandelt …`:r(y).processing?`Wird hochgeladen …`:`PDF oder Bild hierher ziehen oder klicken`),1),g[9]||=a(`span`,{class:`mt-1 text-xs text-muted-foreground`},`Ein PDF wird automatisch zum Bild (erste Seite, A4). Ist für die Woche schon ein Plan da, wird er ersetzt.`,-1)],42,L),a(`input`,{ref_key:`fileInput`,ref:w,type:`file`,accept:`application/pdf,image/jpeg,image/png,image/webp`,class:`hidden`,onChange:g[5]||=e=>{M(e.target.files[0]),e.target.value=``}},null,544),a(`div`,z,[e(r(C),{class:`size-4 text-muted-foreground`}),a(`span`,B,d(n.allergens?n.allergens.name:`Noch keine Allergie-Informationen hinterlegt`),1),e(r(A),{size:`sm`,variant:`outline`,onClick:g[6]||=e=>k.value?.click()},{default:u(()=>[t(d(n.allergens?`Ersetzen`:`PDF hochladen`),1)]),_:1}),n.allergens?(c(),f(r(A),{key:0,size:`icon`,variant:`ghost`,class:`size-8`,"aria-label":`Allergie-Informationen entfernen`,onClick:g[7]||=e=>r(v).delete(`/speiseplan/allergene`,{preserveScroll:!0})},{default:u(()=>[e(r(E))]),_:1})):m(``,!0),a(`input`,{ref_key:`allergenInput`,ref:k,type:`file`,accept:`application/pdf`,class:`hidden`,onChange:g[8]||=e=>{Y(e.target.files[0]),e.target.value=``}},null,544)])]),a(`div`,null,[g[10]||=a(`p`,{class:`mb-2 text-sm font-medium`},`Hochgeladene Wochen`,-1),n.manage.uploaded.length?(c(),o(`ul`,V,[(c(!0),o(l,null,s(n.manage.uploaded,t=>(c(),o(`li`,{key:t.id,class:`group relative`},[a(`a`,{href:t.image_url,target:`_blank`,class:i([`block overflow-hidden rounded-md border bg-white`,{"opacity-60":t.past}])},[a(`img`,{src:t.image_url,alt:t.label,class:`aspect-[210/297] w-full object-cover object-top`,loading:`lazy`},null,8,U)],10,H),a(`p`,W,`KW `+d(t.week),1),a(`p`,G,d(t.past?`vergangen`:t.label.split(`· `)[1]),1),a(`button`,{type:`button`,class:`absolute top-1 right-1 grid size-7 place-items-center rounded-md bg-card/90 text-destructive opacity-0 shadow-xs ring-1 ring-border group-hover:opacity-100 focus-visible:opacity-100`,"aria-label":`KW ${t.week} entfernen`,onClick:e=>X(t)},[e(r(E),{class:`size-3.5`})],8,K)]))),128))])):(c(),o(`p`,q,`Noch keine Pläne hochgeladen.`)),a(`p`,J,`Vergangene Wochen werden nach `+d(n.manage.keepWeeks)+` Wochen automatisch gelöscht.`,1)])])]))}},X=[`href`],Z=[`href`],Q={class:`grid gap-6 lg:grid-cols-2`},$={class:`flex items-center justify-between gap-3 border-b px-4 py-2.5`},ee={class:`text-sm font-semibold`},te={class:`text-xs text-muted-foreground`},ne=[`href`],re=[`href`],ie=[`src`,`alt`],ae={key:1,class:`grid aspect-[210/297] max-h-[36rem] w-full place-items-center bg-muted/30 text-center`},oe={key:0,class:`mt-6 text-sm`},se=[`href`],ce={__name:`Index`,props:{weeks:{type:Array,required:!0},allergens:{type:Object,default:null},canManage:{type:Boolean,default:!1},manage:{type:Object,default:null}},setup(i){let p=i,h=g();n(()=>h.props.flash.status,e=>e&&T.success(e),{immediate:!0});let _=e=>`/speiseplan/druck${e.length?`?wochen=${e.join(`,`)}`:``}`,v=()=>p.weeks.filter(e=>e.plan).map(e=>e.plan.id);return(n,p)=>(c(),f(w,{title:`Speiseplan`},{default:u(()=>[e(k,{title:`Speiseplan`,description:`Unsere Kantine – diese und nächste Woche.`},{actions:u(()=>[i.allergens?(c(),f(r(A),{key:0,variant:`outline`,"as-child":``},{default:u(()=>[a(`a`,{href:i.allergens.url,target:`_blank`,rel:`noopener`},[e(r(C)),p[0]||=t(` Allergie-Informationen`,-1)],8,X)]),_:1})):m(``,!0),v().length?(c(),f(r(A),{key:1,"as-child":``},{default:u(()=>[a(`a`,{href:_(v()),target:`_blank`,rel:`noopener`},[e(r(S)),p[1]||=t(` Drucken`,-1)],8,Z)]),_:1})):m(``,!0)]),_:1}),a(`div`,Q,[(c(!0),o(l,null,s(i.weeks,n=>(c(),o(`section`,{key:n.week_start,class:`overflow-hidden rounded-lg border bg-card`},[a(`header`,$,[a(`div`,null,[a(`h2`,ee,d(n.title),1),a(`p`,te,d(n.label),1)]),n.plan?(c(),f(r(A),{key:0,size:`sm`,variant:`ghost`,"as-child":``},{default:u(()=>[a(`a`,{href:_([n.plan.id]),target:`_blank`,rel:`noopener`},[e(r(S)),p[2]||=t(` Nur diese Woche`,-1)],8,ne)]),_:2},1024)):m(``,!0)]),n.plan?(c(),o(`a`,{key:0,href:n.plan.image_url,target:`_blank`,rel:`noopener`,class:`block bg-muted/40 p-3`,title:`In voller Größe öffnen`},[a(`img`,{src:n.plan.image_url,alt:`Speiseplan ${n.label}`,class:`mx-auto w-full max-w-2xl rounded shadow-sm`},null,8,ie)],8,re)):(c(),o(`div`,ae,[a(`div`,null,[e(r(M),{class:`mx-auto size-8 text-muted-foreground`,"stroke-width":1.5}),p[3]||=a(`p`,{class:`mt-2 text-sm text-muted-foreground`},`Für diese Woche liegt noch kein Speiseplan vor.`,-1)])]))]))),128))]),i.allergens?(c(),o(`p`,oe,[a(`a`,{href:i.allergens.url,target:`_blank`,rel:`noopener`,class:`inline-flex items-center gap-1.5 font-medium text-brand-text hover:underline`},[e(r(C),{class:`size-4`}),p[4]||=t(` Allergie-Informationen (PDF)`,-1)],8,se)])):m(``,!0),i.canManage&&i.manage?(c(),f(Y,{key:1,manage:i.manage,allergens:i.allergens},null,8,[`manage`,`allergens`])):m(``,!0)]),_:1}))}};export{ce as default}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-DDPLWCRM.js","assets/app-BNwrc_lv.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-Bv2m9wnk.css"])))=>i.map(i=>d[i]); +import{D as e,E as t,Ht as n,On as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,vn as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as h}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as g,i as _,o as v,s as y}from"./app-BNwrc_lv.js";import{O as b,k as x}from"./dist-DtGNiYlK.js";import{P as S,X as C}from"./AppIcon-nlhvQfK7.js";import{t as w}from"./AppLayout-esQiy2nD.js";import{s as T}from"./http-CAG9BrJF.js";import{t as E}from"./trash-DUqnVIgb.js";import{t as D}from"./upload-M7dd6qr8.js";import{t as O}from"./FormField-BoFAO4pm.js";import{t as k}from"./PageHeader-BMzzCXfT.js";import{n as A}from"./button-CwUSbS9X.js";import{t as j}from"./NativeSelect-G3km7PmI.js";var M=x({name:`utensils-crossed`,size:24,node:[[`path`,{d:`m16 2-2.3 2.3a3 3 0 0 0 0 4.2l1.8 1.8a3 3 0 0 0 4.2 0L22 8`,key:`n7qcjb`}],[`path`,{d:`M15 15 3.3 3.3a4.2 4.2 0 0 0 0 6l7.3 7.3c.7.7 2 .7 2.8 0L15 15Zm0 0 7 7`,key:`d0u48b`}],[`path`,{d:`m2.1 21.8 6.4-6.3`,key:`yn04lh`}],[`path`,{d:`m19 5-7 7`,key:`194lzd`}]],aliases:[`fork-knife-crossed`]});async function N(e,t=1654){let[n,r]=await Promise.all([y(()=>import(`./pdf-DDPLWCRM.js`),__vite__mapDeps([0,1,2,3,4])),y(()=>import(`./pdf.worker.min-D00xlTFB.js`),[])]);n.GlobalWorkerOptions.workerSrc=r.default;let i=await n.getDocument({data:await e.arrayBuffer(),isEvalSupported:!1,enableXfa:!1}).promise;try{let n=await i.getPage(1),r=n.getViewport({scale:t/n.getViewport({scale:1}).width}),a=document.createElement(`canvas`);a.width=Math.round(r.width),a.height=Math.round(r.height);let o=a.getContext(`2d`);o.fillStyle=`#ffffff`,o.fillRect(0,0,a.width,a.height),await n.render({canvasContext:o,viewport:r}).promise;let s=await new Promise(e=>a.toBlob(e,`image/jpeg`,.9));return new File([s],e.name.replace(/\.pdf$/i,``)+`.jpg`,{type:`image/jpeg`})}finally{i.destroy()}}var P={class:`mt-10 rounded-lg border bg-card print:hidden`},F={class:`grid gap-6 p-5 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`},I={class:`grid content-start gap-4`},L=[`disabled`],R={class:`mt-2 text-sm font-medium`},z={class:`flex flex-wrap items-center gap-3 rounded-md bg-muted/50 px-3 py-2.5 text-sm`},B={class:`min-w-0 flex-1 truncate`},V={key:0,class:`grid grid-cols-[repeat(auto-fill,minmax(7rem,1fr))] gap-3`},H=[`href`],U=[`src`,`alt`],W={class:`mt-1 text-xs font-medium`},G={class:`text-[11px] text-muted-foreground`},K=[`aria-label`,`onClick`],q={key:1,class:`text-sm text-muted-foreground`},J={class:`mt-3 text-xs text-muted-foreground`},Y={__name:`ManagePanel`,props:{manage:{type:Object,required:!0},allergens:{type:Object,default:null}},setup(n){let g=n,y=_({week:g.manage.suggested,image:null}),x=p(!1),S=p(!1),w=p(null),k=p(null);async function M(e){if(!e)return;let t=e;if(e.type===`application/pdf`||/\.pdf$/i.test(e.name)){x.value=!0;try{t=await N(e)}catch{T.error(`Das PDF ließ sich nicht umwandeln. Bitte als Bild hochladen.`);return}finally{x.value=!1}}y.image=t,y.post(`/speiseplan/wochen`,{forceFormData:!0,preserveScroll:!0,onError:e=>T.error(Object.values(e)[0]),onSuccess:()=>{y.image=null,y.week=g.manage.suggested}})}function Y(e){e&&v.post(`/speiseplan/allergene`,{file:e},{forceFormData:!0,preserveScroll:!0,onError:e=>T.error(Object.values(e)[0])})}function X(e){window.confirm(`Speiseplan ${e.label} entfernen?`)&&v.delete(`/speiseplan/wochen/${e.id}`,{preserveScroll:!0})}return(p,g)=>(c(),o(`section`,P,[g[11]||=a(`h2`,{class:`border-b px-5 py-3 text-base font-semibold`},`Speiseplan hochladen`,-1),a(`div`,F,[a(`div`,I,[e(O,{id:`sp-week`,label:`Woche`,error:r(y).errors.week},{default:u(()=>[e(j,{id:`sp-week`,modelValue:r(y).week,"onUpdate:modelValue":g[0]||=e=>r(y).week=e,options:n.manage.options},null,8,[`modelValue`,`options`])]),_:1},8,[`error`]),a(`button`,{type:`button`,class:i([`grid place-items-center rounded-lg border-2 border-dashed px-6 py-10 text-center transition-colors`,S.value?`border-brand-400 bg-brand-soft/60`:`hover:border-brand-300`]),disabled:r(y).processing||x.value,onClick:g[1]||=e=>w.value?.click(),onDragover:g[2]||=h(e=>S.value=!0,[`prevent`]),onDragleave:g[3]||=h(e=>S.value=!1,[`prevent`]),onDrop:g[4]||=h(e=>{S.value=!1,M(e.dataTransfer.files[0])},[`prevent`])},[r(y).processing||x.value?(c(),f(r(b),{key:0,class:`size-7 animate-spin text-muted-foreground`})):(c(),f(r(D),{key:1,class:`size-7 text-muted-foreground`})),a(`span`,R,d(x.value?`PDF wird umgewandelt …`:r(y).processing?`Wird hochgeladen …`:`PDF oder Bild hierher ziehen oder klicken`),1),g[9]||=a(`span`,{class:`mt-1 text-xs text-muted-foreground`},`Ein PDF wird automatisch zum Bild (erste Seite, A4). Ist für die Woche schon ein Plan da, wird er ersetzt.`,-1)],42,L),a(`input`,{ref_key:`fileInput`,ref:w,type:`file`,accept:`application/pdf,image/jpeg,image/png,image/webp`,class:`hidden`,onChange:g[5]||=e=>{M(e.target.files[0]),e.target.value=``}},null,544),a(`div`,z,[e(r(C),{class:`size-4 text-muted-foreground`}),a(`span`,B,d(n.allergens?n.allergens.name:`Noch keine Allergie-Informationen hinterlegt`),1),e(r(A),{size:`sm`,variant:`outline`,onClick:g[6]||=e=>k.value?.click()},{default:u(()=>[t(d(n.allergens?`Ersetzen`:`PDF hochladen`),1)]),_:1}),n.allergens?(c(),f(r(A),{key:0,size:`icon`,variant:`ghost`,class:`size-8`,"aria-label":`Allergie-Informationen entfernen`,onClick:g[7]||=e=>r(v).delete(`/speiseplan/allergene`,{preserveScroll:!0})},{default:u(()=>[e(r(E))]),_:1})):m(``,!0),a(`input`,{ref_key:`allergenInput`,ref:k,type:`file`,accept:`application/pdf`,class:`hidden`,onChange:g[8]||=e=>{Y(e.target.files[0]),e.target.value=``}},null,544)])]),a(`div`,null,[g[10]||=a(`p`,{class:`mb-2 text-sm font-medium`},`Hochgeladene Wochen`,-1),n.manage.uploaded.length?(c(),o(`ul`,V,[(c(!0),o(l,null,s(n.manage.uploaded,t=>(c(),o(`li`,{key:t.id,class:`group relative`},[a(`a`,{href:t.image_url,target:`_blank`,class:i([`block overflow-hidden rounded-md border bg-white`,{"opacity-60":t.past}])},[a(`img`,{src:t.image_url,alt:t.label,class:`aspect-[210/297] w-full object-cover object-top`,loading:`lazy`},null,8,U)],10,H),a(`p`,W,`KW `+d(t.week),1),a(`p`,G,d(t.past?`vergangen`:t.label.split(`· `)[1]),1),a(`button`,{type:`button`,class:`absolute top-1 right-1 grid size-7 place-items-center rounded-md bg-card/90 text-destructive opacity-0 shadow-xs ring-1 ring-border group-hover:opacity-100 focus-visible:opacity-100`,"aria-label":`KW ${t.week} entfernen`,onClick:e=>X(t)},[e(r(E),{class:`size-3.5`})],8,K)]))),128))])):(c(),o(`p`,q,`Noch keine Pläne hochgeladen.`)),a(`p`,J,`Vergangene Wochen werden nach `+d(n.manage.keepWeeks)+` Wochen automatisch gelöscht.`,1)])])]))}},X=[`href`],Z=[`href`],Q={class:`grid gap-6 lg:grid-cols-2`},$={class:`flex items-center justify-between gap-3 border-b px-4 py-2.5`},ee={class:`text-sm font-semibold`},te={class:`text-xs text-muted-foreground`},ne=[`href`],re=[`href`],ie=[`src`,`alt`],ae={key:1,class:`grid aspect-[210/297] max-h-[36rem] w-full place-items-center bg-muted/30 text-center`},oe={key:0,class:`mt-6 text-sm`},se=[`href`],ce={__name:`Index`,props:{weeks:{type:Array,required:!0},allergens:{type:Object,default:null},canManage:{type:Boolean,default:!1},manage:{type:Object,default:null}},setup(i){let p=i,h=g();n(()=>h.props.flash.status,e=>e&&T.success(e),{immediate:!0});let _=e=>`/speiseplan/druck${e.length?`?wochen=${e.join(`,`)}`:``}`,v=()=>p.weeks.filter(e=>e.plan).map(e=>e.plan.id);return(n,p)=>(c(),f(w,{title:`Speiseplan`},{default:u(()=>[e(k,{title:`Speiseplan`,description:`Unsere Kantine – diese und nächste Woche.`},{actions:u(()=>[i.allergens?(c(),f(r(A),{key:0,variant:`outline`,"as-child":``},{default:u(()=>[a(`a`,{href:i.allergens.url,target:`_blank`,rel:`noopener`},[e(r(C)),p[0]||=t(` Allergie-Informationen`,-1)],8,X)]),_:1})):m(``,!0),v().length?(c(),f(r(A),{key:1,"as-child":``},{default:u(()=>[a(`a`,{href:_(v()),target:`_blank`,rel:`noopener`},[e(r(S)),p[1]||=t(` Drucken`,-1)],8,Z)]),_:1})):m(``,!0)]),_:1}),a(`div`,Q,[(c(!0),o(l,null,s(i.weeks,n=>(c(),o(`section`,{key:n.week_start,class:`overflow-hidden rounded-lg border bg-card`},[a(`header`,$,[a(`div`,null,[a(`h2`,ee,d(n.title),1),a(`p`,te,d(n.label),1)]),n.plan?(c(),f(r(A),{key:0,size:`sm`,variant:`ghost`,"as-child":``},{default:u(()=>[a(`a`,{href:_([n.plan.id]),target:`_blank`,rel:`noopener`},[e(r(S)),p[2]||=t(` Nur diese Woche`,-1)],8,ne)]),_:2},1024)):m(``,!0)]),n.plan?(c(),o(`a`,{key:0,href:n.plan.image_url,target:`_blank`,rel:`noopener`,class:`block bg-muted/40 p-3`,title:`In voller Größe öffnen`},[a(`img`,{src:n.plan.image_url,alt:`Speiseplan ${n.label}`,class:`mx-auto w-full max-w-2xl rounded shadow-sm`},null,8,ie)],8,re)):(c(),o(`div`,ae,[a(`div`,null,[e(r(M),{class:`mx-auto size-8 text-muted-foreground`,"stroke-width":1.5}),p[3]||=a(`p`,{class:`mt-2 text-sm text-muted-foreground`},`Für diese Woche liegt noch kein Speiseplan vor.`,-1)])]))]))),128))]),i.allergens?(c(),o(`p`,oe,[a(`a`,{href:i.allergens.url,target:`_blank`,rel:`noopener`,class:`inline-flex items-center gap-1.5 font-medium text-brand-text hover:underline`},[e(r(C),{class:`size-4`}),p[4]||=t(` Allergie-Informationen (PDF)`,-1)],8,se)])):m(``,!0),i.canManage&&i.manage?(c(),f(Y,{key:1,manage:i.manage,allergens:i.allergens},null,8,[`manage`,`allergens`])):m(``,!0)]),_:1}))}};export{ce as default}; \ No newline at end of file diff --git a/public/build/assets/Index-DB_ZZ8w1.js b/public/build/assets/Index-vuwnPxDO.js similarity index 85% rename from public/build/assets/Index-DB_ZZ8w1.js rename to public/build/assets/Index-vuwnPxDO.js index 4f0c5997..fdc55460 100644 --- a/public/build/assets/Index-DB_ZZ8w1.js +++ b/public/build/assets/Index-vuwnPxDO.js @@ -1 +1 @@ -import{D as e,On as t,_ as n,b as r,bt as i,mt as a,o,qt as s,tr as c,v as l,y as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as d}from"./app-Bu3kn8yd.js";import{$ as f}from"./AppIcon-0N56IC2z.js";import{t as p}from"./AppLayout-BxsYt2ib.js";import{t as m}from"./chevron-right-C9w5cb2q.js";import{t as h}from"./EmptyState-Ceq4v8mE.js";import{t as g}from"./PageHeader-Ybe7qDu5.js";import{n as _}from"./format-BsuBtvUs.js";var v={key:0,class:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`},y={class:`grid size-10 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-text`},b={class:`min-w-0 flex-1`},x={class:`block font-semibold group-hover:underline`},S={key:0,class:`mt-1 line-clamp-2 block text-sm text-muted-foreground`},C={key:1,class:`mt-2 block text-xs text-muted-foreground`},w={key:1,class:`rounded-lg border bg-card`},T={__name:`Index`,props:{forms:{type:Array,required:!0}},setup(T){return(E,D)=>(a(),l(p,{title:`Formulare`},{default:s(()=>[e(g,{title:`Formulare`,description:`Anträge, Anmeldungen und Meldungen – direkt online ausfüllen.`}),T.forms.length?(a(),r(`div`,v,[(a(!0),r(o,null,i(T.forms,i=>(a(),l(t(d),{key:i.id,href:i.url,class:`group flex gap-4 rounded-lg border bg-card p-5 hover:border-brand-300`},{default:s(()=>[n(`span`,y,[e(t(f),{class:`size-5`})]),n(`span`,b,[n(`span`,x,c(i.title),1),i.description?(a(),r(`span`,S,c(i.description),1)):u(``,!0),i.closes_at?(a(),r(`span`,C,`Bis `+c(t(_)(i.closes_at)),1)):u(``,!0)]),e(t(m),{class:`mt-2.5 size-4 shrink-0 text-muted-foreground`})]),_:2},1032,[`href`]))),128))])):(a(),r(`div`,w,[e(h,{icon:t(f),title:`Keine Formulare`,text:`Derzeit sind keine Formulare für Sie freigegeben.`},null,8,[`icon`])]))]),_:1}))}};export{T as default}; \ No newline at end of file +import{D as e,On as t,_ as n,b as r,bt as i,mt as a,o,qt as s,tr as c,v as l,y as u}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as d}from"./app-BNwrc_lv.js";import{$ as f}from"./AppIcon-nlhvQfK7.js";import{t as p}from"./AppLayout-esQiy2nD.js";import{t as m}from"./chevron-right-C9w5cb2q.js";import{t as h}from"./EmptyState-Ceq4v8mE.js";import{t as g}from"./PageHeader-BMzzCXfT.js";import{n as _}from"./format-BsuBtvUs.js";var v={key:0,class:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`},y={class:`grid size-10 shrink-0 place-items-center rounded-lg bg-brand-soft text-brand-text`},b={class:`min-w-0 flex-1`},x={class:`block font-semibold group-hover:underline`},S={key:0,class:`mt-1 line-clamp-2 block text-sm text-muted-foreground`},C={key:1,class:`mt-2 block text-xs text-muted-foreground`},w={key:1,class:`rounded-lg border bg-card`},T={__name:`Index`,props:{forms:{type:Array,required:!0}},setup(T){return(E,D)=>(a(),l(p,{title:`Formulare`},{default:s(()=>[e(g,{title:`Formulare`,description:`Anträge, Anmeldungen und Meldungen – direkt online ausfüllen.`}),T.forms.length?(a(),r(`div`,v,[(a(!0),r(o,null,i(T.forms,i=>(a(),l(t(d),{key:i.id,href:i.url,class:`group flex gap-4 rounded-lg border bg-card p-5 hover:border-brand-300`},{default:s(()=>[n(`span`,y,[e(t(f),{class:`size-5`})]),n(`span`,b,[n(`span`,x,c(i.title),1),i.description?(a(),r(`span`,S,c(i.description),1)):u(``,!0),i.closes_at?(a(),r(`span`,C,`Bis `+c(t(_)(i.closes_at)),1)):u(``,!0)]),e(t(m),{class:`mt-2.5 size-4 shrink-0 text-muted-foreground`})]),_:2},1032,[`href`]))),128))])):(a(),r(`div`,w,[e(h,{icon:t(f),title:`Keine Formulare`,text:`Derzeit sind keine Formulare für Sie freigegeben.`},null,8,[`icon`])]))]),_:1}))}};export{T as default}; \ No newline at end of file diff --git a/public/build/assets/Latest-BSAp6xac.js b/public/build/assets/Latest-BLQzvFw2.js similarity index 82% rename from public/build/assets/Latest-BSAp6xac.js rename to public/build/assets/Latest-BLQzvFw2.js index 98346c63..b52a68f0 100644 --- a/public/build/assets/Latest-BSAp6xac.js +++ b/public/build/assets/Latest-BLQzvFw2.js @@ -1 +1 @@ -import{On as e,Zn as t,b as n,bt as r,mt as i,o as a,qt as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{F as l}from"./AppIcon-0N56IC2z.js";import{t as u}from"./EmptyState-Ceq4v8mE.js";import{t as d}from"./Panel-BASB8Xb9.js";import{t as f}from"./NewsListItem-rvZKO5MT.js";var p={key:0,href:`/admin/neuigkeiten/neu`,class:`mt-4 text-sm font-medium text-brand-text hover:underline`},m={__name:`Latest`,props:{posts:{type:Array,required:!0},canWrite:{type:Boolean,default:!1},wide:{type:Boolean,default:!1}},setup(m){return(h,g)=>(i(),s(d,{title:`Neuigkeiten`,"action-label":`Alle anzeigen`,"action-href":`/neuigkeiten`},{default:o(()=>[m.posts.length?(i(),n(`div`,{key:0,class:t([`-my-3 divide-y`,{"sm:grid sm:grid-cols-2 sm:gap-x-6 sm:divide-y-0":m.wide}])},[(i(!0),n(a,null,r(m.posts,e=>(i(),s(f,{key:e.id,post:e},null,8,[`post`]))),128))],2)):(i(),s(u,{key:1,icon:e(l),title:`Noch keine Neuigkeiten`,text:`Sobald Beiträge veröffentlicht sind, erscheinen sie hier.`},{default:o(()=>[m.canWrite?(i(),n(`a`,p,`Ersten Beitrag schreiben`)):c(``,!0)]),_:1},8,[`icon`]))]),_:1}))}};export{m as default}; \ No newline at end of file +import{On as e,Zn as t,b as n,bt as r,mt as i,o as a,qt as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{F as l}from"./AppIcon-nlhvQfK7.js";import{t as u}from"./EmptyState-Ceq4v8mE.js";import{t as d}from"./Panel-Dr-NcUuS.js";import{t as f}from"./NewsListItem-DKC4VK9G.js";var p={key:0,href:`/admin/neuigkeiten/neu`,class:`mt-4 text-sm font-medium text-brand-text hover:underline`},m={__name:`Latest`,props:{posts:{type:Array,required:!0},canWrite:{type:Boolean,default:!1},wide:{type:Boolean,default:!1}},setup(m){return(h,g)=>(i(),s(d,{title:`Neuigkeiten`,"action-label":`Alle anzeigen`,"action-href":`/neuigkeiten`},{default:o(()=>[m.posts.length?(i(),n(`div`,{key:0,class:t([`-my-3 divide-y`,{"sm:grid sm:grid-cols-2 sm:gap-x-6 sm:divide-y-0":m.wide}])},[(i(!0),n(a,null,r(m.posts,e=>(i(),s(f,{key:e.id,post:e},null,8,[`post`]))),128))],2)):(i(),s(u,{key:1,icon:e(l),title:`Noch keine Neuigkeiten`,text:`Sobald Beiträge veröffentlicht sind, erscheinen sie hier.`},{default:o(()=>[m.canWrite?(i(),n(`a`,p,`Ersten Beitrag schreiben`)):c(``,!0)]),_:1},8,[`icon`]))]),_:1}))}};export{m as default}; \ No newline at end of file diff --git a/public/build/assets/LatestNews-DjjPja1-.js b/public/build/assets/LatestNews-CD2sRcmN.js similarity index 90% rename from public/build/assets/LatestNews-DjjPja1-.js rename to public/build/assets/LatestNews-CD2sRcmN.js index 37c4c40a..65e825b9 100644 --- a/public/build/assets/LatestNews-DjjPja1-.js +++ b/public/build/assets/LatestNews-CD2sRcmN.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./app-Bu3kn8yd.js";import{t as p}from"./chevron-right-C9w5cb2q.js";import{t as m}from"./NewsCard-DpbfyO9M.js";import{t as h}from"./NewsListItem-rvZKO5MT.js";var g={key:0,class:`mb-3 flex items-center justify-between gap-4`},_={class:`text-lg font-semibold`},v={key:1,class:`divide-y rounded-lg border bg-card px-4`},y={key:2,class:`grid gap-5 @xl:grid-cols-2 @4xl:grid-cols-3`},b={key:3,class:`text-sm text-muted-foreground`},x={__name:`LatestNews`,props:{block:{type:Object,required:!0}},setup(x){return(S,C)=>(o(),i(`section`,null,[x.block.data.title?(o(),i(`div`,g,[r(`h3`,_,l(x.block.data.title),1),x.block.props?.more_url?(o(),u(n(f),{key:0,href:x.block.props.more_url,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:c(()=>[C[0]||=t(` Alle anzeigen `,-1),e(n(p),{class:`size-3.5`})]),_:1},8,[`href`])):d(``,!0)])):d(``,!0),x.block.data.layout===`list`?(o(),i(`div`,v,[(o(!0),i(s,null,a(x.block.props?.posts??[],e=>(o(),u(h,{key:e.id,post:e},null,8,[`post`]))),128))])):(o(),i(`div`,y,[(o(!0),i(s,null,a(x.block.props?.posts??[],e=>(o(),u(m,{key:e.id,post:e},null,8,[`post`]))),128))])),(x.block.props?.posts??[]).length?d(``,!0):(o(),i(`p`,b,`Keine Beiträge.`))]))}};export{x as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./app-BNwrc_lv.js";import{t as p}from"./chevron-right-C9w5cb2q.js";import{t as m}from"./NewsCard-Cxl6vjIa.js";import{t as h}from"./NewsListItem-DKC4VK9G.js";var g={key:0,class:`mb-3 flex items-center justify-between gap-4`},_={class:`text-lg font-semibold`},v={key:1,class:`divide-y rounded-lg border bg-card px-4`},y={key:2,class:`grid gap-5 @xl:grid-cols-2 @4xl:grid-cols-3`},b={key:3,class:`text-sm text-muted-foreground`},x={__name:`LatestNews`,props:{block:{type:Object,required:!0}},setup(x){return(S,C)=>(o(),i(`section`,null,[x.block.data.title?(o(),i(`div`,g,[r(`h3`,_,l(x.block.data.title),1),x.block.props?.more_url?(o(),u(n(f),{key:0,href:x.block.props.more_url,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:c(()=>[C[0]||=t(` Alle anzeigen `,-1),e(n(p),{class:`size-3.5`})]),_:1},8,[`href`])):d(``,!0)])):d(``,!0),x.block.data.layout===`list`?(o(),i(`div`,v,[(o(!0),i(s,null,a(x.block.props?.posts??[],e=>(o(),u(h,{key:e.id,post:e},null,8,[`post`]))),128))])):(o(),i(`div`,y,[(o(!0),i(s,null,a(x.block.props?.posts??[],e=>(o(),u(m,{key:e.id,post:e},null,8,[`post`]))),128))])),(x.block.props?.posts??[]).length?d(``,!0):(o(),i(`p`,b,`Keine Beiträge.`))]))}};export{x as default}; \ No newline at end of file diff --git a/public/build/assets/Loans-Dl8zdae9.js b/public/build/assets/Loans-DRzgaqxB.js similarity index 80% rename from public/build/assets/Loans-Dl8zdae9.js rename to public/build/assets/Loans-DRzgaqxB.js index 3cd396a3..097565db 100644 --- a/public/build/assets/Loans-Dl8zdae9.js +++ b/public/build/assets/Loans-DRzgaqxB.js @@ -1 +1 @@ -import{D as e,E as t,Ht as n,On as r,T as i,Zn as a,_ as o,b as s,bt as c,g as l,mt as u,o as d,qt as f,tr as p,v as m,vn as h,y as g}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as _}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as v,o as y,r as b}from"./app-Bu3kn8yd.js";import{O as x,k as S}from"./dist-DtGNiYlK.js";import{t as C}from"./arrow-left-BMImfTf2.js";import{t as w}from"./AppLayout-BxsYt2ib.js";import{t as T}from"./calendar-clock-8H2IkjP5.js";import{t as E}from"./http-DmyDwIce.js";import{t as D}from"./chevron-left-8GGLVOvJ.js";import{t as O}from"./chevron-right-C9w5cb2q.js";import{t as k}from"./circle-alert-D8SqHL0j.js";import{t as A}from"./send-6fmdiUe6.js";import{t as j}from"./DialogDescription-BxaIqmag.js";import{t as M}from"./FormField-BoFAO4pm.js";import{t as N}from"./EmptyState-Ceq4v8mE.js";import{t as P}from"./PageHeader-Ybe7qDu5.js";import{t as F}from"./button-ZHC5mKey.js";import{t as I}from"./NativeSelect-BGasRaNs.js";import{t as L}from"./Input-FGSb2-yK.js";import{t as R}from"./Textarea-DEFXqC2w.js";import{i as ee,n as te,r as z,t as B}from"./dialog-uBUhf8w7.js";import{t as V}from"./DialogHeader-DuqiL3ry.js";import{t as H}from"./status-p0CPKwc2.js";var U=S({name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]}),W={class:`mb-2 flex items-center justify-between`},G={class:`grid gap-4 sm:grid-cols-2`},K={class:`mb-1.5 text-center text-sm font-medium`},q={class:`grid grid-cols-7 gap-0.5 text-center text-xs`},J=[`disabled`,`title`,`onClick`],Y={__name:`RangeCalendar`,props:{slots:{type:Array,default:()=>[]},start:{type:String,default:``},end:{type:String,default:``},maxDays:{type:Number,default:180}},emits:[`update:start`,`update:end`],setup(t,{emit:n}){let f=t,m=n,g=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,_=g(new Date),v=h(new Date(new Date().getFullYear(),new Date().getMonth(),1)),y=l(()=>{let e=new Set;for(let t of f.slots){let n=new Date(`${t.start}T12:00:00`),r=new Date(`${t.end||t.start}T12:00:00`);for(let t=0;n<=r&&t<400;t++)e.add(g(n)),n.setDate(n.getDate()+1)}return e}),b=new Intl.DateTimeFormat(`de-DE`,{month:`long`,year:`numeric`}),x=l(()=>[0,1].map(e=>{let t=new Date(v.value.getFullYear(),v.value.getMonth()+e,1),n=[],r=(t.getDay()+6)%7;for(let e=0;e=e&&n<=t)return!1;return!0}function C(e){!e||e<_||y.value.has(e)||(!f.start||f.end||ef.start&&e(u(),s(`div`,null,[o(`div`,W,[o(`button`,{type:`button`,class:`grid size-8 place-items-center rounded-md hover:bg-accent`,"aria-label":`Früher`,onClick:n[0]||=e=>E(-1)},[e(r(D),{class:`size-4`})]),n[2]||=o(`span`,{class:`text-xs text-muted-foreground`},`Beginn und Ende anklicken`,-1),o(`button`,{type:`button`,class:`grid size-8 place-items-center rounded-md hover:bg-accent`,"aria-label":`Später`,onClick:n[1]||=e=>E(1)},[e(r(O),{class:`size-4`})])]),o(`div`,G,[(u(!0),s(d,null,c(x.value,e=>(u(),s(`div`,{key:e.label},[o(`p`,K,p(e.label),1),o(`div`,q,[(u(),s(d,null,c([`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`,`So`],e=>o(`span`,{key:e,class:`py-1 text-muted-foreground`},p(e),1)),64)),(u(!0),s(d,null,c(e.days,(e,t)=>(u(),s(`button`,{key:e??`e${t}`,type:`button`,class:a([`aspect-square rounded-md tabular-nums transition-colors`,T[w(e)]]),disabled:!e||w(e)===`booked`||w(e)===`past`,title:w(e)===`booked`?`Belegt`:void 0,onClick:t=>C(e)},p(e?Number(e.slice(8)):``),11,J))),128))])]))),128))]),n[3]||=i(`

belegt Ihr Zeitraum

`,1)]))}},X={class:`mb-6 grid gap-3 rounded-lg border bg-card p-4 sm:grid-cols-3`},Z={key:0,class:`flex items-center gap-2 rounded-lg border bg-card p-4 text-sm text-destructive`},ne={key:1,class:`rounded-lg border bg-card`},re={key:2,class:`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`},ie={class:`flex items-start gap-3`},ae={class:`grid size-10 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},oe={class:`min-w-0 flex-1`},se={class:`font-medium leading-tight`},Q={key:0,class:`text-xs text-muted-foreground`},ce={key:0,class:`mt-3 line-clamp-3 text-[13px] text-muted-foreground`},le={key:0,class:`grid h-64 place-items-center text-sm text-muted-foreground`},ue={key:0,class:`text-xs text-muted-foreground`},de={class:`grid gap-3 sm:grid-cols-2`},fe={key:0,class:`mr-auto self-center text-[13px] text-muted-foreground`},$={__name:`Loans`,props:{filters:{type:Object,required:!0},types:{type:Object,required:!0},devices:{type:Object,required:!0}},setup(i){let S=i,D=h({typ:S.filters.type??``,von:S.filters.from??``,bis:S.filters.to??``}),O=l(()=>S.types.ok?S.types.data.map(e=>({value:e,label:e})):[]);n(D,e=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e));y.get(`/it-service/leihgeraete`,t,{preserveState:!0,preserveScroll:!0,replace:!0})},{deep:!0});let W=h(null),G=h([]),K=h(null),q=h(!1),J=v({device_id:null,planned_start:``,planned_end:``,purpose:``});async function $(e){W.value=e,J.reset(),J.clearErrors(),J.device_id=e.id,J.planned_start=S.filters.from??``,J.planned_end=S.filters.to??``,G.value=[],K.value=null,q.value=!0;try{G.value=(await E.get(`/it-service/leihgeraete/${e.id}/belegung`)).slots}catch(e){K.value=e.message}finally{q.value=!1}}function pe(){J.post(`/it-service/leihgeraete/anfragen`,{onSuccess:()=>W.value=null})}return(n,l)=>(u(),m(w,{title:`Leihgeräte`},{default:f(()=>[e(r(b),{href:`/it-service`,class:`mb-3 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:f(()=>[e(r(C),{class:`size-4`}),l[10]||=t(` Meine IT`,-1)]),_:1}),e(P,{title:`Leihgeräte`,description:`Laptops, Beamer, Kameras & Co. für einen bestimmten Zeitraum ausleihen.`}),o(`div`,X,[e(M,{id:`type`,label:`Gerätetyp`},{default:f(()=>[e(I,{id:`type`,modelValue:D.value.typ,"onUpdate:modelValue":l[0]||=e=>D.value.typ=e,options:O.value,placeholder:`Alle Typen`},null,8,[`modelValue`,`options`])]),_:1}),e(M,{id:`from`,label:`Benötigt ab`},{default:f(()=>[e(r(L),{id:`from`,modelValue:D.value.von,"onUpdate:modelValue":l[1]||=e=>D.value.von=e,type:`date`},null,8,[`modelValue`])]),_:1}),e(M,{id:`to`,label:`Benötigt bis`},{default:f(()=>[e(r(L),{id:`to`,modelValue:D.value.bis,"onUpdate:modelValue":l[2]||=e=>D.value.bis=e,type:`date`,min:D.value.von||void 0},null,8,[`modelValue`,`min`])]),_:1})]),i.devices.ok?i.devices.data.length?(u(),s(`div`,re,[(u(!0),s(d,null,c(i.devices.data,n=>(u(),s(`article`,{key:n.id,class:`flex flex-col rounded-lg border bg-card p-4`},[o(`div`,ie,[o(`span`,ae,[e(r(U),{class:`size-5`})]),o(`div`,oe,[o(`h2`,se,p(n.title),1),n.type?(u(),s(`p`,Q,p(n.type),1)):g(``,!0)]),o(`span`,{class:a([`rounded-full px-2 py-0.5 text-[11px] font-semibold`,n.available?`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`:`bg-muted text-muted-foreground`])},p(n.available?`verfügbar`:`belegt`),3)]),n.description?(u(),s(`p`,ce,p(n.description),1)):g(``,!0),e(r(F),{class:`mt-4`,variant:`outline`,onClick:e=>$(n)},{default:f(()=>[e(r(T)),l[11]||=t(` Zeitraum wählen`,-1)]),_:1},8,[`onClick`])]))),128))])):(u(),s(`div`,ne,[e(N,{icon:r(U),title:`Keine passenden Leihgeräte`,text:`Anderen Zeitraum oder Gerätetyp versuchen.`},null,8,[`icon`])])):(u(),s(`p`,Z,[e(r(k),{class:`size-4`}),t(` `+p(i.devices.error),1)])),e(r(ee),{open:!!W.value,"onUpdate:open":l[9]||=e=>!e&&(W.value=null)},{default:f(()=>[e(r(z),{class:`sm:max-w-2xl`},{default:f(()=>[e(r(V),null,{default:f(()=>[e(r(B),null,{default:f(()=>[t(p(W.value?.title)+` ausleihen`,1)]),_:1}),e(r(j),null,{default:f(()=>[...l[12]||=[t(`Die IT bestätigt die Anfrage bzw. organisiert die Übergabe.`,-1)]]),_:1})]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:_(pe,[`prevent`])},[q.value?(u(),s(`div`,le,[e(r(x),{class:`size-5 animate-spin`})])):(u(),s(d,{key:1},[K.value?(u(),s(`p`,ue,`Belegung konnte nicht geladen werden – bitte Zeitraum trotzdem wählen.`)):g(``,!0),e(Y,{start:r(J).planned_start,"onUpdate:start":l[3]||=e=>r(J).planned_start=e,end:r(J).planned_end,"onUpdate:end":l[4]||=e=>r(J).planned_end=e,slots:G.value},null,8,[`start`,`end`,`slots`])],64)),o(`div`,de,[e(M,{id:`start`,label:`Von`,error:r(J).errors.planned_start},{default:f(()=>[e(r(L),{id:`start`,modelValue:r(J).planned_start,"onUpdate:modelValue":l[5]||=e=>r(J).planned_start=e,type:`date`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),e(M,{id:`end`,label:`Bis`,error:r(J).errors.planned_end},{default:f(()=>[e(r(L),{id:`end`,modelValue:r(J).planned_end,"onUpdate:modelValue":l[6]||=e=>r(J).planned_end=e,type:`date`,min:r(J).planned_start||void 0,required:``},null,8,[`modelValue`,`min`])]),_:1},8,[`error`])]),e(M,{id:`purpose`,label:`Wofür? (optional)`,error:r(J).errors.purpose},{default:f(()=>[e(r(R),{id:`purpose`,modelValue:r(J).purpose,"onUpdate:modelValue":l[7]||=e=>r(J).purpose=e,rows:`2`,maxlength:`500`,placeholder:`z. B. Präsentation beim Fachtag`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(r(te),null,{default:f(()=>[r(J).planned_start&&r(J).planned_end?(u(),s(`p`,fe,p(r(H)(r(J).planned_start))+` – `+p(r(H)(r(J).planned_end)),1)):g(``,!0),e(r(F),{type:`button`,variant:`outline`,onClick:l[8]||=e=>W.value=null},{default:f(()=>[...l[13]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(F),{type:`submit`,disabled:r(J).processing||!r(J).planned_start||!r(J).planned_end},{default:f(()=>[r(J).processing?(u(),m(r(x),{key:0,class:`animate-spin`})):(u(),m(r(A),{key:1})),l[14]||=t(` Anfragen `,-1)]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`])]),_:1}))}};export{$ as default}; \ No newline at end of file +import{D as e,E as t,Ht as n,On as r,T as i,Zn as a,_ as o,b as s,bt as c,g as l,mt as u,o as d,qt as f,tr as p,v as m,vn as h,y as g}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as _}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as v,o as y,r as b}from"./app-BNwrc_lv.js";import{O as x,k as S}from"./dist-DtGNiYlK.js";import{t as C}from"./arrow-left-BMImfTf2.js";import{t as w}from"./AppLayout-esQiy2nD.js";import{t as T}from"./calendar-clock-8H2IkjP5.js";import{n as E}from"./http-CAG9BrJF.js";import{t as D}from"./chevron-left-8GGLVOvJ.js";import{t as O}from"./chevron-right-C9w5cb2q.js";import{t as k}from"./circle-alert-D8SqHL0j.js";import{t as A}from"./send-6fmdiUe6.js";import{t as j}from"./FormField-BoFAO4pm.js";import{t as M}from"./EmptyState-Ceq4v8mE.js";import{t as N}from"./PageHeader-BMzzCXfT.js";import{n as P}from"./button-CwUSbS9X.js";import{t as F}from"./NativeSelect-G3km7PmI.js";import{t as I}from"./Input-FGSb2-yK.js";import{t as L}from"./Textarea-DEFXqC2w.js";import{i as R,n as ee,r as te,t as z}from"./dialog-RK2mTeqi.js";import{t as B}from"./DialogDescription-CaB-9xpp.js";import{t as V}from"./DialogHeader-DuqiL3ry.js";import{t as H}from"./status-p0CPKwc2.js";var U=S({name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]}),W={class:`mb-2 flex items-center justify-between`},G={class:`grid gap-4 sm:grid-cols-2`},K={class:`mb-1.5 text-center text-sm font-medium`},q={class:`grid grid-cols-7 gap-0.5 text-center text-xs`},J=[`disabled`,`title`,`onClick`],Y={__name:`RangeCalendar`,props:{slots:{type:Array,default:()=>[]},start:{type:String,default:``},end:{type:String,default:``},maxDays:{type:Number,default:180}},emits:[`update:start`,`update:end`],setup(t,{emit:n}){let f=t,m=n,g=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,_=g(new Date),v=h(new Date(new Date().getFullYear(),new Date().getMonth(),1)),y=l(()=>{let e=new Set;for(let t of f.slots){let n=new Date(`${t.start}T12:00:00`),r=new Date(`${t.end||t.start}T12:00:00`);for(let t=0;n<=r&&t<400;t++)e.add(g(n)),n.setDate(n.getDate()+1)}return e}),b=new Intl.DateTimeFormat(`de-DE`,{month:`long`,year:`numeric`}),x=l(()=>[0,1].map(e=>{let t=new Date(v.value.getFullYear(),v.value.getMonth()+e,1),n=[],r=(t.getDay()+6)%7;for(let e=0;e=e&&n<=t)return!1;return!0}function C(e){!e||e<_||y.value.has(e)||(!f.start||f.end||ef.start&&e(u(),s(`div`,null,[o(`div`,W,[o(`button`,{type:`button`,class:`grid size-8 place-items-center rounded-md hover:bg-accent`,"aria-label":`Früher`,onClick:n[0]||=e=>E(-1)},[e(r(D),{class:`size-4`})]),n[2]||=o(`span`,{class:`text-xs text-muted-foreground`},`Beginn und Ende anklicken`,-1),o(`button`,{type:`button`,class:`grid size-8 place-items-center rounded-md hover:bg-accent`,"aria-label":`Später`,onClick:n[1]||=e=>E(1)},[e(r(O),{class:`size-4`})])]),o(`div`,G,[(u(!0),s(d,null,c(x.value,e=>(u(),s(`div`,{key:e.label},[o(`p`,K,p(e.label),1),o(`div`,q,[(u(),s(d,null,c([`Mo`,`Di`,`Mi`,`Do`,`Fr`,`Sa`,`So`],e=>o(`span`,{key:e,class:`py-1 text-muted-foreground`},p(e),1)),64)),(u(!0),s(d,null,c(e.days,(e,t)=>(u(),s(`button`,{key:e??`e${t}`,type:`button`,class:a([`aspect-square rounded-md tabular-nums transition-colors`,T[w(e)]]),disabled:!e||w(e)===`booked`||w(e)===`past`,title:w(e)===`booked`?`Belegt`:void 0,onClick:t=>C(e)},p(e?Number(e.slice(8)):``),11,J))),128))])]))),128))]),n[3]||=i(`

belegt Ihr Zeitraum

`,1)]))}},X={class:`mb-6 grid gap-3 rounded-lg border bg-card p-4 sm:grid-cols-3`},Z={key:0,class:`flex items-center gap-2 rounded-lg border bg-card p-4 text-sm text-destructive`},ne={key:1,class:`rounded-lg border bg-card`},re={key:2,class:`grid gap-4 sm:grid-cols-2 xl:grid-cols-3`},ie={class:`flex items-start gap-3`},ae={class:`grid size-10 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},oe={class:`min-w-0 flex-1`},se={class:`font-medium leading-tight`},Q={key:0,class:`text-xs text-muted-foreground`},ce={key:0,class:`mt-3 line-clamp-3 text-[13px] text-muted-foreground`},le={key:0,class:`grid h-64 place-items-center text-sm text-muted-foreground`},ue={key:0,class:`text-xs text-muted-foreground`},de={class:`grid gap-3 sm:grid-cols-2`},fe={key:0,class:`mr-auto self-center text-[13px] text-muted-foreground`},$={__name:`Loans`,props:{filters:{type:Object,required:!0},types:{type:Object,required:!0},devices:{type:Object,required:!0}},setup(i){let S=i,D=h({typ:S.filters.type??``,von:S.filters.from??``,bis:S.filters.to??``}),O=l(()=>S.types.ok?S.types.data.map(e=>({value:e,label:e})):[]);n(D,e=>{let t=Object.fromEntries(Object.entries(e).filter(([,e])=>e));y.get(`/it-service/leihgeraete`,t,{preserveState:!0,preserveScroll:!0,replace:!0})},{deep:!0});let W=h(null),G=h([]),K=h(null),q=h(!1),J=v({device_id:null,planned_start:``,planned_end:``,purpose:``});async function $(e){W.value=e,J.reset(),J.clearErrors(),J.device_id=e.id,J.planned_start=S.filters.from??``,J.planned_end=S.filters.to??``,G.value=[],K.value=null,q.value=!0;try{G.value=(await E.get(`/it-service/leihgeraete/${e.id}/belegung`)).slots}catch(e){K.value=e.message}finally{q.value=!1}}function pe(){J.post(`/it-service/leihgeraete/anfragen`,{onSuccess:()=>W.value=null})}return(n,l)=>(u(),m(w,{title:`Leihgeräte`},{default:f(()=>[e(r(b),{href:`/it-service`,class:`mb-3 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:f(()=>[e(r(C),{class:`size-4`}),l[10]||=t(` Meine IT`,-1)]),_:1}),e(N,{title:`Leihgeräte`,description:`Laptops, Beamer, Kameras & Co. für einen bestimmten Zeitraum ausleihen.`}),o(`div`,X,[e(j,{id:`type`,label:`Gerätetyp`},{default:f(()=>[e(F,{id:`type`,modelValue:D.value.typ,"onUpdate:modelValue":l[0]||=e=>D.value.typ=e,options:O.value,placeholder:`Alle Typen`},null,8,[`modelValue`,`options`])]),_:1}),e(j,{id:`from`,label:`Benötigt ab`},{default:f(()=>[e(r(I),{id:`from`,modelValue:D.value.von,"onUpdate:modelValue":l[1]||=e=>D.value.von=e,type:`date`},null,8,[`modelValue`])]),_:1}),e(j,{id:`to`,label:`Benötigt bis`},{default:f(()=>[e(r(I),{id:`to`,modelValue:D.value.bis,"onUpdate:modelValue":l[2]||=e=>D.value.bis=e,type:`date`,min:D.value.von||void 0},null,8,[`modelValue`,`min`])]),_:1})]),i.devices.ok?i.devices.data.length?(u(),s(`div`,re,[(u(!0),s(d,null,c(i.devices.data,n=>(u(),s(`article`,{key:n.id,class:`flex flex-col rounded-lg border bg-card p-4`},[o(`div`,ie,[o(`span`,ae,[e(r(U),{class:`size-5`})]),o(`div`,oe,[o(`h2`,se,p(n.title),1),n.type?(u(),s(`p`,Q,p(n.type),1)):g(``,!0)]),o(`span`,{class:a([`rounded-full px-2 py-0.5 text-[11px] font-semibold`,n.available?`bg-emerald-100 text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`:`bg-muted text-muted-foreground`])},p(n.available?`verfügbar`:`belegt`),3)]),n.description?(u(),s(`p`,ce,p(n.description),1)):g(``,!0),e(r(P),{class:`mt-4`,variant:`outline`,onClick:e=>$(n)},{default:f(()=>[e(r(T)),l[11]||=t(` Zeitraum wählen`,-1)]),_:1},8,[`onClick`])]))),128))])):(u(),s(`div`,ne,[e(M,{icon:r(U),title:`Keine passenden Leihgeräte`,text:`Anderen Zeitraum oder Gerätetyp versuchen.`},null,8,[`icon`])])):(u(),s(`p`,Z,[e(r(k),{class:`size-4`}),t(` `+p(i.devices.error),1)])),e(r(R),{open:!!W.value,"onUpdate:open":l[9]||=e=>!e&&(W.value=null)},{default:f(()=>[e(r(te),{class:`sm:max-w-2xl`},{default:f(()=>[e(r(V),null,{default:f(()=>[e(r(z),null,{default:f(()=>[t(p(W.value?.title)+` ausleihen`,1)]),_:1}),e(r(B),null,{default:f(()=>[...l[12]||=[t(`Die IT bestätigt die Anfrage bzw. organisiert die Übergabe.`,-1)]]),_:1})]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:_(pe,[`prevent`])},[q.value?(u(),s(`div`,le,[e(r(x),{class:`size-5 animate-spin`})])):(u(),s(d,{key:1},[K.value?(u(),s(`p`,ue,`Belegung konnte nicht geladen werden – bitte Zeitraum trotzdem wählen.`)):g(``,!0),e(Y,{start:r(J).planned_start,"onUpdate:start":l[3]||=e=>r(J).planned_start=e,end:r(J).planned_end,"onUpdate:end":l[4]||=e=>r(J).planned_end=e,slots:G.value},null,8,[`start`,`end`,`slots`])],64)),o(`div`,de,[e(j,{id:`start`,label:`Von`,error:r(J).errors.planned_start},{default:f(()=>[e(r(I),{id:`start`,modelValue:r(J).planned_start,"onUpdate:modelValue":l[5]||=e=>r(J).planned_start=e,type:`date`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),e(j,{id:`end`,label:`Bis`,error:r(J).errors.planned_end},{default:f(()=>[e(r(I),{id:`end`,modelValue:r(J).planned_end,"onUpdate:modelValue":l[6]||=e=>r(J).planned_end=e,type:`date`,min:r(J).planned_start||void 0,required:``},null,8,[`modelValue`,`min`])]),_:1},8,[`error`])]),e(j,{id:`purpose`,label:`Wofür? (optional)`,error:r(J).errors.purpose},{default:f(()=>[e(r(L),{id:`purpose`,modelValue:r(J).purpose,"onUpdate:modelValue":l[7]||=e=>r(J).purpose=e,rows:`2`,maxlength:`500`,placeholder:`z. B. Präsentation beim Fachtag`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(r(ee),null,{default:f(()=>[r(J).planned_start&&r(J).planned_end?(u(),s(`p`,fe,p(r(H)(r(J).planned_start))+` – `+p(r(H)(r(J).planned_end)),1)):g(``,!0),e(r(P),{type:`button`,variant:`outline`,onClick:l[8]||=e=>W.value=null},{default:f(()=>[...l[13]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(P),{type:`submit`,disabled:r(J).processing||!r(J).planned_start||!r(J).planned_end},{default:f(()=>[r(J).processing?(u(),m(r(x),{key:0,class:`animate-spin`})):(u(),m(r(A),{key:1})),l[14]||=t(` Anfragen `,-1)]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`])]),_:1}))}};export{$ as default}; \ No newline at end of file diff --git a/public/build/assets/Login-HwVm9O9q.js b/public/build/assets/Login-LD01sd0o.js similarity index 96% rename from public/build/assets/Login-HwVm9O9q.js rename to public/build/assets/Login-LD01sd0o.js index 62dcfec0..53d451e1 100644 --- a/public/build/assets/Login-HwVm9O9q.js +++ b/public/build/assets/Login-LD01sd0o.js @@ -1 +1 @@ -import{d as e,i as t,l as n,n as r}from"./usePrimitiveElement-DC7UloPZ.js";import{$n as i,D as a,E as o,Nt as s,On as c,_ as l,b as u,bt as d,et as f,g as p,k as m,mt as h,o as g,qt as _,tr as v,v as y,vn as b,wt as x,xt as S,y as C,z as w}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as T,w as E}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as D,r as O}from"./app-Bu3kn8yd.js";import{O as k,b as A,d as j,l as M,p as N,s as P}from"./dist-DtGNiYlK.js";import{c as F,l as ee,s as te}from"./RovingFocusGroup-D88K7krN.js";import{t as I}from"./check-AfxJa8Ew.js";import{t as L}from"./eye-off-myis3scV.js";import{t as R}from"./eye-CFNQcvaV.js";import{n as z,t as B}from"./isValueEqualOrExist-BmxVVt-T.js";import{n as V,r as H,t as U}from"./VisuallyHiddenInput-BMUp3blB.js";import{t as W}from"./RovingFocusItem-BqPEtysU.js";import{n as G,t as K}from"./FormField-BoFAO4pm.js";import{t as q}from"./button-ZHC5mKey.js";import{t as J}from"./Input-FGSb2-yK.js";import{t as Y}from"./GuestLayout-CAwpgUCY.js";var[X,ne]=e(`CheckboxGroupRoot`);function Z(e){return e===`indeterminate`}function Q(e){return Z(e)?`indeterminate`:e?`checked`:`unchecked`}var[re,ie]=e(`CheckboxRoot`),ae=m({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let r=e,i=t,{forwardRef:a,currentElement:o}=N(),l=X(null),d=A(r,`modelValue`,i,{defaultValue:r.defaultValue??r.falseValue,passive:r.modelValue===void 0}),m=p(()=>l?.disabled.value||r.disabled),v=p(()=>z(d.value,r.trueValue)),b=p(()=>n(l?.modelValue.value)?d.value===`indeterminate`?`indeterminate`:v.value:B(l.modelValue.value,r.value));function w(){if(n(l?.modelValue.value))d.value===`indeterminate`?d.value=r.trueValue:d.value=v.value?r.falseValue:r.trueValue;else{let e=[...l.modelValue.value||[]];if(B(e,r.value)){let t=e.findIndex(e=>z(e,r.value));e.splice(t,1)}else e.push(r.value);l.modelValue.value=e}}let D=H(o),O=V(),k=s(),M=p(()=>{if(!k[`aria-label`])return r.id&&o.value?document.querySelector(`[for="${r.id}"]`)?.innerText:void 0});return ie({disabled:m,state:b}),(e,t)=>(h(),u(g,null,[(h(),y(x(c(l)?.rovingFocus.value?c(W):c(j)),f({...e.$attrs,...c(O)},{id:e.id,ref:c(a),role:`checkbox`,"as-child":e.asChild,as:e.as,type:e.as===`button`?`button`:void 0,"aria-checked":c(Z)(b.value)?`mixed`:b.value,"aria-required":e.required,"aria-label":e.$attrs[`aria-label`]||M.value,"data-state":c(Q)(b.value),"data-disabled":m.value?``:void 0,disabled:m.value,focusable:c(l)?.rovingFocus.value?!m.value:void 0,onKeydown:T(E(()=>{},[`prevent`]),[`enter`]),onClick:w}),{default:_(()=>[S(e.$slots,`default`,{modelValue:c(d),state:b.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),c(D)&&e.name&&!c(l)?(h(),y(c(U),f({key:0,type:`checkbox`,checked:!!b.value,name:e.name,value:e.value,disabled:m.value,required:e.required},c(O)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):C(`v-if`,!0)],64))}}),oe=m({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=N(),n=re();return(e,i)=>(h(),y(c(r),{present:e.forceMount||c(Z)(c(n).state.value)||c(n).state.value===!0},{default:_(()=>[a(c(j),f({ref:c(t),"data-state":c(Q)(c(n).state.value),"data-disabled":c(n).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},e.$attrs),{default:_(()=>[S(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}}),$=m({__name:`Checkbox`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},value:{},id:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,o=n,s=P(r,`class`),l=t(s,o);return(e,t)=>(h(),y(c(ae),f({"data-slot":`checkbox`},c(l),{class:c(M)(`peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50`,r.class)}),{default:_(t=>[a(c(oe),{"data-slot":`checkbox-indicator`,class:`grid place-content-center text-current transition-none`},{default:_(()=>[S(e.$slots,`default`,i(w(t)),()=>[a(c(I),{class:`size-3.5`})])]),_:2},1024)]),_:3},16,[`class`]))}}),se={key:0,class:`mb-6 rounded-md border border-brand-200 bg-brand-soft px-4 py-3 text-sm text-brand-soft-foreground`},ce={key:1,class:`mb-6 rounded-md border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive`,role:`alert`},le={key:2,class:`mb-6 grid gap-3`},ue=[`href`],de={key:0,class:`size-[18px]`,viewBox:`0 0 21 21`,"aria-hidden":`true`},fe={class:`relative`},pe=[`aria-label`],me={class:`flex items-center justify-between`},he={__name:`Login`,props:{canResetPassword:{type:Boolean,default:!1},status:{type:String,default:null},providers:{type:Array,default:()=>[]},identityError:{type:String,default:null},preview:{type:Boolean,default:!1}},setup(e){let t=e,n=b(!1),r=D({email:``,password:``,remember:!1});function i(){t.preview||r.post(`/login`,{onFinish:()=>r.reset(`password`)})}return(t,s)=>(h(),y(Y,{title:`Anmelden`,description:`Melden Sie sich mit Ihrer dienstlichen E-Mail-Adresse an.`},{default:_(()=>[e.status?(h(),u(`div`,se,v(e.status),1)):C(``,!0),e.identityError?(h(),u(`div`,ce,v(e.identityError),1)):C(``,!0),e.providers.length?(h(),u(`div`,le,[(h(!0),u(g,null,d(e.providers,e=>(h(),u(`a`,{key:e.slug,href:`/auth/${e.slug}/redirect`,class:`inline-flex h-11 items-center justify-center gap-3 rounded-md border border-input bg-card px-4 text-sm font-medium shadow-xs transition-colors hover:bg-accent`},[e.type===`entra`?(h(),u(`svg`,de,[...s[4]||=[l(`rect`,{x:`1`,y:`1`,width:`9`,height:`9`,fill:`#f25022`},null,-1),l(`rect`,{x:`11`,y:`1`,width:`9`,height:`9`,fill:`#7fba00`},null,-1),l(`rect`,{x:`1`,y:`11`,width:`9`,height:`9`,fill:`#00a4ef`},null,-1),l(`rect`,{x:`11`,y:`11`,width:`9`,height:`9`,fill:`#ffb900`},null,-1)]])):e.type===`ldap`?(h(),y(c(ee),{key:1,class:`size-[18px] text-muted-foreground`,"aria-hidden":`true`})):e.type===`saml`?(h(),y(c(te),{key:2,class:`size-[18px] text-muted-foreground`,"aria-hidden":`true`})):(h(),y(c(F),{key:3,class:`size-[18px] text-muted-foreground`,"aria-hidden":`true`})),o(` `+v(e.label),1)],8,ue))),128)),s[5]||=l(`div`,{class:`my-2 flex items-center gap-3 text-xs text-muted-foreground`},[l(`span`,{class:`h-px flex-1 bg-border`}),o(` oder mit E-Mail und Passwort `),l(`span`,{class:`h-px flex-1 bg-border`})],-1)])):C(``,!0),l(`form`,{class:`grid gap-5`,onSubmit:E(i,[`prevent`])},[a(K,{id:`email`,label:`E-Mail-Adresse`,error:c(r).errors.email},{default:_(()=>[a(c(J),{id:`email`,modelValue:c(r).email,"onUpdate:modelValue":s[0]||=e=>c(r).email=e,type:`email`,autocomplete:`username`,autofocus:``,class:`h-10`,"aria-invalid":!!c(r).errors.email},null,8,[`modelValue`,`aria-invalid`])]),_:1},8,[`error`]),a(K,{id:`password`,label:`Passwort`,error:c(r).errors.password},{default:_(()=>[l(`div`,fe,[a(c(J),{id:`password`,modelValue:c(r).password,"onUpdate:modelValue":s[1]||=e=>c(r).password=e,type:n.value?`text`:`password`,autocomplete:`current-password`,class:`h-10 pr-10`,"aria-invalid":!!c(r).errors.password},null,8,[`modelValue`,`type`,`aria-invalid`]),l(`button`,{type:`button`,class:`absolute inset-y-0 right-0 grid w-10 place-items-center text-muted-foreground hover:text-foreground`,"aria-label":n.value?`Passwort verbergen`:`Passwort anzeigen`,onClick:s[2]||=e=>n.value=!n.value},[n.value?(h(),y(c(L),{key:0,class:`size-4`})):(h(),y(c(R),{key:1,class:`size-4`}))],8,pe)])]),_:1},8,[`error`]),l(`div`,me,[a(c(G),{class:`flex items-center gap-2 text-sm font-normal`},{default:_(()=>[a(c($),{modelValue:c(r).remember,"onUpdate:modelValue":s[3]||=e=>c(r).remember=e},null,8,[`modelValue`]),s[6]||=o(` Angemeldet bleiben `,-1)]),_:1}),e.canResetPassword?(h(),y(c(O),{key:0,href:`/forgot-password`,class:`text-sm font-medium text-brand-text hover:underline`},{default:_(()=>[...s[7]||=[o(` Passwort vergessen? `,-1)]]),_:1})):C(``,!0)]),a(c(q),{type:`submit`,size:`lg`,class:`mt-2 h-10 w-full`,disabled:c(r).processing},{default:_(()=>[c(r).processing?(h(),y(c(k),{key:0,class:`animate-spin`})):C(``,!0),s[8]||=o(` Anmelden `,-1)]),_:1},8,[`disabled`])],32)]),_:1}))}};export{he as default}; \ No newline at end of file +import{d as e,i as t,l as n,n as r}from"./usePrimitiveElement-DC7UloPZ.js";import{$n as i,D as a,E as o,Nt as s,On as c,_ as l,b as u,bt as d,et as f,g as p,k as m,mt as h,o as g,qt as _,tr as v,v as y,vn as b,wt as x,xt as S,y as C,z as w}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as T,w as E}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as D,r as O}from"./app-BNwrc_lv.js";import{O as k,b as A,d as j,l as M,p as N,s as P}from"./dist-DtGNiYlK.js";import{c as F,l as ee,s as te}from"./RovingFocusGroup-D88K7krN.js";import{t as I}from"./check-AfxJa8Ew.js";import{t as L}from"./eye-off-myis3scV.js";import{t as R}from"./eye-CFNQcvaV.js";import{n as z,t as B}from"./isValueEqualOrExist-BmxVVt-T.js";import{n as V,r as H,t as U}from"./VisuallyHiddenInput-BMUp3blB.js";import{t as W}from"./RovingFocusItem-BqPEtysU.js";import{n as G,t as K}from"./FormField-BoFAO4pm.js";import{n as q}from"./button-CwUSbS9X.js";import{t as J}from"./Input-FGSb2-yK.js";import{t as Y}from"./GuestLayout-B2rtJjbh.js";var[X,ne]=e(`CheckboxGroupRoot`);function Z(e){return e===`indeterminate`}function Q(e){return Z(e)?`indeterminate`:e?`checked`:`unchecked`}var[re,ie]=e(`CheckboxRoot`),ae=m({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let r=e,i=t,{forwardRef:a,currentElement:o}=N(),l=X(null),d=A(r,`modelValue`,i,{defaultValue:r.defaultValue??r.falseValue,passive:r.modelValue===void 0}),m=p(()=>l?.disabled.value||r.disabled),v=p(()=>z(d.value,r.trueValue)),b=p(()=>n(l?.modelValue.value)?d.value===`indeterminate`?`indeterminate`:v.value:B(l.modelValue.value,r.value));function w(){if(n(l?.modelValue.value))d.value===`indeterminate`?d.value=r.trueValue:d.value=v.value?r.falseValue:r.trueValue;else{let e=[...l.modelValue.value||[]];if(B(e,r.value)){let t=e.findIndex(e=>z(e,r.value));e.splice(t,1)}else e.push(r.value);l.modelValue.value=e}}let D=H(o),O=V(),k=s(),M=p(()=>{if(!k[`aria-label`])return r.id&&o.value?document.querySelector(`[for="${r.id}"]`)?.innerText:void 0});return ie({disabled:m,state:b}),(e,t)=>(h(),u(g,null,[(h(),y(x(c(l)?.rovingFocus.value?c(W):c(j)),f({...e.$attrs,...c(O)},{id:e.id,ref:c(a),role:`checkbox`,"as-child":e.asChild,as:e.as,type:e.as===`button`?`button`:void 0,"aria-checked":c(Z)(b.value)?`mixed`:b.value,"aria-required":e.required,"aria-label":e.$attrs[`aria-label`]||M.value,"data-state":c(Q)(b.value),"data-disabled":m.value?``:void 0,disabled:m.value,focusable:c(l)?.rovingFocus.value?!m.value:void 0,onKeydown:T(E(()=>{},[`prevent`]),[`enter`]),onClick:w}),{default:_(()=>[S(e.$slots,`default`,{modelValue:c(d),state:b.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),c(D)&&e.name&&!c(l)?(h(),y(c(U),f({key:0,type:`checkbox`,checked:!!b.value,name:e.name,value:e.value,disabled:m.value,required:e.required},c(O)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):C(`v-if`,!0)],64))}}),oe=m({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=N(),n=re();return(e,i)=>(h(),y(c(r),{present:e.forceMount||c(Z)(c(n).state.value)||c(n).state.value===!0},{default:_(()=>[a(c(j),f({ref:c(t),"data-state":c(Q)(c(n).state.value),"data-disabled":c(n).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},e.$attrs),{default:_(()=>[S(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}}),$=m({__name:`Checkbox`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},value:{},id:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:n}){let r=e,o=n,s=P(r,`class`),l=t(s,o);return(e,t)=>(h(),y(c(ae),f({"data-slot":`checkbox`},c(l),{class:c(M)(`peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50`,r.class)}),{default:_(t=>[a(c(oe),{"data-slot":`checkbox-indicator`,class:`grid place-content-center text-current transition-none`},{default:_(()=>[S(e.$slots,`default`,i(w(t)),()=>[a(c(I),{class:`size-3.5`})])]),_:2},1024)]),_:3},16,[`class`]))}}),se={key:0,class:`mb-6 rounded-md border border-brand-200 bg-brand-soft px-4 py-3 text-sm text-brand-soft-foreground`},ce={key:1,class:`mb-6 rounded-md border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive`,role:`alert`},le={key:2,class:`mb-6 grid gap-3`},ue=[`href`],de={key:0,class:`size-[18px]`,viewBox:`0 0 21 21`,"aria-hidden":`true`},fe={class:`relative`},pe=[`aria-label`],me={class:`flex items-center justify-between`},he={__name:`Login`,props:{canResetPassword:{type:Boolean,default:!1},status:{type:String,default:null},providers:{type:Array,default:()=>[]},identityError:{type:String,default:null},preview:{type:Boolean,default:!1}},setup(e){let t=e,n=b(!1),r=D({email:``,password:``,remember:!1});function i(){t.preview||r.post(`/login`,{onFinish:()=>r.reset(`password`)})}return(t,s)=>(h(),y(Y,{title:`Anmelden`,description:`Melden Sie sich mit Ihrer dienstlichen E-Mail-Adresse an.`},{default:_(()=>[e.status?(h(),u(`div`,se,v(e.status),1)):C(``,!0),e.identityError?(h(),u(`div`,ce,v(e.identityError),1)):C(``,!0),e.providers.length?(h(),u(`div`,le,[(h(!0),u(g,null,d(e.providers,e=>(h(),u(`a`,{key:e.slug,href:`/auth/${e.slug}/redirect`,class:`inline-flex h-11 items-center justify-center gap-3 rounded-md border border-input bg-card px-4 text-sm font-medium shadow-xs transition-colors hover:bg-accent`},[e.type===`entra`?(h(),u(`svg`,de,[...s[4]||=[l(`rect`,{x:`1`,y:`1`,width:`9`,height:`9`,fill:`#f25022`},null,-1),l(`rect`,{x:`11`,y:`1`,width:`9`,height:`9`,fill:`#7fba00`},null,-1),l(`rect`,{x:`1`,y:`11`,width:`9`,height:`9`,fill:`#00a4ef`},null,-1),l(`rect`,{x:`11`,y:`11`,width:`9`,height:`9`,fill:`#ffb900`},null,-1)]])):e.type===`ldap`?(h(),y(c(ee),{key:1,class:`size-[18px] text-muted-foreground`,"aria-hidden":`true`})):e.type===`saml`?(h(),y(c(te),{key:2,class:`size-[18px] text-muted-foreground`,"aria-hidden":`true`})):(h(),y(c(F),{key:3,class:`size-[18px] text-muted-foreground`,"aria-hidden":`true`})),o(` `+v(e.label),1)],8,ue))),128)),s[5]||=l(`div`,{class:`my-2 flex items-center gap-3 text-xs text-muted-foreground`},[l(`span`,{class:`h-px flex-1 bg-border`}),o(` oder mit E-Mail und Passwort `),l(`span`,{class:`h-px flex-1 bg-border`})],-1)])):C(``,!0),l(`form`,{class:`grid gap-5`,onSubmit:E(i,[`prevent`])},[a(K,{id:`email`,label:`E-Mail-Adresse`,error:c(r).errors.email},{default:_(()=>[a(c(J),{id:`email`,modelValue:c(r).email,"onUpdate:modelValue":s[0]||=e=>c(r).email=e,type:`email`,autocomplete:`username`,autofocus:``,class:`h-10`,"aria-invalid":!!c(r).errors.email},null,8,[`modelValue`,`aria-invalid`])]),_:1},8,[`error`]),a(K,{id:`password`,label:`Passwort`,error:c(r).errors.password},{default:_(()=>[l(`div`,fe,[a(c(J),{id:`password`,modelValue:c(r).password,"onUpdate:modelValue":s[1]||=e=>c(r).password=e,type:n.value?`text`:`password`,autocomplete:`current-password`,class:`h-10 pr-10`,"aria-invalid":!!c(r).errors.password},null,8,[`modelValue`,`type`,`aria-invalid`]),l(`button`,{type:`button`,class:`absolute inset-y-0 right-0 grid w-10 place-items-center text-muted-foreground hover:text-foreground`,"aria-label":n.value?`Passwort verbergen`:`Passwort anzeigen`,onClick:s[2]||=e=>n.value=!n.value},[n.value?(h(),y(c(L),{key:0,class:`size-4`})):(h(),y(c(R),{key:1,class:`size-4`}))],8,pe)])]),_:1},8,[`error`]),l(`div`,me,[a(c(G),{class:`flex items-center gap-2 text-sm font-normal`},{default:_(()=>[a(c($),{modelValue:c(r).remember,"onUpdate:modelValue":s[3]||=e=>c(r).remember=e},null,8,[`modelValue`]),s[6]||=o(` Angemeldet bleiben `,-1)]),_:1}),e.canResetPassword?(h(),y(c(O),{key:0,href:`/forgot-password`,class:`text-sm font-medium text-brand-text hover:underline`},{default:_(()=>[...s[7]||=[o(` Passwort vergessen? `,-1)]]),_:1})):C(``,!0)]),a(c(q),{type:`submit`,size:`lg`,class:`mt-2 h-10 w-full`,disabled:c(r).processing},{default:_(()=>[c(r).processing?(h(),y(c(k),{key:0,class:`animate-spin`})):C(``,!0),s[8]||=o(` Anmelden `,-1)]),_:1},8,[`disabled`])],32)]),_:1}))}};export{he as default}; \ No newline at end of file diff --git a/public/build/assets/MyDownloads-DbYaOnA1.js b/public/build/assets/MyDownloads-DMU40SUE.js similarity index 85% rename from public/build/assets/MyDownloads-DbYaOnA1.js rename to public/build/assets/MyDownloads-DMU40SUE.js index 2789a403..51edfb5b 100644 --- a/public/build/assets/MyDownloads-DbYaOnA1.js +++ b/public/build/assets/MyDownloads-DMU40SUE.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{A as p}from"./AppIcon-0N56IC2z.js";import{t as m}from"./FileIcon-B6dfvt48.js";import{t as h}from"./Panel-BASB8Xb9.js";var g={key:0,class:`-my-1.5 grid gap-0.5`},_=[`href`],v={class:`min-w-0 flex-1 truncate text-sm`},y={__name:`MyDownloads`,props:{favorites:{type:Array,default:()=>[]},popular:{type:Array,default:()=>[]}},setup(y){let b=y,x=b.favorites.length?b.favorites:b.popular;return(b,S)=>(s(),d(h,{title:y.favorites.length?`Meine Downloads`:`Häufig genutzt`,"action-label":`Alle Downloads`,"action-href":`/downloads`},{default:l(()=>[n(x).length?(s(),a(`ul`,g,[(s(!0),a(c,null,o(n(x),t=>(s(),a(`li`,{key:t.id},[i(`a`,{href:t.download_url,class:`-mx-2 flex items-center gap-3 rounded-md px-2 py-1.5 hover:bg-accent`},[e(m,{extension:t.extension,size:`sm`},null,8,[`extension`]),i(`span`,v,u(t.title),1)],8,_)]))),128))])):f(``,!0),y.favorites.length?f(``,!0):(s(),a(`p`,{key:1,class:r([`text-[13px] text-muted-foreground`,{"mt-3 border-t pt-3":n(x).length}])},[e(n(p),{class:`-mt-0.5 mr-1 inline size-3.5`}),S[0]||=t(`Mit dem Stern unter „Downloads“ merken Sie sich Dateien für diese Kachel. `,-1)],2))]),_:1},8,[`title`]))}};export{y as default}; \ No newline at end of file +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{A as p}from"./AppIcon-nlhvQfK7.js";import{t as m}from"./FileIcon-BctWLKDw.js";import{t as h}from"./Panel-Dr-NcUuS.js";var g={key:0,class:`-my-1.5 grid gap-0.5`},_=[`href`],v={class:`min-w-0 flex-1 truncate text-sm`},y={__name:`MyDownloads`,props:{favorites:{type:Array,default:()=>[]},popular:{type:Array,default:()=>[]}},setup(y){let b=y,x=b.favorites.length?b.favorites:b.popular;return(b,S)=>(s(),d(h,{title:y.favorites.length?`Meine Downloads`:`Häufig genutzt`,"action-label":`Alle Downloads`,"action-href":`/downloads`},{default:l(()=>[n(x).length?(s(),a(`ul`,g,[(s(!0),a(c,null,o(n(x),t=>(s(),a(`li`,{key:t.id},[i(`a`,{href:t.download_url,class:`-mx-2 flex items-center gap-3 rounded-md px-2 py-1.5 hover:bg-accent`},[e(m,{extension:t.extension,size:`sm`},null,8,[`extension`]),i(`span`,v,u(t.title),1)],8,_)]))),128))])):f(``,!0),y.favorites.length?f(``,!0):(s(),a(`p`,{key:1,class:r([`text-[13px] text-muted-foreground`,{"mt-3 border-t pt-3":n(x).length}])},[e(n(p),{class:`-mt-0.5 mr-1 inline size-3.5`}),S[0]||=t(`Mit dem Stern unter „Downloads“ merken Sie sich Dateien für diese Kachel. `,-1)],2))]),_:1},8,[`title`]))}};export{y as default}; \ No newline at end of file diff --git a/public/build/assets/MyIt-CRI1MUT9.js b/public/build/assets/MyIt-C-wd9M34.js similarity index 89% rename from public/build/assets/MyIt-CRI1MUT9.js rename to public/build/assets/MyIt-C-wd9M34.js index 72aa8b8a..bf38a5c7 100644 --- a/public/build/assets/MyIt-CRI1MUT9.js +++ b/public/build/assets/MyIt-C-wd9M34.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,b as i,bt as a,ct as o,mt as s,o as c,qt as l,tr as u,v as d,vn as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-Bu3kn8yd.js";import{t as h}from"./calendar-clock-8H2IkjP5.js";import{t as g}from"./http-DmyDwIce.js";import{n as _,t as v}from"./message-square-plus-89qxGe_b.js";import{t as y}from"./Panel-BASB8Xb9.js";import{t as b}from"./Skeleton-fJgmuUSB.js";var x={key:0,class:`grid grid-cols-2 gap-2`},S={class:`grid grid-cols-2 gap-2`},C={class:`block text-xl font-semibold tabular-nums`},w={class:`flex items-center gap-1 text-xs text-muted-foreground`},T={class:`block text-xl font-semibold tabular-nums`},E={class:`flex items-center gap-1 text-xs text-muted-foreground`},D={key:0,class:`mt-3 grid gap-0.5`},O={class:`truncate`},k={class:`shrink-0 text-[11px] text-muted-foreground`},A={key:2,class:`text-[13px] text-muted-foreground`},j={__name:`MyIt`,setup(j){let M=f(null),N=f(!1);return o(async()=>{try{M.value=await g.get(`/it-service/uebersicht`)}catch{N.value=!0}}),(o,f)=>(s(),d(y,{title:`Meine IT`,"action-label":`Öffnen`,"action-href":`/it-service`},{default:l(()=>[!M.value&&!N.value?(s(),i(`div`,x,[e(n(b),{class:`h-16`}),e(n(b),{class:`h-16`})])):M.value?(s(),i(c,{key:1},[r(`div`,S,[e(n(m),{href:`/it-service`,class:`rounded-md bg-muted px-3 py-2.5 hover:bg-brand-soft`},{default:l(()=>[r(`span`,C,u(M.value.open_tickets),1),r(`span`,w,[e(n(_),{class:`size-3.5`}),f[0]||=t(` offene Tickets`,-1)])]),_:1}),e(n(m),{href:`/it-service`,class:`rounded-md bg-muted px-3 py-2.5 hover:bg-brand-soft`},{default:l(()=>[r(`span`,T,u(M.value.loans),1),r(`span`,E,[e(n(h),{class:`size-3.5`}),f[1]||=t(` Ausleihen`,-1)])]),_:1})]),M.value.latest.length?(s(),i(`ul`,D,[(s(!0),i(c,null,a(M.value.latest,t=>(s(),i(`li`,{key:t.id},[e(n(m),{href:`/it-service/tickets/${t.id}`,class:`flex items-center justify-between gap-2 rounded px-1 py-1 text-[13px] hover:bg-accent`},{default:l(()=>[r(`span`,O,u(t.subject),1),r(`span`,k,u(t.status_label),1)]),_:2},1032,[`href`])]))),128))])):p(``,!0)],64)):(s(),i(`p`,A,`Der IT-Service ist gerade nicht erreichbar.`)),e(n(m),{href:`/it-service/tickets/neu`,class:`mt-3 flex items-center gap-1.5 border-t pt-3 text-[13px] font-medium text-brand-text hover:underline`},{default:l(()=>[e(n(v),{class:`size-4`}),f[2]||=t(` IT-Problem melden `,-1)]),_:1})]),_:1}))}};export{j as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,b as i,bt as a,ct as o,mt as s,o as c,qt as l,tr as u,v as d,vn as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-BNwrc_lv.js";import{t as h}from"./calendar-clock-8H2IkjP5.js";import{n as g}from"./http-CAG9BrJF.js";import{n as _,t as v}from"./message-square-plus-89qxGe_b.js";import{t as y}from"./Panel-Dr-NcUuS.js";import{t as b}from"./Skeleton-fJgmuUSB.js";var x={key:0,class:`grid grid-cols-2 gap-2`},S={class:`grid grid-cols-2 gap-2`},C={class:`block text-xl font-semibold tabular-nums`},w={class:`flex items-center gap-1 text-xs text-muted-foreground`},T={class:`block text-xl font-semibold tabular-nums`},E={class:`flex items-center gap-1 text-xs text-muted-foreground`},D={key:0,class:`mt-3 grid gap-0.5`},O={class:`truncate`},k={class:`shrink-0 text-[11px] text-muted-foreground`},A={key:2,class:`text-[13px] text-muted-foreground`},j={__name:`MyIt`,setup(j){let M=f(null),N=f(!1);return o(async()=>{try{M.value=await g.get(`/it-service/uebersicht`)}catch{N.value=!0}}),(o,f)=>(s(),d(y,{title:`Meine IT`,"action-label":`Öffnen`,"action-href":`/it-service`},{default:l(()=>[!M.value&&!N.value?(s(),i(`div`,x,[e(n(b),{class:`h-16`}),e(n(b),{class:`h-16`})])):M.value?(s(),i(c,{key:1},[r(`div`,S,[e(n(m),{href:`/it-service`,class:`rounded-md bg-muted px-3 py-2.5 hover:bg-brand-soft`},{default:l(()=>[r(`span`,C,u(M.value.open_tickets),1),r(`span`,w,[e(n(_),{class:`size-3.5`}),f[0]||=t(` offene Tickets`,-1)])]),_:1}),e(n(m),{href:`/it-service`,class:`rounded-md bg-muted px-3 py-2.5 hover:bg-brand-soft`},{default:l(()=>[r(`span`,T,u(M.value.loans),1),r(`span`,E,[e(n(h),{class:`size-3.5`}),f[1]||=t(` Ausleihen`,-1)])]),_:1})]),M.value.latest.length?(s(),i(`ul`,D,[(s(!0),i(c,null,a(M.value.latest,t=>(s(),i(`li`,{key:t.id},[e(n(m),{href:`/it-service/tickets/${t.id}`,class:`flex items-center justify-between gap-2 rounded px-1 py-1 text-[13px] hover:bg-accent`},{default:l(()=>[r(`span`,O,u(t.subject),1),r(`span`,k,u(t.status_label),1)]),_:2},1032,[`href`])]))),128))])):p(``,!0)],64)):(s(),i(`p`,A,`Der IT-Service ist gerade nicht erreichbar.`)),e(n(m),{href:`/it-service/tickets/neu`,class:`mt-3 flex items-center gap-1.5 border-t pt-3 text-[13px] font-medium text-brand-text hover:underline`},{default:l(()=>[e(n(v),{class:`size-4`}),f[2]||=t(` IT-Problem melden `,-1)]),_:1})]),_:1}))}};export{j as default}; \ No newline at end of file diff --git a/public/build/assets/NativeSelect-BGasRaNs.js b/public/build/assets/NativeSelect-G3km7PmI.js similarity index 94% rename from public/build/assets/NativeSelect-BGasRaNs.js rename to public/build/assets/NativeSelect-G3km7PmI.js index 316a8ee4..79e0b036 100644 --- a/public/build/assets/NativeSelect-BGasRaNs.js +++ b/public/build/assets/NativeSelect-G3km7PmI.js @@ -1 +1 @@ -import{$ as e,D as t,Ft as n,On as r,Yt as i,_ as a,b as o,bt as s,et as c,mt as l,o as u,tr as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{b as p}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{C as m}from"./http-DmyDwIce.js";var h={class:`relative`},g={key:0,value:null},_=[`value`],v={__name:`NativeSelect`,props:e({options:{type:Array,required:!0},placeholder:{type:String,default:``}},{modelValue:{type:[String,Number,null],default:null},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let v=n(e,`modelValue`);return(n,y)=>(l(),o(`div`,h,[i(a(`select`,c({"onUpdate:modelValue":y[0]||=e=>v.value=e,class:`h-9 w-full appearance-none rounded-md border border-input bg-card pr-8 pl-3 text-sm shadow-xs focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none disabled:opacity-60`},n.$attrs),[e.placeholder?(l(),o(`option`,g,d(e.placeholder),1)):f(``,!0),(l(!0),o(u,null,s(e.options,e=>(l(),o(`option`,{key:e.value,value:e.value},d(e.label),9,_))),128))],16),[[p,v.value]]),t(r(m),{class:`pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground`})]))}};export{v as t}; \ No newline at end of file +import{$ as e,D as t,Ft as n,On as r,Yt as i,_ as a,b as o,bt as s,et as c,mt as l,o as u,tr as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{b as p}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{w as m}from"./http-CAG9BrJF.js";var h={class:`relative`},g={key:0,value:null},_=[`value`],v={__name:`NativeSelect`,props:e({options:{type:Array,required:!0},placeholder:{type:String,default:``}},{modelValue:{type:[String,Number,null],default:null},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let v=n(e,`modelValue`);return(n,y)=>(l(),o(`div`,h,[i(a(`select`,c({"onUpdate:modelValue":y[0]||=e=>v.value=e,class:`h-9 w-full appearance-none rounded-md border border-input bg-card pr-8 pl-3 text-sm shadow-xs focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none disabled:opacity-60`},n.$attrs),[e.placeholder?(l(),o(`option`,g,d(e.placeholder),1)):f(``,!0),(l(!0),o(u,null,s(e.options,e=>(l(),o(`option`,{key:e.value,value:e.value},d(e.label),9,_))),128))],16),[[p,v.value]]),t(r(m),{class:`pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground`})]))}};export{v as t}; \ No newline at end of file diff --git a/public/build/assets/NewColleagues-BMV90TrO.js b/public/build/assets/NewColleagues-Dl9znv_Q.js similarity index 87% rename from public/build/assets/NewColleagues-BMV90TrO.js rename to public/build/assets/NewColleagues-Dl9znv_Q.js index 12b7b5b4..98e90e98 100644 --- a/public/build/assets/NewColleagues-BMV90TrO.js +++ b/public/build/assets/NewColleagues-Dl9znv_Q.js @@ -1 +1 @@ -import{D as e,On as t,_ as n,b as r,bt as i,mt as a,o,qt as s,tr as c,v as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as u}from"./app-Bu3kn8yd.js";import{p as d}from"./AppIcon-0N56IC2z.js";import{t as f}from"./Panel-BASB8Xb9.js";var p={class:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`},m={class:`min-w-0`},h={class:`truncate text-sm font-semibold`},g={class:`truncate text-[13px] text-muted-foreground`},_={__name:`NewColleagues`,props:{people:{type:Array,required:!0}},setup(_){return(v,y)=>(a(),l(f,{title:`Neu im Team`,"action-label":`Alle Personen`,"action-href":`/personen`},{default:s(()=>[n(`ul`,p,[(a(!0),r(o,null,i(_.people,i=>(a(),r(`li`,{key:i.id},[e(t(u),{href:`/personen/${i.id}`,class:`flex items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-accent`},{default:s(()=>[e(d,{person:i,class:`size-11`},null,8,[`person`]),n(`div`,m,[n(`div`,h,c(i.name),1),n(`div`,g,c(i.job_title||i.department),1)])]),_:2},1032,[`href`])]))),128))])]),_:1}))}};export{_ as default}; \ No newline at end of file +import{D as e,On as t,_ as n,b as r,bt as i,mt as a,o,qt as s,tr as c,v as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as u}from"./app-BNwrc_lv.js";import{p as d}from"./AppIcon-nlhvQfK7.js";import{t as f}from"./Panel-Dr-NcUuS.js";var p={class:`grid gap-3 sm:grid-cols-2 xl:grid-cols-3`},m={class:`min-w-0`},h={class:`truncate text-sm font-semibold`},g={class:`truncate text-[13px] text-muted-foreground`},_={__name:`NewColleagues`,props:{people:{type:Array,required:!0}},setup(_){return(v,y)=>(a(),l(f,{title:`Neu im Team`,"action-label":`Alle Personen`,"action-href":`/personen`},{default:s(()=>[n(`ul`,p,[(a(!0),r(o,null,i(_.people,i=>(a(),r(`li`,{key:i.id},[e(t(u),{href:`/personen/${i.id}`,class:`flex items-center gap-3 rounded-lg border p-3 transition-colors hover:bg-accent`},{default:s(()=>[e(d,{person:i,class:`size-11`},null,8,[`person`]),n(`div`,m,[n(`div`,h,c(i.name),1),n(`div`,g,c(i.job_title||i.department),1)])]),_:2},1032,[`href`])]))),128))])]),_:1}))}};export{_ as default}; \ No newline at end of file diff --git a/public/build/assets/NewPageDialog-BJuo8o_M.js b/public/build/assets/NewPageDialog-CGV-jwsW.js similarity index 63% rename from public/build/assets/NewPageDialog-BJuo8o_M.js rename to public/build/assets/NewPageDialog-CGV-jwsW.js index a60b0a35..f36ec362 100644 --- a/public/build/assets/NewPageDialog-BJuo8o_M.js +++ b/public/build/assets/NewPageDialog-CGV-jwsW.js @@ -1 +1 @@ -import{$ as e,D as t,E as n,Ft as r,Ht as i,On as a,_ as o,b as s,mt as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as p}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as m}from"./app-Bu3kn8yd.js";import{t as h}from"./DialogDescription-BxaIqmag.js";import{t as g}from"./button-ZHC5mKey.js";import{t as _}from"./Input-FGSb2-yK.js";import{i as v,n as y,r as b,t as x}from"./dialog-uBUhf8w7.js";import{t as S}from"./DialogHeader-DuqiL3ry.js";var C={class:`grid gap-1.5`},w={key:0,class:`text-[13px] text-destructive`},T={__name:`NewPageDialog`,props:e({parentId:{type:Number,default:null},parentTitle:{type:String,default:``}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`before-create`],[`update:open`]),setup(e,{emit:T}){let E=e,D=r(e,`open`),O=T,k=m({title:``,parent_id:null});i(D,e=>e&&(k.reset(),k.clearErrors()));async function A(){O(`before-create`),k.parent_id=E.parentId,k.post(`/redaktion/seiten`)}return(r,i)=>(c(),d(a(v),{open:D.value,"onUpdate:open":i[2]||=e=>D.value=e},{default:l(()=>[t(a(b),{class:`sm:max-w-md`},{default:l(()=>[t(a(S),null,{default:l(()=>[t(a(x),null,{default:l(()=>[n(u(e.parentId?`Unterseite anlegen`:`Neue Seite`),1)]),_:1}),e.parentId?(c(),d(a(h),{key:0},{default:l(()=>[n(`Unter „`+u(e.parentTitle)+`“. Die Seite ist erst nach dem Veröffentlichen sichtbar.`,1)]),_:1})):(c(),d(a(h),{key:1},{default:l(()=>[...i[3]||=[n(`Auf der obersten Ebene. Die Seite ist erst nach dem Veröffentlichen sichtbar.`,-1)]]),_:1}))]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:p(A,[`prevent`])},[o(`label`,C,[i[4]||=o(`span`,{class:`text-[13px] font-medium`},`Titel`,-1),t(a(_),{modelValue:a(k).title,"onUpdate:modelValue":i[0]||=e=>a(k).title=e,maxlength:`200`,autofocus:``,"aria-invalid":!!a(k).errors.title},null,8,[`modelValue`,`aria-invalid`]),a(k).errors.title?(c(),s(`span`,w,u(a(k).errors.title),1)):f(``,!0)]),t(a(y),null,{default:l(()=>[t(a(g),{type:`button`,variant:`outline`,onClick:i[1]||=e=>D.value=!1},{default:l(()=>[...i[5]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(g),{type:`submit`,disabled:a(k).processing||!a(k).title.trim()},{default:l(()=>[...i[6]||=[n(`Anlegen und bearbeiten`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]))}};export{T as t}; \ No newline at end of file +import{$ as e,D as t,E as n,Ft as r,Ht as i,On as a,_ as o,b as s,mt as c,qt as l,tr as u,v as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as p}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as m}from"./app-BNwrc_lv.js";import{n as h}from"./button-CwUSbS9X.js";import{t as g}from"./Input-FGSb2-yK.js";import{i as _,n as v,r as y,t as b}from"./dialog-RK2mTeqi.js";import{t as x}from"./DialogDescription-CaB-9xpp.js";import{t as S}from"./DialogHeader-DuqiL3ry.js";var C={class:`grid gap-1.5`},w={key:0,class:`text-[13px] text-destructive`},T={__name:`NewPageDialog`,props:e({parentId:{type:Number,default:null},parentTitle:{type:String,default:``}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:e([`before-create`],[`update:open`]),setup(e,{emit:T}){let E=e,D=r(e,`open`),O=T,k=m({title:``,parent_id:null});i(D,e=>e&&(k.reset(),k.clearErrors()));async function A(){O(`before-create`),k.parent_id=E.parentId,k.post(`/redaktion/seiten`)}return(r,i)=>(c(),d(a(_),{open:D.value,"onUpdate:open":i[2]||=e=>D.value=e},{default:l(()=>[t(a(y),{class:`sm:max-w-md`},{default:l(()=>[t(a(S),null,{default:l(()=>[t(a(b),null,{default:l(()=>[n(u(e.parentId?`Unterseite anlegen`:`Neue Seite`),1)]),_:1}),e.parentId?(c(),d(a(x),{key:0},{default:l(()=>[n(`Unter „`+u(e.parentTitle)+`“. Die Seite ist erst nach dem Veröffentlichen sichtbar.`,1)]),_:1})):(c(),d(a(x),{key:1},{default:l(()=>[...i[3]||=[n(`Auf der obersten Ebene. Die Seite ist erst nach dem Veröffentlichen sichtbar.`,-1)]]),_:1}))]),_:1}),o(`form`,{class:`grid gap-4`,onSubmit:p(A,[`prevent`])},[o(`label`,C,[i[4]||=o(`span`,{class:`text-[13px] font-medium`},`Titel`,-1),t(a(g),{modelValue:a(k).title,"onUpdate:modelValue":i[0]||=e=>a(k).title=e,maxlength:`200`,autofocus:``,"aria-invalid":!!a(k).errors.title},null,8,[`modelValue`,`aria-invalid`]),a(k).errors.title?(c(),s(`span`,w,u(a(k).errors.title),1)):f(``,!0)]),t(a(v),null,{default:l(()=>[t(a(h),{type:`button`,variant:`outline`,onClick:i[1]||=e=>D.value=!1},{default:l(()=>[...i[5]||=[n(`Abbrechen`,-1)]]),_:1}),t(a(h),{type:`submit`,disabled:a(k).processing||!a(k).title.trim()},{default:l(()=>[...i[6]||=[n(`Anlegen und bearbeiten`,-1)]]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]))}};export{T as t}; \ No newline at end of file diff --git a/public/build/assets/NewsCard-DpbfyO9M.js b/public/build/assets/NewsCard-Cxl6vjIa.js similarity index 88% rename from public/build/assets/NewsCard-DpbfyO9M.js rename to public/build/assets/NewsCard-Cxl6vjIa.js index 155364e8..f63aac87 100644 --- a/public/build/assets/NewsCard-DpbfyO9M.js +++ b/public/build/assets/NewsCard-Cxl6vjIa.js @@ -1 +1 @@ -import{D as e,On as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as l}from"./app-Bu3kn8yd.js";import{o as u}from"./format-BsuBtvUs.js";import{n as d,t as f}from"./NewsImage-DgRoe0H1.js";var p={class:`flex flex-1 flex-col p-4`},m={class:`mt-1 line-clamp-2 text-[15px] leading-snug font-semibold group-hover:underline`},h={key:0,class:`mt-1.5 line-clamp-2 text-[13px] text-muted-foreground`},g={class:`mt-auto pt-3 text-xs text-muted-foreground`},_={__name:`NewsCard`,props:{post:{type:Object,required:!0}},setup(_){return(v,y)=>(i(),s(t(l),{href:`/neuigkeiten/${_.post.slug}`,class:`group flex h-full flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-md`},{default:a(()=>[e(f,{src:_.post.thumb_url,alt:_.post.title},null,8,[`src`,`alt`]),n(`div`,p,[e(d,{category:_.post.category},null,8,[`category`]),n(`h3`,m,o(_.post.title),1),_.post.teaser?(i(),r(`p`,h,o(_.post.teaser),1)):c(``,!0),n(`p`,g,o(t(u)(_.post.published_at))+` · `+o(_.post.reading_minutes)+` Min.`,1)])]),_:1},8,[`href`]))}};export{_ as t}; \ No newline at end of file +import{D as e,On as t,_ as n,b as r,mt as i,qt as a,tr as o,v as s,y as c}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as l}from"./app-BNwrc_lv.js";import{o as u}from"./format-BsuBtvUs.js";import{n as d,t as f}from"./NewsImage-C1RPeE33.js";var p={class:`flex flex-1 flex-col p-4`},m={class:`mt-1 line-clamp-2 text-[15px] leading-snug font-semibold group-hover:underline`},h={key:0,class:`mt-1.5 line-clamp-2 text-[13px] text-muted-foreground`},g={class:`mt-auto pt-3 text-xs text-muted-foreground`},_={__name:`NewsCard`,props:{post:{type:Object,required:!0}},setup(_){return(v,y)=>(i(),s(t(l),{href:`/neuigkeiten/${_.post.slug}`,class:`group flex h-full flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-md`},{default:a(()=>[e(f,{src:_.post.thumb_url,alt:_.post.title},null,8,[`src`,`alt`]),n(`div`,p,[e(d,{category:_.post.category},null,8,[`category`]),n(`h3`,m,o(_.post.title),1),_.post.teaser?(i(),r(`p`,h,o(_.post.teaser),1)):c(``,!0),n(`p`,g,o(t(u)(_.post.published_at))+` · `+o(_.post.reading_minutes)+` Min.`,1)])]),_:1},8,[`href`]))}};export{_ as t}; \ No newline at end of file diff --git a/public/build/assets/NewsImage-DgRoe0H1.js b/public/build/assets/NewsImage-C1RPeE33.js similarity index 85% rename from public/build/assets/NewsImage-DgRoe0H1.js rename to public/build/assets/NewsImage-C1RPeE33.js index aebb8b8b..d9b81ee8 100644 --- a/public/build/assets/NewsImage-DgRoe0H1.js +++ b/public/build/assets/NewsImage-C1RPeE33.js @@ -1 +1 @@ -import{D as e,On as t,b as n,mt as r,tr as i,y as a}from"./runtime-core.esm-bundler-B8D2lM98.js";import{F as o}from"./AppIcon-0N56IC2z.js";var s={key:0,class:`text-[11px] font-semibold tracking-wide text-accent2-text uppercase`},c={__name:`CategoryLabel`,props:{category:{type:Object,default:null}},setup(e){return(t,o)=>e.category?(r(),n(`span`,s,i(e.category.name),1)):a(``,!0)}},l={class:`relative aspect-video overflow-hidden bg-muted`},u=[`src`,`alt`],d={key:1,class:`grid size-full place-items-center bg-brand-soft`},f={__name:`NewsImage`,props:{src:{type:String,default:null},alt:{type:String,default:``}},setup(i){return(a,s)=>(r(),n(`div`,l,[i.src?(r(),n(`img`,{key:0,src:i.src,alt:i.alt,loading:`lazy`,class:`size-full object-cover`},null,8,u)):(r(),n(`div`,d,[e(t(o),{class:`size-1/4 max-h-10 max-w-10 text-brand-text opacity-60`,"stroke-width":1.5})]))]))}};export{c as n,f as t}; \ No newline at end of file +import{D as e,On as t,b as n,mt as r,tr as i,y as a}from"./runtime-core.esm-bundler-B8D2lM98.js";import{F as o}from"./AppIcon-nlhvQfK7.js";var s={key:0,class:`text-[11px] font-semibold tracking-wide text-accent2-text uppercase`},c={__name:`CategoryLabel`,props:{category:{type:Object,default:null}},setup(e){return(t,o)=>e.category?(r(),n(`span`,s,i(e.category.name),1)):a(``,!0)}},l={class:`relative aspect-video overflow-hidden bg-muted`},u=[`src`,`alt`],d={key:1,class:`grid size-full place-items-center bg-brand-soft`},f={__name:`NewsImage`,props:{src:{type:String,default:null},alt:{type:String,default:``}},setup(i){return(a,s)=>(r(),n(`div`,l,[i.src?(r(),n(`img`,{key:0,src:i.src,alt:i.alt,loading:`lazy`,class:`size-full object-cover`},null,8,u)):(r(),n(`div`,d,[e(t(o),{class:`size-1/4 max-h-10 max-w-10 text-brand-text opacity-60`,"stroke-width":1.5})]))]))}};export{c as n,f as t}; \ No newline at end of file diff --git a/public/build/assets/NewsListItem-rvZKO5MT.js b/public/build/assets/NewsListItem-DKC4VK9G.js similarity index 84% rename from public/build/assets/NewsListItem-rvZKO5MT.js rename to public/build/assets/NewsListItem-DKC4VK9G.js index 0607d7ce..79159d60 100644 --- a/public/build/assets/NewsListItem-rvZKO5MT.js +++ b/public/build/assets/NewsListItem-DKC4VK9G.js @@ -1 +1 @@ -import{D as e,On as t,_ as n,mt as r,qt as i,tr as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as s}from"./app-Bu3kn8yd.js";import{a as c}from"./format-BsuBtvUs.js";import{n as l,t as u}from"./NewsImage-DgRoe0H1.js";var d={class:`min-w-0`},f={class:`mt-0.5 line-clamp-2 text-sm leading-snug font-semibold group-hover:underline`},p={class:`mt-1 text-xs text-muted-foreground`},m={__name:`NewsListItem`,props:{post:{type:Object,required:!0}},setup(m){return(h,g)=>(r(),o(t(s),{href:`/neuigkeiten/${m.post.slug}`,class:`group flex gap-4 py-3`},{default:i(()=>[e(u,{src:m.post.thumb_url,alt:m.post.title,class:`w-28 shrink-0 rounded-md sm:w-32`},null,8,[`src`,`alt`]),n(`div`,d,[e(l,{category:m.post.category},null,8,[`category`]),n(`h3`,f,a(m.post.title),1),n(`p`,p,a(t(c)(m.post.published_at)),1)])]),_:1},8,[`href`]))}};export{m as t}; \ No newline at end of file +import{D as e,On as t,_ as n,mt as r,qt as i,tr as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as s}from"./app-BNwrc_lv.js";import{a as c}from"./format-BsuBtvUs.js";import{n as l,t as u}from"./NewsImage-C1RPeE33.js";var d={class:`min-w-0`},f={class:`mt-0.5 line-clamp-2 text-sm leading-snug font-semibold group-hover:underline`},p={class:`mt-1 text-xs text-muted-foreground`},m={__name:`NewsListItem`,props:{post:{type:Object,required:!0}},setup(m){return(h,g)=>(r(),o(t(s),{href:`/neuigkeiten/${m.post.slug}`,class:`group flex gap-4 py-3`},{default:i(()=>[e(u,{src:m.post.thumb_url,alt:m.post.title,class:`w-28 shrink-0 rounded-md sm:w-32`},null,8,[`src`,`alt`]),n(`div`,d,[e(l,{category:m.post.category},null,8,[`category`]),n(`h3`,f,a(m.post.title),1),n(`p`,p,a(t(c)(m.post.published_at)),1)])]),_:1},8,[`href`]))}};export{m as t}; \ No newline at end of file diff --git a/public/build/assets/Organigram-B8RSJdkM.js b/public/build/assets/Organigram-DZSdBh0y.js similarity index 96% rename from public/build/assets/Organigram-B8RSJdkM.js rename to public/build/assets/Organigram-DZSdBh0y.js index 9e6e9747..32be6259 100644 --- a/public/build/assets/Organigram-B8RSJdkM.js +++ b/public/build/assets/Organigram-DZSdBh0y.js @@ -1 +1 @@ -import{D as e,E as t,Ht as n,On as r,St as i,Zn as a,_ as o,b as s,bt as c,ct as l,er as u,g as d,mt as f,o as p,qt as m,tr as h,tt as g,v as _,vn as v,wt as y,y as b}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o as x,r as S}from"./app-Bu3kn8yd.js";import{O as C,k as w}from"./dist-DtGNiYlK.js";import{B as T,D as E,I as D,N as ee,O,V as k,m as A,p as j}from"./AppIcon-0N56IC2z.js";import{t as M}from"./AppLayout-BxsYt2ib.js";import{C as N,_ as P,t as F,y as I}from"./http-DmyDwIce.js";import{t as L}from"./chevron-up-DJvyZPom.js";import{t as te}from"./minus-CmsbcqBG.js";import{t as ne}from"./plus-B_ij2ng2.js";import{t as R}from"./smartphone-BE2l7T-2.js";import{t as z}from"./EmptyState-Ceq4v8mE.js";import{t as B}from"./PageHeader-Ybe7qDu5.js";import{t as V}from"./button-ZHC5mKey.js";import{t as H}from"./Input-FGSb2-yK.js";import{t as U}from"./Skeleton-fJgmuUSB.js";import{t as W}from"./useStoredChoice-BAacDiWy.js";var G=w({name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]}),K=w({name:`scan-search`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]}),q=[`id`],J={class:`min-w-0 flex-1`},Y=[`title`],X=[`title`,`aria-label`],Z=[`aria-expanded`],Q={__name:`OrgCard`,props:{person:{type:Object,required:!0},compact:{type:Boolean,default:!1},highlighted:{type:Boolean,default:!1},open:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`toggle`,`focus`],setup(n){let i=n,c=d(()=>A(i.person.department));return(i,l)=>(f(),s(`div`,{id:`person-${n.person.id}`,class:a([`group/card relative overflow-hidden rounded-lg border bg-card text-left shadow-xs transition-shadow hover:shadow-sm`,[n.compact?`w-54`:`w-56`,n.highlighted?`border-brand-400 ring-3 ring-brand-300/50`:``]])},[o(`span`,{class:a([`absolute inset-y-0 left-0 w-1 rounded-l-lg`,c.value.bar]),"aria-hidden":`true`},null,2),o(`div`,{class:a([`flex items-center gap-3`,n.compact?`px-3 py-2`:`px-3.5 pt-3 pb-2.5`])},[e(j,{person:n.person,class:a(n.compact?`size-7 text-[10px]`:`size-10`)},null,8,[`person`,`class`]),o(`div`,J,[n.person.department&&!n.compact?(f(),s(`p`,{key:0,class:a([`truncate text-[10.5px] font-semibold tracking-wide uppercase`,c.value.text])},h(n.person.department),3)):b(``,!0),e(r(S),{href:`/personen/${n.person.id}`,class:`block truncate text-sm leading-tight font-semibold hover:underline`},{default:m(()=>[t(h(n.person.name),1)]),_:1},8,[`href`]),o(`p`,{class:`truncate text-xs leading-tight text-muted-foreground`,title:n.person.job_title},h(n.person.job_title||`–`),9,Y)])],2),o(`button`,{type:`button`,class:`absolute top-1.5 right-1.5 grid size-7 place-items-center rounded-md text-muted-foreground opacity-0 transition-opacity group-hover/card:opacity-100 hover:bg-accent hover:text-foreground focus-visible:opacity-100`,title:`${n.person.name} in den Fokus`,"aria-label":`${n.person.name} in den Fokus`,onClick:l[0]||=e=>i.$emit(`focus`,n.person)},[e(r(K),{class:`size-4`})],8,X),!n.compact&&n.person.reports?(f(),s(`button`,{key:0,type:`button`,class:a([`flex w-full items-center justify-center gap-1.5 rounded-b-lg border-t py-1.5 text-xs font-medium hover:bg-accent`,n.open?`bg-brand-soft/60 text-brand-soft-foreground`:`text-muted-foreground`]),"aria-expanded":n.open,onClick:l[1]||=e=>i.$emit(`toggle`)},[n.loading?(f(),_(r(C),{key:0,class:`size-3.5 animate-spin`})):(f(),_(y(n.open?r(L):r(N)),{key:1,class:`size-3.5`})),t(` `+h(n.person.reports)+` `+h(n.person.reports===1?`Person`:`Personen`)+` im Team `,1)],10,Z)):b(``,!0)],10,q))}},re={key:0,"aria-busy":`true`},ie={class:`org-members`},ae={class:`grid flex-1 gap-1.5`},oe={key:1},se={key:0},ce={__name:`OrgChartNode`,props:{person:{type:Object,required:!0},teams:{type:Object,default:()=>({})},open:{type:Array,default:()=>[]},focus:{type:Number,default:null}},emits:[`focus`],setup(t){let l=t,u=()=>l.open.includes(l.person.id)&&l.teams[l.person.id]!==void 0,m=v(l.teams[l.person.id]??null),h=v(u()),g=v(!1);n(()=>l.teams,e=>{m.value=e[l.person.id]??m.value,h.value=u()});let y=d(()=>(m.value??[]).filter(e=>e.reports)),x=d(()=>(m.value??[]).filter(e=>!e.reports));async function S(){if(h.value=!h.value,h.value&&m.value===null){g.value=!0;try{m.value=(await F.get(`/personen/organigramm/${l.person.id}/team`)).team}catch{h.value=!1}finally{g.value=!1}}}return(n,l)=>{let u=i(`OrgChartNode`,!0);return f(),s(`li`,null,[e(Q,{person:t.person,highlighted:t.person.id===t.focus,open:h.value,loading:g.value,onToggle:S,onFocus:l[0]||=e=>n.$emit(`focus`,e)},null,8,[`person`,`highlighted`,`open`,`loading`]),h.value&&g.value?(f(),s(`ul`,re,[o(`li`,null,[o(`div`,ie,[(f(),s(p,null,c(3,t=>o(`div`,{key:t,class:`flex w-54 items-center gap-3 rounded-lg border bg-card px-3 py-2`},[e(r(U),{class:`size-7 rounded-full`}),o(`div`,ae,[e(r(U),{class:`h-3 w-3/4`}),e(r(U),{class:`h-2.5 w-1/2`})])])),64))])])])):h.value&&m.value?.length?(f(),s(`ul`,oe,[(f(!0),s(p,null,c(y.value,e=>(f(),_(u,{key:e.id,person:e,teams:t.teams,open:t.open,focus:t.focus,onFocus:l[1]||=e=>n.$emit(`focus`,e)},null,8,[`person`,`teams`,`open`,`focus`]))),128)),x.value.length?(f(),s(`li`,se,[o(`div`,{class:a([`org-members`,{"org-members-wide":x.value.length>8}])},[(f(!0),s(p,null,c(x.value,e=>(f(),_(Q,{key:e.id,person:e,compact:``,highlighted:e.id===t.focus,onFocus:l[2]||=e=>n.$emit(`focus`,e)},null,8,[`person`,`highlighted`]))),128))],2)])):b(``,!0)])):b(``,!0)])}}},le={class:`relative overflow-hidden rounded-lg border bg-card`},ue={class:`absolute top-3 right-3 z-10 flex items-center rounded-md border bg-card shadow-xs`},de={class:`w-11 text-center text-xs text-muted-foreground tabular-nums`},fe={class:`org-tree`},pe={__name:`OrgChart`,props:{roots:{type:Array,required:!0},teams:{type:Object,default:()=>({})},open:{type:Array,default:()=>[]},focus:{type:Number,default:null}},emits:[`focus`],setup(t){let i=t,a=v(null),d=v(1),m=[.5,.67,.8,1,1.15];function y(e){let t=m.findIndex(e=>e>=d.value-.001);d.value=m[Math.min(m.length-1,Math.max(0,t+e))]}function b(){let e=a.value;if(!e)return;let t=e.scrollWidth/d.value;d.value=Math.max(.4,Math.min(1,(e.clientWidth-32)/t)),g(()=>e.scrollLeft=(e.scrollWidth-e.clientWidth)/2)}let x=null;function S(e){e.pointerType!==`mouse`||e.button!==0||e.target.closest(`a, button`)||(x={x:e.clientX,y:e.clientY,left:a.value.scrollLeft,top:a.value.scrollTop},a.value.setPointerCapture(e.pointerId))}function C(e){x&&(a.value.scrollLeft=x.left-(e.clientX-x.x),a.value.scrollTop=x.top-(e.clientY-x.y))}function w(){x=null}function T(){g(()=>{let e=a.value,t=i.focus&&document.getElementById(`person-${i.focus}`)||i.roots.length&&document.getElementById(`person-${i.roots[0].id}`);if(e&&t){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();e.scrollLeft+=n.left-r.left-(r.width-n.width)/2,i.focus&&(e.scrollTop+=n.top-r.top-Math.min(120,(r.height-n.height)/2))}})}return l(T),n(()=>i.focus,T),(n,i)=>(f(),s(`div`,le,[o(`div`,ue,[o(`button`,{type:`button`,class:`grid size-8 place-items-center text-muted-foreground hover:text-foreground`,"aria-label":`Verkleinern`,onClick:i[0]||=e=>y(-1)},[e(r(te),{class:`size-4`})]),o(`span`,de,h(Math.round(d.value*100))+` %`,1),o(`button`,{type:`button`,class:`grid size-8 place-items-center text-muted-foreground hover:text-foreground`,"aria-label":`Vergrößern`,onClick:i[1]||=e=>y(1)},[e(r(ne),{class:`size-4`})]),i[3]||=o(`span`,{class:`h-5 w-px bg-border`},null,-1),o(`button`,{type:`button`,class:`grid size-8 place-items-center text-muted-foreground hover:text-foreground`,title:`Einpassen`,"aria-label":`Einpassen`,onClick:b},[e(r(G),{class:`size-4`})])]),o(`div`,{ref_key:`canvas`,ref:a,class:`org-canvas max-h-[calc(100vh-12rem)] min-h-[18rem] cursor-grab overflow-auto active:cursor-grabbing`,onPointerdown:S,onPointermove:C,onPointerup:w,onPointercancel:w},[o(`div`,{class:`inline-block min-w-full px-8 pt-7 pb-8`,style:u({zoom:d.value})},[o(`ul`,fe,[(f(!0),s(p,null,c(t.roots,e=>(f(),_(ce,{key:e.id,person:e,teams:t.teams,open:t.open,focus:t.focus,onFocus:i[2]||=e=>n.$emit(`focus`,e)},null,8,[`person`,`teams`,`open`,`focus`]))),128))])],4)],544)]))}},me={class:`grid gap-5`},he={class:`relative overflow-hidden rounded-lg border bg-card`},ge={class:`flex flex-col gap-5 p-5 sm:flex-row sm:items-center`},_e={class:`min-w-0 flex-1`},ve={class:`text-xl leading-tight font-semibold tracking-tight`},ye={key:1,class:`text-sm text-muted-foreground`},be={class:`mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[13px]`},xe=[`href`],Se={key:1,class:`truncate text-muted-foreground`},Ce={class:`flex shrink-0 flex-wrap gap-2 sm:flex-col`},we={class:`rounded-lg border bg-card`},Te={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},Ee={class:`font-normal text-muted-foreground`},De={key:0,class:`overflow-hidden rounded-b-lg`},Oe={class:`-mr-px -mb-px grid sm:grid-cols-2 xl:grid-cols-3`},ke=[`onClick`],Ae={class:`min-w-0 flex-1`},je={class:`block truncate text-sm font-medium`},Me={class:`block truncate text-xs text-muted-foreground`},Ne=[`title`],Pe={key:0,class:`flex items-center gap-1 px-4 pb-2.5 pl-16`},Fe=[`title`,`onClick`],Ie={key:0,class:`ml-1 text-xs text-muted-foreground`},Le={key:1,class:`px-4 py-3 text-[13px] text-muted-foreground`},Re={key:0,class:`grid gap-5`},ze={key:0,class:`rounded-lg border bg-card`},Be={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},Ve={class:`p-2`},He={key:0,class:`absolute top-9 bottom-0 left-[1.45rem] w-px bg-border`,"aria-hidden":`true`},Ue=[`onClick`],We={class:`min-w-0`},Ge={class:`block truncate text-sm font-medium`},Ke={class:`block truncate text-xs text-muted-foreground`},qe={key:1,class:`rounded-lg border bg-card`},Je={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},Ye={class:`font-normal text-muted-foreground`},Xe={class:`max-h-80 overflow-y-auto p-2`},Ze=[`onClick`],Qe={class:`min-w-0`},$e={class:`block truncate text-[13px] font-medium`},et={class:`block truncate text-xs text-muted-foreground`},tt={__name:`OrgFocus`,props:{roots:{type:Array,required:!0},teams:{type:Object,default:()=>({})},path:{type:Array,default:()=>[]},details:{type:Object,required:!0}},emits:[`focus`,`show-in-tree`],setup(n){let i=n,l=d(()=>{let e=new Map;return[...i.roots,...Object.values(i.teams).flat()].forEach(t=>e.set(t.id,t)),e}),u=d(()=>i.path.slice(0,-1).map(e=>l.value.get(e)).filter(Boolean)),g=d(()=>u.value.at(-1)??null),v=d(()=>g.value?(i.teams[g.value.id]??[]).filter(e=>e.id!==i.details.id):[]),x=d(()=>i.teams[i.details.id]??[]),C=d(()=>[{icon:k,value:i.details.email,href:`mailto:${i.details.email}`},{icon:I,value:i.details.phone,href:i.details.phone&&`tel:${i.details.phone}`},{icon:R,value:i.details.mobile,href:i.details.mobile&&`tel:${i.details.mobile}`},{icon:T,value:[i.details.department,i.details.location].filter(Boolean).join(` · `)}].filter(e=>e.value));return(i,l)=>(f(),s(`div`,{class:a([`grid items-start gap-5`,{"lg:grid-cols-[minmax(0,1fr)_19rem]":u.value.length||v.value.length}])},[o(`div`,me,[o(`section`,he,[o(`span`,{class:a([`absolute inset-y-0 left-0 w-1`,r(A)(n.details.department).bar]),"aria-hidden":`true`},null,2),o(`div`,ge,[e(j,{person:n.details,class:`size-20 text-xl ring-4 ring-brand-soft`},null,8,[`person`]),o(`div`,_e,[n.details.department?(f(),s(`p`,{key:0,class:a([`text-[11px] font-semibold tracking-wide uppercase`,r(A)(n.details.department).text])},h(n.details.department),3)):b(``,!0),o(`h2`,ve,h(n.details.name),1),n.details.job_title?(f(),s(`p`,ye,h(n.details.job_title),1)):b(``,!0),o(`ul`,be,[(f(!0),s(p,null,c(C.value,e=>(f(),s(`li`,{key:e.value,class:`flex min-w-0 items-center gap-1.5`},[(f(),_(y(e.icon),{class:`size-3.5 shrink-0 text-muted-foreground`})),e.href?(f(),s(`a`,{key:0,href:e.href,class:`truncate text-brand-text hover:underline`},h(e.value),9,xe)):(f(),s(`span`,Se,h(e.value),1))]))),128))])]),o(`div`,Ce,[e(r(V),{size:`sm`,"as-child":``},{default:m(()=>[e(r(S),{href:`/personen/${n.details.id}`},{default:m(()=>[e(r(O)),l[1]||=t(` Profil`,-1)]),_:1},8,[`href`])]),_:1}),e(r(V),{variant:`outline`,size:`sm`,onClick:l[0]||=e=>i.$emit(`show-in-tree`,n.details)},{default:m(()=>[e(r(D)),l[2]||=t(` Im Baum`,-1)]),_:1})])])]),o(`section`,we,[o(`h3`,Te,[e(r(E),{class:`size-4 text-brand-text`}),l[3]||=t(` Direkt unterstellt `,-1),o(`span`,Ee,h(x.value.length),1)]),x.value.length?(f(),s(`div`,De,[o(`ul`,Oe,[(f(!0),s(p,null,c(x.value,a=>(f(),s(`li`,{key:a.id,class:`border-r border-b hover:bg-accent/60`},[o(`button`,{type:`button`,class:`flex w-full items-center gap-3 px-4 py-3 text-left`,onClick:e=>i.$emit(`focus`,a)},[e(j,{person:a,class:`size-9`},null,8,[`person`]),o(`span`,Ae,[o(`span`,je,h(a.name),1),o(`span`,Me,h(a.job_title||`–`),1)]),a.reports?(f(),s(`span`,{key:0,class:`inline-flex shrink-0 items-center gap-1 rounded-full bg-brand-soft px-2 py-0.5 text-[11px] font-medium text-brand-soft-foreground`,title:`${a.reports} im Team`},[e(r(E),{class:`size-3`}),t(` `+h(a.reports),1)],8,Ne)):b(``,!0)],8,ke),n.teams[a.id]?.length?(f(),s(`div`,Pe,[(f(!0),s(p,null,c(n.teams[a.id].slice(0,7),t=>(f(),s(`button`,{key:t.id,type:`button`,class:`-ml-1 rounded-full ring-2 ring-card first:ml-0 hover:ring-brand-300`,title:`${t.name}${t.job_title?` – `+t.job_title:``}`,onClick:e=>i.$emit(`focus`,t)},[e(j,{person:t,class:`size-6 text-[9px]`},null,8,[`person`])],8,Fe))),128)),n.teams[a.id].length>7?(f(),s(`span`,Ie,`+`+h(n.teams[a.id].length-7),1)):b(``,!0)])):b(``,!0)]))),128))])])):(f(),s(`p`,Le,`Keine direkt unterstellten Personen.`))])]),u.value.length||v.value.length?(f(),s(`aside`,Re,[u.value.length?(f(),s(`section`,ze,[o(`h3`,Be,[e(r(L),{class:`size-4 text-brand-text`}),l[4]||=t(` Berichtet an`,-1)]),o(`ol`,Ve,[(f(!0),s(p,null,c([...u.value].reverse(),(t,n)=>(f(),s(`li`,{key:t.id,class:`relative`},[ni.$emit(`focus`,t)},[e(j,{person:t,class:`size-8 text-[11px]`},null,8,[`person`]),o(`span`,We,[o(`span`,Ge,h(t.name),1),o(`span`,Ke,h(t.job_title||t.department||`–`),1)])],8,Ue)]))),128))])])):b(``,!0),v.value.length?(f(),s(`section`,qe,[o(`h3`,Je,[e(r(E),{class:`size-4 text-brand-text`}),l[5]||=t(` Im selben Team `,-1),o(`span`,Ye,h(v.value.length),1)]),o(`ul`,Xe,[(f(!0),s(p,null,c(v.value,t=>(f(),s(`li`,{key:t.id},[o(`button`,{type:`button`,class:`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left hover:bg-accent`,onClick:e=>i.$emit(`focus`,t)},[e(j,{person:t,class:`size-7 text-[10px]`},null,8,[`person`]),o(`span`,Qe,[o(`span`,$e,h(t.name),1),o(`span`,et,h(t.job_title||`–`),1)])],8,Ze)]))),128))])])):b(``,!0)])):b(``,!0)],2))}},$={class:`flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center`},nt={class:`inline-flex self-start rounded-md border bg-card p-0.5`,role:`group`,"aria-label":`Ansicht`},rt=[`aria-pressed`,`onClick`],it={class:`relative sm:w-80`},at={key:0,class:`absolute inset-x-0 top-full z-30 mt-1 max-h-72 overflow-y-auto rounded-md border bg-popover p-1 shadow-md`},ot=[`onClick`],st={class:`min-w-0`},ct={class:`block truncate font-medium`},lt={class:`block truncate text-xs text-muted-foreground`},ut={key:0,class:`rounded-lg border bg-card`},dt={key:0,class:`mb-3 flex items-center gap-2 text-[13px]`},ft={key:1,class:`mb-3 flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,"aria-label":`Abteilungen`},pt={key:3,class:`mt-4 text-[13px] text-muted-foreground`},mt={__name:`Organigram`,props:{roots:{type:Array,required:!0},path:{type:Array,default:()=>[]},open:{type:Array,default:()=>[]},teams:{type:Object,default:()=>({})},focus:{type:Number,default:null},details:{type:Object,default:null},view:{type:String,default:`baum`},stats:{type:Object,default:()=>({people:0,leaders:0})},unassigned:{type:Number,default:0}},setup(i){let u=i,g=W(`organigram.view`,`baum`,[`baum`,`fokus`]);l(()=>{!new URLSearchParams(window.location.search).has(`ansicht`)&&g.value!==u.view&&C(g.value,u.focus,!0)}),n(()=>u.view,e=>g.value=e);function C(e,t=u.focus,n=!1){let r={ansicht:e};t&&(r.person=t),x.get(`/personen/organigramm`,r,{preserveScroll:e===`fokus`,replace:n})}let w=v(``),T=v([]),E;n(w,e=>{if(clearTimeout(E),e.trim().length<2){T.value=[];return}E=setTimeout(async()=>{T.value=(await F.get(`/personen/suche?q=${encodeURIComponent(e.trim())}`)).people},250)});function O(e){w.value=``,T.value=[],C(u.view,e.id)}let k=e=>e.toLocaleString(`de-DE`),N=d(()=>[...new Set([...u.roots,...Object.values(u.teams).flat()].map(e=>e.department).filter(Boolean))].sort((e,t)=>e.localeCompare(t,`de`)).slice(0,16));return(n,l)=>(f(),_(M,{title:`Organigramm`},{default:m(()=>[e(B,{title:`Organigramm`,breadcrumbs:[{label:`Personen`,href:`/personen`}],description:`${k(i.stats.people)} Personen · ${k(i.stats.leaders)} mit Personalverantwortung`},{actions:m(()=>[o(`div`,$,[o(`div`,nt,[(f(!0),s(p,null,c([{key:`baum`,icon:r(D),label:`Baum`},{key:`fokus`,icon:r(K),label:`Fokus`}],e=>(f(),s(`button`,{key:e.key,type:`button`,class:a([`inline-flex h-9 items-center gap-1.5 rounded px-3 text-[13px]`,i.view===e.key?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-muted-foreground hover:text-foreground`]),"aria-pressed":i.view===e.key,onClick:t=>i.view!==e.key&&C(e.key)},[(f(),_(y(e.icon),{class:`size-4`})),t(` `+h(e.label),1)],10,rt))),128))]),o(`div`,it,[e(r(ee),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),e(r(H),{modelValue:w.value,"onUpdate:modelValue":l[0]||=e=>w.value=e,class:`h-10 bg-card pl-9`,placeholder:`Person finden …`,"aria-label":`Person im Organigramm finden`,autocomplete:`off`},null,8,[`modelValue`]),T.value.length?(f(),s(`ul`,at,[(f(!0),s(p,null,c(T.value,t=>(f(),s(`li`,{key:t.id},[o(`button`,{type:`button`,class:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm hover:bg-accent`,onClick:e=>O(t)},[e(j,{person:t,class:`size-7 text-[10px]`},null,8,[`person`]),o(`span`,st,[o(`span`,ct,h(t.name),1),o(`span`,lt,h(t.job_title),1)])],8,ot)]))),128))])):b(``,!0)])])]),_:1},8,[`description`]),i.roots.length?i.view===`fokus`&&i.details?(f(),_(tt,{key:1,roots:i.roots,teams:i.teams,path:i.path,details:i.details,onFocus:l[1]||=e=>C(`fokus`,e.id),onShowInTree:l[2]||=e=>C(`baum`,e.id)},null,8,[`roots`,`teams`,`path`,`details`])):(f(),s(p,{key:2},[i.focus?(f(),s(`div`,dt,[l[5]||=o(`span`,{class:`text-muted-foreground`},`Der Weg zur gesuchten Person ist aufgeklappt.`,-1),e(r(S),{href:`/personen/organigramm?ansicht=baum`,class:`inline-flex items-center gap-1 font-medium text-brand-text hover:underline`},{default:m(()=>[e(r(P),{class:`size-3.5`}),l[4]||=t(` Zurücksetzen`,-1)]),_:1})])):b(``,!0),N.value.length>1?(f(),s(`ul`,ft,[(f(!0),s(p,null,c(N.value,e=>(f(),s(`li`,{key:e,class:`flex items-center gap-1.5`},[o(`span`,{class:a([`size-2.5 rounded-sm`,r(A)(e).bar])},null,2),t(h(e),1)]))),128))])):b(``,!0),e(pe,{roots:i.roots,teams:i.teams,open:i.open,focus:i.focus,onFocus:l[3]||=e=>C(`fokus`,e.id)},null,8,[`roots`,`teams`,`open`,`focus`])],64)):(f(),s(`div`,ut,[e(z,{icon:r(D),title:`Noch kein Organigramm`,text:`Es sind noch keine Vorgesetzten hinterlegt. Sie kommen aus dem Anmeldedienst (z. B. Entra ID) oder werden im Admin-Bereich bei den Benutzern eingetragen.`},null,8,[`icon`])])),i.unassigned?(f(),s(`p`,pt,h(i.unassigned===1?`1 Person`:`${k(i.unassigned)} Personen`)+` ohne Vorgesetzte*n und ohne Team `+h(i.unassigned===1?`erscheint`:`erscheinen`)+` hier nicht. `,1)):b(``,!0)]),_:1}))}};export{mt as default}; \ No newline at end of file +import{D as e,E as t,Ht as n,On as r,St as i,Zn as a,_ as o,b as s,bt as c,ct as l,er as u,g as d,mt as f,o as p,qt as m,tr as h,tt as g,v as _,vn as v,wt as y,y as b}from"./runtime-core.esm-bundler-B8D2lM98.js";import{o as x,r as S}from"./app-BNwrc_lv.js";import{O as C,k as w}from"./dist-DtGNiYlK.js";import{B as T,D as E,I as D,N as ee,O,V as k,m as A,p as j}from"./AppIcon-nlhvQfK7.js";import{t as M}from"./AppLayout-esQiy2nD.js";import{b as N,n as P,v as F,w as I}from"./http-CAG9BrJF.js";import{t as L}from"./chevron-up-DJvyZPom.js";import{t as te}from"./minus-CmsbcqBG.js";import{t as ne}from"./plus-B_ij2ng2.js";import{t as R}from"./smartphone-BE2l7T-2.js";import{t as z}from"./EmptyState-Ceq4v8mE.js";import{t as B}from"./PageHeader-BMzzCXfT.js";import{n as V}from"./button-CwUSbS9X.js";import{t as H}from"./Input-FGSb2-yK.js";import{t as U}from"./Skeleton-fJgmuUSB.js";import{t as W}from"./useStoredChoice-BAacDiWy.js";var G=w({name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]}),K=w({name:`scan-search`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]}),q=[`id`],J={class:`min-w-0 flex-1`},Y=[`title`],X=[`title`,`aria-label`],Z=[`aria-expanded`],Q={__name:`OrgCard`,props:{person:{type:Object,required:!0},compact:{type:Boolean,default:!1},highlighted:{type:Boolean,default:!1},open:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`toggle`,`focus`],setup(n){let i=n,c=d(()=>A(i.person.department));return(i,l)=>(f(),s(`div`,{id:`person-${n.person.id}`,class:a([`group/card relative overflow-hidden rounded-lg border bg-card text-left shadow-xs transition-shadow hover:shadow-sm`,[n.compact?`w-54`:`w-56`,n.highlighted?`border-brand-400 ring-3 ring-brand-300/50`:``]])},[o(`span`,{class:a([`absolute inset-y-0 left-0 w-1 rounded-l-lg`,c.value.bar]),"aria-hidden":`true`},null,2),o(`div`,{class:a([`flex items-center gap-3`,n.compact?`px-3 py-2`:`px-3.5 pt-3 pb-2.5`])},[e(j,{person:n.person,class:a(n.compact?`size-7 text-[10px]`:`size-10`)},null,8,[`person`,`class`]),o(`div`,J,[n.person.department&&!n.compact?(f(),s(`p`,{key:0,class:a([`truncate text-[10.5px] font-semibold tracking-wide uppercase`,c.value.text])},h(n.person.department),3)):b(``,!0),e(r(S),{href:`/personen/${n.person.id}`,class:`block truncate text-sm leading-tight font-semibold hover:underline`},{default:m(()=>[t(h(n.person.name),1)]),_:1},8,[`href`]),o(`p`,{class:`truncate text-xs leading-tight text-muted-foreground`,title:n.person.job_title},h(n.person.job_title||`–`),9,Y)])],2),o(`button`,{type:`button`,class:`absolute top-1.5 right-1.5 grid size-7 place-items-center rounded-md text-muted-foreground opacity-0 transition-opacity group-hover/card:opacity-100 hover:bg-accent hover:text-foreground focus-visible:opacity-100`,title:`${n.person.name} in den Fokus`,"aria-label":`${n.person.name} in den Fokus`,onClick:l[0]||=e=>i.$emit(`focus`,n.person)},[e(r(K),{class:`size-4`})],8,X),!n.compact&&n.person.reports?(f(),s(`button`,{key:0,type:`button`,class:a([`flex w-full items-center justify-center gap-1.5 rounded-b-lg border-t py-1.5 text-xs font-medium hover:bg-accent`,n.open?`bg-brand-soft/60 text-brand-soft-foreground`:`text-muted-foreground`]),"aria-expanded":n.open,onClick:l[1]||=e=>i.$emit(`toggle`)},[n.loading?(f(),_(r(C),{key:0,class:`size-3.5 animate-spin`})):(f(),_(y(n.open?r(L):r(I)),{key:1,class:`size-3.5`})),t(` `+h(n.person.reports)+` `+h(n.person.reports===1?`Person`:`Personen`)+` im Team `,1)],10,Z)):b(``,!0)],10,q))}},re={key:0,"aria-busy":`true`},ie={class:`org-members`},ae={class:`grid flex-1 gap-1.5`},oe={key:1},se={key:0},ce={__name:`OrgChartNode`,props:{person:{type:Object,required:!0},teams:{type:Object,default:()=>({})},open:{type:Array,default:()=>[]},focus:{type:Number,default:null}},emits:[`focus`],setup(t){let l=t,u=()=>l.open.includes(l.person.id)&&l.teams[l.person.id]!==void 0,m=v(l.teams[l.person.id]??null),h=v(u()),g=v(!1);n(()=>l.teams,e=>{m.value=e[l.person.id]??m.value,h.value=u()});let y=d(()=>(m.value??[]).filter(e=>e.reports)),x=d(()=>(m.value??[]).filter(e=>!e.reports));async function S(){if(h.value=!h.value,h.value&&m.value===null){g.value=!0;try{m.value=(await P.get(`/personen/organigramm/${l.person.id}/team`)).team}catch{h.value=!1}finally{g.value=!1}}}return(n,l)=>{let u=i(`OrgChartNode`,!0);return f(),s(`li`,null,[e(Q,{person:t.person,highlighted:t.person.id===t.focus,open:h.value,loading:g.value,onToggle:S,onFocus:l[0]||=e=>n.$emit(`focus`,e)},null,8,[`person`,`highlighted`,`open`,`loading`]),h.value&&g.value?(f(),s(`ul`,re,[o(`li`,null,[o(`div`,ie,[(f(),s(p,null,c(3,t=>o(`div`,{key:t,class:`flex w-54 items-center gap-3 rounded-lg border bg-card px-3 py-2`},[e(r(U),{class:`size-7 rounded-full`}),o(`div`,ae,[e(r(U),{class:`h-3 w-3/4`}),e(r(U),{class:`h-2.5 w-1/2`})])])),64))])])])):h.value&&m.value?.length?(f(),s(`ul`,oe,[(f(!0),s(p,null,c(y.value,e=>(f(),_(u,{key:e.id,person:e,teams:t.teams,open:t.open,focus:t.focus,onFocus:l[1]||=e=>n.$emit(`focus`,e)},null,8,[`person`,`teams`,`open`,`focus`]))),128)),x.value.length?(f(),s(`li`,se,[o(`div`,{class:a([`org-members`,{"org-members-wide":x.value.length>8}])},[(f(!0),s(p,null,c(x.value,e=>(f(),_(Q,{key:e.id,person:e,compact:``,highlighted:e.id===t.focus,onFocus:l[2]||=e=>n.$emit(`focus`,e)},null,8,[`person`,`highlighted`]))),128))],2)])):b(``,!0)])):b(``,!0)])}}},le={class:`relative overflow-hidden rounded-lg border bg-card`},ue={class:`absolute top-3 right-3 z-10 flex items-center rounded-md border bg-card shadow-xs`},de={class:`w-11 text-center text-xs text-muted-foreground tabular-nums`},fe={class:`org-tree`},pe={__name:`OrgChart`,props:{roots:{type:Array,required:!0},teams:{type:Object,default:()=>({})},open:{type:Array,default:()=>[]},focus:{type:Number,default:null}},emits:[`focus`],setup(t){let i=t,a=v(null),d=v(1),m=[.5,.67,.8,1,1.15];function y(e){let t=m.findIndex(e=>e>=d.value-.001);d.value=m[Math.min(m.length-1,Math.max(0,t+e))]}function b(){let e=a.value;if(!e)return;let t=e.scrollWidth/d.value;d.value=Math.max(.4,Math.min(1,(e.clientWidth-32)/t)),g(()=>e.scrollLeft=(e.scrollWidth-e.clientWidth)/2)}let x=null;function S(e){e.pointerType!==`mouse`||e.button!==0||e.target.closest(`a, button`)||(x={x:e.clientX,y:e.clientY,left:a.value.scrollLeft,top:a.value.scrollTop},a.value.setPointerCapture(e.pointerId))}function C(e){x&&(a.value.scrollLeft=x.left-(e.clientX-x.x),a.value.scrollTop=x.top-(e.clientY-x.y))}function w(){x=null}function T(){g(()=>{let e=a.value,t=i.focus&&document.getElementById(`person-${i.focus}`)||i.roots.length&&document.getElementById(`person-${i.roots[0].id}`);if(e&&t){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();e.scrollLeft+=n.left-r.left-(r.width-n.width)/2,i.focus&&(e.scrollTop+=n.top-r.top-Math.min(120,(r.height-n.height)/2))}})}return l(T),n(()=>i.focus,T),(n,i)=>(f(),s(`div`,le,[o(`div`,ue,[o(`button`,{type:`button`,class:`grid size-8 place-items-center text-muted-foreground hover:text-foreground`,"aria-label":`Verkleinern`,onClick:i[0]||=e=>y(-1)},[e(r(te),{class:`size-4`})]),o(`span`,de,h(Math.round(d.value*100))+` %`,1),o(`button`,{type:`button`,class:`grid size-8 place-items-center text-muted-foreground hover:text-foreground`,"aria-label":`Vergrößern`,onClick:i[1]||=e=>y(1)},[e(r(ne),{class:`size-4`})]),i[3]||=o(`span`,{class:`h-5 w-px bg-border`},null,-1),o(`button`,{type:`button`,class:`grid size-8 place-items-center text-muted-foreground hover:text-foreground`,title:`Einpassen`,"aria-label":`Einpassen`,onClick:b},[e(r(G),{class:`size-4`})])]),o(`div`,{ref_key:`canvas`,ref:a,class:`org-canvas max-h-[calc(100vh-12rem)] min-h-[18rem] cursor-grab overflow-auto active:cursor-grabbing`,onPointerdown:S,onPointermove:C,onPointerup:w,onPointercancel:w},[o(`div`,{class:`inline-block min-w-full px-8 pt-7 pb-8`,style:u({zoom:d.value})},[o(`ul`,fe,[(f(!0),s(p,null,c(t.roots,e=>(f(),_(ce,{key:e.id,person:e,teams:t.teams,open:t.open,focus:t.focus,onFocus:i[2]||=e=>n.$emit(`focus`,e)},null,8,[`person`,`teams`,`open`,`focus`]))),128))])],4)],544)]))}},me={class:`grid gap-5`},he={class:`relative overflow-hidden rounded-lg border bg-card`},ge={class:`flex flex-col gap-5 p-5 sm:flex-row sm:items-center`},_e={class:`min-w-0 flex-1`},ve={class:`text-xl leading-tight font-semibold tracking-tight`},ye={key:1,class:`text-sm text-muted-foreground`},be={class:`mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[13px]`},xe=[`href`],Se={key:1,class:`truncate text-muted-foreground`},Ce={class:`flex shrink-0 flex-wrap gap-2 sm:flex-col`},we={class:`rounded-lg border bg-card`},Te={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},Ee={class:`font-normal text-muted-foreground`},De={key:0,class:`overflow-hidden rounded-b-lg`},Oe={class:`-mr-px -mb-px grid sm:grid-cols-2 xl:grid-cols-3`},ke=[`onClick`],Ae={class:`min-w-0 flex-1`},je={class:`block truncate text-sm font-medium`},Me={class:`block truncate text-xs text-muted-foreground`},Ne=[`title`],Pe={key:0,class:`flex items-center gap-1 px-4 pb-2.5 pl-16`},Fe=[`title`,`onClick`],Ie={key:0,class:`ml-1 text-xs text-muted-foreground`},Le={key:1,class:`px-4 py-3 text-[13px] text-muted-foreground`},Re={key:0,class:`grid gap-5`},ze={key:0,class:`rounded-lg border bg-card`},Be={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},Ve={class:`p-2`},He={key:0,class:`absolute top-9 bottom-0 left-[1.45rem] w-px bg-border`,"aria-hidden":`true`},Ue=[`onClick`],We={class:`min-w-0`},Ge={class:`block truncate text-sm font-medium`},Ke={class:`block truncate text-xs text-muted-foreground`},qe={key:1,class:`rounded-lg border bg-card`},Je={class:`flex items-center gap-2 border-b px-4 py-2.5 text-sm font-semibold`},Ye={class:`font-normal text-muted-foreground`},Xe={class:`max-h-80 overflow-y-auto p-2`},Ze=[`onClick`],Qe={class:`min-w-0`},$e={class:`block truncate text-[13px] font-medium`},et={class:`block truncate text-xs text-muted-foreground`},tt={__name:`OrgFocus`,props:{roots:{type:Array,required:!0},teams:{type:Object,default:()=>({})},path:{type:Array,default:()=>[]},details:{type:Object,required:!0}},emits:[`focus`,`show-in-tree`],setup(n){let i=n,l=d(()=>{let e=new Map;return[...i.roots,...Object.values(i.teams).flat()].forEach(t=>e.set(t.id,t)),e}),u=d(()=>i.path.slice(0,-1).map(e=>l.value.get(e)).filter(Boolean)),g=d(()=>u.value.at(-1)??null),v=d(()=>g.value?(i.teams[g.value.id]??[]).filter(e=>e.id!==i.details.id):[]),x=d(()=>i.teams[i.details.id]??[]),C=d(()=>[{icon:k,value:i.details.email,href:`mailto:${i.details.email}`},{icon:N,value:i.details.phone,href:i.details.phone&&`tel:${i.details.phone}`},{icon:R,value:i.details.mobile,href:i.details.mobile&&`tel:${i.details.mobile}`},{icon:T,value:[i.details.department,i.details.location].filter(Boolean).join(` · `)}].filter(e=>e.value));return(i,l)=>(f(),s(`div`,{class:a([`grid items-start gap-5`,{"lg:grid-cols-[minmax(0,1fr)_19rem]":u.value.length||v.value.length}])},[o(`div`,me,[o(`section`,he,[o(`span`,{class:a([`absolute inset-y-0 left-0 w-1`,r(A)(n.details.department).bar]),"aria-hidden":`true`},null,2),o(`div`,ge,[e(j,{person:n.details,class:`size-20 text-xl ring-4 ring-brand-soft`},null,8,[`person`]),o(`div`,_e,[n.details.department?(f(),s(`p`,{key:0,class:a([`text-[11px] font-semibold tracking-wide uppercase`,r(A)(n.details.department).text])},h(n.details.department),3)):b(``,!0),o(`h2`,ve,h(n.details.name),1),n.details.job_title?(f(),s(`p`,ye,h(n.details.job_title),1)):b(``,!0),o(`ul`,be,[(f(!0),s(p,null,c(C.value,e=>(f(),s(`li`,{key:e.value,class:`flex min-w-0 items-center gap-1.5`},[(f(),_(y(e.icon),{class:`size-3.5 shrink-0 text-muted-foreground`})),e.href?(f(),s(`a`,{key:0,href:e.href,class:`truncate text-brand-text hover:underline`},h(e.value),9,xe)):(f(),s(`span`,Se,h(e.value),1))]))),128))])]),o(`div`,Ce,[e(r(V),{size:`sm`,"as-child":``},{default:m(()=>[e(r(S),{href:`/personen/${n.details.id}`},{default:m(()=>[e(r(O)),l[1]||=t(` Profil`,-1)]),_:1},8,[`href`])]),_:1}),e(r(V),{variant:`outline`,size:`sm`,onClick:l[0]||=e=>i.$emit(`show-in-tree`,n.details)},{default:m(()=>[e(r(D)),l[2]||=t(` Im Baum`,-1)]),_:1})])])]),o(`section`,we,[o(`h3`,Te,[e(r(E),{class:`size-4 text-brand-text`}),l[3]||=t(` Direkt unterstellt `,-1),o(`span`,Ee,h(x.value.length),1)]),x.value.length?(f(),s(`div`,De,[o(`ul`,Oe,[(f(!0),s(p,null,c(x.value,a=>(f(),s(`li`,{key:a.id,class:`border-r border-b hover:bg-accent/60`},[o(`button`,{type:`button`,class:`flex w-full items-center gap-3 px-4 py-3 text-left`,onClick:e=>i.$emit(`focus`,a)},[e(j,{person:a,class:`size-9`},null,8,[`person`]),o(`span`,Ae,[o(`span`,je,h(a.name),1),o(`span`,Me,h(a.job_title||`–`),1)]),a.reports?(f(),s(`span`,{key:0,class:`inline-flex shrink-0 items-center gap-1 rounded-full bg-brand-soft px-2 py-0.5 text-[11px] font-medium text-brand-soft-foreground`,title:`${a.reports} im Team`},[e(r(E),{class:`size-3`}),t(` `+h(a.reports),1)],8,Ne)):b(``,!0)],8,ke),n.teams[a.id]?.length?(f(),s(`div`,Pe,[(f(!0),s(p,null,c(n.teams[a.id].slice(0,7),t=>(f(),s(`button`,{key:t.id,type:`button`,class:`-ml-1 rounded-full ring-2 ring-card first:ml-0 hover:ring-brand-300`,title:`${t.name}${t.job_title?` – `+t.job_title:``}`,onClick:e=>i.$emit(`focus`,t)},[e(j,{person:t,class:`size-6 text-[9px]`},null,8,[`person`])],8,Fe))),128)),n.teams[a.id].length>7?(f(),s(`span`,Ie,`+`+h(n.teams[a.id].length-7),1)):b(``,!0)])):b(``,!0)]))),128))])])):(f(),s(`p`,Le,`Keine direkt unterstellten Personen.`))])]),u.value.length||v.value.length?(f(),s(`aside`,Re,[u.value.length?(f(),s(`section`,ze,[o(`h3`,Be,[e(r(L),{class:`size-4 text-brand-text`}),l[4]||=t(` Berichtet an`,-1)]),o(`ol`,Ve,[(f(!0),s(p,null,c([...u.value].reverse(),(t,n)=>(f(),s(`li`,{key:t.id,class:`relative`},[ni.$emit(`focus`,t)},[e(j,{person:t,class:`size-8 text-[11px]`},null,8,[`person`]),o(`span`,We,[o(`span`,Ge,h(t.name),1),o(`span`,Ke,h(t.job_title||t.department||`–`),1)])],8,Ue)]))),128))])])):b(``,!0),v.value.length?(f(),s(`section`,qe,[o(`h3`,Je,[e(r(E),{class:`size-4 text-brand-text`}),l[5]||=t(` Im selben Team `,-1),o(`span`,Ye,h(v.value.length),1)]),o(`ul`,Xe,[(f(!0),s(p,null,c(v.value,t=>(f(),s(`li`,{key:t.id},[o(`button`,{type:`button`,class:`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left hover:bg-accent`,onClick:e=>i.$emit(`focus`,t)},[e(j,{person:t,class:`size-7 text-[10px]`},null,8,[`person`]),o(`span`,Qe,[o(`span`,$e,h(t.name),1),o(`span`,et,h(t.job_title||`–`),1)])],8,Ze)]))),128))])])):b(``,!0)])):b(``,!0)],2))}},$={class:`flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center`},nt={class:`inline-flex self-start rounded-md border bg-card p-0.5`,role:`group`,"aria-label":`Ansicht`},rt=[`aria-pressed`,`onClick`],it={class:`relative sm:w-80`},at={key:0,class:`absolute inset-x-0 top-full z-30 mt-1 max-h-72 overflow-y-auto rounded-md border bg-popover p-1 shadow-md`},ot=[`onClick`],st={class:`min-w-0`},ct={class:`block truncate font-medium`},lt={class:`block truncate text-xs text-muted-foreground`},ut={key:0,class:`rounded-lg border bg-card`},dt={key:0,class:`mb-3 flex items-center gap-2 text-[13px]`},ft={key:1,class:`mb-3 flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,"aria-label":`Abteilungen`},pt={key:3,class:`mt-4 text-[13px] text-muted-foreground`},mt={__name:`Organigram`,props:{roots:{type:Array,required:!0},path:{type:Array,default:()=>[]},open:{type:Array,default:()=>[]},teams:{type:Object,default:()=>({})},focus:{type:Number,default:null},details:{type:Object,default:null},view:{type:String,default:`baum`},stats:{type:Object,default:()=>({people:0,leaders:0})},unassigned:{type:Number,default:0}},setup(i){let u=i,g=W(`organigram.view`,`baum`,[`baum`,`fokus`]);l(()=>{!new URLSearchParams(window.location.search).has(`ansicht`)&&g.value!==u.view&&C(g.value,u.focus,!0)}),n(()=>u.view,e=>g.value=e);function C(e,t=u.focus,n=!1){let r={ansicht:e};t&&(r.person=t),x.get(`/personen/organigramm`,r,{preserveScroll:e===`fokus`,replace:n})}let w=v(``),T=v([]),E;n(w,e=>{if(clearTimeout(E),e.trim().length<2){T.value=[];return}E=setTimeout(async()=>{T.value=(await P.get(`/personen/suche?q=${encodeURIComponent(e.trim())}`)).people},250)});function O(e){w.value=``,T.value=[],C(u.view,e.id)}let k=e=>e.toLocaleString(`de-DE`),N=d(()=>[...new Set([...u.roots,...Object.values(u.teams).flat()].map(e=>e.department).filter(Boolean))].sort((e,t)=>e.localeCompare(t,`de`)).slice(0,16));return(n,l)=>(f(),_(M,{title:`Organigramm`},{default:m(()=>[e(B,{title:`Organigramm`,breadcrumbs:[{label:`Personen`,href:`/personen`}],description:`${k(i.stats.people)} Personen · ${k(i.stats.leaders)} mit Personalverantwortung`},{actions:m(()=>[o(`div`,$,[o(`div`,nt,[(f(!0),s(p,null,c([{key:`baum`,icon:r(D),label:`Baum`},{key:`fokus`,icon:r(K),label:`Fokus`}],e=>(f(),s(`button`,{key:e.key,type:`button`,class:a([`inline-flex h-9 items-center gap-1.5 rounded px-3 text-[13px]`,i.view===e.key?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-muted-foreground hover:text-foreground`]),"aria-pressed":i.view===e.key,onClick:t=>i.view!==e.key&&C(e.key)},[(f(),_(y(e.icon),{class:`size-4`})),t(` `+h(e.label),1)],10,rt))),128))]),o(`div`,it,[e(r(ee),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),e(r(H),{modelValue:w.value,"onUpdate:modelValue":l[0]||=e=>w.value=e,class:`h-10 bg-card pl-9`,placeholder:`Person finden …`,"aria-label":`Person im Organigramm finden`,autocomplete:`off`},null,8,[`modelValue`]),T.value.length?(f(),s(`ul`,at,[(f(!0),s(p,null,c(T.value,t=>(f(),s(`li`,{key:t.id},[o(`button`,{type:`button`,class:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm hover:bg-accent`,onClick:e=>O(t)},[e(j,{person:t,class:`size-7 text-[10px]`},null,8,[`person`]),o(`span`,st,[o(`span`,ct,h(t.name),1),o(`span`,lt,h(t.job_title),1)])],8,ot)]))),128))])):b(``,!0)])])]),_:1},8,[`description`]),i.roots.length?i.view===`fokus`&&i.details?(f(),_(tt,{key:1,roots:i.roots,teams:i.teams,path:i.path,details:i.details,onFocus:l[1]||=e=>C(`fokus`,e.id),onShowInTree:l[2]||=e=>C(`baum`,e.id)},null,8,[`roots`,`teams`,`path`,`details`])):(f(),s(p,{key:2},[i.focus?(f(),s(`div`,dt,[l[5]||=o(`span`,{class:`text-muted-foreground`},`Der Weg zur gesuchten Person ist aufgeklappt.`,-1),e(r(S),{href:`/personen/organigramm?ansicht=baum`,class:`inline-flex items-center gap-1 font-medium text-brand-text hover:underline`},{default:m(()=>[e(r(F),{class:`size-3.5`}),l[4]||=t(` Zurücksetzen`,-1)]),_:1})])):b(``,!0),N.value.length>1?(f(),s(`ul`,ft,[(f(!0),s(p,null,c(N.value,e=>(f(),s(`li`,{key:e,class:`flex items-center gap-1.5`},[o(`span`,{class:a([`size-2.5 rounded-sm`,r(A)(e).bar])},null,2),t(h(e),1)]))),128))])):b(``,!0),e(pe,{roots:i.roots,teams:i.teams,open:i.open,focus:i.focus,onFocus:l[3]||=e=>C(`fokus`,e.id)},null,8,[`roots`,`teams`,`open`,`focus`])],64)):(f(),s(`div`,ut,[e(z,{icon:r(D),title:`Noch kein Organigramm`,text:`Es sind noch keine Vorgesetzten hinterlegt. Sie kommen aus dem Anmeldedienst (z. B. Entra ID) oder werden im Admin-Bereich bei den Benutzern eingetragen.`},null,8,[`icon`])])),i.unassigned?(f(),s(`p`,pt,h(i.unassigned===1?`1 Person`:`${k(i.unassigned)} Personen`)+` ohne Vorgesetzte*n und ohne Team `+h(i.unassigned===1?`erscheint`:`erscheinen`)+` hier nicht. `,1)):b(``,!0)]),_:1}))}};export{mt as default}; \ No newline at end of file diff --git a/public/build/assets/PageContent-bQ_WRrV_.js b/public/build/assets/PageContent-22GSNgo9.js similarity index 93% rename from public/build/assets/PageContent-bQ_WRrV_.js rename to public/build/assets/PageContent-22GSNgo9.js index 2cabe144..6e6e0bb3 100644 --- a/public/build/assets/PageContent-bQ_WRrV_.js +++ b/public/build/assets/PageContent-22GSNgo9.js @@ -1 +1 @@ -import{D as e,J as t,On as n,b as r,bt as i,g as a,gt as o,mt as s,o as c,v as l,wt as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as f}from"./registry-ZZ5qL5ag.js";var p={class:`grid gap-6`},m={__name:`BlockList`,props:{item:{type:Object,required:!0}},setup(e){let a=t(`pagebuilder:types`,{});return(t,o)=>(s(),r(`div`,p,[(s(!0),r(c,null,i(e.item.blocks,e=>(s(),r(c,{key:e.id},[n(f)(n(a)[e.type]?.component??e.component??``)?(s(),l(u(n(f)(n(a)[e.type]?.component??e.component??``)),{key:0,block:e},null,8,[`block`])):d(``,!0)],64))),128))]))}},h={class:`@container`},g={__name:`PageContent`,props:{content:{type:Object,required:!0},types:{type:Object,default:null}},setup(t){let n=t;o(`pagebuilder:list`,m),o(`pagebuilder:editing`,!1),o(`pagebuilder:types`,n.types??{});let i=a(()=>({blocks:n.content.blocks??[]}));return(t,n)=>(s(),r(`div`,h,[e(m,{item:i.value},null,8,[`item`])]))}};export{g as t}; \ No newline at end of file +import{D as e,J as t,On as n,b as r,bt as i,g as a,gt as o,mt as s,o as c,v as l,wt as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as f}from"./registry-w73v-fJQ.js";var p={class:`grid gap-6`},m={__name:`BlockList`,props:{item:{type:Object,required:!0}},setup(e){let a=t(`pagebuilder:types`,{});return(t,o)=>(s(),r(`div`,p,[(s(!0),r(c,null,i(e.item.blocks,e=>(s(),r(c,{key:e.id},[n(f)(n(a)[e.type]?.component??e.component??``)?(s(),l(u(n(f)(n(a)[e.type]?.component??e.component??``)),{key:0,block:e},null,8,[`block`])):d(``,!0)],64))),128))]))}},h={class:`@container`},g={__name:`PageContent`,props:{content:{type:Object,required:!0},types:{type:Object,default:null}},setup(t){let n=t;o(`pagebuilder:list`,m),o(`pagebuilder:editing`,!1),o(`pagebuilder:types`,n.types??{});let i=a(()=>({blocks:n.content.blocks??[]}));return(t,n)=>(s(),r(`div`,h,[e(m,{item:i.value},null,8,[`item`])]))}};export{g as t}; \ No newline at end of file diff --git a/public/build/assets/PageHeader-Ybe7qDu5.js b/public/build/assets/PageHeader-BMzzCXfT.js similarity index 95% rename from public/build/assets/PageHeader-Ybe7qDu5.js rename to public/build/assets/PageHeader-BMzzCXfT.js index 317d138a..0fc0db98 100644 --- a/public/build/assets/PageHeader-Ybe7qDu5.js +++ b/public/build/assets/PageHeader-BMzzCXfT.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,xt as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as p}from"./app-Bu3kn8yd.js";import{t as m}from"./chevron-right-C9w5cb2q.js";var h={class:`mb-6 flex flex-wrap items-end justify-between gap-x-6 gap-y-4`},g={class:`flex min-w-0 items-end gap-3.5`},_={class:`min-w-0`},v={key:0,class:`mb-1 flex flex-wrap items-center gap-1 text-[13px] text-muted-foreground`,"aria-label":`Brotkrumen`},y={class:`text-2xl leading-tight font-semibold tracking-tight`},b={key:1,class:`mt-1 max-w-3xl text-sm text-muted-foreground`},x={key:0,class:`flex w-full flex-wrap items-center gap-2 sm:w-auto`},S={__name:`PageHeader`,props:{title:{type:String,required:!0},description:{type:String,default:``},breadcrumbs:{type:Array,default:()=>[]}},setup(S){return(C,w)=>(o(),i(`header`,h,[r(`div`,g,[d(C.$slots,`leading`),r(`div`,_,[S.breadcrumbs.length?(o(),i(`nav`,v,[(o(!0),i(s,null,a(S.breadcrumbs,(r,a)=>(o(),i(s,{key:r.href},[a?(o(),u(n(m),{key:0,class:`size-3.5`})):f(``,!0),e(n(p),{href:r.href,class:`hover:text-foreground hover:underline`},{default:c(()=>[t(l(r.label),1)]),_:2},1032,[`href`])],64))),128))])):f(``,!0),r(`h1`,y,l(S.title),1),S.description||C.$slots.description?(o(),i(`p`,b,[d(C.$slots,`description`,{},()=>[t(l(S.description),1)])])):f(``,!0)])]),C.$slots.actions?(o(),i(`div`,x,[d(C.$slots,`actions`)])):f(``,!0)]))}};export{S as t}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,xt as d,y as f}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as p}from"./app-BNwrc_lv.js";import{t as m}from"./chevron-right-C9w5cb2q.js";var h={class:`mb-6 flex flex-wrap items-end justify-between gap-x-6 gap-y-4`},g={class:`flex min-w-0 items-end gap-3.5`},_={class:`min-w-0`},v={key:0,class:`mb-1 flex flex-wrap items-center gap-1 text-[13px] text-muted-foreground`,"aria-label":`Brotkrumen`},y={class:`text-2xl leading-tight font-semibold tracking-tight`},b={key:1,class:`mt-1 max-w-3xl text-sm text-muted-foreground`},x={key:0,class:`flex w-full flex-wrap items-center gap-2 sm:w-auto`},S={__name:`PageHeader`,props:{title:{type:String,required:!0},description:{type:String,default:``},breadcrumbs:{type:Array,default:()=>[]}},setup(S){return(C,w)=>(o(),i(`header`,h,[r(`div`,g,[d(C.$slots,`leading`),r(`div`,_,[S.breadcrumbs.length?(o(),i(`nav`,v,[(o(!0),i(s,null,a(S.breadcrumbs,(r,a)=>(o(),i(s,{key:r.href},[a?(o(),u(n(m),{key:0,class:`size-3.5`})):f(``,!0),e(n(p),{href:r.href,class:`hover:text-foreground hover:underline`},{default:c(()=>[t(l(r.label),1)]),_:2},1032,[`href`])],64))),128))])):f(``,!0),r(`h1`,y,l(S.title),1),S.description||C.$slots.description?(o(),i(`p`,b,[d(C.$slots,`description`,{},()=>[t(l(S.description),1)])])):f(``,!0)])]),C.$slots.actions?(o(),i(`div`,x,[d(C.$slots,`actions`)])):f(``,!0)]))}};export{S as t}; \ No newline at end of file diff --git a/public/build/assets/Panel-BASB8Xb9.js b/public/build/assets/Panel-Dr-NcUuS.js similarity index 93% rename from public/build/assets/Panel-BASB8Xb9.js rename to public/build/assets/Panel-Dr-NcUuS.js index 8b8a3456..ddffb42c 100644 --- a/public/build/assets/Panel-BASB8Xb9.js +++ b/public/build/assets/Panel-Dr-NcUuS.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,mt as o,qt as s,tr as c,v as l,xt as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./app-Bu3kn8yd.js";import{t as p}from"./chevron-right-C9w5cb2q.js";var m={class:`rounded-lg border bg-card text-card-foreground`},h={key:0,class:`flex items-center justify-between gap-4 px-5 pt-4 pb-3`},g={class:`text-base font-semibold`},_={__name:`Panel`,props:{title:{type:String,default:``},actionLabel:{type:String,default:``},actionHref:{type:String,default:``}},setup(_){return(v,y)=>(o(),a(`section`,m,[_.title||v.$slots.actions?(o(),a(`header`,h,[i(`h2`,g,c(_.title),1),u(v.$slots,`actions`,{},()=>[_.actionHref?(o(),l(n(f),{key:0,href:_.actionHref,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:s(()=>[t(c(_.actionLabel)+` `,1),e(n(p),{class:`size-3.5`})]),_:1},8,[`href`])):d(``,!0)])])):d(``,!0),i(`div`,{class:r([`px-5 pb-5`,{"pt-5":!_.title&&!v.$slots.actions}])},[u(v.$slots,`default`)],2)]))}};export{_ as t}; \ No newline at end of file +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,mt as o,qt as s,tr as c,v as l,xt as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./app-BNwrc_lv.js";import{t as p}from"./chevron-right-C9w5cb2q.js";var m={class:`rounded-lg border bg-card text-card-foreground`},h={key:0,class:`flex items-center justify-between gap-4 px-5 pt-4 pb-3`},g={class:`text-base font-semibold`},_={__name:`Panel`,props:{title:{type:String,default:``},actionLabel:{type:String,default:``},actionHref:{type:String,default:``}},setup(_){return(v,y)=>(o(),a(`section`,m,[_.title||v.$slots.actions?(o(),a(`header`,h,[i(`h2`,g,c(_.title),1),u(v.$slots,`actions`,{},()=>[_.actionHref?(o(),l(n(f),{key:0,href:_.actionHref,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:s(()=>[t(c(_.actionLabel)+` `,1),e(n(p),{class:`size-3.5`})]),_:1},8,[`href`])):d(``,!0)])])):d(``,!0),i(`div`,{class:r([`px-5 pb-5`,{"pt-5":!_.title&&!v.$slots.actions}])},[u(v.$slots,`default`)],2)]))}};export{_ as t}; \ No newline at end of file diff --git a/public/build/assets/PeopleSearch-CLQYjJiH.js b/public/build/assets/PeopleSearch-D-_1m-bo.js similarity index 93% rename from public/build/assets/PeopleSearch-CLQYjJiH.js rename to public/build/assets/PeopleSearch-D-_1m-bo.js index 2bf28019..6e1792fe 100644 --- a/public/build/assets/PeopleSearch-CLQYjJiH.js +++ b/public/build/assets/PeopleSearch-D-_1m-bo.js @@ -1 +1 @@ -import{D as e,E as t,Ht as n,On as r,Yt as i,Zn as a,_ as o,b as s,bt as c,mt as l,o as u,qt as d,tr as f,v as p,vn as m,y as h}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as g,x as _}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{o as v,r as y}from"./app-Bu3kn8yd.js";import{O as b,c as x}from"./dist-DtGNiYlK.js";import{N as S,m as C}from"./AppIcon-0N56IC2z.js";import{a as w}from"./AppLayout-BxsYt2ib.js";import{t as T}from"./http-DmyDwIce.js";import{t as E}from"./Panel-BASB8Xb9.js";var D={key:0,class:`mt-4 grid gap-3`},O=[`src`,`alt`],k={class:`min-w-0`},A={class:`block font-semibold leading-tight`},j={key:0,class:`mt-0.5 block text-xs text-muted-foreground`},M={key:0,class:`divide-y border-t px-3 text-[13px]`},N={class:`text-[10px] font-semibold tracking-wider text-muted-foreground uppercase`},P={class:`mt-0.5 break-words`},F=[`href`],I={key:1,class:`mt-4 text-[13px] text-muted-foreground`},L={__name:`PeopleSearch`,props:{count:{type:Number,required:!0}},setup(L){let R=m(``),z=m([]),B=m(0),V=m(!1),H=0,U=x(async e=>{let t=++H;try{let n=await T.get(`/personen/karten?q=${encodeURIComponent(e)}`);t===H&&(z.value=n.people,B.value=n.total)}finally{t===H&&(V.value=!1)}},220);n(R,e=>{if(e.trim().length<2){H++,z.value=[],B.value=0,V.value=!1;return}V.value=!0,U(e.trim())});function W(){R.value.trim()&&v.visit(`/personen?q=${encodeURIComponent(R.value.trim())}`)}let G=e=>e.type===`email`?`mailto:${e.value}`:e.type===`phone`?`tel:${e.value.replace(/[^\d+]/g,``)}`:null;return(n,m)=>(l(),p(E,{title:`Kolleg:innen finden`},{default:d(()=>[o(`form`,{role:`search`,class:`relative`,onSubmit:g(W,[`prevent`])},[e(r(S),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),i(o(`input`,{"onUpdate:modelValue":m[0]||=e=>R.value=e,name:`q`,type:`search`,autocomplete:`off`,placeholder:`Name, Funktion, Abteilung …`,class:`h-10 w-full rounded-full border border-input bg-background pr-9 pl-9 text-sm placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`},null,512),[[_,R.value]]),V.value?(l(),p(r(b),{key:0,class:`absolute top-1/2 right-3 size-4 -translate-y-1/2 animate-spin text-muted-foreground`})):h(``,!0)],32),z.value.length?(l(),s(`div`,D,[(l(!0),s(u,null,c(z.value,n=>(l(),s(`article`,{key:n.id,class:`overflow-hidden rounded-lg border border-l-4 border-l-brand bg-card shadow-xs`},[e(r(y),{href:`/personen/${n.id}`,class:`flex items-center gap-3 p-3 hover:bg-accent/40`},{default:d(()=>[n.avatar_url?(l(),s(`img`,{key:0,src:n.avatar_url,alt:n.name,class:`size-14 shrink-0 rounded-lg object-cover`},null,8,O)):(l(),s(`span`,{key:1,class:a([`grid size-14 shrink-0 place-items-center rounded-lg text-lg font-semibold`,r(C)(n.id).soft])},f(n.initials),3)),o(`span`,k,[o(`span`,A,f(n.name),1),n.subtitle?(l(),s(`span`,j,f(n.subtitle),1)):h(``,!0)])]),_:2},1032,[`href`]),n.fields.length?(l(),s(`dl`,M,[(l(!0),s(u,null,c(n.fields,e=>(l(),s(`div`,{key:e.key,class:`py-2`},[o(`dt`,N,f(e.label),1),o(`dd`,P,[G(e)?(l(),s(`a`,{key:0,href:G(e),class:`text-brand-text hover:underline`},f(e.value),9,F)):(l(),s(u,{key:1},[t(f(e.value),1)],64))])]))),128))])):h(``,!0)]))),128))])):R.value.trim().length>=2&&!V.value?(l(),s(`p`,I,`Niemand gefunden für „`+f(R.value.trim())+`“.`,1)):h(``,!0),e(r(y),{href:R.value.trim().length>=2?`/personen?q=${encodeURIComponent(R.value.trim())}`:`/personen`,class:`mt-4 flex items-center justify-between text-[13px] text-muted-foreground hover:text-foreground`},{default:d(()=>[R.value.trim().length>=2&&B.value>z.value.length?(l(),s(u,{key:0},[t(`Alle `+f(B.value.toLocaleString(`de-DE`))+` Treffer anzeigen`,1)],64)):(l(),s(u,{key:1},[t(f(L.count===1?`1 Person`:`${L.count.toLocaleString(`de-DE`)} Personen`)+` im Verzeichnis`,1)],64)),e(r(w),{class:`size-4`})]),_:1},8,[`href`])]),_:1}))}};export{L as default}; \ No newline at end of file +import{D as e,E as t,Ht as n,On as r,Yt as i,Zn as a,_ as o,b as s,bt as c,mt as l,o as u,qt as d,tr as f,v as p,vn as m,y as h}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as g,x as _}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{o as v,r as y}from"./app-BNwrc_lv.js";import{O as b,c as x}from"./dist-DtGNiYlK.js";import{N as S,m as C}from"./AppIcon-nlhvQfK7.js";import{a as w}from"./AppLayout-esQiy2nD.js";import{n as T}from"./http-CAG9BrJF.js";import{t as E}from"./Panel-Dr-NcUuS.js";var D={key:0,class:`mt-4 grid gap-3`},O=[`src`,`alt`],k={class:`min-w-0`},A={class:`block font-semibold leading-tight`},j={key:0,class:`mt-0.5 block text-xs text-muted-foreground`},M={key:0,class:`divide-y border-t px-3 text-[13px]`},N={class:`text-[10px] font-semibold tracking-wider text-muted-foreground uppercase`},P={class:`mt-0.5 break-words`},F=[`href`],I={key:1,class:`mt-4 text-[13px] text-muted-foreground`},L={__name:`PeopleSearch`,props:{count:{type:Number,required:!0}},setup(L){let R=m(``),z=m([]),B=m(0),V=m(!1),H=0,U=x(async e=>{let t=++H;try{let n=await T.get(`/personen/karten?q=${encodeURIComponent(e)}`);t===H&&(z.value=n.people,B.value=n.total)}finally{t===H&&(V.value=!1)}},220);n(R,e=>{if(e.trim().length<2){H++,z.value=[],B.value=0,V.value=!1;return}V.value=!0,U(e.trim())});function W(){R.value.trim()&&v.visit(`/personen?q=${encodeURIComponent(R.value.trim())}`)}let G=e=>e.type===`email`?`mailto:${e.value}`:e.type===`phone`?`tel:${e.value.replace(/[^\d+]/g,``)}`:null;return(n,m)=>(l(),p(E,{title:`Kolleg:innen finden`},{default:d(()=>[o(`form`,{role:`search`,class:`relative`,onSubmit:g(W,[`prevent`])},[e(r(S),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),i(o(`input`,{"onUpdate:modelValue":m[0]||=e=>R.value=e,name:`q`,type:`search`,autocomplete:`off`,placeholder:`Name, Funktion, Abteilung …`,class:`h-10 w-full rounded-full border border-input bg-background pr-9 pl-9 text-sm placeholder:text-muted-foreground focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`},null,512),[[_,R.value]]),V.value?(l(),p(r(b),{key:0,class:`absolute top-1/2 right-3 size-4 -translate-y-1/2 animate-spin text-muted-foreground`})):h(``,!0)],32),z.value.length?(l(),s(`div`,D,[(l(!0),s(u,null,c(z.value,n=>(l(),s(`article`,{key:n.id,class:`overflow-hidden rounded-lg border border-l-4 border-l-brand bg-card shadow-xs`},[e(r(y),{href:`/personen/${n.id}`,class:`flex items-center gap-3 p-3 hover:bg-accent/40`},{default:d(()=>[n.avatar_url?(l(),s(`img`,{key:0,src:n.avatar_url,alt:n.name,class:`size-14 shrink-0 rounded-lg object-cover`},null,8,O)):(l(),s(`span`,{key:1,class:a([`grid size-14 shrink-0 place-items-center rounded-lg text-lg font-semibold`,r(C)(n.id).soft])},f(n.initials),3)),o(`span`,k,[o(`span`,A,f(n.name),1),n.subtitle?(l(),s(`span`,j,f(n.subtitle),1)):h(``,!0)])]),_:2},1032,[`href`]),n.fields.length?(l(),s(`dl`,M,[(l(!0),s(u,null,c(n.fields,e=>(l(),s(`div`,{key:e.key,class:`py-2`},[o(`dt`,N,f(e.label),1),o(`dd`,P,[G(e)?(l(),s(`a`,{key:0,href:G(e),class:`text-brand-text hover:underline`},f(e.value),9,F)):(l(),s(u,{key:1},[t(f(e.value),1)],64))])]))),128))])):h(``,!0)]))),128))])):R.value.trim().length>=2&&!V.value?(l(),s(`p`,I,`Niemand gefunden für „`+f(R.value.trim())+`“.`,1)):h(``,!0),e(r(y),{href:R.value.trim().length>=2?`/personen?q=${encodeURIComponent(R.value.trim())}`:`/personen`,class:`mt-4 flex items-center justify-between text-[13px] text-muted-foreground hover:text-foreground`},{default:d(()=>[R.value.trim().length>=2&&B.value>z.value.length?(l(),s(u,{key:0},[t(`Alle `+f(B.value.toLocaleString(`de-DE`))+` Treffer anzeigen`,1)],64)):(l(),s(u,{key:1},[t(f(L.count===1?`1 Person`:`${L.count.toLocaleString(`de-DE`)} Personen`)+` im Verzeichnis`,1)],64)),e(r(w),{class:`size-4`})]),_:1},8,[`href`])]),_:1}))}};export{L as default}; \ No newline at end of file diff --git a/public/build/assets/Print-DlAwSvIZ.js b/public/build/assets/Print-B52yJ-oY.js similarity index 94% rename from public/build/assets/Print-DlAwSvIZ.js rename to public/build/assets/Print-B52yJ-oY.js index afd8394c..cb676f37 100644 --- a/public/build/assets/Print-DlAwSvIZ.js +++ b/public/build/assets/Print-B52yJ-oY.js @@ -1 +1 @@ -import{D as e,On as t,_ as n,b as r,bt as i,ct as a,mt as o,o as s,tr as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as u}from"./app-Bu3kn8yd.js";var d={class:`sp-toolbar`},f={key:0,class:`sp-empty`},p=[`src`,`alt`],m={__name:`Print`,props:{plans:{type:Array,required:!0}},setup(m){let h=m;function g(){window.print()}return a(async()=>{await Promise.all([...document.querySelectorAll(`.sp-page img`)].map(e=>e.complete?null:new Promise(t=>e.onload=e.onerror=t))),h.plans.length&&setTimeout(g,150)}),(a,h)=>(o(),r(s,null,[e(t(u),{title:`Speiseplan drucken`}),n(`div`,d,[h[0]||=n(`strong`,null,`Speiseplan drucken`,-1),n(`span`,null,c(m.plans.length)+` `+c(m.plans.length===1?`Seite`:`Seiten`)+` · A4, randlos. Falls Adresse oder Datum mitgedruckt werden: im Druckdialog „Kopf- und Fußzeilen“ abschalten.`,1),n(`button`,{type:`button`,onClick:g},`Drucken`)]),m.plans.length?l(``,!0):(o(),r(`p`,f,`Kein Speiseplan zum Drucken vorhanden.`)),(o(!0),r(s,null,i(m.plans,e=>(o(),r(`div`,{key:e.id,class:`sp-page`},[n(`img`,{src:e.image_url,alt:`Speiseplan ${e.label}`},null,8,p)]))),128))],64))}};export{m as default}; \ No newline at end of file +import{D as e,On as t,_ as n,b as r,bt as i,ct as a,mt as o,o as s,tr as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as u}from"./app-BNwrc_lv.js";var d={class:`sp-toolbar`},f={key:0,class:`sp-empty`},p=[`src`,`alt`],m={__name:`Print`,props:{plans:{type:Array,required:!0}},setup(m){let h=m;function g(){window.print()}return a(async()=>{await Promise.all([...document.querySelectorAll(`.sp-page img`)].map(e=>e.complete?null:new Promise(t=>e.onload=e.onerror=t))),h.plans.length&&setTimeout(g,150)}),(a,h)=>(o(),r(s,null,[e(t(u),{title:`Speiseplan drucken`}),n(`div`,d,[h[0]||=n(`strong`,null,`Speiseplan drucken`,-1),n(`span`,null,c(m.plans.length)+` `+c(m.plans.length===1?`Seite`:`Seiten`)+` · A4, randlos. Falls Adresse oder Datum mitgedruckt werden: im Druckdialog „Kopf- und Fußzeilen“ abschalten.`,1),n(`button`,{type:`button`,onClick:g},`Drucken`)]),m.plans.length?l(``,!0):(o(),r(`p`,f,`Kein Speiseplan zum Drucken vorhanden.`)),(o(!0),r(s,null,i(m.plans,e=>(o(),r(`div`,{key:e.id,class:`sp-page`},[n(`img`,{src:e.image_url,alt:`Speiseplan ${e.label}`},null,8,p)]))),128))],64))}};export{m as default}; \ No newline at end of file diff --git a/public/build/assets/ProfileBirthday-qxtdAtvE.js b/public/build/assets/ProfileBirthday-BTcaZfOC.js similarity index 85% rename from public/build/assets/ProfileBirthday-qxtdAtvE.js rename to public/build/assets/ProfileBirthday-BTcaZfOC.js index 5447fc21..3d9f18cf 100644 --- a/public/build/assets/ProfileBirthday-qxtdAtvE.js +++ b/public/build/assets/ProfileBirthday-BTcaZfOC.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,g as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as u}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as d,o as f}from"./app-Bu3kn8yd.js";import{O as p}from"./dist-DtGNiYlK.js";import{nt as m}from"./AppIcon-0N56IC2z.js";import{o as h}from"./http-DmyDwIce.js";import{t as g}from"./FormField-BoFAO4pm.js";import{t as _}from"./button-ZHC5mKey.js";import{t as v}from"./NativeSelect-BGasRaNs.js";import{t as y}from"./Panel-BASB8Xb9.js";var b={class:`flex gap-2 text-sm text-muted-foreground`},x={class:`grid grid-cols-2 gap-4 sm:max-w-sm`},S={class:`flex justify-end gap-2 border-t pt-4`},C={__name:`ProfileBirthday`,props:{birthday:{type:Object,default:null},months:{type:Array,required:!0},scope:{type:String,default:`all`}},setup(C){let w=C,T=d({day:w.birthday?.day??null,month:w.birthday?.month??null}),E=i(()=>Array.from({length:31},(e,t)=>({value:t+1,label:String(t+1)}))),D={all:`allen Mitarbeitenden`,department:`Ihrer Abteilung`,location:`Ihrem Standort`};function O(){T.put(`/profil/geburtstag`,{preserveScroll:!0,onSuccess:()=>{T.defaults(),h.success(`Geburtstag gespeichert`)}})}function k(){f.delete(`/profil/geburtstag`,{preserveScroll:!0,onSuccess:()=>{T.day=null,T.month=null,T.defaults(),h.success(`Aus der Geburtstagsliste entfernt`)}})}return(i,d)=>(a(),c(y,{title:`Geburtstag`},{default:o(()=>[r(`form`,{class:`grid gap-4`,onSubmit:u(O,[`prevent`])},[r(`p`,b,[e(n(m),{class:`mt-0.5 size-4 shrink-0 text-brand-text`}),r(`span`,null,`Freiwillig: Wenn Sie Tag und Monat eintragen, erscheint Ihr Geburtstag in der Geburtstagsliste und ist `+s(D[C.scope])+` sichtbar. Das Geburtsjahr wird nicht erfasst. Austragen ist jederzeit möglich.`,1)]),r(`div`,x,[e(g,{id:`birthday-day`,label:`Tag`,error:n(T).errors.day},{default:o(()=>[e(v,{id:`birthday-day`,modelValue:n(T).day,"onUpdate:modelValue":d[0]||=e=>n(T).day=e,options:E.value,placeholder:`–`},null,8,[`modelValue`,`options`])]),_:1},8,[`error`]),e(g,{id:`birthday-month`,label:`Monat`,error:n(T).errors.month},{default:o(()=>[e(v,{id:`birthday-month`,modelValue:n(T).month,"onUpdate:modelValue":d[1]||=e=>n(T).month=e,options:C.months,placeholder:`–`},null,8,[`modelValue`,`options`])]),_:1},8,[`error`])]),r(`div`,S,[C.birthday?(a(),c(n(_),{key:0,type:`button`,variant:`ghost`,class:`text-destructive hover:text-destructive`,onClick:k},{default:o(()=>[...d[2]||=[t(`Austragen`,-1)]]),_:1})):l(``,!0),e(n(_),{type:`submit`,disabled:n(T).processing||!n(T).day||!n(T).month||!n(T).isDirty},{default:o(()=>[n(T).processing?(a(),c(n(p),{key:0,class:`animate-spin`})):l(``,!0),t(` `+s(C.birthday?`Speichern`:`Eintragen`),1)]),_:1},8,[`disabled`])])],32)]),_:1}))}};export{C as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,g as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as u}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as d,o as f}from"./app-BNwrc_lv.js";import{O as p}from"./dist-DtGNiYlK.js";import{nt as m}from"./AppIcon-nlhvQfK7.js";import{s as h}from"./http-CAG9BrJF.js";import{t as g}from"./FormField-BoFAO4pm.js";import{n as _}from"./button-CwUSbS9X.js";import{t as v}from"./NativeSelect-G3km7PmI.js";import{t as y}from"./Panel-Dr-NcUuS.js";var b={class:`flex gap-2 text-sm text-muted-foreground`},x={class:`grid grid-cols-2 gap-4 sm:max-w-sm`},S={class:`flex justify-end gap-2 border-t pt-4`},C={__name:`ProfileBirthday`,props:{birthday:{type:Object,default:null},months:{type:Array,required:!0},scope:{type:String,default:`all`}},setup(C){let w=C,T=d({day:w.birthday?.day??null,month:w.birthday?.month??null}),E=i(()=>Array.from({length:31},(e,t)=>({value:t+1,label:String(t+1)}))),D={all:`allen Mitarbeitenden`,department:`Ihrer Abteilung`,location:`Ihrem Standort`};function O(){T.put(`/profil/geburtstag`,{preserveScroll:!0,onSuccess:()=>{T.defaults(),h.success(`Geburtstag gespeichert`)}})}function k(){f.delete(`/profil/geburtstag`,{preserveScroll:!0,onSuccess:()=>{T.day=null,T.month=null,T.defaults(),h.success(`Aus der Geburtstagsliste entfernt`)}})}return(i,d)=>(a(),c(y,{title:`Geburtstag`},{default:o(()=>[r(`form`,{class:`grid gap-4`,onSubmit:u(O,[`prevent`])},[r(`p`,b,[e(n(m),{class:`mt-0.5 size-4 shrink-0 text-brand-text`}),r(`span`,null,`Freiwillig: Wenn Sie Tag und Monat eintragen, erscheint Ihr Geburtstag in der Geburtstagsliste und ist `+s(D[C.scope])+` sichtbar. Das Geburtsjahr wird nicht erfasst. Austragen ist jederzeit möglich.`,1)]),r(`div`,x,[e(g,{id:`birthday-day`,label:`Tag`,error:n(T).errors.day},{default:o(()=>[e(v,{id:`birthday-day`,modelValue:n(T).day,"onUpdate:modelValue":d[0]||=e=>n(T).day=e,options:E.value,placeholder:`–`},null,8,[`modelValue`,`options`])]),_:1},8,[`error`]),e(g,{id:`birthday-month`,label:`Monat`,error:n(T).errors.month},{default:o(()=>[e(v,{id:`birthday-month`,modelValue:n(T).month,"onUpdate:modelValue":d[1]||=e=>n(T).month=e,options:C.months,placeholder:`–`},null,8,[`modelValue`,`options`])]),_:1},8,[`error`])]),r(`div`,S,[C.birthday?(a(),c(n(_),{key:0,type:`button`,variant:`ghost`,class:`text-destructive hover:text-destructive`,onClick:k},{default:o(()=>[...d[2]||=[t(`Austragen`,-1)]]),_:1})):l(``,!0),e(n(_),{type:`submit`,disabled:n(T).processing||!n(T).day||!n(T).month||!n(T).isDirty},{default:o(()=>[n(T).processing?(a(),c(n(p),{key:0,class:`animate-spin`})):l(``,!0),t(` `+s(C.birthday?`Speichern`:`Eintragen`),1)]),_:1},8,[`disabled`])])],32)]),_:1}))}};export{C as default}; \ No newline at end of file diff --git a/public/build/assets/ProfileIncomplete-_03d3qyC.js b/public/build/assets/ProfileIncomplete-BxjghKzG.js similarity index 82% rename from public/build/assets/ProfileIncomplete-_03d3qyC.js rename to public/build/assets/ProfileIncomplete-BxjghKzG.js index 6449d891..bdc64f4b 100644 --- a/public/build/assets/ProfileIncomplete-_03d3qyC.js +++ b/public/build/assets/ProfileIncomplete-BxjghKzG.js @@ -1 +1 @@ -import{D as e,On as t,_ as n,mt as r,qt as i,v as a}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as o}from"./app-Bu3kn8yd.js";import{r as s}from"./AppLayout-BxsYt2ib.js";var c={__name:`ProfileIncomplete`,setup(c){return(c,l)=>(r(),a(t(o),{href:`/profil/bearbeiten`,class:`flex items-start gap-3 rounded-lg border border-dashed border-brand-300 bg-card p-4 transition-colors hover:bg-brand-soft`},{default:i(()=>[e(t(s),{class:`mt-0.5 size-5 shrink-0 text-brand-text`}),l[0]||=n(`div`,null,[n(`div`,{class:`text-sm font-semibold`},`Profil vervollständigen`),n(`p`,{class:`mt-0.5 text-[13px] text-muted-foreground`},`Mit Foto und Funktion finden Kolleginnen und Kollegen Sie schneller.`)],-1)]),_:1}))}};export{c as default}; \ No newline at end of file +import{D as e,On as t,_ as n,mt as r,qt as i,v as a}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as o}from"./app-BNwrc_lv.js";import{r as s}from"./AppLayout-esQiy2nD.js";var c={__name:`ProfileIncomplete`,setup(c){return(c,l)=>(r(),a(t(o),{href:`/profil/bearbeiten`,class:`flex items-start gap-3 rounded-lg border border-dashed border-brand-300 bg-card p-4 transition-colors hover:bg-brand-soft`},{default:i(()=>[e(t(s),{class:`mt-0.5 size-5 shrink-0 text-brand-text`}),l[0]||=n(`div`,null,[n(`div`,{class:`text-sm font-semibold`},`Profil vervollständigen`),n(`p`,{class:`mt-0.5 text-[13px] text-muted-foreground`},`Mit Foto und Funktion finden Kolleginnen und Kollegen Sie schneller.`)],-1)]),_:1}))}};export{c as default}; \ No newline at end of file diff --git a/public/build/assets/QmSearchBox-Ri1YCTQc.js b/public/build/assets/QmSearchBox-BW950raa.js similarity index 85% rename from public/build/assets/QmSearchBox-Ri1YCTQc.js rename to public/build/assets/QmSearchBox-BW950raa.js index 98aab5a7..e6112f3d 100644 --- a/public/build/assets/QmSearchBox-Ri1YCTQc.js +++ b/public/build/assets/QmSearchBox-BW950raa.js @@ -1 +1 @@ -import{D as e,On as t,b as n,mt as r,vn as i}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as a}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{o}from"./app-Bu3kn8yd.js";import{N as s}from"./AppIcon-0N56IC2z.js";import{t as c}from"./Input-FGSb2-yK.js";var l={__name:`QmSearchBox`,props:{initial:{type:String,default:``}},setup(l){let u=i(l.initial);function d(){u.value.trim()&&o.get(`/qm/suche`,{q:u.value.trim()})}return(i,o)=>(r(),n(`form`,{class:`relative w-full sm:w-80`,role:`search`,onSubmit:a(d,[`prevent`])},[e(t(s),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),e(t(c),{modelValue:u.value,"onUpdate:modelValue":o[0]||=e=>u.value=e,type:`search`,class:`h-10 bg-card pl-9`,placeholder:`QM durchsuchen – auch im Text …`,"aria-label":`Qualitätsmanagement durchsuchen`},null,8,[`modelValue`])],32))}};export{l as t}; \ No newline at end of file +import{D as e,On as t,b as n,mt as r,vn as i}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as a}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{o}from"./app-BNwrc_lv.js";import{N as s}from"./AppIcon-nlhvQfK7.js";import{t as c}from"./Input-FGSb2-yK.js";var l={__name:`QmSearchBox`,props:{initial:{type:String,default:``}},setup(l){let u=i(l.initial);function d(){u.value.trim()&&o.get(`/qm/suche`,{q:u.value.trim()})}return(i,o)=>(r(),n(`form`,{class:`relative w-full sm:w-80`,role:`search`,onSubmit:a(d,[`prevent`])},[e(t(s),{class:`pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),e(t(c),{modelValue:u.value,"onUpdate:modelValue":o[0]||=e=>u.value=e,type:`search`,class:`h-10 bg-card pl-9`,placeholder:`QM durchsuchen – auch im Text …`,"aria-label":`Qualitätsmanagement durchsuchen`},null,8,[`modelValue`])],32))}};export{l as t}; \ No newline at end of file diff --git a/public/build/assets/QuickLinks-CSSpapKm.js b/public/build/assets/QuickLinks-DV6deS27.js similarity index 95% rename from public/build/assets/QuickLinks-CSSpapKm.js rename to public/build/assets/QuickLinks-DV6deS27.js index 8bb60367..88543921 100644 --- a/public/build/assets/QuickLinks-CSSpapKm.js +++ b/public/build/assets/QuickLinks-DV6deS27.js @@ -1 +1 @@ -import{D as e,On as t,_ as n,b as r,bt as i,ct as a,mt as o,o as s,qt as c,tr as l,v as u,vn as d,wt as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-Bu3kn8yd.js";import{i as h,n as g}from"./dist-DtGNiYlK.js";import{t as _}from"./AppIcon-0N56IC2z.js";import{t as v}from"./chevron-left-8GGLVOvJ.js";import{t as y}from"./chevron-right-C9w5cb2q.js";var b={class:`@container rounded-lg border bg-card`},x={class:`flex items-center justify-between px-5 pt-4 pb-3 @max-md:px-4`},S={key:0,class:`flex gap-1.5`},C=[`disabled`],w=[`disabled`],T={class:`text-xs leading-tight font-medium break-words hyphens-auto`},E={__name:`QuickLinksRow`,props:{links:{type:Array,required:!0}},setup(E){let D=d(null),O=d(!1),k=d(!1);function A(){let e=D.value;e&&(O.value=e.scrollLeft>4,k.value=e.scrollLeft+e.clientWidth(o(),r(`section`,b,[n(`header`,x,[d[2]||=n(`h2`,{class:`text-base font-semibold`},`Schnellzugriff`,-1),O.value||k.value?(o(),r(`div`,S,[n(`button`,{type:`button`,class:`grid size-7 place-items-center rounded-md border text-foreground/70 hover:bg-accent disabled:opacity-40`,disabled:!O.value,"aria-label":`Zurück`,onClick:d[0]||=e=>j(-1)},[e(t(v),{class:`size-4`})],8,C),n(`button`,{type:`button`,class:`grid size-7 place-items-center rounded-md border text-foreground/70 hover:bg-accent disabled:opacity-40`,disabled:!k.value,"aria-label":`Weiter`,onClick:d[1]||=e=>j(1)},[e(t(y),{class:`size-4`})],8,w)])):p(``,!0)]),n(`div`,{ref_key:`track`,ref:D,class:`flex snap-x scroll-px-5 gap-3 overflow-x-auto px-5 pb-5 [scrollbar-width:none] @max-md:grid @max-md:grid-cols-3 @max-md:gap-2 @max-md:overflow-visible @max-md:px-4 @max-md:pb-4 [&::-webkit-scrollbar]:hidden`},[(o(!0),r(s,null,i(E.links,r=>(o(),u(f(r.url.startsWith(`/`)&&!r.new_tab?t(m):`a`),{key:r.label+r.url,href:r.url,target:r.new_tab?`_blank`:void 0,rel:r.new_tab?`noopener`:void 0,class:`flex w-[116px] shrink-0 snap-start flex-col items-center gap-2.5 rounded-md bg-muted px-2 py-4 text-center transition-colors hover:bg-brand-soft @max-md:w-auto @max-md:gap-2 @max-md:px-1.5 @max-md:py-3`},{default:c(()=>[e(_,{name:r.icon||`link`,class:`size-6 text-brand-text`,"stroke-width":1.6},null,8,[`name`]),n(`span`,T,l(r.label),1)]),_:2},1032,[`href`,`target`,`rel`]))),128))],512)]))}},D={__name:`QuickLinks`,props:{links:{type:Array,required:!0}},setup(e){return(t,n)=>(o(),u(E,{links:e.links},null,8,[`links`]))}};export{D as default}; \ No newline at end of file +import{D as e,On as t,_ as n,b as r,bt as i,ct as a,mt as o,o as s,qt as c,tr as l,v as u,vn as d,wt as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-BNwrc_lv.js";import{i as h,n as g}from"./dist-DtGNiYlK.js";import{t as _}from"./AppIcon-nlhvQfK7.js";import{t as v}from"./chevron-left-8GGLVOvJ.js";import{t as y}from"./chevron-right-C9w5cb2q.js";var b={class:`@container rounded-lg border bg-card`},x={class:`flex items-center justify-between px-5 pt-4 pb-3 @max-md:px-4`},S={key:0,class:`flex gap-1.5`},C=[`disabled`],w=[`disabled`],T={class:`text-xs leading-tight font-medium break-words hyphens-auto`},E={__name:`QuickLinksRow`,props:{links:{type:Array,required:!0}},setup(E){let D=d(null),O=d(!1),k=d(!1);function A(){let e=D.value;e&&(O.value=e.scrollLeft>4,k.value=e.scrollLeft+e.clientWidth(o(),r(`section`,b,[n(`header`,x,[d[2]||=n(`h2`,{class:`text-base font-semibold`},`Schnellzugriff`,-1),O.value||k.value?(o(),r(`div`,S,[n(`button`,{type:`button`,class:`grid size-7 place-items-center rounded-md border text-foreground/70 hover:bg-accent disabled:opacity-40`,disabled:!O.value,"aria-label":`Zurück`,onClick:d[0]||=e=>j(-1)},[e(t(v),{class:`size-4`})],8,C),n(`button`,{type:`button`,class:`grid size-7 place-items-center rounded-md border text-foreground/70 hover:bg-accent disabled:opacity-40`,disabled:!k.value,"aria-label":`Weiter`,onClick:d[1]||=e=>j(1)},[e(t(y),{class:`size-4`})],8,w)])):p(``,!0)]),n(`div`,{ref_key:`track`,ref:D,class:`flex snap-x scroll-px-5 gap-3 overflow-x-auto px-5 pb-5 [scrollbar-width:none] @max-md:grid @max-md:grid-cols-3 @max-md:gap-2 @max-md:overflow-visible @max-md:px-4 @max-md:pb-4 [&::-webkit-scrollbar]:hidden`},[(o(!0),r(s,null,i(E.links,r=>(o(),u(f(r.url.startsWith(`/`)&&!r.new_tab?t(m):`a`),{key:r.label+r.url,href:r.url,target:r.new_tab?`_blank`:void 0,rel:r.new_tab?`noopener`:void 0,class:`flex w-[116px] shrink-0 snap-start flex-col items-center gap-2.5 rounded-md bg-muted px-2 py-4 text-center transition-colors hover:bg-brand-soft @max-md:w-auto @max-md:gap-2 @max-md:px-1.5 @max-md:py-3`},{default:c(()=>[e(_,{name:r.icon||`link`,class:`size-6 text-brand-text`,"stroke-width":1.6},null,8,[`name`]),n(`span`,T,l(r.label),1)]),_:2},1032,[`href`,`target`,`rel`]))),128))],512)]))}},D={__name:`QuickLinks`,props:{links:{type:Array,required:!0}},setup(e){return(t,n)=>(o(),u(E,{links:e.links},null,8,[`links`]))}};export{D as default}; \ No newline at end of file diff --git a/public/build/assets/ResetPassword-n5gAPufN.js b/public/build/assets/ResetPassword-BMgqvD7X.js similarity index 87% rename from public/build/assets/ResetPassword-n5gAPufN.js rename to public/build/assets/ResetPassword-BMgqvD7X.js index d45ff5ea..34a35afe 100644 --- a/public/build/assets/ResetPassword-n5gAPufN.js +++ b/public/build/assets/ResetPassword-BMgqvD7X.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,mt as i,qt as a,v as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as c}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as l}from"./app-Bu3kn8yd.js";import{O as u}from"./dist-DtGNiYlK.js";import{t as d}from"./FormField-BoFAO4pm.js";import{t as f}from"./button-ZHC5mKey.js";import{t as p}from"./Input-FGSb2-yK.js";import{t as m}from"./GuestLayout-CAwpgUCY.js";var h={__name:`ResetPassword`,props:{email:{type:String,default:``},token:{type:String,required:!0}},setup(h){let g=h,_=l({token:g.token,email:g.email,password:``,password_confirmation:``});function v(){_.post(`/reset-password`,{onFinish:()=>_.reset(`password`,`password_confirmation`)})}return(l,h)=>(i(),o(m,{title:`Neues Passwort festlegen`,description:`Mindestens 10 Zeichen, mit Buchstaben und Ziffern.`},{default:a(()=>[r(`form`,{class:`grid gap-5`,onSubmit:c(v,[`prevent`])},[e(d,{id:`email`,label:`E-Mail-Adresse`,error:n(_).errors.email},{default:a(()=>[e(n(p),{id:`email`,modelValue:n(_).email,"onUpdate:modelValue":h[0]||=e=>n(_).email=e,type:`email`,autocomplete:`username`,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(d,{id:`password`,label:`Neues Passwort`,error:n(_).errors.password},{default:a(()=>[e(n(p),{id:`password`,modelValue:n(_).password,"onUpdate:modelValue":h[1]||=e=>n(_).password=e,type:`password`,autocomplete:`new-password`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(d,{id:`password_confirmation`,label:`Passwort wiederholen`},{default:a(()=>[e(n(p),{id:`password_confirmation`,modelValue:n(_).password_confirmation,"onUpdate:modelValue":h[2]||=e=>n(_).password_confirmation=e,type:`password`,autocomplete:`new-password`,class:`h-10`},null,8,[`modelValue`])]),_:1}),e(n(f),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:n(_).processing},{default:a(()=>[n(_).processing?(i(),o(n(u),{key:0,class:`animate-spin`})):s(``,!0),h[3]||=t(` Passwort speichern `,-1)]),_:1},8,[`disabled`])],32)]),_:1}))}};export{h as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,mt as i,qt as a,v as o,y as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as c}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as l}from"./app-BNwrc_lv.js";import{O as u}from"./dist-DtGNiYlK.js";import{t as d}from"./FormField-BoFAO4pm.js";import{n as f}from"./button-CwUSbS9X.js";import{t as p}from"./Input-FGSb2-yK.js";import{t as m}from"./GuestLayout-B2rtJjbh.js";var h={__name:`ResetPassword`,props:{email:{type:String,default:``},token:{type:String,required:!0}},setup(h){let g=h,_=l({token:g.token,email:g.email,password:``,password_confirmation:``});function v(){_.post(`/reset-password`,{onFinish:()=>_.reset(`password`,`password_confirmation`)})}return(l,h)=>(i(),o(m,{title:`Neues Passwort festlegen`,description:`Mindestens 10 Zeichen, mit Buchstaben und Ziffern.`},{default:a(()=>[r(`form`,{class:`grid gap-5`,onSubmit:c(v,[`prevent`])},[e(d,{id:`email`,label:`E-Mail-Adresse`,error:n(_).errors.email},{default:a(()=>[e(n(p),{id:`email`,modelValue:n(_).email,"onUpdate:modelValue":h[0]||=e=>n(_).email=e,type:`email`,autocomplete:`username`,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(d,{id:`password`,label:`Neues Passwort`,error:n(_).errors.password},{default:a(()=>[e(n(p),{id:`password`,modelValue:n(_).password,"onUpdate:modelValue":h[1]||=e=>n(_).password=e,type:`password`,autocomplete:`new-password`,autofocus:``,class:`h-10`},null,8,[`modelValue`])]),_:1},8,[`error`]),e(d,{id:`password_confirmation`,label:`Passwort wiederholen`},{default:a(()=>[e(n(p),{id:`password_confirmation`,modelValue:n(_).password_confirmation,"onUpdate:modelValue":h[2]||=e=>n(_).password_confirmation=e,type:`password`,autocomplete:`new-password`,class:`h-10`},null,8,[`modelValue`])]),_:1}),e(n(f),{type:`submit`,size:`lg`,class:`h-10 w-full`,disabled:n(_).processing},{default:a(()=>[n(_).processing?(i(),o(n(u),{key:0,class:`animate-spin`})):s(``,!0),h[3]||=t(` Passwort speichern `,-1)]),_:1},8,[`disabled`])],32)]),_:1}))}};export{h as default}; \ No newline at end of file diff --git a/public/build/assets/RichTextEditor-CT-rIT4q.js b/public/build/assets/RichTextEditor-CT-rIT4q.js new file mode 100644 index 00000000..661be7ed --- /dev/null +++ b/public/build/assets/RichTextEditor-CT-rIT4q.js @@ -0,0 +1,129 @@ +import{f as e}from"./usePrimitiveElement-DC7UloPZ.js";import{B as t,D as n,Ht as r,L as i,On as a,Ut as o,Yt as s,Zn as c,_ as l,b as u,ct as d,fn as f,it as p,k as m,mt as h,nn as g,o as _,tt as ee,v as te,vn as v,xn as y,y as b}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as ne,x as re}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{O as ie,k as x}from"./dist-DtGNiYlK.js";import{H as ae,k as oe}from"./AppIcon-nlhvQfK7.js";import{t as se}from"./check-AfxJa8Ew.js";import{v as ce}from"./http-CAG9BrJF.js";import{t as le}from"./image-plus-C1A_7CFG.js";import{t as ue}from"./images-47Nc0alu.js";import{t as de}from"./list-DHYGZ2vt.js";import{t as fe}from"./quote-CAgJDpoy.js";var pe=x({name:`bold`,size:24,node:[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]}),me=x({name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]}),he=x({name:`heading-3`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]}),ge=x({name:`italic`,size:24,node:[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]}),_e=x({name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]}),ve=x({name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]}),ye=x({name:`underline`,size:24,node:[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]}),be=x({name:`unlink`,size:24,node:[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]}),xe=Object.defineProperty,Se=(e,t)=>{let n={};for(var r in e)xe(n,r,{get:e[r],enumerable:!0});return t||xe(n,Symbol.toStringTag,{value:`Module`}),n};function S(e){this.content=e}S.prototype={constructor:S,find:function(e){for(var t=0;t>1}},S.from=function(e){if(e instanceof S)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new S(t)};function C(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i=56320&&e<57344}function Te(e){return e>=55296&&e<56320}var w=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;te&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);at)for(let e=0,a=0;at&&((an)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?De(t+1,i):De(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;ethis.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;te.type.rank-t.type.rank),n}};T.none=[];var ke=class extends Error{},E=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=je(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Ae(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(w.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};E.empty=new E(w.empty,0,0);function Ae(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Ae(a.content,t-i-1,n-i-1)))}function je(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=je(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function Me(e,t,n){if(n.openStart>e.depth)throw new ke(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ke(`Inconsistent open depths`);return Ne(e,t,n,0)}function Ne(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Le(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Ie(e.nodeAfter,r),a++));for(let e=a;ei&&Fe(e,t,i+1),o=r.depth>i&&Fe(n,r,i+1),s=[];return Le(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Pe(a,o),Ie(Re(a,ze(e,t,n,r,i+1)),s)):(a&&Ie(Re(a,Be(e,t,i+1)),s),Le(t,n,i,s),o&&Ie(Re(o,Be(n,r,i+1)),s)),Le(r,null,i,s),new w(s)}function Be(e,t,n){let r=[];return Le(null,e,n,r),e.depth>n&&Ie(Re(Fe(e,t,n+1),Be(e,t,n+1)),r),Le(t,null,n,r),new w(r)}function Ve(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(w.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var He=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ke(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Ge.get(t);if(r)for(let e=0;ee&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Xe(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=w.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;ee.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=w.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};Je.prototype.text=void 0;var Ye=class e extends Je{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Xe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Xe(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Ze(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var Qe=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new $e(t,n);if(r.next==null)return e.empty;let i=et(r);r.next&&r.err(`Unexpected trailing text`);let a=ut(st(i));return dt(a,r),a}matchType(e){for(let t=0;te.createAndFill()));for(let e=0;e=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n`+e.indexOf(t.next[n].next);return r}).join(` +`)}};Qe.empty=new Qe(!0);var $e=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function et(e){let t=[];do t.push(tt(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function tt(e){let t=[];do t.push(nt(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function nt(e){let t=ot(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=it(e,t);else break;return t}function rt(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function it(e,t){let n=rt(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:rt(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function at(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function ot(e){if(e.eat(`(`)){let t=et(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=at(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function st(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Qe(r.indexOf(e.length-1)>-1);for(let e=0;e-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:pt(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Je(this,this.computeAttrs(e),w.from(t),T.setFrom(n))}createChecked(e=null,t,n){return t=w.from(t),this.checkContent(t),new Je(this,this.computeAttrs(e),t,T.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=w.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(w.empty,!0);return i?new Je(this,e,t.append(i),T.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function gt(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var _t=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?gt(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},vt=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=mt(e,r.attrs),this.excluded=null;let i=ft(this.attrs);this.instance=i?new T(this,i):null}create(e=null){return!e&&this.instance?this.instance:new T(this,pt(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t-1}},yt=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=S.from(e.nodes),t.marks=S.from(e.marks||{}),this.nodes=ht.compile(this.spec.nodes,this),this.marks=vt.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Qe.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?bt(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:bt(this,n.split(` `))}this.nodeFromJSON=e=>Je.fromJSON(this,e),this.markFromJSON=e=>T.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof ht))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Ye(n,n.defaultAttrs,e,T.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function bt(e,t){let n=[];for(let r=0;r-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function xt(e){return e.tag!=null}function St(e){return e.style!=null}var Ct=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(xt(e))this.tags.push(e);else if(St(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Mt(this,t,!1);return n.addAll(e,T.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Mt(this,t,!0);return n.addAll(e,T.none,t.from,t.to),E.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;re.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r{n(e=Ft(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Ft(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},wt={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Tt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Et={ol:!0,ul:!0},Dt=1,Ot=2,kt=4;function At(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Dt:0)|(t===`full`?Ot:0)}var jt=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=T.none,this.match=i||(a&kt?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(w.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Dt)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=w.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(w.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!wt.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Mt=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=At(null,t.preserveWhitespace,0)|(n?kt:0);i=r?new jt(r.type,r.attrs,T.none,!0,t.topMatch||r.type.contentMatch,a):n?new jt(null,null,T.none,!0,null,a):new jt(e.schema.topNodeType,null,T.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Ot?`full`:this.localPreserveWS||(r.options&Dt)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,` +`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e!(a.type?a.type.allowsMarkType(t.type):It(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new jt(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Dt);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Nt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Et.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Pt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Ft(e){let t={};for(let n in e)t[n]=e[n];return t}function It(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n{if(i.length||e.marks.length){let n=0,a=0;for(;n=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Ut(zt(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:Ut(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Rt(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Rt(e.marks)}};function Rt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function zt(e){return e.document||window.document}var Bt=new WeakMap;function Vt(e){let t=Bt.get(e);return t===void 0&&Bt.set(e,t=Ht(e)),t}function Ht(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;iu)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=Ut(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Wt=65535,Gt=2**16;function Kt(e,t){return e+t*Gt}function qt(e){return e&Wt}function Jt(e){return(e-(e&Wt))/Gt}var Yt=1,Xt=2,Zt=4,Qt=8,$t=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Qt)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Zt)>0}},en=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=qt(e);if(!this.inverted)for(let e=0;ee)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Kt(o/3,e-s),f=0;return c&&(f|=e==s?Xt:e==u?Yt:Zt,(t<0?e!=s:e!=u)&&(f|=Qt)),new $t(a,f,d)}r+=l-c}return n?e+r:new $t(e+r,0,null)}touches(e,t){let n=0,r=qt(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;te)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;nn&&t!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return O.fromReplace(e,this.from,this.to,i)}invert(){return new on(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};D.jsonID(`addMark`,an);var on=class e extends D{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new E(rn(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return O.fromReplace(e,this.from,this.to,n)}invert(){return new an(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};D.jsonID(`removeMark`,on);var sn=class e extends D{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return O.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return O.fromReplace(e,this.pos,this.pos+1,new E(w.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;rr.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,E.fromJSON(t,n.slice),n.insert,!!n.structure)}};D.jsonID(`replaceAround`,un);function dn(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function fn(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;ee.step(t)),a.forEach(t=>e.step(t))}function pn(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof vt){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;ee.step(new on(t.from,t.to,t.style)))}function mn(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t=0;t--)e.step(o[t])}function hn(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function gn(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(nn;e--)t||r.index(e)>0?(t=!0,u=w.from(r.node(e).copy(u)),d++):c--;let f=w.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=w.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new un(i,a,i,a,new E(r,0,0),n.length,!0))}function Cn(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&En(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Tn(e,t,n,a),mn(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new un(c,l,c+1,l-1,new E(w.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&wn(e,t,n,a),!1}})}function wn(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Tn(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(` +`))}})}function En(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Dn(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new un(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new E(w.from(o),0,0),1,!0))}function On(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function kn(e,t,n=1,r){let i=e.doc.resolve(t),a=w.empty,o=w.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=w.from(i.node(e).copy(a));let t=r&&r[s];o=w.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new ln(t,t,new E(a.append(o),n,n),!0))}function An(e,t){let n=e.resolve(t),r=n.index();return Mn(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function jn(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Mn(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Pn(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);Tn(e,r.node(),r.before(),s)}o.inlineContent&&mn(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new ln(l,c.map(t+n,-1),E.empty,!0)),r===!0){let t=e.doc.resolve(l);wn(e,t.node(),t.before(),e.steps.length)}return e}function Fn(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Ln(e,t,n=t,r=E.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Rn(i,a,r)?new ln(t,n,r):new zn(i,a,r).fit()}function Rn(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var zn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=w.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=w.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new E(i,a,o);return e>-1?new un(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new ln(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Hn(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(w.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced;return qn(e,-1)<=t?!1:(this.unplaced.size>1&&qn(e,1)>n&&n++,this.unplaced=new E(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Hn(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new E(Bn(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new E(Bn(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e1||s==0||e.content.size)&&(u=t,l.push(Un(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=Vn(this.placed,t,w.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t=0;n--){let{match:t,type:r}=this.frontier[n],i=Wn(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Vn(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Vn(this.placed,this.depth,w.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(w.empty,!0);e.childCount&&(this.placed=Vn(this.placed,this.frontier.length,e))}};function Bn(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Bn(e.firstChild.content,t-1,n)))}function Vn(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Vn(e.lastChild.content,t-1,n)))}function Hn(e,t){for(let n=0;n1&&(r=r.replaceChild(0,Un(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(w.empty,!0)))),e.copy(r)}function Wn(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!Gn(n,a.content,o)?s:null}function Gn(e,t,n){for(let r=n;r0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Kn(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function Yn(e,t,n,r,i){if(tr){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(w.empty,!0))}return e}function Xn(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Fn(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new E(w.from(r),0,0))}function Zn(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Qn(r,i);for(let t=0;t0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Qn(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(rt.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var $n=class e extends D{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return O.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return O.fromReplace(e,this.pos,this.pos+1,new E(w.from(r),0,+!t.isLeaf))}getMap(){return en.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};D.jsonID(`attr`,$n);var er=class e extends D{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return O.ok(n)}getMap(){return en.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};D.jsonID(`docAttr`,er);var tr=class extends Error{};tr=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},tr.prototype=Object.create(Error.prototype),tr.prototype.constructor=tr,tr.prototype.name=`TransformError`;var nr=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new tn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new tr(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=E.empty){let r=Ln(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new E(w.from(n),0,0))}delete(e,t){return this.replace(e,t,E.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Jn(this,e,t,n),this}replaceRangeWith(e,t,n){return Xn(this,e,t,n),this}deleteRange(e,t){return Zn(this,e,t),this}lift(e,t){return _n(this,e,t),this}join(e,t=1){return Pn(this,e,t),this}wrap(e,t){return Sn(this,e,t),this}setBlockType(e,t=e,n,r=null){return Cn(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Dn(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new $n(e,t,n)),this}setDocAttribute(e,t){return this.step(new er(e,t)),this}addNodeMark(e,t){return this.step(new sn(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof T)t.isInSet(n.marks)&&this.step(new cn(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new cn(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return kn(this,e,t,n),this}addMark(e,t,n){return fn(this,e,t,n),this}removeMark(e,t,n){return pn(this,e,t,n),this}clearIncompatible(e,t,n){return mn(this,e,t,n),this}},rr=Object.create(null),k=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new ir(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;r--){let i=t<0?dr(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):dr(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new lr(e.node(0))}static atStart(e){return dr(e,e,0,0,1)||new lr(e)}static atEnd(e){return dr(e,e,e.content.size,e.childCount,-1)||new lr(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=rr[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in rr)throw RangeError(`Duplicate use of selection JSON ID `+e);return rr[e]=t,t.prototype.jsonID=e,t}getBookmark(){return A.between(this.$anchor,this.$head).getBookmark()}};k.prototype.visible=!0;var ir=class{constructor(e,t){this.$from=e,this.$to=t}},ar=!1;function or(e){!ar&&!e.parent.inlineContent&&(ar=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var A=class e extends k{constructor(e,t=e){or(e),or(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return k.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=E.empty){if(super.replace(e,t),t==E.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new sr(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=k.findFrom(n,r,!0)||k.findFrom(n,-r,!0);if(e)n=e.$head;else return k.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(k.findFrom(t,-r,!0)||k.findFrom(t,r,!0)).$anchor,t.pos0?0:1);i>0?o=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=dr(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&j.isSelectable(r))return j.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function fr(e,t,n){let r=e.steps.length-1;if(r{o??=r}),e.setSelection(k.near(e.doc.resolve(o),n))}var pr=1,mr=2,hr=4,gr=class extends nr{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=mr,this}ensureMarks(e){return T.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&mr)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||T.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(k.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=hr,this}get scrolledIntoView(){return(this.updated&hr)>0}};function _r(e,t){return!t||!e?e:e.bind(t)}var vr=class{constructor(e,t,n){this.name=e,this.init=_r(t.init,n),this.apply=_r(t.apply,n)}},yr=[new vr(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new vr(`selection`,{init(e,t){return e.selection||k.atStart(t.doc)},apply(e){return e.selection}}),new vr(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new vr(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],br=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=yr.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new vr(e.key,e.spec.state,e))})}},xr=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;ne.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new br(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=Je.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=k.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function Sr(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Sr(i,t,{})),n[r]=i}return n}var M=class{constructor(e){this.spec=e,this.props={},e.props&&Sr(e.props,this,this.props),this.key=e.key?e.key.key:wr(`plugin`)}getState(e){return e[this.key]}},Cr=Object.create(null);function wr(e){return e in Cr?e+`$`+ ++Cr[e]:(Cr[e]=0,e+`$`)}var N=class{constructor(e=`key`){this.key=wr(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Tr=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Er(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var Dr=(e,t,n)=>{let r=Er(e,n);if(!r)return!1;let i=Nr(r);if(!i){let n=r.blockRange(),i=n&&gn(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(Zr(e,i,t,-1))return!0;if(r.parent.content.size==0&&(jr(a,`end`)||j.isSelectable(a)))for(let n=r.depth;;n--){let o=Ln(e.doc,r.before(n),r.after(n),E.empty);if(o&&o.slice.size1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Or=(e,t,n)=>{let r=Er(e,n);if(!r)return!1;let i=Nr(r);return i?Ar(e,i,t):!1},kr=(e,t,n)=>{let r=Pr(e,n);if(!r)return!1;let i=Lr(r);return i?Ar(e,i,t):!1};function Ar(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=Ln(e.doc,i,o,E.empty);if(!s||s.from!=i||s instanceof ln&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(A.create(t.doc,i)),n(t.scrollIntoView())}return!0}function jr(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Mr=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=Nr(r)}let o=a&&a.nodeBefore;return!o||!j.isSelectable(o)?!1:(t&&t(e.tr.setSelection(j.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function Nr(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Pr(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset{let r=Pr(e,n);if(!r)return!1;let i=Lr(r);if(!i)return!1;let a=i.nodeAfter;if(Zr(e,i,t,1))return!0;if(r.parent.content.size==0&&(jr(a,`start`)||j.isSelectable(a))){let n=Ln(e.doc,r.before(),r.after(),E.empty);if(n&&n.slice.size{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let n=e.selection,r=n instanceof j,i;if(r){if(n.node.isTextblock||!An(e.doc,n.from))return!1;i=n.from}else if(i=Nn(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(j.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},zr=(e,t)=>{let n=e.selection,r;if(n instanceof j){if(n.node.isTextblock||!An(e.doc,n.to))return!1;r=n.to}else if(r=Nn(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Br=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&gn(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},Vr=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(` +`).scrollIntoView()),!0)};function Hr(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=Hr(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(k.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Wr=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof lr||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=Hr(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(On(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&gn(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function Kr(e){return(t,n)=>{if(t.selection instanceof j&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!On(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof A||t.selection instanceof lr)&&r.deleteSelection();let{$from:i}=r.selection,a=r.steps.length,o=[],s,c,l=!1,u=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),u=i.start(t)==i.pos-(i.depth-t),c=Hr(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,l,i);o.unshift(n||(l&&c?{type:c}:null)),s=t;break}else{if(t==1)return!1;o.unshift(null)}let d=i.pos,f=On(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,On(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!l&&u&&i.node(s).type!=c){let e=r.mapping.slice(a),t=e.map(i.before(s)),n=r.doc.resolve(t);c&&i.node(s-1).canReplaceWith(n.index(),n.index()+1,c)&&r.setNodeMarkup(e.map(i.before(s)),c)}return n&&n(r.scrollIntoView()),!0}}var qr=Kr(),Jr=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0&&(i=n.before(a),t&&t(e.tr.setSelection(j.create(e.doc,i))),!0)},Yr=(e,t)=>(t&&t(e.tr.setSelection(new lr(e.doc))),!0);function Xr(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||An(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Zr(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Xr(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=w.empty;for(let e=o.length-1;e>=0;e--)s=w.from(o[e].create(null,s));s=w.from(i.copy(s));let c=e.tr.step(new un(t.pos-1,r,t.pos,r,new E(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&An(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:k.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&gn(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&jr(a,`start`,!0)&&jr(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=w.empty;for(let e=o.length-1;e>=0;e--)r=w.from(o[e].copy(r));n(e.tr.step(new un(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new E(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Qr(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(A.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var $r=Qr(-1),ei=Qr(1);function ti(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&vn(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function ni(e,t=null){return function(n,r){let i=!1;for(let r=0;r{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t)){if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new Ke(e,e,t.depth),t.endIndex=0;e--)a=w.from(n[e].type.create(n[e].attrs,a));e.step(new un(t.start-(r?2:0),t.end,t.start,t.end,new E(a,0,0),n.length,!0));let o=0;for(let e=0;et.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?fi(t,n,e,a):pi(t,n,a):!0:!1}}function fi(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);aa;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?w.empty:w.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new un(d-+!!s,f+ +!!c,d+1,f-1,new E((s?w.empty:w.from(i.copy(w.empty))).append(c?w.empty:w.from(i.copy(w.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function mi(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=w.from(r?e.create():null),o=new E(w.from(e.create(null,w.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new un(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var P=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},hi=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},gi=null,_i=function(e,t,n){let r=gi||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},vi=function(){gi=null},yi=function(e,t,n,r){return n&&(xi(e,t,n,r,-1)||xi(e,t,n,r,1))},bi=/^(img|br|input|textarea|hr)$/i;function xi(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:F(e))){let n=e.parentNode;if(!n||!I(n)||Ei(e)||bi.test(e.nodeName)||e.contentEditable==`false`)return!1;t=P(e)+(i<0?0:1),e=n}else if(I(e)){let n=e.childNodes[t+(i<0?-1:0)];if(I(n)&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?F(e):0}else return!1}}function F(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function I(e){return e.nodeType==1}function L(e){return e.nodeType==3}function Si(e,t){return t?e.contains(I(t)?t:t.parentNode):!1}function Ci(e,t){for(;;){if(L(e)&&t)return e;if(I(e)&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=F(e)}else if(e.parentNode&&!Ei(e))t=P(e),e=e.parentNode;else return null}}function wi(e,t){for(;;){if(L(e)&&t2),Ui=Hi||(ji?/Mac/.test(ji.platform):!1),Wi=ji?/Win/.test(ji.platform):!1,Gi=/Android \d/.test(Ni),Ki=!!Mi&&`webkitFontSmoothing`in Mi.documentElement.style,qi=Ki?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ji(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Yi(e,t){return typeof e==`number`?e:e[t]}function Xi(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Zi(e,t,n){if(!fa(t)&&t.left==0)return;let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(!I(o)){o=hi(o);continue}let e=o==a.body,n=e?Ji(a):Xi(o),s=0,c=0;if(t.topn.bottom-Yi(r,`bottom`)&&(c=t.bottom-t.top>n.bottom-n.top?t.top+Yi(i,`top`)-n.top:t.bottom-n.bottom+Yi(i,`bottom`)),t.leftn.right-Yi(r,`right`)&&(s=t.right-n.right+Yi(i,`right`)),s||c){if(e)a.defaultView.scrollBy(s,c);else{let e=o.scrollLeft,n=o.scrollTop;c&&(o.scrollTop+=c),s&&(o.scrollLeft+=s);let r=o.scrollLeft-e,i=o.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i}}}let l=e?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(l))break;o=l==`absolute`?o.offsetParent:hi(o)}}function Qi(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:$i(e.dom)}}function $i(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=hi(r));return t}function ea({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ta(n,r==0?0:r-t)}function ta(e,t){for(let n=0;n=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&L(n)?aa(n,i):!n||r?{node:e,offset:a}:ia(n,i)}function aa(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function oa(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function sa(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function la(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(I(t.dom)&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right-1?i:e.docView.posFromDOM(t,n,-1)}function ua(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&i++}let n;Ki&&i&&I(r)&&I(n=r.childNodes[i-1])&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&I(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||!I(r)||r.childNodes[i-1].nodeName!=`BR`)&&(s=la(e,r,i,t))}s??=ca(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function fa(e){return e.top=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,ga(pa(_i(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==F(r))){let e=r.childNodes[i-1];if(I(e))return _a(e.getBoundingClientRect(),!1)}if(a==null&&i=0)}if(a==null&&i&&(n<0||i==F(r))){let e=r.childNodes[i-1],t=L(e)?_i(e,F(e)-+!o):I(e)&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return ga(pa(t,1),!1)}if(a==null&&i=0)}function ga(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function _a(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function va(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function ya(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return va(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=ha(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(I(e))t=e.getClientRects();else if(L(e))t=_i(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;ei.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var ba=/[\u0590-\u08ac]/;function xa(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!ba.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:va(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!Si(l,u)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var Sa=null,Ca=null,wa=!1;function Ta(e,t,n){return Sa==t&&Ca==n?wa:(Sa=t,Ca=n,wa=n==`up`||n==`down`?ya(e,t,n):xa(e,t,n))}var Ea=0,Da=1,Oa=2,ka=3,Aa=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Ea,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tP(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=!!(e.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(I(a)?Si(a,e):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;te){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof La||e instanceof ja&&e.side>=0))break}if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?P(e.dom)+1:0}}{let e,r=!0;for(;e=n=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=P(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;es&&at){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r=n:en){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?Oa:Da,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=ka:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Oa:ka}n=a}this.dirty=Oa}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Oa:Da;t.dirty{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){let e=I(a)?a:document.createElement(`span`);e!=a&&e.appendChild(a),e.hasAttribute(`contenteditable`)||(e.contentEditable=`false`),e.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Ea&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Ma=class extends Aa{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Na=class e extends Aa{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=Lt.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&ka||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ka&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ea){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty0&&(a=eo(a,0,t,r));for(let e=0;e{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(!L(u))throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Lt.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Ga(u,r,n),l?c=new Ra(t,n,r,i,u,d||null,f,l):n.isText?new Ia(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>I(t)&&e.indexOf(t.parentNode)<0&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>w.empty}}return t}matchesNode(e,t,n){return this.dirty==Ea&&e.eq(this.node)&&Ka(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new Ja(this,a&&a.node,e),c=this.node.inlineContent,l=c&&this.node.isBlock;Za(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?T.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,u,d)=>{s.syncToMarks(t.marks,n,e,d),l&&t.isAtom&&!t.isText&&s.addHackNode(`IMG`,s.top);let f;s.findNodeMatch(t,a,u,d)||o&&e.state.selection.from>r&&e.state.selection.to-1&&s.updateNodeAt(t,a,u,f,e)||s.updateNextNode(t,a,u,e,d,r)||s.addNode(t,a,u,e,r),r+=t.nodeSize,c&&(l=t.isAtom&&!t.isText)}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Oa)&&(a&&this.protectLocalComposition(e,a),za(this.contentDOM,this.children,e),Hi&&Qa(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof A)||nt+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=$a(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new Ma(this,i,t,r);e.input.compositionNodes.push(a),this.children=eo(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==ka||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Ea}updateOuterDeco(e){if(Ka(e,this.outerDeco))return;let t=!I(this.nodeDOM),n=this.dom;this.dom=Ua(this.dom,this.nodeDOM,Ha(this.outerDeco,this.node,t),Ha(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){I(this.nodeDOM)&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){I(this.nodeDOM)&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Fa(e,t,n,r,i){Ga(r,t,e);let a=new Pa(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var Ia=class e extends Pa{constructor(e,t,n,r,i,a){super(e,t,n,r,i,null,a)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==ka||this.dirty!=Ea&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ea||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Ea,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=ka)}get domAtom(){return!1}isText(e){return this.node.text==e}},La=class extends Aa{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ea&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},Ra=class extends Pa{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o),this.spec=s}update(e,t,n,r){if(this.dirty==ka)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function za(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a>1,o=Math.min(a,e.length);for(;i-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=Na.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Na)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Xa(e,t){return e.type.side-t.type.side}function Za(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;na;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Qa(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function $a(e,t,n,r){for(let i=0,a=0;i=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function eo(e,t,n,r,i){let a=[];for(let o=0,s=0;o=n||u<=t?a.push(c):(ln&&a.push(c.slice(n-l,c.size,r)))}return a}function to(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Di(n)){for(c=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&j.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&Ti(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new j(o==e?s:r.resolve(e))}else if(zi&&t==`key`&&o>e.state.selection.to&&I(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if(getComputedStyle(e).overflow!=`visible`){l=k.findFrom(r.resolve(i.posAtStart),1);break}if(e==i.dom||e.nextSibling||!e.parentNode||!I(e.parentNode))break}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!no(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function lo(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,P(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Li&&Ri<=11&&(n.disabled=!0,n.disabled=!1)}function uo(e,t){if(t instanceof j){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(fo(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else fo(e)}function fo(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function po(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||A.between(t,n,r)}function mo(e){return e.editable&&!e.hasFocus()?!1:ho(e)}function ho(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return Si(e.dom,t.anchorNode)&&(e.editable||Si(e.dom,t.focusNode))}catch{return!1}}function go(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return yi(t.node,t.offset,n.anchorNode,n.anchorOffset)}function _o(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&k.findFrom(a,t)}function vo(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function yo(e,t,n){let r=e.state.selection;if(r instanceof A){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return vo(e,new A(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=_o(e.state,t);return n&&n instanceof j?vo(e,n):!1}if(!(Ui&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?j.isSelectable(i)?vo(e,new j(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):vo(e,new A(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1}}else if(r instanceof j&&r.node.isInline)return vo(e,new A(t>0?r.$to:r.$from));else{let n=_o(e.state,t);return n?vo(e,n):!1}}function bo(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`):I(e)&&e.contentEditable==`false`}function xo(e,t){return t<0?So(e):Co(e)}function So(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(zi&&I(n)&&r0){if(!I(n))break;let e=n.childNodes[r-1];if(bo(e,-1))i=n,a=--r;else if(L(e))n=e,r=n.nodeValue.length;else break}else if(wo(n))break;else{let t=n.previousSibling;for(;t&&bo(t,-1);)i=n.parentNode,a=P(t),t=t.previousSibling;if(t)n=t,r=F(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?Do(e,n,r):i&&Do(e,i,a)}function Co(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=F(n),a,o;for(;;)if(r{e.state==i&&ro(e)},50)}function Oo(e,t){let n=e.state.doc.resolve(t);if(!(R||Wi)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i1)return n.leftr.top&&i1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function ko(e,t,n){let r=e.state.selection;if(r instanceof A&&!r.empty||n.indexOf(`s`)>-1||Ui&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=_o(e.state,t);if(n&&n instanceof j)return vo(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof lr?k.near(n,t):k.findFrom(n,t);return o?vo(e,o):!1}return!1}function Ao(e,t){if(!(e.state.selection instanceof A))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function jo(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Mo(e){if(!z||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&I(t)&&n==0&&t.firstChild&&I(t.firstChild)&&t.firstChild.contentEditable==`false`){let n=t.firstChild;jo(e,n,`true`),setTimeout(()=>jo(e,n,`false`),20)}return!1}function No(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Po(e,t){let n=t.keyCode,r=No(t);if(n==8||Ui&&n==72&&r==`c`)return Ao(e,-1)||xo(e,-1);if(n==46&&!t.shiftKey||Ui&&n==68&&r==`c`)return Ao(e,1)||xo(e,1);if(n==13||n==27)return!0;if(n==37||Ui&&n==66&&r==`c`){let t=n==37?Oo(e,e.state.selection.from)==`ltr`?-1:1:-1;return yo(e,t,r)||xo(e,t)}if(n==39||Ui&&n==70&&r==`c`){let t=n==39?Oo(e,e.state.selection.from)==`ltr`?1:-1:1;return yo(e,t,r)||xo(e,t)}return n==38||Ui&&n==80&&r==`c`?ko(e,-1,r)||xo(e,-1):n==40||Ui&&n==78&&r==`c`?Mo(e)||ko(e,1,r)||xo(e,1):!(r!=(Ui?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function Fo(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||Lt.fromSchema(e.state.schema),s=Go(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&I(l)&&(u=Wo[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&I(l)&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,` + +`),slice:t}}function Io(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new E(w.from(e.state.schema.text(t.replace(/\r\n?/g,` +`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=Lt.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=Jo(n),Ki&&Yo(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&!I(e);)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Ct.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!Lo.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Xo(Uo(s,+u[1],+u[2]),u[4]);else if(s=E.maxOpen(Ro(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e{s=t(s,e,c)}),s}var Lo=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Ro(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&Bo(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=Vo(a[a.length-1],i.length));let n=zo(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return w.from(a)}return e}function zo(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,w.from(e));return e}function Bo(e,t,n,r,i){if(i1&&(a=0),i=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(w.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function Uo(e,t,n){return te})}return Ko.createHTML(e)}function Jo(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Go(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),a;if((a=i&&Wo[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>``).reverse().join(``)),r.innerHTML=qo(e),a)for(let e=0;e=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{i=w.from(t.create(r[e+1],i))}catch{break}a++,o++}return new E(i,a,o)}var B={},V={},Zo={touchstart:!0,touchmove:!0},Qo=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function $o(e){for(let t in B){let n=B[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{is(e,t)&&!rs(e,t)&&(e.editable||!(t.type in V))&&n(e,t)},Zo[t]?{passive:!0}:void 0)}z&&e.dom.addEventListener(`input`,()=>null),ns(e)}function es(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function ts(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function ns(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>rs(e,t))})}function rs(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function is(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function as(e,t){!rs(e,t)&&B[t.type]&&(e.editable||!(t.type in V))&&B[t.type](e,t)}V.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Cs(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Gi&&R&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),Hi&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Oi(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Po(e,n)?n.preventDefault():es(e,`key`)}},V.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},V.keypress=(e,t)=>{let n=t;if(Cs(e)||!n.charCode||n.ctrlKey&&!n.altKey||Ui&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof A)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function ss(e){return{left:e.clientX,top:e.clientY}}function cs(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function ls(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function us(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta(`pointer`,!0),e.dispatch(r)}function ds(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&j.isSelectable(r)?(us(e,new j(n)),!0):!1}function fs(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof j&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(j.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i!=null&&(us(e,j.create(e.state.doc,i)),!0)}function ps(e,t,n,r,i){return ls(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?fs(e,n):ds(e,n))}function ms(e,t,n,r){return ls(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function hs(e,t,n,r){return ls(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||gs(e,n,r)}function gs(e,t,n){if(n.button!=0)return!1;let r=_s(e,t,!0),i=e.state.doc;return r?(us(e,r),r instanceof A&&i.eq(e.state.doc)&&(e.input.mouseDown=new Ss(e,r)),!0):!1}function _s(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?A.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return A.create(r,a+1,a+1+t.content.size);if(n&&j.isSelectable(t))return j.create(r,a)}return null}function vs(e){return ks(e)}var ys=Ui?`metaKey`:`ctrlKey`;B.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=vs(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&cs(n,e.input.lastClick)&&!n[ys]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(ss(n));o&&(a==`singleClick`?e.input.mouseDown=new xs(e,o,n,!!r):(a==`doubleClick`?ms:hs)(e,o.pos,o.inside,n)?n.preventDefault():es(e,`pointer`))};var bs=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},xs=class extends bs{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[ys],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&I(s.nodeDOM)?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof j&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!!(this.target&&zi&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),es(e,`pointer`)}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||ro(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ss(e))),this.updateAllowDefault(e),this.allowDefault||!t?es(this.view,`pointer`):ps(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||z&&this.mightDrag&&!this.mightDrag.node.isAtom||R&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(us(this.view,k.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):es(this.view,`pointer`)}move(e){this.updateAllowDefault(e),es(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},Ss=class extends bs{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),es(this.view,`pointer`);let t=this.view.posAtCoords(ss(e)),n=t&&_s(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from{e.input.lastTouch=Date.now(),vs(e),es(e,`pointer`)},B.touchmove=e=>{e.input.lastTouch=Date.now(),es(e,`pointer`)},B.contextmenu=e=>vs(e);function Cs(e,t){return e.composing?!0:z&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var ws=Gi?5e3:-1;V.compositionstart=V.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof A&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||R&&Wi&&Ts(e)))e.markCursor=e.state.storedMarks||n.marks(),ks(e,!0),e.markCursor=null;else if(ks(e,!t.selection.empty),zi&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&I(n)&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(L(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Es(e,ws)};function Ts(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!I(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return I(r)&&r.contentEditable==`false`}V.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Es(e,20))};function Es(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>ks(e),t))}function Ds(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Os(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Ci(t.focusNode,t.focusOffset),r=wi(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function ks(e,t=!1){if(!(Gi&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Ds(e),t||e.docView&&e.docView.dirty){let n=to(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function As(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var js=Li&&Ri<15||Hi&&qi<604;B.copy=V.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=js?null:n.clipboardData,{dom:o,text:s}=Fo(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):As(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Ms(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Ns(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ps(e,r.value,null,i,t):Ps(e,r.textContent,r.innerHTML,i,t)},50)}function Ps(e,t,n,r,i){let a=Io(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||E.empty)))return!0;if(!a)return!1;let o=Ms(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function Fs(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}V.paste=(e,t)=>{let n=t;if(e.composing&&!Gi)return;let r=js?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Ps(e,Fs(r),r.getData(`text/html`),i,n)?n.preventDefault():Ns(e,n)};var Is=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Ls=Ui?`altKey`:`ctrlKey`;function Rs(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[Ls]:!n}B.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(ss(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof j?i.to-1:i.to))){if(r&&r.mightDrag)o=j.create(e.state.doc,r.mightDrag.pos);else if(n.target&&I(n.target)){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=j.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=Fo(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!R||Vi>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(js?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,js||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Is(l,Rs(e,n),o)},B.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},V.dragover=V.dragenter=(e,t)=>t.preventDefault(),V.drop=(e,t)=>{try{zs(e,t,e.dragging)}finally{e.dragging=null}};function zs(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(ss(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=Io(e,Fs(t.dataTransfer),js?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&Rs(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||E.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?In(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&j.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new j(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(po(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}B.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ro(e)},20))},B.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},B.beforeinput=(e,t)=>{if(Gi&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Oi(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in V)B[e]=V[e];function Bs(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var Vs=class e{constructor(e,t){this.toDOM=e,this.spec=t||Ks,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new Ws(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Bs(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Hs=class e{constructor(e,t){this.attrs=e,this.spec=t||Ks}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new Ws(i,a,this)}valid(e,t){return t.from=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;ae){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==U||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Ks)}mapInner(t,n,r,i,a){let o;for(let e=0;e{let o=t+r,s;if(s=Zs(n,e,o)){for(i||=this.children.slice();aa&&n.to=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;ea&&t.type instanceof Hs){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;ee.map(t,n,Ks));return e.from(r)}forChild(t,n){if(n.isLeaf)return H.empty;let r=[];for(let i=0;ie instanceof H)?t:t.reduce((e,t)=>e.concat(t instanceof H?t:t.members),[]))}}forEachSet(e){for(let t=0;t{let o=a-i-(n-e);for(let i=0;ia+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==U?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=$s(Xs(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;en&&a.to{let s=Zs(e,t,o+n);if(s){a=!0;let e=$s(s,t,n+o+1,r);e!=U&&i.push(o,o+t.nodeSize,e)}});let o=Ys(a?Qs(e):e,-n).sort(ec);for(let e=0;e0;)t++;e.splice(t,0,n)}function rc(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=U&&t.push(r)}),e.cursorWrapper&&t.push(H.create(e.state.doc,[e.cursorWrapper.deco])),qs.from(t)}var ic={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ac=Li&&Ri<=11,oc=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},sc=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new oc,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;ee.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():z&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ac&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ic)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(mo(this.view)){if(this.suppressingSelectionUpdates)return ro(this.view);if(Li&&Ri<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&yi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=hi(n))t.add(n);for(let r=e.anchorNode;r;r=hi(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:L(n)?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&mo(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;ee.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||R&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&I(t);){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(zi&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||pc(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||r)&&(i>-1&&(e.docView.markDirty(i,a),uc(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,mc(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||ro(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;na;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){o=e;break}if(!n||n.size)break}let f=e.state.doc,p=e.someProp(`domParser`)||Ct.fromSchema(e.state.schema),m=f.resolve(s),h=null,g=p.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:o,preserveWhitespace:m.parent.type.whitespace!=`pre`||`full`,findPositions:u,ruleFromNode:gc(r),context:m});if(u&&u[0].pos!=null){let e=u[0].pos,t=u[1]&&u[1].pos;t??=e,h={anchor:e+s,head:t+s}}return{doc:g,sel:h,from:s,to:c}}var gc=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(z&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}if(t.parentNode.lastChild==t||z&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},_c=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function vc(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=to(e,t);if(n&&!e.state.selection.eq(n)){if(R&&Gi&&e.input.lastKeyCode===13&&Date.now()-100t(e,Oi(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=hc(e,t,n,i),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Gi)&&i.some(e=>I(e)&&!_c.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Oi(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof A&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=yc(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}}e.state.selection.frome.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Li&&Ri<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),ee=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((Hi&&e.input.lastIOSEnter>Date.now()-225&&(!ee||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!ee&&Sc(l.doc,h.pos,g.pos))&&e.someProp(`handleKeyDown`,t=>t(e,Oi(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&xc(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Oi(8,`Backspace`)))){Gi&&R&&e.domObserver.suppressSelectionUpdates();return}R&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Gi&&!ee&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Oi(13,`Enter`))})},20));let te=m.start,v=m.endA,y=t=>{let n=t||e.state.tr.replace(te,v,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=yc(e,n.doc,l.sel);t&&!(R&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDeletero(e),20));let t=y(e.state.tr.delete(te,v)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(b=bc(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=y(e.state.tr);b.type==`add`?t.addMark(te,v,b.mark):t.removeMark(te,v,b.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>y(e.state.tr.insertText(t,te,v));e.someProp(`handleTextInput`,r=>r(e,te,v,t,n))||e.dispatch(n())}else e.dispatch(y())}else e.dispatch(y())}function yc(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:po(e,t.resolve(n.anchor),t.resolve(n.head))}function bc(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;ee.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;en||Cc(o,!0,!1){e.isTextblock&&a>=t&&a0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function wc(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var Tc=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Qo,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Mc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Oc(this),Dc(this),this.nodeViews=Ac(this),this.docView=Fa(this.state.doc,Ec(this),rc(this),this.dom,this),this.domObserver=new sc(this,(e,t,n,r)=>vc(this,e,t,n,r)),this.domObserver.start(),$o(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ns(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Mc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Ds(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Ac(this);jc(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&ns(this),this.editable=Oc(this),Dc(this);let o=rc(this),s=Ec(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Qi(this);if(i){this.domObserver.stop();let t=l&&(Li||R)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&kc(n.selection,e.selection);if(l){let n=R?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Os(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Fa(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&go(this)&&i.delaySelUpdate())?ro(this,t):(uo(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&ea(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&Si(this.dom,e)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof j){let t=this.docView.domAfterPos(this.state.selection.from);I(t)&&Zi(this,t.getBoundingClientRect(),e)}else Zi(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e0&&ee.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return da(this,e)}coordsAtPos(e,t=1){return ha(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return Ta(this,t||this.state,e)}pasteHTML(e,t){return Ps(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Ps(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return Fo(this,e)}destroy(){this.docView&&(ts(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rc(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,vi())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return as(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?z&&this.root.nodeType===11&&ki(this.dom.ownerDocument)==this.dom&&fc(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Tc.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Ec(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[Ws.node(0,e.state.doc.content.size,t)]}function Dc(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:Ws.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Oc(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function kc(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Ac(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function jc(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Mc(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var Nc={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},Pc={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Fc=typeof navigator<`u`&&/Mac/.test(navigator.platform),Ic=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Lc=0;Lc<10;Lc++)Nc[48+Lc]=Nc[96+Lc]=String(Lc);for(var Lc=1;Lc<=24;Lc++)Nc[Lc+111]=`F`+Lc;for(var Lc=65;Lc<=90;Lc++)Nc[Lc]=String.fromCharCode(Lc+32),Pc[Lc]=String.fromCharCode(Lc);for(var Rc in Nc)Pc.hasOwnProperty(Rc)||(Pc[Rc]=Nc[Rc]);function zc(e){var t=!(Fc&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Ic&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Pc:Nc)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var Bc=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Vc=typeof navigator<`u`&&/Win/.test(navigator.platform);function Hc(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if(n!==`then`)return n===`run`?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if(t!==`then`)return t===`chain`?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:qc({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},Yc=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)==null||(n=n.getSelection())==null||n.removeAllRanges()}}),!0),Xc=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),Zc=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=gn(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Qc=e=>t=>e(t),$c=()=>({state:e,dispatch:t})=>Wr(e,t),el=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new A(r.doc.resolve(Math.max(o-1,0)))),!0},tl=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function W(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var nl=e=>({tr:t,state:n,dispatch:r})=>{let i=W(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},rl=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},il=e=>e.content?/^text(\*|\+)/.test(e.content):!1,al=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos({from:al(e,n,`left`),to:al(t,n,`right`)}),sl=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:a,to:o}=ol(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.selection.empty||n.setSelection(A.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},cl=()=>({commands:e})=>e.keyboardShortcut(`Enter`),ll=()=>({state:e,dispatch:t})=>Ur(e,t);function ul(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function dl(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:ul(t[r])?t[r].test(e[r]):t[r]===e[r])}function fl(e,t,n={}){return e.find(e=>e.type===t&&dl(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function pl(e,t,n={}){return!!fl(e,t,n)}function ml(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!fl([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&pl([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o({tr:n,state:r,dispatch:i})=>{let a=hl(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=ml(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=A.create(o,e.from,e.to);n.setSelection(t)}}return!0},_l=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(Sl()||xl())&&r.dom.focus(),Cl()&&!Sl()&&!xl()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!vl(n.state.selection))return o(),!0;let s=bl(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Tl=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),El=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Dl=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Dl(r)}return e};function Ol(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`${e}`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return Dl(n)}function kl(e){return typeof e?.nodesBetween==`function`}function Al(e,t,n){if(kl(e))return e;let r=typeof e==`object`&&!!e;n={slice:!0,parseOptions:{},...n};let i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return w.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),Al(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new yt({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?Ct.fromSchema(a).parseSlice(Ol(e),n.parseOptions):Ct.fromSchema(a).parse(Ol(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=Ct.fromSchema(t);return n.slice?r.parseSlice(Ol(e),n.parseOptions).content:r.parse(Ol(e),n.parseOptions)}return Al(``,t,n)}function jl(e){return!(`type`in e)}function Ml(e,t,n){let r=e.steps.length-1;if(r{o===0&&(o=r)}),e.setSelection(k.near(e.doc.resolve(o),n))}var Nl=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Al(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=Al(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0,f=jl(i)?i.content:[i];if(f.forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let p;if(u)p=Array.isArray(t)?t.map(e=>e.text||``).join(``):kl(t)?f.map(e=>e.text??``).join(``):typeof t==`object`&&t&&t.text?t.text:t,r.insertText(p,c,l);else{p=w.from(f);let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,i=t.isText||t.isTextblock,a=t.content.size>0;n&&i&&a&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&Ml(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:p})}return!0};function Pl(e){for(let t=0;t({tr:t,dispatch:n,editor:r})=>{let{pos:i,attrs:a,content:o,updateSelection:s=!0}=e,c;c=typeof i==`number`?t.doc.resolve(i):i||t.selection.$from;let l=Pl(c.parent.contentMatchAt(c.index()));if(!l)return!1;let u=Object.keys(l.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{},f;if(o){let e=Al(o,r.schema);f=l.createAndFill(d,e)}else f=l.createAndFill(d);return f?(n&&(t.insert(c.pos,f),s&&Ml(t,t.steps.length-1,-1)),!0):!1},Il=()=>({state:e,dispatch:t})=>Rr(e,t),Ll=()=>({state:e,dispatch:t})=>zr(e,t),Rl=()=>({state:e,dispatch:t})=>Dr(e,t),zl=()=>({state:e,dispatch:t})=>Fr(e,t),Bl=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Nn(e.doc,e.selection.$from.pos,-1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Vl=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Nn(e.doc,e.selection.$from.pos,1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Hl=()=>({state:e,dispatch:t})=>Or(e,t),Ul=()=>({state:e,dispatch:t})=>kr(e,t);function Wl(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function Gl(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e({editor:t,view:n,tr:r,dispatch:i})=>{let a=Gl(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function ql(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?W(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>!o||o.name===e.node.type.name).filter(e=>dl(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Jl=(e,t={})=>({state:n,dispatch:r})=>ql(n,W(e,n.schema),t)?Br(n,r):!1,Yl=()=>({state:e,dispatch:t})=>Gr(e,t),Xl=e=>({state:t,dispatch:n})=>di(W(e,t.schema))(t,n),Zl=()=>({state:e,dispatch:t})=>Vr(e,t);function Ql(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function $l(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var eu=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Ql(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=W(e,r.schema)),s===`mark`&&(o=hl(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,$l(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create($l(a.attrs,t))))})})}),c},tu=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),nu=()=>({tr:e,dispatch:t})=>{if(t){let t=new lr(e.doc);e.setSelection(t)}return!0},ru=()=>({state:e,dispatch:t})=>Mr(e,t),iu=()=>({state:e,dispatch:t})=>Ir(e,t),au=()=>({state:e,dispatch:t})=>Jr(e,t),ou=()=>({state:e,dispatch:t})=>ei(e,t),su=()=>({state:e,dispatch:t})=>$r(e,t);function cu(e,t,n={},r={}){return Al(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var lu=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=cu(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){let e=jl(s)?s.content:[s];a.replaceWith(0,c.content.size,e).setMeta(`preventUpdate`,!n)}return!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function uu(e,t){let n=hl(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function du(e,t){let n=new nr(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function fu(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function pu(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function mu(e){return t=>pu(t.$from,e)}function G(e,t,n){return e.config[t]===void 0&&e.parent?G(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?G(e.parent,t,n):null}):e.config[t]}function hu(e){return e.map(e=>{let t=G(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...hu(t())]:e}).flat(10)}function gu(e,t){let n=Lt.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function _u(e){return typeof e==`function`}function K(e,t=void 0,...n){return _u(e)?t?e.bind(t)(...n):e(...n):e}function vu(e={}){return Object.keys(e).length===0&&e.constructor===Object}function yu(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function bu(e){let t=[],{nodeExtensions:n,markExtensions:r}=yu(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=G(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=G(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function xu(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function Su(e){let t=[],n=xu(e||``),r=n.length;for(let e=0;e!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(e===`__proto__`){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});return}if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...Su(n[e]),...Su(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function Cu(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>q(e,t),{})}function wu(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function Tu(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):wu(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function Eu(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&vu(t)?!1:t!=null))}function Du(e){var t,n;let r={};return!(e!=null&&(t=e.attribute)!=null&&t.isRequired)&&`default`in(e?.attribute||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function Ou(e,t){let n=bu(e),{nodeExtensions:r,markExtensions:i}=yu(e),a=r.find(e=>G(e,`topNode`))?.name;return new yt({topNode:a,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Eu({...e.reduce((e,t)=>{let n=G(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:K(G(r,`content`,a)),marks:K(G(r,`marks`,a)),group:K(G(r,`group`,a)),inline:K(G(r,`inline`,a)),atom:K(G(r,`atom`,a)),selectable:K(G(r,`selectable`,a)),draggable:K(G(r,`draggable`,a)),code:K(G(r,`code`,a)),whitespace:K(G(r,`whitespace`,a)),linebreakReplacement:K(G(r,`linebreakReplacement`,a)),defining:K(G(r,`defining`,a)),isolating:K(G(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Du))}),s=K(G(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Tu(e,i)));let c=G(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:Cu(e,i)}));let l=G(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Eu({...e.reduce((e,t)=>{let n=G(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:K(G(r,`inclusive`,a)),excludes:K(G(r,`excludes`,a)),group:K(G(r,`group`,a)),spanning:K(G(r,`spanning`,a)),code:K(G(r,`code`,a)),attrs:Object.fromEntries(i.map(Du))}),s=K(G(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Tu(e,i)));let c=G(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:Cu(e,i)})),[r.name,o]}))})}function ku(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function Au(e){return e.sort((e,t)=>{let n=G(e,`priority`)||100,r=G(t,`priority`)||100;return n>r?-1:+(ne.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Mu(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=` + +`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function Nu(e,t){return Mu(e,{from:0,to:e.content.size},t)}function Pu(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Fu(e,t){let n=W(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Iu(e,t){let n=Ql(typeof t==`string`?t:t.name,e.schema);return n===`node`?Fu(e,t):n===`mark`?uu(e,t):{}}function Lu(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Ru(e){let t=Lu(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function zu(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Ru(r)}function Bu(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=ml(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&e?.nodeSize!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Vu=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},Hu=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function Uu(e,t){return t.nodes[e]||t.marks[e]||null}function Wu(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var Gu=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function Ku(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?hl(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>dl(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>dl(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function qu(e,t,n={}){if(!t)return ql(e,null,n)||Ku(e,null,n);let r=Ql(t,e.schema);return r===`node`?ql(e,t,n):r===`mark`&&Ku(e,t,n)}var Ju=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=mu(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Xu(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Zu(e,t){let{nodeExtensions:n}=yu(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=K(G(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function Qu(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(Qu(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function $u(e){return e instanceof j}var ed=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function td(e,t){let n=t.mapping.mapResult(e.position);return{position:new ed(n.pos),mapResult:n}}function nd(e){return new ed(e)}function rd(e,t,n){let{selection:r}=t,i=null;if(vl(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var id=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=hl(e,r.schema);if(i){if(o){let e=uu(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})})}return rd(r,n,c)},ad=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),od=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=W(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>ni(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>ni(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},sd=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=yl(e,0,n.content.size),i=j.create(n,r);t.setSelection(i)}return!0},cd=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},ld=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=A.atStart(n).from,o=A.atEnd(n).to,s=yl(r,a,o),c=yl(i,a,o),l=A.create(n,s,c);t.setSelection(l)}return!0},ud=e=>({state:t,dispatch:n})=>mi(W(e,t.schema))(t,n);function dd(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var fd=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=Wu(l,s.node().type.name,s.node().attrs);if(a instanceof j&&a.node.isBlock)return!s.parentOffset||!On(o,s.pos)?!1:(r&&(e&&dd(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Pl(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=On(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&On(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof A&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&dd(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},pd=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=W(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=w.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=w.from(s.node(t).copy(e));let i=s.indexAfter(-1){if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(A.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Wu(d,u.type.name,u.attrs),...t},m={...Wu(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!On(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function md(e){return!e||e===`1`?null:e}function hd(e,t){return md(e)===md(t)}var gd=(e,t)=>{let n=mu(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&An(e.doc,n.pos))||!hd(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},_d=(e,t)=>{let n=mu(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&An(e.doc,r))||!hd(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function vd(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return A.between(r,i)}var yd=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=W(e,o.schema),m=W(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:ee}=h,te=_.blockRange(ee),v=g||h.$to.parentOffset&&h.$from.marks();if(!te)return!1;let y=mu(e=>Zu(e.type.name,d))(h),b=h.from===0&&h.to===o.doc.content.size,ne=o.doc.content.content,re=ne.length===1?ne[0]:null,ie=b&&re&&Zu(re.type.name,d)?{node:re,pos:0,depth:0}:null,x=y??ie,ae=!!y&&te.depth>=1&&te.depth-y.depth<=1,oe=!!ie;if((ae||oe)&&x){if(x.node.type===p)return b&&oe?c().command(({tr:e,dispatch:t})=>{let n=vd(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Zu(x.node.type.name,d)&&p.validContent(x.node.content))return c().command(()=>(a.setNodeMarkup(x.pos,p),!0)).command(()=>gd(a,p)).command(()=>_d(a,p)).run()}return!n||!v||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>gd(a,p)).command(()=>_d(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=v.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>gd(a,p)).command(()=>_d(a,p)).run()},bd=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=hl(e,r.schema);return Ku(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},xd=(e,t,n={})=>({state:r,commands:i})=>{let a=W(e,r.schema),o=W(t,r.schema),s=ql(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},Sd=(e,t={})=>({state:n,commands:r})=>{let i=W(e,n.schema);return ql(n,i,t)?r.lift(i):r.wrapIn(i,t)},Cd=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},wd=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},Td=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=hl(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=ml(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Ed=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},Dd=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Ql(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=W(e,r.schema)),s===`mark`&&(o=hl(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},Od=new N(`__tiptap_decorations__`),kd=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(Od,{type:`force`,name:e}),!0),Ad=(e,t={})=>({state:n,dispatch:r})=>ti(W(e,n.schema),t)(n,r),jd=(e,t={})=>({state:n,dispatch:r})=>ci(W(e,n.schema),t)(n,r),Md=Se({blur:()=>Yc,clearContent:()=>Xc,clearNodes:()=>Zc,command:()=>Qc,createParagraphNear:()=>$c,cut:()=>el,deleteCurrentNode:()=>tl,deleteNode:()=>nl,deleteRange:()=>rl,deleteSelection:()=>sl,enter:()=>cl,exitCode:()=>ll,extendMarkRange:()=>gl,first:()=>_l,focus:()=>wl,forEach:()=>Tl,insertContent:()=>El,insertContentAt:()=>Nl,insertDefaultBlock:()=>Fl,joinBackward:()=>Rl,joinDown:()=>Ll,joinForward:()=>zl,joinItemBackward:()=>Bl,joinItemForward:()=>Vl,joinTextblockBackward:()=>Hl,joinTextblockForward:()=>Ul,joinUp:()=>Il,keyboardShortcut:()=>Kl,lift:()=>Jl,liftEmptyBlock:()=>Yl,liftListItem:()=>Xl,newlineInCode:()=>Zl,resetAttributes:()=>eu,scrollIntoView:()=>tu,selectAll:()=>nu,selectNodeBackward:()=>ru,selectNodeForward:()=>iu,selectParentNode:()=>au,selectTextblockEnd:()=>ou,selectTextblockStart:()=>su,setContent:()=>lu,setMark:()=>id,setMeta:()=>ad,setNode:()=>od,setNodeSelection:()=>sd,setTextDirection:()=>cd,setTextSelection:()=>ld,sinkListItem:()=>ud,splitBlock:()=>fd,splitListItem:()=>pd,toggleList:()=>yd,toggleMark:()=>bd,toggleNode:()=>xd,toggleWrap:()=>Sd,undoInputRule:()=>Cd,unsetAllMarks:()=>wd,unsetMark:()=>Td,unsetTextDirection:()=>Ed,updateAttributes:()=>Dd,updateDecorations:()=>kd,wrapIn:()=>Ad,wrapInList:()=>jd}),Nd=new WeakMap;function Pd(e,t){Nd.set(e,(Nd.get(e)??0)+1);try{return t()}finally{let t=(Nd.get(e)??1)-1;t>0?Nd.set(e,t):Nd.delete(e)}}function Fd(e){return Nd.has(e)}var Id=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Ld=typeof process<`u`&&!1;function Rd(e){return e.kind===`widget`}function zd(e,t){let n=[],r=new Set;for(let i of e)i.kind===`widget`&&Rd(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function Bd(e,t,n){let{decorations:r,widgetKeys:i}=zd(t,n);return{set:H.create(e,r),widgetKeys:i}}function Vd({position:e,from:t,to:n,docSize:r}){return eVd({position:e.anchor,from:t,to:n,docSize:r})?!0:(e.anchor===n||a.has(i)||(a.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function Ud(e){let t=e.spec?.key;return typeof t==`string`?t:void 0}function Wd(e){let t=new Map,n=new Map;for(let r of e.find()){let e=Ud(r);if(!e)continue;let i=r.spec.extensionName??`unknown`,a=t.get(e)??new Set;a.add(i),t.set(e,a),n.set(e,(n.get(e)??0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>(n.get(e)??0)>1)}function Gd(e){return e.jsonID===`attr`}function Kd(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||Gd(e))return!0;let n=e;return typeof n.from==`number`&&typeof n.to==`number`}function qd(e,t){let n=null,r=0,i=0;for(let a=0;at.to);a+=1){let o=i+e.child(a).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function Jd(e,t){if(e.steps.some(e=>!Kd(e)))return{type:`full`};let n=zu(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!Gd(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=qd(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:`ranges`,ranges:i}}function Yd(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=e?.key;typeof t==`string`&&r.delete(t)}})}function Xd(e,t,n){let r=t.decorationSetsByExtension[e]??H.empty,i=new Set(t.widgetKeysByExtension[e]??[]);return{set:Yd(r,n.mapping,n.doc,i),widgetKeys:i}}function Zd(e,t){let n=Object.values(t).flatMap(e=>e.find());return H.create(e,n)}function Qd(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}function $d(e,t){switch(t.update??`document`){case`document`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case`changedRanges`:if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case`manual`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function ef(e,t,n){return n?!0:e.update===`manual`?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var tf=new Set,nf=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=Od.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>$d(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(`beforeTransaction`,this.handleBeforeTransaction)}destroy(){this.editor.off(`beforeTransaction`,this.handleBeforeTransaction)}liveWidgetKeys(){return Od.getState(this.editor.state)?.widgetKeys??tf}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new M({key:Od,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:a}of t){let{set:t,widgetKeys:o}=this.buildFullSet(e,a,n);r[e]=t,i[e]=o}let a={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:Qd(i)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,i,a)=>{let o=n.getMeta(Od),s=o?.type===`force`&&!o.name,c=o?.type===`force`?o.name:void 0,l={},u={},d=new Set;return Pd(e,()=>{for(let{name:o,spec:f}of t){let t=s||c===o;if(!ef(f,{editor:e,tr:n,oldState:i,newState:a},t)){let e=Xd(o,r,n);l[o]=e.set,u[o]=e.widgetKeys}else if(f.update===`changedRanges`&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(o,f,r,n,a);l[o]=e.set,u[o]=e.widgetKeys,d.add(o)}else{let{set:e,widgetKeys:t}=this.buildFullSet(o,f,a);l[o]=e,u[o]=t,d.add(o)}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:l,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:l,recomputedNames:d}),widgetKeys:Qd(u)}}},props:{decorations(e){return Od.getState(e)?.mergedDecorationSet??H.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let a=Jd(r,i.doc);return a.type===`full`?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,a.ranges)}rebuildRanges(e,t,n,r,i,a){let o=n.decorationSetsByExtension[e]??H.empty,s=new Set(n.widgetKeysByExtension[e]??[]),c=Yd(o,r.mapping,r.doc,s),l=i.doc.content.size;for(let{from:n,to:r}of a){let a=c.find(n,r).filter(e=>Vd({position:e.from,from:n,to:r,docSize:l}));for(let e of a){let t=Ud(e);t&&s.delete(t)}c=c.remove(a);let{decorations:o,widgetKeys:u}=zd(Hd({decorations:this.runCreate(e,`createInRange`,()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:l,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(i.doc,o);for(let e of u)s.add(e)}return{set:c,widgetKeys:s}}buildFullSet(e,t,n){let r=this.runCreate(e,`create`,()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return Bd(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!Ld)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=Wd(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(`, `);console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${n.size===1?``:`s`} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:Zd(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):Zd(n.doc,r)}};function rf(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof j){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function af(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function of(e){return typeof e==`number`}function sf(e){return Object.prototype.toString.call(e).slice(8,-1)}function cf(e){return sf(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function lf(e,t,n){let r=e.split(` +`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let d=t.extractItemData(u),{indentLevel:f,mainContent:p}=d;a=`${a}${e}\n`;let m=[p];for(o+=1;oe.trim()!==``);if(t===-1)break;if((((l=r[o+1+t].match(/^(\s*)/))==null||(l=l[1])==null?void 0:l.length)||0)>f){m.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((((c=e.match(/^(\s*)/))==null||(c=c[1])==null?void 0:c.length)||0)>f)m.push(e),a=`${a}${e}\n`,o+=1;else break}let h,g=m.slice(1);if(g.length>0){let e=g.map(e=>e.slice(f+s)).join(` +`);e.trim()&&(h=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a}}var uf=4;function df(e){let t=0;for(let n of e)t=n===` `?t+uf-t%uf:t+1;return t}function ff(e,t,n,r,i){if(!e||!Array.isArray(e.content))return``;let a=typeof n==`function`?n(r):n,[o,...s]=e.content,c=`${a}${t.renderChildren([o])}`;return s&&s.length>0&&s.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=e=>{if(!i?.alignNestedToPrefix)return t.indent(e);let n=t.indent(``),r=df(a);return(df(n)>=r?n:` `.repeat(r))+e},o=r.split(` +`).map(e=>n(e||``)).join(` +`);c+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),c}function pf(e,t){let n={...e};return cf(e)&&cf(t)&&Object.keys(t).forEach(r=>{cf(t[r])&&cf(e[r])?n[r]=pf(e[r],t[r]):n[r]=t[r]}),n}function mf(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var hf=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},gf=(e,t)=>{if(ul(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function _f(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=Gu(c)+i;return a.forEach(e=>{if(l)return;let a=gf(u,e.find);if(!a)return;let d=a[0].length-i.length;if(d>0){let e=c.parentOffset-d;if(e<0||c.parent.textBetween(e,c.parentOffset)!==a[0].slice(0,d))return}let f=s.state.tr,p=qc({state:s.state,transaction:f}),m={from:n-(a[0].length-i.length),to:r},{commands:h,chain:g,can:_}=new Jc({editor:t,state:p});e.handler({state:p,range:m,match:a,commands:h,chain:g,can:_})!==null&&f.steps.length&&(e.undoable&&f.setMeta(o,{transform:f,from:n,to:r,text:i}),s.dispatch(f),l=!0)}),l}function vf(e){let{editor:t,rules:n}=e,r=new M({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:gu(w.from(e),a.schema);let{from:i}=s,o=i+e.length;_f({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return _f({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&_f({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?_f({editor:t,from:a.pos,to:a.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var yf=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...K(G(this,`addOptions`,{name:this.name}))}}get storage(){return{...K(G(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>pf(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},bf=class e extends yf{constructor(...e){super(...e),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},xf=class{constructor(e){this.find=e.find,this.handler=e.handler}},Sf=(e,t,n)=>{if(ul(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Cf(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Jc({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{var f;if((f=e.type)!=null&&(f=f.spec)!=null&&f.code||!(e.isText||e.isTextblock||e.isInline))return;let p=e.content?.size??e.nodeSize??0,m=Math.max(r,t),h=Math.min(i,t+p);m>=h||Sf(e.isText?e.text||``:e.textBetween(m-t,h-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=m+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var wf=null,Tf=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Ef(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr,l=qc({state:e,transaction:c});if(Cf({editor:t,state:l,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})&&c.steps.length){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new M({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(wf=t)},i=()=>{wf&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=wf;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:gu(w.from(t),r.schema);let{from:n}=d,i=n+t.length,a=Tf(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(of(p)&&m&&p!==m.b)return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var Df=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=ju(e),this.schema=Ou(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=G(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Uu(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=Au([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Uu(t.name,this.schema)},r=[],i=G(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&G(t,`exitable`,n)&&(a.ArrowRight=()=>bf.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=Gc(a);r.push(o);let s=G(t,`addInputRules`,n);if(Xu(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=vf({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=G(t,`addPasteRules`,n);if(Xu(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Ef({editor:e,rules:t});r.push(...n)}}let l=G(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;(e=this.decorationManager)==null||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=G(e,`addDecorations`,{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:Uu(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new nf({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return bu(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=yu(this.extensions);return Object.fromEntries(t.filter(e=>!!G(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=G(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:W(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=Cu(r,n);return i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return Au([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Uu(n.name,this.schema)},i=G(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return Au([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Uu(n.name,this.schema)},i=G(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=yu(this.extensions);return Object.fromEntries(t.filter(e=>!!G(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=G(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:hl(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=Cu(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{mf(i,e,t)}})}]:[]}))}destroy(){var e;(e=this.decorationManager)==null||e.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Uu(e.name,this.schema)};e.type===`mark`&&((K(G(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(K(G(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=G(e,`onBeforeCreate`,t),r=G(e,`onCreate`,t),i=G(e,`onUpdate`,t),a=G(e,`onSelectionUpdate`,t),o=G(e,`onTransaction`,t),s=G(e,`onFocus`,t),c=G(e,`onBlur`,t),l=G(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};Df.resolve=ju,Df.sort=Au,Df.flatten=hu;var J=class e extends yf{constructor(...e){super(...e),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Of=J.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new M({key:new N(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=Pu(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>Mu(r,{from:e.pos,to:t.pos},s)).join(o??` + +`)}}})]}}),kf=J.create({name:`commands`,addCommands(){return{...Md}}}),Af=J.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){var n;let r=()=>{var n,r;if(((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null||(r=n.filterTransaction)==null?void 0:r.call(n,e))??e.getMeta(`y-sync$`))return;let i=du(e.before,[e,...t]);zu(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter&&i.mapping.mapResult(t.oldRange.to).deletedBefore&&i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let a=r+n.nodeSize-2,o=t.oldRange.from<=r&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:r,to:a,newFrom:i.mapping.map(r),newTo:i.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:i})})});let a=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof on){let r=a.slice(n).map(t.from,-1),o=a.slice(n).map(t.to),s=a.invert().map(r,-1),c=a.invert().map(o),l=r>0&&i.doc.nodeAt(r-1)?.marks.some(e=>e.eq(t.mark)),u=i.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:r,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:i})}})};((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null?void 0:n.async)??!0?setTimeout(r,0):r()}}),jf=J.create({name:`drop`,addProseMirrorPlugins(){return[new M({key:new N(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Mf=J.create({name:`editable`,addProseMirrorPlugins(){return[new M({key:new N(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),Nf=new N(`focusEvents`),Pf=J.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new M({key:Nf,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),Ff=J.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:k.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Sl()||Wl()?i:r},addProseMirrorPlugins(){return[new M({key:new N(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=k.atStart(t.doc).from,l=k.atEnd(t.doc).to;if(a||o!==c||s!==l||!Qu(n.doc))return;let u=n.tr,d=qc({state:n,transaction:u}),{commands:f}=new Jc({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),If=J.create({name:`paste`,addProseMirrorPlugins(){return[new M({key:new N(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),Lf=J.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new M({key:new N(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),Rf=J.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=yu(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new M({key:new N(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),zf=!1;function Bf(e){if(zf)return;zf=!0;let t;try{t=ln.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof w||console.warn(`[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.`)}var Vf=class e{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Hf=`.ProseMirror { + position: relative; +} + +.ProseMirror { + word-wrap: break-word; + white-space: pre-wrap; + white-space: break-spaces; + -webkit-font-variant-ligatures: none; + font-variant-ligatures: none; + font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ +} + +.ProseMirror [contenteditable="false"] { + white-space: normal; +} + +.ProseMirror [contenteditable="false"] [contenteditable="true"] { + white-space: pre-wrap; +} + +.ProseMirror pre { + white-space: pre-wrap; +} + +img.ProseMirror-separator { + display: inline !important; + border: none !important; + margin: 0 !important; + width: 0 !important; + height: 0 !important; +} + +.ProseMirror-gapcursor { + display: none; + pointer-events: none; + position: absolute; + margin: 0; +} + +.ProseMirror-gapcursor:after { + content: ""; + display: block; + position: absolute; + top: -2px; + width: 20px; + border-top: 1px solid black; + animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; +} + +@keyframes ProseMirror-cursor-blink { + to { + visibility: hidden; + } +} + +.ProseMirror-hideselection *::selection { + background: transparent; +} + +.ProseMirror-hideselection *::-moz-selection { + background: transparent; +} + +.ProseMirror-hideselection * { + caret-color: transparent; +} + +.ProseMirror-focused .ProseMirror-gapcursor { + display: block; +}`,Uf=class extends Id{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:td,createMappablePosition:nd},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=bl(t,this.options.autofocus);this.editorState=xr.create({doc:t,schema:this.schema,selection:e||void 0})}Bf(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Jc.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Jc.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=af(Hf,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return Ld&&!this.hasWarnedStaleDecorationRead&&Fd(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=_u(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[Mf,Of.configure({blockSeparator:(e=this.options.coreExtensionOptions)==null||(e=e.clipboardTextSerializer)==null?void 0:e.blockSeparator}),kf,Pf,Ff,Lf.configure({value:(t=this.options.coreExtensionOptions)==null||(t=t.tabindex)==null?void 0:t.value}),jf,If,Af,Rf.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!=`object`||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new Df(n,this)}createCommandManager(){this.commandManager=new Jc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=cu(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(e.message))throw e;let t=cu(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=xr.create({doc:t,schema:this.schema,selection:bl(t,this.options.autofocus)||void 0}),this.emit(`contentError`,{editor:this,error:e,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),this.editorState.doc}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new Tc(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Iu(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return qu(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return gu(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=` + +`,textSerializers:n={}}=e||{};return Nu(this.state.doc,{blockSeparator:t,textSerializers:{...Pu(this.schema),...n}})}get isEmpty(){return Qu(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new Vf(t,this,!1,n)}get $doc(){return this.$pos(0)}};function Wf(e){return new hf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=K(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Bu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;ln.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function Gf(e){return new hf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=K(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Kf(e){return new hf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=K(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function qf(e){return new hf({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=K(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&vn(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&An(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var Jf=e=>`touches`in e,Yf=class{constructor(e){var t;this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e!=null&&(t=e.options)!=null&&t.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,Jf(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return rthis.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},Xf=class e extends yf{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Zf(e){return new xf({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=K(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Bu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;dn.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}function Qf(e){return g((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var $f=class extends Uf{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=Qf(this.view.state),this.reactiveExtensionStorage=Qf(this.extensionStorage),this.on(`beforeTransaction`,({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),f(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){let n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){let t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},ep=m({name:`EditorContent`,props:{editor:{default:null,type:Object}},setup(e){let t=v(),n=i();return o(()=>{let r=e.editor;r&&r.options.element&&t.value&&ee(()=>{if(!t.value||!r.view.dom?.parentNode)return;let e=a(t.value);t.value.append(...r.view.dom.parentNode.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:e}),r.createNodeViews()})}),p(()=>{let t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:t}},render(){return t(`div`,{ref:e=>{this.rootEl=e}})}});m({name:`NodeViewContent`,props:{as:{type:String,default:`div`}},inject:{nodeViewContentRef:{default:void 0}},mounted(){let e=this.nodeViewContentRef;e&&this.$el&&e(this.$el)},beforeUnmount(){let e=this.nodeViewContentRef;e&&e(null)},render(){return t(this.as,{style:{whiteSpace:`pre-wrap`},"data-node-view-content":``})}}),m({name:`NodeViewWrapper`,props:{as:{type:String,default:`div`}},inject:[`onDragStart`,`decorationClasses`],render(){var e;return t(this.as,{class:this.decorationClasses,style:{whiteSpace:`normal`},"data-node-view-wrapper":``,onDragstart:this.onDragStart},(e=this.$slots).default?.call(e))}});var tp=(e={})=>{let t=y();return d(()=>{t.value=new $f(e)}),p(()=>{var e;(e=t.value)==null||e.destroy()}),t};m({name:`MarkViewContent`,props:{as:{type:String,default:`span`}},render(){return t(this.as,{style:{whiteSpace:`inherit`},"data-mark-view-content":``})}});var np=new WeakSet,rp=new WeakSet;function ip(e){let t=e;return np.add(t),t}function ap(e){return Array.isArray(e)&&np.has(e)}function op(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&rp.has(e)&&!ap(e)?op(e):[e])}function sp(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!ap(n)&&!rp.has(n)?ip(n):n}let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);if(Array.isArray(n)){if(ap(n))return ip([e,r,n]);if(n.length===0)return ip([e,r]);let t=op(n);return t.length===0?ip([e,r]):ip([e,r,...t])}return ip(n==null?[e,r]:[e,r,n])}var cp=(e,t)=>sp(e,t),lp=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new E(n,0,0);return e.replace(l,i.after(),r),e.setSelection(A.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},up=/^\s*>\s$/,dp=Xf.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return cp(`blockquote`,{...q(this.options.HTMLAttributes,e),children:cp(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(` +`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(` +`))}),n.join(` +> +`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>lp(this.editor,this.type)}},addInputRules(){return[qf({find:up,type:this.type})]}}),fp=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,pp=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,mp=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,hp=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,gp=bf.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return cp(`strong`,{...q(this.options.HTMLAttributes,e),children:cp(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:``,close:``}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Wf({find:fp,type:this.type}),Wf({find:mp,type:this.type})]},addPasteRules(){return[Zf({find:pp,type:this.type}),Zf({find:hp,type:this.type})]}}),_p=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},vp=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},yp=bf.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,q(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Wf({find:_p,type:this.type})]},addPasteRules(){return[Zf({find:vp,type:this.type})]}}),bp=4,xp=/^```([a-z]+)?[\s\n]$/,Sp=/^~~~([a-z]+)?[\s\n]$/,Cp=Xf.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:bp,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,q(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(` +`):`\`\`\`${r}\n\n\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??bp,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,` +`,` +`).split(` +`).map(e=>o+e).join(` +`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??bp,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,` +`,` +`).split(` +`),c=0,l=0,u=r-a;for(let e=0;e=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,` +`,` +`).split(` +`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(` +`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(` + +`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(k.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[Kf({find:xp,type:this.type,getAttributes:e=>({language:e[1]})}),Kf({find:Sp,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new M({key:new N(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,` +`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(A.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),wp=Xf.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` + +`):``}),Tp=Xf.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,q(this.options.HTMLAttributes,e)]},renderText(){return` +`},renderMarkdown:()=>` +`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ep=Xf.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,q(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Kf({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),Dp=Xf.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,q(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!rf(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return $u(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(A.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(j.create(t.doc,n.pos)):t.setSelection(A.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(A.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Gf({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Op=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,kp=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Ap=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,jp=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Mp=bf.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,q(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:``,close:``}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Wf({find:Op,type:this.type}),Wf({find:Ap,type:this.type})]},addPasteRules(){return[Zf({find:kp,type:this.type}),Zf({find:jp,type:this.type})]}}),Np=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Pp=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,Fp=`numeric`,Ip=`ascii`,Lp=`alpha`,Rp=`asciinumeric`,zp=`alphanumeric`,Bp=`domain`,Vp=`emoji`,Hp=`scheme`,Up=`slashscheme`,Wp=`whitespace`;function Gp(e,t){return e in t||(t[e]=[]),t[e]}function Kp(e,t,n){t[Fp]&&(t[Rp]=!0,t[zp]=!0),t[Ip]&&(t[Rp]=!0,t[Lp]=!0),t[Rp]&&(t[zp]=!0),t[Lp]&&(t[zp]=!0),t[zp]&&(t[Bp]=!0),t[Vp]&&(t[Bp]=!0);for(let r in t){let t=Gp(r,n);t.indexOf(e)<0&&t.push(e)}}function qp(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Jp(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Jp.groups={},Jp.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;ne.ta(t,n,r,i),X=(e,t,n,r,i)=>e.tr(t,n,r,i),Yp=(e,t,n,r,i)=>e.ts(t,n,r,i),Z=(e,t,n,r,i)=>e.tt(t,n,r,i),Xp=`WORD`,Zp=`UWORD`,Qp=`ASCIINUMERICAL`,$p=`ALPHANUMERICAL`,em=`LOCALHOST`,tm=`TLD`,nm=`UTLD`,rm=`SCHEME`,im=`SLASH_SCHEME`,am=`NUM`,om=`WS`,sm=`NL`,cm=`OPENBRACE`,lm=`CLOSEBRACE`,um=`OPENBRACKET`,dm=`CLOSEBRACKET`,fm=`OPENPAREN`,pm=`CLOSEPAREN`,mm=`OPENANGLEBRACKET`,hm=`CLOSEANGLEBRACKET`,gm=`FULLWIDTHLEFTPAREN`,_m=`FULLWIDTHRIGHTPAREN`,vm=`LEFTCORNERBRACKET`,ym=`RIGHTCORNERBRACKET`,bm=`LEFTWHITECORNERBRACKET`,xm=`RIGHTWHITECORNERBRACKET`,Sm=`FULLWIDTHLESSTHAN`,Cm=`FULLWIDTHGREATERTHAN`,wm=`AMPERSAND`,Tm=`APOSTROPHE`,Em=`ASTERISK`,Dm=`AT`,Om=`BACKSLASH`,km=`BACKTICK`,Am=`CARET`,jm=`COLON`,Mm=`COMMA`,Nm=`DOLLAR`,Pm=`DOT`,Fm=`EQUALS`,Im=`EXCLAMATION`,Lm=`HYPHEN`,Rm=`PERCENT`,zm=`PIPE`,Bm=`PLUS`,Vm=`POUND`,Hm=`QUERY`,Um=`QUOTE`,Wm=`FULLWIDTHMIDDLEDOT`,Gm=`SEMI`,Km=`SLASH`,qm=`TILDE`,Jm=`UNDERSCORE`,Ym=`EMOJI`,Xm=`SYM`,Zm=Object.freeze({__proto__:null,ALPHANUMERICAL:$p,AMPERSAND:wm,APOSTROPHE:Tm,ASCIINUMERICAL:Qp,ASTERISK:Em,AT:Dm,BACKSLASH:Om,BACKTICK:km,CARET:Am,CLOSEANGLEBRACKET:hm,CLOSEBRACE:lm,CLOSEBRACKET:dm,CLOSEPAREN:pm,COLON:jm,COMMA:Mm,DOLLAR:Nm,DOT:Pm,EMOJI:Ym,EQUALS:Fm,EXCLAMATION:Im,FULLWIDTHGREATERTHAN:Cm,FULLWIDTHLEFTPAREN:gm,FULLWIDTHLESSTHAN:Sm,FULLWIDTHMIDDLEDOT:Wm,FULLWIDTHRIGHTPAREN:_m,HYPHEN:Lm,LEFTCORNERBRACKET:vm,LEFTWHITECORNERBRACKET:bm,LOCALHOST:em,NL:sm,NUM:am,OPENANGLEBRACKET:mm,OPENBRACE:cm,OPENBRACKET:um,OPENPAREN:fm,PERCENT:Rm,PIPE:zm,PLUS:Bm,POUND:Vm,QUERY:Hm,QUOTE:Um,RIGHTCORNERBRACKET:ym,RIGHTWHITECORNERBRACKET:xm,SCHEME:rm,SEMI:Gm,SLASH:Km,SLASH_SCHEME:im,SYM:Xm,TILDE:qm,TLD:tm,UNDERSCORE:Jm,UTLD:nm,UWORD:Zp,WORD:Xp,WS:om}),Qm=/[a-z]/,$m=/\p{L}/u,eh=/\p{Emoji}/u,th=/\d/,nh=/\s/,rh=`\r`,ih=` +`,ah=`️`,oh=`‍`,sh=``,ch=null,lh=null;function uh(e=[]){let t={};Jp.groups=t;let n=new Jp;ch??=mh(Np),lh??=mh(Pp),Z(n,`'`,Tm),Z(n,`{`,cm),Z(n,`}`,lm),Z(n,`[`,um),Z(n,`]`,dm),Z(n,`(`,fm),Z(n,`)`,pm),Z(n,`<`,mm),Z(n,`>`,hm),Z(n,`(`,gm),Z(n,`)`,_m),Z(n,`「`,vm),Z(n,`」`,ym),Z(n,`『`,bm),Z(n,`』`,xm),Z(n,`<`,Sm),Z(n,`>`,Cm),Z(n,`&`,wm),Z(n,`*`,Em),Z(n,`@`,Dm),Z(n,"`",km),Z(n,`^`,Am),Z(n,`:`,jm),Z(n,`,`,Mm),Z(n,`$`,Nm),Z(n,`.`,Pm),Z(n,`=`,Fm),Z(n,`!`,Im),Z(n,`-`,Lm),Z(n,`%`,Rm),Z(n,`|`,zm),Z(n,`+`,Bm),Z(n,`#`,Vm),Z(n,`?`,Hm),Z(n,`"`,Um),Z(n,`/`,Km),Z(n,`;`,Gm),Z(n,`~`,qm),Z(n,`_`,Jm),Z(n,`\\`,Om),Z(n,`・`,Wm);let r=X(n,th,am,{[Fp]:!0});X(r,th,r);let i=X(r,Qm,Qp,{[Rp]:!0}),a=X(r,$m,$p,{[zp]:!0}),o=X(n,Qm,Xp,{[Ip]:!0});X(o,th,i),X(o,Qm,o),X(i,th,i),X(i,Qm,i);let s=X(n,$m,Zp,{[Lp]:!0});X(s,Qm),X(s,th,a),X(s,$m,s),X(a,th,a),X(a,Qm),X(a,$m,a);let c=Z(n,ih,sm,{[Wp]:!0}),l=Z(n,rh,om,{[Wp]:!0}),u=X(n,nh,om,{[Wp]:!0});Z(n,sh,u),Z(l,ih,c),Z(l,sh,u),X(l,nh,u),Z(u,rh),Z(u,ih),X(u,nh,u),Z(u,sh,u);let d=X(n,eh,Ym,{[Vp]:!0});Z(d,`#`),X(d,eh,d),Z(d,ah,d);let f=Z(d,oh);Z(f,`#`),X(f,eh,d);let p=[[Qm,o],[th,i]],m=[[Qm,null],[$m,s],[th,a]];for(let e=0;ee[0]>t[0]?1:-1);for(let t=0;t=0?i[Bp]=!0:Qm.test(r)?th.test(r)?i[Rp]=!0:i[Ip]=!0:i[Fp]=!0,Yp(n,r,r,i)}return Yp(n,`localhost`,em,{ascii:!0}),n.jd=new Jp(Xm),{start:n,tokens:Object.assign({groups:t},Zm)}}function dh(e,t){let n=fh(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function fh(e){let t=[],n=e.length,r=0;for(;r56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function ph(e,t,n,r,i){let a,o=t.length;for(let n=0;n=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var hh={defaultProtocol:`http`,events:null,format:_h,formatHref:_h,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function gh(e,t=null){let n=Object.assign({},hh);e&&(n=Object.assign(n,e instanceof gh?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;en?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=hh.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function yh(e,t){class n extends vh{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var bh=yh(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),xh=yh(`text`),Sh=yh(`nl`),Ch=yh(`url`,{isLink:!0,toHref(e=hh.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==em&&e[1].t===jm}}),wh=e=>new Jp(e);function Th({groups:e}){let t=e.domain.concat([wm,Em,Dm,Om,km,Am,Nm,Fm,Lm,am,Rm,zm,Bm,Vm,Km,Xm,qm,Jm]),n=[Tm,jm,Mm,Pm,Im,Rm,Hm,Um,Gm,mm,hm,cm,lm,dm,um,fm,pm,gm,_m,vm,ym,bm,xm,Sm,Cm],r=[wm,Tm,Em,Om,km,Am,Nm,Fm,Lm,cm,lm,Rm,zm,Bm,Vm,Hm,Km,Xm,qm,Jm],i=wh(),a=Z(i,qm);Y(a,r,a),Y(a,e.domain,a);let o=wh(),s=wh(),c=wh();Y(i,e.domain,o),Y(i,e.scheme,s),Y(i,e.slashscheme,c),Y(o,r,a),Y(o,e.domain,o);let l=Z(o,Dm);Z(a,Dm,l),Z(s,Dm,l),Z(c,Dm,l);let u=Z(a,Pm);Y(u,r,a),Y(u,e.domain,a);let d=wh();Y(l,e.domain,d),Y(d,e.domain,d);let f=Z(d,Pm);Y(f,e.domain,d);let p=wh(bh);Y(f,e.tld,p),Y(f,e.utld,p),Z(l,em,p);let m=Z(d,Lm);Z(m,Lm,m),Y(m,e.domain,d),Y(p,e.domain,d),Z(p,Pm,f),Z(p,Lm,m);let h=Z(o,Lm),g=Z(o,Pm);Z(h,Lm,h),Y(h,e.domain,o),Y(g,r,a),Y(g,e.domain,o);let _=wh(Ch);Y(g,e.tld,_),Y(g,e.utld,_),Y(_,e.domain,o),Y(_,r,a),Z(_,Pm,g),Z(_,Lm,h),Z(_,Dm,l);let ee=Z(_,jm),te=wh(Ch);Y(ee,e.numeric,te);let v=wh(Ch),y=wh();Y(v,t,v),Y(v,n,y),Y(y,t,v),Y(y,n,y),Z(_,Km,v),Z(te,Km,v);let b=Z(s,jm),ne=Z(Z(Z(c,jm),Km),Km);Y(s,e.domain,o),Z(s,Pm,g),Z(s,Lm,h),Y(c,e.domain,o),Z(c,Pm,g),Z(c,Lm,h),Y(b,e.domain,v),Z(b,Km,v),Z(b,Hm,v),Y(ne,e.domain,v),Y(ne,t,v),Z(ne,Km,v);let re=[[cm,lm],[um,dm],[fm,pm],[mm,hm],[gm,_m],[vm,ym],[bm,xm],[Sm,Cm]];for(let e=0;e=0&&f++,i++,u++;if(f<0)i-=u,i0&&(a.push(Dh(xh,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(Dh(e,t,r))}}return o.length>0&&a.push(Dh(xh,t,o)),a}function Dh(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var Oh=typeof console<`u`&&console&&console.warn||(()=>{}),kh=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,Q={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Ah(){return Jp.groups={},Q.scanner=null,Q.parser=null,Q.tokenQueue=[],Q.pluginQueue=[],Q.customSchemes=[],Q.initialized=!1,Q}function jh(e,t=!1){if(Q.initialized&&Oh(`linkifyjs: already initialized - will not register custom scheme "${e}" ${kh}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format. +1. Must only contain digits, lowercase ASCII letters or "-" +2. Cannot start or end with "-" +3. "-" cannot repeat`);Q.customSchemes.push([e,t])}function Mh(){Q.scanner=uh(Q.customSchemes);for(let e=0;e{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(zu(du(n.doc,[...t])).forEach(({newRange:t})=>{let n=fu(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!Lh.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(Ih).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=Nh(n).map(t=>t.toObject(e.defaultProtocol));if(!zh(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{Bu(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function Vh(e){return new M({key:new N(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=Iu(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}var Hh=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,Uh=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function Wh(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;--r)n+=1;return n%2==1}function Gh(e,t){let n=0,r=0;for(;r0}function Kh(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||Wh(e,t.index??0)||Gh(e,t.index??0)?!1:!!r.trim()&&n(i)}function qh(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function Jh(e,t){return e.index{let n=Hh.exec(t);return!n||!Kh(t,n,e.isAllowedHref)?null:qh(n)},type:e.type,getAttributes:Yh});return new hf({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function Zh(e){let t=Zf({find:t=>{let n=[];for(let r of t.matchAll(Uh))Kh(t,r,e.isAllowedHref)&&n.push(qh(r));let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>Jh(t,e)));return[...n,...r]},type:e.type,getAttributes:Yh});return new xf({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.match.data?.markdown&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function Qh(e){return new M({key:new N(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=Ph(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function $h(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(Rh,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var eg=bf.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){jh(e);return}jh(e.scheme,e.optionalSlashes)})},onDestroy(){Ah()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!$h(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target??null},rel:{default:this.options.HTMLAttributes.rel??null},class:{default:this.options.HTMLAttributes.class??null},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!$h(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!$h(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,q(this.options.HTMLAttributes,e),0]:[`a`,q(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!$h(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!$h(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addInputRules(){return this.options.markdownLinks?[Xh({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!$h(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;Ph(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!$h(e,n),protocols:n,defaultProtocol:r})).forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t};return this.options.markdownLinks?[Zh({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!$h(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[Zf({find:e,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(Bh({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!$h(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(Vh({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Qh({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),tg=`listItem`,ng=`textStyle`,rg=/^\s*([-+*])\s$/,ig=Xf.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,q(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` +`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(tg,this.editor.getAttributes(ng)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=qf({find:rg,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=qf({find:rg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(ng),editor:this.editor})),[e]}}),ag=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},og=(e,t,n,r)=>{let i=ag(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,w.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},sg=(e,t,n)=>og(e.state,e.view.dispatch,t,n),cg=(e,t)=>J.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>sg(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),lg=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],ug=`abcdefghijklmnopqrstuvwxyz`,dg=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function fg(e){let t=e,n=``;for(let[e,r]of lg)for(;t>=e;)n+=r,t-=e;return n}function pg(e){return fg(e).toUpperCase()}function mg(e){let t=e.toLowerCase(),n=0,r=0;for(;n0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function bg(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return _g(t);case`A`:return _g(t).toUpperCase();case`i`:return fg(t);case`I`:return pg(t);default:return String(t)}}function xg(e){if(e.length===0)return!1;let t=vg(e[0])??`numeric`,n=yg(e[0]);if(n<1)return!1;for(let r=0;r{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(Tg(e))return{type:`listItem`,content:[{type:`paragraph`,content:Eg(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>ff(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){var t,n;let r=((t=e.meta)==null||(t=t.parentAttrs)==null?void 0:t.start)||1;return wg((n=e.meta)==null||(n=n.parentAttrs)==null?void 0:n.type,r-1+(e.index||0),`. `)}return`- `},n,{alignNestedToPrefix:n?.parentType===`orderedList`}),addExtensions(){return[cg(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Og=(e,t)=>{let{$from:n}=t.selection,r=W(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},kg=(e,t)=>{let n=Og(e,t);if(!n)return!1;let[,r]=Vu(t,e,n.$pos.pos+4);return r},Ag=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},jg=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!ql(e.state,t)&&Ag(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!ql(e.state,t)||!Yu(e.state))return!1;let{$from:r}=e.state.selection,i=r.depth-1;return r.node(i).type!==e.schema.nodes[t]||r.index(i)!==0?!1:e.chain().liftListItem(t).run()},Mg=(e,t)=>{let n=kg(e,t),r=Og(e,t);return!r||!n?!1:n>r.depth},Ng=(e,t)=>{let n=kg(e,t),r=Og(e,t);return!r||!n?!1:n{if(!ql(e.state,t)||!Ju(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Mg(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Ng(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},Fg=(e,t,n)=>{let{state:r}=e,{selection:i}=r;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0||!a.parent.isTextblock||ql(r,t))return!1;let o=Hu(a);if(!o||!n.includes(o.type.name))return!1;let s=o.lastChild;if(!s||s.type.name!==t)return!1;let c=a.parent;if(!s.canReplace(s.childCount,s.childCount,w.from(c)))return!1;let l=a.before(),u=a.after(),d=l-2;return e.commands.command(({tr:e,dispatch:t})=>(t&&(e.delete(l,u).insert(d,w.from(c)),e.setSelection(A.create(e.doc,d+1)),e.scrollIntoView()),!0))},Ig=J.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Pg(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Pg(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&jg(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&jg(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(let{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&Fg(e,t,n))return!0;return!1}}}}),Lg=RegExp(`^(\\s*)(${dg})([.)])\\s+(.*)$`),Rg=/^\s/,zg={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function Bg(e){return Lg.test(e.trimStart())}function Vg(e){let t=e.trimStart();return zg.bulletItem.test(t)||Bg(t)||zg.heading.test(t)||zg.thematicBreak.test(t)&&!t.startsWith(`-`)||/^>\s?/.test(t)||zg.codeFence.test(t)||zg.blockMath.test(t)}function Hg(e){return Object.values(zg).some(t=>t.test(e))}function Ug(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&Vg(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function Wg(e){let t=[],n=0,r=0;for(;ne.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(Gg);if(!t)return null;n.push({marker:t[1],content:t[3]})}return xg(n.map(e=>e.marker))?{type:`orderedList`,attrs:Cg(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function qg(e,t,n){let r=[],i=0;for(;it;)f.push(e[d]),d+=1;if(f.length>0){let e=qg(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(` +`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function Jg(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var Yg=`listItem`,Xg=`textStyle`,Zg=/^(\d+)\.\s$/;function Qg(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var $g=Xf.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=Qg(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=Qg(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=q(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?Jg(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` +`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let r=e.split(` +`),[i,a]=Wg(r);if(i.length===0)return;let o=qg(i,i[0].indent,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,typeMarker:i[0]?.type,items:o,raw:r.slice(0,a).join(` +`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Yg,this.editor.getAttributes(Xg)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new M({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=Kg(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=qf({find:Zg,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=qf({find:Zg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Xg)}),joinPredicate:e,editor:this.editor})),[t]}}),e_=/^\s*(\[([( |x])?\])\s$/,t_=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,n_=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)==null?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||`empty task item`}`},r_=Xf.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,q(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>ff(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[cg(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`);o.style.cssText=t_;let l=e=>{let t=n_(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=Cu(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[qf({find:e_,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),i_=Xf.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,q(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` +`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=lf(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=lf(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});J.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(ig.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(Dg.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Ig.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push($g.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(r_.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(i_.configure(this.options.taskList)),e}});var a_=` `,o_=`\xA0`,s_=Xf.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,q(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===a_||n[0].text===a_||n[0].raw===o_||n[0].text===o_)&&r.length===1&&r[0].type===`text`&&(r[0].text===a_||r[0].text===o_)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`&&e.length===0?a_:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),c_=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,l_=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,u_=bf.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,q(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Wf({find:c_,type:this.type})]},addPasteRules(){return[Zf({find:l_,type:this.type})]}}),d_=Xf.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),f_=bf.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,q(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function p_(e={}){return new M({view(t){return new m_(t,e)}})}var m_=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=In(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},h_=class e extends k{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):k.near(r)}content(){return E.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new g_(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!v_(e)||!y_(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!j.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};h_.prototype.visible=!1,h_.findFrom=h_.findGapCursorFrom,k.jsonID(`gapcursor`,h_);var g_=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return h_.valid(t)?new h_(t):k.near(t)}};function __(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function v_(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||__(e.type))return!0;if(e.inlineContent)return!1}}return!0}function y_(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||__(e.type))return!0;if(e.inlineContent)return!1}}return!0}function b_(){return new M({props:{decorations:T_,createSelectionBetween(e,t,n){return t.pos==n.pos&&h_.valid(n)?new h_(n):null},handleClick:C_,handleKeyDown:x_,handleDOMEvents:{beforeinput:w_}}})}var x_=Kc({ArrowLeft:S_(`horiz`,-1),ArrowRight:S_(`horiz`,1),ArrowUp:S_(`vert`,-1),ArrowDown:S_(`vert`,1)});function S_(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof A){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=h_.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new h_(c))),!0):!1}}function C_(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!h_.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&j.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new h_(r))),!0)}function w_(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof h_))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=w.empty;for(let e=r.length-1;e>=0;e--)i=w.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new E(i,0,0));return a.setSelection(A.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function T_(e){if(!(e.selection instanceof h_))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,H.create(e.doc,[Ws.widget(e.selection.head,t,{key:`gapcursor`})])}var E_=200,$=function(){};$.prototype.append=function(e){return e.length?(e=$.from(e),!this.length&&e||e.length=t?$.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},$.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},$.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},$.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},$.from=function(e){return e instanceof $?e:e&&e.length?new D_(e):$.empty};var D_=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=E_)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=E_)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}($);$.empty=new D_([]);var O_=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return ei&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}($),k_=500,A_=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new M_(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new M_(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;eP_&&(s=j_(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new tn;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new M_(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new M_(i,o,l))}else r.push(new M_(i))},i);let l=[];for(let e=n;ek_&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new M_(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e($.from(i.reverse()),a)}};A_.empty=new A_($.empty,0);function j_(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var M_=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},N_=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},P_=20;function F_(e,t,n,r){let i=n.getMeta(U_),a;if(i)return i.historyState;n.getMeta(W_)&&(e=new N_(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(U_))return o.getMeta(U_).redo?new N_(e.done.addTransform(n,void 0,r,H_(t)),e.undone,L_(n.mapping.maps),e.prevTime,e.prevComposition):new N_(e.done,e.undone.addTransform(n,void 0,r,H_(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!I_(n,e.prevRanges)),s=o?R_(e.prevRanges,n.mapping):L_(n.mapping.maps);return new N_(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,H_(t)),A_.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new N_(e.done.rebased(n,a),e.undone.rebased(n,a),R_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new N_(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),R_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function I_(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i=t[i]&&(n=!0)}),n}function L_(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function R_(e,t){if(!e)return null;let n=[];for(let r=0;r{let i=U_.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=z_(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var q_=K_(!1,!0),J_=K_(!0,!0);J.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new M({key:new N(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var Y_=J.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[p_(this.options)]}});J.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new M({key:new N(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return H.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(Ws.node(t,t+e.nodeSize,{class:this.options.className}))}),H.create(e,a)}}})]}});var X_=J.create({name:`gapCursor`,addProseMirrorPlugins(){return[b_()]},extendNodeSchema(e){return{allowGapCursor:K(G(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),Z_=`placeholder`,Q_=new N(`tiptap__placeholder`);function $_(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),Ws.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function ev(e,t){return typeof e==`function`?e(t):e}function tv({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&Qu(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push($_({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:ev(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function nv({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&Qu(c)){let r=a>=l&&a<=l+c.nodeSize;o.push($_({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:ev(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...tv({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return H.create(r,o)}function rv(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function iv(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function av(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;st&&r.push({from:a,to:o})}),r}function ov(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;et.from?n.push(iv(e,rv(e,Math.min(t.to,e.content.size+1)-1))):t.frome.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=tv({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function dv({editor:e,options:t,dataAttribute:n}){return{init(r,i){return nv({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??H.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:uv({decorations:i.map(r.mapping,r.doc),ranges:cv(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function fv(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function pv({editor:e,options:t}){let n=t.dataAttribute?`data-${fv(t.dataAttribute)}`:`data-${Z_}`,r=t.showOnlyCurrent&&!t.includeChildren;return new M({key:Q_,...r?{}:{state:dv({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>nv({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?H.empty:Q_.getState(n)??H.empty}})}var mv=J.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:Z_,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[pv({editor:this.editor,options:this.options})]}});function hv(e,t){return!e.selection.empty&&!$u(e.selection)&&t.isEditable}function gv(e,t){return hv(e,t)&&!t.isFocused&&!t.view.dragging}function _v(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function vv(e){e.focus()}J.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new M({key:new N(`selection`),props:{decorations(n){return gv(n,e)?H.create(n.doc,[Ws.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return hv(t.state,e)&&_v(),!1},focus(t){return hv(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&vv(t)}),!1}}}})]}});function yv({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var bv=J.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new N(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new M({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!yv({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!yv({node:r,types:n})}}})]}}),xv=J.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>q_(e,t),redo:()=>({state:e,dispatch:t})=>J_(e,t)}},addProseMirrorPlugins(){return[G_(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Sv=J.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(gp.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(dp.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(ig.configure(this.options.bulletList)),this.options.code!==!1&&e.push(yp.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Cp.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(wp.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Y_.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(X_.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Tp.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Ep.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(xv.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Dp.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Mp.configure(this.options.italic)),this.options.listItem!==!1&&e.push(Dg.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Ig.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(eg.configure(this.options?.link)),this.options.orderedList!==!1&&e.push($g.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(s_.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(u_.configure(this.options.strike)),this.options.text!==!1&&e.push(d_.configure(this.options.text)),this.options.underline!==!1&&e.push(f_.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(bv.configure(this.options?.trailingNode)),e}}),Cv=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,wv=Xf.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,q(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,i=new Set([`src`,`width`,`height`]);return({node:a,getPos:o,HTMLAttributes:s,editor:c})=>{let l=document.createElement(`img`);l.draggable=!1;let u=q(this.options.HTMLAttributes,s);Object.entries(u).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:l.setAttribute(e,t)}}),u.src!==null&&(l.src=u.src);let d={...s},f=e=>{if(typeof e==`string`&&e!==``){l.getAttribute(`src`)!==e&&(l.src=e);return}l.hasAttribute(`src`)&&l.removeAttribute(`src`),l.src!==``&&(l.src=``)};f(s.src);let p=new Yf({element:l,editor:c,node:a,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==a.type)return!1;let t=Cu(e,c.extensionManager.attributes.filter(t=>t.type===e.type.name));return Object.keys(d).forEach(e=>{!i.has(e)&&!(e in t)&&l.removeAttribute(e)}),Object.entries(t).forEach(([e,t])=>{i.has(e)||(t==null?l.removeAttribute(e):l.setAttribute(e,t))}),f(t.src),d=t,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=p.dom,h=()=>{m.style.visibility=``,m.style.pointerEvents=``};return m.style.visibility=`hidden`,m.style.pointerEvents=`none`,l.complete&&l.naturalWidth>0?h():(l.onload=h,l.onerror=h),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Gf({find:Cv,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),Tv=e({default:()=>kv}),Ev=[`disabled`],Dv=[`disabled`],Ov=[`disabled`],kv={__name:`RichTextEditor`,props:{modelValue:{type:String,default:``},placeholder:{type:String,default:``},headings:{type:Array,default:()=>[2,3]},uploadImage:{type:Function,default:null},pickImage:{type:Function,default:null},minHeight:{type:String,default:``},bordered:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(e,{expose:t,emit:i}){let o=e,d=i,f=tp({content:o.modelValue,extensions:[Sv.configure({heading:{levels:o.headings},code:!1,codeBlock:!1,link:{openOnClick:!1,autolink:!0,protocols:[`mailto`,`tel`],HTMLAttributes:{rel:`noopener noreferrer`,target:null}}}),wv.configure({HTMLAttributes:{loading:`lazy`}}),mv.configure({placeholder:o.placeholder})],editorProps:{attributes:{class:`prose prose-neutral max-w-none focus:outline-none prose-headings:tracking-tight prose-img:rounded-lg`}},onUpdate:({editor:e})=>d(`update:modelValue`,e.isEmpty?``:e.getHTML())});r(()=>o.modelValue,e=>{f.value&&e!==f.value.getHTML()&&!(e===``&&f.value.isEmpty)&&f.value.commands.setContent(e||``,{emitUpdate:!1})}),p(()=>f.value?.destroy()),t({focus:()=>f.value?.chain().focus(`end`).run()});let m=v(!1),g=v(``);function ee(){g.value=f.value.getAttributes(`link`).href??``,m.value=!0}function y(){let e=g.value.trim();e&&!/^(https?:\/\/|mailto:|tel:|\/|#)/i.test(e)&&(e=`https://${e}`);let t=f.value.chain().focus().extendMarkRange(`link`);(e?t.setLink({href:e}):t.unsetLink()).run(),m.value=!1}let x=v(null),xe=v(!1);async function Se(e){let t=e.target.files?.[0];if(e.target.value=``,t&&o.uploadImage){xe.value=!0;try{let e=await o.uploadImage(t);f.value.chain().focus().setImage({src:e,alt:``}).run()}finally{xe.value=!1}}}async function S(){let e=await o.pickImage({multiple:!0});if(!e?.length)return;let t=f.value.chain().focus();e.forEach(e=>t.setImage({src:e.url,alt:e.alt??``})),t.run()}let C=e=>[`grid size-8 place-items-center rounded-md transition-colors disabled:opacity-40`,e?`bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent hover:text-foreground`];return(t,r)=>a(f)?(h(),u(`div`,{key:0,class:c([`group/rte`,e.bordered?`rounded-md border border-input bg-card shadow-xs focus-within:border-brand-400 focus-within:ring-3 focus-within:ring-ring/30`:``])},[l(`div`,{class:c([`flex flex-wrap items-center gap-0.5`,e.bordered?`border-b px-1.5 py-1`:`sticky top-0 z-10 -mx-1 mb-2 hidden rounded-md border bg-card px-1 py-0.5 shadow-sm group-focus-within/rte:flex`]),role:`toolbar`,"aria-label":`Textformatierung`,onMousedown:r[15]||=ne(()=>{},[`prevent`])},[l(`button`,{type:`button`,class:c(C(a(f).isActive(`bold`))),title:`Fett (Strg+B)`,onClick:r[0]||=e=>a(f).chain().focus().toggleBold().run()},[n(a(pe),{class:`size-4`})],2),l(`button`,{type:`button`,class:c(C(a(f).isActive(`italic`))),title:`Kursiv (Strg+I)`,onClick:r[1]||=e=>a(f).chain().focus().toggleItalic().run()},[n(a(ge),{class:`size-4`})],2),l(`button`,{type:`button`,class:c(C(a(f).isActive(`underline`))),title:`Unterstrichen (Strg+U)`,onClick:r[2]||=e=>a(f).chain().focus().toggleUnderline().run()},[n(a(ye),{class:`size-4`})],2),r[16]||=l(`span`,{class:`mx-1 h-5 w-px bg-border`},null,-1),e.headings.includes(2)?(h(),u(`button`,{key:0,type:`button`,class:c(C(a(f).isActive(`heading`,{level:2}))),title:`Zwischenüberschrift`,onClick:r[3]||=e=>a(f).chain().focus().toggleHeading({level:2}).run()},[n(a(me),{class:`size-4`})],2)):b(``,!0),e.headings.includes(3)?(h(),u(`button`,{key:1,type:`button`,class:c(C(a(f).isActive(`heading`,{level:3}))),title:`Kleine Überschrift`,onClick:r[4]||=e=>a(f).chain().focus().toggleHeading({level:3}).run()},[n(a(he),{class:`size-4`})],2)):b(``,!0),l(`button`,{type:`button`,class:c(C(a(f).isActive(`bulletList`))),title:`Aufzählung`,onClick:r[5]||=e=>a(f).chain().focus().toggleBulletList().run()},[n(a(de),{class:`size-4`})],2),l(`button`,{type:`button`,class:c(C(a(f).isActive(`orderedList`))),title:`Nummerierte Liste`,onClick:r[6]||=e=>a(f).chain().focus().toggleOrderedList().run()},[n(a(_e),{class:`size-4`})],2),l(`button`,{type:`button`,class:c(C(a(f).isActive(`blockquote`))),title:`Zitat`,onClick:r[7]||=e=>a(f).chain().focus().toggleBlockquote().run()},[n(a(fe),{class:`size-4`})],2),r[17]||=l(`span`,{class:`mx-1 h-5 w-px bg-border`},null,-1),l(`button`,{type:`button`,class:c(C(a(f).isActive(`link`))),title:`Link`,onClick:ee},[n(a(ae),{class:`size-4`})],2),a(f).isActive(`link`)?(h(),u(`button`,{key:2,type:`button`,class:c(C(!1)),title:`Link entfernen`,onClick:r[8]||=e=>a(f).chain().focus().unsetLink().run()},[n(a(be),{class:`size-4`})],2)):b(``,!0),e.uploadImage?(h(),u(_,{key:3},[l(`button`,{type:`button`,class:c(C(!1)),title:`Bild einfügen`,disabled:xe.value,onClick:r[9]||=e=>x.value?.click()},[xe.value?(h(),te(a(ie),{key:0,class:`size-4 animate-spin`})):(h(),te(a(le),{key:1,class:`size-4`}))],10,Ev),l(`input`,{ref_key:`fileInput`,ref:x,type:`file`,accept:`image/jpeg,image/png,image/webp,image/gif`,class:`hidden`,onChange:Se},null,544)],64)):b(``,!0),e.pickImage?(h(),u(`button`,{key:4,type:`button`,class:c(C(!1)),title:`Bild aus der Mediathek`,onClick:S},[n(a(ue),{class:`size-4`})],2)):b(``,!0),r[18]||=l(`span`,{class:`mx-1 h-5 w-px bg-border`},null,-1),l(`button`,{type:`button`,class:c(C(!1)),title:`Rückgängig`,disabled:!a(f).can().undo(),onClick:r[10]||=e=>a(f).chain().focus().undo().run()},[n(a(oe),{class:`size-4`})],10,Dv),l(`button`,{type:`button`,class:c(C(!1)),title:`Wiederholen`,disabled:!a(f).can().redo(),onClick:r[11]||=e=>a(f).chain().focus().redo().run()},[n(a(ve),{class:`size-4`})],10,Ov),m.value?(h(),u(`form`,{key:5,class:`flex w-full items-center gap-1 border-t px-1 pt-1.5 pb-1`,onSubmit:ne(y,[`prevent`]),onMousedown:r[14]||=ne(()=>{},[`stop`])},[s(l(`input`,{"onUpdate:modelValue":r[12]||=e=>g.value=e,type:`text`,placeholder:`https://… oder /seiten/…`,class:`h-8 min-w-0 flex-1 rounded-md border border-input bg-card px-2 text-sm focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/30`,"aria-label":`Adresse des Links`,autofocus:``},null,512),[[re,g.value]]),l(`button`,{type:`submit`,class:c(C(!1)),title:`Übernehmen`},[n(a(se),{class:`size-4`})],2),l(`button`,{type:`button`,class:c(C(!1)),title:`Abbrechen`,onClick:r[13]||=e=>m.value=!1},[n(a(ce),{class:`size-4`})],2)],32)):b(``,!0)],34),n(a(ep),{editor:a(f),class:c([e.bordered?`px-4 py-3`:``,e.minHeight])},null,8,[`editor`,`class`])],2)):b(``,!0)}};export{kv as n,ve as r,Tv as t}; \ No newline at end of file diff --git a/public/build/assets/RichTextEditor-qslPmeeg.js b/public/build/assets/RichTextEditor-qslPmeeg.js deleted file mode 100644 index d83a765d..00000000 --- a/public/build/assets/RichTextEditor-qslPmeeg.js +++ /dev/null @@ -1,129 +0,0 @@ -import{f as e}from"./usePrimitiveElement-DC7UloPZ.js";import{B as t,D as n,Ht as r,L as i,On as a,Ut as o,Yt as s,Zn as c,_ as l,b as u,ct as d,fn as f,it as p,k as m,mt as h,nn as g,o as _,tt as ee,v,vn as y,xn as b,y as x}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as te,x as ne}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{O as re,k as S}from"./dist-DtGNiYlK.js";import{H as ie,k as ae}from"./AppIcon-0N56IC2z.js";import{t as oe}from"./check-AfxJa8Ew.js";import{_ as se}from"./http-DmyDwIce.js";import{t as ce}from"./list-DHYGZ2vt.js";import{t as le}from"./quote-CAgJDpoy.js";var ue=S({name:`bold`,size:24,node:[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]}),de=S({name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]}),fe=S({name:`heading-3`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]}),pe=S({name:`image-plus`,size:24,node:[[`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`}]]}),me=S({name:`italic`,size:24,node:[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]}),he=S({name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]}),ge=S({name:`redo-2`,size:24,node:[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]}),_e=S({name:`underline`,size:24,node:[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]}),ve=S({name:`unlink`,size:24,node:[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]}),ye=Object.defineProperty,be=(e,t)=>{let n={};for(var r in e)ye(n,r,{get:e[r],enumerable:!0});return t||ye(n,Symbol.toStringTag,{value:`Module`}),n};function C(e){this.content=e}C.prototype={constructor:C,find:function(e){for(var t=0;t>1}},C.from=function(e){if(e instanceof C)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new C(t)};function xe(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i=56320&&e<57344}function we(e){return e>=55296&&e<56320}var w=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;te&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);at)for(let e=0,a=0;at&&((an)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Ee(t+1,i):Ee(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;ethis.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;te.type.rank-t.type.rank),n}};T.none=[];var Oe=class extends Error{},E=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Ae(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(ke(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(w.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};E.empty=new E(w.empty,0,0);function ke(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(ke(a.content,t-i-1,n-i-1)))}function Ae(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=Ae(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function je(e,t,n){if(n.openStart>e.depth)throw new Oe(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Oe(`Inconsistent open depths`);return Me(e,t,n,0)}function Me(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Ie(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Fe(e.nodeAfter,r),a++));for(let e=a;ei&&Pe(e,t,i+1),o=r.depth>i&&Pe(n,r,i+1),s=[];return Ie(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Ne(a,o),Fe(Le(a,Re(e,t,n,r,i+1)),s)):(a&&Fe(Le(a,ze(e,t,i+1)),s),Ie(t,n,i,s),o&&Fe(Le(o,ze(n,r,i+1)),s)),Ie(r,null,i,s),new w(s)}function ze(e,t,n){let r=[];return Ie(null,e,n,r),e.depth>n&&Fe(Le(Pe(e,t,n+1),ze(e,t,n+1)),r),Ie(t,null,n,r),new w(r)}function Be(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(w.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Ve=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ge(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=We.get(t);if(r)for(let e=0;ee&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),Ye(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=w.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;ee.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=w.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};qe.prototype.text=void 0;var Je=class e extends qe{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ye(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Ye(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Xe(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var Ze=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Qe(t,n);if(r.next==null)return e.empty;let i=$e(r);r.next&&r.err(`Unexpected trailing text`);let a=lt(ot(i));return ut(a,r),a}matchType(e){for(let t=0;te.createAndFill()));for(let e=0;e=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n`+e.indexOf(t.next[n].next);return r}).join(` -`)}};Ze.empty=new Ze(!0);var Qe=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function $e(e){let t=[];do t.push(et(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function et(e){let t=[];do t.push(tt(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function tt(e){let t=at(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=rt(e,t);else break;return t}function nt(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function rt(e,t){let n=nt(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:nt(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function it(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function at(e){if(e.eat(`(`)){let t=$e(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=it(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function ot(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Ze(r.indexOf(e.length-1)>-1);for(let e=0;e-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ft(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new qe(this,this.computeAttrs(e),w.from(t),T.setFrom(n))}createChecked(e=null,t,n){return t=w.from(t),this.checkContent(t),new qe(this,this.computeAttrs(e),t,T.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=w.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(w.empty,!0);return i?new qe(this,e,t.append(i),T.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function ht(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var gt=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?ht(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},_t=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=pt(e,r.attrs),this.excluded=null;let i=dt(this.attrs);this.instance=i?new T(this,i):null}create(e=null){return!e&&this.instance?this.instance:new T(this,ft(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t-1}},vt=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=C.from(e.nodes),t.marks=C.from(e.marks||{}),this.nodes=mt.compile(this.spec.nodes,this),this.marks=_t.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Ze.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?yt(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:yt(this,n.split(` `))}this.nodeFromJSON=e=>qe.fromJSON(this,e),this.markFromJSON=e=>T.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof mt))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Je(n,n.defaultAttrs,e,T.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function yt(e,t){let n=[];for(let r=0;r-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function bt(e){return e.tag!=null}function xt(e){return e.style!=null}var St=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(bt(e))this.tags.push(e);else if(xt(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new jt(this,t,!1);return n.addAll(e,T.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new jt(this,t,!0);return n.addAll(e,T.none,t.from,t.to),E.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;re.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r{n(e=Pt(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Pt(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Ct={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},wt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tt={ol:!0,ul:!0},Et=1,Dt=2,Ot=4;function kt(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Et:0)|(t===`full`?Dt:0)}var At=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=T.none,this.match=i||(a&Ot?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(w.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Et)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=w.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(w.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Ct.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},jt=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=kt(null,t.preserveWhitespace,0)|(n?Ot:0);i=r?new At(r.type,r.attrs,T.none,!0,t.topMatch||r.type.contentMatch,a):n?new At(null,null,T.none,!0,null,a):new At(e.schema.topNodeType,null,T.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Dt?`full`:this.localPreserveWS||(r.options&Et)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,` -`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e!(a.type?a.type.allowsMarkType(t.type):Ft(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new At(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Et);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Mt(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Tt.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Nt(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Pt(e){let t={};for(let n in e)t[n]=e[n];return t}function Ft(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n{if(i.length||e.marks.length){let n=0,a=0;for(;n=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Ht(Rt(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:Ht(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Lt(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Lt(e.marks)}};function Lt(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Rt(e){return e.document||window.document}var zt=new WeakMap;function Bt(e){let t=zt.get(e);return t===void 0&&zt.set(e,t=Vt(e)),t}function Vt(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;iu)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=Ht(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Ut=65535,Wt=2**16;function Gt(e,t){return e+t*Wt}function Kt(e){return e&Ut}function qt(e){return(e-(e&Ut))/Wt}var Jt=1,Yt=2,Xt=4,Zt=8,Qt=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Zt)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Xt)>0}},$t=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Kt(e);if(!this.inverted)for(let e=0;ee)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Gt(o/3,e-s),f=0;return c&&(f|=e==s?Yt:e==u?Jt:Xt,(t<0?e!=s:e!=u)&&(f|=Zt)),new Qt(a,f,d)}r+=l-c}return n?e+r:new Qt(e+r,0,null)}touches(e,t){let n=0,r=Kt(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;te)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;nn&&t!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return O.fromReplace(e,this.from,this.to,i)}invert(){return new an(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};D.jsonID(`addMark`,rn);var an=class e extends D{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new E(nn(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return O.fromReplace(e,this.from,this.to,n)}invert(){return new rn(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};D.jsonID(`removeMark`,an);var on=class e extends D{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return O.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return O.fromReplace(e,this.pos,this.pos+1,new E(w.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;rr.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,E.fromJSON(t,n.slice),n.insert,!!n.structure)}};D.jsonID(`replaceAround`,ln);function un(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function dn(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;ee.step(t)),a.forEach(t=>e.step(t))}function fn(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof _t){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;ee.step(new an(t.from,t.to,t.style)))}function pn(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t=0;t--)e.step(o[t])}function mn(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function hn(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(nn;e--)t||r.index(e)>0?(t=!0,u=w.from(r.node(e).copy(u)),d++):c--;let f=w.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=w.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new ln(i,a,i,a,new E(r,0,0),n.length,!0))}function Sn(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Tn(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&wn(e,t,n,a),pn(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new ln(c,l,c+1,l-1,new E(w.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Cn(e,t,n,a),!1}})}function Cn(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function wn(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(` -`))}})}function Tn(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function En(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new ln(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new E(w.from(o),0,0),1,!0))}function Dn(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function On(e,t,n=1,r){let i=e.doc.resolve(t),a=w.empty,o=w.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=w.from(i.node(e).copy(a));let t=r&&r[s];o=w.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new cn(t,t,new E(a.append(o),n,n),!0))}function kn(e,t){let n=e.resolve(t),r=n.index();return jn(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function An(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&jn(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Nn(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);wn(e,r.node(),r.before(),s)}o.inlineContent&&pn(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new cn(l,c.map(t+n,-1),E.empty,!0)),r===!0){let t=e.doc.resolve(l);Cn(e,t.node(),t.before(),e.steps.length)}return e}function Pn(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function In(e,t,n=t,r=E.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Ln(i,a,r)?new cn(t,n,r):new Rn(i,a,r).fit()}function Ln(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Rn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=w.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=w.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new E(i,a,o);return e>-1?new ln(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new cn(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Vn(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(w.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced;return Kn(e,-1)<=t?!1:(this.unplaced.size>1&&Kn(e,1)>n&&n++,this.unplaced=new E(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Vn(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new E(zn(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new E(zn(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e1||s==0||e.content.size)&&(u=t,l.push(Hn(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=Bn(this.placed,t,w.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t=0;n--){let{match:t,type:r}=this.frontier[n],i=Un(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Bn(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Bn(this.placed,this.depth,w.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(w.empty,!0);e.childCount&&(this.placed=Bn(this.placed,this.frontier.length,e))}};function zn(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(zn(e.firstChild.content,t-1,n)))}function Bn(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Bn(e.lastChild.content,t-1,n)))}function Vn(e,t){for(let n=0;n1&&(r=r.replaceChild(0,Hn(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(w.empty,!0)))),e.copy(r)}function Un(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!Wn(n,a.content,o)?s:null}function Wn(e,t,n){for(let r=n;r0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Gn(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function Jn(e,t,n,r,i){if(tr){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(w.empty,!0))}return e}function Yn(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Pn(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new E(w.from(r),0,0))}function Xn(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Zn(r,i);for(let t=0;t0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Zn(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(rt.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Qn=class e extends D{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return O.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return O.fromReplace(e,this.pos,this.pos+1,new E(w.from(r),0,+!t.isLeaf))}getMap(){return $t.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};D.jsonID(`attr`,Qn);var $n=class e extends D{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return O.ok(n)}getMap(){return $t.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};D.jsonID(`docAttr`,$n);var er=class extends Error{};er=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},er.prototype=Object.create(Error.prototype),er.prototype.constructor=er,er.prototype.name=`TransformError`;var tr=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new en}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new er(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=E.empty){let r=In(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new E(w.from(n),0,0))}delete(e,t){return this.replace(e,t,E.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return qn(this,e,t,n),this}replaceRangeWith(e,t,n){return Yn(this,e,t,n),this}deleteRange(e,t){return Xn(this,e,t),this}lift(e,t){return gn(this,e,t),this}join(e,t=1){return Nn(this,e,t),this}wrap(e,t){return xn(this,e,t),this}setBlockType(e,t=e,n,r=null){return Sn(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return En(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Qn(e,t,n)),this}setDocAttribute(e,t){return this.step(new $n(e,t)),this}addNodeMark(e,t){return this.step(new on(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof T)t.isInSet(n.marks)&&this.step(new sn(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new sn(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return On(this,e,t,n),this}addMark(e,t,n){return dn(this,e,t,n),this}removeMark(e,t,n){return fn(this,e,t,n),this}clearIncompatible(e,t,n){return pn(this,e,t,n),this}},nr=Object.create(null),k=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new rr(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;r--){let i=t<0?ur(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):ur(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new cr(e.node(0))}static atStart(e){return ur(e,e,0,0,1)||new cr(e)}static atEnd(e){return ur(e,e,e.content.size,e.childCount,-1)||new cr(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=nr[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in nr)throw RangeError(`Duplicate use of selection JSON ID `+e);return nr[e]=t,t.prototype.jsonID=e,t}getBookmark(){return A.between(this.$anchor,this.$head).getBookmark()}};k.prototype.visible=!0;var rr=class{constructor(e,t){this.$from=e,this.$to=t}},ir=!1;function ar(e){!ir&&!e.parent.inlineContent&&(ir=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var A=class e extends k{constructor(e,t=e){ar(e),ar(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return k.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=E.empty){if(super.replace(e,t),t==E.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new or(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=k.findFrom(n,r,!0)||k.findFrom(n,-r,!0);if(e)n=e.$head;else return k.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(k.findFrom(t,-r,!0)||k.findFrom(t,r,!0)).$anchor,t.pos0?0:1);i>0?o=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=ur(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&j.isSelectable(r))return j.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function dr(e,t,n){let r=e.steps.length-1;if(r{o??=r}),e.setSelection(k.near(e.doc.resolve(o),n))}var fr=1,pr=2,mr=4,hr=class extends tr{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=pr,this}ensureMarks(e){return T.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&pr)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||T.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(k.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=mr,this}get scrolledIntoView(){return(this.updated&mr)>0}};function gr(e,t){return!t||!e?e:e.bind(t)}var _r=class{constructor(e,t,n){this.name=e,this.init=gr(t.init,n),this.apply=gr(t.apply,n)}},vr=[new _r(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new _r(`selection`,{init(e,t){return e.selection||k.atStart(t.doc)},apply(e){return e.selection}}),new _r(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new _r(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],yr=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=vr.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new _r(e.key,e.spec.state,e))})}},br=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;ne.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new yr(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=qe.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=k.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function xr(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=xr(i,t,{})),n[r]=i}return n}var M=class{constructor(e){this.spec=e,this.props={},e.props&&xr(e.props,this,this.props),this.key=e.key?e.key.key:Cr(`plugin`)}getState(e){return e[this.key]}},Sr=Object.create(null);function Cr(e){return e in Sr?e+`$`+ ++Sr[e]:(Sr[e]=0,e+`$`)}var N=class{constructor(e=`key`){this.key=Cr(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},wr=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Tr(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var Er=(e,t,n)=>{let r=Tr(e,n);if(!r)return!1;let i=Mr(r);if(!i){let n=r.blockRange(),i=n&&hn(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(Xr(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Ar(a,`end`)||j.isSelectable(a)))for(let n=r.depth;;n--){let o=In(e.doc,r.before(n),r.after(n),E.empty);if(o&&o.slice.size1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Dr=(e,t,n)=>{let r=Tr(e,n);if(!r)return!1;let i=Mr(r);return i?kr(e,i,t):!1},Or=(e,t,n)=>{let r=Nr(e,n);if(!r)return!1;let i=Ir(r);return i?kr(e,i,t):!1};function kr(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=In(e.doc,i,o,E.empty);if(!s||s.from!=i||s instanceof cn&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(A.create(t.doc,i)),n(t.scrollIntoView())}return!0}function Ar(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var jr=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=Mr(r)}let o=a&&a.nodeBefore;return!o||!j.isSelectable(o)?!1:(t&&t(e.tr.setSelection(j.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function Mr(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Nr(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset{let r=Nr(e,n);if(!r)return!1;let i=Ir(r);if(!i)return!1;let a=i.nodeAfter;if(Xr(e,i,t,1))return!0;if(r.parent.content.size==0&&(Ar(a,`start`)||j.isSelectable(a))){let n=In(e.doc,r.before(),r.after(),E.empty);if(n&&n.slice.size{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let n=e.selection,r=n instanceof j,i;if(r){if(n.node.isTextblock||!kn(e.doc,n.from))return!1;i=n.from}else if(i=Mn(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(j.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Rr=(e,t)=>{let n=e.selection,r;if(n instanceof j){if(n.node.isTextblock||!kn(e.doc,n.to))return!1;r=n.to}else if(r=Mn(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},zr=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&hn(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},Br=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(` -`).scrollIntoView()),!0)};function Vr(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=Vr(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(k.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Ur=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof cr||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=Vr(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Dn(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&hn(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function Gr(e){return(t,n)=>{if(t.selection instanceof j&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!Dn(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof A||t.selection instanceof cr)&&r.deleteSelection();let{$from:i}=r.selection,a=r.steps.length,o=[],s,c,l=!1,u=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),u=i.start(t)==i.pos-(i.depth-t),c=Vr(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,l,i);o.unshift(n||(l&&c?{type:c}:null)),s=t;break}else{if(t==1)return!1;o.unshift(null)}let d=i.pos,f=Dn(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,Dn(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!l&&u&&i.node(s).type!=c){let e=r.mapping.slice(a),t=e.map(i.before(s)),n=r.doc.resolve(t);c&&i.node(s-1).canReplaceWith(n.index(),n.index()+1,c)&&r.setNodeMarkup(e.map(i.before(s)),c)}return n&&n(r.scrollIntoView()),!0}}var Kr=Gr(),qr=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0&&(i=n.before(a),t&&t(e.tr.setSelection(j.create(e.doc,i))),!0)},Jr=(e,t)=>(t&&t(e.tr.setSelection(new cr(e.doc))),!0);function Yr(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||kn(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Xr(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Yr(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=w.empty;for(let e=o.length-1;e>=0;e--)s=w.from(o[e].create(null,s));s=w.from(i.copy(s));let c=e.tr.step(new ln(t.pos-1,r,t.pos,r,new E(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&kn(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:k.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&hn(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&Ar(a,`start`,!0)&&Ar(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=w.empty;for(let e=o.length-1;e>=0;e--)r=w.from(o[e].copy(r));n(e.tr.step(new ln(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new E(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Zr(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(A.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var Qr=Zr(-1),$r=Zr(1);function ei(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&_n(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function ti(e,t=null){return function(n,r){let i=!1;for(let r=0;r{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t)){if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new Ge(e,e,t.depth),t.endIndex=0;e--)a=w.from(n[e].type.create(n[e].attrs,a));e.step(new ln(t.start-(r?2:0),t.end,t.start,t.end,new E(a,0,0),n.length,!0));let o=0;for(let e=0;et.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?di(t,n,e,a):fi(t,n,a):!0:!1}}function di(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);aa;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?w.empty:w.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new ln(d-+!!s,f+ +!!c,d+1,f-1,new E((s?w.empty:w.from(i.copy(w.empty))).append(c?w.empty:w.from(i.copy(w.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function pi(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=w.from(r?e.create():null),o=new E(w.from(e.create(null,w.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new ln(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var P=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},mi=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},hi=null,gi=function(e,t,n){let r=hi||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},_i=function(){hi=null},vi=function(e,t,n,r){return n&&(bi(e,t,n,r,-1)||bi(e,t,n,r,1))},yi=/^(img|br|input|textarea|hr)$/i;function bi(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:F(e))){let n=e.parentNode;if(!n||!I(n)||Ti(e)||yi.test(e.nodeName)||e.contentEditable==`false`)return!1;t=P(e)+(i<0?0:1),e=n}else if(I(e)){let n=e.childNodes[t+(i<0?-1:0)];if(I(n)&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?F(e):0}else return!1}}function F(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function I(e){return e.nodeType==1}function L(e){return e.nodeType==3}function xi(e,t){return t?e.contains(I(t)?t:t.parentNode):!1}function Si(e,t){for(;;){if(L(e)&&t)return e;if(I(e)&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=F(e)}else if(e.parentNode&&!Ti(e))t=P(e),e=e.parentNode;else return null}}function Ci(e,t){for(;;){if(L(e)&&t2),Hi=Vi||(Ai?/Mac/.test(Ai.platform):!1),Ui=Ai?/Win/.test(Ai.platform):!1,Wi=/Android \d/.test(Mi),Gi=!!ji&&`webkitFontSmoothing`in ji.documentElement.style,Ki=Gi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function qi(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ji(e,t){return typeof e==`number`?e:e[t]}function Yi(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Xi(e,t,n){if(!da(t)&&t.left==0)return;let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(!I(o)){o=mi(o);continue}let e=o==a.body,n=e?qi(a):Yi(o),s=0,c=0;if(t.topn.bottom-Ji(r,`bottom`)&&(c=t.bottom-t.top>n.bottom-n.top?t.top+Ji(i,`top`)-n.top:t.bottom-n.bottom+Ji(i,`bottom`)),t.leftn.right-Ji(r,`right`)&&(s=t.right-n.right+Ji(i,`right`)),s||c){if(e)a.defaultView.scrollBy(s,c);else{let e=o.scrollLeft,n=o.scrollTop;c&&(o.scrollTop+=c),s&&(o.scrollLeft+=s);let r=o.scrollLeft-e,i=o.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i}}}let l=e?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(l))break;o=l==`absolute`?o.offsetParent:mi(o)}}function Zi(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:Qi(e.dom)}}function Qi(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=mi(r));return t}function $i({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ea(n,r==0?0:r-t)}function ea(e,t){for(let n=0;n=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&L(n)?ia(n,i):!n||r?{node:e,offset:a}:ra(n,i)}function ia(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function aa(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function oa(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function ca(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(I(t.dom)&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right-1?i:e.docView.posFromDOM(t,n,-1)}function la(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&i++}let n;Gi&&i&&I(r)&&I(n=r.childNodes[i-1])&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&I(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||!I(r)||r.childNodes[i-1].nodeName!=`BR`)&&(s=ca(e,r,i,t))}s??=sa(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function da(e){return e.top=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,ha(fa(gi(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==F(r))){let e=r.childNodes[i-1];if(I(e))return ga(e.getBoundingClientRect(),!1)}if(a==null&&i=0)}if(a==null&&i&&(n<0||i==F(r))){let e=r.childNodes[i-1],t=L(e)?gi(e,F(e)-+!o):I(e)&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return ha(fa(t,1),!1)}if(a==null&&i=0)}function ha(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function ga(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function _a(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function va(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return _a(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=ma(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(I(e))t=e.getClientRects();else if(L(e))t=gi(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;ei.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var ya=/[\u0590-\u08ac]/;function ba(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!ya.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:_a(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!xi(l,u)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var xa=null,Sa=null,Ca=!1;function wa(e,t,n){return xa==t&&Sa==n?Ca:(xa=t,Sa=n,Ca=n==`up`||n==`down`?va(e,t,n):ba(e,t,n))}var Ta=0,Ea=1,Da=2,Oa=3,ka=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Ta,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tP(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=!!(e.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(I(a)?xi(a,e):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;te){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof Ia||e instanceof Aa&&e.side>=0))break}if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?P(e.dom)+1:0}}{let e,r=!0;for(;e=n=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=P(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;es&&at){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r=n:en){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?Da:Ea,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Oa:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Da:Oa}n=a}this.dirty=Da}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Da:Ea;t.dirty{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){let e=I(a)?a:document.createElement(`span`);e!=a&&e.appendChild(a),e.hasAttribute(`contenteditable`)||(e.contentEditable=`false`),e.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Ta&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},ja=class extends ka{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Ma=class e extends ka{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=It.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Oa||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Oa&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ta){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty0&&(a=$a(a,0,t,r));for(let e=0;e{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(!L(u))throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=It.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Wa(u,r,n),l?c=new La(t,n,r,i,u,d||null,f,l):n.isText?new Fa(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>I(t)&&e.indexOf(t.parentNode)<0&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>w.empty}}return t}matchesNode(e,t,n){return this.dirty==Ta&&e.eq(this.node)&&Ga(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new qa(this,a&&a.node,e),c=this.node.inlineContent,l=c&&this.node.isBlock;Xa(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?T.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,u,d)=>{s.syncToMarks(t.marks,n,e,d),l&&t.isAtom&&!t.isText&&s.addHackNode(`IMG`,s.top);let f;s.findNodeMatch(t,a,u,d)||o&&e.state.selection.from>r&&e.state.selection.to-1&&s.updateNodeAt(t,a,u,f,e)||s.updateNextNode(t,a,u,e,d,r)||s.addNode(t,a,u,e,r),r+=t.nodeSize,c&&(l=t.isAtom&&!t.isText)}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Da)&&(a&&this.protectLocalComposition(e,a),Ra(this.contentDOM,this.children,e),Vi&&Za(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof A)||nt+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=Qa(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new ja(this,i,t,r);e.input.compositionNodes.push(a),this.children=$a(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==Oa||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Ta}updateOuterDeco(e){if(Ga(e,this.outerDeco))return;let t=!I(this.nodeDOM),n=this.dom;this.dom=Ha(this.dom,this.nodeDOM,Va(this.outerDeco,this.node,t),Va(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){I(this.nodeDOM)&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){I(this.nodeDOM)&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function Pa(e,t,n,r,i){Wa(r,t,e);let a=new Na(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var Fa=class e extends Na{constructor(e,t,n,r,i,a){super(e,t,n,r,i,null,a)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==Oa||this.dirty!=Ta&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ta||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Ta,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Oa)}get domAtom(){return!1}isText(e){return this.node.text==e}},Ia=class extends ka{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ta&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},La=class extends Na{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o),this.spec=s}update(e,t,n,r){if(this.dirty==Oa)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Ra(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a>1,o=Math.min(a,e.length);for(;i-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=Ma.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Ma)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function Ya(e,t){return e.type.side-t.type.side}function Xa(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;na;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Za(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function Qa(e,t,n,r){for(let i=0,a=0;i=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function $a(e,t,n,r,i){let a=[];for(let o=0,s=0;o=n||u<=t?a.push(c):(ln&&a.push(c.slice(n-l,c.size,r)))}return a}function eo(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Ei(n)){for(c=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&j.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&wi(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new j(o==e?s:r.resolve(e))}else if(Ri&&t==`key`&&o>e.state.selection.to&&I(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if(getComputedStyle(e).overflow!=`visible`){l=k.findFrom(r.resolve(i.posAtStart),1);break}if(e==i.dom||e.nextSibling||!e.parentNode||!I(e.parentNode))break}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!to(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function co(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,P(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Ii&&Li<=11&&(n.disabled=!0,n.disabled=!1)}function lo(e,t){if(t instanceof j){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(uo(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else uo(e)}function uo(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function fo(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||A.between(t,n,r)}function po(e){return e.editable&&!e.hasFocus()?!1:mo(e)}function mo(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return xi(e.dom,t.anchorNode)&&(e.editable||xi(e.dom,t.focusNode))}catch{return!1}}function ho(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return vi(t.node,t.offset,n.anchorNode,n.anchorOffset)}function go(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&k.findFrom(a,t)}function _o(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function vo(e,t,n){let r=e.state.selection;if(r instanceof A){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return _o(e,new A(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=go(e.state,t);return n&&n instanceof j?_o(e,n):!1}if(!(Hi&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?j.isSelectable(i)?_o(e,new j(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):_o(e,new A(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1}}else if(r instanceof j&&r.node.isInline)return _o(e,new A(t>0?r.$to:r.$from));else{let n=go(e.state,t);return n?_o(e,n):!1}}function yo(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`):I(e)&&e.contentEditable==`false`}function bo(e,t){return t<0?xo(e):So(e)}function xo(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Ri&&I(n)&&r0){if(!I(n))break;let e=n.childNodes[r-1];if(yo(e,-1))i=n,a=--r;else if(L(e))n=e,r=n.nodeValue.length;else break}else if(Co(n))break;else{let t=n.previousSibling;for(;t&&yo(t,-1);)i=n.parentNode,a=P(t),t=t.previousSibling;if(t)n=t,r=F(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?Eo(e,n,r):i&&Eo(e,i,a)}function So(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=F(n),a,o;for(;;)if(r{e.state==i&&no(e)},50)}function Do(e,t){let n=e.state.doc.resolve(t);if(!(R||Ui)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i1)return n.leftr.top&&i1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function Oo(e,t,n){let r=e.state.selection;if(r instanceof A&&!r.empty||n.indexOf(`s`)>-1||Hi&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=go(e.state,t);if(n&&n instanceof j)return _o(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof cr?k.near(n,t):k.findFrom(n,t);return o?_o(e,o):!1}return!1}function ko(e,t){if(!(e.state.selection instanceof A))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function Ao(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function jo(e){if(!z||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&I(t)&&n==0&&t.firstChild&&I(t.firstChild)&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Ao(e,n,`true`),setTimeout(()=>Ao(e,n,`false`),20)}return!1}function Mo(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function No(e,t){let n=t.keyCode,r=Mo(t);if(n==8||Hi&&n==72&&r==`c`)return ko(e,-1)||bo(e,-1);if(n==46&&!t.shiftKey||Hi&&n==68&&r==`c`)return ko(e,1)||bo(e,1);if(n==13||n==27)return!0;if(n==37||Hi&&n==66&&r==`c`){let t=n==37?Do(e,e.state.selection.from)==`ltr`?-1:1:-1;return vo(e,t,r)||bo(e,t)}if(n==39||Hi&&n==70&&r==`c`){let t=n==39?Do(e,e.state.selection.from)==`ltr`?1:-1:1;return vo(e,t,r)||bo(e,t)}return n==38||Hi&&n==80&&r==`c`?Oo(e,-1,r)||bo(e,-1):n==40||Hi&&n==78&&r==`c`?jo(e)||Oo(e,1,r)||bo(e,1):!(r!=(Hi?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function Po(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||It.fromSchema(e.state.schema),s=Wo(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&I(l)&&(u=Uo[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&I(l)&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,` - -`),slice:t}}function Fo(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new E(w.from(e.state.schema.text(t.replace(/\r\n?/g,` -`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=It.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=qo(n),Gi&&Jo(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&!I(e);)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||St.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!Io.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Yo(Ho(s,+u[1],+u[2]),u[4]);else if(s=E.maxOpen(Lo(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e{s=t(s,e,c)}),s}var Io=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Lo(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&zo(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=Bo(a[a.length-1],i.length));let n=Ro(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return w.from(a)}return e}function Ro(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,w.from(e));return e}function zo(e,t,n,r,i){if(i1&&(a=0),i=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(w.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function Ho(e,t,n){return te})}return Go.createHTML(e)}function qo(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Wo(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),a;if((a=i&&Uo[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>``).reverse().join(``)),r.innerHTML=Ko(e),a)for(let e=0;e=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{i=w.from(t.create(r[e+1],i))}catch{break}a++,o++}return new E(i,a,o)}var B={},Xo={},Zo={touchstart:!0,touchmove:!0},Qo=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function $o(e){for(let t in B){let n=B[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{is(e,t)&&!rs(e,t)&&(e.editable||!(t.type in Xo))&&n(e,t)},Zo[t]?{passive:!0}:void 0)}z&&e.dom.addEventListener(`input`,()=>null),ns(e)}function es(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function ts(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function ns(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>rs(e,t))})}function rs(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function is(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function as(e,t){!rs(e,t)&&B[t.type]&&(e.editable||!(t.type in Xo))&&B[t.type](e,t)}Xo.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Cs(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Wi&&R&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),Vi&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Di(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||No(e,n)?n.preventDefault():es(e,`key`)}},Xo.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},Xo.keypress=(e,t)=>{let n=t;if(Cs(e)||!n.charCode||n.ctrlKey&&!n.altKey||Hi&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof A)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function ss(e){return{left:e.clientX,top:e.clientY}}function cs(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function ls(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function us(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta(`pointer`,!0),e.dispatch(r)}function ds(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&j.isSelectable(r)?(us(e,new j(n)),!0):!1}function fs(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof j&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(j.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i!=null&&(us(e,j.create(e.state.doc,i)),!0)}function ps(e,t,n,r,i){return ls(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?fs(e,n):ds(e,n))}function ms(e,t,n,r){return ls(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function hs(e,t,n,r){return ls(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||gs(e,n,r)}function gs(e,t,n){if(n.button!=0)return!1;let r=_s(e,t,!0),i=e.state.doc;return r?(us(e,r),r instanceof A&&i.eq(e.state.doc)&&(e.input.mouseDown=new Ss(e,r)),!0):!1}function _s(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?A.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return A.create(r,a+1,a+1+t.content.size);if(n&&j.isSelectable(t))return j.create(r,a)}return null}function vs(e){return ks(e)}var ys=Hi?`metaKey`:`ctrlKey`;B.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=vs(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&cs(n,e.input.lastClick)&&!n[ys]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(ss(n));o&&(a==`singleClick`?e.input.mouseDown=new xs(e,o,n,!!r):(a==`doubleClick`?ms:hs)(e,o.pos,o.inside,n)?n.preventDefault():es(e,`pointer`))};var bs=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},xs=class extends bs{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[ys],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&I(s.nodeDOM)?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof j&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!!(this.target&&Ri&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),es(e,`pointer`)}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||no(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ss(e))),this.updateAllowDefault(e),this.allowDefault||!t?es(this.view,`pointer`):ps(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||z&&this.mightDrag&&!this.mightDrag.node.isAtom||R&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(us(this.view,k.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):es(this.view,`pointer`)}move(e){this.updateAllowDefault(e),es(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},Ss=class extends bs{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),es(this.view,`pointer`);let t=this.view.posAtCoords(ss(e)),n=t&&_s(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from{e.input.lastTouch=Date.now(),vs(e),es(e,`pointer`)},B.touchmove=e=>{e.input.lastTouch=Date.now(),es(e,`pointer`)},B.contextmenu=e=>vs(e);function Cs(e,t){return e.composing?!0:z&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var ws=Wi?5e3:-1;Xo.compositionstart=Xo.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof A&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||R&&Ui&&Ts(e)))e.markCursor=e.state.storedMarks||n.marks(),ks(e,!0),e.markCursor=null;else if(ks(e,!t.selection.empty),Ri&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&I(n)&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(L(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Es(e,ws)};function Ts(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!I(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return I(r)&&r.contentEditable==`false`}Xo.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Es(e,20))};function Es(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>ks(e),t))}function Ds(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Os(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Si(t.focusNode,t.focusOffset),r=Ci(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function ks(e,t=!1){if(!(Wi&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Ds(e),t||e.docView&&e.docView.dirty){let n=eo(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function As(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var js=Ii&&Li<15||Vi&&Ki<604;B.copy=Xo.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=js?null:n.clipboardData,{dom:o,text:s}=Po(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):As(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Ms(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Ns(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ps(e,r.value,null,i,t):Ps(e,r.textContent,r.innerHTML,i,t)},50)}function Ps(e,t,n,r,i){let a=Fo(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||E.empty)))return!0;if(!a)return!1;let o=Ms(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function Fs(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}Xo.paste=(e,t)=>{let n=t;if(e.composing&&!Wi)return;let r=js?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Ps(e,Fs(r),r.getData(`text/html`),i,n)?n.preventDefault():Ns(e,n)};var Is=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Ls=Hi?`altKey`:`ctrlKey`;function Rs(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[Ls]:!n}B.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(ss(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof j?i.to-1:i.to))){if(r&&r.mightDrag)o=j.create(e.state.doc,r.mightDrag.pos);else if(n.target&&I(n.target)){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=j.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=Po(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!R||Bi>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(js?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,js||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Is(l,Rs(e,n),o)},B.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Xo.dragover=Xo.dragenter=(e,t)=>t.preventDefault(),Xo.drop=(e,t)=>{try{zs(e,t,e.dragging)}finally{e.dragging=null}};function zs(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(ss(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=Fo(e,Fs(t.dataTransfer),js?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&Rs(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||E.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Fn(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&j.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new j(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(fo(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}B.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&no(e)},20))},B.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},B.beforeinput=(e,t)=>{if(Wi&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Di(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in Xo)B[e]=Xo[e];function Bs(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var Vs=class e{constructor(e,t){this.toDOM=e,this.spec=t||Ks,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new Ws(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Bs(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Hs=class e{constructor(e,t){this.attrs=e,this.spec=t||Ks}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new Ws(i,a,this)}valid(e,t){return t.from=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;ae){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==H||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Ks)}mapInner(t,n,r,i,a){let o;for(let e=0;e{let o=t+r,s;if(s=Zs(n,e,o)){for(i||=this.children.slice();aa&&n.to=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;ea&&t.type instanceof Hs){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;ee.map(t,n,Ks));return e.from(r)}forChild(t,n){if(n.isLeaf)return V.empty;let r=[];for(let i=0;ie instanceof V)?t:t.reduce((e,t)=>e.concat(t instanceof V?t:t.members),[]))}}forEachSet(e){for(let t=0;t{let o=a-i-(n-e);for(let i=0;ia+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==H?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=$s(Xs(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;en&&a.to{let s=Zs(e,t,o+n);if(s){a=!0;let e=$s(s,t,n+o+1,r);e!=H&&i.push(o,o+t.nodeSize,e)}});let o=Ys(a?Qs(e):e,-n).sort(ec);for(let e=0;e0;)t++;e.splice(t,0,n)}function rc(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=H&&t.push(r)}),e.cursorWrapper&&t.push(V.create(e.state.doc,[e.cursorWrapper.deco])),qs.from(t)}var ic={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ac=Ii&&Li<=11,oc=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},sc=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new oc,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;ee.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():z&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ac&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ic)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(po(this.view)){if(this.suppressingSelectionUpdates)return no(this.view);if(Ii&&Li<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&vi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=mi(n))t.add(n);for(let r=e.anchorNode;r;r=mi(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:L(n)?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&po(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;ee.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||R&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&I(t);){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(Ri&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||pc(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||r)&&(i>-1&&(e.docView.markDirty(i,a),uc(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,mc(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||no(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;na;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){o=e;break}if(!n||n.size)break}let f=e.state.doc,p=e.someProp(`domParser`)||St.fromSchema(e.state.schema),m=f.resolve(s),h=null,g=p.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:o,preserveWhitespace:m.parent.type.whitespace!=`pre`||`full`,findPositions:u,ruleFromNode:gc(r),context:m});if(u&&u[0].pos!=null){let e=u[0].pos,t=u[1]&&u[1].pos;t??=e,h={anchor:e+s,head:t+s}}return{doc:g,sel:h,from:s,to:c}}var gc=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(z&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}if(t.parentNode.lastChild==t||z&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},_c=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function vc(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=eo(e,t);if(n&&!e.state.selection.eq(n)){if(R&&Wi&&e.input.lastKeyCode===13&&Date.now()-100t(e,Di(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=hc(e,t,n,i),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Wi)&&i.some(e=>I(e)&&!_c.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Di(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof A&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=yc(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}}e.state.selection.frome.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Ii&&Li<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),ee=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((Vi&&e.input.lastIOSEnter>Date.now()-225&&(!ee||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!ee&&Sc(l.doc,h.pos,g.pos))&&e.someProp(`handleKeyDown`,t=>t(e,Di(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&xc(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Di(8,`Backspace`)))){Wi&&R&&e.domObserver.suppressSelectionUpdates();return}R&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Wi&&!ee&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Di(13,`Enter`))})},20));let v=m.start,y=m.endA,b=t=>{let n=t||e.state.tr.replace(v,y,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=yc(e,n.doc,l.sel);t&&!(R&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDeleteno(e),20));let t=b(e.state.tr.delete(v,y)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(x=bc(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=b(e.state.tr);x.type==`add`?t.addMark(v,y,x.mark):t.removeMark(v,y,x.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>b(e.state.tr.insertText(t,v,y));e.someProp(`handleTextInput`,r=>r(e,v,y,t,n))||e.dispatch(n())}else e.dispatch(b())}else e.dispatch(b())}function yc(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:fo(e,t.resolve(n.anchor),t.resolve(n.head))}function bc(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;ee.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;en||Cc(o,!0,!1){e.isTextblock&&a>=t&&a0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function wc(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var Tc=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Qo,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Mc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Oc(this),Dc(this),this.nodeViews=Ac(this),this.docView=Pa(this.state.doc,Ec(this),rc(this),this.dom,this),this.domObserver=new sc(this,(e,t,n,r)=>vc(this,e,t,n,r)),this.domObserver.start(),$o(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ns(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Mc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Ds(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Ac(this);jc(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&ns(this),this.editable=Oc(this),Dc(this);let o=rc(this),s=Ec(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&Zi(this);if(i){this.domObserver.stop();let t=l&&(Ii||R)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&kc(n.selection,e.selection);if(l){let n=R?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Os(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=Pa(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ho(this)&&i.delaySelUpdate())?no(this,t):(lo(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&$i(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&xi(this.dom,e)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof j){let t=this.docView.domAfterPos(this.state.selection.from);I(t)&&Xi(this,t.getBoundingClientRect(),e)}else Xi(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e0&&ee.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return ua(this,e)}coordsAtPos(e,t=1){return ma(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return wa(this,t||this.state,e)}pasteHTML(e,t){return Ps(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Ps(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return Po(this,e)}destroy(){this.docView&&(ts(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rc(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,_i())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return as(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?z&&this.root.nodeType===11&&Oi(this.dom.ownerDocument)==this.dom&&fc(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Tc.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Ec(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[Ws.node(0,e.state.doc.content.size,t)]}function Dc(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:Ws.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Oc(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function kc(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Ac(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function jc(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Mc(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var Nc={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},Pc={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},Fc=typeof navigator<`u`&&/Mac/.test(navigator.platform),Ic=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),U=0;U<10;U++)Nc[48+U]=Nc[96+U]=String(U);for(var U=1;U<=24;U++)Nc[U+111]=`F`+U;for(var U=65;U<=90;U++)Nc[U]=String.fromCharCode(U+32),Pc[U]=String.fromCharCode(U);for(var Lc in Nc)Pc.hasOwnProperty(Lc)||(Pc[Lc]=Nc[Lc]);function Rc(e){var t=!(Fc&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Ic&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?Pc:Nc)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var zc=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Bc=typeof navigator<`u`&&/Win/.test(navigator.platform);function Vc(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if(n!==`then`)return n===`run`?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if(t!==`then`)return t===`chain`?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:Kc({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},Jc=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)==null||(n=n.getSelection())==null||n.removeAllRanges()}}),!0),Yc=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),Xc=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=hn(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Zc=e=>t=>e(t),Qc=()=>({state:e,dispatch:t})=>Ur(e,t),$c=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new A(r.doc.resolve(Math.max(o-1,0)))),!0},el=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function W(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var tl=e=>({tr:t,state:n,dispatch:r})=>{let i=W(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},nl=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},rl=e=>e.content?/^text(\*|\+)/.test(e.content):!1,il=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos({from:il(e,n,`left`),to:il(t,n,`right`)}),ol=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:a,to:o}=al(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.selection.empty||n.setSelection(A.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},sl=()=>({commands:e})=>e.keyboardShortcut(`Enter`),cl=()=>({state:e,dispatch:t})=>Hr(e,t);function ll(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function ul(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:ll(t[r])?t[r].test(e[r]):t[r]===e[r])}function dl(e,t,n={}){return e.find(e=>e.type===t&&ul(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function fl(e,t,n={}){return!!dl(e,t,n)}function pl(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!dl([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&fl([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o({tr:n,state:r,dispatch:i})=>{let a=ml(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=pl(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=A.create(o,e.from,e.to);n.setSelection(t)}}return!0},gl=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(xl()||bl())&&r.dom.focus(),Sl()&&!xl()&&!bl()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!_l(n.state.selection))return o(),!0;let s=yl(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},wl=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Tl=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),El=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&El(r)}return e};function Dl(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`${e}`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return El(n)}function Ol(e){return typeof e?.nodesBetween==`function`}function kl(e,t,n){if(Ol(e))return e;let r=typeof e==`object`&&!!e;n={slice:!0,parseOptions:{},...n};let i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return w.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),kl(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new vt({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?St.fromSchema(a).parseSlice(Dl(e),n.parseOptions):St.fromSchema(a).parse(Dl(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=St.fromSchema(t);return n.slice?r.parseSlice(Dl(e),n.parseOptions).content:r.parse(Dl(e),n.parseOptions)}return kl(``,t,n)}function Al(e){return!(`type`in e)}function jl(e,t,n){let r=e.steps.length-1;if(r{o===0&&(o=r)}),e.setSelection(k.near(e.doc.resolve(o),n))}var Ml=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{kl(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=kl(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0,f=Al(i)?i.content:[i];if(f.forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let p;if(u)p=Array.isArray(t)?t.map(e=>e.text||``).join(``):Ol(t)?f.map(e=>e.text??``).join(``):typeof t==`object`&&t&&t.text?t.text:t,r.insertText(p,c,l);else{p=w.from(f);let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,i=t.isText||t.isTextblock,a=t.content.size>0;n&&i&&a&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&jl(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:p})}return!0};function Nl(e){for(let t=0;t({tr:t,dispatch:n,editor:r})=>{let{pos:i,attrs:a,content:o,updateSelection:s=!0}=e,c;c=typeof i==`number`?t.doc.resolve(i):i||t.selection.$from;let l=Nl(c.parent.contentMatchAt(c.index()));if(!l)return!1;let u=Object.keys(l.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{},f;if(o){let e=kl(o,r.schema);f=l.createAndFill(d,e)}else f=l.createAndFill(d);return f?(n&&(t.insert(c.pos,f),s&&jl(t,t.steps.length-1,-1)),!0):!1},Fl=()=>({state:e,dispatch:t})=>Lr(e,t),Il=()=>({state:e,dispatch:t})=>Rr(e,t),Ll=()=>({state:e,dispatch:t})=>Er(e,t),Rl=()=>({state:e,dispatch:t})=>Pr(e,t),zl=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Mn(e.doc,e.selection.$from.pos,-1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Bl=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Mn(e.doc,e.selection.$from.pos,1);return r!=null&&(n.join(r,2),t&&t(n),!0)}catch{return!1}},Vl=()=>({state:e,dispatch:t})=>Dr(e,t),Hl=()=>({state:e,dispatch:t})=>Or(e,t);function Ul(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function Wl(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e({editor:t,view:n,tr:r,dispatch:i})=>{let a=Wl(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function Kl(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?W(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>!o||o.name===e.node.type.name).filter(e=>ul(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var ql=(e,t={})=>({state:n,dispatch:r})=>Kl(n,W(e,n.schema),t)?zr(n,r):!1,Jl=()=>({state:e,dispatch:t})=>Wr(e,t),Yl=e=>({state:t,dispatch:n})=>ui(W(e,t.schema))(t,n),Xl=()=>({state:e,dispatch:t})=>Br(e,t);function Zl(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function Ql(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var $l=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Zl(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=W(e,r.schema)),s===`mark`&&(o=ml(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,Ql(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(Ql(a.attrs,t))))})})}),c},eu=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),tu=()=>({tr:e,dispatch:t})=>{if(t){let t=new cr(e.doc);e.setSelection(t)}return!0},nu=()=>({state:e,dispatch:t})=>jr(e,t),ru=()=>({state:e,dispatch:t})=>Fr(e,t),iu=()=>({state:e,dispatch:t})=>qr(e,t),au=()=>({state:e,dispatch:t})=>$r(e,t),ou=()=>({state:e,dispatch:t})=>Qr(e,t);function su(e,t,n={},r={}){return kl(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var cu=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=su(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){let e=Al(s)?s.content:[s];a.replaceWith(0,c.content.size,e).setMeta(`preventUpdate`,!n)}return!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function lu(e,t){let n=ml(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function uu(e,t){let n=new tr(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function du(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function fu(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function pu(e){return t=>fu(t.$from,e)}function G(e,t,n){return e.config[t]===void 0&&e.parent?G(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?G(e.parent,t,n):null}):e.config[t]}function mu(e){return e.map(e=>{let t=G(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...mu(t())]:e}).flat(10)}function hu(e,t){let n=It.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function gu(e){return typeof e==`function`}function K(e,t=void 0,...n){return gu(e)?t?e.bind(t)(...n):e(...n):e}function _u(e={}){return Object.keys(e).length===0&&e.constructor===Object}function vu(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function yu(e){let t=[],{nodeExtensions:n,markExtensions:r}=vu(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=G(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=G(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function bu(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function xu(e){let t=[],n=bu(e||``),r=n.length;for(let e=0;e!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(e===`__proto__`){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});return}if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...xu(n[e]),...xu(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function Su(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>q(e,t),{})}function Cu(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function wu(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Cu(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function Tu(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&_u(t)?!1:t!=null))}function Eu(e){var t,n;let r={};return!(e!=null&&(t=e.attribute)!=null&&t.isRequired)&&`default`in(e?.attribute||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function Du(e,t){let n=yu(e),{nodeExtensions:r,markExtensions:i}=vu(e),a=r.find(e=>G(e,`topNode`))?.name;return new vt({topNode:a,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Tu({...e.reduce((e,t)=>{let n=G(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:K(G(r,`content`,a)),marks:K(G(r,`marks`,a)),group:K(G(r,`group`,a)),inline:K(G(r,`inline`,a)),atom:K(G(r,`atom`,a)),selectable:K(G(r,`selectable`,a)),draggable:K(G(r,`draggable`,a)),code:K(G(r,`code`,a)),whitespace:K(G(r,`whitespace`,a)),linebreakReplacement:K(G(r,`linebreakReplacement`,a)),defining:K(G(r,`defining`,a)),isolating:K(G(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Eu))}),s=K(G(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>wu(e,i)));let c=G(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:Su(e,i)}));let l=G(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Tu({...e.reduce((e,t)=>{let n=G(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:K(G(r,`inclusive`,a)),excludes:K(G(r,`excludes`,a)),group:K(G(r,`group`,a)),spanning:K(G(r,`spanning`,a)),code:K(G(r,`code`,a)),attrs:Object.fromEntries(i.map(Eu))}),s=K(G(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>wu(e,i)));let c=G(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:Su(e,i)})),[r.name,o]}))})}function Ou(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function ku(e){return e.sort((e,t)=>{let n=G(e,`priority`)||100,r=G(t,`priority`)||100;return n>r?-1:+(ne.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function ju(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=` - -`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function Mu(e,t){return ju(e,{from:0,to:e.content.size},t)}function Nu(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Pu(e,t){let n=W(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Fu(e,t){let n=Zl(typeof t==`string`?t:t.name,e.schema);return n===`node`?Pu(e,t):n===`mark`?lu(e,t):{}}function Iu(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Lu(e){let t=Iu(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function Ru(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Lu(r)}function zu(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=pl(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&e?.nodeSize!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Bu=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},Vu=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function Hu(e,t){return t.nodes[e]||t.marks[e]||null}function Uu(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var Wu=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function Gu(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?ml(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>ul(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>ul(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Ku(e,t,n={}){if(!t)return Kl(e,null,n)||Gu(e,null,n);let r=Zl(t,e.schema);return r===`node`?Kl(e,t,n):r===`mark`&&Gu(e,t,n)}var qu=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=pu(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Yu(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Xu(e,t){let{nodeExtensions:n}=vu(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=K(G(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function Zu(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(Zu(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Qu(e){return e instanceof j}var $u=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function ed(e,t){let n=t.mapping.mapResult(e.position);return{position:new $u(n.pos),mapResult:n}}function td(e){return new $u(e)}function nd(e,t,n){let{selection:r}=t,i=null;if(_l(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var rd=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=ml(e,r.schema);if(i){if(o){let e=lu(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})})}return nd(r,n,c)},id=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),ad=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=W(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>ti(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>ti(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},od=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=vl(e,0,n.content.size),i=j.create(n,r);t.setSelection(i)}return!0},sd=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},cd=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=A.atStart(n).from,o=A.atEnd(n).to,s=vl(r,a,o),c=vl(i,a,o),l=A.create(n,s,c);t.setSelection(l)}return!0},ld=e=>({state:t,dispatch:n})=>pi(W(e,t.schema))(t,n);function ud(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var dd=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=Uu(l,s.node().type.name,s.node().attrs);if(a instanceof j&&a.node.isBlock)return!s.parentOffset||!Dn(o,s.pos)?!1:(r&&(e&&ud(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Nl(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=Dn(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&Dn(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof A&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&ud(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},fd=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=W(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=w.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=w.from(s.node(t).copy(e));let i=s.indexAfter(-1){if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(A.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Uu(d,u.type.name,u.attrs),...t},m={...Uu(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!Dn(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function pd(e){return!e||e===`1`?null:e}function md(e,t){return pd(e)===pd(t)}var hd=(e,t)=>{let n=pu(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&kn(e.doc,n.pos))||!md(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},gd=(e,t)=>{let n=pu(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&kn(e.doc,r))||!md(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function _d(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return A.between(r,i)}var vd=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=W(e,o.schema),m=W(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:ee}=h,v=_.blockRange(ee),y=g||h.$to.parentOffset&&h.$from.marks();if(!v)return!1;let b=pu(e=>Xu(e.type.name,d))(h),x=h.from===0&&h.to===o.doc.content.size,te=o.doc.content.content,ne=te.length===1?te[0]:null,re=x&&ne&&Xu(ne.type.name,d)?{node:ne,pos:0,depth:0}:null,S=b??re,ie=!!b&&v.depth>=1&&v.depth-b.depth<=1,ae=!!re;if((ie||ae)&&S){if(S.node.type===p)return x&&ae?c().command(({tr:e,dispatch:t})=>{let n=_d(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Xu(S.node.type.name,d)&&p.validContent(S.node.content))return c().command(()=>(a.setNodeMarkup(S.pos,p),!0)).command(()=>hd(a,p)).command(()=>gd(a,p)).run()}return!n||!y||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>hd(a,p)).command(()=>gd(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=y.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>hd(a,p)).command(()=>gd(a,p)).run()},yd=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=ml(e,r.schema);return Gu(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},bd=(e,t,n={})=>({state:r,commands:i})=>{let a=W(e,r.schema),o=W(t,r.schema),s=Kl(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},xd=(e,t={})=>({state:n,commands:r})=>{let i=W(e,n.schema);return Kl(n,i,t)?r.lift(i):r.wrapIn(i,t)},Sd=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},Cd=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},wd=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=ml(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=pl(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Td=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},Ed=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Zl(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=W(e,r.schema)),s===`mark`&&(o=ml(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},Dd=new N(`__tiptap_decorations__`),Od=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(Dd,{type:`force`,name:e}),!0),kd=(e,t={})=>({state:n,dispatch:r})=>ei(W(e,n.schema),t)(n,r),Ad=(e,t={})=>({state:n,dispatch:r})=>si(W(e,n.schema),t)(n,r),jd=be({blur:()=>Jc,clearContent:()=>Yc,clearNodes:()=>Xc,command:()=>Zc,createParagraphNear:()=>Qc,cut:()=>$c,deleteCurrentNode:()=>el,deleteNode:()=>tl,deleteRange:()=>nl,deleteSelection:()=>ol,enter:()=>sl,exitCode:()=>cl,extendMarkRange:()=>hl,first:()=>gl,focus:()=>Cl,forEach:()=>wl,insertContent:()=>Tl,insertContentAt:()=>Ml,insertDefaultBlock:()=>Pl,joinBackward:()=>Ll,joinDown:()=>Il,joinForward:()=>Rl,joinItemBackward:()=>zl,joinItemForward:()=>Bl,joinTextblockBackward:()=>Vl,joinTextblockForward:()=>Hl,joinUp:()=>Fl,keyboardShortcut:()=>Gl,lift:()=>ql,liftEmptyBlock:()=>Jl,liftListItem:()=>Yl,newlineInCode:()=>Xl,resetAttributes:()=>$l,scrollIntoView:()=>eu,selectAll:()=>tu,selectNodeBackward:()=>nu,selectNodeForward:()=>ru,selectParentNode:()=>iu,selectTextblockEnd:()=>au,selectTextblockStart:()=>ou,setContent:()=>cu,setMark:()=>rd,setMeta:()=>id,setNode:()=>ad,setNodeSelection:()=>od,setTextDirection:()=>sd,setTextSelection:()=>cd,sinkListItem:()=>ld,splitBlock:()=>dd,splitListItem:()=>fd,toggleList:()=>vd,toggleMark:()=>yd,toggleNode:()=>bd,toggleWrap:()=>xd,undoInputRule:()=>Sd,unsetAllMarks:()=>Cd,unsetMark:()=>wd,unsetTextDirection:()=>Td,updateAttributes:()=>Ed,updateDecorations:()=>Od,wrapIn:()=>kd,wrapInList:()=>Ad}),Md=new WeakMap;function Nd(e,t){Md.set(e,(Md.get(e)??0)+1);try{return t()}finally{let t=(Md.get(e)??1)-1;t>0?Md.set(e,t):Md.delete(e)}}function Pd(e){return Md.has(e)}var Fd=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Id=typeof process<`u`&&!1;function Ld(e){return e.kind===`widget`}function Rd(e,t){let n=[],r=new Set;for(let i of e)i.kind===`widget`&&Ld(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function zd(e,t,n){let{decorations:r,widgetKeys:i}=Rd(t,n);return{set:V.create(e,r),widgetKeys:i}}function Bd({position:e,from:t,to:n,docSize:r}){return eBd({position:e.anchor,from:t,to:n,docSize:r})?!0:(e.anchor===n||a.has(i)||(a.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function Hd(e){let t=e.spec?.key;return typeof t==`string`?t:void 0}function Ud(e){let t=new Map,n=new Map;for(let r of e.find()){let e=Hd(r);if(!e)continue;let i=r.spec.extensionName??`unknown`,a=t.get(e)??new Set;a.add(i),t.set(e,a),n.set(e,(n.get(e)??0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>(n.get(e)??0)>1)}function Wd(e){return e.jsonID===`attr`}function Gd(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||Wd(e))return!0;let n=e;return typeof n.from==`number`&&typeof n.to==`number`}function Kd(e,t){let n=null,r=0,i=0;for(let a=0;at.to);a+=1){let o=i+e.child(a).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function qd(e,t){if(e.steps.some(e=>!Gd(e)))return{type:`full`};let n=Ru(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!Wd(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=Kd(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:`ranges`,ranges:i}}function Jd(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=e?.key;typeof t==`string`&&r.delete(t)}})}function Yd(e,t,n){let r=t.decorationSetsByExtension[e]??V.empty,i=new Set(t.widgetKeysByExtension[e]??[]);return{set:Jd(r,n.mapping,n.doc,i),widgetKeys:i}}function Xd(e,t){let n=Object.values(t).flatMap(e=>e.find());return V.create(e,n)}function Zd(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}function Qd(e,t){switch(t.update??`document`){case`document`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case`changedRanges`:if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case`manual`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function $d(e,t,n){return n?!0:e.update===`manual`?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var ef=new Set,tf=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=Dd.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>Qd(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(`beforeTransaction`,this.handleBeforeTransaction)}destroy(){this.editor.off(`beforeTransaction`,this.handleBeforeTransaction)}liveWidgetKeys(){return Dd.getState(this.editor.state)?.widgetKeys??ef}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new M({key:Dd,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:a}of t){let{set:t,widgetKeys:o}=this.buildFullSet(e,a,n);r[e]=t,i[e]=o}let a={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:Zd(i)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,i,a)=>{let o=n.getMeta(Dd),s=o?.type===`force`&&!o.name,c=o?.type===`force`?o.name:void 0,l={},u={},d=new Set;return Nd(e,()=>{for(let{name:o,spec:f}of t){let t=s||c===o;if(!$d(f,{editor:e,tr:n,oldState:i,newState:a},t)){let e=Yd(o,r,n);l[o]=e.set,u[o]=e.widgetKeys}else if(f.update===`changedRanges`&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(o,f,r,n,a);l[o]=e.set,u[o]=e.widgetKeys,d.add(o)}else{let{set:e,widgetKeys:t}=this.buildFullSet(o,f,a);l[o]=e,u[o]=t,d.add(o)}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:l,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:l,recomputedNames:d}),widgetKeys:Zd(u)}}},props:{decorations(e){return Dd.getState(e)?.mergedDecorationSet??V.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let a=qd(r,i.doc);return a.type===`full`?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,a.ranges)}rebuildRanges(e,t,n,r,i,a){let o=n.decorationSetsByExtension[e]??V.empty,s=new Set(n.widgetKeysByExtension[e]??[]),c=Jd(o,r.mapping,r.doc,s),l=i.doc.content.size;for(let{from:n,to:r}of a){let a=c.find(n,r).filter(e=>Bd({position:e.from,from:n,to:r,docSize:l}));for(let e of a){let t=Hd(e);t&&s.delete(t)}c=c.remove(a);let{decorations:o,widgetKeys:u}=Rd(Vd({decorations:this.runCreate(e,`createInRange`,()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:l,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(i.doc,o);for(let e of u)s.add(e)}return{set:c,widgetKeys:s}}buildFullSet(e,t,n){let r=this.runCreate(e,`create`,()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return zd(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!Id)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=Ud(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(`, `);console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${n.size===1?``:`s`} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:Xd(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):Xd(n.doc,r)}};function nf(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof j){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function rf(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function af(e){return typeof e==`number`}function of(e){return Object.prototype.toString.call(e).slice(8,-1)}function sf(e){return of(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function cf(e,t,n){let r=e.split(` -`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let d=t.extractItemData(u),{indentLevel:f,mainContent:p}=d;a=`${a}${e}\n`;let m=[p];for(o+=1;oe.trim()!==``);if(t===-1)break;if((((l=r[o+1+t].match(/^(\s*)/))==null||(l=l[1])==null?void 0:l.length)||0)>f){m.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((((c=e.match(/^(\s*)/))==null||(c=c[1])==null?void 0:c.length)||0)>f)m.push(e),a=`${a}${e}\n`,o+=1;else break}let h,g=m.slice(1);if(g.length>0){let e=g.map(e=>e.slice(f+s)).join(` -`);e.trim()&&(h=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a}}var lf=4;function uf(e){let t=0;for(let n of e)t=n===` `?t+lf-t%lf:t+1;return t}function df(e,t,n,r,i){if(!e||!Array.isArray(e.content))return``;let a=typeof n==`function`?n(r):n,[o,...s]=e.content,c=`${a}${t.renderChildren([o])}`;return s&&s.length>0&&s.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=e=>{if(!i?.alignNestedToPrefix)return t.indent(e);let n=t.indent(``),r=uf(a);return(uf(n)>=r?n:` `.repeat(r))+e},o=r.split(` -`).map(e=>n(e||``)).join(` -`);c+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),c}function ff(e,t){let n={...e};return sf(e)&&sf(t)&&Object.keys(t).forEach(r=>{sf(t[r])&&sf(e[r])?n[r]=ff(e[r],t[r]):n[r]=t[r]}),n}function pf(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var mf=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},hf=(e,t)=>{if(ll(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function gf(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=Wu(c)+i;return a.forEach(e=>{if(l)return;let a=hf(u,e.find);if(!a)return;let d=a[0].length-i.length;if(d>0){let e=c.parentOffset-d;if(e<0||c.parent.textBetween(e,c.parentOffset)!==a[0].slice(0,d))return}let f=s.state.tr,p=Kc({state:s.state,transaction:f}),m={from:n-(a[0].length-i.length),to:r},{commands:h,chain:g,can:_}=new qc({editor:t,state:p});e.handler({state:p,range:m,match:a,commands:h,chain:g,can:_})!==null&&f.steps.length&&(e.undoable&&f.setMeta(o,{transform:f,from:n,to:r,text:i}),s.dispatch(f),l=!0)}),l}function _f(e){let{editor:t,rules:n}=e,r=new M({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:hu(w.from(e),a.schema);let{from:i}=s,o=i+e.length;gf({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return gf({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&gf({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?gf({editor:t,from:a.pos,to:a.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var vf=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...K(G(this,`addOptions`,{name:this.name}))}}get storage(){return{...K(G(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>ff(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},yf=class e extends vf{constructor(...e){super(...e),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},bf=class{constructor(e){this.find=e.find,this.handler=e.handler}},xf=(e,t,n)=>{if(ll(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Sf(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new qc({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{var f;if((f=e.type)!=null&&(f=f.spec)!=null&&f.code||!(e.isText||e.isTextblock||e.isInline))return;let p=e.content?.size??e.nodeSize??0,m=Math.max(r,t),h=Math.min(i,t+p);m>=h||xf(e.isText?e.text||``:e.textBetween(m-t,h-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=m+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var Cf=null,wf=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Tf(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr,l=Kc({state:e,transaction:c});if(Sf({editor:t,state:l,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})&&c.steps.length){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new M({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Cf=t)},i=()=>{Cf&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=Cf;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:hu(w.from(t),r.schema);let{from:n}=d,i=n+t.length,a=wf(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(af(p)&&m&&p!==m.b)return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var Ef=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=Au(e),this.schema=Du(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=G(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Hu(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=ku([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Hu(t.name,this.schema)},r=[],i=G(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&G(t,`exitable`,n)&&(a.ArrowRight=()=>yf.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=Wc(a);r.push(o);let s=G(t,`addInputRules`,n);if(Yu(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=_f({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=G(t,`addPasteRules`,n);if(Yu(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Tf({editor:e,rules:t});r.push(...n)}}let l=G(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;(e=this.decorationManager)==null||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=G(e,`addDecorations`,{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:Hu(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new tf({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return yu(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=vu(this.extensions);return Object.fromEntries(t.filter(e=>!!G(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=G(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:W(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=Su(r,n);return i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return ku([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Hu(n.name,this.schema)},i=G(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return ku([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Hu(n.name,this.schema)},i=G(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=vu(this.extensions);return Object.fromEntries(t.filter(e=>!!G(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=G(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:ml(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=Su(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{pf(i,e,t)}})}]:[]}))}destroy(){var e;(e=this.decorationManager)==null||e.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Hu(e.name,this.schema)};e.type===`mark`&&((K(G(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(K(G(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=G(e,`onBeforeCreate`,t),r=G(e,`onCreate`,t),i=G(e,`onUpdate`,t),a=G(e,`onSelectionUpdate`,t),o=G(e,`onTransaction`,t),s=G(e,`onFocus`,t),c=G(e,`onBlur`,t),l=G(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};Ef.resolve=Au,Ef.sort=ku,Ef.flatten=mu;var J=class e extends vf{constructor(...e){super(...e),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Df=J.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new M({key:new N(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=Nu(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>ju(r,{from:e.pos,to:t.pos},s)).join(o??` - -`)}}})]}}),Of=J.create({name:`commands`,addCommands(){return{...jd}}}),kf=J.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){var n;let r=()=>{var n,r;if(((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null||(r=n.filterTransaction)==null?void 0:r.call(n,e))??e.getMeta(`y-sync$`))return;let i=uu(e.before,[e,...t]);Ru(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter&&i.mapping.mapResult(t.oldRange.to).deletedBefore&&i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let a=r+n.nodeSize-2,o=t.oldRange.from<=r&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:r,to:a,newFrom:i.mapping.map(r),newTo:i.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:i})})});let a=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof an){let r=a.slice(n).map(t.from,-1),o=a.slice(n).map(t.to),s=a.invert().map(r,-1),c=a.invert().map(o),l=r>0&&i.doc.nodeAt(r-1)?.marks.some(e=>e.eq(t.mark)),u=i.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:r,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:i})}})};((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null?void 0:n.async)??!0?setTimeout(r,0):r()}}),Af=J.create({name:`drop`,addProseMirrorPlugins(){return[new M({key:new N(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),jf=J.create({name:`editable`,addProseMirrorPlugins(){return[new M({key:new N(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),Mf=new N(`focusEvents`),Nf=J.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new M({key:Mf,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),Pf=J.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:k.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return xl()||Ul()?i:r},addProseMirrorPlugins(){return[new M({key:new N(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=k.atStart(t.doc).from,l=k.atEnd(t.doc).to;if(a||o!==c||s!==l||!Zu(n.doc))return;let u=n.tr,d=Kc({state:n,transaction:u}),{commands:f}=new qc({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),Ff=J.create({name:`paste`,addProseMirrorPlugins(){return[new M({key:new N(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),If=J.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new M({key:new N(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),Lf=J.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=vu(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new M({key:new N(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),Rf=!1;function zf(e){if(Rf)return;Rf=!0;let t;try{t=cn.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof w||console.warn(`[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.`)}var Bf=class e{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Vf=`.ProseMirror { - position: relative; -} - -.ProseMirror { - word-wrap: break-word; - white-space: pre-wrap; - white-space: break-spaces; - -webkit-font-variant-ligatures: none; - font-variant-ligatures: none; - font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ -} - -.ProseMirror [contenteditable="false"] { - white-space: normal; -} - -.ProseMirror [contenteditable="false"] [contenteditable="true"] { - white-space: pre-wrap; -} - -.ProseMirror pre { - white-space: pre-wrap; -} - -img.ProseMirror-separator { - display: inline !important; - border: none !important; - margin: 0 !important; - width: 0 !important; - height: 0 !important; -} - -.ProseMirror-gapcursor { - display: none; - pointer-events: none; - position: absolute; - margin: 0; -} - -.ProseMirror-gapcursor:after { - content: ""; - display: block; - position: absolute; - top: -2px; - width: 20px; - border-top: 1px solid black; - animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; -} - -@keyframes ProseMirror-cursor-blink { - to { - visibility: hidden; - } -} - -.ProseMirror-hideselection *::selection { - background: transparent; -} - -.ProseMirror-hideselection *::-moz-selection { - background: transparent; -} - -.ProseMirror-hideselection * { - caret-color: transparent; -} - -.ProseMirror-focused .ProseMirror-gapcursor { - display: block; -}`,Hf=class extends Fd{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:ed,createMappablePosition:td},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=yl(t,this.options.autofocus);this.editorState=br.create({doc:t,schema:this.schema,selection:e||void 0})}zf(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():qc.createFakeChain()}can(){return this.commandManager?this.commandManager.can():qc.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=rf(Vf,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return Id&&!this.hasWarnedStaleDecorationRead&&Pd(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=gu(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[jf,Df.configure({blockSeparator:(e=this.options.coreExtensionOptions)==null||(e=e.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Of,Nf,Pf,If.configure({value:(t=this.options.coreExtensionOptions)==null||(t=t.tabindex)==null?void 0:t.value}),Af,Ff,kf,Lf.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!=`object`||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new Ef(n,this)}createCommandManager(){this.commandManager=new qc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=su(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(e.message))throw e;let t=su(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=br.create({doc:t,schema:this.schema,selection:yl(t,this.options.autofocus)||void 0}),this.emit(`contentError`,{editor:this,error:e,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),this.editorState.doc}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new Tc(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Fu(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Ku(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return hu(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=` - -`,textSerializers:n={}}=e||{};return Mu(this.state.doc,{blockSeparator:t,textSerializers:{...Nu(this.schema),...n}})}get isEmpty(){return Zu(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new Bf(t,this,!1,n)}get $doc(){return this.$pos(0)}};function Uf(e){return new mf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=K(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(zu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;ln.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function Wf(e){return new mf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=K(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Gf(e){return new mf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=K(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function Kf(e){return new mf({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=K(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&_n(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&kn(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var qf=e=>`touches`in e,Jf=class{constructor(e){var t;this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e!=null&&(t=e.options)!=null&&t.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,qf(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return rthis.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},Yf=class e extends vf{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Xf(e){return new bf({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=K(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(zu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;dn.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}function Zf(e){return g((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var Qf=class extends Hf{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=Zf(this.view.state),this.reactiveExtensionStorage=Zf(this.extensionStorage),this.on(`beforeTransaction`,({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),f(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){let n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){let t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},$f=m({name:`EditorContent`,props:{editor:{default:null,type:Object}},setup(e){let t=y(),n=i();return o(()=>{let r=e.editor;r&&r.options.element&&t.value&&ee(()=>{if(!t.value||!r.view.dom?.parentNode)return;let e=a(t.value);t.value.append(...r.view.dom.parentNode.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:e}),r.createNodeViews()})}),p(()=>{let t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:t}},render(){return t(`div`,{ref:e=>{this.rootEl=e}})}});m({name:`NodeViewContent`,props:{as:{type:String,default:`div`}},inject:{nodeViewContentRef:{default:void 0}},mounted(){let e=this.nodeViewContentRef;e&&this.$el&&e(this.$el)},beforeUnmount(){let e=this.nodeViewContentRef;e&&e(null)},render(){return t(this.as,{style:{whiteSpace:`pre-wrap`},"data-node-view-content":``})}}),m({name:`NodeViewWrapper`,props:{as:{type:String,default:`div`}},inject:[`onDragStart`,`decorationClasses`],render(){var e;return t(this.as,{class:this.decorationClasses,style:{whiteSpace:`normal`},"data-node-view-wrapper":``,onDragstart:this.onDragStart},(e=this.$slots).default?.call(e))}});var ep=(e={})=>{let t=b();return d(()=>{t.value=new Qf(e)}),p(()=>{var e;(e=t.value)==null||e.destroy()}),t};m({name:`MarkViewContent`,props:{as:{type:String,default:`span`}},render(){return t(this.as,{style:{whiteSpace:`inherit`},"data-mark-view-content":``})}});var tp=new WeakSet,np=new WeakSet;function rp(e){let t=e;return tp.add(t),t}function ip(e){return Array.isArray(e)&&tp.has(e)}function ap(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&np.has(e)&&!ip(e)?ap(e):[e])}function op(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!ip(n)&&!np.has(n)?rp(n):n}let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);if(Array.isArray(n)){if(ip(n))return rp([e,r,n]);if(n.length===0)return rp([e,r]);let t=ap(n);return t.length===0?rp([e,r]):rp([e,r,...t])}return rp(n==null?[e,r]:[e,r,n])}var sp=(e,t)=>op(e,t),cp=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new E(n,0,0);return e.replace(l,i.after(),r),e.setSelection(A.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},lp=/^\s*>\s$/,up=Yf.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return sp(`blockquote`,{...q(this.options.HTMLAttributes,e),children:sp(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(` -`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(` -`))}),n.join(` -> -`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>cp(this.editor,this.type)}},addInputRules(){return[Kf({find:lp,type:this.type})]}}),dp=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,fp=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,pp=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,mp=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,hp=yf.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return sp(`strong`,{...q(this.options.HTMLAttributes,e),children:sp(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:``,close:``}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Uf({find:dp,type:this.type}),Uf({find:pp,type:this.type})]},addPasteRules(){return[Xf({find:fp,type:this.type}),Xf({find:mp,type:this.type})]}}),gp=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},_p=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},vp=yf.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,q(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:``,addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Uf({find:gp,type:this.type})]},addPasteRules(){return[Xf({find:_p,type:this.type})]}}),yp=4,bp=/^```([a-z]+)?[\s\n]$/,xp=/^~~~([a-z]+)?[\s\n]$/,Sp=Yf.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:yp,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,q(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(` -`):`\`\`\`${r}\n\n\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??yp,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,` -`,` -`).split(` -`).map(e=>o+e).join(` -`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??yp,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,` -`,` -`).split(` -`),c=0,l=0,u=r-a;for(let e=0;e=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,` -`,` -`).split(` -`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(` -`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(` - -`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(k.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[Gf({find:bp,type:this.type,getAttributes:e=>({language:e[1]})}),Gf({find:xp,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new M({key:new N(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,` -`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(A.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),Cp=Yf.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` - -`):``}),wp=Yf.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,q(this.options.HTMLAttributes,e)]},renderText(){return` -`},renderMarkdown:()=>` -`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Tp=Yf.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,q(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Gf({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),Ep=Yf.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,q(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!nf(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return Qu(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(A.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(j.create(t.doc,n.pos)):t.setSelection(A.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(A.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Wf({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Dp=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Op=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,kp=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Ap=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,jp=yf.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,q(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:``,close:``}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Uf({find:Dp,type:this.type}),Uf({find:kp,type:this.type})]},addPasteRules(){return[Xf({find:Op,type:this.type}),Xf({find:Ap,type:this.type})]}}),Mp=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Np=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,Pp=`numeric`,Fp=`ascii`,Ip=`alpha`,Lp=`asciinumeric`,Rp=`alphanumeric`,zp=`domain`,Bp=`emoji`,Vp=`scheme`,Hp=`slashscheme`,Up=`whitespace`;function Wp(e,t){return e in t||(t[e]=[]),t[e]}function Gp(e,t,n){t[Pp]&&(t[Lp]=!0,t[Rp]=!0),t[Fp]&&(t[Lp]=!0,t[Ip]=!0),t[Lp]&&(t[Rp]=!0),t[Ip]&&(t[Rp]=!0),t[Rp]&&(t[zp]=!0),t[Bp]&&(t[zp]=!0);for(let r in t){let t=Wp(r,n);t.indexOf(e)<0&&t.push(e)}}function Kp(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function qp(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}qp.groups={},qp.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;ne.ta(t,n,r,i),X=(e,t,n,r,i)=>e.tr(t,n,r,i),Jp=(e,t,n,r,i)=>e.ts(t,n,r,i),Z=(e,t,n,r,i)=>e.tt(t,n,r,i),Yp=`WORD`,Xp=`UWORD`,Zp=`ASCIINUMERICAL`,Qp=`ALPHANUMERICAL`,$p=`LOCALHOST`,em=`TLD`,tm=`UTLD`,nm=`SCHEME`,rm=`SLASH_SCHEME`,im=`NUM`,am=`WS`,om=`NL`,sm=`OPENBRACE`,cm=`CLOSEBRACE`,lm=`OPENBRACKET`,um=`CLOSEBRACKET`,dm=`OPENPAREN`,fm=`CLOSEPAREN`,pm=`OPENANGLEBRACKET`,mm=`CLOSEANGLEBRACKET`,hm=`FULLWIDTHLEFTPAREN`,gm=`FULLWIDTHRIGHTPAREN`,_m=`LEFTCORNERBRACKET`,vm=`RIGHTCORNERBRACKET`,ym=`LEFTWHITECORNERBRACKET`,bm=`RIGHTWHITECORNERBRACKET`,xm=`FULLWIDTHLESSTHAN`,Sm=`FULLWIDTHGREATERTHAN`,Cm=`AMPERSAND`,wm=`APOSTROPHE`,Tm=`ASTERISK`,Em=`AT`,Dm=`BACKSLASH`,Om=`BACKTICK`,km=`CARET`,Am=`COLON`,jm=`COMMA`,Mm=`DOLLAR`,Nm=`DOT`,Pm=`EQUALS`,Fm=`EXCLAMATION`,Im=`HYPHEN`,Lm=`PERCENT`,Rm=`PIPE`,zm=`PLUS`,Bm=`POUND`,Vm=`QUERY`,Hm=`QUOTE`,Um=`FULLWIDTHMIDDLEDOT`,Wm=`SEMI`,Gm=`SLASH`,Km=`TILDE`,qm=`UNDERSCORE`,Jm=`EMOJI`,Ym=`SYM`,Xm=Object.freeze({__proto__:null,ALPHANUMERICAL:Qp,AMPERSAND:Cm,APOSTROPHE:wm,ASCIINUMERICAL:Zp,ASTERISK:Tm,AT:Em,BACKSLASH:Dm,BACKTICK:Om,CARET:km,CLOSEANGLEBRACKET:mm,CLOSEBRACE:cm,CLOSEBRACKET:um,CLOSEPAREN:fm,COLON:Am,COMMA:jm,DOLLAR:Mm,DOT:Nm,EMOJI:Jm,EQUALS:Pm,EXCLAMATION:Fm,FULLWIDTHGREATERTHAN:Sm,FULLWIDTHLEFTPAREN:hm,FULLWIDTHLESSTHAN:xm,FULLWIDTHMIDDLEDOT:Um,FULLWIDTHRIGHTPAREN:gm,HYPHEN:Im,LEFTCORNERBRACKET:_m,LEFTWHITECORNERBRACKET:ym,LOCALHOST:$p,NL:om,NUM:im,OPENANGLEBRACKET:pm,OPENBRACE:sm,OPENBRACKET:lm,OPENPAREN:dm,PERCENT:Lm,PIPE:Rm,PLUS:zm,POUND:Bm,QUERY:Vm,QUOTE:Hm,RIGHTCORNERBRACKET:vm,RIGHTWHITECORNERBRACKET:bm,SCHEME:nm,SEMI:Wm,SLASH:Gm,SLASH_SCHEME:rm,SYM:Ym,TILDE:Km,TLD:em,UNDERSCORE:qm,UTLD:tm,UWORD:Xp,WORD:Yp,WS:am}),Zm=/[a-z]/,Qm=/\p{L}/u,$m=/\p{Emoji}/u,eh=/\d/,th=/\s/,nh=`\r`,rh=` -`,ih=`️`,ah=`‍`,oh=``,sh=null,ch=null;function lh(e=[]){let t={};qp.groups=t;let n=new qp;sh??=ph(Mp),ch??=ph(Np),Z(n,`'`,wm),Z(n,`{`,sm),Z(n,`}`,cm),Z(n,`[`,lm),Z(n,`]`,um),Z(n,`(`,dm),Z(n,`)`,fm),Z(n,`<`,pm),Z(n,`>`,mm),Z(n,`(`,hm),Z(n,`)`,gm),Z(n,`「`,_m),Z(n,`」`,vm),Z(n,`『`,ym),Z(n,`』`,bm),Z(n,`<`,xm),Z(n,`>`,Sm),Z(n,`&`,Cm),Z(n,`*`,Tm),Z(n,`@`,Em),Z(n,"`",Om),Z(n,`^`,km),Z(n,`:`,Am),Z(n,`,`,jm),Z(n,`$`,Mm),Z(n,`.`,Nm),Z(n,`=`,Pm),Z(n,`!`,Fm),Z(n,`-`,Im),Z(n,`%`,Lm),Z(n,`|`,Rm),Z(n,`+`,zm),Z(n,`#`,Bm),Z(n,`?`,Vm),Z(n,`"`,Hm),Z(n,`/`,Gm),Z(n,`;`,Wm),Z(n,`~`,Km),Z(n,`_`,qm),Z(n,`\\`,Dm),Z(n,`・`,Um);let r=X(n,eh,im,{[Pp]:!0});X(r,eh,r);let i=X(r,Zm,Zp,{[Lp]:!0}),a=X(r,Qm,Qp,{[Rp]:!0}),o=X(n,Zm,Yp,{[Fp]:!0});X(o,eh,i),X(o,Zm,o),X(i,eh,i),X(i,Zm,i);let s=X(n,Qm,Xp,{[Ip]:!0});X(s,Zm),X(s,eh,a),X(s,Qm,s),X(a,eh,a),X(a,Zm),X(a,Qm,a);let c=Z(n,rh,om,{[Up]:!0}),l=Z(n,nh,am,{[Up]:!0}),u=X(n,th,am,{[Up]:!0});Z(n,oh,u),Z(l,rh,c),Z(l,oh,u),X(l,th,u),Z(u,nh),Z(u,rh),X(u,th,u),Z(u,oh,u);let d=X(n,$m,Jm,{[Bp]:!0});Z(d,`#`),X(d,$m,d),Z(d,ih,d);let f=Z(d,ah);Z(f,`#`),X(f,$m,d);let p=[[Zm,o],[eh,i]],m=[[Zm,null],[Qm,s],[eh,a]];for(let e=0;ee[0]>t[0]?1:-1);for(let t=0;t=0?i[zp]=!0:Zm.test(r)?eh.test(r)?i[Lp]=!0:i[Fp]=!0:i[Pp]=!0,Jp(n,r,r,i)}return Jp(n,`localhost`,$p,{ascii:!0}),n.jd=new qp(Ym),{start:n,tokens:Object.assign({groups:t},Xm)}}function uh(e,t){let n=dh(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function dh(e){let t=[],n=e.length,r=0;for(;r56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function fh(e,t,n,r,i){let a,o=t.length;for(let n=0;n=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var mh={defaultProtocol:`http`,events:null,format:gh,formatHref:gh,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function hh(e,t=null){let n=Object.assign({},mh);e&&(n=Object.assign(n,e instanceof hh?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;en?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=mh.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function vh(e,t){class n extends _h{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var yh=vh(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),bh=vh(`text`),xh=vh(`nl`),Sh=vh(`url`,{isLink:!0,toHref(e=mh.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==$p&&e[1].t===Am}}),Ch=e=>new qp(e);function wh({groups:e}){let t=e.domain.concat([Cm,Tm,Em,Dm,Om,km,Mm,Pm,Im,im,Lm,Rm,zm,Bm,Gm,Ym,Km,qm]),n=[wm,Am,jm,Nm,Fm,Lm,Vm,Hm,Wm,pm,mm,sm,cm,um,lm,dm,fm,hm,gm,_m,vm,ym,bm,xm,Sm],r=[Cm,wm,Tm,Dm,Om,km,Mm,Pm,Im,sm,cm,Lm,Rm,zm,Bm,Vm,Gm,Ym,Km,qm],i=Ch(),a=Z(i,Km);Y(a,r,a),Y(a,e.domain,a);let o=Ch(),s=Ch(),c=Ch();Y(i,e.domain,o),Y(i,e.scheme,s),Y(i,e.slashscheme,c),Y(o,r,a),Y(o,e.domain,o);let l=Z(o,Em);Z(a,Em,l),Z(s,Em,l),Z(c,Em,l);let u=Z(a,Nm);Y(u,r,a),Y(u,e.domain,a);let d=Ch();Y(l,e.domain,d),Y(d,e.domain,d);let f=Z(d,Nm);Y(f,e.domain,d);let p=Ch(yh);Y(f,e.tld,p),Y(f,e.utld,p),Z(l,$p,p);let m=Z(d,Im);Z(m,Im,m),Y(m,e.domain,d),Y(p,e.domain,d),Z(p,Nm,f),Z(p,Im,m);let h=Z(o,Im),g=Z(o,Nm);Z(h,Im,h),Y(h,e.domain,o),Y(g,r,a),Y(g,e.domain,o);let _=Ch(Sh);Y(g,e.tld,_),Y(g,e.utld,_),Y(_,e.domain,o),Y(_,r,a),Z(_,Nm,g),Z(_,Im,h),Z(_,Em,l);let ee=Z(_,Am),v=Ch(Sh);Y(ee,e.numeric,v);let y=Ch(Sh),b=Ch();Y(y,t,y),Y(y,n,b),Y(b,t,y),Y(b,n,b),Z(_,Gm,y),Z(v,Gm,y);let x=Z(s,Am),te=Z(Z(Z(c,Am),Gm),Gm);Y(s,e.domain,o),Z(s,Nm,g),Z(s,Im,h),Y(c,e.domain,o),Z(c,Nm,g),Z(c,Im,h),Y(x,e.domain,y),Z(x,Gm,y),Z(x,Vm,y),Y(te,e.domain,y),Y(te,t,y),Z(te,Gm,y);let ne=[[sm,cm],[lm,um],[dm,fm],[pm,mm],[hm,gm],[_m,vm],[ym,bm],[xm,Sm]];for(let e=0;e=0&&f++,i++,u++;if(f<0)i-=u,i0&&(a.push(Eh(bh,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(Eh(e,t,r))}}return o.length>0&&a.push(Eh(bh,t,o)),a}function Eh(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var Dh=typeof console<`u`&&console&&console.warn||(()=>{}),Oh=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,Q={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function kh(){return qp.groups={},Q.scanner=null,Q.parser=null,Q.tokenQueue=[],Q.pluginQueue=[],Q.customSchemes=[],Q.initialized=!1,Q}function Ah(e,t=!1){if(Q.initialized&&Dh(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Oh}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format. -1. Must only contain digits, lowercase ASCII letters or "-" -2. Cannot start or end with "-" -3. "-" cannot repeat`);Q.customSchemes.push([e,t])}function jh(){Q.scanner=lh(Q.customSchemes);for(let e=0;e{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(Ru(uu(n.doc,[...t])).forEach(({newRange:t})=>{let n=du(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!Ih.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(Fh).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=Mh(n).map(t=>t.toObject(e.defaultProtocol));if(!Rh(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{zu(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function Bh(e){return new M({key:new N(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=Fu(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}var Vh=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,Hh=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function Uh(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;--r)n+=1;return n%2==1}function Wh(e,t){let n=0,r=0;for(;r0}function Gh(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||Uh(e,t.index??0)||Wh(e,t.index??0)?!1:!!r.trim()&&n(i)}function Kh(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function qh(e,t){return e.index{let n=Vh.exec(t);return!n||!Gh(t,n,e.isAllowedHref)?null:Kh(n)},type:e.type,getAttributes:Jh});return new mf({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function Xh(e){let t=Xf({find:t=>{let n=[];for(let r of t.matchAll(Hh))Gh(t,r,e.isAllowedHref)&&n.push(Kh(r));let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>qh(t,e)));return[...n,...r]},type:e.type,getAttributes:Jh});return new bf({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.match.data?.markdown&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function Zh(e){return new M({key:new N(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=Nh(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function Qh(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(Lh,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var $h=yf.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e==`string`){Ah(e);return}Ah(e.scheme,e.optionalSlashes)})},onDestroy(){kh()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!Qh(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target??null},rel:{default:this.options.HTMLAttributes.rel??null},class:{default:this.options.HTMLAttributes.class??null},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!Qh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!Qh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,q(this.options.HTMLAttributes,e),0]:[`a`,q(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!Qh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!Qh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addInputRules(){return this.options.markdownLinks?[Yh({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!Qh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;Nh(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!Qh(e,n),protocols:n,defaultProtocol:r})).forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t};return this.options.markdownLinks?[Xh({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!Qh(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[Xf({find:e,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(zh({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!Qh(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(Bh({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Zh({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),eg=`listItem`,tg=`textStyle`,ng=/^\s*([-+*])\s$/,rg=Yf.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,q(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` -`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eg,this.editor.getAttributes(tg)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Kf({find:ng,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Kf({find:ng,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(tg),editor:this.editor})),[e]}}),ig=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},ag=(e,t,n,r)=>{let i=ig(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,w.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},og=(e,t,n)=>ag(e.state,e.view.dispatch,t,n),sg=(e,t)=>J.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>og(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),cg=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],lg=`abcdefghijklmnopqrstuvwxyz`,ug=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function dg(e){let t=e,n=``;for(let[e,r]of cg)for(;t>=e;)n+=r,t-=e;return n}function fg(e){return dg(e).toUpperCase()}function pg(e){let t=e.toLowerCase(),n=0,r=0;for(;n0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function yg(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return gg(t);case`A`:return gg(t).toUpperCase();case`i`:return dg(t);case`I`:return fg(t);default:return String(t)}}function bg(e){if(e.length===0)return!1;let t=_g(e[0])??`numeric`,n=vg(e[0]);if(n<1)return!1;for(let r=0;r{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(wg(e))return{type:`listItem`,content:[{type:`paragraph`,content:Tg(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>df(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){var t,n;let r=((t=e.meta)==null||(t=t.parentAttrs)==null?void 0:t.start)||1;return Cg((n=e.meta)==null||(n=n.parentAttrs)==null?void 0:n.type,r-1+(e.index||0),`. `)}return`- `},n,{alignNestedToPrefix:n?.parentType===`orderedList`}),addExtensions(){return[sg(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Dg=(e,t)=>{let{$from:n}=t.selection,r=W(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},Og=(e,t)=>{let n=Dg(e,t);if(!n)return!1;let[,r]=Bu(t,e,n.$pos.pos+4);return r},kg=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},Ag=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Kl(e.state,t)&&kg(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!Kl(e.state,t)||!Ju(e.state))return!1;let{$from:r}=e.state.selection,i=r.depth-1;return r.node(i).type!==e.schema.nodes[t]||r.index(i)!==0?!1:e.chain().liftListItem(t).run()},jg=(e,t)=>{let n=Og(e,t),r=Dg(e,t);return!r||!n?!1:n>r.depth},Mg=(e,t)=>{let n=Og(e,t),r=Dg(e,t);return!r||!n?!1:n{if(!Kl(e.state,t)||!qu(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:jg(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Mg(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},Pg=(e,t,n)=>{let{state:r}=e,{selection:i}=r;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0||!a.parent.isTextblock||Kl(r,t))return!1;let o=Vu(a);if(!o||!n.includes(o.type.name))return!1;let s=o.lastChild;if(!s||s.type.name!==t)return!1;let c=a.parent;if(!s.canReplace(s.childCount,s.childCount,w.from(c)))return!1;let l=a.before(),u=a.after(),d=l-2;return e.commands.command(({tr:e,dispatch:t})=>(t&&(e.delete(l,u).insert(d,w.from(c)),e.setSelection(A.create(e.doc,d+1)),e.scrollIntoView()),!0))},Fg=J.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Ng(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Ng(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Ag(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Ag(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(let{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&Pg(e,t,n))return!0;return!1}}}}),Ig=RegExp(`^(\\s*)(${ug})([.)])\\s+(.*)$`),Lg=/^\s/,Rg={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function zg(e){return Ig.test(e.trimStart())}function Bg(e){let t=e.trimStart();return Rg.bulletItem.test(t)||zg(t)||Rg.heading.test(t)||Rg.thematicBreak.test(t)&&!t.startsWith(`-`)||/^>\s?/.test(t)||Rg.codeFence.test(t)||Rg.blockMath.test(t)}function Vg(e){return Object.values(Rg).some(t=>t.test(e))}function Hg(e){let t=[],n=[],r=!1;return e.forEach(e=>{if(r){n.push(e);return}if(e.trim()===``){r=!0,n.push(e);return}if(t.length>0&&Bg(e)){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}function Ug(e){let t=[],n=0,r=0;for(;ne.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(Wg);if(!t)return null;n.push({marker:t[1],content:t[3]})}return bg(n.map(e=>e.marker))?{type:`orderedList`,attrs:Sg(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function Kg(e,t,n){let r=[],i=0;for(;it;)f.push(e[d]),d+=1;if(f.length>0){let e=Kg(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(` -`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function qg(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var Jg=`listItem`,Yg=`textStyle`,Xg=/^(\d+)\.\s$/;function Zg(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var Qg=Yf.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=Zg(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=Zg(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=q(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?qg(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` -`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let r=e.split(` -`),[i,a]=Ug(r);if(i.length===0)return;let o=Kg(i,i[0].indent,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,typeMarker:i[0]?.type,items:o,raw:r.slice(0,a).join(` -`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Jg,this.editor.getAttributes(Yg)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new M({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=Gg(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=Kf({find:Xg,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Kf({find:Xg,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Yg)}),joinPredicate:e,editor:this.editor})),[t]}}),$g=/^\s*(\[([( |x])?\])\s$/,e_=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,t_=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)==null?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||`empty task item`}`},n_=Yf.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,q(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>df(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[sg(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`);o.style.cssText=e_;let l=e=>{let t=t_(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=Su(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[Kf({find:$g,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),r_=Yf.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,q(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,` -`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=cf(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=cf(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});J.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(rg.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(Eg.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Fg.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Qg.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(n_.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(r_.configure(this.options.taskList)),e}});var i_=` `,a_=`\xA0`,o_=Yf.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,q(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===i_||n[0].text===i_||n[0].raw===a_||n[0].text===a_)&&r.length===1&&r[0].type===`text`&&(r[0].text===i_||r[0].text===a_)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`&&e.length===0?i_:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),s_=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,c_=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,l_=yf.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,q(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Uf({find:s_,type:this.type})]},addPasteRules(){return[Xf({find:c_,type:this.type})]}}),u_=Yf.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),d_=yf.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,q(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function f_(e={}){return new M({view(t){return new p_(t,e)}})}var p_=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=Fn(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},m_=class e extends k{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):k.near(r)}content(){return E.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new h_(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!__(e)||!v_(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!j.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};m_.prototype.visible=!1,m_.findFrom=m_.findGapCursorFrom,k.jsonID(`gapcursor`,m_);var h_=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return m_.valid(t)?new m_(t):k.near(t)}};function g_(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function __(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||g_(e.type))return!0;if(e.inlineContent)return!1}}return!0}function v_(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||g_(e.type))return!0;if(e.inlineContent)return!1}}return!0}function y_(){return new M({props:{decorations:w_,createSelectionBetween(e,t,n){return t.pos==n.pos&&m_.valid(n)?new m_(n):null},handleClick:S_,handleKeyDown:b_,handleDOMEvents:{beforeinput:C_}}})}var b_=Gc({ArrowLeft:x_(`horiz`,-1),ArrowRight:x_(`horiz`,1),ArrowUp:x_(`vert`,-1),ArrowDown:x_(`vert`,1)});function x_(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof A){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=m_.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new m_(c))),!0):!1}}function S_(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!m_.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&j.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new m_(r))),!0)}function C_(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof m_))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=w.empty;for(let e=r.length-1;e>=0;e--)i=w.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new E(i,0,0));return a.setSelection(A.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function w_(e){if(!(e.selection instanceof m_))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,V.create(e.doc,[Ws.widget(e.selection.head,t,{key:`gapcursor`})])}var T_=200,$=function(){};$.prototype.append=function(e){return e.length?(e=$.from(e),!this.length&&e||e.length=t?$.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},$.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},$.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},$.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},$.from=function(e){return e instanceof $?e:e&&e.length?new E_(e):$.empty};var E_=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=T_)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=T_)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}($);$.empty=new E_([]);var D_=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return ei&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}($),O_=500,k_=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new j_(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new j_(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;eN_&&(s=A_(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new en;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new j_(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new j_(i,o,l))}else r.push(new j_(i))},i);let l=[];for(let e=n;eO_&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new j_(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e($.from(i.reverse()),a)}};k_.empty=new k_($.empty,0);function A_(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var j_=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},M_=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},N_=20;function P_(e,t,n,r){let i=n.getMeta(H_),a;if(i)return i.historyState;n.getMeta(U_)&&(e=new M_(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(H_))return o.getMeta(H_).redo?new M_(e.done.addTransform(n,void 0,r,V_(t)),e.undone,I_(n.mapping.maps),e.prevTime,e.prevComposition):new M_(e.done,e.undone.addTransform(n,void 0,r,V_(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!F_(n,e.prevRanges)),s=o?L_(e.prevRanges,n.mapping):I_(n.mapping.maps);return new M_(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,V_(t)),k_.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new M_(e.done.rebased(n,a),e.undone.rebased(n,a),L_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new M_(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),L_(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function F_(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i=t[i]&&(n=!0)}),n}function I_(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function L_(e,t){if(!e)return null;let n=[];for(let r=0;r{let i=H_.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=R_(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var K_=G_(!1,!0),q_=G_(!0,!0);J.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new M({key:new N(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var J_=J.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[f_(this.options)]}});J.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new M({key:new N(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return V.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(Ws.node(t,t+e.nodeSize,{class:this.options.className}))}),V.create(e,a)}}})]}});var Y_=J.create({name:`gapCursor`,addProseMirrorPlugins(){return[y_()]},extendNodeSchema(e){return{allowGapCursor:K(G(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),X_=`placeholder`,Z_=new N(`tiptap__placeholder`);function Q_(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),Ws.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function $_(e,t){return typeof e==`function`?e(t):e}function ev({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&Zu(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(Q_({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:$_(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function tv({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&Zu(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(Q_({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:$_(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...ev({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return V.create(r,o)}function nv(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function rv(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function iv(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;st&&r.push({from:a,to:o})}),r}function av(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;et.from?n.push(rv(e,nv(e,Math.min(t.to,e.content.size+1)-1))):t.frome.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=ev({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function uv({editor:e,options:t,dataAttribute:n}){return{init(r,i){return tv({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??V.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:lv({decorations:i.map(r.mapping,r.doc),ranges:sv(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function dv(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function fv({editor:e,options:t}){let n=t.dataAttribute?`data-${dv(t.dataAttribute)}`:`data-${X_}`,r=t.showOnlyCurrent&&!t.includeChildren;return new M({key:Z_,...r?{}:{state:uv({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>tv({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?V.empty:Z_.getState(n)??V.empty}})}var pv=J.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:X_,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[fv({editor:this.editor,options:this.options})]}});function mv(e,t){return!e.selection.empty&&!Qu(e.selection)&&t.isEditable}function hv(e,t){return mv(e,t)&&!t.isFocused&&!t.view.dragging}function gv(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function _v(e){e.focus()}J.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new M({key:new N(`selection`),props:{decorations(n){return hv(n,e)?V.create(n.doc,[Ws.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return mv(t.state,e)&&gv(),!1},focus(t){return mv(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&_v(t)}),!1}}}})]}});function vv({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var yv=J.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new N(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new M({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!vv({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!vv({node:r,types:n})}}})]}}),bv=J.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>K_(e,t),redo:()=>({state:e,dispatch:t})=>q_(e,t)}},addProseMirrorPlugins(){return[W_(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),xv=J.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(hp.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(up.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(rg.configure(this.options.bulletList)),this.options.code!==!1&&e.push(vp.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Sp.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Cp.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(J_.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Y_.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(wp.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Tp.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(bv.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Ep.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(jp.configure(this.options.italic)),this.options.listItem!==!1&&e.push(Eg.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Fg.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push($h.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(Qg.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(o_.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(l_.configure(this.options.strike)),this.options.text!==!1&&e.push(u_.configure(this.options.text)),this.options.underline!==!1&&e.push(d_.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(yv.configure(this.options?.trailingNode)),e}}),Sv=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Cv=Yf.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,q(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize,i=new Set([`src`,`width`,`height`]);return({node:a,getPos:o,HTMLAttributes:s,editor:c})=>{let l=document.createElement(`img`);l.draggable=!1;let u=q(this.options.HTMLAttributes,s);Object.entries(u).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:l.setAttribute(e,t)}}),u.src!==null&&(l.src=u.src);let d={...s},f=e=>{if(typeof e==`string`&&e!==``){l.getAttribute(`src`)!==e&&(l.src=e);return}l.hasAttribute(`src`)&&l.removeAttribute(`src`),l.src!==``&&(l.src=``)};f(s.src);let p=new Jf({element:l,editor:c,node:a,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==a.type)return!1;let t=Su(e,c.extensionManager.attributes.filter(t=>t.type===e.type.name));return Object.keys(d).forEach(e=>{!i.has(e)&&!(e in t)&&l.removeAttribute(e)}),Object.entries(t).forEach(([e,t])=>{i.has(e)||(t==null?l.removeAttribute(e):l.setAttribute(e,t))}),f(t.src),d=t,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=p.dom,h=()=>{m.style.visibility=``,m.style.pointerEvents=``};return m.style.visibility=`hidden`,m.style.pointerEvents=`none`,l.complete&&l.naturalWidth>0?h():(l.onload=h,l.onerror=h),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Wf({find:Sv,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),wv=e({default:()=>Ov}),Tv=[`disabled`],Ev=[`disabled`],Dv=[`disabled`],Ov={__name:`RichTextEditor`,props:{modelValue:{type:String,default:``},placeholder:{type:String,default:``},headings:{type:Array,default:()=>[2,3]},uploadImage:{type:Function,default:null},minHeight:{type:String,default:``},bordered:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(e,{expose:t,emit:i}){let o=e,d=i,f=ep({content:o.modelValue,extensions:[xv.configure({heading:{levels:o.headings},code:!1,codeBlock:!1,link:{openOnClick:!1,autolink:!0,protocols:[`mailto`,`tel`],HTMLAttributes:{rel:`noopener noreferrer`,target:null}}}),Cv.configure({HTMLAttributes:{loading:`lazy`}}),pv.configure({placeholder:o.placeholder})],editorProps:{attributes:{class:`prose prose-neutral max-w-none focus:outline-none prose-headings:tracking-tight prose-img:rounded-lg`}},onUpdate:({editor:e})=>d(`update:modelValue`,e.isEmpty?``:e.getHTML())});r(()=>o.modelValue,e=>{f.value&&e!==f.value.getHTML()&&!(e===``&&f.value.isEmpty)&&f.value.commands.setContent(e||``,{emitUpdate:!1})}),p(()=>f.value?.destroy()),t({focus:()=>f.value?.chain().focus(`end`).run()});let m=y(!1),g=y(``);function ee(){g.value=f.value.getAttributes(`link`).href??``,m.value=!0}function b(){let e=g.value.trim();e&&!/^(https?:\/\/|mailto:|tel:|\/|#)/i.test(e)&&(e=`https://${e}`);let t=f.value.chain().focus().extendMarkRange(`link`);(e?t.setLink({href:e}):t.unsetLink()).run(),m.value=!1}let S=y(null),ye=y(!1);async function be(e){let t=e.target.files?.[0];if(e.target.value=``,t&&o.uploadImage){ye.value=!0;try{let e=await o.uploadImage(t);f.value.chain().focus().setImage({src:e,alt:``}).run()}finally{ye.value=!1}}}let C=e=>[`grid size-8 place-items-center rounded-md transition-colors disabled:opacity-40`,e?`bg-brand-soft text-brand-soft-foreground`:`text-muted-foreground hover:bg-accent hover:text-foreground`];return(t,r)=>a(f)?(h(),u(`div`,{key:0,class:c([`group/rte`,e.bordered?`rounded-md border border-input bg-card shadow-xs focus-within:border-brand-400 focus-within:ring-3 focus-within:ring-ring/30`:``])},[l(`div`,{class:c([`flex flex-wrap items-center gap-0.5`,e.bordered?`border-b px-1.5 py-1`:`sticky top-0 z-10 -mx-1 mb-2 hidden rounded-md border bg-card px-1 py-0.5 shadow-sm group-focus-within/rte:flex`]),role:`toolbar`,"aria-label":`Textformatierung`,onMousedown:r[15]||=te(()=>{},[`prevent`])},[l(`button`,{type:`button`,class:c(C(a(f).isActive(`bold`))),title:`Fett (Strg+B)`,onClick:r[0]||=e=>a(f).chain().focus().toggleBold().run()},[n(a(ue),{class:`size-4`})],2),l(`button`,{type:`button`,class:c(C(a(f).isActive(`italic`))),title:`Kursiv (Strg+I)`,onClick:r[1]||=e=>a(f).chain().focus().toggleItalic().run()},[n(a(me),{class:`size-4`})],2),l(`button`,{type:`button`,class:c(C(a(f).isActive(`underline`))),title:`Unterstrichen (Strg+U)`,onClick:r[2]||=e=>a(f).chain().focus().toggleUnderline().run()},[n(a(_e),{class:`size-4`})],2),r[16]||=l(`span`,{class:`mx-1 h-5 w-px bg-border`},null,-1),e.headings.includes(2)?(h(),u(`button`,{key:0,type:`button`,class:c(C(a(f).isActive(`heading`,{level:2}))),title:`Zwischenüberschrift`,onClick:r[3]||=e=>a(f).chain().focus().toggleHeading({level:2}).run()},[n(a(de),{class:`size-4`})],2)):x(``,!0),e.headings.includes(3)?(h(),u(`button`,{key:1,type:`button`,class:c(C(a(f).isActive(`heading`,{level:3}))),title:`Kleine Überschrift`,onClick:r[4]||=e=>a(f).chain().focus().toggleHeading({level:3}).run()},[n(a(fe),{class:`size-4`})],2)):x(``,!0),l(`button`,{type:`button`,class:c(C(a(f).isActive(`bulletList`))),title:`Aufzählung`,onClick:r[5]||=e=>a(f).chain().focus().toggleBulletList().run()},[n(a(ce),{class:`size-4`})],2),l(`button`,{type:`button`,class:c(C(a(f).isActive(`orderedList`))),title:`Nummerierte Liste`,onClick:r[6]||=e=>a(f).chain().focus().toggleOrderedList().run()},[n(a(he),{class:`size-4`})],2),l(`button`,{type:`button`,class:c(C(a(f).isActive(`blockquote`))),title:`Zitat`,onClick:r[7]||=e=>a(f).chain().focus().toggleBlockquote().run()},[n(a(le),{class:`size-4`})],2),r[17]||=l(`span`,{class:`mx-1 h-5 w-px bg-border`},null,-1),l(`button`,{type:`button`,class:c(C(a(f).isActive(`link`))),title:`Link`,onClick:ee},[n(a(ie),{class:`size-4`})],2),a(f).isActive(`link`)?(h(),u(`button`,{key:2,type:`button`,class:c(C(!1)),title:`Link entfernen`,onClick:r[8]||=e=>a(f).chain().focus().unsetLink().run()},[n(a(ve),{class:`size-4`})],2)):x(``,!0),e.uploadImage?(h(),u(_,{key:3},[l(`button`,{type:`button`,class:c(C(!1)),title:`Bild einfügen`,disabled:ye.value,onClick:r[9]||=e=>S.value?.click()},[ye.value?(h(),v(a(re),{key:0,class:`size-4 animate-spin`})):(h(),v(a(pe),{key:1,class:`size-4`}))],10,Tv),l(`input`,{ref_key:`fileInput`,ref:S,type:`file`,accept:`image/jpeg,image/png,image/webp,image/gif`,class:`hidden`,onChange:be},null,544)],64)):x(``,!0),r[18]||=l(`span`,{class:`mx-1 h-5 w-px bg-border`},null,-1),l(`button`,{type:`button`,class:c(C(!1)),title:`Rückgängig`,disabled:!a(f).can().undo(),onClick:r[10]||=e=>a(f).chain().focus().undo().run()},[n(a(ae),{class:`size-4`})],10,Ev),l(`button`,{type:`button`,class:c(C(!1)),title:`Wiederholen`,disabled:!a(f).can().redo(),onClick:r[11]||=e=>a(f).chain().focus().redo().run()},[n(a(ge),{class:`size-4`})],10,Dv),m.value?(h(),u(`form`,{key:4,class:`flex w-full items-center gap-1 border-t px-1 pt-1.5 pb-1`,onSubmit:te(b,[`prevent`]),onMousedown:r[14]||=te(()=>{},[`stop`])},[s(l(`input`,{"onUpdate:modelValue":r[12]||=e=>g.value=e,type:`text`,placeholder:`https://… oder /seiten/…`,class:`h-8 min-w-0 flex-1 rounded-md border border-input bg-card px-2 text-sm focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/30`,"aria-label":`Adresse des Links`,autofocus:``},null,512),[[ne,g.value]]),l(`button`,{type:`submit`,class:c(C(!1)),title:`Übernehmen`},[n(a(oe),{class:`size-4`})],2),l(`button`,{type:`button`,class:c(C(!1)),title:`Abbrechen`,onClick:r[13]||=e=>m.value=!1},[n(a(se),{class:`size-4`})],2)],32)):x(``,!0)],34),n(a($f),{editor:a(f),class:c([e.bordered?`px-4 py-3`:``,e.minHeight])},null,8,[`editor`,`class`])],2)):x(``,!0)}};export{pe as i,Ov as n,ge as r,wv as t}; \ No newline at end of file diff --git a/public/build/assets/Sample-DoS7xL8V.js b/public/build/assets/Sample-CfzueD_V.js similarity index 84% rename from public/build/assets/Sample-DoS7xL8V.js rename to public/build/assets/Sample-CfzueD_V.js index c3ebf615..b26c339e 100644 --- a/public/build/assets/Sample-DoS7xL8V.js +++ b/public/build/assets/Sample-CfzueD_V.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,mt as i,qt as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{rt as s}from"./AppIcon-0N56IC2z.js";import{t as c}from"./AppLayout-BxsYt2ib.js";import{t as l}from"./button-ZHC5mKey.js";import{t as u}from"./Panel-BASB8Xb9.js";import{t as d}from"./Input-FGSb2-yK.js";import{t as f}from"./PageContent-bQ_WRrV_.js";var p={class:`grid gap-8 lg:grid-cols-[minmax(0,1fr)_320px]`},m={class:`min-w-0`},h={class:`grid content-start gap-6`},g={class:`grid gap-3`},_={class:`flex flex-wrap gap-2`},v={__name:`Sample`,props:{content:{type:Object,required:!0}},setup(v){return(y,b)=>(i(),o(c,{title:`Beispielseite`},{default:a(()=>[r(`div`,p,[r(`article`,m,[b[0]||=r(`p`,{class:`text-[11px] font-semibold tracking-wide text-accent2-text uppercase`},`Kategorie`,-1),b[1]||=r(`h1`,{class:`mt-1 mb-8 text-3xl font-semibold tracking-tight`},`Beispielseite`,-1),e(f,{content:v.content},null,8,[`content`])]),r(`aside`,h,[e(u,{title:`Bedienelemente`,"action-label":`Alle anzeigen`,"action-href":`#`},{default:a(()=>[r(`div`,g,[e(n(d),{placeholder:`Eingabefeld`}),r(`div`,_,[e(n(l),null,{default:a(()=>[...b[2]||=[t(`Primär`,-1)]]),_:1}),e(n(l),{variant:`outline`},{default:a(()=>[...b[3]||=[t(`Umrandet`,-1)]]),_:1}),e(n(l),{variant:`ghost`},{default:a(()=>[e(n(s)),b[4]||=t(` Symbol`,-1)]),_:1})])])]),_:1}),b[5]||=r(`section`,{class:`rounded-lg bg-brand p-5 text-brand-foreground`},[r(`p`,{class:`font-semibold`},`Fläche in der Markenfarbe`),r(`p`,{class:`mt-1 text-sm opacity-85`},`Zum Beispiel die Begrüßungskarte auf der Startseite.`)],-1)])])]),_:1}))}};export{v as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,mt as i,qt as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{rt as s}from"./AppIcon-nlhvQfK7.js";import{t as c}from"./AppLayout-esQiy2nD.js";import{n as l}from"./button-CwUSbS9X.js";import{t as u}from"./Panel-Dr-NcUuS.js";import{t as d}from"./Input-FGSb2-yK.js";import{t as f}from"./PageContent-22GSNgo9.js";var p={class:`grid gap-8 lg:grid-cols-[minmax(0,1fr)_320px]`},m={class:`min-w-0`},h={class:`grid content-start gap-6`},g={class:`grid gap-3`},_={class:`flex flex-wrap gap-2`},v={__name:`Sample`,props:{content:{type:Object,required:!0}},setup(v){return(y,b)=>(i(),o(c,{title:`Beispielseite`},{default:a(()=>[r(`div`,p,[r(`article`,m,[b[0]||=r(`p`,{class:`text-[11px] font-semibold tracking-wide text-accent2-text uppercase`},`Kategorie`,-1),b[1]||=r(`h1`,{class:`mt-1 mb-8 text-3xl font-semibold tracking-tight`},`Beispielseite`,-1),e(f,{content:v.content},null,8,[`content`])]),r(`aside`,h,[e(u,{title:`Bedienelemente`,"action-label":`Alle anzeigen`,"action-href":`#`},{default:a(()=>[r(`div`,g,[e(n(d),{placeholder:`Eingabefeld`}),r(`div`,_,[e(n(l),null,{default:a(()=>[...b[2]||=[t(`Primär`,-1)]]),_:1}),e(n(l),{variant:`outline`},{default:a(()=>[...b[3]||=[t(`Umrandet`,-1)]]),_:1}),e(n(l),{variant:`ghost`},{default:a(()=>[e(n(s)),b[4]||=t(` Symbol`,-1)]),_:1})])])]),_:1}),b[5]||=r(`section`,{class:`rounded-lg bg-brand p-5 text-brand-foreground`},[r(`p`,{class:`font-semibold`},`Fläche in der Markenfarbe`),r(`p`,{class:`mt-1 text-sm opacity-85`},`Zum Beispiel die Begrüßungskarte auf der Startseite.`)],-1)])])]),_:1}))}};export{v as default}; \ No newline at end of file diff --git a/public/build/assets/Search-BlIKvXB-.js b/public/build/assets/Search-BlIKvXB-.js deleted file mode 100644 index f43e2f66..00000000 --- a/public/build/assets/Search-BlIKvXB-.js +++ /dev/null @@ -1 +0,0 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,wt as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-Bu3kn8yd.js";import{k as h}from"./dist-DtGNiYlK.js";import{$ as g}from"./AppIcon-0N56IC2z.js";import{t as _}from"./AppLayout-BxsYt2ib.js";import{n as v,r as y}from"./format-uZU1H-69.js";import{t as b}from"./FileIcon-B6dfvt48.js";import{t as x}from"./search-x-BVofHEe_.js";import{t as S}from"./EmptyState-Ceq4v8mE.js";import{t as C}from"./PageHeader-Ybe7qDu5.js";import{t as w}from"./colors-RDOJqd57.js";import{t as T}from"./QmSearchBox-Ri1YCTQc.js";var E=h({name:`text-search`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M10 12H3`,key:`1ulcyk`}],[`path`,{d:`M10 19H3`,key:`108z41`}],[`circle`,{cx:`17`,cy:`15`,r:`3`,key:`1upz2a`}],[`path`,{d:`m21 19-1.9-1.9`,key:`dwi7p8`}]]}),D={key:0,class:`divide-y overflow-hidden rounded-lg border bg-card`},O={key:1,class:`grid size-10 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground`},k={class:`min-w-0 flex-1`},A={class:`flex flex-wrap items-baseline gap-x-2`},j={key:0,class:`text-xs text-muted-foreground`},M={class:`text-xs text-muted-foreground`},N=[`innerHTML`],P={key:1,class:`mt-1 inline-flex items-center gap-1 text-[11px] font-medium text-brand-text`},F={key:1,class:`rounded-lg border bg-card`},I={__name:`Search`,props:{query:{type:String,default:``},results:{type:Array,default:()=>[]}},setup(h){let I=(e,t)=>e.open_kind===`view`?`${e.open_url}?suche=${encodeURIComponent(t)}`:e.open_url;return(L,R)=>(s(),d(_,{title:`Suche: ${h.query}`},{default:l(()=>[e(C,{title:h.query?`Suche: ${h.query}`:`Suche`,breadcrumbs:[{label:`Qualitätsmanagement`,href:`/qm`}],description:h.query?`${h.results.length} ${h.results.length,`Treffer`} im Qualitätsmanagement – in Titeln und im Text der Dokumente`:``},{actions:l(()=>[(s(),d(T,{key:h.query,initial:h.query},null,8,[`initial`]))]),_:1},8,[`title`,`description`]),h.results.length?(s(),a(`ul`,D,[(s(!0),a(c,null,o(h.results,o=>(s(),a(`li`,{key:o.id,class:`flex gap-3 px-4 py-3.5 hover:bg-accent/40`},[o.type===`file`?(s(),d(b,{key:0,extension:o.extension},null,8,[`extension`])):(s(),a(`span`,O,[o.type===`form`?(s(),d(n(g),{key:0,class:`size-5`})):(s(),d(n(y),{key:1,class:`size-5`}))])),i(`div`,k,[i(`div`,A,[(s(),d(f(o.open_kind===`view`?n(m):`a`),{href:I(o,h.query),target:o.open_kind===`link`?`_blank`:void 0,class:`text-[15px] font-semibold hover:underline`},{default:l(()=>[t(u(o.title),1)]),_:2},1032,[`href`,`target`])),o.version?(s(),a(`span`,j,`Version `+u(o.version),1)):p(``,!0),i(`span`,M,`Stand `+u(n(v)(o.valid_from)),1)]),e(n(m),{href:o.folder.url,class:`mt-0.5 inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground hover:underline`},{default:l(()=>[i(`span`,{class:r([`size-2 rounded-sm`,n(w)(o.folder.color).dot])},null,2),t(u(o.folder.path),1)]),_:2},1032,[`href`]),o.snippet?(s(),a(`p`,{key:0,class:`qm-snippet mt-1.5 text-[13px] leading-relaxed text-muted-foreground`,innerHTML:o.snippet},null,8,N)):p(``,!0),o.in_content?(s(),a(`p`,P,[e(n(E),{class:`size-3`}),R[0]||=t(` im Text gefunden`,-1)])):p(``,!0)])]))),128))])):h.query?(s(),a(`div`,F,[e(S,{icon:n(x),title:`Nichts gefunden`,text:`Gesucht wird in Titeln, Beschreibungen, Dateinamen und im Text der Dokumente. Eingescannte PDFs sind nur durchsuchbar, wenn die Texterkennung eingerichtet ist.`},null,8,[`icon`])])):p(``,!0)]),_:1},8,[`title`]))}};export{I as default}; \ No newline at end of file diff --git a/public/build/assets/Search-DfTUuPsS.js b/public/build/assets/Search-DfTUuPsS.js new file mode 100644 index 00000000..779493a3 --- /dev/null +++ b/public/build/assets/Search-DfTUuPsS.js @@ -0,0 +1 @@ +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,mt as s,o as c,qt as l,tr as u,v as d,wt as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-BNwrc_lv.js";import{k as h}from"./dist-DtGNiYlK.js";import{$ as g}from"./AppIcon-nlhvQfK7.js";import{t as _}from"./AppLayout-esQiy2nD.js";import{t as v}from"./external-link-8-VtmLK9.js";import{t as y}from"./FileIcon-BctWLKDw.js";import{t as b}from"./search-x-BVofHEe_.js";import{t as x}from"./EmptyState-Ceq4v8mE.js";import{t as S}from"./PageHeader-BMzzCXfT.js";import{t as C}from"./colors-RDOJqd57.js";import{n as w}from"./format-20VMi8w8.js";import{t as T}from"./QmSearchBox-BW950raa.js";var E=h({name:`text-search`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M10 12H3`,key:`1ulcyk`}],[`path`,{d:`M10 19H3`,key:`108z41`}],[`circle`,{cx:`17`,cy:`15`,r:`3`,key:`1upz2a`}],[`path`,{d:`m21 19-1.9-1.9`,key:`dwi7p8`}]]}),D={key:0,class:`divide-y overflow-hidden rounded-lg border bg-card`},O={key:1,class:`grid size-10 shrink-0 place-items-center rounded-md bg-muted text-muted-foreground`},k={class:`min-w-0 flex-1`},A={class:`flex flex-wrap items-baseline gap-x-2`},j={key:0,class:`text-xs text-muted-foreground`},M={class:`text-xs text-muted-foreground`},N=[`innerHTML`],P={key:1,class:`mt-1 inline-flex items-center gap-1 text-[11px] font-medium text-brand-text`},F={key:1,class:`rounded-lg border bg-card`},I={__name:`Search`,props:{query:{type:String,default:``},results:{type:Array,default:()=>[]}},setup(h){let I=(e,t)=>e.open_kind===`view`?`${e.open_url}?suche=${encodeURIComponent(t)}`:e.open_url;return(L,R)=>(s(),d(_,{title:`Suche: ${h.query}`},{default:l(()=>[e(S,{title:h.query?`Suche: ${h.query}`:`Suche`,breadcrumbs:[{label:`Qualitätsmanagement`,href:`/qm`}],description:h.query?`${h.results.length} ${h.results.length,`Treffer`} im Qualitätsmanagement – in Titeln und im Text der Dokumente`:``},{actions:l(()=>[(s(),d(T,{key:h.query,initial:h.query},null,8,[`initial`]))]),_:1},8,[`title`,`description`]),h.results.length?(s(),a(`ul`,D,[(s(!0),a(c,null,o(h.results,o=>(s(),a(`li`,{key:o.id,class:`flex gap-3 px-4 py-3.5 hover:bg-accent/40`},[o.type===`file`?(s(),d(y,{key:0,extension:o.extension},null,8,[`extension`])):(s(),a(`span`,O,[o.type===`form`?(s(),d(n(g),{key:0,class:`size-5`})):(s(),d(n(v),{key:1,class:`size-5`}))])),i(`div`,k,[i(`div`,A,[(s(),d(f(o.open_kind===`view`?n(m):`a`),{href:I(o,h.query),target:o.open_kind===`link`?`_blank`:void 0,class:`text-[15px] font-semibold hover:underline`},{default:l(()=>[t(u(o.title),1)]),_:2},1032,[`href`,`target`])),o.version?(s(),a(`span`,j,`Version `+u(o.version),1)):p(``,!0),i(`span`,M,`Stand `+u(n(w)(o.valid_from)),1)]),e(n(m),{href:o.folder.url,class:`mt-0.5 inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground hover:underline`},{default:l(()=>[i(`span`,{class:r([`size-2 rounded-sm`,n(C)(o.folder.color).dot])},null,2),t(u(o.folder.path),1)]),_:2},1032,[`href`]),o.snippet?(s(),a(`p`,{key:0,class:`qm-snippet mt-1.5 text-[13px] leading-relaxed text-muted-foreground`,innerHTML:o.snippet},null,8,N)):p(``,!0),o.in_content?(s(),a(`p`,P,[e(n(E),{class:`size-3`}),R[0]||=t(` im Text gefunden`,-1)])):p(``,!0)])]))),128))])):h.query?(s(),a(`div`,F,[e(x,{icon:n(b),title:`Nichts gefunden`,text:`Gesucht wird in Titeln, Beschreibungen, Dateinamen und im Text der Dokumente. Eingescannte PDFs sind nur durchsuchbar, wenn die Texterkennung eingerichtet ist.`},null,8,[`icon`])])):p(``,!0)]),_:1},8,[`title`]))}};export{I as default}; \ No newline at end of file diff --git a/public/build/assets/Show-DWEMstwB.js b/public/build/assets/Show-BY2_D8bu.js similarity index 94% rename from public/build/assets/Show-DWEMstwB.js rename to public/build/assets/Show-BY2_D8bu.js index 8ce13da9..9d83e695 100644 --- a/public/build/assets/Show-DWEMstwB.js +++ b/public/build/assets/Show-BY2_D8bu.js @@ -1 +1 @@ -import{D as e,E as t,On as n,St as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-Bu3kn8yd.js";import{t as h}from"./AppLayout-BxsYt2ib.js";import{t as g}from"./calendar-clock-8H2IkjP5.js";import{t as _}from"./chevron-right-C9w5cb2q.js";import{t as v}from"./pencil-line-CmAbFj4f.js";import{n as y}from"./format-BsuBtvUs.js";import{t as b}from"./button-ZHC5mKey.js";import{t as x}from"./PageContent-bQ_WRrV_.js";var S={__name:`PageTreeNav`,props:{items:{type:Array,required:!0},current:{type:String,required:!0},depth:{type:Number,default:0}},setup(a){let h=(e,t)=>e.url===t||e.children.some(e=>h(e,t));return(g,_)=>{let v=r(`PageTreeNav`,!0);return c(),o(`ul`,{class:i([`grid gap-0.5`,a.depth?`mt-0.5 ml-3 border-l pl-2`:`mt-1`])},[(c(!0),o(l,null,s(a.items,r=>(c(),o(`li`,{key:r.id},[e(n(m),{href:r.url,class:i([`block rounded-md px-3 py-1.5 text-sm`,r.url===a.current?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-foreground/80 hover:bg-accent hover:text-foreground`]),"aria-current":r.url===a.current?`page`:void 0},{default:u(()=>[t(d(r.title),1)]),_:2},1032,[`href`,`class`,`aria-current`]),r.children.length&&h(r,a.current)?(c(),f(v,{key:0,items:r.children,current:a.current,depth:a.depth+1},null,8,[`items`,`current`,`depth`])):p(``,!0)]))),128))],2)}}},C={key:0,class:`hidden lg:block`},w={class:`sticky top-24 rounded-lg border bg-card p-2`,"aria-label":`Seiten in diesem Bereich`},T={key:0,class:`mb-3 flex flex-wrap items-center gap-1 text-[13px] text-muted-foreground`,"aria-label":`Brotkrumen`},E={class:`text-foreground`},D={class:`mb-8 flex flex-wrap items-start justify-between gap-4`},O={class:`min-w-0`},k={class:`text-3xl leading-tight font-semibold tracking-tight`},A={key:0,class:`mt-1.5 text-[13px] text-muted-foreground`},j={key:1,class:`mb-6 flex items-start gap-3 rounded-lg border border-brand-200 bg-brand-soft px-4 py-3 text-sm`},M={key:2,class:`rounded-lg border border-dashed px-6 py-12 text-center text-sm text-muted-foreground`},N={__name:`Show`,props:{page:{type:Object,required:!0},content:{type:Object,required:!0},breadcrumbs:{type:Array,default:()=>[]},section:{type:Object,required:!0},editor:{type:Object,default:null}},setup(r){let N=r.section.children.length>0;return(P,F)=>(c(),f(h,{title:r.page.title},{default:u(()=>[a(`div`,{class:i([`grid gap-8`,N?`lg:grid-cols-[260px_minmax(0,1fr)]`:``])},[N?(c(),o(`aside`,C,[a(`nav`,w,[e(n(m),{href:r.section.url,class:i([`block rounded-md px-3 py-2 text-sm font-semibold`,r.section.active?`bg-brand-soft text-brand-soft-foreground`:`hover:bg-accent`])},{default:u(()=>[t(d(r.section.title),1)]),_:1},8,[`href`,`class`]),e(S,{items:r.section.children,current:r.page.url},null,8,[`items`,`current`])])])):p(``,!0),a(`article`,{class:i([`min-w-0`,N?``:`mx-auto w-full max-w-5xl`])},[r.breadcrumbs.length?(c(),o(`nav`,T,[(c(!0),o(l,null,s(r.breadcrumbs,r=>(c(),o(l,{key:r.url},[e(n(m),{href:r.url,class:`hover:text-foreground hover:underline`},{default:u(()=>[t(d(r.title),1)]),_:2},1032,[`href`]),e(n(_),{class:`size-3.5`})],64))),128)),a(`span`,E,d(r.page.title),1)])):p(``,!0),a(`header`,D,[a(`div`,O,[a(`h1`,k,d(r.page.title),1),r.page.published_at?(c(),o(`p`,A,`Zuletzt aktualisiert am `+d(n(y)(r.page.published_at)),1)):p(``,!0)]),r.editor?(c(),f(n(b),{key:0,variant:`outline`,"as-child":``},{default:u(()=>[e(n(m),{href:r.editor.url},{default:u(()=>[e(n(v)),F[0]||=t(` Bearbeiten`,-1)]),_:1},8,[`href`])]),_:1})):p(``,!0)]),r.editor&&(!r.page.is_published||r.editor.has_draft||r.editor.scheduled_at)?(c(),o(`div`,j,[r.editor.scheduled_at?(c(),f(n(g),{key:0,class:`mt-0.5 size-4 shrink-0 text-brand-text`})):(c(),f(n(v),{key:1,class:`mt-0.5 size-4 shrink-0 text-brand-text`})),a(`p`,null,[r.page.is_published?r.editor.scheduled_at?(c(),o(l,{key:1},[t(`Eine neue Fassung wird am `+d(new Date(r.editor.scheduled_at).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`}))+` veröffentlicht.`,1)],64)):(c(),o(l,{key:2},[t(`Es gibt unveröffentlichte Änderungen an dieser Seite.`)],64)):(c(),o(l,{key:0},[t(`Diese Seite ist noch nicht veröffentlicht. Nur Redakteure sehen sie.`)],64)),e(n(m),{href:r.editor.url,class:`ml-1 font-medium text-brand-text hover:underline`},{default:u(()=>[...F[1]||=[t(`Im Editor öffnen`,-1)]]),_:1},8,[`href`])])])):p(``,!0),e(x,{content:r.content},null,8,[`content`]),r.content.blocks.length?p(``,!0):(c(),o(`p`,M,`Diese Seite hat noch keinen Inhalt.`))],2)],2)]),_:1},8,[`title`]))}};export{N as default}; \ No newline at end of file +import{D as e,E as t,On as n,St as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as m}from"./app-BNwrc_lv.js";import{t as h}from"./AppLayout-esQiy2nD.js";import{t as g}from"./calendar-clock-8H2IkjP5.js";import{t as _}from"./chevron-right-C9w5cb2q.js";import{t as v}from"./pencil-line-CmAbFj4f.js";import{n as y}from"./format-BsuBtvUs.js";import{n as b}from"./button-CwUSbS9X.js";import{t as x}from"./PageContent-22GSNgo9.js";var S={__name:`PageTreeNav`,props:{items:{type:Array,required:!0},current:{type:String,required:!0},depth:{type:Number,default:0}},setup(a){let h=(e,t)=>e.url===t||e.children.some(e=>h(e,t));return(g,_)=>{let v=r(`PageTreeNav`,!0);return c(),o(`ul`,{class:i([`grid gap-0.5`,a.depth?`mt-0.5 ml-3 border-l pl-2`:`mt-1`])},[(c(!0),o(l,null,s(a.items,r=>(c(),o(`li`,{key:r.id},[e(n(m),{href:r.url,class:i([`block rounded-md px-3 py-1.5 text-sm`,r.url===a.current?`bg-brand-soft font-medium text-brand-soft-foreground`:`text-foreground/80 hover:bg-accent hover:text-foreground`]),"aria-current":r.url===a.current?`page`:void 0},{default:u(()=>[t(d(r.title),1)]),_:2},1032,[`href`,`class`,`aria-current`]),r.children.length&&h(r,a.current)?(c(),f(v,{key:0,items:r.children,current:a.current,depth:a.depth+1},null,8,[`items`,`current`,`depth`])):p(``,!0)]))),128))],2)}}},C={key:0,class:`hidden lg:block`},w={class:`sticky top-24 rounded-lg border bg-card p-2`,"aria-label":`Seiten in diesem Bereich`},T={key:0,class:`mb-3 flex flex-wrap items-center gap-1 text-[13px] text-muted-foreground`,"aria-label":`Brotkrumen`},E={class:`text-foreground`},D={class:`mb-8 flex flex-wrap items-start justify-between gap-4`},O={class:`min-w-0`},k={class:`text-3xl leading-tight font-semibold tracking-tight`},A={key:0,class:`mt-1.5 text-[13px] text-muted-foreground`},j={key:1,class:`mb-6 flex items-start gap-3 rounded-lg border border-brand-200 bg-brand-soft px-4 py-3 text-sm`},M={key:2,class:`rounded-lg border border-dashed px-6 py-12 text-center text-sm text-muted-foreground`},N={__name:`Show`,props:{page:{type:Object,required:!0},content:{type:Object,required:!0},breadcrumbs:{type:Array,default:()=>[]},section:{type:Object,required:!0},editor:{type:Object,default:null}},setup(r){let N=r.section.children.length>0;return(P,F)=>(c(),f(h,{title:r.page.title},{default:u(()=>[a(`div`,{class:i([`grid gap-8`,N?`lg:grid-cols-[260px_minmax(0,1fr)]`:``])},[N?(c(),o(`aside`,C,[a(`nav`,w,[e(n(m),{href:r.section.url,class:i([`block rounded-md px-3 py-2 text-sm font-semibold`,r.section.active?`bg-brand-soft text-brand-soft-foreground`:`hover:bg-accent`])},{default:u(()=>[t(d(r.section.title),1)]),_:1},8,[`href`,`class`]),e(S,{items:r.section.children,current:r.page.url},null,8,[`items`,`current`])])])):p(``,!0),a(`article`,{class:i([`min-w-0`,N?``:`mx-auto w-full max-w-5xl`])},[r.breadcrumbs.length?(c(),o(`nav`,T,[(c(!0),o(l,null,s(r.breadcrumbs,r=>(c(),o(l,{key:r.url},[e(n(m),{href:r.url,class:`hover:text-foreground hover:underline`},{default:u(()=>[t(d(r.title),1)]),_:2},1032,[`href`]),e(n(_),{class:`size-3.5`})],64))),128)),a(`span`,E,d(r.page.title),1)])):p(``,!0),a(`header`,D,[a(`div`,O,[a(`h1`,k,d(r.page.title),1),r.page.published_at?(c(),o(`p`,A,`Zuletzt aktualisiert am `+d(n(y)(r.page.published_at)),1)):p(``,!0)]),r.editor?(c(),f(n(b),{key:0,variant:`outline`,"as-child":``},{default:u(()=>[e(n(m),{href:r.editor.url},{default:u(()=>[e(n(v)),F[0]||=t(` Bearbeiten`,-1)]),_:1},8,[`href`])]),_:1})):p(``,!0)]),r.editor&&(!r.page.is_published||r.editor.has_draft||r.editor.scheduled_at)?(c(),o(`div`,j,[r.editor.scheduled_at?(c(),f(n(g),{key:0,class:`mt-0.5 size-4 shrink-0 text-brand-text`})):(c(),f(n(v),{key:1,class:`mt-0.5 size-4 shrink-0 text-brand-text`})),a(`p`,null,[r.page.is_published?r.editor.scheduled_at?(c(),o(l,{key:1},[t(`Eine neue Fassung wird am `+d(new Date(r.editor.scheduled_at).toLocaleString(`de-DE`,{dateStyle:`medium`,timeStyle:`short`}))+` veröffentlicht.`,1)],64)):(c(),o(l,{key:2},[t(`Es gibt unveröffentlichte Änderungen an dieser Seite.`)],64)):(c(),o(l,{key:0},[t(`Diese Seite ist noch nicht veröffentlicht. Nur Redakteure sehen sie.`)],64)),e(n(m),{href:r.editor.url,class:`ml-1 font-medium text-brand-text hover:underline`},{default:u(()=>[...F[1]||=[t(`Im Editor öffnen`,-1)]]),_:1},8,[`href`])])])):p(``,!0),e(x,{content:r.content},null,8,[`content`]),r.content.blocks.length?p(``,!0):(c(),o(`p`,M,`Diese Seite hat noch keinen Inhalt.`))],2)],2)]),_:1},8,[`title`]))}};export{N as default}; \ No newline at end of file diff --git a/public/build/assets/Show-C6LzXbnd.js b/public/build/assets/Show-Cn1r8GQI.js similarity index 98% rename from public/build/assets/Show-C6LzXbnd.js rename to public/build/assets/Show-Cn1r8GQI.js index ba00f57a..4512b927 100644 --- a/public/build/assets/Show-C6LzXbnd.js +++ b/public/build/assets/Show-Cn1r8GQI.js @@ -1 +1 @@ -import{D as e,E as t,Ht as n,On as r,Yt as i,Zn as a,_ as o,b as s,bt as c,ct as l,er as u,mt as d,o as f,qt as p,tr as m,tt as h,v as g,vn as _,wt as v,y}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as b,w as x,x as S}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as C,o as w,r as T}from"./app-Bu3kn8yd.js";import{O as ee,k as E,o as D}from"./dist-DtGNiYlK.js";import{Q as O,V as k,p as A,tt as j}from"./AppIcon-0N56IC2z.js";import{t as M}from"./arrow-left-BMImfTf2.js";import{t as N}from"./AppLayout-BxsYt2ib.js";import{t as P}from"./check-AfxJa8Ew.js";import{t as F}from"./link-2-DbrWevIe.js";import{t as I}from"./pen-line-22hyV1yp.js";import{t as L}from"./send-6fmdiUe6.js";import{t as te}from"./trash-DUqnVIgb.js";import{n as R,o as z}from"./format-BsuBtvUs.js";import{t as B}from"./button-ZHC5mKey.js";import{t as V}from"./PageContent-bQ_WRrV_.js";var ne=E({name:`corner-down-right`,size:24,node:[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]}),H=E({name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]}),re=E({name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]}),ie=E({name:`reply`,size:24,node:[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]}),ae={id:`kommentare`,class:`rounded-xl border bg-card p-6 shadow-xs sm:p-8`,"aria-labelledby":`kommentare-titel`},oe={id:`kommentare-titel`,class:`flex items-center gap-2 text-lg font-semibold`},se={key:0,class:`rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground tabular-nums`},U={class:`min-w-0 flex-1`},W=[`maxlength`,`onKeydown`],G={key:0,class:`mt-1 text-[13px] text-destructive`},K={key:1,class:`mt-2 flex items-center justify-end gap-3`},ce={key:1,class:`mt-4 rounded-md bg-muted px-3 py-2 text-[13px] text-muted-foreground`},le={key:2,class:`mt-6 text-sm text-muted-foreground`},ue={class:`mt-6 grid gap-6`},de=[`id`],fe={class:`min-w-0 flex-1`},pe={key:0,class:`py-1 text-sm text-muted-foreground italic`},me={class:`rounded-lg bg-muted/60 px-3.5 py-2.5`},he={class:`flex flex-wrap items-baseline gap-x-2 text-[13px]`},ge={class:`font-semibold`},_e={key:0,class:`text-muted-foreground`},ve={key:0,class:`mt-0.5 flex items-center gap-1 text-xs text-muted-foreground`},ye=[`onSubmit`],be=[`maxlength`],xe={class:`mt-2 flex justify-end gap-2`},Se={key:2,class:`mt-1 text-sm leading-relaxed break-words whitespace-pre-line`},Ce={class:`mt-1 flex flex-wrap items-center gap-x-3 px-1 text-xs text-muted-foreground`},we=[`datetime`,`title`],Te={key:0},Ee=[`onClick`],De=[`onClick`],Oe=[`onClick`],ke={class:`min-w-0 flex-1`},Ae={class:`mb-1 text-xs text-muted-foreground`},je=[`id`,`maxlength`,`onKeydown`],Me={key:0,class:`mt-1 text-[13px] text-destructive`},Ne={class:`mt-2 flex justify-end gap-2`},q={__name:`NewsComments`,props:{postSlug:{type:String,required:!0},comments:{type:Object,required:!0}},setup(n){let u=n,v=C(),T=v.props.auth?.user,E=_(``),D=_(!1),O=_({}),k=_(null),j=_(``),M=_(null),N=_(``),P=new Intl.RelativeTimeFormat(`de-DE`,{numeric:`auto`}),F=new Intl.DateTimeFormat(`de-DE`,{dateStyle:`medium`,timeStyle:`short`});function I(e){let t=(new Date(e)-new Date)/1e3,n=[[60,`second`],[60,`minute`],[24,`hour`],[7,`day`]],r=t;for(let[e,t]of n){if(Math.abs(r)O.value=e,onSuccess:()=>{O.value={},t();let e=v.props.flash?.comment;e&&h(()=>Z(e))},onFinish:()=>D.value=!1})}function z(){E.value.trim()&&R({body:E.value},()=>E.value=``)}function V(e){M.value=null,k.value=e,j.value=``,h(()=>document.getElementById(`antwort-${e.id}`)?.focus())}function q(){j.value.trim()&&R({body:j.value,parent_id:k.value.id},()=>{k.value=null,j.value=``})}function J(e){k.value=null,M.value=e.id,N.value=e.body}function Y(e){w.put(`/kommentare/${e.id}`,{body:N.value},{preserveScroll:!0,only:[`comments`,`flash`],onSuccess:()=>M.value=null})}function X(e){window.confirm(`Kommentar löschen?`)&&w.delete(`/kommentare/${e.id}`,{preserveScroll:!0,only:[`comments`,`flash`]})}function Z(e){let t=document.getElementById(`kommentar-${e}`);t&&(t.scrollIntoView({behavior:`smooth`,block:`center`}),t.classList.add(`ring-2`,`ring-brand/40`),setTimeout(()=>t.classList.remove(`ring-2`,`ring-brand/40`),2e3))}l(()=>{let e=window.location.hash.match(/^#kommentar-(\d+)$/);e&&setTimeout(()=>Z(e[1]),300)});let Q=e=>{e.target.style.height=`auto`,e.target.style.height=`${e.target.scrollHeight}px`};return(l,u)=>(d(),s(`section`,ae,[o(`h2`,oe,[e(r(H),{class:`size-5 text-brand-text`}),u[6]||=t(` Kommentare `,-1),n.comments.count?(d(),s(`span`,se,m(n.comments.count),1)):y(``,!0)]),n.comments.enabled?(d(),s(`form`,{key:0,class:`mt-5 flex gap-3`,onSubmit:x(z,[`prevent`])},[r(T)?(d(),g(A,{key:0,person:r(T),class:`size-9 shrink-0`},null,8,[`person`])):y(``,!0),o(`div`,U,[i(o(`textarea`,{"onUpdate:modelValue":u[0]||=e=>E.value=e,rows:`2`,maxlength:n.comments.max,placeholder:`Was meinen Sie dazu?`,"aria-label":`Kommentar schreiben`,class:`w-full resize-none rounded-lg border border-input bg-background px-3 py-2 text-sm leading-relaxed focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`,onInput:Q,onKeydown:[b(x(z,[`ctrl`]),[`enter`]),b(x(z,[`meta`]),[`enter`])]},null,40,W),[[S,E.value]]),O.value.body&&!k.value?(d(),s(`p`,G,m(O.value.body),1)):y(``,!0),E.value.trim()?(d(),s(`div`,K,[u[8]||=o(`span`,{class:`text-xs text-muted-foreground`},`Strg + Enter zum Senden`,-1),e(r(B),{type:`submit`,size:`sm`,disabled:D.value},{default:p(()=>[D.value?(d(),g(r(ee),{key:0,class:`animate-spin`})):(d(),g(r(L),{key:1})),u[7]||=t(` Kommentieren`,-1)]),_:1},8,[`disabled`])])):y(``,!0)])],32)):(d(),s(`p`,ce,`Die Kommentare zu diesem Beitrag sind geschlossen.`)),!n.comments.threads.length&&n.comments.enabled?(d(),s(`p`,le,`Noch keine Kommentare – schreiben Sie den ersten.`)):y(``,!0),o(`ol`,ue,[(d(!0),s(f,null,c(n.comments.threads,l=>(d(),s(`li`,{key:l.id},[(d(!0),s(f,null,c([l,...l.replies],(c,l)=>(d(),s(`article`,{key:c.id,id:`kommentar-${c.id}`,class:a([`flex gap-3 rounded-lg transition-shadow`,l>0?`mt-4 ml-6 sm:ml-12`:``])},[c.author?(d(),g(A,{key:0,person:c.author,class:a([l>0?`size-8`:`size-9`,`shrink-0`])},null,8,[`person`,`class`])):(d(),s(`span`,{key:1,class:a([`grid shrink-0 place-items-center rounded-full bg-muted text-muted-foreground`,l>0?`size-8`:`size-9`])},[e(r(H),{class:`size-4`})],2)),o(`div`,fe,[c.deleted?(d(),s(`p`,pe,`Dieser Kommentar wurde gelöscht.`)):(d(),s(f,{key:1},[o(`div`,me,[o(`p`,he,[o(`span`,ge,m(c.author?.name??`Ehemalige Person`),1),c.author?.department?(d(),s(`span`,_e,m(c.author.department),1)):y(``,!0)]),c.reply_to?(d(),s(`p`,ve,[e(r(ne),{class:`size-3`}),t(` Antwort an `+m(c.reply_to),1)])):y(``,!0),M.value===c.id?(d(),s(`form`,{key:1,class:`mt-2`,onSubmit:x(e=>Y(c),[`prevent`])},[i(o(`textarea`,{"onUpdate:modelValue":u[1]||=e=>N.value=e,rows:`3`,maxlength:n.comments.max,class:`w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/30`,"aria-label":`Kommentar bearbeiten`},null,8,be),[[S,N.value]]),o(`div`,xe,[e(r(B),{type:`button`,size:`sm`,variant:`ghost`,onClick:u[2]||=e=>M.value=null},{default:p(()=>[...u[9]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(B),{type:`submit`,size:`sm`,disabled:!N.value.trim()},{default:p(()=>[...u[10]||=[t(`Speichern`,-1)]]),_:1},8,[`disabled`])])],40,ye)):(d(),s(`p`,Se,m(c.body),1))]),o(`div`,Ce,[o(`time`,{datetime:c.created_at,title:r(F).format(new Date(c.created_at))},m(I(c.created_at)),9,we),c.edited?(d(),s(`span`,Te,`bearbeitet`)):y(``,!0),n.comments.enabled?(d(),s(`button`,{key:1,type:`button`,class:`inline-flex items-center gap-1 font-medium hover:text-foreground`,onClick:e=>V(c)},[e(r(ie),{class:`size-3.5`}),u[11]||=t(` Antworten`,-1)],8,Ee)):y(``,!0),c.can.edit?(d(),s(`button`,{key:2,type:`button`,class:`inline-flex items-center gap-1 hover:text-foreground`,onClick:e=>J(c)},[e(r(re),{class:`size-3`}),u[12]||=t(` Bearbeiten`,-1)],8,De)):y(``,!0),c.can.delete?(d(),s(`button`,{key:3,type:`button`,class:`inline-flex items-center gap-1 hover:text-destructive`,onClick:e=>X(c)},[e(r(te),{class:`size-3`}),u[13]||=t(` Löschen`,-1)],8,Oe)):y(``,!0)])],64))])],10,de))),128)),k.value&&[l.id,...l.replies.map(e=>e.id)].includes(k.value.id)?(d(),s(`form`,{key:0,class:`mt-3 ml-6 flex gap-3 sm:ml-12`,onSubmit:x(q,[`prevent`])},[r(T)?(d(),g(A,{key:0,person:r(T),class:`size-8 shrink-0`},null,8,[`person`])):y(``,!0),o(`div`,ke,[o(`p`,Ae,`Antwort an `+m(k.value.author?.name),1),i(o(`textarea`,{id:`antwort-${k.value.id}`,"onUpdate:modelValue":u[3]||=e=>j.value=e,rows:`2`,maxlength:n.comments.max,class:`w-full resize-none rounded-lg border border-input bg-background px-3 py-2 text-sm focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`,"aria-label":`Antwort schreiben`,onInput:Q,onKeydown:[b(x(q,[`ctrl`]),[`enter`]),b(x(q,[`meta`]),[`enter`]),u[4]||=b(e=>k.value=null,[`esc`])]},null,40,je),[[S,j.value]]),O.value.body?(d(),s(`p`,Me,m(O.value.body),1)):y(``,!0),o(`div`,Ne,[e(r(B),{type:`button`,size:`sm`,variant:`ghost`,onClick:u[5]||=e=>k.value=null},{default:p(()=>[...u[14]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(B),{type:`submit`,size:`sm`,disabled:D.value||!j.value.trim()},{default:p(()=>[e(r(L)),u[15]||=t(` Antworten`,-1)]),_:1},8,[`disabled`])])])],32)):y(``,!0)]))),128))])]))}},J={class:`fixed inset-x-0 top-0 z-50 h-1 bg-transparent`,"aria-hidden":`true`},Y={class:`mb-4 flex items-center justify-between gap-4`},X={class:`relative isolate overflow-hidden rounded-xl bg-brand text-white shadow-sm`},Z=[`src`,`alt`],Q={key:1,class:`absolute inset-0 -z-10 bg-gradient-to-t from-black/85 via-black/45 to-black/5`},Pe={key:2,class:`absolute inset-0 -z-10 opacity-20 [background-image:radial-gradient(circle_at_85%_15%,white_0,transparent_45%),radial-gradient(circle_at_10%_110%,white_0,transparent_40%)]`},Fe={class:`flex min-h-[260px] flex-col justify-end gap-3 p-6 sm:min-h-[360px] sm:p-10 lg:min-h-[420px]`},Ie={key:0,class:`w-fit rounded-full bg-white/15 px-3 py-1 text-[11px] font-semibold tracking-wider uppercase ring-1 ring-white/30 backdrop-blur`},Le={class:`max-w-4xl text-3xl leading-tight font-semibold tracking-tight text-balance sm:text-4xl lg:text-[44px]`},Re={key:1,class:`max-w-3xl text-base leading-relaxed text-white/85 sm:text-lg`},ze={class:`mt-2 flex flex-wrap items-center gap-x-5 gap-y-2 text-sm text-white/80`},Be={class:`inline-flex items-center gap-1.5`},Ve={class:`inline-flex items-center gap-1.5`},He={key:0,href:`#kommentare`,class:`inline-flex items-center gap-1.5 hover:text-white`},Ue={class:`mt-6 grid gap-6 lg:grid-cols-12`},We={class:`grid min-w-0 grid-cols-1 content-start gap-6 lg:col-span-8`},Ge={key:0,class:`mb-8 flex items-center gap-3 border-b pb-6 lg:hidden`},Ke={class:`min-w-0 text-sm`},qe={key:0,class:`text-muted-foreground`},Je=[`innerHTML`],$={class:`mt-10 flex flex-wrap items-center gap-2 border-t pt-6`},Ye=[`href`],Xe={class:`grid content-start gap-6 lg:col-span-4`},Ze={key:0,class:`rounded-xl border bg-card p-5 shadow-xs`},Qe={class:`min-w-0`},$e={class:`block font-semibold`},et={key:0,class:`block text-[13px] text-muted-foreground`},tt={key:1,class:`rounded-xl border bg-card p-5 shadow-xs lg:sticky lg:top-20`},nt={class:`grid gap-1`},rt=[`src`],it={key:1,class:`grid h-16 w-20 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},at={class:`min-w-0`},ot={key:0,class:`block text-[10px] font-semibold tracking-wider text-accent2-text uppercase`},st={class:`line-clamp-2 text-sm leading-snug font-medium group-hover:underline`},ct={class:`block text-xs text-muted-foreground`},lt={__name:`Show`,props:{post:{type:Object,required:!0},related:{type:Object,required:!0},editUrl:{type:String,default:null},form:{type:Object,default:null},content:{type:Object,default:null},comments:{type:Object,default:null}},setup(i){let a=i,l=_(null),h=_(0),{y:b}=D();n(b,()=>{let e=l.value;if(!e)return;let t=e.getBoundingClientRect(),n=t.height-window.innerHeight*.6;h.value=Math.min(100,Math.max(0,-t.top/Math.max(n,1)*100))});let x=_(!1);async function S(){try{await navigator.clipboard.writeText(window.location.href),x.value=!0,setTimeout(()=>x.value=!1,2e3)}catch{window.prompt(`Link zum Beitrag:`,window.location.href)}}let C=e=>[e?.department,e?.job_title].filter(Boolean).join(` | `),w=()=>`mailto:?subject=${encodeURIComponent(a.post.title)}&body=${encodeURIComponent(window.location.href)}`;return(n,a)=>(d(),g(N,{title:i.post.title},{default:p(()=>[o(`div`,J,[o(`div`,{class:`h-full bg-brand transition-[width] duration-150`,style:u({width:`${h.value}%`})},null,4)]),o(`div`,Y,[e(r(T),{href:`/neuigkeiten`,class:`inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:p(()=>[e(r(M),{class:`size-4`}),a[0]||=t(` Alle Neuigkeiten `,-1)]),_:1}),i.editUrl?(d(),g(r(B),{key:0,variant:`outline`,size:`sm`,"as-child":``},{default:p(()=>[e(r(T),{href:i.editUrl},{default:p(()=>[e(r(I)),a[1]||=t(` Bearbeiten`,-1)]),_:1},8,[`href`])]),_:1})):y(``,!0)]),o(`header`,X,[i.post.cover_url?(d(),s(`img`,{key:0,src:i.post.cover_url,alt:i.post.title,class:`absolute inset-0 -z-10 size-full object-cover`},null,8,Z)):y(``,!0),i.post.cover_url?(d(),s(`div`,Q)):(d(),s(`div`,Pe)),o(`div`,Fe,[i.post.category?(d(),s(`span`,Ie,m(i.post.category.name),1)):y(``,!0),o(`h1`,Le,m(i.post.title),1),i.post.teaser?(d(),s(`p`,Re,m(i.post.teaser),1)):y(``,!0),o(`div`,ze,[o(`span`,Be,[e(r(j),{class:`size-4`}),t(` `+m(r(R)(i.post.published_at)),1)]),o(`span`,Ve,[e(r(O),{class:`size-4`}),t(` `+m(i.post.reading_minutes)+` Min. Lesezeit`,1)]),i.comments?.count?(d(),s(`a`,He,[e(r(H),{class:`size-4`}),t(` `+m(i.comments.count)+` `+m(i.comments.count===1?`Kommentar`:`Kommentare`),1)])):y(``,!0)])])]),o(`div`,Ue,[o(`div`,We,[o(`article`,{ref_key:`article`,ref:l,class:`min-w-0 rounded-xl border bg-card p-6 shadow-xs sm:p-10`},[i.post.author?(d(),s(`div`,Ge,[e(A,{person:i.post.author,class:`size-11`},null,8,[`person`]),o(`div`,Ke,[e(r(T),{href:`/personen/${i.post.author.id}`,class:`font-semibold hover:underline`},{default:p(()=>[t(m(i.post.author.name),1)]),_:1},8,[`href`]),C(i.post.author)?(d(),s(`p`,qe,m(C(i.post.author)),1)):y(``,!0)])])):y(``,!0),i.content?(d(),g(V,{key:1,content:i.content},null,8,[`content`])):(d(),s(`div`,{key:2,class:`prose prose-neutral max-w-none prose-headings:tracking-tight prose-h2:mt-10 prose-a:text-brand-text prose-blockquote:border-l-brand prose-blockquote:bg-brand-soft/50 prose-blockquote:py-1 prose-blockquote:not-italic prose-img:rounded-lg dark:prose-invert first-of-type:prose-p:text-lg`,innerHTML:i.post.body_html},null,8,Je)),i.form?(d(),g(V,{key:3,content:i.form,class:`mt-10`},null,8,[`content`])):y(``,!0),o(`footer`,$,[a[3]||=o(`span`,{class:`mr-2 text-sm text-muted-foreground`},`Beitrag teilen:`,-1),e(r(B),{variant:`outline`,size:`sm`,onClick:S},{default:p(()=>[(d(),g(v(x.value?r(P):r(F)))),t(` `+m(x.value?`Link kopiert`:`Link kopieren`),1)]),_:1}),e(r(B),{variant:`outline`,size:`sm`,"as-child":``},{default:p(()=>[o(`a`,{href:w()},[e(r(k)),a[2]||=t(` Per E-Mail`,-1)],8,Ye)]),_:1})])],512),i.comments?(d(),g(q,{key:0,"post-slug":i.post.slug,comments:i.comments},null,8,[`post-slug`,`comments`])):y(``,!0)]),o(`aside`,Xe,[i.post.author?(d(),s(`section`,Ze,[a[4]||=o(`h2`,{class:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Geschrieben von`,-1),e(r(T),{href:`/personen/${i.post.author.id}`,class:`flex items-center gap-3 rounded-lg p-1 hover:bg-accent/50`},{default:p(()=>[e(A,{person:i.post.author,class:`size-14`},null,8,[`person`]),o(`span`,Qe,[o(`span`,$e,m(i.post.author.name),1),C(i.post.author)?(d(),s(`span`,et,m(C(i.post.author)),1)):y(``,!0)])]),_:1},8,[`href`])])):y(``,!0),i.related.data.length?(d(),s(`section`,tt,[a[6]||=o(`h2`,{class:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Weitere Beiträge`,-1),o(`ul`,nt,[(d(!0),s(f,null,c(i.related.data,t=>(d(),s(`li`,{key:t.id},[e(r(T),{href:`/neuigkeiten/${t.slug}`,class:`group flex gap-3 rounded-lg p-2 hover:bg-accent/50`},{default:p(()=>[t.thumb_url?(d(),s(`img`,{key:0,src:t.thumb_url,alt:``,loading:`lazy`,class:`h-16 w-20 shrink-0 rounded-md object-cover`},null,8,rt)):(d(),s(`span`,it,[e(r(j),{class:`size-5`})])),o(`span`,at,[t.category?(d(),s(`span`,ot,m(t.category.name),1)):y(``,!0),o(`span`,st,m(t.title),1),o(`span`,ct,m(r(z)(t.published_at)),1)])]),_:2},1032,[`href`])]))),128))]),e(r(T),{href:`/neuigkeiten`,class:`mt-3 block border-t pt-3 text-[13px] font-medium text-brand-text hover:underline`},{default:p(()=>[...a[5]||=[t(`Alle Neuigkeiten`,-1)]]),_:1})])):y(``,!0)])])]),_:1},8,[`title`]))}};export{lt as default}; \ No newline at end of file +import{D as e,E as t,Ht as n,On as r,Yt as i,Zn as a,_ as o,b as s,bt as c,ct as l,er as u,mt as d,o as f,qt as p,tr as m,tt as h,v as g,vn as _,wt as v,y}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as b,w as x,x as S}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as C,o as w,r as T}from"./app-BNwrc_lv.js";import{O as ee,k as E,o as D}from"./dist-DtGNiYlK.js";import{Q as O,V as k,p as A,tt as j}from"./AppIcon-nlhvQfK7.js";import{t as M}from"./arrow-left-BMImfTf2.js";import{t as N}from"./AppLayout-esQiy2nD.js";import{t as P}from"./check-AfxJa8Ew.js";import{t as F}from"./link-2-DbrWevIe.js";import{t as I}from"./pen-line-22hyV1yp.js";import{t as L}from"./send-6fmdiUe6.js";import{t as te}from"./trash-DUqnVIgb.js";import{n as R,o as z}from"./format-BsuBtvUs.js";import{n as B}from"./button-CwUSbS9X.js";import{t as V}from"./PageContent-22GSNgo9.js";var ne=E({name:`corner-down-right`,size:24,node:[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]}),H=E({name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]}),re=E({name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]}),ie=E({name:`reply`,size:24,node:[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]}),ae={id:`kommentare`,class:`rounded-xl border bg-card p-6 shadow-xs sm:p-8`,"aria-labelledby":`kommentare-titel`},oe={id:`kommentare-titel`,class:`flex items-center gap-2 text-lg font-semibold`},se={key:0,class:`rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground tabular-nums`},U={class:`min-w-0 flex-1`},W=[`maxlength`,`onKeydown`],G={key:0,class:`mt-1 text-[13px] text-destructive`},K={key:1,class:`mt-2 flex items-center justify-end gap-3`},ce={key:1,class:`mt-4 rounded-md bg-muted px-3 py-2 text-[13px] text-muted-foreground`},le={key:2,class:`mt-6 text-sm text-muted-foreground`},ue={class:`mt-6 grid gap-6`},de=[`id`],fe={class:`min-w-0 flex-1`},pe={key:0,class:`py-1 text-sm text-muted-foreground italic`},me={class:`rounded-lg bg-muted/60 px-3.5 py-2.5`},he={class:`flex flex-wrap items-baseline gap-x-2 text-[13px]`},ge={class:`font-semibold`},_e={key:0,class:`text-muted-foreground`},ve={key:0,class:`mt-0.5 flex items-center gap-1 text-xs text-muted-foreground`},ye=[`onSubmit`],be=[`maxlength`],xe={class:`mt-2 flex justify-end gap-2`},Se={key:2,class:`mt-1 text-sm leading-relaxed break-words whitespace-pre-line`},Ce={class:`mt-1 flex flex-wrap items-center gap-x-3 px-1 text-xs text-muted-foreground`},we=[`datetime`,`title`],Te={key:0},Ee=[`onClick`],De=[`onClick`],Oe=[`onClick`],ke={class:`min-w-0 flex-1`},Ae={class:`mb-1 text-xs text-muted-foreground`},je=[`id`,`maxlength`,`onKeydown`],Me={key:0,class:`mt-1 text-[13px] text-destructive`},Ne={class:`mt-2 flex justify-end gap-2`},q={__name:`NewsComments`,props:{postSlug:{type:String,required:!0},comments:{type:Object,required:!0}},setup(n){let u=n,v=C(),T=v.props.auth?.user,E=_(``),D=_(!1),O=_({}),k=_(null),j=_(``),M=_(null),N=_(``),P=new Intl.RelativeTimeFormat(`de-DE`,{numeric:`auto`}),F=new Intl.DateTimeFormat(`de-DE`,{dateStyle:`medium`,timeStyle:`short`});function I(e){let t=(new Date(e)-new Date)/1e3,n=[[60,`second`],[60,`minute`],[24,`hour`],[7,`day`]],r=t;for(let[e,t]of n){if(Math.abs(r)O.value=e,onSuccess:()=>{O.value={},t();let e=v.props.flash?.comment;e&&h(()=>Z(e))},onFinish:()=>D.value=!1})}function z(){E.value.trim()&&R({body:E.value},()=>E.value=``)}function V(e){M.value=null,k.value=e,j.value=``,h(()=>document.getElementById(`antwort-${e.id}`)?.focus())}function q(){j.value.trim()&&R({body:j.value,parent_id:k.value.id},()=>{k.value=null,j.value=``})}function J(e){k.value=null,M.value=e.id,N.value=e.body}function Y(e){w.put(`/kommentare/${e.id}`,{body:N.value},{preserveScroll:!0,only:[`comments`,`flash`],onSuccess:()=>M.value=null})}function X(e){window.confirm(`Kommentar löschen?`)&&w.delete(`/kommentare/${e.id}`,{preserveScroll:!0,only:[`comments`,`flash`]})}function Z(e){let t=document.getElementById(`kommentar-${e}`);t&&(t.scrollIntoView({behavior:`smooth`,block:`center`}),t.classList.add(`ring-2`,`ring-brand/40`),setTimeout(()=>t.classList.remove(`ring-2`,`ring-brand/40`),2e3))}l(()=>{let e=window.location.hash.match(/^#kommentar-(\d+)$/);e&&setTimeout(()=>Z(e[1]),300)});let Q=e=>{e.target.style.height=`auto`,e.target.style.height=`${e.target.scrollHeight}px`};return(l,u)=>(d(),s(`section`,ae,[o(`h2`,oe,[e(r(H),{class:`size-5 text-brand-text`}),u[6]||=t(` Kommentare `,-1),n.comments.count?(d(),s(`span`,se,m(n.comments.count),1)):y(``,!0)]),n.comments.enabled?(d(),s(`form`,{key:0,class:`mt-5 flex gap-3`,onSubmit:x(z,[`prevent`])},[r(T)?(d(),g(A,{key:0,person:r(T),class:`size-9 shrink-0`},null,8,[`person`])):y(``,!0),o(`div`,U,[i(o(`textarea`,{"onUpdate:modelValue":u[0]||=e=>E.value=e,rows:`2`,maxlength:n.comments.max,placeholder:`Was meinen Sie dazu?`,"aria-label":`Kommentar schreiben`,class:`w-full resize-none rounded-lg border border-input bg-background px-3 py-2 text-sm leading-relaxed focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`,onInput:Q,onKeydown:[b(x(z,[`ctrl`]),[`enter`]),b(x(z,[`meta`]),[`enter`])]},null,40,W),[[S,E.value]]),O.value.body&&!k.value?(d(),s(`p`,G,m(O.value.body),1)):y(``,!0),E.value.trim()?(d(),s(`div`,K,[u[8]||=o(`span`,{class:`text-xs text-muted-foreground`},`Strg + Enter zum Senden`,-1),e(r(B),{type:`submit`,size:`sm`,disabled:D.value},{default:p(()=>[D.value?(d(),g(r(ee),{key:0,class:`animate-spin`})):(d(),g(r(L),{key:1})),u[7]||=t(` Kommentieren`,-1)]),_:1},8,[`disabled`])])):y(``,!0)])],32)):(d(),s(`p`,ce,`Die Kommentare zu diesem Beitrag sind geschlossen.`)),!n.comments.threads.length&&n.comments.enabled?(d(),s(`p`,le,`Noch keine Kommentare – schreiben Sie den ersten.`)):y(``,!0),o(`ol`,ue,[(d(!0),s(f,null,c(n.comments.threads,l=>(d(),s(`li`,{key:l.id},[(d(!0),s(f,null,c([l,...l.replies],(c,l)=>(d(),s(`article`,{key:c.id,id:`kommentar-${c.id}`,class:a([`flex gap-3 rounded-lg transition-shadow`,l>0?`mt-4 ml-6 sm:ml-12`:``])},[c.author?(d(),g(A,{key:0,person:c.author,class:a([l>0?`size-8`:`size-9`,`shrink-0`])},null,8,[`person`,`class`])):(d(),s(`span`,{key:1,class:a([`grid shrink-0 place-items-center rounded-full bg-muted text-muted-foreground`,l>0?`size-8`:`size-9`])},[e(r(H),{class:`size-4`})],2)),o(`div`,fe,[c.deleted?(d(),s(`p`,pe,`Dieser Kommentar wurde gelöscht.`)):(d(),s(f,{key:1},[o(`div`,me,[o(`p`,he,[o(`span`,ge,m(c.author?.name??`Ehemalige Person`),1),c.author?.department?(d(),s(`span`,_e,m(c.author.department),1)):y(``,!0)]),c.reply_to?(d(),s(`p`,ve,[e(r(ne),{class:`size-3`}),t(` Antwort an `+m(c.reply_to),1)])):y(``,!0),M.value===c.id?(d(),s(`form`,{key:1,class:`mt-2`,onSubmit:x(e=>Y(c),[`prevent`])},[i(o(`textarea`,{"onUpdate:modelValue":u[1]||=e=>N.value=e,rows:`3`,maxlength:n.comments.max,class:`w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/30`,"aria-label":`Kommentar bearbeiten`},null,8,be),[[S,N.value]]),o(`div`,xe,[e(r(B),{type:`button`,size:`sm`,variant:`ghost`,onClick:u[2]||=e=>M.value=null},{default:p(()=>[...u[9]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(B),{type:`submit`,size:`sm`,disabled:!N.value.trim()},{default:p(()=>[...u[10]||=[t(`Speichern`,-1)]]),_:1},8,[`disabled`])])],40,ye)):(d(),s(`p`,Se,m(c.body),1))]),o(`div`,Ce,[o(`time`,{datetime:c.created_at,title:r(F).format(new Date(c.created_at))},m(I(c.created_at)),9,we),c.edited?(d(),s(`span`,Te,`bearbeitet`)):y(``,!0),n.comments.enabled?(d(),s(`button`,{key:1,type:`button`,class:`inline-flex items-center gap-1 font-medium hover:text-foreground`,onClick:e=>V(c)},[e(r(ie),{class:`size-3.5`}),u[11]||=t(` Antworten`,-1)],8,Ee)):y(``,!0),c.can.edit?(d(),s(`button`,{key:2,type:`button`,class:`inline-flex items-center gap-1 hover:text-foreground`,onClick:e=>J(c)},[e(r(re),{class:`size-3`}),u[12]||=t(` Bearbeiten`,-1)],8,De)):y(``,!0),c.can.delete?(d(),s(`button`,{key:3,type:`button`,class:`inline-flex items-center gap-1 hover:text-destructive`,onClick:e=>X(c)},[e(r(te),{class:`size-3`}),u[13]||=t(` Löschen`,-1)],8,Oe)):y(``,!0)])],64))])],10,de))),128)),k.value&&[l.id,...l.replies.map(e=>e.id)].includes(k.value.id)?(d(),s(`form`,{key:0,class:`mt-3 ml-6 flex gap-3 sm:ml-12`,onSubmit:x(q,[`prevent`])},[r(T)?(d(),g(A,{key:0,person:r(T),class:`size-8 shrink-0`},null,8,[`person`])):y(``,!0),o(`div`,ke,[o(`p`,Ae,`Antwort an `+m(k.value.author?.name),1),i(o(`textarea`,{id:`antwort-${k.value.id}`,"onUpdate:modelValue":u[3]||=e=>j.value=e,rows:`2`,maxlength:n.comments.max,class:`w-full resize-none rounded-lg border border-input bg-background px-3 py-2 text-sm focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`,"aria-label":`Antwort schreiben`,onInput:Q,onKeydown:[b(x(q,[`ctrl`]),[`enter`]),b(x(q,[`meta`]),[`enter`]),u[4]||=b(e=>k.value=null,[`esc`])]},null,40,je),[[S,j.value]]),O.value.body?(d(),s(`p`,Me,m(O.value.body),1)):y(``,!0),o(`div`,Ne,[e(r(B),{type:`button`,size:`sm`,variant:`ghost`,onClick:u[5]||=e=>k.value=null},{default:p(()=>[...u[14]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(B),{type:`submit`,size:`sm`,disabled:D.value||!j.value.trim()},{default:p(()=>[e(r(L)),u[15]||=t(` Antworten`,-1)]),_:1},8,[`disabled`])])])],32)):y(``,!0)]))),128))])]))}},J={class:`fixed inset-x-0 top-0 z-50 h-1 bg-transparent`,"aria-hidden":`true`},Y={class:`mb-4 flex items-center justify-between gap-4`},X={class:`relative isolate overflow-hidden rounded-xl bg-brand text-white shadow-sm`},Z=[`src`,`alt`],Q={key:1,class:`absolute inset-0 -z-10 bg-gradient-to-t from-black/85 via-black/45 to-black/5`},Pe={key:2,class:`absolute inset-0 -z-10 opacity-20 [background-image:radial-gradient(circle_at_85%_15%,white_0,transparent_45%),radial-gradient(circle_at_10%_110%,white_0,transparent_40%)]`},Fe={class:`flex min-h-[260px] flex-col justify-end gap-3 p-6 sm:min-h-[360px] sm:p-10 lg:min-h-[420px]`},Ie={key:0,class:`w-fit rounded-full bg-white/15 px-3 py-1 text-[11px] font-semibold tracking-wider uppercase ring-1 ring-white/30 backdrop-blur`},Le={class:`max-w-4xl text-3xl leading-tight font-semibold tracking-tight text-balance sm:text-4xl lg:text-[44px]`},Re={key:1,class:`max-w-3xl text-base leading-relaxed text-white/85 sm:text-lg`},ze={class:`mt-2 flex flex-wrap items-center gap-x-5 gap-y-2 text-sm text-white/80`},Be={class:`inline-flex items-center gap-1.5`},Ve={class:`inline-flex items-center gap-1.5`},He={key:0,href:`#kommentare`,class:`inline-flex items-center gap-1.5 hover:text-white`},Ue={class:`mt-6 grid gap-6 lg:grid-cols-12`},We={class:`grid min-w-0 grid-cols-1 content-start gap-6 lg:col-span-8`},Ge={key:0,class:`mb-8 flex items-center gap-3 border-b pb-6 lg:hidden`},Ke={class:`min-w-0 text-sm`},qe={key:0,class:`text-muted-foreground`},Je=[`innerHTML`],$={class:`mt-10 flex flex-wrap items-center gap-2 border-t pt-6`},Ye=[`href`],Xe={class:`grid content-start gap-6 lg:col-span-4`},Ze={key:0,class:`rounded-xl border bg-card p-5 shadow-xs`},Qe={class:`min-w-0`},$e={class:`block font-semibold`},et={key:0,class:`block text-[13px] text-muted-foreground`},tt={key:1,class:`rounded-xl border bg-card p-5 shadow-xs lg:sticky lg:top-20`},nt={class:`grid gap-1`},rt=[`src`],it={key:1,class:`grid h-16 w-20 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},at={class:`min-w-0`},ot={key:0,class:`block text-[10px] font-semibold tracking-wider text-accent2-text uppercase`},st={class:`line-clamp-2 text-sm leading-snug font-medium group-hover:underline`},ct={class:`block text-xs text-muted-foreground`},lt={__name:`Show`,props:{post:{type:Object,required:!0},related:{type:Object,required:!0},editUrl:{type:String,default:null},form:{type:Object,default:null},content:{type:Object,default:null},comments:{type:Object,default:null}},setup(i){let a=i,l=_(null),h=_(0),{y:b}=D();n(b,()=>{let e=l.value;if(!e)return;let t=e.getBoundingClientRect(),n=t.height-window.innerHeight*.6;h.value=Math.min(100,Math.max(0,-t.top/Math.max(n,1)*100))});let x=_(!1);async function S(){try{await navigator.clipboard.writeText(window.location.href),x.value=!0,setTimeout(()=>x.value=!1,2e3)}catch{window.prompt(`Link zum Beitrag:`,window.location.href)}}let C=e=>[e?.department,e?.job_title].filter(Boolean).join(` | `),w=()=>`mailto:?subject=${encodeURIComponent(a.post.title)}&body=${encodeURIComponent(window.location.href)}`;return(n,a)=>(d(),g(N,{title:i.post.title},{default:p(()=>[o(`div`,J,[o(`div`,{class:`h-full bg-brand transition-[width] duration-150`,style:u({width:`${h.value}%`})},null,4)]),o(`div`,Y,[e(r(T),{href:`/neuigkeiten`,class:`inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:p(()=>[e(r(M),{class:`size-4`}),a[0]||=t(` Alle Neuigkeiten `,-1)]),_:1}),i.editUrl?(d(),g(r(B),{key:0,variant:`outline`,size:`sm`,"as-child":``},{default:p(()=>[e(r(T),{href:i.editUrl},{default:p(()=>[e(r(I)),a[1]||=t(` Bearbeiten`,-1)]),_:1},8,[`href`])]),_:1})):y(``,!0)]),o(`header`,X,[i.post.cover_url?(d(),s(`img`,{key:0,src:i.post.cover_url,alt:i.post.title,class:`absolute inset-0 -z-10 size-full object-cover`},null,8,Z)):y(``,!0),i.post.cover_url?(d(),s(`div`,Q)):(d(),s(`div`,Pe)),o(`div`,Fe,[i.post.category?(d(),s(`span`,Ie,m(i.post.category.name),1)):y(``,!0),o(`h1`,Le,m(i.post.title),1),i.post.teaser?(d(),s(`p`,Re,m(i.post.teaser),1)):y(``,!0),o(`div`,ze,[o(`span`,Be,[e(r(j),{class:`size-4`}),t(` `+m(r(R)(i.post.published_at)),1)]),o(`span`,Ve,[e(r(O),{class:`size-4`}),t(` `+m(i.post.reading_minutes)+` Min. Lesezeit`,1)]),i.comments?.count?(d(),s(`a`,He,[e(r(H),{class:`size-4`}),t(` `+m(i.comments.count)+` `+m(i.comments.count===1?`Kommentar`:`Kommentare`),1)])):y(``,!0)])])]),o(`div`,Ue,[o(`div`,We,[o(`article`,{ref_key:`article`,ref:l,class:`min-w-0 rounded-xl border bg-card p-6 shadow-xs sm:p-10`},[i.post.author?(d(),s(`div`,Ge,[e(A,{person:i.post.author,class:`size-11`},null,8,[`person`]),o(`div`,Ke,[e(r(T),{href:`/personen/${i.post.author.id}`,class:`font-semibold hover:underline`},{default:p(()=>[t(m(i.post.author.name),1)]),_:1},8,[`href`]),C(i.post.author)?(d(),s(`p`,qe,m(C(i.post.author)),1)):y(``,!0)])])):y(``,!0),i.content?(d(),g(V,{key:1,content:i.content},null,8,[`content`])):(d(),s(`div`,{key:2,class:`prose prose-neutral max-w-none prose-headings:tracking-tight prose-h2:mt-10 prose-a:text-brand-text prose-blockquote:border-l-brand prose-blockquote:bg-brand-soft/50 prose-blockquote:py-1 prose-blockquote:not-italic prose-img:rounded-lg dark:prose-invert first-of-type:prose-p:text-lg`,innerHTML:i.post.body_html},null,8,Je)),i.form?(d(),g(V,{key:3,content:i.form,class:`mt-10`},null,8,[`content`])):y(``,!0),o(`footer`,$,[a[3]||=o(`span`,{class:`mr-2 text-sm text-muted-foreground`},`Beitrag teilen:`,-1),e(r(B),{variant:`outline`,size:`sm`,onClick:S},{default:p(()=>[(d(),g(v(x.value?r(P):r(F)))),t(` `+m(x.value?`Link kopiert`:`Link kopieren`),1)]),_:1}),e(r(B),{variant:`outline`,size:`sm`,"as-child":``},{default:p(()=>[o(`a`,{href:w()},[e(r(k)),a[2]||=t(` Per E-Mail`,-1)],8,Ye)]),_:1})])],512),i.comments?(d(),g(q,{key:0,"post-slug":i.post.slug,comments:i.comments},null,8,[`post-slug`,`comments`])):y(``,!0)]),o(`aside`,Xe,[i.post.author?(d(),s(`section`,Ze,[a[4]||=o(`h2`,{class:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Geschrieben von`,-1),e(r(T),{href:`/personen/${i.post.author.id}`,class:`flex items-center gap-3 rounded-lg p-1 hover:bg-accent/50`},{default:p(()=>[e(A,{person:i.post.author,class:`size-14`},null,8,[`person`]),o(`span`,Qe,[o(`span`,$e,m(i.post.author.name),1),C(i.post.author)?(d(),s(`span`,et,m(C(i.post.author)),1)):y(``,!0)])]),_:1},8,[`href`])])):y(``,!0),i.related.data.length?(d(),s(`section`,tt,[a[6]||=o(`h2`,{class:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Weitere Beiträge`,-1),o(`ul`,nt,[(d(!0),s(f,null,c(i.related.data,t=>(d(),s(`li`,{key:t.id},[e(r(T),{href:`/neuigkeiten/${t.slug}`,class:`group flex gap-3 rounded-lg p-2 hover:bg-accent/50`},{default:p(()=>[t.thumb_url?(d(),s(`img`,{key:0,src:t.thumb_url,alt:``,loading:`lazy`,class:`h-16 w-20 shrink-0 rounded-md object-cover`},null,8,rt)):(d(),s(`span`,it,[e(r(j),{class:`size-5`})])),o(`span`,at,[t.category?(d(),s(`span`,ot,m(t.category.name),1)):y(``,!0),o(`span`,st,m(t.title),1),o(`span`,ct,m(r(z)(t.published_at)),1)])]),_:2},1032,[`href`])]))),128))]),e(r(T),{href:`/neuigkeiten`,class:`mt-3 block border-t pt-3 text-[13px] font-medium text-brand-text hover:underline`},{default:p(()=>[...a[5]||=[t(`Alle Neuigkeiten`,-1)]]),_:1})])):y(``,!0)])])]),_:1},8,[`title`]))}};export{lt as default}; \ No newline at end of file diff --git a/public/build/assets/Show-DTMG6TUr.js b/public/build/assets/Show-D7IyxymP.js similarity index 81% rename from public/build/assets/Show-DTMG6TUr.js rename to public/build/assets/Show-D7IyxymP.js index 0166bcf3..7a83fce3 100644 --- a/public/build/assets/Show-DTMG6TUr.js +++ b/public/build/assets/Show-D7IyxymP.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as u}from"./app-Bu3kn8yd.js";import{t as d}from"./arrow-left-BMImfTf2.js";import{t as f}from"./AppLayout-BxsYt2ib.js";import{t as p}from"./calendar-clock-8H2IkjP5.js";import{n as m}from"./format-BsuBtvUs.js";import{t as h}from"./FormRenderer-BEg0886q.js";var g={class:`mx-auto max-w-3xl`},_={class:`text-3xl font-semibold tracking-tight`},v={key:0,class:`mt-3 leading-relaxed whitespace-pre-line text-muted-foreground`},y={key:1,class:`mt-3 inline-flex items-center gap-1.5 text-[13px] text-muted-foreground`},b={class:`@container mt-8 rounded-lg border bg-card p-5 sm:p-8`},x={__name:`Show`,props:{form:{type:Object,required:!0}},setup(x){return(S,C)=>(a(),c(f,{title:x.form.title},{default:o(()=>[r(`div`,g,[e(n(u),{href:`/formulare`,class:`mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:o(()=>[e(n(d),{class:`size-4`}),C[0]||=t(` Alle Formulare `,-1)]),_:1}),r(`h1`,_,s(x.form.title),1),x.form.description?(a(),i(`p`,v,s(x.form.description),1)):l(``,!0),x.form.closes_at&&x.form.open?(a(),i(`p`,y,[e(n(p),{class:`size-4`}),t(` Einsendeschluss: `+s(n(m)(x.form.closes_at)),1)])):l(``,!0),r(`div`,b,[e(h,{form:x.form},null,8,[`form`])])])]),_:1},8,[`title`]))}};export{x as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as u}from"./app-BNwrc_lv.js";import{t as d}from"./arrow-left-BMImfTf2.js";import{t as f}from"./AppLayout-esQiy2nD.js";import{t as p}from"./calendar-clock-8H2IkjP5.js";import{n as m}from"./format-BsuBtvUs.js";import{t as h}from"./FormRenderer-CoNVx1AS.js";var g={class:`mx-auto max-w-3xl`},_={class:`text-3xl font-semibold tracking-tight`},v={key:0,class:`mt-3 leading-relaxed whitespace-pre-line text-muted-foreground`},y={key:1,class:`mt-3 inline-flex items-center gap-1.5 text-[13px] text-muted-foreground`},b={class:`@container mt-8 rounded-lg border bg-card p-5 sm:p-8`},x={__name:`Show`,props:{form:{type:Object,required:!0}},setup(x){return(S,C)=>(a(),c(f,{title:x.form.title},{default:o(()=>[r(`div`,g,[e(n(u),{href:`/formulare`,class:`mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:o(()=>[e(n(d),{class:`size-4`}),C[0]||=t(` Alle Formulare `,-1)]),_:1}),r(`h1`,_,s(x.form.title),1),x.form.description?(a(),i(`p`,v,s(x.form.description),1)):l(``,!0),x.form.closes_at&&x.form.open?(a(),i(`p`,y,[e(n(p),{class:`size-4`}),t(` Einsendeschluss: `+s(n(m)(x.form.closes_at)),1)])):l(``,!0),r(`div`,b,[e(h,{form:x.form},null,8,[`form`])])])]),_:1},8,[`title`]))}};export{x as default}; \ No newline at end of file diff --git a/public/build/assets/Show-BNFnLRmU.js b/public/build/assets/Show-DHgGJJKJ.js similarity index 90% rename from public/build/assets/Show-BNFnLRmU.js rename to public/build/assets/Show-DHgGJJKJ.js index e933d1d0..b85a3996 100644 --- a/public/build/assets/Show-BNFnLRmU.js +++ b/public/build/assets/Show-DHgGJJKJ.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as u}from"./app-Bu3kn8yd.js";import{k as d}from"./dist-DtGNiYlK.js";import{B as f,E as p,Q as m}from"./AppIcon-0N56IC2z.js";import{t as h}from"./arrow-left-BMImfTf2.js";import{t as g}from"./AppLayout-BxsYt2ib.js";import{r as _}from"./format-BsuBtvUs.js";import{t as v}from"./button-ZHC5mKey.js";import{t as y}from"./Panel-BASB8Xb9.js";import{t as b}from"./EventDateBlock-_E5XlLto.js";var x=d({name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]}),S={class:`mx-auto max-w-4xl`},C={class:`flex items-start gap-4`},w={class:`pt-1 text-2xl leading-tight font-semibold tracking-tight sm:text-3xl`},T=[`src`,`alt`],E={class:`mt-6 grid gap-6 lg:grid-cols-3`},D=[`innerHTML`],O={key:1,class:`text-sm text-muted-foreground`},k={class:`grid gap-4 text-sm`},A={class:`flex gap-3`},j={key:0,class:`flex gap-3`},M={key:1,class:`flex gap-3`},N={class:`min-w-0`},P={class:`truncate`},F=[`href`],I=[`href`],L={__name:`Show`,props:{event:{type:Object,required:!0}},setup(d){return(L,R)=>(a(),c(g,{title:d.event.title},{default:o(()=>[r(`div`,S,[e(n(u),{href:`/termine`,class:`mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:o(()=>[e(n(h),{class:`size-4`}),R[0]||=t(` Alle Termine `,-1)]),_:1}),r(`div`,C,[e(b,{date:d.event.starts_at,class:`w-16 py-2`},null,8,[`date`]),r(`h1`,w,s(d.event.title),1)]),d.event.image_url?(a(),i(`img`,{key:0,src:d.event.image_url,alt:d.event.title,class:`mt-6 aspect-video w-full rounded-lg object-cover`},null,8,T)):l(``,!0),r(`div`,E,[e(y,{title:`Beschreibung`,class:`lg:col-span-2`},{default:o(()=>[d.event.description_html?(a(),i(`div`,{key:0,class:`prose prose-neutral max-w-none text-[15px]`,innerHTML:d.event.description_html},null,8,D)):(a(),i(`p`,O,`Keine weiteren Informationen.`))]),_:1}),e(y,{title:`Details`,class:`content-start`},{default:o(()=>[r(`dl`,k,[r(`div`,A,[e(n(m),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,null,[R[1]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Wann`,-1),r(`dd`,null,s(n(_)(d.event)),1)])]),d.event.location?(a(),i(`div`,j,[e(n(f),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,null,[R[2]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Ort`,-1),r(`dd`,null,s(d.event.location),1)])])):l(``,!0),d.event.online_url?(a(),i(`div`,M,[e(n(p),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,N,[R[3]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Online`,-1),r(`dd`,P,[r(`a`,{href:d.event.online_url,target:`_blank`,rel:`noopener`,class:`text-brand-text hover:underline`},`Zur Teilnahme`,8,F)])])])):l(``,!0)]),e(n(v),{variant:`outline`,class:`mt-5 w-full`,"as-child":``},{default:o(()=>[r(`a`,{href:`/termine/${d.event.id}/kalender.ics`},[e(n(x)),R[4]||=t(` In meinen Kalender`,-1)],8,I)]),_:1})]),_:1})])])]),_:1},8,[`title`]))}};export{L as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,b as i,mt as a,qt as o,tr as s,v as c,y as l}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as u}from"./app-BNwrc_lv.js";import{k as d}from"./dist-DtGNiYlK.js";import{B as f,E as p,Q as m}from"./AppIcon-nlhvQfK7.js";import{t as h}from"./arrow-left-BMImfTf2.js";import{t as g}from"./AppLayout-esQiy2nD.js";import{r as _}from"./format-BsuBtvUs.js";import{n as v}from"./button-CwUSbS9X.js";import{t as y}from"./Panel-Dr-NcUuS.js";import{t as b}from"./EventDateBlock-_E5XlLto.js";var x=d({name:`calendar-plus`,size:24,node:[[`path`,{d:`M16 18h6`,key:`987eiv`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M19 15v6`,key:`10aioa`}],[`path`,{d:`M21 11.5V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h8.3`,key:`jgwkxf`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}]]}),S={class:`mx-auto max-w-4xl`},C={class:`flex items-start gap-4`},w={class:`pt-1 text-2xl leading-tight font-semibold tracking-tight sm:text-3xl`},T=[`src`,`alt`],E={class:`mt-6 grid gap-6 lg:grid-cols-3`},D=[`innerHTML`],O={key:1,class:`text-sm text-muted-foreground`},k={class:`grid gap-4 text-sm`},A={class:`flex gap-3`},j={key:0,class:`flex gap-3`},M={key:1,class:`flex gap-3`},N={class:`min-w-0`},P={class:`truncate`},F=[`href`],I=[`href`],L={__name:`Show`,props:{event:{type:Object,required:!0}},setup(d){return(L,R)=>(a(),c(g,{title:d.event.title},{default:o(()=>[r(`div`,S,[e(n(u),{href:`/termine`,class:`mb-6 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:o(()=>[e(n(h),{class:`size-4`}),R[0]||=t(` Alle Termine `,-1)]),_:1}),r(`div`,C,[e(b,{date:d.event.starts_at,class:`w-16 py-2`},null,8,[`date`]),r(`h1`,w,s(d.event.title),1)]),d.event.image_url?(a(),i(`img`,{key:0,src:d.event.image_url,alt:d.event.title,class:`mt-6 aspect-video w-full rounded-lg object-cover`},null,8,T)):l(``,!0),r(`div`,E,[e(y,{title:`Beschreibung`,class:`lg:col-span-2`},{default:o(()=>[d.event.description_html?(a(),i(`div`,{key:0,class:`prose prose-neutral max-w-none text-[15px]`,innerHTML:d.event.description_html},null,8,D)):(a(),i(`p`,O,`Keine weiteren Informationen.`))]),_:1}),e(y,{title:`Details`,class:`content-start`},{default:o(()=>[r(`dl`,k,[r(`div`,A,[e(n(m),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,null,[R[1]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Wann`,-1),r(`dd`,null,s(n(_)(d.event)),1)])]),d.event.location?(a(),i(`div`,j,[e(n(f),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,null,[R[2]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Ort`,-1),r(`dd`,null,s(d.event.location),1)])])):l(``,!0),d.event.online_url?(a(),i(`div`,M,[e(n(p),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),r(`div`,N,[R[3]||=r(`dt`,{class:`text-xs text-muted-foreground`},`Online`,-1),r(`dd`,P,[r(`a`,{href:d.event.online_url,target:`_blank`,rel:`noopener`,class:`text-brand-text hover:underline`},`Zur Teilnahme`,8,F)])])])):l(``,!0)]),e(n(v),{variant:`outline`,class:`mt-5 w-full`,"as-child":``},{default:o(()=>[r(`a`,{href:`/termine/${d.event.id}/kalender.ics`},[e(n(x)),R[4]||=t(` In meinen Kalender`,-1)],8,I)]),_:1})]),_:1})])])]),_:1},8,[`title`]))}};export{L as default}; \ No newline at end of file diff --git a/public/build/assets/Show-BHs_GqKb.js b/public/build/assets/Show-oCIt-pUC.js similarity index 91% rename from public/build/assets/Show-BHs_GqKb.js rename to public/build/assets/Show-oCIt-pUC.js index e8a741c2..693609bd 100644 --- a/public/build/assets/Show-BHs_GqKb.js +++ b/public/build/assets/Show-oCIt-pUC.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,g as s,mt as c,o as l,qt as u,tr as d,v as f,wt as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as h}from"./app-Bu3kn8yd.js";import{B as g,V as _,p as v}from"./AppIcon-0N56IC2z.js";import{r as y,t as b}from"./AppLayout-BxsYt2ib.js";import{l as ee}from"./RovingFocusGroup-D88K7krN.js";import{y as x}from"./http-DmyDwIce.js";import{t as S}from"./smartphone-BE2l7T-2.js";import{t as C}from"./button-ZHC5mKey.js";import{t as w}from"./Panel-BASB8Xb9.js";var T={class:`overflow-hidden rounded-lg border bg-card`},E={class:`flex flex-col gap-4 px-6 pb-6 sm:flex-row sm:items-end sm:justify-between`},D={class:`flex flex-col gap-4 sm:flex-row sm:items-end`},O={class:`sm:pb-1`},k={class:`text-2xl font-semibold tracking-tight`},A={key:0,class:`mt-0.5 text-[15px] text-muted-foreground`},j={class:`flex gap-2 sm:pb-1`},M=[`href`],N={class:`mt-6 grid gap-6 lg:grid-cols-12`},P={class:`grid content-start gap-6 lg:col-span-5`},F={class:`grid gap-4`},I={class:`min-w-0`},te={class:`text-xs text-muted-foreground`},L={class:`truncate text-sm`},R=[`href`],z={class:`grid gap-4`},B={class:`text-xs text-muted-foreground`},V=[`href`,`target`],H={class:`grid content-start gap-6 lg:col-span-7`},U={key:0,class:`text-sm leading-relaxed whitespace-pre-line`},W={key:1,class:`text-sm text-muted-foreground`},G={key:0,class:`mb-4`},K={class:`block text-sm font-semibold`},q={class:`block text-[13px] text-muted-foreground`},J={key:1},Y={class:`flex flex-wrap gap-2`},X={__name:`Show`,props:{person:{type:Object,required:!0},isOwnProfile:{type:Boolean,default:!1}},setup(X){let Z=X,Q=s(()=>[{icon:_,label:`E-Mail`,value:Z.person.email,href:`mailto:${Z.person.email}`},{icon:x,label:`Telefon`,value:Z.person.phone,href:Z.person.phone&&`tel:${Z.person.phone}`},{icon:S,label:`Mobil`,value:Z.person.mobile,href:Z.person.mobile&&`tel:${Z.person.mobile}`},{icon:ee,label:`Abteilung`,value:Z.person.department},{icon:g,label:`Standort`,value:Z.person.location}].filter(e=>e.value));function $(e){return e.type===`email`?`mailto:${e.value}`:e.type===`phone`?`tel:${e.value}`:e.type===`url`&&/^https?:\/\//i.test(e.value)?e.value:null}return(s,g)=>(c(),f(b,{title:X.person.name},{default:u(()=>[i(`section`,T,[g[2]||=i(`div`,{class:`h-28 bg-brand sm:h-32`,style:{"background-image":`linear-gradient(120deg, transparent 40%, rgb(255 255 255 / 0.08))`}},null,-1),i(`div`,E,[i(`div`,D,[e(v,{person:X.person,class:`-mt-14 size-28 text-2xl ring-4 ring-card`},null,8,[`person`]),i(`div`,O,[i(`h1`,k,d(X.person.name),1),X.person.job_title?(c(),a(`p`,A,d(X.person.job_title),1)):m(``,!0)])]),i(`div`,j,[X.isOwnProfile?(c(),f(n(C),{key:0,variant:`outline`,"as-child":``},{default:u(()=>[e(n(h),{href:`/profil/bearbeiten`},{default:u(()=>[e(n(y)),g[0]||=t(` Profil bearbeiten`,-1)]),_:1})]),_:1})):(c(),f(n(C),{key:1,"as-child":``},{default:u(()=>[i(`a`,{href:`mailto:${X.person.email}`},[e(n(_)),g[1]||=t(` E-Mail schreiben`,-1)],8,M)]),_:1}))])])]),i(`div`,N,[i(`div`,P,[e(w,{title:`Kontakt`},{default:u(()=>[i(`dl`,F,[(c(!0),a(l,null,o(Q.value,e=>(c(),a(`div`,{key:e.label,class:`flex items-start gap-3`},[(c(),f(p(e.icon),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`})),i(`div`,I,[i(`dt`,te,d(e.label),1),i(`dd`,L,[e.href?(c(),a(`a`,{key:0,href:e.href,class:`text-brand-text hover:underline`},d(e.value),9,R)):(c(),a(l,{key:1},[t(d(e.value),1)],64))])])]))),128))])]),_:1}),X.person.fields?.length?(c(),f(w,{key:0,title:`Weitere Angaben`},{default:u(()=>[i(`dl`,z,[(c(!0),a(l,null,o(X.person.fields,e=>(c(),a(`div`,{key:e.key,class:`min-w-0`},[i(`dt`,B,d(e.label),1),i(`dd`,{class:r([`text-sm break-words`,{"whitespace-pre-line":e.type===`textarea`}])},[$(e)?(c(),a(`a`,{key:0,href:$(e),class:`text-brand-text hover:underline`,target:e.type===`url`?`_blank`:void 0,rel:`noopener`},d(e.value),9,V)):(c(),a(l,{key:1},[t(d(e.value),1)],64))],2)]))),128))])]),_:1})):m(``,!0)]),i(`div`,H,[e(w,{title:`Über mich`},{default:u(()=>[X.person.about?(c(),a(`p`,U,d(X.person.about),1)):(c(),a(`p`,W,`Noch keine Angaben.`))]),_:1}),X.person.manager||X.person.reports.length?(c(),f(w,{key:0,title:`Team`,"action-label":`Im Organigramm`,"action-href":`/personen/organigramm?person=${X.person.id}`},{default:u(()=>[X.person.manager?(c(),a(`div`,G,[g[3]||=i(`div`,{class:`mb-2 text-xs text-muted-foreground`},`Vorgesetzte*r`,-1),e(n(h),{href:`/personen/${X.person.manager.id}`,class:`flex items-center gap-3 rounded-lg p-2 -m-2 hover:bg-accent`},{default:u(()=>[e(v,{person:X.person.manager,class:`size-10`},null,8,[`person`]),i(`span`,null,[i(`span`,K,d(X.person.manager.name),1),i(`span`,q,d(X.person.manager.job_title),1)])]),_:1},8,[`href`])])):m(``,!0),X.person.reports.length?(c(),a(`div`,J,[g[4]||=i(`div`,{class:`mb-2 text-xs text-muted-foreground`},`Mitarbeitende`,-1),i(`div`,Y,[(c(!0),a(l,null,o(X.person.reports,t=>(c(),f(n(h),{key:t.id,href:`/personen/${t.id}`,title:t.name,class:`rounded-full hover:ring-2 hover:ring-brand-300`},{default:u(()=>[e(v,{person:t,class:`size-9`},null,8,[`person`])]),_:2},1032,[`href`,`title`]))),128))])])):m(``,!0)]),_:1},8,[`action-href`])):m(``,!0)])])]),_:1},8,[`title`]))}};export{X as default}; \ No newline at end of file +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,g as s,mt as c,o as l,qt as u,tr as d,v as f,wt as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as h}from"./app-BNwrc_lv.js";import{B as g,V as _,p as v}from"./AppIcon-nlhvQfK7.js";import{r as y,t as b}from"./AppLayout-esQiy2nD.js";import{l as ee}from"./RovingFocusGroup-D88K7krN.js";import{b as x}from"./http-CAG9BrJF.js";import{t as S}from"./smartphone-BE2l7T-2.js";import{n as C}from"./button-CwUSbS9X.js";import{t as w}from"./Panel-Dr-NcUuS.js";var T={class:`overflow-hidden rounded-lg border bg-card`},E={class:`flex flex-col gap-4 px-6 pb-6 sm:flex-row sm:items-end sm:justify-between`},D={class:`flex flex-col gap-4 sm:flex-row sm:items-end`},O={class:`sm:pb-1`},k={class:`text-2xl font-semibold tracking-tight`},A={key:0,class:`mt-0.5 text-[15px] text-muted-foreground`},j={class:`flex gap-2 sm:pb-1`},M=[`href`],N={class:`mt-6 grid gap-6 lg:grid-cols-12`},P={class:`grid content-start gap-6 lg:col-span-5`},F={class:`grid gap-4`},I={class:`min-w-0`},te={class:`text-xs text-muted-foreground`},L={class:`truncate text-sm`},R=[`href`],z={class:`grid gap-4`},B={class:`text-xs text-muted-foreground`},V=[`href`,`target`],H={class:`grid content-start gap-6 lg:col-span-7`},U={key:0,class:`text-sm leading-relaxed whitespace-pre-line`},W={key:1,class:`text-sm text-muted-foreground`},G={key:0,class:`mb-4`},K={class:`block text-sm font-semibold`},q={class:`block text-[13px] text-muted-foreground`},J={key:1},Y={class:`flex flex-wrap gap-2`},X={__name:`Show`,props:{person:{type:Object,required:!0},isOwnProfile:{type:Boolean,default:!1}},setup(X){let Z=X,Q=s(()=>[{icon:_,label:`E-Mail`,value:Z.person.email,href:`mailto:${Z.person.email}`},{icon:x,label:`Telefon`,value:Z.person.phone,href:Z.person.phone&&`tel:${Z.person.phone}`},{icon:S,label:`Mobil`,value:Z.person.mobile,href:Z.person.mobile&&`tel:${Z.person.mobile}`},{icon:ee,label:`Abteilung`,value:Z.person.department},{icon:g,label:`Standort`,value:Z.person.location}].filter(e=>e.value));function $(e){return e.type===`email`?`mailto:${e.value}`:e.type===`phone`?`tel:${e.value}`:e.type===`url`&&/^https?:\/\//i.test(e.value)?e.value:null}return(s,g)=>(c(),f(b,{title:X.person.name},{default:u(()=>[i(`section`,T,[g[2]||=i(`div`,{class:`h-28 bg-brand sm:h-32`,style:{"background-image":`linear-gradient(120deg, transparent 40%, rgb(255 255 255 / 0.08))`}},null,-1),i(`div`,E,[i(`div`,D,[e(v,{person:X.person,class:`-mt-14 size-28 text-2xl ring-4 ring-card`},null,8,[`person`]),i(`div`,O,[i(`h1`,k,d(X.person.name),1),X.person.job_title?(c(),a(`p`,A,d(X.person.job_title),1)):m(``,!0)])]),i(`div`,j,[X.isOwnProfile?(c(),f(n(C),{key:0,variant:`outline`,"as-child":``},{default:u(()=>[e(n(h),{href:`/profil/bearbeiten`},{default:u(()=>[e(n(y)),g[0]||=t(` Profil bearbeiten`,-1)]),_:1})]),_:1})):(c(),f(n(C),{key:1,"as-child":``},{default:u(()=>[i(`a`,{href:`mailto:${X.person.email}`},[e(n(_)),g[1]||=t(` E-Mail schreiben`,-1)],8,M)]),_:1}))])])]),i(`div`,N,[i(`div`,P,[e(w,{title:`Kontakt`},{default:u(()=>[i(`dl`,F,[(c(!0),a(l,null,o(Q.value,e=>(c(),a(`div`,{key:e.label,class:`flex items-start gap-3`},[(c(),f(p(e.icon),{class:`mt-0.5 size-4 shrink-0 text-muted-foreground`})),i(`div`,I,[i(`dt`,te,d(e.label),1),i(`dd`,L,[e.href?(c(),a(`a`,{key:0,href:e.href,class:`text-brand-text hover:underline`},d(e.value),9,R)):(c(),a(l,{key:1},[t(d(e.value),1)],64))])])]))),128))])]),_:1}),X.person.fields?.length?(c(),f(w,{key:0,title:`Weitere Angaben`},{default:u(()=>[i(`dl`,z,[(c(!0),a(l,null,o(X.person.fields,e=>(c(),a(`div`,{key:e.key,class:`min-w-0`},[i(`dt`,B,d(e.label),1),i(`dd`,{class:r([`text-sm break-words`,{"whitespace-pre-line":e.type===`textarea`}])},[$(e)?(c(),a(`a`,{key:0,href:$(e),class:`text-brand-text hover:underline`,target:e.type===`url`?`_blank`:void 0,rel:`noopener`},d(e.value),9,V)):(c(),a(l,{key:1},[t(d(e.value),1)],64))],2)]))),128))])]),_:1})):m(``,!0)]),i(`div`,H,[e(w,{title:`Über mich`},{default:u(()=>[X.person.about?(c(),a(`p`,U,d(X.person.about),1)):(c(),a(`p`,W,`Noch keine Angaben.`))]),_:1}),X.person.manager||X.person.reports.length?(c(),f(w,{key:0,title:`Team`,"action-label":`Im Organigramm`,"action-href":`/personen/organigramm?person=${X.person.id}`},{default:u(()=>[X.person.manager?(c(),a(`div`,G,[g[3]||=i(`div`,{class:`mb-2 text-xs text-muted-foreground`},`Vorgesetzte*r`,-1),e(n(h),{href:`/personen/${X.person.manager.id}`,class:`flex items-center gap-3 rounded-lg p-2 -m-2 hover:bg-accent`},{default:u(()=>[e(v,{person:X.person.manager,class:`size-10`},null,8,[`person`]),i(`span`,null,[i(`span`,K,d(X.person.manager.name),1),i(`span`,q,d(X.person.manager.job_title),1)])]),_:1},8,[`href`])])):m(``,!0),X.person.reports.length?(c(),a(`div`,J,[g[4]||=i(`div`,{class:`mb-2 text-xs text-muted-foreground`},`Mitarbeitende`,-1),i(`div`,Y,[(c(!0),a(l,null,o(X.person.reports,t=>(c(),f(n(h),{key:t.id,href:`/personen/${t.id}`,title:t.name,class:`rounded-full hover:ring-2 hover:ring-brand-300`},{default:u(()=>[e(v,{person:t,class:`size-9`},null,8,[`person`])]),_:2},1032,[`href`,`title`]))),128))])])):m(``,!0)]),_:1},8,[`action-href`])):m(``,!0)])])]),_:1},8,[`title`]))}};export{X as default}; \ No newline at end of file diff --git a/public/build/assets/Subpages-xPi82WYF.js b/public/build/assets/Subpages-BaNB0mvB.js similarity index 90% rename from public/build/assets/Subpages-xPi82WYF.js rename to public/build/assets/Subpages-BaNB0mvB.js index 2bc450b4..5297aaa8 100644 --- a/public/build/assets/Subpages-xPi82WYF.js +++ b/public/build/assets/Subpages-BaNB0mvB.js @@ -1 +1 @@ -import{D as e,On as t,Zn as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./app-Bu3kn8yd.js";import{X as p}from"./AppIcon-0N56IC2z.js";import{t as m}from"./chevron-right-C9w5cb2q.js";var h={key:0,class:`mb-3 text-lg font-semibold`},g={class:`min-w-0 flex-1 truncate font-medium group-hover:underline`},_={__name:`Subpages`,props:{block:{type:Object,required:!0}},setup(_){return(v,y)=>(o(),i(`section`,null,[_.block.data.title?(o(),i(`h3`,h,l(_.block.data.title),1)):d(``,!0),r(`div`,{class:n(_.block.data.layout===`list`?`divide-y rounded-lg border bg-card`:`grid gap-3 @xl:grid-cols-2 @4xl:grid-cols-3`)},[(o(!0),i(s,null,a(_.block.props?.pages??[],i=>(o(),u(t(f),{key:i.id,href:i.url,class:n([`group flex items-center gap-3 hover:bg-accent/50`,_.block.data.layout===`list`?`px-4 py-3`:`rounded-lg border bg-card p-4`])},{default:c(()=>[e(t(p),{class:`size-5 shrink-0 text-brand-text`}),r(`span`,g,l(i.title),1),e(t(m),{class:`size-4 text-muted-foreground`})]),_:2},1032,[`href`,`class`]))),128)),(_.block.props?.pages??[]).length?d(``,!0):(o(),i(`p`,{key:0,class:n([`text-sm text-muted-foreground`,_.block.data.layout===`list`?`px-4 py-3`:``])},`Keine veröffentlichten Unterseiten.`,2))],2)]))}};export{_ as default}; \ No newline at end of file +import{D as e,On as t,Zn as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./app-BNwrc_lv.js";import{X as p}from"./AppIcon-nlhvQfK7.js";import{t as m}from"./chevron-right-C9w5cb2q.js";var h={key:0,class:`mb-3 text-lg font-semibold`},g={class:`min-w-0 flex-1 truncate font-medium group-hover:underline`},_={__name:`Subpages`,props:{block:{type:Object,required:!0}},setup(_){return(v,y)=>(o(),i(`section`,null,[_.block.data.title?(o(),i(`h3`,h,l(_.block.data.title),1)):d(``,!0),r(`div`,{class:n(_.block.data.layout===`list`?`divide-y rounded-lg border bg-card`:`grid gap-3 @xl:grid-cols-2 @4xl:grid-cols-3`)},[(o(!0),i(s,null,a(_.block.props?.pages??[],i=>(o(),u(t(f),{key:i.id,href:i.url,class:n([`group flex items-center gap-3 hover:bg-accent/50`,_.block.data.layout===`list`?`px-4 py-3`:`rounded-lg border bg-card p-4`])},{default:c(()=>[e(t(p),{class:`size-5 shrink-0 text-brand-text`}),r(`span`,g,l(i.title),1),e(t(m),{class:`size-4 text-muted-foreground`})]),_:2},1032,[`href`,`class`]))),128)),(_.block.props?.pages??[]).length?d(``,!0):(o(),i(`p`,{key:0,class:n([`text-sm text-muted-foreground`,_.block.data.layout===`list`?`px-4 py-3`:``])},`Keine veröffentlichten Unterseiten.`,2))],2)]))}};export{_ as default}; \ No newline at end of file diff --git a/public/build/assets/Switch-CWN1_5O7.js b/public/build/assets/Switch-CWN1_5O7.js deleted file mode 100644 index f715597e..00000000 --- a/public/build/assets/Switch-CWN1_5O7.js +++ /dev/null @@ -1 +0,0 @@ -import{d as e,i as t}from"./usePrimitiveElement-DC7UloPZ.js";import{$n as n,B as r,D as i,Ht as a,L as o,On as s,Tn as c,Zn as l,b as u,ct as d,et as f,ft as p,g as m,gn as h,k as g,mt as _,o as v,qt as y,tt as b,un as x,v as S,vn as ee,xt as C,y as w,z as T}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as te,w as E}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{b as ne,d as re,k as D,l as ie,p as ae,s as oe}from"./dist-DtGNiYlK.js";import{n as se,r as ce,t as le}from"./VisuallyHiddenInput-BMUp3blB.js";var ue=D({name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]}),de=D({name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]}),fe=D({name:`heading`,size:24,node:[[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M6 20V4`,key:`1w1bmo`}],[`path`,{d:`M18 20V4`,key:`o2hl4u`}]]}),pe=D({name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]}),[me,he]=e(`SwitchRoot`),ge=g({inheritAttrs:!1,__name:`SwitchRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:`on`},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{disabled:a}=c(n),o=ne(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),l=m(()=>o.value===n.trueValue);function d(){a.value||(o.value=l.value?n.falseValue:n.trueValue)}let{forwardRef:p,currentElement:h}=ae(),g=ce(h),b=se(),x=m(()=>n.id&&h.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);return he({checked:l,toggleCheck:d,disabled:a}),(e,t)=>(_(),u(v,null,[i(s(re),f({id:e.id,ref:s(p),role:`switch`,type:e.as===`button`?`button`:void 0,value:e.value,"aria-label":e.$attrs[`aria-label`]||x.value,"aria-checked":l.value,"aria-required":e.required,"data-state":l.value?`checked`:`unchecked`,"data-disabled":s(a)?``:void 0,"as-child":e.asChild,as:e.as,disabled:s(a)},{...s(b),...e.$attrs},{onClick:d,onKeydown:te(E(d,[`prevent`]),[`enter`])}),{default:y(()=>[C(e.$slots,`default`,{modelValue:s(o),checked:l.value})]),_:3},16,[`id`,`type`,`value`,`aria-label`,`aria-checked`,`aria-required`,`data-state`,`data-disabled`,`as-child`,`as`,`disabled`,`onKeydown`]),s(g)&&e.name?(_(),S(s(le),f({key:0,type:`checkbox`,name:e.name,disabled:s(a),required:e.required,value:e.value,checked:l.value},s(b)),null,16,[`name`,`disabled`,`required`,`value`,`checked`])):w(`v-if`,!0)],64))}}),_e=g({__name:`SwitchThumb`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=me();return ae(),(e,n)=>(_(),S(s(re),{"data-state":s(t).checked.value?`checked`:`unchecked`,"data-disabled":s(t).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},{default:y(()=>[C(e.$slots,`default`)]),_:3},8,[`data-state`,`data-disabled`,`as-child`,`as`]))}}),ve=Object.defineProperty,ye=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable,Se=(e,t,n)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ce=(e,t)=>{for(var n in t||={})be.call(t,n)&&Se(e,n,t[n]);if(ye)for(var n of ye(t))xe.call(t,n)&&Se(e,n,t[n]);return e},we=(e,t)=>{var n={};for(var r in e)be.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ye)for(var r of ye(e))t.indexOf(r)<0&&xe.call(e,r)&&(n[r]=e[r]);return n},Te=`[vue-draggable-plus]: `;function Ee(e){console.warn(Te+e)}function De(e){console.error(Te+e)}function Oe(e,t,n){return n>=0&&nt?t.toUpperCase():``)}function Ae(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[ke(n)]=e[n]),t),{})}function je(e,t){return Array.isArray(e)&&e.splice(t,1),e}function Me(e,t,n){return Array.isArray(e)&&e.splice(t,0,n),e}function Ne(e){return e===void 0}function Pe(e){return typeof e==`string`}function Fe(e,t,n){let r=e.children[n];e.insertBefore(t,r)}function Ie(e){e.parentNode&&e.parentNode.removeChild(e)}function Le(e,t=document){let n=null;return n=typeof t?.querySelector==`function`?(t?.querySelector)?.call(t,e):document.querySelector(e),n||Ee(`Element not found: ${e}`),n}function Re(e,t,n=null){return function(...r){return e.apply(n,r),t.apply(n,r)}}function ze(e,t){let n=Ce({},e);return Object.keys(t).forEach(r=>{n[r]?n[r]=Re(e[r],t[r]):n[r]=t[r]}),n}function Be(e){return e instanceof HTMLElement}function Ve(e,t){Object.keys(e).forEach(n=>{t(n,e[n])})}function He(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97)}var Ue=Object.assign;function We(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function O(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function Je(e,t){if(e==null)return{};var n=qe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var Ye=`1.15.2`;function A(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}var j=A(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Xe=A(/Edge/i),Ze=A(/firefox/i),Qe=A(/safari/i)&&!A(/chrome/i)&&!A(/android/i),$e=A(/iP(ad|od|hone)/i),et=A(/chrome/i)&&A(/android/i),tt={capture:!1,passive:!1};function M(e,t,n){e.addEventListener(t,n,!j&&tt)}function N(e,t,n){e.removeEventListener(t,n,!j&&tt)}function nt(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function rt(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function P(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&nt(e,t):nt(e,t))||r&&e===n)return e;if(e===n)break}while(e=rt(e))}return null}var it=/\s+/g;function F(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(it,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(it,` `))}function I(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function at(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=I(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function ot(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i=a,!o)return r;if(r===L())break;r=ft(r,!1)}return!1}function ct(e,t,n,r){for(var i=0,a=0,o=e.children;a2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=Je(n,Ot);Et.pluginEvent.bind(Q)(e,t,O({dragEl:U,parentEl:W,ghostEl:G,rootEl:K,nextEl:kt,lastDownEl:At,cloneEl:q,cloneHidden:jt,dragStarted:Wt,putSortable:Y,activeSortable:Q.active,originalEvent:r,oldIndex:Mt,oldDraggableIndex:Nt,newIndex:J,newDraggableIndex:Pt,hideGhostForTarget:ln,unhideGhostForTarget:un,cloneNowHidden:function(){jt=!0},cloneNowShown:function(){jt=!1},dispatchSortableEvent:function(e){H({sortable:t,name:e,originalEvent:r})}},i))};function H(e){Dt(O({putSortable:Y,cloneEl:q,targetEl:U,rootEl:K,oldIndex:Mt,oldDraggableIndex:Nt,newIndex:J,newDraggableIndex:Pt},e))}var U,W,G,K,kt,At,q,jt,Mt,J,Nt,Pt,Ft,Y,It=!1,Lt=!1,Rt=[],zt,X,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt=!1,Jt=!1,Yt,Z,Xt=[],Zt=!1,Qt=[],$t=typeof document<`u`,en=$e,tn=Xe||j?`cssFloat`:`float`,nn=$t&&!et&&!$e&&`draggable`in document.createElement(`div`),rn=function(){if($t){if(j)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),an=function(e,t){var n=I(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=ct(e,0,t),a=ct(e,1,t),o=i&&I(i),s=a&&I(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+R(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+R(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[tn]===`none`||a&&n[tn]===`none`&&c+l>r)?`vertical`:`horizontal`},on=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},sn=function(e,t){var n;return Rt.some(function(r){var i=r[B].options.emptyInsertThreshold;if(i&&!lt(r)){var a=R(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},cn=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||Ge(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},ln=function(){!rn&&G&&I(G,`display`,`none`)},un=function(){!rn&&G&&I(G,`display`,``)};$t&&!et&&document.addEventListener(`click`,function(e){if(Lt)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Lt=!1,!1},!0);var dn=function(e){if(U){e=e.touches?e.touches[0]:e;var t=sn(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[B]._onDragOver(n)}}},fn=function(e){U&&U.parentNode[B]._isOutsideThisEl(e.target)};function Q(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=k({},t),e[B]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return an(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Q.supportPointer!==!1&&`PointerEvent`in window&&!Qe,emptyInsertThreshold:5};for(var r in Et.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in cn(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&nn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?M(e,`pointerdown`,this._onTapStart):(M(e,`mousedown`,this._onTapStart),M(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(M(e,`dragover`,this),M(e,`dragenter`,this)),Rt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),k(this,xt())}Q.prototype={constructor:Q,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Gt=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,U):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(Sn(n),!U&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Qe&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=P(s,r.draggable,n,!1),!(s&&s.animated)&&At!==s)){if(Mt=z(s),Nt=z(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){H({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),V(`filter`,t,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=P(c,r.trim(),n,!1),r)return H({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),V(`filter`,t,{evt:e}),!0}),l)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!P(c,r.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!U&&n.parentNode===i){var c=R(n);if(K=i,U=n,W=U.parentNode,kt=U.nextSibling,At=n,Ft=a.group,Q.dragged=U,zt={target:U,clientX:(t||e).clientX,clientY:(t||e).clientY},Ht=zt.clientX-c.left,Ut=zt.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,U.style[`will-change`]=`all`,s=function(){if(V(`delayEnded`,r,{evt:e}),Q.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Ze&&r.nativeDraggable&&(U.draggable=!0),r._triggerDragStart(e,t),H({sortable:r,name:`choose`,originalEvent:e}),F(U,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){ot(U,e.trim(),hn)}),M(o,`dragover`,dn),M(o,`mousemove`,dn),M(o,`touchmove`,dn),M(o,`mouseup`,r._onDrop),M(o,`touchend`,r._onDrop),M(o,`touchcancel`,r._onDrop),Ze&&this.nativeDraggable&&(this.options.touchStartThreshold=4,U.draggable=!0),V(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Xe||j))){if(Q.eventCanceled){this._onDrop();return}M(o,`mouseup`,r._disableDelayedDrag),M(o,`touchend`,r._disableDelayedDrag),M(o,`touchcancel`,r._disableDelayedDrag),M(o,`mousemove`,r._delayedDragTouchMoveHandler),M(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&M(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){U&&hn(U),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;N(e,`mouseup`,this._disableDelayedDrag),N(e,`touchend`,this._disableDelayedDrag),N(e,`touchcancel`,this._disableDelayedDrag),N(e,`mousemove`,this._delayedDragTouchMoveHandler),N(e,`touchmove`,this._delayedDragTouchMoveHandler),N(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?M(document,`pointermove`,this._onTouchMove):t?M(document,`touchmove`,this._onTouchMove):M(document,`mousemove`,this._onTouchMove):(M(U,`dragend`,this),M(K,`dragstart`,this._onDragStart));try{document.selection?Cn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(It=!1,K&&U){V(`dragStarted`,this,{evt:t}),this.nativeDraggable&&M(document,`dragover`,fn);var n=this.options;!e&&F(U,n.dragClass,!1),F(U,n.ghostClass,!0),Q.active=this,e&&this._appendGhost(),H({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(X){this._lastX=X.clientX,this._lastY=X.clientY,ln();for(var e=document.elementFromPoint(X.clientX,X.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(X.clientX,X.clientY),e!==t);)t=e;if(U.parentNode[B]._isOutsideThisEl(e),t)do{if(t[B]){var n=void 0;if(n=t[B]._onDragOver({clientX:X.clientX,clientY:X.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);un()}},_onTouchMove:function(e){if(zt){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=G&&at(G,!0),o=G&&a&&a.a,s=G&&a&&a.d,c=en&&Z&&ut(Z),l=(i.clientX-zt.clientX+r.x)/(o||1)+(c?c[0]-Xt[0]:0)/(o||1),u=(i.clientY-zt.clientY+r.y)/(s||1)+(c?c[1]-Xt[1]:0)/(s||1);if(!Q.active&&!It){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))=0&&(H({sortable:this,name:`update`,toEl:W,originalEvent:e}),H({sortable:this,name:`sort`,toEl:W,originalEvent:e})):(J>=0&&(H({rootEl:W,name:`add`,toEl:W,fromEl:K,originalEvent:e}),H({sortable:this,name:`remove`,toEl:W,originalEvent:e}),H({rootEl:W,name:`sort`,toEl:W,fromEl:K,originalEvent:e}),H({sortable:this,name:`sort`,toEl:W,originalEvent:e})),Y&&Y.save()),Q.active&&((J==null||J===-1)&&(J=Mt,Pt=Nt),H({sortable:this,name:`end`,toEl:W,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){V(`nulling`,this),K=U=W=G=kt=q=At=jt=zt=X=Wt=J=Pt=Mt=Nt=Gt=Kt=Y=Ft=Q.dragged=Q.ghost=Q.clone=Q.active=null,Qt.forEach(function(e){e.checked=!0}),Qt.length=Bt=Vt=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:U&&(this._onDragOver(e),pn(e));break;case`selectstart`:e.preventDefault()}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;ri.right+a||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+a||e.clientX>r.right&&e.clientY>r.top}function yn(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&Ytu+l*a/2:cd-Yt)return-Kt}else if(c>u+l*(1-i)/2&&cd-l*a/2)?c>u+l/2?1:-1:0}function bn(e){return z(U){if(e&&n?.length!==a.childNodes.length)return i.insertBefore(e,t.nextSibling),!0;let o=a.childNodes[r];e=a?.replaceChild(t,o)})}}catch(e){o=e}finally{n=null}b(()=>{if(Wn(),o)throw o})}let S={onUpdate:v,onStart:h,onAdd:g,onRemove:_,onEnd:y};function ee(e){let n=s(r);return e||=Pe(n)?Le(n,t?.$el):n,e&&!Be(e)&&(e=e.$el),e||De(`Root element not found`),e}function C(){let e=s(c)??{},{immediate:t,clone:n}=e,r=we(e,[`immediate`,`clone`]);return Ve(r,(e,t)=>{He(e)&&(r[e]=(e,...n)=>(Ue(e,Gn()),t(e,...n)))}),ze(i===null?{}:S,r)}let w=e=>{e=ee(e),l&&T.destroy(),l=new Q(e,C())};a(()=>c,()=>{l&&Ve(C(),(e,t)=>{l?.option(e,t)})},{deep:!0});let T={option:(e,t)=>l?.option(e,t),destroy:()=>{l?.destroy(),l=null},save:()=>l?.save(),toArray:()=>l?.toArray(),closest:(...e)=>l?.closest(...e)};return Vn(()=>{u&&w()}),Bn(T.destroy),Ce({start:w,pause:()=>T?.option(`disabled`,!0),resume:()=>T?.option(`disabled`,!1)},T)}var Jn=[`update`,`start`,`add`,`remove`,`choose`,`unchoose`,`end`,`sort`,`filter`,`clone`,`move`,`change`],Yn=[`clone`,`animation`,`ghostClass`,`group`,`sort`,`disabled`,`store`,`handle`,`draggable`,`swapThreshold`,`invertSwap`,`invertedSwapThreshold`,`removeCloneOnHide`,`direction`,`chosenClass`,`dragClass`,`ignore`,`filter`,`preventOnFilter`,`easing`,`setData`,`dropBubble`,`dragoverBubble`,`dataIdAttr`,`delay`,`delayOnTouchOnly`,`touchStartThreshold`,`forceFallback`,`fallbackClass`,`fallbackOnBody`,`fallbackTolerance`,`fallbackOffset`,`supportPointer`,`emptyInsertThreshold`,`scroll`,`forceAutoScrollFallback`,`scrollSensitivity`,`scrollSpeed`,`bubbleScroll`,`modelValue`,`tag`,`target`,`customUpdate`,...Jn.map(e=>`on${e.replace(/^\S/,e=>e.toUpperCase())}`)],Xn=g({name:`VueDraggable`,model:{prop:`modelValue`,event:`update:modelValue`},props:Yn,emits:[`update:modelValue`,...Jn],setup(e,{slots:t,emit:n,expose:i,attrs:a}){let o=Jn.reduce((e,t)=>{let r=`on${t.replace(/^\S/,e=>e.toUpperCase())}`;return e[r]=(...e)=>n(t,...e),e},{}),l=m(()=>{let t=c(e),{modelValue:n}=t,r=we(t,[`modelValue`]),i=Object.entries(r).reduce((e,[t,n])=>{let r=s(n);return r!==void 0&&(e[t]=r),e},{});return Ce(Ce({},o),Ae(Ce(Ce({},a),i)))}),u=m({get:()=>e.modelValue,set:e=>n(`update:modelValue`,e)}),d=ee(),f=h(qn(e.target||d,u,l));return i(f),()=>r(e.tag||`div`,{ref:d},(t?.default)?.call(t,f))}}),Zn={mounted:`mounted`,unmounted:`unmounted`};Zn.mounted,Zn.unmounted;var Qn=g({__name:`Switch`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},id:{},value:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:r}){let a=e,o=r,c=oe(a,`class`),u=t(c,o);return(e,t)=>(_(),S(s(ge),f({"data-slot":`switch`},s(u),{class:s(ie)(`peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50`,a.class)}),{default:y(t=>[i(s(_e),{"data-slot":`switch-thumb`,class:l(s(ie)(`bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0`))},{default:y(()=>[C(e.$slots,`thumb`,n(T(t)))]),_:2},1032,[`class`])]),_:3},16,[`class`]))}});export{de as a,fe as i,Xn as n,ue as o,pe as r,Qn as t}; \ No newline at end of file diff --git a/public/build/assets/Switch-DtqyAsXz.js b/public/build/assets/Switch-DtqyAsXz.js new file mode 100644 index 00000000..8c91f78e --- /dev/null +++ b/public/build/assets/Switch-DtqyAsXz.js @@ -0,0 +1 @@ +import{d as e,i as t}from"./usePrimitiveElement-DC7UloPZ.js";import{$n as n,B as r,D as i,Ht as a,L as o,On as s,Tn as c,Zn as l,b as u,ct as d,et as f,ft as p,g as m,gn as h,k as g,mt as _,o as v,qt as y,tt as b,un as x,v as S,vn as ee,xt as C,y as w,z as T}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as te,w as E}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{b as ne,d as D,k as re,l as ie,p as ae,s as oe}from"./dist-DtGNiYlK.js";import{n as se,r as ce,t as le}from"./VisuallyHiddenInput-BMUp3blB.js";var ue=re({name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]}),de=re({name:`heading`,size:24,node:[[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M6 20V4`,key:`1w1bmo`}],[`path`,{d:`M18 20V4`,key:`o2hl4u`}]]}),fe=re({name:`text-align-start`,size:24,node:[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],aliases:[`text`,`align-left`]}),[pe,me]=e(`SwitchRoot`),he=g({inheritAttrs:!1,__name:`SwitchRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},id:{type:String,required:!1},value:{type:String,required:!1,default:`on`},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{disabled:a}=c(n),o=ne(n,`modelValue`,r,{defaultValue:n.defaultValue??n.falseValue,passive:n.modelValue===void 0}),l=m(()=>o.value===n.trueValue);function d(){a.value||(o.value=l.value?n.falseValue:n.trueValue)}let{forwardRef:p,currentElement:h}=ae(),g=ce(h),b=se(),x=m(()=>n.id&&h.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);return me({checked:l,toggleCheck:d,disabled:a}),(e,t)=>(_(),u(v,null,[i(s(D),f({id:e.id,ref:s(p),role:`switch`,type:e.as===`button`?`button`:void 0,value:e.value,"aria-label":e.$attrs[`aria-label`]||x.value,"aria-checked":l.value,"aria-required":e.required,"data-state":l.value?`checked`:`unchecked`,"data-disabled":s(a)?``:void 0,"as-child":e.asChild,as:e.as,disabled:s(a)},{...s(b),...e.$attrs},{onClick:d,onKeydown:te(E(d,[`prevent`]),[`enter`])}),{default:y(()=>[C(e.$slots,`default`,{modelValue:s(o),checked:l.value})]),_:3},16,[`id`,`type`,`value`,`aria-label`,`aria-checked`,`aria-required`,`data-state`,`data-disabled`,`as-child`,`as`,`disabled`,`onKeydown`]),s(g)&&e.name?(_(),S(s(le),f({key:0,type:`checkbox`,name:e.name,disabled:s(a),required:e.required,value:e.value,checked:l.value},s(b)),null,16,[`name`,`disabled`,`required`,`value`,`checked`])):w(`v-if`,!0)],64))}}),ge=g({__name:`SwitchThumb`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let t=pe();return ae(),(e,n)=>(_(),S(s(D),{"data-state":s(t).checked.value?`checked`:`unchecked`,"data-disabled":s(t).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},{default:y(()=>[C(e.$slots,`default`)]),_:3},8,[`data-state`,`data-disabled`,`as-child`,`as`]))}}),_e=Object.defineProperty,ve=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,xe=(e,t,n)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Se=(e,t)=>{for(var n in t||={})ye.call(t,n)&&xe(e,n,t[n]);if(ve)for(var n of ve(t))be.call(t,n)&&xe(e,n,t[n]);return e},Ce=(e,t)=>{var n={};for(var r in e)ye.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ve)for(var r of ve(e))t.indexOf(r)<0&&be.call(e,r)&&(n[r]=e[r]);return n},we=`[vue-draggable-plus]: `;function Te(e){console.warn(we+e)}function Ee(e){console.error(we+e)}function De(e,t,n){return n>=0&&nt?t.toUpperCase():``)}function ke(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[Oe(n)]=e[n]),t),{})}function Ae(e,t){return Array.isArray(e)&&e.splice(t,1),e}function je(e,t,n){return Array.isArray(e)&&e.splice(t,0,n),e}function Me(e){return e===void 0}function Ne(e){return typeof e==`string`}function Pe(e,t,n){let r=e.children[n];e.insertBefore(t,r)}function Fe(e){e.parentNode&&e.parentNode.removeChild(e)}function Ie(e,t=document){let n=null;return n=typeof t?.querySelector==`function`?(t?.querySelector)?.call(t,e):document.querySelector(e),n||Te(`Element not found: ${e}`),n}function Le(e,t,n=null){return function(...r){return e.apply(n,r),t.apply(n,r)}}function Re(e,t){let n=Se({},e);return Object.keys(t).forEach(r=>{n[r]?n[r]=Le(e[r],t[r]):n[r]=t[r]}),n}function ze(e){return e instanceof HTMLElement}function Be(e,t){Object.keys(e).forEach(n=>{t(n,e[n])})}function Ve(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97)}var He=Object.assign;function Ue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function O(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function qe(e,t){if(e==null)return{};var n=Ke(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var Je=`1.15.2`;function A(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}var j=A(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ye=A(/Edge/i),Xe=A(/firefox/i),Ze=A(/safari/i)&&!A(/chrome/i)&&!A(/android/i),Qe=A(/iP(ad|od|hone)/i),$e=A(/chrome/i)&&A(/android/i),et={capture:!1,passive:!1};function M(e,t,n){e.addEventListener(t,n,!j&&et)}function N(e,t,n){e.removeEventListener(t,n,!j&&et)}function tt(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function nt(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function P(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&tt(e,t):tt(e,t))||r&&e===n)return e;if(e===n)break}while(e=nt(e))}return null}var rt=/\s+/g;function F(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(rt,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(rt,` `))}function I(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function it(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=I(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function at(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i=a,!o)return r;if(r===L())break;r=dt(r,!1)}return!1}function st(e,t,n,r){for(var i=0,a=0,o=e.children;a2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=qe(n,Dt);Tt.pluginEvent.bind(Q)(e,t,O({dragEl:U,parentEl:W,ghostEl:G,rootEl:K,nextEl:Ot,lastDownEl:kt,cloneEl:q,cloneHidden:At,dragStarted:Ut,putSortable:Y,activeSortable:Q.active,originalEvent:r,oldIndex:jt,oldDraggableIndex:Mt,newIndex:J,newDraggableIndex:Nt,hideGhostForTarget:cn,unhideGhostForTarget:ln,cloneNowHidden:function(){At=!0},cloneNowShown:function(){At=!1},dispatchSortableEvent:function(e){H({sortable:t,name:e,originalEvent:r})}},i))};function H(e){Et(O({putSortable:Y,cloneEl:q,targetEl:U,rootEl:K,oldIndex:jt,oldDraggableIndex:Mt,newIndex:J,newDraggableIndex:Nt},e))}var U,W,G,K,Ot,kt,q,At,jt,J,Mt,Nt,Pt,Y,Ft=!1,It=!1,Lt=[],Rt,X,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt=!1,qt=!1,Jt,Z,Yt=[],Xt=!1,Zt=[],Qt=typeof document<`u`,$t=Qe,en=Ye||j?`cssFloat`:`float`,tn=Qt&&!$e&&!Qe&&`draggable`in document.createElement(`div`),nn=function(){if(Qt){if(j)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),rn=function(e,t){var n=I(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=st(e,0,t),a=st(e,1,t),o=i&&I(i),s=a&&I(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+R(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+R(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[en]===`none`||a&&n[en]===`none`&&c+l>r)?`vertical`:`horizontal`},an=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},on=function(e,t){var n;return Lt.some(function(r){var i=r[B].options.emptyInsertThreshold;if(i&&!ct(r)){var a=R(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},sn=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||We(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},cn=function(){!nn&&G&&I(G,`display`,`none`)},ln=function(){!nn&&G&&I(G,`display`,``)};Qt&&!$e&&document.addEventListener(`click`,function(e){if(It)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),It=!1,!1},!0);var un=function(e){if(U){e=e.touches?e.touches[0]:e;var t=on(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[B]._onDragOver(n)}}},dn=function(e){U&&U.parentNode[B]._isOutsideThisEl(e.target)};function Q(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=k({},t),e[B]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return rn(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Q.supportPointer!==!1&&`PointerEvent`in window&&!Ze,emptyInsertThreshold:5};for(var r in Tt.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in sn(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&tn,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?M(e,`pointerdown`,this._onTapStart):(M(e,`mousedown`,this._onTapStart),M(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(M(e,`dragover`,this),M(e,`dragenter`,this)),Lt.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),k(this,bt())}Q.prototype={constructor:Q,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Wt=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,U):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(xn(n),!U&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&Ze&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=P(s,r.draggable,n,!1),!(s&&s.animated)&&kt!==s)){if(jt=z(s),Mt=z(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){H({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),V(`filter`,t,{evt:e}),i&&e.cancelable&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=P(c,r.trim(),n,!1),r)return H({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),V(`filter`,t,{evt:e}),!0}),l)){i&&e.cancelable&&e.preventDefault();return}r.handle&&!P(c,r.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!U&&n.parentNode===i){var c=R(n);if(K=i,U=n,W=U.parentNode,Ot=U.nextSibling,kt=n,Pt=a.group,Q.dragged=U,Rt={target:U,clientX:(t||e).clientX,clientY:(t||e).clientY},Vt=Rt.clientX-c.left,Ht=Rt.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,U.style[`will-change`]=`all`,s=function(){if(V(`delayEnded`,r,{evt:e}),Q.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Xe&&r.nativeDraggable&&(U.draggable=!0),r._triggerDragStart(e,t),H({sortable:r,name:`choose`,originalEvent:e}),F(U,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){at(U,e.trim(),mn)}),M(o,`dragover`,un),M(o,`mousemove`,un),M(o,`touchmove`,un),M(o,`mouseup`,r._onDrop),M(o,`touchend`,r._onDrop),M(o,`touchcancel`,r._onDrop),Xe&&this.nativeDraggable&&(this.options.touchStartThreshold=4,U.draggable=!0),V(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Ye||j))){if(Q.eventCanceled){this._onDrop();return}M(o,`mouseup`,r._disableDelayedDrag),M(o,`touchend`,r._disableDelayedDrag),M(o,`touchcancel`,r._disableDelayedDrag),M(o,`mousemove`,r._delayedDragTouchMoveHandler),M(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&M(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){U&&mn(U),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;N(e,`mouseup`,this._disableDelayedDrag),N(e,`touchend`,this._disableDelayedDrag),N(e,`touchcancel`,this._disableDelayedDrag),N(e,`mousemove`,this._delayedDragTouchMoveHandler),N(e,`touchmove`,this._delayedDragTouchMoveHandler),N(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?M(document,`pointermove`,this._onTouchMove):t?M(document,`touchmove`,this._onTouchMove):M(document,`mousemove`,this._onTouchMove):(M(U,`dragend`,this),M(K,`dragstart`,this._onDragStart));try{document.selection?Sn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Ft=!1,K&&U){V(`dragStarted`,this,{evt:t}),this.nativeDraggable&&M(document,`dragover`,dn);var n=this.options;!e&&F(U,n.dragClass,!1),F(U,n.ghostClass,!0),Q.active=this,e&&this._appendGhost(),H({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(X){this._lastX=X.clientX,this._lastY=X.clientY,cn();for(var e=document.elementFromPoint(X.clientX,X.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(X.clientX,X.clientY),e!==t);)t=e;if(U.parentNode[B]._isOutsideThisEl(e),t)do{if(t[B]){var n=void 0;if(n=t[B]._onDragOver({clientX:X.clientX,clientY:X.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);ln()}},_onTouchMove:function(e){if(Rt){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=G&&it(G,!0),o=G&&a&&a.a,s=G&&a&&a.d,c=$t&&Z&<(Z),l=(i.clientX-Rt.clientX+r.x)/(o||1)+(c?c[0]-Yt[0]:0)/(o||1),u=(i.clientY-Rt.clientY+r.y)/(s||1)+(c?c[1]-Yt[1]:0)/(s||1);if(!Q.active&&!Ft){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))=0&&(H({sortable:this,name:`update`,toEl:W,originalEvent:e}),H({sortable:this,name:`sort`,toEl:W,originalEvent:e})):(J>=0&&(H({rootEl:W,name:`add`,toEl:W,fromEl:K,originalEvent:e}),H({sortable:this,name:`remove`,toEl:W,originalEvent:e}),H({rootEl:W,name:`sort`,toEl:W,fromEl:K,originalEvent:e}),H({sortable:this,name:`sort`,toEl:W,originalEvent:e})),Y&&Y.save()),Q.active&&((J==null||J===-1)&&(J=jt,Nt=Mt),H({sortable:this,name:`end`,toEl:W,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){V(`nulling`,this),K=U=W=G=Ot=q=kt=At=Rt=X=Ut=J=Nt=jt=Mt=Wt=Gt=Y=Pt=Q.dragged=Q.ghost=Q.clone=Q.active=null,Zt.forEach(function(e){e.checked=!0}),Zt.length=zt=Bt=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:U&&(this._onDragOver(e),fn(e));break;case`selectstart`:e.preventDefault()}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;ri.right+a||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+a||e.clientX>r.right&&e.clientY>r.top}function vn(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&Jtu+l*a/2:cd-Jt)return-Gt}else if(c>u+l*(1-i)/2&&cd-l*a/2)?c>u+l/2?1:-1:0}function yn(e){return z(U){if(e&&n?.length!==a.childNodes.length)return i.insertBefore(e,t.nextSibling),!0;let o=a.childNodes[r];e=a?.replaceChild(t,o)})}}catch(e){o=e}finally{n=null}b(()=>{if(Un(),o)throw o})}let S={onUpdate:v,onStart:h,onAdd:g,onRemove:_,onEnd:y};function ee(e){let n=s(r);return e||=Ne(n)?Ie(n,t?.$el):n,e&&!ze(e)&&(e=e.$el),e||Ee(`Root element not found`),e}function C(){let e=s(c)??{},{immediate:t,clone:n}=e,r=Ce(e,[`immediate`,`clone`]);return Be(r,(e,t)=>{Ve(e)&&(r[e]=(e,...n)=>(He(e,Wn()),t(e,...n)))}),Re(i===null?{}:S,r)}let w=e=>{e=ee(e),l&&T.destroy(),l=new Q(e,C())};a(()=>c,()=>{l&&Be(C(),(e,t)=>{l?.option(e,t)})},{deep:!0});let T={option:(e,t)=>l?.option(e,t),destroy:()=>{l?.destroy(),l=null},save:()=>l?.save(),toArray:()=>l?.toArray(),closest:(...e)=>l?.closest(...e)};return Bn(()=>{u&&w()}),zn(T.destroy),Se({start:w,pause:()=>T?.option(`disabled`,!0),resume:()=>T?.option(`disabled`,!1)},T)}var qn=[`update`,`start`,`add`,`remove`,`choose`,`unchoose`,`end`,`sort`,`filter`,`clone`,`move`,`change`],Jn=[`clone`,`animation`,`ghostClass`,`group`,`sort`,`disabled`,`store`,`handle`,`draggable`,`swapThreshold`,`invertSwap`,`invertedSwapThreshold`,`removeCloneOnHide`,`direction`,`chosenClass`,`dragClass`,`ignore`,`filter`,`preventOnFilter`,`easing`,`setData`,`dropBubble`,`dragoverBubble`,`dataIdAttr`,`delay`,`delayOnTouchOnly`,`touchStartThreshold`,`forceFallback`,`fallbackClass`,`fallbackOnBody`,`fallbackTolerance`,`fallbackOffset`,`supportPointer`,`emptyInsertThreshold`,`scroll`,`forceAutoScrollFallback`,`scrollSensitivity`,`scrollSpeed`,`bubbleScroll`,`modelValue`,`tag`,`target`,`customUpdate`,...qn.map(e=>`on${e.replace(/^\S/,e=>e.toUpperCase())}`)],Yn=g({name:`VueDraggable`,model:{prop:`modelValue`,event:`update:modelValue`},props:Jn,emits:[`update:modelValue`,...qn],setup(e,{slots:t,emit:n,expose:i,attrs:a}){let o=qn.reduce((e,t)=>{let r=`on${t.replace(/^\S/,e=>e.toUpperCase())}`;return e[r]=(...e)=>n(t,...e),e},{}),l=m(()=>{let t=c(e),{modelValue:n}=t,r=Ce(t,[`modelValue`]),i=Object.entries(r).reduce((e,[t,n])=>{let r=s(n);return r!==void 0&&(e[t]=r),e},{});return Se(Se({},o),ke(Se(Se({},a),i)))}),u=m({get:()=>e.modelValue,set:e=>n(`update:modelValue`,e)}),d=ee(),f=h(Kn(e.target||d,u,l));return i(f),()=>r(e.tag||`div`,{ref:d},(t?.default)?.call(t,f))}}),Xn={mounted:`mounted`,unmounted:`unmounted`};Xn.mounted,Xn.unmounted;var Zn=g({__name:`Switch`,props:{defaultValue:{},modelValue:{},disabled:{type:Boolean},id:{},value:{},trueValue:{},falseValue:{},asChild:{type:Boolean},as:{},name:{},required:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:r}){let a=e,o=r,c=oe(a,`class`),u=t(c,o);return(e,t)=>(_(),S(s(he),f({"data-slot":`switch`},s(u),{class:s(ie)(`peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50`,a.class)}),{default:y(t=>[i(s(ge),{"data-slot":`switch-thumb`,class:l(s(ie)(`bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0`))},{default:y(()=>[C(e.$slots,`thumb`,n(T(t)))]),_:2},1032,[`class`])]),_:3},16,[`class`]))}});export{ue as a,de as i,Yn as n,fe as r,Zn as t}; \ No newline at end of file diff --git a/public/build/assets/Text-BEgy2ho_.js b/public/build/assets/Text-BEgy2ho_.js deleted file mode 100644 index edfaa53e..00000000 --- a/public/build/assets/Text-BEgy2ho_.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RichTextEditor-qslPmeeg.js","assets/usePrimitiveElement-DC7UloPZ.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/dist-DtGNiYlK.js","assets/AppIcon-0N56IC2z.js","assets/app-Bu3kn8yd.js","assets/app-CL30rx2M.css","assets/RovingFocusGroup-D88K7krN.js","assets/http-DmyDwIce.js","assets/check-AfxJa8Ew.js","assets/list-DHYGZ2vt.js","assets/quote-CAgJDpoy.js","assets/RichTextEditor-Lf5W1_X5.css"])))=>i.map(i=>d[i]); -import{D as e,J as t,O as n,On as r,b as i,mt as a,vn as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{s}from"./app-Bu3kn8yd.js";var c=[`innerHTML`],l={__name:`Text`,props:{block:{type:Object,required:!0}},setup(l){let u=t(`pagebuilder:editing`,!1),d=n(()=>s(()=>import(`./RichTextEditor-qslPmeeg.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),f=o(null);function p(e){e.target.closest(`.ProseMirror, [role="toolbar"]`)||f.value?.focus()}return(t,n)=>r(u)?(a(),i(`div`,{key:0,class:`min-h-16 cursor-text pt-3 [&_.tiptap]:min-h-10`,onClick:p},[e(r(d),{ref_key:`editorRef`,ref:f,modelValue:l.block.data.html,"onUpdate:modelValue":n[0]||=e=>l.block.data.html=e,placeholder:`Text eingeben …`},null,8,[`modelValue`])])):(a(),i(`div`,{key:1,class:`prose prose-neutral max-w-none prose-headings:tracking-tight prose-img:rounded-lg`,innerHTML:l.block.data.html},null,8,c))}};export{l as default}; \ No newline at end of file diff --git a/public/build/assets/Text-z90Y59eg.js b/public/build/assets/Text-z90Y59eg.js new file mode 100644 index 00000000..cf7430a5 --- /dev/null +++ b/public/build/assets/Text-z90Y59eg.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RichTextEditor-CT-rIT4q.js","assets/usePrimitiveElement-DC7UloPZ.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/dist-DtGNiYlK.js","assets/AppIcon-nlhvQfK7.js","assets/app-BNwrc_lv.js","assets/app-Bv2m9wnk.css","assets/RovingFocusGroup-D88K7krN.js","assets/http-CAG9BrJF.js","assets/check-AfxJa8Ew.js","assets/image-plus-C1A_7CFG.js","assets/images-47Nc0alu.js","assets/list-DHYGZ2vt.js","assets/quote-CAgJDpoy.js","assets/RichTextEditor-Lf5W1_X5.css"])))=>i.map(i=>d[i]); +import{D as e,J as t,O as n,On as r,b as i,mt as a,vn as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{s}from"./app-BNwrc_lv.js";var c=[`innerHTML`],l={__name:`Text`,props:{block:{type:Object,required:!0}},setup(l){let u=t(`pagebuilder:editing`,!1),d=n(()=>s(()=>import(`./RichTextEditor-CT-rIT4q.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))),f=o(null);function p(e){e.target.closest(`.ProseMirror, [role="toolbar"]`)||f.value?.focus()}return(t,n)=>r(u)?(a(),i(`div`,{key:0,class:`min-h-16 cursor-text pt-3 [&_.tiptap]:min-h-10`,onClick:p},[e(r(d),{ref_key:`editorRef`,ref:f,modelValue:l.block.data.html,"onUpdate:modelValue":n[0]||=e=>l.block.data.html=e,placeholder:`Text eingeben …`},null,8,[`modelValue`])])):(a(),i(`div`,{key:1,class:`prose prose-neutral max-w-none prose-headings:tracking-tight prose-img:rounded-lg`,innerHTML:l.block.data.html},null,8,c))}};export{l as default}; \ No newline at end of file diff --git a/public/build/assets/Ticket-oyqxLk_w.js b/public/build/assets/Ticket-DQFll5zs.js similarity index 96% rename from public/build/assets/Ticket-oyqxLk_w.js rename to public/build/assets/Ticket-DQFll5zs.js index ffdd4b59..57d22570 100644 --- a/public/build/assets/Ticket-oyqxLk_w.js +++ b/public/build/assets/Ticket-DQFll5zs.js @@ -1 +1 @@ -import{D as e,E as t,Ht as n,On as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as ee}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as m,i as h,r as g}from"./app-Bu3kn8yd.js";import{O as te,k as _}from"./dist-DtGNiYlK.js";import{B as ne,G as re,O as ie,p as v,q as y}from"./AppIcon-0N56IC2z.js";import{t as b}from"./arrow-left-BMImfTf2.js";import{t as x}from"./AppLayout-BxsYt2ib.js";import{o as S}from"./http-DmyDwIce.js";import{t as C}from"./paperclip-DmVAQ5Y5.js";import{t as w}from"./send-6fmdiUe6.js";import{t as T}from"./button-ZHC5mKey.js";import{t as E}from"./Textarea-DEFXqC2w.js";import{t as D}from"./StatusBadge-udDF6Kfz.js";import{r as O,t as k}from"./status-p0CPKwc2.js";var A=_({name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]}),j={class:`grid grid-cols-1 items-start gap-6 lg:grid-cols-12`},M={class:`grid min-w-0 grid-cols-1 gap-6 lg:col-span-8`},N={class:`rounded-xl border bg-card p-6 shadow-xs`},P={class:`flex flex-wrap items-start justify-between gap-3`},F={class:`min-w-0`},I={class:`text-xs font-medium text-muted-foreground`},L={class:`mt-1 text-2xl font-semibold tracking-tight text-balance`},R={key:0,class:`mt-5 text-[15px] leading-relaxed whitespace-pre-line`},z={key:0,"aria-label":`Verlauf`,class:`grid gap-4`},B={key:0,class:`grid size-9 shrink-0 place-items-center rounded-full bg-brand text-brand-foreground`},V={key:2,class:`grid size-9 shrink-0 place-items-center rounded-full bg-muted`},ae={class:`mb-1 text-xs text-muted-foreground`},H={class:`font-medium text-foreground`},U={class:`text-sm leading-relaxed whitespace-pre-line`},W={for:`message`,class:`text-sm font-medium`},G={key:0,class:`mt-1 text-[13px] text-destructive`},K={class:`mt-3 flex justify-end`},q={class:`grid content-start gap-4 lg:col-span-4`},J={class:`rounded-xl border bg-card p-5 shadow-xs`},oe={class:`grid gap-2.5 text-sm`},se={key:0,class:`flex items-center gap-2`},ce={key:1,class:`flex items-center gap-2`},le={key:2,class:`flex items-center gap-2`},ue={class:`flex items-center gap-2`},Y={key:0,class:`rounded-xl border bg-card p-5 shadow-xs`},de={class:`grid gap-1`},fe=[`href`],pe={class:`min-w-0 flex-1 truncate`},me={class:`text-xs text-muted-foreground`},X={__name:`Ticket`,props:{ticket:{type:Object,required:!0}},setup(_){let X=_,Z=m(),Q=Z.props.auth?.user;n(()=>Z.props.flash.status,e=>e&&S.success(e),{immediate:!0});let $=h({message:``});function he(){$.post(`/it-service/tickets/${X.ticket.id}/antworten`,{preserveScroll:!0,onSuccess:()=>$.reset()})}let ge=e=>e?e>1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`:``;return(n,m)=>(c(),f(x,{title:_.ticket.subject},{default:u(()=>[e(r(g),{href:`/it-service`,class:`mb-3 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:u(()=>[e(r(b),{class:`size-4`}),m[1]||=t(` Meine IT`,-1)]),_:1}),a(`div`,j,[a(`div`,M,[a(`article`,N,[a(`div`,P,[a(`div`,F,[a(`p`,I,[_.ticket.number?(c(),o(l,{key:0},[t(`Ticket #`+d(_.ticket.number)+` · `,1)],64)):p(``,!0),t(`erstellt `+d(r(k)(_.ticket.created_at,!0)),1)]),a(`h1`,L,d(_.ticket.subject),1)]),e(D,{label:_.ticket.status_label,tone:r(O)(_.ticket),class:`text-xs`},null,8,[`label`,`tone`])]),_.ticket.description?(c(),o(`p`,R,d(_.ticket.description),1)):p(``,!0)]),_.ticket.replies.length?(c(),o(`section`,z,[(c(!0),o(l,null,s(_.ticket.replies,(n,s)=>(c(),o(`div`,{key:s,class:i([`flex gap-3`,n.from_staff?``:`flex-row-reverse`])},[n.from_staff?(c(),o(`span`,B,[e(r(y),{class:`size-4`})])):r(Q)?(c(),f(v,{key:1,person:r(Q),class:`size-9`},null,8,[`person`])):(c(),o(`span`,V,[e(r(ie),{class:`size-4`})])),a(`div`,{class:i([`max-w-[85%] rounded-xl border px-4 py-3`,n.from_staff?`bg-card`:`border-brand-200 bg-brand-soft/60`])},[a(`p`,ae,[a(`span`,H,d(n.from_staff?n.author||`IT-Service`:`Sie`),1),n.created_at?(c(),o(l,{key:0},[t(` · `+d(r(k)(n.created_at,!0)),1)],64)):p(``,!0)]),a(`p`,U,d(n.message),1)],2)],2))),128))])):p(``,!0),a(`form`,{class:`rounded-xl border bg-card p-4 shadow-xs`,onSubmit:ee(he,[`prevent`])},[a(`label`,W,d(_.ticket.open?`Antworten`:`Das Ticket ist abgeschlossen – mit einer Antwort können Sie sich erneut melden.`),1),e(r(E),{id:`message`,modelValue:r($).message,"onUpdate:modelValue":m[0]||=e=>r($).message=e,rows:`4`,maxlength:`20000`,class:`mt-2`,placeholder:`Ihre Nachricht an die IT …`},null,8,[`modelValue`]),r($).errors.message?(c(),o(`p`,G,d(r($).errors.message),1)):p(``,!0),a(`div`,K,[e(r(T),{type:`submit`,disabled:r($).processing||!r($).message.trim()},{default:u(()=>[r($).processing?(c(),f(r(te),{key:0,class:`animate-spin`})):(c(),f(r(w),{key:1})),m[2]||=t(` Senden `,-1)]),_:1},8,[`disabled`])])],32)]),a(`aside`,q,[a(`section`,J,[m[7]||=a(`h2`,{class:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Details`,-1),a(`dl`,oe,[_.ticket.asset?(c(),o(`div`,se,[e(r(re),{class:`size-4 text-muted-foreground`}),m[3]||=a(`dt`,{class:`sr-only`},`Gerät`,-1),a(`dd`,null,d(_.ticket.asset),1)])):p(``,!0),_.ticket.category?(c(),o(`div`,ce,[e(r(A),{class:`size-4 text-muted-foreground`}),m[4]||=a(`dt`,{class:`sr-only`},`Kategorie`,-1),a(`dd`,null,d(_.ticket.category),1)])):p(``,!0),_.ticket.location?(c(),o(`div`,le,[e(r(ne),{class:`size-4 text-muted-foreground`}),m[5]||=a(`dt`,{class:`sr-only`},`Standort`,-1),a(`dd`,null,d(_.ticket.location),1)])):p(``,!0),a(`div`,ue,[e(r(y),{class:`size-4 text-muted-foreground`}),m[6]||=a(`dt`,{class:`sr-only`},`Bearbeitet von`,-1),a(`dd`,null,d(_.ticket.assignees.length?_.ticket.assignees.join(`, `):`Noch nicht zugewiesen`),1)])])]),_.ticket.attachments.length?(c(),o(`section`,Y,[m[8]||=a(`h2`,{class:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Anhänge`,-1),a(`ul`,de,[(c(!0),o(l,null,s(_.ticket.attachments,t=>(c(),o(`li`,{key:t.id},[a(`a`,{href:`/it-service/anhaenge/${t.id}`,class:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent`},[e(r(C),{class:`size-4 text-muted-foreground`}),a(`span`,pe,d(t.name),1),a(`span`,me,d(ge(t.size)),1)],8,fe)]))),128))])])):p(``,!0)])])]),_:1},8,[`title`]))}};export{X as default}; \ No newline at end of file +import{D as e,E as t,Ht as n,On as r,Zn as i,_ as a,b as o,bt as s,mt as c,o as l,qt as u,tr as d,v as f,y as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as ee}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as m,i as h,r as g}from"./app-BNwrc_lv.js";import{O as te,k as _}from"./dist-DtGNiYlK.js";import{B as ne,G as re,O as ie,p as v,q as y}from"./AppIcon-nlhvQfK7.js";import{t as b}from"./arrow-left-BMImfTf2.js";import{t as x}from"./AppLayout-esQiy2nD.js";import{s as S}from"./http-CAG9BrJF.js";import{t as C}from"./paperclip-DmVAQ5Y5.js";import{t as w}from"./send-6fmdiUe6.js";import{n as T}from"./button-CwUSbS9X.js";import{t as E}from"./Textarea-DEFXqC2w.js";import{t as D}from"./StatusBadge-udDF6Kfz.js";import{r as O,t as k}from"./status-p0CPKwc2.js";var A=_({name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]}),j={class:`grid grid-cols-1 items-start gap-6 lg:grid-cols-12`},M={class:`grid min-w-0 grid-cols-1 gap-6 lg:col-span-8`},N={class:`rounded-xl border bg-card p-6 shadow-xs`},P={class:`flex flex-wrap items-start justify-between gap-3`},F={class:`min-w-0`},I={class:`text-xs font-medium text-muted-foreground`},L={class:`mt-1 text-2xl font-semibold tracking-tight text-balance`},R={key:0,class:`mt-5 text-[15px] leading-relaxed whitespace-pre-line`},z={key:0,"aria-label":`Verlauf`,class:`grid gap-4`},B={key:0,class:`grid size-9 shrink-0 place-items-center rounded-full bg-brand text-brand-foreground`},V={key:2,class:`grid size-9 shrink-0 place-items-center rounded-full bg-muted`},ae={class:`mb-1 text-xs text-muted-foreground`},H={class:`font-medium text-foreground`},U={class:`text-sm leading-relaxed whitespace-pre-line`},W={for:`message`,class:`text-sm font-medium`},G={key:0,class:`mt-1 text-[13px] text-destructive`},K={class:`mt-3 flex justify-end`},q={class:`grid content-start gap-4 lg:col-span-4`},J={class:`rounded-xl border bg-card p-5 shadow-xs`},oe={class:`grid gap-2.5 text-sm`},se={key:0,class:`flex items-center gap-2`},ce={key:1,class:`flex items-center gap-2`},le={key:2,class:`flex items-center gap-2`},ue={class:`flex items-center gap-2`},Y={key:0,class:`rounded-xl border bg-card p-5 shadow-xs`},de={class:`grid gap-1`},fe=[`href`],pe={class:`min-w-0 flex-1 truncate`},me={class:`text-xs text-muted-foreground`},X={__name:`Ticket`,props:{ticket:{type:Object,required:!0}},setup(_){let X=_,Z=m(),Q=Z.props.auth?.user;n(()=>Z.props.flash.status,e=>e&&S.success(e),{immediate:!0});let $=h({message:``});function he(){$.post(`/it-service/tickets/${X.ticket.id}/antworten`,{preserveScroll:!0,onSuccess:()=>$.reset()})}let ge=e=>e?e>1048576?`${(e/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`:``;return(n,m)=>(c(),f(x,{title:_.ticket.subject},{default:u(()=>[e(r(g),{href:`/it-service`,class:`mb-3 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:u(()=>[e(r(b),{class:`size-4`}),m[1]||=t(` Meine IT`,-1)]),_:1}),a(`div`,j,[a(`div`,M,[a(`article`,N,[a(`div`,P,[a(`div`,F,[a(`p`,I,[_.ticket.number?(c(),o(l,{key:0},[t(`Ticket #`+d(_.ticket.number)+` · `,1)],64)):p(``,!0),t(`erstellt `+d(r(k)(_.ticket.created_at,!0)),1)]),a(`h1`,L,d(_.ticket.subject),1)]),e(D,{label:_.ticket.status_label,tone:r(O)(_.ticket),class:`text-xs`},null,8,[`label`,`tone`])]),_.ticket.description?(c(),o(`p`,R,d(_.ticket.description),1)):p(``,!0)]),_.ticket.replies.length?(c(),o(`section`,z,[(c(!0),o(l,null,s(_.ticket.replies,(n,s)=>(c(),o(`div`,{key:s,class:i([`flex gap-3`,n.from_staff?``:`flex-row-reverse`])},[n.from_staff?(c(),o(`span`,B,[e(r(y),{class:`size-4`})])):r(Q)?(c(),f(v,{key:1,person:r(Q),class:`size-9`},null,8,[`person`])):(c(),o(`span`,V,[e(r(ie),{class:`size-4`})])),a(`div`,{class:i([`max-w-[85%] rounded-xl border px-4 py-3`,n.from_staff?`bg-card`:`border-brand-200 bg-brand-soft/60`])},[a(`p`,ae,[a(`span`,H,d(n.from_staff?n.author||`IT-Service`:`Sie`),1),n.created_at?(c(),o(l,{key:0},[t(` · `+d(r(k)(n.created_at,!0)),1)],64)):p(``,!0)]),a(`p`,U,d(n.message),1)],2)],2))),128))])):p(``,!0),a(`form`,{class:`rounded-xl border bg-card p-4 shadow-xs`,onSubmit:ee(he,[`prevent`])},[a(`label`,W,d(_.ticket.open?`Antworten`:`Das Ticket ist abgeschlossen – mit einer Antwort können Sie sich erneut melden.`),1),e(r(E),{id:`message`,modelValue:r($).message,"onUpdate:modelValue":m[0]||=e=>r($).message=e,rows:`4`,maxlength:`20000`,class:`mt-2`,placeholder:`Ihre Nachricht an die IT …`},null,8,[`modelValue`]),r($).errors.message?(c(),o(`p`,G,d(r($).errors.message),1)):p(``,!0),a(`div`,K,[e(r(T),{type:`submit`,disabled:r($).processing||!r($).message.trim()},{default:u(()=>[r($).processing?(c(),f(r(te),{key:0,class:`animate-spin`})):(c(),f(r(w),{key:1})),m[2]||=t(` Senden `,-1)]),_:1},8,[`disabled`])])],32)]),a(`aside`,q,[a(`section`,J,[m[7]||=a(`h2`,{class:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Details`,-1),a(`dl`,oe,[_.ticket.asset?(c(),o(`div`,se,[e(r(re),{class:`size-4 text-muted-foreground`}),m[3]||=a(`dt`,{class:`sr-only`},`Gerät`,-1),a(`dd`,null,d(_.ticket.asset),1)])):p(``,!0),_.ticket.category?(c(),o(`div`,ce,[e(r(A),{class:`size-4 text-muted-foreground`}),m[4]||=a(`dt`,{class:`sr-only`},`Kategorie`,-1),a(`dd`,null,d(_.ticket.category),1)])):p(``,!0),_.ticket.location?(c(),o(`div`,le,[e(r(ne),{class:`size-4 text-muted-foreground`}),m[5]||=a(`dt`,{class:`sr-only`},`Standort`,-1),a(`dd`,null,d(_.ticket.location),1)])):p(``,!0),a(`div`,ue,[e(r(y),{class:`size-4 text-muted-foreground`}),m[6]||=a(`dt`,{class:`sr-only`},`Bearbeitet von`,-1),a(`dd`,null,d(_.ticket.assignees.length?_.ticket.assignees.join(`, `):`Noch nicht zugewiesen`),1)])])]),_.ticket.attachments.length?(c(),o(`section`,Y,[m[8]||=a(`h2`,{class:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Anhänge`,-1),a(`ul`,de,[(c(!0),o(l,null,s(_.ticket.attachments,t=>(c(),o(`li`,{key:t.id},[a(`a`,{href:`/it-service/anhaenge/${t.id}`,class:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-accent`},[e(r(C),{class:`size-4 text-muted-foreground`}),a(`span`,pe,d(t.name),1),a(`span`,me,d(ge(t.size)),1)],8,fe)]))),128))])])):p(``,!0)])])]),_:1},8,[`title`]))}};export{X as default}; \ No newline at end of file diff --git a/public/build/assets/TicketCreate-D0MGa9W5.js b/public/build/assets/TicketCreate-UMEMz3xd.js similarity index 93% rename from public/build/assets/TicketCreate-D0MGa9W5.js rename to public/build/assets/TicketCreate-UMEMz3xd.js index d25b70bc..b92e1f39 100644 --- a/public/build/assets/TicketCreate-D0MGa9W5.js +++ b/public/build/assets/TicketCreate-UMEMz3xd.js @@ -1 +1 @@ -import{D as e,E as t,On as n,Yt as r,Zn as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as h,y as g}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as _,r as v}from"./app-Bu3kn8yd.js";import{O as y}from"./dist-DtGNiYlK.js";import{G as b,et as x}from"./AppIcon-0N56IC2z.js";import{t as S}from"./arrow-left-BMImfTf2.js";import{t as C}from"./AppLayout-BxsYt2ib.js";import{t as w}from"./circle-alert-D8SqHL0j.js";import{t as T}from"./send-6fmdiUe6.js";import{t as E}from"./FormField-BoFAO4pm.js";import{t as D}from"./PageHeader-Ybe7qDu5.js";import{t as O}from"./button-ZHC5mKey.js";import{t as k}from"./NativeSelect-BGasRaNs.js";import{t as A}from"./Panel-BASB8Xb9.js";import{t as j}from"./Input-FGSb2-yK.js";import{t as M}from"./Textarea-DEFXqC2w.js";var N={class:`grid gap-2`,role:`radiogroup`,"aria-label":`Gerät`},P=[`value`],F={class:`grid size-9 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},I={class:`min-w-0`},L={class:`block text-sm font-medium`},R={class:`block truncate text-xs text-muted-foreground`},z={class:`grid size-9 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},B={key:0,class:`flex items-center gap-2 text-xs text-muted-foreground`},V={class:`grid gap-4`},H={class:`grid gap-4 sm:grid-cols-2`},U={class:`flex justify-end border-t pt-4`},W={__name:`TicketCreate`,props:{assetId:{type:Number,default:null},assets:{type:Object,required:!0},options:{type:Object,required:!0},defaultLocation:{type:Number,default:null}},setup(W){let G=W,K=c(()=>G.assets.ok?G.assets.data:[]),q=c(()=>G.options.ok?G.options.data.categories:[]),J=c(()=>G.options.ok?G.options.data.locations:[]),Y=_({asset_id:K.value.some(e=>e.id===G.assetId)?G.assetId:null,subject:``,description:``,category_id:null,location_id:G.defaultLocation});function X(){Y.transform(e=>({...e,asset_id:e.asset_id||null,category_id:e.category_id?Number(e.category_id):null,location_id:e.location_id?Number(e.location_id):null})).post(`/it-service/tickets`)}return(c,_)=>(l(),p(C,{title:`Ticket erstellen`},{default:d(()=>[e(n(v),{href:`/it-service`,class:`mb-3 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:d(()=>[e(n(S),{class:`size-4`}),_[6]||=t(` Meine IT`,-1)]),_:1}),e(D,{title:`Ticket erstellen`,description:`Beschreiben Sie kurz, was nicht funktioniert – die IT meldet sich.`}),a(`form`,{class:`grid grid-cols-1 items-start gap-6 lg:grid-cols-12`,onSubmit:h(X,[`prevent`])},[e(A,{title:`Worum geht es?`,class:`lg:col-span-5 xl:col-span-4`},{default:d(()=>[a(`div`,N,[(l(!0),o(u,null,s(K.value,t=>(l(),o(`label`,{key:t.id,class:i([`flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors`,n(Y).asset_id===t.id?`border-brand bg-brand-soft/60 ring-1 ring-brand`:`hover:bg-accent/60`])},[r(a(`input`,{"onUpdate:modelValue":_[0]||=e=>n(Y).asset_id=e,type:`radio`,value:t.id,class:`sr-only`},null,8,P),[[g,n(Y).asset_id]]),a(`span`,F,[e(n(b),{class:`size-4`})]),a(`span`,I,[a(`span`,L,f(t.name),1),a(`span`,R,f([t.type,t.serial&&`SN ${t.serial}`].filter(Boolean).join(` · `)),1)])],2))),128)),a(`label`,{class:i([`flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors`,n(Y).asset_id?`hover:bg-accent/60`:`border-brand bg-brand-soft/60 ring-1 ring-brand`])},[r(a(`input`,{"onUpdate:modelValue":_[1]||=e=>n(Y).asset_id=e,type:`radio`,value:null,class:`sr-only`},null,512),[[g,n(Y).asset_id]]),a(`span`,z,[e(n(x),{class:`size-4`})]),_[7]||=a(`span`,null,[a(`span`,{class:`block text-sm font-medium`},`Allgemeines Anliegen`),a(`span`,{class:`block text-xs text-muted-foreground`},`ohne bestimmtes Gerät, z. B. Zugang, Software, Frage`)],-1)],2),W.assets.ok?m(``,!0):(l(),o(`p`,B,[e(n(w),{class:`size-3.5`}),_[8]||=t(` Ihre Geräte konnten nicht geladen werden.`,-1)]))])]),_:1}),e(A,{title:`Beschreibung`,class:`lg:col-span-7 xl:col-span-8`},{default:d(()=>[a(`div`,V,[a(`div`,H,[e(E,{id:`category`,label:`Kategorie`,error:n(Y).errors.category_id,hint:q.value.length?``:`Kategorien konnten nicht geladen werden.`},{default:d(()=>[e(k,{id:`category`,modelValue:n(Y).category_id,"onUpdate:modelValue":_[2]||=e=>n(Y).category_id=e,options:q.value,placeholder:`– bitte wählen –`,required:q.value.length>0,disabled:!q.value.length},null,8,[`modelValue`,`options`,`required`,`disabled`])]),_:1},8,[`error`,`hint`]),e(E,{id:`location`,label:`Standort`,error:n(Y).errors.location_id,hint:J.value.length?`Wo tritt das Problem auf?`:`Standorte konnten nicht geladen werden.`},{default:d(()=>[e(k,{id:`location`,modelValue:n(Y).location_id,"onUpdate:modelValue":_[3]||=e=>n(Y).location_id=e,options:J.value,placeholder:`– bitte wählen –`,required:J.value.length>0,disabled:!J.value.length},null,8,[`modelValue`,`options`,`required`,`disabled`])]),_:1},8,[`error`,`hint`])]),e(E,{id:`subject`,label:`Betreff`,error:n(Y).errors.subject},{default:d(()=>[e(n(j),{id:`subject`,modelValue:n(Y).subject,"onUpdate:modelValue":_[4]||=e=>n(Y).subject=e,maxlength:`200`,placeholder:`z. B. Drucker im 2. OG druckt nicht`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),e(E,{id:`description`,label:`Was ist passiert?`,error:n(Y).errors.description,hint:`Seit wann? Gibt es eine Fehlermeldung? Was haben Sie schon versucht?`},{default:d(()=>[e(n(M),{id:`description`,modelValue:n(Y).description,"onUpdate:modelValue":_[5]||=e=>n(Y).description=e,rows:`7`,maxlength:`20000`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),a(`div`,U,[e(n(O),{type:`submit`,disabled:n(Y).processing},{default:d(()=>[n(Y).processing?(l(),p(n(y),{key:0,class:`animate-spin`})):(l(),p(n(T),{key:1})),_[9]||=t(` Ticket absenden `,-1)]),_:1},8,[`disabled`])])])]),_:1})],32)]),_:1}))}};export{W as default}; \ No newline at end of file +import{D as e,E as t,On as n,Yt as r,Zn as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as h,y as g}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as _,r as v}from"./app-BNwrc_lv.js";import{O as y}from"./dist-DtGNiYlK.js";import{G as b,et as x}from"./AppIcon-nlhvQfK7.js";import{t as S}from"./arrow-left-BMImfTf2.js";import{t as C}from"./AppLayout-esQiy2nD.js";import{t as w}from"./circle-alert-D8SqHL0j.js";import{t as T}from"./send-6fmdiUe6.js";import{t as E}from"./FormField-BoFAO4pm.js";import{t as D}from"./PageHeader-BMzzCXfT.js";import{n as O}from"./button-CwUSbS9X.js";import{t as k}from"./NativeSelect-G3km7PmI.js";import{t as A}from"./Panel-Dr-NcUuS.js";import{t as j}from"./Input-FGSb2-yK.js";import{t as M}from"./Textarea-DEFXqC2w.js";var N={class:`grid gap-2`,role:`radiogroup`,"aria-label":`Gerät`},P=[`value`],F={class:`grid size-9 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},I={class:`min-w-0`},L={class:`block text-sm font-medium`},R={class:`block truncate text-xs text-muted-foreground`},z={class:`grid size-9 shrink-0 place-items-center rounded-md bg-muted text-foreground/70`},B={key:0,class:`flex items-center gap-2 text-xs text-muted-foreground`},V={class:`grid gap-4`},H={class:`grid gap-4 sm:grid-cols-2`},U={class:`flex justify-end border-t pt-4`},W={__name:`TicketCreate`,props:{assetId:{type:Number,default:null},assets:{type:Object,required:!0},options:{type:Object,required:!0},defaultLocation:{type:Number,default:null}},setup(W){let G=W,K=c(()=>G.assets.ok?G.assets.data:[]),q=c(()=>G.options.ok?G.options.data.categories:[]),J=c(()=>G.options.ok?G.options.data.locations:[]),Y=_({asset_id:K.value.some(e=>e.id===G.assetId)?G.assetId:null,subject:``,description:``,category_id:null,location_id:G.defaultLocation});function X(){Y.transform(e=>({...e,asset_id:e.asset_id||null,category_id:e.category_id?Number(e.category_id):null,location_id:e.location_id?Number(e.location_id):null})).post(`/it-service/tickets`)}return(c,_)=>(l(),p(C,{title:`Ticket erstellen`},{default:d(()=>[e(n(v),{href:`/it-service`,class:`mb-3 inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:d(()=>[e(n(S),{class:`size-4`}),_[6]||=t(` Meine IT`,-1)]),_:1}),e(D,{title:`Ticket erstellen`,description:`Beschreiben Sie kurz, was nicht funktioniert – die IT meldet sich.`}),a(`form`,{class:`grid grid-cols-1 items-start gap-6 lg:grid-cols-12`,onSubmit:h(X,[`prevent`])},[e(A,{title:`Worum geht es?`,class:`lg:col-span-5 xl:col-span-4`},{default:d(()=>[a(`div`,N,[(l(!0),o(u,null,s(K.value,t=>(l(),o(`label`,{key:t.id,class:i([`flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors`,n(Y).asset_id===t.id?`border-brand bg-brand-soft/60 ring-1 ring-brand`:`hover:bg-accent/60`])},[r(a(`input`,{"onUpdate:modelValue":_[0]||=e=>n(Y).asset_id=e,type:`radio`,value:t.id,class:`sr-only`},null,8,P),[[g,n(Y).asset_id]]),a(`span`,F,[e(n(b),{class:`size-4`})]),a(`span`,I,[a(`span`,L,f(t.name),1),a(`span`,R,f([t.type,t.serial&&`SN ${t.serial}`].filter(Boolean).join(` · `)),1)])],2))),128)),a(`label`,{class:i([`flex cursor-pointer items-center gap-3 rounded-lg border p-3 transition-colors`,n(Y).asset_id?`hover:bg-accent/60`:`border-brand bg-brand-soft/60 ring-1 ring-brand`])},[r(a(`input`,{"onUpdate:modelValue":_[1]||=e=>n(Y).asset_id=e,type:`radio`,value:null,class:`sr-only`},null,512),[[g,n(Y).asset_id]]),a(`span`,z,[e(n(x),{class:`size-4`})]),_[7]||=a(`span`,null,[a(`span`,{class:`block text-sm font-medium`},`Allgemeines Anliegen`),a(`span`,{class:`block text-xs text-muted-foreground`},`ohne bestimmtes Gerät, z. B. Zugang, Software, Frage`)],-1)],2),W.assets.ok?m(``,!0):(l(),o(`p`,B,[e(n(w),{class:`size-3.5`}),_[8]||=t(` Ihre Geräte konnten nicht geladen werden.`,-1)]))])]),_:1}),e(A,{title:`Beschreibung`,class:`lg:col-span-7 xl:col-span-8`},{default:d(()=>[a(`div`,V,[a(`div`,H,[e(E,{id:`category`,label:`Kategorie`,error:n(Y).errors.category_id,hint:q.value.length?``:`Kategorien konnten nicht geladen werden.`},{default:d(()=>[e(k,{id:`category`,modelValue:n(Y).category_id,"onUpdate:modelValue":_[2]||=e=>n(Y).category_id=e,options:q.value,placeholder:`– bitte wählen –`,required:q.value.length>0,disabled:!q.value.length},null,8,[`modelValue`,`options`,`required`,`disabled`])]),_:1},8,[`error`,`hint`]),e(E,{id:`location`,label:`Standort`,error:n(Y).errors.location_id,hint:J.value.length?`Wo tritt das Problem auf?`:`Standorte konnten nicht geladen werden.`},{default:d(()=>[e(k,{id:`location`,modelValue:n(Y).location_id,"onUpdate:modelValue":_[3]||=e=>n(Y).location_id=e,options:J.value,placeholder:`– bitte wählen –`,required:J.value.length>0,disabled:!J.value.length},null,8,[`modelValue`,`options`,`required`,`disabled`])]),_:1},8,[`error`,`hint`])]),e(E,{id:`subject`,label:`Betreff`,error:n(Y).errors.subject},{default:d(()=>[e(n(j),{id:`subject`,modelValue:n(Y).subject,"onUpdate:modelValue":_[4]||=e=>n(Y).subject=e,maxlength:`200`,placeholder:`z. B. Drucker im 2. OG druckt nicht`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),e(E,{id:`description`,label:`Was ist passiert?`,error:n(Y).errors.description,hint:`Seit wann? Gibt es eine Fehlermeldung? Was haben Sie schon versucht?`},{default:d(()=>[e(n(M),{id:`description`,modelValue:n(Y).description,"onUpdate:modelValue":_[5]||=e=>n(Y).description=e,rows:`7`,maxlength:`20000`,required:``},null,8,[`modelValue`])]),_:1},8,[`error`]),a(`div`,U,[e(n(O),{type:`submit`,disabled:n(Y).processing},{default:d(()=>[n(Y).processing?(l(),p(n(y),{key:0,class:`animate-spin`})):(l(),p(n(T),{key:1})),_[9]||=t(` Ticket absenden `,-1)]),_:1},8,[`disabled`])])])]),_:1})],32)]),_:1}))}};export{W as default}; \ No newline at end of file diff --git a/public/build/assets/Upcoming-CqA1fba6.js b/public/build/assets/Upcoming-B8HALD0a.js similarity index 89% rename from public/build/assets/Upcoming-CqA1fba6.js rename to public/build/assets/Upcoming-B8HALD0a.js index 52bf182f..24d4555c 100644 --- a/public/build/assets/Upcoming-CqA1fba6.js +++ b/public/build/assets/Upcoming-B8HALD0a.js @@ -1 +1 @@ -import{_ as e,b as t,bt as n,mt as r,o as i,qt as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as s}from"./BirthdayItem-CI_wVS_D.js";import{t as c}from"./Panel-BASB8Xb9.js";var l={class:`-my-2 divide-y`},u={__name:`Upcoming`,props:{birthdays:{type:Array,required:!0},days:{type:Number,default:7}},setup(u){return(d,f)=>(r(),o(c,{title:`Geburtstage`,"action-label":`Alle`,"action-href":`/geburtstage`},{default:a(()=>[e(`div`,l,[(r(!0),t(i,null,n(u.birthdays,e=>(r(),o(s,{key:`${e.person.id}-${e.date}`,item:e},null,8,[`item`]))),128))])]),_:1}))}};export{u as default}; \ No newline at end of file +import{_ as e,b as t,bt as n,mt as r,o as i,qt as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{t as s}from"./BirthdayItem-ELeKwOyJ.js";import{t as c}from"./Panel-Dr-NcUuS.js";var l={class:`-my-2 divide-y`},u={__name:`Upcoming`,props:{birthdays:{type:Array,required:!0},days:{type:Number,default:7}},setup(u){return(d,f)=>(r(),o(c,{title:`Geburtstage`,"action-label":`Alle`,"action-href":`/geburtstage`},{default:a(()=>[e(`div`,l,[(r(!0),t(i,null,n(u.birthdays,e=>(r(),o(s,{key:`${e.person.id}-${e.date}`,item:e},null,8,[`item`]))),128))])]),_:1}))}};export{u as default}; \ No newline at end of file diff --git a/public/build/assets/Upcoming-OBguJie2.js b/public/build/assets/Upcoming-CgTH3-xJ.js similarity index 74% rename from public/build/assets/Upcoming-OBguJie2.js rename to public/build/assets/Upcoming-CgTH3-xJ.js index 67929a73..d194c5fb 100644 --- a/public/build/assets/Upcoming-OBguJie2.js +++ b/public/build/assets/Upcoming-CgTH3-xJ.js @@ -1 +1 @@ -import{On as e,b as t,bt as n,mt as r,o as i,qt as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{tt as s}from"./AppIcon-0N56IC2z.js";import{t as c}from"./EmptyState-Ceq4v8mE.js";import{t as l}from"./Panel-BASB8Xb9.js";import{t as u}from"./EventListItem-D1yV2ddA.js";var d={key:0,class:`-my-3 divide-y`},f={__name:`Upcoming`,props:{events:{type:Array,required:!0}},setup(f){return(p,m)=>(r(),o(l,{title:`Termine`,"action-label":`Alle Termine`,"action-href":`/termine`},{default:a(()=>[f.events.length?(r(),t(`div`,d,[(r(!0),t(i,null,n(f.events,e=>(r(),o(u,{key:e.id,event:e},null,8,[`event`]))),128))])):(r(),o(c,{key:1,icon:e(s),title:`Keine anstehenden Termine`,class:`py-6`},null,8,[`icon`]))]),_:1}))}};export{f as default}; \ No newline at end of file +import{On as e,b as t,bt as n,mt as r,o as i,qt as a,v as o}from"./runtime-core.esm-bundler-B8D2lM98.js";import{tt as s}from"./AppIcon-nlhvQfK7.js";import{t as c}from"./EmptyState-Ceq4v8mE.js";import{t as l}from"./Panel-Dr-NcUuS.js";import{t as u}from"./EventListItem-B744Ks6-.js";var d={key:0,class:`-my-3 divide-y`},f={__name:`Upcoming`,props:{events:{type:Array,required:!0}},setup(f){return(p,m)=>(r(),o(l,{title:`Termine`,"action-label":`Alle Termine`,"action-href":`/termine`},{default:a(()=>[f.events.length?(r(),t(`div`,d,[(r(!0),t(i,null,n(f.events,e=>(r(),o(u,{key:e.id,event:e},null,8,[`event`]))),128))])):(r(),o(c,{key:1,icon:e(s),title:`Keine anstehenden Termine`,class:`py-6`},null,8,[`icon`]))]),_:1}))}};export{f as default}; \ No newline at end of file diff --git a/public/build/assets/UpcomingEvents-PAkPjGQe.js b/public/build/assets/UpcomingEvents-C3jR0Ycw.js similarity index 88% rename from public/build/assets/UpcomingEvents-PAkPjGQe.js rename to public/build/assets/UpcomingEvents-C3jR0Ycw.js index 1bdfc1b8..c797b9cd 100644 --- a/public/build/assets/UpcomingEvents-PAkPjGQe.js +++ b/public/build/assets/UpcomingEvents-C3jR0Ycw.js @@ -1 +1 @@ -import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./app-Bu3kn8yd.js";import{t as p}from"./chevron-right-C9w5cb2q.js";import{t as m}from"./EventListItem-D1yV2ddA.js";var h={key:0,class:`mb-3 flex items-center justify-between gap-4`},g={class:`text-lg font-semibold`},_={class:`divide-y rounded-lg border bg-card px-4`},v={key:0,class:`py-3 text-sm text-muted-foreground`},y={__name:`UpcomingEvents`,props:{block:{type:Object,required:!0}},setup(y){return(b,x)=>(o(),i(`section`,null,[y.block.data.title?(o(),i(`div`,h,[r(`h3`,g,l(y.block.data.title),1),e(n(f),{href:`/termine`,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:c(()=>[x[0]||=t(`Alle Termine `,-1),e(n(p),{class:`size-3.5`})]),_:1})])):d(``,!0),r(`div`,_,[(o(!0),i(s,null,a(y.block.props?.events??[],e=>(o(),u(m,{key:e.id,event:e},null,8,[`event`]))),128)),(y.block.props?.events??[]).length?d(``,!0):(o(),i(`p`,v,`Keine anstehenden Termine.`))])]))}};export{y as default}; \ No newline at end of file +import{D as e,E as t,On as n,_ as r,b as i,bt as a,mt as o,o as s,qt as c,tr as l,v as u,y as d}from"./runtime-core.esm-bundler-B8D2lM98.js";import{r as f}from"./app-BNwrc_lv.js";import{t as p}from"./chevron-right-C9w5cb2q.js";import{t as m}from"./EventListItem-B744Ks6-.js";var h={key:0,class:`mb-3 flex items-center justify-between gap-4`},g={class:`text-lg font-semibold`},_={class:`divide-y rounded-lg border bg-card px-4`},v={key:0,class:`py-3 text-sm text-muted-foreground`},y={__name:`UpcomingEvents`,props:{block:{type:Object,required:!0}},setup(y){return(b,x)=>(o(),i(`section`,null,[y.block.data.title?(o(),i(`div`,h,[r(`h3`,g,l(y.block.data.title),1),e(n(f),{href:`/termine`,class:`inline-flex items-center gap-0.5 text-[13px] font-medium text-brand-text hover:underline`},{default:c(()=>[x[0]||=t(`Alle Termine `,-1),e(n(p),{class:`size-3.5`})]),_:1})])):d(``,!0),r(`div`,_,[(o(!0),i(s,null,a(y.block.props?.events??[],e=>(o(),u(m,{key:e.id,event:e},null,8,[`event`]))),128)),(y.block.props?.events??[]).length?d(``,!0):(o(),i(`p`,v,`Keine anstehenden Termine.`))])]))}};export{y as default}; \ No newline at end of file diff --git a/public/build/assets/Video-ANYz6xeT.js b/public/build/assets/Video-BCiRhytl.js similarity index 96% rename from public/build/assets/Video-ANYz6xeT.js rename to public/build/assets/Video-BCiRhytl.js index 81ad1cd3..ac47cd94 100644 --- a/public/build/assets/Video-ANYz6xeT.js +++ b/public/build/assets/Video-BCiRhytl.js @@ -1 +1 @@ -import{D as e,On as t,_ as n,b as r,mt as i,o as a,tr as o,vn as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{E as c}from"./AppIcon-0N56IC2z.js";import{t as l}from"./play-GbhjcPFH.js";var u={class:`relative aspect-video overflow-hidden rounded-lg bg-neutral-900`},d=[`src`],f=[`src`,`title`],p={class:`grid justify-items-center gap-3 px-6 text-center`},m={class:`grid size-16 place-items-center rounded-full bg-white/15 transition-colors hover:bg-white/25`},h={class:`font-medium`},g={class:`max-w-md text-xs text-white/70`},_={key:1,class:`grid size-full place-items-center text-white/60`},v={__name:`Video`,props:{block:{type:Object,required:!0}},setup(v){let y=s(!1);return(s,b)=>(i(),r(`figure`,null,[n(`div`,u,[v.block.props?.embed?(i(),r(a,{key:0},[v.block.props.embed.provider===`file`?(i(),r(`video`,{key:0,src:v.block.props.embed.src,controls:``,preload:`metadata`,class:`size-full`},null,8,d)):y.value?(i(),r(`iframe`,{key:1,src:`${v.block.props.embed.src}&autoplay=1`,title:v.block.data.title||`Video`,class:`size-full`,allow:`autoplay; fullscreen; picture-in-picture`,allowfullscreen:``},null,8,f)):(i(),r(`button`,{key:2,type:`button`,class:`grid size-full place-items-center text-white`,onClick:b[0]||=e=>y.value=!0},[n(`span`,p,[n(`span`,m,[e(t(l),{class:`size-7 fill-current`})]),n(`span`,h,o(v.block.data.title||`Video abspielen`),1),n(`span`,g,`Beim Abspielen wird das Video von `+o(v.block.props.embed.provider)+` geladen. Dabei werden Daten an `+o(v.block.props.embed.provider)+` übertragen.`,1)])]))],64)):(i(),r(`div`,_,[e(t(c),{class:`size-8`})]))])]))}};export{v as default}; \ No newline at end of file +import{D as e,On as t,_ as n,b as r,mt as i,o as a,tr as o,vn as s}from"./runtime-core.esm-bundler-B8D2lM98.js";import{E as c}from"./AppIcon-nlhvQfK7.js";import{t as l}from"./play-GbhjcPFH.js";var u={class:`relative aspect-video overflow-hidden rounded-lg bg-neutral-900`},d=[`src`],f=[`src`,`title`],p={class:`grid justify-items-center gap-3 px-6 text-center`},m={class:`grid size-16 place-items-center rounded-full bg-white/15 transition-colors hover:bg-white/25`},h={class:`font-medium`},g={class:`max-w-md text-xs text-white/70`},_={key:1,class:`grid size-full place-items-center text-white/60`},v={__name:`Video`,props:{block:{type:Object,required:!0}},setup(v){let y=s(!1);return(s,b)=>(i(),r(`figure`,null,[n(`div`,u,[v.block.props?.embed?(i(),r(a,{key:0},[v.block.props.embed.provider===`file`?(i(),r(`video`,{key:0,src:v.block.props.embed.src,controls:``,preload:`metadata`,class:`size-full`},null,8,d)):y.value?(i(),r(`iframe`,{key:1,src:`${v.block.props.embed.src}&autoplay=1`,title:v.block.data.title||`Video`,class:`size-full`,allow:`autoplay; fullscreen; picture-in-picture`,allowfullscreen:``},null,8,f)):(i(),r(`button`,{key:2,type:`button`,class:`grid size-full place-items-center text-white`,onClick:b[0]||=e=>y.value=!0},[n(`span`,p,[n(`span`,m,[e(t(l),{class:`size-7 fill-current`})]),n(`span`,h,o(v.block.data.title||`Video abspielen`),1),n(`span`,g,`Beim Abspielen wird das Video von `+o(v.block.props.embed.provider)+` geladen. Dabei werden Daten an `+o(v.block.props.embed.provider)+` übertragen.`,1)])]))],64)):(i(),r(`div`,_,[e(t(c),{class:`size-8`})]))])]))}};export{v as default}; \ No newline at end of file diff --git a/public/build/assets/Viewer-CRtgYcl6.js b/public/build/assets/Viewer-CRtgYcl6.js new file mode 100644 index 00000000..aa9f44a8 --- /dev/null +++ b/public/build/assets/Viewer-CRtgYcl6.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-DDPLWCRM.js","assets/app-BNwrc_lv.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-Bv2m9wnk.css"])))=>i.map(i=>d[i]); +import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,ct as s,er as c,it as l,mt as u,o as d,qt as f,tr as p,tt as m,v as h,vn as g,xn as _,y as v}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as y,r as b,s as x}from"./app-BNwrc_lv.js";import{O as S}from"./dist-DtGNiYlK.js";import{Z as C}from"./AppIcon-nlhvQfK7.js";import{t as w}from"./arrow-left-BMImfTf2.js";import{t as T}from"./AppLayout-esQiy2nD.js";import{t as E}from"./download-UAAY3N2F.js";import{t as D}from"./external-link-8-VtmLK9.js";import{t as O}from"./minus-CmsbcqBG.js";import{t as k}from"./plus-B_ij2ng2.js";import{n as A}from"./button-CwUSbS9X.js";import{t as j}from"./colors-RDOJqd57.js";import{n as M,t as N}from"./format-20VMi8w8.js";var P={class:`relative flex h-full min-h-0 flex-col`},F={class:`flex items-center justify-between gap-3 border-b bg-card px-3 py-1.5 text-[13px] text-muted-foreground`},I={class:`tabular-nums`},L={class:`flex items-center rounded-md border`},R={class:`w-12 text-center tabular-nums`},z={key:0,class:`mx-auto max-w-md rounded-lg border bg-card p-6 text-center text-sm`},B={key:1,class:`grid h-full place-items-center`},V={key:2,class:`grid justify-center gap-4`},H=[`data-page`],U=[`aria-label`],W={__name:`PdfViewer`,props:{url:{type:String,required:!0}},setup(t){let r=t,f=g(null),h=_(null),v=g([]),y=g(1),b=g(1),C=g(!1),w=new Map,T;async function E(){try{let[e,t]=await Promise.all([x(()=>import(`./pdf-DDPLWCRM.js`),__vite__mapDeps([0,1,2,3,4])),x(()=>import(`./pdf.worker.min-D00xlTFB.js`),[])]);e.GlobalWorkerOptions.workerSrc=t.default,h.value=await e.getDocument({url:r.url,isEvalSupported:!1,enableXfa:!1}).promise;let n=(await h.value.getPage(1)).getViewport({scale:1}),i=Math.min(f.value.clientWidth-48,860);y.value=Math.max(.5,i/n.width),v.value=Array.from({length:h.value.numPages},(e,t)=>({number:t+1,width:n.width,height:n.height})),await m(),D()}catch(e){console.error(e),C.value=!0}}function D(){T?.disconnect(),w.clear(),T=new IntersectionObserver(e=>{for(let t of e){let e=Number(t.target.dataset.page);t.isIntersecting&&(b.value=e,A(e,t.target.querySelector(`canvas`)))}},{root:f.value,rootMargin:`400px 0px`}),f.value.querySelectorAll(`[data-page]`).forEach(e=>T.observe(e))}async function A(e,t){let n=`${e}@${y.value}`;if(!t||w.get(e)===n)return;w.set(e,n);let r=await h.value.getPage(e),i=r.getViewport({scale:y.value}),a=window.devicePixelRatio||1;t.width=Math.floor(i.width*a),t.height=Math.floor(i.height*a),t.style.width=`${Math.floor(i.width)}px`,t.style.height=`${Math.floor(i.height)}px`,await r.render({canvasContext:t.getContext(`2d`),viewport:i,transform:a===1?null:[a,0,0,a,0,0]}).promise}async function j(e){y.value=Math.min(3,Math.max(.4,Math.round((y.value+e)*10)/10)),await m(),D()}return s(E),l(()=>{T?.disconnect(),h.value?.destroy()}),(t,r)=>(u(),a(`div`,P,[i(`div`,F,[i(`span`,I,p(v.value.length?`Seite ${b.value} von ${v.value.length}`:``),1),i(`div`,L,[i(`button`,{type:`button`,class:`grid size-8 place-items-center hover:text-foreground`,"aria-label":`Verkleinern`,onClick:r[0]||=e=>j(-.2)},[e(n(O),{class:`size-4`})]),i(`span`,R,p(Math.round(y.value*100))+` %`,1),i(`button`,{type:`button`,class:`grid size-8 place-items-center hover:text-foreground`,"aria-label":`Vergrößern`,onClick:r[1]||=e=>j(.2)},[e(n(k),{class:`size-4`})])])]),i(`div`,{ref_key:`container`,ref:f,class:`min-h-0 flex-1 overflow-auto bg-muted/60 px-4 py-6`},[C.value?(u(),a(`div`,z,`Die Datei lässt sich hier nicht anzeigen. Bitte herunterladen.`)):v.value.length?(u(),a(`div`,V,[(u(!0),a(d,null,o(v.value,e=>(u(),a(`div`,{key:e.number,"data-page":e.number,class:`bg-white shadow-md`,style:c({width:`${Math.floor(e.width*y.value)}px`,height:`${Math.floor(e.height*y.value)}px`})},[i(`canvas`,{"aria-label":`Seite ${e.number}`},null,8,U)],12,H))),128))])):(u(),a(`div`,B,[e(n(S),{class:`size-6 animate-spin text-muted-foreground`})]))],512)]))}},G={class:`flex h-[calc(100vh-9.5rem)] min-h-[32rem] flex-col overflow-hidden rounded-lg border bg-card`},K={class:`flex flex-wrap items-center gap-x-4 gap-y-2 border-b px-4 py-3`},q={class:`min-w-0 flex-1`},J={class:`truncate text-lg leading-tight font-semibold`},Y={class:`text-xs text-muted-foreground`},X={class:`flex flex-wrap items-center gap-2`},Z=[`href`],Q=[`href`],$=[`href`],ee={key:1,class:`grid min-h-0 flex-1 place-items-center overflow-auto bg-muted/60 p-6`},te=[`src`,`alt`],ne={__name:`Viewer`,props:{entry:{type:Object,required:!0},file:{type:Object,required:!0},query:{type:String,default:``}},setup(o){return(s,c)=>(u(),h(T,{title:o.entry.title},{default:f(()=>[e(n(y),{title:o.entry.title},null,8,[`title`]),i(`div`,G,[i(`header`,K,[e(n(b),{href:o.entry.folder.url,class:`grid size-9 place-items-center rounded-md hover:bg-accent`,"aria-label":`Zurück zu ${o.entry.folder.path}`},{default:f(()=>[e(n(w),{class:`size-5`})]),_:1},8,[`href`,`aria-label`]),i(`div`,q,[e(n(b),{href:o.entry.folder.url,class:`inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:underline`},{default:f(()=>[i(`span`,{class:r([`size-2 rounded-sm`,n(j)(o.entry.folder.color).dot])},null,2),t(p(o.entry.folder.path),1)]),_:1},8,[`href`]),i(`h1`,J,p(o.entry.title),1),i(`p`,Y,[o.entry.version?(u(),a(d,{key:0},[t(`Version `+p(o.entry.version)+` · `,1)],64)):v(``,!0),t(`Stand `+p(n(M)(o.entry.valid_from))+` · `+p(n(N)(o.entry.size)),1)])]),i(`div`,X,[o.entry.editable?(u(),h(n(A),{key:0,variant:`outline`,size:`sm`,"as-child":``},{default:f(()=>[i(`a`,{href:o.entry.editable.url},[e(n(C)),t(` Vorlage (`+p(o.entry.editable.extension)+`)`,1)],8,Z)]),_:1})):v(``,!0),e(n(A),{variant:`outline`,size:`sm`,"as-child":``},{default:f(()=>[i(`a`,{href:o.file.url,target:`_blank`,rel:`noopener`},[e(n(D)),c[0]||=t(` In neuem Tab`,-1)],8,Q)]),_:1}),e(n(A),{size:`sm`,"as-child":``},{default:f(()=>[i(`a`,{href:o.entry.download_url},[e(n(E)),c[1]||=t(` Herunterladen`,-1)],8,$)]),_:1})])]),o.file.kind===`pdf`?(u(),h(W,{key:0,url:o.file.url,class:`min-h-0 flex-1`},null,8,[`url`])):(u(),a(`div`,ee,[i(`img`,{src:o.file.url,alt:o.entry.title,class:`max-h-full max-w-full rounded shadow-md`},null,8,te)]))])]),_:1},8,[`title`]))}};export{ne as default}; \ No newline at end of file diff --git a/public/build/assets/Viewer-aK9tWVFU.js b/public/build/assets/Viewer-aK9tWVFU.js deleted file mode 100644 index 0c2a0e84..00000000 --- a/public/build/assets/Viewer-aK9tWVFU.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-xi5Hl50h.js","assets/app-Bu3kn8yd.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/app-CL30rx2M.css"])))=>i.map(i=>d[i]); -import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,ct as s,er as c,it as l,mt as u,o as d,qt as f,tr as p,tt as m,v as h,vn as g,xn as _,y as v}from"./runtime-core.esm-bundler-B8D2lM98.js";import{n as y,r as b,s as x}from"./app-Bu3kn8yd.js";import{O as S}from"./dist-DtGNiYlK.js";import{Z as C}from"./AppIcon-0N56IC2z.js";import{t as w}from"./arrow-left-BMImfTf2.js";import{t as T}from"./AppLayout-BxsYt2ib.js";import{t as E}from"./download-UAAY3N2F.js";import{n as D,r as O,t as k}from"./format-uZU1H-69.js";import{t as A}from"./minus-CmsbcqBG.js";import{t as j}from"./plus-B_ij2ng2.js";import{t as M}from"./button-ZHC5mKey.js";import{t as N}from"./colors-RDOJqd57.js";var P={class:`relative flex h-full min-h-0 flex-col`},F={class:`flex items-center justify-between gap-3 border-b bg-card px-3 py-1.5 text-[13px] text-muted-foreground`},I={class:`tabular-nums`},L={class:`flex items-center rounded-md border`},R={class:`w-12 text-center tabular-nums`},z={key:0,class:`mx-auto max-w-md rounded-lg border bg-card p-6 text-center text-sm`},B={key:1,class:`grid h-full place-items-center`},V={key:2,class:`grid justify-center gap-4`},H=[`data-page`],U=[`aria-label`],W={__name:`PdfViewer`,props:{url:{type:String,required:!0}},setup(t){let r=t,f=g(null),h=_(null),v=g([]),y=g(1),b=g(1),C=g(!1),w=new Map,T;async function E(){try{let[e,t]=await Promise.all([x(()=>import(`./pdf-xi5Hl50h.js`),__vite__mapDeps([0,1,2,3,4])),x(()=>import(`./pdf.worker.min-D00xlTFB.js`),[])]);e.GlobalWorkerOptions.workerSrc=t.default,h.value=await e.getDocument({url:r.url,isEvalSupported:!1,enableXfa:!1}).promise;let n=(await h.value.getPage(1)).getViewport({scale:1}),i=Math.min(f.value.clientWidth-48,860);y.value=Math.max(.5,i/n.width),v.value=Array.from({length:h.value.numPages},(e,t)=>({number:t+1,width:n.width,height:n.height})),await m(),D()}catch(e){console.error(e),C.value=!0}}function D(){T?.disconnect(),w.clear(),T=new IntersectionObserver(e=>{for(let t of e){let e=Number(t.target.dataset.page);t.isIntersecting&&(b.value=e,O(e,t.target.querySelector(`canvas`)))}},{root:f.value,rootMargin:`400px 0px`}),f.value.querySelectorAll(`[data-page]`).forEach(e=>T.observe(e))}async function O(e,t){let n=`${e}@${y.value}`;if(!t||w.get(e)===n)return;w.set(e,n);let r=await h.value.getPage(e),i=r.getViewport({scale:y.value}),a=window.devicePixelRatio||1;t.width=Math.floor(i.width*a),t.height=Math.floor(i.height*a),t.style.width=`${Math.floor(i.width)}px`,t.style.height=`${Math.floor(i.height)}px`,await r.render({canvasContext:t.getContext(`2d`),viewport:i,transform:a===1?null:[a,0,0,a,0,0]}).promise}async function k(e){y.value=Math.min(3,Math.max(.4,Math.round((y.value+e)*10)/10)),await m(),D()}return s(E),l(()=>{T?.disconnect(),h.value?.destroy()}),(t,r)=>(u(),a(`div`,P,[i(`div`,F,[i(`span`,I,p(v.value.length?`Seite ${b.value} von ${v.value.length}`:``),1),i(`div`,L,[i(`button`,{type:`button`,class:`grid size-8 place-items-center hover:text-foreground`,"aria-label":`Verkleinern`,onClick:r[0]||=e=>k(-.2)},[e(n(A),{class:`size-4`})]),i(`span`,R,p(Math.round(y.value*100))+` %`,1),i(`button`,{type:`button`,class:`grid size-8 place-items-center hover:text-foreground`,"aria-label":`Vergrößern`,onClick:r[1]||=e=>k(.2)},[e(n(j),{class:`size-4`})])])]),i(`div`,{ref_key:`container`,ref:f,class:`min-h-0 flex-1 overflow-auto bg-muted/60 px-4 py-6`},[C.value?(u(),a(`div`,z,`Die Datei lässt sich hier nicht anzeigen. Bitte herunterladen.`)):v.value.length?(u(),a(`div`,V,[(u(!0),a(d,null,o(v.value,e=>(u(),a(`div`,{key:e.number,"data-page":e.number,class:`bg-white shadow-md`,style:c({width:`${Math.floor(e.width*y.value)}px`,height:`${Math.floor(e.height*y.value)}px`})},[i(`canvas`,{"aria-label":`Seite ${e.number}`},null,8,U)],12,H))),128))])):(u(),a(`div`,B,[e(n(S),{class:`size-6 animate-spin text-muted-foreground`})]))],512)]))}},G={class:`flex h-[calc(100vh-9.5rem)] min-h-[32rem] flex-col overflow-hidden rounded-lg border bg-card`},K={class:`flex flex-wrap items-center gap-x-4 gap-y-2 border-b px-4 py-3`},q={class:`min-w-0 flex-1`},J={class:`truncate text-lg leading-tight font-semibold`},Y={class:`text-xs text-muted-foreground`},X={class:`flex flex-wrap items-center gap-2`},Z=[`href`],Q=[`href`],$=[`href`],ee={key:1,class:`grid min-h-0 flex-1 place-items-center overflow-auto bg-muted/60 p-6`},te=[`src`,`alt`],ne={__name:`Viewer`,props:{entry:{type:Object,required:!0},file:{type:Object,required:!0},query:{type:String,default:``}},setup(o){return(s,c)=>(u(),h(T,{title:o.entry.title},{default:f(()=>[e(n(y),{title:o.entry.title},null,8,[`title`]),i(`div`,G,[i(`header`,K,[e(n(b),{href:o.entry.folder.url,class:`grid size-9 place-items-center rounded-md hover:bg-accent`,"aria-label":`Zurück zu ${o.entry.folder.path}`},{default:f(()=>[e(n(w),{class:`size-5`})]),_:1},8,[`href`,`aria-label`]),i(`div`,q,[e(n(b),{href:o.entry.folder.url,class:`inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:underline`},{default:f(()=>[i(`span`,{class:r([`size-2 rounded-sm`,n(N)(o.entry.folder.color).dot])},null,2),t(p(o.entry.folder.path),1)]),_:1},8,[`href`]),i(`h1`,J,p(o.entry.title),1),i(`p`,Y,[o.entry.version?(u(),a(d,{key:0},[t(`Version `+p(o.entry.version)+` · `,1)],64)):v(``,!0),t(`Stand `+p(n(D)(o.entry.valid_from))+` · `+p(n(k)(o.entry.size)),1)])]),i(`div`,X,[o.entry.editable?(u(),h(n(M),{key:0,variant:`outline`,size:`sm`,"as-child":``},{default:f(()=>[i(`a`,{href:o.entry.editable.url},[e(n(C)),t(` Vorlage (`+p(o.entry.editable.extension)+`)`,1)],8,Z)]),_:1})):v(``,!0),e(n(M),{variant:`outline`,size:`sm`,"as-child":``},{default:f(()=>[i(`a`,{href:o.file.url,target:`_blank`,rel:`noopener`},[e(n(O)),c[0]||=t(` In neuem Tab`,-1)],8,Q)]),_:1}),e(n(M),{size:`sm`,"as-child":``},{default:f(()=>[i(`a`,{href:o.entry.download_url},[e(n(E)),c[1]||=t(` Herunterladen`,-1)],8,$)]),_:1})])]),o.file.kind===`pdf`?(u(),h(W,{key:0,url:o.file.url,class:`min-h-0 flex-1`},null,8,[`url`])):(u(),a(`div`,ee,[i(`img`,{src:o.file.url,alt:o.entry.title,class:`max-h-full max-w-full rounded shadow-md`},null,8,te)]))])]),_:1},8,[`title`]))}};export{ne as default}; \ No newline at end of file diff --git a/public/build/assets/app-Bu3kn8yd.js b/public/build/assets/app-BNwrc_lv.js similarity index 92% rename from public/build/assets/app-Bu3kn8yd.js rename to public/build/assets/app-BNwrc_lv.js index d89cced5..fd130d22 100644 --- a/public/build/assets/app-Bu3kn8yd.js +++ b/public/build/assets/app-BNwrc_lv.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Sample-DoS7xL8V.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/AppIcon-0N56IC2z.js","assets/usePrimitiveElement-DC7UloPZ.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/dist-DtGNiYlK.js","assets/RovingFocusGroup-D88K7krN.js","assets/http-DmyDwIce.js","assets/AppLayout-BxsYt2ib.js","assets/FileIcon-B6dfvt48.js","assets/BrandLogo-1xuP9ByR.js","assets/format-BsuBtvUs.js","assets/button-ZHC5mKey.js","assets/Panel-BASB8Xb9.js","assets/chevron-right-C9w5cb2q.js","assets/Input-FGSb2-yK.js","assets/PageContent-bQ_WRrV_.js","assets/registry-ZZ5qL5ag.js","assets/DirectoryLogin-Dv1jxmzh.js","assets/arrow-left-BMImfTf2.js","assets/eye-off-myis3scV.js","assets/eye-CFNQcvaV.js","assets/FormField-BoFAO4pm.js","assets/GuestLayout-CAwpgUCY.js","assets/ForgotPassword-DBBKbJ8d.js","assets/Login-HwVm9O9q.js","assets/check-AfxJa8Ew.js","assets/isValueEqualOrExist-BmxVVt-T.js","assets/VisuallyHiddenInput-BMUp3blB.js","assets/RovingFocusItem-BqPEtysU.js","assets/ResetPassword-n5gAPufN.js","assets/Dashboard-DDRG4hPZ.js","assets/widgets-BmL-pPiO.js","assets/Index-CEVOUwPe.js","assets/PageHeader-Ybe7qDu5.js","assets/Index-BYeL_mJs.js","assets/chevron-left-8GGLVOvJ.js","assets/search-x-BVofHEe_.js","assets/Organigram-B8RSJdkM.js","assets/chevron-up-DJvyZPom.js","assets/minus-CmsbcqBG.js","assets/plus-B_ij2ng2.js","assets/smartphone-BE2l7T-2.js","assets/EmptyState-Ceq4v8mE.js","assets/Skeleton-fJgmuUSB.js","assets/useStoredChoice-BAacDiWy.js","assets/Organigram-D2H6GNN8.css","assets/Edit-CpWBr8mw.js","assets/trash-DUqnVIgb.js","assets/Textarea-DEFXqC2w.js","assets/Show-BHs_GqKb.js","assets/Index-LjDUx_tK.js","assets/Index-BcmYQkcJ.js","assets/BirthdayItem-CI_wVS_D.js","assets/Index-HU3KGFXQ.js","assets/arrow-up-Djq_2Npz.js","assets/download-UAAY3N2F.js","assets/ellipsis-vertical-B9wuHo-w.js","assets/file-plus-corner-Z8xo1q-K.js","assets/folder-tree-ZY-sbGXb.js","assets/list-DHYGZ2vt.js","assets/pencil-line-CmAbFj4f.js","assets/rotate-ccw-clock-DRYS-TO2.js","assets/upload-M7dd6qr8.js","assets/DialogDescription-BxaIqmag.js","assets/NativeSelect-BGasRaNs.js","assets/dialog-uBUhf8w7.js","assets/DialogHeader-DuqiL3ry.js","assets/Index-Cb5ksNXA.js","assets/EventDateBlock-_E5XlLto.js","assets/Show-BNFnLRmU.js","assets/Builder-C8khIh0O.js","assets/Switch-CWN1_5O7.js","assets/lock-H7FAhSBr.js","assets/paperclip-DmVAQ5Y5.js","assets/save-aFVYiCIj.js","assets/settings-2-L4P6usDq.js","assets/table-properties-BPjlj2dD.js","assets/FormRenderer-BEg0886q.js","assets/send-6fmdiUe6.js","assets/Index-DB_ZZ8w1.js","assets/Show-DTMG6TUr.js","assets/calendar-clock-8H2IkjP5.js","assets/Index-stioZgWd.js","assets/Index-Cr7HhjGR.js","assets/circle-alert-D8SqHL0j.js","assets/message-square-plus-89qxGe_b.js","assets/StatusBadge-udDF6Kfz.js","assets/status-p0CPKwc2.js","assets/Loans-Dl8zdae9.js","assets/Ticket-oyqxLk_w.js","assets/TicketCreate-D0MGa9W5.js","assets/Editor-DhqamJ3d.js","assets/RichTextEditor-qslPmeeg.js","assets/quote-CAgJDpoy.js","assets/RichTextEditor-Lf5W1_X5.css","assets/EditorBlockList-C9b3fqvQ.js","assets/message-square-warning-BFfa_vqd.js","assets/play-GbhjcPFH.js","assets/EditorBlockList-D8CaLfE4.css","assets/Index-DKsXZOQc.js","assets/pen-line-22hyV1yp.js","assets/NewsCard-DpbfyO9M.js","assets/NewsImage-DgRoe0H1.js","assets/Show-C6LzXbnd.js","assets/link-2-DbrWevIe.js","assets/Editor-8SdMFOv_.js","assets/NewPageDialog-BJuo8o_M.js","assets/Index-n_s429m8.js","assets/Show-DWEMstwB.js","assets/Folder-Bi6XxhES.js","assets/format-uZU1H-69.js","assets/FolderTile-_J6uRwiD.js","assets/colors-RDOJqd57.js","assets/QmSearchBox-Ri1YCTQc.js","assets/Index-OH77dt1V.js","assets/Search-BlIKvXB-.js","assets/Search-5WfA9Ai4.css","assets/Viewer-aK9tWVFU.js","assets/Index-BVnuDp-X.js","assets/Print-DlAwSvIZ.js","assets/Print-juRIblN_.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Sample-CfzueD_V.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/AppIcon-nlhvQfK7.js","assets/usePrimitiveElement-DC7UloPZ.js","assets/runtime-dom.esm-bundler-BEWGoe8n.js","assets/dist-DtGNiYlK.js","assets/RovingFocusGroup-D88K7krN.js","assets/http-CAG9BrJF.js","assets/AppLayout-esQiy2nD.js","assets/FileIcon-BctWLKDw.js","assets/BrandLogo-B9g_TCsV.js","assets/format-BsuBtvUs.js","assets/button-CwUSbS9X.js","assets/Panel-Dr-NcUuS.js","assets/chevron-right-C9w5cb2q.js","assets/Input-FGSb2-yK.js","assets/PageContent-22GSNgo9.js","assets/registry-w73v-fJQ.js","assets/DirectoryLogin-DMGjY_5j.js","assets/arrow-left-BMImfTf2.js","assets/eye-off-myis3scV.js","assets/eye-CFNQcvaV.js","assets/FormField-BoFAO4pm.js","assets/GuestLayout-B2rtJjbh.js","assets/ForgotPassword-D3igZp7Q.js","assets/Login-LD01sd0o.js","assets/check-AfxJa8Ew.js","assets/isValueEqualOrExist-BmxVVt-T.js","assets/VisuallyHiddenInput-BMUp3blB.js","assets/RovingFocusItem-BqPEtysU.js","assets/ResetPassword-BMgqvD7X.js","assets/Dashboard-CSKyh0Uo.js","assets/widgets-D5Uy4PcL.js","assets/Index-BYRiOW5j.js","assets/PageHeader-BMzzCXfT.js","assets/Index-CjQCdvt-.js","assets/useMediaList-Cpw6m1Nv.js","assets/circle-alert-D8SqHL0j.js","assets/external-link-8-VtmLK9.js","assets/image-off-IDPmIoA8.js","assets/link-2-DbrWevIe.js","assets/copy-DsLby0sm.js","assets/download-UAAY3N2F.js","assets/ellipsis-vertical-B9wuHo-w.js","assets/image-plus-C1A_7CFG.js","assets/images-47Nc0alu.js","assets/search-x-BVofHEe_.js","assets/trash-DUqnVIgb.js","assets/DialogDescription-Cf3zbHQX.js","assets/Textarea-DEFXqC2w.js","assets/Index-BC3mnuyy.js","assets/chevron-left-8GGLVOvJ.js","assets/Organigram-DZSdBh0y.js","assets/chevron-up-DJvyZPom.js","assets/minus-CmsbcqBG.js","assets/plus-B_ij2ng2.js","assets/smartphone-BE2l7T-2.js","assets/EmptyState-Ceq4v8mE.js","assets/Skeleton-fJgmuUSB.js","assets/useStoredChoice-BAacDiWy.js","assets/Organigram-D2H6GNN8.css","assets/Edit-D7IMdWK_.js","assets/Show-oCIt-pUC.js","assets/Index-CppAWUIo.js","assets/Index-BIQaJQNR.js","assets/BirthdayItem-ELeKwOyJ.js","assets/Index-D1NjDzqB.js","assets/arrow-up-Djq_2Npz.js","assets/file-plus-corner-Z8xo1q-K.js","assets/folder-tree-ZY-sbGXb.js","assets/list-DHYGZ2vt.js","assets/pencil-line-CmAbFj4f.js","assets/rotate-ccw-clock-DRYS-TO2.js","assets/upload-M7dd6qr8.js","assets/NativeSelect-G3km7PmI.js","assets/dialog-RK2mTeqi.js","assets/DialogDescription-CaB-9xpp.js","assets/DialogHeader-DuqiL3ry.js","assets/Index-BjNLv6WL.js","assets/EventDateBlock-_E5XlLto.js","assets/Show-DHgGJJKJ.js","assets/Builder-CNJagWI1.js","assets/Switch-DtqyAsXz.js","assets/lock-H7FAhSBr.js","assets/paperclip-DmVAQ5Y5.js","assets/save-aFVYiCIj.js","assets/settings-2-L4P6usDq.js","assets/table-properties-BPjlj2dD.js","assets/FormRenderer-CoNVx1AS.js","assets/send-6fmdiUe6.js","assets/Index-vuwnPxDO.js","assets/Show-D7IyxymP.js","assets/calendar-clock-8H2IkjP5.js","assets/Index-CaaVYsb2.js","assets/Index-Bh8jiaJi.js","assets/message-square-plus-89qxGe_b.js","assets/StatusBadge-udDF6Kfz.js","assets/status-p0CPKwc2.js","assets/Loans-DRzgaqxB.js","assets/Ticket-DQFll5zs.js","assets/TicketCreate-UMEMz3xd.js","assets/Editor-BhJCzJD1.js","assets/RichTextEditor-CT-rIT4q.js","assets/quote-CAgJDpoy.js","assets/RichTextEditor-Lf5W1_X5.css","assets/useMediaPicker-BtFVt5Ui.js","assets/message-square-warning-BFfa_vqd.js","assets/play-GbhjcPFH.js","assets/useMediaPicker-D8CaLfE4.css","assets/Index-BDNjv7bZ.js","assets/pen-line-22hyV1yp.js","assets/NewsCard-Cxl6vjIa.js","assets/NewsImage-C1RPeE33.js","assets/Show-Cn1r8GQI.js","assets/Editor-BKM9pJGo.js","assets/NewPageDialog-CGV-jwsW.js","assets/Index-DJEXwOyO.js","assets/Show-BY2_D8bu.js","assets/Folder-DhP4Kqlb.js","assets/FolderTile-B1Q0k_YL.js","assets/colors-RDOJqd57.js","assets/format-20VMi8w8.js","assets/QmSearchBox-BW950raa.js","assets/Index-CLoLvBQV.js","assets/Search-DfTUuPsS.js","assets/Search-5WfA9Ai4.css","assets/Viewer-CRtgYcl6.js","assets/Index-Q18G3mVK.js","assets/Print-B52yJ-oY.js","assets/Print-juRIblN_.css"])))=>i.map(i=>d[i]); import{B as e,Ht as t,ct as n,fn as r,ft as i,g as a,gn as o,gt as s,it as c,k as l,o as u,tt as d,vn as f,xn as p}from"./runtime-core.esm-bundler-B8D2lM98.js";import{a as m,i as h}from"./runtime-dom.esm-bundler-BEWGoe8n.js";var g=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function _(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function v(){}function y(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function b(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function x(e){if(y(e))return e;if(Array.isArray(e)||b(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function S(e){return g.Buffer!==void 0&&g.Buffer.isBuffer(e)}function C(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function w(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var T=`[object RegExp]`,E=`[object String]`,ee=`[object Number]`,te=`[object Boolean]`,ne=`[object Arguments]`,re=`[object Symbol]`,ie=`[object Date]`,ae=`[object Map]`,oe=`[object Set]`,se=`[object Array]`,ce=`[object Function]`,le=`[object ArrayBuffer]`,ue=`[object Object]`,de=`[object Error]`,fe=`[object DataView]`,pe=`[object Uint8Array]`,me=`[object Uint8ClampedArray]`,he=`[object Uint16Array]`,ge=`[object Uint32Array]`,_e=`[object BigUint64Array]`,ve=`[object Int8Array]`,ye=`[object Int16Array]`,be=`[object Int32Array]`,xe=`[object BigInt64Array]`,Se=`[object Float32Array]`,Ce=`[object Float64Array]`;function we(e,t){return Te(e,void 0,e,new Map,t)}function Te(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(y(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;aMe(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case se:case pe:case me:case he:case ge:case _e:case ve:case ye:case be:case xe:case Se:case Ce:if(S(e)!==S(t)||e.length!==t.length)return!1;for(let i=0;i=0}var Fe={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function Ie(e){return e.replace(/[&<>"']/g,e=>Fe[e])}function Le(e){return e!=null&&typeof e!=`function`&&Pe(e.length)}function Re(e){return typeof e==`symbol`||e instanceof Symbol}function ze(e){return e==null?``:Be(e)}function Be(e){if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(Be).join(`,`);if(Re(e))return e.toString();let t=e+``;return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function Ve(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function He(e){if(Array.isArray(e))return e.map(Ve);if(typeof e==`symbol`)return[e];e=ze(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1,s=!1,c=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push(``);r{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(w(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),D(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case ee:case E:case te:{let t=new e.constructor(e?.valueOf());return D(t,e),t}case ne:{let t={};return D(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function Je(e){return qe(e)}function Ye(e){return typeof e==`object`&&!!e&&w(e)===`[object Arguments]`}var Xe=/^(?:0|[1-9]\d*)$/;function Ze(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e{let r=e[t];(!(Object.hasOwn(e,t)&&Ae(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function ot(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function st(e,t,n,r){if(e==null&&!Ke(e))return e;let i;i=rt(t,e)?[t]:Array.isArray(t)?t:He(t);let a=n(A(e,i)),o=e;for(let t=0;tn,()=>void 0)}function ct(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=_(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?((r||i)&&(s=e.apply(this,t)),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function lt(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;etypeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0,mt=e=>e instanceof FormData||pt(e)||typeof e==`object`&&!!e&&Object.values(e).some(e=>mt(e)),ht=class extends Error{response;constructor(e){super(`HTTP error ${e.status}`),this.name=`HttpResponseError`,this.response=e}},gt=class extends Error{constructor(e=`Request was cancelled`){super(e),this.name=`HttpCancelledError`}},_t=class extends Error{constructor(e=`Network error`){super(e),this.name=`HttpNetworkError`}};function vt(e){let t=new URLSearchParams;return Object.entries(e).forEach(([e,n])=>{n!=null&&(Array.isArray(n)?n.forEach(n=>t.append(`${e}[]`,String(n))):typeof n==`object`?t.append(e,JSON.stringify(n)):t.append(e,String(n)))}),t.toString()}function yt(e,t,n){if(t&&!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&(e=t.replace(/\/$/,``)+`/`+e.replace(/^\//,``)),n&&Object.keys(n).length>0){let t=vt(n);t&&(e+=(e.includes(`?`)?`&`:`?`)+t)}return e}function bt(){return typeof window>`u`?null:window.axios?.defaults?.headers?.common?.[`X-Requested-With`]??null}function xt(e,t=new FormData,n=null){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&St(t,n?`${n}[${r}]`:r,e[r]);return t}function St(e,t,n){if(Array.isArray(n))return n.forEach((n,r)=>St(e,`${t}[${r}]`,n));if(n instanceof Date)return e.append(t,n.toISOString());if(typeof File<`u`&&n instanceof File)return e.append(t,n,n.name);if(n instanceof Blob)return e.append(t,n);if(typeof n==`boolean`)return e.append(t,n?`1`:`0`);if(typeof n==`string`)return e.append(t,n);if(typeof n==`number`)return e.append(t,`${n}`);if(n==null)return e.append(t,``);xt(n,e,t)}function Ct(e,t){if(e!=null)return e instanceof FormData?e:typeof e==`object`&&mt(e)?xt(e):typeof e==`object`||t[`Content-Type`]?.includes(`application/json`)?JSON.stringify(e):String(e)}function wt(e){let t={};return e.forEach((e,n)=>{t[n.toLowerCase()]=e}),t}function Tt(e={}){let t=e.xsrfCookieName??`XSRF-TOKEN`,n=e.xsrfHeaderName??`X-XSRF-TOKEN`;function r(){if(typeof document>`u`)return null;let e=document.cookie.match(RegExp(`(^|;\\s*)`+t+`=([^;]*)`));return e?decodeURIComponent(e[2]):null}return{setXsrfCookieName(e){t=e},setXsrfHeaderName(e){n=e},async request(e){let t=yt(e.url,e.baseURL,e.params),i=e.method.toUpperCase(),a={},o=bt();o&&(a[`X-Requested-With`]=o),e.data!==void 0&&![`GET`,`DELETE`].includes(i)&&!(e.data instanceof FormData)&&!mt(e.data)&&(a[`Content-Type`]=`application/json`),e.headers&&Object.entries(e.headers).forEach(([e,t])=>{t!==void 0&&(a[e]=String(t))});let s=r();s&&![`GET`,`HEAD`,`OPTIONS`].includes(i)&&(a[n]=s);let c=e.signal,l,u=e.timeout??3e4;if(u>0&&!c){let e=new AbortController;c=e.signal,l=setTimeout(()=>e.abort(),u)}let d=[`GET`,`DELETE`].includes(i)?void 0:Ct(e.data,a);d instanceof FormData&&delete a[`Content-Type`];try{let n=await fetch(t,{method:i,headers:a,body:d,signal:c,credentials:e.credentials??`same-origin`});l&&clearTimeout(l);let r;r=n.headers.get(`content-type`)?.includes(`application/json`)?await n.json():await n.text();let o={status:n.status,data:r,headers:wt(n.headers)};if(!n.ok)throw new ht(o);return o}catch(e){throw l&&clearTimeout(l),e instanceof ht?e:e instanceof DOMException&&e.name===`AbortError`?new gt:e instanceof TypeError?new _t(e.message):e}}}}var Et=Tt(),Dt=Et,Ot=void 0,kt=void 0,At=`same-origin`,jt=e=>`${e.method}:${e.baseURL??Ot??``}${e.url}`,Mt=e=>e.status===204&&e.headers[`precognition-success`]===`true`,Nt={},M={get:(e,t={},n={})=>Ft(Pt(`get`,e,t,n)),post:(e,t={},n={})=>Ft(Pt(`post`,e,t,n)),patch:(e,t={},n={})=>Ft(Pt(`patch`,e,t,n)),put:(e,t={},n={})=>Ft(Pt(`put`,e,t,n)),delete:(e,t={},n={})=>Ft(Pt(`delete`,e,t,n)),useHttpClient(e){return Dt=e,M},withBaseURL(e){return Ot=e,M},withTimeout(e){return kt=e,M},withCredentials(e){return At=typeof e==`string`?e:e?`include`:`omit`,M},fingerprintRequestsUsing(e){return jt=e===null?()=>null:e,M},determineSuccessUsing(e){return Mt=e,M},withXsrfCookieName(e){return Et.setXsrfCookieName(e),M},withXsrfHeaderName(e){return Et.setXsrfHeaderName(e),M}},Pt=(e,t,n,r)=>({url:t,method:e,...r,...[`get`,`delete`].includes(e)?{params:dt({},n,r?.params)}:{data:dt({},n,r?.data)}}),Ft=(e={})=>{let t=[It,Rt,zt].reduce((e,t)=>t(e),e);return(t.onBefore??(()=>!0))()===!1?Promise.resolve(null):((t.onStart??(()=>null))(),Dt.request({method:t.method,url:t.url,baseURL:t.baseURL??Ot,data:t.data,params:t.params,headers:t.headers,signal:t.signal,timeout:t.timeout,credentials:At}).then(async e=>{t.precognitive&&Bt(e);let n=e.status,r=e;return t.precognitive&&t.onPrecognitionSuccess&&Mt(e)&&(r=await Promise.resolve(t.onPrecognitionSuccess(e)??r)),t.onSuccess&&Lt(n)&&(r=await Promise.resolve(t.onSuccess(r)??r)),(Ht(t,n)??(e=>e))(r)??r},e=>{if(Vt(e))return Promise.reject(e);let n=e;return t.precognitive&&Bt(n.response),(Ht(t,n.response.status)??((e,t)=>Promise.reject(t)))(n.response,n)}).finally(t.onFinish??(()=>null)))},It=e=>{let t=e.only??e.validate;return{...e,timeout:e.timeout??kt,precognitive:e.precognitive!==!1,fingerprint:e.fingerprint===void 0?jt(e,Dt):e.fingerprint,headers:{...e.headers,Accept:`application/json`,"Content-Type":Ut(e),...e.precognitive===!1?{}:{Precognition:!0},...t?{"Precognition-Validate-Only":Array.from(t).join()}:{}}}},Lt=e=>e>=200&&e<300,Rt=e=>typeof e.fingerprint==`string`?(Nt[e.fingerprint]?.abort(),delete Nt[e.fingerprint],e):e,zt=e=>typeof e.fingerprint!=`string`||e.signal||!e.precognitive?e:(Nt[e.fingerprint]=new AbortController,{...e,signal:Nt[e.fingerprint].signal}),Bt=e=>{if(e.headers?.precognition!==`true`)throw Error(`Did not receive a Precognition response. Ensure you have the Precognition middleware in place for the route.`)},Vt=e=>!(e instanceof ht)||typeof e.response?.status!=`number`,Ht=(e,t)=>({401:e.onUnauthorized,403:e.onForbidden,404:e.onNotFound,409:e.onConflict,422:e.onValidationError,423:e.onLocked})[t],Ut=e=>e.headers?.[`Content-Type`]??e.headers?.[`Content-type`]??e.headers?.[`content-type`]??(mt(e.data)?`multipart/form-data`:`application/json`),Wt=(e,t)=>{if(!e.includes(`*`))return[e];let n=e.split(`.`),r=[``];for(let e of n)if(e===`*`){let e=[];for(let n of r){let r=n?A(t,n):t;if(Array.isArray(r))for(let t=0;tt?`${t}.${e}`:e);return r},Gt=(e,t)=>t.includes(`*`)?RegExp(`^`+t.replace(/\./g,`\\.`).replace(/\*/g,`[^.]+`)+`$`).test(e):e===t,Kt=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.some(t=>Gt(e,t)))),qt=(e,t={})=>{let n={errorsChanged:[],touchedChanged:[],validatingChanged:[],validatedChanged:[]},r=!1,i=!1,a=e=>e===i?[]:(i=e,n.validatingChanged),o=[],s=e=>{let t=[...new Set(e)];return o.length!==t.length||!t.every(e=>o.includes(e))?(o=t,n.validatedChanged):[]},c=()=>o.filter(e=>d[e]===void 0),l=[],u=e=>{let t=[...new Set(e)];return l.length!==t.length||!t.every(e=>l.includes(e))?(l=t,n.touchedChanged):[]},d={},f=e=>{let t=Yt(e);return k(d,t)?[]:(d=t,n.errorsChanged)},p=e=>{let t={...d};return delete t[Xt(e)],f(t)},m=()=>Object.keys(d).length>0,h=1500,g=e=>{h=e,S.cancel(),S=x()},_=t,v=null,y=[],b=null,x=()=>ct(t=>{e({get:(e,n={},r={})=>M.get(e,T(n),C(r,t,n)),post:(e,n={},r={})=>M.post(e,T(n),C(r,t,n)),patch:(e,n={},r={})=>M.patch(e,T(n),C(r,t,n)),put:(e,n={},r={})=>M.put(e,T(n),C(r,t,n)),delete:(e,n={},r={})=>M.delete(e,T(n),C(r,t,n))}).catch(e=>e instanceof gt||e instanceof ht&&e.response?.status===422?null:Promise.reject(e))},h,{leading:!0,trailing:!0}),S=x(),C=(e,t,n={})=>{let r={...e,...t},i=Array.from(r.only??r.validate??l);return{...t,...dt({},e,t),only:i,timeout:r.timeout??5e3,onValidationError:(e,t)=>([...s([...o,...i]),...f(dt(Kt({...d},i),e.data.errors))].forEach(e=>e()),r.onValidationError?r.onValidationError(e,t):Promise.reject(t)),onSuccess:e=>(s([...o,...i]).forEach(e=>e()),r.onSuccess?r.onSuccess(e):e),onPrecognitionSuccess:e=>([...s([...o,...i]),...f(Kt({...d},i))].forEach(e=>e()),r.onPrecognitionSuccess?r.onPrecognitionSuccess(e):e),onBefore:()=>{let e=l.some(e=>e.includes(`*`)),t=e?[...new Set(l.flatMap(e=>Wt(e,n)))]:l;return r.onBeforeValidation&&r.onBeforeValidation({data:n,touched:t},{data:_,touched:y})===!1||(r.onBefore||(()=>!0))()===!1?!1:(e&&u(t).forEach(e=>e()),b=l,v=n,!0)},onStart:()=>{a(!0).forEach(e=>e()),(r.onStart??(()=>null))()},onFinish:()=>{a(!1).forEach(e=>e()),y=b,_=v,b=v=null,(r.onFinish??(()=>null))()}}},w=(e,t,n)=>{if(e===void 0){let e=Array.from(n?.only??n?.validate??[]);u([...l,...e]).forEach(e=>e()),S(n??{});return}if(pt(t)&&!r){console.warn(`Precognition file validation is not active. Call the "validateFiles" function on your form to enable it.`);return}e=Xt(e),(e.includes(`*`)||A(_,e)!==t)&&(u([e,...l]).forEach(e=>e()),S(n??{}))},T=e=>r===!1?Zt(e):e,E={touched:()=>l,validate(e,t,n){return typeof e==`object`&&!(`target`in e)&&(n=e,e=t=void 0),w(e,t,n),E},touch(e){let t=Array.isArray(e)?e:[Xt(e)];return u([...l,...t]).forEach(e=>e()),E},validating:()=>i,valid:c,errors:()=>d,hasErrors:m,setErrors(e){return f(e).forEach(e=>e()),E},forgetError(e){return p(e).forEach(e=>e()),E},defaults(e){return t=e,_=e,E},reset(...e){if(e.length===0)u([]).forEach(e=>e());else{let n=[...l];e.forEach(e=>{n.includes(e)&&n.splice(n.indexOf(e),1),j(_,e,A(t,e))}),u(n).forEach(e=>e())}return E},setTimeout(e){return g(e),E},on(e,t){return n[e].push(t),E},validateFiles(){return r=!0,E},withoutFileValidation(){return r=!1,E}};return E},Jt=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:Array.isArray(e[n])?e[n][0]:e[n]}),{}),Yt=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:typeof e[n]==`string`?[e[n]]:e[n]}),{}),Xt=e=>typeof e==`string`?e:e.target.name,Zt=e=>{let t={...e};return Object.keys(t).forEach(e=>{let n=t[e];if(n!==null){if(pt(n)){delete t[e];return}if(Array.isArray(n)){t[e]=Object.values(Zt({...n}));return}if(typeof n==`object`){t[e]=Zt(t[e]);return}}}),t},Qt=`modulepreload`,$t=function(e){return`/build/`+e},en={},N=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=$t(t,n),t=s(t),t in en)return;en[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Qt,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},tn=new class{config={};defaults;constructor(e){this.defaults=e}extend(e){return e&&(this.defaults={...this.defaults,...e}),this}replace(e){this.config=e}get(e){return Qe(this.config,e)?A(this.config,e):A(this.defaults,e)}set(e,t){typeof e==`string`?j(this.config,e,t):Object.entries(e).forEach(([e,t])=>{j(this.config,e,t)})}}({form:{recentlySuccessfulDuration:2e3,forceIndicesArrayFormatInFormData:!0,withAllErrors:!1},prefetch:{cacheFor:3e4,hoverDelay:75}});function nn(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function P(e,t){return document.dispatchEvent(new CustomEvent(`inertia:${e}`,t))}var rn=e=>P(`before`,{cancelable:!0,detail:{visit:e}}),an=(e,{page:t,visitId:n}={})=>P(`error`,{detail:{errors:e,page:t,visitId:n}}),on=e=>P(`networkError`,{cancelable:!0,detail:{error:e}}),sn=e=>P(`finish`,{detail:{visit:e}}),cn=e=>P(`httpException`,{cancelable:!0,detail:{response:e}}),ln=e=>P(`beforeUpdate`,{detail:{page:e}}),un=(e,{cached:t=!1,visitId:n}={})=>P(`navigate`,{detail:{page:e,cached:t,visitId:n}}),dn=(e,{replace:t,visitId:n})=>P(`clientVisit`,{detail:{page:e,replace:t,visitId:n}}),fn=e=>P(`progress`,{detail:{progress:e}}),pn=e=>P(`start`,{detail:{visit:e}}),mn=(e,{visitId:t}={})=>P(`success`,{detail:{page:e,visitId:t}}),hn=(e,t)=>P(`prefetched`,{detail:{fetchedAt:Date.now(),response:e,visit:t}}),gn=e=>P(`prefetching`,{detail:{visit:e}}),_n=e=>P(`flash`,{detail:{flash:e}}),vn=(e,t)=>P(`location`,{cancelable:!0,detail:{url:e,versionChange:t}}),F=class{static locationVisitKey=`inertiaLocationVisit`;static set(e,t){typeof window<`u`&&window.sessionStorage.setItem(e,JSON.stringify(t))}static get(e){if(typeof window<`u`)return JSON.parse(window.sessionStorage.getItem(e)||`null`)}static merge(e,t){let n=this.get(e);n===null?this.set(e,t):this.set(e,{...n,...t})}static remove(e){typeof window<`u`&&window.sessionStorage.removeItem(e)}static removeNested(e,t){let n=this.get(e);n!==null&&(delete n[t],this.set(e,n))}static exists(e){try{return this.get(e)!==null}catch{return!1}}static clear(){typeof window<`u`&&window.sessionStorage.clear()}},yn=async e=>{if(typeof window>`u`)throw Error(`Unable to encrypt history`);let t=wn(),n=await Dn(await On());if(!n)throw Error(`Unable to encrypt history`);return await Sn(t,n,e)},bn={key:`historyKey`,iv:`historyIv`},xn=async e=>{let t=wn(),n=await On();if(!n)throw Error(`Unable to decrypt history`);return await Cn(t,n,e)},Sn=async(e,t,n)=>{if(typeof window>`u`)throw Error(`Unable to encrypt history`);if(window.crypto.subtle===void 0)return console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve(n);let r=new TextEncoder,i=JSON.stringify(n),a=new Uint8Array(i.length*3),o=r.encodeInto(i,a);return window.crypto.subtle.encrypt({name:`AES-GCM`,iv:e},t,a.subarray(0,o.written))},Cn=async(e,t,n)=>{if(window.crypto.subtle===void 0)return console.warn(`Decryption is not supported in this environment. SSL is required.`),Promise.resolve(n);let r=await window.crypto.subtle.decrypt({name:`AES-GCM`,iv:e},t,n);return JSON.parse(new TextDecoder().decode(r))},wn=()=>{let e=F.get(bn.iv);if(e)return new Uint8Array(e);let t=window.crypto.getRandomValues(new Uint8Array(12));return F.set(bn.iv,Array.from(t)),t},Tn=async()=>window.crypto.subtle===void 0?(console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve(null)):window.crypto.subtle.generateKey({name:`AES-GCM`,length:256},!0,[`encrypt`,`decrypt`]),En=async e=>{if(window.crypto.subtle===void 0)return console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve();let t=await window.crypto.subtle.exportKey(`raw`,e);F.set(bn.key,Array.from(new Uint8Array(t)))},Dn=async e=>{if(e)return e;let t=await Tn();return t?(await En(t),t):null},On=async()=>{let e=F.get(bn.key);return e?await window.crypto.subtle.importKey(`raw`,new Uint8Array(e),{name:`AES-GCM`,length:256},!0,[`encrypt`,`decrypt`]):null},kn=e=>{let t={};for(let n of Object.keys(e))e[n]!==void 0&&(t[n]=e[n]);return t},An=(e,t,n)=>{if(e===t)return!0;for(let r in e)if(!n.includes(r)&&e[r]!==t[r]&&!jn(e[r],t[r]))return!1;for(let r in t)if(!n.includes(r)&&!(r in e))return!1;return!0},jn=(e,t)=>{switch(typeof e){case`object`:return An(e,t,[]);case`function`:return e.toString()===t.toString();default:return e===t}},Mn=(e,t,n)=>{let r=He(t);if(r.length===0)return e;let i=(e,t)=>{if(t===r.length)return n;let a=r[t],o=Array.isArray(e)?[...e]:e&&typeof e==`object`?{...e}:/^(?:0|[1-9]\d*)$/.test(a)?[]:{};return o[a]=i(e?.[a],t+1),o};return i(e,0)},Nn={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},Pn=e=>{if(typeof e==`number`)return e;for(let[t,n]of Object.entries(Nn))if(e.endsWith(t))return parseFloat(e)*n;return parseInt(e)},I=new class{cached=[];inFlightRequests=[];removalTimers=[];currentUseId=null;add(e,t,{cacheFor:n,cacheTags:r}){if(this.findInFlight(e))return Promise.resolve();let i=this.findCached(e);if(!e.fresh&&i&&i.staleTimestamp>Date.now())return Promise.resolve();let[a,o]=this.extractStaleValues(n),s=new Promise((n,r)=>{t({...e,onCancel:()=>{this.remove(e),e.onCancel(),r()},onError:t=>{this.remove(e),e.onError(t),r()},onPrefetching(t){e.onPrefetching(t)},onPrefetched(t,n){e.onPrefetched(t,n)},onPrefetchResponse(e){n(e)},onPrefetchError(t){I.removeFromInFlight(e),r(t)}})}).then(t=>{this.remove(e);let n=t.getPageResponse();B.mergeOncePropsIntoResponse(n),this.cached.push({params:{...e},staleTimestamp:Date.now()+a,expiresAt:Date.now()+o,response:s,singleUse:o===0,timestamp:Date.now(),inFlight:!1,tags:Array.isArray(r)?r:[r]});let i=this.getShortestOncePropTtl(n);return this.scheduleForRemoval(e,i?Math.min(o,i):o),this.removeFromInFlight(e),t.handlePrefetch(),t});return this.inFlightRequests.push({params:{...e},response:s,staleTimestamp:null,inFlight:!0}),s}removeAll(){this.cached=[],this.removalTimers.forEach(e=>{clearTimeout(e.timer)}),this.removalTimers=[]}removeByTags(e){this.cached=this.cached.filter(t=>!t.tags.some(t=>e.includes(t)))}remove(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)),this.clearTimer(e)}removeFromInFlight(e){this.inFlightRequests=this.inFlightRequests.filter(t=>!this.paramsAreEqual(t.params,e))}extractStaleValues(e){let[t,n]=this.cacheForToStaleAndExpires(e);return[Pn(t),Pn(n)]}cacheForToStaleAndExpires(e){if(!Array.isArray(e))return[e,e];switch(e.length){case 0:return[0,0];case 1:return[e[0],e[0]];default:return[e[0],e[1]]}}clearTimer(e){let t=this.removalTimers.find(t=>this.paramsAreEqual(t.params,e));t&&(clearTimeout(t.timer),this.removalTimers=this.removalTimers.filter(e=>e!==t))}scheduleForRemoval(e,t){if(typeof window<`u`&&(this.clearTimer(e),t>0)){let n=window.setTimeout(()=>this.remove(e),t);this.removalTimers.push({params:e,timer:n})}}get(e){return this.findCached(e)||this.findInFlight(e)}use(e,t){let n=`${t.url.pathname}-${Date.now()}-${Math.random().toString(36).substring(7)}`;this.currentUseId=n;let r={...t,cached:!0};return e.response.then(e=>{if(this.currentUseId===n)return e.mergeParams({...r,onPrefetched:()=>{}}),this.removeSingleUseItems(t),e.handle()})}removeSingleUseItems(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)||!t.singleUse)}findCached(e){return this.cached.find(t=>this.paramsAreEqual(t.params,e))||null}findInFlight(e){return this.inFlightRequests.find(t=>this.paramsAreEqual(t.params,e))||null}withoutPurposePrefetchHeader(e){let t=O(e);return t.headers.Purpose===`prefetch`&&delete t.headers.Purpose,t}paramsAreEqual(e,t){return An(this.withoutPurposePrefetchHeader(e),this.withoutPurposePrefetchHeader(t),[`id`,`showProgress`,`replace`,`prefetch`,`preserveScroll`,`preserveState`,`onBefore`,`onBeforeUpdate`,`onStart`,`onProgress`,`onFinish`,`onCancel`,`onSuccess`,`onError`,`onFlash`,`onPrefetched`,`onCancelToken`,`onPrefetching`,`async`,`viewTransition`,`optimistic`,`component`,`pageProps`,`cached`])}updateCachedOncePropsFromCurrentPage(){this.cached.forEach(e=>{e.response.then(t=>{let n=t.getPageResponse();B.mergeOncePropsIntoResponse(n,{force:!0});for(let[e,t]of Object.entries(n.deferredProps??{})){let r=t.filter(e=>A(n.props,e)===void 0);r.length>0?n.deferredProps[e]=r:delete n.deferredProps[e]}let r=this.getShortestOncePropTtl(n);if(r===null)return;let i=e.expiresAt-Date.now(),a=Math.min(i,r);a>0?this.scheduleForRemoval(e.params,a):this.remove(e.params)})})}getShortestOncePropTtl(e){let t=Object.values(e.onceProps??{}).map(e=>e.expiresAt).filter(e=>!!e);return t.length===0?null:Math.min(...t)-Date.now()}},Fn=e=>{if(e.offsetParent===null)return!1;let t=e.getBoundingClientRect(),n=t.top=0,r=t.left=0;return n&&r},In=e=>{let t=e=>{let t=window.getComputedStyle(e);return t.overflowY===`scroll`?!0:t.overflowY===`auto`?[`visible`,`clip`].includes(t.overflowX)?!0:r(t.maxHeight,e.style.height)||i(e,`height`):!1},n=e=>{let t=window.getComputedStyle(e);return t.overflowX===`scroll`?!0:t.overflowX===`auto`?[`visible`,`clip`].includes(t.overflowY)?!0:r(t.maxWidth,e.style.width)||i(e,`width`):!1},r=(e,t)=>!!(e&&e!==`none`&&e!==`0px`||t&&t!==`auto`&&t!==`0`),i=(e,t)=>{let n=e.parentElement;if(!n)return!1;let r=window.getComputedStyle(n);if([`flex`,`inline-flex`].includes(r.display)){let e=[`column`,`column-reverse`].includes(r.flexDirection);return t===`height`?e:!e}return[`grid`,`inline-grid`].includes(r.display)},a=e?.parentElement;for(;a;){let e=t(a)||n(a);if(window.getComputedStyle(a).display!==`contents`&&e)return a;a=a.parentElement}return null},Ln=(e,t)=>{if(!t)return e.filter(e=>Fn(e));let n=e.indexOf(t),r=[],i=[];for(let t=n;t>=0;t--){let n=e[t];if(Fn(n))r.push(n);else break}for(let t=n+1;t{window.requestAnimationFrame(()=>{t>1?Rn(e,t-1):e()})},zn=e=>{if(typeof window>`u`)return null;let t=document.querySelector(`script[data-page="${e}"][type="application/json"]`);return t?.textContent?JSON.parse(t.textContent):null},Bn=typeof window>`u`,Vn=!Bn&&/Firefox/i.test(window.navigator.userAgent),L=class{static save(){V.saveScrollPositions(this.getScrollRegions())}static getScrollRegions(){return Array.from(this.regions()).map(e=>({top:e.scrollTop,left:e.scrollLeft}))}static regions(){return document.querySelectorAll(`[scroll-region]`)}static scrollToTop(){if(Vn&&getComputedStyle(document.documentElement).scrollBehavior===`smooth`)return Rn(()=>window.scrollTo(0,0),2);window.scrollTo(0,0)}static reset(){(Bn||!window.location.hash)&&this.scrollToTop(),this.regions().forEach(e=>{typeof e.scrollTo==`function`?e.scrollTo(0,0):(e.scrollTop=0,e.scrollLeft=0)}),this.save(),this.scrollToAnchor()}static scrollToAnchor(){let e=Bn?null:window.location.hash;e&&setTimeout(()=>{let t=document.getElementById(e.slice(1));t?t.scrollIntoView():this.scrollToTop()})}static restore(e){Bn||window.requestAnimationFrame(()=>{this.restoreDocument(),this.restoreScrollRegions(e)})}static restoreScrollRegions(e){Bn||this.regions().forEach((t,n)=>{let r=e[n];r&&(typeof t.scrollTo==`function`?t.scrollTo(r.left,r.top):(t.scrollTop=r.top,t.scrollLeft=r.left))})}static restoreDocument(){let e=V.getDocumentScrollPosition();window.scrollTo(e.left,e.top)}static onScroll(e){let t=e.target;typeof t.hasAttribute==`function`&&t.hasAttribute(`scroll-region`)&&this.save()}static onWindowScroll(){V.saveDocumentScrollPosition({top:window.scrollY,left:window.scrollX})}},Hn=e=>typeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0;function Un(e){return Hn(e)||e instanceof FormData&&Array.from(e.values()).some(e=>Un(e))||typeof e==`object`&&!!e&&Object.values(e).some(e=>Un(e))}var Wn=e=>e instanceof FormData;function Gn(e,t=new FormData,n=null,r=`brackets`){e||={};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&qn(t,Kn(n,i,`indices`),e[i],r);return t}function Kn(e,t,n){return e?n===`brackets`?`${e}[]`:`${e}[${t}]`:t}function qn(e,t,n,r){if(Array.isArray(n))return Array.from(n.keys()).forEach(i=>qn(e,Kn(t,i.toString(),r),n[i],r));if(n instanceof Date)return e.append(t,n.toISOString());if(n instanceof File)return e.append(t,n,n.name);if(n instanceof Blob)return e.append(t,n);if(typeof n==`boolean`)return e.append(t,n?`1`:`0`);if(typeof n==`string`)return e.append(t,n);if(typeof n==`number`)return e.append(t,`${n}`);if(n==null)return e.append(t,``);Gn(n,e,t,r)}function Jn(e){return/\[\d+\]/.test(decodeURIComponent(e.search))}function Yn(e){if(!e||e===`?`)return{};let t={};return e.replace(/^\?/,``).split(`&`).filter(Boolean).forEach(e=>{let[n,r]=Zn(e);$n(t,Qn(n),Qn(r))}),t}function Xn(e,t){let n=[];return tr(e,``,n,t),n.length?`?`+n.join(`&`):``}function Zn(e){let t=e.indexOf(`=`);return t===-1?[e,``]:[e.substring(0,t),e.substring(t+1)]}function Qn(e){return decodeURIComponent(e.replace(/\+/g,` `))}function $n(e,t,n){let r=er(t);if(r.some(e=>e===`__proto__`))return;let i=e;for(;r.length>1;){let e=r.shift(),t=r[0]===``;(typeof i[e]!=`object`||i[e]===null)&&(i[e]=t?[]:{}),i=i[e]}let a=r.shift();a===``&&Array.isArray(i)?i.push(n):i[a]=n}function er(e){let t=[],n=e.split(`[`)[0];n&&t.push(n);let r,i=/\[([^\]]*)\]/g;for(;(r=i.exec(e))!==null;)t.push(r[1]);return t}function tr(e,t,n,r){if(e!==void 0){if(e===null){n.push(`${t}=`);return}if(Array.isArray(e)){e.forEach((e,i)=>{tr(e,r===`indices`?`${t}[${i}]`:`${t}[]`,n,r)});return}if(typeof e==`object`){Object.keys(e).forEach(i=>{tr(e[i],t?`${t}[${i}]`:i,n,r)});return}n.push(`${t}=${encodeURIComponent(String(e))}`)}}function R(e){return new URL(e.toString(),typeof window>`u`?void 0:window.location.toString())}var nr=(e,t,n,r,i)=>{let a=typeof e==`string`?R(e):e;if((Un(t)||r)&&!Wn(t)&&(tn.get(`form.forceIndicesArrayFormatInFormData`)&&(i=`indices`),t=Gn(t,new FormData,null,i)),Wn(t))return[a,t];let[o,s]=rr(n,a,t,i);return[R(o),s]};function rr(e,t,n,r=`brackets`){let i=e===`get`&&!Wn(n)&&Object.keys(n).length>0,a=lr(t.toString()),o=a||t.toString().startsWith(`/`)||t.toString()===``,s=!o&&!t.toString().startsWith(`#`)&&!t.toString().startsWith(`?`),c=/^[.]{1,2}([/]|$)/.test(t.toString()),l=t.toString().includes(`?`)||i,u=t.toString().includes(`#`),d=new URL(t.toString(),typeof window>`u`?`http://localhost`:window.location.toString());if(i){let e=Jn(d)?`indices`:r;d.search=Xn({...Yn(d.search),...n},e)}return[[a?`${d.protocol}//${d.host}`:``,o?d.pathname:``,s?d.pathname.substring(+!c):``,l?d.search:``,u?d.hash:``].join(``),i?{}:n]}function ir(e){return e=new URL(e.href),e.hash=``,e}var ar=(e,t)=>{e.hash&&!t.hash&&ir(e).href===t.href&&(t.hash=e.hash)},or=(e,t)=>ir(e).href===ir(t).href,sr=(e,t)=>e.origin===t.origin&&e.pathname===t.pathname;function z(e){return typeof e==`object`&&!!e&&e!==void 0&&`url`in e&&`method`in e}function cr(e){return e.component?typeof e.component==`string`?e.component:(console.error(`The "component" property on the URL method pair received multiple components (${Object.keys(e.component).join(`, `)}), but only a single component string is supported for instant visits. Use the withComponent() method to specify which component to use.`),null):null}function lr(e){return/^([a-z][a-z0-9+.-]*:)?\/\/[^/]/i.test(e)}function ur(e,t){let n=typeof e==`string`?R(e):e;return t?`${n.protocol}//${n.host}${n.pathname}${n.search}${n.hash}`:`${n.pathname}${n.search}${n.hash}`}var B=new class{page;swapComponent;resolveComponent;onFlashCallback;componentId={};listeners=[];isFirstPageLoad=!0;cleared=!1;pendingDeferredProps=null;historyQuotaExceeded=!1;optimisticBaseline={};pendingOptimistics=[];optimisticCounter=0;init({initialPage:e,swapComponent:t,resolveComponent:n,onFlash:r}){return this.page={...e,flash:e.flash??{},rescuedProps:e.rescuedProps??[]},this.swapComponent=t,this.resolveComponent=n,this.onFlashCallback=r,H.on(`historyQuotaExceeded`,()=>{this.historyQuotaExceeded=!0}),this}set(e,{replace:t=!1,preserveScroll:n=!1,preserveState:r=!1,viewTransition:i=!1,cached:a=!1,initialRender:o=!1,visitId:s}={}){Object.keys(e.deferredProps||{}).length&&(this.pendingDeferredProps={deferredProps:e.deferredProps,component:e.component,url:e.url},e.initialDeferredProps===void 0&&(e.initialDeferredProps=e.deferredProps)),this.componentId={};let c=this.componentId;return e.clearHistory&&V.clear(),this.resolve(e.component,e).then(l=>{if(c!==this.componentId)return;e.rememberedState??={};let u=typeof window>`u`,d=u?new URL(e.url):window.location,f=!u&&n?L.getScrollRegions():[];t||=or(R(e.url),d);let p={...e,flash:{}};return new Promise(e=>t?V.replaceState(p,e):V.pushState(p,e)).then(()=>{let c=!this.isTheSame(e);if(!c&&Object.keys(e.props.errors||{}).length>0&&(i=!1),this.page=e,this.cleared=!1,this.hasOnceProps()&&I.updateCachedOncePropsFromCurrentPage(),c&&this.fireEventsFor(`newComponent`),this.isFirstPageLoad&&this.fireEventsFor(`firstLoad`),this.isFirstPageLoad=!1,this.historyQuotaExceeded){this.historyQuotaExceeded=!1;return}return this.swap({component:l,page:e,preserveState:r,viewTransition:i,initialRender:o}).then(()=>{n?window.requestAnimationFrame(()=>L.restoreScrollRegions(f)):L.reset(),this.pendingDeferredProps&&this.pendingDeferredProps.component===e.component&&this.pendingDeferredProps.url===e.url&&H.fireInternalEvent(`loadDeferredProps`,this.pendingDeferredProps.deferredProps),this.pendingDeferredProps=null,t||un(e,{cached:a,visitId:s})})})})}setQuietly(e,{preserveState:t=!1}={}){return this.resolve(e.component,e).then(n=>(this.page=e,this.cleared=!1,V.setCurrent(e),this.swap({component:n,page:e,preserveState:t,viewTransition:!1})))}clear(){this.cleared=!0}isCleared(){return this.cleared}get(){return this.page}getWithoutFlashData(){return{...this.page,flash:{}}}hasOnceProps(){return Object.keys(this.page.onceProps??{}).length>0}merge(e){this.page={...this.page,...e}}setPropsQuietly(e){return this.page={...this.page,props:e},this.resolve(this.page.component,this.page).then(e=>this.swap({component:e,page:this.page,preserveState:!0,viewTransition:!1}))}setFlash(e){this.page={...this.page,flash:e},this.onFlashCallback?.(e)}setUrlHash(e){this.page.url.includes(e)||(this.page.url+=e)}remember(e){this.page.rememberedState=e}swap({component:e,page:t,preserveState:n,viewTransition:r,initialRender:i=!1}){let a=()=>this.swapComponent({component:e,page:t,preserveState:n,initialRender:i});if(!r||!document?.startViewTransition||document.visibilityState===`hidden`)return a();let o=typeof r==`boolean`?()=>null:r,s=e=>{e.catch(e=>{if(!(e instanceof DOMException))throw e})};return new Promise(e=>{let t=document.startViewTransition(()=>a().then(e));s(t.ready),s(t.finished),s(t.updateCallbackDone),o(t)})}resolve(e,t){return Promise.resolve(this.resolveComponent(e,t))}nextOptimisticId(){return++this.optimisticCounter}setBaseline(e,t){e in this.optimisticBaseline||(this.optimisticBaseline[e]=t)}updateBaseline(e,t){e in this.optimisticBaseline&&(this.optimisticBaseline[e]=t)}hasBaseline(e){return e in this.optimisticBaseline}registerOptimistic(e,t){this.pendingOptimistics.push({id:e,callback:t})}unregisterOptimistic(e){this.pendingOptimistics=this.pendingOptimistics.filter(t=>t.id!==e)}replayOptimistics(){let e=Object.keys(this.optimisticBaseline);if(e.length===0)return{};let t=O(this.page.props);for(let n of e)t[n]=O(this.optimisticBaseline[n]);for(let{callback:e}of this.pendingOptimistics){let n=e(O(t));n&&Object.assign(t,n)}let n={};for(let r of e)n[r]=t[r];return n}pendingOptimisticCount(){return this.pendingOptimistics.length}clearOptimisticState(){this.optimisticBaseline={},this.pendingOptimistics=[]}isTheSame(e){return this.page.component===e.component}on(e,t){return this.listeners.push({event:e,callback:t}),()=>{this.listeners=this.listeners.filter(n=>n.event!==e&&n.callback!==t)}}fireEventsFor(e){this.listeners.filter(t=>t.event===e).forEach(e=>e.callback())}mergeOncePropsIntoResponse(e,{force:t=!1}={}){Object.entries(e.onceProps??{}).forEach(([n,r])=>{let i=this.page.onceProps?.[n];i!==void 0&&(t||A(e.props,r.prop)===void 0)&&(j(e.props,r.prop,A(this.page.props,i.prop)),e.onceProps[n].expiresAt=i.expiresAt)})}},dr=class{items=[];processingPromise=null;add(e){return this.items.push(e),this.process()}process(){return this.processingPromise??=this.processNext().finally(()=>{this.processingPromise=null}),this.processingPromise}processNext(){let e=this.items.shift();return e?Promise.resolve(e()).then(()=>this.processNext()):Promise.resolve()}},fr=typeof window>`u`,pr=new dr,mr=!fr&&/CriOS/.test(window.navigator.userAgent),hr=class{rememberedState=`rememberedState`;scrollRegions=`scrollRegions`;preserveUrl=!1;current={};initialState=null;remember(e,t){this.replaceState({...B.getWithoutFlashData(),rememberedState:{...B.get()?.rememberedState??{},[t]:e}})}restore(e){if(!fr)return this.current[this.rememberedState]?.[e]===void 0?this.initialState?.[this.rememberedState]?.[e]:this.current[this.rememberedState]?.[e]}pushState(e,t=null){if(!fr){if(this.preserveUrl){t&&t();return}this.current=e,pr.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doPushState({page:n},e.url).then(()=>t?.());return mr?new Promise(e=>{setTimeout(()=>r().then(e))}):r()}))}}clonePageProps(e){try{return structuredClone(e.props),e}catch{return{...e,props:O(e.props)}}}getPageData(e){let t=this.clonePageProps(e);return new Promise(n=>e.encryptHistory?yn(t).then(n):n(t))}processQueue(){return pr.process()}decrypt(e=null){if(fr)return Promise.resolve(e??B.get());let t=e??window.history.state?.page;return this.decryptPageData(t).then(e=>{if(!e)throw Error(`Unable to decrypt history`);return this.initialState===null?this.initialState=e??void 0:this.current=e??{},e})}decryptPageData(e){return e instanceof ArrayBuffer?xn(e):Promise.resolve(e)}saveScrollPositions(e){pr.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!k(this.getScrollRegions(),e))return this.doReplaceState({page:window.history.state.page,scrollRegions:e})}))}saveDocumentScrollPosition(e){pr.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!k(this.getDocumentScrollPosition(),e))return this.doReplaceState({page:window.history.state.page,documentScrollPosition:e})}))}getScrollRegions(){return window.history.state?.scrollRegions||[]}getDocumentScrollPosition(){return window.history.state?.documentScrollPosition||{top:0,left:0}}replaceState(e,t=null){if(k(this.current,e)){t&&t();return}let{flash:n,...r}=e;if(B.merge(r),!fr){if(this.preserveUrl){t&&t();return}this.current=e,pr.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doReplaceState({page:n},e.url).then(()=>t?.());return mr?new Promise(e=>{setTimeout(()=>r().then(e))}):r()}))}}isHistoryThrottleError(e){return e instanceof Error&&e.name===`SecurityError`&&(e.message.includes(`history.pushState`)||e.message.includes(`history.replaceState`))}isQuotaExceededError(e){return e instanceof Error&&e.name===`QuotaExceededError`}withThrottleProtection(e){return Promise.resolve().then(()=>{try{return e()}catch(e){if(!this.isHistoryThrottleError(e))throw e;console.error(e.message)}})}doReplaceState(e,t){return this.withThrottleProtection(()=>{window.history.replaceState({...e,scrollRegions:e.scrollRegions??window.history.state?.scrollRegions,documentScrollPosition:e.documentScrollPosition??window.history.state?.documentScrollPosition},``,t)})}doPushState(e,t){return this.withThrottleProtection(()=>{try{window.history.pushState(e,``,t)}catch(e){if(!this.isQuotaExceededError(e))throw e;H.fireInternalEvent(`historyQuotaExceeded`,t)}})}getState(e,t){return this.current?.[e]??t}deleteState(e){this.current[e]!==void 0&&(delete this.current[e],this.replaceState(this.current))}clearInitialState(e){this.initialState&&this.initialState[e]!==void 0&&delete this.initialState[e]}browserHasHistoryEntry(){return!fr&&!!window.history.state?.page}clear(){F.remove(bn.key),F.remove(bn.iv)}setCurrent(e){this.current=e}isValidState(e){return!!e.page}getAllState(){return this.current}};typeof window<`u`&&window.history.scrollRestoration&&(window.history.scrollRestoration=`manual`);var V=new hr,H=new class{internalListeners=[];init(){typeof window<`u`&&(window.addEventListener(`popstate`,this.handlePopstateEvent.bind(this)),window.addEventListener(`pageshow`,this.handlePageshowEvent.bind(this)),window.addEventListener(`scroll`,nn(L.onWindowScroll.bind(L),100),!0)),typeof document<`u`&&document.addEventListener(`scroll`,nn(L.onScroll.bind(L),100),!0)}onGlobalEvent(e,t){return this.registerListener(`inertia:${e}`,(e=>{let n=t(e);e.cancelable&&!e.defaultPrevented&&n===!1&&e.preventDefault()}))}on(e,t){return this.internalListeners.push({event:e,listener:t}),()=>{this.internalListeners=this.internalListeners.filter(e=>e.listener!==t)}}onMissingHistoryItem(){B.clear(),this.fireInternalEvent(`missingHistoryItem`)}fireInternalEvent(e,...t){this.internalListeners.filter(t=>t.event===e).forEach(e=>e.listener(...t))}registerListener(e,t){return document.addEventListener(e,t),()=>document.removeEventListener(e,t)}handlePageshowEvent(e){e.persisted&&V.decrypt().catch(()=>this.onMissingHistoryItem())}handlePopstateEvent(e){let t=e.state||null;if(t===null){let e=R(B.get().url);e.hash=window.location.hash,V.replaceState({...B.getWithoutFlashData(),url:e.href}),L.reset();return}if(!V.isValidState(t))return this.onMissingHistoryItem();V.decrypt(t.page).then(e=>{if(B.get().version!==e.version){this.onMissingHistoryItem();return}X.cancelAll({prefetch:!1}),B.setQuietly(e,{preserveState:!1}).then(()=>{L.restore(V.getScrollRegions()),un(B.get());let t={},n=B.get().props;for(let[r,i]of Object.entries(e.initialDeferredProps??e.deferredProps??{})){let e=i.filter(e=>A(n,e)===void 0);e.length>0&&(t[r]=e)}Object.keys(t).length>0&&this.fireInternalEvent(`loadDeferredProps`,t)})}).catch(()=>{this.onMissingHistoryItem()})}},gr=new class{type;constructor(){this.type=this.resolveType()}resolveType(){return typeof window>`u`?`navigate`:window.performance?.getEntriesByType(`navigation`)[0]?.type??`navigate`}get(){return this.type}isBackForward(){return this.type===`back_forward`}isReload(){return this.type===`reload`}};function _r(){let e=typeof window<`u`?window.crypto:void 0;if(e?.randomUUID)return e.randomUUID();let t=()=>e?.getRandomValues?e.getRandomValues(new Uint8Array(1))[0]:Math.floor(Math.random()*256);return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(+e^t()&15>>e/4).toString(16))}var vr=class{static handle(){this.clearRememberedStateOnReload(),[this.handleBackForward,this.handleLocation,this.handleDefault].find(e=>e.bind(this)())}static clearRememberedStateOnReload(){gr.isReload()&&(V.deleteState(V.rememberedState),V.clearInitialState(V.rememberedState))}static handleBackForward(){if(!gr.isBackForward()||!V.browserHasHistoryEntry())return!1;let e=V.getScrollRegions();return V.decrypt().then(t=>{let n=_r();B.set(t,{preserveScroll:!0,preserveState:!0,visitId:n}).then(()=>{L.restore(e),un(B.get(),{visitId:n})})}).catch(()=>{H.onMissingHistoryItem()}),!0}static handleLocation(){if(!F.exists(F.locationVisitKey))return!1;let e=F.get(F.locationVisitKey)||{};return F.remove(F.locationVisitKey),typeof window<`u`&&B.setUrlHash(window.location.hash),V.decrypt(B.get()).then(()=>{let t=_r(),n=V.getState(V.rememberedState,{}),r=V.getScrollRegions();B.remember(n),B.set(B.get(),{preserveScroll:e.preserveScroll,preserveState:!0,initialRender:!0,visitId:t}).then(()=>{e.preserveScroll&&L.restore(r),this.fireInitialEvents(t)})}).catch(()=>{H.onMissingHistoryItem()}),!0}static handleDefault(){typeof window<`u`&&B.setUrlHash(window.location.hash);let e=_r();B.set(B.get(),{preserveScroll:!0,preserveState:!0,initialRender:!0,visitId:e}).then(()=>{gr.isReload()?L.restore(V.getScrollRegions()):L.scrollToAnchor(),this.fireInitialEvents(e)})}static fireInitialEvents(e){let t=B.get();un(t,{visitId:e}),Object.keys(t.flash).length>0&&queueMicrotask(()=>_n(t.flash))}},yr=class{intervalId=null;timeoutId=null;throttle=!1;keepAlive=!1;cb;interval;cbCount=0;mode;inFlight=!1;currentCancel=null;stopped=!0;instanceId=0;constructor(e,t,n){this.keepAlive=n.keepAlive??!1,this.mode=n.mode??`overlap`,this.cb=t,this.interval=e,(n.autoStart??!0)&&this.start()}stop(){this.stopped=!0,this.instanceId++,this.inFlight=!1,this.currentCancel=null,this.intervalId&&=(clearInterval(this.intervalId),null),this.timeoutId&&=(clearTimeout(this.timeoutId),null)}start(){if(typeof window<`u`){if(this.stop(),this.stopped=!1,this.mode===`rest`){this.scheduleNext();return}this.intervalId=window.setInterval(()=>this.tick(),this.interval)}}isInBackground(e){this.throttle=!this.keepAlive&&e,this.throttle&&(this.cbCount=0)}scheduleNext(){this.stopped||(this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.tick()},this.interval))}tick(){!this.throttle||this.cbCount%10==0?this.fire():this.mode===`rest`&&this.scheduleNext(),this.throttle&&this.cbCount++}fire(){this.inFlight&&this.mode===`cancel`&&this.currentCancel?.();let e=this.instanceId;this.cb({onStart:t=>{e===this.instanceId&&(this.inFlight=!0,this.currentCancel=t)},onFinish:()=>{e===this.instanceId&&(this.inFlight=!1,this.currentCancel=null,this.mode===`rest`&&this.scheduleNext())}})}},br=new class{polls=[];constructor(){this.setupVisibilityListener()}get count(){return this.polls.length}add(e,t,n){let r=new yr(e,t,n);return this.polls.push(r),{stop:()=>r.stop(),start:()=>r.start(),destroy:()=>{r.stop(),this.polls=this.polls.filter(e=>e!==r)}}}clear(){this.polls.forEach(e=>e.stop()),this.polls=[]}setupVisibilityListener(){typeof document<`u`&&document.addEventListener(`visibilitychange`,()=>{this.polls.forEach(e=>e.isInBackground(document.hidden))},!1)}},U=new class{requestHandlers=[];responseHandlers=[];errorHandlers=[];onRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}onError(e){return this.errorHandlers.push(e),()=>{this.errorHandlers=this.errorHandlers.filter(t=>t!==e)}}async processRequest(e){let t=e;for(let e of this.requestHandlers)t=await e(t);return t}async processResponse(e){let t=e;for(let e of this.responseHandlers)t=await e(t);return t}async processError(e){for(let t of this.errorHandlers)await t(e)}},xr=class extends Error{code;url;constructor(e,t,n){super(n?`${e} (${n})`:e),this.name=`HttpError`,this.code=t,this.url=n}},Sr=class extends xr{response;constructor(e,t,n){super(e,`ERR_HTTP_RESPONSE`,n),this.name=`HttpResponseError`,this.response=t}},Cr=class extends xr{constructor(e=`Request was cancelled`,t){super(e,`ERR_CANCELLED`,t),this.name=`HttpCancelledError`}},wr=class extends xr{cause;constructor(e,t,n){super(e,`ERR_NETWORK`,t),this.name=`HttpNetworkError`,this.cause=n}};function Tr(e){let t=document.cookie.match(RegExp(`(^|;\\s*)(`+e+`)=([^;]*)`));return t?decodeURIComponent(t[3]):null}function Er(e){let t={};return e.getAllResponseHeaders().split(`\r `).forEach(e=>{let n=e.indexOf(`:`);n>0&&(t[e.slice(0,n).toLowerCase().trim()]=e.slice(n+1).trim())}),t}function Dr(e){return typeof FormData<`u`&&e instanceof FormData}function Or(e){return typeof e==`string`||Dr(e)||typeof Blob<`u`&&e instanceof Blob||typeof ArrayBuffer<`u`&&e instanceof ArrayBuffer||typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)||typeof URLSearchParams<`u`&&e instanceof URLSearchParams}function kr(e,t){if(!t.headers)return;let n=Dr(t.data);Object.entries(t.headers).forEach(([t,r])=>{(t.toLowerCase()!==`content-type`||!n)&&e.setRequestHeader(t,String(r))})}function Ar(e,t){if(!t||Object.keys(t).length===0)return e;let[n]=rr(`get`,e,t);return n}var jr=class{xsrfCookieName;xsrfHeaderName;constructor(e={}){this.xsrfCookieName=e.xsrfCookieName??`XSRF-TOKEN`,this.xsrfHeaderName=e.xsrfHeaderName??`X-XSRF-TOKEN`}async request(e){let t=await U.processRequest(e);try{let e=await this.doRequest(t);return await U.processResponse(e)}catch(e){throw(e instanceof Sr||e instanceof wr||e instanceof Cr)&&await U.processError(e),e}}doRequest(e){return new Promise((t,n)=>{let r=new XMLHttpRequest,i=Ar(e.url,e.params);r.open(e.method.toUpperCase(),i,!0);let a=Tr(this.xsrfCookieName);a&&r.setRequestHeader(this.xsrfHeaderName,a),Object.keys(e.headers??{}).some(e=>e.toLowerCase()===`x-requested-with`)||r.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`);let o=null;e.data!==null&&e.data!==void 0&&(Or(e.data)?o=e.data:typeof e.data==`object`?(o=JSON.stringify(e.data),!e.headers?.[`Content-Type`]&&!e.headers?.[`content-type`]&&r.setRequestHeader(`Content-Type`,`application/json`)):o=String(e.data)),kr(r,e),e.onUploadProgress&&(r.upload.onprogress=t=>{let n=t.lengthComputable?t.loaded/t.total:void 0;e.onUploadProgress({progress:n,percentage:n?Math.round(n*100):0,loaded:t.loaded,total:t.lengthComputable?t.total:void 0})}),e.signal&&e.signal.addEventListener(`abort`,()=>r.abort()),r.onabort=()=>n(new Cr(`Request was cancelled`,e.url)),r.onerror=()=>n(new wr(`Network error`,e.url)),r.onload=()=>{let i={status:r.status,data:r.responseText,headers:Er(r)};r.status>=400?n(new Sr(`Request failed with status ${r.status}`,i,e.url)):t(i)},r.send(o)})}},Mr=new jr;function Nr(e){return!(`request`in e)}var Pr={getClient(){return Mr},setClient(e){if(!Nr(e)){Mr=e;return}Mr=new jr(e),e.xsrfCookieName&&M.withXsrfCookieName(e.xsrfCookieName),e.xsrfHeaderName&&M.withXsrfHeaderName(e.xsrfHeaderName)},onRequest:U.onRequest.bind(U),onResponse:U.onResponse.bind(U),onError:U.onError.bind(U),processRequest:U.processRequest.bind(U),processResponse:U.processResponse.bind(U),processError:U.processError.bind(U)},Fr=new class{requestHandlers=[];responseHandlers=[];onVisitRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onVisitResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}async processRequest(e,t){let n=t;for(let t of this.requestHandlers)n=await t(e,n);return n}async processResponse(e,t){let n=t;for(let t of this.responseHandlers)n=await t(e,n);return n}};function Ir(){typeof window<`u`&&(window.__inertia_interceptors__=Fr)}var Lr=class e{callbacks=[];params;constructor(e){if(!e.prefetch)this.params=e;else{let t={onBefore:this.wrapCallback(e,`onBefore`),onBeforeUpdate:this.wrapCallback(e,`onBeforeUpdate`),onStart:this.wrapCallback(e,`onStart`),onProgress:this.wrapCallback(e,`onProgress`),onFinish:this.wrapCallback(e,`onFinish`),onCancel:this.wrapCallback(e,`onCancel`),onSuccess:this.wrapCallback(e,`onSuccess`),onError:this.wrapCallback(e,`onError`),onHttpException:this.wrapCallback(e,`onHttpException`),onNetworkError:this.wrapCallback(e,`onNetworkError`),onFlash:this.wrapCallback(e,`onFlash`),onCancelToken:this.wrapCallback(e,`onCancelToken`),onPrefetched:this.wrapCallback(e,`onPrefetched`),onPrefetching:this.wrapCallback(e,`onPrefetching`)};this.params={...e,...t,onPrefetchResponse:e.onPrefetchResponse||(()=>{}),onPrefetchError:e.onPrefetchError||(()=>{})}}}static create(t){return new e(t)}data(){return this.params.method===`get`?null:this.params.data}queryParams(){return this.params.method===`get`?this.params.data:{}}isPartial(){return this.params.only.length>0||this.params.except.length>0||this.params.reset.length>0}isPrefetch(){return this.params.prefetch===!0}isDeferredPropsRequest(){return this.params.deferredProps===!0}isPollRequest(){return this.params.poll===!0}onCancelToken(e){this.params.onCancelToken({cancel:e})}markAsFinished(){this.params.completed=!0,this.params.cancelled=!1,this.params.interrupted=!1}markAsCancelled({cancelled:e=!0,interrupted:t=!1}){this.params.onCancel(),this.params.completed=!1,this.params.cancelled=e,this.params.interrupted=t}wasCancelledAtAll(){return this.params.cancelled||this.params.interrupted}onFinish(){this.params.onFinish(this.params)}onStart(){this.params.onStart(this.params)}onPrefetching(){this.params.onPrefetching(this.params)}onPrefetchResponse(e){this.params.onPrefetchResponse&&this.params.onPrefetchResponse(e)}onPrefetchError(e){this.params.onPrefetchError&&this.params.onPrefetchError(e)}all(){return this.params}headers(){let e={...this.params.headers};this.isPartial()&&(e[`X-Inertia-Partial-Component`]=B.get().component);let t=this.params.only.concat(this.params.reset);return t.length>0&&(e[`X-Inertia-Partial-Data`]=t.join(`,`)),this.params.except.length>0&&(e[`X-Inertia-Partial-Except`]=this.params.except.join(`,`)),this.params.reset.length>0&&(e[`X-Inertia-Reset`]=this.params.reset.join(`,`)),this.params.errorBag&&this.params.errorBag.length>0&&(e[`X-Inertia-Error-Bag`]=this.params.errorBag),e}setPreserveOptions(t){this.params.preserveScroll=e.resolvePreserveOption(this.params.preserveScroll,t),this.params.preserveState=e.resolvePreserveOption(this.params.preserveState,t)}runCallbacks(){this.callbacks.forEach(({name:e,args:t})=>{this.params[e](...t)})}merge(e){this.params={...this.params,...e}}wrapCallback(e,t){return(...n)=>{this.recordCallback(t,n),e[t](...n)}}recordCallback(e,t){this.callbacks.push({name:e,args:t})}static resolvePreserveOption(e,t){return typeof e==`function`?e(t):e===`errors`?Object.keys(t.props.errors||{}).length>0:e}},Rr={createIframeAndPage(e){typeof e==`object`&&(e=`All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.
${JSON.stringify(e)}`);let t=document.createElement(`html`);t.innerHTML=e,t.querySelectorAll(`a`).forEach(e=>e.setAttribute(`target`,`_top`));let n=document.createElement(`iframe`);return n.style.backgroundColor=`white`,n.style.borderRadius=`5px`,n.style.width=`100%`,n.style.height=`100%`,n.setAttribute(`sandbox`,`allow-scripts`),{iframe:n,page:t}},show(e){let{iframe:t,page:n}=this.createIframeAndPage(e);t.style.boxSizing=`border-box`,t.style.display=`block`;let r=document.createElement(`dialog`);r.id=`inertia-error-dialog`,Object.assign(r.style,{width:`calc(100vw - 100px)`,height:`calc(100vh - 100px)`,padding:`0`,margin:`auto`,border:`none`,backgroundColor:`transparent`});let i=document.createElement(`style`);i.textContent=` dialog#inertia-error-dialog::backdrop { @@ -87,4 +87,4 @@ import{B as e,Ht as t,ct as n,fn as r,ft as i,g as a,gn as o,gt as s,it as c,k a 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } - `,document.head.appendChild(t)},J={configure:Fi,isStarted:Li,done:zi,set:Ii,remove:Ui,start:Ri,status:Ni,show:()=>{if(Pi=!1,K?.isConnected){if(Mi)try{K.showPopover()}catch{}else K.style.display=``}},hide:()=>{if(Pi=!0,K?.isConnected){if(Mi)try{K.hidePopover()}catch{}else K.style.display=`none`}}},Y=new class{hideCount=0;start(){J.start()}reveal(e=!1){this.hideCount=Math.max(0,this.hideCount-1),(e||this.hideCount===0)&&J.show()}hide(){this.hideCount++,J.hide()}set(e){J.set(Math.max(0,Math.min(1,e)))}finish(){J.done()}reset(){J.set(0)}remove(){J.done(),J.remove()}isStarted(){return J.isStarted()}getStatus(){return J.status}};function Yi(e){document.addEventListener(`inertia:start`,t=>Xi(t,e)),document.addEventListener(`inertia:progress`,Zi)}function Xi(e,t){e.detail.visit.showProgress||Y.hide();let n=setTimeout(()=>Y.start(),t);document.addEventListener(`inertia:finish`,e=>Qi(e,n),{once:!0})}function Zi(e){Y.isStarted()&&e.detail.progress?.percentage&&Y.set(Math.max(Y.getStatus(),e.detail.progress.percentage/100*.9))}function Qi(e,t){clearTimeout(t),Y.isStarted()&&(e.detail.visit.completed?Y.finish():e.detail.visit.interrupted?Y.reset():e.detail.visit.cancelled&&Y.remove())}function $i({delay:e=250,color:t=`#29d`,includeCSS:n=!0,showSpinner:r=!1,popover:i=null}={}){Yi(e),J.configure({showSpinner:r,includeCSS:n,color:t,popover:i})}var ea=Symbol(`FormComponentReset`);function ta(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function na(e,t){let n=e.value,r=e.checked;switch(e.type.toLowerCase()){case`checkbox`:e.checked=t.includes(e.value);break;case`radio`:e.checked=t[0]===e.value;break;case`file`:e.value=``;break;case`button`:case`submit`:case`reset`:case`image`:break;default:e.value=t[0]!==null&&t[0]!==void 0?String(t[0]):``}return e.value!==n||e.checked!==r}function ra(e,t){let n=e.value,r=Array.from(e.selectedOptions).map(e=>e.value);if(e.multiple){let n=t.map(e=>String(e));Array.from(e.options).forEach(e=>{e.selected=n.includes(e.value)})}else e.value=t[0]===void 0?``:String(t[0]);let i=Array.from(e.selectedOptions).map(e=>e.value);return e.multiple?JSON.stringify(r.sort())!==JSON.stringify(i.sort()):e.value!==n}function ia(e,t){if(e.disabled){if(e instanceof HTMLInputElement){let t=e.value,n=e.checked;switch(e.type.toLowerCase()){case`checkbox`:case`radio`:return e.checked=e.defaultChecked,e.checked!==n;case`file`:return e.value=``,t!==``;case`button`:case`submit`:case`reset`:case`image`:return!1;default:return e.value=e.defaultValue,e.value!==t}}else if(e instanceof HTMLSelectElement){let t=Array.from(e.selectedOptions).map(e=>e.value);Array.from(e.options).forEach(e=>{e.selected=e.defaultSelected});let n=Array.from(e.selectedOptions).map(e=>e.value);return JSON.stringify(t.sort())!==JSON.stringify(n.sort())}else if(e instanceof HTMLTextAreaElement){let t=e.value;return e.value=e.defaultValue,e.value!==t}return!1}if(e instanceof HTMLInputElement)return na(e,t);if(e instanceof HTMLSelectElement)return ra(e,t);if(e instanceof HTMLTextAreaElement){let n=e.value;return e.value=t[0]===void 0?``:String(t[0]),e.value!==n}return!1}function aa(e,t){let n=!1;return e instanceof RadioNodeList||e instanceof HTMLCollection?Array.from(e).forEach((e,r)=>{e instanceof Element&&ta(e)&&(e instanceof HTMLInputElement&&[`checkbox`,`radio`].includes(e.type.toLowerCase())?ia(e,t)&&(n=!0):ia(e,t[r]===void 0?[t[0]??null].filter(Boolean):[t[r]])&&(n=!0))}):ta(e)&&(n=ia(e,t)),n}function oa(e,t,n){if(!e)return;let r=!n||n.length===0;if(r){let r=new FormData(e),i=Array.from(e.elements).map(e=>ta(e)?e.name:``).filter(Boolean);n=[...new Set([...t.keys(),...r.keys(),...i])]}let i=!1;n.forEach(n=>{let r=e.elements.namedItem(n);r&&aa(r,t.getAll(n))&&(i=!0)}),i&&r&&e.dispatchEvent(new CustomEvent(`reset`,{bubbles:!0,cancelable:!0,detail:{[ea]:!0}}))}function sa(e,t,n){return`