@baseline-ui/core 2.1.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.css +10 -0
- package/dist/Accordion.mjs +1 -0
- package/dist/ActionButton.css +10 -0
- package/dist/ActionButton.mjs +1 -0
- package/dist/ActionGroup.css +10 -0
- package/dist/ActionGroup.mjs +1 -0
- package/dist/ActionIconButton.css +10 -0
- package/dist/ActionIconButton.mjs +1 -0
- package/dist/Actionable.css +10 -0
- package/dist/Actionable.mjs +1 -0
- package/dist/AlertDialog.css +10 -0
- package/dist/AlertDialog.mjs +1 -0
- package/dist/AudioPlayer.css +10 -0
- package/dist/AudioPlayer.mjs +1 -0
- package/dist/Avatar.css +10 -0
- package/dist/Avatar.mjs +1 -0
- package/dist/Box.mjs +1 -0
- package/dist/ButtonSelect.css +10 -0
- package/dist/ButtonSelect.mjs +1 -0
- package/dist/Calendar.css +10 -0
- package/dist/Calendar.mjs +1 -0
- package/dist/Checkbox.css +10 -0
- package/dist/Checkbox.mjs +1 -0
- package/dist/Code.css +10 -0
- package/dist/Code.mjs +1 -0
- package/dist/ColorInput.css +10 -0
- package/dist/ColorInput.mjs +1 -0
- package/dist/ColorSwatch.css +10 -0
- package/dist/ColorSwatch.mjs +1 -0
- package/dist/ColorSwatchPicker.css +10 -0
- package/dist/ColorSwatchPicker.mjs +1 -0
- package/dist/ComboBox.css +10 -0
- package/dist/ComboBox.mjs +1 -0
- package/dist/DateField.css +10 -0
- package/dist/DateField.mjs +1 -0
- package/dist/DateFormat.mjs +1 -0
- package/dist/DeviceProvider.mjs +1 -0
- package/dist/Dialog.css +10 -0
- package/dist/Dialog.mjs +1 -0
- package/dist/Disclosure.css +10 -0
- package/dist/Disclosure.mjs +1 -0
- package/dist/DomNodeRenderer.mjs +1 -0
- package/dist/Drawer.css +10 -0
- package/dist/Drawer.mjs +1 -0
- package/dist/Editor.css +10 -0
- package/dist/Editor.mjs +1 -0
- package/dist/FileInput.css +10 -0
- package/dist/FileInput.mjs +1 -0
- package/dist/FileList.css +10 -0
- package/dist/FileList.mjs +1 -0
- package/dist/FileUploader.css +10 -0
- package/dist/FileUploader.mjs +1 -0
- package/dist/FrameProvider.mjs +1 -0
- package/dist/FreehandCanvas.css +10 -0
- package/dist/FreehandCanvas.mjs +1 -0
- package/dist/GridList.css +10 -0
- package/dist/GridList.mjs +1 -0
- package/dist/Group.mjs +1 -0
- package/dist/I18nProvider.mjs +1 -0
- package/dist/Icon.mjs +1 -0
- package/dist/ImageDropZone.css +10 -0
- package/dist/ImageDropZone.mjs +1 -0
- package/dist/ImageGallery.css +10 -0
- package/dist/ImageGallery.mjs +1 -0
- package/dist/InlineAlert.css +10 -0
- package/dist/InlineAlert.mjs +1 -0
- package/dist/InlineToolbar.css +10 -0
- package/dist/InlineToolbar.mjs +10 -0
- package/dist/Kbd.css +10 -0
- package/dist/Kbd.mjs +1 -0
- package/dist/Link.css +10 -0
- package/dist/Link.mjs +1 -0
- package/dist/ListBox.css +10 -0
- package/dist/ListBox.mjs +1 -0
- package/dist/Markdown.css +10 -0
- package/dist/Markdown.mjs +1 -0
- package/dist/Menu.css +10 -0
- package/dist/Menu.mjs +1 -0
- package/dist/MessageFormat.mjs +1 -0
- package/dist/Modal.css +10 -0
- package/dist/Modal.mjs +1 -0
- package/dist/NumberFormat.mjs +1 -0
- package/dist/NumberInput.css +10 -0
- package/dist/NumberInput.mjs +1 -0
- package/dist/Pagination.css +10 -0
- package/dist/Pagination.mjs +1 -0
- package/dist/Panel.css +10 -0
- package/dist/Panel.mjs +1 -0
- package/dist/PointPicker.css +10 -0
- package/dist/PointPicker.mjs +1 -0
- package/dist/Popover.css +10 -0
- package/dist/Popover.mjs +1 -0
- package/dist/Portal.css +10 -0
- package/dist/Portal.mjs +1 -0
- package/dist/PortalContainerProvider.mjs +1 -0
- package/dist/Preview.css +10 -0
- package/dist/Preview.mjs +1 -0
- package/dist/ProgressBar.css +10 -0
- package/dist/ProgressBar.mjs +1 -0
- package/dist/ProgressSpinner.css +10 -0
- package/dist/ProgressSpinner.mjs +1 -0
- package/dist/RadioGroup.css +10 -0
- package/dist/RadioGroup.mjs +1 -0
- package/dist/Reaction.css +10 -0
- package/dist/Reaction.mjs +1 -0
- package/dist/ScrollControlButton.css +10 -0
- package/dist/ScrollControlButton.mjs +1 -0
- package/dist/SearchInput.css +10 -0
- package/dist/SearchInput.mjs +1 -0
- package/dist/Select.css +10 -0
- package/dist/Select.mjs +1 -0
- package/dist/Separator.css +10 -0
- package/dist/Separator.mjs +1 -0
- package/dist/Skeleton.css +10 -0
- package/dist/Skeleton.mjs +1 -0
- package/dist/Slider.css +10 -0
- package/dist/Slider.mjs +1 -0
- package/dist/StatusCard.css +10 -0
- package/dist/StatusCard.mjs +1 -0
- package/dist/Stepper.css +10 -0
- package/dist/Stepper.mjs +1 -0
- package/dist/Switch.css +10 -0
- package/dist/Switch.mjs +1 -0
- package/dist/Table.css +10 -0
- package/dist/Table.mjs +1 -0
- package/dist/Tabs.css +10 -0
- package/dist/Tabs.mjs +1 -0
- package/dist/Tag.css +10 -0
- package/dist/Tag.mjs +1 -0
- package/dist/TagGroup.css +10 -0
- package/dist/TagGroup.mjs +1 -0
- package/dist/TaggedPagination.css +10 -0
- package/dist/TaggedPagination.mjs +1 -0
- package/dist/Text.css +10 -0
- package/dist/Text.mjs +1 -0
- package/dist/TextInput.css +10 -0
- package/dist/TextInput.mjs +1 -0
- package/dist/ThemeProvider.css +10 -0
- package/dist/ThemeProvider.mjs +1 -0
- package/dist/TimeField.css +10 -0
- package/dist/TimeField.mjs +1 -0
- package/dist/Toast.css +10 -0
- package/dist/Toast.mjs +1 -0
- package/dist/ToggleButton.css +10 -0
- package/dist/ToggleButton.mjs +1 -0
- package/dist/ToggleIconButton.css +10 -0
- package/dist/ToggleIconButton.mjs +1 -0
- package/dist/Toolbar.css +10 -0
- package/dist/Toolbar.mjs +1 -0
- package/dist/Tooltip.css +10 -0
- package/dist/Tooltip.mjs +1 -0
- package/dist/TreeView.css +10 -0
- package/dist/TreeView.mjs +1 -0
- package/dist/UNSAFE_ListBox.css +10 -0
- package/dist/UNSAFE_ListBox.mjs +1 -0
- package/dist/Virtualizer.mjs +1 -0
- package/dist/chunk-22BJMDCA.mjs +10 -0
- package/dist/chunk-246VHB32.mjs +10 -0
- package/dist/chunk-2CZ3OV4X.mjs +10 -0
- package/dist/chunk-2JANDORZ.mjs +11 -0
- package/dist/chunk-2MS356Q7.mjs +10 -0
- package/dist/chunk-2PH5GN2S.mjs +0 -0
- package/dist/chunk-2RCST7ET.mjs +10 -0
- package/dist/chunk-2UUKKXBD.mjs +10 -0
- package/dist/chunk-2VY4FAOY.mjs +10 -0
- package/dist/chunk-2WAKHFPS.mjs +10 -0
- package/dist/chunk-34TYNTXM.mjs +10 -0
- package/dist/chunk-3CWP2VCB.mjs +10 -0
- package/dist/chunk-3FYY26ED.mjs +10 -0
- package/dist/chunk-3HKG74G4.mjs +0 -0
- package/dist/chunk-3UH5CQQF.mjs +10 -0
- package/dist/chunk-3W6RWDIE.mjs +10 -0
- package/dist/chunk-44OUOGJ4.mjs +10 -0
- package/dist/chunk-4N6CLPAY.mjs +10 -0
- package/dist/chunk-4NYPVKDO.mjs +10 -0
- package/dist/chunk-4PYEGHW5.mjs +10 -0
- package/dist/chunk-4QEH5CGK.mjs +10 -0
- package/dist/chunk-4SW77SGW.mjs +10 -0
- package/dist/chunk-4WW2MVQN.mjs +0 -0
- package/dist/chunk-4ZJMZB5B.mjs +10 -0
- package/dist/chunk-545KDVGI.mjs +10 -0
- package/dist/chunk-54IAJ3RI.mjs +0 -0
- package/dist/chunk-566SP7NE.mjs +10 -0
- package/dist/chunk-5ANNWMLJ.mjs +0 -0
- package/dist/chunk-5BAHJXOI.mjs +10 -0
- package/dist/chunk-5HXTXIE5.mjs +10 -0
- package/dist/chunk-5IC46G5J.mjs +10 -0
- package/dist/chunk-5KD2MNNX.mjs +10 -0
- package/dist/chunk-5ODZPQL2.mjs +10 -0
- package/dist/chunk-5PQHOVGX.mjs +0 -0
- package/dist/chunk-5ULL6IBX.mjs +10 -0
- package/dist/chunk-5YHNHEDK.mjs +0 -0
- package/dist/chunk-63KRQW56.mjs +10 -0
- package/dist/chunk-66CUIXA6.mjs +10 -0
- package/dist/chunk-66NJ7EYY.mjs +10 -0
- package/dist/chunk-6F66XVOA.mjs +0 -0
- package/dist/chunk-6IRWW75G.mjs +10 -0
- package/dist/chunk-6IX6BM7C.mjs +0 -0
- package/dist/chunk-6XARU7F2.mjs +0 -0
- package/dist/chunk-6YQHZ5RZ.mjs +0 -0
- package/dist/chunk-6Z6HOW6T.mjs +10 -0
- package/dist/chunk-6ZFBX7C7.mjs +10 -0
- package/dist/chunk-6ZQE5SHE.mjs +10 -0
- package/dist/chunk-6ZV4UYEG.mjs +10 -0
- package/dist/chunk-77BAFSDX.mjs +10 -0
- package/dist/chunk-7AQAC6QK.mjs +10 -0
- package/dist/chunk-7AY6C5M5.mjs +10 -0
- package/dist/chunk-7PRJIPFA.mjs +10 -0
- package/dist/chunk-7ZYMMUDM.mjs +10 -0
- package/dist/chunk-A24DWFQ2.mjs +10 -0
- package/dist/chunk-A6ZQQSAX.mjs +10 -0
- package/dist/chunk-AC7OXVHA.mjs +10 -0
- package/dist/chunk-AGUSZG6K.mjs +0 -0
- package/dist/chunk-AGYQLGBZ.mjs +10 -0
- package/dist/chunk-AKES5B6C.mjs +10 -0
- package/dist/chunk-AMQX3KZR.mjs +10 -0
- package/dist/chunk-AMW7LGCF.mjs +10 -0
- package/dist/chunk-AMYRLAIC.mjs +10 -0
- package/dist/chunk-AQYBKDT2.mjs +16 -0
- package/dist/chunk-AUOQSTS5.mjs +10 -0
- package/dist/chunk-AV4ZP5SY.mjs +10 -0
- package/dist/chunk-AZRPXTYJ.mjs +10 -0
- package/dist/chunk-B7PSE5KC.mjs +10 -0
- package/dist/chunk-BED7T5CL.mjs +10 -0
- package/dist/chunk-BGMVPFYK.mjs +10 -0
- package/dist/chunk-BJVFZYUV.mjs +10 -0
- package/dist/chunk-BKDQLDOK.mjs +10 -0
- package/dist/chunk-BLHN7I5Z.mjs +0 -0
- package/dist/chunk-BTVDMO5C.mjs +10 -0
- package/dist/chunk-BU5H25MV.mjs +10 -0
- package/dist/chunk-C342HL26.mjs +0 -0
- package/dist/chunk-C5P23FUW.mjs +10 -0
- package/dist/chunk-C6OMLVIQ.mjs +0 -0
- package/dist/chunk-CAWUDHAE.mjs +10 -0
- package/dist/chunk-CFDKFUTO.mjs +10 -0
- package/dist/chunk-CFLEBB5T.mjs +10 -0
- package/dist/chunk-CFRTAJP2.mjs +0 -0
- package/dist/chunk-CGFLGZL4.mjs +10 -0
- package/dist/chunk-CHTLOFCT.mjs +10 -0
- package/dist/chunk-CPSUI4IW.mjs +10 -0
- package/dist/chunk-CSPZMYVG.mjs +10 -0
- package/dist/chunk-CV6JQGJ3.mjs +10 -0
- package/dist/chunk-CWPFUB7B.mjs +10 -0
- package/dist/chunk-D3IZ4HBL.mjs +10 -0
- package/dist/chunk-D5EEZT5J.mjs +10 -0
- package/dist/chunk-DD5FWULD.mjs +10 -0
- package/dist/chunk-DECHIERQ.mjs +10 -0
- package/dist/chunk-DIHILOKU.mjs +10 -0
- package/dist/chunk-DOL6RDMF.mjs +10 -0
- package/dist/chunk-DRYSJSKA.mjs +10 -0
- package/dist/chunk-DY6WY36N.mjs +0 -0
- package/dist/chunk-E3PFPOHX.mjs +0 -0
- package/dist/chunk-E6VOSF6Z.mjs +10 -0
- package/dist/chunk-EA6GA4WC.mjs +10 -0
- package/dist/chunk-EK3RIYMV.mjs +10 -0
- package/dist/chunk-ELXWR5TS.mjs +10 -0
- package/dist/chunk-EMCEJKBJ.mjs +10 -0
- package/dist/chunk-ENDOKA57.mjs +10 -0
- package/dist/chunk-EU75HMPG.mjs +10 -0
- package/dist/chunk-EX2LI2CV.mjs +10 -0
- package/dist/chunk-EZXMEGV7.mjs +0 -0
- package/dist/chunk-F2HESRBD.mjs +10 -0
- package/dist/chunk-F2X474RV.mjs +10 -0
- package/dist/chunk-F7PGMOQF.mjs +10 -0
- package/dist/chunk-FJ2JRD3H.mjs +10 -0
- package/dist/chunk-FKYHERP4.mjs +0 -0
- package/dist/chunk-FP5EWPOF.mjs +10 -0
- package/dist/chunk-FRZTJBLY.mjs +10 -0
- package/dist/chunk-FTYXFTJV.mjs +10 -0
- package/dist/chunk-FXCHST4Z.mjs +10 -0
- package/dist/chunk-GCZFXILF.mjs +10 -0
- package/dist/chunk-GEZGEZAP.mjs +10 -0
- package/dist/chunk-GFLVN5JQ.mjs +10 -0
- package/dist/chunk-GKODQS6E.mjs +10 -0
- package/dist/chunk-GOSLHCDP.mjs +0 -0
- package/dist/chunk-GXOXYPQQ.mjs +10 -0
- package/dist/chunk-H44PBNVX.mjs +10 -0
- package/dist/chunk-H7OUUCSA.mjs +10 -0
- package/dist/chunk-HBBRMEES.mjs +10 -0
- package/dist/chunk-HHI7CEUP.mjs +10 -0
- package/dist/chunk-HI44JQA7.mjs +10 -0
- package/dist/chunk-HLDCVJXD.mjs +10 -0
- package/dist/chunk-HONWMHMX.mjs +10 -0
- package/dist/chunk-HT55YHTN.mjs +10 -0
- package/dist/chunk-HWOMGFBL.mjs +10 -0
- package/dist/chunk-HXTAOYOD.mjs +10 -0
- package/dist/chunk-I3RGYL4B.mjs +10 -0
- package/dist/chunk-I3YGB2BE.mjs +10 -0
- package/dist/chunk-IB23KCIW.mjs +10 -0
- package/dist/chunk-IHLJTHGQ.mjs +10 -0
- package/dist/chunk-ILBAZFBL.mjs +0 -0
- package/dist/chunk-INDVRI57.mjs +10 -0
- package/dist/chunk-IUQOFRI3.mjs +10 -0
- package/dist/chunk-IVVZSESM.mjs +10 -0
- package/dist/chunk-IW4GXU75.mjs +10 -0
- package/dist/chunk-IYFTU6IC.mjs +10 -0
- package/dist/chunk-J3MJZQUJ.mjs +10 -0
- package/dist/chunk-J4NO4WYU.mjs +0 -0
- package/dist/chunk-J5YWAPLN.mjs +10 -0
- package/dist/chunk-J7EAQSKX.mjs +10 -0
- package/dist/chunk-J7K7I5U2.mjs +10 -0
- package/dist/chunk-JBXZ6ZHP.mjs +10 -0
- package/dist/chunk-JDLUGVXG.mjs +10 -0
- package/dist/chunk-JI4SJ53O.mjs +11 -0
- package/dist/chunk-JJG67M2S.mjs +10 -0
- package/dist/chunk-JJPCZOOI.mjs +10 -0
- package/dist/chunk-JQ4ZGZPV.mjs +15 -0
- package/dist/chunk-JUXBZ2ZN.mjs +10 -0
- package/dist/chunk-K6IQ4ALU.mjs +0 -0
- package/dist/chunk-K6X2BHPP.mjs +10 -0
- package/dist/chunk-KCHAWPUN.mjs +10 -0
- package/dist/chunk-KEVERVHK.mjs +10 -0
- package/dist/chunk-KG5PDPBK.mjs +10 -0
- package/dist/chunk-KKJ6XIU3.mjs +10 -0
- package/dist/chunk-KPEONVLU.mjs +10 -0
- package/dist/chunk-KUEDQO7P.mjs +10 -0
- package/dist/chunk-KY3JKXSX.mjs +10 -0
- package/dist/chunk-LQMEFFFM.mjs +10 -0
- package/dist/chunk-LZFTBNPW.mjs +10 -0
- package/dist/chunk-M5M3EPG5.mjs +10 -0
- package/dist/chunk-MEYMETYC.mjs +11 -0
- package/dist/chunk-MEZNZ5W6.mjs +10 -0
- package/dist/chunk-MFH2E2GU.mjs +10 -0
- package/dist/chunk-MI7DCFP2.mjs +10 -0
- package/dist/chunk-MIHIAPBG.mjs +10 -0
- package/dist/chunk-MLNPTVVX.mjs +10 -0
- package/dist/chunk-MRJFGHFW.mjs +10 -0
- package/dist/chunk-MUNFBB7D.mjs +0 -0
- package/dist/chunk-MVK5CB64.mjs +10 -0
- package/dist/chunk-MXKP7NQ4.mjs +10 -0
- package/dist/chunk-MZ4O6LWG.mjs +0 -0
- package/dist/chunk-N2XGJKZG.mjs +10 -0
- package/dist/chunk-N5RZGO7Y.mjs +10 -0
- package/dist/chunk-N7MTFSWR.mjs +10 -0
- package/dist/chunk-NA3IF43N.mjs +10 -0
- package/dist/chunk-NGZRN4SF.mjs +10 -0
- package/dist/chunk-NHM3H5JU.mjs +0 -0
- package/dist/chunk-NO55UIGK.mjs +0 -0
- package/dist/chunk-NRKHWSOP.mjs +0 -0
- package/dist/chunk-NSC53QWT.mjs +10 -0
- package/dist/chunk-NV7KQVPE.mjs +10 -0
- package/dist/chunk-O4VZ6XEP.mjs +10 -0
- package/dist/chunk-O57ZEY3V.mjs +0 -0
- package/dist/chunk-O66FNQSB.mjs +10 -0
- package/dist/chunk-O7XK2WIX.mjs +10 -0
- package/dist/chunk-OAY74XPB.mjs +10 -0
- package/dist/chunk-OC42IZG2.mjs +10 -0
- package/dist/chunk-OLJWK3LS.mjs +10 -0
- package/dist/chunk-OMT6ZWSV.mjs +11 -0
- package/dist/chunk-OO7BXL2N.mjs +10 -0
- package/dist/chunk-P44XZ4PV.mjs +10 -0
- package/dist/chunk-P5GO3XIS.mjs +10 -0
- package/dist/chunk-PAQQ7MQG.mjs +10 -0
- package/dist/chunk-PBFIKNYZ.mjs +10 -0
- package/dist/chunk-PBO4SFGS.mjs +10 -0
- package/dist/chunk-PF3OQKXP.mjs +10 -0
- package/dist/chunk-PHZZLBH3.mjs +10 -0
- package/dist/chunk-PZTVDABF.mjs +0 -0
- package/dist/chunk-Q5UMLFN3.mjs +10 -0
- package/dist/chunk-QAUEG3EX.mjs +0 -0
- package/dist/chunk-QBJDGBTU.mjs +0 -0
- package/dist/chunk-QMDDCVAF.mjs +10 -0
- package/dist/chunk-QNBBJ5HC.mjs +11 -0
- package/dist/chunk-R32OJDN2.mjs +10 -0
- package/dist/chunk-RC7QITNV.mjs +10 -0
- package/dist/chunk-RCBUNCHV.mjs +10 -0
- package/dist/chunk-RFTDIXEG.mjs +10 -0
- package/dist/chunk-RJC3HQDZ.mjs +10 -0
- package/dist/chunk-RJWPSJX2.mjs +10 -0
- package/dist/chunk-RMUV6NJJ.mjs +10 -0
- package/dist/chunk-ROHLZINC.mjs +10 -0
- package/dist/chunk-RSKKEGJZ.mjs +10 -0
- package/dist/chunk-RT4LMB6X.mjs +10 -0
- package/dist/chunk-RXSYDMT6.mjs +10 -0
- package/dist/chunk-S3V4OOC3.mjs +10 -0
- package/dist/chunk-SAZLJ66W.mjs +10 -0
- package/dist/chunk-SMAYNDQQ.mjs +10 -0
- package/dist/chunk-TAROK7TO.mjs +10 -0
- package/dist/chunk-TAYP2OGC.mjs +10 -0
- package/dist/chunk-TBSQUJ67.mjs +10 -0
- package/dist/chunk-TDXALNX3.mjs +10 -0
- package/dist/chunk-TEQE6WCH.mjs +10 -0
- package/dist/chunk-THRAJMLX.mjs +10 -0
- package/dist/chunk-TI5RR7KX.mjs +10 -0
- package/dist/chunk-TIHKHXTS.mjs +10 -0
- package/dist/chunk-TJEK54BW.mjs +10 -0
- package/dist/chunk-TK4QXU3W.mjs +10 -0
- package/dist/chunk-TKQOQVZD.mjs +10 -0
- package/dist/chunk-TO2TQ2LE.mjs +10 -0
- package/dist/chunk-TO6OQF2Y.mjs +10 -0
- package/dist/chunk-TZ4MVY4E.mjs +10 -0
- package/dist/chunk-U2ODAIZG.mjs +10 -0
- package/dist/chunk-U4K44ZHN.mjs +10 -0
- package/dist/chunk-UCNHDT36.mjs +10 -0
- package/dist/chunk-UCZZLAPB.mjs +10 -0
- package/dist/chunk-UQJGSVXP.mjs +10 -0
- package/dist/chunk-USMC34OO.mjs +10 -0
- package/dist/chunk-UTQ7AIPM.mjs +0 -0
- package/dist/chunk-UUBOEBYZ.mjs +10 -0
- package/dist/chunk-V3L4SVVF.mjs +10 -0
- package/dist/chunk-VCIX4HG7.mjs +0 -0
- package/dist/chunk-VDUFLHKK.mjs +10 -0
- package/dist/chunk-VG7J427T.mjs +10 -0
- package/dist/chunk-VHDXSFQC.mjs +10 -0
- package/dist/chunk-VLQ4S7XC.mjs +10 -0
- package/dist/chunk-VTX6R6KM.mjs +10 -0
- package/dist/chunk-VXB5SVQC.mjs +10 -0
- package/dist/chunk-W6QO7FPZ.mjs +10 -0
- package/dist/chunk-WAFYFWH4.mjs +0 -0
- package/dist/chunk-WAOWR7MR.mjs +10 -0
- package/dist/chunk-WL27JGVG.mjs +10 -0
- package/dist/chunk-WOVAT6U4.mjs +10 -0
- package/dist/chunk-WSCZ34XO.mjs +10 -0
- package/dist/chunk-WSQGB4ZE.mjs +0 -0
- package/dist/chunk-WWSGOGLA.mjs +10 -0
- package/dist/chunk-X3AXUU3H.mjs +10 -0
- package/dist/chunk-X3OCHEQM.mjs +12 -0
- package/dist/chunk-X7DI4I2U.mjs +10 -0
- package/dist/chunk-XB657BXX.mjs +10 -0
- package/dist/chunk-XBBPWSJI.mjs +0 -0
- package/dist/chunk-XJGQXVMR.mjs +10 -0
- package/dist/chunk-XPISSX5R.mjs +10 -0
- package/dist/chunk-XTH6B5FE.mjs +10 -0
- package/dist/chunk-XVBOKL6D.mjs +10 -0
- package/dist/chunk-XWLESSHN.mjs +10 -0
- package/dist/chunk-XXANV3FM.mjs +10 -0
- package/dist/chunk-XZ2VSOJD.mjs +29 -0
- package/dist/chunk-Y4DRSGEJ.mjs +10 -0
- package/dist/chunk-Y6XQJ4X2.mjs +10 -0
- package/dist/chunk-YB3KW7JC.mjs +10 -0
- package/dist/chunk-YCI6BEXQ.mjs +10 -0
- package/dist/chunk-YGSCHWU3.mjs +10 -0
- package/dist/chunk-YIGT3OP2.mjs +10 -0
- package/dist/chunk-YOBESAXG.mjs +10 -0
- package/dist/chunk-YS3Y5KGV.mjs +10 -0
- package/dist/chunk-YT36W3OS.mjs +10 -0
- package/dist/chunk-YV3WI6OV.mjs +10 -0
- package/dist/chunk-YV5CNDCW.mjs +0 -0
- package/dist/chunk-YVYMYKYN.mjs +10 -0
- package/dist/chunk-ZANUFNOL.mjs +0 -0
- package/dist/chunk-ZGRRD3TU.mjs +10 -0
- package/dist/chunk-ZLAY7NNY.mjs +10 -0
- package/dist/chunk-ZLDT2KDZ.mjs +10 -0
- package/dist/chunk-ZNN43VZV.mjs +10 -0
- package/dist/chunk-ZREX7XOO.mjs +10 -0
- package/dist/chunk-ZRWDMNNY.mjs +10 -0
- package/dist/chunk-ZVODDLGL.mjs +10 -0
- package/dist/hooks/useDevice.mjs +1 -0
- package/dist/hooks/useI18n.mjs +1 -0
- package/dist/hooks/useImage.mjs +1 -0
- package/dist/hooks/useIntersectionObserver.mjs +1 -0
- package/dist/hooks/useIsFirstRender.mjs +1 -0
- package/dist/hooks/useIsTouchDevice.mjs +1 -0
- package/dist/hooks/useLiveInteractionModality.mjs +1 -0
- package/dist/hooks/useLocalStorage.mjs +1 -0
- package/dist/hooks/useMedia.mjs +1 -0
- package/dist/hooks/useMutationObserver.mjs +1 -0
- package/dist/hooks/usePortalContainer.mjs +1 -0
- package/dist/hooks/usePreventFocus.mjs +1 -0
- package/dist/hooks/useResizeObserver.mjs +1 -0
- package/dist/hooks/useTextSelection.mjs +1 -0
- package/dist/hooks/useUndoRedo.mjs +1 -0
- package/dist/index.d.ts +811 -70
- package/dist/index.js +21 -21
- package/dist/index.mjs +1 -43
- package/dist/messageIds.mjs +1 -0
- package/dist/react-aria.d.ts +133 -133
- package/dist/react-aria.mjs +1 -0
- package/dist/react-stately.d.ts +82 -82
- package/dist/react-stately.mjs +1 -0
- package/dist/utils/a11y.mjs +1 -0
- package/dist/utils/classNames.mjs +1 -0
- package/dist/utils/colors.mjs +1 -0
- package/dist/utils/constants.mjs +10 -0
- package/dist/utils/devWarn.mjs +1 -0
- package/dist/utils/dom.mjs +1 -0
- package/dist/utils/invariant.mjs +1 -0
- package/dist/utils/isInIframe.mjs +1 -0
- package/dist/utils/isInShadowDOM.mjs +1 -0
- package/dist/utils/isRect.mjs +1 -0
- package/dist/utils/keyboards.mjs +1 -0
- package/dist/utils/math.mjs +1 -0
- package/dist/utils/objects.mjs +1 -0
- package/dist/utils/onDropOrPaste.mjs +1 -0
- package/dist/utils/overlays.mjs +1 -0
- package/dist/utils/reactAriaCompat.mjs +1 -0
- package/dist/utils/reactAriaComponentsCompat.mjs +1 -0
- package/dist/utils/resolveAriaLabelAttrs.mjs +1 -0
- package/dist/utils/resolvePublicUrl.mjs +10 -0
- package/dist/utils/strings.mjs +1 -0
- package/dist/utils/style.mjs +1 -0
- package/dist/utils/svgs.mjs +1 -0
- package/dist/utils/validations.mjs +1 -0
- package/intl/ar.json +2 -2
- package/intl/cs.json +2 -2
- package/intl/cy.json +4 -4
- package/intl/da.json +3 -3
- package/intl/de.json +3 -3
- package/intl/el.json +2 -2
- package/intl/en-GB.json +2 -2
- package/intl/en.json +2 -2
- package/intl/fi.json +3 -3
- package/intl/fr-CA.json +1 -1
- package/intl/fr.json +2 -2
- package/intl/he.json +3 -3
- package/intl/hr.json +3 -3
- package/intl/id.json +3 -3
- package/intl/ja.json +2 -2
- package/intl/ko.json +1 -1
- package/intl/ms.json +2 -2
- package/intl/nb-NO.json +3 -3
- package/intl/nl.json +4 -4
- package/intl/pt-PT.json +1 -1
- package/intl/pt.json +3 -3
- package/intl/ru.json +2 -2
- package/intl/sk.json +2 -2
- package/intl/sl.json +4 -4
- package/intl/sv.json +3 -3
- package/intl/th.json +1 -1
- package/intl/tr.json +3 -3
- package/intl/uk.json +1 -1
- package/intl/zh-Hant.json +2 -2
- package/messages.json +2 -2
- package/package.json +8 -5
- package/sbom.json +6 -6
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-XXANV3FM.mjs';import {b as b$2}from'./chunk-F7PGMOQF.mjs';import {a,b,c as c$1}from'./chunk-GFLVN5JQ.mjs';import {b as b$1}from'./chunk-N2XGJKZG.mjs';import {useContext,useMemo,useEffect}from'react';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var w=class{messages;defaultLocale;constructor(t,n="en-US"){this.messages=Object.fromEntries(Object.entries(t).filter(([,r])=>r)),this.defaultLocale=n;}getStringForLocale(t,n){let r=this.messages[n];r||(r=Ke(n,this.messages,this.defaultLocale),this.messages[n]=r);let i=r[t];if(!i)throw new Error(`Could not find intl message ${t} in ${n} locale`);return i}};function Ke(e,t,n="en-US"){if(t[e])return t[e];let r=et(e);if(t[r])return t[r];for(let i in t)if(i.startsWith(r+"-"))return t[i];return t[n]}function et(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}var J=function(e,t){return J=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r;}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i]);},J(e,t)};function L(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");J(e,t);function n(){this.constructor=e;}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n);}var m=function(){return m=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);}return t},m.apply(this,arguments)};function Ee(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function X(e,t,n){if(arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function z(e,t){var n=t&&t.cache?t.cache:at,r=t&&t.serializer?t.serializer:ot,i=t&&t.strategy?t.strategy:rt;return i(e,{cache:n,serializer:r})}function tt(e){return e==null||typeof e=="number"||typeof e=="boolean"}function ve(e,t,n,r){var i=tt(r)?r:n(r),o=t.get(i);return typeof o>"u"&&(o=e.call(this,r),t.set(i,o)),o}function _e(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,r),t.set(i,o)),o}function Q(e,t,n,r,i){return n.bind(t,e,r,i)}function rt(e,t){var n=e.length===1?ve:_e;return Q(e,this,n,t.cache.create(),t.serializer)}function nt(e,t){return Q(e,this,_e,t.cache.create(),t.serializer)}var ot=function(){return JSON.stringify(arguments)},st=(function(){function e(){this.cache=Object.create(null);}return e.prototype.get=function(t){return this.cache[t]},e.prototype.set=function(t,n){this.cache[t]=n;},e})(),at={create:function(){return new st}},W={variadic:nt};var c;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG";})(c||(c={}));var x;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag";})(x||(x={}));var B;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime";})(B||(B={}));function q(e){return e.type===x.literal}function K(e){return e.type===x.argument}function I(e){return e.type===x.number}function M(e){return e.type===x.date}function N(e){return e.type===x.time}function O(e){return e.type===x.select}function R(e){return e.type===x.plural}function Te(e){return e.type===x.pound}function C(e){return e.type===x.tag}function $(e){return !!(e&&typeof e=="object"&&e.type===B.number)}function D(e){return !!(e&&typeof e=="object"&&e.type===B.dateTime)}var ee=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;var ut=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Se(e){var t={};return e.replace(ut,function(n){var r=n.length;switch(n[0]){case "G":t.era=r===4?"long":r===5?"narrow":"short";break;case "y":t.year=r===2?"2-digit":"numeric";break;case "Y":case "u":case "U":case "r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case "q":case "Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case "M":case "L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case "w":case "W":throw new RangeError("`w/W` (week) patterns are not supported");case "d":t.day=["numeric","2-digit"][r-1];break;case "D":case "F":case "g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case "E":t.weekday=r===4?"long":r===5?"narrow":"short";break;case "e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case "c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case "a":t.hour12=true;break;case "b":case "B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case "h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case "H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case "K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case "k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case "j":case "J":case "C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case "m":t.minute=["numeric","2-digit"][r-1];break;case "s":t.second=["numeric","2-digit"][r-1];break;case "S":case "A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case "z":t.timeZoneName=r<4?"short":"long";break;case "Z":case "O":case "v":case "V":case "X":case "x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return ""}),t}var He=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function we(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(He).filter(function(f){return f.length>0}),n=[],r=0,i=t;r<i.length;r++){var o=i[r],s=o.split("/");if(s.length===0)throw new Error("Invalid number skeleton");for(var h=s[0],p=s.slice(1),a=0,u=p;a<u.length;a++){var g=u[a];if(g.length===0)throw new Error("Invalid number skeleton")}n.push({stem:h,options:p});}return n}function ht(e){return e.replace(/^(.*?)-/,"")}var Be=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Le=/^(@+)?(\+|#+)?[rs]?$/g,lt=/(\*)(0+)|(#+)(0+)|(0+)/g,Ie=/^(0+)$/;function Pe(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(Le,function(n,r,i){return typeof i!="string"?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):i==="+"?t.minimumSignificantDigits=r.length:r[0]==="#"?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+(typeof i=="string"?i.length:0)),""}),t}function Me(e){switch(e){case "sign-auto":return {signDisplay:"auto"};case "sign-accounting":case "()":return {currencySign:"accounting"};case "sign-always":case "+!":return {signDisplay:"always"};case "sign-accounting-always":case "()!":return {signDisplay:"always",currencySign:"accounting"};case "sign-except-zero":case "+?":return {signDisplay:"exceptZero"};case "sign-accounting-except-zero":case "()?":return {signDisplay:"exceptZero",currencySign:"accounting"};case "sign-never":case "+_":return {signDisplay:"never"}}}function ft(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!Ie.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length;}return t}function Ae(e){var t={},n=Me(e);return n||t}function Ne(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];switch(i.stem){case "percent":case "%":t.style="percent";continue;case "%x100":t.style="percent",t.scale=100;continue;case "currency":t.style="currency",t.currency=i.options[0];continue;case "group-off":case ",_":t.useGrouping=false;continue;case "precision-integer":case ".":t.maximumFractionDigits=0;continue;case "measure-unit":case "unit":t.style="unit",t.unit=ht(i.options[0]);continue;case "compact-short":case "K":t.notation="compact",t.compactDisplay="short";continue;case "compact-long":case "KK":t.notation="compact",t.compactDisplay="long";continue;case "scientific":t=m(m(m({},t),{notation:"scientific"}),i.options.reduce(function(p,a){return m(m({},p),Ae(a))},{}));continue;case "engineering":t=m(m(m({},t),{notation:"engineering"}),i.options.reduce(function(p,a){return m(m({},p),Ae(a))},{}));continue;case "notation-simple":t.notation="standard";continue;case "unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case "unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case "unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case "unit-width-iso-code":t.currencyDisplay="symbol";continue;case "scale":t.scale=parseFloat(i.options[0]);continue;case "rounding-mode-floor":t.roundingMode="floor";continue;case "rounding-mode-ceiling":t.roundingMode="ceil";continue;case "rounding-mode-down":t.roundingMode="trunc";continue;case "rounding-mode-up":t.roundingMode="expand";continue;case "rounding-mode-half-even":t.roundingMode="halfEven";continue;case "rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case "rounding-mode-half-up":t.roundingMode="halfExpand";continue;case "integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(lt,function(p,a,u,g,f,l){if(a)t.minimumIntegerDigits=u.length;else {if(g&&f)throw new Error("We currently do not support maximum integer digits");if(l)throw new Error("We currently do not support exact integer digits")}return ""});continue}if(Ie.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(Be.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(Be,function(p,a,u,g,f,l){return u==="*"?t.minimumFractionDigits=a.length:g&&g[0]==="#"?t.maximumFractionDigits=g.length:f&&l?(t.minimumFractionDigits=f.length,t.maximumFractionDigits=f.length+l.length):(t.minimumFractionDigits=a.length,t.maximumFractionDigits=a.length),""});var o=i.options[0];o==="w"?t=m(m({},t),{trailingZeroDisplay:"stripIfInteger"}):o&&(t=m(m({},t),Pe(o)));continue}if(Le.test(i.stem)){t=m(m({},t),Pe(i.stem));continue}var s=Me(i.stem);s&&(t=m(m({},t),s));var h=ft(i.stem);h&&(t=m(m({},t),h));}return t}var G={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function Oe(e,t){for(var n="",r=0;r<e.length;r++){var i=e.charAt(r);if(i==="j"){for(var o=0;r+1<e.length&&e.charAt(r+1)===i;)o++,r++;var s=1+(o&1),h=o<2?1:3+(o>>1),p="a",a=ct(t);for((a=="H"||a=="k")&&(h=0);h-- >0;)n+=p;for(;s-- >0;)n=a+n;}else i==="J"?n+="H":n+=i;}return n}function ct(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case "h24":return "k";case "h23":return "H";case "h12":return "h";case "h11":return "K";default:throw new Error("Invalid hourCycle")}var n=e.language,r;n!=="root"&&(r=e.maximize().region);var i=G[r||""]||G[n||""]||G["".concat(n,"-001")]||G["001"];return i[0]}var te,pt=new RegExp("^".concat(ee.source,"*")),mt=new RegExp("".concat(ee.source,"*$"));function d(e,t){return {start:e,end:t}}var gt=!!String.prototype.startsWith&&"_a".startsWith("a",1),dt=!!String.fromCodePoint,bt=!!Object.fromEntries,xt=!!String.prototype.codePointAt,yt=!!String.prototype.trimStart,Et=!!String.prototype.trimEnd,vt=!!Number.isSafeInteger,_t=vt?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},ne=true;try{Re=Ue("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),ne=((te=Re.exec("a"))===null||te===void 0?void 0:te[0])==="a";}catch{ne=false;}var Re,Ce=gt?function(t,n,r){return t.startsWith(n,r)}:function(t,n,r){return t.slice(r,r+n.length)===n},ie=dt?String.fromCodePoint:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r="",i=t.length,o=0,s;i>o;){if(s=t[o++],s>1114111)throw RangeError(s+" is not a valid code point");r+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320);}return r},De=bt?Object.fromEntries:function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],s=o[0],h=o[1];n[s]=h;}return n},Ge=xt?function(t,n){return t.codePointAt(n)}:function(t,n){var r=t.length;if(!(n<0||n>=r)){var i=t.charCodeAt(n),o;return i<55296||i>56319||n+1===r||(o=t.charCodeAt(n+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},Tt=yt?function(t){return t.trimStart()}:function(t){return t.replace(pt,"")},St=Et?function(t){return t.trimEnd()}:function(t){return t.replace(mt,"")};function Ue(e,t){return new RegExp(e,t)}var oe;ne?(re=Ue("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),oe=function(t,n){var r;re.lastIndex=n;var i=re.exec(t);return (r=i[1])!==null&&r!==void 0?r:""}):oe=function(t,n){for(var r=[];;){var i=Ge(t,n);if(i===void 0||je(i)||Pt(i))break;r.push(i),n+=i>=65536?2:1;}return ie.apply(void 0,r)};var re,Fe=(function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons;}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",false)},e.prototype.parseMessage=function(t,n,r){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var s=this.parseArgument(t,r);if(s.err)return s;i.push(s.val);}else {if(o===125&&t>0)break;if(o===35&&(n==="plural"||n==="selectordinal")){var h=this.clonePosition();this.bump(),i.push({type:x.pound,location:d(h,this.clonePosition())});}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(r)break;return this.error(c.UNMATCHED_CLOSING_TAG,d(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&se(this.peek()||0)){var s=this.parseTag(t,n);if(s.err)return s;i.push(s.val);}else {var s=this.parseLiteral(t,n);if(s.err)return s;i.push(s.val);}}}return {val:i,err:null}},e.prototype.parseTag=function(t,n){var r=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return {val:{type:x.literal,value:"<".concat(i,"/>"),location:d(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,n,true);if(o.err)return o;var s=o.val,h=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!se(this.char()))return this.error(c.INVALID_TAG,d(h,this.clonePosition()));var p=this.clonePosition(),a=this.parseTagName();return i!==a?this.error(c.UNMATCHED_CLOSING_TAG,d(p,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:x.tag,value:i,children:s,location:d(r,this.clonePosition())},err:null}:this.error(c.INVALID_TAG,d(h,this.clonePosition())))}else return this.error(c.UNCLOSED_TAG,d(r,this.clonePosition()))}else return this.error(c.INVALID_TAG,d(r,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&Bt(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var r=this.clonePosition(),i="";;){var o=this.tryParseQuote(n);if(o){i+=o;continue}var s=this.tryParseUnquoted(t,n);if(s){i+=s;continue}var h=this.tryParseLeftAngleBracket();if(h){i+=h;continue}break}var p=d(r,this.clonePosition());return {val:{type:x.literal,value:i,location:p},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return !this.isEOF()&&this.char()===60&&(this.ignoreTag||!Ht(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(r===39)if(this.peek()===39)n.push(39),this.bump();else {this.bump();break}else n.push(r);this.bump();}return ie.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var r=this.char();return r===60||r===123||r===35&&(n==="plural"||n==="selectordinal")||r===125&&t>0?null:(this.bump(),ie(r))},e.prototype.parseArgument=function(t,n){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(c.EXPECT_ARGUMENT_CLOSING_BRACE,d(r,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(c.EMPTY_ARGUMENT,d(r,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(c.MALFORMED_ARGUMENT,d(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(c.EXPECT_ARGUMENT_CLOSING_BRACE,d(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:x.argument,value:i,location:d(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(c.EXPECT_ARGUMENT_CLOSING_BRACE,d(r,this.clonePosition())):this.parseArgumentOptions(t,n,i,r);default:return this.error(c.MALFORMED_ARGUMENT,d(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),r=oe(this.message,n),i=n+r.length;this.bumpTo(i);var o=this.clonePosition(),s=d(t,o);return {value:r,location:s}},e.prototype.parseArgumentOptions=function(t,n,r,i){var o,s=this.clonePosition(),h=this.parseIdentifierIfPossible().value,p=this.clonePosition();switch(h){case "":return this.error(c.EXPECT_ARGUMENT_TYPE,d(s,p));case "number":case "date":case "time":{this.bumpSpace();var a=null;if(this.bumpIf(",")){this.bumpSpace();var u=this.clonePosition(),g=this.parseSimpleArgStyleIfPossible();if(g.err)return g;var f=St(g.val);if(f.length===0)return this.error(c.EXPECT_ARGUMENT_STYLE,d(this.clonePosition(),this.clonePosition()));var l=d(u,this.clonePosition());a={style:f,styleLocation:l};}var b=this.tryParseArgumentClose(i);if(b.err)return b;var E=d(i,this.clonePosition());if(a&&Ce(a?.style,"::",0)){var y=Tt(a.style.slice(2));if(h==="number"){var g=this.parseNumberSkeletonFromString(y,a.styleLocation);return g.err?g:{val:{type:x.number,value:r,location:E,style:g.val},err:null}}else {if(y.length===0)return this.error(c.EXPECT_DATE_TIME_SKELETON,E);var T=y;this.locale&&(T=Oe(y,this.locale));var f={type:B.dateTime,pattern:T,location:a.styleLocation,parsedOptions:this.shouldParseSkeletons?Se(T):{}},_=h==="date"?x.date:x.time;return {val:{type:_,value:r,location:E,style:f},err:null}}}return {val:{type:h==="number"?x.number:h==="date"?x.date:x.time,value:r,location:E,style:(o=a?.style)!==null&&o!==void 0?o:null},err:null}}case "plural":case "selectordinal":case "select":{var S=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(c.EXPECT_SELECT_ARGUMENT_OPTIONS,d(S,m({},S)));this.bumpSpace();var A=this.parseIdentifierIfPossible(),H=0;if(h!=="select"&&A.value==="offset"){if(!this.bumpIf(":"))return this.error(c.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,d(this.clonePosition(),this.clonePosition()));this.bumpSpace();var g=this.tryParseDecimalInteger(c.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,c.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(g.err)return g;this.bumpSpace(),A=this.parseIdentifierIfPossible(),H=g.val;}var k=this.tryParsePluralOrSelectOptions(t,h,n,A);if(k.err)return k;var b=this.tryParseArgumentClose(i);if(b.err)return b;var me=d(i,this.clonePosition());return h==="select"?{val:{type:x.select,value:r,options:De(k.val),location:me},err:null}:{val:{type:x.plural,value:r,options:De(k.val),offset:H,pluralType:h==="plural"?"cardinal":"ordinal",location:me},err:null}}default:return this.error(c.INVALID_ARGUMENT_TYPE,d(s,p))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(c.EXPECT_ARGUMENT_CLOSING_BRACE,d(t,this.clonePosition())):(this.bump(),{val:true,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var r=this.char();switch(r){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(c.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,d(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return {val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return {val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var r=[];try{r=we(t);}catch{return this.error(c.INVALID_NUMBER_SKELETON,n)}return {val:{type:B.number,tokens:r,location:n,parsedOptions:this.shouldParseSkeletons?Ne(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,r,i){for(var o,s=false,h=[],p=new Set,a=i.value,u=i.location;;){if(a.length===0){var g=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(c.EXPECT_PLURAL_ARGUMENT_SELECTOR,c.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;u=d(g,this.clonePosition()),a=this.message.slice(g.offset,this.offset());}else break}if(p.has(a))return this.error(n==="select"?c.DUPLICATE_SELECT_ARGUMENT_SELECTOR:c.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,u);a==="other"&&(s=true),this.bumpSpace();var l=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?c.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:c.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,d(this.clonePosition(),this.clonePosition()));var b=this.parseMessage(t+1,n,r);if(b.err)return b;var E=this.tryParseArgumentClose(l);if(E.err)return E;h.push([a,{value:b.val,location:d(l,this.clonePosition())}]),p.add(a),this.bumpSpace(),o=this.parseIdentifierIfPossible(),a=o.value,u=o.location;}return h.length===0?this.error(n==="select"?c.EXPECT_SELECT_ARGUMENT_SELECTOR:c.EXPECT_PLURAL_ARGUMENT_SELECTOR,d(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(c.MISSING_OTHER_CLAUSE,d(this.clonePosition(),this.clonePosition())):{val:h,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var r=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var o=false,s=0;!this.isEOF();){var h=this.char();if(h>=48&&h<=57)o=true,s=s*10+(h-48),this.bump();else break}var p=d(i,this.clonePosition());return o?(s*=r,_t(s)?{val:s,err:null}:this.error(n,p)):this.error(t,p)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return {offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var n=Ge(this.message,t);if(n===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return n},e.prototype.error=function(t,n){return {val:null,err:{kind:t,message:this.message,location:n}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2);}},e.prototype.bumpIf=function(t){if(Ce(this.message,t,this.offset())){for(var n=0;n<t.length;n++)this.bump();return true}return false},e.prototype.bumpUntil=function(t){var n=this.offset(),r=this.message.indexOf(t,n);return r>=0?(this.bumpTo(r),true):(this.bumpTo(this.message.length),false)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&je(this.char());)this.bump();},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),r=this.message.charCodeAt(n+(t>=65536?2:1));return r??null},e})();function se(e){return e>=97&&e<=122||e>=65&&e<=90}function Ht(e){return se(e)||e===47}function Bt(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function je(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function Pt(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function ae(e){e.forEach(function(t){if(delete t.location,O(t)||R(t))for(var n in t.options)delete t.options[n].location,ae(t.options[n].value);else I(t)&&$(t.style)||(M(t)||N(t))&&D(t.style)?delete t.style.location:C(t)&&ae(t.children);});}function Ve(e,t){t===void 0&&(t={}),t=m({shouldParseSkeletons:true,requiresOtherClause:true},t);var n=new Fe(e,t).parse();if(n.err){var r=SyntaxError(c[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t?.captureLocation||ae(n.val),n.val}var P;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API";})(P||(P={}));var U=(function(e){L(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.code=r,o.originalMessage=i,o}return t.prototype.toString=function(){return "[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t})(Error);var ue=(function(e){L(t,e);function t(n,r,i,o){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(r,'". Options are "').concat(Object.keys(i).join('", "'),'"'),P.INVALID_VALUE,o)||this}return t})(U);var ke=(function(e){L(t,e);function t(n,r,i){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(r),P.INVALID_VALUE,i)||this}return t})(U);var Xe=(function(e){L(t,e);function t(n,r){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(r,'"'),P.MISSING_VALUE,r)||this}return t})(U);var v;(function(e){e[e.literal=0]="literal",e[e.object=1]="object";})(v||(v={}));function At(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return !r||r.type!==v.literal||n.type!==v.literal?t.push(n):r.value+=n.value,t},[])}function wt(e){return typeof e=="function"}function F(e,t,n,r,i,o,s){if(e.length===1&&q(e[0]))return [{type:v.literal,value:e[0].value}];for(var h=[],p=0,a=e;p<a.length;p++){var u=a[p];if(q(u)){h.push({type:v.literal,value:u.value});continue}if(Te(u)){typeof o=="number"&&h.push({type:v.literal,value:n.getNumberFormat(t).format(o)});continue}var g=u.value;if(!(i&&g in i))throw new Xe(g,s);var f=i[g];if(K(u)){(!f||typeof f=="string"||typeof f=="number")&&(f=typeof f=="string"||typeof f=="number"?String(f):""),h.push({type:typeof f=="string"?v.literal:v.object,value:f});continue}if(M(u)){var l=typeof u.style=="string"?r.date[u.style]:D(u.style)?u.style.parsedOptions:void 0;h.push({type:v.literal,value:n.getDateTimeFormat(t,l).format(f)});continue}if(N(u)){var l=typeof u.style=="string"?r.time[u.style]:D(u.style)?u.style.parsedOptions:r.time.medium;h.push({type:v.literal,value:n.getDateTimeFormat(t,l).format(f)});continue}if(I(u)){var l=typeof u.style=="string"?r.number[u.style]:$(u.style)?u.style.parsedOptions:void 0;l&&l.scale&&(f=f*(l.scale||1)),h.push({type:v.literal,value:n.getNumberFormat(t,l).format(f)});continue}if(C(u)){var b=u.children,E=u.value,y=i[E];if(!wt(y))throw new ke(E,"function",s);var T=F(b,t,n,r,i,o),_=y(T.map(function(H){return H.value}));Array.isArray(_)||(_=[_]),h.push.apply(h,_.map(function(H){return {type:typeof H=="string"?v.literal:v.object,value:H}}));}if(O(u)){var S=u.options[f]||u.options.other;if(!S)throw new ue(u.value,f,Object.keys(u.options),s);h.push.apply(h,F(S.value,t,n,r,i));continue}if(R(u)){var S=u.options["=".concat(f)];if(!S){if(!Intl.PluralRules)throw new U(`Intl.PluralRules is not available in this environment.
|
|
11
|
+
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
12
|
+
`,P.MISSING_INTL_API,s);var A=n.getPluralRules(t,{type:u.pluralType}).select(f-(u.offset||0));S=u.options[A]||u.options.other;}if(!S)throw new ue(u.value,f,Object.keys(u.options),s);h.push.apply(h,F(S.value,t,n,r,i,f-(u.offset||0)));continue}}return At(h)}function Lt(e,t){return t?m(m(m({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=m(m({},e[r]),t[r]||{}),n},{})):e}function It(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=Lt(e[r],t[r]),n},m({},e)):e}function he(e){return {create:function(){return {get:function(t){return e[t]},set:function(t,n){e[t]=n;}}}}}function Mt(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:z(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,X([void 0],n,false)))},{cache:he(e.number),strategy:W.variadic}),getDateTimeFormat:z(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,X([void 0],n,false)))},{cache:he(e.dateTime),strategy:W.variadic}),getPluralRules:z(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,X([void 0],n,false)))},{cache:he(e.pluralRules),strategy:W.variadic})}}var ze=(function(){function e(t,n,r,i){n===void 0&&(n=e.defaultLocale);var o=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(a){var u=o.formatToParts(a);if(u.length===1)return u[0].value;var g=u.reduce(function(f,l){return !f.length||l.type!==v.literal||typeof f[f.length-1]!="string"?f.push(l.value):f[f.length-1]+=l.value,f},[]);return g.length<=1?g[0]||"":g},this.formatToParts=function(a){return F(o.ast,o.locales,o.formatters,o.formats,a,void 0,o.message)},this.resolvedOptions=function(){var a;return {locale:((a=o.resolvedLocale)===null||a===void 0?void 0:a.toString())||Intl.NumberFormat.supportedLocalesOf(o.locales)[0]}},this.getAst=function(){return o.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=i||{};s.formatters;var p=Ee(s,["formatters"]);this.ast=e.__parse(t,m(m({},p),{locale:this.resolvedLocale}));}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=It(e.formats,r),this.formatters=i&&i.formatters||Mt(this.formatterCache);}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:false,configurable:true}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){if(!(typeof Intl.Locale>"u")){var n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Ve,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e})();var We=ze;var j=class{locale;messages;cache;constructor(t,n){this.locale=t,this.messages=n,this.cache={};}format(t,n){let r=this.cache[t];if(!r){let o=this.messages.getStringForLocale(t,this.locale);if(!o)throw new Error(`Could not find intl message ${t} in ${this.locale} locale`);r=new We(o,this.locale),this.cache[t]=r;}let i;return n&&(i=Object.keys(n).reduce((o,s)=>(o[s]=n[s]==null?false:n[s],o),{})),r.format(i)}};function Ze(e){return e instanceof Error?e.message:String(e)}function le(e){return e.slice(e.lastIndexOf(".")+1)}var V={},Je={"en-US":V},fe=new WeakMap;function Ye(e,t){let n=fe.get(e);n||(n=new Map,fe.set(e,n));let r=n.get(t);if(!r){let i=new j(t,new w(e));r=(o,s)=>i.format(o,s),n.set(t,r);}return r}var Ot={};function Rt(e){try{new Intl.Locale(e);}catch{throw new Error(`BUI \u{1F30D}: \`createMessageFormatter\` received an invalid locale: \`${e}\`. Pass a BCP 47 language tag such as \`fr-CA\` \u2014 unlike the keys of \`messages\`, the underscore form (\`fr_CA\`) is not accepted here.`)}}function Ct(e,t){let{language:n}=new Intl.Locale(t);return !!(e[t]||e[n]||Object.entries(e).some(([r,i])=>i&&r.startsWith(`${n}-`)))}function Dt(e){return Object.values(e).some(Boolean)}function Gt(e,t,n){if(!t.includes("."))return {outcome:"miss"};let r=le(t);try{return {outcome:"resolved",value:e(r,n)}}catch(i){return Qe(i)?{outcome:"miss"}:{outcome:"malformed",error:i}}}function Qe(e){return e instanceof Error&&e.message.startsWith("Could not find intl message")}function Ut(e,t){if(process.env.NODE_ENV==="production")return "";let n=(b$2[t]??[]).filter(r=>r!==e);return n.length===0?"":` Note that \`${t}\` also answers for ${n.map(r=>`\`${r}\``).join(", ")}, so this one entry translates all of them.`}function ce(e){let t;for(let n of Object.keys(e)){let r=n.replaceAll("_","-");r!==n&&(t??={...e},t[r]={...e[n],...t[r]});}return t??e}function pe(e,t){if(t)for(let n of Object.keys(e)){let r=n.replaceAll("_","-");r!==n&&Object.prototype.hasOwnProperty.call(e,r)&&t(`locale-alias:${n}:${r}`,()=>({code:"locale-alias-collision",locale:r,message:`Locale supplied in multiple formats ("${n}" and "${r}"). Using the hyphenated entry; provide a single locale ID format to avoid ambiguity.`}));}}function qe(e,t,n){let r=Ye(e,t),i=Ye(Je,t),o=Ct(e,t),s=!o&&Dt(e)&&new Intl.Locale(t).language!=="en",h=l=>{!s||!l.startsWith("bui.")||n?.(`no-catalog:${t}`,()=>{let b=Object.keys(e).filter(E=>e[E]).map(E=>`\`${E}\``).join(", ");return {code:"no-catalog-for-locale",locale:t,message:`No supplied catalog covers locale: \`${t}\` (catalogs supplied for ${b}). Every message will use its English \`defaultMessage\`. File the catalog under a key that matches the active locale.`}});},p=l=>{l.startsWith("bui.")&&n?.(`missing:${l}`,()=>({code:"missing-message",locale:t,id:l,message:`Translation not found for key: \`${l}\` for locale: \`${t}\`. The message's \`defaultMessage\` will be used instead.`}));},a=(l,b,E)=>{n?.(`malformed:${l}`,()=>({code:"malformed-message",locale:t,id:l,error:b,source:"catalog",message:`Translation for \`${l}\` for locale: \`${t}\`${E?`, supplied under the deprecated bare id \`${le(l)}\`,`:""} could not be formatted (${Ze(b)}). The message's \`defaultMessage\` will be used instead.`}));},u=(l,b)=>{n?.(`malformed-default:${l}`,()=>({code:"malformed-message",locale:t,id:l,error:b,source:"defaultMessage",message:`The \`defaultMessage\` for \`${l}\` could not be formatted (${Ze(b)}). Its template will render as-is.`}));},g=l=>{n?.(`legacy:${l}`,()=>{let b=le(l);return {code:"deprecated-message-id",locale:t,id:l,message:`Translation for \`${l}\` resolved via the deprecated bare id \`${b}\` for locale: \`${t}\`. Regenerate your translation catalog with namespaced keys; the bare-id fallback will be removed in a future major.${Ut(l,b)}`}});},f=(l,b,E)=>{let y=b?.defaultMessage??V[l];if(!y)return l;if(!y.includes("{")||V[l]!==y)return y;try{return i(l,E)}catch(T){return u(l,T),y}};return (l,b)=>{let E=typeof l=="object"?l:void 0,y=E?.id??l;if(!o)return h(y),f(y,E,b);try{return r(y,b)}catch(T){if(Qe(T)){if(y.startsWith("bui.")){let _=Gt(r,y,b);if(_.outcome==="resolved")return g(y),_.value;if(_.outcome==="malformed")return a(y,_.error,true),f(y,E,b)}p(y);}else a(y,T,false);return f(y,E,b)}}}function Wr({locale:e,messages:t,shouldLogMissingMessages:n=a,onMessageIssue:r}){Rt(e);let i=r||n?b(new Set,()=>r):void 0,o=t?a$1(t):Ot;return pe(o,i),qe(ce(o),e,i)}function $r(e){let{messages:t,reportMessageIssue:n,setLang:r}=useContext(c$1),i=useMemo(()=>e?a$1(e):void 0,[e]);useEffect(()=>{i&&pe(i,n),pe(t,n);},[i,t,n]);let o=useMemo(()=>{let p=i?ce(i):void 0,a=ce(t);if(!p)return a;if(Object.keys(a).length===0)return p;let u=new Set([...Object.keys(p),...Object.keys(a)]),g={};for(let f of u)g[f]={...p[f],...a[f]};return g},[i,t]),s=b$1();useEffect(()=>{r(s.locale);},[s.locale,r]);let h=useMemo(()=>qe(o,s.locale,n),[o,s.locale,n]);return useMemo(()=>({formatMessage:h,locale:s}),[h,s])}var Zr=e=>{for(let{id:t,defaultMessage:n}of Object.values(e)){if(!n)continue;let r=V[t];V[t]=n,r&&r!==n&&fe.delete(Je);}return e};export{Wr as a,$r as b,Zr as c};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$3}from'./chunk-YCI6BEXQ.mjs';import {q}from'./chunk-7AY6C5M5.mjs';import {b as b$2}from'./chunk-AC7OXVHA.mjs';import {c,b}from'./chunk-X3OCHEQM.mjs';import {a as a$1}from'./chunk-O7XK2WIX.mjs';import {a as a$4}from'./chunk-GCZFXILF.mjs';import {b as b$1}from'./chunk-4ZJMZB5B.mjs';import {g}from'./chunk-AUOQSTS5.mjs';import {a}from'./chunk-FXCHST4Z.mjs';import {a as a$2}from'./chunk-4QEH5CGK.mjs';import {MinusIcon}from'@baseline-ui/icons/12';import {AttachmentsIcon,ErrorCircleFilledIcon}from'@baseline-ui/icons/16';import {sprinkles}from'@baseline-ui/tokens';import d from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var T="_1x35j5g0 _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j4 _1yep5z6j5 _1yep5z6j6 _1yep5z6ln _1yep5z6lq",P=a({defaultClassName:"_1x35j5g1 _1yep5z68f _1yep5z68g _1yep5z68h _1yep5z663 _1yep5z664 _1yep5z665 _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j4 _1yep5z6j5 _1yep5z6j6 _1yep5z6lq",variantClassNames:{isFocusVisible:{true:"_1x35j5g2"},isError:{true:"_1x35j5g3"},isDisabled:{true:"_1x35j5g4"}},defaultVariants:{},compoundVariants:[]}),D="_1x35j5g5 _1yep5z66 _1yep5z67 _1yep5z68 _1yep5z62i _1yep5z62j _1yep5z62k _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6jj _1yep5z6jk _1yep5z6jl _1yep5z69l _1yep5z69m _1yep5z69n _1yep5z6ln",V=a({defaultClassName:"_1x35j5g7 _1yep5z6dy _1yep5z6eu",variantClassNames:{isLoading:{true:"_1yep5z610z"}},defaultVariants:{},compoundVariants:[]}),S="_1yep5z64r _1yep5z64s _1yep5z64t _1yep5z673 _1yep5z674 _1yep5z675 _1yep5z689 _1yep5z68a _1yep5z68b _1yep5z65x _1yep5z65y _1yep5z65z",H="_1x35j5g6 _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j4 _1yep5z6j5 _1yep5z6j6 _1yep5z6jg _1yep5z6jh _1yep5z6ji _1yep5z6kd _1yep5z6ke _1yep5z6kf";var Q=sprinkles({color:"icon.secondary"}),W=sprinkles({color:"support.error.medium"});function X({item:e,isFocusVisible:x,isDisabled:i,onRemove:t,loadingLabel:a,removeHintLabel:s}){let{formatMessage:y}=b(),n=!!e.isLoading,l=!!(e.errorMessage||e.errorExplanation),b$3=!i&&!n&&!!t,c=(typeof a=="function"?a({fileName:e.name}):a)??y(A.loading,{fileName:e.name}),m=e.name;return n?m=c:b$3&&(m=(typeof s=="function"?s({fileName:e.name}):s)??y(A.removeHint,{fileName:e.name})),jsxs("div",{className:P({isDisabled:i,isFocusVisible:x,isError:l}),"data-error":l||void 0,children:[jsx(b$1,{children:jsx(b$2,{slot:"label",children:m})}),jsxs("div",{className:D,children:[jsx(AttachmentsIcon,{width:16,height:16,className:Q}),jsx("span",{className:H,children:jsx("span",{className:V({isLoading:n}),title:e.name,children:e.name})}),jsxs(a$1,{elementType:"span",display:"flex",alignItems:"center",gap:"xs",flexShrink:0,children:[l?jsx(ErrorCircleFilledIcon,{width:16,height:16,className:W}):null,n?jsx(a$3,{size:"sm",className:S,"aria-label":c}):t?jsx(a$4,{icon:MinusIcon,size:"xs",variant:"secondary",excludeFromTabOrder:true,preventFocusOnPress:true,isDisabled:i,onPress:()=>{t(e.id);},UNSAFE_isVisuallyInteractiveOnly:true}):null]})]}),l?jsxs(a$1,{display:"flex",flexDirection:"column",width:"full",paddingY:"md",children:[e.errorMessage?jsx(a$1,{elementType:"span",typography:"label.sm.medium",color:"support.error.medium",children:e.errorMessage}):null,e.errorExplanation?jsx(a$1,{elementType:"span",typography:"label.sm.medium",color:"text.helper",children:e.errorExplanation}):null]}):null]})}var R=d.forwardRef(({className:e,style:x,items:i,onRemove:t,disabledKeys:a,loadingLabel:s,removeHintLabel:y,"aria-label":n,"aria-labelledby":l,"aria-describedby":b,"aria-details":c},m)=>{let u=a==="all",_=d.useMemo(()=>new Set(a&&a!=="all"?a:[]),[a]),v=d.useMemo(()=>new Map(i.map(r=>[r.id,r])),[i]),j=d.useMemo(()=>i.map(r=>({id:r.id,label:r.name})),[i]),U=d.useCallback((r,{isFocusVisible:F})=>{let f=v.get(r.id);return f?jsx(X,{item:f,isFocusVisible:F,isDisabled:u||_.has(f.id),onRemove:t,loadingLabel:s,removeHintLabel:y}):null},[v,u,_,t,s,y]);if(!i.length)return null;let q$1=u?j.map(r=>r.id):_,K=r=>{if(!t||r.key!=="Delete"&&r.key!=="Backspace"||u)return;let z=g(r)?.closest("[data-key]")?.dataset.key;z&&(_.has(z)||v.get(z)?.isLoading||(r.preventDefault(),t(z)));};return jsx(a$1,{ref:m,className:a$2("BaselineUI-FileList",e),style:x,onKeyDown:K,children:jsx(q,{"aria-label":n,"aria-labelledby":l,"aria-describedby":b,"aria-details":c,items:j,selectionMode:"none",disabledKeys:q$1,className:T,renderOption:U})})});R.displayName="FileList";var A=c({loading:{id:"bui.fileList.loading",defaultMessage:"Loading {fileName}"},removeHint:{id:"bui.fileList.removeHint",defaultMessage:"{fileName}, press Delete or Backspace to remove"}});export{R as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$2}from'./chunk-CHTLOFCT.mjs';import {a as a$1}from'./chunk-CFLEBB5T.mjs';import {b}from'./chunk-4ZJMZB5B.mjs';import {a as a$5}from'./chunk-RSKKEGJZ.mjs';import {a as a$3}from'./chunk-K6X2BHPP.mjs';import {a as a$4}from'./chunk-3FYY26ED.mjs';import {c}from'./chunk-TZ4MVY4E.mjs';import {a}from'./chunk-FXCHST4Z.mjs';import {a as a$6}from'./chunk-4QEH5CGK.mjs';import C from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var h=a({defaultClassName:"bpklwa7 z9nup88",variantClassNames:{isReadOnly:{true:"bpklwa8"},isDisabled:{true:"bpklwa9"},isSelected:{true:"bpklwaa"},isFocused:{true:"bpklwab"}},defaultVariants:{},compoundVariants:[[{isSelected:true,isDisabled:false,isReadOnly:false},"bpklwac"]]}),v=a({defaultClassName:"bpklwae",variantClassNames:{isDisabled:{true:"bpklwaf"},isSelected:{true:"bpklwag"},isReadOnly:{true:"bpklwah"}},defaultVariants:{},compoundVariants:[]}),g="bpklwad",y=a({defaultClassName:"bpklwa0",variantClassNames:{labelPosition:{top:"bpklwa1",left:"bpklwa2"}},defaultVariants:{},compoundVariants:[]}),x="bpklwa6",S=a({defaultClassName:"bpklwa3",variantClassNames:{labelPosition:{top:"bpklwa4",left:"bpklwa5"}},defaultVariants:{},compoundVariants:[]});var R=C.forwardRef(({className:V,label:r,labelPosition:d="top",statusLabel:l,style:D,"data-block-id":P,"data-block-class":O,...a},L)=>{let c$1=C.useRef(null),t=a$1(a),{inputProps:H,isPressed:I,labelProps:B}=a$2({...a,children:r},t,c$1),{isFocusVisible:s,focusProps:F}=a$3(),{hoverProps:T,isHovered:U}=a$4({isDisabled:a.isDisabled}),K=a$5({"data-block-id":P,"data-block-class":O,"data-focused":s,"data-disabled":a.isDisabled,"data-focus-visible":s,"data-selected":t.isSelected,"data-readonly":a.isReadOnly,"data-hovered":U,"data-pressed":I}),p=jsx("div",{className:a$6(h({isSelected:t.isSelected,isDisabled:!!a.isDisabled,isFocused:s,isReadOnly:!!a.isReadOnly}),"BaselineUI-Switch-Track"),children:jsx("div",{className:a$6(v({isSelected:t.isSelected,isDisabled:a.isDisabled,isReadOnly:a.isReadOnly}),"BaselineUI-Switch-Knob"),"data-testid":"switch-knob"})});return jsxs("label",{...c(K,B,T),className:a$6(y({labelPosition:d}),"BaselineUI-Switch",V),style:D,ref:L,children:[r?jsx("span",{className:a$6(g,"BaselineUI-Switch-Label"),children:r}):null,jsx(b,{children:jsx("input",{...c(H,F),ref:c$1})}),l?jsxs("div",{className:S({labelPosition:d}),children:[jsx("span",{className:a$6("BaselineUI-Switch-Status-Label",x),children:t.isSelected?l.on:l.off}),p]}):p]})});R.displayName="Switch";export{R as a};
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$b}from'./chunk-WAOWR7MR.mjs';import {c as c$3,a as a$c,b as b$5}from'./chunk-BKDQLDOK.mjs';import {b}from'./chunk-J7EAQSKX.mjs';import {e,f,g}from'./chunk-IW4GXU75.mjs';import {a as a$5}from'./chunk-SAZLJ66W.mjs';import {a as a$a}from'./chunk-M5M3EPG5.mjs';import {d}from'./chunk-W6QO7FPZ.mjs';import {c}from'./chunk-JJPCZOOI.mjs';import {d as d$1}from'./chunk-KUEDQO7P.mjs';import {b as b$1}from'./chunk-N2XGJKZG.mjs';import {b as b$3}from'./chunk-4ZJMZB5B.mjs';import {a as a$4}from'./chunk-X3AXUU3H.mjs';import {a as a$9}from'./chunk-545KDVGI.mjs';import {a as a$2}from'./chunk-RSKKEGJZ.mjs';import {a as a$7}from'./chunk-K6X2BHPP.mjs';import {d as d$3}from'./chunk-BGMVPFYK.mjs';import {b as b$2}from'./chunk-YB3KW7JC.mjs';import {a as a$8}from'./chunk-3FYY26ED.mjs';import {d as d$2}from'./chunk-AQYBKDT2.mjs';import {a as a$1}from'./chunk-RT4LMB6X.mjs';import {c as c$1}from'./chunk-TZ4MVY4E.mjs';import {a as a$6}from'./chunk-KEVERVHK.mjs';import {c as c$2}from'./chunk-JDLUGVXG.mjs';import {b as b$4,g as g$1}from'./chunk-AUOQSTS5.mjs';import {a}from'./chunk-FXCHST4Z.mjs';import {a as a$3}from'./chunk-4QEH5CGK.mjs';import Oe,{useMemo,useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var C=new WeakMap;function F(e,a,o){let{value:i,children:d,"aria-label":s,"aria-labelledby":p,onPressStart:t,onPressEnd:l,onPressChange:u,onPress:b,onPressUp:v,onClick:R}=e,r=e.isDisabled||a.isDisabled,D=d!=null,P=s!=null||p!=null;!D&&!P&&process.env.NODE_ENV!=="production"&&console.warn("If you do not provide children, you must specify an aria-label for accessibility");let y=a.selectedValue===i,g=z=>{z.stopPropagation(),a.setSelectedValue(i);},{pressProps:V,isPressed:_}=d$2({onPressStart:t,onPressEnd:l,onPressChange:u,onPress:b,onPressUp:v,onClick:R,isDisabled:r}),{pressProps:h,isPressed:G}=d$2({onPressStart:t,onPressEnd:l,onPressChange:u,onPressUp:v,onClick:R,isDisabled:r,onPress(z){b?.(z),a.setSelectedValue(i),o.current?.focus();}}),{focusableProps:c}=d$3(c$1(e,{onFocus:()=>a.setLastFocusedValue(i)}),o),m=c$1(V,c),x=a$6(e,{labelable:true}),n=-1;a.selectedValue!=null?a.selectedValue===i&&(n=0):(a.lastFocusedValue===i||a.lastFocusedValue==null)&&(n=0),r&&(n=void 0);let{name:O,form:xe,descriptionId:De,errorMessageId:_e,validationBehavior:E}=C.get(a);a$9(o,a.defaultSelectedValue,a.setSelectedValue),a$a({validationBehavior:E},a,o);let H=a$b();return {labelProps:c$1(h,useMemo(()=>({onClick:z=>z.preventDefault(),onMouseDown:z=>z.preventDefault()}),[])),inputProps:c$1(x,{...m,type:"radio",name:O,form:xe,tabIndex:n,disabled:r,required:a.isRequired&&E==="native",checked:y,value:i,onChange:g,"aria-describedby":[e["aria-describedby"],H.id,a.isInvalid?_e:null,De].filter(Boolean).join(" ")||void 0}),descriptionProps:H,isDisabled:r,isSelected:y,isPressed:_||G}}function N(e,a,o){let{name:i,form:d,isReadOnly:s,isRequired:p,isDisabled:t,orientation:l="vertical",validationBehavior:u="aria"}=e,{direction:b}=b$1(),{isInvalid:v,validationErrors:R,validationDetails:r}=a.displayValidation,{labelProps:D,fieldProps:P,descriptionProps:y,errorMessageProps:g}=a$5({...e,labelElementType:"span",isInvalid:a.isInvalid,errorMessage:e.errorMessage||R,ref:o}),V=a$6(e,{labelable:true}),{focusWithinProps:_}=b$2({onBlurWithin(c){e.onBlur?.(c),a.selectedValue||a.setLastFocusedValue(null);},onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange}),h=c=>{let m;switch(c.key){case "ArrowRight":b==="rtl"&&l!=="vertical"?m="prev":m="next";break;case "ArrowLeft":b==="rtl"&&l!=="vertical"?m="next":m="prev";break;case "ArrowDown":m="next";break;case "ArrowUp":m="prev";break;default:return}c.preventDefault();let x=d$1(c.currentTarget,{from:g$1(c),accept:O=>O instanceof b$4(O).HTMLInputElement&&O.type==="radio"}),n;m==="next"?(n=x.nextNode(),n||(x.currentNode=c.currentTarget,n=x.firstChild())):(n=x.previousNode(),n||(x.currentNode=c.currentTarget,n=x.lastChild())),n&&(n.focus(),a.setSelectedValue(n.value));},G=c$2(i);return C.set(a,{name:G,form:d,descriptionId:y.id,errorMessageId:g.id,validationBehavior:u}),{radioGroupProps:c$1(V,{role:"radiogroup",onKeyDown:h,"aria-invalid":a.isInvalid||void 0,"aria-errormessage":e["aria-errormessage"],"aria-readonly":s||void 0,"aria-required":p||void 0,"aria-disabled":t||void 0,"aria-orientation":l,...P,..._}),labelProps:D,descriptionProps:y,errorMessageProps:g,isInvalid:v,validationErrors:R,validationDetails:r}}var Ie=Math.round(Math.random()*1e10),he=0;function w(e){let a=useMemo(()=>e.name||`radio-group-${Ie}-${++he}`,[e.name]),[o,i]=a$4(e.value,e.defaultValue??null,e.onChange),[d$1]=useState(o),[s,p]=useState(null),t=d({...e,value:o}),l=b=>{!e.isReadOnly&&!e.isDisabled&&(i(b),t.commitValidation());},u=t.displayValidation.isInvalid;return {...t,name:a,selectedValue:o,defaultSelectedValue:e.value!==void 0?d$1:e.defaultValue??null,setSelectedValue:l,lastFocusedValue:s,setLastFocusedValue:p,isDisabled:e.isDisabled||false,isReadOnly:e.isReadOnly||false,isRequired:e.isRequired||false,validationState:e.validationState||(u?"invalid":null),isInvalid:u}}var be="_1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j4 _1yep5z6j5 _1yep5z6j6 _1yep5z69c _1yep5z69d _1yep5z69e",ye=a({defaultClassName:"cw3m0n5 _1yep5z6ew _1yep5z6dv",variantClassNames:{isDisabled:{true:"_1yep5z6111"}},defaultVariants:{},compoundVariants:[]}),Re="cw3m0n4",Pe="_1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j4 _1yep5z6j5 _1yep5z6j6 _1yep5z69i _1yep5z69j _1yep5z69k _1yep5z6lk",ve=a({defaultClassName:"cw3m0n0 _1yep5z61j6 _1yep5z61j7 _1yep5z61j8 _1yep5z61ju _1yep5z61jv _1yep5z61jw _1yep5z61ki _1yep5z61kj _1yep5z61kk _1yep5z61l6 _1yep5z61l7 _1yep5z61l8 _1yep5z61nb _1yep5z61tg",variantClassNames:{isHovered:{true:"cw3m0n1"},isReadOnly:{true:"cw3m0n2"}},defaultVariants:{},compoundVariants:[[{isHovered:true,isReadOnly:false},"cw3m0n3"]]});var Le=({label:e,description:a},{isSelected:o,isFocusVisible:i,isDisabled:d,optionLabelPosition:s,isHovered:p,isReadOnly:t})=>jsxs("div",{className:b$5({labelPosition:s}),children:[jsx("div",{className:a$3(c$3({isSelected:o,isFocusVisible:i,isDisabled:d,isReadOnly:t,isHovered:p}),ve({isHovered:p})),children:o?jsx("div",{className:Re}):null}),e?jsxs("div",{className:be,children:[jsx("span",{className:a$c({isDisabled:d}),children:e}),a?jsx("span",{className:ye({isDisabled:d}),children:a}):null]}):null]}),ge=({state:e,renderOption:a=Le,item:o,optionLabelPosition:i="end",optionStyle:d,optionClassName:s,isReadOnly:p,...t})=>{let l=!!t.isDisabled||!!t.disabledValues?.includes(o.id),u=Oe.useRef(null),{inputProps:b,isPressed:v,isSelected:R,labelProps:r}=F({...t,isDisabled:l,children:o.label,value:o.id},e,u),{focusProps:D,isFocusVisible:P,isFocused:y}=a$7(),{hoverProps:g,isHovered:V}=a$8({isDisabled:l},u),_=a$2({"data-selected":R,"data-focused":y,"data-focus-visible":P,"data-hovered":V,"data-disabled":l,"data-pressed":v,"data-read-only":p});return jsxs("label",{...c$1(r,g,_),style:d,className:a$3("BaselineUI-Radio-Item",s),children:[jsx(b$3,{children:jsx("input",{...c$1(b,D),ref:u})}),a(o,{isFocusVisible:P,isSelected:R,isFocused:y,isHovered:V,isDisabled:l,optionLabelPosition:i,isReadOnly:p})]})};var Ge=Oe.forwardRef(({className:e$1,style:a,optionsContainerClassName:o,optionsContainerStyle:i,items:d,labelPosition:s="top",renderOption:p,"aria-label":t,"aria-labelledby":l,"aria-describedby":u,"aria-details":b$1,"data-block-id":v,"data-block-class":R,...r},D)=>{let P=a$1(D),y=w(r),{radioGroupProps:g$1,labelProps:V,descriptionProps:_,errorMessageProps:h}=N({...r,"aria-label":t,"aria-labelledby":l,"aria-describedby":u,"aria-details":b$1},y,P),G=b({...r,descriptionProps:_,errorMessageProps:h,labelPosition:s}),c$2=a$2({"data-orientation":r.orientation,"data-block-id":v,"data-block-class":R,"data-disabled":r.isDisabled,"data-readonly":r.isReadOnly});return jsxs("div",{...c$1(g$1,c$2),className:a$3(g({labelPosition:s}),"BaselineUI-RadioGroup",e$1),style:a,ref:P,children:[r.label||G?jsxs("div",{className:f({labelPosition:s,hasMessage:!!G}),children:[jsx("span",{...V,className:a$3(e,"BaselineUI-RadioGroup-Label"),children:r.label}),s==="start"&&G]}):null,jsx("div",{className:a$3(Pe,{[c]:r.isDisabled},o),style:i,children:d.map(m=>jsx(ge,{state:y,renderOption:p,item:m,...r,value:m.id},m.id))}),s==="top"&&G]})});Ge.displayName="RadioGroup";export{Ge as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:true});};export{e as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {d as d$1,e}from'./chunk-AUOQSTS5.mjs';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var d=class{filter;root;whatToShow;_doc;_walkerStack=[];_currentNode;_currentSetFor=new Set;constructor(t,e,r,o){this._doc=t,this.root=e,this.filter=o??null,this.whatToShow=r??NodeFilter.SHOW_ALL,this._currentNode=e,this._walkerStack.unshift(t.createTreeWalker(e,r,this._acceptNode));let i=e.shadowRoot;if(i){let n=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(n);}}_acceptNode=t=>{if(t.nodeType===Node.ELEMENT_NODE){let e=t.shadowRoot;if(e){let r=this._doc.createTreeWalker(e,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(r),NodeFilter.FILTER_ACCEPT}else {if(typeof this.filter=="function")return this.filter(t);if(this.filter?.acceptNode)return this.filter.acceptNode(t);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP};get currentNode(){return this._currentNode}set currentNode(t){if(!e(this.root,t))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");let e$1=[],r=t,o=t;for(this._currentNode=t;r&&r!==this.root;)if(r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let n=r,s=this._doc.createTreeWalker(n,this.whatToShow,{acceptNode:this._acceptNode});e$1.push(s),s.currentNode=o,this._currentSetFor.add(s),r=o=n.host;}else r=r.parentNode;let i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});e$1.push(i),i.currentNode=o,this._currentSetFor.add(i),this._walkerStack=e$1;}get doc(){return this._doc}firstChild(){let t=this.currentNode,e$1=this.nextNode();return e(t,e$1)?(e$1&&(this.currentNode=e$1),e$1):(this.currentNode=t,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){let t=this._walkerStack[0].nextNode();if(t){if(t.shadowRoot){let r;if(typeof this.filter=="function"?r=this.filter(t):this.filter?.acceptNode&&(r=this.filter.acceptNode(t)),r===NodeFilter.FILTER_ACCEPT)return this.currentNode=t,t;let o=this.nextNode();return o&&(this.currentNode=o),o}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.nextNode();return e&&(this.currentNode=e),e}else return null}previousNode(){let t=this._walkerStack[0];if(t.currentNode===t.root){if(this._currentSetFor.has(t))if(this._currentSetFor.delete(t),this._walkerStack.length>1){this._walkerStack.shift();let r=this.previousNode();return r&&(this.currentNode=r),r}else return null;return null}let e=t.previousNode();if(e){if(e.shadowRoot){let o;if(typeof this.filter=="function"?o=this.filter(e):this.filter?.acceptNode&&(o=this.filter.acceptNode(e)),o===NodeFilter.FILTER_ACCEPT)return e&&(this.currentNode=e),e;let i=this.lastChild();return i&&(this.currentNode=i),i}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.previousNode();return r&&(this.currentNode=r),r}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}};function N(l,t,e,r){return d$1()?new d(l,t,e,r):l.createTreeWalker(t,e,r)}export{N as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {c}from'./chunk-ZNN43VZV.mjs';import {b,c as c$1,a as a$1}from'./chunk-BKDQLDOK.mjs';import {a}from'./chunk-4QEH5CGK.mjs';import {CheckmarkIcon,MinusIcon}from'@baseline-ui/icons/12';import P from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var y=({label:r,...c})=>{let{isSelected:t,isIndeterminate:e,isFocusVisible:n,isDisabled:s,isReadOnly:l,isHovered:a,isInvalid:k}=c;return jsxs(Fragment,{children:[jsxs("div",{className:c$1({isSelected:t&&!e,isIndeterminate:e,isFocusVisible:n,isDisabled:s,isReadOnly:l,hasError:k,isHovered:a}),children:[t&&!e?jsx(CheckmarkIcon,{size:12}):null,e?jsx(MinusIcon,{size:12}):null]}),r?jsx("span",{className:a$1({isDisabled:s}),children:r}):null]})},d=P.forwardRef(({className:r,style:c$1,label:t,labelPosition:e="end",slot:n,...s},l)=>jsx(c,{...s,className:a(b({labelPosition:e}),"BaselineUI-Checkbox",r),style:c$1,slot:n,ref:l,children:a=>jsx(y,{label:t,...a})}));d.displayName="Checkbox";export{d as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a}from'./chunk-JDLUGVXG.mjs';import {useState}from'react';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var c=0,s=new WeakMap;function y(t,u){let[l,d]=useState();return a(()=>{if(!t)return;let n=u?.current?.getRootNode()||document,m=n?.ownerDocument||document,o=s.get(n);o||(o=new Map,s.set(n,o));let e=o.get(t);if(e)d(e.element.id);else {let i=`react-aria-description-${c++}`;d(i);let r=m.createElement("div");r.id=i,r.style.display="none",r.textContent=t,"body"in n?n.body.appendChild(r):n.appendChild(r),e={refCount:0,element:r},o.set(t,e);}return e.refCount++,()=>{e&&--e.refCount===0&&(e.element.remove(),o.delete(t));}},[t]),{"aria-describedby":t?l:void 0}}export{y as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
function o(t){return t.split("/").pop()?.split(".").shift()}function i(t){let n={};for(let r of Object.keys(t)){let e=o(r)??"";n[e]=t[r];}return n}export{i as a};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {a as a$q}from'./chunk-JI4SJ53O.mjs';import {b as b$a}from'./chunk-GKODQS6E.mjs';import {a as a$8}from'./chunk-P44XZ4PV.mjs';import {b as b$3}from'./chunk-HI44JQA7.mjs';import {a as a$o}from'./chunk-3UH5CQQF.mjs';import {a as a$r}from'./chunk-IHLJTHGQ.mjs';import {b as b$6,a as a$m}from'./chunk-DOL6RDMF.mjs';import {a as a$c}from'./chunk-5IC46G5J.mjs';import {b as b$4}from'./chunk-OLJWK3LS.mjs';import {f}from'./chunk-RC7QITNV.mjs';import {a as a$j}from'./chunk-5BAHJXOI.mjs';import {b as b$8,c as c$2}from'./chunk-RJC3HQDZ.mjs';import {a as a$6}from'./chunk-EU75HMPG.mjs';import {a as a$k}from'./chunk-NGZRN4SF.mjs';import {a as a$p}from'./chunk-RJWPSJX2.mjs';import {a as a$g}from'./chunk-YOBESAXG.mjs';import {a as a$h}from'./chunk-MEYMETYC.mjs';import {a as a$i}from'./chunk-S3V4OOC3.mjs';import {b as b$9,e}from'./chunk-PHZZLBH3.mjs';import {b as b$7,f as f$1}from'./chunk-AKES5B6C.mjs';import {a as a$n}from'./chunk-2WAKHFPS.mjs';import {a as a$a}from'./chunk-NSC53QWT.mjs';import {a as a$d}from'./chunk-CGFLGZL4.mjs';import {c as c$1,b as b$1}from'./chunk-X3OCHEQM.mjs';import {b as b$b}from'./chunk-J3MJZQUJ.mjs';import {a as a$9}from'./chunk-O7XK2WIX.mjs';import {a as a$b}from'./chunk-GCZFXILF.mjs';import {a as a$l}from'./chunk-TDXALNX3.mjs';import {b as b$5,j as j$1}from'./chunk-4NYPVKDO.mjs';import {a as a$1}from'./chunk-X3AXUU3H.mjs';import {a as a$4}from'./chunk-RSKKEGJZ.mjs';import {a as a$2}from'./chunk-K6X2BHPP.mjs';import {a as a$e}from'./chunk-BGMVPFYK.mjs';import {a as a$3}from'./chunk-3FYY26ED.mjs';import {d}from'./chunk-MRJFGHFW.mjs';import {b,c}from'./chunk-TZ4MVY4E.mjs';import {c as c$3}from'./chunk-JDLUGVXG.mjs';import {a as a$7,b as b$2,g,e as e$1}from'./chunk-AUOQSTS5.mjs';import {a as a$f}from'./chunk-HXTAOYOD.mjs';import {a}from'./chunk-FXCHST4Z.mjs';import {a as a$5}from'./chunk-4QEH5CGK.mjs';import {BoldIcon,ItalicIcon,UnderlineIcon,ArrowUpCircleFilledIcon,AtIcon,XCircleFilledIcon,LinkIcon,XIcon}from'@baseline-ui/icons/20';import {layoutSprinkleValues,sprinkles}from'@baseline-ui/tokens';import mt,{useCallback,useImperativeHandle,useEffect,useRef,useState,useMemo,useLayoutEffect,useId,useContext,Fragment as Fragment$1}from'react';import {useGranularLayoutEffect}from'granular-hooks';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import Hr from'just-camel-case';import {QuestionmarkCircleIcon,TextIcon,HighlightTextIcon}from'@baseline-ui/icons/24';import*as jo from'dompurify';import Qr from'just-kebab-case';import {createPortal}from'react-dom';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var xo="f6jv6bm",bo="_1yep5z64u _1yep5z64v _1yep5z64w _1yep5z676 _1yep5z677 _1yep5z678 _1yep5z6js _1yep5z6jt _1yep5z6ju",Be="_1yep5z689 _1yep5z68a _1yep5z68b _1yep5z65x _1yep5z65y _1yep5z65z",yo=a({defaultClassName:"f6jv6b0 _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6g1",variantClassNames:{isInline:{true:"f6jv6b1"},isMinimal:{true:"_1yep5z6154 _1yep5z6155 _1yep5z6156 _1yep5z6vo _1yep5z6vp _1yep5z6vq _1yep5z615m _1yep5z615n _1yep5z615o",false:"_1yep5z6157 _1yep5z6158 _1yep5z6159"}},defaultVariants:{},compoundVariants:[[{isInline:true,isMinimal:false},"_1yep5z61ir _1yep5z61is _1yep5z61it _1yep5z61jf _1yep5z61jg _1yep5z61jh _1yep5z61k3 _1yep5z61k4 _1yep5z61k5 _1yep5z61kr _1yep5z61ks _1yep5z61kt _1yep5z61u7 _1yep5z61u5 _1yep5z61pa"]]}),ot=a({defaultClassName:"f6jv6b4 _1yep5z69 _1yep5z6a _1yep5z6b _1yep5z62l _1yep5z62m _1yep5z62n _1yep5z63r _1yep5z63s _1yep5z63t _1yep5z61f _1yep5z61g _1yep5z61h _1yep5z6e3 _1yep5z6eu _1yep5z6lq",variantClassNames:{isDisabled:{true:"f6jv6b5 _1yep5z6111"}},defaultVariants:{},compoundVariants:[]}),Eo="f6jv6b6",vo="f6jv6bj _1yep5z6wr _1yep5z6ws _1yep5z6wt _1yep5z6xf _1yep5z6xg _1yep5z6xh _1yep5z6y3 _1yep5z6y4 _1yep5z6y5 _1yep5z6yr _1yep5z6ys _1yep5z6yt",Ro="f6jv6bk";var To="f6jv6bn _1yep5z63l _1yep5z63m _1yep5z63n _1yep5z619 _1yep5z61a _1yep5z61b _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6iv _1yep5z6iw _1yep5z6ix _1yep5z6ly _1yep5z6lt _1yep5z6lr _1yep5z6hx _1yep5z6eu",ko=a({defaultClassName:"f6jv6bg _1yep5z63r _1yep5z63s _1yep5z63t _1yep5z61f _1yep5z61g _1yep5z61h _1yep5z63 _1yep5z64 _1yep5z65 _1yep5z62f _1yep5z62g _1yep5z62h _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j1 _1yep5z6j2 _1yep5z6j3 _1yep5z6jj _1yep5z6jk _1yep5z6jl _1yep5z69l _1yep5z69m _1yep5z69n _1yep5z6lq _1yep5z6la _1yep5z6ld _1yep5z6lp",variantClassNames:{isHovered:{true:"_1yep5z6126"},isDisabled:{true:"_1yep5z6zd"}},defaultVariants:{},compoundVariants:[]}),Co="_1yep5z6jy _1yep5z6jz _1yep5z6k0",Mo="f6jv6bf f6jv6bb _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6ip _1yep5z6iq _1yep5z6ir _1yep5z6eu _1yep5z6e3 _1yep5z6ln",Lo=a({defaultClassName:"f6jv6bc _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j1 _1yep5z6j2 _1yep5z6j3 _1yep5z69l _1yep5z69m _1yep5z69n _1yep5z6k4 _1yep5z6k5 _1yep5z6k6",variantClassNames:{isInline:{true:"_1yep5z6pr _1yep5z6ps _1yep5z6pt _1yep5z6184 _1yep5z6182 _1yep5z6137",false:"_1yep5z6pu _1yep5z6pv _1yep5z6pw _1yep5z6x6 _1yep5z6x7 _1yep5z6x8 _1yep5z6xu _1yep5z6xv _1yep5z6xw _1yep5z6yi _1yep5z6yj _1yep5z6yk _1yep5z6z6 _1yep5z6z7 _1yep5z6z8"}},defaultVariants:{},compoundVariants:[]}),So="f6jv6bl",zo="f6jv6bb _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6ip _1yep5z6iq _1yep5z6ir _1yep5z6eu",_t=a({defaultClassName:"f6jv6b7",variantClassNames:{isInline:{true:"f6jv6b8",false:"f6jv6b9"}},defaultVariants:{},compoundVariants:[]}),It="f6jv6ba _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j1 _1yep5z6j2 _1yep5z6j3 _1yep5z6jj _1yep5z6jk _1yep5z6jl",rt="f6jv6bo";var Nt=mt.forwardRef(({value:t,defaultValue:e,onChange:n,placeholder:o,spellCheck:r,textBoxRef:i,isInline:l,isMinimal:s,isDisabled:a,editableContentAriaLabel:c$1,editorHandle:u,autoFocus:d,saveOnEnter:f,onSave:p},g)=>{let m=mt.useRef(null),[k,L]=a$1(t,e||"",n),K=useCallback(b=>{L(b.currentTarget.value||"");},[L]),C=useCallback(b=>{(f&&b.key==="Enter"&&!b.shiftKey||(b.ctrlKey||b.metaKey)&&b.key==="Enter")&&(b.preventDefault(),p());},[f,p]);useImperativeHandle(g,()=>({clear:()=>{L("");}}));let A=useCallback(b=>{b.currentTarget.style.height="16px",b.currentTarget.style.height=b.currentTarget.scrollHeight+"px";},[]);useGranularLayoutEffect(()=>{let b=m.current;b&&(b.style.height="16px",b.style.height=b.scrollHeight+"px");},[s],[k]),useImperativeHandle(u,()=>({setCaretPosition:b=>{m.current&&(m.current.focus(),m.current.setSelectionRange(b,b));},focus:()=>{m.current&&m.current.focus();}}));let S=d===true||d==="start"||d==="end",M=typeof d=="string"?d:void 0;useEffect(()=>{if(M&&m.current){let b=M==="start"?0:M==="end"?m.current.value.length:void 0;b!==void 0&&m.current.setSelectionRange(b,b);}},[M]);let{focusProps:V,isFocused:W,isFocusVisible:q}=a$2(),{hoverProps:h,isHovered:y}=a$3({}),O=a$4({"data-focus-visible":q,"data-hovered":y,"data-focused":W});return jsx("textarea",{...c(V,h,O),ref:b(m,i),className:a$5({[ot()]:!s,[_t({isInline:l})]:!s,[zo]:!s,[Mo]:s},"BaselineUI-Editor-PlainEditorEditingArea"),autoFocus:S,onChange:K,disabled:a,onInput:A,value:k,placeholder:o,spellCheck:r,"aria-label":c$1,onKeyDown:C})});Nt.displayName="PlainEditor";var Io=[["Toolbar Focus","Alt+F10"],["Bold","Ctrl+B"],["Italic","Ctrl+I"],["Underline","Ctrl+U"],["Select All","Ctrl+A"],["Cut","Ctrl+X"],["Copy","Ctrl+C"],["Paste","Ctrl+V"],["Undo","Ctrl+Z"],["Redo","Ctrl+Shift+Z"],["Submit","Ctrl+Enter"],["Open Help Dialog","Ctrl+Shift+H"]],{dialog:{row:it}}=layoutSprinkleValues,No=({isOpen:t,onClose:e$1,toolbarFocusLabel:n,helpLabel:o,closeLabel:r,actionLabel:i,shortcutLabel:l,boldLabel:s,italicLabel:a,underlineLabel:c,selectAllLabel:u,cutLabel:d,copyLabel:f,pasteLabel:p,undoLabel:g,redoLabel:m,openHelpDialogLabel:k,submitLabel:L})=>{let{formatMessage:K}=b$1(),C=c$3(),A={toolbarFocus:n,help:o,close:r,action:i,shortcut:l,bold:s,italic:a,underline:c,selectAll:u,cut:d,copy:f,paste:p,undo:g,redo:m,openHelpDialog:k,submit:L},S=M=>A[M]??K(Kr[M]);return jsx(b$9,{isOpen:t,onOpenChange:M=>{M||e$1();},children:jsx(e,{enableDrawer:"auto",style:{zIndex:999999},children:jsxs(a$i,{"aria-labelledby":C,className:vo,drawerBackground:"subtle",children:[jsxs(a$9,{paddingLeft:it.padding.horizontal.lg,paddingRight:it.padding.horizontal.sm,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",backgroundColor:"background.primary.subtle",className:Ro,children:[jsx(a$n,{id:C,elementType:"h3",type:"title",size:"md",children:S("help")}),jsx(a$b,{icon:XIcon,size:"md",variant:"secondary","aria-label":S("close"),"data-testid":"editor-help-dialog-close-button",onPress:e$1})]}),jsx(a$a,{className:So}),jsxs(a$9,{paddingX:it.padding.horizontal.lg,role:"table","aria-labelledby":C,backgroundColor:"background.primary.subtle",children:[jsx("div",{role:"rowgroup",children:jsxs(a$9,{role:"row",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingY:it.padding.vertical.md,color:"text.primary",children:[jsx("h6",{className:sprinkles({typography:"heading.h6.semibold"}),role:"columnheader",children:S("action")}),jsx("h6",{className:sprinkles({typography:"heading.h6.semibold"}),role:"columnheader",style:{textTransform:"capitalize"},children:S("shortcut")})]})}),jsx("div",{role:"rowgroup",children:Io.map(([M,V],W)=>jsxs(Fragment$1,{children:[jsxs(a$9,{role:"row",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingY:it.padding.vertical.xs,style:{minHeight:40},children:[jsx(a$n,{type:"subtitle",size:"sm",role:"cell",children:S(Hr(M))}),jsx(a$n,{elementType:"kbd",type:"subtitle",size:"sm",role:"cell",children:a$o(V,true)})]}),W!==Io.length-1&&jsx(a$a,{})]},M))})]})]})})})},Kr=c$1({toolbarFocus:{id:"bui.editor.toolbarFocus",defaultMessage:"Toolbar Focus"},help:{id:"bui.editor.help",defaultMessage:"Help"},close:{id:"bui.editor.close",defaultMessage:"Close"},action:{id:"bui.editor.action",defaultMessage:"Action"},shortcut:{id:"bui.editor.shortcut",defaultMessage:"Shortcut"},bold:{id:"bui.editor.bold",defaultMessage:"Bold"},italic:{id:"bui.editor.italic",defaultMessage:"Italic"},underline:{id:"bui.editor.underline",defaultMessage:"Underline"},selectAll:{id:"bui.editor.selectAll",defaultMessage:"Select All"},cut:{id:"bui.editor.cut",defaultMessage:"Cut"},copy:{id:"bui.editor.copy",defaultMessage:"Copy"},paste:{id:"bui.editor.paste",defaultMessage:"Paste"},undo:{id:"bui.editor.undo",defaultMessage:"Undo"},redo:{id:"bui.editor.redo",defaultMessage:"Redo"},openHelpDialog:{id:"bui.editor.openHelpDialog",defaultMessage:"Open Help Dialog"},submit:{id:"bui.editor.submit",defaultMessage:"Submit"}});var Fr=a$6("#ffffff00").toString("hexa"),an=[{label:"Red",color:"#ff0000"},{label:"Green",color:"#00ff00"},{label:"Blue",color:"#0000ff"},{label:"Yellow",color:"#ffff00"},{label:"Cyan",color:"#00ffff"},{label:"Magenta",color:"#ff00ff"},{label:"Black",color:"#000000"},{label:"White",color:"#ffffff"},{label:"Gray",color:"#808080"},{label:"Orange",color:"#ffa500"},{label:"Brown",color:"#a52a2a"},{label:"Purple",color:"#800080"}];[...an,{label:"Transparent",color:Fr}];var je="p",Z="a",se="mention",ye="mention_input";function cn(t,e){return typeof t=="object"&&t!==null&&"type"in t&&t.type===e}function x(t){return typeof t=="object"&&t!==null&&"text"in t&&!("type"in t)}function T(t){return cn(t,Z)}function ue(t){return cn(t,se)}function fe(t){return cn(t,ye)}function J(t){return ue(t)||fe(t)}function Ke(){return [{type:je,children:[{text:""}]}]}function wt(t,e){return t.bold===e.bold&&t.italic===e.italic&&t.underline===e.underline&&b$a(t.color,e.color)&&b$a(t.backgroundColor,e.backgroundColor)}function At(t,e){let n=false;for(let i=0;i<t.length;i++){let l=t[i];if(l.text===""&&!(e&&t.length===1)){n=true;break}if(i>0&&wt(t[i-1],l)){n=true;break}}if(!n)return t;let o=t.filter(i=>i.text!==""),r=[];for(let i of o){let l=r.at(-1);l!==void 0&&wt(l,i)?r[r.length-1]={...l,text:l.text+i.text}:r.push(i);}return r}function Ur(t){let e=(i,l)=>i===0&&l===t.length||i>0&&J(t[i-1]),n=false,o=-1;for(let i=0;i<=t.length;i++){let l=t[i],s=i<t.length&&x(l);if(s&&o===-1)o=i;else if(!s&&o!==-1){let a=t.slice(o,i);if(At(a,e(o,i))!==a){n=true;break}o=-1;}}if(!n)return t;let r=[];o=-1;for(let i=0;i<=t.length;i++){let l=t[i],s=i<t.length&&x(l);if(s&&o===-1)o=i;else if(!s&&o!==-1){let a=t.slice(o,i),c=At(a,e(o,i));for(let u of c)r.push(u);o=-1;}!s&&i<t.length&&r.push(l);}return r}function Vr(t){let e=false;for(let o=1;o<t.length;o++){let r=t[o-1],i=t[o];if(T(r)&&T(i)&&r.url===i.url){e=true;break}}if(!e)return t;let n=[];for(let o of t){let r=n.at(-1);if(T(o)&&r!==void 0&&T(r)&&r.url===o.url){let i=At([...r.children,...o.children],false);n[n.length-1]={...r,children:i};}else n.push(o);}return n}function Wr(t){let e=At(t.children,t.children.length===1);return e.reduce((o,r)=>o+r.text,"")===""?null:e===t.children?t:{...t,children:e}}function qr(t){let e=false,n=[];for(let a of t)if(T(a)){let c=Wr(a);c===null?e=true:(n.push(c),c!==a&&(e=true));}else n.push(a);let o=e?n:t,r=Ur(o),i=Vr(r),l=(a,c)=>J(a[c])&&(c===a.length-1||!x(a[c+1])),s=i;if(i.some((a,c)=>l(i,c))){s=[];for(let[a,c]of i.entries())s.push(c),l(i,a)&&s.push({text:""});}return s.length===0?[{text:""}]:s===o&&!e?t:s}function D(t){if(t.length===0)return Ke();let e=false,n=t.map(o=>{let r=qr(o.children);return r===o.children?o:(e=true,{...o,children:r})});return e?n:t}function j(t){if(x(t))return t.text.length;switch(t.type){case Z:{let e=0;for(let n=0;n<t.children.length;n++)e+=t.children[n].text.length;return e}case se:return t.displayName.length;case ye:return t.children[0].text.length;default:return t}}function Fe(t){if(t.length===0)return 0;let e=t.length-1;for(let n of t)for(let o of n.children)e+=j(o);return e}var $r=1,un=3;function st(t){return t.nodeType===$r}function Ue(t,e){return t.tagName.toLowerCase()===e}function Gr(t){if(!st(t))return false;let e=t.tagName.toLowerCase();return e==="p"||e==="div"}function Xr(t){return st(t)&&t.querySelector("p, div")!==null}var Yr=new RegExp("["+String.fromCodePoint(8203)+String.fromCodePoint(65279)+"]","g"),Zr=String.fromCodePoint(160);function Me(t){return t.replaceAll(Yr,"").replaceAll(Zr," ")}function Ao(t,e){let n={...e},o=t.tagName.toLowerCase();(o==="b"||o==="strong")&&(n.bold=true),(o==="i"||o==="em")&&(n.italic=true),o==="u"&&(n.underline=true);let r=t.style;if(r){let i=r.fontWeight;(i==="bold"||Number.parseInt(i,10)>=600&&i!=="")&&(n.bold=true),r.fontStyle==="italic"&&(n.italic=true),r.textDecoration?.includes("underline")&&(n.underline=true);let l=r.color;l&&(n.color=l);let s=r.backgroundColor;s&&(n.backgroundColor=s);}return n}function Ot(t,e,n,o){for(let r=0;r<t.childNodes.length;r++){let i=t.childNodes[r];if(i.nodeType===un){let s=i.nodeValue??"",a=Me(s);a.length>0&&o.push(Bo(a,e));continue}if(!st(i))continue;if(Ue(i,"span")&&i.dataset.userId!==void 0){let s=i.dataset.userId??"",a=i.textContent??"",c=a.startsWith("@")?a.slice(1):a;o.push({type:se,value:s,displayName:c,children:[{text:""}]});continue}if(Ue(i,"span")&&i.dataset.mentionAnchor!==void 0){let s=i.textContent??"";o.push({type:ye,children:[{text:s}]});continue}if(Ue(i,"a")){{let s=i.getAttribute("href")??"",a=[];Oo(i,e,a);let c=fn(a);c.some(d=>d.text.length>0)&&o.push({type:Z,url:s,children:c});}continue}if(Ue(i,"br")){o.push({text:"\0BR\0"});continue}let l=Ao(i,e);Ot(i,l,n,o);}}function Oo(t,e,n){for(let o=0;o<t.childNodes.length;o++){let r=t.childNodes[o];if(r.nodeType===un){let l=r.nodeValue??"",s=Me(l);s.length>0&&n.push(Bo(s,e));continue}if(!st(r))continue;if(Ue(r,"br")){n.push({text:"\0BR\0"});continue}let i=Ao(r,e);Oo(r,i,n);}}function Bo(t,e){let n={text:t};return e.bold&&(n.bold=true),e.italic&&(n.italic=true),e.underline&&(n.underline=true),e.color&&(n.color=e.color),e.backgroundColor&&(n.backgroundColor=e.backgroundColor),n}var Ho="\0BR\0";function fn(t){let e=[...t];if(e.length===1&&dn(e[0]))return [{text:""}];let n=e.length,o=0;for(;o<n&&dn(e[n-1-o]);)o+=1;let r=o>=2?o-1:0;n-=o;let i=[];for(let l=0;l<n;l++){let s=e[l];dn(s)?wo(i):i.push(s);}for(let l=0;l<r;l++)wo(i);return i}function dn(t){return "text"in t&&t.text===Ho}function wo(t){let e=t.at(-1);e!==void 0&&"text"in e&&!("type"in e)?e.text+=`
|
|
11
|
+
`:t.push({text:`
|
|
12
|
+
`});}function Jr(t){let e=[];Ot(t,{},false,e);let n=fn(e);return {type:je,children:n.length>0?n:[{text:""}]}}function Bt(t){let e=t.childNodes;if(e.length===0)return Ke();let n=[],o=[];function r(){if(o.length===0)return;let l=fn(o);n.push({type:je,children:l.length>0?l:[{text:""}]}),o=[];}function i(l){for(let s of l)if(Gr(s))r(),n.push(Jr(s));else if(s.nodeType===un){let a=s.nodeValue??"",c=Me(a);c.trim().length>0&&o.push({text:c});}else st(s)&&(Ue(s,"br")?o.push({text:Ho}):Xr(s)?(r(),i(s.childNodes)):Ot(s,{},false,o));}return i(e),r(),n.length===0?Ke():D(n)}function ei(t){return Object.entries(t).map(([e,n])=>`${Qr(e)}:${n}`).filter(([,e])=>!!e).join(";")}function Ko(t){return "text"in t}function lt(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function le(t){let e=t.trim(),n=e.replaceAll(/[\u0000- ]/g,""),o=/^([a-z][a-z0-9+.-]*):/i.exec(n);if(!o)return e;let r=o[1].toLowerCase();return new Set(["javascript","data","vbscript"]).has(r)?"":e}function Fo(t,e){if(!(e.mac?e.metaKey:e.ctrlKey))return {isLinkClick:false,url:null};let o=t?.closest?.("a")??null;if(!o)return {isLinkClick:false,url:null};let r=le(o.getAttribute("href")??"");return {isLinkClick:true,url:r===""?null:r}}function ti(t){return t.text.includes(`
|
|
13
|
+
`)?t.text.split(`
|
|
14
|
+
`).map(n=>{let o={text:n};return n.length>0&&(t.bold!==void 0&&(o.bold=t.bold),t.italic!==void 0&&(o.italic=t.italic),t.underline!==void 0&&(o.underline=t.underline),t.color!==void 0&&(o.color=t.color),t.backgroundColor!==void 0&&(o.backgroundColor=t.backgroundColor)),o}):[t]}function ni(t){let e=[[]],n=0;for(let o of t)if(Ko(o)){let r=ti(o);for(let i=0;i<r.length;i++)e[n].push(r[i]),i<r.length-1&&(n++,e[n]=[]);}else e[n].push(o);return e}function pe(t){if(!t)return "";function e(n){if(Ko(n)){if(n.text==="")return "";let r=lt(n.text);if(n.bold&&(r=`<b>${r}</b>`),n.italic&&(r=`<i>${r}</i>`),n.underline&&(r=`<u>${r}</u>`),n.color||n.backgroundColor){let i=ei(a$4({color:n.color||void 0,backgroundColor:n.backgroundColor||void 0}));r=`<span style="${lt(i)}">${r}</span>`;}return r}let o=n.children?.map(r=>pe(r)).join("");switch(n.type){case je:return ni(n.children).map(i=>`<p>${i.map(s=>pe(s)).join("")}</p>`).join("");case Z:return `<a href="${lt(le(n.url))}">${o}</a>`;case se:return `<span data-user-id="${lt(n.value)}">${lt(n.displayName)}</span>`;default:return o}}return Array.isArray(t)?t.map(n=>e(n)).join(""):e(t)}function pn(t){let e=new DOMParser().parseFromString(jo.default.sanitize(t),"text/html");if(!e.body.querySelector("p, div")){let n=e.createElement("p");n.append(...e.body.childNodes),e.body.append(n);}return Bt(e.body)}var oi=new Set(["(","[","{","<",'"',"'","`","\xAB"]),ri=new Set([".",",","!","?",":",";",'"',"'","`","\xBB"]),ii=new Map([[")","("],["]","["],["}","{"]]);function Uo(t,e){let n=0;for(let o of t)o===e&&n++;return n}function Ht(t){let e=0,n=t.length;for(;e<n&&oi.has(t[e]);)e++;for(;n>e;){let l=t[n-1];if(ri.has(l)){n--;continue}let s=ii.get(l);if(s!==void 0){let a=t.slice(e,n);if(Uo(a,l)>Uo(a,s)){n--;continue}}break}if(n<=e)return null;let o=t.slice(e,n),r;if(/^https?:\/\//i.test(o))r=o;else if(/^www\./i.test(o)){if(o.length<=4)return null;r=`https://${o}`;}else return null;let i;try{i=new URL(r);}catch{return null}return i.hostname===""?null:{start:e,end:n,url:r}}function si(t){let e=[],n=/\S+/g,o;for(;(o=n.exec(t))!==null;){let r=Ht(o[0]);if(r){let i=o.index+r.start,l=o.index+r.end;e.push({start:i,end:l,text:t.slice(i,l),url:r.url});}}return e}function Vo(t){let e=t.trim();if(e===""||/\s/.test(e))return null;let n=Ht(e);return n&&n.start===0&&n.end===e.length?n.url:null}function li(t){let e=si(t.text);if(e.length===0)return null;let n=[],o=0;for(let r of e)r.start>o&&n.push({...t,text:t.text.slice(o,r.start)}),n.push({type:Z,url:r.url,children:[{...t,text:r.text}]}),o=r.end;return o<t.text.length&&n.push({...t,text:t.text.slice(o)}),n}function hn(t){let e=false,n=t.map(o=>{let r=false,i=[];for(let l of o.children){let s=x(l)?li(l):null;s?(i.push(...s),r=true):i.push(l);}return r?(e=true,{...o,children:i}):o});return e?n:t}function Wo(t){return ue(t)?0:j(t)}function qo(t){return t.children.reduce((e,n)=>e+j(n),0)}function mn(t,e,n){return Math.min(Math.max(t,e),n)}function Ee(t,e){return t.path[0]!==e.path[0]?t.path[0]<e.path[0]?-1:1:t.path[1]!==e.path[1]?t.path[1]<e.path[1]?-1:1:t.offset!==e.offset?t.offset<e.offset?-1:1:0}function I(t){return Ee(t.anchor,t.focus)===0}function gn(t){return Ee(t.anchor,t.focus)<=0?t:{anchor:t.focus,focus:t.anchor}}function te(t,e){let n=mn(e.path[0],0,t.length-1),o=t[n].children,r=mn(e.path[1],0,o.length-1),i=mn(e.offset,0,Wo(o[r]));return {path:[n,r],offset:i}}function Ve(t){let e=t.length-1,n=t[e].children,o=n.length-1;return {path:[e,o],offset:Wo(n[o])}}function _(t,e){let n=Math.max(e,0);for(let o=0;o<t.length;o++){let r=t[o],i=qo(r);if(n>i){n-=i+1;continue}let l=r.children;for(let s=0;s<l.length;s++){let a=l[s],c=j(a);if(ue(a)){if(n===0)return {path:[o,s],offset:0};if(n<c)return {path:[o,s+1],offset:0}}else if(n<=c)return {path:[o,s],offset:n};n-=c;}}return Ve(t)}function z(t,e){let[n,o]=e.path,r=0;for(let l=0;l<n;l++)r+=qo(t[l])+1;let i=t[n].children;for(let l=0;l<o;l++)r+=j(i[l]);return r+e.offset}function ve(t,e,n,o,r){let i=n==="atomic";if(t<o.path[0]||t>r.path[0])return null;let l=0;if(t===o.path[0]){if(e<o.path[1])return null;e===o.path[1]&&(l=i?0:o.offset);}let s=i?1:n;if(t===r.path[0]){if(e>r.path[1])return null;e===r.path[1]&&(s=i?r.offset>0?1:0:r.offset);}return l>=s?null:{from:l,to:s}}function xn(t,e,n){let o=0;for(let r of t.children)n(r,Math.max(e.from-o,0),Math.min(e.to-o,r.text.length)),o+=r.text.length;}function Go(t,e,n,o){for(let r=e.path[0];r<=n.path[0]&&r<t.length;r++){let i=t[r].children;for(let[l,s]of i.entries())if(!J(s)){if(x(s)){let a=ve(r,l,s.text.length,e,n);a&&o(s,a.from,a.to);}else if(T(s)){let a=ve(r,l,j(s),e,n);a&&xn(s,a,(c,u,d)=>{u<d&&o(c,u,d);});}}}}function Xo(t){return x(t)?t:T(t)?t.children.at(-1)??null:null}function Yo(t,e){let n=te(t,e),o=t[n.path[0]].children,r=o[n.path[1]],i=n.path[1]>0?Xo(o[n.path[1]-1]):null;if(x(r))return n.offset>0?r:i??r;if(T(r)){if(n.offset===0)return i??r.children[0]??null;let l=0;for(let s of r.children)if(l+=s.text.length,n.offset<=l)return s;return r.children.at(-1)??null}return fe(r)?n.offset>0?r.children[0]:i??r.children[0]:i}function $o(t){let e={};return t.bold&&(e.bold=true),t.italic&&(e.italic=true),t.underline&&(e.underline=true),t.color!==void 0&&(e.color=t.color),t.backgroundColor!==void 0&&(e.backgroundColor=t.backgroundColor),e}function ai(t,e){let n={};return t.bold&&e.bold&&(n.bold=true),t.italic&&e.italic&&(n.italic=true),t.underline&&e.underline&&(n.underline=true),t.color!==void 0&&b$a(t.color,e.color)&&(n.color=t.color),t.backgroundColor!==void 0&&b$a(t.backgroundColor,e.backgroundColor)&&(n.backgroundColor=t.backgroundColor),n}function Se(t,e){if(I(e)){let l=Yo(t,e.focus);return l?$o(l):{}}let n=gn(e),o=te(t,n.anchor),r=te(t,n.focus),i=null;return Go(t,o,r,l=>{let s=$o(l);i=i===null?s:ai(i,s);}),i??{}}function jt(t,e,n){if(n===t)return {doc:t,range:e};let o=D(n);return {doc:o,range:{anchor:_(o,z(t,te(t,e.anchor))),focus:_(o,z(t,te(t,e.focus)))}}}function Zo(t,e,n,o){let r={...t,text:t.text.slice(e,n)},i=o(r);if(wt(i,r))return null;let l=[];return e>0&&l.push({...t,text:t.text.slice(0,e)}),l.push(i),n<t.text.length&&l.push({...t,text:t.text.slice(n)}),l}function ci(t,e,n){let o=false,r=[];return xn(t,e,(i,l,s)=>{let a=l<s?Zo(i,l,s,n):null;a?(r.push(...a),o=true):r.push(i);}),o?{...t,children:r}:null}function Jo(t,e,n,o){let r=false,i=t.map((l,s)=>{if(s<e.path[0]||s>n.path[0])return l;let a=false,c=[];for(let[u,d]of l.children.entries())if(x(d)){let f=ve(s,u,d.text.length,e,n),p=f?Zo(d,f.from,f.to,o):null;p?(c.push(...p),a=true):c.push(d);}else if(T(d)){let f=ve(s,u,j(d),e,n),p=f?ci(d,f,o):null;p?(c.push(p),a=true):c.push(d);}else c.push(d);return a?(r=true,{...l,children:c}):l});return r?i:t}function We(t,e){let n=gn(e);return [te(t,n.anchor),te(t,n.focus)]}function bn(t,e,n){if(I(e))return {doc:t,range:e};let[o,r]=We(t,e),i=false,l=true;return Go(t,o,r,a=>{i=true,a[n]||(l=false);}),i?jt(t,e,Jo(t,o,r,l?a=>{let c={...a};return delete c[n],c}:a=>a[n]?a:{...a,[n]:true})):{doc:t,range:e}}function yn(t,e,n,o){if(I(e))return {doc:t,range:e};let[r,i]=We(t,e);return jt(t,e,Jo(t,r,i,s=>{if(s[n]===o)return s;let a={...s};return o===void 0?delete a[n]:a[n]=o,a}))}function Qo(t,e){let n=[],o=[],r=0;for(let i of t){let l=r+i.text.length;l<=e?n.push(i):r>=e?o.push(i):(n.push({...i,text:i.text.slice(0,e-r)}),o.push({...i,text:i.text.slice(e-r)})),r=l;}return [n,o]}function Le(t,e,n){if(e>=t.length)return [[...t],[]];let o=t.slice(0,e),r=t.slice(e+1),i=t[e];if(x(i))o.push({...i,text:i.text.slice(0,n)}),r.unshift({...i,text:i.text.slice(n)});else if(T(i)){let[l,s]=Qo(i.children,n);o.push({...i,children:l}),r.unshift({...i,children:s});}else n===0?r.unshift(i):o.push(i);return [o,r]}function En(t,e){let[n,o]=We(t,e);for(let r=n.path[0];r<=o.path[0]&&r<t.length;r++)for(let[i,l]of t[r].children.entries()){if(!T(l))continue;let s={path:[r,i],offset:0},a={path:[r,i],offset:j(l)};if(Ee(n,a)<=0&&Ee(o,s)>=0)return {paragraphIndex:r,inlineIndex:i,link:l}}return null}function er(t,e){let n=En(t,e);if(!n)return null;let{paragraphIndex:o,inlineIndex:r,link:i}=n;return {url:i.url,range:{anchor:{path:[o,r],offset:0},focus:{path:[o,r],offset:j(i)}}}}function tr(t,e){let[n,o]=We(t,e);for(let r=n.path[0];r<=o.path[0]&&r<t.length;r++)for(let[i,l]of t[r].children.entries()){if(x(l))continue;let s=J(l)?"atomic":j(l);if(ve(r,i,s,n,o))return true}return false}function di(t,e,n,o){let r=[],i=(l,s,a)=>{s<a&&r.push({...l,text:l.text.slice(s,a)});};for(let[l,s]of t[e].children.entries())if(!J(s)){if(x(s)){let a=ve(e,l,s.text.length,n,o);a&&i(s,a.from,a.to);}else if(T(s)){let a=ve(e,l,j(s),n,o);a&&xn(s,a,i);}}return r}function vn(t,e,n){if(I(e))return {doc:t,range:e};let[o,r]=We(t,e);for(let s=o.path[0];s<=r.path[0]&&s<t.length;s++)for(let[a,c]of t[s].children.entries())if(J(c)&&ve(s,a,"atomic",o,r))return {doc:t,range:e};let i=false,l=t.map((s,a)=>{if(a<o.path[0]||a>r.path[0])return s;let c=di(t,a,o,r);if(c.length===0)return s;let u=s.children,[d]=a===o.path[0]?Le(u,o.path[1],o.offset):[[]],f=a===r.path[0]?Le(u,r.path[1],r.offset)[1]:[];return i=true,{...s,children:[...d,{type:Z,url:n,children:c},...f]}});return i?jt(t,e,l):{doc:t,range:e}}function nr(t,e,n){let o=En(t,e);if(!o||o.link.url===n)return {doc:t,range:e};let{paragraphIndex:r,inlineIndex:i,link:l}=o,s=t.map((a,c)=>c!==r?a:{...a,children:a.children.map((u,d)=>d===i?{...l,url:n}:u)});return {doc:D(s),range:e}}function or(t,e){let n=En(t,e);if(!n)return {doc:t,range:e};let{paragraphIndex:o,inlineIndex:r,link:i}=n,l=t.map((s,a)=>a!==o?s:{...s,children:s.children.flatMap((c,u)=>u===r?i.children:[c])});return jt(t,e,l)}function qe(t,e){if(I(e))return {doc:t,range:e};let[n,o]=We(t,e);if(Ee(n,o)===0)return {doc:t,range:e};let r=z(t,n),i=Le(t[n.path[0]].children,n.path[1],n.offset)[0],l=Le(t[o.path[0]].children,o.path[1],o.offset)[1],s={...t[n.path[0]],children:[...i,...l]},a=D([...t.slice(0,n.path[0]),s,...t.slice(o.path[0]+1)]),c=_(a,r);return {doc:a,range:{anchor:c,focus:c}}}function at(t,e,n){let o=te(t,e);if(n==="")return {doc:t,range:{anchor:o,focus:o}};let r=Yo(t,o),i=r?{...r,text:n}:{text:n},l=o.path[0],s=t[l].children,a=s[o.path[1]],c;if(T(a)&&o.offset>0&&o.offset<j(a)){let[f,p]=Qo(a.children,o.offset),g={...a,children:[...f,i,...p]};c=s.map((m,k)=>k===o.path[1]?g:m);}else {let[f,p]=Le(s,o.path[1],o.offset);c=[...f,i,...p];}let u=D(t.map((f,p)=>p===l?{...f,children:c}:f)),d=_(u,z(t,o)+n.length);return {doc:u,range:{anchor:d,focus:d}}}function rr(t,e,n){let o=D(n),r=Fe(o),i=t,l;if(I(e))l=te(t,e.focus);else {let p=qe(t,e);i=p.doc,l=p.range.focus;}if(o.length===1&&r===0)return {doc:i,range:{anchor:l,focus:l}};let s=l.path[0],[a,c]=Le(i[s].children,l.path[1],l.offset),u=o.length===1?[{...i[s],children:[...a,...o[0].children,...c]}]:[{...i[s],children:[...a,...o[0].children]},...o.slice(1,-1),{...o.at(-1),children:[...o.at(-1).children,...c]}],d=D([...i.slice(0,s),...u,...i.slice(s+1)]),f=_(d,z(i,l)+r);return {doc:d,range:{anchor:f,focus:f}}}function ir(t,e){if(I(e))return at(t,e.focus,`
|
|
15
|
+
`);let n=qe(t,e);return at(n.doc,n.range.focus,`
|
|
16
|
+
`)}function sr(t,e){for(let[n,o]of t.entries()){let r=o.children.indexOf(e);if(r!==-1)return [n,r]}return null}function lr(t){for(let[e,n]of t.entries())for(let[o,r]of n.children.entries())if(fe(r))return [e,o];return null}function ar(t){let e=Ve(t);return {anchor:e,focus:e}}function cr(t,e){let n=t,o;if(I(e))o=te(t,e.focus);else {let d=qe(t,e);n=d.doc,o=d.range.focus;}let r={type:ye,children:[{text:""}]},i=o.path[0],[l,s]=Le(n[i].children,o.path[1],o.offset),a=D(n.map((d,f)=>f===i?{...d,children:[...l,r,...s]}:d)),u={path:sr(a,r)??[0,0],offset:0};return {doc:a,range:{anchor:u,focus:u}}}function dr(t,e){let n=lr(t);if(!n)return {doc:t,range:ar(t)};let[o,r]=n,i={type:se,value:e.id,displayName:e.displayName,children:[{text:""}]},l=D(t.map((u,d)=>d===o?{...u,children:u.children.map((f,p)=>p===r?i:f)}:u)),[s,a]=sr(l,i)??[o,r],c={path:[s,a+1],offset:0};return {doc:l,range:{anchor:c,focus:c}}}function ur(t,e){let n=lr(t);if(!n)return {doc:t,range:ar(t)};let[o,r]=n,i=t[o].children,l=r>0?Xo(i[r-1]):null,s=l?{...l,text:e}:{text:e},a=z(t,{path:[o,r],offset:0})+e.length,c=D(t.map((d,f)=>f===o?{...d,children:i.map((p,g)=>g===r?s:p)}:d)),u=_(c,a);return {doc:c,range:{anchor:u,focus:u}}}function ui(t){let e=[];return t.color&&e.push(`color:${t.color}`),t.backgroundColor&&e.push(`background-color:${t.backgroundColor}`),e.join(";")}function fi(t){for(let e of t.children)if(J(e)||T(e)&&e.children.map(o=>o.text).join("").length>0||x(e)&&e.text.length>0)return false;return true}function fr(t,e,n,o){if(n.text==="")return;let r=n.text.split(`
|
|
17
|
+
`);for(let i=0;i<r.length;i++){let l=r[i],s=i===r.length-1;if(l.length>0){let c=t.createTextNode(l);if(n.underline){let d=t.createElement("u");d.append(c),c=d;}if(n.italic){let d=t.createElement("i");d.append(c),c=d;}if(n.bold){let d=t.createElement("b");d.append(c),c=d;}let u=ui(n);if(u){let d=t.createElement("span");d.setAttribute("style",u),d.append(c),c=d;}e.append(c);}(!s||l===""&&r.length>1&&o)&&e.append(t.createElement("br"));}}function pi(t,e,n,o){if(x(n)){fr(t,e,n,o);return}switch(n.type){case Z:{let r=t.createElement("a");r.setAttribute("href",le(n.url)),r.className=a$r({size:"sm",variant:"inline"});for(let i of n.children)fr(t,r,i,false);e.append(r);break}case se:{let r=t.createElement("span");r.setAttribute("contenteditable","false"),r.dataset.userId=n.value,r.textContent=`@${n.displayName}`,e.append(r);break}case ye:{let r=t.createElement("span");r.setAttribute("contenteditable","false"),r.dataset.mentionAnchor="true",r.textContent=n.children[0].text,e.append(r);break}}}function Rn(t){return x(t)?t.text!=="":T(t)?t.children.some(e=>e.text!==""):true}function hi(t,e){let n=t.createElement("p");if(fi(e))return n.append(t.createElement("br")),n;let o=-1;for(let r=e.children.length-1;r>=0;r--)if(Rn(e.children[r])){o=r;break}for(let[r,i]of e.children.entries())pi(t,n,i,r===o);return n}function ct(t,e){let n=e.ownerDocument,o=n.createDocumentFragment();for(let r of t)o.append(hi(n,r));e.replaceChildren(o);}var mi=1,gi=3,xi=11;function ne(t){return t.nodeType===mi}function hr(t){return t.nodeType===xi&&"host"in t}function Ft(t){return t.nodeType===gi}function dt(t,e){return t.tagName.toLowerCase()===e}function bi(t){return dt(t,"span")?t.getAttribute("contenteditable")==="false":false}function yi(t,e,n,o,r){if(o===t){let s=t.childNodes,a=Math.min(r,s.length);return a===0?{found:true,point:{path:[n,0],offset:0}}:Ei(e,n,a)}let i=t.childNodes,l=0;for(let s=0;s<e.children.length;s++){let a=e.children[s];if(x(a)){let c=Ut(e.children,s),u=gr(a.text,i,l,n,s,o,r,c);if(u.found)return u;l+=ze(a.text,c);}else if(T(a)){if(l>=i.length)continue;let c=i[l];if(!ne(c)||!dt(c,"a")){l++;continue}let u=vi(a,c,n,s,o,r);if(u.found)return u;l++;}else if(ue(a)||fe(a)){if(l>=i.length)continue;let c=i[l];if(!ne(c)||!bi(c)){l++;continue}if(o===c||(ne(o)||Ft(o))&&e$1(c,o))return {found:true,point:{path:[n,s+1],offset:0}};l++;}}return {found:false}}function Ei(t,e,n){let o=0;for(let l=0;l<t.children.length;l++){let s=t.children[l],a=x(s)?ze(s.text,Ut(t.children,l)):1;if(o+a>=n){if(x(s))return {found:true,point:{path:[e,l],offset:mr(s.text,n-o)}};if(J(s))return {found:true,point:{path:[e,l+1],offset:0}};{let c=s.children.reduce((u,d)=>u+d.text.length,0);return {found:true,point:{path:[e,l],offset:c}}}}o+=a;}let r=t.children.length-1,i=t.children[r];if(x(i))return {found:true,point:{path:[e,r],offset:i.text.length}};if(J(i))return {found:true,point:{path:[e,r+1],offset:0}};if(T(i)){let l=i.children.reduce((s,a)=>s+a.text.length,0);return {found:true,point:{path:[e,r],offset:l}}}return {found:false}}function Ut(t,e){for(let n=e+1;n<t.length;n++)if(Rn(t[n]))return false;return true}function ze(t,e){if(t==="")return 0;let n=t.split(`
|
|
18
|
+
`),o=0;for(let r=0;r<n.length;r++)n[r].length>0&&o++,r<n.length-1&&o++;return e&&t.endsWith(`
|
|
19
|
+
`)&&o++,o}function mr(t,e){if(t==="")return 0;let n=t.split(`
|
|
20
|
+
`),o=0,r=0;for(let i=0;i<n.length&&!(o>=e);i++){if(n[i].length>0){if(o+1>=e){r+=n[i].length,o++;break}r+=n[i].length,o++;}if(i<n.length-1){if(o+1>=e){r++,o++;break}r++,o++;}}return t.endsWith(`
|
|
21
|
+
`)&&o<e&&(r=t.length),Math.min(r,t.length)}function gr(t,e,n,o,r,i,l,s=false){if(t==="")return {found:false};let a=t.split(`
|
|
22
|
+
`),c=n,u=0;for(let d=0;d<a.length;d++){let f=a[d],p=d===a.length-1;if(f.length>0&&c<e.length){let g=e[c],m=Vt(g);if(m!==null){if(i===m){let k=Math.min(l,f.length);return {found:true,point:{path:[o,r],offset:u+k}}}if(ne(i)&&e$1(i,m))return {found:true,point:{path:[o,r],offset:u+(l===0?0:f.length)}}}u+=f.length,c++;}if(p){if(p&&s&&t.endsWith(`
|
|
23
|
+
`)&&f===""&&c<e.length){let g=e[c];if(ne(g)&&dt(g,"br")&&i===g)return {found:true,point:{path:[o,r],offset:u}};c++;}}else if(c<e.length){let g=e[c];if(ne(g)&&dt(g,"br")&&i===g)return {found:true,point:{path:[o,r],offset:u+(l===0?0:1)}};u++,c++;}}return {found:false}}function vi(t,e,n,o,r,i){if(!ne(e))return {found:false};if(r===e){let c=e.childNodes,u=Math.min(i,c.length),d=0,f=0,p=0;for(let g of t.children){let m=ze(g.text,false);if(p+m>=u){f=d+mr(g.text,u-p);break}d+=g.text.length,p+=m;}return p>=t.children.reduce((g,m)=>g+ze(m.text,false),0)&&(f=t.children.reduce((g,m)=>g+m.text.length,0)),{found:true,point:{path:[n,o],offset:f}}}if(!e$1(e,r))return {found:false};let l=e.childNodes,s=0,a=0;for(let c of t.children){let u=gr(c.text,l,a,n,o,r,i);if(u.found)return {found:true,point:{path:[n,o],offset:s+u.point.offset}};s+=c.text.length,a+=ze(c.text,false);}return {found:false}}function Vt(t){if(Ft(t))return t;if(ne(t)){let e=t;for(;ne(e)&&e.childNodes.length===1;){let n=e.childNodes[0];if(Ft(n))return n;if(ne(n))e=n;else break}}return null}function Kt(t,e,n,o){try{if(n!==t&&!e$1(t,n)||e.length===0)return null;if(n===t){let i=Math.min(o,t.childNodes.length);if(i===0)return {path:[0,0],offset:0};let l=Math.min(i,e.length)-1,s=e[l];if(!s)return null;let a=s.children.length-1,c=s.children[a];if(!c)return null;let u=x(c)?c.text.length:T(c)?c.children.reduce((d,f)=>d+f.text.length,0):0;return {path:[l,a],offset:u}}let r=t.children;for(let i=0;i<e.length;i++){let l=r[i];if(!l)return null;let s=e[i];if(n!==l&&!e$1(l,n))continue;let a=yi(l,s,i,n,o);return a.found?a.point:null}return null}catch{return null}}function pr(t,e,n){try{let[o,r]=n.path,i=n.offset;if(o<0||o>=e.length)return null;let l=e[o];if(r<0||r>=l.children.length)return null;let s=l.children[r],a=t.children[o];if(!a)return null;let c=a.childNodes,u=0;for(let d=0;d<r;d++){let f=l.children[d];x(f)?u+=ze(f.text,Ut(l.children,d)):u++;}if(x(s))return xr(s.text,i,c,u,a,Ut(l.children,r));if(T(s)){if(u>=c.length)return null;let d=c[u];return !ne(d)||!dt(d,"a")?null:Ri(s,i,d)}else if(ue(s)||fe(s)){let d=u+1;if(d<c.length){let f=c[d];if(Ft(f))return {node:f,offset:0}}return {node:a,offset:Math.min(d,a.childNodes.length)}}return null}catch{return null}}function xr(t,e,n,o,r,i=false){if(t==="")return {node:r,offset:o};let l=t.split(`
|
|
24
|
+
`),s=o,a=0;for(let c=0;c<l.length;c++){let u=l[c],d=c===l.length-1;if(u.length>0&&s<n.length){let f=n[s];if(e>=a&&e<=a+u.length){let p=Vt(f);return p!==null?{node:p,offset:e-a}:{node:r,offset:s}}a+=u.length,s++;}if(d){if(d&&t.endsWith(`
|
|
25
|
+
`)&&u===""&&s<=n.length){if(e===a)return {node:r,offset:Math.min(s,r.childNodes.length)};i&&s++;}}else if(s<n.length){if(e===a)return {node:r,offset:s};a++,s++;}}if(s>o&&s-1<n.length){let c=n[s-1],u=Vt(c);return u!==null?{node:u,offset:u.length}:{node:r,offset:s}}return {node:r,offset:Math.min(s,r.childNodes.length)}}function Ri(t,e,n){let o=n.childNodes,r=0,i=0;for(let l of t.children){let s=l.text.length;if(e<=r+s)return xr(l.text,e-r,o,i,n);r+=s,i+=ze(l.text,false);}if(o.length>0){let l=n.lastChild,s=l===null?null:Vt(l);return s!==null?{node:s,offset:s.length}:{node:n,offset:o.length}}return {node:n,offset:0}}function Wt(t){let e=t.getRootNode();if(typeof e.getSelection=="function")return e.getSelection();let n=t.ownerDocument;if(!n)return null;let o=n.defaultView;return o?o.getSelection():null}function Ti(t,e){let n=t.getComposedRanges;if(typeof n!="function")return null;let o;try{o=n.call(t,{shadowRoots:[e]});}catch{try{o=n.call(t,e);}catch{return null}}let r=o?.[0];return r?{startContainer:r.startContainer,startOffset:r.startOffset,endContainer:r.endContainer,endOffset:r.endOffset}:null}function Tn(t,e){let n=e.rangeCount>0?e.getRangeAt(0):null,o=n?{startContainer:n.startContainer,startOffset:n.startOffset,endContainer:n.endContainer,endOffset:n.endOffset}:null;if(o&&e$1(t,o.startContainer))return o;let r=t.getRootNode();if(hr(r)){let i=Ti(e,r);if(i&&e$1(t,i.startContainer))return i}return o}function qt(t,e){try{let n=Wt(t);if(!n)return null;let{anchorNode:o,focusNode:r}=n;if(o&&r&&e$1(t,o)&&e$1(t,r)){let a=Kt(t,e,o,n.anchorOffset),c=Kt(t,e,r,n.focusOffset);if(a!==null&&c!==null)return {anchor:a,focus:c}}let i=Tn(t,n);if(!i)return null;let l=Kt(t,e,i.startContainer,i.startOffset);if(l===null)return null;let s=Kt(t,e,i.endContainer,i.endOffset);return s===null?null:{anchor:l,focus:s}}catch{return null}}function Pe(t,e,n){try{let o=pr(t,e,n.anchor);if(o===null)return;let r=pr(t,e,n.focus);if(r===null)return;let i=t.ownerDocument;if(!i)return;let l=Wt(t);if(!l)return;if(Ee(n.anchor,n.focus)>0||hr(t.getRootNode())){l.setBaseAndExtent(o.node,o.offset,r.node,r.offset);return}let a=i.createRange();a.setStart(o.node,o.offset),a.setEnd(r.node,r.offset),l.removeAllRanges(),l.addRange(a);}catch{}}var br="typing";var $t=class{undoStack=[];redoStack=[];now;maxDepth;lastKind=null;lastTime=null;constructor(e={}){this.now=e.now??Date.now,this.maxDepth=e.maxDepth??100;}record(e,n){let o=this.now();this.redoStack.length>0&&(this.redoStack=[]);let r=n===br&&this.lastKind===br&&this.lastTime!==null&&o-this.lastTime<=1e3;this.lastKind=n,this.lastTime=o,!r&&(this.undoStack.push(e),this.undoStack.length>this.maxDepth&&this.undoStack.shift());}undo(e){let n=this.undoStack.pop();return n?(this.redoStack.push(e),this.lastKind=null,this.lastTime=null,n):null}redo(e){let n=this.redoStack.pop();return n?(this.undoStack.push(e),this.lastKind=null,this.lastTime=null,n):null}clear(){this.undoStack=[],this.redoStack=[],this.lastKind=null,this.lastTime=null;}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}};var ki=1,ut=class t{doc=Ke();lastKnownHtml="";lastAppliedValue=null;cachedRange=null;needsSelectionRestore=false;composing=false;pending=null;preservePendingSelectionChanges=0;history=new $t;opts;el=null;pendingExternalRender=null;keyboardShortcutsOverride=void 0;constructor(e={}){this.opts=e,this.lastKnownHtml=pe(this.doc);}setKeyboardShortcutsEnabled(e){this.keyboardShortcutsOverride=e;}attach(e){this.el=e,ct(this.doc,e),this.cachedRange&&Pe(e,this.doc,this.cachedRange);let n=this.handleBeforeInputBound,o=this.handleInputBound,r=this.handlePasteBound,i=this.handleCompositionStartBound,l=this.handleCompositionEndBound,s=this.handleSelectionChangeBound,a=this.handlePointerDownBound,c=this.handleFocusBound,u=e.ownerDocument;return e.addEventListener("beforeinput",n),e.addEventListener("input",o),e.addEventListener("paste",r),e.addEventListener("compositionstart",i),e.addEventListener("compositionend",l),e.addEventListener("pointerdown",a),e.addEventListener("focus",c),u.addEventListener("selectionchange",s),()=>{e.removeEventListener("beforeinput",n),e.removeEventListener("input",o),e.removeEventListener("paste",r),e.removeEventListener("compositionstart",i),e.removeEventListener("compositionend",l),e.removeEventListener("pointerdown",a),e.removeEventListener("focus",c),u.removeEventListener("selectionchange",s),this.el===e&&(this.el=null);}}handleBeforeInputBound=e=>{let n=e;if(g(n)===this.el){if(this.opts.isReadOnly?.()){n.preventDefault();return}this.refreshSelectionFromDom(),this.handleBeforeInput(n);}};handleInputBound=e=>{g(e)===this.el&&(this.composing||this.syncFromDom());};handlePasteBound=e=>{let n=e,o=g(n);!o||!e$1(this.el,o)||(o.nodeType===ki?o:o.parentElement)?.closest('input, [contenteditable="false"]')||(n.preventDefault(),!this.opts.isReadOnly?.()&&(this.composing||(this.refreshSelectionFromDom(),this.insertPastedData(n.clipboardData))));};handlePointerDownBound=()=>{this.preservePendingSelectionChanges=0,this.needsSelectionRestore=false;};handleFocusBound=()=>{this.needsSelectionRestore&&(this.needsSelectionRestore=false,!(!this.el||!this.cachedRange)&&Pe(this.el,this.doc,this.cachedRange));};handleCompositionStartBound=()=>{this.composing=true;};handleCompositionEndBound=()=>{if(this.composing=false,this.pendingExternalRender){let e=this.pendingExternalRender;this.pendingExternalRender=null,e();return}this.syncFromDom();};handleSelectionChangeBound=()=>{this.el&&this.handleSelectionChange();};refreshSelectionFromDom(){if(!this.el)return;let e=qt(this.el,this.doc);e&&(this.cachedRange=e);}getDoc(){return this.doc}getValue(){return pe(this.doc)}setValue(e,n={}){if(e===this.lastKnownHtml||e===this.lastAppliedValue)return;let o,r;try{o=D(pn(e)),r=pe(o);}catch(a){process.env.NODE_ENV!=="production"&&console.error("[Editor] setValue failed to parse value:",a);return}let i=this.cachedRange?z(this.doc,this.cachedRange.anchor):null,l=t.docHasMentionInput(this.doc);this.doc=o,this.lastKnownHtml=r,this.lastAppliedValue=e,this.pending=null,this.history.clear();let s=()=>{if(this.el&&(ct(o,this.el),i!==null)){let a=Math.min(i,Fe(o)),c=_(o,a),u={anchor:c,focus:c};this.cachedRange=u,this.hasFocus()?Pe(this.el,o,u):(this.needsSelectionRestore=true,n.emit||this.emitSelectionChange());}};this.el&&(this.composing?this.pendingExternalRender=s:s()),l&&!t.docHasMentionInput(o)&&this.opts.onMentionInputRemoved?.(),n.emit&&(this.opts.onChange?.(r),this.emitSelectionChange());}static docHasMentionInput(e){return e.some(n=>n.children.some(o=>fe(o)))}exec(e,...n){this.refreshSelectionFromDom();let o=this.cachedRange,r=this.doc,i=o??this.collapsedAtDocEnd(),l={doc:r,range:o},s;try{s=this.dispatchCommand(e,n);}catch(a){process.env.NODE_ENV!=="production"&&console.error(`[Editor] command "${e}" threw:`,a);return}if(s.doc===r){if(e==="toggleMark"&&I(i)){let[a]=n;this.setPendingMark(a,i),this.emitSelectionChange();return}if(e==="setMarkValue"&&I(i)){let[a,c]=n;this.setPendingColorMark(a,c,i),this.emitSelectionChange();return}this.pending=null;return}if(this.pending=null,e==="insertSoftBreak"){let a=this.mergePendingMarks(Se(r,i));if(Object.keys(a).length>0){let c=z(s.doc,s.range.anchor);this.pending={marks:a,caretOffset:c},this.preservePendingSelectionChanges=10;}}this.history.record(l,e),this.applyDocChange(s.doc,s.range,true);}undo(){if(!this.history.canUndo)return;let e={doc:this.doc,range:this.cachedRange},n=this.history.undo(e);n&&(this.pending=null,this.applyDocChange(n.doc,n.range,true));}redo(){if(!this.history.canRedo)return;let e={doc:this.doc,range:this.cachedRange},n=this.history.redo(e);n&&(this.pending=null,this.applyDocChange(n.doc,n.range,true));}canUndo(){return this.history.canUndo}canRedo(){return this.history.canRedo}focus(){this.el?.focus();}hasFocus(){return this.el?e$1(this.el,f$1(this.el)):false}setCaretPosition(e){if(!this.el)return;let n=_(this.doc,e);this.select({anchor:n,focus:n});}select(e){this.el&&(this.el.focus(),this.cachedRange=e,Pe(this.el,this.doc,e));}selectStart(){this.setCaretPosition(0);}selectEnd(){let e=Ve(this.doc);this.select({anchor:e,focus:e});}getSelectionState(){return this.buildSelectionState(this.cachedRange)}buildSelectionState(e){let n=e?Se(this.doc,e):{},o=this.mergePendingMarks(n),r=e?er(this.doc,e):null;return {marks:o,link:r,range:e}}mergePendingMarks(e){return this.pending?this.pending.marks:e}setPendingMark(e,n){let o=z(this.doc,n.anchor),r=Se(this.doc,n),i=this.pending?{...this.pending.marks}:{...r};i[e]?delete i[e]:i[e]=true,this.pending={marks:i,caretOffset:o};}setPendingColorMark(e,n,o){let r=z(this.doc,o.anchor),i=Se(this.doc,o),l=this.pending?{...this.pending.marks}:{...i};n===void 0?delete l[e]:l[e]=n,this.pending={marks:l,caretOffset:r};}emitSelectionChange(){this.opts.onSelectionChange&&this.opts.onSelectionChange(this.buildSelectionState(this.cachedRange));}applyDocChange(e,n,o){if(this.doc=e,this.cachedRange=n,this.lastAppliedValue=null,this.el&&!this.composing&&(ct(e,this.el),n&&Pe(this.el,e,n)),o){let r=pe(e);this.lastKnownHtml=r,this.opts.onChange?.(r),this.emitSelectionChange();}}handleBeforeInput(e){let{inputType:n}=e;if(n==="insertParagraph"||n==="insertLineBreak"){e.preventDefault();let r=this.detectAutoLinkBeforeCaret();this.exec("insertSoftBreak"),r&&this.applyAutoLink(r);return}if(n==="insertText"&&e.data===" "){let r=this.detectAutoLinkBeforeCaret();if(r){e.preventDefault(),this.exec("insertText"," "),this.applyAutoLink(r);return}}if(n==="insertFromPaste"||n==="insertFromDrop"){e.preventDefault(),this.handlePasteInput(e);return}let o=this.keyboardShortcutsOverride??this.opts.areKeyboardShortcutsEnabled?.()??true;if(n==="formatBold"){e.preventDefault(),o&&this.exec("toggleMark","bold");return}if(n==="formatItalic"){e.preventDefault(),o&&this.exec("toggleMark","italic");return}if(n==="formatUnderline"){e.preventDefault(),o&&this.exec("toggleMark","underline");return}if(n==="historyUndo"){e.preventDefault(),o&&this.undo();return}if(n==="historyRedo"){e.preventDefault(),o&&this.redo();return}if(n==="insertText"&&e.data==="@"&&this.shouldTriggerMention()&&this.opts.canStartMention?.()!==false){e.preventDefault();let r=this.doc;this.exec("insertMentionInput"),this.doc===r?this.exec("insertText","@"):this.opts.onMentionTrigger?.();}}shouldTriggerMention(){if(!this.cachedRange)return true;if(!I(this.cachedRange))return false;let e=this.cachedRange,[n,o]=e.anchor.path,r=e.anchor.offset,i=this.doc;if(n>=i.length)return true;let l=i[n];if(o>=l.children.length)return true;let s=l.children[o];if(r===0&&o===0)return true;let a=null;if(x(s)){let c=s.text;if(r>0)a=c[r-1];else if(o>0)a=this.lastCharOf(l.children[o-1]);else return true}else if(T(s)){let c=s.children.map(u=>u.text).join("");if(r>0)a=c[r-1]??null;else if(o>0)a=this.lastCharOf(l.children[o-1]);else return true}else if(r===0&&o>0)a=this.lastCharOf(l.children[o-1]);else return true;return a===null?true:/^[\s"']$/.test(a)}lastCharOf(e){if(x(e)){let n=e.text;return n.length>0?n.at(-1)??null:null}if(T(e)){let o=(e.children??[]).at(-1);return o&&o.text.length>0?o.text.at(-1)??null:null}if(ue(e)){let n=e.displayName??"";return n.length>0?n.at(-1)??null:null}return null}autoLinkEnabled(){return this.opts.autoLink?.()??true}detectAutoLinkBeforeCaret(){return !this.autoLinkEnabled()||this.composing?null:this.findAutoLinkBeforeCaret()}findAutoLinkBeforeCaret(){let e=this.cachedRange;if(!e||!I(e))return null;let n=e.anchor,o=this.doc,r=n.path[0];if(r>=o.length)return null;let i=o[r].children,l=n.path[1],s=n.offset;if(l>=i.length){l=i.length-1;let f=i[l];if(!f||!x(f))return null;s=f.text.length;}else {let f=i[l];x(f)&&s>f.text.length&&(s=f.text.length);}let a=i[l];if(x(a)&&s<a.text.length&&!/\s/.test(a.text[s]))return null;let c="";for(;;){let f=i[l];if(!f||!x(f))break;if(s>0){let p=f.text[s-1];if(/\s/.test(p))break;c=p+c,s-=1;}else {if(l===0)break;let p=i[l-1];if(!x(p))break;l-=1,s=p.text.length;}}if(c==="")return null;let u=Ht(c);if(!u)return null;let d=z(o,{path:[r,l],offset:s});return {startAbs:d+u.start,endAbs:d+u.end,url:u.url}}applyAutoLink(e){let n=le(e.url);if(n==="")return;let o=this.doc,r={anchor:_(o,e.startAbs),focus:_(o,e.endAbs)},i={doc:o,range:this.cachedRange},l=vn(o,r,n);if(l.doc===o)return;let s=this.cachedRange?z(o,this.cachedRange.anchor):e.endAbs;this.history.record(i,"wrapLink");let a=_(l.doc,s);this.applyDocChange(l.doc,{anchor:a,focus:a},true);}handlePasteInput(e){this.insertPastedData(e.dataTransfer);}insertPastedData(e){if(!e)return;let n=this.autoLinkEnabled(),o=e.getData("text/plain");if(n&&o){let i=this.cachedRange;if(i&&!I(i)&&i.anchor.path[0]===i.focus.path[0]){let l=Vo(o),s=l?le(l):"";if(s&&!tr(this.doc,i)){this.exec("wrapLink",s);return}}}let r=e.getData("text/html");if(r)try{let i=D(pn(r));n&&(i=D(hn(i))),this.exec("insertFragment",i);return}catch(i){process.env.NODE_ENV!=="production"&&console.error("[Editor] failed to parse pasted HTML:",i);}if(o){let i=Me(o.replaceAll(`\r
|
|
26
|
+
`,`
|
|
27
|
+
`).replaceAll("\r",`
|
|
28
|
+
`)),l=D([{type:"p",children:[{text:i}]}]);n&&(l=D(hn(l))),this.exec("insertFragment",l);}}syncFromDom(){if(!this.el||this.composing)return;let e=this.doc,n={doc:e,range:this.cachedRange},o=Bt(this.el),r=qt(this.el,o);if(!(pe(o)!==this.lastKnownHtml)){if(r){let d=this.cachedRange;this.cachedRange=r,(!d||!this.rangesEqual(d,r))&&this.emitSelectionChange();}return}this.history.record(n,"typing");let s=o,a=r,c=false;if(!a&&n.range){let d=Math.max(Fe(o)-Fe(e),0),f=this.pending?this.pending.caretOffset:z(e,n.range.anchor),p=_(o,f+d);a={anchor:p,focus:p};}if(this.pending){let d=this.pending.marks,f=a;if(f){let p=this.applyPendingMarks(o,n.range,f);p.doc!==o&&(s=p.doc,a=p.range,c=true),this.pending=a?{marks:d,caretOffset:z(s,a.anchor)}:null,a&&(this.preservePendingSelectionChanges=10);}else this.pending=null;}this.doc=s,this.cachedRange=a;let u=pe(s);this.lastKnownHtml=u,this.lastAppliedValue=null,c&&(ct(s,this.el),a&&Pe(this.el,s,a)),this.opts.onChange?.(u),this.emitSelectionChange();}applyPendingMarks(e,n,o){if(!this.pending||!n||!o)return {doc:e,range:o??{anchor:{path:[0,0],offset:0},focus:{path:[0,0],offset:0}}};let r=this.pending.caretOffset,i=o?z(e,o.anchor):r;if(i<=r)return {doc:e,range:o??{anchor:{path:[0,0],offset:0},focus:{path:[0,0],offset:0}}};let l=this.applyPendingMarkSnapshot(e,this.pending.marks,r,i),s=_(l,i);return {doc:l,range:{anchor:s,focus:s}}}applyPendingMarkSnapshot(e,n,o,r){let i=e,l=()=>({anchor:_(i,o),focus:_(i,r)});for(let s of ["bold","italic","underline"]){let a=l(),c=!!n[s],u=!!Se(i,a)[s];if(c!==u){let d=bn(i,a,s);d.doc!==i&&(i=d.doc);}}for(let s of ["color","backgroundColor"]){let a=l(),c=n[s],u=Se(i,a)[s];if(!b$a(c,u)){let d=yn(i,a,s,c);d.doc!==i&&(i=d.doc);}}return i}handleSelectionChange(){if(!this.el)return;let e=Wt(this.el);if(!e)return;let n=Tn(this.el,e);if(!n||!e$1(this.el,n.startContainer))return;let o=qt(this.el,this.doc),r=this.cachedRange;this.preservePendingSelectionChanges>0?(this.preservePendingSelectionChanges-=1,this.pending&&o&&(this.pending={...this.pending,caretOffset:z(this.doc,o.anchor)})):this.pending&&o&&z(this.doc,o.anchor)!==this.pending.caretOffset&&(this.pending=null),o!==null&&(this.cachedRange=o),(!r||!o||!this.rangesEqual(r,o))&&this.emitSelectionChange();}dispatchCommand(e,n){let o=this.doc,r=this.cachedRange??this.collapsedAtDocEnd();switch(e){case "toggleMark":{let[i]=n;return bn(o,r,i)}case "setMarkValue":{let[i,l]=n;return yn(o,r,i,l)}case "wrapLink":{let[i]=n;return vn(o,r,i)}case "updateLinkUrl":{let[i]=n;return nr(o,r,i)}case "unwrapLink":return or(o,r);case "deleteRange":return qe(o,r);case "insertText":{let[i]=n;if(!I(r)){let l=qe(o,r);return at(l.doc,l.range.focus,i)}return at(o,r.anchor,i)}case "insertFragment":{let[i]=n;return rr(o,r,i)}case "insertSoftBreak":return ir(o,r);case "insertMentionInput":return cr(o,r);case "confirmMention":{let[i]=n;return dr(o,i)}case "removeMentionInput":{let[i]=n;return ur(o,i)}default:return {doc:o,range:r}}}collapsedAtDocEnd(){let e=Ve(this.doc);return {anchor:e,focus:e}}rangesEqual(e,n){return e.anchor.path[0]===n.anchor.path[0]&&e.anchor.path[1]===n.anchor.path[1]&&e.anchor.offset===n.anchor.offset&&e.focus.path[0]===n.focus.path[0]&&e.focus.path[1]===n.focus.path[1]&&e.focus.offset===n.focus.offset}};var ft=mt.createContext(null);function he(){let t=mt.useContext(ft);if(!t)throw new Error("useEditorContext must be used within an EditorProvider");return t}var Gt=Object.freeze({marks:{},link:null,range:null});function Li(t){let e=Me(t.replaceAll(/<br\s*\/?>/gi,""));return e==="<p></p>"||e===""||e==="<p> </p>"}function kn(t={}){let{value:e,defaultValue:n,onChange:o,isDisabled:r,keyboardShortcuts:i,onSelectionChange:l,onMentionTrigger:s,onMentionInputRemoved:a,canStartMention:c,isReadOnly:u,autoLink:d}=t;e!==void 0&&o===void 0&&a$c("use-editor-value-without-onchange","useEditor: `value` without `onChange` is controlled but cannot reflect edits \u2014 they are discarded on the next render. Use `defaultValue` for initial content, or add `onChange`.");let[f,p]=useState(Gt),[g,m]=useState(()=>e??n??""),k=useRef(o);k.current=o;let L=useRef(l);L.current=l;let K=useRef(s);K.current=s;let C=useRef(a);C.current=a;let A=useRef(c);A.current=c;let S=useRef(u);S.current=u;let M=useRef(r);M.current=r;let V=useRef(i);V.current=i;let W=useRef(d);W.current=d;let q=useRef(null);q.current===null&&(q.current=new ut({onChange:R=>{m(R),k.current?.(R);},onSelectionChange:R=>{p(R),L.current?.(R);},onMentionTrigger:()=>{K.current?.();},onMentionInputRemoved:()=>{C.current?.();},canStartMention:()=>A.current?.()??false,autoLink:()=>W.current!==false,isReadOnly:()=>S.current?.()??!!M.current,areKeyboardShortcutsEnabled:()=>V.current!==false}));let h=q.current;useLayoutEffect(()=>{e!==void 0&&h.setValue(e);});let y=useRef(false);useEffect(()=>{if(!y.current){y.current=true;let R=e??n;R&&h.setValue(R);}},[h]),useEffect(()=>{r&&p(Gt);},[r]);let O=e??g,b=Li(O),ae=h.canUndo(),re=h.canRedo();return useMemo(()=>({core:h,selectionState:f,value:O,isEmpty:b,isDisabled:!!r,keyboardShortcuts:i!==false,canUndo:ae,canRedo:re,focus:()=>{h.focus();},selectStart:()=>{h.selectStart();},selectEnd:()=>{h.selectEnd();},setCaretPosition:R=>{h.setCaretPosition(R);},undo:()=>{h.undo();},redo:()=>{h.redo();},getValue:()=>h.getValue(),setValue:(R,$)=>{h.setValue(R,$);},exec:(R,...$)=>{h.exec(R,...$);},isMarkActive:R=>!!f.marks[R],toggleMark:R=>{h.exec("toggleMark",R);},setMark:(R,$)=>{h.exec("setMarkValue",R,$);}}),[h,f,O,b,r,i,ae,re])}function Tr(t,e){let n=t.ctrlKey||t.metaKey,o=t.key.toLowerCase();if(n&&!t.altKey&&o==="z")return t.preventDefault(),t.shiftKey?e.redo():e.undo(),true;if(t.ctrlKey&&!t.altKey&&!t.shiftKey&&o==="y")return t.preventDefault(),e.redo(),true;if(n&&!t.shiftKey&&!t.altKey){if(o==="b")return t.preventDefault(),e.toggleMark("bold"),true;if(o==="i")return t.preventDefault(),e.toggleMark("italic"),true;if(o==="u")return t.preventDefault(),e.toggleMark("underline"),true}return false}function Mn(t,e={}){let n=_i(t),{ref:o,autoFocus:r,onKeyDown:i,keyboardShortcuts:l}=e,s=l??n.keyboardShortcuts,a=useId(),c=useRef(null),u=useRef(null),d=useCallback(m=>{u.current&&(u.current(),u.current=null),m&&(u.current=n.core.attach(m));},[n.core]),f=useMemo(()=>b(c,d,o??null),[d,o]);useEffect(()=>(n.core.setKeyboardShortcutsEnabled(l),()=>{n.core.setKeyboardShortcutsEnabled(void 0);}),[n.core,l]);let p=useRef(false);useEffect(()=>{if(!p.current)switch(p.current=true,r){case true:{n.focus();break}case "start":{n.selectStart();break}case "end":{n.selectEnd();break}}},[n.core]);let{keyboardProps:g}=a$e({onKeyDown:m=>{i?.(m)||s&&Tr(m,n)||m.continuePropagation();}});return {editableProps:{...g,id:a,ref:f,contentEditable:!n.isDisabled,suppressContentEditableWarning:true,role:"textbox","aria-multiline":true}}}function _i(t){let e=useContext(ft);if(t)return t;if(!e)throw new Error("useEditable must be passed an editor or used within an EditorProvider");return e}var Ln=({editor:t,children:e})=>jsx(ft.Provider,{value:t,children:e});var Xt=({markName:t,icon:e,ariaLabel:n,isDisabled:o})=>{let{core:r,selectionState:i}=he(),l=!!i.marks[t];return jsx(a$g,{variant:"tertiary",isSelected:l,size:"sm",icon:e,"aria-label":n,"data-testid":`editor-${t}-button`,isDisabled:o,onPress:()=>{r.exec("toggleMark",t),r.focus();},preventFocusOnPress:true})},zn=({colorKey:t,"aria-label":e,isDisabled:n})=>{let{core:o,selectionState:r}=he(),i=t==="color"?r.marks.color:r.marks.backgroundColor,l=mt.useRef(null),s=useCallback(()=>{l.current=r.range;},[r.range]),a=useCallback(p=>{setTimeout(()=>{let g=o.getSelectionState().range??l.current;g&&o.select(g),o.exec("setMarkValue",t,p);},0);},[o,t]),c=useCallback(p=>{a(p);},[a]),u=useCallback(()=>{a();},[a]),d=useCallback(({ref:p,triggerProps:g})=>jsx(a$b,{icon:t==="color"?TextIcon:HighlightTextIcon,"aria-label":e,"data-testid":t==="color"?"editor-font-color-button":"editor-background-color-button",size:"md",variant:"popover",isDisabled:n,className:Be,preventFocusOnPress:true,...g,ref:p}),[t,e,n]),f=useCallback(p=>{p?c(p.toString("rgba")):u();},[u,c]);return jsx(b$4,{presets:an,allowRemoval:true,pickerMode:"lazy",placement:"top end",colorLabel:false,renderTriggerButton:d,onTriggerPress:s,value:i||"#000000",onChange:f,isDisabled:n})};var De={Add:"add",Edit:"edit",Show:"show"},Cr=({isDisabled:t,addLinkLabel:e,editLinkLabel:n,removeLinkLabel:o,linkAnnotationLabel:r,linkCancelLabel:i,linkSaveLabel:l})=>{let{formatMessage:s}=b$1(),{core:a}=he();return jsxs(b$5,{type:"dialog",children:[jsx(j$1,{children:jsx(a$b,{icon:LinkIcon,size:"sm",isDisabled:t,"aria-label":e??s(_e.addLink),"data-testid":"editor-add-link-button",className:Be,preventFocusOnPress:true})}),jsx(a$h,{className:sprinkles({boxShadow:"medium"}),placement:"top end",children:({close:c})=>jsx(a$i,{size:"content",style:{minWidth:240},children:jsx(Hi,{addLinkLabel:e,editLinkLabel:n,removeLinkLabel:o,linkAnnotationLabel:r,linkCancelLabel:i,linkSaveLabel:l,close:()=>{c(),setTimeout(()=>{a.focus();},0);}})})})]})},Hi=({close:t,addLinkLabel:e,editLinkLabel:n,removeLinkLabel:o,linkAnnotationLabel:r,linkCancelLabel:i,linkSaveLabel:l})=>{let{core:s,selectionState:a}=he(),{formatMessage:c}=b$1(),u=a.link?.url,[d,f]=mt.useState(u?De.Show:De.Add),[p,g]=mt.useState(u||""),m=jsx(a$9,{padding:"lg",children:jsx(a$p,{label:r??c(_e.link),value:p,autoFocus:true,onChange:g,placeholder:"https://yourdomain.com","data-testid":"editor-link-input"})});return jsxs(Fragment,{children:[d===De.Add&&jsxs(Fragment,{children:[m,jsx(a$9,{display:"flex",justifyContent:"flex-end",padding:"lg",className:xo,children:jsx(b$b,{isDisabled:!a$q(p,true)||le(p)==="",label:e??c(_e.addLink),"data-testid":"editor-link-add-button",size:"sm",onPress:()=>{s.exec("wrapLink",p),t?.();},preventFocusOnPress:true})})]}),d===De.Show&&jsxs(Fragment,{children:[jsx(a$9,{padding:"lg",children:jsx(a$n,{type:"subtitle",size:"sm",children:u})}),jsxs(a$9,{display:"flex",justifyContent:"flex-end",padding:"lg",gap:"lg",borderColor:"border.subtle",borderWidth:1,borderStyle:"solid",children:[jsx(b$b,{label:n??c(_e.editLink),"data-testid":"editor-link-edit-button",size:"sm",variant:"secondary",onPress:()=>{f(De.Edit);},style:{flex:1,justifyContent:"center"}}),jsx(b$b,{label:o??c(_e.removeLink),"data-testid":"editor-link-remove-button",size:"sm",onPress:()=>{s.exec("unwrapLink"),t?.();},preventFocusOnPress:true,style:{flex:1,justifyContent:"center"}})]})]}),d===De.Edit&&jsxs(Fragment,{children:[m,jsxs(a$9,{display:"flex",justifyContent:"flex-end",padding:"lg",gap:"lg",borderColor:"border.subtle",borderWidth:1,borderStyle:"solid",children:[jsx(b$b,{label:i??c(_e.cancel),"data-testid":"editor-link-cancel-button",size:"sm",variant:"secondary",onPress:()=>{f(De.Show),t?.();}}),jsx(b$b,{label:l??c(_e.save),"data-testid":"editor-link-save-button",size:"sm",onPress:()=>{le(p)!==""&&(s.exec("updateLinkUrl",p),t?.());}})]})]})]})},_e=c$1({addLink:{id:"bui.editor.addLink",defaultMessage:"Add Link"},editLink:{id:"bui.editor.editLink",defaultMessage:"Edit Link"},removeLink:{id:"bui.editor.removeLink",defaultMessage:"Remove Link"},cancel:{id:"bui.editor.cancel",defaultMessage:"Cancel"},save:{id:"bui.editor.save",defaultMessage:"Save"},link:{id:"bui.editor.linkAnnotation",defaultMessage:"Link"}});var Dn=mt.createContext({items:[],containerRef:{current:null},maxMentionableUsersSuggestions:10}),qi=({key:t,value:e},{isDisabled:n,optionProps:o,isFocused:r,_state:i},l)=>{let{hoverProps:s}=a$3({isDisabled:n}),{label:a,data:c$1}=e;return jsxs(Fragment,{children:[jsxs("li",{...c(o,s),className:ko({isDisabled:n,isHovered:r}),"data-active":r,ref:l,children:[jsx(a$f,{name:a,...c$1?.avatar}),jsxs(a$9,{display:"flex",flexDirection:"column",children:[jsx(a$n,{type:"subtitle",size:"sm",children:a}),jsx(a$n,{type:"helper",size:"sm",children:c$1?.description})]})]}),t===i.collection.getLastKey()?null:jsx(a$a,{})]})};function Pn(t){return t.displayName?.trim()||t.name?.trim()||t.id}function _n({anchor:t,onClose:e,mentionLabel:n}){let{core:o}=he(),{containerRef:r,items:i,maxMentionableUsersSuggestions:l}=useContext(Dn),[s,a]=useState(""),{contains:c$1}=a$j({sensitivity:"base"}),{formatMessage:u}=b$1(),d=useRef(false),f$1=useCallback(()=>{d.current=true,e();},[e]),p=useMemo(()=>{let h=i.filter(y=>s===""||c$1(Pn(y),s)).map(y=>({id:y.id,label:Pn(y),data:y}));return l?h.slice(0,l):h},[i,l,s,c$1]),g=useCallback(h=>jsx(a$k,{textValue:h.label,children:h.label},h.id),[]),m=useCallback(h=>{if(d.current||h==null)return;let y=i.find(O=>O.id===h);y&&(f$1(),o.exec("confirmMention",{id:y.id,displayName:y.displayName??Pn(y)}),o.exec("insertText"," "),o.focus());},[f$1,o,i]),k=b$6({items:p,children:g,menuTrigger:"focus",onSelectionChange:m}),L=useCallback(h=>{if(d.current)return;f$1();let y=h==="backspace"?"":`@${k.inputValue}`;o.exec("removeMentionInput",y),o.focus();},[f$1,o,k.inputValue]),K=useRef(null),C=useRef(null),A=useRef(null),S=useRef(null);a$l({ref:S,onInteractOutside:()=>{k.close();}});let{inputProps:M,listBoxProps:V}=a$m({defaultItems:p,inputRef:C,buttonRef:K,listBoxRef:A,popoverRef:S,menuTrigger:"focus","aria-label":n??u($i.mention)},k);useLayoutEffect(()=>{C.current?.focus(),setTimeout(()=>{C.current?.focus();});},[]);let W=useCallback(h=>{let y=h.currentTarget,O=y.selectionStart===0&&y.selectionEnd===0,b=y.selectionStart===y.value.length&&y.selectionEnd===y.value.length;h.key==="Backspace"&&O?(h.preventDefault(),L("backspace")):h.key==="Escape"?L("escape"):h.key==="ArrowLeft"&&O?(h.preventDefault(),L("arrowLeft")):h.key==="ArrowRight"&&b&&(h.preventDefault(),L("arrowRight"));let ae=h.metaKey||h.ctrlKey,re=h.key.toLowerCase(),R=ae&&!h.shiftKey&&re==="z"&&o.canUndo(),$=(ae&&h.shiftKey&&re==="z"||h.ctrlKey&&re==="y")&&o.canRedo();(R||$)&&(h.preventDefault(),R?o.undo():o.redo(),f$1(),o.focus());},[L,f$1,o]),q=useMemo(()=>{if(!CSS.supports("field-sizing","content")){let h=b$2(C.current),y=C.current?h?.getComputedStyle(C.current).font:void 0;return {width:y?b$7({text:k.inputValue,font:y,element:C.current}).width+10:"4ch"}}},[k.inputValue]);return jsxs(Fragment,{children:[createPortal(jsx("input",{...c(M,{onKeyDown:W,onBlur:()=>{L("blur");},onChange:h=>{a(h.target.value);}}),style:q,className:To,ref:C}),t),jsx(b$8.Provider,{value:k,children:jsx(a$h,{triggerRef:r,isNonModal:true,ref:S,state:k,crossOffset:-2,children:jsx(c$2,{...V,items:void 0,ref:A,"data-testid":"editor-mention-listbox",className:a$5(f,sprinkles({width:"full"})),renderOption:qi})})})]})}_n.displayName="MentionInputOverlay";var $i=c$1({mention:{defaultMessage:"Mention",id:"bui.editor.mention"}});var wn=mt.forwardRef(({value:t,defaultValue:e,onChange:n,style:o,spellCheck:r,placeholder:i,isInline:l,isDisabled:s,editableContentAriaLabel:a,containerRef:c,onHelpDialogOpenRequest:u,mentionableUsers:d$1,editorHandle:f,maxMentionableUsersSuggestions:p,autoFocus:g,editorRef:m,saveOnEnter:k,onSave:L,autoLink:K,mentionLabel:C,boldLabel:A,italicLabel:S,underlineLabel:M,fontColorLabel:V,backgroundColorLabel:W,helpLabel:q,addLinkLabel:h,editLinkLabel:y,removeLinkLabel:O,linkAnnotationLabel:b,linkCancelLabel:ae,linkSaveLabel:re},R)=>{let $=useRef(null),Ne=useRef(null),{formatMessage:ge}=b$1(),[Xe,Ye]=useState(null),xt=useRef(0),[Qt,bt]=useState(false),yt=()=>{let v=Ne.current?.querySelector("[data-mention-anchor]");v&&(xt.current+=1,Ye({anchor:v,id:xt.current}));},xe=kn({value:t,defaultValue:e,onChange:n,isDisabled:s,onMentionTrigger:yt,onMentionInputRemoved:()=>{Ye(null);},canStartMention:()=>(d$1?.length??0)>0,autoLink:K}),Ze=xe.core;mt.useEffect(()=>{m&&(m.current=Ze);},[Ze,m]);let E=v=>k&&v.key==="Enter"&&!v.shiftKey||(v.ctrlKey||v.metaKey)&&v.key==="Enter"?(v.preventDefault(),L(),true):v.altKey&&v.key==="F10"?(v.preventDefault(),$.current?.querySelector("button")?.focus(),true):false,{editableProps:Et}=Mn(xe,{ref:Ne,autoFocus:g,onKeyDown:E}),Je=v=>{if(s)return;let{isLinkClick:ce,url:G}=Fo(v.target,{metaKey:v.metaKey,ctrlKey:v.ctrlKey,mac:d()});ce&&(v.preventDefault(),G&&b$2(v.currentTarget).open(G,"_blank","noopener,noreferrer"));};mt.useEffect(()=>{let v=Ne.current;if(!v||s)return;let ce=a$7(v),G=b$2(v),Te=ke=>{bt(d()?ke.metaKey:ke.ctrlKey);},tt=()=>{bt(false);};return ce.addEventListener("keydown",Te),ce.addEventListener("keyup",Te),G.addEventListener("blur",tt),()=>{ce.removeEventListener("keydown",Te),ce.removeEventListener("keyup",Te),G.removeEventListener("blur",tt),tt();}},[s]),useImperativeHandle(R,()=>({startMention:()=>{d$1?.length&&(Ne.current?.querySelector("input[role='combobox']")||(Ze.exec("insertMentionInput"),yt()));}})),useImperativeHandle(f,()=>({setCaretPosition:v=>{xe.setCaretPosition(v);},focus:()=>{xe.focus();}}));let Qe=useMemo(()=>({items:d$1||[],containerRef:c,maxMentionableUsersSuggestions:p}),[d$1,c,p]),et=xe.isEmpty;return jsx(Dn.Provider,{value:Qe,children:jsxs(Ln,{editor:xe,children:[jsxs(a$8,{className:a$5(It,"BaselineUI-Editor-RichEditorToolbar"),"aria-controls":Et.id,ref:$,children:[jsxs(a$9,{display:"flex",flexDirection:"row",role:"group",gap:"xs",paddingX:"sm",children:[jsx(Xt,{markName:"bold",icon:BoldIcon,ariaLabel:A??ge(Ge.bold),isDisabled:s}),jsx(Xt,{markName:"italic",icon:ItalicIcon,ariaLabel:S??ge(Ge.italic),isDisabled:s}),jsx(Xt,{markName:"underline",icon:UnderlineIcon,ariaLabel:M??ge(Ge.underline),isDisabled:s})]}),jsx(a$a,{orientation:"vertical",className:rt}),jsx(zn,{colorKey:"color","aria-label":V??ge(Ge.fontColor),isDisabled:s}),jsx(a$a,{orientation:"vertical",className:rt}),jsx(zn,{colorKey:"backgroundColor","aria-label":W??ge(Ge.backgroundColor),isDisabled:s}),jsx(a$a,{orientation:"vertical",className:rt}),jsx(Cr,{isDisabled:s,addLinkLabel:h,editLinkLabel:y,removeLinkLabel:O,linkAnnotationLabel:b,linkCancelLabel:ae,linkSaveLabel:re}),jsx(a$a,{orientation:"vertical",className:rt}),jsx(a$b,{className:Be,icon:QuestionmarkCircleIcon,size:"sm","aria-label":q??ge(Ge.help),"data-testid":"editor-help-button",onPress:u})]}),jsx(a$a,{variant:"secondary"}),jsxs("div",{style:{position:"relative"},children:[!!(i&&et)&&jsx("span",{"aria-hidden":true,"aria-disabled":true,"data-testid":"editor-placeholder",style:{position:"absolute",pointerEvents:"none",userSelect:"none",top:0,left:0,right:0},className:a$5(ot({isDisabled:s}),Eo,"BaselineUI-Editor-RichEditorPlaceholder"),children:i}),jsx("div",{...Et,onClick:Je,"data-mod-held":Qt?"":void 0,"aria-label":a,"aria-placeholder":i,spellCheck:r,style:o,className:a$5(ot({isDisabled:s}),_t({isInline:l}),"BaselineUI-Editor-RichEditorEditingArea")})]}),Xe!==null&&jsx(_n,{anchor:Xe.anchor,mentionLabel:C,onClose:()=>{Ye(null);}},Xe.id)]})})});wn.displayName="RichEditor";var Ge=c$1({bold:{defaultMessage:"Bold",id:"bui.editor.bold"},italic:{defaultMessage:"Italic",id:"bui.editor.italic"},underline:{defaultMessage:"Underline",id:"bui.editor.underline"},backgroundColor:{defaultMessage:"Background Color",id:"bui.editor.backgroundColor"},fontColor:{defaultMessage:"Font Color",id:"bui.editor.fontColor"},help:{defaultMessage:"Help",id:"bui.editor.help"}});var Pr=mt.memo(mt.forwardRef(({className:t,style:e,"data-block-id":n,"data-block-class":o,enableRichText:r=false,onCancel:i,onSave:l,isInline:s=true,submitButtonIcon:a=ArrowUpCircleFilledIcon,submitButtonAriaLabel:c$1,cancelButtonAriaLabel:u,"aria-label":d,"aria-describedby":f,"aria-labelledby":p,"aria-details":g,editableContentAriaLabel:m="Editing Area",footerButtons:k,clearOnCancel:L,clearOnSave:K,mentionLabel:C,boldLabel:A,italicLabel:S,underlineLabel:M,fontColorLabel:V,backgroundColorLabel:W,helpLabel:q,closeLabel:h,actionLabel:y,shortcutLabel:O,toolbarFocusLabel:b$2,selectAllLabel:ae,cutLabel:re,copyLabel:R,pasteLabel:$,undoLabel:Ne,redoLabel:ge,openHelpDialogLabel:Xe,submitLabel:Ye,addLinkLabel:xt,editLinkLabel:Qt,removeLinkLabel:bt,linkAnnotationLabel:yt,linkCancelLabel:xe,linkSaveLabel:Ze,...E},Et)=>{let Je=useRef(null),{formatMessage:Qe}=b$1(),et=useRef(null),v=useRef(null),ce=useRef(null),G=!r&&E.variant==="minimal",Te=useRef(null),[tt,ke]=mt.useState(E.value||E.defaultValue),en=E.value!==void 0&&E.onChange!==void 0;r&&E.value!==void 0&&!E.onChange&&a$c("editor-rich-value-uncontrolled","Editor: `value` without `onChange` in rich text mode sets the initial content only. Use `defaultValue` for uncontrolled content, or add `onChange` to control the value.");let Hn=E.value!==void 0&&(!r||en),tn=E.value;mt.useEffect(()=>{Hn&&tn!==void 0&&ke(tn);},[Hn,tn]);let nn=E.isDisabled||E.isSaveDisabled||!b$3(tt||""),{fieldProps:Dr}=a$d({"aria-label":d,"aria-labelledby":p,"aria-describedby":f,"aria-details":g,labelElementType:"div"});G&&!E.avatarName&&console.warn("Editor: When using the minimal `variant` and `enableRichText` is `false`, you should provide an `avatarName`.");let on=useCallback(()=>{ke(""),r?Je.current?.setValue("<p></p>",{emit:true}):v.current?.clear();},[r]),vt=useCallback(()=>{nn||(l?.(r?Je.current?.getValue()??"":et.current.value),K&&on());},[on,K,r,l,nn]),jn=jsx(a$b,{variant:"ghost","aria-label":c$1||Qe(On.save),icon:a,isDisabled:nn,"data-testid":"editor-save-button",size:"md",excludeFromTabOrder:G,className:a$5({[Co]:G},"BaselineUI-Editor-Save"),onPress:vt,preventFocusOnPress:true}),[_r,rn]=mt.useState(false),{keyboardProps:Ir}=a$e({onKeyDown:F=>{(F.metaKey||F.ctrlKey)&&F.shiftKey&&F.key==="h"&&(F.preventDefault(),rn(true));}}),Kn=useCallback(F=>{ke(F),E.onChange?.(F);},[E]);return jsxs("div",{...c(Dr,r?Ir:{}),role:"application",ref:b(ce,Et),style:e,"data-block-id":n,"data-block-class":o,className:a$5(yo({isInline:s,isMinimal:G}),"BaselineUI-Editor",t),"aria-disabled":E.isDisabled,children:[G?jsxs(Fragment,{children:[s?jsx(a$f,{className:bo,name:E.avatarName||""}):null,jsxs("div",{className:Lo({isInline:s}),children:[jsx(Nt,{isMinimal:G,textBoxRef:et,ref:v,isInline:s,editableContentAriaLabel:m,...E,onChange:Kn,onSave:vt}),jn]})]}):jsxs(Fragment,{children:[r?jsx(wn,{containerRef:ce,ref:Te,editorRef:Je,isInline:s,editableContentAriaLabel:m,onHelpDialogOpenRequest:()=>{rn(true);},mentionLabel:C,boldLabel:A,italicLabel:S,underlineLabel:M,fontColorLabel:V,backgroundColorLabel:W,helpLabel:q,addLinkLabel:xt,editLinkLabel:Qt,removeLinkLabel:bt,linkAnnotationLabel:yt,linkCancelLabel:xe,linkSaveLabel:Ze,...E,value:en?E.value:void 0,defaultValue:E.defaultValue??(en?void 0:E.value),onChange:Kn,onSave:vt}):jsxs(Fragment,{children:[!s&&jsx(a$a,{variant:"secondary"}),jsx(Nt,{onCancel:i,textBoxRef:et,ref:v,isInline:s,editableContentAriaLabel:m,...E,onChange:F=>{ke(F),E.onChange?.(F);},onSave:vt})]}),jsx(a$a,{variant:"secondary"}),jsxs("div",{className:a$5(It,sprinkles({justifyContent:"space-between"}),"BaselineUI-Editor-Footer"),children:[jsxs(a$9,{paddingX:"sm",gap:"sm",display:"flex",children:[r&&E.mentionableUsers?jsx(a$b,{icon:AtIcon,size:"sm","aria-label":C??Qe(On.mention),"data-testid":"editor-mention-button",onPress:()=>Te.current?.startMention(),preventFocusOnPress:true,className:"BaselineUI-Editor-Mention"}):null,k?.map(({type:F,props:Rt},Fn)=>F==="action"?jsx(a$b,{...Rt,size:"sm",isDisabled:E.isDisabled||Rt.isDisabled},Fn):jsx(a$g,{...Rt,size:"sm",variant:"tertiary",isDisabled:E.isDisabled||Rt.isDisabled},Fn))]}),jsxs(a$9,{children:[!!i&&jsx(a$b,{variant:"secondary",icon:XCircleFilledIcon,isDisabled:E.isDisabled,"data-testid":"editor-cancel-button",size:"md",onPress:()=>{i(),L&&on();},"aria-label":u||Qe(On.cancel),className:"BaselineUI-Editor-Cancel"}),jn]})]})]}),jsx(No,{isOpen:_r,onClose:()=>{rn(false);},toolbarFocusLabel:b$2,helpLabel:q,closeLabel:h,actionLabel:y,shortcutLabel:O,boldLabel:A,italicLabel:S,underlineLabel:M,selectAllLabel:ae,cutLabel:re,copyLabel:R,pasteLabel:$,undoLabel:Ne,redoLabel:ge,openHelpDialogLabel:Xe,submitLabel:Ye})]})}));Pr.displayName="Editor";var On=c$1({cancel:{defaultMessage:"Cancel",id:"bui.editor.cancel"},save:{defaultMessage:"Save",id:"bui.editor.save"},mention:{defaultMessage:"Mention",id:"bui.editor.mention"}});
|
|
29
|
+
export{ut as a,he as b,Gt as c,kn as d,Tr as e,Mn as f,Ln as g,Pr as h};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {d as d$1}from'./chunk-66NJ7EYY.mjs';import {o,l,d as d$2,s,a as a$2}from'./chunk-MRJFGHFW.mjs';import {a as a$1,b as b$1,g as g$1,f}from'./chunk-AUOQSTS5.mjs';import {b as b$2}from'./chunk-RMUV6NJJ.mjs';import {useState,useEffect}from'react';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var u=null,d="keyboard",E=new Set,v=new Map,a=false,g=false,R={Tab:true,Escape:true};function b(e,n){for(let t of E)t(e,n);}function _(e){return !(e.metaKey||!d$2()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function m(e){a=true,!o.isOpening&&_(e)&&(u="keyboard",d="keyboard",b("keyboard",e));}function i(e){u="pointer",d="pointerType"in e?e.pointerType:"mouse",(e.type==="mousedown"||e.type==="pointerdown")&&(a=true,b("pointer",e));}function D(e){!o.isOpening&&l(e)&&(a=true,u="virtual",d="virtual");}function I(e){let n=g$1(e),t="nodeType"in n&&n.nodeType===Node.DOCUMENT_NODE,o=t?n.defaultView||window:b$1(n),l=t?n:a$1(n);n===o||n===l||d$1||!e.isTrusted||(!a&&!g&&(u="virtual",d="virtual",b("virtual",e)),a=false,g=false);}function O(){d$1||(a=false,g=true);}function y(e){if(typeof window>"u"||typeof document>"u")return;let n=b$1(e),t=a$1(e);if(v.get(n))return;let o=n.HTMLElement.prototype.focus;Reflect.defineProperty(n.HTMLElement.prototype,"focus",{configurable:true,writable:true,value:function(){a=true,o.apply(this,arguments);}}),t.addEventListener("keydown",m,true),t.addEventListener("keyup",m,true),t.addEventListener("click",D,true),n.addEventListener("focus",I,true),n.addEventListener("blur",O,false),typeof PointerEvent<"u"?(t.addEventListener("pointerdown",i,true),t.addEventListener("pointermove",i,true),t.addEventListener("pointerup",i,true)):process.env.NODE_ENV==="test"&&(t.addEventListener("mousedown",i,true),t.addEventListener("mousemove",i,true),t.addEventListener("mouseup",i,true)),n.addEventListener("beforeunload",()=>{P(e);},{once:true}),v.set(n,{focus:o});}var P=(e,n)=>{let t=b$1(e),o=a$1(e);n&&o.removeEventListener("DOMContentLoaded",n),v.has(t)&&(Reflect.defineProperty(t.HTMLElement.prototype,"focus",{configurable:true,writable:true,value:v.get(t).focus}),o.removeEventListener("keydown",m,true),o.removeEventListener("keyup",m,true),o.removeEventListener("click",D,true),t.removeEventListener("focus",I,true),t.removeEventListener("blur",O,false),typeof PointerEvent<"u"?(o.removeEventListener("pointerdown",i,true),o.removeEventListener("pointermove",i,true),o.removeEventListener("pointerup",i,true)):process.env.NODE_ENV==="test"&&(o.removeEventListener("mousedown",i,true),o.removeEventListener("mousemove",i,true),o.removeEventListener("mouseup",i,true)),v.delete(t));};function j(e){let n=a$1(e),t;return n.readyState!=="loading"?y(e):(t=()=>{y(e);},n.addEventListener("DOMContentLoaded",t)),()=>P(e,t)}typeof document<"u"&&j();function S(){return u!=="pointer"}function K(){return u}function ee(e){u=e,d=e==="pointer"?"mouse":e,b(e,null);}function te(){return d}function ne(){y();let[e,n]=useState(u);return useEffect(()=>{let t=()=>{n(u);};return E.add(t),()=>{E.delete(t);}},[]),b$2()?null:e}var G=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function B(e,n,t){let o=t?g$1(t):void 0,l=a$1(o),r=b$1(o),W=typeof r<"u"?r.HTMLInputElement:HTMLInputElement,C=typeof r<"u"?r.HTMLTextAreaElement:HTMLTextAreaElement,N=typeof r<"u"?r.HTMLElement:HTMLElement,A=typeof r<"u"?r.KeyboardEvent:KeyboardEvent,c=f(l);return e=e||c instanceof W&&!G.has(c.type)||c instanceof C||c instanceof N&&c.isContentEditable,!(e&&n==="keyboard"&&t instanceof A&&!R[t.key])}function oe(e={}){let{isTextInput:n,autoFocus:t}=e,[o,l]=useState(t||S());return U(r=>{l(r);},[n],{isTextInput:n}),{isFocusVisible:o}}function U(e,n,t){y(),useEffect(()=>{if(t?.enabled===false)return;let o=(l,r)=>{B(!!t?.isTextInput,l,r)&&e(S());};return E.add(o),()=>{E.delete(o);}},n);}function de(e){if(!e.isConnected)return;let n=a$1(e);if(K()==="virtual"){let t=f(n);s(()=>{let o=f(n);(o===t||o===n.body)&&e.isConnected&&a$2(e);},e);}else a$2(e);}export{j as a,S as b,K as c,ee as d,te as e,ne as f,oe as g,U as h,de as i};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$2}from'./chunk-O7XK2WIX.mjs';import {a as a$1}from'./chunk-MEZNZ5W6.mjs';import {a}from'./chunk-VDUFLHKK.mjs';import {jsx}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var d=({icon:p,tooltip:r,label:c,isFocusable:e=true,...s})=>{let{tooltipProps:l}=a({label:c,tooltip:r,offset:9});return jsx(a$1,{...l,children:({triggerProps:f,triggerRef:m})=>jsx(a$2,{display:"inline-flex",...f,ref:m,tabIndex:e?0:void 0,"data-testid":"icon-with-tooltip",children:jsx(p,{...s})})})};export{d as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {c,b,a as a$2}from'./chunk-66NJ7EYY.mjs';import {a}from'./chunk-6ZQE5SHE.mjs';import {e,g,a as a$1,f}from'./chunk-AUOQSTS5.mjs';import {useRef,useCallback}from'react';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
function k(p){let{isDisabled:F,onBlurWithin:s,onFocusWithin:n,onFocusWithinChange:e$1}=p,r=useRef({isFocusWithin:false}),{addGlobalListener:c$1,removeAllGlobalListeners:f$1}=a(),o=useCallback(t=>{e(t.currentTarget,g(t))&&r.current.isFocusWithin&&!e(t.currentTarget,t.relatedTarget)&&(r.current.isFocusWithin=false,f$1(),s&&s(t),e$1&&e$1(false));},[s,e$1,r,f$1]),i=c(o),m=useCallback(t=>{if(!e(t.currentTarget,g(t)))return;let h=g(t),E=a$1(h),A=f(E);if(!r.current.isFocusWithin&&A===h){n&&n(t),e$1&&e$1(true),r.current.isFocusWithin=true,i(t);let T=t.currentTarget;c$1(E,"focus",w=>{let d=g(w);if(r.current.isFocusWithin&&!e(T,d)){let b$1=new E.defaultView.FocusEvent("blur",{relatedTarget:d});b(b$1,T);let C=a$2(b$1);o(C);}},{capture:true});}},[n,e$1,i,c$1,o]);return F?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:m,onBlur:o}}}function J(p){let{isDisabled:F,onFocus:s,onBlur:n,onFocusChange:e}=p,r=useCallback(o=>{if(g(o)===o.currentTarget)return n&&n(o),e&&e(false),true},[n,e]),c$1=c(r),f$1=useCallback(o=>{let i=g(o),m=a$1(i),t=m?f(m):f();i===o.currentTarget&&i===t&&(s&&s(o),e&&e(true),c$1(o));},[e,s,c$1]);return {focusProps:{onFocus:!F&&(s||e||n)?f$1:void 0,onBlur:!F&&(n||e)?r:void 0}}}export{J as a,k as b};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a}from'./chunk-LZFTBNPW.mjs';import {a as a$1}from'./chunk-4QEH5CGK.mjs';import {CheckmarkCircleFilledIcon,ErrorAltCircleFilledIcon as ErrorAltCircleFilledIcon$1}from'@baseline-ui/icons/16';import {CheckCircleFilledIcon,ErrorAltCircleFilledIcon}from'@baseline-ui/icons/20';import {assignInlineVars}from'@vanilla-extract/dynamic';import F from'react';import {jsxs,jsx}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var p="_1azy5686",m="_1azy5685",d="var(--_1azy5680)",y="_1azy5688",f="_1azy5689",g="_1azy5681 z9nup81",v="_1azy5682";var u="_1azy5687";var M={sm:16,md:20},V={sm:[CheckmarkCircleFilledIcon,ErrorAltCircleFilledIcon$1],md:[CheckCircleFilledIcon,ErrorAltCircleFilledIcon]},z=F.forwardRef(({className:C,style:k,size:c="md",variant:e="active","data-block-id":_,"data-block-class":b,...o},x)=>{let{labelProps:P,progressBarProps:h}=a({...o,isIndeterminate:true}),r=M[c],s=r/2-2,S=2*s*Math.PI,t=V[c][e==="success"?0:1];return jsxs("div",{className:a$1(g,"BaselineUI-ProgressSpinner",C),ref:x,style:{...assignInlineVars({[d]:`${S}px`}),...k},"data-block-id":_,"data-block-class":b,children:[jsxs("div",{...h,className:v,children:[(e==="active"||e==="inactive")&&jsxs("svg",{height:r,width:r,viewBox:`0 0 ${r} ${r}`,children:[jsx("circle",{role:"presentation",className:p,cx:r/2,cy:r/2,r:s,fill:"none",stroke:"none"}),e==="active"&&jsx("circle",{role:"presentation",className:m,cx:r/2,cy:r/2,r:s,fill:"none",stroke:"none"})]}),e==="success"&&jsx(t,{className:u,size:r}),e==="error"&&jsx(t,{className:y,size:r})]}),o.label?jsx("span",{...P,className:f,children:o.label}):null]})});z.displayName="ProgressSpinner";export{z as a};
|