From 35d2bf1985fae8ceea54a407f44665280da81230 Mon Sep 17 00:00:00 2001 From: Owen Allen Date: Mon, 13 Jan 2025 10:01:09 +0000 Subject: [PATCH] Updates --- ...ddress-vmeQMcJR.js => Address-D_1XShe2.js} | 2 +- ...ffI3Rz_.js => Address.stories-CnQ-tpAv.js} | 2 +- ...Ql-sX.js => AdvancedSelection-CuAWMfAc.js} | 2 +- ... => AdvancedSelection.stories-Brf5CJqi.js} | 2 +- ...{Button-BL7nnjzP.js => Button-CGus-HTO.js} | 2 +- ...nRow-DQyOGQtp.js => ButtonRow-ljX1cVF2.js} | 2 +- .../{Card-DRSaEp1D.js => Card-DImfeiKn.js} | 2 +- ...ckbox-H8YuhK9L.js => Checkbox-BCi8vIYQ.js} | 2 +- ...t-DL9O_08e.js => CheckboxList-a1U_M_fR.js} | 2 +- .../{Chip-DbaBEC_F.js => Chip-D0v-3ziP.js} | 2 +- ...CAod4Jrm.js => Color-PRSJMWNM-BVhT5zVY.js} | 2 +- ... => ConditionalFields.stories-C0pzXX-A.js} | 2 +- ...> ConditionalSections.stories-BFeSssEW.js} | 2 +- ...ontent-CZTjyAQw.js => Content-BgPagL-k.js} | 2 +- ...jyGRp.js => CopyField.stories-6XNSINZ7.js} | 2 +- ...5a.js => CustomFields.stories-BX2UbNrJ.js} | 2 +- ...aView-BTUFg3QS.js => DataView-DBys1vCl.js} | 2 +- ...V7kSXG.js => DataView.stories-DWp99G5d.js} | 2 +- ...Nv37.js => DataViewFilterDate-Dh4aUe6H.js} | 2 +- ...=> DataViewFilterDate.stories-Cw2dS4mi.js} | 2 +- ... => DataViewFilterMultiselect-DJBDJUNV.js} | 2 +- ...Sf.js => DataViewFilterNumber-CsSdJqG2.js} | 2 +- ...8Z.js => DataViewFilterNumber-DXeWfoJw.js} | 2 +- ... DataViewFilterNumber.stories-m1dupcpg.js} | 2 +- ...=> DataViewFilterSingleSelect-BLcEV6I4.js} | 2 +- ...Gg6M.js => DataViewFilterText-BpSNZJuo.js} | 2 +- ...ield-vRtzsM4n.js => DateField-BY6cxiaE.js} | 2 +- ...-VM3I.js => DateField.stories-B4uSKeMs.js} | 2 +- ...{Dialog-CZ_Rg0vQ.js => Dialog-C5L98Bpm.js} | 2 +- ...3.js => DocsRenderer-K4EAMTCU-Bcn-YnNS.js} | 2 +- ...4K8k.js => DrawerForm.stories-C3XUuSSz.js} | 2 +- ...rawers-B7DDXSOi.js => Drawers-CCB-J_2n.js} | 2 +- ...yzzuJLS.js => Drawers.stories-Dbqjbbut.js} | 2 +- .../{Form-CecvGgxl.js => Form-CRl9vEGi.js} | 122 +++++++++--------- .../{Form-KemOgO0L.js => Form-a5gbPled.js} | 2 +- ...ZY0hY.js => FormFieldCheckbox-0ANayj08.js} | 2 +- ... => FormFieldCheckbox.stories-BUpT97vZ.js} | 2 +- ...DiZr5OfC.js => FormFieldChips-DQCHDyGP.js} | 2 +- ....js => FormFieldChips.stories-C9XYTfMh.js} | 2 +- ...4KFC5CdD.js => FormFieldColor-CdFZXq3q.js} | 2 +- ....js => FormFieldColor.stories-CEoPXIrT.js} | 2 +- ...GXUC2.js => FormFieldDropdown-DJcpJo8z.js} | 2 +- ... => FormFieldDropdown.stories-yij-I3mA.js} | 2 +- ...IAVD6XY.js => FormFieldMatrix-Ca0oZIkl.js} | 2 +- ...js => FormFieldMatrix.stories-BPhFPWW5.js} | 2 +- ...js => FormFieldNumber.stories-DUwW3HYi.js} | 2 +- ...jv.js => FormFieldNumberTable-DmxudUJV.js} | 2 +- ... FormFieldNumberTable.stories-gPIFx8CY.js} | 2 +- ...Ca-8Ipwl.js => FormFieldPhone-Cm9_G2H0.js} | 2 +- ....js => FormFieldPhone.stories-CtU_G2Np.js} | 2 +- ...CYRT9w-Z.js => FormFieldRadio-CmTSBv-G.js} | 2 +- ....js => FormFieldRadio.stories-DClBGior.js} | 2 +- ...w-B6X2dFFC.js => FormFieldRaw-C7NJYYVy.js} | 2 +- ...W1.js => FormFieldRaw.stories-CTfXcj_9.js} | 2 +- ...-BrzHFFwS.js => FormFieldText-DJ1npm_o.js} | 2 +- ...D.js => FormFieldText.stories-9qtXpJUG.js} | 2 +- ...q6s.js => FormFieldTextEditor-Dtm8pSgw.js} | 2 +- ...> FormFieldTextEditor.stories-wpSOd2DJ.js} | 2 +- ...T6MEk6j.js => FormFieldToggle-DAr_rjdq.js} | 2 +- ...js => FormFieldToggle.stories-CF_VQQuY.js} | 2 +- ...1lGQZak.js => FormFieldUpload-DDl8a0OE.js} | 2 +- ...js => FormFieldUpload.stories-lfiUZB0I.js} | 2 +- ...eftNav-k7hP-2XE.js => LeftNav-DpLGhfZp.js} | 2 +- ...BOHJ_okh.js => MapCoordinates-CRnVQNKn.js} | 2 +- ....js => MapCoordinates.stories-DcZOiKZO.js} | 2 +- .../{Menu-DnYYGt6j.js => Menu-CIfBK3hc.js} | 2 +- ...der-BGPOSKGc.js => PageHeader-DBcRbjbb.js} | 2 +- ...PerformanceWithSubmit.stories-BwOman0a.js} | 2 +- ...M0wM.js => Playground.stories-mIH44Bst.js} | 2 +- ...opover-BvcN1tnz.js => Popover-BTcPOCrM.js} | 2 +- ...kzKkLsC.js => Profile.stories-BbPlk5Xb.js} | 2 +- ...js => QuickSubmitForm.stories-DAUj41OL.js} | 2 +- ...on-Coq9yEKZ.js => RadioButton-DnGuxdsB.js} | 2 +- ... => RuntimeBehaviours.stories-D3jM6ZBd.js} | 2 +- ...ideNav-CUm7aRt0.js => SideNav-CK8I46Ds.js} | 2 +- ...ckbar-DnDBtiZ0.js => Snackbar-DYIm1cIM.js} | 2 +- ...pinner-C8wylg-U.js => Spinner-BQIeWrPy.js} | 2 +- ...ield--Zu-k8nh.js => TimeField-jBY3PkFk.js} | 2 +- ...oNHJD.js => TimeField.stories-DwvCasRD.js} | 2 +- ...{Toggle-CWy3pUCP.js => Toggle-CFofdwNy.js} | 2 +- ...ary-8vfEQruv.js => TopSummary-DjJtAcY1.js} | 2 +- ...phy-B-UN2-8I.js => Typography-l1FHU-Vp.js} | 2 +- ...0P_A.js => Validators.stories-DoDrrWN0.js} | 2 +- ...js => VaryingSections.stories-CCSQftKH.js} | 2 +- ...wp.js => WithTooltip-KJL26V4Q-XmqOFVr3.js} | 2 +- ...r_pia.js => column_transforms-D_0bcitG.js} | 2 +- ...kA9H.js => formatter-2WMMO6ZP-Bsg5rG4M.js} | 2 +- ...{iframe-CPBXIkt3.js => iframe-CjjOpcna.js} | 4 +- .../{index-oGQ2mxNr.js => index-BbAFHYha.js} | 10 +- .../{index-BhsI2nxq.js => index-MydwXDSS.js} | 2 +- ...review-zAt8HGVj.js => preview-DcOKaz2U.js} | 4 +- ...=> syntaxhighlighter-BP7B2CQK-D6i7tNei.js} | 2 +- ...2IKBK.js => transform_boolean-DKWcXcrz.js} | 2 +- ...Xw-80hf.js => transform_chips-C2llvTBM.js} | 2 +- ...N.js => transform_colorPicker-DBKITEmM.js} | 2 +- ...RD.js => transform_dateFormat-C-qDdeUt.js} | 2 +- ...-fC7TmbN3.js => transform_get-BhJ9MtQd.js} | 2 +- ...DRv_z0y-.js => transform_join-BqavvGtR.js} | 2 +- ...IG2ayS.js => transform_mapGet-BNUnYISC.js} | 2 +- ...H_e.js => transform_thumbnail-BsDxwRzj.js} | 2 +- ...y-s9vJXTNH.js => useScrollSpy-YViwOYi7.js} | 2 +- ...ggle-Bi-PbcuM.js => useToggle-DulN9UUz.js} | 2 +- sb8/qa/iframe.html | 2 +- sb8/qa/project.json | 2 +- 104 files changed, 170 insertions(+), 170 deletions(-) rename sb8/qa/assets/{Address-vmeQMcJR.js => Address-D_1XShe2.js} (97%) rename sb8/qa/assets/{Address.stories-DffI3Rz_.js => Address.stories-CnQ-tpAv.js} (99%) rename sb8/qa/assets/{AdvancedSelection-BcwQl-sX.js => AdvancedSelection-CuAWMfAc.js} (97%) rename sb8/qa/assets/{AdvancedSelection.stories-CuDthQth.js => AdvancedSelection.stories-Brf5CJqi.js} (99%) rename sb8/qa/assets/{Button-BL7nnjzP.js => Button-CGus-HTO.js} (94%) rename sb8/qa/assets/{ButtonRow-DQyOGQtp.js => ButtonRow-ljX1cVF2.js} (90%) rename sb8/qa/assets/{Card-DRSaEp1D.js => Card-DImfeiKn.js} (91%) rename sb8/qa/assets/{Checkbox-H8YuhK9L.js => Checkbox-BCi8vIYQ.js} (89%) rename sb8/qa/assets/{CheckboxList-DL9O_08e.js => CheckboxList-a1U_M_fR.js} (91%) rename sb8/qa/assets/{Chip-DbaBEC_F.js => Chip-D0v-3ziP.js} (93%) rename sb8/qa/assets/{Color-PRSJMWNM-CAod4Jrm.js => Color-PRSJMWNM-BVhT5zVY.js} (99%) rename sb8/qa/assets/{ConditionalFields.stories-CzWgAQLR.js => ConditionalFields.stories-C0pzXX-A.js} (98%) rename sb8/qa/assets/{ConditionalSections.stories-DtD6qEqq.js => ConditionalSections.stories-BFeSssEW.js} (98%) rename sb8/qa/assets/{Content-CZTjyAQw.js => Content-BgPagL-k.js} (97%) rename sb8/qa/assets/{CopyField.stories-BnRjyGRp.js => CopyField.stories-6XNSINZ7.js} (98%) rename sb8/qa/assets/{CustomFields.stories-BMXLNT5a.js => CustomFields.stories-BX2UbNrJ.js} (97%) rename sb8/qa/assets/{DataView-BTUFg3QS.js => DataView-DBys1vCl.js} (98%) rename sb8/qa/assets/{DataView.stories-CxV7kSXG.js => DataView.stories-DWp99G5d.js} (99%) rename sb8/qa/assets/{DataViewFilterDate-BqSFNv37.js => DataViewFilterDate-Dh4aUe6H.js} (92%) rename sb8/qa/assets/{DataViewFilterDate.stories-C0p9BXdF.js => DataViewFilterDate.stories-Cw2dS4mi.js} (98%) rename sb8/qa/assets/{DataViewFilterMultiselect-CJbyiaya.js => DataViewFilterMultiselect-DJBDJUNV.js} (96%) rename sb8/qa/assets/{DataViewFilterNumber-BLLSpjSf.js => DataViewFilterNumber-CsSdJqG2.js} (88%) rename sb8/qa/assets/{DataViewFilterNumber-DemMkJ8Z.js => DataViewFilterNumber-DXeWfoJw.js} (96%) rename sb8/qa/assets/{DataViewFilterNumber.stories-DsHNpCTM.js => DataViewFilterNumber.stories-m1dupcpg.js} (90%) rename sb8/qa/assets/{DataViewFilterSingleSelect-BqbmNMMg.js => DataViewFilterSingleSelect-BLcEV6I4.js} (94%) rename sb8/qa/assets/{DataViewFilterText-CwvAGg6M.js => DataViewFilterText-BpSNZJuo.js} (95%) rename sb8/qa/assets/{DateField-vRtzsM4n.js => DateField-BY6cxiaE.js} (96%) rename sb8/qa/assets/{DateField.stories-Byc-VM3I.js => DateField.stories-B4uSKeMs.js} (98%) rename sb8/qa/assets/{Dialog-CZ_Rg0vQ.js => Dialog-C5L98Bpm.js} (94%) rename sb8/qa/assets/{DocsRenderer-K4EAMTCU-DpPv9Gs3.js => DocsRenderer-K4EAMTCU-Bcn-YnNS.js} (86%) rename sb8/qa/assets/{DrawerForm.stories-CEgG4K8k.js => DrawerForm.stories-C3XUuSSz.js} (99%) rename sb8/qa/assets/{Drawers-B7DDXSOi.js => Drawers-CCB-J_2n.js} (96%) rename sb8/qa/assets/{Drawers.stories-4yzzuJLS.js => Drawers.stories-Dbqjbbut.js} (98%) rename sb8/qa/assets/{Form-CecvGgxl.js => Form-CRl9vEGi.js} (92%) rename sb8/qa/assets/{Form-KemOgO0L.js => Form-a5gbPled.js} (99%) rename sb8/qa/assets/{FormFieldCheckbox-k4TZY0hY.js => FormFieldCheckbox-0ANayj08.js} (96%) rename sb8/qa/assets/{FormFieldCheckbox.stories-BAPtEowi.js => FormFieldCheckbox.stories-BUpT97vZ.js} (98%) rename sb8/qa/assets/{FormFieldChips-DiZr5OfC.js => FormFieldChips-DQCHDyGP.js} (96%) rename sb8/qa/assets/{FormFieldChips.stories-CK3kR_RB.js => FormFieldChips.stories-C9XYTfMh.js} (98%) rename sb8/qa/assets/{FormFieldColor-4KFC5CdD.js => FormFieldColor-CdFZXq3q.js} (95%) rename sb8/qa/assets/{FormFieldColor.stories-D4tSs6mc.js => FormFieldColor.stories-CEoPXIrT.js} (97%) rename sb8/qa/assets/{FormFieldDropdown-BC6GXUC2.js => FormFieldDropdown-DJcpJo8z.js} (96%) rename sb8/qa/assets/{FormFieldDropdown.stories-C7yGjKzM.js => FormFieldDropdown.stories-yij-I3mA.js} (98%) rename sb8/qa/assets/{FormFieldMatrix-CIAVD6XY.js => FormFieldMatrix-Ca0oZIkl.js} (97%) rename sb8/qa/assets/{FormFieldMatrix.stories-CUDtjXDT.js => FormFieldMatrix.stories-BPhFPWW5.js} (99%) rename sb8/qa/assets/{FormFieldNumber.stories-BKiKOIod.js => FormFieldNumber.stories-DUwW3HYi.js} (98%) rename sb8/qa/assets/{FormFieldNumberTable-Dq2_szjv.js => FormFieldNumberTable-DmxudUJV.js} (97%) rename sb8/qa/assets/{FormFieldNumberTable.stories-Cuz97ATj.js => FormFieldNumberTable.stories-gPIFx8CY.js} (96%) rename sb8/qa/assets/{FormFieldPhone-Ca-8Ipwl.js => FormFieldPhone-Cm9_G2H0.js} (96%) rename sb8/qa/assets/{FormFieldPhone.stories-DhvP4-bY.js => FormFieldPhone.stories-CtU_G2Np.js} (98%) rename sb8/qa/assets/{FormFieldRadio-CYRT9w-Z.js => FormFieldRadio-CmTSBv-G.js} (95%) rename sb8/qa/assets/{FormFieldRadio.stories-Bg7V3zI-.js => FormFieldRadio.stories-DClBGior.js} (98%) rename sb8/qa/assets/{FormFieldRaw-B6X2dFFC.js => FormFieldRaw-C7NJYYVy.js} (94%) rename sb8/qa/assets/{FormFieldRaw.stories-DhyCByW1.js => FormFieldRaw.stories-CTfXcj_9.js} (98%) rename sb8/qa/assets/{FormFieldText-BrzHFFwS.js => FormFieldText-DJ1npm_o.js} (97%) rename sb8/qa/assets/{FormFieldText.stories-CGT8kqzD.js => FormFieldText.stories-9qtXpJUG.js} (99%) rename sb8/qa/assets/{FormFieldTextEditor-BpTFGq6s.js => FormFieldTextEditor-Dtm8pSgw.js} (98%) rename sb8/qa/assets/{FormFieldTextEditor.stories-DCiwWUV3.js => FormFieldTextEditor.stories-wpSOd2DJ.js} (99%) rename sb8/qa/assets/{FormFieldToggle-CT6MEk6j.js => FormFieldToggle-DAr_rjdq.js} (95%) rename sb8/qa/assets/{FormFieldToggle.stories-R5vrbr0D.js => FormFieldToggle.stories-CF_VQQuY.js} (98%) rename sb8/qa/assets/{FormFieldUpload-C1lGQZak.js => FormFieldUpload-DDl8a0OE.js} (98%) rename sb8/qa/assets/{FormFieldUpload.stories-5oNynfQN.js => FormFieldUpload.stories-lfiUZB0I.js} (99%) rename sb8/qa/assets/{LeftNav-k7hP-2XE.js => LeftNav-DpLGhfZp.js} (98%) rename sb8/qa/assets/{MapCoordinates-BOHJ_okh.js => MapCoordinates-CRnVQNKn.js} (95%) rename sb8/qa/assets/{MapCoordinates.stories-uu7VfpoX.js => MapCoordinates.stories-DcZOiKZO.js} (98%) rename sb8/qa/assets/{Menu-DnYYGt6j.js => Menu-CIfBK3hc.js} (91%) rename sb8/qa/assets/{PageHeader-BGPOSKGc.js => PageHeader-DBcRbjbb.js} (91%) rename sb8/qa/assets/{PerformanceWithSubmit.stories-BtcrVlGY.js => PerformanceWithSubmit.stories-BwOman0a.js} (96%) rename sb8/qa/assets/{Playground.stories-D0-vM0wM.js => Playground.stories-mIH44Bst.js} (99%) rename sb8/qa/assets/{Popover-BvcN1tnz.js => Popover-BTcPOCrM.js} (91%) rename sb8/qa/assets/{Profile.stories-CkzKkLsC.js => Profile.stories-BbPlk5Xb.js} (99%) rename sb8/qa/assets/{QuickSubmitForm.stories-DCGng4Bz.js => QuickSubmitForm.stories-DAUj41OL.js} (98%) rename sb8/qa/assets/{RadioButton-Coq9yEKZ.js => RadioButton-DnGuxdsB.js} (94%) rename sb8/qa/assets/{RuntimeBehaviours.stories-DnMXjIzr.js => RuntimeBehaviours.stories-D3jM6ZBd.js} (99%) rename sb8/qa/assets/{SideNav-CUm7aRt0.js => SideNav-CK8I46Ds.js} (96%) rename sb8/qa/assets/{Snackbar-DnDBtiZ0.js => Snackbar-DYIm1cIM.js} (92%) rename sb8/qa/assets/{Spinner-C8wylg-U.js => Spinner-BQIeWrPy.js} (90%) rename sb8/qa/assets/{TimeField--Zu-k8nh.js => TimeField-jBY3PkFk.js} (94%) rename sb8/qa/assets/{TimeField.stories-BtloNHJD.js => TimeField.stories-DwvCasRD.js} (97%) rename sb8/qa/assets/{Toggle-CWy3pUCP.js => Toggle-CFofdwNy.js} (94%) rename sb8/qa/assets/{TopSummary-8vfEQruv.js => TopSummary-DjJtAcY1.js} (92%) rename sb8/qa/assets/{Typography-B-UN2-8I.js => Typography-l1FHU-Vp.js} (98%) rename sb8/qa/assets/{Validators.stories-DUT00P_A.js => Validators.stories-DoDrrWN0.js} (99%) rename sb8/qa/assets/{VaryingSections.stories-BicZVXrc.js => VaryingSections.stories-CCSQftKH.js} (98%) rename sb8/qa/assets/{WithTooltip-KJL26V4Q-Dnn5Iswp.js => WithTooltip-KJL26V4Q-XmqOFVr3.js} (71%) rename sb8/qa/assets/{column_transforms-BFzr_pia.js => column_transforms-D_0bcitG.js} (93%) rename sb8/qa/assets/{formatter-2WMMO6ZP-DsgckA9H.js => formatter-2WMMO6ZP-Bsg5rG4M.js} (99%) rename sb8/qa/assets/{iframe-CPBXIkt3.js => iframe-CjjOpcna.js} (75%) rename sb8/qa/assets/{index-oGQ2mxNr.js => index-BbAFHYha.js} (99%) rename sb8/qa/assets/{index-BhsI2nxq.js => index-MydwXDSS.js} (98%) rename sb8/qa/assets/{preview-zAt8HGVj.js => preview-DcOKaz2U.js} (73%) rename sb8/qa/assets/{syntaxhighlighter-BP7B2CQK-DPXKZz4d.js => syntaxhighlighter-BP7B2CQK-D6i7tNei.js} (74%) rename sb8/qa/assets/{transform_boolean-CDA2IKBK.js => transform_boolean-DKWcXcrz.js} (91%) rename sb8/qa/assets/{transform_chips-DXw-80hf.js => transform_chips-C2llvTBM.js} (95%) rename sb8/qa/assets/{transform_colorPicker-C4TvqvhN.js => transform_colorPicker-DBKITEmM.js} (95%) rename sb8/qa/assets/{transform_dateFormat-Cn236qRD.js => transform_dateFormat-C-qDdeUt.js} (95%) rename sb8/qa/assets/{transform_get-fC7TmbN3.js => transform_get-BhJ9MtQd.js} (93%) rename sb8/qa/assets/{transform_join-DRv_z0y-.js => transform_join-BqavvGtR.js} (91%) rename sb8/qa/assets/{transform_mapGet-DuIG2ayS.js => transform_mapGet-BNUnYISC.js} (94%) rename sb8/qa/assets/{transform_thumbnail-BArX8H_e.js => transform_thumbnail-BsDxwRzj.js} (96%) rename sb8/qa/assets/{useScrollSpy-s9vJXTNH.js => useScrollSpy-YViwOYi7.js} (95%) rename sb8/qa/assets/{useToggle-Bi-PbcuM.js => useToggle-DulN9UUz.js} (98%) diff --git a/sb8/qa/assets/Address-vmeQMcJR.js b/sb8/qa/assets/Address-D_1XShe2.js similarity index 97% rename from sb8/qa/assets/Address-vmeQMcJR.js rename to sb8/qa/assets/Address-D_1XShe2.js index a78ab9693d..d26b9baa0f 100644 --- a/sb8/qa/assets/Address-vmeQMcJR.js +++ b/sb8/qa/assets/Address-D_1XShe2.js @@ -1,4 +1,4 @@ -import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as n}from"./index-3-_tf5dF.js";import{M as s}from"./index-oGQ2mxNr.js";import{s as o}from"./Address.stories-DffI3Rz_.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./renderButtons-BmHfsf_z.js";import"./Form-CecvGgxl.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./optionGetters-DXvNsMp-.js";function i(r){const t={a:"a",code:"code",h1:"h1",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...n(),...r.components};return e.jsxs(e.Fragment,{children:[e.jsx(s,{of:o}),` +import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as n}from"./index-3-_tf5dF.js";import{M as s}from"./index-BbAFHYha.js";import{s as o}from"./Address.stories-CnQ-tpAv.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./renderButtons-BmHfsf_z.js";import"./Form-CRl9vEGi.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./optionGetters-DXvNsMp-.js";function i(r){const t={a:"a",code:"code",h1:"h1",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...n(),...r.components};return e.jsxs(e.Fragment,{children:[e.jsx(s,{of:o}),` `,e.jsx(t.h1,{id:"address",children:"Address"}),` `,e.jsxs(t.p,{children:["This field implements the ",e.jsx(t.a,{href:"#generic-field-props-fielddef",children:e.jsx(t.strong,{children:"FieldDef"})})," interface."]}),` `,e.jsxs(t.ul,{children:[` diff --git a/sb8/qa/assets/Address.stories-DffI3Rz_.js b/sb8/qa/assets/Address.stories-CnQ-tpAv.js similarity index 99% rename from sb8/qa/assets/Address.stories-DffI3Rz_.js rename to sb8/qa/assets/Address.stories-CnQ-tpAv.js index 60d4ea0fe4..073cd23e5a 100644 --- a/sb8/qa/assets/Address.stories-DffI3Rz_.js +++ b/sb8/qa/assets/Address.stories-CnQ-tpAv.js @@ -1,4 +1,4 @@ -import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as f}from"./index-BP8_t0zE.js";import{r as j}from"./renderButtons-BmHfsf_z.js";import{u as h,F}from"./Form-CecvGgxl.js";import{g as _,a as C}from"./optionGetters-DXvNsMp-.js";const I={title:"FormFields/FormFieldAddress"},y=["undefined",1,2,3,4,5,-1],r={getOptionsCountries:_,getOptionsStates:C},V="AIzaSyArV4f-KFF86Zn9VWAu9wS4hHlG1TXxqac",q=[{id:1,address1:"137 Teaticket Highway",address2:"",city:"Falmouth",state:{label:"Massachusetts",value:"MA"},postalCode:"02536",country:{label:"United States",value:"US"},types:[{label:"Physical",value:"physical"}]},{id:2,address1:"555 East Main Street",address2:"",city:"Norfolk",state:{label:"Virginia",value:"VA"},postalCode:"23510",country:{label:"United States",value:"US"},types:[{label:"Physical",value:"physical"}]}],s=({label:n,disabled:i,required:d,skeleton:b,prepopulate:u,amountPerType:a,amountShipping:o,amountPhysical:l,amountBilling:m,googleKey:c})=>{const g=h(),{state:S,handleSubmit:O}=g,B=f.useMemo(()=>u?async()=>({address:q}):void 0,[u]),E=f.useMemo(()=>[{disabled:i,label:n,required:d,name:"address",type:"address",inputSettings:{amountPerType:a==="undefined"?void 0:Number(a),amountShipping:o==="undefined"?void 0:Number(o),amountPhysical:l==="undefined"?void 0:Number(l),amountBilling:m==="undefined"?void 0:Number(m),googleMapsApiKey:c,...r}}],[i,n,d,a,o,l,m,c]);return e.jsxs(e.Fragment,{children:[e.jsx(F,{...g,buttons:j(O),title:"Address field",fields:E,skeleton:b,getFormValues:B}),e.jsx("pre",{children:JSON.stringify(S,null," ")})]})};s.args={label:"Label",disabled:!1,required:!1,skeleton:!1,prepopulate:!1,amountPerType:"undefined",amountShipping:"undefined",amountPhysical:"undefined",amountBilling:"undefined",googleKey:V};s.argTypes={label:{name:"Label"},disabled:{name:"Disabled"},required:{name:"Required"},skeleton:{name:"Skeleton"},prepopulate:{name:"Prepopulate"},amountPerType:{name:"Maximum of Each Type",control:{type:"select"},options:y},amountShipping:{name:"Shipping Maximum",control:{type:"select"},options:y},amountPhysical:{name:"Physical Maximum",control:{type:"select"},options:y},amountBilling:{name:"Billing Maximum",control:{type:"select"},options:y},googleKey:{name:"Google API Key"}};const t=({label:n,disabled:i,required:d,skeleton:b,prepopulate:u,subFields:a,googleKey:o})=>{const l=h(),{state:m,handleSubmit:c}=l,g=f.useMemo(()=>u?async()=>({address:q[0]}):void 0,[u]),S=f.useMemo(()=>[{disabled:i,label:n,required:d,name:"address",type:"addressSingle",inputSettings:{subFields:a,googleMapsApiKey:o,...r}}],[i,n,d,a,o]);return e.jsxs(e.Fragment,{children:[e.jsx(F,{...l,buttons:j(c),title:"Address Single field",fields:S,skeleton:b,getFormValues:g}),e.jsx("pre",{children:JSON.stringify(m,null," ")})]})};t.args={label:"Label",disabled:!1,required:!1,skeleton:!1,prepopulate:!1,subFields:["address1","address2","address3","country","city","state","postalCode"],googleKey:V};t.argTypes={label:{name:"Label"},disabled:{name:"Disabled"},required:{name:"Required"},skeleton:{name:"Skeleton"},prepopulate:{name:"Prepopulate"},subFields:{name:"Sub-Fields",control:{type:"object"}},googleKey:{name:"Google API Key"}};const R=[{label:"Provide a physical address",name:"physicalOnly",type:"address",inputSettings:{amountPhysical:1,...r}},{label:"Provide 1 physical address and 1 shipping address",name:"physicalAndShipping",type:"address",inputSettings:{amountPhysical:1,amountShipping:1,...r}},{label:"Provide any combination of addresses with a maximum of 1 each",name:"anyCombinationMax1",type:"address",inputSettings:{...r}},{label:"Provide any combination of addresses with no maximum",name:"anyCombinationNoMax",type:"address",inputSettings:{amountPerType:-1,...r}}],p=()=>{const n=h();return e.jsx(F,{...n,title:"Address Field",fields:R})};var P,M,x;s.parameters={...s.parameters,docs:{...(P=s.parameters)==null?void 0:P.docs,source:{originalSource:`({ +import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as f}from"./index-BP8_t0zE.js";import{r as j}from"./renderButtons-BmHfsf_z.js";import{u as h,F}from"./Form-CRl9vEGi.js";import{g as _,a as C}from"./optionGetters-DXvNsMp-.js";const I={title:"FormFields/FormFieldAddress"},y=["undefined",1,2,3,4,5,-1],r={getOptionsCountries:_,getOptionsStates:C},V="AIzaSyArV4f-KFF86Zn9VWAu9wS4hHlG1TXxqac",q=[{id:1,address1:"137 Teaticket Highway",address2:"",city:"Falmouth",state:{label:"Massachusetts",value:"MA"},postalCode:"02536",country:{label:"United States",value:"US"},types:[{label:"Physical",value:"physical"}]},{id:2,address1:"555 East Main Street",address2:"",city:"Norfolk",state:{label:"Virginia",value:"VA"},postalCode:"23510",country:{label:"United States",value:"US"},types:[{label:"Physical",value:"physical"}]}],s=({label:n,disabled:i,required:d,skeleton:b,prepopulate:u,amountPerType:a,amountShipping:o,amountPhysical:l,amountBilling:m,googleKey:c})=>{const g=h(),{state:S,handleSubmit:O}=g,B=f.useMemo(()=>u?async()=>({address:q}):void 0,[u]),E=f.useMemo(()=>[{disabled:i,label:n,required:d,name:"address",type:"address",inputSettings:{amountPerType:a==="undefined"?void 0:Number(a),amountShipping:o==="undefined"?void 0:Number(o),amountPhysical:l==="undefined"?void 0:Number(l),amountBilling:m==="undefined"?void 0:Number(m),googleMapsApiKey:c,...r}}],[i,n,d,a,o,l,m,c]);return e.jsxs(e.Fragment,{children:[e.jsx(F,{...g,buttons:j(O),title:"Address field",fields:E,skeleton:b,getFormValues:B}),e.jsx("pre",{children:JSON.stringify(S,null," ")})]})};s.args={label:"Label",disabled:!1,required:!1,skeleton:!1,prepopulate:!1,amountPerType:"undefined",amountShipping:"undefined",amountPhysical:"undefined",amountBilling:"undefined",googleKey:V};s.argTypes={label:{name:"Label"},disabled:{name:"Disabled"},required:{name:"Required"},skeleton:{name:"Skeleton"},prepopulate:{name:"Prepopulate"},amountPerType:{name:"Maximum of Each Type",control:{type:"select"},options:y},amountShipping:{name:"Shipping Maximum",control:{type:"select"},options:y},amountPhysical:{name:"Physical Maximum",control:{type:"select"},options:y},amountBilling:{name:"Billing Maximum",control:{type:"select"},options:y},googleKey:{name:"Google API Key"}};const t=({label:n,disabled:i,required:d,skeleton:b,prepopulate:u,subFields:a,googleKey:o})=>{const l=h(),{state:m,handleSubmit:c}=l,g=f.useMemo(()=>u?async()=>({address:q[0]}):void 0,[u]),S=f.useMemo(()=>[{disabled:i,label:n,required:d,name:"address",type:"addressSingle",inputSettings:{subFields:a,googleMapsApiKey:o,...r}}],[i,n,d,a,o]);return e.jsxs(e.Fragment,{children:[e.jsx(F,{...l,buttons:j(c),title:"Address Single field",fields:S,skeleton:b,getFormValues:g}),e.jsx("pre",{children:JSON.stringify(m,null," ")})]})};t.args={label:"Label",disabled:!1,required:!1,skeleton:!1,prepopulate:!1,subFields:["address1","address2","address3","country","city","state","postalCode"],googleKey:V};t.argTypes={label:{name:"Label"},disabled:{name:"Disabled"},required:{name:"Required"},skeleton:{name:"Skeleton"},prepopulate:{name:"Prepopulate"},subFields:{name:"Sub-Fields",control:{type:"object"}},googleKey:{name:"Google API Key"}};const R=[{label:"Provide a physical address",name:"physicalOnly",type:"address",inputSettings:{amountPhysical:1,...r}},{label:"Provide 1 physical address and 1 shipping address",name:"physicalAndShipping",type:"address",inputSettings:{amountPhysical:1,amountShipping:1,...r}},{label:"Provide any combination of addresses with a maximum of 1 each",name:"anyCombinationMax1",type:"address",inputSettings:{...r}},{label:"Provide any combination of addresses with no maximum",name:"anyCombinationNoMax",type:"address",inputSettings:{amountPerType:-1,...r}}],p=()=>{const n=h();return e.jsx(F,{...n,title:"Address Field",fields:R})};var P,M,x;s.parameters={...s.parameters,docs:{...(P=s.parameters)==null?void 0:P.docs,source:{originalSource:`({ label, disabled, required, diff --git a/sb8/qa/assets/AdvancedSelection-BcwQl-sX.js b/sb8/qa/assets/AdvancedSelection-CuAWMfAc.js similarity index 97% rename from sb8/qa/assets/AdvancedSelection-BcwQl-sX.js rename to sb8/qa/assets/AdvancedSelection-CuAWMfAc.js index 058260b5a8..59d4fb86f0 100644 --- a/sb8/qa/assets/AdvancedSelection-BcwQl-sX.js +++ b/sb8/qa/assets/AdvancedSelection-CuAWMfAc.js @@ -1,4 +1,4 @@ -import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as i}from"./index-3-_tf5dF.js";import{M as o}from"./index-oGQ2mxNr.js";import{s}from"./AdvancedSelection.stories-CuDthQth.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./index.browser-vcSNLBTf.js";import"./Form-CecvGgxl.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./renderButtons-BmHfsf_z.js";import"./options-CstHLxTf.js";import"./MultiSelectHelper-dY4FeL1L.js";function r(n){const e={a:"a",code:"code",h1:"h1",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...i(),...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(o,{of:s}),` +import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as i}from"./index-3-_tf5dF.js";import{M as o}from"./index-BbAFHYha.js";import{s}from"./AdvancedSelection.stories-Brf5CJqi.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./index.browser-vcSNLBTf.js";import"./Form-CRl9vEGi.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./renderButtons-BmHfsf_z.js";import"./options-CstHLxTf.js";import"./MultiSelectHelper-dY4FeL1L.js";function r(n){const e={a:"a",code:"code",h1:"h1",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...i(),...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(o,{of:s}),` `,t.jsx(e.h1,{id:"advanced-selection",children:"Advanced Selection"}),` `,t.jsxs(e.p,{children:["This field implements the ",t.jsx(e.a,{href:"#generic-field-props-fielddef",children:t.jsx(e.strong,{children:"FieldDef"})})," interface."]}),` `,t.jsxs(e.ul,{children:[` diff --git a/sb8/qa/assets/AdvancedSelection.stories-CuDthQth.js b/sb8/qa/assets/AdvancedSelection.stories-Brf5CJqi.js similarity index 99% rename from sb8/qa/assets/AdvancedSelection.stories-CuDthQth.js rename to sb8/qa/assets/AdvancedSelection.stories-Brf5CJqi.js index 5ad476dbd1..31581e5116 100644 --- a/sb8/qa/assets/AdvancedSelection.stories-CuDthQth.js +++ b/sb8/qa/assets/AdvancedSelection.stories-Brf5CJqi.js @@ -1,4 +1,4 @@ -import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{r as _}from"./index-BP8_t0zE.js";import{n as T}from"./index.browser-vcSNLBTf.js";import{u as C,F as H}from"./Form-CecvGgxl.js";import{r as M}from"./renderButtons-BmHfsf_z.js";import{o as s}from"./options-CstHLxTf.js";import{M as j,J as k,c as B}from"./MultiSelectHelper-dY4FeL1L.js";const E={title:"FormFields/FormFieldAdvancedSelection"},i=({label:r,required:g,skeleton:O,disabled:n,instructionText:o,helperText:l,optionsOrigin:a,getOptionsLimit:c,createNewOptionsKnob:p,selectLimit:d})=>{const e=C(),{state:S,handleSubmit:w}=e,v=s?s:[],b=new k(B),L=new j({api:b,labelColumn:"tag",valueColumn:"id",sortColumn:"sort_tag"}),J=async f=>{const D=T(),u={_id:D,tag:f,sort_tag:f,updated:new Date,created:new Date,id:D};s.push({label:u.tag,value:u.id});const q=[...await b.getData(),u];return await b.setData(q),{label:u.tag,value:u.id}},K=_.useMemo(()=>[{name:"advancedSelection",label:r,required:g,disabled:n,helperText:l,instructionText:o,type:"advancedSelection",inputSettings:{options:a==="Local"?v:void 0,getOptions:a==="DB"?L.getOptions.bind(L):void 0,getOptionsLimit:a==="DB"&&c?c:void 0,createNewOption:p?J:void 0,selectLimit:d}}],[r,g,n,l,o,c,v,a,p,d]);return t.jsxs(t.Fragment,{children:[t.jsx("pre",{children:JSON.stringify(S,null," ")}),t.jsx(H,{...e,buttons:M(w),title:"Advanced Selection Field",fields:K,skeleton:O})]})};i.args={label:"Label",disabled:!1,required:!1,skeleton:!1,instructionText:"Instruction text",helperText:"Helper text",optionsOrigin:"Local",getOptionsLimit:5,createNewOptionsKnob:!0,selectLimit:-1};i.argTypes={label:{name:"Label"},disabled:{name:"Disabled"},required:{name:"Required"},skeleton:{name:"Skeleton"},instructionText:{name:"Instruction Text"},helperText:{name:"Helper Text"},optionsOrigin:{name:"Options Origin"},getOptionsLimit:{name:"Get Options Limit"},createNewOptionsKnob:{name:"Create New Option"},selectLimit:{name:"Select Limit"}};const m=()=>{const r=C(),{state:g,handleSubmit:O}=r,n=s?s:[],o=new k(B),l=new j({api:o,labelColumn:"tag",valueColumn:"id",sortColumn:"sort_tag"}),a=async p=>{const d=T(),e={_id:d,tag:p,sort_tag:p,updated:new Date,created:new Date,id:d};s.push({label:e.tag,value:e.id});const w=[...await o.getData(),e];return await o.setData(w),{label:e.tag,value:e.id}},c=_.useMemo(()=>[{name:"checkboxOptions",label:"Advanced selection with options prop",type:"advancedSelection",inputSettings:{options:n}},{name:"getOptions",label:"Advanced selection with getOptions prop",type:"advancedSelection",inputSettings:{getOptions:l.getOptions.bind(l),getOptionsLimit:5}},{name:"createNewOption",label:"Advanced selection with createNewOption prop",type:"advancedSelection",inputSettings:{options:n,getOptionsLimit:10,createNewOption:a}},{name:"selectLimitOfOptions",label:"Advanced selection with selectLimit prop (Max 2 options)",type:"advancedSelection",inputSettings:{options:n,getOptionsLimit:10,selectLimit:2}}],[n]);return t.jsxs(t.Fragment,{children:[t.jsx("pre",{children:JSON.stringify(g,null," ")}),t.jsx(H,{...r,buttons:M(O),title:"Form Title",description:"Description",fields:c})]})};var y,h,x;i.parameters={...i.parameters,docs:{...(y=i.parameters)==null?void 0:y.docs,source:{originalSource:`({ +import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{r as _}from"./index-BP8_t0zE.js";import{n as T}from"./index.browser-vcSNLBTf.js";import{u as C,F as H}from"./Form-CRl9vEGi.js";import{r as M}from"./renderButtons-BmHfsf_z.js";import{o as s}from"./options-CstHLxTf.js";import{M as j,J as k,c as B}from"./MultiSelectHelper-dY4FeL1L.js";const E={title:"FormFields/FormFieldAdvancedSelection"},i=({label:r,required:g,skeleton:O,disabled:n,instructionText:o,helperText:l,optionsOrigin:a,getOptionsLimit:c,createNewOptionsKnob:p,selectLimit:d})=>{const e=C(),{state:S,handleSubmit:w}=e,v=s?s:[],b=new k(B),L=new j({api:b,labelColumn:"tag",valueColumn:"id",sortColumn:"sort_tag"}),J=async f=>{const D=T(),u={_id:D,tag:f,sort_tag:f,updated:new Date,created:new Date,id:D};s.push({label:u.tag,value:u.id});const q=[...await b.getData(),u];return await b.setData(q),{label:u.tag,value:u.id}},K=_.useMemo(()=>[{name:"advancedSelection",label:r,required:g,disabled:n,helperText:l,instructionText:o,type:"advancedSelection",inputSettings:{options:a==="Local"?v:void 0,getOptions:a==="DB"?L.getOptions.bind(L):void 0,getOptionsLimit:a==="DB"&&c?c:void 0,createNewOption:p?J:void 0,selectLimit:d}}],[r,g,n,l,o,c,v,a,p,d]);return t.jsxs(t.Fragment,{children:[t.jsx("pre",{children:JSON.stringify(S,null," ")}),t.jsx(H,{...e,buttons:M(w),title:"Advanced Selection Field",fields:K,skeleton:O})]})};i.args={label:"Label",disabled:!1,required:!1,skeleton:!1,instructionText:"Instruction text",helperText:"Helper text",optionsOrigin:"Local",getOptionsLimit:5,createNewOptionsKnob:!0,selectLimit:-1};i.argTypes={label:{name:"Label"},disabled:{name:"Disabled"},required:{name:"Required"},skeleton:{name:"Skeleton"},instructionText:{name:"Instruction Text"},helperText:{name:"Helper Text"},optionsOrigin:{name:"Options Origin"},getOptionsLimit:{name:"Get Options Limit"},createNewOptionsKnob:{name:"Create New Option"},selectLimit:{name:"Select Limit"}};const m=()=>{const r=C(),{state:g,handleSubmit:O}=r,n=s?s:[],o=new k(B),l=new j({api:o,labelColumn:"tag",valueColumn:"id",sortColumn:"sort_tag"}),a=async p=>{const d=T(),e={_id:d,tag:p,sort_tag:p,updated:new Date,created:new Date,id:d};s.push({label:e.tag,value:e.id});const w=[...await o.getData(),e];return await o.setData(w),{label:e.tag,value:e.id}},c=_.useMemo(()=>[{name:"checkboxOptions",label:"Advanced selection with options prop",type:"advancedSelection",inputSettings:{options:n}},{name:"getOptions",label:"Advanced selection with getOptions prop",type:"advancedSelection",inputSettings:{getOptions:l.getOptions.bind(l),getOptionsLimit:5}},{name:"createNewOption",label:"Advanced selection with createNewOption prop",type:"advancedSelection",inputSettings:{options:n,getOptionsLimit:10,createNewOption:a}},{name:"selectLimitOfOptions",label:"Advanced selection with selectLimit prop (Max 2 options)",type:"advancedSelection",inputSettings:{options:n,getOptionsLimit:10,selectLimit:2}}],[n]);return t.jsxs(t.Fragment,{children:[t.jsx("pre",{children:JSON.stringify(g,null," ")}),t.jsx(H,{...r,buttons:M(O),title:"Form Title",description:"Description",fields:c})]})};var y,h,x;i.parameters={...i.parameters,docs:{...(y=i.parameters)==null?void 0:y.docs,source:{originalSource:`({ label, required, skeleton, diff --git a/sb8/qa/assets/Button-BL7nnjzP.js b/sb8/qa/assets/Button-CGus-HTO.js similarity index 94% rename from sb8/qa/assets/Button-BL7nnjzP.js rename to sb8/qa/assets/Button-CGus-HTO.js index 501bdf8dde..107de30223 100644 --- a/sb8/qa/assets/Button-BL7nnjzP.js +++ b/sb8/qa/assets/Button-CGus-HTO.js @@ -1,4 +1,4 @@ -import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as e}from"./index-3-_tf5dF.js";import{M as i,C as p}from"./index-oGQ2mxNr.js";import{s,P as m}from"./Button.stories-LtdyEDuc.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./Button-Do5OxnZO.js";import"./theme-DRtZtbPc.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./Create-CpnV7q0W.js";import"./styled-hJgfyZIG.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./createSvgIcon-DE5yaevU.js";import"./Delete-Bd9yuHmM.js";import"./Add-DakDrsh-.js";import"./CloudDownload-BiNecmWM.js";import"./Help-ICrZiAq7.js";import"./ButtonRow-DWtIszZP.js";import"./testIds-DZf96GK8.js";import"./toggleOptions-1cXvXfFl.js";function r(n){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...e(),...n.components};return o.jsxs(o.Fragment,{children:[o.jsx(i,{of:s}),` +import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as e}from"./index-3-_tf5dF.js";import{M as i,C as p}from"./index-BbAFHYha.js";import{s,P as m}from"./Button.stories-LtdyEDuc.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./Button-Do5OxnZO.js";import"./theme-DRtZtbPc.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./Create-CpnV7q0W.js";import"./styled-hJgfyZIG.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./createSvgIcon-DE5yaevU.js";import"./Delete-Bd9yuHmM.js";import"./Add-DakDrsh-.js";import"./CloudDownload-BiNecmWM.js";import"./Help-ICrZiAq7.js";import"./ButtonRow-DWtIszZP.js";import"./testIds-DZf96GK8.js";import"./toggleOptions-1cXvXfFl.js";function r(n){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",...e(),...n.components};return o.jsxs(o.Fragment,{children:[o.jsx(i,{of:s}),` `,o.jsx(t.h1,{id:"button",children:"Button"}),` `,o.jsx(t.p,{children:"Displays a button."}),` `,o.jsx(t.h2,{id:"props",children:"Props"}),` diff --git a/sb8/qa/assets/ButtonRow-DQyOGQtp.js b/sb8/qa/assets/ButtonRow-ljX1cVF2.js similarity index 90% rename from sb8/qa/assets/ButtonRow-DQyOGQtp.js rename to sb8/qa/assets/ButtonRow-ljX1cVF2.js index a25a9bcef4..dc2d946a82 100644 --- a/sb8/qa/assets/ButtonRow-DQyOGQtp.js +++ b/sb8/qa/assets/ButtonRow-ljX1cVF2.js @@ -1,3 +1,3 @@ -import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as i}from"./index-3-_tf5dF.js";import{M as p,C as n}from"./index-oGQ2mxNr.js";import{s,P as e}from"./ButtonRow.stories-Dlf8dxHc.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./styled-components.browser.esm-8MQ3dTkk.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./toggleOptions-1cXvXfFl.js";import"./ButtonRow-DWtIszZP.js";import"./theme-DRtZtbPc.js";import"./Button-Do5OxnZO.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./testIds-DZf96GK8.js";function m(o){const r={h1:"h1",...i(),...o.components};return t.jsxs(t.Fragment,{children:[t.jsx(p,{of:s}),` +import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as i}from"./index-3-_tf5dF.js";import{M as p,C as n}from"./index-BbAFHYha.js";import{s,P as e}from"./ButtonRow.stories-Dlf8dxHc.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./styled-components.browser.esm-8MQ3dTkk.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./toggleOptions-1cXvXfFl.js";import"./ButtonRow-DWtIszZP.js";import"./theme-DRtZtbPc.js";import"./Button-Do5OxnZO.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./testIds-DZf96GK8.js";function m(o){const r={h1:"h1",...i(),...o.components};return t.jsxs(t.Fragment,{children:[t.jsx(p,{of:s}),` `,t.jsx(r.h1,{id:"buttonrow",children:"ButtonRow"}),` `,t.jsx(n,{of:e})]})}function H(o={}){const{wrapper:r}={...i(),...o.components};return r?t.jsx(r,{...o,children:t.jsx(m,{...o})}):m(o)}export{H as default}; diff --git a/sb8/qa/assets/Card-DRSaEp1D.js b/sb8/qa/assets/Card-DImfeiKn.js similarity index 91% rename from sb8/qa/assets/Card-DRSaEp1D.js rename to sb8/qa/assets/Card-DImfeiKn.js index 4feeac1908..047021b382 100644 --- a/sb8/qa/assets/Card-DRSaEp1D.js +++ b/sb8/qa/assets/Card-DImfeiKn.js @@ -1,4 +1,4 @@ -import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as n}from"./index-3-_tf5dF.js";import{M as p,C as i}from"./index-oGQ2mxNr.js";import{s as m,P as s,R as c}from"./Card.stories-BzYv-zGH.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./styled-components.browser.esm-8MQ3dTkk.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./theme-DRtZtbPc.js";import"./testIds-DZf96GK8.js";import"./ButtonRow-DWtIszZP.js";import"./Button-Do5OxnZO.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./Add-DakDrsh-.js";import"./styled-hJgfyZIG.js";import"./createSvgIcon-DE5yaevU.js";import"./Create-CpnV7q0W.js";import"./Delete-Bd9yuHmM.js";import"./formats-sBod7wm8.js";function e(r){const o={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...n(),...r.components};return t.jsxs(t.Fragment,{children:[t.jsx(p,{of:m}),` +import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as n}from"./index-3-_tf5dF.js";import{M as p,C as i}from"./index-BbAFHYha.js";import{s as m,P as s,R as c}from"./Card.stories-BzYv-zGH.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./styled-components.browser.esm-8MQ3dTkk.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./theme-DRtZtbPc.js";import"./testIds-DZf96GK8.js";import"./ButtonRow-DWtIszZP.js";import"./Button-Do5OxnZO.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./Add-DakDrsh-.js";import"./styled-hJgfyZIG.js";import"./createSvgIcon-DE5yaevU.js";import"./Create-CpnV7q0W.js";import"./Delete-Bd9yuHmM.js";import"./formats-sBod7wm8.js";function e(r){const o={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...n(),...r.components};return t.jsxs(t.Fragment,{children:[t.jsx(p,{of:m}),` `,t.jsx(o.h1,{id:"card",children:"Card"}),` `,t.jsxs(o.p,{children:["The ",t.jsx(o.code,{children:"Card"})," component its a wrapper that will render any content that receives as the following RecentActivity component."]}),` `,t.jsx(o.h2,{id:"props",children:"Props"}),` diff --git a/sb8/qa/assets/Checkbox-H8YuhK9L.js b/sb8/qa/assets/Checkbox-BCi8vIYQ.js similarity index 89% rename from sb8/qa/assets/Checkbox-H8YuhK9L.js rename to sb8/qa/assets/Checkbox-BCi8vIYQ.js index e9347aa3c1..622cf7d400 100644 --- a/sb8/qa/assets/Checkbox-H8YuhK9L.js +++ b/sb8/qa/assets/Checkbox-BCi8vIYQ.js @@ -1,4 +1,4 @@ -import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as i}from"./index-3-_tf5dF.js";import{M as s,C as m}from"./index-oGQ2mxNr.js";import{s as p,P as n}from"./Checkbox.stories-DjO9BWdm.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./Checkbox-Q9UDhbdf.js";import"./theme-DRtZtbPc.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";function e(t){const r={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...i(),...t.components};return o.jsxs(o.Fragment,{children:[o.jsx(s,{of:p}),` +import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as i}from"./index-3-_tf5dF.js";import{M as s,C as m}from"./index-BbAFHYha.js";import{s as p,P as n}from"./Checkbox.stories-DjO9BWdm.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./Checkbox-Q9UDhbdf.js";import"./theme-DRtZtbPc.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";function e(t){const r={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...i(),...t.components};return o.jsxs(o.Fragment,{children:[o.jsx(s,{of:p}),` `,o.jsx(r.h1,{id:"checkbox",children:"Checkbox"}),` `,o.jsxs(r.p,{children:[o.jsx(r.code,{children:"Checkbox"})," is a simple wrapper for ",o.jsx(r.a,{href:"https://mui.com/material-ui/react-checkbox/#basic-checkboxes/",rel:"nofollow",children:"MUI Checkbox"})," but with our brand colors."]}),` `,o.jsx(r.h2,{id:"props",children:"Props"}),` diff --git a/sb8/qa/assets/CheckboxList-DL9O_08e.js b/sb8/qa/assets/CheckboxList-a1U_M_fR.js similarity index 91% rename from sb8/qa/assets/CheckboxList-DL9O_08e.js rename to sb8/qa/assets/CheckboxList-a1U_M_fR.js index 974fbe37a5..f52f35c91e 100644 --- a/sb8/qa/assets/CheckboxList-DL9O_08e.js +++ b/sb8/qa/assets/CheckboxList-a1U_M_fR.js @@ -1,4 +1,4 @@ -import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as s}from"./index-3-_tf5dF.js";import{M as r,C as n}from"./index-oGQ2mxNr.js";import{s as p,P as m}from"./CheckboxList.stories-2msDQ8J6.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./theme-DRtZtbPc.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldCheckboxUtils-C4lbz8gc.js";function e(i){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...s(),...i.components};return o.jsxs(o.Fragment,{children:[o.jsx(r,{of:p}),` +import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as s}from"./index-3-_tf5dF.js";import{M as r,C as n}from"./index-BbAFHYha.js";import{s as p,P as m}from"./CheckboxList.stories-2msDQ8J6.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./theme-DRtZtbPc.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldCheckboxUtils-C4lbz8gc.js";function e(i){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...s(),...i.components};return o.jsxs(o.Fragment,{children:[o.jsx(r,{of:p}),` `,o.jsx(t.h1,{id:"checkboxlist",children:"CheckboxList"}),` `,o.jsxs(t.p,{children:[o.jsx(t.code,{children:"CheckboxList"})," is for displaying a list of labeled checkboxes. Clicking the label or the checkbox will select the item."]}),` `,o.jsx(t.p,{children:"If you need a dropdown menu with a list of checkboxes use MenuSelect instead, that wraps this component but provides dropdown capability."}),` diff --git a/sb8/qa/assets/Chip-DbaBEC_F.js b/sb8/qa/assets/Chip-D0v-3ziP.js similarity index 93% rename from sb8/qa/assets/Chip-DbaBEC_F.js rename to sb8/qa/assets/Chip-D0v-3ziP.js index 8e30386ad1..4837097fc3 100644 --- a/sb8/qa/assets/Chip-DbaBEC_F.js +++ b/sb8/qa/assets/Chip-D0v-3ziP.js @@ -1,4 +1,4 @@ -import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as p}from"./index-3-_tf5dF.js";import{M as e,C as n}from"./index-oGQ2mxNr.js";import{s as m,P as s}from"./Chip.stories-BFcvf7ah.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./styled-components.browser.esm-8MQ3dTkk.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./Chip-DoaLK3Y8.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./theme-DRtZtbPc.js";import"./ButtonBase-BZmvw3BH.js";import"./testIds-DZf96GK8.js";function r(t){const i={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...p(),...t.components};return o.jsxs(o.Fragment,{children:[o.jsx(e,{of:m}),` +import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as p}from"./index-3-_tf5dF.js";import{M as e,C as n}from"./index-BbAFHYha.js";import{s as m,P as s}from"./Chip.stories-BFcvf7ah.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./styled-components.browser.esm-8MQ3dTkk.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./Chip-DoaLK3Y8.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./theme-DRtZtbPc.js";import"./ButtonBase-BZmvw3BH.js";import"./testIds-DZf96GK8.js";function r(t){const i={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...p(),...t.components};return o.jsxs(o.Fragment,{children:[o.jsx(e,{of:m}),` `,o.jsx(i.h1,{id:"chip",children:"Chip"}),` `,o.jsxs(i.p,{children:["The ",o.jsx(i.code,{children:"Chip"})," component is built over a simple wrapper for ",o.jsx(i.a,{href:"https://mui.com/material-ui/react-chip/#main-content",rel:"nofollow",children:"MUI Chip"})," but with SimpleView brand colors."]}),` `,o.jsx(i.h2,{id:"props",children:"Props"}),` diff --git a/sb8/qa/assets/Color-PRSJMWNM-CAod4Jrm.js b/sb8/qa/assets/Color-PRSJMWNM-BVhT5zVY.js similarity index 99% rename from sb8/qa/assets/Color-PRSJMWNM-CAod4Jrm.js rename to sb8/qa/assets/Color-PRSJMWNM-BVhT5zVY.js index 8a0036f4eb..884024cc9a 100644 --- a/sb8/qa/assets/Color-PRSJMWNM-CAod4Jrm.js +++ b/sb8/qa/assets/Color-PRSJMWNM-BVhT5zVY.js @@ -1 +1 @@ -import{n as $,e as ue,T as Me,F as Ce,f as $e,g as Oe}from"./index-oGQ2mxNr.js";import{a as h,r as m,g as fe}from"./index-BP8_t0zE.js";import{i as J}from"./index-DJqTsaQd.js";import{_ as Ne,i as Ie}from"./toString-BjCnz-8e.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./index-DrFu-skq.js";function N(){return(N=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function K(e){var t=m.useRef(e),n=m.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var R=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:p.buttons>0)&&o.current?a(ne(o.current,p,s.current)):M(!1)},j=function(){return M(!1)};function M(p){var b=i.current,w=V(o.current),E=p?w.addEventListener:w.removeEventListener;E(b?"touchmove":"mousemove",x),E(b?"touchend":"mouseup",j)}return[function(p){var b=p.nativeEvent,w=o.current;if(w&&(re(b),!function(k,O){return O&&!F(k)}(b,i.current)&&w)){if(F(b)){i.current=!0;var E=b.changedTouches||[];E.length&&(s.current=E[0].identifier)}w.focus(),a(ne(w,b,s.current)),M(!0)}},function(p){var b=p.which||p.keyCode;b<37||b>40||(p.preventDefault(),l({left:b===39?.05:b===37?-.05:0,top:b===40?.05:b===38?-.05:0}))},M]},[l,a]),d=c[0],f=c[1],g=c[2];return m.useEffect(function(){return g},[g]),h.createElement("div",N({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:f,tabIndex:0,role:"slider"}))}),H=function(e){return e.filter(Boolean).join(" ")},ee=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,a=H(["react-colorful__pointer",e.className]);return h.createElement("div",{className:a,style:{top:100*o+"%",left:100*n+"%"}},h.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},y=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},Se={grad:.9,turn:360,rad:360/(2*Math.PI)},Re=function(e){return ge(A(e))},A=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?y(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?y(parseInt(e.substring(6,8),16)/255,2):1}},je=function(e,t){return t===void 0&&(t="deg"),Number(e)*(Se[t]||1)},Te=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?Fe({h:je(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},Fe=function(e){var t=e.s,n=e.l;return{h:e.h,s:(t*=(n<50?n:100-n)/100)>0?2*t/(n+t)*100:0,v:n+t,a:e.a}},ze=function(e){return Pe(de(e))},he=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:y(e.h),s:y(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:y(o/2),a:y(r,2)}},G=function(e){var t=he(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},B=function(e){var t=he(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},de=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),l=r*(1-n),s=r*(1-(t-a)*n),i=r*(1-(1-t+a)*n),c=a%6;return{r:y(255*[r,s,l,l,i,r][c]),g:y(255*[i,r,r,s,l,l][c]),b:y(255*[l,l,i,r,r,s][c]),a:y(o,2)}},He=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?ge({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},P=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Pe=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=o<1?P(y(255*o)):"";return"#"+P(t)+P(n)+P(r)+a},ge=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=Math.max(t,n,r),l=a-Math.min(t,n,r),s=l?a===t?(n-r)/l:a===n?2+(r-t)/l:4+(t-n)/l:0;return{h:y(60*(s<0?s+6:s)),s:y(a?l/a*100:0),v:y(a/255*100),a:o}},me=h.memo(function(e){var t=e.hue,n=e.onChange,r=H(["react-colorful__hue",e.className]);return h.createElement("div",{className:r},h.createElement(Z,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:R(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":y(t),"aria-valuemax":"360","aria-valuemin":"0"},h.createElement(ee,{className:"react-colorful__hue-pointer",left:t/360,color:G({h:t,s:100,v:100,a:1})})))}),be=h.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:G({h:t.h,s:100,v:100,a:1})};return h.createElement("div",{className:"react-colorful__saturation",style:r},h.createElement(Z,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:R(t.s+100*o.left,0,100),v:R(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+y(t.s)+"%, Brightness "+y(t.v)+"%"},h.createElement(ee,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:G(t)})))}),ve=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},pe=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},Le=function(e,t){return e.toLowerCase()===t.toLowerCase()||ve(A(e),A(t))};function ye(e,t,n){var r=K(n),o=m.useState(function(){return e.toHsva(t)}),a=o[0],l=o[1],s=m.useRef({color:t,hsva:a});m.useEffect(function(){if(!e.equal(t,s.current.color)){var c=e.toHsva(t);s.current={hsva:c,color:t},l(c)}},[t,e]),m.useEffect(function(){var c;ve(a,s.current.hsva)||e.equal(c=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:c},r(c))},[a,e,r]);var i=m.useCallback(function(c){l(function(d){return Object.assign({},d,c)})},[]);return[a,i]}var qe=typeof window<"u"?m.useLayoutEffect:m.useEffect,Be=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},oe=new Map,xe=function(e){qe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!oe.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,oe.set(t,n);var r=Be();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},We=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=Q(e,["className","colorModel","color","onChange"]),s=m.useRef(null);xe(s);var i=ye(n,o,a),c=i[0],d=i[1],f=H(["react-colorful",t]);return h.createElement("div",N({},l,{ref:s,className:f}),h.createElement(be,{hsva:c,onChange:d}),h.createElement(me,{hue:c.h,onChange:d,className:"react-colorful__last-control"}))},Xe={defaultColor:"000",toHsva:Re,fromHsva:function(e){return ze({h:e.h,s:e.s,v:e.v,a:1})},equal:Le},De=function(e){return h.createElement(We,N({},e,{colorModel:Xe}))},Ke=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+B(Object.assign({},n,{a:0}))+", "+B(Object.assign({},n,{a:1}))+")"},a=H(["react-colorful__alpha",t]),l=y(100*n.a);return h.createElement("div",{className:a},h.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),h.createElement(Z,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:R(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":l+"%","aria-valuenow":l,"aria-valuemin":"0","aria-valuemax":"100"},h.createElement(ee,{className:"react-colorful__alpha-pointer",left:n.a,color:B(n)})))},we=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=Q(e,["className","colorModel","color","onChange"]),s=m.useRef(null);xe(s);var i=ye(n,o,a),c=i[0],d=i[1],f=H(["react-colorful",t]);return h.createElement("div",N({},l,{ref:s,className:f}),h.createElement(be,{hsva:c,onChange:d}),h.createElement(me,{hue:c.h,onChange:d}),h.createElement(Ke,{hsva:c,onChange:d,className:"react-colorful__last-control"}))},Ve={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:Te,fromHsva:B,equal:pe},Ae=function(e){return h.createElement(we,N({},e,{colorModel:Ve}))},Ge={defaultColor:"rgba(0, 0, 0, 1)",toHsva:He,fromHsva:function(e){var t=de(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:pe},Ue=function(e){return h.createElement(we,N({},e,{colorModel:Ge}))},Ye={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const z=Ye,ke={};for(const e of Object.keys(z))ke[z[e]]=e;const u={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var _e=u;for(const e of Object.keys(u)){if(!("channels"in u[e]))throw new Error("missing channels property: "+e);if(!("labels"in u[e]))throw new Error("missing channel labels property: "+e);if(u[e].labels.length!==u[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=u[e];delete u[e].channels,delete u[e].labels,Object.defineProperty(u[e],"channels",{value:t}),Object.defineProperty(u[e],"labels",{value:n})}u.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),a=Math.max(t,n,r),l=a-o;let s,i;a===o?s=0:t===a?s=(n-r)/l:n===a?s=2+(r-t)/l:r===a&&(s=4+(t-n)/l),s=Math.min(s*60,360),s<0&&(s+=360);const c=(o+a)/2;return a===o?i=0:c<=.5?i=l/(a+o):i=l/(2-a-o),[s,i*100,c*100]};u.rgb.hsv=function(e){let t,n,r,o,a;const l=e[0]/255,s=e[1]/255,i=e[2]/255,c=Math.max(l,s,i),d=c-Math.min(l,s,i),f=function(g){return(c-g)/6/d+1/2};return d===0?(o=0,a=0):(a=d/c,t=f(l),n=f(s),r=f(i),l===c?o=r-n:s===c?o=1/3+t-r:i===c&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[o*360,a*100,c*100]};u.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=u.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,a*100,r*100]};u.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),a=(1-t-o)/(1-o)||0,l=(1-n-o)/(1-o)||0,s=(1-r-o)/(1-o)||0;return[a*100,l*100,s*100,o*100]};function Je(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}u.rgb.keyword=function(e){const t=ke[e];if(t)return t;let n=1/0,r;for(const o of Object.keys(z)){const a=z[o],l=Je(e,a);l.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,l=t*.0193+n*.1192+r*.9505;return[o*100,a*100,l*100]};u.rgb.lab=function(e){const t=u.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const a=116*r-16,l=500*(n-r),s=200*(r-o);return[a,l,s]};u.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,a,l;if(n===0)return l=r*255,[l,l,l];r<.5?o=r*(1+n):o=r+n-r*n;const s=2*r-o,i=[0,0,0];for(let c=0;c<3;c++)a=t+1/3*-(c-1),a<0&&a++,a>1&&a--,6*a<1?l=s+(o-s)*6*a:2*a<1?l=o:3*a<2?l=s+(o-s)*(2/3-a)*6:l=s,i[c]=l*255;return i};u.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=a<=1?a:2-a;const l=(r+n)/2,s=r===0?2*o/(a+o):2*n/(r+n);return[t,s*100,l*100]};u.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,a=t-Math.floor(t),l=255*r*(1-n),s=255*r*(1-n*a),i=255*r*(1-n*(1-a));switch(r*=255,o){case 0:return[r,i,l];case 1:return[s,r,l];case 2:return[l,r,i];case 3:return[l,s,r];case 4:return[i,l,r];case 5:return[r,l,s]}};u.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let a,l;l=(2-n)*r;const s=(2-n)*o;return a=n*o,a/=s<=1?s:2-s,a=a||0,l/=2,[t,a*100,l*100]};u.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let a;o>1&&(n/=o,r/=o);const l=Math.floor(6*t),s=1-r;a=6*t-l,l&1&&(a=1-a);const i=n+a*(s-n);let c,d,f;switch(l){default:case 6:case 0:c=s,d=i,f=n;break;case 1:c=i,d=s,f=n;break;case 2:c=n,d=s,f=i;break;case 3:c=n,d=i,f=s;break;case 4:c=i,d=n,f=s;break;case 5:c=s,d=n,f=i;break}return[c*255,d*255,f*255]};u.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,a=1-Math.min(1,t*(1-o)+o),l=1-Math.min(1,n*(1-o)+o),s=1-Math.min(1,r*(1-o)+o);return[a*255,l*255,s*255]};u.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,a,l;return o=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,l=t*.0557+n*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),l=Math.min(Math.max(0,l),1),[o*255,a*255,l*255]};u.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16,a=500*(t-n),l=200*(n-r);return[o,a,l]};u.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,a,l;a=(t+16)/116,o=n/500+a,l=a-r/200;const s=a**3,i=o**3,c=l**3;return a=s>.008856?s:(a-16/116)/7.787,o=i>.008856?i:(o-16/116)/7.787,l=c>.008856?c:(l-16/116)/7.787,o*=95.047,a*=100,l*=108.883,[o,a,l]};u.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const l=Math.sqrt(n*n+r*r);return[t,l,o]};u.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,a=n*Math.cos(o),l=n*Math.sin(o);return[t,a,l]};u.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let a=t===null?u.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let l=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(l+=60),l};u.hsv.ansi16=function(e){return u.rgb.ansi16(u.hsv.rgb(e),e[2])};u.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};u.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,a=(t>>2&1)*n*255;return[r,o,a]};u.ansi256.rgb=function(e){if(e>=232){const a=(e-232)*10+8;return[a,a,a]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]};u.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};u.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(s=>s+s).join(""));const r=parseInt(n,16),o=r>>16&255,a=r>>8&255,l=r&255;return[o,a,l]};u.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),l=o-a;let s,i;return l<1?s=a/(1-l):s=0,l<=0?i=0:o===t?i=(n-r)/l%6:o===n?i=2+(r-t)/l:i=4+(t-n)/l,i/=6,i%=1,[i*360,l*100,s*100]};u.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]};u.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]};u.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],a=t%1*6,l=a%1,s=1-l;let i=0;switch(Math.floor(a)){case 0:o[0]=1,o[1]=l,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=l;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=l,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return i=(1-n)*r,[(n*o[0]+i)*255,(n*o[1]+i)*255,(n*o[2]+i)*255]};u.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]};u.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]};u.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};u.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,o=r-t;let a=0;return o<1&&(a=(r-o)/(1-o)),[e[0],o*100,a*100]};u.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};u.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};u.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};u.gray.hsl=function(e){return[0,0,e[0]]};u.gray.hsv=u.gray.hsl;u.gray.hwb=function(e){return[0,100,e[0]]};u.gray.cmyk=function(e){return[0,0,0,e[0]]};u.gray.lab=function(e){return[e[0],0,0]};u.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};u.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const W=_e;function Qe(){const e={},t=Object.keys(W);for(let n=t.length,r=0;r1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function lt(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let a=o.length,l=0;l{I[e]={},Object.defineProperty(I[e],"channels",{value:U[e].channels}),Object.defineProperty(I[e],"labels",{value:U[e].labels});const t=rt(e);Object.keys(t).forEach(r=>{const o=t[r];I[e][r]=lt(o),I[e][r].raw=at(o)})});var st=I;const _=fe(st);var it=Ne,ct=function(){return it.Date.now()},ut=ct,ft=/\s/;function ht(e){for(var t=e.length;t--&&ft.test(e.charAt(t)););return t}var dt=ht,gt=dt,mt=/^\s+/;function bt(e){return e&&e.slice(0,gt(e)+1).replace(mt,"")}var vt=bt,pt=vt,ae=J,yt=Ie,le=NaN,xt=/^[-+]0x[0-9a-f]+$/i,wt=/^0b[01]+$/i,kt=/^0o[0-7]+$/i,_t=parseInt;function Et(e){if(typeof e=="number")return e;if(yt(e))return le;if(ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=pt(e);var n=wt.test(e);return n||kt.test(e)?_t(e.slice(2),n?2:8):xt.test(e)?le:+e}var Mt=Et,Ct=J,D=ut,se=Mt,$t="Expected a function",Ot=Math.max,Nt=Math.min;function It(e,t,n){var r,o,a,l,s,i,c=0,d=!1,f=!1,g=!0;if(typeof e!="function")throw new TypeError($t);t=se(t)||0,Ct(n)&&(d=!!n.leading,f="maxWait"in n,a=f?Ot(se(n.maxWait)||0,t):a,g="trailing"in n?!!n.trailing:g);function x(v){var C=r,T=o;return r=o=void 0,c=v,l=e.apply(T,C),l}function j(v){return c=v,s=setTimeout(b,t),d?x(v):l}function M(v){var C=v-i,T=v-c,te=t-C;return f?Nt(te,a-T):te}function p(v){var C=v-i,T=v-c;return i===void 0||C>=t||C<0||f&&T>=a}function b(){var v=D();if(p(v))return w(v);s=setTimeout(b,M(v))}function w(v){return s=void 0,g&&r?x(v):(r=o=void 0,l)}function E(){s!==void 0&&clearTimeout(s),c=0,r=i=o=s=void 0}function k(){return s===void 0?l:w(D())}function O(){var v=D(),C=p(v);if(r=arguments,o=this,i=v,C){if(s===void 0)return j(i);if(f)return clearTimeout(s),s=setTimeout(b,t),x(i)}return s===void 0&&(s=setTimeout(b,t)),l}return O.cancel=E,O.flush=k,O}var St=It,Rt=St,jt=J,Tt="Expected a function";function Ft(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(Tt);return jt(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Rt(e,t,{leading:r,maxWait:t,trailing:o})}var zt=Ft;const Ht=fe(zt);var Pt=$.div({position:"relative",maxWidth:250,'&[aria-readonly="true"]':{opacity:.5}}),Lt=$(ue)({position:"absolute",zIndex:1,top:4,left:4,"[aria-readonly=true] &":{cursor:"not-allowed"}}),qt=$.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),Bt=$(Me)(({theme:e})=>({fontFamily:e.typography.fonts.base})),Wt=$.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),Xt=$.div(({theme:e,active:t})=>({width:16,height:16,boxShadow:t?`${e.appBorderColor} 0 0 0 1px inset, ${e.textMutedColor}50 0 0 0 4px`:`${e.appBorderColor} 0 0 0 1px inset`,borderRadius:e.appBorderRadius})),Dt=`url('data:image/svg+xml;charset=utf-8,')`,ie=({value:e,style:t,...n})=>{let r=`linear-gradient(${e}, ${e}), ${Dt}, linear-gradient(#fff, #fff)`;return h.createElement(Xt,{...n,style:{...t,backgroundImage:r}})},Kt=$(Ce.Input)(({theme:e,readOnly:t})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:e.typography.fonts.base})),Vt=$($e)(({theme:e})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:e.input.color})),Ee=(e=>(e.RGB="rgb",e.HSL="hsl",e.HEX="hex",e))(Ee||{}),L=Object.values(Ee),At=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,Gt=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,Ut=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,Y=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,Yt=/^\s*#?([0-9a-f]{3})\s*$/i,Jt={hex:De,rgb:Ue,hsl:Ae},q={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},ce=e=>{let t=e==null?void 0:e.match(At);if(!t)return[0,0,0,1];let[,n,r,o,a=1]=t;return[n,r,o,a].map(Number)},S=e=>{if(!e)return;let t=!0;if(Gt.test(e)){let[l,s,i,c]=ce(e),[d,f,g]=_.rgb.hsl([l,s,i])||[0,0,0];return{valid:t,value:e,keyword:_.rgb.keyword([l,s,i]),colorSpace:"rgb",rgb:e,hsl:`hsla(${d}, ${f}%, ${g}%, ${c})`,hex:`#${_.rgb.hex([l,s,i]).toLowerCase()}`}}if(Ut.test(e)){let[l,s,i,c]=ce(e),[d,f,g]=_.hsl.rgb([l,s,i])||[0,0,0];return{valid:t,value:e,keyword:_.hsl.keyword([l,s,i]),colorSpace:"hsl",rgb:`rgba(${d}, ${f}, ${g}, ${c})`,hsl:e,hex:`#${_.hsl.hex([l,s,i]).toLowerCase()}`}}let n=e.replace("#",""),r=_.keyword.rgb(n)||_.hex.rgb(n),o=_.rgb.hsl(r),a=e;if(/[^#a-f0-9]/i.test(e)?a=n:Y.test(e)&&(a=`#${n}`),a.startsWith("#"))t=Y.test(a);else try{_.keyword.hex(a)}catch{t=!1}return{valid:t,value:a,keyword:_.rgb.keyword(r),colorSpace:"hex",rgb:`rgba(${r[0]}, ${r[1]}, ${r[2]}, 1)`,hsl:`hsla(${o[0]}, ${o[1]}%, ${o[2]}%, 1)`,hex:a}},Qt=(e,t,n)=>{if(!e||!(t!=null&&t.valid))return q[n];if(n!=="hex")return(t==null?void 0:t[n])||q[n];if(!t.hex.startsWith("#"))try{return`#${_.keyword.hex(t.hex)}`}catch{return q.hex}let r=t.hex.match(Yt);if(!r)return Y.test(t.hex)?t.hex:q.hex;let[o,a,l]=r[1].split("");return`#${o}${o}${a}${a}${l}${l}`},Zt=(e,t)=>{let[n,r]=m.useState(e||""),[o,a]=m.useState(()=>S(n)),[l,s]=m.useState((o==null?void 0:o.colorSpace)||"hex");m.useEffect(()=>{let f=e||"",g=S(f);r(f),a(g),s((g==null?void 0:g.colorSpace)||"hex")},[e]);let i=m.useMemo(()=>Qt(n,o,l).toLowerCase(),[n,o,l]),c=m.useCallback(f=>{let g=S(f),x=(g==null?void 0:g.value)||f||"";r(x),x===""&&(a(void 0),t(void 0)),g&&(a(g),s(g.colorSpace),t(g.value))},[t]),d=m.useCallback(()=>{let f=L.indexOf(l)+1;f>=L.length&&(f=0),s(L[f]);let g=(o==null?void 0:o[L[f]])||"";r(g),t(g)},[o,l,t]);return{value:n,realValue:i,updateValue:c,color:o,colorSpace:l,cycleColorSpace:d}},X=e=>e.replace(/\s*/,"").toLowerCase(),en=(e,t,n)=>{let[r,o]=m.useState(t!=null&&t.valid?[t]:[]);m.useEffect(()=>{t===void 0&&o([])},[t]);let a=m.useMemo(()=>(e||[]).map(s=>typeof s=="string"?S(s):s.title?{...S(s.color),keyword:s.title}:S(s.color)).concat(r).filter(Boolean).slice(-27),[e,r]),l=m.useCallback(s=>{s!=null&&s.valid&&(a.some(i=>X(i[n])===X(s[n]))||o(i=>i.concat(s)))},[n,a]);return{presets:a,addPreset:l}},tn=({name:e,value:t,onChange:n,onFocus:r,onBlur:o,presetColors:a,startOpen:l=!1,argType:s})=>{var E;let i=m.useCallback(Ht(n,200),[n]),{value:c,realValue:d,updateValue:f,color:g,colorSpace:x,cycleColorSpace:j}=Zt(t,i),{presets:M,addPreset:p}=en(a,g,x),b=Jt[x],w=!!((E=s==null?void 0:s.table)!=null&&E.readonly);return h.createElement(Pt,{"aria-readonly":w},h.createElement(Lt,{startOpen:l,trigger:w?[null]:void 0,closeOnOutsideClick:!0,onVisibleChange:()=>p(g),tooltip:h.createElement(qt,null,h.createElement(b,{color:d==="transparent"?"#000000":d,onChange:f,onFocus:r,onBlur:o}),M.length>0&&h.createElement(Wt,null,M.map((k,O)=>h.createElement(ue,{key:`${k.value}-${O}`,hasChrome:!1,tooltip:h.createElement(Bt,{note:k.keyword||k.value})},h.createElement(ie,{value:k[x],active:g&&X(k[x])===X(g[x]),onClick:()=>f(k.value)})))))},h.createElement(ie,{value:d,style:{margin:4}})),h.createElement(Kt,{id:Oe(e),value:c,onChange:k=>f(k.target.value),onFocus:k=>k.target.select(),readOnly:w,placeholder:"Choose color..."}),c?h.createElement(Vt,{onClick:j}):null)},mn=tn;export{tn as ColorControl,mn as default}; +import{n as $,e as ue,T as Me,F as Ce,f as $e,g as Oe}from"./index-BbAFHYha.js";import{a as h,r as m,g as fe}from"./index-BP8_t0zE.js";import{i as J}from"./index-DJqTsaQd.js";import{_ as Ne,i as Ie}from"./toString-BjCnz-8e.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./index-DrFu-skq.js";function N(){return(N=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function K(e){var t=m.useRef(e),n=m.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var R=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:p.buttons>0)&&o.current?a(ne(o.current,p,s.current)):M(!1)},j=function(){return M(!1)};function M(p){var b=i.current,w=V(o.current),E=p?w.addEventListener:w.removeEventListener;E(b?"touchmove":"mousemove",x),E(b?"touchend":"mouseup",j)}return[function(p){var b=p.nativeEvent,w=o.current;if(w&&(re(b),!function(k,O){return O&&!F(k)}(b,i.current)&&w)){if(F(b)){i.current=!0;var E=b.changedTouches||[];E.length&&(s.current=E[0].identifier)}w.focus(),a(ne(w,b,s.current)),M(!0)}},function(p){var b=p.which||p.keyCode;b<37||b>40||(p.preventDefault(),l({left:b===39?.05:b===37?-.05:0,top:b===40?.05:b===38?-.05:0}))},M]},[l,a]),d=c[0],f=c[1],g=c[2];return m.useEffect(function(){return g},[g]),h.createElement("div",N({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:f,tabIndex:0,role:"slider"}))}),H=function(e){return e.filter(Boolean).join(" ")},ee=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,a=H(["react-colorful__pointer",e.className]);return h.createElement("div",{className:a,style:{top:100*o+"%",left:100*n+"%"}},h.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},y=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},Se={grad:.9,turn:360,rad:360/(2*Math.PI)},Re=function(e){return ge(A(e))},A=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?y(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?y(parseInt(e.substring(6,8),16)/255,2):1}},je=function(e,t){return t===void 0&&(t="deg"),Number(e)*(Se[t]||1)},Te=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?Fe({h:je(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},Fe=function(e){var t=e.s,n=e.l;return{h:e.h,s:(t*=(n<50?n:100-n)/100)>0?2*t/(n+t)*100:0,v:n+t,a:e.a}},ze=function(e){return Pe(de(e))},he=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:y(e.h),s:y(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:y(o/2),a:y(r,2)}},G=function(e){var t=he(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},B=function(e){var t=he(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},de=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),l=r*(1-n),s=r*(1-(t-a)*n),i=r*(1-(1-t+a)*n),c=a%6;return{r:y(255*[r,s,l,l,i,r][c]),g:y(255*[i,r,r,s,l,l][c]),b:y(255*[l,l,i,r,r,s][c]),a:y(o,2)}},He=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?ge({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},P=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Pe=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=o<1?P(y(255*o)):"";return"#"+P(t)+P(n)+P(r)+a},ge=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=Math.max(t,n,r),l=a-Math.min(t,n,r),s=l?a===t?(n-r)/l:a===n?2+(r-t)/l:4+(t-n)/l:0;return{h:y(60*(s<0?s+6:s)),s:y(a?l/a*100:0),v:y(a/255*100),a:o}},me=h.memo(function(e){var t=e.hue,n=e.onChange,r=H(["react-colorful__hue",e.className]);return h.createElement("div",{className:r},h.createElement(Z,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:R(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":y(t),"aria-valuemax":"360","aria-valuemin":"0"},h.createElement(ee,{className:"react-colorful__hue-pointer",left:t/360,color:G({h:t,s:100,v:100,a:1})})))}),be=h.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:G({h:t.h,s:100,v:100,a:1})};return h.createElement("div",{className:"react-colorful__saturation",style:r},h.createElement(Z,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:R(t.s+100*o.left,0,100),v:R(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+y(t.s)+"%, Brightness "+y(t.v)+"%"},h.createElement(ee,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:G(t)})))}),ve=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},pe=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},Le=function(e,t){return e.toLowerCase()===t.toLowerCase()||ve(A(e),A(t))};function ye(e,t,n){var r=K(n),o=m.useState(function(){return e.toHsva(t)}),a=o[0],l=o[1],s=m.useRef({color:t,hsva:a});m.useEffect(function(){if(!e.equal(t,s.current.color)){var c=e.toHsva(t);s.current={hsva:c,color:t},l(c)}},[t,e]),m.useEffect(function(){var c;ve(a,s.current.hsva)||e.equal(c=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:c},r(c))},[a,e,r]);var i=m.useCallback(function(c){l(function(d){return Object.assign({},d,c)})},[]);return[a,i]}var qe=typeof window<"u"?m.useLayoutEffect:m.useEffect,Be=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},oe=new Map,xe=function(e){qe(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!oe.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,oe.set(t,n);var r=Be();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},We=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=Q(e,["className","colorModel","color","onChange"]),s=m.useRef(null);xe(s);var i=ye(n,o,a),c=i[0],d=i[1],f=H(["react-colorful",t]);return h.createElement("div",N({},l,{ref:s,className:f}),h.createElement(be,{hsva:c,onChange:d}),h.createElement(me,{hue:c.h,onChange:d,className:"react-colorful__last-control"}))},Xe={defaultColor:"000",toHsva:Re,fromHsva:function(e){return ze({h:e.h,s:e.s,v:e.v,a:1})},equal:Le},De=function(e){return h.createElement(We,N({},e,{colorModel:Xe}))},Ke=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+B(Object.assign({},n,{a:0}))+", "+B(Object.assign({},n,{a:1}))+")"},a=H(["react-colorful__alpha",t]),l=y(100*n.a);return h.createElement("div",{className:a},h.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),h.createElement(Z,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:R(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":l+"%","aria-valuenow":l,"aria-valuemin":"0","aria-valuemax":"100"},h.createElement(ee,{className:"react-colorful__alpha-pointer",left:n.a,color:B(n)})))},we=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=Q(e,["className","colorModel","color","onChange"]),s=m.useRef(null);xe(s);var i=ye(n,o,a),c=i[0],d=i[1],f=H(["react-colorful",t]);return h.createElement("div",N({},l,{ref:s,className:f}),h.createElement(be,{hsva:c,onChange:d}),h.createElement(me,{hue:c.h,onChange:d}),h.createElement(Ke,{hsva:c,onChange:d,className:"react-colorful__last-control"}))},Ve={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:Te,fromHsva:B,equal:pe},Ae=function(e){return h.createElement(we,N({},e,{colorModel:Ve}))},Ge={defaultColor:"rgba(0, 0, 0, 1)",toHsva:He,fromHsva:function(e){var t=de(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:pe},Ue=function(e){return h.createElement(we,N({},e,{colorModel:Ge}))},Ye={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const z=Ye,ke={};for(const e of Object.keys(z))ke[z[e]]=e;const u={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var _e=u;for(const e of Object.keys(u)){if(!("channels"in u[e]))throw new Error("missing channels property: "+e);if(!("labels"in u[e]))throw new Error("missing channel labels property: "+e);if(u[e].labels.length!==u[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=u[e];delete u[e].channels,delete u[e].labels,Object.defineProperty(u[e],"channels",{value:t}),Object.defineProperty(u[e],"labels",{value:n})}u.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),a=Math.max(t,n,r),l=a-o;let s,i;a===o?s=0:t===a?s=(n-r)/l:n===a?s=2+(r-t)/l:r===a&&(s=4+(t-n)/l),s=Math.min(s*60,360),s<0&&(s+=360);const c=(o+a)/2;return a===o?i=0:c<=.5?i=l/(a+o):i=l/(2-a-o),[s,i*100,c*100]};u.rgb.hsv=function(e){let t,n,r,o,a;const l=e[0]/255,s=e[1]/255,i=e[2]/255,c=Math.max(l,s,i),d=c-Math.min(l,s,i),f=function(g){return(c-g)/6/d+1/2};return d===0?(o=0,a=0):(a=d/c,t=f(l),n=f(s),r=f(i),l===c?o=r-n:s===c?o=1/3+t-r:i===c&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[o*360,a*100,c*100]};u.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=u.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,a*100,r*100]};u.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),a=(1-t-o)/(1-o)||0,l=(1-n-o)/(1-o)||0,s=(1-r-o)/(1-o)||0;return[a*100,l*100,s*100,o*100]};function Je(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}u.rgb.keyword=function(e){const t=ke[e];if(t)return t;let n=1/0,r;for(const o of Object.keys(z)){const a=z[o],l=Je(e,a);l.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,l=t*.0193+n*.1192+r*.9505;return[o*100,a*100,l*100]};u.rgb.lab=function(e){const t=u.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const a=116*r-16,l=500*(n-r),s=200*(r-o);return[a,l,s]};u.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,a,l;if(n===0)return l=r*255,[l,l,l];r<.5?o=r*(1+n):o=r+n-r*n;const s=2*r-o,i=[0,0,0];for(let c=0;c<3;c++)a=t+1/3*-(c-1),a<0&&a++,a>1&&a--,6*a<1?l=s+(o-s)*6*a:2*a<1?l=o:3*a<2?l=s+(o-s)*(2/3-a)*6:l=s,i[c]=l*255;return i};u.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=a<=1?a:2-a;const l=(r+n)/2,s=r===0?2*o/(a+o):2*n/(r+n);return[t,s*100,l*100]};u.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,a=t-Math.floor(t),l=255*r*(1-n),s=255*r*(1-n*a),i=255*r*(1-n*(1-a));switch(r*=255,o){case 0:return[r,i,l];case 1:return[s,r,l];case 2:return[l,r,i];case 3:return[l,s,r];case 4:return[i,l,r];case 5:return[r,l,s]}};u.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let a,l;l=(2-n)*r;const s=(2-n)*o;return a=n*o,a/=s<=1?s:2-s,a=a||0,l/=2,[t,a*100,l*100]};u.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let a;o>1&&(n/=o,r/=o);const l=Math.floor(6*t),s=1-r;a=6*t-l,l&1&&(a=1-a);const i=n+a*(s-n);let c,d,f;switch(l){default:case 6:case 0:c=s,d=i,f=n;break;case 1:c=i,d=s,f=n;break;case 2:c=n,d=s,f=i;break;case 3:c=n,d=i,f=s;break;case 4:c=i,d=n,f=s;break;case 5:c=s,d=n,f=i;break}return[c*255,d*255,f*255]};u.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,a=1-Math.min(1,t*(1-o)+o),l=1-Math.min(1,n*(1-o)+o),s=1-Math.min(1,r*(1-o)+o);return[a*255,l*255,s*255]};u.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,a,l;return o=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,l=t*.0557+n*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),l=Math.min(Math.max(0,l),1),[o*255,a*255,l*255]};u.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16,a=500*(t-n),l=200*(n-r);return[o,a,l]};u.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,a,l;a=(t+16)/116,o=n/500+a,l=a-r/200;const s=a**3,i=o**3,c=l**3;return a=s>.008856?s:(a-16/116)/7.787,o=i>.008856?i:(o-16/116)/7.787,l=c>.008856?c:(l-16/116)/7.787,o*=95.047,a*=100,l*=108.883,[o,a,l]};u.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const l=Math.sqrt(n*n+r*r);return[t,l,o]};u.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,a=n*Math.cos(o),l=n*Math.sin(o);return[t,a,l]};u.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let a=t===null?u.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let l=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(l+=60),l};u.hsv.ansi16=function(e){return u.rgb.ansi16(u.hsv.rgb(e),e[2])};u.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};u.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,a=(t>>2&1)*n*255;return[r,o,a]};u.ansi256.rgb=function(e){if(e>=232){const a=(e-232)*10+8;return[a,a,a]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]};u.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};u.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(s=>s+s).join(""));const r=parseInt(n,16),o=r>>16&255,a=r>>8&255,l=r&255;return[o,a,l]};u.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),l=o-a;let s,i;return l<1?s=a/(1-l):s=0,l<=0?i=0:o===t?i=(n-r)/l%6:o===n?i=2+(r-t)/l:i=4+(t-n)/l,i/=6,i%=1,[i*360,l*100,s*100]};u.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]};u.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]};u.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],a=t%1*6,l=a%1,s=1-l;let i=0;switch(Math.floor(a)){case 0:o[0]=1,o[1]=l,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=l;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=l,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return i=(1-n)*r,[(n*o[0]+i)*255,(n*o[1]+i)*255,(n*o[2]+i)*255]};u.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]};u.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]};u.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};u.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,o=r-t;let a=0;return o<1&&(a=(r-o)/(1-o)),[e[0],o*100,a*100]};u.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};u.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};u.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};u.gray.hsl=function(e){return[0,0,e[0]]};u.gray.hsv=u.gray.hsl;u.gray.hwb=function(e){return[0,100,e[0]]};u.gray.cmyk=function(e){return[0,0,0,e[0]]};u.gray.lab=function(e){return[e[0],0,0]};u.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};u.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const W=_e;function Qe(){const e={},t=Object.keys(W);for(let n=t.length,r=0;r1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function lt(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let a=o.length,l=0;l{I[e]={},Object.defineProperty(I[e],"channels",{value:U[e].channels}),Object.defineProperty(I[e],"labels",{value:U[e].labels});const t=rt(e);Object.keys(t).forEach(r=>{const o=t[r];I[e][r]=lt(o),I[e][r].raw=at(o)})});var st=I;const _=fe(st);var it=Ne,ct=function(){return it.Date.now()},ut=ct,ft=/\s/;function ht(e){for(var t=e.length;t--&&ft.test(e.charAt(t)););return t}var dt=ht,gt=dt,mt=/^\s+/;function bt(e){return e&&e.slice(0,gt(e)+1).replace(mt,"")}var vt=bt,pt=vt,ae=J,yt=Ie,le=NaN,xt=/^[-+]0x[0-9a-f]+$/i,wt=/^0b[01]+$/i,kt=/^0o[0-7]+$/i,_t=parseInt;function Et(e){if(typeof e=="number")return e;if(yt(e))return le;if(ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=pt(e);var n=wt.test(e);return n||kt.test(e)?_t(e.slice(2),n?2:8):xt.test(e)?le:+e}var Mt=Et,Ct=J,D=ut,se=Mt,$t="Expected a function",Ot=Math.max,Nt=Math.min;function It(e,t,n){var r,o,a,l,s,i,c=0,d=!1,f=!1,g=!0;if(typeof e!="function")throw new TypeError($t);t=se(t)||0,Ct(n)&&(d=!!n.leading,f="maxWait"in n,a=f?Ot(se(n.maxWait)||0,t):a,g="trailing"in n?!!n.trailing:g);function x(v){var C=r,T=o;return r=o=void 0,c=v,l=e.apply(T,C),l}function j(v){return c=v,s=setTimeout(b,t),d?x(v):l}function M(v){var C=v-i,T=v-c,te=t-C;return f?Nt(te,a-T):te}function p(v){var C=v-i,T=v-c;return i===void 0||C>=t||C<0||f&&T>=a}function b(){var v=D();if(p(v))return w(v);s=setTimeout(b,M(v))}function w(v){return s=void 0,g&&r?x(v):(r=o=void 0,l)}function E(){s!==void 0&&clearTimeout(s),c=0,r=i=o=s=void 0}function k(){return s===void 0?l:w(D())}function O(){var v=D(),C=p(v);if(r=arguments,o=this,i=v,C){if(s===void 0)return j(i);if(f)return clearTimeout(s),s=setTimeout(b,t),x(i)}return s===void 0&&(s=setTimeout(b,t)),l}return O.cancel=E,O.flush=k,O}var St=It,Rt=St,jt=J,Tt="Expected a function";function Ft(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(Tt);return jt(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Rt(e,t,{leading:r,maxWait:t,trailing:o})}var zt=Ft;const Ht=fe(zt);var Pt=$.div({position:"relative",maxWidth:250,'&[aria-readonly="true"]':{opacity:.5}}),Lt=$(ue)({position:"absolute",zIndex:1,top:4,left:4,"[aria-readonly=true] &":{cursor:"not-allowed"}}),qt=$.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),Bt=$(Me)(({theme:e})=>({fontFamily:e.typography.fonts.base})),Wt=$.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),Xt=$.div(({theme:e,active:t})=>({width:16,height:16,boxShadow:t?`${e.appBorderColor} 0 0 0 1px inset, ${e.textMutedColor}50 0 0 0 4px`:`${e.appBorderColor} 0 0 0 1px inset`,borderRadius:e.appBorderRadius})),Dt=`url('data:image/svg+xml;charset=utf-8,')`,ie=({value:e,style:t,...n})=>{let r=`linear-gradient(${e}, ${e}), ${Dt}, linear-gradient(#fff, #fff)`;return h.createElement(Xt,{...n,style:{...t,backgroundImage:r}})},Kt=$(Ce.Input)(({theme:e,readOnly:t})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:e.typography.fonts.base})),Vt=$($e)(({theme:e})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:e.input.color})),Ee=(e=>(e.RGB="rgb",e.HSL="hsl",e.HEX="hex",e))(Ee||{}),L=Object.values(Ee),At=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,Gt=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,Ut=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,Y=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,Yt=/^\s*#?([0-9a-f]{3})\s*$/i,Jt={hex:De,rgb:Ue,hsl:Ae},q={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},ce=e=>{let t=e==null?void 0:e.match(At);if(!t)return[0,0,0,1];let[,n,r,o,a=1]=t;return[n,r,o,a].map(Number)},S=e=>{if(!e)return;let t=!0;if(Gt.test(e)){let[l,s,i,c]=ce(e),[d,f,g]=_.rgb.hsl([l,s,i])||[0,0,0];return{valid:t,value:e,keyword:_.rgb.keyword([l,s,i]),colorSpace:"rgb",rgb:e,hsl:`hsla(${d}, ${f}%, ${g}%, ${c})`,hex:`#${_.rgb.hex([l,s,i]).toLowerCase()}`}}if(Ut.test(e)){let[l,s,i,c]=ce(e),[d,f,g]=_.hsl.rgb([l,s,i])||[0,0,0];return{valid:t,value:e,keyword:_.hsl.keyword([l,s,i]),colorSpace:"hsl",rgb:`rgba(${d}, ${f}, ${g}, ${c})`,hsl:e,hex:`#${_.hsl.hex([l,s,i]).toLowerCase()}`}}let n=e.replace("#",""),r=_.keyword.rgb(n)||_.hex.rgb(n),o=_.rgb.hsl(r),a=e;if(/[^#a-f0-9]/i.test(e)?a=n:Y.test(e)&&(a=`#${n}`),a.startsWith("#"))t=Y.test(a);else try{_.keyword.hex(a)}catch{t=!1}return{valid:t,value:a,keyword:_.rgb.keyword(r),colorSpace:"hex",rgb:`rgba(${r[0]}, ${r[1]}, ${r[2]}, 1)`,hsl:`hsla(${o[0]}, ${o[1]}%, ${o[2]}%, 1)`,hex:a}},Qt=(e,t,n)=>{if(!e||!(t!=null&&t.valid))return q[n];if(n!=="hex")return(t==null?void 0:t[n])||q[n];if(!t.hex.startsWith("#"))try{return`#${_.keyword.hex(t.hex)}`}catch{return q.hex}let r=t.hex.match(Yt);if(!r)return Y.test(t.hex)?t.hex:q.hex;let[o,a,l]=r[1].split("");return`#${o}${o}${a}${a}${l}${l}`},Zt=(e,t)=>{let[n,r]=m.useState(e||""),[o,a]=m.useState(()=>S(n)),[l,s]=m.useState((o==null?void 0:o.colorSpace)||"hex");m.useEffect(()=>{let f=e||"",g=S(f);r(f),a(g),s((g==null?void 0:g.colorSpace)||"hex")},[e]);let i=m.useMemo(()=>Qt(n,o,l).toLowerCase(),[n,o,l]),c=m.useCallback(f=>{let g=S(f),x=(g==null?void 0:g.value)||f||"";r(x),x===""&&(a(void 0),t(void 0)),g&&(a(g),s(g.colorSpace),t(g.value))},[t]),d=m.useCallback(()=>{let f=L.indexOf(l)+1;f>=L.length&&(f=0),s(L[f]);let g=(o==null?void 0:o[L[f]])||"";r(g),t(g)},[o,l,t]);return{value:n,realValue:i,updateValue:c,color:o,colorSpace:l,cycleColorSpace:d}},X=e=>e.replace(/\s*/,"").toLowerCase(),en=(e,t,n)=>{let[r,o]=m.useState(t!=null&&t.valid?[t]:[]);m.useEffect(()=>{t===void 0&&o([])},[t]);let a=m.useMemo(()=>(e||[]).map(s=>typeof s=="string"?S(s):s.title?{...S(s.color),keyword:s.title}:S(s.color)).concat(r).filter(Boolean).slice(-27),[e,r]),l=m.useCallback(s=>{s!=null&&s.valid&&(a.some(i=>X(i[n])===X(s[n]))||o(i=>i.concat(s)))},[n,a]);return{presets:a,addPreset:l}},tn=({name:e,value:t,onChange:n,onFocus:r,onBlur:o,presetColors:a,startOpen:l=!1,argType:s})=>{var E;let i=m.useCallback(Ht(n,200),[n]),{value:c,realValue:d,updateValue:f,color:g,colorSpace:x,cycleColorSpace:j}=Zt(t,i),{presets:M,addPreset:p}=en(a,g,x),b=Jt[x],w=!!((E=s==null?void 0:s.table)!=null&&E.readonly);return h.createElement(Pt,{"aria-readonly":w},h.createElement(Lt,{startOpen:l,trigger:w?[null]:void 0,closeOnOutsideClick:!0,onVisibleChange:()=>p(g),tooltip:h.createElement(qt,null,h.createElement(b,{color:d==="transparent"?"#000000":d,onChange:f,onFocus:r,onBlur:o}),M.length>0&&h.createElement(Wt,null,M.map((k,O)=>h.createElement(ue,{key:`${k.value}-${O}`,hasChrome:!1,tooltip:h.createElement(Bt,{note:k.keyword||k.value})},h.createElement(ie,{value:k[x],active:g&&X(k[x])===X(g[x]),onClick:()=>f(k.value)})))))},h.createElement(ie,{value:d,style:{margin:4}})),h.createElement(Kt,{id:Oe(e),value:c,onChange:k=>f(k.target.value),onFocus:k=>k.target.select(),readOnly:w,placeholder:"Choose color..."}),c?h.createElement(Vt,{onClick:j}):null)},mn=tn;export{tn as ColorControl,mn as default}; diff --git a/sb8/qa/assets/ConditionalFields.stories-CzWgAQLR.js b/sb8/qa/assets/ConditionalFields.stories-C0pzXX-A.js similarity index 98% rename from sb8/qa/assets/ConditionalFields.stories-CzWgAQLR.js rename to sb8/qa/assets/ConditionalFields.stories-C0pzXX-A.js index a9f4d0c94a..54e749ce62 100644 --- a/sb8/qa/assets/ConditionalFields.stories-CzWgAQLR.js +++ b/sb8/qa/assets/ConditionalFields.stories-C0pzXX-A.js @@ -1,4 +1,4 @@ -import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as i}from"./index-BP8_t0zE.js";import{u as c,F as y}from"./Form-CecvGgxl.js";import{r as h}from"./renderButtons-BmHfsf_z.js";import{O as f}from"./utils-BR2PSRFh.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./index-BxmsGmlx.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";const bt={title:"Components/Form"},t=({showState:d})=>{const o=c(),{state:l,handleSubmit:a}=o,n="SHOW";i.useEffect(()=>(document.body.style.margin="0px",()=>{document.body.style.margin=f}),[]);const u=i.useMemo(()=>[{name:"dependency",label:"Dependency",type:"text",instructionText:`Type "${n}" to show another field`,required:!0},{name:"dependent",label:"Dependent",type:"text",show:({data:r})=>(r==null?void 0:r.dependency)===n,required:!0}],[]);return e.jsxs(e.Fragment,{children:[d&&e.jsx("pre",{children:JSON.stringify(l,null," ")}),e.jsx("div",{style:{height:"100vh"},children:e.jsx(y,{...o,buttons:h(a),title:"Runtime behaviors",fields:u})})]})};t.args={showState:!1};t.argTypes={showState:{name:"Show state"}};var m,p,s;t.parameters={...t.parameters,docs:{...(m=t.parameters)==null?void 0:m.docs,source:{originalSource:`({ +import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as i}from"./index-BP8_t0zE.js";import{u as c,F as y}from"./Form-CRl9vEGi.js";import{r as h}from"./renderButtons-BmHfsf_z.js";import{O as f}from"./utils-BR2PSRFh.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./index-BxmsGmlx.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";const bt={title:"Components/Form"},t=({showState:d})=>{const o=c(),{state:l,handleSubmit:a}=o,n="SHOW";i.useEffect(()=>(document.body.style.margin="0px",()=>{document.body.style.margin=f}),[]);const u=i.useMemo(()=>[{name:"dependency",label:"Dependency",type:"text",instructionText:`Type "${n}" to show another field`,required:!0},{name:"dependent",label:"Dependent",type:"text",show:({data:r})=>(r==null?void 0:r.dependency)===n,required:!0}],[]);return e.jsxs(e.Fragment,{children:[d&&e.jsx("pre",{children:JSON.stringify(l,null," ")}),e.jsx("div",{style:{height:"100vh"},children:e.jsx(y,{...o,buttons:h(a),title:"Runtime behaviors",fields:u})})]})};t.args={showState:!1};t.argTypes={showState:{name:"Show state"}};var m,p,s;t.parameters={...t.parameters,docs:{...(m=t.parameters)==null?void 0:m.docs,source:{originalSource:`({ showState }: typeof ConditionalFields.args): ReactElement => { const controller = useForm(); diff --git a/sb8/qa/assets/ConditionalSections.stories-DtD6qEqq.js b/sb8/qa/assets/ConditionalSections.stories-BFeSssEW.js similarity index 98% rename from sb8/qa/assets/ConditionalSections.stories-DtD6qEqq.js rename to sb8/qa/assets/ConditionalSections.stories-BFeSssEW.js index e86ba041c2..ffd0600934 100644 --- a/sb8/qa/assets/ConditionalSections.stories-DtD6qEqq.js +++ b/sb8/qa/assets/ConditionalSections.stories-BFeSssEW.js @@ -1,4 +1,4 @@ -import{j as n}from"./jsx-runtime-nGUw9YhZ.js";import{r}from"./index-BP8_t0zE.js";import{u as h,F as y}from"./Form-CecvGgxl.js";import{r as f}from"./renderButtons-BmHfsf_z.js";import{O as S}from"./utils-BR2PSRFh.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./index-BxmsGmlx.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";const be={title:"Components/Form"},t=({showState:c})=>{const i=h(),{state:d,handleSubmit:l}=i,o="SHOW";r.useEffect(()=>(document.body.style.margin="0px",()=>{document.body.style.margin=S}),[]);const a=r.useMemo(()=>[{title:"Section 1",description:"Description for section 1",fields:[[["dependency"]],[["section_show"]]]},{title:"Section 2",description:"Description for section 2",fields:[[["dependent"]]],show:({data:e})=>(e==null?void 0:e.dependency)===o&&(e==null?void 0:e.section_show)}],[]),u=r.useMemo(()=>[{name:"dependency",label:"Dependency",type:"text",instructionText:`Type "${o}" to show another field`,required:!0},{name:"section_show",label:"Show another section",type:"toggle",show:({data:e})=>(e==null?void 0:e.dependency)===o},{name:"dependent",label:"Dependent",type:"text",required:!0}],[]);return n.jsxs(n.Fragment,{children:[c&&n.jsx("pre",{children:JSON.stringify(d,null," ")}),n.jsx("div",{style:{height:"100vh"},children:n.jsx(y,{...i,buttons:f(l),title:"Runtime behaviors",fields:u,sections:a})})]})};t.args={showState:!1};t.argTypes={showState:{name:"Show state"}};var s,p,m;t.parameters={...t.parameters,docs:{...(s=t.parameters)==null?void 0:s.docs,source:{originalSource:`({ +import{j as n}from"./jsx-runtime-nGUw9YhZ.js";import{r}from"./index-BP8_t0zE.js";import{u as h,F as y}from"./Form-CRl9vEGi.js";import{r as f}from"./renderButtons-BmHfsf_z.js";import{O as S}from"./utils-BR2PSRFh.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./index-BxmsGmlx.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";const be={title:"Components/Form"},t=({showState:c})=>{const i=h(),{state:d,handleSubmit:l}=i,o="SHOW";r.useEffect(()=>(document.body.style.margin="0px",()=>{document.body.style.margin=S}),[]);const a=r.useMemo(()=>[{title:"Section 1",description:"Description for section 1",fields:[[["dependency"]],[["section_show"]]]},{title:"Section 2",description:"Description for section 2",fields:[[["dependent"]]],show:({data:e})=>(e==null?void 0:e.dependency)===o&&(e==null?void 0:e.section_show)}],[]),u=r.useMemo(()=>[{name:"dependency",label:"Dependency",type:"text",instructionText:`Type "${o}" to show another field`,required:!0},{name:"section_show",label:"Show another section",type:"toggle",show:({data:e})=>(e==null?void 0:e.dependency)===o},{name:"dependent",label:"Dependent",type:"text",required:!0}],[]);return n.jsxs(n.Fragment,{children:[c&&n.jsx("pre",{children:JSON.stringify(d,null," ")}),n.jsx("div",{style:{height:"100vh"},children:n.jsx(y,{...i,buttons:f(l),title:"Runtime behaviors",fields:u,sections:a})})]})};t.args={showState:!1};t.argTypes={showState:{name:"Show state"}};var s,p,m;t.parameters={...t.parameters,docs:{...(s=t.parameters)==null?void 0:s.docs,source:{originalSource:`({ showState }: typeof ConditionalSections.args): ReactElement => { const controller = useForm(); diff --git a/sb8/qa/assets/Content-CZTjyAQw.js b/sb8/qa/assets/Content-BgPagL-k.js similarity index 97% rename from sb8/qa/assets/Content-CZTjyAQw.js rename to sb8/qa/assets/Content-BgPagL-k.js index 9fdc7fc5b0..e9b41a172d 100644 --- a/sb8/qa/assets/Content-CZTjyAQw.js +++ b/sb8/qa/assets/Content-BgPagL-k.js @@ -1,4 +1,4 @@ -import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as r}from"./index-3-_tf5dF.js";import{M as i,C as s}from"./index-oGQ2mxNr.js";import{s as l,P as a}from"./Content.stories-iDuKhpps.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./column_transforms-CyX7y3_5.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./theme-DRtZtbPc.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./ColorSelected-HjDSMxjB.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./createSvgIcon-CcHL1II5.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./Chip-DoaLK3Y8.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./TitleWrapper-D2l-_w9e.js";import"./containerQuery-C0QVV4Kt.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./Image-DW9YTXUC.js";import"./formats-sBod7wm8.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Edit-hiJ2yy-Y.js";import"./styled-hJgfyZIG.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./createSvgIcon-DE5yaevU.js";import"./Typography-aSbaE-Qi.js";function o(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...r(),...e.components};return t.jsxs(t.Fragment,{children:[t.jsx(i,{of:l}),` +import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as r}from"./index-3-_tf5dF.js";import{M as i,C as s}from"./index-BbAFHYha.js";import{s as l,P as a}from"./Content.stories-iDuKhpps.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./column_transforms-CyX7y3_5.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./theme-DRtZtbPc.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./ColorSelected-HjDSMxjB.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./createSvgIcon-CcHL1II5.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./Chip-DoaLK3Y8.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./TitleWrapper-D2l-_w9e.js";import"./containerQuery-C0QVV4Kt.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./Image-DW9YTXUC.js";import"./formats-sBod7wm8.js";import"./TooltipIcon-CO3K7ssQ.js";import"./Edit-hiJ2yy-Y.js";import"./styled-hJgfyZIG.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./createSvgIcon-DE5yaevU.js";import"./Typography-aSbaE-Qi.js";function o(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...r(),...e.components};return t.jsxs(t.Fragment,{children:[t.jsx(i,{of:l}),` `,t.jsx(n.h1,{id:"content",children:"Content"}),` `,t.jsxs(n.p,{children:["The ",t.jsx(n.code,{children:"Content"})," helps to show the primary information from each specific record, with the possibility to add new subsections separate from the main form."]}),` `,t.jsx(n.h2,{id:"props",children:"Props"}),` diff --git a/sb8/qa/assets/CopyField.stories-BnRjyGRp.js b/sb8/qa/assets/CopyField.stories-6XNSINZ7.js similarity index 98% rename from sb8/qa/assets/CopyField.stories-BnRjyGRp.js rename to sb8/qa/assets/CopyField.stories-6XNSINZ7.js index 5b1727435f..657486f550 100644 --- a/sb8/qa/assets/CopyField.stories-BnRjyGRp.js +++ b/sb8/qa/assets/CopyField.stories-6XNSINZ7.js @@ -1,4 +1,4 @@ -import{j as r}from"./jsx-runtime-nGUw9YhZ.js";import{r as o}from"./index-BP8_t0zE.js";import{u as f,F as h}from"./Form-CecvGgxl.js";import{r as g}from"./renderButtons-BmHfsf_z.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./index-BxmsGmlx.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";const xt={title:"Components/Form"},y=document.body.style.margin,t=({showState:p})=>{const i=f(),{state:e,methods:{setFieldValue:n},handleSubmit:d}=i;o.useEffect(()=>(document.body.style.margin="0px",()=>{document.body.style.margin=y}),[]);const u=o.useMemo(()=>[{name:"name",label:"Name",type:"text",required:!0},{name:"slug",label:"Slug",type:"text",required:!0,helperText:"The text for this field will be populated with a slugified version the name field, but only if this field hasn't been touched"}],[]);return o.useEffect(()=>{var m;if(!e.touched.slug){const c=(m=e.data.name)==null?void 0:m.trim().toLowerCase().replace(/ {1,}/g,"_").replace(/[^a-z_]/g,"");n({name:"slug",value:c})}},[n,e.data.name,e.touched]),r.jsxs(r.Fragment,{children:[p&&r.jsx("pre",{children:JSON.stringify(e,null," ")}),r.jsx("div",{style:{height:"100vh"},children:r.jsx(h,{...i,buttons:g(d),title:"Validators story",fields:u})})]})};t.args={showState:!1};t.argTypes={showState:{name:"Show state"}};var s,a,l;t.parameters={...t.parameters,docs:{...(s=t.parameters)==null?void 0:s.docs,source:{originalSource:`({ +import{j as r}from"./jsx-runtime-nGUw9YhZ.js";import{r as o}from"./index-BP8_t0zE.js";import{u as f,F as h}from"./Form-CRl9vEGi.js";import{r as g}from"./renderButtons-BmHfsf_z.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./index-BxmsGmlx.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";const xt={title:"Components/Form"},y=document.body.style.margin,t=({showState:p})=>{const i=f(),{state:e,methods:{setFieldValue:n},handleSubmit:d}=i;o.useEffect(()=>(document.body.style.margin="0px",()=>{document.body.style.margin=y}),[]);const u=o.useMemo(()=>[{name:"name",label:"Name",type:"text",required:!0},{name:"slug",label:"Slug",type:"text",required:!0,helperText:"The text for this field will be populated with a slugified version the name field, but only if this field hasn't been touched"}],[]);return o.useEffect(()=>{var m;if(!e.touched.slug){const c=(m=e.data.name)==null?void 0:m.trim().toLowerCase().replace(/ {1,}/g,"_").replace(/[^a-z_]/g,"");n({name:"slug",value:c})}},[n,e.data.name,e.touched]),r.jsxs(r.Fragment,{children:[p&&r.jsx("pre",{children:JSON.stringify(e,null," ")}),r.jsx("div",{style:{height:"100vh"},children:r.jsx(h,{...i,buttons:g(d),title:"Validators story",fields:u})})]})};t.args={showState:!1};t.argTypes={showState:{name:"Show state"}};var s,a,l;t.parameters={...t.parameters,docs:{...(s=t.parameters)==null?void 0:s.docs,source:{originalSource:`({ showState }: typeof CopyField.args): ReactElement => { const controller = useForm(); diff --git a/sb8/qa/assets/CustomFields.stories-BMXLNT5a.js b/sb8/qa/assets/CustomFields.stories-BX2UbNrJ.js similarity index 97% rename from sb8/qa/assets/CustomFields.stories-BMXLNT5a.js rename to sb8/qa/assets/CustomFields.stories-BX2UbNrJ.js index 9afc37d43e..89b0ec4215 100644 --- a/sb8/qa/assets/CustomFields.stories-BMXLNT5a.js +++ b/sb8/qa/assets/CustomFields.stories-BX2UbNrJ.js @@ -1,4 +1,4 @@ -import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{r as m}from"./index-BP8_t0zE.js";import{u as f,a as l,F as x}from"./Form-CecvGgxl.js";import{r as y}from"./renderButtons-BmHfsf_z.js";import{O as v}from"./utils-BR2PSRFh.js";import{c as g,s as b}from"./styled-components.browser.esm-8MQ3dTkk.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./index-BxmsGmlx.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./tslib.es6-CRos2fHm.js";import"./emotion-unitless.esm-sScrWPmR.js";const Nt={title:"Components/Form"},F=g` +import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{r as m}from"./index-BP8_t0zE.js";import{u as f,a as l,F as x}from"./Form-CRl9vEGi.js";import{r as y}from"./renderButtons-BmHfsf_z.js";import{O as v}from"./utils-BR2PSRFh.js";import{c as g,s as b}from"./styled-components.browser.esm-8MQ3dTkk.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./index-BxmsGmlx.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./tslib.es6-CRos2fHm.js";import"./emotion-unitless.esm-sScrWPmR.js";const Nt={title:"Components/Form"},F=g` 0% { transform: translateX(0) } 25% { transform: translateX(5px) } 50% { transform: translateX(-5px) } diff --git a/sb8/qa/assets/DataView-BTUFg3QS.js b/sb8/qa/assets/DataView-DBys1vCl.js similarity index 98% rename from sb8/qa/assets/DataView-BTUFg3QS.js rename to sb8/qa/assets/DataView-DBys1vCl.js index 6bf39c84de..83932c32e9 100644 --- a/sb8/qa/assets/DataView-BTUFg3QS.js +++ b/sb8/qa/assets/DataView-DBys1vCl.js @@ -1,4 +1,4 @@ -import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as s}from"./index-3-_tf5dF.js";import{M as r}from"./index-oGQ2mxNr.js";import{s as o}from"./DataView.stories-CxV7kSXG.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./uniqueId-BPI7foNJ.js";import"./styled-components.browser.esm-8MQ3dTkk.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./Add-DakDrsh-.js";import"./styled-hJgfyZIG.js";import"./createSvgIcon-DE5yaevU.js";import"./Create-CpnV7q0W.js";import"./Delete-Bd9yuHmM.js";import"./MultiSelectHelper-dY4FeL1L.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./theme-DRtZtbPc.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./createSvgIcon-CcHL1II5.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./Chip-DoaLK3Y8.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./containerQuery-C0QVV4Kt.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./index-BhsI2nxq.js";import"./Form-CecvGgxl.js";import"./SideNav-D66jd1x5.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./DataViewPrimaryFilter-DV1DLudm.js";import"./DataViewFilterSingleSelect-DBzmexEb.js";import"./DataViewFilterText-BHAWDSVA.js";import"./useMosaicSettings-BhwODcT2.js";import"./column_transforms-CyX7y3_5.js";import"./Image-DW9YTXUC.js";import"./DataViewFilterNumber-DemMkJ8Z.js";import"./DataViewFilterMultiselect-DLeOCs4W.js";function t(n){const i={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{of:o}),` +import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as s}from"./index-3-_tf5dF.js";import{M as r}from"./index-BbAFHYha.js";import{s as o}from"./DataView.stories-DWp99G5d.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./uniqueId-BPI7foNJ.js";import"./styled-components.browser.esm-8MQ3dTkk.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./Add-DakDrsh-.js";import"./styled-hJgfyZIG.js";import"./createSvgIcon-DE5yaevU.js";import"./Create-CpnV7q0W.js";import"./Delete-Bd9yuHmM.js";import"./MultiSelectHelper-dY4FeL1L.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./theme-DRtZtbPc.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./createSvgIcon-CcHL1II5.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./Chip-DoaLK3Y8.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./containerQuery-C0QVV4Kt.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./index-MydwXDSS.js";import"./Form-CRl9vEGi.js";import"./SideNav-D66jd1x5.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./DataViewPrimaryFilter-DV1DLudm.js";import"./DataViewFilterSingleSelect-DBzmexEb.js";import"./DataViewFilterText-BHAWDSVA.js";import"./useMosaicSettings-BhwODcT2.js";import"./column_transforms-CyX7y3_5.js";import"./Image-DW9YTXUC.js";import"./DataViewFilterNumber-DXeWfoJw.js";import"./DataViewFilterMultiselect-DLeOCs4W.js";function t(n){const i={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",strong:"strong",ul:"ul",...s(),...n.components};return e.jsxs(e.Fragment,{children:[e.jsx(r,{of:o}),` `,e.jsx(i.h1,{id:"dataview",children:"DataView"}),` `,e.jsxs(i.p,{children:["A ",e.jsx(i.code,{children:"DataView"})," is used to output a list or grid of items. It can support a whole variety of actions including primary actions, additional actions and bulk actions."]}),` `,e.jsx(i.h2,{id:"props",children:"Props"}),` diff --git a/sb8/qa/assets/DataView.stories-CxV7kSXG.js b/sb8/qa/assets/DataView.stories-DWp99G5d.js similarity index 99% rename from sb8/qa/assets/DataView.stories-CxV7kSXG.js rename to sb8/qa/assets/DataView.stories-DWp99G5d.js index 0208d995a7..2d75493ba1 100644 --- a/sb8/qa/assets/DataView.stories-CxV7kSXG.js +++ b/sb8/qa/assets/DataView.stories-DWp99G5d.js @@ -1,4 +1,4 @@ -var Ie=Object.defineProperty;var Fe=(i,a,d)=>a in i?Ie(i,a,{enumerable:!0,configurable:!0,writable:!0,value:d}):i[a]=d;var H=(i,a,d)=>Fe(i,typeof a!="symbol"?a+"":a,d);import{r as R,j as l}from"./jsx-runtime-nGUw9YhZ.js";import{u as Ae}from"./uniqueId-BPI7foNJ.js";import{r as n}from"./index-BP8_t0zE.js";import{s as je}from"./styled-components.browser.esm-8MQ3dTkk.js";import{d as De}from"./Add-DakDrsh-.js";import{d as ke}from"./Create-CpnV7q0W.js";import{i as M}from"./styled-hJgfyZIG.js";import{r as I}from"./createSvgIcon-DE5yaevU.js";import{d as ne}from"./Delete-Bd9yuHmM.js";import{M as se,J as le,c as Le}from"./MultiSelectHelper-dY4FeL1L.js";import{a as fe,D as Ve}from"./ColorSelected-HjDSMxjB.js";import{D as $}from"./index-BhsI2nxq.js";import{D as Ze}from"./DataViewFilterSingleSelect-DBzmexEb.js";import{D as B}from"./DataViewFilterText-BHAWDSVA.js";import"./index-DRdTCjFK.js";import{u as Oe}from"./useMosaicSettings-BhwODcT2.js";import{M as Be}from"./useMosaicTranslation-CZCb37QS.js";import{u as Ge,F as We}from"./Form-CecvGgxl.js";import{k as x,c as pe,l as Ue,m as Ne,i as Je,b as Q}from"./column_transforms-CyX7y3_5.js";import{t as ee}from"./testIds-DZf96GK8.js";import{D as qe}from"./DataViewFilterNumber-DemMkJ8Z.js";import{D as ae}from"./DataViewFilterMultiselect-DLeOCs4W.js";var U={},Ye=M;Object.defineProperty(U,"__esModule",{value:!0});var be=U.default=void 0,ze=Ye(I()),Xe=R();be=U.default=(0,ze.default)((0,Xe.jsx)("path",{d:"M21 12.4V7l-4-4H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h7.4zM15 15c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3M6 6h9v4H6zm13.99 10.25 1.77 1.77L16.77 23H15v-1.77zm3.26.26-.85.85-1.77-1.77.85-.85c.2-.2.51-.2.71 0l1.06 1.06c.2.2.2.52 0 .71"}),"SaveAs");var N={},Ke=M;Object.defineProperty(N,"__esModule",{value:!0});var ge=N.default=void 0,He=Ke(I()),$e=R();ge=N.default=(0,He.default)((0,$e.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");var J={},Qe=M;Object.defineProperty(J,"__esModule",{value:!0});var ue=J.default=void 0,ea=Qe(I()),aa=R();ue=J.default=(0,ea.default)((0,aa.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility");var q={},ia=M;Object.defineProperty(q,"__esModule",{value:!0});var _e=q.default=void 0,ta=ia(I()),ra=R();_e=q.default=(0,ta.default)((0,ra.jsx)("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star");const da=[{_id:"55842aafd989fc715e628959",title:"Sandy beaches of Lake Michigan only a short drive away.",categories_ids:["5594402c3c392ffe4438cbd8","55943f9f3c392ffe4438cae2","559c3acce3bd4253522eb134","55873d4ad989fc715e63fa2d"],image_id:"5584231bd989fc715e627fa1",description:"Sandy beaches only a short drive away.",target:!1,created:"2015-06-19T14:42:54.574Z",updated:"2020-02-10T23:17:16.692Z",content_owner:"default",image:{_id:"5584231bd989fc715e627fa1",title:"Lake Michigan Beach",notes:`Lake Michigan\r +var Ie=Object.defineProperty;var Fe=(i,a,d)=>a in i?Ie(i,a,{enumerable:!0,configurable:!0,writable:!0,value:d}):i[a]=d;var H=(i,a,d)=>Fe(i,typeof a!="symbol"?a+"":a,d);import{r as R,j as l}from"./jsx-runtime-nGUw9YhZ.js";import{u as Ae}from"./uniqueId-BPI7foNJ.js";import{r as n}from"./index-BP8_t0zE.js";import{s as je}from"./styled-components.browser.esm-8MQ3dTkk.js";import{d as De}from"./Add-DakDrsh-.js";import{d as ke}from"./Create-CpnV7q0W.js";import{i as M}from"./styled-hJgfyZIG.js";import{r as I}from"./createSvgIcon-DE5yaevU.js";import{d as ne}from"./Delete-Bd9yuHmM.js";import{M as se,J as le,c as Le}from"./MultiSelectHelper-dY4FeL1L.js";import{a as fe,D as Ve}from"./ColorSelected-HjDSMxjB.js";import{D as $}from"./index-MydwXDSS.js";import{D as Ze}from"./DataViewFilterSingleSelect-DBzmexEb.js";import{D as B}from"./DataViewFilterText-BHAWDSVA.js";import"./index-DRdTCjFK.js";import{u as Oe}from"./useMosaicSettings-BhwODcT2.js";import{M as Be}from"./useMosaicTranslation-CZCb37QS.js";import{u as Ge,F as We}from"./Form-CRl9vEGi.js";import{k as x,c as pe,l as Ue,m as Ne,i as Je,b as Q}from"./column_transforms-CyX7y3_5.js";import{t as ee}from"./testIds-DZf96GK8.js";import{D as qe}from"./DataViewFilterNumber-DXeWfoJw.js";import{D as ae}from"./DataViewFilterMultiselect-DLeOCs4W.js";var U={},Ye=M;Object.defineProperty(U,"__esModule",{value:!0});var be=U.default=void 0,ze=Ye(I()),Xe=R();be=U.default=(0,ze.default)((0,Xe.jsx)("path",{d:"M21 12.4V7l-4-4H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h7.4zM15 15c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3 3 1.34 3 3M6 6h9v4H6zm13.99 10.25 1.77 1.77L16.77 23H15v-1.77zm3.26.26-.85.85-1.77-1.77.85-.85c.2-.2.51-.2.71 0l1.06 1.06c.2.2.2.52 0 .71"}),"SaveAs");var N={},Ke=M;Object.defineProperty(N,"__esModule",{value:!0});var ge=N.default=void 0,He=Ke(I()),$e=R();ge=N.default=(0,He.default)((0,$e.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7zM5 18v2h14v-2z"}),"GetApp");var J={},Qe=M;Object.defineProperty(J,"__esModule",{value:!0});var ue=J.default=void 0,ea=Qe(I()),aa=R();ue=J.default=(0,ea.default)((0,aa.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility");var q={},ia=M;Object.defineProperty(q,"__esModule",{value:!0});var _e=q.default=void 0,ta=ia(I()),ra=R();_e=q.default=(0,ta.default)((0,ra.jsx)("path",{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star");const da=[{_id:"55842aafd989fc715e628959",title:"Sandy beaches of Lake Michigan only a short drive away.",categories_ids:["5594402c3c392ffe4438cbd8","55943f9f3c392ffe4438cae2","559c3acce3bd4253522eb134","55873d4ad989fc715e63fa2d"],image_id:"5584231bd989fc715e627fa1",description:"Sandy beaches only a short drive away.",target:!1,created:"2015-06-19T14:42:54.574Z",updated:"2020-02-10T23:17:16.692Z",content_owner:"default",image:{_id:"5584231bd989fc715e627fa1",title:"Lake Michigan Beach",notes:`Lake Michigan\r Holland\r Muskegon\r Grand Haven\r diff --git a/sb8/qa/assets/DataViewFilterDate-BqSFNv37.js b/sb8/qa/assets/DataViewFilterDate-Dh4aUe6H.js similarity index 92% rename from sb8/qa/assets/DataViewFilterDate-BqSFNv37.js rename to sb8/qa/assets/DataViewFilterDate-Dh4aUe6H.js index a0705035c5..0d7dd94aff 100644 --- a/sb8/qa/assets/DataViewFilterDate-BqSFNv37.js +++ b/sb8/qa/assets/DataViewFilterDate-Dh4aUe6H.js @@ -1,4 +1,4 @@ -import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as r}from"./index-3-_tf5dF.js";import{M as p,C as s}from"./index-oGQ2mxNr.js";import{s as a,P as m}from"./DataViewFilterDate.stories-C0p9BXdF.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./index-BhsI2nxq.js";import"./theme-DRtZtbPc.js";import"./ColorSelected-HjDSMxjB.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./createSvgIcon-CcHL1II5.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./Chip-DoaLK3Y8.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./TitleWrapper-D2l-_w9e.js";import"./containerQuery-C0QVV4Kt.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./Form-CecvGgxl.js";import"./SideNav-D66jd1x5.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./DataViewPrimaryFilter-DV1DLudm.js";function i(e){const o={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...r(),...e.components};return t.jsxs(t.Fragment,{children:[t.jsx(p,{of:a}),` +import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as r}from"./index-3-_tf5dF.js";import{M as p,C as s}from"./index-BbAFHYha.js";import{s as a,P as m}from"./DataViewFilterDate.stories-Cw2dS4mi.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./index-MydwXDSS.js";import"./theme-DRtZtbPc.js";import"./ColorSelected-HjDSMxjB.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./createSvgIcon-CcHL1II5.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./Chip-DoaLK3Y8.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./TitleWrapper-D2l-_w9e.js";import"./containerQuery-C0QVV4Kt.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./Form-CRl9vEGi.js";import"./SideNav-D66jd1x5.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./DataViewPrimaryFilter-DV1DLudm.js";function i(e){const o={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...r(),...e.components};return t.jsxs(t.Fragment,{children:[t.jsx(p,{of:a}),` `,t.jsx(o.h1,{id:"dataviewfilterdate",children:"DataViewFilterDate"}),` `,t.jsxs(o.p,{children:[t.jsx(o.code,{children:"DataViewFilterDate"}),' is a filter that can be used to select records between a set of dates. The filter also allows developers to pass a specific set of "magic values" that when clicked will automatically set a date (e.g. "Today", "Last 2 months", etc). For more please take a look at the props. The ',t.jsx(o.code,{children:"args"})," object takes an optional ",t.jsx(o.code,{children:"minDate"})," prop which can be used to define a minimum date that can be chosen using the datepicker. By default, the minimum date is 01/01/1900."]}),` `,t.jsx(o.h2,{id:"props",children:"Props"}),` diff --git a/sb8/qa/assets/DataViewFilterDate.stories-C0p9BXdF.js b/sb8/qa/assets/DataViewFilterDate.stories-Cw2dS4mi.js similarity index 98% rename from sb8/qa/assets/DataViewFilterDate.stories-C0p9BXdF.js rename to sb8/qa/assets/DataViewFilterDate.stories-Cw2dS4mi.js index 44451f4600..fa2b6e8c2d 100644 --- a/sb8/qa/assets/DataViewFilterDate.stories-C0p9BXdF.js +++ b/sb8/qa/assets/DataViewFilterDate.stories-Cw2dS4mi.js @@ -1,4 +1,4 @@ -import{j as l}from"./jsx-runtime-nGUw9YhZ.js";import{r as b}from"./index-BP8_t0zE.js";import{D as u}from"./index-BhsI2nxq.js";const f={title:"Components/DataViewFilterDate"},m=[{label:"Today",value:"today"},{label:"Yesterday",value:"yesterday"},{label:"Tomorrow",value:"tomorrow"},{label:"A really really long time ago",value:"a_really_really_long_time_ago"},{label:"Last year",value:"last_year"},{label:"Last 2 years",value:"last_2_years"},{label:"Last 3 years",value:"last_3_years"},{label:"Last 4 years",value:"last_4_years"},{label:"Last 5 years",value:"last_5_years"},{label:"Last 6 years",value:"last_6_years"},{label:"Last 7 years",value:"last_7_years"},{label:"Last 8 years",value:"last_8_years"},{label:"Last 9 years",value:"last_9_years"}],e=({showOptions:t})=>{const[o,r]=b.useState({}),n=m.slice(0,t),a=function(i){r(i)};return l.jsx(u,{label:"Date filter example",data:o,args:{options:t>0?n:void 0},onChange:a})};e.args={showOptions:0};e.argTypes={showOptions:{name:"Number of options to show",control:{type:"range",min:0,max:m.length}}};const s=()=>{const[t,o]=b.useState({regular:{},options:{}}),r=[{label:"Today",value:"today"},{label:"Yesterday",value:"yesterday"},{label:"Tomorrow",value:"tomorrow"},{label:"Last year",value:"last_year"},{label:"Last 2 years",value:"last_2_years"},{label:"Last 3 years",value:"last_3_years"}],n=function(a,i){const v={...t,[a]:i};o(v)};return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsx(u,{label:"Regular Date filter",data:t.regular,onChange:a=>n("regular",a),args:{options:void 0}}),l.jsx(u,{label:"Date filter with options",data:t.options,args:{options:r},onChange:a=>n("options",a)})]})};var y,p,c;e.parameters={...e.parameters,docs:{...(y=e.parameters)==null?void 0:y.docs,source:{originalSource:`({ +import{j as l}from"./jsx-runtime-nGUw9YhZ.js";import{r as b}from"./index-BP8_t0zE.js";import{D as u}from"./index-MydwXDSS.js";const f={title:"Components/DataViewFilterDate"},m=[{label:"Today",value:"today"},{label:"Yesterday",value:"yesterday"},{label:"Tomorrow",value:"tomorrow"},{label:"A really really long time ago",value:"a_really_really_long_time_ago"},{label:"Last year",value:"last_year"},{label:"Last 2 years",value:"last_2_years"},{label:"Last 3 years",value:"last_3_years"},{label:"Last 4 years",value:"last_4_years"},{label:"Last 5 years",value:"last_5_years"},{label:"Last 6 years",value:"last_6_years"},{label:"Last 7 years",value:"last_7_years"},{label:"Last 8 years",value:"last_8_years"},{label:"Last 9 years",value:"last_9_years"}],e=({showOptions:t})=>{const[o,r]=b.useState({}),n=m.slice(0,t),a=function(i){r(i)};return l.jsx(u,{label:"Date filter example",data:o,args:{options:t>0?n:void 0},onChange:a})};e.args={showOptions:0};e.argTypes={showOptions:{name:"Number of options to show",control:{type:"range",min:0,max:m.length}}};const s=()=>{const[t,o]=b.useState({regular:{},options:{}}),r=[{label:"Today",value:"today"},{label:"Yesterday",value:"yesterday"},{label:"Tomorrow",value:"tomorrow"},{label:"Last year",value:"last_year"},{label:"Last 2 years",value:"last_2_years"},{label:"Last 3 years",value:"last_3_years"}],n=function(a,i){const v={...t,[a]:i};o(v)};return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsx(u,{label:"Regular Date filter",data:t.regular,onChange:a=>n("regular",a),args:{options:void 0}}),l.jsx(u,{label:"Date filter with options",data:t.options,args:{options:r},onChange:a=>n("options",a)})]})};var y,p,c;e.parameters={...e.parameters,docs:{...(y=e.parameters)==null?void 0:y.docs,source:{originalSource:`({ showOptions }: typeof Playground.args): ReactElement => { const [state, setState] = useState({}); diff --git a/sb8/qa/assets/DataViewFilterMultiselect-CJbyiaya.js b/sb8/qa/assets/DataViewFilterMultiselect-DJBDJUNV.js similarity index 96% rename from sb8/qa/assets/DataViewFilterMultiselect-CJbyiaya.js rename to sb8/qa/assets/DataViewFilterMultiselect-DJBDJUNV.js index ead5370ef7..8c7b758842 100644 --- a/sb8/qa/assets/DataViewFilterMultiselect-CJbyiaya.js +++ b/sb8/qa/assets/DataViewFilterMultiselect-DJBDJUNV.js @@ -1,4 +1,4 @@ -import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as r}from"./index-3-_tf5dF.js";import{M as s,C as p}from"./index-oGQ2mxNr.js";import{s as n,P as m}from"./DataViewFilterMultiselect.stories-CRgR-jzZ.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./index-DRdTCjFK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./theme-DRtZtbPc.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./createSvgIcon-CcHL1II5.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./Chip-DoaLK3Y8.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./MultiSelectHelper-dY4FeL1L.js";import"./DataViewFilterMultiselect-DLeOCs4W.js";import"./DataViewPrimaryFilter-DV1DLudm.js";function e(i){const o={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...r(),...i.components};return t.jsxs(t.Fragment,{children:[t.jsx(s,{of:n}),` +import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as r}from"./index-3-_tf5dF.js";import{M as s,C as p}from"./index-BbAFHYha.js";import{s as n,P as m}from"./DataViewFilterMultiselect.stories-CRgR-jzZ.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./index-DRdTCjFK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./theme-DRtZtbPc.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./createSvgIcon-CcHL1II5.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./Chip-DoaLK3Y8.js";import"./useMosaicTranslation-CZCb37QS.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./useToggle-lipGlewK.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./MultiSelectHelper-dY4FeL1L.js";import"./DataViewFilterMultiselect-DLeOCs4W.js";import"./DataViewPrimaryFilter-DV1DLudm.js";function e(i){const o={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...r(),...i.components};return t.jsxs(t.Fragment,{children:[t.jsx(s,{of:n}),` `,t.jsx(o.h1,{id:"dataviewfiltermultiselect",children:"DataViewFilterMultiselect"}),` `,t.jsxs(o.p,{children:[t.jsx(o.code,{children:"DataViewFilterMultiselect"})," is a filter that can be used to pick multiple values from an array of options."]}),` `,t.jsx(o.h2,{id:"props",children:"Props"}),` diff --git a/sb8/qa/assets/DataViewFilterNumber-BLLSpjSf.js b/sb8/qa/assets/DataViewFilterNumber-CsSdJqG2.js similarity index 88% rename from sb8/qa/assets/DataViewFilterNumber-BLLSpjSf.js rename to sb8/qa/assets/DataViewFilterNumber-CsSdJqG2.js index 0f2c26dda3..b6d262f838 100644 --- a/sb8/qa/assets/DataViewFilterNumber-BLLSpjSf.js +++ b/sb8/qa/assets/DataViewFilterNumber-CsSdJqG2.js @@ -1,2 +1,2 @@ -import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as m}from"./index-3-_tf5dF.js";import{M as p}from"./index-oGQ2mxNr.js";import{s as e}from"./DataViewFilterNumber.stories-DsHNpCTM.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./DataViewFilterNumber-DemMkJ8Z.js";import"./DataViewPrimaryFilter-DV1DLudm.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./theme-DRtZtbPc.js";import"./Button-Do5OxnZO.js";import"./ButtonBase-BZmvw3BH.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./Form-CecvGgxl.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./FormFieldNumber.stories-BKiKOIod.js";import"./renderButtons-BmHfsf_z.js";function i(t){const r={h1:"h1",...m(),...t.components};return o.jsxs(o.Fragment,{children:[o.jsx(p,{of:e}),` +import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as m}from"./index-3-_tf5dF.js";import{M as p}from"./index-BbAFHYha.js";import{s as e}from"./DataViewFilterNumber.stories-m1dupcpg.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./DataViewFilterNumber-DXeWfoJw.js";import"./DataViewPrimaryFilter-DV1DLudm.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./theme-DRtZtbPc.js";import"./Button-Do5OxnZO.js";import"./ButtonBase-BZmvw3BH.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./Form-CRl9vEGi.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./getThemeProps-Cs15h2IA.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./FormFieldNumber.stories-DUwW3HYi.js";import"./renderButtons-BmHfsf_z.js";function i(t){const r={h1:"h1",...m(),...t.components};return o.jsxs(o.Fragment,{children:[o.jsx(p,{of:e}),` `,o.jsx(r.h1,{id:"dataviewfilternumber",children:"DataViewFilterNumber"})]})}function bt(t={}){const{wrapper:r}={...m(),...t.components};return r?o.jsx(r,{...t,children:o.jsx(i,{...t})}):i(t)}export{bt as default}; diff --git a/sb8/qa/assets/DataViewFilterNumber-DemMkJ8Z.js b/sb8/qa/assets/DataViewFilterNumber-DXeWfoJw.js similarity index 96% rename from sb8/qa/assets/DataViewFilterNumber-DemMkJ8Z.js rename to sb8/qa/assets/DataViewFilterNumber-DXeWfoJw.js index d1a587504d..da073b04d5 100644 --- a/sb8/qa/assets/DataViewFilterNumber-DemMkJ8Z.js +++ b/sb8/qa/assets/DataViewFilterNumber-DXeWfoJw.js @@ -1,4 +1,4 @@ -import{j as s}from"./jsx-runtime-nGUw9YhZ.js";import{r as n}from"./index-BP8_t0zE.js";import{D as E}from"./DataViewPrimaryFilter-DV1DLudm.js";import{a as F,D as j}from"./FormFieldText.styled-BhoqJBjr.js";import{s as w,B as x}from"./theme-DRtZtbPc.js";import{u as V,V as p,F as N}from"./Form-CecvGgxl.js";import{t as y}from"./testIds-DZf96GK8.js";const A=w.div` +import{j as s}from"./jsx-runtime-nGUw9YhZ.js";import{r as n}from"./index-BP8_t0zE.js";import{D as E}from"./DataViewPrimaryFilter-DV1DLudm.js";import{a as F,D as j}from"./FormFieldText.styled-BhoqJBjr.js";import{s as w,B as x}from"./theme-DRtZtbPc.js";import{u as V,V as p,F as N}from"./Form-CRl9vEGi.js";import{t as y}from"./testIds-DZf96GK8.js";const A=w.div` display: flex; flex-direction: column; justify-content: space-between; diff --git a/sb8/qa/assets/DataViewFilterNumber.stories-DsHNpCTM.js b/sb8/qa/assets/DataViewFilterNumber.stories-m1dupcpg.js similarity index 90% rename from sb8/qa/assets/DataViewFilterNumber.stories-DsHNpCTM.js rename to sb8/qa/assets/DataViewFilterNumber.stories-m1dupcpg.js index 6f84616769..4a11e9de69 100644 --- a/sb8/qa/assets/DataViewFilterNumber.stories-DsHNpCTM.js +++ b/sb8/qa/assets/DataViewFilterNumber.stories-m1dupcpg.js @@ -1,4 +1,4 @@ -import{j as p}from"./jsx-runtime-nGUw9YhZ.js";import{r as u}from"./index-BP8_t0zE.js";import{D as c}from"./DataViewFilterNumber-DemMkJ8Z.js";import{Playground as e}from"./FormFieldNumber.stories-BKiKOIod.js";const f={title:"Components/DataViewFilterNumber"},a=({decimalPlaces:i,prefix:n,suffix:o,sign:l})=>{const[m,g]=u.useState({});return p.jsx(c,{label:"Number filter example",data:m,args:{decimalPlaces:i,prefix:n,suffix:o,sign:l},onChange:g})};a.args={decimalPlaces:e.args.decimalPlaces,prefix:e.args.prefix,suffix:e.args.suffix,sign:e.args.sign};a.argTypes={decimalPlaces:e.argTypes.decimalPlaces,prefix:e.argTypes.prefix,suffix:e.argTypes.suffix,sign:e.argTypes.sign};var r,s,t;a.parameters={...a.parameters,docs:{...(r=a.parameters)==null?void 0:r.docs,source:{originalSource:`({ +import{j as p}from"./jsx-runtime-nGUw9YhZ.js";import{r as u}from"./index-BP8_t0zE.js";import{D as c}from"./DataViewFilterNumber-DXeWfoJw.js";import{Playground as e}from"./FormFieldNumber.stories-DUwW3HYi.js";const f={title:"Components/DataViewFilterNumber"},a=({decimalPlaces:i,prefix:n,suffix:o,sign:l})=>{const[m,g]=u.useState({});return p.jsx(c,{label:"Number filter example",data:m,args:{decimalPlaces:i,prefix:n,suffix:o,sign:l},onChange:g})};a.args={decimalPlaces:e.args.decimalPlaces,prefix:e.args.prefix,suffix:e.args.suffix,sign:e.args.sign};a.argTypes={decimalPlaces:e.argTypes.decimalPlaces,prefix:e.argTypes.prefix,suffix:e.argTypes.suffix,sign:e.argTypes.sign};var r,s,t;a.parameters={...a.parameters,docs:{...(r=a.parameters)==null?void 0:r.docs,source:{originalSource:`({ decimalPlaces, prefix, suffix, diff --git a/sb8/qa/assets/DataViewFilterSingleSelect-BqbmNMMg.js b/sb8/qa/assets/DataViewFilterSingleSelect-BLcEV6I4.js similarity index 94% rename from sb8/qa/assets/DataViewFilterSingleSelect-BqbmNMMg.js rename to sb8/qa/assets/DataViewFilterSingleSelect-BLcEV6I4.js index 335970dc92..46655e6af5 100644 --- a/sb8/qa/assets/DataViewFilterSingleSelect-BqbmNMMg.js +++ b/sb8/qa/assets/DataViewFilterSingleSelect-BLcEV6I4.js @@ -1,4 +1,4 @@ -import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as r}from"./index-3-_tf5dF.js";import{M as n,C as s}from"./index-oGQ2mxNr.js";import{s as p,P as a}from"./DataViewFilterSingleSelect.stories-BtE7K3pJ.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./DataViewFilterSingleSelect-DBzmexEb.js";import"./theme-DRtZtbPc.js";import"./DataViewPrimaryFilter-DV1DLudm.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./Button-Do5OxnZO.js";import"./ButtonBase-BZmvw3BH.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./testIds-DZf96GK8.js";function o(i){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...r(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(n,{of:p}),` +import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as r}from"./index-3-_tf5dF.js";import{M as n,C as s}from"./index-BbAFHYha.js";import{s as p,P as a}from"./DataViewFilterSingleSelect.stories-BtE7K3pJ.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./DataViewFilterSingleSelect-DBzmexEb.js";import"./theme-DRtZtbPc.js";import"./DataViewPrimaryFilter-DV1DLudm.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./Button-Do5OxnZO.js";import"./ButtonBase-BZmvw3BH.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./testIds-DZf96GK8.js";function o(i){const t={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...r(),...i.components};return e.jsxs(e.Fragment,{children:[e.jsx(n,{of:p}),` `,e.jsx(t.h1,{id:"dataviewfiltersingleselect",children:"DataViewFilterSingleSelect"}),` `,e.jsxs(t.p,{children:[e.jsx(t.code,{children:"DataViewFilterSingleSelect"})," is a filter that can be used to pick a single value from an array of options."]}),` `,e.jsx(t.h2,{id:"props",children:"Props"}),` diff --git a/sb8/qa/assets/DataViewFilterText-CwvAGg6M.js b/sb8/qa/assets/DataViewFilterText-BpSNZJuo.js similarity index 95% rename from sb8/qa/assets/DataViewFilterText-CwvAGg6M.js rename to sb8/qa/assets/DataViewFilterText-BpSNZJuo.js index 859552bb23..cafa79a272 100644 --- a/sb8/qa/assets/DataViewFilterText-CwvAGg6M.js +++ b/sb8/qa/assets/DataViewFilterText-BpSNZJuo.js @@ -1,4 +1,4 @@ -import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as r}from"./index-3-_tf5dF.js";import{M as s,C as n}from"./index-oGQ2mxNr.js";import{s as p,P as a}from"./DataViewFilterText.stories-B3DmH4na.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./DataViewFilterText-BHAWDSVA.js";import"./DataViewPrimaryFilter-DV1DLudm.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./theme-DRtZtbPc.js";import"./Button-Do5OxnZO.js";import"./ButtonBase-BZmvw3BH.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./sizes-C6oSOElx.js";function i(e){const o={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...r(),...e.components};return t.jsxs(t.Fragment,{children:[t.jsx(s,{of:p}),` +import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as r}from"./index-3-_tf5dF.js";import{M as s,C as n}from"./index-BbAFHYha.js";import{s as p,P as a}from"./DataViewFilterText.stories-B3DmH4na.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./DataViewFilterText-BHAWDSVA.js";import"./DataViewPrimaryFilter-DV1DLudm.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./theme-DRtZtbPc.js";import"./Button-Do5OxnZO.js";import"./ButtonBase-BZmvw3BH.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./useMosaicTranslation-CZCb37QS.js";import"./formControlState-D52vkf9K.js";import"./sizes-C6oSOElx.js";function i(e){const o={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...r(),...e.components};return t.jsxs(t.Fragment,{children:[t.jsx(s,{of:p}),` `,t.jsx(o.h1,{id:"dataviewfiltertext",children:"DataViewFilterText"}),` `,t.jsxs(o.p,{children:[t.jsx(o.code,{children:"DataViewFilterText"})," is a filter that can be used to show the records that match with a string (varies depending on the comparison selected)."]}),` `,t.jsx(o.h2,{id:"props",children:"Props"}),` diff --git a/sb8/qa/assets/DateField-vRtzsM4n.js b/sb8/qa/assets/DateField-BY6cxiaE.js similarity index 96% rename from sb8/qa/assets/DateField-vRtzsM4n.js rename to sb8/qa/assets/DateField-BY6cxiaE.js index 2a96e24cd0..c3f311da6d 100644 --- a/sb8/qa/assets/DateField-vRtzsM4n.js +++ b/sb8/qa/assets/DateField-BY6cxiaE.js @@ -1,4 +1,4 @@ -import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as o}from"./index-3-_tf5dF.js";import{M as n}from"./index-oGQ2mxNr.js";import{s as d}from"./DateField.stories-Byc-VM3I.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./Form-CecvGgxl.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./renderButtons-BmHfsf_z.js";function e(i){const r={a:"a",code:"code",h1:"h1",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...o(),...i.components};return t.jsxs(t.Fragment,{children:[t.jsx(n,{of:d}),` +import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as o}from"./index-3-_tf5dF.js";import{M as n}from"./index-BbAFHYha.js";import{s as d}from"./DateField.stories-B4uSKeMs.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./Form-CRl9vEGi.js";import"./theme-DRtZtbPc.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./useId-DLncWxdO.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./ChevronRight-CSz705Z0.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./renderButtons-BmHfsf_z.js";function e(i){const r={a:"a",code:"code",h1:"h1",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...o(),...i.components};return t.jsxs(t.Fragment,{children:[t.jsx(n,{of:d}),` `,t.jsx(r.h1,{id:"date",children:"Date"}),` `,t.jsxs(r.p,{children:["This field implements the ",t.jsx(r.a,{href:"#generic-field-props-fielddef",children:t.jsx(r.strong,{children:"FieldDef"})})," interface."]}),` `,t.jsxs(r.ul,{children:[` diff --git a/sb8/qa/assets/DateField.stories-Byc-VM3I.js b/sb8/qa/assets/DateField.stories-B4uSKeMs.js similarity index 98% rename from sb8/qa/assets/DateField.stories-Byc-VM3I.js rename to sb8/qa/assets/DateField.stories-B4uSKeMs.js index bc4ec49de5..bed0468cfd 100644 --- a/sb8/qa/assets/DateField.stories-Byc-VM3I.js +++ b/sb8/qa/assets/DateField.stories-B4uSKeMs.js @@ -1,4 +1,4 @@ -import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as m}from"./index-BP8_t0zE.js";import{u as y,t as N,F as w}from"./Form-CecvGgxl.js";import{r as q}from"./renderButtons-BmHfsf_z.js";import{D as V}from"./formats-sBod7wm8.js";const v={title:"FormFields/FormFieldDateField"},I={date:new Date(2024,12,25,11,30)},a=({label:i,required:t,skeleton:p,disabled:n,instructionText:r,prepopulate:d,helperText:s,showTime:u,minDateStr:l,defaultTime:c})=>{const T=y(),{state:j,handleSubmit:k}=T,M=m.useMemo(()=>d?async()=>I:void 0,[d]),f=l&&N(l,V)?new Date(Number(l.split("/")[2]),Number(l.split("/")[0])-1,Number(l.split("/")[1])):void 0,b=m.useMemo(()=>{if(!/\d{4}/.test(c))return;const[,O,_]=c.match(/(\d{2})(\d{2})/);return`${O}:${_}`},[c]),$=m.useMemo(()=>[{name:"date",type:"date",label:i,required:t,disabled:n,helperText:s,instructionText:r,inputSettings:{showTime:u,minDate:f,defaultTime:b}}],[i,t,n,s,r,u,f,b]);return e.jsxs(e.Fragment,{children:[e.jsx("pre",{children:JSON.stringify(j,null," ")}),e.jsx(w,{...T,buttons:q(k),title:"Date Field",fields:$,skeleton:p,getFormValues:M})]})};a.args={label:"Label",disabled:!1,required:!1,skeleton:!1,instructionText:"Instruction text",prepopulate:!1,helperText:"Helper text",showTime:!1,minDateStr:"",defaultTime:""};a.argTypes={label:{name:"Label"},disabled:{name:"Disabled"},required:{name:"Required"},skeleton:{name:"Skeleton"},instructionText:{name:"Instruction Text"},prepopulate:{name:"Prepopulate"},helperText:{name:"Helper Text"},showTime:{name:"Show Time"},minDateStr:{name:"Minimum Date"},defaultTime:{name:"Default Time"}};const P=async()=>({dateTimePrefilled:new Date("2023-07-31T14:00:00.000Z")}),o=()=>{const i=y(),{state:t,handleSubmit:p}=i,n="Helper text",r="Instruction text",d=m.useMemo(()=>[{name:"singleDate",type:"date",label:"Single Date Calendar",required:!1,disabled:!1,helperText:n,instructionText:r,inputSettings:{showTime:!1}},{name:"dateTime",type:"date",label:"Date Time Input",required:!1,disabled:!1,helperText:n,instructionText:r,inputSettings:{showTime:!0}},{name:"dateTimePrefilled",type:"date",label:"Date Time with preset values",required:!1,disabled:!1,helperText:n,instructionText:r,inputSettings:{showTime:!0}},{name:"requiredDateTime",type:"date",label:"Required Single Date Calendar",required:!0,disabled:!1,helperText:n,instructionText:r,inputSettings:{showTime:!0}}],[]);return e.jsxs(e.Fragment,{children:[e.jsx(w,{...i,buttons:q(p),title:"Date Field Calendar",description:"This is a description example",fields:d,getFormValues:P}),e.jsx("h3",{children:"Date.toString()"}),e.jsx("pre",{children:Object.keys(t.data).map((s,u)=>e.jsxs("div",{children:[s,":"," ",t.data[s]&&t.data[s].toString()]},u))}),e.jsx("h3",{children:"State"}),e.jsx("pre",{children:JSON.stringify(t,null," ")})]})};var h,x,g;a.parameters={...a.parameters,docs:{...(h=a.parameters)==null?void 0:h.docs,source:{originalSource:`({ +import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as m}from"./index-BP8_t0zE.js";import{u as y,t as N,F as w}from"./Form-CRl9vEGi.js";import{r as q}from"./renderButtons-BmHfsf_z.js";import{D as V}from"./formats-sBod7wm8.js";const v={title:"FormFields/FormFieldDateField"},I={date:new Date(2024,12,25,11,30)},a=({label:i,required:t,skeleton:p,disabled:n,instructionText:r,prepopulate:d,helperText:s,showTime:u,minDateStr:l,defaultTime:c})=>{const T=y(),{state:j,handleSubmit:k}=T,M=m.useMemo(()=>d?async()=>I:void 0,[d]),f=l&&N(l,V)?new Date(Number(l.split("/")[2]),Number(l.split("/")[0])-1,Number(l.split("/")[1])):void 0,b=m.useMemo(()=>{if(!/\d{4}/.test(c))return;const[,O,_]=c.match(/(\d{2})(\d{2})/);return`${O}:${_}`},[c]),$=m.useMemo(()=>[{name:"date",type:"date",label:i,required:t,disabled:n,helperText:s,instructionText:r,inputSettings:{showTime:u,minDate:f,defaultTime:b}}],[i,t,n,s,r,u,f,b]);return e.jsxs(e.Fragment,{children:[e.jsx("pre",{children:JSON.stringify(j,null," ")}),e.jsx(w,{...T,buttons:q(k),title:"Date Field",fields:$,skeleton:p,getFormValues:M})]})};a.args={label:"Label",disabled:!1,required:!1,skeleton:!1,instructionText:"Instruction text",prepopulate:!1,helperText:"Helper text",showTime:!1,minDateStr:"",defaultTime:""};a.argTypes={label:{name:"Label"},disabled:{name:"Disabled"},required:{name:"Required"},skeleton:{name:"Skeleton"},instructionText:{name:"Instruction Text"},prepopulate:{name:"Prepopulate"},helperText:{name:"Helper Text"},showTime:{name:"Show Time"},minDateStr:{name:"Minimum Date"},defaultTime:{name:"Default Time"}};const P=async()=>({dateTimePrefilled:new Date("2023-07-31T14:00:00.000Z")}),o=()=>{const i=y(),{state:t,handleSubmit:p}=i,n="Helper text",r="Instruction text",d=m.useMemo(()=>[{name:"singleDate",type:"date",label:"Single Date Calendar",required:!1,disabled:!1,helperText:n,instructionText:r,inputSettings:{showTime:!1}},{name:"dateTime",type:"date",label:"Date Time Input",required:!1,disabled:!1,helperText:n,instructionText:r,inputSettings:{showTime:!0}},{name:"dateTimePrefilled",type:"date",label:"Date Time with preset values",required:!1,disabled:!1,helperText:n,instructionText:r,inputSettings:{showTime:!0}},{name:"requiredDateTime",type:"date",label:"Required Single Date Calendar",required:!0,disabled:!1,helperText:n,instructionText:r,inputSettings:{showTime:!0}}],[]);return e.jsxs(e.Fragment,{children:[e.jsx(w,{...i,buttons:q(p),title:"Date Field Calendar",description:"This is a description example",fields:d,getFormValues:P}),e.jsx("h3",{children:"Date.toString()"}),e.jsx("pre",{children:Object.keys(t.data).map((s,u)=>e.jsxs("div",{children:[s,":"," ",t.data[s]&&t.data[s].toString()]},u))}),e.jsx("h3",{children:"State"}),e.jsx("pre",{children:JSON.stringify(t,null," ")})]})};var h,x,g;a.parameters={...a.parameters,docs:{...(h=a.parameters)==null?void 0:h.docs,source:{originalSource:`({ label, required, skeleton, diff --git a/sb8/qa/assets/Dialog-CZ_Rg0vQ.js b/sb8/qa/assets/Dialog-C5L98Bpm.js similarity index 94% rename from sb8/qa/assets/Dialog-CZ_Rg0vQ.js rename to sb8/qa/assets/Dialog-C5L98Bpm.js index 3406024b81..f47220aab5 100644 --- a/sb8/qa/assets/Dialog-CZ_Rg0vQ.js +++ b/sb8/qa/assets/Dialog-C5L98Bpm.js @@ -1,4 +1,4 @@ -import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as e}from"./index-3-_tf5dF.js";import{M as s,C as n}from"./index-oGQ2mxNr.js";import{s as p,P as a}from"./Dialog.stories-BBjxYkPe.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./Dialog-DXK7hw4q.js";import"./Button-Do5OxnZO.js";import"./theme-DRtZtbPc.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./useId-DLncWxdO.js";function r(t){const i={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...e(),...t.components};return o.jsxs(o.Fragment,{children:[o.jsx(s,{of:p}),` +import{j as o}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as e}from"./index-3-_tf5dF.js";import{M as s,C as n}from"./index-BbAFHYha.js";import{s as p,P as a}from"./Dialog.stories-BBjxYkPe.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./Dialog-DXK7hw4q.js";import"./Button-Do5OxnZO.js";import"./theme-DRtZtbPc.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./Popper-CPbWUqAP.js";import"./ownerWindow-DvT1GKkC.js";import"./createChainedFunction-BO_9K8Jh.js";import"./useTheme-5hcycNQy.js";import"./useToggle-lipGlewK.js";import"./useId-DLncWxdO.js";function r(t){const i={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",...e(),...t.components};return o.jsxs(o.Fragment,{children:[o.jsx(s,{of:p}),` `,o.jsx(i.h1,{id:"dialog",children:"Dialog"}),` `,o.jsxs(i.p,{children:["The ",o.jsx(i.code,{children:"Dialog"})," component is built over a wrapper for ",o.jsx(i.a,{href:"https://mui.com/components/dialogs/",rel:"nofollow",children:"Material-UI Dialog"})," but with SimpleView brand colors."]}),` `,o.jsx(i.p,{children:`A dialog is a type of modal window that appears in front of app content to provide critical information or ask for a decision.\r diff --git a/sb8/qa/assets/DocsRenderer-K4EAMTCU-DpPv9Gs3.js b/sb8/qa/assets/DocsRenderer-K4EAMTCU-Bcn-YnNS.js similarity index 86% rename from sb8/qa/assets/DocsRenderer-K4EAMTCU-DpPv9Gs3.js rename to sb8/qa/assets/DocsRenderer-K4EAMTCU-Bcn-YnNS.js index be6cbd25ae..6566471e6e 100644 --- a/sb8/qa/assets/DocsRenderer-K4EAMTCU-DpPv9Gs3.js +++ b/sb8/qa/assets/DocsRenderer-K4EAMTCU-Bcn-YnNS.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-3-_tf5dF.js","./index-BP8_t0zE.js"])))=>i.map(i=>d[i]); -import{_ as p}from"./iframe-CPBXIkt3.js";import{a as e,r as c}from"./index-BP8_t0zE.js";import{r as u,u as l}from"./react-18-DDrzupZ7.js";import{d as h,A as d,H as E,D as x}from"./index-oGQ2mxNr.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";var D={code:h,a:d,...E},_=class extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){let{showException:r}=this.props;r(t)}render(){let{hasError:t}=this.state,{children:r}=this.props;return t?null:e.createElement(e.Fragment,null,r)}},T=class{constructor(){this.render=async(t,r,n)=>{let s={...D,...r==null?void 0:r.components},m=x;return new Promise((i,a)=>{p(async()=>{const{MDXProvider:o}=await import("./index-3-_tf5dF.js");return{MDXProvider:o}},__vite__mapDeps([0,1]),import.meta.url).then(({MDXProvider:o})=>u(e.createElement(_,{showException:a,key:Math.random()},e.createElement(o,{components:s},e.createElement(m,{context:t,docsParameter:r}))),n)).then(()=>i())})},this.unmount=t=>{l(t)}}};export{T as DocsRenderer,D as defaultComponents}; +import{_ as p}from"./iframe-CjjOpcna.js";import{a as e,r as c}from"./index-BP8_t0zE.js";import{r as u,u as l}from"./react-18-DDrzupZ7.js";import{d as h,A as d,H as E,D as x}from"./index-BbAFHYha.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";var D={code:h,a:d,...E},_=class extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){let{showException:r}=this.props;r(t)}render(){let{hasError:t}=this.state,{children:r}=this.props;return t?null:e.createElement(e.Fragment,null,r)}},T=class{constructor(){this.render=async(t,r,n)=>{let s={...D,...r==null?void 0:r.components},m=x;return new Promise((i,a)=>{p(async()=>{const{MDXProvider:o}=await import("./index-3-_tf5dF.js");return{MDXProvider:o}},__vite__mapDeps([0,1]),import.meta.url).then(({MDXProvider:o})=>u(e.createElement(_,{showException:a,key:Math.random()},e.createElement(o,{components:s},e.createElement(m,{context:t,docsParameter:r}))),n)).then(()=>i())})},this.unmount=t=>{l(t)}}};export{T as DocsRenderer,D as defaultComponents}; diff --git a/sb8/qa/assets/DrawerForm.stories-CEgG4K8k.js b/sb8/qa/assets/DrawerForm.stories-C3XUuSSz.js similarity index 99% rename from sb8/qa/assets/DrawerForm.stories-CEgG4K8k.js rename to sb8/qa/assets/DrawerForm.stories-C3XUuSSz.js index 4f258dc54f..bebdaf7583 100644 --- a/sb8/qa/assets/DrawerForm.stories-CEgG4K8k.js +++ b/sb8/qa/assets/DrawerForm.stories-C3XUuSSz.js @@ -1,4 +1,4 @@ -import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as p}from"./index-BP8_t0zE.js";import{u as F,v as T,F as P}from"./Form-CecvGgxl.js";import{B as k}from"./Button-Do5OxnZO.js";import{D as A}from"./ColorSelected-HjDSMxjB.js";import{t as l,B as t}from"./theme-DRtZtbPc.js";import{u as D}from"./uniqueId-BPI7foNJ.js";import{S as o}from"./sizes-C6oSOElx.js";import{g as M,a as N}from"./optionGetters-DXvNsMp-.js";import{s as z}from"./styled-components.browser.esm-8MQ3dTkk.js";import{d as H}from"./AddCircleOutline-CXqn0GBH.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./Popper-CPbWUqAP.js";import"./index-BxmsGmlx.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./MoreVert-BbmWEP2K.js";import"./PageHeader-BRjQFO47.js";import"./ChevronRight-CSz705Z0.js";import"./toString-BjCnz-8e.js";import"./tslib.es6-CRos2fHm.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./styled-hJgfyZIG.js";import"./extends-CF3RwP-h.js";import"./createSvgIcon-DE5yaevU.js";const Je={title:"Components/Form"},n={type:"text",instructionText:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras venenatis arcu sed rutrum maximus.",required:!0,inputSettings:{maxCharacters:20}},m={type:"address",required:!0,inputSettings:{getOptionsCountries:M,getOptionsStates:N,googleMapsApiKey:"AIzaSyArV4f-KFF86Zn9VWAu9wS4hHlG1TXxqac"}},a={type:"mapCoordinates",instructionText:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras venenatis arcu sed rutrum maximus.",inputSettings:{googleMapsApiKey:"AIzaSyArV4f-KFF86Zn9VWAu9wS4hHlG1TXxqac"}},c=z.h2` +import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as p}from"./index-BP8_t0zE.js";import{u as F,v as T,F as P}from"./Form-CRl9vEGi.js";import{B as k}from"./Button-Do5OxnZO.js";import{D as A}from"./ColorSelected-HjDSMxjB.js";import{t as l,B as t}from"./theme-DRtZtbPc.js";import{u as D}from"./uniqueId-BPI7foNJ.js";import{S as o}from"./sizes-C6oSOElx.js";import{g as M,a as N}from"./optionGetters-DXvNsMp-.js";import{s as z}from"./styled-components.browser.esm-8MQ3dTkk.js";import{d as H}from"./AddCircleOutline-CXqn0GBH.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useControlled-im5M3O13.js";import"./getThemeProps-Cs15h2IA.js";import"./useTheme-5hcycNQy.js";import"./createSvgIcon-CPgMIgId.js";import"./testIds-DZf96GK8.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./useMosaicTranslation-CZCb37QS.js";import"./createSvgIcon-CcHL1II5.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useId-DLncWxdO.js";import"./Popper-CPbWUqAP.js";import"./index-BxmsGmlx.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";import"./MoreVert-BbmWEP2K.js";import"./PageHeader-BRjQFO47.js";import"./ChevronRight-CSz705Z0.js";import"./toString-BjCnz-8e.js";import"./tslib.es6-CRos2fHm.js";import"./emotion-unitless.esm-sScrWPmR.js";import"./styled-hJgfyZIG.js";import"./extends-CF3RwP-h.js";import"./createSvgIcon-DE5yaevU.js";const Je={title:"Components/Form"},n={type:"text",instructionText:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras venenatis arcu sed rutrum maximus.",required:!0,inputSettings:{maxCharacters:20}},m={type:"address",required:!0,inputSettings:{getOptionsCountries:M,getOptionsStates:N,googleMapsApiKey:"AIzaSyArV4f-KFF86Zn9VWAu9wS4hHlG1TXxqac"}},a={type:"mapCoordinates",instructionText:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras venenatis arcu sed rutrum maximus.",inputSettings:{googleMapsApiKey:"AIzaSyArV4f-KFF86Zn9VWAu9wS4hHlG1TXxqac"}},c=z.h2` font-family: ${l.museoFont}; font-size: 26px; font-weight: ${l.fontWeight.light}; diff --git a/sb8/qa/assets/Drawers-B7DDXSOi.js b/sb8/qa/assets/Drawers-CCB-J_2n.js similarity index 96% rename from sb8/qa/assets/Drawers-B7DDXSOi.js rename to sb8/qa/assets/Drawers-CCB-J_2n.js index 12be3ca6ea..aee3c0fed4 100644 --- a/sb8/qa/assets/Drawers-B7DDXSOi.js +++ b/sb8/qa/assets/Drawers-CCB-J_2n.js @@ -1,4 +1,4 @@ -import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as o}from"./index-3-_tf5dF.js";import{M as a,C as i}from"./index-oGQ2mxNr.js";import{s,P as p}from"./Drawers.stories-4yzzuJLS.js";import"./index-BP8_t0zE.js";import"./iframe-CPBXIkt3.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./Drawers-pcFoTkEg.js";import"./theme-DRtZtbPc.js";import"./testIds-DZf96GK8.js";import"./ChevronRight-CSz705Z0.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./Form-CecvGgxl.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./getThemeProps-Cs15h2IA.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./useMosaicTranslation-CZCb37QS.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";function r(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...o(),...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(a,{of:s}),` +import{j as t}from"./jsx-runtime-nGUw9YhZ.js";import{useMDXComponents as o}from"./index-3-_tf5dF.js";import{M as a,C as i}from"./index-BbAFHYha.js";import{s,P as p}from"./Drawers.stories-Dbqjbbut.js";import"./index-BP8_t0zE.js";import"./iframe-CjjOpcna.js";import"../sb-preview/runtime.js";import"./index-BxmsGmlx.js";import"./extends-CF3RwP-h.js";import"./tslib.es6-CRos2fHm.js";import"./index-DXimoRZY.js";import"./inheritsLoose-CMy1E8oj.js";import"./toString-BjCnz-8e.js";import"./index-DJqTsaQd.js";import"./index-DrFu-skq.js";import"./Drawers-pcFoTkEg.js";import"./theme-DRtZtbPc.js";import"./testIds-DZf96GK8.js";import"./ChevronRight-CSz705Z0.js";import"./generateUtilityClasses-DAcHHM0W.js";import"./createSvgIcon-CcHL1II5.js";import"./createSvgIcon-CPgMIgId.js";import"./createChainedFunction-BO_9K8Jh.js";import"./ownerWindow-DvT1GKkC.js";import"./useIsFocusVisible-De2ftVE9.js";import"./useId-DLncWxdO.js";import"./useControlled-im5M3O13.js";import"./Popper-CPbWUqAP.js";import"./useTheme-5hcycNQy.js";import"./Form-CRl9vEGi.js";import"./SideNav-D66jd1x5.js";import"./containerQuery-C0QVV4Kt.js";import"./useToggle-lipGlewK.js";import"./CheckboxList-BTpJVlmR.js";import"./isSymbol-CEVJpixJ.js";import"./Checkbox-Q9UDhbdf.js";import"./FormControlLabel-n1qioM9o.js";import"./formControlState-D52vkf9K.js";import"./ButtonBase-BZmvw3BH.js";import"./getThemeProps-Cs15h2IA.js";import"./FormFieldText.styled-BhoqJBjr.js";import"./Button-Do5OxnZO.js";import"./useMosaicTranslation-CZCb37QS.js";import"./index-DRdTCjFK.js";import"./debounce-DO3dP4oK.js";import"./DataViewPrimaryFilter.styled-CylNlUs-.js";import"./Chip-DoaLK3Y8.js";import"./ButtonRow-DWtIszZP.js";import"./Spinner-DgupAfKo.js";import"./Typography-Br_RMLnS.js";import"./SubtitleText-Vdwjg1jD.js";import"./sizes-C6oSOElx.js";import"./RadioButton-CO2cFro8.js";import"./StyledFormControl.styled-BHyCFBbY.js";import"./Toggle-SCloM1cV.js";import"./ColorSelected-HjDSMxjB.js";import"./TitleWrapper-D2l-_w9e.js";import"./TitleText-C9TlfF_O.js";import"./MoreVert-BbmWEP2K.js";import"./PageHeader-BRjQFO47.js";import"./formats-sBod7wm8.js";import"./Dialog-DXK7hw4q.js";import"./useMediaQuery-CguehUMS.js";import"./Snackbar-J6gNQC5v.js";import"./Close-Dlpx7KpR.js";import"./ClickAwayListener-DnjBLK-5.js";import"./TooltipIcon-CO3K7ssQ.js";function r(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...o(),...n.components};return t.jsxs(t.Fragment,{children:[t.jsx(a,{of:s}),` `,t.jsx(e.h1,{id:"drawers",children:"Drawers"}),` `,t.jsxs(e.p,{children:["The ",t.jsx(e.code,{children:"Drawers"})," component is wrapper that generates several ",t.jsx(e.a,{href:"https://mui.com/material-ui/react-drawer/#main-content",rel:"nofollow",children:"Material-UI Drawers"})," but with SimpleView brand colors."]}),` `,t.jsx(e.p,{children:`The component does not provide a mechanism for navigating between drawers, it only helps stacking one on top of another. diff --git a/sb8/qa/assets/Drawers.stories-4yzzuJLS.js b/sb8/qa/assets/Drawers.stories-Dbqjbbut.js similarity index 98% rename from sb8/qa/assets/Drawers.stories-4yzzuJLS.js rename to sb8/qa/assets/Drawers.stories-Dbqjbbut.js index c818e2bf16..ca19cadb57 100644 --- a/sb8/qa/assets/Drawers.stories-4yzzuJLS.js +++ b/sb8/qa/assets/Drawers.stories-Dbqjbbut.js @@ -1,4 +1,4 @@ -import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as o}from"./index-BP8_t0zE.js";import{D as f}from"./Drawers-pcFoTkEg.js";import{u as x,F as b}from"./Form-CecvGgxl.js";import{P as D}from"./PageHeader-BRjQFO47.js";const d=o.createContext({});function v({config:r,callbacks:n}){const a=o.useContext(d),s=x(),{state:i,methods:{setFieldValue:t}}=s,l=[{label:"Cancel",onClick:a.removeDrawer,color:"gray",variant:"outlined"},{label:"Save",onClick:()=>n.save(i.data),color:"yellow",variant:"contained",show:!!n.save},{label:"Open new form",onClick:()=>a.addDrawer({config:{type:"form",title:"Sub-Form",fields:[{name:"wut",label:"Wut",type:"text"},{name:"is",label:"Is",type:"text"},{name:"this",label:"This",type:"text"},{name:"from_parent",label:"From Parent",type:"text"}]},callbacks:{save:u=>{t({name:"from_parent",value:JSON.stringify(u)}),a.removeDrawer()}}}),color:"teal",variant:"outlined",tooltip:"Clicking opens form in a new drawer"}];return e.jsxs("div",{children:[e.jsx(b,{title:r.title,fields:r.fields,buttons:l,onBack:a.removeDrawer,...s}),e.jsxs("p",{children:["Data:",JSON.stringify(i.data)]})]})}function y(){const r=o.useContext(d);return e.jsxs(e.Fragment,{children:[e.jsx(D,{title:"Grid",onBack:r.removeDrawer}),e.jsx("p",{children:"Grid"})]})}const C={form:v,grid:y};function g({config:r,callbacks:n}){const a=C[r.type];return e.jsx(a,{config:r,callbacks:n})}const F={title:"Components/Drawers"},c=()=>{const[r,n]=o.useState({content:{},drawers:[]}),a=o.useCallback(t=>{n(l=>({...l,drawers:[...l.drawers,t]}))},[]),s=o.useCallback(()=>{n(t=>({...t,drawers:[...t.drawers.slice(0,-1)]}))},[]),i=o.useMemo(()=>({addDrawer:a,removeDrawer:s}),[a,s]);return e.jsx(d.Provider,{value:i,children:e.jsxs("div",{className:"App",children:[e.jsx("h1",{children:"Drawer Demo"}),e.jsxs("p",{children:["From Form:",JSON.stringify(r.content)]}),e.jsx("button",{onClick:()=>a({config:{type:"form",title:"New Form",fields:[{name:"foo",label:"Foo",type:"text"},{name:"bar",label:"Bar",type:"text"},{name:"baz",label:"Baz",type:"text"},{name:"from_parent",label:"From Parent",type:"text"}]},callbacks:{save:t=>{n(l=>({...l,content:t})),s()}}}),children:"Add Form"}),e.jsx(f,{drawers:r.drawers,children:t=>e.jsx(g,{config:t.config,callbacks:t.callbacks??{}})})]})})};var m,p,w;c.parameters={...c.parameters,docs:{...(m=c.parameters)==null?void 0:m.docs,source:{originalSource:`(): ReactElement => { +import{j as e}from"./jsx-runtime-nGUw9YhZ.js";import{r as o}from"./index-BP8_t0zE.js";import{D as f}from"./Drawers-pcFoTkEg.js";import{u as x,F as b}from"./Form-CRl9vEGi.js";import{P as D}from"./PageHeader-BRjQFO47.js";const d=o.createContext({});function v({config:r,callbacks:n}){const a=o.useContext(d),s=x(),{state:i,methods:{setFieldValue:t}}=s,l=[{label:"Cancel",onClick:a.removeDrawer,color:"gray",variant:"outlined"},{label:"Save",onClick:()=>n.save(i.data),color:"yellow",variant:"contained",show:!!n.save},{label:"Open new form",onClick:()=>a.addDrawer({config:{type:"form",title:"Sub-Form",fields:[{name:"wut",label:"Wut",type:"text"},{name:"is",label:"Is",type:"text"},{name:"this",label:"This",type:"text"},{name:"from_parent",label:"From Parent",type:"text"}]},callbacks:{save:u=>{t({name:"from_parent",value:JSON.stringify(u)}),a.removeDrawer()}}}),color:"teal",variant:"outlined",tooltip:"Clicking opens form in a new drawer"}];return e.jsxs("div",{children:[e.jsx(b,{title:r.title,fields:r.fields,buttons:l,onBack:a.removeDrawer,...s}),e.jsxs("p",{children:["Data:",JSON.stringify(i.data)]})]})}function y(){const r=o.useContext(d);return e.jsxs(e.Fragment,{children:[e.jsx(D,{title:"Grid",onBack:r.removeDrawer}),e.jsx("p",{children:"Grid"})]})}const C={form:v,grid:y};function g({config:r,callbacks:n}){const a=C[r.type];return e.jsx(a,{config:r,callbacks:n})}const F={title:"Components/Drawers"},c=()=>{const[r,n]=o.useState({content:{},drawers:[]}),a=o.useCallback(t=>{n(l=>({...l,drawers:[...l.drawers,t]}))},[]),s=o.useCallback(()=>{n(t=>({...t,drawers:[...t.drawers.slice(0,-1)]}))},[]),i=o.useMemo(()=>({addDrawer:a,removeDrawer:s}),[a,s]);return e.jsx(d.Provider,{value:i,children:e.jsxs("div",{className:"App",children:[e.jsx("h1",{children:"Drawer Demo"}),e.jsxs("p",{children:["From Form:",JSON.stringify(r.content)]}),e.jsx("button",{onClick:()=>a({config:{type:"form",title:"New Form",fields:[{name:"foo",label:"Foo",type:"text"},{name:"bar",label:"Bar",type:"text"},{name:"baz",label:"Baz",type:"text"},{name:"from_parent",label:"From Parent",type:"text"}]},callbacks:{save:t=>{n(l=>({...l,content:t})),s()}}}),children:"Add Form"}),e.jsx(f,{drawers:r.drawers,children:t=>e.jsx(g,{config:t.config,callbacks:t.callbacks??{}})})]})})};var m,p,w;c.parameters={...c.parameters,docs:{...(m=c.parameters)==null?void 0:m.docs,source:{originalSource:`(): ReactElement => { const [state, setState] = useState({ content: {}, drawers: [] diff --git a/sb8/qa/assets/Form-CecvGgxl.js b/sb8/qa/assets/Form-CRl9vEGi.js similarity index 92% rename from sb8/qa/assets/Form-CecvGgxl.js rename to sb8/qa/assets/Form-CRl9vEGi.js index 7ff2b11921..72e85e9d64 100644 --- a/sb8/qa/assets/Form-CecvGgxl.js +++ b/sb8/qa/assets/Form-CRl9vEGi.js @@ -1,4 +1,4 @@ -var BM=Object.defineProperty;var jM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var sl=(t,e,n)=>jM(t,typeof e!="symbol"?e+"":e,n);import{j as v,r as St}from"./jsx-runtime-nGUw9YhZ.js";import{g as Aa,a as O,r as h,c as al}from"./index-BP8_t0zE.js";import{s as Q,C as hx,t as _,n as ko,B as zM}from"./theme-DRtZtbPc.js";import{S as HM}from"./SideNav-D66jd1x5.js";import{c as Wt}from"./containerQuery-C0QVV4Kt.js";import{C as VM,F as WM,l as Pa,k as mx,A as UM,r as gx,B as vx,D as GM,o as qM,E as yx,G as KM,H as YM,I as JM,J as ZM,K as au,L as bx,b as xx,M as XM,N as QM,O as eE,g as mr,P as tE,Q as nE,R as rE,d as oE,z as iE,p as sE,S as wx,m as aE,a as lE,T as cE,w as Cx,U as uE,V as dE,W as pE,j as fE,v as hE,X as mE}from"./CheckboxList-BTpJVlmR.js";import{S as lu,F as Sx,i as Ku,b as Po,o as Mg,f as bi,A as gE,T as Af,I as kx,c as vE}from"./FormFieldText.styled-BhoqJBjr.js";import{I as fa,a as yE,D as bE,d as xE}from"./index-DRdTCjFK.js";import{S as Xe,a as Jl,B as Ra}from"./ButtonRow-DWtIszZP.js";import{_ as tt,d as J,T as wE,L as CE,H as SE,I as pp,i as kt,g as En,a as At,s as Ee,b as Da,u as ii,e as Hn,f as Tn,j as Yu,M as kE,E as ME,z as cu,y as Pf,N as EE}from"./generateUtilityClasses-DAcHHM0W.js";import{r as Mt}from"./createSvgIcon-CcHL1II5.js";import{C as fp,a as TE,d as Mx}from"./Chip-DoaLK3Y8.js";import{S as ft}from"./sizes-C6oSOElx.js";import{c as qr}from"./createSvgIcon-CPgMIgId.js";import{I as Mo,d as Is,G as OE,u as Rf,T as Df,P as LE,B as un,e as AE}from"./Button-Do5OxnZO.js";import{f as PE,T as Ex,R as RE,a as si,P as Ia,u as ms,g as Eg,h as DE,m as IE,j as $E,k as NE,F as Tx}from"./Popper-CPbWUqAP.js";import{u as If}from"./useId-DLncWxdO.js";import{u as es}from"./useControlled-im5M3O13.js";import{_ as _E,a as $s,s as FE,u as Wr,c as Re,d as BE,b as $f}from"./useIsFocusVisible-De2ftVE9.js";import{d as Nf}from"./DataViewPrimaryFilter.styled-CylNlUs-.js";import{a as jE,R as zE}from"./RadioButton-CO2cFro8.js";import{T as HE}from"./Toggle-SCloM1cV.js";import{b as _f,d as ai,i as uu,_ as $a,c as VE,a as WE}from"./isSymbol-CEVJpixJ.js";import{r as _e,t as De,b as UE,c as Ox,_ as GE,C as qE,P as KE,d as Lt,e as Ff,g as hp,h as du,i as YE,s as mp,j as Lx,k as JE,l as ZE,n as Tg,o as XE,p as Og,q as QE,u as eT,v as Ax,w as eo,x as Px,f as Ki,y as tT,z as nT,A as Pl,D as Bf,B as rT,a as oT,E as iT,F as Zl}from"./ColorSelected-HjDSMxjB.js";import{D as Yi,b as sT,T as aT,c as lT}from"./formats-sBod7wm8.js";import{u as cT,T as xo}from"./FormControlLabel-n1qioM9o.js";import{b as uT,c as Lg,e as dT,f as st,g as rt,h as Le,i as ot,_ as pT}from"./useMosaicTranslation-CZCb37QS.js";import{a as fT,b as hT,d as Ag,c as mT,D as jf}from"./Dialog-DXK7hw4q.js";import{o as Ju}from"./ownerWindow-DvT1GKkC.js";import{B as Rx,T as Dx}from"./ButtonBase-BZmvw3BH.js";import{u as gT}from"./useTheme-5hcycNQy.js";import{u as vT}from"./useMediaQuery-CguehUMS.js";import{D as Ix,a as yT,b as bT}from"./TitleWrapper-D2l-_w9e.js";import{T as xT}from"./Typography-Br_RMLnS.js";import{T as wT}from"./TitleText-C9TlfF_O.js";import{t as CT,d as ST}from"./debounce-DO3dP4oK.js";import{S as zf}from"./Snackbar-J6gNQC5v.js";import{r as Eo,R as kT}from"./index-BxmsGmlx.js";import{t as Lr}from"./testIds-DZf96GK8.js";import{T as MT,F as Hf,B as gp}from"./TooltipIcon-CO3K7ssQ.js";import{g as Rl}from"./useToggle-lipGlewK.js";import{C as ET}from"./ClickAwayListener-DnjBLK-5.js";import{d as TT}from"./MoreVert-BbmWEP2K.js";import{P as OT}from"./PageHeader-BRjQFO47.js";import{S as Vf}from"./Spinner-DgupAfKo.js";var $x={exports:{}},LT="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",AT=LT,PT=AT;function Nx(){}function _x(){}_x.resetWarningCache=Nx;var RT=function(){function t(r,o,i,s,a,l){if(l!==PT){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:_x,resetWarningCache:Nx};return n.PropTypes=n,n};$x.exports=RT();var Fx=$x.exports;const Se=Aa(Fx);function DT(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function IT(t,e){t.classList?t.classList.add(e):DT(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function Pg(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function $T(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=Pg(t.className,e):t.setAttribute("class",Pg(t.className&&t.className.baseVal||"",e))}var NT=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return IT(e,r)})},Zu=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return $T(e,r)})},Wf=function(t){_E(e,t);function e(){for(var r,o=arguments.length,i=new Array(o),s=0;s{const e=h.useRef({});return h.useEffect(()=>{e.current=t}),e.current},Bx=h.createContext(null);function jx(){return h.useContext(Bx)}const FT=typeof Symbol=="function"&&Symbol.for,BT=FT?Symbol.for("mui.nested"):"__THEME_NESTED__";function jT(t,e){return typeof e=="function"?e(t):J({},t,e)}function zT(t){const{children:e,theme:n}=t,r=jx(),o=h.useMemo(()=>{const i=r===null?n:jT(r,n);return i!=null&&(i[BT]=r!==null),i},[n,r]);return v.jsx(Bx.Provider,{value:o,children:e})}const Rg={};function Dg(t,e,n,r=!1){return h.useMemo(()=>{const o=t&&e[t]||e;if(typeof n=="function"){const i=n(o),s=t?J({},e,{[t]:i}):i;return r?()=>s:s}return t?J({},e,{[t]:n}):J({},e,n)},[t,e,n,r])}function HT(t){const{children:e,theme:n,themeId:r}=t,o=gT(Rg),i=jx()||Rg,s=Dg(r,o,n),a=Dg(r,i,n,!0),l=s.direction==="rtl";return v.jsx(zT,{theme:a,children:v.jsx(wE.Provider,{value:s,children:v.jsx(RE,{value:l,children:v.jsx(CE,{value:s==null?void 0:s.components,children:e})})})})}function Kr({props:t,name:e}){return cT({props:t,name:e,defaultTheme:SE,themeId:pp})}const VT=["theme"];function WT(t){let{theme:e}=t,n=tt(t,VT);const r=e[pp];return v.jsx(HT,J({},n,{themeId:r?pp:void 0,theme:r||e}))}function is(t){_e(1,arguments);var e=De(t);return e.setHours(0,0,0,0),e}function UT(t,e){_e(2,arguments);var n=is(t),r=is(e);return n.getTime()===r.getTime()}const GT=Q.div` +var BM=Object.defineProperty;var jM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var sl=(t,e,n)=>jM(t,typeof e!="symbol"?e+"":e,n);import{j as v,r as St}from"./jsx-runtime-nGUw9YhZ.js";import{g as Aa,a as O,r as h,c as al}from"./index-BP8_t0zE.js";import{s as Q,C as hx,t as _,n as ko,B as zM}from"./theme-DRtZtbPc.js";import{S as HM}from"./SideNav-D66jd1x5.js";import{c as Wt}from"./containerQuery-C0QVV4Kt.js";import{C as VM,F as WM,l as Pa,k as mx,A as UM,r as gx,B as vx,D as GM,o as qM,E as yx,G as KM,H as YM,I as JM,J as ZM,K as au,L as bx,b as xx,M as XM,N as QM,O as eE,g as mr,P as tE,Q as nE,R as rE,d as oE,z as iE,p as sE,S as wx,m as aE,a as lE,T as cE,w as Cx,U as uE,V as dE,W as pE,j as fE,v as hE,X as mE}from"./CheckboxList-BTpJVlmR.js";import{S as lu,F as Sx,i as Yu,b as Po,o as Mg,f as bi,A as gE,T as Pf,I as kx,c as vE}from"./FormFieldText.styled-BhoqJBjr.js";import{I as fa,a as yE,D as bE,d as xE}from"./index-DRdTCjFK.js";import{S as Xe,a as Jl,B as Ra}from"./ButtonRow-DWtIszZP.js";import{_ as tt,d as J,T as wE,L as CE,H as SE,I as fp,i as kt,g as En,a as At,s as Ee,b as Da,u as ii,e as Hn,f as Tn,j as Ju,M as kE,E as ME,z as cu,y as Rf,N as EE}from"./generateUtilityClasses-DAcHHM0W.js";import{r as Mt}from"./createSvgIcon-CcHL1II5.js";import{C as hp,a as TE,d as Mx}from"./Chip-DoaLK3Y8.js";import{S as ft}from"./sizes-C6oSOElx.js";import{c as qr}from"./createSvgIcon-CPgMIgId.js";import{I as Mo,d as Is,G as OE,u as Df,T as If,P as LE,B as un,e as AE}from"./Button-Do5OxnZO.js";import{f as PE,T as Ex,R as RE,a as si,P as Ia,u as ms,g as Eg,h as DE,m as IE,j as $E,k as NE,F as Tx}from"./Popper-CPbWUqAP.js";import{u as $f}from"./useId-DLncWxdO.js";import{u as es}from"./useControlled-im5M3O13.js";import{_ as _E,a as $s,s as FE,u as Wr,c as Re,d as BE,b as Nf}from"./useIsFocusVisible-De2ftVE9.js";import{d as _f}from"./DataViewPrimaryFilter.styled-CylNlUs-.js";import{a as jE,R as zE}from"./RadioButton-CO2cFro8.js";import{T as HE}from"./Toggle-SCloM1cV.js";import{b as Ff,d as ai,i as uu,_ as $a,c as VE,a as WE}from"./isSymbol-CEVJpixJ.js";import{r as _e,t as De,b as UE,c as Ox,_ as GE,C as qE,P as KE,d as Lt,e as Bf,g as mp,h as du,i as YE,s as gp,j as Lx,k as JE,l as ZE,n as Tg,o as XE,p as Og,q as QE,u as eT,v as Ax,w as eo,x as Px,f as Ki,y as tT,z as nT,A as Pl,D as jf,B as rT,a as oT,E as iT,F as Zl}from"./ColorSelected-HjDSMxjB.js";import{D as Yi,b as sT,T as aT,c as lT}from"./formats-sBod7wm8.js";import{u as cT,T as xo}from"./FormControlLabel-n1qioM9o.js";import{b as uT,c as Lg,e as dT,f as st,g as rt,h as Le,i as ot,_ as pT}from"./useMosaicTranslation-CZCb37QS.js";import{a as fT,b as hT,d as Ag,c as mT,D as zf}from"./Dialog-DXK7hw4q.js";import{o as Zu}from"./ownerWindow-DvT1GKkC.js";import{B as Rx,T as Dx}from"./ButtonBase-BZmvw3BH.js";import{u as gT}from"./useTheme-5hcycNQy.js";import{u as vT}from"./useMediaQuery-CguehUMS.js";import{D as Ix,a as yT,b as bT}from"./TitleWrapper-D2l-_w9e.js";import{T as xT}from"./Typography-Br_RMLnS.js";import{T as wT}from"./TitleText-C9TlfF_O.js";import{t as CT,d as ST}from"./debounce-DO3dP4oK.js";import{S as Hf}from"./Snackbar-J6gNQC5v.js";import{r as Eo,R as kT}from"./index-BxmsGmlx.js";import{t as Lr}from"./testIds-DZf96GK8.js";import{T as MT,F as Vf,B as vp}from"./TooltipIcon-CO3K7ssQ.js";import{g as Rl}from"./useToggle-lipGlewK.js";import{C as ET}from"./ClickAwayListener-DnjBLK-5.js";import{d as TT}from"./MoreVert-BbmWEP2K.js";import{P as OT}from"./PageHeader-BRjQFO47.js";import{S as Wf}from"./Spinner-DgupAfKo.js";var $x={exports:{}},LT="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",AT=LT,PT=AT;function Nx(){}function _x(){}_x.resetWarningCache=Nx;var RT=function(){function t(r,o,i,s,a,l){if(l!==PT){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:_x,resetWarningCache:Nx};return n.PropTypes=n,n};$x.exports=RT();var Fx=$x.exports;const Se=Aa(Fx);function DT(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function IT(t,e){t.classList?t.classList.add(e):DT(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function Pg(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function $T(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=Pg(t.className,e):t.setAttribute("class",Pg(t.className&&t.className.baseVal||"",e))}var NT=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return IT(e,r)})},Xu=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return $T(e,r)})},Uf=function(t){_E(e,t);function e(){for(var r,o=arguments.length,i=new Array(o),s=0;s{const e=h.useRef({});return h.useEffect(()=>{e.current=t}),e.current},Bx=h.createContext(null);function jx(){return h.useContext(Bx)}const FT=typeof Symbol=="function"&&Symbol.for,BT=FT?Symbol.for("mui.nested"):"__THEME_NESTED__";function jT(t,e){return typeof e=="function"?e(t):J({},t,e)}function zT(t){const{children:e,theme:n}=t,r=jx(),o=h.useMemo(()=>{const i=r===null?n:jT(r,n);return i!=null&&(i[BT]=r!==null),i},[n,r]);return v.jsx(Bx.Provider,{value:o,children:e})}const Rg={};function Dg(t,e,n,r=!1){return h.useMemo(()=>{const o=t&&e[t]||e;if(typeof n=="function"){const i=n(o),s=t?J({},e,{[t]:i}):i;return r?()=>s:s}return t?J({},e,{[t]:n}):J({},e,n)},[t,e,n,r])}function HT(t){const{children:e,theme:n,themeId:r}=t,o=gT(Rg),i=jx()||Rg,s=Dg(r,o,n),a=Dg(r,i,n,!0),l=s.direction==="rtl";return v.jsx(zT,{theme:a,children:v.jsx(wE.Provider,{value:s,children:v.jsx(RE,{value:l,children:v.jsx(CE,{value:s==null?void 0:s.components,children:e})})})})}function Kr({props:t,name:e}){return cT({props:t,name:e,defaultTheme:SE,themeId:fp})}const VT=["theme"];function WT(t){let{theme:e}=t,n=tt(t,VT);const r=e[fp];return v.jsx(HT,J({},n,{themeId:r?fp:void 0,theme:r||e}))}function is(t){_e(1,arguments);var e=De(t);return e.setHours(0,0,0,0),e}function UT(t,e){_e(2,arguments);var n=is(t),r=is(e);return n.getTime()===r.getTime()}const GT=Q.div` position: relative; display: flex; flex-direction: column; @@ -71,7 +71,7 @@ var BM=Object.defineProperty;var jM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,config container-type: inline-size; container-name: ${hx.FORM_COL}; -`;function vp(t){return"isPending"in t&&t.isPending}function yp(t){return Object.prototype.toString.call(t)==="[object Object]"}const zx=t=>{if(!(t===""||Array.isArray(t)&&t.length===0)&&!(yp(t)&&!Object.values(t).filter(e=>e!==void 0).length))return t};function Xt(t){return{internalValue:t,value:zx(t)}}const e2=t=>{var m,g,y,b,x,S,E,k;const{fieldDef:e,error:n,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=t,u=(m=e==null?void 0:e.inputSettings)!=null&&m.prefixElement?{startAdornment:v.jsx(fa,{position:"start",children:(g=e==null?void 0:e.inputSettings)==null?void 0:g.prefixElement})}:null,d=w=>{const{value:M}=w.target;r&&r(M)},p=w=>{const{value:M}=w.target;o&&o(M===""?void 0:M),e!=null&&e.onBlurCb&&(e==null||e.onBlurCb(M))},f=typeof n=="string"?(n==null?void 0:n.trim().length)>0:!1;return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(lu,{id:l,"data-testid":"form-field-text-test-id",value:i??"",onChange:d,onBlur:p,variant:"outlined",error:f||f&&(e==null?void 0:e.required),className:e==null?void 0:e.className,placeholder:(y=e==null?void 0:e.inputSettings)==null?void 0:y.placeholder,multiline:(b=e==null?void 0:e.inputSettings)==null?void 0:b.multiline,fieldSize:e==null?void 0:e.size,InputProps:{...u||{},inputRef:a},required:e==null?void 0:e.required,type:((x=e==null?void 0:e.inputSettings)==null?void 0:x.type)==="number"?"text":(S=e==null?void 0:e.inputSettings)==null?void 0:S.type,minRows:(E=e==null?void 0:e.inputSettings)==null?void 0:E.minRows,maxRows:(k=e==null?void 0:e.inputSettings)==null?void 0:k.maxRows,disabled:s})},t2=h.memo(e2);var Uf={},n2=kt;Object.defineProperty(Uf,"__esModule",{value:!0});var Gf=Uf.default=void 0,r2=n2(Mt()),o2=St();Gf=Uf.default=(0,r2.default)((0,o2.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline");Q.div` +`;function yp(t){return"isPending"in t&&t.isPending}function bp(t){return Object.prototype.toString.call(t)==="[object Object]"}const zx=t=>{if(!(t===""||Array.isArray(t)&&t.length===0)&&!(bp(t)&&!Object.values(t).filter(e=>e!==void 0).length))return t};function Xt(t){return{internalValue:t,value:zx(t)}}const e2=t=>{var m,g,y,b,x,S,E,k;const{fieldDef:e,error:n,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=t,u=(m=e==null?void 0:e.inputSettings)!=null&&m.prefixElement?{startAdornment:v.jsx(fa,{position:"start",children:(g=e==null?void 0:e.inputSettings)==null?void 0:g.prefixElement})}:null,d=w=>{const{value:M}=w.target;r&&r(M)},p=w=>{const{value:M}=w.target;o&&o(M===""?void 0:M),e!=null&&e.onBlurCb&&(e==null||e.onBlurCb(M))},f=typeof n=="string"?(n==null?void 0:n.trim().length)>0:!1;return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(lu,{id:l,"data-testid":"form-field-text-test-id",value:i??"",onChange:d,onBlur:p,variant:"outlined",error:f||f&&(e==null?void 0:e.required),className:e==null?void 0:e.className,placeholder:(y=e==null?void 0:e.inputSettings)==null?void 0:y.placeholder,multiline:(b=e==null?void 0:e.inputSettings)==null?void 0:b.multiline,fieldSize:e==null?void 0:e.size,InputProps:{...u||{},inputRef:a},required:e==null?void 0:e.required,type:((x=e==null?void 0:e.inputSettings)==null?void 0:x.type)==="number"?"text":(S=e==null?void 0:e.inputSettings)==null?void 0:S.type,minRows:(E=e==null?void 0:e.inputSettings)==null?void 0:E.minRows,maxRows:(k=e==null?void 0:e.inputSettings)==null?void 0:k.maxRows,disabled:s})},t2=h.memo(e2);var Gf={},n2=kt;Object.defineProperty(Gf,"__esModule",{value:!0});var qf=Gf.default=void 0,r2=n2(Mt()),o2=St();qf=Gf.default=(0,r2.default)((0,o2.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline");Q.div` display: flex; `;const i2=Q(VM)` &.MuiFormGroup-root { @@ -95,7 +95,7 @@ var BM=Object.defineProperty;var jM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,config display: flex; flex-direction: row; margin-top: 8px; -`;Q(Gf)` +`;Q(qf)` &.MuiSvgIcon-root { font-size: 16px; margin-right: 8px; @@ -113,7 +113,7 @@ var BM=Object.defineProperty;var jM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,config width: 18px; height: 40px; margin-right: 14px; -`;function Xu(){return v.jsxs(a2,{children:[v.jsx(l2,{children:v.jsx(Xe,{variant:"rectangular",width:18,height:18})}),v.jsx(Xe,{width:52,height:28})]})}function c2(){return v.jsxs(s2,{children:[v.jsx(Xu,{}),v.jsx(Xu,{}),v.jsx(Xu,{})]})}const u2=t=>{var g,y;const{fieldDef:e,onChange:n,onBlur:r,value:o,disabled:i,skeleton:s,id:a}=t,[l,c]=h.useState([]),[u,d]=h.useState([]),[p,f]=h.useState(void 0);h.useEffect(()=>{(async()=>{var x,S;if((x=e==null?void 0:e.inputSettings)!=null&&x.options)c(e.inputSettings.options),f(!0);else if((S=e==null?void 0:e.inputSettings)!=null&&S.getOptions){const E=await e.inputSettings.getOptions();c(E),f(!1)}})()},[(g=e==null?void 0:e.inputSettings)==null?void 0:g.options,(y=e==null?void 0:e.inputSettings)==null?void 0:y.getOptions]),h.useEffect(()=>{o&&p===!1&&o.forEach(b=>{l.find(x=>(x==null?void 0:x.value)===(b==null?void 0:b.value))||c([...l,b])}),d(o)},[l,o,p]);const m=(b,x)=>{const S=b==null?void 0:b.map(E=>l.find(k=>(k==null?void 0:k.value)===E.value));x&&x(S)};return s?v.jsx(c2,{}):v.jsx(i2,{disabled:i,checked:u,options:l,onChange:b=>m(b,n),onChangeCb:b=>m(b,e.onChangeCb),onBlur:r,style:e.style,className:e.className,id:a})},d2=h.memo(u2),p2=Q.div` +`;function Qu(){return v.jsxs(a2,{children:[v.jsx(l2,{children:v.jsx(Xe,{variant:"rectangular",width:18,height:18})}),v.jsx(Xe,{width:52,height:28})]})}function c2(){return v.jsxs(s2,{children:[v.jsx(Qu,{}),v.jsx(Qu,{}),v.jsx(Qu,{})]})}const u2=t=>{var g,y;const{fieldDef:e,onChange:n,onBlur:r,value:o,disabled:i,skeleton:s,id:a}=t,[l,c]=h.useState([]),[u,d]=h.useState([]),[p,f]=h.useState(void 0);h.useEffect(()=>{(async()=>{var x,S;if((x=e==null?void 0:e.inputSettings)!=null&&x.options)c(e.inputSettings.options),f(!0);else if((S=e==null?void 0:e.inputSettings)!=null&&S.getOptions){const E=await e.inputSettings.getOptions();c(E),f(!1)}})()},[(g=e==null?void 0:e.inputSettings)==null?void 0:g.options,(y=e==null?void 0:e.inputSettings)==null?void 0:y.getOptions]),h.useEffect(()=>{o&&p===!1&&o.forEach(b=>{l.find(x=>(x==null?void 0:x.value)===(b==null?void 0:b.value))||c([...l,b])}),d(o)},[l,o,p]);const m=(b,x)=>{const S=b==null?void 0:b.map(E=>l.find(k=>(k==null?void 0:k.value)===E.value));x&&x(S)};return s?v.jsx(c2,{}):v.jsx(i2,{disabled:i,checked:u,options:l,onChange:b=>m(b,n),onChangeCb:b=>m(b,e.onChangeCb),onBlur:r,style:e.style,className:e.className,id:a})},d2=h.memo(u2),p2=Q.div` display: flex; flex-wrap: wrap; row-gap: 12px; @@ -133,7 +133,7 @@ var BM=Object.defineProperty;var jM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,config & .MuiSkeleton-root { border-radius: 99999em; } -`;function h2(){return v.jsxs(f2,{children:[v.jsx(Xe,{variant:"rounded",width:85,height:32}),v.jsx(Xe,{variant:"rounded",width:78,height:32}),v.jsx(Xe,{variant:"rounded",width:186,height:32})]})}const m2=t=>{var x,S;const{fieldDef:e,error:n,onChange:r,onBlur:o,value:i,disabled:s,skeleton:a}=t,{required:l}=e||null,[c,u]=h.useState([]),[d,p]=h.useState(!1),[f,m]=h.useState(void 0);h.useEffect(()=>{(async()=>{var k,w;if((k=e==null?void 0:e.inputSettings)!=null&&k.options)u(e.inputSettings.options),m(!0);else if((w=e==null?void 0:e.inputSettings)!=null&&w.getOptions){const M=await e.inputSettings.getOptions();u(M),m(!1)}p(!1)})()},[(x=e==null?void 0:e.inputSettings)==null?void 0:x.options,(S=e==null?void 0:e.inputSettings)==null?void 0:S.getOptions]),h.useEffect(()=>{i&&!d&&(f===!0&&g(i),f===!1&&(c.find(E=>E.value===i.value)?g(i):u([...c,{...i,selected:!0}])),p(!0))},[i,d,c,f]);const g=E=>{let k=[...c];k=k.map(M=>(M==null?void 0:M.value)===(E==null?void 0:E.value)?{...M,selected:l&&M.selected?M.selected:!M.selected}:{...M,selected:!1});const w=k.find(M=>M.selected===!0);return u(k),w},y=E=>{const k=g(E);p(!0),r(k?{label:k.label,value:k.value}:void 0)},b=typeof n=="string"?(n==null?void 0:n.trim().length)>0:!1;return a?v.jsx(h2,{}):v.jsx(p2,{$error:b,onBlur:o,role:"listbox",children:c.map(E=>v.jsx(fp,{label:E.label,disabled:s,selected:E.selected,onClick:()=>y(E),role:"option"},E.value))})},g2=h.memo(m2);function Ig(t){return typeof t.normalize<"u"?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t}function v2(t={}){const{ignoreAccents:e=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:s=!1}=t;return(a,{inputValue:l,getOptionLabel:c})=>{let u=s?l.trim():l;n&&(u=u.toLowerCase()),e&&(u=Ig(u));const d=u?a.filter(p=>{let f=(i||c)(p);return n&&(f=f.toLowerCase()),e&&(f=Ig(f)),o==="start"?f.indexOf(u)===0:f.indexOf(u)>-1}):a;return typeof r=="number"?d.slice(0,r):d}}function ll(t,e){for(let n=0;n{var e;return t.current!==null&&((e=t.current.parentElement)==null?void 0:e.contains(document.activeElement))};function x2(t){const{unstable_isActiveElementInListbox:e=b2,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:s=!1,clearOnBlur:a=!t.freeSolo,clearOnEscape:l=!1,componentName:c="useAutocomplete",defaultValue:u=t.multiple?[]:null,disableClearable:d=!1,disableCloseOnSelect:p=!1,disabled:f,disabledItemsFocusable:m=!1,disableListWrap:g=!1,filterOptions:y=y2,filterSelectedOptions:b=!1,freeSolo:x=!1,getOptionDisabled:S,getOptionKey:E,getOptionLabel:k=re=>{var ee;return(ee=re.label)!=null?ee:re},groupBy:w,handleHomeEndKeys:M=!t.freeSolo,id:T,includeInputInList:D=!1,inputValue:P,isOptionEqualToValue:U=(re,ee)=>re===ee,multiple:N=!1,onChange:K,onClose:R,onHighlightChange:B,onInputChange:z,onOpen:I,open:oe,openOnFocus:me=!1,options:te,readOnly:G=!1,selectOnFocus:X=!t.freeSolo,value:ie}=t,Y=If(T);let C=k;C=re=>{const ee=k(re);return typeof ee!="string"?String(ee):ee};const A=h.useRef(!1),j=h.useRef(!0),H=h.useRef(null),V=h.useRef(null),[fe,pe]=h.useState(null),[he,ke]=h.useState(-1),Te=o?0:-1,$=h.useRef(Te),[F,de]=es({controlled:ie,default:u,name:c}),[Z,ae]=es({controlled:P,default:"",name:c,state:"inputValue"}),[ue,ye]=h.useState(!1),be=h.useCallback((re,ee)=>{if(!(N?F.length!(b&&(N?F:[F]).some(ee=>ee!==null&&U(re,ee)))),{inputValue:Ae&&je?"":Z,getOptionLabel:C}):[],it=_T({filteredOptions:Pe,value:F,inputValue:Z});h.useEffect(()=>{const re=F!==it.value;ue&&!re||x&&!re||be(null,F)},[F,be,ue,it.value,x]);const jt=ge&&Pe.length>0&&!G,Pt=$s(re=>{re===-1?H.current.focus():fe.querySelector(`[data-tag-index="${re}"]`).focus()});h.useEffect(()=>{N&&he>F.length-1&&(ke(-1),Pt(-1))},[F,N,he,Pt]);function Gt(re,ee){if(!V.current||re<0||re>=Pe.length)return-1;let Me=re;for(;;){const xe=V.current.querySelector(`[data-option-index="${Me}"]`),ze=m?!1:!xe||xe.disabled||xe.getAttribute("aria-disabled")==="true";if(xe&&xe.hasAttribute("tabindex")&&!ze)return Me;if(ee==="next"?Me=(Me+1)%Pe.length:Me=(Me-1+Pe.length)%Pe.length,Me===re)return-1}}const zt=$s(({event:re,index:ee,reason:Me="auto"})=>{if($.current=ee,ee===-1?H.current.removeAttribute("aria-activedescendant"):H.current.setAttribute("aria-activedescendant",`${Y}-option-${ee}`),B&&B(re,ee===-1?null:Pe[ee],Me),!V.current)return;const xe=V.current.querySelector(`[role="option"].${n}-focused`);xe&&(xe.classList.remove(`${n}-focused`),xe.classList.remove(`${n}-focusVisible`));let ze=V.current;if(V.current.getAttribute("role")!=="listbox"&&(ze=V.current.parentElement.querySelector('[role="listbox"]')),!ze)return;if(ee===-1){ze.scrollTop=0;return}const et=V.current.querySelector(`[data-option-index="${ee}"]`);if(et&&(et.classList.add(`${n}-focused`),Me==="keyboard"&&et.classList.add(`${n}-focusVisible`),ze.scrollHeight>ze.clientHeight&&Me!=="mouse"&&Me!=="touch")){const L=et,q=ze.clientHeight+ze.scrollTop,le=L.offsetTop+L.offsetHeight;le>q?ze.scrollTop=le-ze.clientHeight:L.offsetTop-L.offsetHeight*(w?1.3:0){if(!He)return;const et=Gt((()=>{const L=Pe.length-1;if(ee==="reset")return Te;if(ee==="start")return 0;if(ee==="end")return L;const q=$.current+ee;return q<0?q===-1&&D?-1:g&&$.current!==-1||Math.abs(ee)>1?0:L:q>L?q===L+1&&D?-1:g||Math.abs(ee)>1?L:0:q})(),Me);if(zt({index:et,reason:xe,event:re}),r&&ee!=="reset")if(et===-1)H.current.value=Z;else{const L=C(Pe[et]);H.current.value=L,L.toLowerCase().indexOf(Z.toLowerCase())===0&&Z.length>0&&H.current.setSelectionRange(Z.length,L.length)}}),lt=()=>{const re=(ee,Me)=>{const xe=ee?C(ee):"",ze=Me?C(Me):"";return xe===ze};if($.current!==-1&&it.filteredOptions&&it.filteredOptions.length!==Pe.length&&it.inputValue===Z&&(N?F.length===it.value.length&&it.value.every((ee,Me)=>C(F[Me])===C(ee)):re(it.value,F))){const ee=it.filteredOptions[$.current];if(ee)return ll(Pe,Me=>C(Me)===C(ee))}return-1},xn=h.useCallback(()=>{if(!He)return;const re=lt();if(re!==-1){$.current=re;return}const ee=N?F[0]:F;if(Pe.length===0||ee==null){qt({diff:"reset"});return}if(V.current){if(ee!=null){const Me=Pe[$.current];if(N&&Me&&ll(F,ze=>U(Me,ze))!==-1)return;const xe=ll(Pe,ze=>U(ze,ee));xe===-1?qt({diff:"reset"}):zt({index:xe});return}if($.current>=Pe.length-1){zt({index:Pe.length-1});return}zt({index:$.current})}},[Pe.length,N?!1:F,b,qt,zt,He,Z,N]),In=$s(re=>{FE(V,re),re&&xn()});h.useEffect(()=>{xn()},[xn]);const $t=re=>{ge||(ce(!0),Oe(!0),I&&I(re))},dn=(re,ee)=>{ge&&(ce(!1),R&&R(re,ee))},Kt=(re,ee,Me,xe)=>{if(N){if(F.length===ee.length&&F.every((ze,et)=>ze===ee[et]))return}else if(F===ee)return;K&&K(re,ee,Me,xe),de(ee)},On=h.useRef(!1),$n=(re,ee,Me="selectOption",xe="options")=>{let ze=Me,et=ee;if(N){et=Array.isArray(F)?F.slice():[];const L=ll(et,q=>U(ee,q));L===-1?et.push(ee):xe!=="freeSolo"&&(et.splice(L,1),ze="removeOption")}be(re,et),Kt(re,et,ze,{option:ee}),!p&&(!re||!re.ctrlKey&&!re.metaKey)&&dn(re,ze),(s===!0||s==="touch"&&On.current||s==="mouse"&&!On.current)&&H.current.blur()};function Kn(re,ee){if(re===-1)return-1;let Me=re;for(;;){if(ee==="next"&&Me===F.length||ee==="previous"&&Me===-1)return-1;const xe=fe.querySelector(`[data-tag-index="${Me}"]`);if(!xe||!xe.hasAttribute("tabindex")||xe.disabled||xe.getAttribute("aria-disabled")==="true")Me+=ee==="next"?1:-1;else return Me}}const pn=(re,ee)=>{if(!N)return;Z===""&&dn(re,"toggleInput");let Me=he;he===-1?Z===""&&ee==="previous"&&(Me=F.length-1):(Me+=ee==="next"?1:-1,Me<0&&(Me=0),Me===F.length&&(Me=-1)),Me=Kn(Me,ee),ke(Me),Pt(Me)},fn=re=>{A.current=!0,ae(""),z&&z(re,"","clear"),Kt(re,N?[]:null,"clear")},Dr=re=>ee=>{if(re.onKeyDown&&re.onKeyDown(ee),!ee.defaultMuiPrevented&&(he!==-1&&["ArrowLeft","ArrowRight"].indexOf(ee.key)===-1&&(ke(-1),Pt(-1)),ee.which!==229))switch(ee.key){case"Home":He&&M&&(ee.preventDefault(),qt({diff:"start",direction:"next",reason:"keyboard",event:ee}));break;case"End":He&&M&&(ee.preventDefault(),qt({diff:"end",direction:"previous",reason:"keyboard",event:ee}));break;case"PageUp":ee.preventDefault(),qt({diff:-$g,direction:"previous",reason:"keyboard",event:ee}),$t(ee);break;case"PageDown":ee.preventDefault(),qt({diff:$g,direction:"next",reason:"keyboard",event:ee}),$t(ee);break;case"ArrowDown":ee.preventDefault(),qt({diff:1,direction:"next",reason:"keyboard",event:ee}),$t(ee);break;case"ArrowUp":ee.preventDefault(),qt({diff:-1,direction:"previous",reason:"keyboard",event:ee}),$t(ee);break;case"ArrowLeft":pn(ee,"previous");break;case"ArrowRight":pn(ee,"next");break;case"Enter":if($.current!==-1&&He){const Me=Pe[$.current],xe=S?S(Me):!1;if(ee.preventDefault(),xe)return;$n(ee,Me,"selectOption"),r&&H.current.setSelectionRange(H.current.value.length,H.current.value.length)}else x&&Z!==""&&Ae===!1&&(N&&ee.preventDefault(),$n(ee,Z,"createOption","freeSolo"));break;case"Escape":He?(ee.preventDefault(),ee.stopPropagation(),dn(ee,"escape")):l&&(Z!==""||N&&F.length>0)&&(ee.preventDefault(),ee.stopPropagation(),fn(ee));break;case"Backspace":if(N&&!G&&Z===""&&F.length>0){const Me=he===-1?F.length-1:he,xe=F.slice();xe.splice(Me,1),Kt(ee,xe,"removeOption",{option:F[Me]})}break;case"Delete":if(N&&!G&&Z===""&&F.length>0&&he!==-1){const Me=he,xe=F.slice();xe.splice(Me,1),Kt(ee,xe,"removeOption",{option:F[Me]})}break}},Yn=re=>{ye(!0),me&&!A.current&&$t(re)},Jn=re=>{if(e(V)){H.current.focus();return}ye(!1),j.current=!0,A.current=!1,i&&$.current!==-1&&He?$n(re,Pe[$.current],"blur"):i&&x&&Z!==""?$n(re,Z,"blur","freeSolo"):a&&be(re,F),dn(re,"blur")},Rt=re=>{const ee=re.target.value;Z!==ee&&(ae(ee),Oe(!1),z&&z(re,ee,"input")),ee===""?!d&&!N&&Kt(re,null,"clear"):$t(re)},bt=re=>{const ee=Number(re.currentTarget.getAttribute("data-option-index"));$.current!==ee&&zt({event:re,index:ee,reason:"mouse"})},Yt=re=>{zt({event:re,index:Number(re.currentTarget.getAttribute("data-option-index")),reason:"touch"}),On.current=!0},Nn=re=>{const ee=Number(re.currentTarget.getAttribute("data-option-index"));$n(re,Pe[ee],"selectOption"),On.current=!1},Zn=re=>ee=>{const Me=F.slice();Me.splice(re,1),Kt(ee,Me,"removeOption",{option:F[re]})},Ir=re=>{ge?dn(re,"toggleInput"):$t(re)},$r=re=>{re.currentTarget.contains(re.target)&&re.target.getAttribute("id")!==Y&&re.preventDefault()},Qt=re=>{re.currentTarget.contains(re.target)&&(H.current.focus(),X&&j.current&&H.current.selectionEnd-H.current.selectionStart===0&&H.current.select(),j.current=!1)},Xn=re=>{!f&&(Z===""||!ge)&&Ir(re)};let _n=x&&Z.length>0;_n=_n||(N?F.length>0:F!==null);let Fn=Pe;return w&&(Fn=Pe.reduce((re,ee,Me)=>{const xe=w(ee);return re.length>0&&re[re.length-1].group===xe?re[re.length-1].options.push(ee):re.push({key:Me,index:Me,group:xe,options:[ee]}),re},[])),f&&ue&&Jn(),{getRootProps:(re={})=>J({"aria-owns":jt?`${Y}-listbox`:null},re,{onKeyDown:Dr(re),onMouseDown:$r,onClick:Qt}),getInputLabelProps:()=>({id:`${Y}-label`,htmlFor:Y}),getInputProps:()=>({id:Y,value:Z,onBlur:Jn,onFocus:Yn,onChange:Rt,onMouseDown:Xn,"aria-activedescendant":He?"":null,"aria-autocomplete":r?"both":"list","aria-controls":jt?`${Y}-listbox`:void 0,"aria-expanded":jt,autoComplete:"off",ref:H,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:f}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:fn}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Ir}),getTagProps:({index:re})=>J({key:re,"data-tag-index":re,tabIndex:-1},!G&&{onDelete:Zn(re)}),getListboxProps:()=>({role:"listbox",id:`${Y}-listbox`,"aria-labelledby":`${Y}-label`,ref:In,onMouseDown:re=>{re.preventDefault()}}),getOptionProps:({index:re,option:ee})=>{var Me;const xe=(N?F:[F]).some(et=>et!=null&&U(ee,et)),ze=S?S(ee):!1;return{key:(Me=E==null?void 0:E(ee))!=null?Me:C(ee),tabIndex:-1,role:"option",id:`${Y}-option-${re}`,onMouseMove:bt,onClick:Nn,onTouchStart:Yt,"data-option-index":re,"aria-disabled":ze,"aria-selected":xe}},id:Y,inputValue:Z,value:F,dirty:_n,expanded:He&&fe,popupOpen:He,focused:ue||he!==-1,anchorEl:fe,setAnchorEl:pe,focusedTag:he,groupedOptions:Fn}}function w2(t){return En("MuiListSubheader",t)}At("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const C2=["className","color","component","disableGutters","disableSticky","inset"],S2=t=>{const{classes:e,color:n,disableGutters:r,inset:o,disableSticky:i}=t,s={root:["root",n!=="default"&&`color${Da(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Tn(s,w2,e)},k2=Ee("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${Da(n.color)}`],!n.disableGutters&&e.gutters,n.inset&&e.inset,!n.disableSticky&&e.sticky]}})(({theme:t,ownerState:e})=>J({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14)},e.color==="primary"&&{color:(t.vars||t).palette.primary.main},e.color==="inherit"&&{color:"inherit"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.inset&&{paddingLeft:72},!e.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper})),Hx=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiListSubheader"}),{className:o,color:i="default",component:s="li",disableGutters:a=!1,disableSticky:l=!1,inset:c=!1}=r,u=tt(r,C2),d=J({},r,{color:i,component:s,disableGutters:a,disableSticky:l,inset:c}),p=S2(d);return v.jsx(k2,J({as:s,className:Hn(p.root,o),ref:n,ownerState:d},u))});Hx.muiSkipListHighlight=!0;const M2=qr(v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function E2(t){return En("MuiAutocomplete",t)}const qe=At("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var Ng,_g;const T2=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],O2=["ref"],L2=["key"],A2=["key"],P2=t=>{const{classes:e,disablePortal:n,expanded:r,focused:o,fullWidth:i,hasClearIcon:s,hasPopupIcon:a,inputFocused:l,popupOpen:c,size:u}=t,d={root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",s&&"hasClearIcon",a&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Da(u)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",c&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Tn(d,E2,e)},R2=Ee("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:s,size:a}=n;return[{[`& .${qe.tag}`]:e.tag},{[`& .${qe.tag}`]:e[`tagSize${Da(a)}`]},{[`& .${qe.inputRoot}`]:e.inputRoot},{[`& .${qe.input}`]:e.input},{[`& .${qe.input}`]:s&&e.inputFocused},e.root,r&&e.fullWidth,i&&e.hasPopupIcon,o&&e.hasClearIcon]}})({[`&.${qe.focused} .${qe.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${qe.clearIndicator}`]:{visibility:"visible"}},[`& .${qe.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${qe.inputRoot}`]:{[`.${qe.hasPopupIcon}&, .${qe.hasClearIcon}&`]:{paddingRight:30},[`.${qe.hasPopupIcon}.${qe.hasClearIcon}&`]:{paddingRight:56},[`& .${qe.input}`]:{width:0,minWidth:30}},[`& .${Ku.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Ku.root}.${Po.sizeSmall}`]:{[`& .${Ku.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Mg.root}`]:{padding:9,[`.${qe.hasPopupIcon}&, .${qe.hasClearIcon}&`]:{paddingRight:39},[`.${qe.hasPopupIcon}.${qe.hasClearIcon}&`]:{paddingRight:65},[`& .${qe.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${qe.endAdornment}`]:{right:9}},[`& .${Mg.root}.${Po.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${qe.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${bi.root}`]:{paddingTop:19,paddingLeft:8,[`.${qe.hasPopupIcon}&, .${qe.hasClearIcon}&`]:{paddingRight:39},[`.${qe.hasPopupIcon}.${qe.hasClearIcon}&`]:{paddingRight:65},[`& .${bi.input}`]:{padding:"7px 4px"},[`& .${qe.endAdornment}`]:{right:9}},[`& .${bi.root}.${Po.sizeSmall}`]:{paddingBottom:1,[`& .${bi.input}`]:{padding:"2.5px 4px"}},[`& .${Po.hiddenLabel}`]:{paddingTop:8},[`& .${bi.root}.${Po.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${qe.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${bi.root}.${Po.hiddenLabel}.${Po.sizeSmall}`]:{[`& .${qe.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${qe.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${qe.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${qe.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${qe.inputRoot}`]:{flexWrap:"wrap"}}}]}),D2=Ee("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(t,e)=>e.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),I2=Ee(Mo,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(t,e)=>e.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),$2=Ee(Mo,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:t},e)=>J({},e.popupIndicator,t.popupOpen&&e.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),N2=Ee(si,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${qe.option}`]:e.option},e.popper,n.disablePortal&&e.popperDisablePortal]}})(({theme:t})=>({zIndex:(t.vars||t).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),_2=Ee(Ia,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({theme:t})=>J({},t.typography.body1,{overflow:"auto"})),F2=Ee("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(t,e)=>e.loading})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),B2=Ee("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(t,e)=>e.noOptions})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),j2=Ee("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(t,e)=>e.listbox})(({theme:t})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${qe.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${qe.focused}`]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${qe.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Yu(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${qe.focused}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Yu(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},[`&.${qe.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Yu(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}})),z2=Ee(Hx,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(t,e)=>e.groupLabel})(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,top:-8})),H2=Ee("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(t,e)=>e.groupUl})({padding:0,[`& .${qe.option}`]:{paddingLeft:24}}),V2=h.forwardRef(function(e,n){var r,o,i,s;const a=ii({props:e,name:"MuiAutocomplete"}),{autoComplete:l=!1,autoHighlight:c=!1,autoSelect:u=!1,blurOnSelect:d=!1,ChipProps:p,className:f,clearIcon:m=Ng||(Ng=v.jsx(M2,{fontSize:"small"})),clearOnBlur:g=!a.freeSolo,clearOnEscape:y=!1,clearText:b="Clear",closeText:x="Close",componentsProps:S={},defaultValue:E=a.multiple?[]:null,disableClearable:k=!1,disableCloseOnSelect:w=!1,disabled:M=!1,disabledItemsFocusable:T=!1,disableListWrap:D=!1,disablePortal:P=!1,filterSelectedOptions:U=!1,forcePopupIcon:N="auto",freeSolo:K=!1,fullWidth:R=!1,getLimitTagsText:B=xe=>`+${xe}`,getOptionLabel:z,groupBy:I,handleHomeEndKeys:oe=!a.freeSolo,includeInputInList:me=!1,limitTags:te=-1,ListboxComponent:G="ul",ListboxProps:X,loading:ie=!1,loadingText:Y="Loading…",multiple:C=!1,noOptionsText:A="No options",openOnFocus:j=!1,openText:H="Open",PaperComponent:V=Ia,PopperComponent:fe=si,popupIcon:pe=_g||(_g=v.jsx(gE,{})),readOnly:he=!1,renderGroup:ke,renderInput:Te,renderOption:$,renderTags:F,selectOnFocus:de=!a.freeSolo,size:Z="medium",slotProps:ae={}}=a,ue=tt(a,T2),{getRootProps:ye,getInputProps:be,getInputLabelProps:ge,getPopupIndicatorProps:ce,getClearProps:je,getTagProps:Oe,getListboxProps:Ae,getOptionProps:He,value:Pe,dirty:it,expanded:jt,id:Pt,popupOpen:Gt,focused:zt,focusedTag:qt,anchorEl:lt,setAnchorEl:xn,inputValue:In,groupedOptions:$t}=x2(J({},a,{componentName:"Autocomplete"})),dn=!k&&!M&&it&&!he,Kt=(!K||N===!0)&&N!==!1,{onMouseDown:On}=be(),{ref:$n}=X??{},Kn=Ae(),{ref:pn}=Kn,fn=tt(Kn,O2),Dr=Wr(pn,$n),Jn=z||(xe=>{var ze;return(ze=xe.label)!=null?ze:xe}),Rt=J({},a,{disablePortal:P,expanded:jt,focused:zt,fullWidth:R,getOptionLabel:Jn,hasClearIcon:dn,hasPopupIcon:Kt,inputFocused:qt===-1,popupOpen:Gt,size:Z}),bt=P2(Rt);let Yt;if(C&&Pe.length>0){const xe=ze=>J({className:bt.tag,disabled:M},Oe(ze));F?Yt=F(Pe,xe,Rt):Yt=Pe.map((ze,et)=>{const L=xe({index:et}),{key:q}=L,le=tt(L,L2);return v.jsx(TE,J({label:Jn(ze),size:Z},le,p),q)})}if(te>-1&&Array.isArray(Yt)){const xe=Yt.length-te;!zt&&xe>0&&(Yt=Yt.splice(0,te),Yt.push(v.jsx("span",{className:bt.tag,children:B(xe)},Yt.length)))}const Zn=ke||(xe=>v.jsxs("li",{children:[v.jsx(z2,{className:bt.groupLabel,ownerState:Rt,component:"div",children:xe.group}),v.jsx(H2,{className:bt.groupUl,ownerState:Rt,children:xe.children})]},xe.key)),$r=$||((xe,ze)=>{const{key:et}=xe,L=tt(xe,A2);return v.jsx("li",J({},L,{children:Jn(ze)}),et)}),Qt=(xe,ze)=>{const et=He({option:xe,index:ze});return $r(J({},et,{className:bt.option}),xe,{selected:et["aria-selected"],index:ze,inputValue:In},Rt)},Xn=(r=ae.clearIndicator)!=null?r:S.clearIndicator,_n=(o=ae.paper)!=null?o:S.paper,Fn=(i=ae.popper)!=null?i:S.popper,re=(s=ae.popupIndicator)!=null?s:S.popupIndicator,ee=xe=>v.jsx(N2,J({as:fe,disablePortal:P,style:{width:lt?lt.clientWidth:null},ownerState:Rt,role:"presentation",anchorEl:lt,open:Gt},Fn,{className:Hn(bt.popper,Fn==null?void 0:Fn.className),children:v.jsx(_2,J({ownerState:Rt,as:V},_n,{className:Hn(bt.paper,_n==null?void 0:_n.className),children:xe}))}));let Me=null;return $t.length>0?Me=ee(v.jsx(j2,J({as:G,className:bt.listbox,ownerState:Rt},fn,X,{ref:Dr,children:$t.map((xe,ze)=>I?Zn({key:xe.key,group:xe.group,children:xe.options.map((et,L)=>Qt(et,xe.index+L))}):Qt(xe,ze))}))):ie&&$t.length===0?Me=ee(v.jsx(F2,{className:bt.loading,ownerState:Rt,children:Y})):$t.length===0&&!K&&!ie&&(Me=ee(v.jsx(B2,{className:bt.noOptions,ownerState:Rt,role:"presentation",onMouseDown:xe=>{xe.preventDefault()},children:A}))),v.jsxs(h.Fragment,{children:[v.jsx(R2,J({ref:n,className:Hn(bt.root,f),ownerState:Rt},ye(ue),{children:Te({id:Pt,disabled:M,fullWidth:!0,size:Z==="small"?"small":void 0,InputLabelProps:ge(),InputProps:J({ref:xn,className:bt.inputRoot,startAdornment:Yt,onClick:xe=>{xe.target===xe.currentTarget&&On(xe)}},(dn||Kt)&&{endAdornment:v.jsxs(D2,{className:bt.endAdornment,ownerState:Rt,children:[dn?v.jsx(I2,J({},je(),{"aria-label":b,title:b,ownerState:Rt},Xn,{className:Hn(bt.clearIndicator,Xn==null?void 0:Xn.className),children:m})):null,Kt?v.jsx($2,J({},ce(),{disabled:M,"aria-label":Gt?x:H,title:Gt?x:H,ownerState:Rt},re,{className:Hn(bt.popupIndicator,re==null?void 0:re.className),children:pe})):null]})}),inputProps:J({className:bt.input,disabled:M,readOnly:he},be())})})),lt?Me:null]})}),W2=Q(V2)` +`;function h2(){return v.jsxs(f2,{children:[v.jsx(Xe,{variant:"rounded",width:85,height:32}),v.jsx(Xe,{variant:"rounded",width:78,height:32}),v.jsx(Xe,{variant:"rounded",width:186,height:32})]})}const m2=t=>{var x,S;const{fieldDef:e,error:n,onChange:r,onBlur:o,value:i,disabled:s,skeleton:a}=t,{required:l}=e||null,[c,u]=h.useState([]),[d,p]=h.useState(!1),[f,m]=h.useState(void 0);h.useEffect(()=>{(async()=>{var k,w;if((k=e==null?void 0:e.inputSettings)!=null&&k.options)u(e.inputSettings.options),m(!0);else if((w=e==null?void 0:e.inputSettings)!=null&&w.getOptions){const M=await e.inputSettings.getOptions();u(M),m(!1)}p(!1)})()},[(x=e==null?void 0:e.inputSettings)==null?void 0:x.options,(S=e==null?void 0:e.inputSettings)==null?void 0:S.getOptions]),h.useEffect(()=>{i&&!d&&(f===!0&&g(i),f===!1&&(c.find(E=>E.value===i.value)?g(i):u([...c,{...i,selected:!0}])),p(!0))},[i,d,c,f]);const g=E=>{let k=[...c];k=k.map(M=>(M==null?void 0:M.value)===(E==null?void 0:E.value)?{...M,selected:l&&M.selected?M.selected:!M.selected}:{...M,selected:!1});const w=k.find(M=>M.selected===!0);return u(k),w},y=E=>{const k=g(E);p(!0),r(k?{label:k.label,value:k.value}:void 0)},b=typeof n=="string"?(n==null?void 0:n.trim().length)>0:!1;return a?v.jsx(h2,{}):v.jsx(p2,{$error:b,onBlur:o,role:"listbox",children:c.map(E=>v.jsx(hp,{label:E.label,disabled:s,selected:E.selected,onClick:()=>y(E),role:"option"},E.value))})},g2=h.memo(m2);function Ig(t){return typeof t.normalize<"u"?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t}function v2(t={}){const{ignoreAccents:e=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:s=!1}=t;return(a,{inputValue:l,getOptionLabel:c})=>{let u=s?l.trim():l;n&&(u=u.toLowerCase()),e&&(u=Ig(u));const d=u?a.filter(p=>{let f=(i||c)(p);return n&&(f=f.toLowerCase()),e&&(f=Ig(f)),o==="start"?f.indexOf(u)===0:f.indexOf(u)>-1}):a;return typeof r=="number"?d.slice(0,r):d}}function ll(t,e){for(let n=0;n{var e;return t.current!==null&&((e=t.current.parentElement)==null?void 0:e.contains(document.activeElement))};function x2(t){const{unstable_isActiveElementInListbox:e=b2,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:s=!1,clearOnBlur:a=!t.freeSolo,clearOnEscape:l=!1,componentName:c="useAutocomplete",defaultValue:u=t.multiple?[]:null,disableClearable:d=!1,disableCloseOnSelect:p=!1,disabled:f,disabledItemsFocusable:m=!1,disableListWrap:g=!1,filterOptions:y=y2,filterSelectedOptions:b=!1,freeSolo:x=!1,getOptionDisabled:S,getOptionKey:E,getOptionLabel:k=re=>{var ee;return(ee=re.label)!=null?ee:re},groupBy:w,handleHomeEndKeys:M=!t.freeSolo,id:T,includeInputInList:D=!1,inputValue:P,isOptionEqualToValue:U=(re,ee)=>re===ee,multiple:N=!1,onChange:K,onClose:R,onHighlightChange:B,onInputChange:z,onOpen:I,open:oe,openOnFocus:me=!1,options:te,readOnly:G=!1,selectOnFocus:X=!t.freeSolo,value:ie}=t,Y=$f(T);let C=k;C=re=>{const ee=k(re);return typeof ee!="string"?String(ee):ee};const A=h.useRef(!1),j=h.useRef(!0),H=h.useRef(null),V=h.useRef(null),[fe,pe]=h.useState(null),[he,ke]=h.useState(-1),Te=o?0:-1,$=h.useRef(Te),[F,de]=es({controlled:ie,default:u,name:c}),[Z,ae]=es({controlled:P,default:"",name:c,state:"inputValue"}),[ue,be]=h.useState(!1),ye=h.useCallback((re,ee)=>{if(!(N?F.length!(b&&(N?F:[F]).some(ee=>ee!==null&&U(re,ee)))),{inputValue:Ae&&je?"":Z,getOptionLabel:C}):[],it=_T({filteredOptions:Pe,value:F,inputValue:Z});h.useEffect(()=>{const re=F!==it.value;ue&&!re||x&&!re||ye(null,F)},[F,ye,ue,it.value,x]);const jt=ge&&Pe.length>0&&!G,Pt=$s(re=>{re===-1?H.current.focus():fe.querySelector(`[data-tag-index="${re}"]`).focus()});h.useEffect(()=>{N&&he>F.length-1&&(ke(-1),Pt(-1))},[F,N,he,Pt]);function Gt(re,ee){if(!V.current||re<0||re>=Pe.length)return-1;let Me=re;for(;;){const xe=V.current.querySelector(`[data-option-index="${Me}"]`),ze=m?!1:!xe||xe.disabled||xe.getAttribute("aria-disabled")==="true";if(xe&&xe.hasAttribute("tabindex")&&!ze)return Me;if(ee==="next"?Me=(Me+1)%Pe.length:Me=(Me-1+Pe.length)%Pe.length,Me===re)return-1}}const zt=$s(({event:re,index:ee,reason:Me="auto"})=>{if($.current=ee,ee===-1?H.current.removeAttribute("aria-activedescendant"):H.current.setAttribute("aria-activedescendant",`${Y}-option-${ee}`),B&&B(re,ee===-1?null:Pe[ee],Me),!V.current)return;const xe=V.current.querySelector(`[role="option"].${n}-focused`);xe&&(xe.classList.remove(`${n}-focused`),xe.classList.remove(`${n}-focusVisible`));let ze=V.current;if(V.current.getAttribute("role")!=="listbox"&&(ze=V.current.parentElement.querySelector('[role="listbox"]')),!ze)return;if(ee===-1){ze.scrollTop=0;return}const et=V.current.querySelector(`[data-option-index="${ee}"]`);if(et&&(et.classList.add(`${n}-focused`),Me==="keyboard"&&et.classList.add(`${n}-focusVisible`),ze.scrollHeight>ze.clientHeight&&Me!=="mouse"&&Me!=="touch")){const L=et,q=ze.clientHeight+ze.scrollTop,le=L.offsetTop+L.offsetHeight;le>q?ze.scrollTop=le-ze.clientHeight:L.offsetTop-L.offsetHeight*(w?1.3:0){if(!He)return;const et=Gt((()=>{const L=Pe.length-1;if(ee==="reset")return Te;if(ee==="start")return 0;if(ee==="end")return L;const q=$.current+ee;return q<0?q===-1&&D?-1:g&&$.current!==-1||Math.abs(ee)>1?0:L:q>L?q===L+1&&D?-1:g||Math.abs(ee)>1?L:0:q})(),Me);if(zt({index:et,reason:xe,event:re}),r&&ee!=="reset")if(et===-1)H.current.value=Z;else{const L=C(Pe[et]);H.current.value=L,L.toLowerCase().indexOf(Z.toLowerCase())===0&&Z.length>0&&H.current.setSelectionRange(Z.length,L.length)}}),lt=()=>{const re=(ee,Me)=>{const xe=ee?C(ee):"",ze=Me?C(Me):"";return xe===ze};if($.current!==-1&&it.filteredOptions&&it.filteredOptions.length!==Pe.length&&it.inputValue===Z&&(N?F.length===it.value.length&&it.value.every((ee,Me)=>C(F[Me])===C(ee)):re(it.value,F))){const ee=it.filteredOptions[$.current];if(ee)return ll(Pe,Me=>C(Me)===C(ee))}return-1},xn=h.useCallback(()=>{if(!He)return;const re=lt();if(re!==-1){$.current=re;return}const ee=N?F[0]:F;if(Pe.length===0||ee==null){qt({diff:"reset"});return}if(V.current){if(ee!=null){const Me=Pe[$.current];if(N&&Me&&ll(F,ze=>U(Me,ze))!==-1)return;const xe=ll(Pe,ze=>U(ze,ee));xe===-1?qt({diff:"reset"}):zt({index:xe});return}if($.current>=Pe.length-1){zt({index:Pe.length-1});return}zt({index:$.current})}},[Pe.length,N?!1:F,b,qt,zt,He,Z,N]),In=$s(re=>{FE(V,re),re&&xn()});h.useEffect(()=>{xn()},[xn]);const $t=re=>{ge||(ce(!0),Oe(!0),I&&I(re))},dn=(re,ee)=>{ge&&(ce(!1),R&&R(re,ee))},Kt=(re,ee,Me,xe)=>{if(N){if(F.length===ee.length&&F.every((ze,et)=>ze===ee[et]))return}else if(F===ee)return;K&&K(re,ee,Me,xe),de(ee)},On=h.useRef(!1),$n=(re,ee,Me="selectOption",xe="options")=>{let ze=Me,et=ee;if(N){et=Array.isArray(F)?F.slice():[];const L=ll(et,q=>U(ee,q));L===-1?et.push(ee):xe!=="freeSolo"&&(et.splice(L,1),ze="removeOption")}ye(re,et),Kt(re,et,ze,{option:ee}),!p&&(!re||!re.ctrlKey&&!re.metaKey)&&dn(re,ze),(s===!0||s==="touch"&&On.current||s==="mouse"&&!On.current)&&H.current.blur()};function Kn(re,ee){if(re===-1)return-1;let Me=re;for(;;){if(ee==="next"&&Me===F.length||ee==="previous"&&Me===-1)return-1;const xe=fe.querySelector(`[data-tag-index="${Me}"]`);if(!xe||!xe.hasAttribute("tabindex")||xe.disabled||xe.getAttribute("aria-disabled")==="true")Me+=ee==="next"?1:-1;else return Me}}const pn=(re,ee)=>{if(!N)return;Z===""&&dn(re,"toggleInput");let Me=he;he===-1?Z===""&&ee==="previous"&&(Me=F.length-1):(Me+=ee==="next"?1:-1,Me<0&&(Me=0),Me===F.length&&(Me=-1)),Me=Kn(Me,ee),ke(Me),Pt(Me)},fn=re=>{A.current=!0,ae(""),z&&z(re,"","clear"),Kt(re,N?[]:null,"clear")},Dr=re=>ee=>{if(re.onKeyDown&&re.onKeyDown(ee),!ee.defaultMuiPrevented&&(he!==-1&&["ArrowLeft","ArrowRight"].indexOf(ee.key)===-1&&(ke(-1),Pt(-1)),ee.which!==229))switch(ee.key){case"Home":He&&M&&(ee.preventDefault(),qt({diff:"start",direction:"next",reason:"keyboard",event:ee}));break;case"End":He&&M&&(ee.preventDefault(),qt({diff:"end",direction:"previous",reason:"keyboard",event:ee}));break;case"PageUp":ee.preventDefault(),qt({diff:-$g,direction:"previous",reason:"keyboard",event:ee}),$t(ee);break;case"PageDown":ee.preventDefault(),qt({diff:$g,direction:"next",reason:"keyboard",event:ee}),$t(ee);break;case"ArrowDown":ee.preventDefault(),qt({diff:1,direction:"next",reason:"keyboard",event:ee}),$t(ee);break;case"ArrowUp":ee.preventDefault(),qt({diff:-1,direction:"previous",reason:"keyboard",event:ee}),$t(ee);break;case"ArrowLeft":pn(ee,"previous");break;case"ArrowRight":pn(ee,"next");break;case"Enter":if($.current!==-1&&He){const Me=Pe[$.current],xe=S?S(Me):!1;if(ee.preventDefault(),xe)return;$n(ee,Me,"selectOption"),r&&H.current.setSelectionRange(H.current.value.length,H.current.value.length)}else x&&Z!==""&&Ae===!1&&(N&&ee.preventDefault(),$n(ee,Z,"createOption","freeSolo"));break;case"Escape":He?(ee.preventDefault(),ee.stopPropagation(),dn(ee,"escape")):l&&(Z!==""||N&&F.length>0)&&(ee.preventDefault(),ee.stopPropagation(),fn(ee));break;case"Backspace":if(N&&!G&&Z===""&&F.length>0){const Me=he===-1?F.length-1:he,xe=F.slice();xe.splice(Me,1),Kt(ee,xe,"removeOption",{option:F[Me]})}break;case"Delete":if(N&&!G&&Z===""&&F.length>0&&he!==-1){const Me=he,xe=F.slice();xe.splice(Me,1),Kt(ee,xe,"removeOption",{option:F[Me]})}break}},Yn=re=>{be(!0),me&&!A.current&&$t(re)},Jn=re=>{if(e(V)){H.current.focus();return}be(!1),j.current=!0,A.current=!1,i&&$.current!==-1&&He?$n(re,Pe[$.current],"blur"):i&&x&&Z!==""?$n(re,Z,"blur","freeSolo"):a&&ye(re,F),dn(re,"blur")},Rt=re=>{const ee=re.target.value;Z!==ee&&(ae(ee),Oe(!1),z&&z(re,ee,"input")),ee===""?!d&&!N&&Kt(re,null,"clear"):$t(re)},bt=re=>{const ee=Number(re.currentTarget.getAttribute("data-option-index"));$.current!==ee&&zt({event:re,index:ee,reason:"mouse"})},Yt=re=>{zt({event:re,index:Number(re.currentTarget.getAttribute("data-option-index")),reason:"touch"}),On.current=!0},Nn=re=>{const ee=Number(re.currentTarget.getAttribute("data-option-index"));$n(re,Pe[ee],"selectOption"),On.current=!1},Zn=re=>ee=>{const Me=F.slice();Me.splice(re,1),Kt(ee,Me,"removeOption",{option:F[re]})},Ir=re=>{ge?dn(re,"toggleInput"):$t(re)},$r=re=>{re.currentTarget.contains(re.target)&&re.target.getAttribute("id")!==Y&&re.preventDefault()},Qt=re=>{re.currentTarget.contains(re.target)&&(H.current.focus(),X&&j.current&&H.current.selectionEnd-H.current.selectionStart===0&&H.current.select(),j.current=!1)},Xn=re=>{!f&&(Z===""||!ge)&&Ir(re)};let _n=x&&Z.length>0;_n=_n||(N?F.length>0:F!==null);let Fn=Pe;return w&&(Fn=Pe.reduce((re,ee,Me)=>{const xe=w(ee);return re.length>0&&re[re.length-1].group===xe?re[re.length-1].options.push(ee):re.push({key:Me,index:Me,group:xe,options:[ee]}),re},[])),f&&ue&&Jn(),{getRootProps:(re={})=>J({"aria-owns":jt?`${Y}-listbox`:null},re,{onKeyDown:Dr(re),onMouseDown:$r,onClick:Qt}),getInputLabelProps:()=>({id:`${Y}-label`,htmlFor:Y}),getInputProps:()=>({id:Y,value:Z,onBlur:Jn,onFocus:Yn,onChange:Rt,onMouseDown:Xn,"aria-activedescendant":He?"":null,"aria-autocomplete":r?"both":"list","aria-controls":jt?`${Y}-listbox`:void 0,"aria-expanded":jt,autoComplete:"off",ref:H,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:f}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:fn}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Ir}),getTagProps:({index:re})=>J({key:re,"data-tag-index":re,tabIndex:-1},!G&&{onDelete:Zn(re)}),getListboxProps:()=>({role:"listbox",id:`${Y}-listbox`,"aria-labelledby":`${Y}-label`,ref:In,onMouseDown:re=>{re.preventDefault()}}),getOptionProps:({index:re,option:ee})=>{var Me;const xe=(N?F:[F]).some(et=>et!=null&&U(ee,et)),ze=S?S(ee):!1;return{key:(Me=E==null?void 0:E(ee))!=null?Me:C(ee),tabIndex:-1,role:"option",id:`${Y}-option-${re}`,onMouseMove:bt,onClick:Nn,onTouchStart:Yt,"data-option-index":re,"aria-disabled":ze,"aria-selected":xe}},id:Y,inputValue:Z,value:F,dirty:_n,expanded:He&&fe,popupOpen:He,focused:ue||he!==-1,anchorEl:fe,setAnchorEl:pe,focusedTag:he,groupedOptions:Fn}}function w2(t){return En("MuiListSubheader",t)}At("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const C2=["className","color","component","disableGutters","disableSticky","inset"],S2=t=>{const{classes:e,color:n,disableGutters:r,inset:o,disableSticky:i}=t,s={root:["root",n!=="default"&&`color${Da(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Tn(s,w2,e)},k2=Ee("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.color!=="default"&&e[`color${Da(n.color)}`],!n.disableGutters&&e.gutters,n.inset&&e.inset,!n.disableSticky&&e.sticky]}})(({theme:t,ownerState:e})=>J({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14)},e.color==="primary"&&{color:(t.vars||t).palette.primary.main},e.color==="inherit"&&{color:"inherit"},!e.disableGutters&&{paddingLeft:16,paddingRight:16},e.inset&&{paddingLeft:72},!e.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper})),Hx=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiListSubheader"}),{className:o,color:i="default",component:s="li",disableGutters:a=!1,disableSticky:l=!1,inset:c=!1}=r,u=tt(r,C2),d=J({},r,{color:i,component:s,disableGutters:a,disableSticky:l,inset:c}),p=S2(d);return v.jsx(k2,J({as:s,className:Hn(p.root,o),ref:n,ownerState:d},u))});Hx.muiSkipListHighlight=!0;const M2=qr(v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function E2(t){return En("MuiAutocomplete",t)}const qe=At("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var Ng,_g;const T2=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],O2=["ref"],L2=["key"],A2=["key"],P2=t=>{const{classes:e,disablePortal:n,expanded:r,focused:o,fullWidth:i,hasClearIcon:s,hasPopupIcon:a,inputFocused:l,popupOpen:c,size:u}=t,d={root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",s&&"hasClearIcon",a&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${Da(u)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",c&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Tn(d,E2,e)},R2=Ee("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:s,size:a}=n;return[{[`& .${qe.tag}`]:e.tag},{[`& .${qe.tag}`]:e[`tagSize${Da(a)}`]},{[`& .${qe.inputRoot}`]:e.inputRoot},{[`& .${qe.input}`]:e.input},{[`& .${qe.input}`]:s&&e.inputFocused},e.root,r&&e.fullWidth,i&&e.hasPopupIcon,o&&e.hasClearIcon]}})({[`&.${qe.focused} .${qe.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${qe.clearIndicator}`]:{visibility:"visible"}},[`& .${qe.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${qe.inputRoot}`]:{[`.${qe.hasPopupIcon}&, .${qe.hasClearIcon}&`]:{paddingRight:30},[`.${qe.hasPopupIcon}.${qe.hasClearIcon}&`]:{paddingRight:56},[`& .${qe.input}`]:{width:0,minWidth:30}},[`& .${Yu.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Yu.root}.${Po.sizeSmall}`]:{[`& .${Yu.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Mg.root}`]:{padding:9,[`.${qe.hasPopupIcon}&, .${qe.hasClearIcon}&`]:{paddingRight:39},[`.${qe.hasPopupIcon}.${qe.hasClearIcon}&`]:{paddingRight:65},[`& .${qe.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${qe.endAdornment}`]:{right:9}},[`& .${Mg.root}.${Po.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${qe.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${bi.root}`]:{paddingTop:19,paddingLeft:8,[`.${qe.hasPopupIcon}&, .${qe.hasClearIcon}&`]:{paddingRight:39},[`.${qe.hasPopupIcon}.${qe.hasClearIcon}&`]:{paddingRight:65},[`& .${bi.input}`]:{padding:"7px 4px"},[`& .${qe.endAdornment}`]:{right:9}},[`& .${bi.root}.${Po.sizeSmall}`]:{paddingBottom:1,[`& .${bi.input}`]:{padding:"2.5px 4px"}},[`& .${Po.hiddenLabel}`]:{paddingTop:8},[`& .${bi.root}.${Po.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${qe.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${bi.root}.${Po.hiddenLabel}.${Po.sizeSmall}`]:{[`& .${qe.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${qe.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${qe.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${qe.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${qe.inputRoot}`]:{flexWrap:"wrap"}}}]}),D2=Ee("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(t,e)=>e.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),I2=Ee(Mo,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(t,e)=>e.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),$2=Ee(Mo,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:t},e)=>J({},e.popupIndicator,t.popupOpen&&e.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),N2=Ee(si,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${qe.option}`]:e.option},e.popper,n.disablePortal&&e.popperDisablePortal]}})(({theme:t})=>({zIndex:(t.vars||t).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),_2=Ee(Ia,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(t,e)=>e.paper})(({theme:t})=>J({},t.typography.body1,{overflow:"auto"})),F2=Ee("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(t,e)=>e.loading})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),B2=Ee("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(t,e)=>e.noOptions})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),j2=Ee("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(t,e)=>e.listbox})(({theme:t})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${qe.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${qe.focused}`]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${qe.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Ju(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${qe.focused}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Ju(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},[`&.${qe.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Ju(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}})),z2=Ee(Hx,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(t,e)=>e.groupLabel})(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,top:-8})),H2=Ee("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(t,e)=>e.groupUl})({padding:0,[`& .${qe.option}`]:{paddingLeft:24}}),V2=h.forwardRef(function(e,n){var r,o,i,s;const a=ii({props:e,name:"MuiAutocomplete"}),{autoComplete:l=!1,autoHighlight:c=!1,autoSelect:u=!1,blurOnSelect:d=!1,ChipProps:p,className:f,clearIcon:m=Ng||(Ng=v.jsx(M2,{fontSize:"small"})),clearOnBlur:g=!a.freeSolo,clearOnEscape:y=!1,clearText:b="Clear",closeText:x="Close",componentsProps:S={},defaultValue:E=a.multiple?[]:null,disableClearable:k=!1,disableCloseOnSelect:w=!1,disabled:M=!1,disabledItemsFocusable:T=!1,disableListWrap:D=!1,disablePortal:P=!1,filterSelectedOptions:U=!1,forcePopupIcon:N="auto",freeSolo:K=!1,fullWidth:R=!1,getLimitTagsText:B=xe=>`+${xe}`,getOptionLabel:z,groupBy:I,handleHomeEndKeys:oe=!a.freeSolo,includeInputInList:me=!1,limitTags:te=-1,ListboxComponent:G="ul",ListboxProps:X,loading:ie=!1,loadingText:Y="Loading…",multiple:C=!1,noOptionsText:A="No options",openOnFocus:j=!1,openText:H="Open",PaperComponent:V=Ia,PopperComponent:fe=si,popupIcon:pe=_g||(_g=v.jsx(gE,{})),readOnly:he=!1,renderGroup:ke,renderInput:Te,renderOption:$,renderTags:F,selectOnFocus:de=!a.freeSolo,size:Z="medium",slotProps:ae={}}=a,ue=tt(a,T2),{getRootProps:be,getInputProps:ye,getInputLabelProps:ge,getPopupIndicatorProps:ce,getClearProps:je,getTagProps:Oe,getListboxProps:Ae,getOptionProps:He,value:Pe,dirty:it,expanded:jt,id:Pt,popupOpen:Gt,focused:zt,focusedTag:qt,anchorEl:lt,setAnchorEl:xn,inputValue:In,groupedOptions:$t}=x2(J({},a,{componentName:"Autocomplete"})),dn=!k&&!M&&it&&!he,Kt=(!K||N===!0)&&N!==!1,{onMouseDown:On}=ye(),{ref:$n}=X??{},Kn=Ae(),{ref:pn}=Kn,fn=tt(Kn,O2),Dr=Wr(pn,$n),Jn=z||(xe=>{var ze;return(ze=xe.label)!=null?ze:xe}),Rt=J({},a,{disablePortal:P,expanded:jt,focused:zt,fullWidth:R,getOptionLabel:Jn,hasClearIcon:dn,hasPopupIcon:Kt,inputFocused:qt===-1,popupOpen:Gt,size:Z}),bt=P2(Rt);let Yt;if(C&&Pe.length>0){const xe=ze=>J({className:bt.tag,disabled:M},Oe(ze));F?Yt=F(Pe,xe,Rt):Yt=Pe.map((ze,et)=>{const L=xe({index:et}),{key:q}=L,le=tt(L,L2);return v.jsx(TE,J({label:Jn(ze),size:Z},le,p),q)})}if(te>-1&&Array.isArray(Yt)){const xe=Yt.length-te;!zt&&xe>0&&(Yt=Yt.splice(0,te),Yt.push(v.jsx("span",{className:bt.tag,children:B(xe)},Yt.length)))}const Zn=ke||(xe=>v.jsxs("li",{children:[v.jsx(z2,{className:bt.groupLabel,ownerState:Rt,component:"div",children:xe.group}),v.jsx(H2,{className:bt.groupUl,ownerState:Rt,children:xe.children})]},xe.key)),$r=$||((xe,ze)=>{const{key:et}=xe,L=tt(xe,A2);return v.jsx("li",J({},L,{children:Jn(ze)}),et)}),Qt=(xe,ze)=>{const et=He({option:xe,index:ze});return $r(J({},et,{className:bt.option}),xe,{selected:et["aria-selected"],index:ze,inputValue:In},Rt)},Xn=(r=ae.clearIndicator)!=null?r:S.clearIndicator,_n=(o=ae.paper)!=null?o:S.paper,Fn=(i=ae.popper)!=null?i:S.popper,re=(s=ae.popupIndicator)!=null?s:S.popupIndicator,ee=xe=>v.jsx(N2,J({as:fe,disablePortal:P,style:{width:lt?lt.clientWidth:null},ownerState:Rt,role:"presentation",anchorEl:lt,open:Gt},Fn,{className:Hn(bt.popper,Fn==null?void 0:Fn.className),children:v.jsx(_2,J({ownerState:Rt,as:V},_n,{className:Hn(bt.paper,_n==null?void 0:_n.className),children:xe}))}));let Me=null;return $t.length>0?Me=ee(v.jsx(j2,J({as:G,className:bt.listbox,ownerState:Rt},fn,X,{ref:Dr,children:$t.map((xe,ze)=>I?Zn({key:xe.key,group:xe.group,children:xe.options.map((et,L)=>Qt(et,xe.index+L))}):Qt(xe,ze))}))):ie&&$t.length===0?Me=ee(v.jsx(F2,{className:bt.loading,ownerState:Rt,children:Y})):$t.length===0&&!K&&!ie&&(Me=ee(v.jsx(B2,{className:bt.noOptions,ownerState:Rt,role:"presentation",onMouseDown:xe=>{xe.preventDefault()},children:A}))),v.jsxs(h.Fragment,{children:[v.jsx(R2,J({ref:n,className:Hn(bt.root,f),ownerState:Rt},be(ue),{children:Te({id:Pt,disabled:M,fullWidth:!0,size:Z==="small"?"small":void 0,InputLabelProps:ge(),InputProps:J({ref:xn,className:bt.inputRoot,startAdornment:Yt,onClick:xe=>{xe.target===xe.currentTarget&&On(xe)}},(dn||Kt)&&{endAdornment:v.jsxs(D2,{className:bt.endAdornment,ownerState:Rt,children:[dn?v.jsx(I2,J({},je(),{"aria-label":b,title:b,ownerState:Rt},Xn,{className:Hn(bt.clearIndicator,Xn==null?void 0:Xn.className),children:m})):null,Kt?v.jsx($2,J({},ce(),{disabled:M,"aria-label":Gt?x:H,title:Gt?x:H,ownerState:Rt},re,{className:Hn(bt.popupIndicator,re==null?void 0:re.className),children:pe})):null]})}),inputProps:J({className:bt.input,disabled:M,readOnly:he},ye())})})),lt?Me:null]})}),W2=Q(V2)` & .MuiFormControl-root .MuiInputBase-root { font-family: ${_.fontFamily}; color: ${_.newColors.almostBlack[100]}; @@ -256,11 +256,11 @@ var BM=Object.defineProperty;var jM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,config & .MuiOutlinedInput-input { height: ${_.fieldSpecs.inputText.height}; } -`,K2=({children:t})=>v.jsx(q2,{children:t}),Y2=t=>{var k,w;const{fieldDef:e,error:n,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=t,[u,d]=h.useState(!1),[p,f]=h.useState([]),[m,g]=h.useState(void 0);h.useEffect(()=>{(async()=>{var T,D;if((T=e==null?void 0:e.inputSettings)!=null&&T.options)f(e.inputSettings.options),g(!0);else if((D=e==null?void 0:e.inputSettings)!=null&&D.getOptions){const P=await e.inputSettings.getOptions();f(P),g(!1)}})()},[(k=e==null?void 0:e.inputSettings)==null?void 0:k.options,(w=e==null?void 0:e.inputSettings)==null?void 0:w.getOptions]),h.useEffect(()=>{i&&m===!1&&(p.find(M=>(M==null?void 0:M.value)===(i==null?void 0:i.value))||f([...p,i]))},[p,i,m]);const y=M=>{var T;return v.jsx(K2,{children:v.jsx(Af,{...M,"data-testid":"textfield-test-id",variant:"outlined",placeholder:(T=e==null?void 0:e.inputSettings)==null?void 0:T.placeholder,required:e==null?void 0:e.required,inputProps:{...M.inputProps,ref:D=>{a&&(a.current=D),M.inputProps.ref.current=D},id:l}})})},b=()=>{d(!u)},x=async M=>{r&&await r(M||void 0)},S=(M,T)=>(T==null?void 0:T.value)===""?!0:M.value===(T==null?void 0:T.value),E=M=>v.jsx(G2,{$value:(i==null?void 0:i.value)==="",...M});return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(U2,{"data-testid":"dropdown-single-selection-test-id",$innerWidth:e==null?void 0:e.size,children:v.jsx(W2,{value:i||null,onOpen:b,onClose:b,"data-testid":"autocomplete-test-id",options:p,getOptionLabel:M=>M.label,getOptionKey:M=>M.value,isOptionEqualToValue:S,onChange:(M,T)=>x(T),$error:e!=null&&e.required&&n?!!n:void 0,renderInput:y,PopperComponent:E,popupIcon:v.jsx(Nf,{}),onBlur:M=>o&&o(M.target.value),open:u,disabled:s})})},Vx=h.memo(Y2);var J2=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(r,o,i){n.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:i})},n.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,o){if(1&o&&(r=n(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var s in r)n.d(i,s,(function(a){return r[a]}).bind(null,s));return i},n.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(o,"a",o),o},n.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},n.p="",n(n.s=9)}([function(t,e){t.exports=h},function(t,e,n){var r;/*! +`,K2=({children:t})=>v.jsx(q2,{children:t}),Y2=t=>{var k,w;const{fieldDef:e,error:n,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=t,[u,d]=h.useState(!1),[p,f]=h.useState([]),[m,g]=h.useState(void 0);h.useEffect(()=>{(async()=>{var T,D;if((T=e==null?void 0:e.inputSettings)!=null&&T.options)f(e.inputSettings.options),g(!0);else if((D=e==null?void 0:e.inputSettings)!=null&&D.getOptions){const P=await e.inputSettings.getOptions();f(P),g(!1)}})()},[(k=e==null?void 0:e.inputSettings)==null?void 0:k.options,(w=e==null?void 0:e.inputSettings)==null?void 0:w.getOptions]),h.useEffect(()=>{i&&m===!1&&(p.find(M=>(M==null?void 0:M.value)===(i==null?void 0:i.value))||f([...p,i]))},[p,i,m]);const y=M=>{var T;return v.jsx(K2,{children:v.jsx(Pf,{...M,"data-testid":"textfield-test-id",variant:"outlined",placeholder:(T=e==null?void 0:e.inputSettings)==null?void 0:T.placeholder,required:e==null?void 0:e.required,inputProps:{...M.inputProps,ref:D=>{a&&(a.current=D),M.inputProps.ref.current=D},id:l}})})},b=()=>{d(!u)},x=async M=>{r&&await r(M||void 0)},S=(M,T)=>(T==null?void 0:T.value)===""?!0:M.value===(T==null?void 0:T.value),E=M=>v.jsx(G2,{$value:(i==null?void 0:i.value)==="",...M});return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(U2,{"data-testid":"dropdown-single-selection-test-id",$innerWidth:e==null?void 0:e.size,children:v.jsx(W2,{value:i||null,onOpen:b,onClose:b,"data-testid":"autocomplete-test-id",options:p,getOptionLabel:M=>M.label,getOptionKey:M=>M.value,isOptionEqualToValue:S,onChange:(M,T)=>x(T),$error:e!=null&&e.required&&n?!!n:void 0,renderInput:y,PopperComponent:E,popupIcon:v.jsx(_f,{}),onBlur:M=>o&&o(M.target.value),open:u,disabled:s})})},Vx=h.memo(Y2);var J2=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(r,o,i){n.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:i})},n.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,o){if(1&o&&(r=n(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var s in r)n.d(i,s,(function(a){return r[a]}).bind(null,s));return i},n.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(o,"a",o),o},n.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},n.p="",n(n.s=9)}([function(t,e){t.exports=h},function(t,e,n){var r;/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(){var o={}.hasOwnProperty;function i(){for(var s=[],a=0;a=D?T:D)),w=T,k=y(k),E.slice(w,w+k.length)==k}}).call(this,n(3))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch{typeof window=="object"&&(n=window)}t.exports=n},function(t,e,n){(function(r){var o=/^\[object .+?Constructor\]$/,i=typeof r=="object"&&r&&r.Object===Object&&r,s=typeof self=="object"&&self&&self.Object===Object&&self,a=i||s||Function("return this")(),l,c=Array.prototype,u=Function.prototype,d=Object.prototype,p=a["__core-js_shared__"],f=(l=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||""))?"Symbol(src)_1."+l:"",m=u.toString,g=d.hasOwnProperty,y=d.toString,b=RegExp("^"+m.call(g).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x=c.splice,S=U(a,"Map"),E=U(Object,"create");function k(R){var B=-1,z=R?R.length:0;for(this.clear();++B-1},w.prototype.set=function(R,B){var z=this.__data__,I=T(z,R);return I<0?z.push([R,B]):z[I][1]=B,this},M.prototype.clear=function(){this.__data__={hash:new k,map:new(S||w),string:new k}},M.prototype.delete=function(R){return P(this,R).delete(R)},M.prototype.get=function(R){return P(this,R).get(R)},M.prototype.has=function(R){return P(this,R).has(R)},M.prototype.set=function(R,B){return P(this,R).set(R,B),this},N.Cache=M,t.exports=N}).call(this,n(3))},function(t,e,n){(function(r){var o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt,c=typeof r=="object"&&r&&r.Object===Object&&r,u=typeof self=="object"&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,f=Math.max,m=Math.min,g=function(){return d.Date.now()};function y(x){var S=typeof x;return!!x&&(S=="object"||S=="function")}function b(x){if(typeof x=="number")return x;if(function(k){return typeof k=="symbol"||function(w){return!!w&&typeof w=="object"}(k)&&p.call(k)=="[object Symbol]"}(x))return NaN;if(y(x)){var S=typeof x.valueOf=="function"?x.valueOf():x;x=y(S)?S+"":S}if(typeof x!="string")return x===0?x:+x;x=x.replace(o,"");var E=s.test(x);return E||a.test(x)?l(x.slice(2),E?2:8):i.test(x)?NaN:+x}t.exports=function(x,S,E){var k,w,M,T,D,P,U=0,N=!1,K=!1,R=!0;if(typeof x!="function")throw new TypeError("Expected a function");function B(G){var X=k,ie=w;return k=w=void 0,U=G,T=x.apply(ie,X)}function z(G){return U=G,D=setTimeout(oe,S),N?B(G):T}function I(G){var X=G-P;return P===void 0||X>=S||X<0||K&&G-U>=M}function oe(){var G=g();if(I(G))return me(G);D=setTimeout(oe,function(X){var ie=S-(X-P);return K?m(ie,M-(X-U)):ie}(G))}function me(G){return D=void 0,R&&k?B(G):(k=w=void 0,T)}function te(){var G=g(),X=I(G);if(k=arguments,w=this,P=G,X){if(D===void 0)return z(P);if(K)return D=setTimeout(oe,S),B(P)}return D===void 0&&(D=setTimeout(oe,S)),T}return S=b(S)||0,y(E)&&(N=!!E.leading,M=(K="maxWait"in E)?f(b(E.maxWait)||0,S):M,R="trailing"in E?!!E.trailing:R),te.cancel=function(){D!==void 0&&clearTimeout(D),U=0,k=P=w=D=void 0},te.flush=function(){return D===void 0?T:me(g())},te}}).call(this,n(3))},function(t,e,n){(function(r,o){var i="[object Arguments]",s="[object Map]",a="[object Object]",l="[object Set]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,d=/^\./,p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,m=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,y={};y["[object Float32Array]"]=y["[object Float64Array]"]=y["[object Int8Array]"]=y["[object Int16Array]"]=y["[object Int32Array]"]=y["[object Uint8Array]"]=y["[object Uint8ClampedArray]"]=y["[object Uint16Array]"]=y["[object Uint32Array]"]=!0,y[i]=y["[object Array]"]=y["[object ArrayBuffer]"]=y["[object Boolean]"]=y["[object DataView]"]=y["[object Date]"]=y["[object Error]"]=y["[object Function]"]=y[s]=y["[object Number]"]=y[a]=y["[object RegExp]"]=y[l]=y["[object String]"]=y["[object WeakMap]"]=!1;var b=typeof r=="object"&&r&&r.Object===Object&&r,x=typeof self=="object"&&self&&self.Object===Object&&self,S=b||x||Function("return this")(),E=e&&!e.nodeType&&e,k=E&&typeof o=="object"&&o&&!o.nodeType&&o,w=k&&k.exports===E&&b.process,M=function(){try{return w&&w.binding("util")}catch{}}(),T=M&&M.isTypedArray;function D(L,q,le,ve){var Fe=-1,$e=L?L.length:0;for(ve&&$e&&(le=L[++Fe]);++Fe<$e;)le=q(le,L[Fe],Fe,L);return le}function P(L,q){for(var le=-1,ve=L?L.length:0;++le-1},Ae.prototype.set=function(L,q){var le=this.__data__,ve=Pt(le,L);return ve<0?le.push([L,q]):le[ve][1]=q,this},He.prototype.clear=function(){this.__data__={hash:new Oe,map:new(ke||Ae),string:new Oe}},He.prototype.delete=function(L){return Kn(this,L).delete(L)},He.prototype.get=function(L){return Kn(this,L).get(L)},He.prototype.has=function(L){return Kn(this,L).has(L)},He.prototype.set=function(L,q){return Kn(this,L).set(L,q),this},Pe.prototype.add=Pe.prototype.push=function(L){return this.__data__.set(L,"__lodash_hash_undefined__"),this},Pe.prototype.has=function(L){return this.__data__.has(L)},it.prototype.clear=function(){this.__data__=new Ae},it.prototype.delete=function(L){return this.__data__.delete(L)},it.prototype.get=function(L){return this.__data__.get(L)},it.prototype.has=function(L){return this.__data__.has(L)},it.prototype.set=function(L,q){var le=this.__data__;if(le instanceof Ae){var ve=le.__data__;if(!ke||ve.length<199)return ve.push([L,q]),this;le=this.__data__=new He(ve)}return le.set(L,q),this};var Gt,zt=(Gt=function(L,q){return L&&qt(L,q,ze)},function(L,q){if(L==null)return L;if(!Xn(L))return Gt(L,q);for(var le=L.length,ve=-1,Fe=Object(L);++vext))return!1;var ht=$e.get(L);if(ht&&$e.get(q))return ht==q;var ct=-1,Qn=!0,sn=1&Fe?new Pe:void 0;for($e.set(L,q),$e.set(q,L);++ct-1&&L%1==0&&L-1&&L%1==0&&L<=9007199254740991}function re(L){var q=typeof L;return!!L&&(q=="object"||q=="function")}function ee(L){return!!L&&typeof L=="object"}function Me(L){return typeof L=="symbol"||ee(L)&&C.call(L)=="[object Symbol]"}var xe=T?function(L){return function(q){return L(q)}}(T):function(L){return ee(L)&&Fn(L.length)&&!!y[C.call(L)]};function ze(L){return Xn(L)?jt(L):Kt(L)}function et(L){return L}o.exports=function(L,q,le){var ve=Qt(L)?D:U,Fe=arguments.length<3;return ve(L,dn(q),le,Fe,zt)}}).call(this,n(3),n(7)(t))},function(t,e){t.exports=function(n){return n.webpackPolyfill||(n.deprecate=function(){},n.paths=[],n.children||(n.children=[]),Object.defineProperty(n,"loaded",{enumerable:!0,get:function(){return n.l}}),Object.defineProperty(n,"id",{enumerable:!0,get:function(){return n.i}}),n.webpackPolyfill=1),n}},function(t,e){String.prototype.padEnd||(String.prototype.padEnd=function(n,r){return n>>=0,r=String(r!==void 0?r:" "),this.length>n?String(this):((n-=this.length)>r.length&&(r+=r.repeat(n/r.length)),String(this)+r.slice(0,n))})},function(t,e,n){function r(te,G,X){return G in te?Object.defineProperty(te,G,{value:X,enumerable:!0,configurable:!0,writable:!0}):te[G]=X,te}function o(te){if(Symbol.iterator in Object(te)||Object.prototype.toString.call(te)==="[object Arguments]")return Array.from(te)}function i(te){return function(G){if(Array.isArray(G)){for(var X=0,ie=new Array(G.length);X0?(V.mainCode=!0,A||G.constructor.name==="Array"&&G.includes(H[2])?(V.hasAreaCodes=!0,[V].concat(fe)):(j=j.concat(fe),[V])):[V]}))),j]}function z(te,G,X,ie){if(X!==null){var Y=Object.keys(X),C=Object.values(X);Y.forEach(function(A,j){if(ie)return te.push([A,C[j]]);var H=te.findIndex(function(fe){return fe[0]===A});if(H===-1){var V=[A];V[G]=C[j],te.push(V)}else te[H][G]=C[j]})}}function I(te,G){return G.length===0?te:te.map(function(X){var ie=G.findIndex(function(C){return C[0]===X[2]});if(ie===-1)return X;var Y=G[ie];return Y[1]&&(X[4]=Y[1]),Y[3]&&(X[5]=Y[3]),Y[2]&&(X[6]=Y[2]),X})}var oe=function te(G,X,ie,Y,C,A,j,H,V,fe,pe,he,ke,Te){l(this,te),this.filterRegions=function(ge,ce){if(typeof ge=="string"){var je=ge;return ce.filter(function(Oe){return Oe.regions.some(function(Ae){return Ae===je})})}return ce.filter(function(Oe){return ge.map(function(Ae){return Oe.regions.some(function(He){return He===Ae})}).some(function(Ae){return Ae})})},this.sortTerritories=function(ge,ce){var je=[].concat(i(ge),i(ce));return je.sort(function(Oe,Ae){return Oe.nameAe.name?1:0}),je},this.getFilteredCountryList=function(ge,ce,je){return ge.length===0?ce:je?ge.map(function(Oe){var Ae=ce.find(function(He){return He.iso2===Oe});if(Ae)return Ae}).filter(function(Oe){return Oe}):ce.filter(function(Oe){return ge.some(function(Ae){return Ae===Oe.iso2})})},this.localizeCountries=function(ge,ce,je){for(var Oe=0;OeHe.localName?1:0}),ge},this.getCustomAreas=function(ge,ce){for(var je=[],Oe=0;Oebe.dialCode.length||ge.dialCode.length===be.dialCode.length&&ge.priority="0"&&$.indexOf(0)<="9"?de.find(function(Z){return Z.dialCode==+$}):de.find(function(Z){return Z.iso2==$}))&&F.dialCode&&C.setState({selectedCountry:F,formattedNumber:C.props.disableCountryCode?"":C.formatNumber(F.dialCode,F)})},C.scrollTo=function($,F){if($){var de=C.dropdownRef;if(de&&document.body){var Z=de.offsetHeight,ae=de.getBoundingClientRect().top+document.body.scrollTop,ue=ae+Z,ye=$,be=ye.getBoundingClientRect(),ge=ye.offsetHeight,ce=be.top+document.body.scrollTop,je=ce+ge,Oe=ce-ae+de.scrollTop,Ae=Z/2-ge/2;if(C.props.enableSearch?ceue){F&&(Oe+=Ae);var He=Z-ge;de.scrollTop=Oe-He}}}},C.scrollToTop=function(){var $=C.dropdownRef;$&&document.body&&($.scrollTop=0)},C.formatNumber=function($,F){if(!F)return $;var de,Z=F.format,ae=C.props,ue=ae.disableCountryCode,ye=ae.enableAreaCodeStretch,be=ae.enableLongNumbers,ge=ae.autoFormat;if(ue?((de=Z.split(" ")).shift(),de=de.join(" ")):ye&&F.isAreaCode?((de=Z.split(" "))[1]=de[1].replace(/\.+/,"".padEnd(F.areaCodeLength,".")),de=de.join(" ")):de=Z,!$||$.length===0)return ue?"":C.props.prefix;if($&&$.length<2||!de||!ge)return ue?$:C.props.prefix+$;var ce,je=w()(de,function(Oe,Ae){if(Oe.remainingText.length===0)return Oe;if(Ae!==".")return{formattedText:Oe.formattedText+Ae,remainingText:Oe.remainingText};var He,Pe=s(He=Oe.remainingText)||o(He)||a(),it=Pe[0],jt=Pe.slice(1);return{formattedText:Oe.formattedText+it,remainingText:jt}},{formattedText:"",remainingText:$.split("")});return(ce=be?je.formattedText+je.remainingText.join(""):je.formattedText).includes("(")&&!ce.includes(")")&&(ce+=")"),ce},C.cursorToEnd=function(){var $=C.numberInputRef;if(document.activeElement===$){$.focus();var F=$.value.length;$.value.charAt(F-1)===")"&&(F-=1),$.setSelectionRange(F,F)}},C.getElement=function($){return C["flag_no_".concat($)]},C.getCountryData=function(){return C.state.selectedCountry?{name:C.state.selectedCountry.name||"",dialCode:C.state.selectedCountry.dialCode||"",countryCode:C.state.selectedCountry.iso2||"",format:C.state.selectedCountry.format||""}:{}},C.handleFlagDropdownClick=function($){if($.preventDefault(),C.state.showDropdown||!C.props.disabled){var F=C.state,de=F.preferredCountries,Z=F.onlyCountries,ae=F.selectedCountry,ue=C.concatPreferredCountries(de,Z).findIndex(function(ye){return ye.dialCode===ae.dialCode&&ye.iso2===ae.iso2});C.setState({showDropdown:!C.state.showDropdown,highlightCountryIndex:ue},function(){C.state.showDropdown&&C.scrollTo(C.getElement(C.state.highlightCountryIndex))})}},C.handleInput=function($){var F=$.target.value,de=C.props,Z=de.prefix,ae=de.onChange,ue=C.props.disableCountryCode?"":Z,ye=C.state.selectedCountry,be=C.state.freezeSelection;if(!C.props.countryCodeEditable){var ge=Z+(ye.hasAreaCodes?C.state.onlyCountries.find(function(zt){return zt.iso2===ye.iso2&&zt.mainCode}).dialCode:ye.dialCode);if(F.slice(0,ge.length)!==ge)return}if(F===Z)return ae&&ae("",C.getCountryData(),$,""),C.setState({formattedNumber:""});if(!(F.replace(/\D/g,"").length>15&&(C.props.enableLongNumbers===!1||typeof C.props.enableLongNumbers=="number"&&F.replace(/\D/g,"").length>C.props.enableLongNumbers))&&F!==C.state.formattedNumber){$.preventDefault?$.preventDefault():$.returnValue=!1;var ce=C.props.country,je=C.state,Oe=je.onlyCountries,Ae=je.selectedCountry,He=je.hiddenAreaCodes;if(ae&&$.persist(),F.length>0){var Pe=F.replace(/\D/g,"");(!C.state.freezeSelection||Ae&&Ae.dialCode.length>Pe.length)&&(ye=C.props.disableCountryGuess?Ae:C.guessSelectedCountry(Pe.substring(0,6),ce,Oe,He)||Ae,be=!1),ue=C.formatNumber(Pe,ye),ye=ye.dialCode?ye:Ae}var it=$.target.selectionStart,jt=$.target.selectionStart,Pt=C.state.formattedNumber,Gt=ue.length-Pt.length;C.setState({formattedNumber:ue,freezeSelection:be,selectedCountry:ye},function(){Gt>0&&(jt-=Gt),ue.charAt(ue.length-1)==")"?C.numberInputRef.setSelectionRange(ue.length-1,ue.length-1):jt>0&&Pt.length>=ue.length?C.numberInputRef.setSelectionRange(jt,jt):it1?ae.replace(de.dialCode,Z.dialCode):Z.dialCode,ye=C.formatNumber(ue.replace(/\D/g,""),Z);C.setState({showDropdown:!1,selectedCountry:Z,freezeSelection:!0,formattedNumber:ye,searchValue:""},function(){C.cursorToEnd(),C.props.onChange&&C.props.onChange(ye.replace(/[^0-9]+/g,""),C.getCountryData(),F,ye)})}},C.handleInputFocus=function($){C.numberInputRef&&C.numberInputRef.value===C.props.prefix&&C.state.selectedCountry&&!C.props.disableCountryCode&&C.setState({formattedNumber:C.props.prefix+C.state.selectedCountry.dialCode},function(){C.props.jumpCursorToEnd&&setTimeout(C.cursorToEnd,0)}),C.setState({placeholder:""}),C.props.onFocus&&C.props.onFocus($,C.getCountryData()),C.props.jumpCursorToEnd&&setTimeout(C.cursorToEnd,0)},C.handleInputBlur=function($){$.target.value||C.setState({placeholder:C.props.placeholder}),C.props.onBlur&&C.props.onBlur($,C.getCountryData())},C.handleInputCopy=function($){if(C.props.copyNumbersOnly){var F=window.getSelection().toString().replace(/[^0-9]+/g,"");$.clipboardData.setData("text/plain",F),$.preventDefault()}},C.getHighlightCountryIndex=function($){var F=C.state.highlightCountryIndex+$;return F<0||F>=C.state.onlyCountries.length+C.state.preferredCountries.length?F-$:C.props.enableSearch&&F>C.getSearchFilteredCountries().length?0:F},C.searchCountry=function(){var $=C.getProbableCandidate(C.state.queryString)||C.state.onlyCountries[0],F=C.state.onlyCountries.findIndex(function(de){return de==$})+C.state.preferredCountries.length;C.scrollTo(C.getElement(F),!0),C.setState({queryString:"",highlightCountryIndex:F})},C.handleKeydown=function($){var F=C.props.keys,de=$.target.className;if(de.includes("selected-flag")&&$.which===F.ENTER&&!C.state.showDropdown)return C.handleFlagDropdownClick($);if(de.includes("form-control")&&($.which===F.ENTER||$.which===F.ESC))return $.target.blur();if(C.state.showDropdown&&!C.props.disabled&&(!de.includes("search-box")||$.which===F.UP||$.which===F.DOWN||$.which===F.ENTER||$.which===F.ESC&&$.target.value==="")){$.preventDefault?$.preventDefault():$.returnValue=!1;var Z=function(ae){C.setState({highlightCountryIndex:C.getHighlightCountryIndex(ae)},function(){C.scrollTo(C.getElement(C.state.highlightCountryIndex),!0)})};switch($.which){case F.DOWN:Z(1);break;case F.UP:Z(-1);break;case F.ENTER:C.props.enableSearch?C.handleFlagItemClick(C.getSearchFilteredCountries()[C.state.highlightCountryIndex]||C.getSearchFilteredCountries()[0],$):C.handleFlagItemClick([].concat(i(C.state.preferredCountries),i(C.state.onlyCountries))[C.state.highlightCountryIndex],$);break;case F.ESC:case F.TAB:C.setState({showDropdown:!1},C.cursorToEnd);break;default:($.which>=F.A&&$.which<=F.Z||$.which===F.SPACE)&&C.setState({queryString:C.state.queryString+String.fromCharCode($.which)},C.state.debouncedQueryStingSearcher)}}},C.handleInputKeyDown=function($){var F=C.props,de=F.keys,Z=F.onEnterKeyPress,ae=F.onKeyDown;$.which===de.ENTER&&Z&&Z($),ae&&ae($)},C.handleClickOutside=function($){C.dropdownRef&&C.dropdownRef!==$.target&&!C.dropdownRef.contains($.target)&&C.state.showDropdown&&C.setState({showDropdown:!1})},C.handleSearchChange=function($){var F=$.currentTarget.value,de=C.state,Z=de.preferredCountries,ae=de.selectedCountry,ue=0;if(F===""&&ae){var ye=C.state.onlyCountries;ue=C.concatPreferredCountries(Z,ye).findIndex(function(be){return be==ae}),setTimeout(function(){return C.scrollTo(C.getElement(ue))},100)}C.setState({searchValue:F,highlightCountryIndex:ue})},C.concatPreferredCountries=function($,F){return $.length>0?i(new Set($.concat(F))):F},C.getDropdownCountryName=function($){return $.localName||$.name},C.getSearchFilteredCountries=function(){var $=C.state,F=$.preferredCountries,de=$.onlyCountries,Z=$.searchValue,ae=C.props.enableSearch,ue=C.concatPreferredCountries(F,de),ye=Z.trim().toLowerCase().replace("+","");if(ae&&ye){if(/^\d+$/.test(ye))return ue.filter(function(ce){var je=ce.dialCode;return["".concat(je)].some(function(Oe){return Oe.toLowerCase().includes(ye)})});var be=ue.filter(function(ce){var je=ce.iso2;return["".concat(je)].some(function(Oe){return Oe.toLowerCase().includes(ye)})}),ge=ue.filter(function(ce){var je=ce.name,Oe=ce.localName;return ce.iso2,["".concat(je),"".concat(Oe||"")].some(function(Ae){return Ae.toLowerCase().includes(ye)})});return C.scrollToTop(),i(new Set([].concat(be,ge)))}return ue},C.getCountryDropdownList=function(){var $=C.state,F=$.preferredCountries,de=$.highlightCountryIndex,Z=$.showDropdown,ae=$.searchValue,ue=C.props,ye=ue.disableDropdown,be=ue.prefix,ge=C.props,ce=ge.enableSearch,je=ge.searchNotFound,Oe=ge.disableSearchIcon,Ae=ge.searchClass,He=ge.searchStyle,Pe=ge.searchPlaceholder,it=ge.autocompleteSearch,jt=ge.DropdownList,Pt=C.getSearchFilteredCountries().map(function(lt,xn){var In=de===xn,$t=P()({country:!0,preferred:lt.iso2==="us"||lt.iso2==="gb",active:lt.iso2==="us",highlight:In}),dn="flag ".concat(lt.iso2);return y.a.createElement("li",Object.assign({ref:function(Kt){return C["flag_no_".concat(xn)]=Kt},key:"flag_no_".concat(xn),"data-flag-key":"flag_no_".concat(xn),className:$t,"data-dial-code":"1",tabIndex:ye?"-1":"0","data-country-code":lt.iso2,onClick:function(Kt){return C.handleFlagItemClick(lt,Kt)},role:"option"},In?{"aria-selected":!0}:{}),y.a.createElement("div",{className:dn}),y.a.createElement("span",{className:"country-name"},C.getDropdownCountryName(lt)),y.a.createElement("span",{className:"dial-code"},lt.format?C.formatNumber(lt.dialCode,lt):be+lt.dialCode))}),Gt=y.a.createElement("li",{key:"dashes",className:"divider"});F.length>0&&(!ce||ce&&!ae.trim())&&Pt.splice(F.length,0,Gt);var zt=P()(r({"country-list":!0,hide:!Z},C.props.dropdownClass,!0)),qt=y.a.createElement(y.a.Fragment,null,ce&&y.a.createElement("li",{className:P()(r({search:!0},Ae,Ae))},!Oe&&y.a.createElement("span",{className:P()(r({"search-emoji":!0},"".concat(Ae,"-emoji"),Ae)),role:"img","aria-label":"Magnifying glass"},"🔎"),y.a.createElement("input",{className:P()(r({"search-box":!0},"".concat(Ae,"-box"),Ae)),style:He,type:"search",placeholder:Pe,autoFocus:!0,autoComplete:it?"on":"off",value:ae,onChange:C.handleSearchChange})),Pt.length>0?Pt:y.a.createElement("li",{className:"no-entries-message"},y.a.createElement("span",null,je)));return jt?y.a.createElement(jt,{ref:function(lt){return!ce&<&<.focus(),C.dropdownRef=lt},anchorEl:C.numberInputRef},qt):y.a.createElement("ul",{ref:function(lt){return!ce&<&<.focus(),C.dropdownRef=lt},className:zt,style:C.props.dropdownStyle,role:"listbox",tabIndex:"0"},qt)};var A,j=new oe(Y.enableAreaCodes,Y.enableTerritories,Y.regions,Y.onlyCountries,Y.preferredCountries,Y.excludeCountries,Y.preserveOrder,Y.masks,Y.priority,Y.areaCodes,Y.localization,Y.prefix,Y.defaultMask,Y.alwaysDefaultMask),H=j.onlyCountries,V=j.preferredCountries,fe=j.hiddenAreaCodes,pe=Y.value?Y.value.replace(/\D/g,""):"";A=Y.disableInitialCountryGuess?0:pe.length>1?C.guessSelectedCountry(pe.substring(0,6),Y.country,H,fe)||0:Y.country&&H.find(function($){return $.iso2==Y.country})||0;var he,ke=pe.length<2&&A&&!T()(pe,A.dialCode)?A.dialCode:"";he=pe===""&&A===0?"":C.formatNumber((Y.disableCountryCode?"":ke)+pe,A.name?A:void 0);var Te=H.findIndex(function($){return $==A});return C.state={showDropdown:Y.showDropdown,formattedNumber:he,onlyCountries:H,preferredCountries:V,hiddenAreaCodes:fe,selectedCountry:A,highlightCountryIndex:Te,queryString:"",freezeSelection:!1,debouncedQueryStingSearcher:x()(C.searchCountry,250),searchValue:""},C}var X,ie;return function(Y,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");Y.prototype=Object.create(C&&C.prototype,{constructor:{value:Y,writable:!0,configurable:!0}}),C&&m(Y,C)}(G,te),X=G,(ie=[{key:"componentDidMount",value:function(){document.addEventListener&&this.props.enableClickOutside&&document.addEventListener("mousedown",this.handleClickOutside),this.props.onMount&&this.props.onMount(this.state.formattedNumber.replace(/[^0-9]+/g,""),this.getCountryData(),this.state.formattedNumber)}},{key:"componentWillUnmount",value:function(){document.removeEventListener&&this.props.enableClickOutside&&document.removeEventListener("mousedown",this.handleClickOutside)}},{key:"componentDidUpdate",value:function(Y,C,A){Y.country!==this.props.country?this.updateCountry(this.props.country):Y.value!==this.props.value&&this.updateFormattedNumber(this.props.value)}},{key:"updateFormattedNumber",value:function(Y){if(Y===null)return this.setState({selectedCountry:0,formattedNumber:""});var C=this.state,A=C.onlyCountries,j=C.selectedCountry,H=C.hiddenAreaCodes,V=this.props,fe=V.country,pe=V.prefix;if(Y==="")return this.setState({selectedCountry:j,formattedNumber:""});var he,ke,Te=Y.replace(/\D/g,"");if(j&&T()(Y,pe+j.dialCode))ke=this.formatNumber(Te,j),this.setState({formattedNumber:ke});else{var $=(he=this.props.disableCountryGuess?j:this.guessSelectedCountry(Te.substring(0,6),fe,A,H)||j)&&T()(Te,pe+he.dialCode)?he.dialCode:"";ke=this.formatNumber((this.props.disableCountryCode?"":$)+Te,he||void 0),this.setState({selectedCountry:he,formattedNumber:ke})}}},{key:"render",value:function(){var Y,C,A,j=this,H=this.state,V=H.onlyCountries,fe=H.selectedCountry,pe=H.showDropdown,he=H.formattedNumber,ke=H.hiddenAreaCodes,Te=this.props,$=Te.disableDropdown,F=Te.tabbableDropdown,de=Te.renderStringAsFlag,Z=Te.isValid,ae=Te.defaultErrorMessage,ue=Te.specialLabel;if(typeof Z=="boolean")C=Z;else{var ye=Z(he.replace(/\D/g,""),fe,V,ke);typeof ye=="boolean"?(C=ye)===!1&&(A=ae):(C=!1,A=ye)}var be=P()((r(Y={},this.props.containerClass,!0),r(Y,"react-tel-input",!0),Y)),ge=P()({arrow:!0,up:pe}),ce=P()(r({"form-control":!0,"invalid-number":!C,open:pe},this.props.inputClass,!0)),je=P()({"selected-flag":!0,open:pe}),Oe=P()(r({"flag-dropdown":!0,"invalid-number":!C,open:pe},this.props.buttonClass,!0)),Ae="flag ".concat(fe&&fe.iso2);return y.a.createElement("div",{className:"".concat(be," ").concat(this.props.className),style:this.props.style||this.props.containerStyle,onKeyDown:this.handleKeydown},ue&&y.a.createElement("div",{className:"special-label"},ue),A&&y.a.createElement("div",{className:"invalid-number-message"},A),y.a.createElement("input",Object.assign({className:ce,style:this.props.inputStyle,onChange:this.handleInput,onClick:this.handleInputClick,onDoubleClick:this.handleDoubleClick,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onCopy:this.handleInputCopy,value:he,onKeyDown:this.handleInputKeyDown,placeholder:this.props.placeholder,disabled:this.props.disabled,type:"tel"},this.props.inputProps,{ref:function(He){j.numberInputRef=He,typeof j.props.inputProps.ref=="function"?j.props.inputProps.ref(He):typeof j.props.inputProps.ref=="object"&&(j.props.inputProps.ref.current=He)}})),y.a.createElement("div",{className:Oe,style:this.props.buttonStyle,ref:function(He){return j.dropdownContainerRef=He}},de?y.a.createElement("div",{className:je},de):y.a.createElement("div",{onClick:$?void 0:this.handleFlagDropdownClick,className:je,title:fe?"".concat(fe.localName||fe.name,": + ").concat(fe.dialCode):"",tabIndex:$||F===!1?"-1":"0",role:"button","aria-haspopup":"listbox","aria-expanded":!!pe||void 0},y.a.createElement("div",{className:Ae},!$&&y.a.createElement("div",{className:ge}))),pe&&this.getCountryDropdownList()))}}])&&c(X.prototype,ie),G}(y.a.Component);me.defaultProps={country:"",value:"",onlyCountries:[],preferredCountries:[],excludeCountries:[],placeholder:"1 (702) 123-4567",searchPlaceholder:"search",searchNotFound:"No entries to show",flagsImagePath:"./flags.png",disabled:!1,containerStyle:{},inputStyle:{},buttonStyle:{},dropdownStyle:{},searchStyle:{},containerClass:"",inputClass:"",buttonClass:"",dropdownClass:"",searchClass:"",className:"",autoFormat:!0,enableAreaCodes:!1,enableTerritories:!1,disableCountryCode:!1,disableDropdown:!1,enableLongNumbers:!1,countryCodeEditable:!0,enableSearch:!1,disableSearchIcon:!1,disableInitialCountryGuess:!1,disableCountryGuess:!1,regions:"",inputProps:{},localization:{},masks:null,priority:null,areaCodes:null,preserveOrder:[],defaultMask:"... ... ... ... ..",alwaysDefaultMask:!1,prefix:"+",copyNumbersOnly:!0,renderStringAsFlag:"",autocompleteSearch:!1,jumpCursorToEnd:!0,enableAreaCodeStretch:!1,enableClickOutside:!0,showDropdown:!1,isValid:!0,defaultErrorMessage:"",specialLabel:"Phone",onEnterKeyPress:null,keys:{UP:38,DOWN:40,RIGHT:39,LEFT:37,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9}},e.default=me}]);const Z2=Aa(J2),X2=Q.div` +*/(function(){var o={}.hasOwnProperty;function i(){for(var s=[],a=0;a=D?T:D)),w=T,k=y(k),E.slice(w,w+k.length)==k}}).call(this,n(3))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch{typeof window=="object"&&(n=window)}t.exports=n},function(t,e,n){(function(r){var o=/^\[object .+?Constructor\]$/,i=typeof r=="object"&&r&&r.Object===Object&&r,s=typeof self=="object"&&self&&self.Object===Object&&self,a=i||s||Function("return this")(),l,c=Array.prototype,u=Function.prototype,d=Object.prototype,p=a["__core-js_shared__"],f=(l=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||""))?"Symbol(src)_1."+l:"",m=u.toString,g=d.hasOwnProperty,y=d.toString,b=RegExp("^"+m.call(g).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x=c.splice,S=U(a,"Map"),E=U(Object,"create");function k(R){var B=-1,z=R?R.length:0;for(this.clear();++B-1},w.prototype.set=function(R,B){var z=this.__data__,I=T(z,R);return I<0?z.push([R,B]):z[I][1]=B,this},M.prototype.clear=function(){this.__data__={hash:new k,map:new(S||w),string:new k}},M.prototype.delete=function(R){return P(this,R).delete(R)},M.prototype.get=function(R){return P(this,R).get(R)},M.prototype.has=function(R){return P(this,R).has(R)},M.prototype.set=function(R,B){return P(this,R).set(R,B),this},N.Cache=M,t.exports=N}).call(this,n(3))},function(t,e,n){(function(r){var o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt,c=typeof r=="object"&&r&&r.Object===Object&&r,u=typeof self=="object"&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,f=Math.max,m=Math.min,g=function(){return d.Date.now()};function y(x){var S=typeof x;return!!x&&(S=="object"||S=="function")}function b(x){if(typeof x=="number")return x;if(function(k){return typeof k=="symbol"||function(w){return!!w&&typeof w=="object"}(k)&&p.call(k)=="[object Symbol]"}(x))return NaN;if(y(x)){var S=typeof x.valueOf=="function"?x.valueOf():x;x=y(S)?S+"":S}if(typeof x!="string")return x===0?x:+x;x=x.replace(o,"");var E=s.test(x);return E||a.test(x)?l(x.slice(2),E?2:8):i.test(x)?NaN:+x}t.exports=function(x,S,E){var k,w,M,T,D,P,U=0,N=!1,K=!1,R=!0;if(typeof x!="function")throw new TypeError("Expected a function");function B(G){var X=k,ie=w;return k=w=void 0,U=G,T=x.apply(ie,X)}function z(G){return U=G,D=setTimeout(oe,S),N?B(G):T}function I(G){var X=G-P;return P===void 0||X>=S||X<0||K&&G-U>=M}function oe(){var G=g();if(I(G))return me(G);D=setTimeout(oe,function(X){var ie=S-(X-P);return K?m(ie,M-(X-U)):ie}(G))}function me(G){return D=void 0,R&&k?B(G):(k=w=void 0,T)}function te(){var G=g(),X=I(G);if(k=arguments,w=this,P=G,X){if(D===void 0)return z(P);if(K)return D=setTimeout(oe,S),B(P)}return D===void 0&&(D=setTimeout(oe,S)),T}return S=b(S)||0,y(E)&&(N=!!E.leading,M=(K="maxWait"in E)?f(b(E.maxWait)||0,S):M,R="trailing"in E?!!E.trailing:R),te.cancel=function(){D!==void 0&&clearTimeout(D),U=0,k=P=w=D=void 0},te.flush=function(){return D===void 0?T:me(g())},te}}).call(this,n(3))},function(t,e,n){(function(r,o){var i="[object Arguments]",s="[object Map]",a="[object Object]",l="[object Set]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,d=/^\./,p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,m=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,y={};y["[object Float32Array]"]=y["[object Float64Array]"]=y["[object Int8Array]"]=y["[object Int16Array]"]=y["[object Int32Array]"]=y["[object Uint8Array]"]=y["[object Uint8ClampedArray]"]=y["[object Uint16Array]"]=y["[object Uint32Array]"]=!0,y[i]=y["[object Array]"]=y["[object ArrayBuffer]"]=y["[object Boolean]"]=y["[object DataView]"]=y["[object Date]"]=y["[object Error]"]=y["[object Function]"]=y[s]=y["[object Number]"]=y[a]=y["[object RegExp]"]=y[l]=y["[object String]"]=y["[object WeakMap]"]=!1;var b=typeof r=="object"&&r&&r.Object===Object&&r,x=typeof self=="object"&&self&&self.Object===Object&&self,S=b||x||Function("return this")(),E=e&&!e.nodeType&&e,k=E&&typeof o=="object"&&o&&!o.nodeType&&o,w=k&&k.exports===E&&b.process,M=function(){try{return w&&w.binding("util")}catch{}}(),T=M&&M.isTypedArray;function D(L,q,le,ve){var Fe=-1,$e=L?L.length:0;for(ve&&$e&&(le=L[++Fe]);++Fe<$e;)le=q(le,L[Fe],Fe,L);return le}function P(L,q){for(var le=-1,ve=L?L.length:0;++le-1},Ae.prototype.set=function(L,q){var le=this.__data__,ve=Pt(le,L);return ve<0?le.push([L,q]):le[ve][1]=q,this},He.prototype.clear=function(){this.__data__={hash:new Oe,map:new(ke||Ae),string:new Oe}},He.prototype.delete=function(L){return Kn(this,L).delete(L)},He.prototype.get=function(L){return Kn(this,L).get(L)},He.prototype.has=function(L){return Kn(this,L).has(L)},He.prototype.set=function(L,q){return Kn(this,L).set(L,q),this},Pe.prototype.add=Pe.prototype.push=function(L){return this.__data__.set(L,"__lodash_hash_undefined__"),this},Pe.prototype.has=function(L){return this.__data__.has(L)},it.prototype.clear=function(){this.__data__=new Ae},it.prototype.delete=function(L){return this.__data__.delete(L)},it.prototype.get=function(L){return this.__data__.get(L)},it.prototype.has=function(L){return this.__data__.has(L)},it.prototype.set=function(L,q){var le=this.__data__;if(le instanceof Ae){var ve=le.__data__;if(!ke||ve.length<199)return ve.push([L,q]),this;le=this.__data__=new He(ve)}return le.set(L,q),this};var Gt,zt=(Gt=function(L,q){return L&&qt(L,q,ze)},function(L,q){if(L==null)return L;if(!Xn(L))return Gt(L,q);for(var le=L.length,ve=-1,Fe=Object(L);++vext))return!1;var ht=$e.get(L);if(ht&&$e.get(q))return ht==q;var ct=-1,Qn=!0,sn=1&Fe?new Pe:void 0;for($e.set(L,q),$e.set(q,L);++ct-1&&L%1==0&&L-1&&L%1==0&&L<=9007199254740991}function re(L){var q=typeof L;return!!L&&(q=="object"||q=="function")}function ee(L){return!!L&&typeof L=="object"}function Me(L){return typeof L=="symbol"||ee(L)&&C.call(L)=="[object Symbol]"}var xe=T?function(L){return function(q){return L(q)}}(T):function(L){return ee(L)&&Fn(L.length)&&!!y[C.call(L)]};function ze(L){return Xn(L)?jt(L):Kt(L)}function et(L){return L}o.exports=function(L,q,le){var ve=Qt(L)?D:U,Fe=arguments.length<3;return ve(L,dn(q),le,Fe,zt)}}).call(this,n(3),n(7)(t))},function(t,e){t.exports=function(n){return n.webpackPolyfill||(n.deprecate=function(){},n.paths=[],n.children||(n.children=[]),Object.defineProperty(n,"loaded",{enumerable:!0,get:function(){return n.l}}),Object.defineProperty(n,"id",{enumerable:!0,get:function(){return n.i}}),n.webpackPolyfill=1),n}},function(t,e){String.prototype.padEnd||(String.prototype.padEnd=function(n,r){return n>>=0,r=String(r!==void 0?r:" "),this.length>n?String(this):((n-=this.length)>r.length&&(r+=r.repeat(n/r.length)),String(this)+r.slice(0,n))})},function(t,e,n){function r(te,G,X){return G in te?Object.defineProperty(te,G,{value:X,enumerable:!0,configurable:!0,writable:!0}):te[G]=X,te}function o(te){if(Symbol.iterator in Object(te)||Object.prototype.toString.call(te)==="[object Arguments]")return Array.from(te)}function i(te){return function(G){if(Array.isArray(G)){for(var X=0,ie=new Array(G.length);X0?(V.mainCode=!0,A||G.constructor.name==="Array"&&G.includes(H[2])?(V.hasAreaCodes=!0,[V].concat(fe)):(j=j.concat(fe),[V])):[V]}))),j]}function z(te,G,X,ie){if(X!==null){var Y=Object.keys(X),C=Object.values(X);Y.forEach(function(A,j){if(ie)return te.push([A,C[j]]);var H=te.findIndex(function(fe){return fe[0]===A});if(H===-1){var V=[A];V[G]=C[j],te.push(V)}else te[H][G]=C[j]})}}function I(te,G){return G.length===0?te:te.map(function(X){var ie=G.findIndex(function(C){return C[0]===X[2]});if(ie===-1)return X;var Y=G[ie];return Y[1]&&(X[4]=Y[1]),Y[3]&&(X[5]=Y[3]),Y[2]&&(X[6]=Y[2]),X})}var oe=function te(G,X,ie,Y,C,A,j,H,V,fe,pe,he,ke,Te){l(this,te),this.filterRegions=function(ge,ce){if(typeof ge=="string"){var je=ge;return ce.filter(function(Oe){return Oe.regions.some(function(Ae){return Ae===je})})}return ce.filter(function(Oe){return ge.map(function(Ae){return Oe.regions.some(function(He){return He===Ae})}).some(function(Ae){return Ae})})},this.sortTerritories=function(ge,ce){var je=[].concat(i(ge),i(ce));return je.sort(function(Oe,Ae){return Oe.nameAe.name?1:0}),je},this.getFilteredCountryList=function(ge,ce,je){return ge.length===0?ce:je?ge.map(function(Oe){var Ae=ce.find(function(He){return He.iso2===Oe});if(Ae)return Ae}).filter(function(Oe){return Oe}):ce.filter(function(Oe){return ge.some(function(Ae){return Ae===Oe.iso2})})},this.localizeCountries=function(ge,ce,je){for(var Oe=0;OeHe.localName?1:0}),ge},this.getCustomAreas=function(ge,ce){for(var je=[],Oe=0;Oeye.dialCode.length||ge.dialCode.length===ye.dialCode.length&&ge.priority="0"&&$.indexOf(0)<="9"?de.find(function(Z){return Z.dialCode==+$}):de.find(function(Z){return Z.iso2==$}))&&F.dialCode&&C.setState({selectedCountry:F,formattedNumber:C.props.disableCountryCode?"":C.formatNumber(F.dialCode,F)})},C.scrollTo=function($,F){if($){var de=C.dropdownRef;if(de&&document.body){var Z=de.offsetHeight,ae=de.getBoundingClientRect().top+document.body.scrollTop,ue=ae+Z,be=$,ye=be.getBoundingClientRect(),ge=be.offsetHeight,ce=ye.top+document.body.scrollTop,je=ce+ge,Oe=ce-ae+de.scrollTop,Ae=Z/2-ge/2;if(C.props.enableSearch?ceue){F&&(Oe+=Ae);var He=Z-ge;de.scrollTop=Oe-He}}}},C.scrollToTop=function(){var $=C.dropdownRef;$&&document.body&&($.scrollTop=0)},C.formatNumber=function($,F){if(!F)return $;var de,Z=F.format,ae=C.props,ue=ae.disableCountryCode,be=ae.enableAreaCodeStretch,ye=ae.enableLongNumbers,ge=ae.autoFormat;if(ue?((de=Z.split(" ")).shift(),de=de.join(" ")):be&&F.isAreaCode?((de=Z.split(" "))[1]=de[1].replace(/\.+/,"".padEnd(F.areaCodeLength,".")),de=de.join(" ")):de=Z,!$||$.length===0)return ue?"":C.props.prefix;if($&&$.length<2||!de||!ge)return ue?$:C.props.prefix+$;var ce,je=w()(de,function(Oe,Ae){if(Oe.remainingText.length===0)return Oe;if(Ae!==".")return{formattedText:Oe.formattedText+Ae,remainingText:Oe.remainingText};var He,Pe=s(He=Oe.remainingText)||o(He)||a(),it=Pe[0],jt=Pe.slice(1);return{formattedText:Oe.formattedText+it,remainingText:jt}},{formattedText:"",remainingText:$.split("")});return(ce=ye?je.formattedText+je.remainingText.join(""):je.formattedText).includes("(")&&!ce.includes(")")&&(ce+=")"),ce},C.cursorToEnd=function(){var $=C.numberInputRef;if(document.activeElement===$){$.focus();var F=$.value.length;$.value.charAt(F-1)===")"&&(F-=1),$.setSelectionRange(F,F)}},C.getElement=function($){return C["flag_no_".concat($)]},C.getCountryData=function(){return C.state.selectedCountry?{name:C.state.selectedCountry.name||"",dialCode:C.state.selectedCountry.dialCode||"",countryCode:C.state.selectedCountry.iso2||"",format:C.state.selectedCountry.format||""}:{}},C.handleFlagDropdownClick=function($){if($.preventDefault(),C.state.showDropdown||!C.props.disabled){var F=C.state,de=F.preferredCountries,Z=F.onlyCountries,ae=F.selectedCountry,ue=C.concatPreferredCountries(de,Z).findIndex(function(be){return be.dialCode===ae.dialCode&&be.iso2===ae.iso2});C.setState({showDropdown:!C.state.showDropdown,highlightCountryIndex:ue},function(){C.state.showDropdown&&C.scrollTo(C.getElement(C.state.highlightCountryIndex))})}},C.handleInput=function($){var F=$.target.value,de=C.props,Z=de.prefix,ae=de.onChange,ue=C.props.disableCountryCode?"":Z,be=C.state.selectedCountry,ye=C.state.freezeSelection;if(!C.props.countryCodeEditable){var ge=Z+(be.hasAreaCodes?C.state.onlyCountries.find(function(zt){return zt.iso2===be.iso2&&zt.mainCode}).dialCode:be.dialCode);if(F.slice(0,ge.length)!==ge)return}if(F===Z)return ae&&ae("",C.getCountryData(),$,""),C.setState({formattedNumber:""});if(!(F.replace(/\D/g,"").length>15&&(C.props.enableLongNumbers===!1||typeof C.props.enableLongNumbers=="number"&&F.replace(/\D/g,"").length>C.props.enableLongNumbers))&&F!==C.state.formattedNumber){$.preventDefault?$.preventDefault():$.returnValue=!1;var ce=C.props.country,je=C.state,Oe=je.onlyCountries,Ae=je.selectedCountry,He=je.hiddenAreaCodes;if(ae&&$.persist(),F.length>0){var Pe=F.replace(/\D/g,"");(!C.state.freezeSelection||Ae&&Ae.dialCode.length>Pe.length)&&(be=C.props.disableCountryGuess?Ae:C.guessSelectedCountry(Pe.substring(0,6),ce,Oe,He)||Ae,ye=!1),ue=C.formatNumber(Pe,be),be=be.dialCode?be:Ae}var it=$.target.selectionStart,jt=$.target.selectionStart,Pt=C.state.formattedNumber,Gt=ue.length-Pt.length;C.setState({formattedNumber:ue,freezeSelection:ye,selectedCountry:be},function(){Gt>0&&(jt-=Gt),ue.charAt(ue.length-1)==")"?C.numberInputRef.setSelectionRange(ue.length-1,ue.length-1):jt>0&&Pt.length>=ue.length?C.numberInputRef.setSelectionRange(jt,jt):it1?ae.replace(de.dialCode,Z.dialCode):Z.dialCode,be=C.formatNumber(ue.replace(/\D/g,""),Z);C.setState({showDropdown:!1,selectedCountry:Z,freezeSelection:!0,formattedNumber:be,searchValue:""},function(){C.cursorToEnd(),C.props.onChange&&C.props.onChange(be.replace(/[^0-9]+/g,""),C.getCountryData(),F,be)})}},C.handleInputFocus=function($){C.numberInputRef&&C.numberInputRef.value===C.props.prefix&&C.state.selectedCountry&&!C.props.disableCountryCode&&C.setState({formattedNumber:C.props.prefix+C.state.selectedCountry.dialCode},function(){C.props.jumpCursorToEnd&&setTimeout(C.cursorToEnd,0)}),C.setState({placeholder:""}),C.props.onFocus&&C.props.onFocus($,C.getCountryData()),C.props.jumpCursorToEnd&&setTimeout(C.cursorToEnd,0)},C.handleInputBlur=function($){$.target.value||C.setState({placeholder:C.props.placeholder}),C.props.onBlur&&C.props.onBlur($,C.getCountryData())},C.handleInputCopy=function($){if(C.props.copyNumbersOnly){var F=window.getSelection().toString().replace(/[^0-9]+/g,"");$.clipboardData.setData("text/plain",F),$.preventDefault()}},C.getHighlightCountryIndex=function($){var F=C.state.highlightCountryIndex+$;return F<0||F>=C.state.onlyCountries.length+C.state.preferredCountries.length?F-$:C.props.enableSearch&&F>C.getSearchFilteredCountries().length?0:F},C.searchCountry=function(){var $=C.getProbableCandidate(C.state.queryString)||C.state.onlyCountries[0],F=C.state.onlyCountries.findIndex(function(de){return de==$})+C.state.preferredCountries.length;C.scrollTo(C.getElement(F),!0),C.setState({queryString:"",highlightCountryIndex:F})},C.handleKeydown=function($){var F=C.props.keys,de=$.target.className;if(de.includes("selected-flag")&&$.which===F.ENTER&&!C.state.showDropdown)return C.handleFlagDropdownClick($);if(de.includes("form-control")&&($.which===F.ENTER||$.which===F.ESC))return $.target.blur();if(C.state.showDropdown&&!C.props.disabled&&(!de.includes("search-box")||$.which===F.UP||$.which===F.DOWN||$.which===F.ENTER||$.which===F.ESC&&$.target.value==="")){$.preventDefault?$.preventDefault():$.returnValue=!1;var Z=function(ae){C.setState({highlightCountryIndex:C.getHighlightCountryIndex(ae)},function(){C.scrollTo(C.getElement(C.state.highlightCountryIndex),!0)})};switch($.which){case F.DOWN:Z(1);break;case F.UP:Z(-1);break;case F.ENTER:C.props.enableSearch?C.handleFlagItemClick(C.getSearchFilteredCountries()[C.state.highlightCountryIndex]||C.getSearchFilteredCountries()[0],$):C.handleFlagItemClick([].concat(i(C.state.preferredCountries),i(C.state.onlyCountries))[C.state.highlightCountryIndex],$);break;case F.ESC:case F.TAB:C.setState({showDropdown:!1},C.cursorToEnd);break;default:($.which>=F.A&&$.which<=F.Z||$.which===F.SPACE)&&C.setState({queryString:C.state.queryString+String.fromCharCode($.which)},C.state.debouncedQueryStingSearcher)}}},C.handleInputKeyDown=function($){var F=C.props,de=F.keys,Z=F.onEnterKeyPress,ae=F.onKeyDown;$.which===de.ENTER&&Z&&Z($),ae&&ae($)},C.handleClickOutside=function($){C.dropdownRef&&C.dropdownRef!==$.target&&!C.dropdownRef.contains($.target)&&C.state.showDropdown&&C.setState({showDropdown:!1})},C.handleSearchChange=function($){var F=$.currentTarget.value,de=C.state,Z=de.preferredCountries,ae=de.selectedCountry,ue=0;if(F===""&&ae){var be=C.state.onlyCountries;ue=C.concatPreferredCountries(Z,be).findIndex(function(ye){return ye==ae}),setTimeout(function(){return C.scrollTo(C.getElement(ue))},100)}C.setState({searchValue:F,highlightCountryIndex:ue})},C.concatPreferredCountries=function($,F){return $.length>0?i(new Set($.concat(F))):F},C.getDropdownCountryName=function($){return $.localName||$.name},C.getSearchFilteredCountries=function(){var $=C.state,F=$.preferredCountries,de=$.onlyCountries,Z=$.searchValue,ae=C.props.enableSearch,ue=C.concatPreferredCountries(F,de),be=Z.trim().toLowerCase().replace("+","");if(ae&&be){if(/^\d+$/.test(be))return ue.filter(function(ce){var je=ce.dialCode;return["".concat(je)].some(function(Oe){return Oe.toLowerCase().includes(be)})});var ye=ue.filter(function(ce){var je=ce.iso2;return["".concat(je)].some(function(Oe){return Oe.toLowerCase().includes(be)})}),ge=ue.filter(function(ce){var je=ce.name,Oe=ce.localName;return ce.iso2,["".concat(je),"".concat(Oe||"")].some(function(Ae){return Ae.toLowerCase().includes(be)})});return C.scrollToTop(),i(new Set([].concat(ye,ge)))}return ue},C.getCountryDropdownList=function(){var $=C.state,F=$.preferredCountries,de=$.highlightCountryIndex,Z=$.showDropdown,ae=$.searchValue,ue=C.props,be=ue.disableDropdown,ye=ue.prefix,ge=C.props,ce=ge.enableSearch,je=ge.searchNotFound,Oe=ge.disableSearchIcon,Ae=ge.searchClass,He=ge.searchStyle,Pe=ge.searchPlaceholder,it=ge.autocompleteSearch,jt=ge.DropdownList,Pt=C.getSearchFilteredCountries().map(function(lt,xn){var In=de===xn,$t=P()({country:!0,preferred:lt.iso2==="us"||lt.iso2==="gb",active:lt.iso2==="us",highlight:In}),dn="flag ".concat(lt.iso2);return y.a.createElement("li",Object.assign({ref:function(Kt){return C["flag_no_".concat(xn)]=Kt},key:"flag_no_".concat(xn),"data-flag-key":"flag_no_".concat(xn),className:$t,"data-dial-code":"1",tabIndex:be?"-1":"0","data-country-code":lt.iso2,onClick:function(Kt){return C.handleFlagItemClick(lt,Kt)},role:"option"},In?{"aria-selected":!0}:{}),y.a.createElement("div",{className:dn}),y.a.createElement("span",{className:"country-name"},C.getDropdownCountryName(lt)),y.a.createElement("span",{className:"dial-code"},lt.format?C.formatNumber(lt.dialCode,lt):ye+lt.dialCode))}),Gt=y.a.createElement("li",{key:"dashes",className:"divider"});F.length>0&&(!ce||ce&&!ae.trim())&&Pt.splice(F.length,0,Gt);var zt=P()(r({"country-list":!0,hide:!Z},C.props.dropdownClass,!0)),qt=y.a.createElement(y.a.Fragment,null,ce&&y.a.createElement("li",{className:P()(r({search:!0},Ae,Ae))},!Oe&&y.a.createElement("span",{className:P()(r({"search-emoji":!0},"".concat(Ae,"-emoji"),Ae)),role:"img","aria-label":"Magnifying glass"},"🔎"),y.a.createElement("input",{className:P()(r({"search-box":!0},"".concat(Ae,"-box"),Ae)),style:He,type:"search",placeholder:Pe,autoFocus:!0,autoComplete:it?"on":"off",value:ae,onChange:C.handleSearchChange})),Pt.length>0?Pt:y.a.createElement("li",{className:"no-entries-message"},y.a.createElement("span",null,je)));return jt?y.a.createElement(jt,{ref:function(lt){return!ce&<&<.focus(),C.dropdownRef=lt},anchorEl:C.numberInputRef},qt):y.a.createElement("ul",{ref:function(lt){return!ce&<&<.focus(),C.dropdownRef=lt},className:zt,style:C.props.dropdownStyle,role:"listbox",tabIndex:"0"},qt)};var A,j=new oe(Y.enableAreaCodes,Y.enableTerritories,Y.regions,Y.onlyCountries,Y.preferredCountries,Y.excludeCountries,Y.preserveOrder,Y.masks,Y.priority,Y.areaCodes,Y.localization,Y.prefix,Y.defaultMask,Y.alwaysDefaultMask),H=j.onlyCountries,V=j.preferredCountries,fe=j.hiddenAreaCodes,pe=Y.value?Y.value.replace(/\D/g,""):"";A=Y.disableInitialCountryGuess?0:pe.length>1?C.guessSelectedCountry(pe.substring(0,6),Y.country,H,fe)||0:Y.country&&H.find(function($){return $.iso2==Y.country})||0;var he,ke=pe.length<2&&A&&!T()(pe,A.dialCode)?A.dialCode:"";he=pe===""&&A===0?"":C.formatNumber((Y.disableCountryCode?"":ke)+pe,A.name?A:void 0);var Te=H.findIndex(function($){return $==A});return C.state={showDropdown:Y.showDropdown,formattedNumber:he,onlyCountries:H,preferredCountries:V,hiddenAreaCodes:fe,selectedCountry:A,highlightCountryIndex:Te,queryString:"",freezeSelection:!1,debouncedQueryStingSearcher:x()(C.searchCountry,250),searchValue:""},C}var X,ie;return function(Y,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");Y.prototype=Object.create(C&&C.prototype,{constructor:{value:Y,writable:!0,configurable:!0}}),C&&m(Y,C)}(G,te),X=G,(ie=[{key:"componentDidMount",value:function(){document.addEventListener&&this.props.enableClickOutside&&document.addEventListener("mousedown",this.handleClickOutside),this.props.onMount&&this.props.onMount(this.state.formattedNumber.replace(/[^0-9]+/g,""),this.getCountryData(),this.state.formattedNumber)}},{key:"componentWillUnmount",value:function(){document.removeEventListener&&this.props.enableClickOutside&&document.removeEventListener("mousedown",this.handleClickOutside)}},{key:"componentDidUpdate",value:function(Y,C,A){Y.country!==this.props.country?this.updateCountry(this.props.country):Y.value!==this.props.value&&this.updateFormattedNumber(this.props.value)}},{key:"updateFormattedNumber",value:function(Y){if(Y===null)return this.setState({selectedCountry:0,formattedNumber:""});var C=this.state,A=C.onlyCountries,j=C.selectedCountry,H=C.hiddenAreaCodes,V=this.props,fe=V.country,pe=V.prefix;if(Y==="")return this.setState({selectedCountry:j,formattedNumber:""});var he,ke,Te=Y.replace(/\D/g,"");if(j&&T()(Y,pe+j.dialCode))ke=this.formatNumber(Te,j),this.setState({formattedNumber:ke});else{var $=(he=this.props.disableCountryGuess?j:this.guessSelectedCountry(Te.substring(0,6),fe,A,H)||j)&&T()(Te,pe+he.dialCode)?he.dialCode:"";ke=this.formatNumber((this.props.disableCountryCode?"":$)+Te,he||void 0),this.setState({selectedCountry:he,formattedNumber:ke})}}},{key:"render",value:function(){var Y,C,A,j=this,H=this.state,V=H.onlyCountries,fe=H.selectedCountry,pe=H.showDropdown,he=H.formattedNumber,ke=H.hiddenAreaCodes,Te=this.props,$=Te.disableDropdown,F=Te.tabbableDropdown,de=Te.renderStringAsFlag,Z=Te.isValid,ae=Te.defaultErrorMessage,ue=Te.specialLabel;if(typeof Z=="boolean")C=Z;else{var be=Z(he.replace(/\D/g,""),fe,V,ke);typeof be=="boolean"?(C=be)===!1&&(A=ae):(C=!1,A=be)}var ye=P()((r(Y={},this.props.containerClass,!0),r(Y,"react-tel-input",!0),Y)),ge=P()({arrow:!0,up:pe}),ce=P()(r({"form-control":!0,"invalid-number":!C,open:pe},this.props.inputClass,!0)),je=P()({"selected-flag":!0,open:pe}),Oe=P()(r({"flag-dropdown":!0,"invalid-number":!C,open:pe},this.props.buttonClass,!0)),Ae="flag ".concat(fe&&fe.iso2);return y.a.createElement("div",{className:"".concat(ye," ").concat(this.props.className),style:this.props.style||this.props.containerStyle,onKeyDown:this.handleKeydown},ue&&y.a.createElement("div",{className:"special-label"},ue),A&&y.a.createElement("div",{className:"invalid-number-message"},A),y.a.createElement("input",Object.assign({className:ce,style:this.props.inputStyle,onChange:this.handleInput,onClick:this.handleInputClick,onDoubleClick:this.handleDoubleClick,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onCopy:this.handleInputCopy,value:he,onKeyDown:this.handleInputKeyDown,placeholder:this.props.placeholder,disabled:this.props.disabled,type:"tel"},this.props.inputProps,{ref:function(He){j.numberInputRef=He,typeof j.props.inputProps.ref=="function"?j.props.inputProps.ref(He):typeof j.props.inputProps.ref=="object"&&(j.props.inputProps.ref.current=He)}})),y.a.createElement("div",{className:Oe,style:this.props.buttonStyle,ref:function(He){return j.dropdownContainerRef=He}},de?y.a.createElement("div",{className:je},de):y.a.createElement("div",{onClick:$?void 0:this.handleFlagDropdownClick,className:je,title:fe?"".concat(fe.localName||fe.name,": + ").concat(fe.dialCode):"",tabIndex:$||F===!1?"-1":"0",role:"button","aria-haspopup":"listbox","aria-expanded":!!pe||void 0},y.a.createElement("div",{className:Ae},!$&&y.a.createElement("div",{className:ge}))),pe&&this.getCountryDropdownList()))}}])&&c(X.prototype,ie),G}(y.a.Component);me.defaultProps={country:"",value:"",onlyCountries:[],preferredCountries:[],excludeCountries:[],placeholder:"1 (702) 123-4567",searchPlaceholder:"search",searchNotFound:"No entries to show",flagsImagePath:"./flags.png",disabled:!1,containerStyle:{},inputStyle:{},buttonStyle:{},dropdownStyle:{},searchStyle:{},containerClass:"",inputClass:"",buttonClass:"",dropdownClass:"",searchClass:"",className:"",autoFormat:!0,enableAreaCodes:!1,enableTerritories:!1,disableCountryCode:!1,disableDropdown:!1,enableLongNumbers:!1,countryCodeEditable:!0,enableSearch:!1,disableSearchIcon:!1,disableInitialCountryGuess:!1,disableCountryGuess:!1,regions:"",inputProps:{},localization:{},masks:null,priority:null,areaCodes:null,preserveOrder:[],defaultMask:"... ... ... ... ..",alwaysDefaultMask:!1,prefix:"+",copyNumbersOnly:!0,renderStringAsFlag:"",autocompleteSearch:!1,jumpCursorToEnd:!0,enableAreaCodeStretch:!1,enableClickOutside:!0,showDropdown:!1,isValid:!0,defaultErrorMessage:"",specialLabel:"Phone",onEnterKeyPress:null,keys:{UP:38,DOWN:40,RIGHT:39,LEFT:37,ENTER:13,ESC:27,PLUS:43,A:65,Z:90,SPACE:32,TAB:9}},e.default=me}]);const Z2=Aa(J2),X2=Q.div` .react-tel-input { .form-control { border-radius: 0px; @@ -400,7 +400,7 @@ var BM=Object.defineProperty;var jM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,config li:hover { background-color: rgba(0, 0, 0, 0.04); } -`,tO=O.forwardRef(function({children:e,anchorEl:n},r){return v.jsx(Q2,{open:!0,anchorEl:n,style:{width:n.clientWidth},children:v.jsx(Ia,{children:v.jsx(eO,{ref:r,children:e})})})}),nO=t=>{var u,d;const{fieldDef:e,error:n,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=t;return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(X2,{$error:!!(e!=null&&e.required&&n),onBlur:p=>o&&o(p.target.value),$disabled:s,children:v.jsx(Z2,{autoFormat:!!((u=e==null?void 0:e.inputSettings)!=null&&u.autoFormat),country:(d=e==null?void 0:e.inputSettings)!=null&&d.country?e==null?void 0:e.inputSettings.country:"us",disabled:s,onChange:r,value:i,inputProps:{required:e==null?void 0:e.required,ref:a,id:l},tabbableDropdown:!1,DropdownList:tO})})},rO=h.memo(nO);function oO(t){return En("MuiRadioGroup",t)}At("MuiRadioGroup",["root","row","error"]);const iO=["actions","children","className","defaultValue","name","onChange","value"],sO=t=>{const{classes:e,row:n,error:r}=t;return Tn({root:["root",n&&"row",r&&"error"]},oO,e)},aO=h.forwardRef(function(e,n){const{actions:r,children:o,className:i,defaultValue:s,name:a,onChange:l,value:c}=e,u=tt(e,iO),d=h.useRef(null),p=sO(e),[f,m]=es({controlled:c,default:s,name:"RadioGroup"});h.useImperativeHandle(r,()=>({focus:()=>{let x=d.current.querySelector("input:not(:disabled):checked");x||(x=d.current.querySelector("input:not(:disabled)")),x&&x.focus()}}),[]);const g=Wr(n,d),y=If(a),b=h.useMemo(()=>({name:y,onChange(x){m(x.target.value),l&&l(x,x.target.value)},value:f}),[y,l,m,f]);return v.jsx(jE.Provider,{value:b,children:v.jsx(WM,J({role:"radiogroup",ref:g,className:Hn(p.root,i)},u,{children:o}))})}),lO=Q(aO)` +`,tO=O.forwardRef(function({children:e,anchorEl:n},r){return v.jsx(Q2,{open:!0,anchorEl:n,style:{width:n.clientWidth},children:v.jsx(Ia,{children:v.jsx(eO,{ref:r,children:e})})})}),nO=t=>{var u,d;const{fieldDef:e,error:n,onChange:r,onBlur:o,value:i,disabled:s,inputRef:a,id:l,skeleton:c}=t;return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(X2,{$error:!!(e!=null&&e.required&&n),onBlur:p=>o&&o(p.target.value),$disabled:s,children:v.jsx(Z2,{autoFormat:!!((u=e==null?void 0:e.inputSettings)!=null&&u.autoFormat),country:(d=e==null?void 0:e.inputSettings)!=null&&d.country?e==null?void 0:e.inputSettings.country:"us",disabled:s,onChange:r,value:i,inputProps:{required:e==null?void 0:e.required,ref:a,id:l},tabbableDropdown:!1,DropdownList:tO})})},rO=h.memo(nO);function oO(t){return En("MuiRadioGroup",t)}At("MuiRadioGroup",["root","row","error"]);const iO=["actions","children","className","defaultValue","name","onChange","value"],sO=t=>{const{classes:e,row:n,error:r}=t;return Tn({root:["root",n&&"row",r&&"error"]},oO,e)},aO=h.forwardRef(function(e,n){const{actions:r,children:o,className:i,defaultValue:s,name:a,onChange:l,value:c}=e,u=tt(e,iO),d=h.useRef(null),p=sO(e),[f,m]=es({controlled:c,default:s,name:"RadioGroup"});h.useImperativeHandle(r,()=>({focus:()=>{let x=d.current.querySelector("input:not(:disabled):checked");x||(x=d.current.querySelector("input:not(:disabled)")),x&&x.focus()}}),[]);const g=Wr(n,d),y=$f(a),b=h.useMemo(()=>({name:y,onChange(x){m(x.target.value),l&&l(x,x.target.value)},value:f}),[y,l,m,f]);return v.jsx(jE.Provider,{value:b,children:v.jsx(WM,J({role:"radiogroup",ref:g,className:Hn(p.root,i)},u,{children:o}))})}),lO=Q(aO)` margin-left: -12px; `,cO=Q.div` display: flex; @@ -415,7 +415,7 @@ var BM=Object.defineProperty;var jM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,config width: 18px; height: 40px; margin-right: 14px; -`;function Qu(){return v.jsxs(uO,{children:[v.jsx(dO,{children:v.jsx(Xe,{variant:"circular",width:18,height:18})}),v.jsx(Xe,{width:52,height:28})]})}function pO(){return v.jsxs(cO,{children:[v.jsx(Qu,{}),v.jsx(Qu,{}),v.jsx(Qu,{})]})}const fO=t=>{var f,m;const{fieldDef:e,onChange:n,value:r,onBlur:o,disabled:i,skeleton:s}=t,[a,l]=h.useState([]),[c,u]=h.useState(void 0);h.useEffect(()=>{(async()=>{var y,b;if((y=e==null?void 0:e.inputSettings)!=null&&y.options)l(e.inputSettings.options),u(!0);else if((b=e==null?void 0:e.inputSettings)!=null&&b.getOptions){const x=await e.inputSettings.getOptions();l(x),u(!1)}})()},[(f=e==null?void 0:e.inputSettings)==null?void 0:f.options,(m=e==null?void 0:e.inputSettings)==null?void 0:m.getOptions]),h.useEffect(()=>{r&&c===!1&&(a.find(g=>(g==null?void 0:g.value)===(r==null?void 0:r.value))||l([...a,r]))},[a,r,c]);const d=v.jsx(v.Fragment,{children:a.map(g=>v.jsx(zE,{disabled:i,label:g.label,value:g.value},g.label))}),p=g=>{const y=a.find(b=>b.value===g);n(y)};return s?v.jsx(pO,{}):v.jsx(lO,{onChange:g=>n&&p(g.target.value),value:r?r.value:"",onBlur:g=>o&&o(g.target.value),children:d})},hO=h.memo(fO),mO=t=>{const{value:e}=t;return v.jsx(v.Fragment,{children:e})},gO=h.memo(mO),vO=Q.div` +`;function ed(){return v.jsxs(uO,{children:[v.jsx(dO,{children:v.jsx(Xe,{variant:"circular",width:18,height:18})}),v.jsx(Xe,{width:52,height:28})]})}function pO(){return v.jsxs(cO,{children:[v.jsx(ed,{}),v.jsx(ed,{}),v.jsx(ed,{})]})}const fO=t=>{var f,m;const{fieldDef:e,onChange:n,value:r,onBlur:o,disabled:i,skeleton:s}=t,[a,l]=h.useState([]),[c,u]=h.useState(void 0);h.useEffect(()=>{(async()=>{var y,b;if((y=e==null?void 0:e.inputSettings)!=null&&y.options)l(e.inputSettings.options),u(!0);else if((b=e==null?void 0:e.inputSettings)!=null&&b.getOptions){const x=await e.inputSettings.getOptions();l(x),u(!1)}})()},[(f=e==null?void 0:e.inputSettings)==null?void 0:f.options,(m=e==null?void 0:e.inputSettings)==null?void 0:m.getOptions]),h.useEffect(()=>{r&&c===!1&&(a.find(g=>(g==null?void 0:g.value)===(r==null?void 0:r.value))||l([...a,r]))},[a,r,c]);const d=v.jsx(v.Fragment,{children:a.map(g=>v.jsx(zE,{disabled:i,label:g.label,value:g.value},g.label))}),p=g=>{const y=a.find(b=>b.value===g);n(y)};return s?v.jsx(pO,{}):v.jsx(lO,{onChange:g=>n&&p(g.target.value),value:r?r.value:"",onBlur:g=>o&&o(g.target.value),children:d})},hO=h.memo(fO),mO=t=>{const{value:e}=t;return v.jsx(v.Fragment,{children:e})},gO=h.memo(mO),vO=Q.div` display: flex; flex-flow: column; `,yO=Q.div` @@ -432,7 +432,7 @@ var BM=Object.defineProperty;var jM=(t,e,n)=>e in t?BM(t,e,{enumerable:!0,config & .MuiSkeleton-root { border-radius: 99999em; } -`;function xO(){return v.jsxs(yO,{children:[v.jsx(bO,{children:v.jsx(Xe,{variant:"rounded",width:36,height:22})}),v.jsx(Xe,{width:78,height:28})]})}function wO(){return v.jsx(vO,{children:v.jsx(xO,{})})}const CO=t=>{var a;const{fieldDef:e,onBlur:n,onChange:r,value:o,disabled:i,skeleton:s}=t;return s?v.jsx(wO,{}):v.jsx(HE,{disabled:i,checked:o,label:(a=e==null?void 0:e.inputSettings)==null?void 0:a.toggleLabel,onChange:r,onBlur:n})},SO=h.memo(CO);var ir={},Na={},kO=_f,MO=Pa,EO=ai,TO="[object String]";function OO(t){return typeof t=="string"||!MO(t)&&EO(t)&&kO(t)==TO}var LO=OO,AO=mx;function PO(t){return typeof t=="function"?t:AO}var RO=PO,DO=yE,IO=RO;function $O(t,e){return t&&DO(t,IO(e))}var qf=$O,NO=UM,_O=NO(Object.getPrototypeOf,Object),Kf=_O,FO=_f,BO=Kf,jO=ai,zO="[object Object]",HO=Function.prototype,VO=Object.prototype,Wx=HO.toString,WO=VO.hasOwnProperty,UO=Wx.call(Object);function GO(t){if(!jO(t)||FO(t)!=zO)return!1;var e=BO(t);if(e===null)return!0;var n=WO.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Wx.call(n)==UO}var Ux=GO;Object.defineProperty(Na,"__esModule",{value:!0});Na.flattenNames=void 0;var qO=LO,KO=pu(qO),YO=qf,JO=pu(YO),ZO=Ux,XO=pu(ZO),QO=UE,eL=pu(QO);function pu(t){return t&&t.__esModule?t:{default:t}}var tL=Na.flattenNames=function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,eL.default)(e,function(r){Array.isArray(r)?t(r).map(function(o){return n.push(o)}):(0,XO.default)(r)?(0,JO.default)(r,function(o,i){o===!0&&n.push(i),n.push(i+"-"+o)}):(0,KO.default)(r)&&n.push(r)}),n};Na.default=tL;var _a={};function nL(t,e){for(var n=-1,r=t==null?0:t.length;++n1&&arguments[1]!==void 0?arguments[1]:[],r=e.default&&(0,lR.default)(e.default)||{};return n.map(function(o){var i=e[o];return i&&(0,sR.default)(i,function(s,a){r[a]||(r[a]={}),r[a]=cR({},r[a],i[a])}),o}),r};_a.default=uR;var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});Fa.autoprefix=void 0;var dR=qf,qg=fR(dR),pR=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){xR(o,r);function o(){var i,s,a,l;bR(this,o);for(var c=arguments.length,u=Array(c),d=0;d1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){ER(o,r);function o(){var i,s,a,l;MR(this,o);for(var c=arguments.length,u=Array(c),d=0;d1&&arguments[1]!==void 0?arguments[1]:!0;r[s]=a};return e===0&&o("first-child"),e===n-1&&o("last-child"),(e===0||e%2===0)&&o("even"),Math.abs(e%2)===1&&o("odd"),o("nth-child",e),r};Qf.default=OR;Object.defineProperty(ir,"__esModule",{value:!0});ir.ReactCSS=ir.loop=ir.handleActive=eh=ir.handleHover=ir.hover=void 0;var LR=Na,AR=gs(LR),PR=_a,RR=gs(PR),DR=Fa,IR=gs(DR),$R=Ba,Xx=gs($R),NR=ja,_R=gs(NR),FR=Qf,BR=gs(FR);function gs(t){return t&&t.__esModule?t:{default:t}}ir.hover=Xx.default;var eh=ir.handleHover=Xx.default;ir.handleActive=_R.default;ir.loop=BR.default;var jR=ir.ReactCSS=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;oa?p=1:p=Math.round(d*100/a)/100,n.a!==p)return{h:n.h,s:n.s,l:n.l,a:p,source:"rgb"}}else{var f=void 0;if(u<0?f=0:u>s?f=1:f=Math.round(u*100/s)/100,o!==f)return{h:n.h,s:n.s,l:n.l,a:f,source:"rgb"}}return null},nd={},HR=function(e,n,r,o){if(typeof document>"u"&&!o)return null;var i=o?new o:document.createElement("canvas");i.width=r*2,i.height=r*2;var s=i.getContext("2d");return s?(s.fillStyle=e,s.fillRect(0,0,i.width,i.height),s.fillStyle=n,s.fillRect(0,0,r,r),s.translate(r,r),s.fillRect(0,0,r,r),i.toDataURL()):null},VR=function(e,n,r,o){var i=e+"-"+n+"-"+r+(o?"-server":"");if(nd[i])return nd[i];var s=HR(e,n,r,o);return nd[i]=s,s},Jg=Object.assign||function(t){for(var e=1;e{var a;const{fieldDef:e,onBlur:n,onChange:r,value:o,disabled:i,skeleton:s}=t;return s?v.jsx(wO,{}):v.jsx(HE,{disabled:i,checked:o,label:(a=e==null?void 0:e.inputSettings)==null?void 0:a.toggleLabel,onChange:r,onBlur:n})},SO=h.memo(CO);var ir={},Na={},kO=Ff,MO=Pa,EO=ai,TO="[object String]";function OO(t){return typeof t=="string"||!MO(t)&&EO(t)&&kO(t)==TO}var LO=OO,AO=mx;function PO(t){return typeof t=="function"?t:AO}var RO=PO,DO=yE,IO=RO;function $O(t,e){return t&&DO(t,IO(e))}var Kf=$O,NO=UM,_O=NO(Object.getPrototypeOf,Object),Yf=_O,FO=Ff,BO=Yf,jO=ai,zO="[object Object]",HO=Function.prototype,VO=Object.prototype,Wx=HO.toString,WO=VO.hasOwnProperty,UO=Wx.call(Object);function GO(t){if(!jO(t)||FO(t)!=zO)return!1;var e=BO(t);if(e===null)return!0;var n=WO.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Wx.call(n)==UO}var Ux=GO;Object.defineProperty(Na,"__esModule",{value:!0});Na.flattenNames=void 0;var qO=LO,KO=pu(qO),YO=Kf,JO=pu(YO),ZO=Ux,XO=pu(ZO),QO=UE,eL=pu(QO);function pu(t){return t&&t.__esModule?t:{default:t}}var tL=Na.flattenNames=function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[];return(0,eL.default)(e,function(r){Array.isArray(r)?t(r).map(function(o){return n.push(o)}):(0,XO.default)(r)?(0,JO.default)(r,function(o,i){o===!0&&n.push(i),n.push(i+"-"+o)}):(0,KO.default)(r)&&n.push(r)}),n};Na.default=tL;var _a={};function nL(t,e){for(var n=-1,r=t==null?0:t.length;++n1&&arguments[1]!==void 0?arguments[1]:[],r=e.default&&(0,lR.default)(e.default)||{};return n.map(function(o){var i=e[o];return i&&(0,sR.default)(i,function(s,a){r[a]||(r[a]={}),r[a]=cR({},r[a],i[a])}),o}),r};_a.default=uR;var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});Fa.autoprefix=void 0;var dR=Kf,qg=fR(dR),pR=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){xR(o,r);function o(){var i,s,a,l;bR(this,o);for(var c=arguments.length,u=Array(c),d=0;d1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){ER(o,r);function o(){var i,s,a,l;MR(this,o);for(var c=arguments.length,u=Array(c),d=0;d1&&arguments[1]!==void 0?arguments[1]:!0;r[s]=a};return e===0&&o("first-child"),e===n-1&&o("last-child"),(e===0||e%2===0)&&o("even"),Math.abs(e%2)===1&&o("odd"),o("nth-child",e),r};eh.default=OR;Object.defineProperty(ir,"__esModule",{value:!0});ir.ReactCSS=ir.loop=ir.handleActive=th=ir.handleHover=ir.hover=void 0;var LR=Na,AR=gs(LR),PR=_a,RR=gs(PR),DR=Fa,IR=gs(DR),$R=Ba,Xx=gs($R),NR=ja,_R=gs(NR),FR=eh,BR=gs(FR);function gs(t){return t&&t.__esModule?t:{default:t}}ir.hover=Xx.default;var th=ir.handleHover=Xx.default;ir.handleActive=_R.default;ir.loop=BR.default;var jR=ir.ReactCSS=function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;oa?p=1:p=Math.round(d*100/a)/100,n.a!==p)return{h:n.h,s:n.s,l:n.l,a:p,source:"rgb"}}else{var f=void 0;if(u<0?f=0:u>s?f=1:f=Math.round(u*100/s)/100,o!==f)return{h:n.h,s:n.s,l:n.l,a:f,source:"rgb"}}return null},rd={},HR=function(e,n,r,o){if(typeof document>"u"&&!o)return null;var i=o?new o:document.createElement("canvas");i.width=r*2,i.height=r*2;var s=i.getContext("2d");return s?(s.fillStyle=e,s.fillRect(0,0,i.width,i.height),s.fillStyle=n,s.fillRect(0,0,r,r),s.translate(r,r),s.fillRect(0,0,r,r),i.toDataURL()):null},VR=function(e,n,r,o){var i=e+"-"+n+"-"+r+(o?"-server":"");if(rd[i])return rd[i];var s=HR(e,n,r,o);return rd[i]=s,s},Jg=Object.assign||function(t){for(var e=1;e-1},rD=function(e){return Number(String(e).replace(/%/g,""))},oD=1,nt=function(t){XR(e,t);function e(n){JR(this,e);var r=ZR(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.handleBlur=function(){r.state.blurValue&&r.setState({value:r.state.blurValue,blurValue:null})},r.handleChange=function(o){r.setUpdatedValue(o.target.value,o)},r.handleKeyDown=function(o){var i=rD(o.target.value);if(!isNaN(i)&&nD(o.keyCode)){var s=r.getArrowOffset(),a=o.keyCode===Qx?i+s:i-s;r.setUpdatedValue(a,o)}},r.handleDrag=function(o){if(r.props.dragLabel){var i=Math.round(r.props.value+o.movementX);i>=0&&i<=r.props.dragMax&&r.props.onChange&&r.props.onChange(r.getValueObjectWithLabel(i),o)}},r.handleMouseDown=function(o){r.props.dragLabel&&(o.preventDefault(),r.handleDrag(o),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(n.value).toUpperCase(),blurValue:String(n.value).toUpperCase()},r.inputId="rc-editable-input-"+oD++,r}return KR(e,[{key:"componentDidUpdate",value:function(r,o){this.props.value!==this.state.value&&(r.value!==this.props.value||o.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(r){return YR({},this.props.label,r)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||QR}},{key:"setUpdatedValue",value:function(r,o){var i=this.props.label?this.getValueObjectWithLabel(r):r;this.props.onChange&&this.props.onChange(i,o),this.setState({value:r})}},{key:"render",value:function(){var r=this,o=We({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return O.createElement("div",{style:o.wrap},O.createElement("input",{id:this.inputId,style:o.input,ref:function(s){return r.input=s},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?O.createElement("label",{htmlFor:this.inputId,style:o.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),e}(h.PureComponent||h.Component),iD=function(e,n,r,o){var i=o.clientWidth,s=o.clientHeight,a=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=a-(o.getBoundingClientRect().left+window.pageXOffset),u=l-(o.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var d=void 0;if(u<0)d=359;else if(u>s)d=0;else{var p=-(u*100/s)+100;d=360*p/100}if(r.h!==d)return{h:d,s:r.s,l:r.l,a:r.a,source:"hsl"}}else{var f=void 0;if(c<0)f=0;else if(c>i)f=359;else{var m=c*100/i;f=360*m/100}if(r.h!==f)return{h:f,s:r.s,l:r.l,a:r.a,source:"hsl"}}return null},sD=function(){function t(e,n){for(var r=0;re in t?BM(t,e,{enumerable:!0,config background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); } - `),O.createElement("div",{style:s.pointer},this.props.pointer?O.createElement(this.props.pointer,this.props):O.createElement("div",{style:s.slider}))))}}]),e}(h.PureComponent||h.Component);function cD(){this.__data__=[],this.size=0}function za(t,e){return t===e||t!==t&&e!==e}function gu(t,e){for(var n=t.length;n--;)if(za(t[n][0],e))return n;return-1}var uD=Array.prototype,dD=uD.splice;function pD(t){var e=this.__data__,n=gu(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():dD.call(e,n,1),--this.size,!0}function fD(t){var e=this.__data__,n=gu(e,t);return n<0?void 0:e[n][1]}function hD(t){return gu(this.__data__,t)>-1}function mD(t,e){var n=this.__data__,r=gu(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Yr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=CI}function bs(t){return t!=null&&ih(t.length)&&!nh(t)}function SI(t){return Co(t)&&bs(t)}function kI(){return!1}var a1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,iv=a1&&typeof module=="object"&&module&&!module.nodeType&&module,MI=iv&&iv.exports===a1,sv=MI?xr.Buffer:void 0,EI=sv?sv.isBuffer:void 0,nc=EI||kI,TI="[object Object]",OI=Function.prototype,LI=Object.prototype,l1=OI.toString,AI=LI.hasOwnProperty,PI=l1.call(Object);function RI(t){if(!Co(t)||li(t)!=TI)return!1;var e=i1(t);if(e===null)return!0;var n=AI.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&l1.call(n)==PI}var DI="[object Arguments]",II="[object Array]",$I="[object Boolean]",NI="[object Date]",_I="[object Error]",FI="[object Function]",BI="[object Map]",jI="[object Number]",zI="[object Object]",HI="[object RegExp]",VI="[object Set]",WI="[object String]",UI="[object WeakMap]",GI="[object ArrayBuffer]",qI="[object DataView]",KI="[object Float32Array]",YI="[object Float64Array]",JI="[object Int8Array]",ZI="[object Int16Array]",XI="[object Int32Array]",QI="[object Uint8Array]",e$="[object Uint8ClampedArray]",t$="[object Uint16Array]",n$="[object Uint32Array]",Ct={};Ct[KI]=Ct[YI]=Ct[JI]=Ct[ZI]=Ct[XI]=Ct[QI]=Ct[e$]=Ct[t$]=Ct[n$]=!0;Ct[DI]=Ct[II]=Ct[GI]=Ct[$I]=Ct[qI]=Ct[NI]=Ct[_I]=Ct[FI]=Ct[BI]=Ct[jI]=Ct[zI]=Ct[HI]=Ct[VI]=Ct[WI]=Ct[UI]=!1;function r$(t){return Co(t)&&ih(t.length)&&!!Ct[li(t)]}function o$(t){return function(e){return t(e)}}var c1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ea=c1&&typeof module=="object"&&module&&!module.nodeType&&module,i$=ea&&ea.exports===c1,od=i$&&e1.process,av=function(){try{var t=ea&&ea.require&&ea.require("util").types;return t||od&&od.binding&&od.binding("util")}catch{}}(),lv=av&&av.isTypedArray,sh=lv?o$(lv):r$;function xp(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var s$=Object.prototype,a$=s$.hasOwnProperty;function l$(t,e,n){var r=t[e];(!(a$.call(t,e)&&za(r,n))||n===void 0&&!(e in t))&&rh(t,e,n)}function c$(t,e,n,r){var o=!n;n||(n={});for(var i=-1,s=e.length;++i-1&&t%1==0&&t0){if(++e>=M$)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var L$=O$(k$);function A$(t,e){return L$(C$(t,e,yu),t+"")}function P$(t,e,n){if(!lr(n))return!1;var r=typeof e;return(r=="number"?bs(n)&&ah(e,n.length):r=="string"&&e in n)?za(n[e],t):!1}function R$(t){return A$(function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=t.length>3&&typeof i=="function"?(o--,i):void 0,s&&P$(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),e=Object(e);++r=e||M<0||d&&T>=i}function b(){var w=id();if(y(w))return x(w);a=setTimeout(b,g(w))}function x(w){return a=void 0,p&&r?f(w):(r=o=void 0,s)}function S(){a!==void 0&&clearTimeout(a),c=0,r=l=o=a=void 0}function E(){return a===void 0?s:x(id())}function k(){var w=id(),M=y(w);if(r=arguments,o=this,l=w,M){if(a===void 0)return m(l);if(d)return clearTimeout(a),a=setTimeout(b,e),f(l)}return a===void 0&&(a=setTimeout(b,e)),s}return k.cancel=S,k.flush=E,k}var U$="Expected a function";function G$(t,e,n){var r=!0,o=!0;if(typeof t!="function")throw new TypeError(U$);return lr(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),f1(t,e,{leading:r,maxWait:e,trailing:o})}var q$=function(e,n,r){var o=r.getBoundingClientRect(),i=o.width,s=o.height,a=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=a-(r.getBoundingClientRect().left+window.pageXOffset),u=l-(r.getBoundingClientRect().top+window.pageYOffset);c<0?c=0:c>i&&(c=i),u<0?u=0:u>s&&(u=s);var d=c/i,p=1-u/s;return{h:n.h,s:d,v:p,a:n.a,source:"hsv"}},K$=function(){function t(e,n){for(var r=0;r-1}function mD(t,e){var n=this.__data__,r=gu(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Yr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=CI}function bs(t){return t!=null&&sh(t.length)&&!rh(t)}function SI(t){return Co(t)&&bs(t)}function kI(){return!1}var a1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,iv=a1&&typeof module=="object"&&module&&!module.nodeType&&module,MI=iv&&iv.exports===a1,sv=MI?xr.Buffer:void 0,EI=sv?sv.isBuffer:void 0,nc=EI||kI,TI="[object Object]",OI=Function.prototype,LI=Object.prototype,l1=OI.toString,AI=LI.hasOwnProperty,PI=l1.call(Object);function RI(t){if(!Co(t)||li(t)!=TI)return!1;var e=i1(t);if(e===null)return!0;var n=AI.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&l1.call(n)==PI}var DI="[object Arguments]",II="[object Array]",$I="[object Boolean]",NI="[object Date]",_I="[object Error]",FI="[object Function]",BI="[object Map]",jI="[object Number]",zI="[object Object]",HI="[object RegExp]",VI="[object Set]",WI="[object String]",UI="[object WeakMap]",GI="[object ArrayBuffer]",qI="[object DataView]",KI="[object Float32Array]",YI="[object Float64Array]",JI="[object Int8Array]",ZI="[object Int16Array]",XI="[object Int32Array]",QI="[object Uint8Array]",e$="[object Uint8ClampedArray]",t$="[object Uint16Array]",n$="[object Uint32Array]",Ct={};Ct[KI]=Ct[YI]=Ct[JI]=Ct[ZI]=Ct[XI]=Ct[QI]=Ct[e$]=Ct[t$]=Ct[n$]=!0;Ct[DI]=Ct[II]=Ct[GI]=Ct[$I]=Ct[qI]=Ct[NI]=Ct[_I]=Ct[FI]=Ct[BI]=Ct[jI]=Ct[zI]=Ct[HI]=Ct[VI]=Ct[WI]=Ct[UI]=!1;function r$(t){return Co(t)&&sh(t.length)&&!!Ct[li(t)]}function o$(t){return function(e){return t(e)}}var c1=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ea=c1&&typeof module=="object"&&module&&!module.nodeType&&module,i$=ea&&ea.exports===c1,id=i$&&e1.process,av=function(){try{var t=ea&&ea.require&&ea.require("util").types;return t||id&&id.binding&&id.binding("util")}catch{}}(),lv=av&&av.isTypedArray,ah=lv?o$(lv):r$;function wp(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var s$=Object.prototype,a$=s$.hasOwnProperty;function l$(t,e,n){var r=t[e];(!(a$.call(t,e)&&za(r,n))||n===void 0&&!(e in t))&&oh(t,e,n)}function c$(t,e,n,r){var o=!n;n||(n={});for(var i=-1,s=e.length;++i-1&&t%1==0&&t0){if(++e>=M$)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var L$=O$(k$);function A$(t,e){return L$(C$(t,e,yu),t+"")}function P$(t,e,n){if(!lr(n))return!1;var r=typeof e;return(r=="number"?bs(n)&&lh(e,n.length):r=="string"&&e in n)?za(n[e],t):!1}function R$(t){return A$(function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=t.length>3&&typeof i=="function"?(o--,i):void 0,s&&P$(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),e=Object(e);++r=e||M<0||d&&T>=i}function b(){var w=sd();if(y(w))return x(w);a=setTimeout(b,g(w))}function x(w){return a=void 0,p&&r?f(w):(r=o=void 0,s)}function S(){a!==void 0&&clearTimeout(a),c=0,r=l=o=a=void 0}function E(){return a===void 0?s:x(sd())}function k(){var w=sd(),M=y(w);if(r=arguments,o=this,l=w,M){if(a===void 0)return m(l);if(d)return clearTimeout(a),a=setTimeout(b,e),f(l)}return a===void 0&&(a=setTimeout(b,e)),s}return k.cancel=S,k.flush=E,k}var U$="Expected a function";function G$(t,e,n){var r=!0,o=!0;if(typeof t!="function")throw new TypeError(U$);return lr(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),f1(t,e,{leading:r,maxWait:e,trailing:o})}var q$=function(e,n,r){var o=r.getBoundingClientRect(),i=o.width,s=o.height,a=typeof e.pageX=="number"?e.pageX:e.touches[0].pageX,l=typeof e.pageY=="number"?e.pageY:e.touches[0].pageY,c=a-(r.getBoundingClientRect().left+window.pageXOffset),u=l-(r.getBoundingClientRect().top+window.pageYOffset);c<0?c=0:c>i&&(c=i),u<0?u=0:u>s&&(u=s);var d=c/i,p=1-u/s;return{h:n.h,s:d,v:p,a:n.a,source:"hsv"}},K$=function(){function t(e,n){for(var r=0;re in t?BM(t,e,{enumerable:!0,config background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0)); background: linear-gradient(to top, #000, rgba(0,0,0,0)); } - `),O.createElement("div",{style:u.white,className:"saturation-white"},O.createElement("div",{style:u.black,className:"saturation-black"}),O.createElement("div",{style:u.pointer},this.props.pointer?O.createElement(this.props.pointer,this.props):O.createElement("div",{style:u.circle}))))}}]),e}(h.PureComponent||h.Component);function X$(t,e){for(var n=-1,r=t==null?0:t.length;++n=0,i=!n&&o&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return i?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return Ne(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(vN,arguments)},brighten:function(){return this._applyModification(yN,arguments)},darken:function(){return this._applyModification(bN,arguments)},desaturate:function(){return this._applyModification(hN,arguments)},saturate:function(){return this._applyModification(mN,arguments)},greyscale:function(){return this._applyModification(gN,arguments)},spin:function(){return this._applyModification(xN,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(SN,arguments)},complement:function(){return this._applyCombination(wN,arguments)},monochromatic:function(){return this._applyCombination(kN,arguments)},splitcomplement:function(){return this._applyCombination(CN,arguments)},triad:function(){return this._applyCombination(gv,[3])},tetrad:function(){return this._applyCombination(gv,[4])}};Ne.fromRatio=function(t,e){if(rc(t)=="object"){var n={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?n[r]=t[r]:n[r]=Ns(t[r]));t=n}return Ne(t,e)};function cN(t){var e={r:0,g:0,b:0},n=1,r=null,o=null,i=null,s=!1,a=!1;return typeof t=="string"&&(t=LN(t)),rc(t)=="object"&&(_r(t.r)&&_r(t.g)&&_r(t.b)?(e=uN(t.r,t.g,t.b),s=!0,a=String(t.r).substr(-1)==="%"?"prgb":"rgb"):_r(t.h)&&_r(t.s)&&_r(t.v)?(r=Ns(t.s),o=Ns(t.v),e=pN(t.h,r,o),s=!0,a="hsv"):_r(t.h)&&_r(t.s)&&_r(t.l)&&(r=Ns(t.s),i=Ns(t.l),e=dN(t.h,r,i),s=!0,a="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=m1(n),{ok:s,format:t.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function uN(t,e,n){return{r:Et(t,255)*255,g:Et(e,255)*255,b:Et(n,255)*255}}function pv(t,e,n){t=Et(t,255),e=Et(e,255),n=Et(n,255);var r=Math.max(t,e,n),o=Math.min(t,e,n),i,s,a=(r+o)/2;if(r==o)i=s=0;else{var l=r-o;switch(s=a>.5?l/(2-r-o):l/(r+o),r){case t:i=(e-n)/l+(e1&&(d-=1),d<1/6?c+(u-c)*6*d:d<1/2?u:d<2/3?c+(u-c)*(2/3-d)*6:c}if(e===0)r=o=i=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;r=s(l,a,t+1/3),o=s(l,a,t),i=s(l,a,t-1/3)}return{r:r*255,g:o*255,b:i*255}}function fv(t,e,n){t=Et(t,255),e=Et(e,255),n=Et(n,255);var r=Math.max(t,e,n),o=Math.min(t,e,n),i,s,a=r,l=r-o;if(s=r===0?0:l/r,r==o)i=0;else{switch(r){case t:i=(e-n)/l+(e>1)+720)%360;--e;)r.h=(r.h+o)%360,i.push(Ne(r));return i}function kN(t,e){e=e||6;for(var n=Ne(t).toHsv(),r=n.h,o=n.s,i=n.v,s=[],a=1/e;e--;)s.push(Ne({h:r,s:o,v:i})),i=(i+a)%1;return s}Ne.mix=function(t,e,n){n=n===0?0:n||50;var r=Ne(t).toRgb(),o=Ne(e).toRgb(),i=n/100,s={r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a};return Ne(s)};Ne.readability=function(t,e){var n=Ne(t),r=Ne(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};Ne.isReadable=function(t,e,n){var r=Ne.readability(t,e),o,i;switch(i=!1,o=AN(n),o.level+o.size){case"AAsmall":case"AAAlarge":i=r>=4.5;break;case"AAlarge":i=r>=3;break;case"AAAsmall":i=r>=7;break}return i};Ne.mostReadable=function(t,e,n){var r=null,o=0,i,s,a,l;n=n||{},s=n.includeFallbackColors,a=n.level,l=n.size;for(var c=0;co&&(o=i,r=Ne(e[c]));return Ne.isReadable(t,r,{level:a,size:l})||!s?r:(n.includeFallbackColors=!1,Ne.mostReadable(t,["#fff","#000"],n))};var wp=Ne.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},MN=Ne.hexNames=EN(wp);function EN(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function m1(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Et(t,e){TN(t)&&(t="100%");var n=ON(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function wu(t){return Math.min(1,Math.max(0,t))}function jn(t){return parseInt(t,16)}function TN(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function ON(t){return typeof t=="string"&&t.indexOf("%")!=-1}function gr(t){return t.length==1?"0"+t:""+t}function Ns(t){return t<=1&&(t=t*100+"%"),t}function g1(t){return Math.round(parseFloat(t)*255).toString(16)}function vv(t){return jn(t)/255}var dr=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function _r(t){return!!dr.CSS_UNIT.exec(t)}function LN(t){t=t.replace(aN,"").replace(lN,"").toLowerCase();var e=!1;if(wp[t])t=wp[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=dr.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=dr.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=dr.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=dr.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=dr.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=dr.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=dr.hex8.exec(t))?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),a:vv(n[4]),format:e?"name":"hex8"}:(n=dr.hex6.exec(t))?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),format:e?"name":"hex"}:(n=dr.hex4.exec(t))?{r:jn(n[1]+""+n[1]),g:jn(n[2]+""+n[2]),b:jn(n[3]+""+n[3]),a:vv(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=dr.hex3.exec(t))?{r:jn(n[1]+""+n[1]),g:jn(n[2]+""+n[2]),b:jn(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function AN(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}var yv=function(e){var n=["r","g","b","a","h","s","l","v"],r=0,o=0;return sN(n,function(i){if(e[i]&&(r+=1,isNaN(e[i])||(o+=1),i==="s"||i==="l")){var s=/^\d+%$/;s.test(e[i])&&(o+=1)}}),r===o?e:!1},_s=function(e,n){var r=e.hex?Ne(e.hex):Ne(e),o=r.toHsl(),i=r.toHsv(),s=r.toRgb(),a=r.toHex();o.s===0&&(o.h=n||0,i.h=n||0);var l=a==="000000"&&s.a===0;return{hsl:o,hex:l?"transparent":"#"+a,rgb:s,hsv:i,oldHue:e.h||n||o.h,source:e.source}},To=function(e){if(e==="transparent")return!0;var n=String(e).charAt(0)==="#"?1:0;return e.length!==4+n&&e.length<7+n&&Ne(e).isValid()},ch=function(e){if(!e)return"#fff";var n=_s(e);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},sd=function(e,n){var r=e.replace("°","");return Ne(n+" ("+r+")")._ok},ks=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){FN(o,r);function o(){var i,s,a,l;_N(this,o);for(var c=arguments.length,u=Array(c),d=0;da))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var d=-1,p=!0,f=n&JN?new oc:void 0;for(i.set(t,e),i.set(e,t);++d=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var ul=24,p3=E1.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,o=r===void 0?ul:r,i=t.height,s=i===void 0?ul:i,a=t.style,l=a===void 0?{}:a,c=d3(t,["fill","width","height","style"]);return Nv.default.createElement("svg",$v({viewBox:"0 0 "+ul+" "+ul,style:$v({fill:n,width:o,height:s},l)},c),Nv.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},f3=function(){function t(e,n){for(var r=0;r1&&(o.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(o.a*100)/100,source:"rgb"},i)):(o.h||o.s||o.l)&&(typeof o.s=="string"&&o.s.includes("%")&&(o.s=o.s.replace("%","")),typeof o.l=="string"&&o.l.includes("%")&&(o.l=o.l.replace("%","")),o.s==1?o.s=.01:o.l==1&&(o.l=.01),r.props.onChange({h:o.h||r.props.hsl.h,s:Number(Iv(o.s)?r.props.hsl.s:o.s),l:Number(Iv(o.l)?r.props.hsl.l:o.l),source:"hsl"},i))},r.showHighlight=function(o){o.currentTarget.style.background="#eee"},r.hideHighlight=function(o){o.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?r.state={view:"rgb"}:r.state={view:n.view},r}return f3(e,[{key:"render",value:function(){var r=this,o=We({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),i=void 0;return this.state.view==="hex"?i=O.createElement("div",{style:o.fields,className:"flexbox-fix"},O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=O.createElement("div",{style:o.fields,className:"flexbox-fix"},O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),O.createElement("div",{style:o.alpha},O.createElement(nt,{style:{input:o.input,label:o.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(i=O.createElement("div",{style:o.fields,className:"flexbox-fix"},O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),O.createElement("div",{style:o.alpha},O.createElement(nt,{style:{input:o.input,label:o.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),O.createElement("div",{style:o.wrap,className:"flexbox-fix"},i,O.createElement("div",{style:o.toggle},O.createElement("div",{style:o.icon,onClick:this.toggleViews,ref:function(a){return r.icon=a}},O.createElement(p3,{style:o.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,o){return r.hsl.a!==1&&o.view==="hex"?{view:"rgb"}:null}}]),e}(O.Component);T1.defaultProps={view:"hex"};var _v=function(){var e=We({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return O.createElement("div",{style:e.picker})},v3=function(){var e=We({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return O.createElement("div",{style:e.picker})},mh=function(e){var n=e.width,r=e.onChange,o=e.disableAlpha,i=e.rgb,s=e.hsl,a=e.hsv,l=e.hex,c=e.renderers,u=e.styles,d=u===void 0?{}:u,p=e.className,f=p===void 0?"":p,m=e.defaultView,g=We(Rn({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+i.r+", "+i.g+", "+i.b+", "+i.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},d),{disableAlpha:o});return O.createElement("div",{style:g.picker,className:"chrome-picker "+f},O.createElement("div",{style:g.saturation},O.createElement(xu,{style:g.Saturation,hsl:s,hsv:a,pointer:v3,onChange:r})),O.createElement("div",{style:g.body},O.createElement("div",{style:g.controls,className:"flexbox-fix"},O.createElement("div",{style:g.color},O.createElement("div",{style:g.swatch},O.createElement("div",{style:g.active}),O.createElement(vs,{renderers:c}))),O.createElement("div",{style:g.toggles},O.createElement("div",{style:g.hue},O.createElement(ys,{style:g.Hue,hsl:s,pointer:_v,onChange:r})),O.createElement("div",{style:g.alpha},O.createElement(th,{style:g.Alpha,rgb:i,hsl:s,pointer:_v,renderers:c,onChange:r})))),O.createElement(T1,{rgb:i,hsl:s,hex:l,view:m,onChange:r,disableAlpha:o})))};mh.propTypes={width:Se.oneOfType([Se.string,Se.number]),disableAlpha:Se.bool,styles:Se.object,defaultView:Se.oneOf(["hex","rgb","hsl"])};mh.defaultProps={width:225,disableAlpha:!1,styles:{}};Dn(mh);var y3=function(e){var n=e.color,r=e.onClick,o=r===void 0?function(){}:r,i=e.onSwatchHover,s=e.active,a=We({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:ch(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:s,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return O.createElement(di,{style:a.color,color:n,onClick:o,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},O.createElement("div",{style:a.dot}))},b3=function(e){var n=e.hex,r=e.rgb,o=e.onChange,i=We({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),s=function(l,c){l.r||l.g||l.b?o({r:l.r||r.r,g:l.g||r.g,b:l.b||r.b,source:"rgb"},c):o({hex:l.hex,source:"hex"},c)};return O.createElement("div",{style:i.fields,className:"flexbox-fix"},O.createElement("div",{style:i.active}),O.createElement(nt,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:n,onChange:s}),O.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:r.r,onChange:s}),O.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:r.g,onChange:s}),O.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:r.b,onChange:s}))},gh=function(e){var n=e.onChange,r=e.onSwatchHover,o=e.colors,i=e.hex,s=e.rgb,a=e.styles,l=a===void 0?{}:a,c=e.className,u=c===void 0?"":c,d=We(Rn({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},l)),p=function(m,g){m.hex?To(m.hex)&&n({hex:m.hex,source:"hex"},g):n(m,g)};return O.createElement(Ha,{style:d.Compact,styles:l},O.createElement("div",{style:d.compact,className:"compact-picker "+u},O.createElement("div",null,pi(o,function(f){return O.createElement(y3,{key:f,color:f,active:f.toLowerCase()===i,onClick:p,onSwatchHover:r})}),O.createElement("div",{style:d.clear})),O.createElement(b3,{hex:i,rgb:s,onChange:p})))};gh.propTypes={colors:Se.arrayOf(Se.string),styles:Se.object};gh.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};Dn(gh);var x3=function(e){var n=e.hover,r=e.color,o=e.onClick,i=e.onSwatchHover,s={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},a=We({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:s}},{hover:n});return O.createElement("div",{style:a.swatch},O.createElement(di,{color:r,onClick:o,onHover:i,focusStyle:s}))};const w3=eh(x3);var vh=function(e){var n=e.width,r=e.colors,o=e.onChange,i=e.onSwatchHover,s=e.triangle,a=e.styles,l=a===void 0?{}:a,c=e.className,u=c===void 0?"":c,d=We(Rn({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},l),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right","bottom-left-triangle":s==="bottom-left","bottom-right-triangle":s==="bottom-right"}),p=function(m,g){return o({hex:m,source:"hex"},g)};return O.createElement("div",{style:d.card,className:"github-picker "+u},O.createElement("div",{style:d.triangleShadow}),O.createElement("div",{style:d.triangle}),pi(r,function(f){return O.createElement(w3,{color:f,key:f,onClick:p,onSwatchHover:i})}))};vh.propTypes={width:Se.oneOfType([Se.string,Se.number]),colors:Se.arrayOf(Se.string),triangle:Se.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:Se.object};vh.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};Dn(vh);var C3=function(e){var n=e.direction,r=We({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return O.createElement("div",{style:r.picker})},S3=Object.assign||function(t){for(var e=1;e.5});return O.createElement("div",{style:r.picker})},T3=function(){var e=We({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return O.createElement("div",{style:e.pointer},O.createElement("div",{style:e.left},O.createElement("div",{style:e.leftInside})),O.createElement("div",{style:e.right},O.createElement("div",{style:e.rightInside})))},Fv=function(e){var n=e.onClick,r=e.label,o=e.children,i=e.active,s=We({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:i});return O.createElement("div",{style:s.button,onClick:n},r||o)},O3=function(e){var n=e.rgb,r=e.currentColor,o=We({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return O.createElement("div",null,O.createElement("div",{style:o.label},"new"),O.createElement("div",{style:o.swatches},O.createElement("div",{style:o.new}),O.createElement("div",{style:o.current})),O.createElement("div",{style:o.label},"current"))},L3=function(){function t(e,n){for(var r=0;r100&&(u.a=100),u.a/=100,n({h:o.h,s:o.s,l:o.l,a:u.a,source:"rgb"},d))};return O.createElement("div",{style:a.fields,className:"flexbox-fix"},O.createElement("div",{style:a.double},O.createElement(nt,{style:{input:a.input,label:a.label},label:"hex",value:i.replace("#",""),onChange:l})),O.createElement("div",{style:a.single},O.createElement(nt,{style:{input:a.input,label:a.label},label:"r",value:r.r,onChange:l,dragLabel:"true",dragMax:"255"})),O.createElement("div",{style:a.single},O.createElement(nt,{style:{input:a.input,label:a.label},label:"g",value:r.g,onChange:l,dragLabel:"true",dragMax:"255"})),O.createElement("div",{style:a.single},O.createElement(nt,{style:{input:a.input,label:a.label},label:"b",value:r.b,onChange:l,dragLabel:"true",dragMax:"255"})),O.createElement("div",{style:a.alpha},O.createElement(nt,{style:{input:a.input,label:a.label},label:"a",value:Math.round(r.a*100),onChange:l,dragLabel:"true",dragMax:"100"})))},I3=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var dl=24,H3=L1.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,o=r===void 0?dl:r,i=t.height,s=i===void 0?dl:i,a=t.style,l=a===void 0?{}:a,c=z3(t,["fill","width","height","style"]);return jv.default.createElement("svg",Bv({viewBox:"0 0 "+dl+" "+dl,style:Bv({fill:n,width:o,height:s},l)},c),jv.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},V3=function(e){var n=e.color,r=e.onClick,o=r===void 0?function(){}:r,i=e.onSwatchHover,s=e.first,a=e.last,l=e.active,c=We({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:ch(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:s,last:a,active:l,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return O.createElement(di,{color:n,style:c.color,onClick:o,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},O.createElement("div",{style:c.check},O.createElement(H3,null)))},W3=function(e){var n=e.onClick,r=e.onSwatchHover,o=e.group,i=e.active,s=We({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return O.createElement("div",{style:s.group},pi(o,function(a,l){return O.createElement(V3,{key:a,color:a,active:a.toLowerCase()===i,first:l===0,last:l===o.length-1,onClick:n,onSwatchHover:r})}))},Ch=function(e){var n=e.width,r=e.height,o=e.onChange,i=e.onSwatchHover,s=e.colors,a=e.hex,l=e.styles,c=l===void 0?{}:l,u=e.className,d=u===void 0?"":u,p=We(Rn({default:{picker:{width:n,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},c)),f=function(g,y){return o({hex:g,source:"hex"},y)};return O.createElement("div",{style:p.picker,className:"swatches-picker "+d},O.createElement(Ha,null,O.createElement("div",{style:p.overflow},O.createElement("div",{style:p.body},pi(s,function(m){return O.createElement(W3,{key:m.toString(),group:m,active:a,onClick:f,onSwatchHover:i})}),O.createElement("div",{style:p.clear})))))};Ch.propTypes={width:Se.oneOfType([Se.string,Se.number]),height:Se.oneOfType([Se.string,Se.number]),colors:Se.arrayOf(Se.arrayOf(Se.string)),styles:Se.object};Ch.defaultProps={width:320,height:240,colors:[[Ei[900],Ei[700],Ei[500],Ei[300],Ei[100]],[Ti[900],Ti[700],Ti[500],Ti[300],Ti[100]],[Oi[900],Oi[700],Oi[500],Oi[300],Oi[100]],[Li[900],Li[700],Li[500],Li[300],Li[100]],[Ai[900],Ai[700],Ai[500],Ai[300],Ai[100]],[Pi[900],Pi[700],Pi[500],Pi[300],Pi[100]],[Ri[900],Ri[700],Ri[500],Ri[300],Ri[100]],[Di[900],Di[700],Di[500],Di[300],Di[100]],[Ii[900],Ii[700],Ii[500],Ii[300],Ii[100]],["#194D33",Fs[700],Fs[500],Fs[300],Fs[100]],[$i[900],$i[700],$i[500],$i[300],$i[100]],[Ni[900],Ni[700],Ni[500],Ni[300],Ni[100]],[_i[900],_i[700],_i[500],_i[300],_i[100]],[Fi[900],Fi[700],Fi[500],Fi[300],Fi[100]],[Bi[900],Bi[700],Bi[500],Bi[300],Bi[100]],[ji[900],ji[700],ji[500],ji[300],ji[100]],[zi[900],zi[700],zi[500],zi[300],zi[100]],[Hi[900],Hi[700],Hi[500],Hi[300],Hi[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};Dn(Ch);var Sh=function(e){var n=e.onChange,r=e.onSwatchHover,o=e.hex,i=e.colors,s=e.width,a=e.triangle,l=e.styles,c=l===void 0?{}:l,u=e.className,d=u===void 0?"":u,p=We(Rn({default:{card:{width:s,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},c),{"hide-triangle":a==="hide","top-left-triangle":a==="top-left","top-right-triangle":a==="top-right"}),f=function(g,y){To(g)&&n({hex:g,source:"hex"},y)};return O.createElement("div",{style:p.card,className:"twitter-picker "+d},O.createElement("div",{style:p.triangleShadow}),O.createElement("div",{style:p.triangle}),O.createElement("div",{style:p.body},pi(i,function(m,g){return O.createElement(di,{key:g,color:m,hex:m,style:p.swatch,onClick:f,onHover:r,focusStyle:{boxShadow:"0 0 4px "+m}})}),O.createElement("div",{style:p.hash},"#"),O.createElement(nt,{label:null,style:{input:p.input},value:o.replace("#",""),onChange:f}),O.createElement("div",{style:p.clear})))};Sh.propTypes={width:Se.oneOfType([Se.string,Se.number]),triangle:Se.oneOf(["hide","top-left","top-right"]),colors:Se.arrayOf(Se.string),styles:Se.object};Sh.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};Dn(Sh);var kh=function(e){var n=We({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(e.hsl.h)+", "+Math.round(e.hsl.s*100)+"%, "+Math.round(e.hsl.l*100)+"%)"}}});return O.createElement("div",{style:n.picker})};kh.propTypes={hsl:Se.shape({h:Se.number,s:Se.number,l:Se.number,a:Se.number})};kh.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var Mh=function(e){var n=We({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(e.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return O.createElement("div",{style:n.picker})};Mh.propTypes={hsl:Se.shape({h:Se.number,s:Se.number,l:Se.number,a:Se.number})};Mh.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var U3=function(e){var n=e.onChange,r=e.rgb,o=e.hsl,i=e.hex,s=e.hsv,a=function(f,m){if(f.hex)To(f.hex)&&n({hex:f.hex,source:"hex"},m);else if(f.rgb){var g=f.rgb.split(",");sd(f.rgb,"rgb")&&n({r:g[0],g:g[1],b:g[2],a:1,source:"rgb"},m)}else if(f.hsv){var y=f.hsv.split(",");sd(f.hsv,"hsv")&&(y[2]=y[2].replace("%",""),y[1]=y[1].replace("%",""),y[0]=y[0].replace("°",""),y[1]==1?y[1]=.01:y[2]==1&&(y[2]=.01),n({h:Number(y[0]),s:Number(y[1]),v:Number(y[2]),source:"hsv"},m))}else if(f.hsl){var b=f.hsl.split(",");sd(f.hsl,"hsl")&&(b[2]=b[2].replace("%",""),b[1]=b[1].replace("%",""),b[0]=b[0].replace("°",""),d[1]==1?d[1]=.01:d[2]==1&&(d[2]=.01),n({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsl"},m))}},l=We({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),c=r.r+", "+r.g+", "+r.b,u=Math.round(o.h)+"°, "+Math.round(o.s*100)+"%, "+Math.round(o.l*100)+"%",d=Math.round(s.h)+"°, "+Math.round(s.s*100)+"%, "+Math.round(s.v*100)+"%";return O.createElement("div",{style:l.wrap,className:"flexbox-fix"},O.createElement("div",{style:l.fields},O.createElement("div",{style:l.double},O.createElement(nt,{style:{input:l.input,label:l.label},label:"hex",value:i,onChange:a})),O.createElement("div",{style:l.column},O.createElement("div",{style:l.single},O.createElement(nt,{style:{input:l.input2,label:l.label2},label:"rgb",value:c,onChange:a})),O.createElement("div",{style:l.single},O.createElement(nt,{style:{input:l.input2,label:l.label2},label:"hsv",value:d,onChange:a})),O.createElement("div",{style:l.single},O.createElement(nt,{style:{input:l.input2,label:l.label2},label:"hsl",value:u,onChange:a})))))},Eh=function(e){var n=e.width,r=e.onChange,o=e.rgb,i=e.hsl,s=e.hsv,a=e.hex,l=e.header,c=e.styles,u=c===void 0?{}:c,d=e.className,p=d===void 0?"":d,f=We(Rn({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+o.r+", "+o.g+", "+o.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},u));return O.createElement("div",{style:f.picker,className:"google-picker "+p},O.createElement("div",{style:f.head},l),O.createElement("div",{style:f.swatch}),O.createElement("div",{style:f.saturation},O.createElement(xu,{hsl:i,hsv:s,pointer:kh,onChange:r})),O.createElement("div",{style:f.body},O.createElement("div",{style:f.controls,className:"flexbox-fix"},O.createElement("div",{style:f.hue},O.createElement(ys,{style:f.Hue,hsl:i,radius:"4px",pointer:Mh,onChange:r}))),O.createElement(U3,{rgb:o,hsl:i,hex:a,hsv:s,onChange:r})))};Eh.propTypes={width:Se.oneOfType([Se.string,Se.number]),styles:Se.object,header:Se.string};Eh.defaultProps={width:652,styles:{},header:"Color picker"};Dn(Eh);const G3=t=>{let e=t.r.toString(16),n=t.g.toString(16),r=t.b.toString(16),o=Math.round(t.a*255).toString(16);return e.length===1&&(e="0"+e),n.length===1&&(n="0"+n),r.length===1&&(r="0"+r),o.length===1&&(o="0"+o),"#"+e+n+r+o},q3=t=>{const[e,n]=h.useState(null),{fieldDef:r,value:o,onChange:i,onBlur:s,disabled:a,skeleton:l,id:c}=t,[u,d]=h.useState(!1),[p,f]=h.useState(null),m=x=>{d(!u),n(x.currentTarget)},g=()=>{d(!1),n(null),s()},y=x=>{f(x),i(G3(x.rgb))},b=open?`${r.name}-popover`:void 0;return l?v.jsx(Xe,{variant:"rectangular",width:102,height:52}):v.jsxs(v.Fragment,{children:[v.jsx(qE,{disabled:a,color:(p==null?void 0:p.rgb)||o||{r:0,g:141,b:168,a:1},onClick:m,id:c}),!a&&v.jsx(KE,{id:b,open:u,anchorEl:e,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:v.jsx(N3,{color:o||_.newColors.realTeal[100],onChange:y})})]})},K3=h.memo(q3);function Ep(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function Y3(t,e){_e(2,arguments);var n=Lt(e);return Ff(t,n*1e3)}var J3=6e4;function Z3(t,e){_e(2,arguments);var n=Lt(e);return Ff(t,n*J3)}var X3=36e5;function Q3(t,e){_e(2,arguments);var n=Lt(e);return Ff(t,n*X3)}function eF(t,e){_e(2,arguments);var n=Lt(e),r=n*7;return Ep(t,r)}function Il(t,e){_e(2,arguments);var n=De(t),r=Lt(e);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());i.setMonth(n.getMonth()+r+1,0);var s=i.getDate();return o>=s?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}function zv(t,e){_e(2,arguments);var n=Lt(e);return Il(t,n*12)}function tF(t,e){_e(2,arguments);var n=De(t),r=De(e);return n.getFullYear()-r.getFullYear()}function ta(t,e){_e(2,arguments);var n=De(t),r=De(e),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function nF(t,e){_e(2,arguments);var n=De(t),r=De(e),o=ta(n,r),i=Math.abs(tF(n,r));n.setFullYear(1584),r.setFullYear(1584);var s=ta(n,r)===-o,a=o*(i-Number(s));return a===0?0:a}function rF(t,e){_e(2,arguments);var n=De(t),r=De(e),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function Tp(t){_e(1,arguments);var e=De(t);return e.setHours(23,59,59,999),e}function Op(t){_e(1,arguments);var e=De(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function oF(t){_e(1,arguments);var e=De(t);return Tp(e).getTime()===Op(e).getTime()}function A1(t,e){_e(2,arguments);var n=De(t),r=De(e),o=ta(n,r),i=Math.abs(rF(n,r)),s;if(i<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-o*i);var a=ta(n,r)===-o;oF(De(t))&&i===1&&ta(t,r)===1&&(a=!1),s=o*(i-Number(a))}return s===0?0:s}var Hv={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},iF="trunc";function Va(t){return t?Hv[t]:Hv[iF]}function sF(t,e,n){_e(2,arguments);var r=A1(t,e)/3;return Va(void 0)(r)}var aF=864e5;function lF(t,e){_e(2,arguments);var n=is(t),r=is(e),o=n.getTime()-hp(n),i=r.getTime()-hp(r);return Math.round((o-i)/aF)}function Vv(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function P1(t,e){_e(2,arguments);var n=De(t),r=De(e),o=Vv(n,r),i=Math.abs(lF(n,r));n.setDate(n.getDate()-o*i);var s=+(Vv(n,r)===-o),a=o*(i-s);return a===0?0:a}function cF(t,e,n){_e(2,arguments);var r=P1(t,e)/7;return Va(void 0)(r)}var Su=6e4,ku=36e5,uF=1e3;function Mu(t,e){return _e(2,arguments),De(t).getTime()-De(e).getTime()}function dF(t,e,n){_e(2,arguments);var r=Mu(t,e)/ku;return Va(void 0)(r)}function pF(t,e,n){_e(2,arguments);var r=Mu(t,e)/Su;return Va(void 0)(r)}function fF(t,e,n){_e(2,arguments);var r=Mu(t,e)/1e3;return Va(void 0)(r)}function hF(t,e){var n;_e(1,arguments);var r=t||{},o=De(r.start),i=De(r.end),s=i.getTime();if(!(o.getTime()<=s))throw new RangeError("Invalid interval");var a=[],l=o;l.setHours(0,0,0,0);var c=Number((n=void 0)!==null&&n!==void 0?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;l.getTime()<=s;)a.push(De(l)),l.setDate(l.getDate()+c),l.setHours(0,0,0,0);return a}function ld(t,e){var n,r,o,i,s,a,l,c;_e(1,arguments);var u=du(),d=Lt((n=(r=(o=(i=e==null?void 0:e.weekStartsOn)!==null&&i!==void 0?i:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&o!==void 0?o:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=De(t),f=p.getDay(),m=(fr.getTime()}function xi(t,e){_e(2,arguments);var n=De(t),r=De(e);return n.getTime()=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return s=c.done,c},e:function(c){a=!0,i=c},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw i}}}}function EF(t,e){if(t==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function D1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(D1=function(){return!!t})()}function at(t){var e=D1();return function(){var n,r=Lg(t);if(e){var o=Lg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return dT(this,n)}}var TF=10,I1=function(){function t(){rt(this,t),Le(this,"priority",void 0),Le(this,"subPriority",0)}return ot(t,[{key:"validate",value:function(n,r){return!0}}]),t}(),OF=function(t){st(n,t);var e=at(n);function n(r,o,i,s,a){var l;return rt(this,n),l=e.call(this),l.value=r,l.validateValue=o,l.setValue=i,l.priority=s,a&&(l.subPriority=a),l}return ot(n,[{key:"validate",value:function(o,i){return this.validateValue(o,this.value,i)}},{key:"set",value:function(o,i,s){return this.setValue(o,i,this.value,s)}}]),n}(I1),LF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s0,r=n?e:1-e,o;if(r<=50)o=t||100;else{var i=r+50,s=Math.floor(i/100)*100,a=t>=i%100;o=t+s-(a?100:0)}return n?o:1-o}function _1(t){return t%400===0||t%4===0&&t%100!==0}var PF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s0}},{key:"set",value:function(o,i,s){var a=o.getUTCFullYear();if(s.isTwoDigitYear){var l=N1(s.year,a);return o.setUTCFullYear(l,0,1),o.setUTCHours(0,0,0,0),o}var c=!("era"in i)||i.era===1?s.year:1-s.year;return o.setUTCFullYear(c,0,1),o.setUTCHours(0,0,0,0),o}}]),n}(dt),RF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s0}},{key:"set",value:function(o,i,s,a){var l=YE(o,a);if(s.isTwoDigitYear){var c=N1(s.year,l);return o.setUTCFullYear(c,0,a.firstWeekContainsDate),o.setUTCHours(0,0,0,0),mp(o,a)}var u=!("era"in i)||i.era===1?s.year:1-s.year;return o.setUTCFullYear(u,0,a.firstWeekContainsDate),o.setUTCHours(0,0,0,0),mp(o,a)}}]),n}(dt),DF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=4}},{key:"set",value:function(o,i,s){return o.setUTCMonth((s-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),n}(dt),NF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=4}},{key:"set",value:function(o,i,s){return o.setUTCMonth((s-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),n}(dt),_F=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=11}},{key:"set",value:function(o,i,s){return o.setUTCMonth(s,1),o.setUTCHours(0,0,0,0),o}}]),n}(dt),FF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=11}},{key:"set",value:function(o,i,s){return o.setUTCMonth(s,1),o.setUTCHours(0,0,0,0),o}}]),n}(dt);function BF(t,e,n){_e(2,arguments);var r=De(t),o=Lt(e),i=JE(r,n)-o;return r.setUTCDate(r.getUTCDate()-i*7),r}var jF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=53}},{key:"set",value:function(o,i,s,a){return mp(BF(o,s,a),a)}}]),n}(dt);function zF(t,e){_e(2,arguments);var n=De(t),r=Lt(e),o=ZE(n)-r;return n.setUTCDate(n.getUTCDate()-o*7),n}var HF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=53}},{key:"set",value:function(o,i,s){return Lx(zF(o,s))}}]),n}(dt),VF=[31,28,31,30,31,30,31,31,30,31,30,31],WF=[31,29,31,30,31,30,31,31,30,31,30,31],UF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=WF[l]:i>=1&&i<=VF[l]}},{key:"set",value:function(o,i,s){return o.setUTCDate(s),o.setUTCHours(0,0,0,0),o}}]),n}(dt),GF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=366:i>=1&&i<=365}},{key:"set",value:function(o,i,s){return o.setUTCMonth(0,s),o.setUTCHours(0,0,0,0),o}}]),n}(dt);function Oh(t,e,n){var r,o,i,s,a,l,c,u;_e(2,arguments);var d=du(),p=Lt((r=(o=(i=(s=n==null?void 0:n.weekStartsOn)!==null&&s!==void 0?s:n==null||(a=n.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&i!==void 0?i:d.weekStartsOn)!==null&&o!==void 0?o:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=De(t),m=Lt(e),g=f.getUTCDay(),y=m%7,b=(y+7)%7,x=(b=0&&i<=6}},{key:"set",value:function(o,i,s,a){return o=Oh(o,s,a),o.setUTCHours(0,0,0,0),o}}]),n}(dt),KF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=6}},{key:"set",value:function(o,i,s,a){return o=Oh(o,s,a),o.setUTCHours(0,0,0,0),o}}]),n}(dt),YF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=6}},{key:"set",value:function(o,i,s,a){return o=Oh(o,s,a),o.setUTCHours(0,0,0,0),o}}]),n}(dt);function JF(t,e){_e(2,arguments);var n=Lt(e);n%7===0&&(n=n-7);var r=1,o=De(t),i=o.getUTCDay(),s=n%7,a=(s+7)%7,l=(a=1&&i<=7}},{key:"set",value:function(o,i,s){return o=JF(o,s),o.setUTCHours(0,0,0,0),o}}]),n}(dt),XF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=12}},{key:"set",value:function(o,i,s){var a=o.getUTCHours()>=12;return a&&s<12?o.setUTCHours(s+12,0,0,0):!a&&s===12?o.setUTCHours(0,0,0,0):o.setUTCHours(s,0,0,0),o}}]),n}(dt),nB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=23}},{key:"set",value:function(o,i,s){return o.setUTCHours(s,0,0,0),o}}]),n}(dt),rB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=11}},{key:"set",value:function(o,i,s){var a=o.getUTCHours()>=12;return a&&s<12?o.setUTCHours(s+12,0,0,0):o.setUTCHours(s,0,0,0),o}}]),n}(dt),oB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=24}},{key:"set",value:function(o,i,s){var a=s<=24?s%24:s;return o.setUTCHours(a,0,0,0),o}}]),n}(dt),iB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=59}},{key:"set",value:function(o,i,s){return o.setUTCMinutes(s,0,0),o}}]),n}(dt),sB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=59}},{key:"set",value:function(o,i,s){return o.setUTCSeconds(s,0),o}}]),n}(dt),aB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&P<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var U=Lt((m=(g=(y=(b=r==null?void 0:r.weekStartsOn)!==null&&b!==void 0?b:r==null||(x=r.locale)===null||x===void 0||(S=x.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&y!==void 0?y:T.weekStartsOn)!==null&&g!==void 0?g:(E=T.locale)===null||E===void 0||(k=E.options)===null||k===void 0?void 0:k.weekStartsOn)!==null&&m!==void 0?m:0);if(!(U>=0&&U<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(M==="")return w===""?De(n):new Date(NaN);var N={firstWeekContainsDate:P,weekStartsOn:U,locale:D},K=[new LF],R=M.match(hB).map(function(H){var V=H[0];if(V in Tg){var fe=Tg[V];return fe(H,D.formatLong)}return H}).join("").match(fB),B=[],z=Uv(R),I;try{var oe=function(){var V=I.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&XE(V)&&Og(V,M,t),!(r!=null&&r.useAdditionalDayOfYearTokens)&&QE(V)&&Og(V,M,t);var fe=V[0],pe=pB[fe];if(pe){var he=pe.incompatibleTokens;if(Array.isArray(he)){var ke=B.find(function($){return he.includes($.token)||$.token===fe});if(ke)throw new RangeError("The format string mustn't contain `".concat(ke.fullToken,"` and `").concat(V,"` at the same time"))}else if(pe.incompatibleTokens==="*"&&B.length>0)throw new RangeError("The format string mustn't contain `".concat(V,"` and any other token at the same time"));B.push({token:fe,fullToken:V});var Te=pe.run(w,V,D.match,N);if(!Te)return{v:new Date(NaN)};K.push(Te.setter),w=Te.rest}else{if(fe.match(yB))throw new RangeError("Format string contains an unescaped latin alphabet character `"+fe+"`");if(V==="''"?V="'":fe==="'"&&(V=bB(V)),w.indexOf(V)===0)w=w.slice(V.length);else return{v:new Date(NaN)}}};for(z.s();!(I=z.n()).done;){var me=oe();if(pT(me)==="object")return me.v}}catch(H){z.e(H)}finally{z.f()}if(w.length>0&&vB.test(w))return new Date(NaN);var te=K.map(function(H){return H.priority}).sort(function(H,V){return V-H}).filter(function(H,V,fe){return fe.indexOf(H)===V}).map(function(H){return K.filter(function(V){return V.priority===H}).sort(function(V,fe){return fe.subPriority-V.subPriority})}).map(function(H){return H[0]}),G=De(n);if(isNaN(G.getTime()))return new Date(NaN);var X=eT(G,hp(G)),ie={},Y=Uv(te),C;try{for(Y.s();!(C=Y.n()).done;){var A=C.value;if(!A.validate(X,N))return new Date(NaN);var j=A.set(X,ie,N);Array.isArray(j)?(X=j[0],EF(ie,j[1])):X=j}}catch(H){Y.e(H)}finally{Y.f()}return X}function bB(t){return t.match(mB)[1].replace(gB,"'")}function xB(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return n.setDate(r),n}function wB(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return n.setHours(r),n}function CB(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return n.setMinutes(r),n}function SB(t,e){_e(2,arguments);var n=De(t),r=Lt(e),o=n.getFullYear(),i=n.getDate(),s=new Date(0);s.setFullYear(o,r,15),s.setHours(0,0,0,0);var a=R1(s);return n.setMonth(r,Math.min(i,a)),n}function kB(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return n.setSeconds(r),n}function MB(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function fl(t){_e(1,arguments);var e=De(t);return e.setDate(1),e.setHours(0,0,0,0),e}function ud(t,e){var n,r,o,i,s,a,l,c;_e(1,arguments);var u=du(),d=Lt((n=(r=(o=(i=e==null?void 0:e.weekStartsOn)!==null&&i!==void 0?i:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&o!==void 0?o:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=De(t),f=p.getDay(),m=(f2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],ml.timeZoneDelimiter.test(e.date)&&(e.date=t.split(ml.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var o=ml.timezone.exec(r);o?(e.time=r.replace(o[1],""),e.timezone=o[1]):e.time=r}return e}function PB(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};var o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?o:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function RB(t,e){if(e===null)return new Date(NaN);var n=t.match(TB);if(!n)return new Date(NaN);var r=!!n[4],o=Es(n[1]),i=Es(n[2])-1,s=Es(n[3]),a=Es(n[4]),l=Es(n[5])-1;if(r)return BB(e,a,l)?$B(e,a,l):new Date(NaN);var c=new Date(0);return!_B(e,i,s)||!FB(e,o)?new Date(NaN):(c.setUTCFullYear(e,i,Math.max(o,s)),c)}function Es(t){return t?parseInt(t):1}function DB(t){var e=t.match(OB);if(!e)return NaN;var n=dd(e[1]),r=dd(e[2]),o=dd(e[3]);return jB(n,r,o)?n*ku+r*Su+o*1e3:NaN}function dd(t){return t&&parseFloat(t.replace(",","."))||0}function IB(t){if(t==="Z")return 0;var e=t.match(LB);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),o=e[3]&&parseInt(e[3])||0;return zB(r,o)?n*(r*ku+o*Su):NaN}function $B(t,e,n){var r=new Date(0);r.setUTCFullYear(t,0,4);var o=r.getUTCDay()||7,i=(e-1)*7+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}var NB=[31,null,31,30,31,30,31,31,30,31,30,31];function B1(t){return t%400===0||t%4===0&&t%100!==0}function _B(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(NB[e]||(B1(t)?29:28))}function FB(t,e){return e>=1&&e<=(B1(t)?366:365)}function BB(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function jB(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function zB(t,e){return e>=0&&e<=59}function HB(t,e){var n,r;_e(1,arguments);var o=De(t);if(isNaN(o.getTime()))throw new RangeError("Invalid time value");var i=String((n=e==null?void 0:e.format)!==null&&n!==void 0?n:"extended"),s=String((r=e==null?void 0:e.representation)!==null&&r!==void 0?r:"complete");if(i!=="extended"&&i!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(s!=="date"&&s!=="time"&&s!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var a="",l="",c=i==="extended"?"-":"",u=i==="extended"?":":"";if(s!=="time"){var d=eo(o.getDate(),2),p=eo(o.getMonth()+1,2),f=eo(o.getFullYear(),4);a="".concat(f).concat(c).concat(p).concat(c).concat(d)}if(s!=="date"){var m=o.getTimezoneOffset();if(m!==0){var g=Math.abs(m),y=eo(Math.floor(g/60),2),b=eo(g%60,2),x=m<0?"+":"-";l="".concat(x).concat(y,":").concat(b)}else l="Z";var S=eo(o.getHours(),2),E=eo(o.getMinutes(),2),k=eo(o.getSeconds(),2),w=a===""?"":"T",M=[S,E,k].join(u);a="".concat(a).concat(w).concat(M).concat(l)}return a}function VB(t,e){_e(2,arguments);var n=De(t).getTime(),r=De(e.start).getTime(),o=De(e.end).getTime();if(!(r<=o))throw new RangeError("Invalid interval");return n>=r&&n<=o}var Lp={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},r=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},o=function(l,c){var u=l.match(/(P+)(p+)?/)||[],d=u[1],p=u[2];if(!p)return n(l,c);var f;switch(d){case"P":f=c.dateTime({width:"short"});break;case"PP":f=c.dateTime({width:"medium"});break;case"PPP":f=c.dateTime({width:"long"});break;case"PPPP":default:f=c.dateTime({width:"full"});break}return f.replace("{{date}}",n(d,c)).replace("{{time}}",r(p,c))},i={p:r,P:o},s=i;e.default=s,t.exports=e.default})(Lp,Lp.exports);var WB=Lp.exports;const UB=Aa(WB),GB={dayOfMonth:"d",fullDate:"PP",fullDateWithWeekday:"PPPP",fullDateTime:"PP p",fullDateTime12h:"PP hh:mm aaa",fullDateTime24h:"PP HH:mm",fullTime:"p",fullTime12h:"hh:mm aaa",fullTime24h:"HH:mm",hours12h:"hh",hours24h:"HH",keyboardDate:"P",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aaa",keyboardDateTime24h:"P HH:mm",minutes:"mm",month:"LLLL",monthAndDate:"MMMM d",monthAndYear:"LLLL yyyy",monthShort:"MMM",weekday:"EEEE",weekdayShort:"EEE",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",seconds:"ss",shortDate:"MMM d",year:"yyyy"};class j1{constructor({locale:e,formats:n}={}){this.lib="date-fns",this.is12HourCycleInCurrentLocale=()=>{var r;return this.locale?/a/.test((r=this.locale.formatLong)===null||r===void 0?void 0:r.time()):!0},this.getFormatHelperText=r=>{var o,i;const s=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,a=this.locale||Ax;return(i=(o=r.match(s))===null||o===void 0?void 0:o.map(l=>{const c=l[0];if(c==="p"||c==="P"){const u=UB[c];return u(l,a.formatLong,{})}return l}).join("").replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase())!==null&&i!==void 0?i:r},this.parseISO=r=>EB(r),this.toISO=r=>HB(r,{format:"extended"}),this.getCurrentLocaleCode=()=>{var r;return((r=this.locale)===null||r===void 0?void 0:r.code)||"en-US"},this.addSeconds=(r,o)=>Y3(r,o),this.addMinutes=(r,o)=>Z3(r,o),this.addHours=(r,o)=>Q3(r,o),this.addDays=(r,o)=>Ep(r,o),this.addWeeks=(r,o)=>eF(r,o),this.addMonths=(r,o)=>Il(r,o),this.addYears=(r,o)=>zv(r,o),this.isValid=r=>Px(this.date(r)),this.getDiff=(r,o,i)=>{var s;const a=(s=this.date(o))!==null&&s!==void 0?s:r;if(!this.isValid(a))return 0;switch(i){case"years":return nF(r,a);case"quarters":return sF(r,a);case"months":return A1(r,a);case"weeks":return cF(r,a);case"days":return P1(r,a);case"hours":return dF(r,a);case"minutes":return pF(r,a);case"seconds":return fF(r,a);default:return Mu(r,a)}},this.isAfter=(r,o)=>pl(r,o),this.isBefore=(r,o)=>xi(r,o),this.startOfDay=r=>is(r),this.endOfDay=r=>Tp(r),this.getHours=r=>vF(r),this.setHours=(r,o)=>wB(r,o),this.setMinutes=(r,o)=>CB(r,o),this.getSeconds=r=>xF(r),this.setSeconds=(r,o)=>kB(r,o),this.isSameDay=(r,o)=>UT(r,o),this.isSameMonth=(r,o)=>kF(r,o),this.isSameYear=(r,o)=>SF(r,o),this.isSameHour=(r,o)=>MF(r,o),this.startOfYear=r=>hl(r),this.endOfYear=r=>cd(r),this.startOfMonth=r=>fl(r),this.endOfMonth=r=>Op(r),this.startOfWeek=r=>ud(r,{locale:this.locale}),this.endOfWeek=r=>ld(r,{locale:this.locale}),this.getYear=r=>wF(r),this.setYear=(r,o)=>MB(r,o),this.date=r=>typeof r>"u"?new Date:r===null?null:new Date(r),this.toJsDate=r=>r,this.parse=(r,o)=>r===""?null:F1(r,o,new Date,{locale:this.locale}),this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>Ki(r,o,{locale:this.locale}),this.isEqual=(r,o)=>r===null&&o===null?!0:CF(r,o),this.isNull=r=>r===null,this.isAfterDay=(r,o)=>pl(r,Tp(o)),this.isBeforeDay=(r,o)=>xi(r,is(o)),this.isBeforeYear=(r,o)=>xi(r,hl(o)),this.isAfterYear=(r,o)=>pl(r,cd(o)),this.isWithinRange=(r,[o,i])=>VB(r,{start:o,end:i}),this.formatNumber=r=>r,this.getMinutes=r=>yF(r),this.getDate=r=>mF(r),this.setDate=(r,o)=>xB(r,o),this.getMonth=r=>bF(r),this.getDaysInMonth=r=>R1(r),this.setMonth=(r,o)=>SB(r,o),this.getMeridiemText=r=>r==="am"?"AM":"PM",this.getNextMonth=r=>Il(r,1),this.getPreviousMonth=r=>Il(r,-1),this.getMonthArray=r=>{const i=[hl(r)];for(;i.length<12;){const s=i[i.length-1];i.push(this.getNextMonth(s))}return i},this.mergeDateAndTime=(r,o)=>this.setSeconds(this.setMinutes(this.setHours(r,this.getHours(o)),this.getMinutes(o)),this.getSeconds(o)),this.getWeekdays=()=>{const r=new Date;return hF({start:ud(r,{locale:this.locale}),end:ld(r,{locale:this.locale})}).map(o=>this.formatByString(o,"EEEEEE"))},this.getWeekArray=r=>{const o=ud(fl(r),{locale:this.locale}),i=ld(Op(r),{locale:this.locale});let s=0,a=o;const l=[];let c=null;for(;xi(a,i);){const u=Math.floor(s/7);l[u]=l[u]||[];const d=gF(a);c!==d&&(c=d,l[u].push(a),s+=1),a=Ep(a,1)}return l},this.getYearRange=(r,o)=>{const i=hl(r),s=cd(o),a=[];let l=i;for(;xi(l,s);)a.push(l),l=zv(l,1);return a},this.locale=e,this.formats=Object.assign({},GB,n)}isBeforeMonth(e,n){return xi(e,fl(n))}isAfterMonth(e,n){return pl(e,fl(n))}}const qB=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:J({},t)}}}}),z1={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"open previous view",openNextView:"open next view",calendarViewSwitchingButtonAriaLabel:t=>t==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",clockLabelText:(t,e,n)=>`Select ${t}. ${e===null?"No time selected":`Selected time is ${n.format(e,"fullTime")}`}`,hoursClockNumberText:t=>`${t} hours`,minutesClockNumberText:t=>`${t} minutes`,secondsClockNumberText:t=>`${t} seconds`,openDatePickerDialogue:(t,e)=>t&&e.isValid(e.date(t))?`Choose date, selected date is ${e.format(e.date(t),"fullDate")}`:"Choose date",openTimePickerDialogue:(t,e)=>t&&e.isValid(e.date(t))?`Choose time, selected time is ${e.format(e.date(t),"fullTime")}`:"Choose time",timeTableLabel:"pick time",dateTableLabel:"pick date"},KB=z1;qB(z1);const H1=h.createContext(null);function V1(t){const e=Kr({props:t,name:"MuiLocalizationProvider"}),{children:n,dateAdapter:r,dateFormats:o,dateLibInstance:i,locale:s,adapterLocale:a,localeText:l}=e,c=h.useMemo(()=>new r({locale:a??s,formats:o,instance:i}),[r,s,a,o,i]),u=h.useMemo(()=>({minDate:c.date("1900-01-01T00:00:00.000"),maxDate:c.date("2099-12-31T00:00:00.000")}),[c]),d=h.useMemo(()=>({utils:c,defaultDates:u,localeText:J({},KB,l??{})}),[u,c,l]);return v.jsx(H1.Provider,{value:d,children:n})}const Wa=()=>{const t=h.useContext(H1);if(t===null)throw new Error("MUI: Can not find utils in context. It looks like you forgot to wrap your component in LocalizationProvider, or pass dateAdapter prop directly.");return t},Bt=()=>Wa().utils,Eu=()=>Wa().defaultDates,xs=()=>Wa().localeText,Ua=()=>{const t=Bt();return h.useRef(t.date()).current},pd=({date:t,disableFuture:e,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,utils:s})=>{const a=s.startOfDay(s.date());n&&s.isBefore(o,a)&&(o=a),e&&s.isAfter(r,a)&&(r=a);let l=t,c=t;for(s.isBefore(t,o)&&(l=s.date(o),c=null),s.isAfter(t,r)&&(c&&(c=s.date(r)),l=null);l||c;){if(l&&s.isAfter(l,r)&&(l=null),c&&s.isBefore(c,o)&&(c=null),l){if(!i(l))return l;l=s.addDays(l,1)}if(c){if(!i(c))return c;c=s.addDays(c,-1)}}return null},W1=(t,e)=>{const n=t.date(e);return t.isValid(n)?n:null},U1=t=>t.length===1&&t[0]==="year",G1=t=>t.length===2&&t.indexOf("month")!==-1&&t.indexOf("year")!==-1,YB=(t,e)=>U1(t)?{inputFormat:e.formats.year}:G1(t)?{disableMaskedInput:!0,inputFormat:e.formats.monthAndYear}:{inputFormat:e.formats.keyboardDate};function JB(t,e){var n;const r=Bt(),o=Eu(),i=Kr({props:t,name:e}),s=(n=i.views)!=null?n:["year","day"];return J({openTo:"day",minDate:o.minDate,maxDate:o.maxDate},YB(s,r),i,{views:s})}const ZB={emptyValue:null,getTodayValue:t=>t.date(),parseInput:W1,areValuesEqual:(t,e,n)=>t.isEqual(e,n)};function XB(t){return En("MuiCollapse",t)}At("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const QB=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],ej=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Tn(r,XB,n)},tj=Ee("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.orientation],n.state==="entered"&&e.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&e.hidden]}})(({theme:t,ownerState:e})=>J({height:0,overflow:"hidden",transition:t.transitions.create("height")},e.orientation==="horizontal"&&{height:"auto",width:0,transition:t.transitions.create("width")},e.state==="entered"&&J({height:"auto",overflow:"visible"},e.orientation==="horizontal"&&{width:"auto"}),e.state==="exited"&&!e.in&&e.collapsedSize==="0px"&&{visibility:"hidden"})),nj=Ee("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})(({ownerState:t})=>J({display:"flex",width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),rj=Ee("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})(({ownerState:t})=>J({width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),q1=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiCollapse"}),{addEndListener:o,children:i,className:s,collapsedSize:a="0px",component:l,easing:c,in:u,onEnter:d,onEntered:p,onEntering:f,onExit:m,onExited:g,onExiting:y,orientation:b="vertical",style:x,timeout:S=kE.standard,TransitionComponent:E=Ex}=r,k=tt(r,QB),w=J({},r,{orientation:b,collapsedSize:a}),M=ej(w),T=ms(),D=BE(),P=h.useRef(null),U=h.useRef(),N=typeof a=="number"?`${a}px`:a,K=b==="horizontal",R=K?"width":"height",B=h.useRef(null),z=Wr(n,B),I=A=>j=>{if(A){const H=B.current;j===void 0?A(H):A(H,j)}},oe=()=>P.current?P.current[K?"clientWidth":"clientHeight"]:0,me=I((A,j)=>{P.current&&K&&(P.current.style.position="absolute"),A.style[R]=N,d&&d(A,j)}),te=I((A,j)=>{const H=oe();P.current&&K&&(P.current.style.position="");const{duration:V,easing:fe}=Eg({style:x,timeout:S,easing:c},{mode:"enter"});if(S==="auto"){const pe=T.transitions.getAutoHeightDuration(H);A.style.transitionDuration=`${pe}ms`,U.current=pe}else A.style.transitionDuration=typeof V=="string"?V:`${V}ms`;A.style[R]=`${H}px`,A.style.transitionTimingFunction=fe,f&&f(A,j)}),G=I((A,j)=>{A.style[R]="auto",p&&p(A,j)}),X=I(A=>{A.style[R]=`${oe()}px`,m&&m(A)}),ie=I(g),Y=I(A=>{const j=oe(),{duration:H,easing:V}=Eg({style:x,timeout:S,easing:c},{mode:"exit"});if(S==="auto"){const fe=T.transitions.getAutoHeightDuration(j);A.style.transitionDuration=`${fe}ms`,U.current=fe}else A.style.transitionDuration=typeof H=="string"?H:`${H}ms`;A.style[R]=N,A.style.transitionTimingFunction=V,y&&y(A)}),C=A=>{S==="auto"&&D.start(U.current||0,A),o&&o(B.current,A)};return v.jsx(E,J({in:u,onEnter:me,onEntered:G,onEntering:te,onExit:X,onExited:ie,onExiting:Y,addEndListener:C,nodeRef:B,timeout:S==="auto"?null:S},k,{children:(A,j)=>v.jsx(tj,J({as:l,className:Hn(M.root,s,{entered:M.entered,exited:!u&&N==="0px"&&M.hidden}[A]),style:J({[K?"minWidth":"minHeight"]:N},x),ref:z},j,{ownerState:J({},w,{state:A}),children:v.jsx(nj,{ownerState:J({},w,{state:A}),className:M.wrapper,ref:P,children:v.jsx(rj,{ownerState:J({},w,{state:A}),className:M.wrapperInner,children:i})})}))}))});q1.muiSupportAuto=!0;const K1=h.createContext({}),oj=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],ij=["component","slots","slotProps"],sj=["component"];function aj(t,e){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,getSlotOwnerState:s,internalForwardedProps:a}=e,l=tt(e,oj),{component:c,slots:u={[t]:void 0},slotProps:d={[t]:void 0}}=i;tt(i,ij);const p=u[t]||r,f=DE(d[t],o),m=IE(J({className:n},l,{externalForwardedProps:void 0,externalSlotProps:f})),{props:{component:g},internalRef:y}=m,b=tt(m.props,sj),x=Wr(y,f==null?void 0:f.ref,e.ref),S=s?s(b):{},E=J({},o,S),k=g,w=$E(p,J({},t==="root",!u[t]&&a,b,k&&{as:k},{ref:x}),E);return Object.keys(S).forEach(M=>{delete w[M]}),[p,w]}function lj(t){return En("MuiAccordion",t)}const gl=At("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),cj=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","slots","slotProps","TransitionComponent","TransitionProps"],uj=t=>{const{classes:e,square:n,expanded:r,disabled:o,disableGutters:i}=t;return Tn({root:["root",!n&&"rounded",r&&"expanded",o&&"disabled",!i&&"gutters"],region:["region"]},lj,e)},dj=Ee(Ia,{name:"MuiAccordion",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${gl.region}`]:e.region},e.root,!n.square&&e.rounded,!n.disableGutters&&e.gutters]}})(({theme:t})=>{const e={duration:t.transitions.duration.shortest};return{position:"relative",transition:t.transitions.create(["margin"],e),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(t.vars||t).palette.divider,transition:t.transitions.create(["opacity","background-color"],e)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${gl.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${gl.disabled}`]:{backgroundColor:(t.vars||t).palette.action.disabledBackground}}},({theme:t})=>({variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(t.vars||t).shape.borderRadius,borderBottomRightRadius:(t.vars||t).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${gl.expanded}`]:{margin:"16px 0"}}}]})),pj=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiAccordion"}),{children:o,className:i,defaultExpanded:s=!1,disabled:a=!1,disableGutters:l=!1,expanded:c,onChange:u,square:d=!1,slots:p={},slotProps:f={},TransitionComponent:m,TransitionProps:g}=r,y=tt(r,cj),[b,x]=es({controlled:c,default:s,name:"Accordion",state:"expanded"}),S=h.useCallback(K=>{x(!b),u&&u(K,!b)},[b,u,x]),[E,...k]=h.Children.toArray(o),w=h.useMemo(()=>({expanded:b,disabled:a,disableGutters:l,toggle:S}),[b,a,l,S]),M=J({},r,{square:d,disabled:a,disableGutters:l,expanded:b}),T=uj(M),D=J({transition:m},p),P=J({transition:g},f),[U,N]=aj("transition",{elementType:q1,externalForwardedProps:{slots:D,slotProps:P},ownerState:M});return v.jsxs(dj,J({className:Hn(T.root,i),ref:n,ownerState:M,square:d},y,{children:[v.jsx(K1.Provider,{value:w,children:E}),v.jsx(U,J({in:b,timeout:"auto"},N,{children:v.jsx("div",{"aria-labelledby":E.props.id,id:E.props["aria-controls"],role:"region",className:T.region,children:k})}))]}))});function fj(t){return En("MuiAccordionDetails",t)}At("MuiAccordionDetails",["root"]);const hj=["className"],mj=t=>{const{classes:e}=t;return Tn({root:["root"]},fj,e)},gj=Ee("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({padding:t.spacing(1,2,2)})),vj=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiAccordionDetails"}),{className:o}=r,i=tt(r,hj),s=r,a=mj(s);return v.jsx(gj,J({className:Hn(a.root,o),ref:n,ownerState:s},i))});function yj(t){return En("MuiAccordionSummary",t)}const Ji=At("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),bj=["children","className","expandIcon","focusVisibleClassName","onClick"],xj=t=>{const{classes:e,expanded:n,disabled:r,disableGutters:o}=t;return Tn({root:["root",n&&"expanded",r&&"disabled",!o&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!o&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},yj,e)},wj=Ee(Rx,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e={duration:t.transitions.duration.shortest};return{display:"flex",minHeight:48,padding:t.spacing(0,2),transition:t.transitions.create(["min-height","background-color"],e),[`&.${Ji.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Ji.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`&:hover:not(.${Ji.disabled})`]:{cursor:"pointer"},variants:[{props:n=>!n.disableGutters,style:{[`&.${Ji.expanded}`]:{minHeight:64}}}]}}),Cj=Ee("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(t,e)=>e.content})(({theme:t})=>({display:"flex",flexGrow:1,margin:"12px 0",variants:[{props:e=>!e.disableGutters,style:{transition:t.transitions.create(["margin"],{duration:t.transitions.duration.shortest}),[`&.${Ji.expanded}`]:{margin:"20px 0"}}}]})),Sj=Ee("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(t,e)=>e.expandIconWrapper})(({theme:t})=>({display:"flex",color:(t.vars||t).palette.action.active,transform:"rotate(0deg)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),[`&.${Ji.expanded}`]:{transform:"rotate(180deg)"}})),kj=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiAccordionSummary"}),{children:o,className:i,expandIcon:s,focusVisibleClassName:a,onClick:l}=r,c=tt(r,bj),{disabled:u=!1,disableGutters:d,expanded:p,toggle:f}=h.useContext(K1),m=b=>{f&&f(b),l&&l(b)},g=J({},r,{expanded:p,disabled:u,disableGutters:d}),y=xj(g);return v.jsxs(wj,J({focusRipple:!1,disableRipple:!0,disabled:u,component:"div","aria-expanded":p,className:Hn(y.root,i),focusVisibleClassName:Hn(y.focusVisible,a),onClick:m,ref:n,ownerState:g},c,{children:[v.jsx(Cj,{className:y.content,ownerState:g,children:o}),s&&v.jsx(Sj,{className:y.expandIconWrapper,ownerState:g,children:s})]}))}),Gv=h.createContext();function Mj(t){return En("MuiGrid",t)}const Ej=[0,1,2,3,4,5,6,7,8,9,10],Tj=["column-reverse","column","row-reverse","row"],Oj=["nowrap","wrap-reverse","wrap"],Ts=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],ga=At("MuiGrid",["root","container","item","zeroMinWidth",...Ej.map(t=>`spacing-xs-${t}`),...Tj.map(t=>`direction-xs-${t}`),...Oj.map(t=>`wrap-xs-${t}`),...Ts.map(t=>`grid-xs-${t}`),...Ts.map(t=>`grid-sm-${t}`),...Ts.map(t=>`grid-md-${t}`),...Ts.map(t=>`grid-lg-${t}`),...Ts.map(t=>`grid-xl-${t}`)]),Lj=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function ts(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function Aj({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,o)=>{let i={};if(e[o]&&(n=e[o]),!n)return r;if(n===!0)i={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=cu({values:e.columns,breakpoints:t.breakpoints.values}),a=typeof s=="object"?s[o]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=t.spacing(e.columnSpacing);if(u!=="0px"){const d=`calc(${l} + ${ts(u)})`;c={flexBasis:d,maxWidth:d}}}i=J({flexBasis:l,flexGrow:0,maxWidth:l},c)}return t.breakpoints.values[o]===0?Object.assign(r,i):r[t.breakpoints.up(o)]=i,r},{})}function Pj({theme:t,ownerState:e}){const n=cu({values:e.direction,breakpoints:t.breakpoints.values});return Pf({theme:t},n,r=>{const o={flexDirection:r};return r.indexOf("column")===0&&(o[`& > .${ga.item}`]={maxWidth:"none"}),o})}function Y1({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(o=>{n===""&&e[o]!==0&&(n=o)});const r=Object.keys(t).sort((o,i)=>t[o]-t[i]);return r.slice(0,r.indexOf(n))}function Rj({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let o={};if(n&&r!==0){const i=cu({values:r,breakpoints:t.breakpoints.values});let s;typeof i=="object"&&(s=Y1({breakpoints:t.breakpoints.values,values:i})),o=Pf({theme:t},i,(a,l)=>{var c;const u=t.spacing(a);return u!=="0px"?{marginTop:`-${ts(u)}`,[`& > .${ga.item}`]:{paddingTop:ts(u)}}:(c=s)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${ga.item}`]:{paddingTop:0}}})}return o}function Dj({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let o={};if(n&&r!==0){const i=cu({values:r,breakpoints:t.breakpoints.values});let s;typeof i=="object"&&(s=Y1({breakpoints:t.breakpoints.values,values:i})),o=Pf({theme:t},i,(a,l)=>{var c;const u=t.spacing(a);return u!=="0px"?{width:`calc(100% + ${ts(u)})`,marginLeft:`-${ts(u)}`,[`& > .${ga.item}`]:{paddingLeft:ts(u)}}:(c=s)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${ga.item}`]:{paddingLeft:0}}})}return o}function Ij(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(o=>{const i=t[o];Number(i)>0&&r.push(n[`spacing-${o}-${String(i)}`])}),r}const $j=Ee("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:o,item:i,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=Ij(s,c,e));const d=[];return c.forEach(p=>{const f=n[p];f&&d.push(e[`grid-${p}-${String(f)}`])}),[e.root,r&&e.container,i&&e.item,l&&e.zeroMinWidth,...u,o!=="row"&&e[`direction-xs-${String(o)}`],a!=="wrap"&&e[`wrap-xs-${String(a)}`],...d]}})(({ownerState:t})=>J({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),Pj,Rj,Dj,Aj);function Nj(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const o=t[r];if(Number(o)>0){const i=`spacing-${r}-${String(o)}`;n.push(i)}}),n}const _j=t=>{const{classes:e,container:n,direction:r,item:o,spacing:i,wrap:s,zeroMinWidth:a,breakpoints:l}=t;let c=[];n&&(c=Nj(i,l));const u=[];l.forEach(p=>{const f=t[p];f&&u.push(`grid-${p}-${String(f)}`)});const d={root:["root",n&&"container",o&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return Tn(d,Mj,e)},Fj=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiGrid"}),{breakpoints:o}=ms(),i=ME(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:u=!1,direction:d="row",item:p=!1,rowSpacing:f,spacing:m=0,wrap:g="wrap",zeroMinWidth:y=!1}=i,b=tt(i,Lj),x=f||m,S=l||m,E=h.useContext(Gv),k=u?a||12:E,w={},M=J({},b);o.keys.forEach(P=>{b[P]!=null&&(w[P]=b[P],delete M[P])});const T=J({},i,{columns:k,container:u,direction:d,item:p,rowSpacing:x,columnSpacing:S,wrap:g,zeroMinWidth:y,spacing:m},w,{breakpoints:o.keys}),D=_j(T);return v.jsx(Gv.Provider,{value:k,children:v.jsx($j,J({ownerState:T,className:Hn(D.root,s),as:c,ref:n},M))})});function J1(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;ee.root})(({theme:t,ownerState:e})=>J({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:t.spacing(2,3)},e.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"})),Wj=Ee(Fj,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:1}),Uj=Ee(Mo,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(t,e)=>e.penIconButton})({}),Gj=t=>t==="clock"?v.jsx(X1,{color:"inherit"}):v.jsx(Z1,{color:"inherit"});function qj(t,e){return t?`text input view is open, go to ${e} view`:`${e} view is open, go to text input view`}const Q1=h.forwardRef(function(e,n){const{children:r,className:o,getMobileKeyboardInputViewButtonText:i=qj,isLandscape:s,isMobileKeyboardViewOpen:a,landscapeDirection:l="column",toggleMobileKeyboardView:c,toolbarTitle:u,viewType:d="calendar"}=e,p=e;return v.jsxs(Vj,{ref:n,className:nn(Zi.root,o),ownerState:p,children:[v.jsx(xo,{color:"text.secondary",variant:"overline",children:u}),v.jsxs(Wj,{container:!0,justifyContent:"space-between",className:Zi.content,ownerState:p,direction:s?l:"row",alignItems:s?"flex-start":"flex-end",children:[r,v.jsx(Uj,{onClick:c,className:nn(Zi.penIconButton,s&&Zi.penIconButtonLandscape),ownerState:p,color:"inherit","aria-label":i(a,d),children:a?Gj(d):v.jsx(Hj,{color:"inherit"})})]})]})}),Kj=["parsedValue","isLandscape","isMobileKeyboardViewOpen","onChange","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],qv=At("MuiDatePickerToolbar",["root","title"]),Yj=Ee(Q1,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})({[`& .${Zi.penIconButton}`]:{position:"relative",top:4}}),Jj=Ee(xo,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(t,e)=>e.title})(({ownerState:t})=>J({},t.isLandscape&&{margin:"auto 16px auto auto"})),Zj=h.forwardRef(function(e,n){const{parsedValue:r,isLandscape:o,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,toolbarFormat:a,toolbarPlaceholder:l="––",toolbarTitle:c="Select date",views:u}=e,d=tt(e,Kj),p=Bt(),f=h.useMemo(()=>r?a?p.formatByString(r,a):U1(u)?p.format(r,"year"):G1(u)?p.format(r,"month"):/en/.test(p.getCurrentLocaleCode())?p.format(r,"normalDateWithWeekday"):p.format(r,"normalDate"):l,[r,a,l,p,u]),m=e;return v.jsx(Yj,J({ref:n,toolbarTitle:c,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,isLandscape:o,ownerState:m,className:qv.root},d,{children:v.jsx(Jj,{variant:"h4",align:o?"left":"center",ownerState:m,className:qv.title,children:f})}))}),fi=h.createContext(null),ew=t=>{const{onAccept:e,onClear:n,onCancel:r,onSetToday:o,actions:i}=t,s=h.useContext(fi),a=xs(),l=typeof i=="function"?i(s):i;if(l==null||l.length===0)return null;const c=l==null?void 0:l.map(u=>{switch(u){case"clear":return v.jsx(Is,{onClick:n,children:a.clearButtonLabel},u);case"cancel":return v.jsx(Is,{onClick:r,children:a.cancelButtonLabel},u);case"accept":return v.jsx(Is,{onClick:e,children:a.okButtonLabel},u);case"today":return v.jsx(Is,{onClick:o,children:a.todayButtonLabel},u);default:return null}});return v.jsx(fT,{children:c})},Xj=["onClick","onTouchStart"],Qj=Ee(si)(({theme:t})=>({zIndex:t.zIndex.modal})),e5=Ee(Ia)(({ownerState:t})=>J({transformOrigin:"top center",outline:0},t.placement==="top"&&{transformOrigin:"bottom center"}));function t5(t,e){return e.documentElement.clientWidth{if(!t)return;function l(){i.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),i.current=!1}},[t]);const s=$s(l=>{if(!i.current)return;const c=r.current;r.current=!1;const u=Ju(o.current);if(!o.current||"clientX"in l&&t5(l,u))return;if(n.current){n.current=!1;return}let d;l.composedPath?d=l.composedPath().indexOf(o.current)>-1:d=!u.documentElement.contains(l.target)||o.current.contains(l.target),!d&&!c&&e(l)}),a=()=>{r.current=!0};return h.useEffect(()=>{if(t){const l=Ju(o.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",c)}}},[t,s]),h.useEffect(()=>{if(t){const l=Ju(o.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[t,s]),[o,a,a]}const r5=t=>{var e;const{anchorEl:n,children:r,containerRef:o=null,onBlur:i,onClose:s,onClear:a,onAccept:l,onCancel:c,onSetToday:u,open:d,PopperProps:p,role:f,TransitionComponent:m=OE,TrapFocusProps:g,PaperProps:y={},components:b,componentsProps:x}=t;h.useEffect(()=>{function z(I){d&&(I.key==="Escape"||I.key==="Esc")&&s()}return document.addEventListener("keydown",z),()=>{document.removeEventListener("keydown",z)}},[s,d]);const S=h.useRef(null);h.useEffect(()=>{f!=="tooltip"&&(d?S.current=document.activeElement:S.current&&S.current instanceof HTMLElement&&S.current.focus())},[d,f]);const[E,k,w]=n5(d,i??s),M=h.useRef(null),T=Wr(M,o),D=Wr(T,E),P=t,{onClick:U,onTouchStart:N}=y,K=tt(y,Xj),R=z=>{z.key==="Escape"&&(z.stopPropagation(),s())},B=(e=b==null?void 0:b.ActionBar)!=null?e:ew;return v.jsx(Qj,J({transition:!0,role:f,open:d,anchorEl:n,ownerState:P,onKeyDown:R},p,{children:({TransitionProps:z,placement:I})=>v.jsx(NE,J({open:d,disableAutoFocus:!0,disableEnforceFocus:f==="tooltip",isEnabled:()=>!0},g,{children:v.jsx(m,J({},z,{children:v.jsxs(e5,J({tabIndex:-1,elevation:8,ref:D,onClick:oe=>{k(oe),U&&U(oe)},onTouchStart:oe=>{w(oe),N&&N(oe)},ownerState:J({},P,{placement:I})},K,{children:[r,v.jsx(B,J({onAccept:l,onClear:a,onCancel:c,onSetToday:u,actions:[]},x==null?void 0:x.actionBar))]}))}))}))}))};function tw(t){const{children:e,DateInputProps:n,KeyboardDateInputComponent:r,onClear:o,onDismiss:i,onCancel:s,onAccept:a,onSetToday:l,open:c,PopperProps:u,PaperProps:d,TransitionComponent:p,components:f,componentsProps:m}=t,g=h.useRef(null),y=Wr(n.inputRef,g);return v.jsxs(fi.Provider,{value:"desktop",children:[v.jsx(r,J({},n,{inputRef:y})),v.jsx(r5,{role:"dialog",open:c,anchorEl:g.current,TransitionComponent:p,PopperProps:u,PaperProps:d,onClose:i,onCancel:s,onClear:o,onAccept:a,onSetToday:l,components:f,componentsProps:m,children:e})]})}function No(t,e){return Array.isArray(e)?e.every(n=>t.indexOf(n)!==-1):t.indexOf(e)!==-1}const nw=(t,e)=>n=>{(n.key==="Enter"||n.key===" ")&&(t(),n.preventDefault(),n.stopPropagation())};function Lh({onChange:t,onViewChange:e,openTo:n,view:r,views:o}){var i,s;const[a,l]=es({name:"Picker",state:"view",controlled:r,default:n&&No(o,n)?n:o[0]}),c=(i=o[o.indexOf(a)-1])!=null?i:null,u=(s=o[o.indexOf(a)+1])!=null?s:null,d=h.useCallback(m=>{l(m),e&&e(m)},[l,e]),p=h.useCallback(()=>{u&&d(u)},[u,d]);return{handleChangeAndOpenNext:h.useCallback((m,g)=>{const y=g==="finish";t(m,y&&u?"partial":g),y&&p()},[u,t,p]),nextView:u,previousView:c,openNext:p,openView:a,setOpenView:d}}const ss=220,ho=36,va={x:ss/2,y:ss/2},rw={x:va.x,y:0},o5=rw.x-va.x,i5=rw.y-va.y,s5=t=>t*(180/Math.PI),ow=(t,e,n)=>{const r=e-va.x,o=n-va.y,i=Math.atan2(o5,i5)-Math.atan2(r,o);let s=s5(i);s=Math.round(s/t)*t,s%=360;const a=Math.floor(s/t)||0,l=r**2+o**2,c=Math.sqrt(l);return{value:a,distance:c}},a5=(t,e,n=1)=>{const r=n*6;let{value:o}=ow(r,t,e);return o=o*n%60,o},l5=(t,e,n)=>{const{value:r,distance:o}=ow(30,t,e);let i=r||12;return n?i%=12:oJ({width:2,backgroundColor:t.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},e.toAnimateTransform&&{transition:t.transitions.create(["transform","height"])})),d5=Ee("div")(({theme:t,ownerState:e})=>J({width:4,height:4,backgroundColor:t.palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${ho/2}px)`,border:`${(ho-4)/2}px solid ${t.palette.primary.main}`,boxSizing:"content-box"},e.hasSelected&&{backgroundColor:t.palette.primary.main}));class iw extends h.Component{constructor(...e){super(...e),this.state={toAnimateTransform:!1,previousType:void 0}}render(){const e=this.props,{className:n,isInner:r,type:o,value:i}=e,s=tt(e,c5),a=J({},this.props,this.state),l=()=>{let u=360/(o==="hours"?12:60)*i;return o==="hours"&&i>12&&(u-=360),{height:Math.round((r?.26:.4)*ss),transform:`rotateZ(${u}deg)`}};return v.jsx(u5,J({style:l(),className:n,ownerState:a},s,{children:v.jsx(d5,{ownerState:a})}))}}iw.getDerivedStateFromProps=(t,e)=>t.type!==e.previousType?{toAnimateTransform:!0,previousType:t.type}:{toAnimateTransform:!1,previousType:t.type};const p5=Ee("div")(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),f5=Ee("div")({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),h5=Ee("div")(({ownerState:t})=>J({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none"},t.disabled?{}:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}})),m5=Ee("div")(({theme:t})=>({width:6,height:6,borderRadius:"50%",backgroundColor:t.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),g5=Ee(Mo)(({theme:t,ownerState:e})=>J({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,left:8},e.meridiemMode==="am"&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:t.palette.primary.light}})),v5=Ee(Mo)(({theme:t,ownerState:e})=>J({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,right:8},e.meridiemMode==="pm"&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:t.palette.primary.light}}));function y5(t){const{ampm:e,ampmInClock:n,autoFocus:r,children:o,date:i,getClockLabelText:s,handleMeridiemChange:a,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:d,selectedId:p,type:f,value:m,disabled:g,readOnly:y}=t,b=t,x=Bt(),S=h.useContext(fi),E=h.useRef(!1),k=l(m,f),w=!e&&f==="hours"&&(m<1||m>12),M=(I,oe)=>{g||y||l(I,f)||d(I,oe)},T=(I,oe)=>{let{offsetX:me,offsetY:te}=I;if(me===void 0){const X=I.target.getBoundingClientRect();me=I.changedTouches[0].clientX-X.left,te=I.changedTouches[0].clientY-X.top}const G=f==="seconds"||f==="minutes"?a5(me,te,u):l5(me,te,!!e);M(G,oe)},D=I=>{E.current=!0,T(I,"shallow")},P=I=>{E.current&&(T(I,"finish"),E.current=!1)},U=I=>{I.buttons>0&&T(I.nativeEvent,"shallow")},N=I=>{E.current&&(E.current=!1),T(I.nativeEvent,"finish")},K=h.useMemo(()=>f==="hours"?!0:m%5===0,[f,m]),R=f==="minutes"?u:1,B=h.useRef(null);$f(()=>{r&&B.current.focus()},[r]);const z=I=>{if(!E.current)switch(I.key){case"Home":M(0,"partial"),I.preventDefault();break;case"End":M(f==="minutes"?59:23,"partial"),I.preventDefault();break;case"ArrowUp":M(m+R,"partial"),I.preventDefault();break;case"ArrowDown":M(m-R,"partial"),I.preventDefault();break}};return v.jsxs(p5,{children:[v.jsxs(f5,{children:[v.jsx(h5,{onTouchMove:D,onTouchEnd:P,onMouseUp:N,onMouseMove:U,ownerState:{disabled:g}}),!k&&v.jsxs(h.Fragment,{children:[v.jsx(m5,{}),i&&v.jsx(iw,{type:f,value:m,isInner:w,hasSelected:K})]}),v.jsx("div",{"aria-activedescendant":p,"aria-label":s(f,i,x),ref:B,role:"listbox",onKeyDown:z,tabIndex:0,children:o})]}),e&&(S==="desktop"||n)&&v.jsxs(h.Fragment,{children:[v.jsx(g5,{onClick:y?void 0:()=>a("am"),disabled:g||c===null,ownerState:b,children:v.jsx(xo,{variant:"caption",children:"AM"})}),v.jsx(v5,{disabled:g||c===null,onClick:y?void 0:()=>a("pm"),ownerState:b,children:v.jsx(xo,{variant:"caption",children:"PM"})})]})]})}const sw=t=>()=>{},b5=["className","disabled","index","inner","label","selected"],sc=At("PrivateClockNumber",["selected","disabled"]),x5=Ee("span")(({theme:t,ownerState:e})=>J({height:ho,width:ho,position:"absolute",left:`calc((100% - ${ho}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:t.palette.text.primary,fontFamily:t.typography.fontFamily,"&:focused":{backgroundColor:t.palette.background.paper},[`&.${sc.selected}`]:{color:t.palette.primary.contrastText},[`&.${sc.disabled}`]:{pointerEvents:"none",color:t.palette.text.disabled}},e.inner&&J({},t.typography.body2,{color:t.palette.text.secondary})));function aw(t){const{className:e,disabled:n,index:r,inner:o,label:i,selected:s}=t,a=tt(t,b5),l=t,c=r%12/12*Math.PI*2-Math.PI/2,u=(ss-ho-2)/2*(o?.65:1),d=Math.round(Math.cos(c)*u),p=Math.round(Math.sin(c)*u);return v.jsx(x5,J({className:nn(e,s&&sc.selected,n&&sc.disabled),"aria-disabled":n?!0:void 0,"aria-selected":s?!0:void 0,role:"option",style:{transform:`translate(${d}px, ${p+(ss-ho)/2}px`},ownerState:l},a,{children:i}))}const w5=({ampm:t,date:e,getClockNumberText:n,isDisabled:r,selectedId:o,utils:i})=>{const s=e?i.getHours(e):null,a=[],l=t?1:0,c=t?12:23,u=d=>s===null?!1:t?d===12?s===12||s===0:s===d||s-12===d:s===d;for(let d=l;d<=c;d+=1){let p=d.toString();d===0&&(p="00");const f=!t&&(d===0||d>12);p=i.formatNumber(p);const m=u(d);a.push(v.jsx(aw,{id:m?o:void 0,index:d,inner:f,selected:m,disabled:r(d),label:p,"aria-label":n(p)},d))}return a},Kv=({utils:t,value:e,isDisabled:n,getClockNumberText:r,selectedId:o})=>{const i=t.formatNumber;return[[5,i("05")],[10,i("10")],[15,i("15")],[20,i("20")],[25,i("25")],[30,i("30")],[35,i("35")],[40,i("40")],[45,i("45")],[50,i("50")],[55,i("55")],[0,i("00")]].map(([s,a],l)=>{const c=s===e;return v.jsx(aw,{label:a,id:c?o:void 0,index:l+1,inner:!1,disabled:n(s),selected:c,"aria-label":r(a)},s)})},C5=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],vl=At("MuiPickersArrowSwitcher",["root","spacer","button"]),S5=Ee("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),k5=Ee("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),Yv=Ee(Mo,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})(({ownerState:t})=>J({},t.hidden&&{visibility:"hidden"})),lw=h.forwardRef(function(e,n){const{children:r,className:o,components:i,componentsProps:s,isLeftDisabled:a,isLeftHidden:l,isRightDisabled:c,isRightHidden:u,leftArrowButtonText:d,onLeftClick:p,onRightClick:f,rightArrowButtonText:m}=e,g=tt(e,C5),b=ms().direction==="rtl",x=(s==null?void 0:s.leftArrowButton)||{},S=(i==null?void 0:i.LeftArrowIcon)||jj,E=(s==null?void 0:s.rightArrowButton)||{},k=(i==null?void 0:i.RightArrowIcon)||zj,w=e;return v.jsxs(S5,J({ref:n,className:nn(vl.root,o),ownerState:w},g,{children:[v.jsx(Yv,J({as:i==null?void 0:i.LeftArrowButton,size:"small","aria-label":d,title:d,disabled:a,edge:"end",onClick:p},x,{className:nn(vl.button,x.className),ownerState:J({},w,x,{hidden:l}),children:b?v.jsx(k,{}):v.jsx(S,{})})),r?v.jsx(xo,{variant:"subtitle1",component:"span",children:r}):v.jsx(k5,{className:vl.spacer,ownerState:w}),v.jsx(Yv,J({as:i==null?void 0:i.RightArrowButton,size:"small","aria-label":m,title:m,edge:"start",disabled:c,onClick:f},E,{className:nn(vl.button,E.className),ownerState:J({},w,E,{hidden:u}),children:b?v.jsx(S,{}):v.jsx(k,{})}))]}))}),M5=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,Ap=(t,e,n)=>n&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,E5=(t,e,n,r)=>{const o=Ap(r.getHours(t),e,n);return r.setHours(t,o)},Jv=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),cw=(t=!1,e)=>(n,r)=>t?e.isAfter(n,r):Jv(n,e)>Jv(r,e);function T5(t,{disableFuture:e,maxDate:n}){const r=Bt();return h.useMemo(()=>{const o=r.date(),i=r.startOfMonth(e&&r.isBefore(o,n)?o:n);return!r.isAfter(i,t)},[e,n,t,r])}function O5(t,{disablePast:e,minDate:n}){const r=Bt();return h.useMemo(()=>{const o=r.date(),i=r.startOfMonth(e&&r.isAfter(o,n)?o:n);return!r.isBefore(i,t)},[e,n,t,r])}function uw(t,e,n){const r=Bt(),o=M5(t,r),i=h.useCallback(s=>{const a=t==null?null:E5(t,s,!!e,r);n(a,"partial")},[e,t,n,r]);return{meridiemMode:o,handleMeridiemChange:i}}function L5(t){return En("MuiClockPicker",t)}At("MuiClockPicker",["root","arrowSwitcher"]);const Pp=36,Ah=2,dw=320,A5=358,Ph=Ee("div")({overflowX:"hidden",width:dw,maxHeight:A5,display:"flex",flexDirection:"column",margin:"0 auto"}),P5=t=>{const{classes:e}=t;return Tn({root:["root"],arrowSwitcher:["arrowSwitcher"]},L5,e)},R5=Ee(Ph,{name:"MuiClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),D5=Ee(lw,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),I5=sw(),$5=h.forwardRef(function(e,n){const r=Kr({props:e,name:"MuiClockPicker"}),{ampm:o=!1,ampmInClock:i=!1,autoFocus:s,components:a,componentsProps:l,date:c,disableIgnoringDatePartForTimeValidation:u,getClockLabelText:d,getHoursClockNumberText:p,getMinutesClockNumberText:f,getSecondsClockNumberText:m,leftArrowButtonText:g,maxTime:y,minTime:b,minutesStep:x=1,rightArrowButtonText:S,shouldDisableTime:E,showViewSwitcher:k,onChange:w,view:M,views:T=["hours","minutes"],openTo:D,onViewChange:P,className:U,disabled:N,readOnly:K}=r;I5({leftArrowButtonText:g,rightArrowButtonText:S,getClockLabelText:d,getHoursClockNumberText:p,getMinutesClockNumberText:f,getSecondsClockNumberText:m});const R=xs(),B=g??R.openPreviousView,z=S??R.openNextView,I=d??R.clockLabelText,oe=p??R.hoursClockNumberText,me=f??R.minutesClockNumberText,te=m??R.secondsClockNumberText,{openView:G,setOpenView:X,nextView:ie,previousView:Y,handleChangeAndOpenNext:C}=Lh({view:M,views:T,openTo:D,onViewChange:P,onChange:w}),A=Ua(),j=Bt(),H=h.useMemo(()=>c||j.setSeconds(j.setMinutes(j.setHours(A,0),0),0),[c,A,j]),{meridiemMode:V,handleMeridiemChange:fe}=uw(H,o,C),pe=h.useCallback((F,de)=>{const Z=cw(u,j),ae=({start:ye,end:be})=>!(b&&Z(b,be)||y&&Z(ye,y)),ue=(ye,be=1)=>ye%be!==0?!1:E?!E(ye,de):!0;switch(de){case"hours":{const ye=Ap(F,V,o),be=j.setHours(H,ye),ge=j.setSeconds(j.setMinutes(be,0),0),ce=j.setSeconds(j.setMinutes(be,59),59);return!ae({start:ge,end:ce})||!ue(ye)}case"minutes":{const ye=j.setMinutes(H,F),be=j.setSeconds(ye,0),ge=j.setSeconds(ye,59);return!ae({start:be,end:ge})||!ue(F,x)}case"seconds":{const ye=j.setSeconds(H,F);return!ae({start:ye,end:ye})||!ue(F)}default:throw new Error("not supported")}},[o,H,u,y,V,b,x,E,j]),he=If(),ke=h.useMemo(()=>{switch(G){case"hours":{const F=(de,Z)=>{const ae=Ap(de,V,o);C(j.setHours(H,ae),Z)};return{onChange:F,value:j.getHours(H),children:w5({date:c,utils:j,ampm:o,onChange:F,getClockNumberText:oe,isDisabled:de=>N||pe(de,"hours"),selectedId:he})}}case"minutes":{const F=j.getMinutes(H),de=(Z,ae)=>{C(j.setMinutes(H,Z),ae)};return{value:F,onChange:de,children:Kv({utils:j,value:F,onChange:de,getClockNumberText:me,isDisabled:Z=>N||pe(Z,"minutes"),selectedId:he})}}case"seconds":{const F=j.getSeconds(H),de=(Z,ae)=>{C(j.setSeconds(H,Z),ae)};return{value:F,onChange:de,children:Kv({utils:j,value:F,onChange:de,getClockNumberText:te,isDisabled:Z=>N||pe(Z,"seconds"),selectedId:he})}}default:throw new Error("You must provide the type for ClockView")}},[G,j,c,o,oe,me,te,V,C,H,pe,he,N]),Te=r,$=P5(Te);return v.jsxs(R5,{ref:n,className:nn($.root,U),ownerState:Te,children:[k&&v.jsx(D5,{className:$.arrowSwitcher,leftArrowButtonText:B,rightArrowButtonText:z,components:a,componentsProps:l,onLeftClick:()=>X(Y),onRightClick:()=>X(ie),isLeftDisabled:!Y,isRightDisabled:!ie,ownerState:Te}),v.jsx(y5,J({autoFocus:s,date:c,ampmInClock:i,type:G,ampm:o,getClockLabelText:I,minutesStep:x,isTimeDisabled:pe,meridiemMode:V,handleMeridiemChange:fe,selectedId:he,disabled:N,readOnly:K},ke))]})}),N5=["disabled","onSelect","selected","value"],Rp=At("PrivatePickersMonth",["root","selected"]),_5=Ee(xo)(({theme:t})=>J({flex:"1 0 33.33%",display:"flex",alignItems:"center",justifyContent:"center",color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:Jl(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:t.palette.text.secondary},[`&.${Rp.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),F5=t=>{const{disabled:e,onSelect:n,selected:r,value:o}=t,i=tt(t,N5),s=()=>{n(o)};return v.jsx(_5,J({component:"button",type:"button",className:nn(Rp.root,r&&Rp.selected),tabIndex:e?-1:0,onClick:s,onKeyDown:nw(s),color:r?"primary":void 0,variant:r?"h5":"subtitle1",disabled:e},i))};function B5(t){return En("MuiMonthPicker",t)}At("MuiMonthPicker",["root"]);const j5=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly"],z5=t=>{const{classes:e}=t;return Tn({root:["root"]},B5,e)},H5=Ee("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),V5=h.forwardRef(function(e,n){const r=Bt(),o=Ua(),i=Eu(),s=Kr({props:e,name:"MuiMonthPicker"}),{className:a,date:l,disabled:c,disableFuture:u,disablePast:d,maxDate:p=i.maxDate,minDate:f=i.minDate,onChange:m,shouldDisableMonth:g,readOnly:y}=s,b=tt(s,j5),x=s,S=z5(x),E=l??o,k=r.getMonth(E),w=T=>{const D=r.startOfMonth(d&&r.isAfter(o,f)?o:f),P=r.startOfMonth(u&&r.isBefore(o,p)?o:p);return r.isBefore(T,D)||r.isAfter(T,P)?!0:g?g(T):!1},M=T=>{if(y)return;const D=r.setMonth(E,T);m(D,"finish")};return v.jsx(H5,J({ref:n,className:nn(S.root,a),ownerState:x},b,{children:r.getMonthArray(E).map(T=>{const D=r.getMonth(T),P=r.format(T,"monthShort");return v.jsx(F5,{value:D,selected:D===k,onSelect:M,disabled:c||w(T),children:P},P)})}))});function pw(t,e,n){const{value:r,onError:o}=t,i=Wa(),s=h.useRef(null),a=e({adapter:i,value:r,props:t});return h.useEffect(()=>{o&&!n(a,s.current)&&o(a,r),s.current=a},[n,o,s,a,r]),a}const fw=({props:t,value:e,adapter:n})=>{const r=n.utils.date(),o=n.utils.date(e),{shouldDisableDate:i,minDate:s=n.defaultDates.minDate,maxDate:a=n.defaultDates.maxDate,disableFuture:l,disablePast:c}=t;if(o===null)return null;switch(!0){case!n.utils.isValid(e):return"invalidDate";case!!(i&&i(o)):return"shouldDisableDate";case!!(l&&n.utils.isAfterDay(o,r)):return"disableFuture";case!!(c&&n.utils.isBeforeDay(o,r)):return"disablePast";case!!(s&&n.utils.isBeforeDay(o,s)):return"minDate";case!!(a&&n.utils.isAfterDay(o,a)):return"maxDate";default:return null}},hw=({shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:o})=>{const i=Wa();return h.useCallback(s=>fw({adapter:i,value:s,props:{shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:o}})!==null,[i,t,e,n,r,o])},W5=(t,e)=>t===e,U5=t=>pw(t,fw,W5),G5=(t,e,n)=>(r,o)=>{switch(o.type){case"changeMonth":return J({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!t});case"finishMonthSwitchingAnimation":return J({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&n.isSameDay(o.focusedDay,r.focusedDay))return r;const i=o.focusedDay!=null&&!e&&!n.isSameMonth(r.currentMonth,o.focusedDay);return J({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:i&&!t,currentMonth:i?n.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&n.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},q5=({date:t,defaultCalendarMonth:e,disableFuture:n,disablePast:r,disableSwitchToMonthOnDayFocus:o=!1,maxDate:i,minDate:s,onMonthChange:a,reduceAnimations:l,shouldDisableDate:c})=>{var u;const d=Ua(),p=Bt(),f=h.useRef(G5(!!l,o,p)).current,[m,g]=h.useReducer(f,{isMonthSwitchingAnimating:!1,focusedDay:t||d,currentMonth:p.startOfMonth((u=t??e)!=null?u:d),slideDirection:"left"}),y=h.useCallback(k=>{g(J({type:"changeMonth"},k)),a&&a(k.newMonth)},[a]),b=h.useCallback(k=>{const w=k??d;p.isSameMonth(w,m.currentMonth)||y({newMonth:p.startOfMonth(w),direction:p.isAfterDay(w,m.currentMonth)?"left":"right"})},[m.currentMonth,y,d,p]),x=hw({shouldDisableDate:c,minDate:s,maxDate:i,disableFuture:n,disablePast:r}),S=h.useCallback(()=>{g({type:"finishMonthSwitchingAnimation"})},[]),E=h.useCallback(k=>{x(k)||g({type:"changeFocusedDay",focusedDay:k})},[x]);return{calendarState:m,changeMonth:b,changeFocusedDay:E,isDateDisabled:x,onMonthSwitchingAnimationEnd:S,handleChangeMonth:y}},K5=At("PrivatePickersFadeTransitionGroup",["root"]),Zv=500,Y5=Ee(Dx)({display:"block",position:"relative"}),mw=({children:t,className:e,reduceAnimations:n,transKey:r})=>n?t:v.jsx(Y5,{className:nn(K5.root,e),children:v.jsx(Tx,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:Zv,enter:Zv/2,exit:0},children:t},r)});function J5(t){return En("MuiPickersDay",t)}const yl=At("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),Z5=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDayFocus","onDaySelect","onFocus","onKeyDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],X5=t=>{const{selected:e,disableMargin:n,disableHighlightToday:r,today:o,outsideCurrentMonth:i,showDaysOutsideCurrentMonth:s,classes:a}=t;return Tn({root:["root",e&&"selected",!n&&"dayWithMargin",!r&&o&&"today",i&&s&&"dayOutsideMonth"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},J5,a)},gw=({theme:t,ownerState:e})=>J({},t.typography.caption,{width:Pp,height:Pp,borderRadius:"50%",padding:0,backgroundColor:t.palette.background.paper,color:t.palette.text.primary,"&:hover":{backgroundColor:Jl(t.palette.action.active,t.palette.action.hoverOpacity)},"&:focus":{backgroundColor:Jl(t.palette.action.active,t.palette.action.hoverOpacity),[`&.${yl.selected}`]:{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${yl.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,fontWeight:t.typography.fontWeightMedium,transition:t.transitions.create("background-color",{duration:t.transitions.duration.short}),"&:hover":{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${yl.disabled}`]:{color:t.palette.text.disabled}},!e.disableMargin&&{margin:`0 ${Ah}px`},e.outsideCurrentMonth&&e.showDaysOutsideCurrentMonth&&{color:t.palette.text.secondary},!e.disableHighlightToday&&e.today&&{[`&:not(.${yl.selected})`]:{border:`1px solid ${t.palette.text.secondary}`}}),vw=(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableMargin&&e.dayWithMargin,!n.disableHighlightToday&&n.today&&e.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},Q5=Ee(Rx,{name:"MuiPickersDay",slot:"Root",overridesResolver:vw})(gw),e4=Ee("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:vw})(({theme:t,ownerState:e})=>J({},gw({theme:t,ownerState:e}),{visibility:"hidden"})),t4=()=>{},n4=h.forwardRef(function(e,n){const r=Kr({props:e,name:"MuiPickersDay"}),{autoFocus:o=!1,className:i,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:d,onDayFocus:p=t4,onDaySelect:f,onFocus:m,onKeyDown:g,outsideCurrentMonth:y,selected:b=!1,showDaysOutsideCurrentMonth:x=!1,children:S,today:E=!1}=r,k=tt(r,Z5),w=J({},r,{autoFocus:o,disabled:a,disableHighlightToday:l,disableMargin:c,selected:b,showDaysOutsideCurrentMonth:x,today:E}),M=X5(w),T=Bt(),D=h.useRef(null),P=Wr(D,n);$f(()=>{o&&!a&&!u&&!y&&D.current.focus()},[o,a,u,y]);const U=B=>{p&&p(s),m&&m(B)},N=B=>{a||f(s,"finish"),d&&d(B)},K=ms();function R(B){switch(g!==void 0&&g(B),B.key){case"ArrowUp":p(T.addDays(s,-7)),B.preventDefault();break;case"ArrowDown":p(T.addDays(s,7)),B.preventDefault();break;case"ArrowLeft":p(T.addDays(s,K.direction==="ltr"?-1:1)),B.preventDefault();break;case"ArrowRight":p(T.addDays(s,K.direction==="ltr"?1:-1)),B.preventDefault();break;case"Home":p(T.startOfWeek(s)),B.preventDefault();break;case"End":p(T.endOfWeek(s)),B.preventDefault();break;case"PageUp":p(T.getNextMonth(s)),B.preventDefault();break;case"PageDown":p(T.getPreviousMonth(s)),B.preventDefault();break}}return y&&!x?v.jsx(e4,{className:nn(M.root,M.hiddenDaySpacingFiller,i),ownerState:w}):v.jsx(Q5,J({className:nn(M.root,i),ownerState:w,ref:P,centerRipple:!0,disabled:a,"aria-label":S?void 0:T.format(s,"fullDate"),tabIndex:b?0:-1,onFocus:U,onKeyDown:R,onClick:N},k,{children:S||T.format(s,"dayOfMonth")}))}),r4=(t,e)=>t.autoFocus===e.autoFocus&&t.isAnimating===e.isAnimating&&t.today===e.today&&t.disabled===e.disabled&&t.selected===e.selected&&t.disableMargin===e.disableMargin&&t.showDaysOutsideCurrentMonth===e.showDaysOutsideCurrentMonth&&t.disableHighlightToday===e.disableHighlightToday&&t.className===e.className&&t.outsideCurrentMonth===e.outsideCurrentMonth&&t.onDayFocus===e.onDayFocus&&t.onDaySelect===e.onDaySelect,o4=h.memo(n4,r4),i4=["children","className","reduceAnimations","slideDirection","transKey"],or=At("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),yw=350,s4=Ee(Dx)(({theme:t})=>{const e=t.transitions.create("transform",{duration:yw,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${or["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${or["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${or.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${or.slideExit}`]:{transform:"translate(0%)"},[`& .${or["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${or["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}}),a4=t=>{let{children:e,className:n,reduceAnimations:r,slideDirection:o,transKey:i}=t,s=tt(t,i4);if(r)return v.jsx("div",{className:nn(or.root,n),children:e});const a={exit:or.slideExit,enterActive:or.slideEnterActive,enter:or[`slideEnter-${o}`],exitActive:or[`slideExitActiveLeft-${o}`]};return v.jsx(s4,{className:nn(or.root,n),childFactory:l=>h.cloneElement(l,{classNames:a}),children:v.jsx(Wf,J({mountOnEnter:!0,unmountOnExit:!0,timeout:yw,classNames:a},s,{children:e}),i)})},bw=(Pp+Ah*2)*6,l4=Ee("div")({display:"flex",justifyContent:"center",alignItems:"center"}),c4=Ee(xo)(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:t.palette.text.secondary})),u4=Ee("div")({display:"flex",justifyContent:"center",alignItems:"center",minHeight:bw}),d4=Ee(a4)({minHeight:bw}),p4=Ee("div")({overflow:"hidden"}),f4=Ee("div")({margin:`${Ah}px 0`,display:"flex",justifyContent:"center"});function h4(t){const e=Ua(),n=Bt(),{autoFocus:r,onFocusedDayChange:o,className:i,currentMonth:s,selectedDays:a,disabled:l,disableHighlightToday:c,focusedDay:u,isMonthSwitchingAnimating:d,loading:p,onSelectedDaysChange:f,onMonthSwitchingAnimationEnd:m,readOnly:g,reduceAnimations:y,renderDay:b,renderLoading:x=()=>v.jsx("span",{children:"..."}),showDaysOutsideCurrentMonth:S,slideDirection:E,TransitionProps:k,disablePast:w,disableFuture:M,minDate:T,maxDate:D,shouldDisableDate:P}=t,U=hw({shouldDisableDate:P,minDate:T,maxDate:D,disablePast:w,disableFuture:M}),N=h.useCallback((I,oe="finish")=>{g||f(I,oe)},[f,g]),K=n.getMonth(s),R=a.filter(I=>!!I).map(I=>n.startOfDay(I)),B=K,z=h.useMemo(()=>h.createRef(),[B]);return v.jsxs(h.Fragment,{children:[v.jsx(l4,{children:n.getWeekdays().map((I,oe)=>v.jsx(c4,{"aria-hidden":!0,variant:"caption",children:I.charAt(0).toUpperCase()},I+oe.toString()))}),p?v.jsx(u4,{children:x()}):v.jsx(d4,J({transKey:B,onExited:m,reduceAnimations:y,slideDirection:E,className:i},k,{nodeRef:z,children:v.jsx(p4,{ref:z,role:"grid",children:n.getWeekArray(s).map(I=>v.jsx(f4,{role:"row",children:I.map(oe=>{const me={key:oe==null?void 0:oe.toString(),day:oe,isAnimating:d,disabled:l||U(oe),autoFocus:r&&u!==null&&n.isSameDay(oe,u),today:n.isSameDay(oe,e),outsideCurrentMonth:n.getMonth(oe)!==K,selected:R.some(te=>n.isSameDay(te,oe)),disableHighlightToday:c,showDaysOutsideCurrentMonth:S,onDayFocus:o,onDaySelect:N};return b?b(oe,R,me):v.jsx("div",{role:"cell",children:v.jsx(o4,J({},me))},me.key)})},`week-${I[0]}`))})}))]})}const m4=Ee("div")({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),g4=Ee("div")(({theme:t})=>J({display:"flex",maxHeight:30,overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},t.typography.body1,{fontWeight:t.typography.fontWeightMedium})),v4=Ee("div")({marginRight:6}),y4=Ee(Mo)({marginRight:"auto"}),b4=Ee(Bj)(({theme:t,ownerState:e})=>J({willChange:"transform",transition:t.transitions.create("transform"),transform:"rotate(0deg)"},e.openView==="year"&&{transform:"rotate(180deg)"})),x4=sw();function w4(t){const{components:e={},componentsProps:n={},currentMonth:r,disabled:o,disableFuture:i,disablePast:s,getViewSwitchingButtonText:a,leftArrowButtonText:l,maxDate:c,minDate:u,onMonthChange:d,onViewChange:p,openView:f,reduceAnimations:m,rightArrowButtonText:g,views:y}=t;x4({leftArrowButtonText:l,rightArrowButtonText:g,getViewSwitchingButtonText:a});const b=xs(),x=l??b.previousMonth,S=g??b.nextMonth,E=a??b.calendarViewSwitchingButtonAriaLabel,k=Bt(),w=n.switchViewButton||{},M=()=>d(k.getNextMonth(r),"left"),T=()=>d(k.getPreviousMonth(r),"right"),D=T5(r,{disableFuture:i,maxDate:c}),P=O5(r,{disablePast:s,minDate:u}),U=()=>{if(!(y.length===1||!p||o))if(y.length===2)p(y.find(K=>K!==f)||y[0]);else{const K=y.indexOf(f)!==0?0:1;p(y[K])}};if(y.length===1&&y[0]==="year")return null;const N=t;return v.jsxs(m4,{ownerState:N,children:[v.jsxs(g4,{role:"presentation",onClick:U,ownerState:N,children:[v.jsx(mw,{reduceAnimations:m,transKey:k.format(r,"monthAndYear"),children:v.jsx(v4,{"aria-live":"polite",ownerState:N,children:k.format(r,"monthAndYear")})}),y.length>1&&!o&&v.jsx(y4,J({size:"small",as:e.SwitchViewButton,"aria-label":E(f)},w,{children:v.jsx(b4,{as:e.SwitchViewIcon,ownerState:N})}))]}),v.jsx(Tx,{in:f==="day",children:v.jsx(lw,{leftArrowButtonText:x,rightArrowButtonText:S,components:e,componentsProps:n,onLeftClick:T,onRightClick:M,isLeftDisabled:P,isRightDisabled:D})})]})}function C4(t){return En("PrivatePickersYear",t)}const Xv=At("PrivatePickersYear",["root","modeMobile","modeDesktop","yearButton","disabled","selected"]),S4=t=>{const{wrapperVariant:e,disabled:n,selected:r,classes:o}=t,i={root:["root",e&&`mode${Da(e)}`],yearButton:["yearButton",n&&"disabled",r&&"selected"]};return Tn(i,C4,o)},k4=Ee("div")(({ownerState:t})=>J({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},(t==null?void 0:t.wrapperVariant)==="desktop"&&{flexBasis:"25%"})),M4=Ee("button")(({theme:t})=>J({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:Jl(t.palette.action.active,t.palette.action.hoverOpacity)},[`&.${Xv.disabled}`]:{color:t.palette.text.secondary},[`&.${Xv.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),E4=h.forwardRef(function(e,n){const{autoFocus:r,className:o,children:i,disabled:s,onClick:a,onKeyDown:l,selected:c,value:u}=e,d=h.useRef(null),p=Wr(d,n),f=h.useContext(fi),m=J({},e,{wrapperVariant:f}),g=S4(m);return h.useEffect(()=>{r&&d.current.focus()},[r]),v.jsx(k4,{className:nn(g.root,o),ownerState:m,children:v.jsx(M4,{ref:p,disabled:s,type:"button",tabIndex:c?0:-1,onClick:y=>a(y,u),onKeyDown:y=>l(y,u),className:g.yearButton,ownerState:m,children:i})})});function T4(t){return En("MuiYearPicker",t)}At("MuiYearPicker",["root"]);const O4=t=>{const{classes:e}=t;return Tn({root:["root"]},T4,e)},L4=Ee("div",{name:"MuiYearPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",margin:"0 4px"}),A4=h.forwardRef(function(e,n){const r=Ua(),o=ms(),i=Bt(),s=Eu(),a=Kr({props:e,name:"MuiYearPicker"}),{autoFocus:l,className:c,date:u,disabled:d,disableFuture:p,disablePast:f,maxDate:m=s.maxDate,minDate:g=s.minDate,onChange:y,readOnly:b,shouldDisableYear:x}=a,S=a,E=O4(S),k=u||r,w=i.getYear(k),M=h.useContext(fi),T=h.useRef(null),[D,P]=h.useState(w),U=h.useCallback(z=>!!(f&&i.isBeforeYear(z,r)||p&&i.isAfterYear(z,r)||g&&i.isBeforeYear(z,g)||m&&i.isAfterYear(z,m)||x&&x(z)),[p,f,m,g,r,x,i]),N=(z,I,oe="finish")=>{if(b)return;const me=i.setYear(k,I);y(me,oe)},K=h.useCallback(z=>{U(i.setYear(k,z))||P(z)},[k,U,i]),R=M==="desktop"?4:3,B=(z,I)=>{switch(z.key){case"ArrowUp":K(I-R),z.preventDefault();break;case"ArrowDown":K(I+R),z.preventDefault();break;case"ArrowLeft":K(I+(o.direction==="ltr"?-1:1)),z.preventDefault();break;case"ArrowRight":K(I+(o.direction==="ltr"?1:-1)),z.preventDefault();break}};return v.jsx(L4,{ref:n,className:nn(E.root,c),ownerState:S,children:i.getYearRange(g,m).map(z=>{const I=i.getYear(z),oe=I===w;return v.jsx(E4,{selected:oe,value:I,onClick:N,onKeyDown:B,autoFocus:l&&I===D,ref:oe?T:void 0,disabled:d||U(z),children:i.format(z,"year")},i.format(z,"year"))})})}),P4=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),R4=t=>En("MuiCalendarPicker",t);At("MuiCalendarPicker",["root","viewTransitionContainer"]);const D4=["autoFocus","onViewChange","date","disableFuture","disablePast","defaultCalendarMonth","loading","onChange","onYearChange","onMonthChange","reduceAnimations","renderLoading","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate"],I4=t=>{const{classes:e}=t;return Tn({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},R4,e)},$4=Ee(Ph,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),N4=Ee(mw,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({overflowY:"auto"}),_4=h.forwardRef(function(e,n){const r=Bt(),o=Eu(),i=Kr({props:e,name:"MuiCalendarPicker"}),{autoFocus:s,onViewChange:a,date:l,disableFuture:c,disablePast:u,defaultCalendarMonth:d,loading:p=!1,onChange:f,onYearChange:m,onMonthChange:g,reduceAnimations:y=P4,renderLoading:b=()=>v.jsx("span",{children:"..."}),shouldDisableDate:x,shouldDisableMonth:S,shouldDisableYear:E,view:k,views:w=["year","day"],openTo:M="day",className:T,disabled:D,readOnly:P,minDate:U=o.minDate,maxDate:N=o.maxDate}=i,K=tt(i,D4),{openView:R,setOpenView:B,openNext:z}=Lh({view:k,views:w,openTo:M,onChange:f,onViewChange:a}),{calendarState:I,changeFocusedDay:oe,changeMonth:me,handleChangeMonth:te,isDateDisabled:G,onMonthSwitchingAnimationEnd:X}=q5({date:l,defaultCalendarMonth:d,reduceAnimations:y,onMonthChange:g,minDate:U,maxDate:N,shouldDisableDate:x,disablePast:u,disableFuture:c}),ie=h.useCallback((pe,he)=>{const ke=r.startOfMonth(pe),Te=r.endOfMonth(pe),$=G(pe)?pd({utils:r,date:pe,minDate:r.isBefore(U,ke)?ke:U,maxDate:r.isAfter(N,Te)?Te:N,disablePast:u,disableFuture:c,isDateDisabled:G}):pe;$?(f($,he),g==null||g(ke)):(z(),me(ke)),oe($)},[oe,c,u,G,N,U,f,g,me,z,r]),Y=h.useCallback((pe,he)=>{const ke=r.startOfYear(pe),Te=r.endOfYear(pe),$=G(pe)?pd({utils:r,date:pe,minDate:r.isBefore(U,ke)?ke:U,maxDate:r.isAfter(N,Te)?Te:N,disablePast:u,disableFuture:c,isDateDisabled:G}):pe;$?(f($,he),m==null||m($)):(z(),me(ke)),oe($)},[oe,c,u,G,N,U,f,m,z,r,me]),C=h.useCallback((pe,he)=>f(l&&pe?r.mergeDateAndTime(pe,l):pe,he),[r,l,f]);h.useEffect(()=>{if(l&&G(l)){const pe=pd({utils:r,date:l,minDate:U,maxDate:N,disablePast:u,disableFuture:c,isDateDisabled:G});f(pe,"partial")}},[]),h.useEffect(()=>{l&&me(l)},[l]);const A=i,j=I4(A),H={disablePast:u,disableFuture:c,maxDate:N,minDate:U},V=D&&l||U,fe=D&&l||N;return v.jsxs($4,{ref:n,className:nn(j.root,T),ownerState:A,children:[v.jsx(w4,J({},K,{views:w,openView:R,currentMonth:I.currentMonth,onViewChange:B,onMonthChange:(pe,he)=>te({newMonth:pe,direction:he}),minDate:V,maxDate:fe,disabled:D,disablePast:u,disableFuture:c,reduceAnimations:y})),v.jsx(N4,{reduceAnimations:y,className:j.viewTransitionContainer,transKey:R,ownerState:A,children:v.jsxs("div",{children:[R==="year"&&v.jsx(A4,J({},K,H,{autoFocus:s,date:l,onChange:Y,shouldDisableYear:E,disabled:D,readOnly:P})),R==="month"&&v.jsx(V5,J({},H,{className:T,date:l,onChange:ie,disabled:D,readOnly:P,shouldDisableMonth:S})),R==="day"&&v.jsx(h4,J({},K,I,H,{autoFocus:s,onMonthSwitchingAnimationEnd:X,onFocusedDayChange:oe,reduceAnimations:y,selectedDays:[l],onSelectedDaysChange:C,loading:p,renderLoading:b,disabled:D,readOnly:P,shouldDisableDate:x}))]})})]})}),F4=t=>{const[,e]=h.useReducer(l=>l+1,0),n=h.useRef(null),{replace:r,append:o}=t,i=r?r(t.format(t.value)):t.format(t.value),s=h.useRef(!1),a=l=>{const c=l.target.value;n.current=[c,l.target,c.length>i.length,s.current,i===t.format(c)],e()};return h.useLayoutEffect(()=>{if(n.current==null)return;let[l,c,u,d,p]=n.current;n.current=null;const f=d&&p,g=l.slice(c.selectionStart).search(t.accept||/\d/g),y=g!==-1?g:0,b=w=>(w.match(t.accept||/\d/g)||[]).join(""),x=b(l.substr(0,c.selectionStart)),S=w=>{let M=0,T=0;for(let D=0;D!==x.length;++D){let P=w.indexOf(x[D],M)+1,U=b(w).indexOf(x[D],T)+1;U-T>1&&(P=M,U=T),T=Math.max(U,T),M=Math.max(M,P)}return M};if(t.mask===!0&&u&&!p){let w=S(l);const M=b(l.substr(w))[0];w=l.indexOf(M,w),l=`${l.substr(0,w)}${l.substr(w+1)}`}let E=t.format(l);o!=null&&c.selectionStart===l.length&&!p&&(u?E=o(E):b(E.slice(-1))===""&&(E=E.slice(0,-1)));const k=r?r(E):E;return i===k?e():t.onChange(k),()=>{let w=S(E);if(t.mask!=null&&(u||d&&!f))for(;E[w]&&b(E[w])==="";)w+=1;c.selectionStart=c.selectionEnd=w+(f?1+y:0)}}),h.useEffect(()=>{const l=u=>{u.code==="Delete"&&(s.current=!0)},c=u=>{u.code==="Delete"&&(s.current=!1)};return document.addEventListener("keydown",l),document.addEventListener("keyup",c),()=>{document.removeEventListener("keydown",l),document.removeEventListener("keyup",c)}},[]),{value:n.current!=null?n.current[0]:i,onChange:a}},Dp=(t,e,n)=>{const r=t.date(e);return e===null?"":t.isValid(r)?t.formatByString(r,n):""},ac="_",xw="2019-11-21T22:30:00.000",ww="2019-01-01T09:00:00.000";function B4(t,e,n,r){if(t)return t;const i=r.formatByString(r.date(ww),e).replace(n,ac),s=r.formatByString(r.date(xw),e).replace(n,"_");return i===s?i:""}function j4(t,e,n,r){if(!t)return!1;const i=r.formatByString(r.date(ww),e).replace(n,ac),s=r.formatByString(r.date(xw),e).replace(n,"_"),a=s===i&&t===s;return!a&&r.lib,a}const z4=(t,e)=>n=>{let r=0;return n.split("").map((o,i)=>{if(e.lastIndex=0,r>t.length-1)return"";const s=t[r],a=t[r+1],l=e.test(o)?o:"",c=s===ac?l:s+l;return r+=c.length,i===n.length-1&&a&&a!==ac?c?c+a:"":c}).join("")},H4=({acceptRegex:t=/[\d]/gi,disabled:e,disableMaskedInput:n,ignoreInvalidInputs:r,inputFormat:o,inputProps:i,label:s,mask:a,onChange:l,rawValue:c,readOnly:u,rifmFormatter:d,TextFieldProps:p,validationError:f})=>{const m=Bt(),g=m.getFormatHelperText(o),{shouldUseMaskedInput:y,maskToUse:b}=h.useMemo(()=>{if(n)return{shouldUseMaskedInput:!1,maskToUse:""};const N=B4(a,o,t,m);return{shouldUseMaskedInput:j4(N,o,t,m),maskToUse:N}},[t,n,o,a,m]),x=h.useMemo(()=>y&&b?z4(b,t):N=>N,[t,b,y]),S=c===null?null:m.date(c),[E,k]=h.useState(S),[w,M]=h.useState(Dp(m,c,o)),T=h.useRef();h.useEffect(()=>{const N=c!==T.current;if(T.current=c,!N)return;const K=c===null?null:m.date(c);if(!(c===null||m.isValid(K))||m.isEqual(E,K))return;const B=Dp(m,c,o);k(K),M(B)},[m,c,o,E]);const D=N=>{const K=N===""||N===a?"":N;M(K);const R=K===null?null:m.parse(K,o);r&&!m.isValid(R)||(k(R),l(R,K||void 0))},P=F4({value:w,onChange:D,format:d||x});return J({label:s,disabled:e,error:f,inputProps:J({},y?P:{value:w,onChange:N=>{D(N.currentTarget.value)}},{disabled:e,placeholder:g,readOnly:u,type:y?"tel":"text"},i)},p)},V4=["components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],Rh=h.forwardRef(function(e,n){const{components:r={},disableOpenPicker:o,getOpenDialogAriaText:i,InputAdornmentProps:s,InputProps:a,inputRef:l,openPicker:c,OpenPickerButtonProps:u,renderInput:d}=e,p=tt(e,V4),f=xs(),m=i??f.openDatePickerDialogue,g=Bt(),y=H4(p),b=(s==null?void 0:s.position)||"end",x=r.OpenPickerIcon||Z1;return d(J({ref:n,inputRef:l},y,{InputProps:J({},a,{[`${b}Adornment`]:o?void 0:v.jsx(fa,J({position:b},s,{children:v.jsx(Mo,J({edge:b,disabled:p.disabled||p.readOnly,"aria-label":m(p.rawValue,g)},u,{onClick:c,children:v.jsx(x,{})}))}))})}))});function Qv(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const W4=(t,e)=>{const[n,r]=h.useState(Qv);return $f(()=>{const i=()=>{r(Qv())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),No(t,["hours","minutes","seconds"])?!1:(e||n)==="landscape"},U4=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],G4=Ee("div")({padding:"16px 24px"}),q4=Ee("div")(({ownerState:t})=>J({display:"flex",flexDirection:"column"},t.isLandscape&&{flexDirection:"row"})),K4={fullWidth:!0},e0=t=>t==="year"||t==="month"||t==="day",t0=t=>t==="hours"||t==="minutes"||t==="seconds";function Dh(t){const{autoFocus:e,parsedValue:n,DateInputProps:r,isMobileKeyboardViewOpen:o,onDateChange:i,onViewChange:s,openTo:a,orientation:l,showToolbar:c,toggleMobileKeyboardView:u,ToolbarComponent:d=()=>null,toolbarFormat:p,toolbarPlaceholder:f,toolbarTitle:m,views:g}=t,y=tt(t,U4),b=W4(g,l),x=h.useContext(fi),S=c??x!=="desktop",E=h.useCallback((D,P)=>{i(D,x,P)},[i,x]),k=h.useCallback(D=>{o&&u(),s&&s(D)},[o,s,u]),{openView:w,setOpenView:M,handleChangeAndOpenNext:T}=Lh({view:void 0,views:g,openTo:a,onChange:E,onViewChange:k});return v.jsxs(q4,{ownerState:{isLandscape:b},children:[S&&v.jsx(d,J({},y,{views:g,isLandscape:b,parsedValue:n,onChange:E,setOpenView:M,openView:w,toolbarTitle:m,toolbarFormat:p,toolbarPlaceholder:f,isMobileKeyboardViewOpen:o,toggleMobileKeyboardView:u})),v.jsx(Ph,{children:o?v.jsx(G4,{children:v.jsx(Rh,J({},r,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:K4}))}):v.jsxs(h.Fragment,{children:[e0(w)&&v.jsx(_4,J({autoFocus:e,date:n,onViewChange:M,onChange:T,view:w,views:g.filter(e0)},y)),t0(w)&&v.jsx($5,J({},y,{autoFocus:e,date:n,view:w,views:g.filter(t0),onChange:T,onViewChange:M,showViewSwitcher:x==="desktop"}))]})})]})}const Y4=({open:t,onOpen:e,onClose:n})=>{const r=h.useRef(typeof t=="boolean").current,[o,i]=h.useState(!1);h.useEffect(()=>{if(r){if(typeof t!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(t)}},[r,t]);const s=h.useCallback(a=>{r||i(a),a&&e&&e(),!a&&n&&n()},[r,e,n]);return{isOpen:o,setIsOpen:s}},Ih=(t,e)=>{const{onAccept:n,onChange:r,value:o,closeOnSelect:i}=t,s=Bt(),{isOpen:a,setIsOpen:l}=Y4(t),c=h.useMemo(()=>e.parseInput(s,o),[e,s,o]),[u,d]=h.useState(c),[p,f]=h.useState(()=>({committed:c,draft:c,resetFallback:c})),m=h.useCallback(w=>{f(M=>{switch(w.action){case"setAll":case"acceptAndClose":return{draft:w.value,committed:w.value,resetFallback:w.value};case"setCommitted":return J({},M,{draft:w.value,committed:w.value});case"setDraft":return J({},M,{draft:w.value});default:return M}}),!w.skipOnChangeCall&&!e.areValuesEqual(s,p.committed,w.value)&&r(w.value),w.action==="acceptAndClose"&&(l(!1),n&&!e.areValuesEqual(s,p.resetFallback,w.value)&&n(w.value))},[n,r,l,p,s,e]);h.useEffect(()=>{s.isValid(c)&&d(c)},[s,c]),h.useEffect(()=>{a&&m({action:"setAll",value:c,skipOnChangeCall:!0})},[a]),e.areValuesEqual(s,p.committed,c)||m({action:"setCommitted",value:c,skipOnChangeCall:!0});const g=h.useMemo(()=>({open:a,onClear:()=>{m({value:e.emptyValue,action:"acceptAndClose"})},onAccept:()=>{m({value:p.draft,action:"acceptAndClose"})},onDismiss:()=>{m({value:p.committed,action:"acceptAndClose"})},onCancel:()=>{m({value:p.resetFallback,action:"acceptAndClose"})},onSetToday:()=>{m({value:e.getTodayValue(s),action:"acceptAndClose"})}}),[m,a,s,p,e]),[y,b]=h.useState(!1),x=h.useMemo(()=>({parsedValue:p.draft,isMobileKeyboardViewOpen:y,toggleMobileKeyboardView:()=>b(!y),onDateChange:(w,M,T="partial")=>{switch(T){case"shallow":return m({action:"setDraft",value:w,skipOnChangeCall:!0});case"partial":return m({action:"setDraft",value:w});case"finish":return m(i??M==="desktop"?{value:w,action:"acceptAndClose"}:{value:w,action:"setCommitted"});default:throw new Error("MUI: Invalid selectionState passed to `onDateChange`")}}}),[m,y,p.draft,i]),S=h.useCallback((w,M)=>{const T=e.valueReducer?e.valueReducer(s,u,w):w;r(T,M)},[r,e,u,s]),E=h.useMemo(()=>({onChange:S,open:a,rawValue:o,openPicker:()=>l(!0)}),[S,a,o,l]),k={pickerProps:x,inputProps:E,wrapperProps:g};return h.useDebugValue(k,()=>({MuiPickerState:{dateState:p,other:k}})),k},J4=["onChange","PopperProps","PaperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps"],Z4=h.forwardRef(function(e,n){const r=JB(e,"MuiDesktopDatePicker"),o=U5(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=Ih(r,ZB),{PopperProps:l,PaperProps:c,ToolbarComponent:u=Zj,TransitionComponent:d,components:p,componentsProps:f}=r,m=tt(r,J4),g=J({},s,m,{components:p,componentsProps:f,ref:n,validationError:o});return v.jsx(tw,J({},a,{DateInputProps:g,KeyboardDateInputComponent:Rh,PopperProps:l,PaperProps:c,TransitionComponent:d,components:p,componentsProps:f,children:v.jsx(Dh,J({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:g,components:p,componentsProps:f},m))}))}),X4={"& .MuiPaper-root":{border:`2px solid ${_.newColors.grey2[100]}`,boxShadow:"0px 1px 5px rgba(26, 26, 26, 0.161)"},"& .MuiPickersDay-today":{color:`${_.newColors.realTeal[100]} !important`,border:"none !important",fontFamily:_.fontFamily,fontWeight:_.fontWeight.bold,backgroundColor:"transparent !important","&:hover":{color:_.newColors.realTeal[100],backgroundColor:`${_.colors.tealOpacity} !important`}},"& .MuiPickersDay-dayWithMargin":{color:_.newColors.almostBlack[100],fontFamily:_.fontFamily,"&:hover":{color:_.newColors.realTeal[100],backgroundColor:_.colors.tealOpacity,fontWeight:_.fontWeight.bold}},"& .MuiIconButton-edgeStart, .MuiIconButton-edgeEnd":{color:_.newColors.grey4[100]},"& .MuiPickersDay-root.Mui-selected":{backgroundColor:`${_.newColors.realTeal[100]} !important`,color:"#FFFF !important",fontWeight:_.fontWeight.bold,"&:hover":{color:"#FFFF !important",backgroundColor:`${_.newColors.realTeal[100]} !important`}},"& .MuiCalendarPicker-root > div:first-of-type":{marginBottom:"16px",paddingLeft:"16px",paddingRight:"16px"}},Cw=Q.div` + `),O.createElement("div",{style:u.white,className:"saturation-white"},O.createElement("div",{style:u.black,className:"saturation-black"}),O.createElement("div",{style:u.pointer},this.props.pointer?O.createElement(this.props.pointer,this.props):O.createElement("div",{style:u.circle}))))}}]),e}(h.PureComponent||h.Component);function X$(t,e){for(var n=-1,r=t==null?0:t.length;++n=0,i=!n&&o&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return i?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(r=this.toRgbString()),e==="prgb"&&(r=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(r=this.toHexString()),e==="hex3"&&(r=this.toHexString(!0)),e==="hex4"&&(r=this.toHex8String(!0)),e==="hex8"&&(r=this.toHex8String()),e==="name"&&(r=this.toName()),e==="hsl"&&(r=this.toHslString()),e==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return Ne(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(vN,arguments)},brighten:function(){return this._applyModification(yN,arguments)},darken:function(){return this._applyModification(bN,arguments)},desaturate:function(){return this._applyModification(hN,arguments)},saturate:function(){return this._applyModification(mN,arguments)},greyscale:function(){return this._applyModification(gN,arguments)},spin:function(){return this._applyModification(xN,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(SN,arguments)},complement:function(){return this._applyCombination(wN,arguments)},monochromatic:function(){return this._applyCombination(kN,arguments)},splitcomplement:function(){return this._applyCombination(CN,arguments)},triad:function(){return this._applyCombination(gv,[3])},tetrad:function(){return this._applyCombination(gv,[4])}};Ne.fromRatio=function(t,e){if(rc(t)=="object"){var n={};for(var r in t)t.hasOwnProperty(r)&&(r==="a"?n[r]=t[r]:n[r]=Ns(t[r]));t=n}return Ne(t,e)};function cN(t){var e={r:0,g:0,b:0},n=1,r=null,o=null,i=null,s=!1,a=!1;return typeof t=="string"&&(t=LN(t)),rc(t)=="object"&&(_r(t.r)&&_r(t.g)&&_r(t.b)?(e=uN(t.r,t.g,t.b),s=!0,a=String(t.r).substr(-1)==="%"?"prgb":"rgb"):_r(t.h)&&_r(t.s)&&_r(t.v)?(r=Ns(t.s),o=Ns(t.v),e=pN(t.h,r,o),s=!0,a="hsv"):_r(t.h)&&_r(t.s)&&_r(t.l)&&(r=Ns(t.s),i=Ns(t.l),e=dN(t.h,r,i),s=!0,a="hsl"),t.hasOwnProperty("a")&&(n=t.a)),n=m1(n),{ok:s,format:t.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}function uN(t,e,n){return{r:Et(t,255)*255,g:Et(e,255)*255,b:Et(n,255)*255}}function pv(t,e,n){t=Et(t,255),e=Et(e,255),n=Et(n,255);var r=Math.max(t,e,n),o=Math.min(t,e,n),i,s,a=(r+o)/2;if(r==o)i=s=0;else{var l=r-o;switch(s=a>.5?l/(2-r-o):l/(r+o),r){case t:i=(e-n)/l+(e1&&(d-=1),d<1/6?c+(u-c)*6*d:d<1/2?u:d<2/3?c+(u-c)*(2/3-d)*6:c}if(e===0)r=o=i=n;else{var a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;r=s(l,a,t+1/3),o=s(l,a,t),i=s(l,a,t-1/3)}return{r:r*255,g:o*255,b:i*255}}function fv(t,e,n){t=Et(t,255),e=Et(e,255),n=Et(n,255);var r=Math.max(t,e,n),o=Math.min(t,e,n),i,s,a=r,l=r-o;if(s=r===0?0:l/r,r==o)i=0;else{switch(r){case t:i=(e-n)/l+(e>1)+720)%360;--e;)r.h=(r.h+o)%360,i.push(Ne(r));return i}function kN(t,e){e=e||6;for(var n=Ne(t).toHsv(),r=n.h,o=n.s,i=n.v,s=[],a=1/e;e--;)s.push(Ne({h:r,s:o,v:i})),i=(i+a)%1;return s}Ne.mix=function(t,e,n){n=n===0?0:n||50;var r=Ne(t).toRgb(),o=Ne(e).toRgb(),i=n/100,s={r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a};return Ne(s)};Ne.readability=function(t,e){var n=Ne(t),r=Ne(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)};Ne.isReadable=function(t,e,n){var r=Ne.readability(t,e),o,i;switch(i=!1,o=AN(n),o.level+o.size){case"AAsmall":case"AAAlarge":i=r>=4.5;break;case"AAlarge":i=r>=3;break;case"AAAsmall":i=r>=7;break}return i};Ne.mostReadable=function(t,e,n){var r=null,o=0,i,s,a,l;n=n||{},s=n.includeFallbackColors,a=n.level,l=n.size;for(var c=0;co&&(o=i,r=Ne(e[c]));return Ne.isReadable(t,r,{level:a,size:l})||!s?r:(n.includeFallbackColors=!1,Ne.mostReadable(t,["#fff","#000"],n))};var Cp=Ne.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},MN=Ne.hexNames=EN(Cp);function EN(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}function m1(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Et(t,e){TN(t)&&(t="100%");var n=ON(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function wu(t){return Math.min(1,Math.max(0,t))}function jn(t){return parseInt(t,16)}function TN(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function ON(t){return typeof t=="string"&&t.indexOf("%")!=-1}function gr(t){return t.length==1?"0"+t:""+t}function Ns(t){return t<=1&&(t=t*100+"%"),t}function g1(t){return Math.round(parseFloat(t)*255).toString(16)}function vv(t){return jn(t)/255}var dr=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",n="(?:"+e+")|(?:"+t+")",r="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",o="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?";return{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+r),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+r),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+r),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function _r(t){return!!dr.CSS_UNIT.exec(t)}function LN(t){t=t.replace(aN,"").replace(lN,"").toLowerCase();var e=!1;if(Cp[t])t=Cp[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n;return(n=dr.rgb.exec(t))?{r:n[1],g:n[2],b:n[3]}:(n=dr.rgba.exec(t))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=dr.hsl.exec(t))?{h:n[1],s:n[2],l:n[3]}:(n=dr.hsla.exec(t))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=dr.hsv.exec(t))?{h:n[1],s:n[2],v:n[3]}:(n=dr.hsva.exec(t))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=dr.hex8.exec(t))?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),a:vv(n[4]),format:e?"name":"hex8"}:(n=dr.hex6.exec(t))?{r:jn(n[1]),g:jn(n[2]),b:jn(n[3]),format:e?"name":"hex"}:(n=dr.hex4.exec(t))?{r:jn(n[1]+""+n[1]),g:jn(n[2]+""+n[2]),b:jn(n[3]+""+n[3]),a:vv(n[4]+""+n[4]),format:e?"name":"hex8"}:(n=dr.hex3.exec(t))?{r:jn(n[1]+""+n[1]),g:jn(n[2]+""+n[2]),b:jn(n[3]+""+n[3]),format:e?"name":"hex"}:!1}function AN(t){var e,n;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),n!=="small"&&n!=="large"&&(n="small"),{level:e,size:n}}var yv=function(e){var n=["r","g","b","a","h","s","l","v"],r=0,o=0;return sN(n,function(i){if(e[i]&&(r+=1,isNaN(e[i])||(o+=1),i==="s"||i==="l")){var s=/^\d+%$/;s.test(e[i])&&(o+=1)}}),r===o?e:!1},_s=function(e,n){var r=e.hex?Ne(e.hex):Ne(e),o=r.toHsl(),i=r.toHsv(),s=r.toRgb(),a=r.toHex();o.s===0&&(o.h=n||0,i.h=n||0);var l=a==="000000"&&s.a===0;return{hsl:o,hex:l?"transparent":"#"+a,rgb:s,hsv:i,oldHue:e.h||n||o.h,source:e.source}},To=function(e){if(e==="transparent")return!0;var n=String(e).charAt(0)==="#"?1:0;return e.length!==4+n&&e.length<7+n&&Ne(e).isValid()},uh=function(e){if(!e)return"#fff";var n=_s(e);if(n.hex==="transparent")return"rgba(0,0,0,0.4)";var r=(n.rgb.r*299+n.rgb.g*587+n.rgb.b*114)/1e3;return r>=128?"#000":"#fff"},ad=function(e,n){var r=e.replace("°","");return Ne(n+" ("+r+")")._ok},ks=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"span";return function(r){FN(o,r);function o(){var i,s,a,l;_N(this,o);for(var c=arguments.length,u=Array(c),d=0;da))return!1;var c=i.get(t),u=i.get(e);if(c&&u)return c==e&&u==t;var d=-1,p=!0,f=n&JN?new oc:void 0;for(i.set(t,e),i.set(e,t);++d=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var ul=24,p3=E1.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,o=r===void 0?ul:r,i=t.height,s=i===void 0?ul:i,a=t.style,l=a===void 0?{}:a,c=d3(t,["fill","width","height","style"]);return Nv.default.createElement("svg",$v({viewBox:"0 0 "+ul+" "+ul,style:$v({fill:n,width:o,height:s},l)},c),Nv.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},f3=function(){function t(e,n){for(var r=0;r1&&(o.a=1),r.props.onChange({h:r.props.hsl.h,s:r.props.hsl.s,l:r.props.hsl.l,a:Math.round(o.a*100)/100,source:"rgb"},i)):(o.h||o.s||o.l)&&(typeof o.s=="string"&&o.s.includes("%")&&(o.s=o.s.replace("%","")),typeof o.l=="string"&&o.l.includes("%")&&(o.l=o.l.replace("%","")),o.s==1?o.s=.01:o.l==1&&(o.l=.01),r.props.onChange({h:o.h||r.props.hsl.h,s:Number(Iv(o.s)?r.props.hsl.s:o.s),l:Number(Iv(o.l)?r.props.hsl.l:o.l),source:"hsl"},i))},r.showHighlight=function(o){o.currentTarget.style.background="#eee"},r.hideHighlight=function(o){o.currentTarget.style.background="transparent"},n.hsl.a!==1&&n.view==="hex"?r.state={view:"rgb"}:r.state={view:n.view},r}return f3(e,[{key:"render",value:function(){var r=this,o=We({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),i=void 0;return this.state.view==="hex"?i=O.createElement("div",{style:o.fields,className:"flexbox-fix"},O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=O.createElement("div",{style:o.fields,className:"flexbox-fix"},O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),O.createElement("div",{style:o.alpha},O.createElement(nt,{style:{input:o.input,label:o.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(i=O.createElement("div",{style:o.fields,className:"flexbox-fix"},O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),O.createElement("div",{style:o.field},O.createElement(nt,{style:{input:o.input,label:o.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),O.createElement("div",{style:o.alpha},O.createElement(nt,{style:{input:o.input,label:o.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),O.createElement("div",{style:o.wrap,className:"flexbox-fix"},i,O.createElement("div",{style:o.toggle},O.createElement("div",{style:o.icon,onClick:this.toggleViews,ref:function(a){return r.icon=a}},O.createElement(p3,{style:o.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(r,o){return r.hsl.a!==1&&o.view==="hex"?{view:"rgb"}:null}}]),e}(O.Component);T1.defaultProps={view:"hex"};var _v=function(){var e=We({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return O.createElement("div",{style:e.picker})},v3=function(){var e=We({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return O.createElement("div",{style:e.picker})},gh=function(e){var n=e.width,r=e.onChange,o=e.disableAlpha,i=e.rgb,s=e.hsl,a=e.hsv,l=e.hex,c=e.renderers,u=e.styles,d=u===void 0?{}:u,p=e.className,f=p===void 0?"":p,m=e.defaultView,g=We(Rn({default:{picker:{width:n,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+i.r+", "+i.g+", "+i.b+", "+i.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},d),{disableAlpha:o});return O.createElement("div",{style:g.picker,className:"chrome-picker "+f},O.createElement("div",{style:g.saturation},O.createElement(xu,{style:g.Saturation,hsl:s,hsv:a,pointer:v3,onChange:r})),O.createElement("div",{style:g.body},O.createElement("div",{style:g.controls,className:"flexbox-fix"},O.createElement("div",{style:g.color},O.createElement("div",{style:g.swatch},O.createElement("div",{style:g.active}),O.createElement(vs,{renderers:c}))),O.createElement("div",{style:g.toggles},O.createElement("div",{style:g.hue},O.createElement(ys,{style:g.Hue,hsl:s,pointer:_v,onChange:r})),O.createElement("div",{style:g.alpha},O.createElement(nh,{style:g.Alpha,rgb:i,hsl:s,pointer:_v,renderers:c,onChange:r})))),O.createElement(T1,{rgb:i,hsl:s,hex:l,view:m,onChange:r,disableAlpha:o})))};gh.propTypes={width:Se.oneOfType([Se.string,Se.number]),disableAlpha:Se.bool,styles:Se.object,defaultView:Se.oneOf(["hex","rgb","hsl"])};gh.defaultProps={width:225,disableAlpha:!1,styles:{}};Dn(gh);var y3=function(e){var n=e.color,r=e.onClick,o=r===void 0?function(){}:r,i=e.onSwatchHover,s=e.active,a=We({default:{color:{background:n,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:uh(n),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:s,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return O.createElement(di,{style:a.color,color:n,onClick:o,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},O.createElement("div",{style:a.dot}))},b3=function(e){var n=e.hex,r=e.rgb,o=e.onChange,i=We({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:n},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),s=function(l,c){l.r||l.g||l.b?o({r:l.r||r.r,g:l.g||r.g,b:l.b||r.b,source:"rgb"},c):o({hex:l.hex,source:"hex"},c)};return O.createElement("div",{style:i.fields,className:"flexbox-fix"},O.createElement("div",{style:i.active}),O.createElement(nt,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:n,onChange:s}),O.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:r.r,onChange:s}),O.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:r.g,onChange:s}),O.createElement(nt,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:r.b,onChange:s}))},vh=function(e){var n=e.onChange,r=e.onSwatchHover,o=e.colors,i=e.hex,s=e.rgb,a=e.styles,l=a===void 0?{}:a,c=e.className,u=c===void 0?"":c,d=We(Rn({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},l)),p=function(m,g){m.hex?To(m.hex)&&n({hex:m.hex,source:"hex"},g):n(m,g)};return O.createElement(Ha,{style:d.Compact,styles:l},O.createElement("div",{style:d.compact,className:"compact-picker "+u},O.createElement("div",null,pi(o,function(f){return O.createElement(y3,{key:f,color:f,active:f.toLowerCase()===i,onClick:p,onSwatchHover:r})}),O.createElement("div",{style:d.clear})),O.createElement(b3,{hex:i,rgb:s,onChange:p})))};vh.propTypes={colors:Se.arrayOf(Se.string),styles:Se.object};vh.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};Dn(vh);var x3=function(e){var n=e.hover,r=e.color,o=e.onClick,i=e.onSwatchHover,s={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},a=We({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:s}},{hover:n});return O.createElement("div",{style:a.swatch},O.createElement(di,{color:r,onClick:o,onHover:i,focusStyle:s}))};const w3=th(x3);var yh=function(e){var n=e.width,r=e.colors,o=e.onChange,i=e.onSwatchHover,s=e.triangle,a=e.styles,l=a===void 0?{}:a,c=e.className,u=c===void 0?"":c,d=We(Rn({default:{card:{width:n,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},l),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right","bottom-left-triangle":s==="bottom-left","bottom-right-triangle":s==="bottom-right"}),p=function(m,g){return o({hex:m,source:"hex"},g)};return O.createElement("div",{style:d.card,className:"github-picker "+u},O.createElement("div",{style:d.triangleShadow}),O.createElement("div",{style:d.triangle}),pi(r,function(f){return O.createElement(w3,{color:f,key:f,onClick:p,onSwatchHover:i})}))};yh.propTypes={width:Se.oneOfType([Se.string,Se.number]),colors:Se.arrayOf(Se.string),triangle:Se.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:Se.object};yh.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};Dn(yh);var C3=function(e){var n=e.direction,r=We({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:n==="vertical"});return O.createElement("div",{style:r.picker})},S3=Object.assign||function(t){for(var e=1;e.5});return O.createElement("div",{style:r.picker})},T3=function(){var e=We({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return O.createElement("div",{style:e.pointer},O.createElement("div",{style:e.left},O.createElement("div",{style:e.leftInside})),O.createElement("div",{style:e.right},O.createElement("div",{style:e.rightInside})))},Fv=function(e){var n=e.onClick,r=e.label,o=e.children,i=e.active,s=We({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:i});return O.createElement("div",{style:s.button,onClick:n},r||o)},O3=function(e){var n=e.rgb,r=e.currentColor,o=We({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+n.r+","+n.g+", "+n.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return O.createElement("div",null,O.createElement("div",{style:o.label},"new"),O.createElement("div",{style:o.swatches},O.createElement("div",{style:o.new}),O.createElement("div",{style:o.current})),O.createElement("div",{style:o.label},"current"))},L3=function(){function t(e,n){for(var r=0;r100&&(u.a=100),u.a/=100,n({h:o.h,s:o.s,l:o.l,a:u.a,source:"rgb"},d))};return O.createElement("div",{style:a.fields,className:"flexbox-fix"},O.createElement("div",{style:a.double},O.createElement(nt,{style:{input:a.input,label:a.label},label:"hex",value:i.replace("#",""),onChange:l})),O.createElement("div",{style:a.single},O.createElement(nt,{style:{input:a.input,label:a.label},label:"r",value:r.r,onChange:l,dragLabel:"true",dragMax:"255"})),O.createElement("div",{style:a.single},O.createElement(nt,{style:{input:a.input,label:a.label},label:"g",value:r.g,onChange:l,dragLabel:"true",dragMax:"255"})),O.createElement("div",{style:a.single},O.createElement(nt,{style:{input:a.input,label:a.label},label:"b",value:r.b,onChange:l,dragLabel:"true",dragMax:"255"})),O.createElement("div",{style:a.alpha},O.createElement(nt,{style:{input:a.input,label:a.label},label:"a",value:Math.round(r.a*100),onChange:l,dragLabel:"true",dragMax:"100"})))},I3=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}var dl=24,H3=L1.default=function(t){var e=t.fill,n=e===void 0?"currentColor":e,r=t.width,o=r===void 0?dl:r,i=t.height,s=i===void 0?dl:i,a=t.style,l=a===void 0?{}:a,c=z3(t,["fill","width","height","style"]);return jv.default.createElement("svg",Bv({viewBox:"0 0 "+dl+" "+dl,style:Bv({fill:n,width:o,height:s},l)},c),jv.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},V3=function(e){var n=e.color,r=e.onClick,o=r===void 0?function(){}:r,i=e.onSwatchHover,s=e.first,a=e.last,l=e.active,c=We({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:n,marginBottom:"1px"},check:{color:uh(n),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:s,last:a,active:l,"color-#FFFFFF":n==="#FFFFFF",transparent:n==="transparent"});return O.createElement(di,{color:n,style:c.color,onClick:o,onHover:i,focusStyle:{boxShadow:"0 0 4px "+n}},O.createElement("div",{style:c.check},O.createElement(H3,null)))},W3=function(e){var n=e.onClick,r=e.onSwatchHover,o=e.group,i=e.active,s=We({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return O.createElement("div",{style:s.group},pi(o,function(a,l){return O.createElement(V3,{key:a,color:a,active:a.toLowerCase()===i,first:l===0,last:l===o.length-1,onClick:n,onSwatchHover:r})}))},Sh=function(e){var n=e.width,r=e.height,o=e.onChange,i=e.onSwatchHover,s=e.colors,a=e.hex,l=e.styles,c=l===void 0?{}:l,u=e.className,d=u===void 0?"":u,p=We(Rn({default:{picker:{width:n,height:r},overflow:{height:r,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},c)),f=function(g,y){return o({hex:g,source:"hex"},y)};return O.createElement("div",{style:p.picker,className:"swatches-picker "+d},O.createElement(Ha,null,O.createElement("div",{style:p.overflow},O.createElement("div",{style:p.body},pi(s,function(m){return O.createElement(W3,{key:m.toString(),group:m,active:a,onClick:f,onSwatchHover:i})}),O.createElement("div",{style:p.clear})))))};Sh.propTypes={width:Se.oneOfType([Se.string,Se.number]),height:Se.oneOfType([Se.string,Se.number]),colors:Se.arrayOf(Se.arrayOf(Se.string)),styles:Se.object};Sh.defaultProps={width:320,height:240,colors:[[Ei[900],Ei[700],Ei[500],Ei[300],Ei[100]],[Ti[900],Ti[700],Ti[500],Ti[300],Ti[100]],[Oi[900],Oi[700],Oi[500],Oi[300],Oi[100]],[Li[900],Li[700],Li[500],Li[300],Li[100]],[Ai[900],Ai[700],Ai[500],Ai[300],Ai[100]],[Pi[900],Pi[700],Pi[500],Pi[300],Pi[100]],[Ri[900],Ri[700],Ri[500],Ri[300],Ri[100]],[Di[900],Di[700],Di[500],Di[300],Di[100]],[Ii[900],Ii[700],Ii[500],Ii[300],Ii[100]],["#194D33",Fs[700],Fs[500],Fs[300],Fs[100]],[$i[900],$i[700],$i[500],$i[300],$i[100]],[Ni[900],Ni[700],Ni[500],Ni[300],Ni[100]],[_i[900],_i[700],_i[500],_i[300],_i[100]],[Fi[900],Fi[700],Fi[500],Fi[300],Fi[100]],[Bi[900],Bi[700],Bi[500],Bi[300],Bi[100]],[ji[900],ji[700],ji[500],ji[300],ji[100]],[zi[900],zi[700],zi[500],zi[300],zi[100]],[Hi[900],Hi[700],Hi[500],Hi[300],Hi[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};Dn(Sh);var kh=function(e){var n=e.onChange,r=e.onSwatchHover,o=e.hex,i=e.colors,s=e.width,a=e.triangle,l=e.styles,c=l===void 0?{}:l,u=e.className,d=u===void 0?"":u,p=We(Rn({default:{card:{width:s,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},c),{"hide-triangle":a==="hide","top-left-triangle":a==="top-left","top-right-triangle":a==="top-right"}),f=function(g,y){To(g)&&n({hex:g,source:"hex"},y)};return O.createElement("div",{style:p.card,className:"twitter-picker "+d},O.createElement("div",{style:p.triangleShadow}),O.createElement("div",{style:p.triangle}),O.createElement("div",{style:p.body},pi(i,function(m,g){return O.createElement(di,{key:g,color:m,hex:m,style:p.swatch,onClick:f,onHover:r,focusStyle:{boxShadow:"0 0 4px "+m}})}),O.createElement("div",{style:p.hash},"#"),O.createElement(nt,{label:null,style:{input:p.input},value:o.replace("#",""),onChange:f}),O.createElement("div",{style:p.clear})))};kh.propTypes={width:Se.oneOfType([Se.string,Se.number]),triangle:Se.oneOf(["hide","top-left","top-right"]),colors:Se.arrayOf(Se.string),styles:Se.object};kh.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};Dn(kh);var Mh=function(e){var n=We({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(e.hsl.h)+", "+Math.round(e.hsl.s*100)+"%, "+Math.round(e.hsl.l*100)+"%)"}}});return O.createElement("div",{style:n.picker})};Mh.propTypes={hsl:Se.shape({h:Se.number,s:Se.number,l:Se.number,a:Se.number})};Mh.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var Eh=function(e){var n=We({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(e.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return O.createElement("div",{style:n.picker})};Eh.propTypes={hsl:Se.shape({h:Se.number,s:Se.number,l:Se.number,a:Se.number})};Eh.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var U3=function(e){var n=e.onChange,r=e.rgb,o=e.hsl,i=e.hex,s=e.hsv,a=function(f,m){if(f.hex)To(f.hex)&&n({hex:f.hex,source:"hex"},m);else if(f.rgb){var g=f.rgb.split(",");ad(f.rgb,"rgb")&&n({r:g[0],g:g[1],b:g[2],a:1,source:"rgb"},m)}else if(f.hsv){var y=f.hsv.split(",");ad(f.hsv,"hsv")&&(y[2]=y[2].replace("%",""),y[1]=y[1].replace("%",""),y[0]=y[0].replace("°",""),y[1]==1?y[1]=.01:y[2]==1&&(y[2]=.01),n({h:Number(y[0]),s:Number(y[1]),v:Number(y[2]),source:"hsv"},m))}else if(f.hsl){var b=f.hsl.split(",");ad(f.hsl,"hsl")&&(b[2]=b[2].replace("%",""),b[1]=b[1].replace("%",""),b[0]=b[0].replace("°",""),d[1]==1?d[1]=.01:d[2]==1&&(d[2]=.01),n({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsl"},m))}},l=We({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),c=r.r+", "+r.g+", "+r.b,u=Math.round(o.h)+"°, "+Math.round(o.s*100)+"%, "+Math.round(o.l*100)+"%",d=Math.round(s.h)+"°, "+Math.round(s.s*100)+"%, "+Math.round(s.v*100)+"%";return O.createElement("div",{style:l.wrap,className:"flexbox-fix"},O.createElement("div",{style:l.fields},O.createElement("div",{style:l.double},O.createElement(nt,{style:{input:l.input,label:l.label},label:"hex",value:i,onChange:a})),O.createElement("div",{style:l.column},O.createElement("div",{style:l.single},O.createElement(nt,{style:{input:l.input2,label:l.label2},label:"rgb",value:c,onChange:a})),O.createElement("div",{style:l.single},O.createElement(nt,{style:{input:l.input2,label:l.label2},label:"hsv",value:d,onChange:a})),O.createElement("div",{style:l.single},O.createElement(nt,{style:{input:l.input2,label:l.label2},label:"hsl",value:u,onChange:a})))))},Th=function(e){var n=e.width,r=e.onChange,o=e.rgb,i=e.hsl,s=e.hsv,a=e.hex,l=e.header,c=e.styles,u=c===void 0?{}:c,d=e.className,p=d===void 0?"":d,f=We(Rn({default:{picker:{width:n,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+o.r+", "+o.g+", "+o.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},u));return O.createElement("div",{style:f.picker,className:"google-picker "+p},O.createElement("div",{style:f.head},l),O.createElement("div",{style:f.swatch}),O.createElement("div",{style:f.saturation},O.createElement(xu,{hsl:i,hsv:s,pointer:Mh,onChange:r})),O.createElement("div",{style:f.body},O.createElement("div",{style:f.controls,className:"flexbox-fix"},O.createElement("div",{style:f.hue},O.createElement(ys,{style:f.Hue,hsl:i,radius:"4px",pointer:Eh,onChange:r}))),O.createElement(U3,{rgb:o,hsl:i,hex:a,hsv:s,onChange:r})))};Th.propTypes={width:Se.oneOfType([Se.string,Se.number]),styles:Se.object,header:Se.string};Th.defaultProps={width:652,styles:{},header:"Color picker"};Dn(Th);const G3=t=>{let e=t.r.toString(16),n=t.g.toString(16),r=t.b.toString(16),o=Math.round(t.a*255).toString(16);return e.length===1&&(e="0"+e),n.length===1&&(n="0"+n),r.length===1&&(r="0"+r),o.length===1&&(o="0"+o),"#"+e+n+r+o},q3=t=>{const[e,n]=h.useState(null),{fieldDef:r,value:o,onChange:i,onBlur:s,disabled:a,skeleton:l,id:c}=t,[u,d]=h.useState(!1),[p,f]=h.useState(null),m=x=>{d(!u),n(x.currentTarget)},g=()=>{d(!1),n(null),s()},y=x=>{f(x),i(G3(x.rgb))},b=open?`${r.name}-popover`:void 0;return l?v.jsx(Xe,{variant:"rectangular",width:102,height:52}):v.jsxs(v.Fragment,{children:[v.jsx(qE,{disabled:a,color:(p==null?void 0:p.rgb)||o||{r:0,g:141,b:168,a:1},onClick:m,id:c}),!a&&v.jsx(KE,{id:b,open:u,anchorEl:e,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:v.jsx(N3,{color:o||_.newColors.realTeal[100],onChange:y})})]})},K3=h.memo(q3);function Tp(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function Y3(t,e){_e(2,arguments);var n=Lt(e);return Bf(t,n*1e3)}var J3=6e4;function Z3(t,e){_e(2,arguments);var n=Lt(e);return Bf(t,n*J3)}var X3=36e5;function Q3(t,e){_e(2,arguments);var n=Lt(e);return Bf(t,n*X3)}function eF(t,e){_e(2,arguments);var n=Lt(e),r=n*7;return Tp(t,r)}function Il(t,e){_e(2,arguments);var n=De(t),r=Lt(e);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());i.setMonth(n.getMonth()+r+1,0);var s=i.getDate();return o>=s?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}function zv(t,e){_e(2,arguments);var n=Lt(e);return Il(t,n*12)}function tF(t,e){_e(2,arguments);var n=De(t),r=De(e);return n.getFullYear()-r.getFullYear()}function ta(t,e){_e(2,arguments);var n=De(t),r=De(e),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function nF(t,e){_e(2,arguments);var n=De(t),r=De(e),o=ta(n,r),i=Math.abs(tF(n,r));n.setFullYear(1584),r.setFullYear(1584);var s=ta(n,r)===-o,a=o*(i-Number(s));return a===0?0:a}function rF(t,e){_e(2,arguments);var n=De(t),r=De(e),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function Op(t){_e(1,arguments);var e=De(t);return e.setHours(23,59,59,999),e}function Lp(t){_e(1,arguments);var e=De(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function oF(t){_e(1,arguments);var e=De(t);return Op(e).getTime()===Lp(e).getTime()}function A1(t,e){_e(2,arguments);var n=De(t),r=De(e),o=ta(n,r),i=Math.abs(rF(n,r)),s;if(i<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-o*i);var a=ta(n,r)===-o;oF(De(t))&&i===1&&ta(t,r)===1&&(a=!1),s=o*(i-Number(a))}return s===0?0:s}var Hv={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},iF="trunc";function Va(t){return t?Hv[t]:Hv[iF]}function sF(t,e,n){_e(2,arguments);var r=A1(t,e)/3;return Va(void 0)(r)}var aF=864e5;function lF(t,e){_e(2,arguments);var n=is(t),r=is(e),o=n.getTime()-mp(n),i=r.getTime()-mp(r);return Math.round((o-i)/aF)}function Vv(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function P1(t,e){_e(2,arguments);var n=De(t),r=De(e),o=Vv(n,r),i=Math.abs(lF(n,r));n.setDate(n.getDate()-o*i);var s=+(Vv(n,r)===-o),a=o*(i-s);return a===0?0:a}function cF(t,e,n){_e(2,arguments);var r=P1(t,e)/7;return Va(void 0)(r)}var Su=6e4,ku=36e5,uF=1e3;function Mu(t,e){return _e(2,arguments),De(t).getTime()-De(e).getTime()}function dF(t,e,n){_e(2,arguments);var r=Mu(t,e)/ku;return Va(void 0)(r)}function pF(t,e,n){_e(2,arguments);var r=Mu(t,e)/Su;return Va(void 0)(r)}function fF(t,e,n){_e(2,arguments);var r=Mu(t,e)/1e3;return Va(void 0)(r)}function hF(t,e){var n;_e(1,arguments);var r=t||{},o=De(r.start),i=De(r.end),s=i.getTime();if(!(o.getTime()<=s))throw new RangeError("Invalid interval");var a=[],l=o;l.setHours(0,0,0,0);var c=Number((n=void 0)!==null&&n!==void 0?n:1);if(c<1||isNaN(c))throw new RangeError("`options.step` must be a number greater than 1");for(;l.getTime()<=s;)a.push(De(l)),l.setDate(l.getDate()+c),l.setHours(0,0,0,0);return a}function cd(t,e){var n,r,o,i,s,a,l,c;_e(1,arguments);var u=du(),d=Lt((n=(r=(o=(i=e==null?void 0:e.weekStartsOn)!==null&&i!==void 0?i:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&o!==void 0?o:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=De(t),f=p.getDay(),m=(fr.getTime()}function xi(t,e){_e(2,arguments);var n=De(t),r=De(e);return n.getTime()=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return s=c.done,c},e:function(c){a=!0,i=c},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw i}}}}function EF(t,e){if(t==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function D1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(D1=function(){return!!t})()}function at(t){var e=D1();return function(){var n,r=Lg(t);if(e){var o=Lg(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return dT(this,n)}}var TF=10,I1=function(){function t(){rt(this,t),Le(this,"priority",void 0),Le(this,"subPriority",0)}return ot(t,[{key:"validate",value:function(n,r){return!0}}]),t}(),OF=function(t){st(n,t);var e=at(n);function n(r,o,i,s,a){var l;return rt(this,n),l=e.call(this),l.value=r,l.validateValue=o,l.setValue=i,l.priority=s,a&&(l.subPriority=a),l}return ot(n,[{key:"validate",value:function(o,i){return this.validateValue(o,this.value,i)}},{key:"set",value:function(o,i,s){return this.setValue(o,i,this.value,s)}}]),n}(I1),LF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s0,r=n?e:1-e,o;if(r<=50)o=t||100;else{var i=r+50,s=Math.floor(i/100)*100,a=t>=i%100;o=t+s-(a?100:0)}return n?o:1-o}function _1(t){return t%400===0||t%4===0&&t%100!==0}var PF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s0}},{key:"set",value:function(o,i,s){var a=o.getUTCFullYear();if(s.isTwoDigitYear){var l=N1(s.year,a);return o.setUTCFullYear(l,0,1),o.setUTCHours(0,0,0,0),o}var c=!("era"in i)||i.era===1?s.year:1-s.year;return o.setUTCFullYear(c,0,1),o.setUTCHours(0,0,0,0),o}}]),n}(dt),RF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s0}},{key:"set",value:function(o,i,s,a){var l=YE(o,a);if(s.isTwoDigitYear){var c=N1(s.year,l);return o.setUTCFullYear(c,0,a.firstWeekContainsDate),o.setUTCHours(0,0,0,0),gp(o,a)}var u=!("era"in i)||i.era===1?s.year:1-s.year;return o.setUTCFullYear(u,0,a.firstWeekContainsDate),o.setUTCHours(0,0,0,0),gp(o,a)}}]),n}(dt),DF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=4}},{key:"set",value:function(o,i,s){return o.setUTCMonth((s-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),n}(dt),NF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=4}},{key:"set",value:function(o,i,s){return o.setUTCMonth((s-1)*3,1),o.setUTCHours(0,0,0,0),o}}]),n}(dt),_F=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=11}},{key:"set",value:function(o,i,s){return o.setUTCMonth(s,1),o.setUTCHours(0,0,0,0),o}}]),n}(dt),FF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=11}},{key:"set",value:function(o,i,s){return o.setUTCMonth(s,1),o.setUTCHours(0,0,0,0),o}}]),n}(dt);function BF(t,e,n){_e(2,arguments);var r=De(t),o=Lt(e),i=JE(r,n)-o;return r.setUTCDate(r.getUTCDate()-i*7),r}var jF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=53}},{key:"set",value:function(o,i,s,a){return gp(BF(o,s,a),a)}}]),n}(dt);function zF(t,e){_e(2,arguments);var n=De(t),r=Lt(e),o=ZE(n)-r;return n.setUTCDate(n.getUTCDate()-o*7),n}var HF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=53}},{key:"set",value:function(o,i,s){return Lx(zF(o,s))}}]),n}(dt),VF=[31,28,31,30,31,30,31,31,30,31,30,31],WF=[31,29,31,30,31,30,31,31,30,31,30,31],UF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=WF[l]:i>=1&&i<=VF[l]}},{key:"set",value:function(o,i,s){return o.setUTCDate(s),o.setUTCHours(0,0,0,0),o}}]),n}(dt),GF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=366:i>=1&&i<=365}},{key:"set",value:function(o,i,s){return o.setUTCMonth(0,s),o.setUTCHours(0,0,0,0),o}}]),n}(dt);function Lh(t,e,n){var r,o,i,s,a,l,c,u;_e(2,arguments);var d=du(),p=Lt((r=(o=(i=(s=n==null?void 0:n.weekStartsOn)!==null&&s!==void 0?s:n==null||(a=n.locale)===null||a===void 0||(l=a.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&i!==void 0?i:d.weekStartsOn)!==null&&o!==void 0?o:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=De(t),m=Lt(e),g=f.getUTCDay(),y=m%7,b=(y+7)%7,x=(b=0&&i<=6}},{key:"set",value:function(o,i,s,a){return o=Lh(o,s,a),o.setUTCHours(0,0,0,0),o}}]),n}(dt),KF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=6}},{key:"set",value:function(o,i,s,a){return o=Lh(o,s,a),o.setUTCHours(0,0,0,0),o}}]),n}(dt),YF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=6}},{key:"set",value:function(o,i,s,a){return o=Lh(o,s,a),o.setUTCHours(0,0,0,0),o}}]),n}(dt);function JF(t,e){_e(2,arguments);var n=Lt(e);n%7===0&&(n=n-7);var r=1,o=De(t),i=o.getUTCDay(),s=n%7,a=(s+7)%7,l=(a=1&&i<=7}},{key:"set",value:function(o,i,s){return o=JF(o,s),o.setUTCHours(0,0,0,0),o}}]),n}(dt),XF=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=12}},{key:"set",value:function(o,i,s){var a=o.getUTCHours()>=12;return a&&s<12?o.setUTCHours(s+12,0,0,0):!a&&s===12?o.setUTCHours(0,0,0,0):o.setUTCHours(s,0,0,0),o}}]),n}(dt),nB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=23}},{key:"set",value:function(o,i,s){return o.setUTCHours(s,0,0,0),o}}]),n}(dt),rB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=11}},{key:"set",value:function(o,i,s){var a=o.getUTCHours()>=12;return a&&s<12?o.setUTCHours(s+12,0,0,0):o.setUTCHours(s,0,0,0),o}}]),n}(dt),oB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&i<=24}},{key:"set",value:function(o,i,s){var a=s<=24?s%24:s;return o.setUTCHours(a,0,0,0),o}}]),n}(dt),iB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=59}},{key:"set",value:function(o,i,s){return o.setUTCMinutes(s,0,0),o}}]),n}(dt),sB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=0&&i<=59}},{key:"set",value:function(o,i,s){return o.setUTCSeconds(s,0),o}}]),n}(dt),aB=function(t){st(n,t);var e=at(n);function n(){var r;rt(this,n);for(var o=arguments.length,i=new Array(o),s=0;s=1&&P<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var U=Lt((m=(g=(y=(b=r==null?void 0:r.weekStartsOn)!==null&&b!==void 0?b:r==null||(x=r.locale)===null||x===void 0||(S=x.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&y!==void 0?y:T.weekStartsOn)!==null&&g!==void 0?g:(E=T.locale)===null||E===void 0||(k=E.options)===null||k===void 0?void 0:k.weekStartsOn)!==null&&m!==void 0?m:0);if(!(U>=0&&U<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(M==="")return w===""?De(n):new Date(NaN);var N={firstWeekContainsDate:P,weekStartsOn:U,locale:D},K=[new LF],R=M.match(hB).map(function(H){var V=H[0];if(V in Tg){var fe=Tg[V];return fe(H,D.formatLong)}return H}).join("").match(fB),B=[],z=Uv(R),I;try{var oe=function(){var V=I.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&XE(V)&&Og(V,M,t),!(r!=null&&r.useAdditionalDayOfYearTokens)&&QE(V)&&Og(V,M,t);var fe=V[0],pe=pB[fe];if(pe){var he=pe.incompatibleTokens;if(Array.isArray(he)){var ke=B.find(function($){return he.includes($.token)||$.token===fe});if(ke)throw new RangeError("The format string mustn't contain `".concat(ke.fullToken,"` and `").concat(V,"` at the same time"))}else if(pe.incompatibleTokens==="*"&&B.length>0)throw new RangeError("The format string mustn't contain `".concat(V,"` and any other token at the same time"));B.push({token:fe,fullToken:V});var Te=pe.run(w,V,D.match,N);if(!Te)return{v:new Date(NaN)};K.push(Te.setter),w=Te.rest}else{if(fe.match(yB))throw new RangeError("Format string contains an unescaped latin alphabet character `"+fe+"`");if(V==="''"?V="'":fe==="'"&&(V=bB(V)),w.indexOf(V)===0)w=w.slice(V.length);else return{v:new Date(NaN)}}};for(z.s();!(I=z.n()).done;){var me=oe();if(pT(me)==="object")return me.v}}catch(H){z.e(H)}finally{z.f()}if(w.length>0&&vB.test(w))return new Date(NaN);var te=K.map(function(H){return H.priority}).sort(function(H,V){return V-H}).filter(function(H,V,fe){return fe.indexOf(H)===V}).map(function(H){return K.filter(function(V){return V.priority===H}).sort(function(V,fe){return fe.subPriority-V.subPriority})}).map(function(H){return H[0]}),G=De(n);if(isNaN(G.getTime()))return new Date(NaN);var X=eT(G,mp(G)),ie={},Y=Uv(te),C;try{for(Y.s();!(C=Y.n()).done;){var A=C.value;if(!A.validate(X,N))return new Date(NaN);var j=A.set(X,ie,N);Array.isArray(j)?(X=j[0],EF(ie,j[1])):X=j}}catch(H){Y.e(H)}finally{Y.f()}return X}function bB(t){return t.match(mB)[1].replace(gB,"'")}function xB(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return n.setDate(r),n}function wB(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return n.setHours(r),n}function CB(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return n.setMinutes(r),n}function SB(t,e){_e(2,arguments);var n=De(t),r=Lt(e),o=n.getFullYear(),i=n.getDate(),s=new Date(0);s.setFullYear(o,r,15),s.setHours(0,0,0,0);var a=R1(s);return n.setMonth(r,Math.min(i,a)),n}function kB(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return n.setSeconds(r),n}function MB(t,e){_e(2,arguments);var n=De(t),r=Lt(e);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}function fl(t){_e(1,arguments);var e=De(t);return e.setDate(1),e.setHours(0,0,0,0),e}function dd(t,e){var n,r,o,i,s,a,l,c;_e(1,arguments);var u=du(),d=Lt((n=(r=(o=(i=e==null?void 0:e.weekStartsOn)!==null&&i!==void 0?i:e==null||(s=e.locale)===null||s===void 0||(a=s.options)===null||a===void 0?void 0:a.weekStartsOn)!==null&&o!==void 0?o:u.weekStartsOn)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=De(t),f=p.getDay(),m=(f2)return e;if(/:/.test(n[0])?r=n[0]:(e.date=n[0],r=n[1],ml.timeZoneDelimiter.test(e.date)&&(e.date=t.split(ml.timeZoneDelimiter)[0],r=t.substr(e.date.length,t.length))),r){var o=ml.timezone.exec(r);o?(e.time=r.replace(o[1],""),e.timezone=o[1]):e.time=r}return e}function PB(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:NaN,restDateString:""};var o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?o:i*100,restDateString:t.slice((r[1]||r[2]).length)}}function RB(t,e){if(e===null)return new Date(NaN);var n=t.match(TB);if(!n)return new Date(NaN);var r=!!n[4],o=Es(n[1]),i=Es(n[2])-1,s=Es(n[3]),a=Es(n[4]),l=Es(n[5])-1;if(r)return BB(e,a,l)?$B(e,a,l):new Date(NaN);var c=new Date(0);return!_B(e,i,s)||!FB(e,o)?new Date(NaN):(c.setUTCFullYear(e,i,Math.max(o,s)),c)}function Es(t){return t?parseInt(t):1}function DB(t){var e=t.match(OB);if(!e)return NaN;var n=pd(e[1]),r=pd(e[2]),o=pd(e[3]);return jB(n,r,o)?n*ku+r*Su+o*1e3:NaN}function pd(t){return t&&parseFloat(t.replace(",","."))||0}function IB(t){if(t==="Z")return 0;var e=t.match(LB);if(!e)return 0;var n=e[1]==="+"?-1:1,r=parseInt(e[2]),o=e[3]&&parseInt(e[3])||0;return zB(r,o)?n*(r*ku+o*Su):NaN}function $B(t,e,n){var r=new Date(0);r.setUTCFullYear(t,0,4);var o=r.getUTCDay()||7,i=(e-1)*7+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}var NB=[31,null,31,30,31,30,31,31,30,31,30,31];function B1(t){return t%400===0||t%4===0&&t%100!==0}function _B(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(NB[e]||(B1(t)?29:28))}function FB(t,e){return e>=1&&e<=(B1(t)?366:365)}function BB(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}function jB(t,e,n){return t===24?e===0&&n===0:n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}function zB(t,e){return e>=0&&e<=59}function HB(t,e){var n,r;_e(1,arguments);var o=De(t);if(isNaN(o.getTime()))throw new RangeError("Invalid time value");var i=String((n=e==null?void 0:e.format)!==null&&n!==void 0?n:"extended"),s=String((r=e==null?void 0:e.representation)!==null&&r!==void 0?r:"complete");if(i!=="extended"&&i!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(s!=="date"&&s!=="time"&&s!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var a="",l="",c=i==="extended"?"-":"",u=i==="extended"?":":"";if(s!=="time"){var d=eo(o.getDate(),2),p=eo(o.getMonth()+1,2),f=eo(o.getFullYear(),4);a="".concat(f).concat(c).concat(p).concat(c).concat(d)}if(s!=="date"){var m=o.getTimezoneOffset();if(m!==0){var g=Math.abs(m),y=eo(Math.floor(g/60),2),b=eo(g%60,2),x=m<0?"+":"-";l="".concat(x).concat(y,":").concat(b)}else l="Z";var S=eo(o.getHours(),2),E=eo(o.getMinutes(),2),k=eo(o.getSeconds(),2),w=a===""?"":"T",M=[S,E,k].join(u);a="".concat(a).concat(w).concat(M).concat(l)}return a}function VB(t,e){_e(2,arguments);var n=De(t).getTime(),r=De(e.start).getTime(),o=De(e.end).getTime();if(!(r<=o))throw new RangeError("Invalid interval");return n>=r&&n<=o}var Ap={exports:{}};(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},r=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},o=function(l,c){var u=l.match(/(P+)(p+)?/)||[],d=u[1],p=u[2];if(!p)return n(l,c);var f;switch(d){case"P":f=c.dateTime({width:"short"});break;case"PP":f=c.dateTime({width:"medium"});break;case"PPP":f=c.dateTime({width:"long"});break;case"PPPP":default:f=c.dateTime({width:"full"});break}return f.replace("{{date}}",n(d,c)).replace("{{time}}",r(p,c))},i={p:r,P:o},s=i;e.default=s,t.exports=e.default})(Ap,Ap.exports);var WB=Ap.exports;const UB=Aa(WB),GB={dayOfMonth:"d",fullDate:"PP",fullDateWithWeekday:"PPPP",fullDateTime:"PP p",fullDateTime12h:"PP hh:mm aaa",fullDateTime24h:"PP HH:mm",fullTime:"p",fullTime12h:"hh:mm aaa",fullTime24h:"HH:mm",hours12h:"hh",hours24h:"HH",keyboardDate:"P",keyboardDateTime:"P p",keyboardDateTime12h:"P hh:mm aaa",keyboardDateTime24h:"P HH:mm",minutes:"mm",month:"LLLL",monthAndDate:"MMMM d",monthAndYear:"LLLL yyyy",monthShort:"MMM",weekday:"EEEE",weekdayShort:"EEE",normalDate:"d MMMM",normalDateWithWeekday:"EEE, MMM d",seconds:"ss",shortDate:"MMM d",year:"yyyy"};class j1{constructor({locale:e,formats:n}={}){this.lib="date-fns",this.is12HourCycleInCurrentLocale=()=>{var r;return this.locale?/a/.test((r=this.locale.formatLong)===null||r===void 0?void 0:r.time()):!0},this.getFormatHelperText=r=>{var o,i;const s=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,a=this.locale||Ax;return(i=(o=r.match(s))===null||o===void 0?void 0:o.map(l=>{const c=l[0];if(c==="p"||c==="P"){const u=UB[c];return u(l,a.formatLong,{})}return l}).join("").replace(/(aaa|aa|a)/g,"(a|p)m").toLocaleLowerCase())!==null&&i!==void 0?i:r},this.parseISO=r=>EB(r),this.toISO=r=>HB(r,{format:"extended"}),this.getCurrentLocaleCode=()=>{var r;return((r=this.locale)===null||r===void 0?void 0:r.code)||"en-US"},this.addSeconds=(r,o)=>Y3(r,o),this.addMinutes=(r,o)=>Z3(r,o),this.addHours=(r,o)=>Q3(r,o),this.addDays=(r,o)=>Tp(r,o),this.addWeeks=(r,o)=>eF(r,o),this.addMonths=(r,o)=>Il(r,o),this.addYears=(r,o)=>zv(r,o),this.isValid=r=>Px(this.date(r)),this.getDiff=(r,o,i)=>{var s;const a=(s=this.date(o))!==null&&s!==void 0?s:r;if(!this.isValid(a))return 0;switch(i){case"years":return nF(r,a);case"quarters":return sF(r,a);case"months":return A1(r,a);case"weeks":return cF(r,a);case"days":return P1(r,a);case"hours":return dF(r,a);case"minutes":return pF(r,a);case"seconds":return fF(r,a);default:return Mu(r,a)}},this.isAfter=(r,o)=>pl(r,o),this.isBefore=(r,o)=>xi(r,o),this.startOfDay=r=>is(r),this.endOfDay=r=>Op(r),this.getHours=r=>vF(r),this.setHours=(r,o)=>wB(r,o),this.setMinutes=(r,o)=>CB(r,o),this.getSeconds=r=>xF(r),this.setSeconds=(r,o)=>kB(r,o),this.isSameDay=(r,o)=>UT(r,o),this.isSameMonth=(r,o)=>kF(r,o),this.isSameYear=(r,o)=>SF(r,o),this.isSameHour=(r,o)=>MF(r,o),this.startOfYear=r=>hl(r),this.endOfYear=r=>ud(r),this.startOfMonth=r=>fl(r),this.endOfMonth=r=>Lp(r),this.startOfWeek=r=>dd(r,{locale:this.locale}),this.endOfWeek=r=>cd(r,{locale:this.locale}),this.getYear=r=>wF(r),this.setYear=(r,o)=>MB(r,o),this.date=r=>typeof r>"u"?new Date:r===null?null:new Date(r),this.toJsDate=r=>r,this.parse=(r,o)=>r===""?null:F1(r,o,new Date,{locale:this.locale}),this.format=(r,o)=>this.formatByString(r,this.formats[o]),this.formatByString=(r,o)=>Ki(r,o,{locale:this.locale}),this.isEqual=(r,o)=>r===null&&o===null?!0:CF(r,o),this.isNull=r=>r===null,this.isAfterDay=(r,o)=>pl(r,Op(o)),this.isBeforeDay=(r,o)=>xi(r,is(o)),this.isBeforeYear=(r,o)=>xi(r,hl(o)),this.isAfterYear=(r,o)=>pl(r,ud(o)),this.isWithinRange=(r,[o,i])=>VB(r,{start:o,end:i}),this.formatNumber=r=>r,this.getMinutes=r=>yF(r),this.getDate=r=>mF(r),this.setDate=(r,o)=>xB(r,o),this.getMonth=r=>bF(r),this.getDaysInMonth=r=>R1(r),this.setMonth=(r,o)=>SB(r,o),this.getMeridiemText=r=>r==="am"?"AM":"PM",this.getNextMonth=r=>Il(r,1),this.getPreviousMonth=r=>Il(r,-1),this.getMonthArray=r=>{const i=[hl(r)];for(;i.length<12;){const s=i[i.length-1];i.push(this.getNextMonth(s))}return i},this.mergeDateAndTime=(r,o)=>this.setSeconds(this.setMinutes(this.setHours(r,this.getHours(o)),this.getMinutes(o)),this.getSeconds(o)),this.getWeekdays=()=>{const r=new Date;return hF({start:dd(r,{locale:this.locale}),end:cd(r,{locale:this.locale})}).map(o=>this.formatByString(o,"EEEEEE"))},this.getWeekArray=r=>{const o=dd(fl(r),{locale:this.locale}),i=cd(Lp(r),{locale:this.locale});let s=0,a=o;const l=[];let c=null;for(;xi(a,i);){const u=Math.floor(s/7);l[u]=l[u]||[];const d=gF(a);c!==d&&(c=d,l[u].push(a),s+=1),a=Tp(a,1)}return l},this.getYearRange=(r,o)=>{const i=hl(r),s=ud(o),a=[];let l=i;for(;xi(l,s);)a.push(l),l=zv(l,1);return a},this.locale=e,this.formats=Object.assign({},GB,n)}isBeforeMonth(e,n){return xi(e,fl(n))}isAfterMonth(e,n){return pl(e,fl(n))}}const qB=t=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:J({},t)}}}}),z1={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"open previous view",openNextView:"open next view",calendarViewSwitchingButtonAriaLabel:t=>t==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",clockLabelText:(t,e,n)=>`Select ${t}. ${e===null?"No time selected":`Selected time is ${n.format(e,"fullTime")}`}`,hoursClockNumberText:t=>`${t} hours`,minutesClockNumberText:t=>`${t} minutes`,secondsClockNumberText:t=>`${t} seconds`,openDatePickerDialogue:(t,e)=>t&&e.isValid(e.date(t))?`Choose date, selected date is ${e.format(e.date(t),"fullDate")}`:"Choose date",openTimePickerDialogue:(t,e)=>t&&e.isValid(e.date(t))?`Choose time, selected time is ${e.format(e.date(t),"fullTime")}`:"Choose time",timeTableLabel:"pick time",dateTableLabel:"pick date"},KB=z1;qB(z1);const H1=h.createContext(null);function V1(t){const e=Kr({props:t,name:"MuiLocalizationProvider"}),{children:n,dateAdapter:r,dateFormats:o,dateLibInstance:i,locale:s,adapterLocale:a,localeText:l}=e,c=h.useMemo(()=>new r({locale:a??s,formats:o,instance:i}),[r,s,a,o,i]),u=h.useMemo(()=>({minDate:c.date("1900-01-01T00:00:00.000"),maxDate:c.date("2099-12-31T00:00:00.000")}),[c]),d=h.useMemo(()=>({utils:c,defaultDates:u,localeText:J({},KB,l??{})}),[u,c,l]);return v.jsx(H1.Provider,{value:d,children:n})}const Wa=()=>{const t=h.useContext(H1);if(t===null)throw new Error("MUI: Can not find utils in context. It looks like you forgot to wrap your component in LocalizationProvider, or pass dateAdapter prop directly.");return t},Bt=()=>Wa().utils,Eu=()=>Wa().defaultDates,xs=()=>Wa().localeText,Ua=()=>{const t=Bt();return h.useRef(t.date()).current},fd=({date:t,disableFuture:e,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,utils:s})=>{const a=s.startOfDay(s.date());n&&s.isBefore(o,a)&&(o=a),e&&s.isAfter(r,a)&&(r=a);let l=t,c=t;for(s.isBefore(t,o)&&(l=s.date(o),c=null),s.isAfter(t,r)&&(c&&(c=s.date(r)),l=null);l||c;){if(l&&s.isAfter(l,r)&&(l=null),c&&s.isBefore(c,o)&&(c=null),l){if(!i(l))return l;l=s.addDays(l,1)}if(c){if(!i(c))return c;c=s.addDays(c,-1)}}return null},W1=(t,e)=>{const n=t.date(e);return t.isValid(n)?n:null},U1=t=>t.length===1&&t[0]==="year",G1=t=>t.length===2&&t.indexOf("month")!==-1&&t.indexOf("year")!==-1,YB=(t,e)=>U1(t)?{inputFormat:e.formats.year}:G1(t)?{disableMaskedInput:!0,inputFormat:e.formats.monthAndYear}:{inputFormat:e.formats.keyboardDate};function JB(t,e){var n;const r=Bt(),o=Eu(),i=Kr({props:t,name:e}),s=(n=i.views)!=null?n:["year","day"];return J({openTo:"day",minDate:o.minDate,maxDate:o.maxDate},YB(s,r),i,{views:s})}const ZB={emptyValue:null,getTodayValue:t=>t.date(),parseInput:W1,areValuesEqual:(t,e,n)=>t.isEqual(e,n)};function XB(t){return En("MuiCollapse",t)}At("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const QB=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],ej=t=>{const{orientation:e,classes:n}=t,r={root:["root",`${e}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${e}`],wrapperInner:["wrapperInner",`${e}`]};return Tn(r,XB,n)},tj=Ee("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.orientation],n.state==="entered"&&e.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&e.hidden]}})(({theme:t,ownerState:e})=>J({height:0,overflow:"hidden",transition:t.transitions.create("height")},e.orientation==="horizontal"&&{height:"auto",width:0,transition:t.transitions.create("width")},e.state==="entered"&&J({height:"auto",overflow:"visible"},e.orientation==="horizontal"&&{width:"auto"}),e.state==="exited"&&!e.in&&e.collapsedSize==="0px"&&{visibility:"hidden"})),nj=Ee("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(t,e)=>e.wrapper})(({ownerState:t})=>J({display:"flex",width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),rj=Ee("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(t,e)=>e.wrapperInner})(({ownerState:t})=>J({width:"100%"},t.orientation==="horizontal"&&{width:"auto",height:"100%"})),q1=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiCollapse"}),{addEndListener:o,children:i,className:s,collapsedSize:a="0px",component:l,easing:c,in:u,onEnter:d,onEntered:p,onEntering:f,onExit:m,onExited:g,onExiting:y,orientation:b="vertical",style:x,timeout:S=kE.standard,TransitionComponent:E=Ex}=r,k=tt(r,QB),w=J({},r,{orientation:b,collapsedSize:a}),M=ej(w),T=ms(),D=BE(),P=h.useRef(null),U=h.useRef(),N=typeof a=="number"?`${a}px`:a,K=b==="horizontal",R=K?"width":"height",B=h.useRef(null),z=Wr(n,B),I=A=>j=>{if(A){const H=B.current;j===void 0?A(H):A(H,j)}},oe=()=>P.current?P.current[K?"clientWidth":"clientHeight"]:0,me=I((A,j)=>{P.current&&K&&(P.current.style.position="absolute"),A.style[R]=N,d&&d(A,j)}),te=I((A,j)=>{const H=oe();P.current&&K&&(P.current.style.position="");const{duration:V,easing:fe}=Eg({style:x,timeout:S,easing:c},{mode:"enter"});if(S==="auto"){const pe=T.transitions.getAutoHeightDuration(H);A.style.transitionDuration=`${pe}ms`,U.current=pe}else A.style.transitionDuration=typeof V=="string"?V:`${V}ms`;A.style[R]=`${H}px`,A.style.transitionTimingFunction=fe,f&&f(A,j)}),G=I((A,j)=>{A.style[R]="auto",p&&p(A,j)}),X=I(A=>{A.style[R]=`${oe()}px`,m&&m(A)}),ie=I(g),Y=I(A=>{const j=oe(),{duration:H,easing:V}=Eg({style:x,timeout:S,easing:c},{mode:"exit"});if(S==="auto"){const fe=T.transitions.getAutoHeightDuration(j);A.style.transitionDuration=`${fe}ms`,U.current=fe}else A.style.transitionDuration=typeof H=="string"?H:`${H}ms`;A.style[R]=N,A.style.transitionTimingFunction=V,y&&y(A)}),C=A=>{S==="auto"&&D.start(U.current||0,A),o&&o(B.current,A)};return v.jsx(E,J({in:u,onEnter:me,onEntered:G,onEntering:te,onExit:X,onExited:ie,onExiting:Y,addEndListener:C,nodeRef:B,timeout:S==="auto"?null:S},k,{children:(A,j)=>v.jsx(tj,J({as:l,className:Hn(M.root,s,{entered:M.entered,exited:!u&&N==="0px"&&M.hidden}[A]),style:J({[K?"minWidth":"minHeight"]:N},x),ref:z},j,{ownerState:J({},w,{state:A}),children:v.jsx(nj,{ownerState:J({},w,{state:A}),className:M.wrapper,ref:P,children:v.jsx(rj,{ownerState:J({},w,{state:A}),className:M.wrapperInner,children:i})})}))}))});q1.muiSupportAuto=!0;const K1=h.createContext({}),oj=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],ij=["component","slots","slotProps"],sj=["component"];function aj(t,e){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,getSlotOwnerState:s,internalForwardedProps:a}=e,l=tt(e,oj),{component:c,slots:u={[t]:void 0},slotProps:d={[t]:void 0}}=i;tt(i,ij);const p=u[t]||r,f=DE(d[t],o),m=IE(J({className:n},l,{externalForwardedProps:void 0,externalSlotProps:f})),{props:{component:g},internalRef:y}=m,b=tt(m.props,sj),x=Wr(y,f==null?void 0:f.ref,e.ref),S=s?s(b):{},E=J({},o,S),k=g,w=$E(p,J({},t==="root",!u[t]&&a,b,k&&{as:k},{ref:x}),E);return Object.keys(S).forEach(M=>{delete w[M]}),[p,w]}function lj(t){return En("MuiAccordion",t)}const gl=At("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),cj=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","slots","slotProps","TransitionComponent","TransitionProps"],uj=t=>{const{classes:e,square:n,expanded:r,disabled:o,disableGutters:i}=t;return Tn({root:["root",!n&&"rounded",r&&"expanded",o&&"disabled",!i&&"gutters"],region:["region"]},lj,e)},dj=Ee(Ia,{name:"MuiAccordion",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[{[`& .${gl.region}`]:e.region},e.root,!n.square&&e.rounded,!n.disableGutters&&e.gutters]}})(({theme:t})=>{const e={duration:t.transitions.duration.shortest};return{position:"relative",transition:t.transitions.create(["margin"],e),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(t.vars||t).palette.divider,transition:t.transitions.create(["opacity","background-color"],e)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${gl.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${gl.disabled}`]:{backgroundColor:(t.vars||t).palette.action.disabledBackground}}},({theme:t})=>({variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(t.vars||t).shape.borderRadius,borderBottomRightRadius:(t.vars||t).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${gl.expanded}`]:{margin:"16px 0"}}}]})),pj=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiAccordion"}),{children:o,className:i,defaultExpanded:s=!1,disabled:a=!1,disableGutters:l=!1,expanded:c,onChange:u,square:d=!1,slots:p={},slotProps:f={},TransitionComponent:m,TransitionProps:g}=r,y=tt(r,cj),[b,x]=es({controlled:c,default:s,name:"Accordion",state:"expanded"}),S=h.useCallback(K=>{x(!b),u&&u(K,!b)},[b,u,x]),[E,...k]=h.Children.toArray(o),w=h.useMemo(()=>({expanded:b,disabled:a,disableGutters:l,toggle:S}),[b,a,l,S]),M=J({},r,{square:d,disabled:a,disableGutters:l,expanded:b}),T=uj(M),D=J({transition:m},p),P=J({transition:g},f),[U,N]=aj("transition",{elementType:q1,externalForwardedProps:{slots:D,slotProps:P},ownerState:M});return v.jsxs(dj,J({className:Hn(T.root,i),ref:n,ownerState:M,square:d},y,{children:[v.jsx(K1.Provider,{value:w,children:E}),v.jsx(U,J({in:b,timeout:"auto"},N,{children:v.jsx("div",{"aria-labelledby":E.props.id,id:E.props["aria-controls"],role:"region",className:T.region,children:k})}))]}))});function fj(t){return En("MuiAccordionDetails",t)}At("MuiAccordionDetails",["root"]);const hj=["className"],mj=t=>{const{classes:e}=t;return Tn({root:["root"]},fj,e)},gj=Ee("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>({padding:t.spacing(1,2,2)})),vj=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiAccordionDetails"}),{className:o}=r,i=tt(r,hj),s=r,a=mj(s);return v.jsx(gj,J({className:Hn(a.root,o),ref:n,ownerState:s},i))});function yj(t){return En("MuiAccordionSummary",t)}const Ji=At("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),bj=["children","className","expandIcon","focusVisibleClassName","onClick"],xj=t=>{const{classes:e,expanded:n,disabled:r,disableGutters:o}=t;return Tn({root:["root",n&&"expanded",r&&"disabled",!o&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!o&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},yj,e)},wj=Ee(Rx,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(t,e)=>e.root})(({theme:t})=>{const e={duration:t.transitions.duration.shortest};return{display:"flex",minHeight:48,padding:t.spacing(0,2),transition:t.transitions.create(["min-height","background-color"],e),[`&.${Ji.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${Ji.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`&:hover:not(.${Ji.disabled})`]:{cursor:"pointer"},variants:[{props:n=>!n.disableGutters,style:{[`&.${Ji.expanded}`]:{minHeight:64}}}]}}),Cj=Ee("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(t,e)=>e.content})(({theme:t})=>({display:"flex",flexGrow:1,margin:"12px 0",variants:[{props:e=>!e.disableGutters,style:{transition:t.transitions.create(["margin"],{duration:t.transitions.duration.shortest}),[`&.${Ji.expanded}`]:{margin:"20px 0"}}}]})),Sj=Ee("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(t,e)=>e.expandIconWrapper})(({theme:t})=>({display:"flex",color:(t.vars||t).palette.action.active,transform:"rotate(0deg)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),[`&.${Ji.expanded}`]:{transform:"rotate(180deg)"}})),kj=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiAccordionSummary"}),{children:o,className:i,expandIcon:s,focusVisibleClassName:a,onClick:l}=r,c=tt(r,bj),{disabled:u=!1,disableGutters:d,expanded:p,toggle:f}=h.useContext(K1),m=b=>{f&&f(b),l&&l(b)},g=J({},r,{expanded:p,disabled:u,disableGutters:d}),y=xj(g);return v.jsxs(wj,J({focusRipple:!1,disableRipple:!0,disabled:u,component:"div","aria-expanded":p,className:Hn(y.root,i),focusVisibleClassName:Hn(y.focusVisible,a),onClick:m,ref:n,ownerState:g},c,{children:[v.jsx(Cj,{className:y.content,ownerState:g,children:o}),s&&v.jsx(Sj,{className:y.expandIconWrapper,ownerState:g,children:s})]}))}),Gv=h.createContext();function Mj(t){return En("MuiGrid",t)}const Ej=[0,1,2,3,4,5,6,7,8,9,10],Tj=["column-reverse","column","row-reverse","row"],Oj=["nowrap","wrap-reverse","wrap"],Ts=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],ga=At("MuiGrid",["root","container","item","zeroMinWidth",...Ej.map(t=>`spacing-xs-${t}`),...Tj.map(t=>`direction-xs-${t}`),...Oj.map(t=>`wrap-xs-${t}`),...Ts.map(t=>`grid-xs-${t}`),...Ts.map(t=>`grid-sm-${t}`),...Ts.map(t=>`grid-md-${t}`),...Ts.map(t=>`grid-lg-${t}`),...Ts.map(t=>`grid-xl-${t}`)]),Lj=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function ts(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function Aj({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,o)=>{let i={};if(e[o]&&(n=e[o]),!n)return r;if(n===!0)i={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=cu({values:e.columns,breakpoints:t.breakpoints.values}),a=typeof s=="object"?s[o]:s;if(a==null)return r;const l=`${Math.round(n/a*1e8)/1e6}%`;let c={};if(e.container&&e.item&&e.columnSpacing!==0){const u=t.spacing(e.columnSpacing);if(u!=="0px"){const d=`calc(${l} + ${ts(u)})`;c={flexBasis:d,maxWidth:d}}}i=J({flexBasis:l,flexGrow:0,maxWidth:l},c)}return t.breakpoints.values[o]===0?Object.assign(r,i):r[t.breakpoints.up(o)]=i,r},{})}function Pj({theme:t,ownerState:e}){const n=cu({values:e.direction,breakpoints:t.breakpoints.values});return Rf({theme:t},n,r=>{const o={flexDirection:r};return r.indexOf("column")===0&&(o[`& > .${ga.item}`]={maxWidth:"none"}),o})}function Y1({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(o=>{n===""&&e[o]!==0&&(n=o)});const r=Object.keys(t).sort((o,i)=>t[o]-t[i]);return r.slice(0,r.indexOf(n))}function Rj({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let o={};if(n&&r!==0){const i=cu({values:r,breakpoints:t.breakpoints.values});let s;typeof i=="object"&&(s=Y1({breakpoints:t.breakpoints.values,values:i})),o=Rf({theme:t},i,(a,l)=>{var c;const u=t.spacing(a);return u!=="0px"?{marginTop:`-${ts(u)}`,[`& > .${ga.item}`]:{paddingTop:ts(u)}}:(c=s)!=null&&c.includes(l)?{}:{marginTop:0,[`& > .${ga.item}`]:{paddingTop:0}}})}return o}function Dj({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let o={};if(n&&r!==0){const i=cu({values:r,breakpoints:t.breakpoints.values});let s;typeof i=="object"&&(s=Y1({breakpoints:t.breakpoints.values,values:i})),o=Rf({theme:t},i,(a,l)=>{var c;const u=t.spacing(a);return u!=="0px"?{width:`calc(100% + ${ts(u)})`,marginLeft:`-${ts(u)}`,[`& > .${ga.item}`]:{paddingLeft:ts(u)}}:(c=s)!=null&&c.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${ga.item}`]:{paddingLeft:0}}})}return o}function Ij(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(o=>{const i=t[o];Number(i)>0&&r.push(n[`spacing-${o}-${String(i)}`])}),r}const $j=Ee("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:o,item:i,spacing:s,wrap:a,zeroMinWidth:l,breakpoints:c}=n;let u=[];r&&(u=Ij(s,c,e));const d=[];return c.forEach(p=>{const f=n[p];f&&d.push(e[`grid-${p}-${String(f)}`])}),[e.root,r&&e.container,i&&e.item,l&&e.zeroMinWidth,...u,o!=="row"&&e[`direction-xs-${String(o)}`],a!=="wrap"&&e[`wrap-xs-${String(a)}`],...d]}})(({ownerState:t})=>J({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),Pj,Rj,Dj,Aj);function Nj(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const o=t[r];if(Number(o)>0){const i=`spacing-${r}-${String(o)}`;n.push(i)}}),n}const _j=t=>{const{classes:e,container:n,direction:r,item:o,spacing:i,wrap:s,zeroMinWidth:a,breakpoints:l}=t;let c=[];n&&(c=Nj(i,l));const u=[];l.forEach(p=>{const f=t[p];f&&u.push(`grid-${p}-${String(f)}`)});const d={root:["root",n&&"container",o&&"item",a&&"zeroMinWidth",...c,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return Tn(d,Mj,e)},Fj=h.forwardRef(function(e,n){const r=ii({props:e,name:"MuiGrid"}),{breakpoints:o}=ms(),i=ME(r),{className:s,columns:a,columnSpacing:l,component:c="div",container:u=!1,direction:d="row",item:p=!1,rowSpacing:f,spacing:m=0,wrap:g="wrap",zeroMinWidth:y=!1}=i,b=tt(i,Lj),x=f||m,S=l||m,E=h.useContext(Gv),k=u?a||12:E,w={},M=J({},b);o.keys.forEach(P=>{b[P]!=null&&(w[P]=b[P],delete M[P])});const T=J({},i,{columns:k,container:u,direction:d,item:p,rowSpacing:x,columnSpacing:S,wrap:g,zeroMinWidth:y,spacing:m},w,{breakpoints:o.keys}),D=_j(T);return v.jsx(Gv.Provider,{value:k,children:v.jsx($j,J({ownerState:T,className:Hn(D.root,s),as:c,ref:n},M))})});function J1(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;ee.root})(({theme:t,ownerState:e})=>J({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:t.spacing(2,3)},e.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"})),Wj=Ee(Fj,{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(t,e)=>e.content})({flex:1}),Uj=Ee(Mo,{name:"MuiPickersToolbar",slot:"PenIconButton",overridesResolver:(t,e)=>e.penIconButton})({}),Gj=t=>t==="clock"?v.jsx(X1,{color:"inherit"}):v.jsx(Z1,{color:"inherit"});function qj(t,e){return t?`text input view is open, go to ${e} view`:`${e} view is open, go to text input view`}const Q1=h.forwardRef(function(e,n){const{children:r,className:o,getMobileKeyboardInputViewButtonText:i=qj,isLandscape:s,isMobileKeyboardViewOpen:a,landscapeDirection:l="column",toggleMobileKeyboardView:c,toolbarTitle:u,viewType:d="calendar"}=e,p=e;return v.jsxs(Vj,{ref:n,className:nn(Zi.root,o),ownerState:p,children:[v.jsx(xo,{color:"text.secondary",variant:"overline",children:u}),v.jsxs(Wj,{container:!0,justifyContent:"space-between",className:Zi.content,ownerState:p,direction:s?l:"row",alignItems:s?"flex-start":"flex-end",children:[r,v.jsx(Uj,{onClick:c,className:nn(Zi.penIconButton,s&&Zi.penIconButtonLandscape),ownerState:p,color:"inherit","aria-label":i(a,d),children:a?Gj(d):v.jsx(Hj,{color:"inherit"})})]})]})}),Kj=["parsedValue","isLandscape","isMobileKeyboardViewOpen","onChange","toggleMobileKeyboardView","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],qv=At("MuiDatePickerToolbar",["root","title"]),Yj=Ee(Q1,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})({[`& .${Zi.penIconButton}`]:{position:"relative",top:4}}),Jj=Ee(xo,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(t,e)=>e.title})(({ownerState:t})=>J({},t.isLandscape&&{margin:"auto 16px auto auto"})),Zj=h.forwardRef(function(e,n){const{parsedValue:r,isLandscape:o,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,toolbarFormat:a,toolbarPlaceholder:l="––",toolbarTitle:c="Select date",views:u}=e,d=tt(e,Kj),p=Bt(),f=h.useMemo(()=>r?a?p.formatByString(r,a):U1(u)?p.format(r,"year"):G1(u)?p.format(r,"month"):/en/.test(p.getCurrentLocaleCode())?p.format(r,"normalDateWithWeekday"):p.format(r,"normalDate"):l,[r,a,l,p,u]),m=e;return v.jsx(Yj,J({ref:n,toolbarTitle:c,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:s,isLandscape:o,ownerState:m,className:qv.root},d,{children:v.jsx(Jj,{variant:"h4",align:o?"left":"center",ownerState:m,className:qv.title,children:f})}))}),fi=h.createContext(null),ew=t=>{const{onAccept:e,onClear:n,onCancel:r,onSetToday:o,actions:i}=t,s=h.useContext(fi),a=xs(),l=typeof i=="function"?i(s):i;if(l==null||l.length===0)return null;const c=l==null?void 0:l.map(u=>{switch(u){case"clear":return v.jsx(Is,{onClick:n,children:a.clearButtonLabel},u);case"cancel":return v.jsx(Is,{onClick:r,children:a.cancelButtonLabel},u);case"accept":return v.jsx(Is,{onClick:e,children:a.okButtonLabel},u);case"today":return v.jsx(Is,{onClick:o,children:a.todayButtonLabel},u);default:return null}});return v.jsx(fT,{children:c})},Xj=["onClick","onTouchStart"],Qj=Ee(si)(({theme:t})=>({zIndex:t.zIndex.modal})),e5=Ee(Ia)(({ownerState:t})=>J({transformOrigin:"top center",outline:0},t.placement==="top"&&{transformOrigin:"bottom center"}));function t5(t,e){return e.documentElement.clientWidth{if(!t)return;function l(){i.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),i.current=!1}},[t]);const s=$s(l=>{if(!i.current)return;const c=r.current;r.current=!1;const u=Zu(o.current);if(!o.current||"clientX"in l&&t5(l,u))return;if(n.current){n.current=!1;return}let d;l.composedPath?d=l.composedPath().indexOf(o.current)>-1:d=!u.documentElement.contains(l.target)||o.current.contains(l.target),!d&&!c&&e(l)}),a=()=>{r.current=!0};return h.useEffect(()=>{if(t){const l=Zu(o.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",c)}}},[t,s]),h.useEffect(()=>{if(t){const l=Zu(o.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[t,s]),[o,a,a]}const r5=t=>{var e;const{anchorEl:n,children:r,containerRef:o=null,onBlur:i,onClose:s,onClear:a,onAccept:l,onCancel:c,onSetToday:u,open:d,PopperProps:p,role:f,TransitionComponent:m=OE,TrapFocusProps:g,PaperProps:y={},components:b,componentsProps:x}=t;h.useEffect(()=>{function z(I){d&&(I.key==="Escape"||I.key==="Esc")&&s()}return document.addEventListener("keydown",z),()=>{document.removeEventListener("keydown",z)}},[s,d]);const S=h.useRef(null);h.useEffect(()=>{f!=="tooltip"&&(d?S.current=document.activeElement:S.current&&S.current instanceof HTMLElement&&S.current.focus())},[d,f]);const[E,k,w]=n5(d,i??s),M=h.useRef(null),T=Wr(M,o),D=Wr(T,E),P=t,{onClick:U,onTouchStart:N}=y,K=tt(y,Xj),R=z=>{z.key==="Escape"&&(z.stopPropagation(),s())},B=(e=b==null?void 0:b.ActionBar)!=null?e:ew;return v.jsx(Qj,J({transition:!0,role:f,open:d,anchorEl:n,ownerState:P,onKeyDown:R},p,{children:({TransitionProps:z,placement:I})=>v.jsx(NE,J({open:d,disableAutoFocus:!0,disableEnforceFocus:f==="tooltip",isEnabled:()=>!0},g,{children:v.jsx(m,J({},z,{children:v.jsxs(e5,J({tabIndex:-1,elevation:8,ref:D,onClick:oe=>{k(oe),U&&U(oe)},onTouchStart:oe=>{w(oe),N&&N(oe)},ownerState:J({},P,{placement:I})},K,{children:[r,v.jsx(B,J({onAccept:l,onClear:a,onCancel:c,onSetToday:u,actions:[]},x==null?void 0:x.actionBar))]}))}))}))}))};function tw(t){const{children:e,DateInputProps:n,KeyboardDateInputComponent:r,onClear:o,onDismiss:i,onCancel:s,onAccept:a,onSetToday:l,open:c,PopperProps:u,PaperProps:d,TransitionComponent:p,components:f,componentsProps:m}=t,g=h.useRef(null),y=Wr(n.inputRef,g);return v.jsxs(fi.Provider,{value:"desktop",children:[v.jsx(r,J({},n,{inputRef:y})),v.jsx(r5,{role:"dialog",open:c,anchorEl:g.current,TransitionComponent:p,PopperProps:u,PaperProps:d,onClose:i,onCancel:s,onClear:o,onAccept:a,onSetToday:l,components:f,componentsProps:m,children:e})]})}function No(t,e){return Array.isArray(e)?e.every(n=>t.indexOf(n)!==-1):t.indexOf(e)!==-1}const nw=(t,e)=>n=>{(n.key==="Enter"||n.key===" ")&&(t(),n.preventDefault(),n.stopPropagation())};function Ah({onChange:t,onViewChange:e,openTo:n,view:r,views:o}){var i,s;const[a,l]=es({name:"Picker",state:"view",controlled:r,default:n&&No(o,n)?n:o[0]}),c=(i=o[o.indexOf(a)-1])!=null?i:null,u=(s=o[o.indexOf(a)+1])!=null?s:null,d=h.useCallback(m=>{l(m),e&&e(m)},[l,e]),p=h.useCallback(()=>{u&&d(u)},[u,d]);return{handleChangeAndOpenNext:h.useCallback((m,g)=>{const y=g==="finish";t(m,y&&u?"partial":g),y&&p()},[u,t,p]),nextView:u,previousView:c,openNext:p,openView:a,setOpenView:d}}const ss=220,ho=36,va={x:ss/2,y:ss/2},rw={x:va.x,y:0},o5=rw.x-va.x,i5=rw.y-va.y,s5=t=>t*(180/Math.PI),ow=(t,e,n)=>{const r=e-va.x,o=n-va.y,i=Math.atan2(o5,i5)-Math.atan2(r,o);let s=s5(i);s=Math.round(s/t)*t,s%=360;const a=Math.floor(s/t)||0,l=r**2+o**2,c=Math.sqrt(l);return{value:a,distance:c}},a5=(t,e,n=1)=>{const r=n*6;let{value:o}=ow(r,t,e);return o=o*n%60,o},l5=(t,e,n)=>{const{value:r,distance:o}=ow(30,t,e);let i=r||12;return n?i%=12:oJ({width:2,backgroundColor:t.palette.primary.main,position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},e.toAnimateTransform&&{transition:t.transitions.create(["transform","height"])})),d5=Ee("div")(({theme:t,ownerState:e})=>J({width:4,height:4,backgroundColor:t.palette.primary.contrastText,borderRadius:"50%",position:"absolute",top:-21,left:`calc(50% - ${ho/2}px)`,border:`${(ho-4)/2}px solid ${t.palette.primary.main}`,boxSizing:"content-box"},e.hasSelected&&{backgroundColor:t.palette.primary.main}));class iw extends h.Component{constructor(...e){super(...e),this.state={toAnimateTransform:!1,previousType:void 0}}render(){const e=this.props,{className:n,isInner:r,type:o,value:i}=e,s=tt(e,c5),a=J({},this.props,this.state),l=()=>{let u=360/(o==="hours"?12:60)*i;return o==="hours"&&i>12&&(u-=360),{height:Math.round((r?.26:.4)*ss),transform:`rotateZ(${u}deg)`}};return v.jsx(u5,J({style:l(),className:n,ownerState:a},s,{children:v.jsx(d5,{ownerState:a})}))}}iw.getDerivedStateFromProps=(t,e)=>t.type!==e.previousType?{toAnimateTransform:!0,previousType:t.type}:{toAnimateTransform:!1,previousType:t.type};const p5=Ee("div")(({theme:t})=>({display:"flex",justifyContent:"center",alignItems:"center",margin:t.spacing(2)})),f5=Ee("div")({backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:220,width:220,flexShrink:0,position:"relative",pointerEvents:"none"}),h5=Ee("div")(({ownerState:t})=>J({width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",outline:0,touchAction:"none",userSelect:"none"},t.disabled?{}:{"@media (pointer: fine)":{cursor:"pointer",borderRadius:"50%"},"&:active":{cursor:"move"}})),m5=Ee("div")(({theme:t})=>({width:6,height:6,borderRadius:"50%",backgroundColor:t.palette.primary.main,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"})),g5=Ee(Mo)(({theme:t,ownerState:e})=>J({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,left:8},e.meridiemMode==="am"&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:t.palette.primary.light}})),v5=Ee(Mo)(({theme:t,ownerState:e})=>J({zIndex:1,position:"absolute",bottom:e.ampmInClock?64:8,right:8},e.meridiemMode==="pm"&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:t.palette.primary.light}}));function y5(t){const{ampm:e,ampmInClock:n,autoFocus:r,children:o,date:i,getClockLabelText:s,handleMeridiemChange:a,isTimeDisabled:l,meridiemMode:c,minutesStep:u=1,onChange:d,selectedId:p,type:f,value:m,disabled:g,readOnly:y}=t,b=t,x=Bt(),S=h.useContext(fi),E=h.useRef(!1),k=l(m,f),w=!e&&f==="hours"&&(m<1||m>12),M=(I,oe)=>{g||y||l(I,f)||d(I,oe)},T=(I,oe)=>{let{offsetX:me,offsetY:te}=I;if(me===void 0){const X=I.target.getBoundingClientRect();me=I.changedTouches[0].clientX-X.left,te=I.changedTouches[0].clientY-X.top}const G=f==="seconds"||f==="minutes"?a5(me,te,u):l5(me,te,!!e);M(G,oe)},D=I=>{E.current=!0,T(I,"shallow")},P=I=>{E.current&&(T(I,"finish"),E.current=!1)},U=I=>{I.buttons>0&&T(I.nativeEvent,"shallow")},N=I=>{E.current&&(E.current=!1),T(I.nativeEvent,"finish")},K=h.useMemo(()=>f==="hours"?!0:m%5===0,[f,m]),R=f==="minutes"?u:1,B=h.useRef(null);Nf(()=>{r&&B.current.focus()},[r]);const z=I=>{if(!E.current)switch(I.key){case"Home":M(0,"partial"),I.preventDefault();break;case"End":M(f==="minutes"?59:23,"partial"),I.preventDefault();break;case"ArrowUp":M(m+R,"partial"),I.preventDefault();break;case"ArrowDown":M(m-R,"partial"),I.preventDefault();break}};return v.jsxs(p5,{children:[v.jsxs(f5,{children:[v.jsx(h5,{onTouchMove:D,onTouchEnd:P,onMouseUp:N,onMouseMove:U,ownerState:{disabled:g}}),!k&&v.jsxs(h.Fragment,{children:[v.jsx(m5,{}),i&&v.jsx(iw,{type:f,value:m,isInner:w,hasSelected:K})]}),v.jsx("div",{"aria-activedescendant":p,"aria-label":s(f,i,x),ref:B,role:"listbox",onKeyDown:z,tabIndex:0,children:o})]}),e&&(S==="desktop"||n)&&v.jsxs(h.Fragment,{children:[v.jsx(g5,{onClick:y?void 0:()=>a("am"),disabled:g||c===null,ownerState:b,children:v.jsx(xo,{variant:"caption",children:"AM"})}),v.jsx(v5,{disabled:g||c===null,onClick:y?void 0:()=>a("pm"),ownerState:b,children:v.jsx(xo,{variant:"caption",children:"PM"})})]})]})}const sw=t=>()=>{},b5=["className","disabled","index","inner","label","selected"],sc=At("PrivateClockNumber",["selected","disabled"]),x5=Ee("span")(({theme:t,ownerState:e})=>J({height:ho,width:ho,position:"absolute",left:`calc((100% - ${ho}px) / 2)`,display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",color:t.palette.text.primary,fontFamily:t.typography.fontFamily,"&:focused":{backgroundColor:t.palette.background.paper},[`&.${sc.selected}`]:{color:t.palette.primary.contrastText},[`&.${sc.disabled}`]:{pointerEvents:"none",color:t.palette.text.disabled}},e.inner&&J({},t.typography.body2,{color:t.palette.text.secondary})));function aw(t){const{className:e,disabled:n,index:r,inner:o,label:i,selected:s}=t,a=tt(t,b5),l=t,c=r%12/12*Math.PI*2-Math.PI/2,u=(ss-ho-2)/2*(o?.65:1),d=Math.round(Math.cos(c)*u),p=Math.round(Math.sin(c)*u);return v.jsx(x5,J({className:nn(e,s&&sc.selected,n&&sc.disabled),"aria-disabled":n?!0:void 0,"aria-selected":s?!0:void 0,role:"option",style:{transform:`translate(${d}px, ${p+(ss-ho)/2}px`},ownerState:l},a,{children:i}))}const w5=({ampm:t,date:e,getClockNumberText:n,isDisabled:r,selectedId:o,utils:i})=>{const s=e?i.getHours(e):null,a=[],l=t?1:0,c=t?12:23,u=d=>s===null?!1:t?d===12?s===12||s===0:s===d||s-12===d:s===d;for(let d=l;d<=c;d+=1){let p=d.toString();d===0&&(p="00");const f=!t&&(d===0||d>12);p=i.formatNumber(p);const m=u(d);a.push(v.jsx(aw,{id:m?o:void 0,index:d,inner:f,selected:m,disabled:r(d),label:p,"aria-label":n(p)},d))}return a},Kv=({utils:t,value:e,isDisabled:n,getClockNumberText:r,selectedId:o})=>{const i=t.formatNumber;return[[5,i("05")],[10,i("10")],[15,i("15")],[20,i("20")],[25,i("25")],[30,i("30")],[35,i("35")],[40,i("40")],[45,i("45")],[50,i("50")],[55,i("55")],[0,i("00")]].map(([s,a],l)=>{const c=s===e;return v.jsx(aw,{label:a,id:c?o:void 0,index:l+1,inner:!1,disabled:n(s),selected:c,"aria-label":r(a)},s)})},C5=["children","className","components","componentsProps","isLeftDisabled","isLeftHidden","isRightDisabled","isRightHidden","leftArrowButtonText","onLeftClick","onRightClick","rightArrowButtonText"],vl=At("MuiPickersArrowSwitcher",["root","spacer","button"]),S5=Ee("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex"}),k5=Ee("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(t,e)=>e.spacer})(({theme:t})=>({width:t.spacing(3)})),Yv=Ee(Mo,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(t,e)=>e.button})(({ownerState:t})=>J({},t.hidden&&{visibility:"hidden"})),lw=h.forwardRef(function(e,n){const{children:r,className:o,components:i,componentsProps:s,isLeftDisabled:a,isLeftHidden:l,isRightDisabled:c,isRightHidden:u,leftArrowButtonText:d,onLeftClick:p,onRightClick:f,rightArrowButtonText:m}=e,g=tt(e,C5),b=ms().direction==="rtl",x=(s==null?void 0:s.leftArrowButton)||{},S=(i==null?void 0:i.LeftArrowIcon)||jj,E=(s==null?void 0:s.rightArrowButton)||{},k=(i==null?void 0:i.RightArrowIcon)||zj,w=e;return v.jsxs(S5,J({ref:n,className:nn(vl.root,o),ownerState:w},g,{children:[v.jsx(Yv,J({as:i==null?void 0:i.LeftArrowButton,size:"small","aria-label":d,title:d,disabled:a,edge:"end",onClick:p},x,{className:nn(vl.button,x.className),ownerState:J({},w,x,{hidden:l}),children:b?v.jsx(k,{}):v.jsx(S,{})})),r?v.jsx(xo,{variant:"subtitle1",component:"span",children:r}):v.jsx(k5,{className:vl.spacer,ownerState:w}),v.jsx(Yv,J({as:i==null?void 0:i.RightArrowButton,size:"small","aria-label":m,title:m,edge:"start",disabled:c,onClick:f},E,{className:nn(vl.button,E.className),ownerState:J({},w,E,{hidden:u}),children:b?v.jsx(S,{}):v.jsx(k,{})}))]}))}),M5=(t,e)=>t?e.getHours(t)>=12?"pm":"am":null,Pp=(t,e,n)=>n&&(t>=12?"pm":"am")!==e?e==="am"?t-12:t+12:t,E5=(t,e,n,r)=>{const o=Pp(r.getHours(t),e,n);return r.setHours(t,o)},Jv=(t,e)=>e.getHours(t)*3600+e.getMinutes(t)*60+e.getSeconds(t),cw=(t=!1,e)=>(n,r)=>t?e.isAfter(n,r):Jv(n,e)>Jv(r,e);function T5(t,{disableFuture:e,maxDate:n}){const r=Bt();return h.useMemo(()=>{const o=r.date(),i=r.startOfMonth(e&&r.isBefore(o,n)?o:n);return!r.isAfter(i,t)},[e,n,t,r])}function O5(t,{disablePast:e,minDate:n}){const r=Bt();return h.useMemo(()=>{const o=r.date(),i=r.startOfMonth(e&&r.isAfter(o,n)?o:n);return!r.isBefore(i,t)},[e,n,t,r])}function uw(t,e,n){const r=Bt(),o=M5(t,r),i=h.useCallback(s=>{const a=t==null?null:E5(t,s,!!e,r);n(a,"partial")},[e,t,n,r]);return{meridiemMode:o,handleMeridiemChange:i}}function L5(t){return En("MuiClockPicker",t)}At("MuiClockPicker",["root","arrowSwitcher"]);const Rp=36,Ph=2,dw=320,A5=358,Rh=Ee("div")({overflowX:"hidden",width:dw,maxHeight:A5,display:"flex",flexDirection:"column",margin:"0 auto"}),P5=t=>{const{classes:e}=t;return Tn({root:["root"],arrowSwitcher:["arrowSwitcher"]},L5,e)},R5=Ee(Rh,{name:"MuiClockPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),D5=Ee(lw,{name:"MuiClockPicker",slot:"ArrowSwitcher",overridesResolver:(t,e)=>e.arrowSwitcher})({position:"absolute",right:12,top:15}),I5=sw(),$5=h.forwardRef(function(e,n){const r=Kr({props:e,name:"MuiClockPicker"}),{ampm:o=!1,ampmInClock:i=!1,autoFocus:s,components:a,componentsProps:l,date:c,disableIgnoringDatePartForTimeValidation:u,getClockLabelText:d,getHoursClockNumberText:p,getMinutesClockNumberText:f,getSecondsClockNumberText:m,leftArrowButtonText:g,maxTime:y,minTime:b,minutesStep:x=1,rightArrowButtonText:S,shouldDisableTime:E,showViewSwitcher:k,onChange:w,view:M,views:T=["hours","minutes"],openTo:D,onViewChange:P,className:U,disabled:N,readOnly:K}=r;I5({leftArrowButtonText:g,rightArrowButtonText:S,getClockLabelText:d,getHoursClockNumberText:p,getMinutesClockNumberText:f,getSecondsClockNumberText:m});const R=xs(),B=g??R.openPreviousView,z=S??R.openNextView,I=d??R.clockLabelText,oe=p??R.hoursClockNumberText,me=f??R.minutesClockNumberText,te=m??R.secondsClockNumberText,{openView:G,setOpenView:X,nextView:ie,previousView:Y,handleChangeAndOpenNext:C}=Ah({view:M,views:T,openTo:D,onViewChange:P,onChange:w}),A=Ua(),j=Bt(),H=h.useMemo(()=>c||j.setSeconds(j.setMinutes(j.setHours(A,0),0),0),[c,A,j]),{meridiemMode:V,handleMeridiemChange:fe}=uw(H,o,C),pe=h.useCallback((F,de)=>{const Z=cw(u,j),ae=({start:be,end:ye})=>!(b&&Z(b,ye)||y&&Z(be,y)),ue=(be,ye=1)=>be%ye!==0?!1:E?!E(be,de):!0;switch(de){case"hours":{const be=Pp(F,V,o),ye=j.setHours(H,be),ge=j.setSeconds(j.setMinutes(ye,0),0),ce=j.setSeconds(j.setMinutes(ye,59),59);return!ae({start:ge,end:ce})||!ue(be)}case"minutes":{const be=j.setMinutes(H,F),ye=j.setSeconds(be,0),ge=j.setSeconds(be,59);return!ae({start:ye,end:ge})||!ue(F,x)}case"seconds":{const be=j.setSeconds(H,F);return!ae({start:be,end:be})||!ue(F)}default:throw new Error("not supported")}},[o,H,u,y,V,b,x,E,j]),he=$f(),ke=h.useMemo(()=>{switch(G){case"hours":{const F=(de,Z)=>{const ae=Pp(de,V,o);C(j.setHours(H,ae),Z)};return{onChange:F,value:j.getHours(H),children:w5({date:c,utils:j,ampm:o,onChange:F,getClockNumberText:oe,isDisabled:de=>N||pe(de,"hours"),selectedId:he})}}case"minutes":{const F=j.getMinutes(H),de=(Z,ae)=>{C(j.setMinutes(H,Z),ae)};return{value:F,onChange:de,children:Kv({utils:j,value:F,onChange:de,getClockNumberText:me,isDisabled:Z=>N||pe(Z,"minutes"),selectedId:he})}}case"seconds":{const F=j.getSeconds(H),de=(Z,ae)=>{C(j.setSeconds(H,Z),ae)};return{value:F,onChange:de,children:Kv({utils:j,value:F,onChange:de,getClockNumberText:te,isDisabled:Z=>N||pe(Z,"seconds"),selectedId:he})}}default:throw new Error("You must provide the type for ClockView")}},[G,j,c,o,oe,me,te,V,C,H,pe,he,N]),Te=r,$=P5(Te);return v.jsxs(R5,{ref:n,className:nn($.root,U),ownerState:Te,children:[k&&v.jsx(D5,{className:$.arrowSwitcher,leftArrowButtonText:B,rightArrowButtonText:z,components:a,componentsProps:l,onLeftClick:()=>X(Y),onRightClick:()=>X(ie),isLeftDisabled:!Y,isRightDisabled:!ie,ownerState:Te}),v.jsx(y5,J({autoFocus:s,date:c,ampmInClock:i,type:G,ampm:o,getClockLabelText:I,minutesStep:x,isTimeDisabled:pe,meridiemMode:V,handleMeridiemChange:fe,selectedId:he,disabled:N,readOnly:K},ke))]})}),N5=["disabled","onSelect","selected","value"],Dp=At("PrivatePickersMonth",["root","selected"]),_5=Ee(xo)(({theme:t})=>J({flex:"1 0 33.33%",display:"flex",alignItems:"center",justifyContent:"center",color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:Jl(t.palette.action.active,t.palette.action.hoverOpacity)},"&:disabled":{pointerEvents:"none",color:t.palette.text.secondary},[`&.${Dp.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),F5=t=>{const{disabled:e,onSelect:n,selected:r,value:o}=t,i=tt(t,N5),s=()=>{n(o)};return v.jsx(_5,J({component:"button",type:"button",className:nn(Dp.root,r&&Dp.selected),tabIndex:e?-1:0,onClick:s,onKeyDown:nw(s),color:r?"primary":void 0,variant:r?"h5":"subtitle1",disabled:e},i))};function B5(t){return En("MuiMonthPicker",t)}At("MuiMonthPicker",["root"]);const j5=["className","date","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly"],z5=t=>{const{classes:e}=t;return Tn({root:["root"]},B5,e)},H5=Ee("div",{name:"MuiMonthPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({width:310,display:"flex",flexWrap:"wrap",alignContent:"stretch",margin:"0 4px"}),V5=h.forwardRef(function(e,n){const r=Bt(),o=Ua(),i=Eu(),s=Kr({props:e,name:"MuiMonthPicker"}),{className:a,date:l,disabled:c,disableFuture:u,disablePast:d,maxDate:p=i.maxDate,minDate:f=i.minDate,onChange:m,shouldDisableMonth:g,readOnly:y}=s,b=tt(s,j5),x=s,S=z5(x),E=l??o,k=r.getMonth(E),w=T=>{const D=r.startOfMonth(d&&r.isAfter(o,f)?o:f),P=r.startOfMonth(u&&r.isBefore(o,p)?o:p);return r.isBefore(T,D)||r.isAfter(T,P)?!0:g?g(T):!1},M=T=>{if(y)return;const D=r.setMonth(E,T);m(D,"finish")};return v.jsx(H5,J({ref:n,className:nn(S.root,a),ownerState:x},b,{children:r.getMonthArray(E).map(T=>{const D=r.getMonth(T),P=r.format(T,"monthShort");return v.jsx(F5,{value:D,selected:D===k,onSelect:M,disabled:c||w(T),children:P},P)})}))});function pw(t,e,n){const{value:r,onError:o}=t,i=Wa(),s=h.useRef(null),a=e({adapter:i,value:r,props:t});return h.useEffect(()=>{o&&!n(a,s.current)&&o(a,r),s.current=a},[n,o,s,a,r]),a}const fw=({props:t,value:e,adapter:n})=>{const r=n.utils.date(),o=n.utils.date(e),{shouldDisableDate:i,minDate:s=n.defaultDates.minDate,maxDate:a=n.defaultDates.maxDate,disableFuture:l,disablePast:c}=t;if(o===null)return null;switch(!0){case!n.utils.isValid(e):return"invalidDate";case!!(i&&i(o)):return"shouldDisableDate";case!!(l&&n.utils.isAfterDay(o,r)):return"disableFuture";case!!(c&&n.utils.isBeforeDay(o,r)):return"disablePast";case!!(s&&n.utils.isBeforeDay(o,s)):return"minDate";case!!(a&&n.utils.isAfterDay(o,a)):return"maxDate";default:return null}},hw=({shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:o})=>{const i=Wa();return h.useCallback(s=>fw({adapter:i,value:s,props:{shouldDisableDate:t,minDate:e,maxDate:n,disableFuture:r,disablePast:o}})!==null,[i,t,e,n,r,o])},W5=(t,e)=>t===e,U5=t=>pw(t,fw,W5),G5=(t,e,n)=>(r,o)=>{switch(o.type){case"changeMonth":return J({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!t});case"finishMonthSwitchingAnimation":return J({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&n.isSameDay(o.focusedDay,r.focusedDay))return r;const i=o.focusedDay!=null&&!e&&!n.isSameMonth(r.currentMonth,o.focusedDay);return J({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:i&&!t,currentMonth:i?n.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&n.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},q5=({date:t,defaultCalendarMonth:e,disableFuture:n,disablePast:r,disableSwitchToMonthOnDayFocus:o=!1,maxDate:i,minDate:s,onMonthChange:a,reduceAnimations:l,shouldDisableDate:c})=>{var u;const d=Ua(),p=Bt(),f=h.useRef(G5(!!l,o,p)).current,[m,g]=h.useReducer(f,{isMonthSwitchingAnimating:!1,focusedDay:t||d,currentMonth:p.startOfMonth((u=t??e)!=null?u:d),slideDirection:"left"}),y=h.useCallback(k=>{g(J({type:"changeMonth"},k)),a&&a(k.newMonth)},[a]),b=h.useCallback(k=>{const w=k??d;p.isSameMonth(w,m.currentMonth)||y({newMonth:p.startOfMonth(w),direction:p.isAfterDay(w,m.currentMonth)?"left":"right"})},[m.currentMonth,y,d,p]),x=hw({shouldDisableDate:c,minDate:s,maxDate:i,disableFuture:n,disablePast:r}),S=h.useCallback(()=>{g({type:"finishMonthSwitchingAnimation"})},[]),E=h.useCallback(k=>{x(k)||g({type:"changeFocusedDay",focusedDay:k})},[x]);return{calendarState:m,changeMonth:b,changeFocusedDay:E,isDateDisabled:x,onMonthSwitchingAnimationEnd:S,handleChangeMonth:y}},K5=At("PrivatePickersFadeTransitionGroup",["root"]),Zv=500,Y5=Ee(Dx)({display:"block",position:"relative"}),mw=({children:t,className:e,reduceAnimations:n,transKey:r})=>n?t:v.jsx(Y5,{className:nn(K5.root,e),children:v.jsx(Tx,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:Zv,enter:Zv/2,exit:0},children:t},r)});function J5(t){return En("MuiPickersDay",t)}const yl=At("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),Z5=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDayFocus","onDaySelect","onFocus","onKeyDown","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today"],X5=t=>{const{selected:e,disableMargin:n,disableHighlightToday:r,today:o,outsideCurrentMonth:i,showDaysOutsideCurrentMonth:s,classes:a}=t;return Tn({root:["root",e&&"selected",!n&&"dayWithMargin",!r&&o&&"today",i&&s&&"dayOutsideMonth"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},J5,a)},gw=({theme:t,ownerState:e})=>J({},t.typography.caption,{width:Rp,height:Rp,borderRadius:"50%",padding:0,backgroundColor:t.palette.background.paper,color:t.palette.text.primary,"&:hover":{backgroundColor:Jl(t.palette.action.active,t.palette.action.hoverOpacity)},"&:focus":{backgroundColor:Jl(t.palette.action.active,t.palette.action.hoverOpacity),[`&.${yl.selected}`]:{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${yl.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,fontWeight:t.typography.fontWeightMedium,transition:t.transitions.create("background-color",{duration:t.transitions.duration.short}),"&:hover":{willChange:"background-color",backgroundColor:t.palette.primary.dark}},[`&.${yl.disabled}`]:{color:t.palette.text.disabled}},!e.disableMargin&&{margin:`0 ${Ph}px`},e.outsideCurrentMonth&&e.showDaysOutsideCurrentMonth&&{color:t.palette.text.secondary},!e.disableHighlightToday&&e.today&&{[`&:not(.${yl.selected})`]:{border:`1px solid ${t.palette.text.secondary}`}}),vw=(t,e)=>{const{ownerState:n}=t;return[e.root,!n.disableMargin&&e.dayWithMargin,!n.disableHighlightToday&&n.today&&e.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&e.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&e.hiddenDaySpacingFiller]},Q5=Ee(Rx,{name:"MuiPickersDay",slot:"Root",overridesResolver:vw})(gw),e4=Ee("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:vw})(({theme:t,ownerState:e})=>J({},gw({theme:t,ownerState:e}),{visibility:"hidden"})),t4=()=>{},n4=h.forwardRef(function(e,n){const r=Kr({props:e,name:"MuiPickersDay"}),{autoFocus:o=!1,className:i,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:d,onDayFocus:p=t4,onDaySelect:f,onFocus:m,onKeyDown:g,outsideCurrentMonth:y,selected:b=!1,showDaysOutsideCurrentMonth:x=!1,children:S,today:E=!1}=r,k=tt(r,Z5),w=J({},r,{autoFocus:o,disabled:a,disableHighlightToday:l,disableMargin:c,selected:b,showDaysOutsideCurrentMonth:x,today:E}),M=X5(w),T=Bt(),D=h.useRef(null),P=Wr(D,n);Nf(()=>{o&&!a&&!u&&!y&&D.current.focus()},[o,a,u,y]);const U=B=>{p&&p(s),m&&m(B)},N=B=>{a||f(s,"finish"),d&&d(B)},K=ms();function R(B){switch(g!==void 0&&g(B),B.key){case"ArrowUp":p(T.addDays(s,-7)),B.preventDefault();break;case"ArrowDown":p(T.addDays(s,7)),B.preventDefault();break;case"ArrowLeft":p(T.addDays(s,K.direction==="ltr"?-1:1)),B.preventDefault();break;case"ArrowRight":p(T.addDays(s,K.direction==="ltr"?1:-1)),B.preventDefault();break;case"Home":p(T.startOfWeek(s)),B.preventDefault();break;case"End":p(T.endOfWeek(s)),B.preventDefault();break;case"PageUp":p(T.getNextMonth(s)),B.preventDefault();break;case"PageDown":p(T.getPreviousMonth(s)),B.preventDefault();break}}return y&&!x?v.jsx(e4,{className:nn(M.root,M.hiddenDaySpacingFiller,i),ownerState:w}):v.jsx(Q5,J({className:nn(M.root,i),ownerState:w,ref:P,centerRipple:!0,disabled:a,"aria-label":S?void 0:T.format(s,"fullDate"),tabIndex:b?0:-1,onFocus:U,onKeyDown:R,onClick:N},k,{children:S||T.format(s,"dayOfMonth")}))}),r4=(t,e)=>t.autoFocus===e.autoFocus&&t.isAnimating===e.isAnimating&&t.today===e.today&&t.disabled===e.disabled&&t.selected===e.selected&&t.disableMargin===e.disableMargin&&t.showDaysOutsideCurrentMonth===e.showDaysOutsideCurrentMonth&&t.disableHighlightToday===e.disableHighlightToday&&t.className===e.className&&t.outsideCurrentMonth===e.outsideCurrentMonth&&t.onDayFocus===e.onDayFocus&&t.onDaySelect===e.onDaySelect,o4=h.memo(n4,r4),i4=["children","className","reduceAnimations","slideDirection","transKey"],or=At("PrivatePickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),yw=350,s4=Ee(Dx)(({theme:t})=>{const e=t.transitions.create("transform",{duration:yw,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${or["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${or["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${or.slideEnterActive}`]:{transform:"translate(0%)",transition:e},[`& .${or.slideExit}`]:{transform:"translate(0%)"},[`& .${or["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:e,zIndex:0},[`& .${or["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:e,zIndex:0}}}),a4=t=>{let{children:e,className:n,reduceAnimations:r,slideDirection:o,transKey:i}=t,s=tt(t,i4);if(r)return v.jsx("div",{className:nn(or.root,n),children:e});const a={exit:or.slideExit,enterActive:or.slideEnterActive,enter:or[`slideEnter-${o}`],exitActive:or[`slideExitActiveLeft-${o}`]};return v.jsx(s4,{className:nn(or.root,n),childFactory:l=>h.cloneElement(l,{classNames:a}),children:v.jsx(Uf,J({mountOnEnter:!0,unmountOnExit:!0,timeout:yw,classNames:a},s,{children:e}),i)})},bw=(Rp+Ph*2)*6,l4=Ee("div")({display:"flex",justifyContent:"center",alignItems:"center"}),c4=Ee(xo)(({theme:t})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:t.palette.text.secondary})),u4=Ee("div")({display:"flex",justifyContent:"center",alignItems:"center",minHeight:bw}),d4=Ee(a4)({minHeight:bw}),p4=Ee("div")({overflow:"hidden"}),f4=Ee("div")({margin:`${Ph}px 0`,display:"flex",justifyContent:"center"});function h4(t){const e=Ua(),n=Bt(),{autoFocus:r,onFocusedDayChange:o,className:i,currentMonth:s,selectedDays:a,disabled:l,disableHighlightToday:c,focusedDay:u,isMonthSwitchingAnimating:d,loading:p,onSelectedDaysChange:f,onMonthSwitchingAnimationEnd:m,readOnly:g,reduceAnimations:y,renderDay:b,renderLoading:x=()=>v.jsx("span",{children:"..."}),showDaysOutsideCurrentMonth:S,slideDirection:E,TransitionProps:k,disablePast:w,disableFuture:M,minDate:T,maxDate:D,shouldDisableDate:P}=t,U=hw({shouldDisableDate:P,minDate:T,maxDate:D,disablePast:w,disableFuture:M}),N=h.useCallback((I,oe="finish")=>{g||f(I,oe)},[f,g]),K=n.getMonth(s),R=a.filter(I=>!!I).map(I=>n.startOfDay(I)),B=K,z=h.useMemo(()=>h.createRef(),[B]);return v.jsxs(h.Fragment,{children:[v.jsx(l4,{children:n.getWeekdays().map((I,oe)=>v.jsx(c4,{"aria-hidden":!0,variant:"caption",children:I.charAt(0).toUpperCase()},I+oe.toString()))}),p?v.jsx(u4,{children:x()}):v.jsx(d4,J({transKey:B,onExited:m,reduceAnimations:y,slideDirection:E,className:i},k,{nodeRef:z,children:v.jsx(p4,{ref:z,role:"grid",children:n.getWeekArray(s).map(I=>v.jsx(f4,{role:"row",children:I.map(oe=>{const me={key:oe==null?void 0:oe.toString(),day:oe,isAnimating:d,disabled:l||U(oe),autoFocus:r&&u!==null&&n.isSameDay(oe,u),today:n.isSameDay(oe,e),outsideCurrentMonth:n.getMonth(oe)!==K,selected:R.some(te=>n.isSameDay(te,oe)),disableHighlightToday:c,showDaysOutsideCurrentMonth:S,onDayFocus:o,onDaySelect:N};return b?b(oe,R,me):v.jsx("div",{role:"cell",children:v.jsx(o4,J({},me))},me.key)})},`week-${I[0]}`))})}))]})}const m4=Ee("div")({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),g4=Ee("div")(({theme:t})=>J({display:"flex",maxHeight:30,overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},t.typography.body1,{fontWeight:t.typography.fontWeightMedium})),v4=Ee("div")({marginRight:6}),y4=Ee(Mo)({marginRight:"auto"}),b4=Ee(Bj)(({theme:t,ownerState:e})=>J({willChange:"transform",transition:t.transitions.create("transform"),transform:"rotate(0deg)"},e.openView==="year"&&{transform:"rotate(180deg)"})),x4=sw();function w4(t){const{components:e={},componentsProps:n={},currentMonth:r,disabled:o,disableFuture:i,disablePast:s,getViewSwitchingButtonText:a,leftArrowButtonText:l,maxDate:c,minDate:u,onMonthChange:d,onViewChange:p,openView:f,reduceAnimations:m,rightArrowButtonText:g,views:y}=t;x4({leftArrowButtonText:l,rightArrowButtonText:g,getViewSwitchingButtonText:a});const b=xs(),x=l??b.previousMonth,S=g??b.nextMonth,E=a??b.calendarViewSwitchingButtonAriaLabel,k=Bt(),w=n.switchViewButton||{},M=()=>d(k.getNextMonth(r),"left"),T=()=>d(k.getPreviousMonth(r),"right"),D=T5(r,{disableFuture:i,maxDate:c}),P=O5(r,{disablePast:s,minDate:u}),U=()=>{if(!(y.length===1||!p||o))if(y.length===2)p(y.find(K=>K!==f)||y[0]);else{const K=y.indexOf(f)!==0?0:1;p(y[K])}};if(y.length===1&&y[0]==="year")return null;const N=t;return v.jsxs(m4,{ownerState:N,children:[v.jsxs(g4,{role:"presentation",onClick:U,ownerState:N,children:[v.jsx(mw,{reduceAnimations:m,transKey:k.format(r,"monthAndYear"),children:v.jsx(v4,{"aria-live":"polite",ownerState:N,children:k.format(r,"monthAndYear")})}),y.length>1&&!o&&v.jsx(y4,J({size:"small",as:e.SwitchViewButton,"aria-label":E(f)},w,{children:v.jsx(b4,{as:e.SwitchViewIcon,ownerState:N})}))]}),v.jsx(Tx,{in:f==="day",children:v.jsx(lw,{leftArrowButtonText:x,rightArrowButtonText:S,components:e,componentsProps:n,onLeftClick:T,onRightClick:M,isLeftDisabled:P,isRightDisabled:D})})]})}function C4(t){return En("PrivatePickersYear",t)}const Xv=At("PrivatePickersYear",["root","modeMobile","modeDesktop","yearButton","disabled","selected"]),S4=t=>{const{wrapperVariant:e,disabled:n,selected:r,classes:o}=t,i={root:["root",e&&`mode${Da(e)}`],yearButton:["yearButton",n&&"disabled",r&&"selected"]};return Tn(i,C4,o)},k4=Ee("div")(({ownerState:t})=>J({flexBasis:"33.3%",display:"flex",alignItems:"center",justifyContent:"center"},(t==null?void 0:t.wrapperVariant)==="desktop"&&{flexBasis:"25%"})),M4=Ee("button")(({theme:t})=>J({color:"unset",backgroundColor:"transparent",border:0,outline:0},t.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus, &:hover":{backgroundColor:Jl(t.palette.action.active,t.palette.action.hoverOpacity)},[`&.${Xv.disabled}`]:{color:t.palette.text.secondary},[`&.${Xv.selected}`]:{color:t.palette.primary.contrastText,backgroundColor:t.palette.primary.main,"&:focus, &:hover":{backgroundColor:t.palette.primary.dark}}})),E4=h.forwardRef(function(e,n){const{autoFocus:r,className:o,children:i,disabled:s,onClick:a,onKeyDown:l,selected:c,value:u}=e,d=h.useRef(null),p=Wr(d,n),f=h.useContext(fi),m=J({},e,{wrapperVariant:f}),g=S4(m);return h.useEffect(()=>{r&&d.current.focus()},[r]),v.jsx(k4,{className:nn(g.root,o),ownerState:m,children:v.jsx(M4,{ref:p,disabled:s,type:"button",tabIndex:c?0:-1,onClick:y=>a(y,u),onKeyDown:y=>l(y,u),className:g.yearButton,ownerState:m,children:i})})});function T4(t){return En("MuiYearPicker",t)}At("MuiYearPicker",["root"]);const O4=t=>{const{classes:e}=t;return Tn({root:["root"]},T4,e)},L4=Ee("div",{name:"MuiYearPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",margin:"0 4px"}),A4=h.forwardRef(function(e,n){const r=Ua(),o=ms(),i=Bt(),s=Eu(),a=Kr({props:e,name:"MuiYearPicker"}),{autoFocus:l,className:c,date:u,disabled:d,disableFuture:p,disablePast:f,maxDate:m=s.maxDate,minDate:g=s.minDate,onChange:y,readOnly:b,shouldDisableYear:x}=a,S=a,E=O4(S),k=u||r,w=i.getYear(k),M=h.useContext(fi),T=h.useRef(null),[D,P]=h.useState(w),U=h.useCallback(z=>!!(f&&i.isBeforeYear(z,r)||p&&i.isAfterYear(z,r)||g&&i.isBeforeYear(z,g)||m&&i.isAfterYear(z,m)||x&&x(z)),[p,f,m,g,r,x,i]),N=(z,I,oe="finish")=>{if(b)return;const me=i.setYear(k,I);y(me,oe)},K=h.useCallback(z=>{U(i.setYear(k,z))||P(z)},[k,U,i]),R=M==="desktop"?4:3,B=(z,I)=>{switch(z.key){case"ArrowUp":K(I-R),z.preventDefault();break;case"ArrowDown":K(I+R),z.preventDefault();break;case"ArrowLeft":K(I+(o.direction==="ltr"?-1:1)),z.preventDefault();break;case"ArrowRight":K(I+(o.direction==="ltr"?1:-1)),z.preventDefault();break}};return v.jsx(L4,{ref:n,className:nn(E.root,c),ownerState:S,children:i.getYearRange(g,m).map(z=>{const I=i.getYear(z),oe=I===w;return v.jsx(E4,{selected:oe,value:I,onClick:N,onKeyDown:B,autoFocus:l&&I===D,ref:oe?T:void 0,disabled:d||U(z),children:i.format(z,"year")},i.format(z,"year"))})})}),P4=typeof navigator<"u"&&/(android)/i.test(navigator.userAgent),R4=t=>En("MuiCalendarPicker",t);At("MuiCalendarPicker",["root","viewTransitionContainer"]);const D4=["autoFocus","onViewChange","date","disableFuture","disablePast","defaultCalendarMonth","loading","onChange","onYearChange","onMonthChange","reduceAnimations","renderLoading","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate"],I4=t=>{const{classes:e}=t;return Tn({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},R4,e)},$4=Ee(Rh,{name:"MuiCalendarPicker",slot:"Root",overridesResolver:(t,e)=>e.root})({display:"flex",flexDirection:"column"}),N4=Ee(mw,{name:"MuiCalendarPicker",slot:"ViewTransitionContainer",overridesResolver:(t,e)=>e.viewTransitionContainer})({overflowY:"auto"}),_4=h.forwardRef(function(e,n){const r=Bt(),o=Eu(),i=Kr({props:e,name:"MuiCalendarPicker"}),{autoFocus:s,onViewChange:a,date:l,disableFuture:c,disablePast:u,defaultCalendarMonth:d,loading:p=!1,onChange:f,onYearChange:m,onMonthChange:g,reduceAnimations:y=P4,renderLoading:b=()=>v.jsx("span",{children:"..."}),shouldDisableDate:x,shouldDisableMonth:S,shouldDisableYear:E,view:k,views:w=["year","day"],openTo:M="day",className:T,disabled:D,readOnly:P,minDate:U=o.minDate,maxDate:N=o.maxDate}=i,K=tt(i,D4),{openView:R,setOpenView:B,openNext:z}=Ah({view:k,views:w,openTo:M,onChange:f,onViewChange:a}),{calendarState:I,changeFocusedDay:oe,changeMonth:me,handleChangeMonth:te,isDateDisabled:G,onMonthSwitchingAnimationEnd:X}=q5({date:l,defaultCalendarMonth:d,reduceAnimations:y,onMonthChange:g,minDate:U,maxDate:N,shouldDisableDate:x,disablePast:u,disableFuture:c}),ie=h.useCallback((pe,he)=>{const ke=r.startOfMonth(pe),Te=r.endOfMonth(pe),$=G(pe)?fd({utils:r,date:pe,minDate:r.isBefore(U,ke)?ke:U,maxDate:r.isAfter(N,Te)?Te:N,disablePast:u,disableFuture:c,isDateDisabled:G}):pe;$?(f($,he),g==null||g(ke)):(z(),me(ke)),oe($)},[oe,c,u,G,N,U,f,g,me,z,r]),Y=h.useCallback((pe,he)=>{const ke=r.startOfYear(pe),Te=r.endOfYear(pe),$=G(pe)?fd({utils:r,date:pe,minDate:r.isBefore(U,ke)?ke:U,maxDate:r.isAfter(N,Te)?Te:N,disablePast:u,disableFuture:c,isDateDisabled:G}):pe;$?(f($,he),m==null||m($)):(z(),me(ke)),oe($)},[oe,c,u,G,N,U,f,m,z,r,me]),C=h.useCallback((pe,he)=>f(l&&pe?r.mergeDateAndTime(pe,l):pe,he),[r,l,f]);h.useEffect(()=>{if(l&&G(l)){const pe=fd({utils:r,date:l,minDate:U,maxDate:N,disablePast:u,disableFuture:c,isDateDisabled:G});f(pe,"partial")}},[]),h.useEffect(()=>{l&&me(l)},[l]);const A=i,j=I4(A),H={disablePast:u,disableFuture:c,maxDate:N,minDate:U},V=D&&l||U,fe=D&&l||N;return v.jsxs($4,{ref:n,className:nn(j.root,T),ownerState:A,children:[v.jsx(w4,J({},K,{views:w,openView:R,currentMonth:I.currentMonth,onViewChange:B,onMonthChange:(pe,he)=>te({newMonth:pe,direction:he}),minDate:V,maxDate:fe,disabled:D,disablePast:u,disableFuture:c,reduceAnimations:y})),v.jsx(N4,{reduceAnimations:y,className:j.viewTransitionContainer,transKey:R,ownerState:A,children:v.jsxs("div",{children:[R==="year"&&v.jsx(A4,J({},K,H,{autoFocus:s,date:l,onChange:Y,shouldDisableYear:E,disabled:D,readOnly:P})),R==="month"&&v.jsx(V5,J({},H,{className:T,date:l,onChange:ie,disabled:D,readOnly:P,shouldDisableMonth:S})),R==="day"&&v.jsx(h4,J({},K,I,H,{autoFocus:s,onMonthSwitchingAnimationEnd:X,onFocusedDayChange:oe,reduceAnimations:y,selectedDays:[l],onSelectedDaysChange:C,loading:p,renderLoading:b,disabled:D,readOnly:P,shouldDisableDate:x}))]})})]})}),F4=t=>{const[,e]=h.useReducer(l=>l+1,0),n=h.useRef(null),{replace:r,append:o}=t,i=r?r(t.format(t.value)):t.format(t.value),s=h.useRef(!1),a=l=>{const c=l.target.value;n.current=[c,l.target,c.length>i.length,s.current,i===t.format(c)],e()};return h.useLayoutEffect(()=>{if(n.current==null)return;let[l,c,u,d,p]=n.current;n.current=null;const f=d&&p,g=l.slice(c.selectionStart).search(t.accept||/\d/g),y=g!==-1?g:0,b=w=>(w.match(t.accept||/\d/g)||[]).join(""),x=b(l.substr(0,c.selectionStart)),S=w=>{let M=0,T=0;for(let D=0;D!==x.length;++D){let P=w.indexOf(x[D],M)+1,U=b(w).indexOf(x[D],T)+1;U-T>1&&(P=M,U=T),T=Math.max(U,T),M=Math.max(M,P)}return M};if(t.mask===!0&&u&&!p){let w=S(l);const M=b(l.substr(w))[0];w=l.indexOf(M,w),l=`${l.substr(0,w)}${l.substr(w+1)}`}let E=t.format(l);o!=null&&c.selectionStart===l.length&&!p&&(u?E=o(E):b(E.slice(-1))===""&&(E=E.slice(0,-1)));const k=r?r(E):E;return i===k?e():t.onChange(k),()=>{let w=S(E);if(t.mask!=null&&(u||d&&!f))for(;E[w]&&b(E[w])==="";)w+=1;c.selectionStart=c.selectionEnd=w+(f?1+y:0)}}),h.useEffect(()=>{const l=u=>{u.code==="Delete"&&(s.current=!0)},c=u=>{u.code==="Delete"&&(s.current=!1)};return document.addEventListener("keydown",l),document.addEventListener("keyup",c),()=>{document.removeEventListener("keydown",l),document.removeEventListener("keyup",c)}},[]),{value:n.current!=null?n.current[0]:i,onChange:a}},Ip=(t,e,n)=>{const r=t.date(e);return e===null?"":t.isValid(r)?t.formatByString(r,n):""},ac="_",xw="2019-11-21T22:30:00.000",ww="2019-01-01T09:00:00.000";function B4(t,e,n,r){if(t)return t;const i=r.formatByString(r.date(ww),e).replace(n,ac),s=r.formatByString(r.date(xw),e).replace(n,"_");return i===s?i:""}function j4(t,e,n,r){if(!t)return!1;const i=r.formatByString(r.date(ww),e).replace(n,ac),s=r.formatByString(r.date(xw),e).replace(n,"_"),a=s===i&&t===s;return!a&&r.lib,a}const z4=(t,e)=>n=>{let r=0;return n.split("").map((o,i)=>{if(e.lastIndex=0,r>t.length-1)return"";const s=t[r],a=t[r+1],l=e.test(o)?o:"",c=s===ac?l:s+l;return r+=c.length,i===n.length-1&&a&&a!==ac?c?c+a:"":c}).join("")},H4=({acceptRegex:t=/[\d]/gi,disabled:e,disableMaskedInput:n,ignoreInvalidInputs:r,inputFormat:o,inputProps:i,label:s,mask:a,onChange:l,rawValue:c,readOnly:u,rifmFormatter:d,TextFieldProps:p,validationError:f})=>{const m=Bt(),g=m.getFormatHelperText(o),{shouldUseMaskedInput:y,maskToUse:b}=h.useMemo(()=>{if(n)return{shouldUseMaskedInput:!1,maskToUse:""};const N=B4(a,o,t,m);return{shouldUseMaskedInput:j4(N,o,t,m),maskToUse:N}},[t,n,o,a,m]),x=h.useMemo(()=>y&&b?z4(b,t):N=>N,[t,b,y]),S=c===null?null:m.date(c),[E,k]=h.useState(S),[w,M]=h.useState(Ip(m,c,o)),T=h.useRef();h.useEffect(()=>{const N=c!==T.current;if(T.current=c,!N)return;const K=c===null?null:m.date(c);if(!(c===null||m.isValid(K))||m.isEqual(E,K))return;const B=Ip(m,c,o);k(K),M(B)},[m,c,o,E]);const D=N=>{const K=N===""||N===a?"":N;M(K);const R=K===null?null:m.parse(K,o);r&&!m.isValid(R)||(k(R),l(R,K||void 0))},P=F4({value:w,onChange:D,format:d||x});return J({label:s,disabled:e,error:f,inputProps:J({},y?P:{value:w,onChange:N=>{D(N.currentTarget.value)}},{disabled:e,placeholder:g,readOnly:u,type:y?"tel":"text"},i)},p)},V4=["components","disableOpenPicker","getOpenDialogAriaText","InputAdornmentProps","InputProps","inputRef","openPicker","OpenPickerButtonProps","renderInput"],Dh=h.forwardRef(function(e,n){const{components:r={},disableOpenPicker:o,getOpenDialogAriaText:i,InputAdornmentProps:s,InputProps:a,inputRef:l,openPicker:c,OpenPickerButtonProps:u,renderInput:d}=e,p=tt(e,V4),f=xs(),m=i??f.openDatePickerDialogue,g=Bt(),y=H4(p),b=(s==null?void 0:s.position)||"end",x=r.OpenPickerIcon||Z1;return d(J({ref:n,inputRef:l},y,{InputProps:J({},a,{[`${b}Adornment`]:o?void 0:v.jsx(fa,J({position:b},s,{children:v.jsx(Mo,J({edge:b,disabled:p.disabled||p.readOnly,"aria-label":m(p.rawValue,g)},u,{onClick:c,children:v.jsx(x,{})}))}))})}))});function Qv(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const W4=(t,e)=>{const[n,r]=h.useState(Qv);return Nf(()=>{const i=()=>{r(Qv())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),No(t,["hours","minutes","seconds"])?!1:(e||n)==="landscape"},U4=["autoFocus","className","parsedValue","DateInputProps","isMobileKeyboardViewOpen","onDateChange","onViewChange","openTo","orientation","showToolbar","toggleMobileKeyboardView","ToolbarComponent","toolbarFormat","toolbarPlaceholder","toolbarTitle","views"],G4=Ee("div")({padding:"16px 24px"}),q4=Ee("div")(({ownerState:t})=>J({display:"flex",flexDirection:"column"},t.isLandscape&&{flexDirection:"row"})),K4={fullWidth:!0},e0=t=>t==="year"||t==="month"||t==="day",t0=t=>t==="hours"||t==="minutes"||t==="seconds";function Ih(t){const{autoFocus:e,parsedValue:n,DateInputProps:r,isMobileKeyboardViewOpen:o,onDateChange:i,onViewChange:s,openTo:a,orientation:l,showToolbar:c,toggleMobileKeyboardView:u,ToolbarComponent:d=()=>null,toolbarFormat:p,toolbarPlaceholder:f,toolbarTitle:m,views:g}=t,y=tt(t,U4),b=W4(g,l),x=h.useContext(fi),S=c??x!=="desktop",E=h.useCallback((D,P)=>{i(D,x,P)},[i,x]),k=h.useCallback(D=>{o&&u(),s&&s(D)},[o,s,u]),{openView:w,setOpenView:M,handleChangeAndOpenNext:T}=Ah({view:void 0,views:g,openTo:a,onChange:E,onViewChange:k});return v.jsxs(q4,{ownerState:{isLandscape:b},children:[S&&v.jsx(d,J({},y,{views:g,isLandscape:b,parsedValue:n,onChange:E,setOpenView:M,openView:w,toolbarTitle:m,toolbarFormat:p,toolbarPlaceholder:f,isMobileKeyboardViewOpen:o,toggleMobileKeyboardView:u})),v.jsx(Rh,{children:o?v.jsx(G4,{children:v.jsx(Dh,J({},r,{ignoreInvalidInputs:!0,disableOpenPicker:!0,TextFieldProps:K4}))}):v.jsxs(h.Fragment,{children:[e0(w)&&v.jsx(_4,J({autoFocus:e,date:n,onViewChange:M,onChange:T,view:w,views:g.filter(e0)},y)),t0(w)&&v.jsx($5,J({},y,{autoFocus:e,date:n,view:w,views:g.filter(t0),onChange:T,onViewChange:M,showViewSwitcher:x==="desktop"}))]})})]})}const Y4=({open:t,onOpen:e,onClose:n})=>{const r=h.useRef(typeof t=="boolean").current,[o,i]=h.useState(!1);h.useEffect(()=>{if(r){if(typeof t!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(t)}},[r,t]);const s=h.useCallback(a=>{r||i(a),a&&e&&e(),!a&&n&&n()},[r,e,n]);return{isOpen:o,setIsOpen:s}},$h=(t,e)=>{const{onAccept:n,onChange:r,value:o,closeOnSelect:i}=t,s=Bt(),{isOpen:a,setIsOpen:l}=Y4(t),c=h.useMemo(()=>e.parseInput(s,o),[e,s,o]),[u,d]=h.useState(c),[p,f]=h.useState(()=>({committed:c,draft:c,resetFallback:c})),m=h.useCallback(w=>{f(M=>{switch(w.action){case"setAll":case"acceptAndClose":return{draft:w.value,committed:w.value,resetFallback:w.value};case"setCommitted":return J({},M,{draft:w.value,committed:w.value});case"setDraft":return J({},M,{draft:w.value});default:return M}}),!w.skipOnChangeCall&&!e.areValuesEqual(s,p.committed,w.value)&&r(w.value),w.action==="acceptAndClose"&&(l(!1),n&&!e.areValuesEqual(s,p.resetFallback,w.value)&&n(w.value))},[n,r,l,p,s,e]);h.useEffect(()=>{s.isValid(c)&&d(c)},[s,c]),h.useEffect(()=>{a&&m({action:"setAll",value:c,skipOnChangeCall:!0})},[a]),e.areValuesEqual(s,p.committed,c)||m({action:"setCommitted",value:c,skipOnChangeCall:!0});const g=h.useMemo(()=>({open:a,onClear:()=>{m({value:e.emptyValue,action:"acceptAndClose"})},onAccept:()=>{m({value:p.draft,action:"acceptAndClose"})},onDismiss:()=>{m({value:p.committed,action:"acceptAndClose"})},onCancel:()=>{m({value:p.resetFallback,action:"acceptAndClose"})},onSetToday:()=>{m({value:e.getTodayValue(s),action:"acceptAndClose"})}}),[m,a,s,p,e]),[y,b]=h.useState(!1),x=h.useMemo(()=>({parsedValue:p.draft,isMobileKeyboardViewOpen:y,toggleMobileKeyboardView:()=>b(!y),onDateChange:(w,M,T="partial")=>{switch(T){case"shallow":return m({action:"setDraft",value:w,skipOnChangeCall:!0});case"partial":return m({action:"setDraft",value:w});case"finish":return m(i??M==="desktop"?{value:w,action:"acceptAndClose"}:{value:w,action:"setCommitted"});default:throw new Error("MUI: Invalid selectionState passed to `onDateChange`")}}}),[m,y,p.draft,i]),S=h.useCallback((w,M)=>{const T=e.valueReducer?e.valueReducer(s,u,w):w;r(T,M)},[r,e,u,s]),E=h.useMemo(()=>({onChange:S,open:a,rawValue:o,openPicker:()=>l(!0)}),[S,a,o,l]),k={pickerProps:x,inputProps:E,wrapperProps:g};return h.useDebugValue(k,()=>({MuiPickerState:{dateState:p,other:k}})),k},J4=["onChange","PopperProps","PaperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps"],Z4=h.forwardRef(function(e,n){const r=JB(e,"MuiDesktopDatePicker"),o=U5(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=$h(r,ZB),{PopperProps:l,PaperProps:c,ToolbarComponent:u=Zj,TransitionComponent:d,components:p,componentsProps:f}=r,m=tt(r,J4),g=J({},s,m,{components:p,componentsProps:f,ref:n,validationError:o});return v.jsx(tw,J({},a,{DateInputProps:g,KeyboardDateInputComponent:Dh,PopperProps:l,PaperProps:c,TransitionComponent:d,components:p,componentsProps:f,children:v.jsx(Ih,J({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:g,components:p,componentsProps:f},m))}))}),X4={"& .MuiPaper-root":{border:`2px solid ${_.newColors.grey2[100]}`,boxShadow:"0px 1px 5px rgba(26, 26, 26, 0.161)"},"& .MuiPickersDay-today":{color:`${_.newColors.realTeal[100]} !important`,border:"none !important",fontFamily:_.fontFamily,fontWeight:_.fontWeight.bold,backgroundColor:"transparent !important","&:hover":{color:_.newColors.realTeal[100],backgroundColor:`${_.colors.tealOpacity} !important`}},"& .MuiPickersDay-dayWithMargin":{color:_.newColors.almostBlack[100],fontFamily:_.fontFamily,"&:hover":{color:_.newColors.realTeal[100],backgroundColor:_.colors.tealOpacity,fontWeight:_.fontWeight.bold}},"& .MuiIconButton-edgeStart, .MuiIconButton-edgeEnd":{color:_.newColors.grey4[100]},"& .MuiPickersDay-root.Mui-selected":{backgroundColor:`${_.newColors.realTeal[100]} !important`,color:"#FFFF !important",fontWeight:_.fontWeight.bold,"&:hover":{color:"#FFFF !important",backgroundColor:`${_.newColors.realTeal[100]} !important`}},"& .MuiCalendarPicker-root > div:first-of-type":{marginBottom:"16px",paddingLeft:"16px",paddingRight:"16px"}},Cw=Q.div` min-width: 0; .MuiOutlinedInput-root { @@ -499,14 +499,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .MuiIconButton-root { color: ${({$isPickerOpen:t})=>t?_.newColors.almostBlack[100]:_.newColors.grey3[100]}; } -`,Q4=Q(Af)` +`,Q4=Q(Pf)` width: 100%; `,e6=t=>{var p,f;const{fieldDef:e,onChange:n,value:r=null,onBlur:o,disabled:i,inputRef:s,id:a}=t,[l,c]=h.useState(!1),u=async()=>{c(!l),l&&o&&o()},d=m=>{var g;return v.jsx(Q4,{...m,id:a,onBlur:o,required:e.required,disabled:i,inputProps:{...m.inputProps,ref:s,placeholder:(g=e==null?void 0:e.inputSettings)==null?void 0:g.placeholder}})};return v.jsx(V1,{dateAdapter:j1,children:v.jsx(Cw,{"data-testid":"date-picker-test-id",$isPickerOpen:l,$disabled:i,children:v.jsx(Z4,{renderInput:d,inputFormat:Yi,value:r,onChange:n,onOpen:u,onClose:u,PopperProps:{sx:X4},minDate:(p=e==null?void 0:e.inputSettings)==null?void 0:p.minDate,maxDate:(f=e==null?void 0:e.inputSettings)==null?void 0:f.maxDate,disabled:i})})})},t6=Q.div` display: flex; flex-direction: column; -`;function n6(){return v.jsx(Xe,{variant:"rectangular",width:"100%",height:43})}const r6=t=>{const{fieldDef:e,onChange:n,value:r,onBlur:o,disabled:i,error:s,inputRef:a,skeleton:l,id:c}=t,{inputSettings:{minDate:u,maxDate:d}={}}=e,p=h.useMemo(()=>r||{date:null,keyboardInputValue:void 0},[r]),f=(m,g)=>n({date:m,keyboardInputValue:g});return l?v.jsx(n6,{}):v.jsx(t6,{children:v.jsx(e6,{id:c,error:s,onChange:f,fieldDef:{name:e==null?void 0:e.name,label:"",type:"",inputSettings:{placeholder:sT,minDate:u,maxDate:d},required:e==null?void 0:e.required},value:p==null?void 0:p.date,onBlur:o,disabled:i,inputRef:a})})},o6=h.memo(r6);function Sw(t,e){var n;const r=Kr({props:t,name:e}),o=Bt(),i=(n=r.ampm)!=null?n:o.is12HourCycleInCurrentLocale(),a=xs().openTimePickerDialogue;return J({ampm:i,openTo:"hours",views:["hours","minutes"],acceptRegex:i?/[\dapAP]/gi:/\d/gi,disableMaskedInput:!1,getOpenDialogAriaText:a,inputFormat:i?o.formats.fullTime12h:o.formats.fullTime24h},r,{components:J({OpenPickerIcon:X1},r.components)})}const kw={emptyValue:null,parseInput:W1,getTodayValue:t=>t.date(),areValuesEqual:(t,e,n)=>t.isEqual(e,n),valueReducer:(t,e,n)=>!e||!t.isValid(n)?n:t.mergeDateAndTime(e,n)},i6=["className","selected","value"],Mw=At("PrivatePickersToolbarText",["selected"]),s6=Ee(xo)(({theme:t})=>({transition:t.transitions.create("color"),color:t.palette.text.secondary,[`&.${Mw.selected}`]:{color:t.palette.text.primary}})),Ew=h.forwardRef(function(e,n){const{className:r,selected:o,value:i}=e,s=tt(e,i6);return v.jsx(s6,J({ref:n,className:nn(r,o&&Mw.selected),component:"span"},s,{children:i}))}),a6=["align","className","selected","typographyClassName","value","variant"],l6=Ee(Is)({padding:0,minWidth:16,textTransform:"none"}),Os=h.forwardRef(function(e,n){const{align:r,className:o,selected:i,typographyClassName:s,value:a,variant:l}=e,c=tt(e,a6);return v.jsx(l6,J({variant:"text",ref:n,className:o},c,{children:v.jsx(Ew,{align:r,className:s,variant:l,value:a,selected:i})}))});function c6(t){return En("MuiTimePickerToolbar",t)}const u6=At("MuiTimePickerToolbar",["root","separator","hourMinuteLabel","hourMinuteLabelLandscape","hourMinuteLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),d6=["ampm","ampmInClock","parsedValue","isLandscape","isMobileKeyboardViewOpen","onChange","openView","setOpenView","toggleMobileKeyboardView","toolbarTitle","views","disabled","readOnly"],p6=t=>{const{theme:e,isLandscape:n,classes:r}=t,o={root:["root"],separator:["separator"],hourMinuteLabel:["hourMinuteLabel",n&&"hourMinuteLabelLandscape",e.direction==="rtl"&&"hourMinuteLabelReverse"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]};return Tn(o,c6,r)},f6=Ee(Q1,{name:"MuiTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})({[`& .${Zi.penIconButtonLandscape}`]:{marginTop:"auto"}}),h6=Ee(Ew,{name:"MuiTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({outline:0,margin:"0 4px 0 2px",cursor:"default"}),m6=Ee("div",{name:"MuiTimePickerToolbar",slot:"HourMinuteLabel",overridesResolver:(t,e)=>e.hourMinuteLabel})(({theme:t,ownerState:e})=>J({display:"flex",justifyContent:"flex-end",alignItems:"flex-end"},e.isLandscape&&{marginTop:"auto"},t.direction==="rtl"&&{flexDirection:"row-reverse"})),g6=Ee("div",{name:"MuiTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(t,e)=>e.ampmSelection})(({ownerState:t})=>J({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12},t.isLandscape&&{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"},{[`& .${u6.ampmLabel}`]:{fontSize:17}})),Tw=t=>{const{ampm:e,ampmInClock:n,parsedValue:r,isLandscape:o,isMobileKeyboardViewOpen:i,onChange:s,openView:a,setOpenView:l,toggleMobileKeyboardView:c,toolbarTitle:u="Select time",views:d,disabled:p,readOnly:f}=t,m=tt(t,d6),g=Bt(),y=ms(),b=!!(e&&!n),{meridiemMode:x,handleMeridiemChange:S}=uw(r,e,s),E=T=>e?g.format(T,"hours12h"):g.format(T,"hours24h"),k=t,w=p6(J({},k,{theme:y})),M=v.jsx(h6,{tabIndex:-1,value:":",variant:"h3",selected:!1,className:w.separator});return v.jsxs(f6,J({viewType:"clock",landscapeDirection:"row",toolbarTitle:u,isLandscape:o,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:c,ownerState:k,className:w.root},m,{children:[v.jsxs(m6,{className:w.hourMinuteLabel,ownerState:k,children:[No(d,"hours")&&v.jsx(Os,{tabIndex:-1,variant:"h3",onClick:()=>l("hours"),selected:a==="hours",value:r?E(r):"--"}),No(d,["hours","minutes"])&&M,No(d,"minutes")&&v.jsx(Os,{tabIndex:-1,variant:"h3",onClick:()=>l("minutes"),selected:a==="minutes",value:r?g.format(r,"minutes"):"--"}),No(d,["minutes","seconds"])&&M,No(d,"seconds")&&v.jsx(Os,{variant:"h3",onClick:()=>l("seconds"),selected:a==="seconds",value:r?g.format(r,"seconds"):"--"})]}),b&&v.jsxs(g6,{className:w.ampmSelection,ownerState:k,children:[v.jsx(Os,{disableRipple:!0,variant:"subtitle2",selected:x==="am",typographyClassName:w.ampmLabel,value:g.getMeridiemText("am"),onClick:f?void 0:()=>S("am"),disabled:p}),v.jsx(Os,{disableRipple:!0,variant:"subtitle2",selected:x==="pm",typographyClassName:w.ampmLabel,value:g.getMeridiemText("pm"),onClick:f?void 0:()=>S("pm"),disabled:p})]})]}))},v6=({adapter:t,value:e,props:n})=>{const{minTime:r,maxTime:o,minutesStep:i,shouldDisableTime:s,disableIgnoringDatePartForTimeValidation:a}=n,l=t.utils.date(e),c=cw(a,t.utils);if(e===null)return null;switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(r&&c(r,l)):return"minTime";case!!(o&&c(l,o)):return"maxTime";case!!(s&&s(t.utils.getHours(l),"hours")):return"shouldDisableTime-hours";case!!(s&&s(t.utils.getMinutes(l),"minutes")):return"shouldDisableTime-minutes";case!!(s&&s(t.utils.getSeconds(l),"seconds")):return"shouldDisableTime-seconds";case!!(i&&t.utils.getMinutes(l)%i!==0):return"minutesStep";default:return null}},y6=(t,e)=>t===e,Ow=t=>pw(t,v6,y6),b6=["onChange","PaperProps","PopperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps"],x6=h.forwardRef(function(e,n){const r=Sw(e,"MuiDesktopTimePicker"),o=Ow(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=Ih(r,kw),{PaperProps:l,PopperProps:c,ToolbarComponent:u=Tw,TransitionComponent:d,components:p,componentsProps:f}=r,m=tt(r,b6),g=J({},s,m,{components:p,componentsProps:f,ref:n,validationError:o});return v.jsx(tw,J({},a,{DateInputProps:g,KeyboardDateInputComponent:Rh,PopperProps:c,PaperProps:l,TransitionComponent:d,components:p,componentsProps:f,children:v.jsx(Dh,J({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:g,components:p,componentsProps:f},m))}))}),w6=Ee(hT)({[`& .${Ag.container}`]:{outline:0},[`& .${Ag.paper}`]:{outline:0,minWidth:dw}}),C6=Ee(mT)({"&:first-of-type":{padding:0}}),S6=t=>{var e;const{children:n,DialogProps:r={},onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,components:u,componentsProps:d}=t,p=(e=u==null?void 0:u.ActionBar)!=null?e:ew;return v.jsxs(w6,J({open:c,onClose:s},r,{children:[v.jsx(C6,{children:n}),v.jsx(p,J({onAccept:o,onClear:i,onCancel:a,onSetToday:l,actions:["cancel","accept"]},d==null?void 0:d.actionBar))]}))},k6=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function M6(t){const{children:e,DateInputProps:n,DialogProps:r,onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,PureDateInputComponent:u,components:d,componentsProps:p}=t,f=tt(t,k6);return v.jsxs(fi.Provider,{value:"mobile",children:[v.jsx(u,J({components:d},f,n)),v.jsx(S6,{DialogProps:r,onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,components:d,componentsProps:p,children:e})]})}const E6=h.forwardRef(function(e,n){const{disabled:r,getOpenDialogAriaText:o,inputFormat:i,InputProps:s,inputRef:a,label:l,openPicker:c,rawValue:u,renderInput:d,TextFieldProps:p={},validationError:f}=e,m=xs(),g=o??m.openDatePickerDialogue,y=Bt(),b=h.useMemo(()=>J({},s,{readOnly:!0}),[s]),x=Dp(y,u,i);return d(J({label:l,disabled:r,ref:n,inputRef:a,error:f,InputProps:b,inputProps:J({disabled:r,readOnly:!0,"aria-readonly":!0,"aria-label":g(u,y),value:x},!e.readOnly&&{onClick:c},{onKeyDown:nw(c)})},p))}),T6=["ToolbarComponent","value","onChange","components","componentsProps"],O6=h.forwardRef(function(e,n){const r=Sw(e,"MuiMobileTimePicker"),o=Ow(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=Ih(r,kw),{ToolbarComponent:l=Tw,components:c,componentsProps:u}=r,d=tt(r,T6),p=J({},s,d,{components:c,componentsProps:u,ref:n,validationError:o});return v.jsx(M6,J({},d,a,{DateInputProps:p,PureDateInputComponent:E6,components:c,componentsProps:u,children:v.jsx(Dh,J({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:l,DateInputProps:p,components:c,componentsProps:u},d))}))}),L6=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],A6=h.forwardRef(function(e,n){const r=Kr({props:e,name:"MuiTimePicker"}),{desktopModeMediaQuery:o="@media (pointer: fine)",DialogProps:i,PopperProps:s,TransitionComponent:a}=r,l=tt(r,L6);return vT(o)?v.jsx(x6,J({ref:n,PopperProps:s,TransitionComponent:a},l)):v.jsx(O6,J({ref:n,DialogProps:i},l))}),P6=EE({palette:{primary:{main:_.newColors.realTeal[100]}}}),R6=t=>{const{fieldDef:e,onChange:n,value:r=null,onBlur:o,disabled:i,inputRef:s,id:a}=t,[l,c]=h.useState(!1),u=h.useCallback(async()=>{c(p=>(p&&o&&o(),!p))},[o]),d=p=>{var f;return v.jsx(Af,{...p,id:a,onBlur:o,required:e.required,disabled:i,inputProps:{...p.inputProps,placeholder:(f=e==null?void 0:e.inputSettings)==null?void 0:f.placeholder,ref:s}})};return v.jsx(V1,{dateAdapter:j1,children:v.jsx(WT,{theme:P6,children:v.jsx(Cw,{$isPickerOpen:l,$disabled:i,children:v.jsx(A6,{value:r,onChange:n,renderInput:d,onOpen:u,onClose:u,disabled:i})})})})};function D6(t){if(Array.isArray(t))return t;const[e,n]=t.split(":");if(!e||e.length!==2||!n||n.length!==2)throw new Error(`${t} is not a valid 24hr time. It must contain hour and minute components separated by a colon.`);const r=Number(e),o=Number(n);if(r!==r||r<0||r>23||o!==o||o<0||o>59)throw new Error(`${t} is not a valid 24hr time`);return[r,o,0,0]}function $h(t,e){const n=new Date(t.getTime()),[r,o,i]=typeof e=="string"?D6(e):Array.isArray(e)?e:[e.getHours(),e.getMinutes(),e.getSeconds()];return n.setHours(r,o,i,0),n}function I6(t){if(!t)return;const e=t.getTime();if(e===e)return t}function Lw(t,e){const n=F1(t,e,new Date);return Px(n)&&Ki(n,e)===t}function ya(){return{internalData:{},data:{},errors:{},disabled:!0,touched:{},submitWarning:{open:!1,lead:"",reasons:[]},waits:[],loadingInitial:!0}}function $6(){return{...ya(),initialData:{},fields:{},mounted:{},hasBlurred:{},hasSubmitted:!1,moveToError:!1,loadingInitial:!0}}function ur(t){return function(){throw new Error(t)}}const hi=h.createContext({state:ya(),methods:{addWait:ur("addWait requires a FormContext provider"),disableForm:ur("disableForm requires a FormContext provider"),init:ur("init requires a FormContext provider"),mountField:ur("mountField requires a FormContext provider"),removeWait:ur("removeWait requires a FormContext provider"),reset:ur("reset requires a FormContext provider"),setFieldBlur:ur("setFieldBlur requires a FormContext provider"),setFieldValue:ur("setFieldValue requires a FormContext provider"),setFormValues:ur("setFormValues requires a FormContext provider"),setSubmitWarning:ur("setSubmitWarning requires a FormContext provider"),submitForm:ur("submitForm requires a FormContext provider")}}),N6=t=>{const{fieldDef:e,onChange:n,value:r,onBlur:o,disabled:i,error:s,inputRef:a,id:l,skeleton:c,path:u}=t,{inputSettings:d={}}=e,{defaultTime:p}=d,f=h.useMemo(()=>r||{time:null,keyboardInputValue:void 0},[r]),{state:m}=h.useContext(hi),g=h.useMemo(()=>mr(m.internalData,[...u||[],"date"]),[m,u]);h.useEffect(()=>{n(b=>{if(!(!b||b.usingDefaultTime)||!p)return b;if(g!=null&&g.date)return{time:$h(new Date,p),validTime:!0,usingDefaultTime:!0}})},[g,p,n]);const y=(b,x)=>n({time:b,keyboardInputValue:x,usingDefaultTime:!b||!I6(b)});return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(R6,{id:l,error:s,onChange:y,fieldDef:{name:e==null?void 0:e.name,label:"",type:"timePicker",inputSettings:{placeholder:aT}},value:f==null?void 0:f.time,onBlur:o,disabled:i,inputRef:a})},_6=h.memo(N6);var Aw={};(function(t){t.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},t.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},t.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},t.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},t.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},t.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},t.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},t.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},t.realToAlias=function(){var e=Object.prototype.hasOwnProperty,n=t.aliasToReal,r={};for(var o in n){var i=n[o];e.call(r,i)?r[i].push(o):r[i]=[o]}return r}(),t.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},t.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},t.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}})(Aw);var fd,n0;function Nh(){return n0||(n0=1,fd={}),fd}var Zt=Aw,F6=Nh(),r0=Array.prototype.push;function B6(t,e){return e==2?function(n,r){return t.apply(void 0,arguments)}:function(n){return t.apply(void 0,arguments)}}function hd(t,e){return e==2?function(n,r){return t(n,r)}:function(n){return t(n)}}function o0(t){for(var e=t?t.length:0,n=Array(e);e--;)n[e]=t[e];return n}function j6(t){return function(e){return t({},e)}}function z6(t,e){return function(){for(var n=arguments.length,r=n-1,o=Array(n);n--;)o[n]=arguments[n];var i=o[e],s=o.slice(0,e);return i&&r0.apply(s,i),e!=r&&r0.apply(s,o.slice(e+1)),t.apply(this,s)}}function md(t,e){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var o=r[0]=e.apply(void 0,r);return t.apply(void 0,r),o}}}function Ip(t,e,n,r){var o=typeof e=="function",i=e===Object(e);if(i&&(r=n,n=e,e=void 0),n==null)throw new TypeError;r||(r={});var s={cap:"cap"in r?r.cap:!0,curry:"curry"in r?r.curry:!0,fixed:"fixed"in r?r.fixed:!0,immutable:"immutable"in r?r.immutable:!0,rearg:"rearg"in r?r.rearg:!0},a=o?n:F6,l="curry"in r&&r.curry,c="fixed"in r&&r.fixed,u="rearg"in r&&r.rearg,d=o?n.runInContext():void 0,p=o?n:{ary:t.ary,assign:t.assign,clone:t.clone,curry:t.curry,forEach:t.forEach,isArray:t.isArray,isError:t.isError,isFunction:t.isFunction,isWeakMap:t.isWeakMap,iteratee:t.iteratee,keys:t.keys,rearg:t.rearg,toInteger:t.toInteger,toPath:t.toPath},f=p.ary,m=p.assign,g=p.clone,y=p.curry,b=p.forEach,x=p.isArray,S=p.isError,E=p.isFunction,k=p.isWeakMap,w=p.keys,M=p.rearg,T=p.toInteger,D=p.toPath,P=w(Zt.aryMethod),U={castArray:function(C){return function(){var A=arguments[0];return x(A)?C(o0(A)):C.apply(void 0,arguments)}},iteratee:function(C){return function(){var A=arguments[0],j=arguments[1],H=C(A,j),V=H.length;return s.cap&&typeof j=="number"?(j=j>2?j-2:1,V&&V<=j?H:hd(H,j)):H}},mixin:function(C){return function(A){var j=this;if(!E(j))return C(j,Object(A));var H=[];return b(w(A),function(V){E(A[V])&&H.push([V,j.prototype[V]])}),C(j,Object(A)),b(H,function(V){var fe=V[1];E(fe)?j.prototype[V[0]]=fe:delete j.prototype[V[0]]}),j}},nthArg:function(C){return function(A){var j=A<0?1:T(A)+1;return y(C(A),j)}},rearg:function(C){return function(A,j){var H=j?j.length:0;return y(C(A,j),H)}},runInContext:function(C){return function(A){return Ip(t,C(A),r)}}};function N(C,A){if(s.cap){var j=Zt.iterateeRearg[C];if(j)return te(A,j);var H=!o&&Zt.iterateeAry[C];if(H)return me(A,H)}return A}function K(C,A,j){return l||s.curry&&j>1?y(A,j):A}function R(C,A,j){if(s.fixed&&(c||!Zt.skipFixed[C])){var H=Zt.methodSpread[C],V=H&&H.start;return V===void 0?f(A,j):z6(A,V)}return A}function B(C,A,j){return s.rearg&&j>1&&(u||!Zt.skipRearg[C])?M(A,Zt.methodRearg[C]||Zt.aryRearg[j]):A}function z(C,A){A=D(A);for(var j=-1,H=A.length,V=H-1,fe=g(Object(C)),pe=fe;pe!=null&&++j1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Gz,`{ +`;function n6(){return v.jsx(Xe,{variant:"rectangular",width:"100%",height:43})}const r6=t=>{const{fieldDef:e,onChange:n,value:r,onBlur:o,disabled:i,error:s,inputRef:a,skeleton:l,id:c}=t,{inputSettings:{minDate:u,maxDate:d}={}}=e,p=h.useMemo(()=>r||{date:null,keyboardInputValue:void 0},[r]),f=(m,g)=>n({date:m,keyboardInputValue:g});return l?v.jsx(n6,{}):v.jsx(t6,{children:v.jsx(e6,{id:c,error:s,onChange:f,fieldDef:{name:e==null?void 0:e.name,label:"",type:"",inputSettings:{placeholder:sT,minDate:u,maxDate:d},required:e==null?void 0:e.required},value:p==null?void 0:p.date,onBlur:o,disabled:i,inputRef:a})})},o6=h.memo(r6);function Sw(t,e){var n;const r=Kr({props:t,name:e}),o=Bt(),i=(n=r.ampm)!=null?n:o.is12HourCycleInCurrentLocale(),a=xs().openTimePickerDialogue;return J({ampm:i,openTo:"hours",views:["hours","minutes"],acceptRegex:i?/[\dapAP]/gi:/\d/gi,disableMaskedInput:!1,getOpenDialogAriaText:a,inputFormat:i?o.formats.fullTime12h:o.formats.fullTime24h},r,{components:J({OpenPickerIcon:X1},r.components)})}const kw={emptyValue:null,parseInput:W1,getTodayValue:t=>t.date(),areValuesEqual:(t,e,n)=>t.isEqual(e,n),valueReducer:(t,e,n)=>!e||!t.isValid(n)?n:t.mergeDateAndTime(e,n)},i6=["className","selected","value"],Mw=At("PrivatePickersToolbarText",["selected"]),s6=Ee(xo)(({theme:t})=>({transition:t.transitions.create("color"),color:t.palette.text.secondary,[`&.${Mw.selected}`]:{color:t.palette.text.primary}})),Ew=h.forwardRef(function(e,n){const{className:r,selected:o,value:i}=e,s=tt(e,i6);return v.jsx(s6,J({ref:n,className:nn(r,o&&Mw.selected),component:"span"},s,{children:i}))}),a6=["align","className","selected","typographyClassName","value","variant"],l6=Ee(Is)({padding:0,minWidth:16,textTransform:"none"}),Os=h.forwardRef(function(e,n){const{align:r,className:o,selected:i,typographyClassName:s,value:a,variant:l}=e,c=tt(e,a6);return v.jsx(l6,J({variant:"text",ref:n,className:o},c,{children:v.jsx(Ew,{align:r,className:s,variant:l,value:a,selected:i})}))});function c6(t){return En("MuiTimePickerToolbar",t)}const u6=At("MuiTimePickerToolbar",["root","separator","hourMinuteLabel","hourMinuteLabelLandscape","hourMinuteLabelReverse","ampmSelection","ampmLandscape","ampmLabel"]),d6=["ampm","ampmInClock","parsedValue","isLandscape","isMobileKeyboardViewOpen","onChange","openView","setOpenView","toggleMobileKeyboardView","toolbarTitle","views","disabled","readOnly"],p6=t=>{const{theme:e,isLandscape:n,classes:r}=t,o={root:["root"],separator:["separator"],hourMinuteLabel:["hourMinuteLabel",n&&"hourMinuteLabelLandscape",e.direction==="rtl"&&"hourMinuteLabelReverse"],ampmSelection:["ampmSelection",n&&"ampmLandscape"],ampmLabel:["ampmLabel"]};return Tn(o,c6,r)},f6=Ee(Q1,{name:"MuiTimePickerToolbar",slot:"Root",overridesResolver:(t,e)=>e.root})({[`& .${Zi.penIconButtonLandscape}`]:{marginTop:"auto"}}),h6=Ee(Ew,{name:"MuiTimePickerToolbar",slot:"Separator",overridesResolver:(t,e)=>e.separator})({outline:0,margin:"0 4px 0 2px",cursor:"default"}),m6=Ee("div",{name:"MuiTimePickerToolbar",slot:"HourMinuteLabel",overridesResolver:(t,e)=>e.hourMinuteLabel})(({theme:t,ownerState:e})=>J({display:"flex",justifyContent:"flex-end",alignItems:"flex-end"},e.isLandscape&&{marginTop:"auto"},t.direction==="rtl"&&{flexDirection:"row-reverse"})),g6=Ee("div",{name:"MuiTimePickerToolbar",slot:"AmPmSelection",overridesResolver:(t,e)=>e.ampmSelection})(({ownerState:t})=>J({display:"flex",flexDirection:"column",marginRight:"auto",marginLeft:12},t.isLandscape&&{margin:"4px 0 auto",flexDirection:"row",justifyContent:"space-around",flexBasis:"100%"},{[`& .${u6.ampmLabel}`]:{fontSize:17}})),Tw=t=>{const{ampm:e,ampmInClock:n,parsedValue:r,isLandscape:o,isMobileKeyboardViewOpen:i,onChange:s,openView:a,setOpenView:l,toggleMobileKeyboardView:c,toolbarTitle:u="Select time",views:d,disabled:p,readOnly:f}=t,m=tt(t,d6),g=Bt(),y=ms(),b=!!(e&&!n),{meridiemMode:x,handleMeridiemChange:S}=uw(r,e,s),E=T=>e?g.format(T,"hours12h"):g.format(T,"hours24h"),k=t,w=p6(J({},k,{theme:y})),M=v.jsx(h6,{tabIndex:-1,value:":",variant:"h3",selected:!1,className:w.separator});return v.jsxs(f6,J({viewType:"clock",landscapeDirection:"row",toolbarTitle:u,isLandscape:o,isMobileKeyboardViewOpen:i,toggleMobileKeyboardView:c,ownerState:k,className:w.root},m,{children:[v.jsxs(m6,{className:w.hourMinuteLabel,ownerState:k,children:[No(d,"hours")&&v.jsx(Os,{tabIndex:-1,variant:"h3",onClick:()=>l("hours"),selected:a==="hours",value:r?E(r):"--"}),No(d,["hours","minutes"])&&M,No(d,"minutes")&&v.jsx(Os,{tabIndex:-1,variant:"h3",onClick:()=>l("minutes"),selected:a==="minutes",value:r?g.format(r,"minutes"):"--"}),No(d,["minutes","seconds"])&&M,No(d,"seconds")&&v.jsx(Os,{variant:"h3",onClick:()=>l("seconds"),selected:a==="seconds",value:r?g.format(r,"seconds"):"--"})]}),b&&v.jsxs(g6,{className:w.ampmSelection,ownerState:k,children:[v.jsx(Os,{disableRipple:!0,variant:"subtitle2",selected:x==="am",typographyClassName:w.ampmLabel,value:g.getMeridiemText("am"),onClick:f?void 0:()=>S("am"),disabled:p}),v.jsx(Os,{disableRipple:!0,variant:"subtitle2",selected:x==="pm",typographyClassName:w.ampmLabel,value:g.getMeridiemText("pm"),onClick:f?void 0:()=>S("pm"),disabled:p})]})]}))},v6=({adapter:t,value:e,props:n})=>{const{minTime:r,maxTime:o,minutesStep:i,shouldDisableTime:s,disableIgnoringDatePartForTimeValidation:a}=n,l=t.utils.date(e),c=cw(a,t.utils);if(e===null)return null;switch(!0){case!t.utils.isValid(e):return"invalidDate";case!!(r&&c(r,l)):return"minTime";case!!(o&&c(l,o)):return"maxTime";case!!(s&&s(t.utils.getHours(l),"hours")):return"shouldDisableTime-hours";case!!(s&&s(t.utils.getMinutes(l),"minutes")):return"shouldDisableTime-minutes";case!!(s&&s(t.utils.getSeconds(l),"seconds")):return"shouldDisableTime-seconds";case!!(i&&t.utils.getMinutes(l)%i!==0):return"minutesStep";default:return null}},y6=(t,e)=>t===e,Ow=t=>pw(t,v6,y6),b6=["onChange","PaperProps","PopperProps","ToolbarComponent","TransitionComponent","value","components","componentsProps"],x6=h.forwardRef(function(e,n){const r=Sw(e,"MuiDesktopTimePicker"),o=Ow(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=$h(r,kw),{PaperProps:l,PopperProps:c,ToolbarComponent:u=Tw,TransitionComponent:d,components:p,componentsProps:f}=r,m=tt(r,b6),g=J({},s,m,{components:p,componentsProps:f,ref:n,validationError:o});return v.jsx(tw,J({},a,{DateInputProps:g,KeyboardDateInputComponent:Dh,PopperProps:c,PaperProps:l,TransitionComponent:d,components:p,componentsProps:f,children:v.jsx(Ih,J({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:u,DateInputProps:g,components:p,componentsProps:f},m))}))}),w6=Ee(hT)({[`& .${Ag.container}`]:{outline:0},[`& .${Ag.paper}`]:{outline:0,minWidth:dw}}),C6=Ee(mT)({"&:first-of-type":{padding:0}}),S6=t=>{var e;const{children:n,DialogProps:r={},onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,components:u,componentsProps:d}=t,p=(e=u==null?void 0:u.ActionBar)!=null?e:ew;return v.jsxs(w6,J({open:c,onClose:s},r,{children:[v.jsx(C6,{children:n}),v.jsx(p,J({onAccept:o,onClear:i,onCancel:a,onSetToday:l,actions:["cancel","accept"]},d==null?void 0:d.actionBar))]}))},k6=["children","DateInputProps","DialogProps","onAccept","onClear","onDismiss","onCancel","onSetToday","open","PureDateInputComponent","components","componentsProps"];function M6(t){const{children:e,DateInputProps:n,DialogProps:r,onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,PureDateInputComponent:u,components:d,componentsProps:p}=t,f=tt(t,k6);return v.jsxs(fi.Provider,{value:"mobile",children:[v.jsx(u,J({components:d},f,n)),v.jsx(S6,{DialogProps:r,onAccept:o,onClear:i,onDismiss:s,onCancel:a,onSetToday:l,open:c,components:d,componentsProps:p,children:e})]})}const E6=h.forwardRef(function(e,n){const{disabled:r,getOpenDialogAriaText:o,inputFormat:i,InputProps:s,inputRef:a,label:l,openPicker:c,rawValue:u,renderInput:d,TextFieldProps:p={},validationError:f}=e,m=xs(),g=o??m.openDatePickerDialogue,y=Bt(),b=h.useMemo(()=>J({},s,{readOnly:!0}),[s]),x=Ip(y,u,i);return d(J({label:l,disabled:r,ref:n,inputRef:a,error:f,InputProps:b,inputProps:J({disabled:r,readOnly:!0,"aria-readonly":!0,"aria-label":g(u,y),value:x},!e.readOnly&&{onClick:c},{onKeyDown:nw(c)})},p))}),T6=["ToolbarComponent","value","onChange","components","componentsProps"],O6=h.forwardRef(function(e,n){const r=Sw(e,"MuiMobileTimePicker"),o=Ow(r)!==null,{pickerProps:i,inputProps:s,wrapperProps:a}=$h(r,kw),{ToolbarComponent:l=Tw,components:c,componentsProps:u}=r,d=tt(r,T6),p=J({},s,d,{components:c,componentsProps:u,ref:n,validationError:o});return v.jsx(M6,J({},d,a,{DateInputProps:p,PureDateInputComponent:E6,components:c,componentsProps:u,children:v.jsx(Ih,J({},i,{autoFocus:!0,toolbarTitle:r.label||r.toolbarTitle,ToolbarComponent:l,DateInputProps:p,components:c,componentsProps:u},d))}))}),L6=["desktopModeMediaQuery","DialogProps","PopperProps","TransitionComponent"],A6=h.forwardRef(function(e,n){const r=Kr({props:e,name:"MuiTimePicker"}),{desktopModeMediaQuery:o="@media (pointer: fine)",DialogProps:i,PopperProps:s,TransitionComponent:a}=r,l=tt(r,L6);return vT(o)?v.jsx(x6,J({ref:n,PopperProps:s,TransitionComponent:a},l)):v.jsx(O6,J({ref:n,DialogProps:i},l))}),P6=EE({palette:{primary:{main:_.newColors.realTeal[100]}}}),R6=t=>{const{fieldDef:e,onChange:n,value:r=null,onBlur:o,disabled:i,inputRef:s,id:a}=t,[l,c]=h.useState(!1),u=h.useCallback(async()=>{c(p=>(p&&o&&o(),!p))},[o]),d=p=>{var f;return v.jsx(Pf,{...p,id:a,onBlur:o,required:e.required,disabled:i,inputProps:{...p.inputProps,placeholder:(f=e==null?void 0:e.inputSettings)==null?void 0:f.placeholder,ref:s}})};return v.jsx(V1,{dateAdapter:j1,children:v.jsx(WT,{theme:P6,children:v.jsx(Cw,{$isPickerOpen:l,$disabled:i,children:v.jsx(A6,{value:r,onChange:n,renderInput:d,onOpen:u,onClose:u,disabled:i})})})})};function D6(t){if(Array.isArray(t))return t;const[e,n]=t.split(":");if(!e||e.length!==2||!n||n.length!==2)throw new Error(`${t} is not a valid 24hr time. It must contain hour and minute components separated by a colon.`);const r=Number(e),o=Number(n);if(r!==r||r<0||r>23||o!==o||o<0||o>59)throw new Error(`${t} is not a valid 24hr time`);return[r,o,0,0]}function Nh(t,e){const n=new Date(t.getTime()),[r,o,i]=typeof e=="string"?D6(e):Array.isArray(e)?e:[e.getHours(),e.getMinutes(),e.getSeconds()];return n.setHours(r,o,i,0),n}function I6(t){if(!t)return;const e=t.getTime();if(e===e)return t}function Lw(t,e){const n=F1(t,e,new Date);return Px(n)&&Ki(n,e)===t}function ya(){return{internalData:{},data:{},errors:{},disabled:!0,touched:{},submitWarning:{open:!1,lead:"",reasons:[]},waits:[],loadingInitial:!0}}function $6(){return{...ya(),initialData:{},fields:{},mounted:{},hasBlurred:{},hasSubmitted:!1,moveToError:!1,loadingInitial:!0}}function ur(t){return function(){throw new Error(t)}}const hi=h.createContext({state:ya(),methods:{addWait:ur("addWait requires a FormContext provider"),disableForm:ur("disableForm requires a FormContext provider"),init:ur("init requires a FormContext provider"),mountField:ur("mountField requires a FormContext provider"),removeWait:ur("removeWait requires a FormContext provider"),reset:ur("reset requires a FormContext provider"),setFieldBlur:ur("setFieldBlur requires a FormContext provider"),setFieldValue:ur("setFieldValue requires a FormContext provider"),setFormValues:ur("setFormValues requires a FormContext provider"),setSubmitWarning:ur("setSubmitWarning requires a FormContext provider"),submitForm:ur("submitForm requires a FormContext provider")}}),N6=t=>{const{fieldDef:e,onChange:n,value:r,onBlur:o,disabled:i,error:s,inputRef:a,id:l,skeleton:c,path:u}=t,{inputSettings:d={}}=e,{defaultTime:p}=d,f=h.useMemo(()=>r||{time:null,keyboardInputValue:void 0},[r]),{state:m}=h.useContext(hi),g=h.useMemo(()=>mr(m.internalData,[...u||[],"date"]),[m,u]);h.useEffect(()=>{n(b=>{if(!(!b||b.usingDefaultTime)||!p)return b;if(g!=null&&g.date)return{time:Nh(new Date,p),validTime:!0,usingDefaultTime:!0}})},[g,p,n]);const y=(b,x)=>n({time:b,keyboardInputValue:x,usingDefaultTime:!b||!I6(b)});return c?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(R6,{id:l,error:s,onChange:y,fieldDef:{name:e==null?void 0:e.name,label:"",type:"timePicker",inputSettings:{placeholder:aT}},value:f==null?void 0:f.time,onBlur:o,disabled:i,inputRef:a})},_6=h.memo(N6);var Aw={};(function(t){t.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"},t.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]},t.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},t.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},t.iterateeRearg={mapKeys:[1],reduceRight:[1,0]},t.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]},t.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}},t.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}},t.realToAlias=function(){var e=Object.prototype.hasOwnProperty,n=t.aliasToReal,r={};for(var o in n){var i=n[o];e.call(r,i)?r[i].push(o):r[i]=[o]}return r}(),t.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"},t.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0},t.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}})(Aw);var hd,n0;function _h(){return n0||(n0=1,hd={}),hd}var Zt=Aw,F6=_h(),r0=Array.prototype.push;function B6(t,e){return e==2?function(n,r){return t.apply(void 0,arguments)}:function(n){return t.apply(void 0,arguments)}}function md(t,e){return e==2?function(n,r){return t(n,r)}:function(n){return t(n)}}function o0(t){for(var e=t?t.length:0,n=Array(e);e--;)n[e]=t[e];return n}function j6(t){return function(e){return t({},e)}}function z6(t,e){return function(){for(var n=arguments.length,r=n-1,o=Array(n);n--;)o[n]=arguments[n];var i=o[e],s=o.slice(0,e);return i&&r0.apply(s,i),e!=r&&r0.apply(s,o.slice(e+1)),t.apply(this,s)}}function gd(t,e){return function(){var n=arguments.length;if(n){for(var r=Array(n);n--;)r[n]=arguments[n];var o=r[0]=e.apply(void 0,r);return t.apply(void 0,r),o}}}function $p(t,e,n,r){var o=typeof e=="function",i=e===Object(e);if(i&&(r=n,n=e,e=void 0),n==null)throw new TypeError;r||(r={});var s={cap:"cap"in r?r.cap:!0,curry:"curry"in r?r.curry:!0,fixed:"fixed"in r?r.fixed:!0,immutable:"immutable"in r?r.immutable:!0,rearg:"rearg"in r?r.rearg:!0},a=o?n:F6,l="curry"in r&&r.curry,c="fixed"in r&&r.fixed,u="rearg"in r&&r.rearg,d=o?n.runInContext():void 0,p=o?n:{ary:t.ary,assign:t.assign,clone:t.clone,curry:t.curry,forEach:t.forEach,isArray:t.isArray,isError:t.isError,isFunction:t.isFunction,isWeakMap:t.isWeakMap,iteratee:t.iteratee,keys:t.keys,rearg:t.rearg,toInteger:t.toInteger,toPath:t.toPath},f=p.ary,m=p.assign,g=p.clone,y=p.curry,b=p.forEach,x=p.isArray,S=p.isError,E=p.isFunction,k=p.isWeakMap,w=p.keys,M=p.rearg,T=p.toInteger,D=p.toPath,P=w(Zt.aryMethod),U={castArray:function(C){return function(){var A=arguments[0];return x(A)?C(o0(A)):C.apply(void 0,arguments)}},iteratee:function(C){return function(){var A=arguments[0],j=arguments[1],H=C(A,j),V=H.length;return s.cap&&typeof j=="number"?(j=j>2?j-2:1,V&&V<=j?H:md(H,j)):H}},mixin:function(C){return function(A){var j=this;if(!E(j))return C(j,Object(A));var H=[];return b(w(A),function(V){E(A[V])&&H.push([V,j.prototype[V]])}),C(j,Object(A)),b(H,function(V){var fe=V[1];E(fe)?j.prototype[V[0]]=fe:delete j.prototype[V[0]]}),j}},nthArg:function(C){return function(A){var j=A<0?1:T(A)+1;return y(C(A),j)}},rearg:function(C){return function(A,j){var H=j?j.length:0;return y(C(A,j),H)}},runInContext:function(C){return function(A){return $p(t,C(A),r)}}};function N(C,A){if(s.cap){var j=Zt.iterateeRearg[C];if(j)return te(A,j);var H=!o&&Zt.iterateeAry[C];if(H)return me(A,H)}return A}function K(C,A,j){return l||s.curry&&j>1?y(A,j):A}function R(C,A,j){if(s.fixed&&(c||!Zt.skipFixed[C])){var H=Zt.methodSpread[C],V=H&&H.start;return V===void 0?f(A,j):z6(A,V)}return A}function B(C,A,j){return s.rearg&&j>1&&(u||!Zt.skipRearg[C])?M(A,Zt.methodRearg[C]||Zt.aryRearg[j]):A}function z(C,A){A=D(A);for(var j=-1,H=A.length,V=H-1,fe=g(Object(C)),pe=fe;pe!=null&&++j1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(Gz,`{ /* [wrapped with `+e+`] */ -`)}var Kz=qz,Yz=Yf,Jz=oE,Zz=1,Xz=2,Qz=8,eH=16,tH=32,nH=64,rH=128,oH=256,iH=512,sH=[["ary",rH],["bind",Zz],["bindKey",Xz],["curry",Qz],["curryRight",eH],["flip",iH],["partial",tH],["partialRight",nH],["rearg",oH]];function aH(t,e){return Yz(sH,function(n){var r="_."+n[0];e&n[1]&&!Jz(t,r)&&t.push(r)}),t.sort()}var lH=aH,cH=Uz,uH=Kz,dH=iE,pH=lH;function fH(t,e,n){var r=e+"";return dH(t,uH(r,pH(cH(r),n)))}var Fw=fH,hH=Fz,mH=_w,gH=Fw,vH=1,yH=2,bH=4,xH=8,u0=32,d0=64;function wH(t,e,n,r,o,i,s,a,l,c){var u=e&xH,d=u?s:void 0,p=u?void 0:s,f=u?i:void 0,m=u?void 0:i;e|=u?u0:d0,e&=~(u?d0:u0),e&bH||(e&=~(vH|yH));var g=[t,e,o,f,d,m,p,a,l,c],y=n.apply(void 0,g);return hH(t)&&mH(y,g),y.placeholder=r,gH(y,t,e)}var Bw=wH;function CH(t){var e=t;return e.placeholder}var jw=CH,SH=hu,kH=sE,MH=Math.min;function EH(t,e){for(var n=t.length,r=MH(e.length,n),o=SH(t);r--;){var i=e[r];t[r]=kH(i,n)?o[i]:void 0}return t}var TH=EH,p0="__lodash_placeholder__";function OH(t,e){for(var n=-1,r=t.length,o=0,i=[];++n1&&x.reverse(),u&&li?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var s=Array(i);++o{if(!$p.has(e))throw Error(`Invalid country code: ${e}`);return $p.get(e).test(t)},R9=t=>$p.has(t);function D9(t){return!(t===null||typeof t!="object"||!("value"in t)||!("label"in t))}function qw(t,e=", ",n=" and "){if(t.length<3)return t.join(n);const r=t.slice(0,t.length-1).join(e),o=t[t.length-1];return`${r}${n}${o}`}const L0="Segmenter"in Intl&&new Intl.Segmenter("en",{granularity:"grapheme"});function Hh(t){return L0?[...L0.segment(t)].length:Array.from(t).length}const Kw=["https","http"];function A0(t,e=Kw){if(!t)return"";const[n=""]=e;for(const r of e)if(t.substring(0,r.length+3)===`${r}://`)return t;return`${n}://${t}`}const I9=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","li","main","nav","noscript","ol","p","pre","section","table","tfoot","ul","video"];function dc(t){return I9.includes(t.tagName.toLowerCase())}function Yw(t){return t.nodeType===Node.TEXT_NODE}function pc(t){return t.nodeType===Node.ELEMENT_NODE}function Jw(t,e,n){const r=e&&pc(e)&&dc(e),o=n&&pc(n)&&dc(n),i=r&&o;return t.textContent&&!i}function Vh(t,e){const n=Array.from(t.childNodes);n.forEach((r,o)=>{const i=pc(r)?r:void 0,s=Yw(r)?r:void 0;e({node:r,index:o,parent:t,elem:i,text:s,siblings:n}),i&&Vh(i,e)})}function $9(t,e,n){const o=new DOMParser().parseFromString(t,"text/html");let i=n;return Vh(o.body,s=>{const a=e(i,s);a!==void 0&&(i=a)}),i}function Zw(t){return $9(t,(e,{index:n,parent:r,siblings:o,text:i,elem:s})=>{if(i&&Jw(i,o[n-1],o[n+1])){const a=r.tagName.toLowerCase();if(a!=="script"&&a!=="style"){const l=document.createElement("div");l.appendChild(i.cloneNode());const c=l.innerHTML.replace(/\s+/g," ");return l.innerHTML=c,e+Hh(l.textContent||"")}}if(s){const a=s.tagName.toLowerCase();if(a!=="script"&&a!=="style"&&s!==o[0])return e+(dc(s)?1:0)}},0)}const toe="validateDateRange",noe="validateNumberRange";function N9(t){if(!(!t||t.toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)))return"The value is not a valid email"}function _9(t){if(t)return new Promise(function(e){setTimeout(function(){return t.includes("test")?e("String cannot include test"):e(void 0)},1e3)})}function Wh(t){if(!(isFinite(t)&&Math.abs(t)<=90))return"Latitude should be between -90 and 90"}function Uh(t){if(!(isFinite(t)&&Math.abs(t)<=180))return"Longitude should be between -180 and 180"}function F9(t,e,n,r,o,i){if(!i.hasValue({value:t,internalValue:r}))return"This field is required, please fill it"}function B9(t){if(t&&!(!isNaN(Number(t))&&!isNaN(parseFloat(t))))return"The value is not a number"}function j9(t){if(!t)return;if(!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t))return"The value is not a valid URL"}async function z9(t,e,n){const r=e[n.startDateName]?e[n.startDateName]:t,o=e[n.endDateName]?e[n.endDateName]:t;if(!r||!o)return;const i=r===t?"Start date should happen before the end date":"End date should happen after the start date",s=new Date(r),a=new Date(o);if(s.getTime()>a.getTime())return i}function H9(t,e,{minName:n,maxName:r}){if(t===void 0)return;const o=n&&e[n],i=r&&e[r],s=Number(t);if(!(Number.isNaN(s)||!Number.isFinite(s))){if(o&&!i&&si)return`Number must be less than or equal to ${i}`;if(o&&i&&(si))return`Number must be between ${o} and ${i}`}}function V9(t,e,{min:n,max:r}){if(t instanceof Date){if(n&&!r&&tr)return`Date must come on or before ${Ki(r,Yi)}`;if(n&&r&&(tr))return`Date must come between ${Ki(n,Yi)} and ${Ki(r,Yi)}`}}function W9(t,e,n){if(!n.max||typeof t!="string")return;const r="You have exceeded the maximum number of characters";if(n.ignoreHTML&&Zw(t)>n.max||!n.ignoreHTML&&Hh(t)>n.max)return r}function U9(t){if(!(!t||t[0]!=="1"||t.length===11))return"Phone number must be exactly 10 numbers excluding the country code"}async function Xw(t,e,{countryField:n}){if(!t)return;const r=e[n];if(!r)return;const o=D9(r)?r.value:r;if(!(!o||!R9(o))&&!P9(t,o))return"This is not a valid postal code in the selected country"}async function G9(t,e,n,r){if(!(r!=null&&r.date))return;const{date:o,keyboardInputValue:i}=r;if(isNaN(o.getTime())||i&&!Lw(i,Yi))return"Please enter a valid MM/DD/YYYY date, e.g. 01/31/2024"}async function q9(t,e,n,r){if(!(r!=null&&r.time))return;const{time:o,keyboardInputValue:i}=r;if(isNaN(o.getTime())||i&&!Lw(i,lT))return"Please enter a valid 12hr time, e.g. 01:30 pm"}function K9({internalData:t,data:e,errors:n,disabled:r,touched:o,submitWarning:i,waits:s,loadingInitial:a}){return{internalData:t,data:e,errors:n,disabled:r,touched:o,submitWarning:i,waits:s,loadingInitial:a}}async function Y9(t,e,n,r,o,i){for(const s of t){const a=await s.fn(e,n,s.options,r,o,i);if(a)return{errorMessage:a,validator:s}}}function J9(t){const e={required:F9,validateLatitude:Wh,validateLongitude:Uh,validateDateRange:z9,validateMinDate:V9,validateDate:G9,validateTime:q9,validateNumberRange:H9,validateCharacterCount:W9,validateEmail:N9,validateNumber:B9,validateSlow:_9,validateURL:j9,validatePhoneNumber:U9,validatePostcode:Xw};return t.map(n=>typeof n=="string"?{fn:e[n],options:{}}:typeof n=="function"?{fn:n,options:{}}:{fn:e[n.fn],options:n.options})}function Qw({name:t,path:e,stable:n}){const{mounted:r}=n;if(!r[t])return!1;const o=ns({name:t,path:e,stable:n}),i=Pl(o.disabled,K9(n),!1);return!Rl(i)}async function eC({name:t,include:e,path:n=[],stable:r}){var d,p,f,m,g;if(!Qw({name:t,path:n,stable:r}))return;const{data:o,internalData:i}=r,s=ns({name:t,path:n,stable:r}),{required:a,validators:l=[]}=s;a&&a.validator&&l.unshift({fn:"required",options:{}}),s.type==="phone"&&l.push({fn:"validatePhoneNumber",options:{}}),s.type==="date"&&l.push({fn:"validateDate",options:{}}),s.type==="time"&&l.push({fn:"validateTime",options:{}}),((d=s.inputSettings)==null?void 0:d.maxCharacters)>0&&l.push({fn:"validateCharacterCount",options:{max:s.inputSettings.maxCharacters,ignoreHTML:s.type==="textEditor"}}),((p=s.inputSettings)!=null&&p.minDate||(f=s.inputSettings)!=null&&f.maxDate)&&l.push({fn:"validateMinDate",options:{min:(m=s.inputSettings)==null?void 0:m.minDate,max:(g=s.inputSettings)==null?void 0:g.maxDate}});const c=J9(l).filter(y=>!e||e.includes(y.fn)),u=await Y9(c,mr(o,[...n,t]),n.length?mr(o,n):o,mr(i,[...n,t]),n.length?mr(i,n):i,s);if(u)return u.errorMessage}function Gh(t,e=[]){const n=Object.entries(t),r=[];for(const[,o]of n){if(o.type==="group"){r.push(...Gh(o.fields,[...e,o.name]));continue}r.push([...e,o.name])}return r}async function Md({stable:t,paths:e=Gh(t.fields)}){const n=await Promise.all(e.map(async i=>{const{path:s,include:a}=Array.isArray(i)?{path:i,include:void 0}:i,l=await eC({name:s.at(-1),include:a,path:s.slice(0,-1),stable:t});return[s.join("."),l]})),r=Object.fromEntries(n),o=Object.values(r).filter(Boolean).length;return{errors:r,count:o}}function Np(t,e){const n=Object.entries(e),r={};for(const[o,i]of n)t&&("fields"in i&&i.fields?r[o]=Np(i.getResolvedValue(t[o]).internalValue,i.fields):r[o]=i.getResolvedValue(t[o]).internalValue);return r}function tC({fields:t,sections:e,stable:n}){const r=e&&e.map(({fields:o})=>o).flat(3);return t.reduce((o,i,s)=>{const a=DM(i.type),l=i.getResolvedValue||a.getResolvedValue,c={...i,validateOn:i.validateOn||a.validate,getResolvedValue:u=>l(u,i),hasValue:i.hasValue||a.hasValue,order:(r?r.indexOf(i.name):s)+1,fields:i.type==="group"?tC({fields:i.inputSettings.fields,stable:n}):void 0,required:typeof i.required=="object"?i.required:i.required?{validator:!0,asterisk:!0}:void 0};return{...o,[i.name]:c}},{})}function Z9({stable:t,path:e=[]}){let n=t.fields;for(const r of e)n=n[r].fields;return n}function nC({target:t,fieldName:e=t[0],path:n=[],value:r,currentValues:o,stable:i,depth:s=0}){const a=ns({name:e,path:n,stable:i});if(a.type==="group"){const c=Object.keys(a.fields).reduce((u,d)=>{var f,m;const p=nC({target:t,fieldName:d,path:[...n,e],value:r,currentValues:{values:((f=o==null?void 0:o.values)==null?void 0:f[e])||{},internalValues:((m=o==null?void 0:o.internalValues)==null?void 0:m[e])||{}},stable:i,depth:s+1});return{internalValue:{...u.internalValue,[d]:p.internalValue},value:{...u.value,[d]:p.value}}},{internalValue:o.internalValues[e],value:o.values[e]});return{internalValue:c.internalValue,value:a.getResolvedValue(c.value).value}}const l=t.join(".")===[...n,e].join(".");return a.getResolvedValue(l?typeof r=="function"?r(mr(i.internalData,[...n,e])):r:o.internalValues[e])}function Ou(){const t=h.useRef($6()),[e,n]=h.useReducer(A9,ya()),r=h.useCallback(async({name:b,path:x=[],validateLinkedFields:S})=>{const E=[...x,b];for(let k=0;ktypeof N=="object"?N:{name:N,include:void 0}),{errors:U}=await Md({paths:P.map(N=>({...N,path:[...M,N.name]})),stable:t.current});t.current.errors={...t.current.errors,...U}}}n({type:"SET_FIELD_ERRORS",errors:t.current.errors})},[]),o=h.useCallback(async({values:b={},path:x=[],initial:S,validate:E})=>{const k=Np(b,Z9({stable:t.current,path:x}));if(t.current.data=x.length?to(x,b,t.current.data):b,t.current.internalData=x.length?to(x,k,t.current.internalData):k,S&&(t.current.initialData=x.length?to(x,b,t.current.initialData):b,t.current.disabled=!1),E){const{errors:w}=await Md({stable:t.current});t.current.errors=x.length?to(x,w,t.current.errors):w,n({type:"SET_FIELD_ERRORS",errors:t.current.errors})}return n({type:"SET_FIELD_VALUES",values:t.current.data,internalValues:t.current.internalData,...S?{disabled:!1,loadingInitial:!1}:{}})},[]),i=h.useCallback(({fields:b,sections:x})=>{t.current.fields=tC({fields:b,sections:x,stable:t.current})},[]),s=h.useCallback(()=>{const{initialData:b,fields:x}=t.current,S={...b},E=Np(b,x);t.current={...ya(),...t.current,hasBlurred:{},data:S,internalData:E,disabled:!1,loadingInitial:!1},n({type:"RESET",data:S,internalData:E})},[]),a=h.useCallback(({name:b,value:x,touched:S,validate:E,path:k=[]})=>{const w=[...k,b],M=ns({name:b,path:k,stable:t.current}),{errors:T,hasBlurred:D,hasSubmitted:P}=t.current,{value:U,internalValue:N}=nC({target:w,stable:t.current,value:x,currentValues:{values:t.current.data,internalValues:t.current.internalData}});t.current.data=to(w[0],U,t.current.data),t.current.internalData=to(w[0],N,t.current.internalData),S&&(t.current.touched=to(w,!0,t.current.touched)),n({type:"SET_FIELD_VALUES",values:t.current.data,internalValues:t.current.internalData,touched:t.current.touched}),(E||M.validateOn==="onChange")&&r({name:b,validateLinkedFields:!0,path:k}),M.validateOn==="onBlurChange"&&(P||mr(D,w))&&r({name:b,validateLinkedFields:!0,path:k}),M.validateOn==="onBlurAmend"&&(P||mr(D,w))&&mr(T,w)&&(t.current.hasBlurred=O0(w,t.current.hasBlurred),t.current.errors=O0(w,t.current.errors),n({type:"SET_FIELD_ERRORS",errors:t.current.errors}))},[r]),l=h.useCallback(({name:b,path:x=[]})=>{const S=ns({name:b,path:x,stable:t.current});t.current.hasBlurred=to([...x,b],!0,t.current.hasBlurred),(S.validateOn==="onBlur"||S.validateOn==="onBlurAmend"||S.validateOn==="onBlurChange")&&r({name:b,path:x,validateLinkedFields:!0})},[r]),c=h.useCallback(({disabled:b=!1,initial:x})=>{n({type:"FORM_DISABLE",disabled:b,loadingInitial:x})},[]),u=h.useCallback(b=>{n({type:"SET_SUBMIT_WARNING",...b})},[]),d=h.useCallback(async()=>{const{data:b,waits:x}=t.current;t.current.hasSubmitted=!0;const{count:S,errors:E}=await Md({stable:t.current});if(S)return t.current.errors=E,t.current.moveToError=!0,n({type:"SET_FIELD_ERRORS",errors:E}),{valid:!1,data:null};if(x.length>0)return u({open:!0,lead:"The form cannot be submitted at this time:",reasons:x.map(({message:w})=>w)}),{valid:!1,data:null};const k=Gh(t.current.fields).filter(w=>Qw({name:w.at(-1),path:w.slice(0,-1),stable:t.current})).map(w=>w.join("."));return{valid:!0,data:b,activeFields:k}},[u]),p=h.useCallback(({names:b})=>{const{waits:x}=t.current,S=x.filter(({name:E})=>!b.includes(E));t.current.waits=S,n({type:"SET_FORM_WAITS",waits:S})},[]),f=h.useCallback(({name:b,message:x,disableForm:S=!1})=>{const{waits:E}=t.current,k=[...E,{name:b,message:x,disableForm:S}];return t.current.waits=k,n({type:"SET_FORM_WAITS",waits:k}),{remove:(w={})=>p({names:[b],...w})}},[p]),m=h.useCallback(({name:b,fieldRef:x,inputRef:S})=>(t.current.mounted[b]={fieldRef:x,inputRef:S},{unmount:()=>{t.current.mounted[b]=!1,n({type:"SET_FIELD_ERRORS",errors:{[b]:void 0},merge:!0})}}),[]),g=h.useMemo(()=>({setFormValues:o,setFieldValue:a,setFieldBlur:l,submitForm:d,disableForm:c,addWait:f,removeWait:p,mountField:m,init:i,reset:s,setSubmitWarning:u}),[l,o,a,d,c,f,p,m,i,s,u]),y=h.useCallback((b,x)=>async()=>{const{data:S,activeFields:E,valid:k}=await d();if(!k){x&&x({data:S});return}b({data:S,activeFields:E})},[d]);return{state:e,stable:t.current,methods:g,handleSubmit:y}}function rC(t,e){const n=new Set(t),r=new Set(e),o=[...t].filter(a=>!r.has(a)),i=[...e].filter(a=>!n.has(a));return[...o,...i]}function X9(t,e){if(t===e||t===void 0&&Object.values(e).every(r=>r===void 0)||e===void 0&&Object.values(t).every(r=>r===void 0))return!0;if(!t||!e)return!1;const n=t.types===e.types||!rC(t.types||[],e.types||[]).length;return String(t.address1)===String(e.address1)&&String(t.address2)===String(e.address2)&&String(t.address3)===String(e.address3)&&String(t.city)===String(e.city)&&String(t.state)===String(e.state)&&String(t.postalCode)===String(e.postalCode)&&String(t.country)===String(e.country)&&n}const Q9=Q.div` +`)}var Kz=qz,Yz=Jf,Jz=oE,Zz=1,Xz=2,Qz=8,eH=16,tH=32,nH=64,rH=128,oH=256,iH=512,sH=[["ary",rH],["bind",Zz],["bindKey",Xz],["curry",Qz],["curryRight",eH],["flip",iH],["partial",tH],["partialRight",nH],["rearg",oH]];function aH(t,e){return Yz(sH,function(n){var r="_."+n[0];e&n[1]&&!Jz(t,r)&&t.push(r)}),t.sort()}var lH=aH,cH=Uz,uH=Kz,dH=iE,pH=lH;function fH(t,e,n){var r=e+"";return dH(t,uH(r,pH(cH(r),n)))}var Fw=fH,hH=Fz,mH=_w,gH=Fw,vH=1,yH=2,bH=4,xH=8,u0=32,d0=64;function wH(t,e,n,r,o,i,s,a,l,c){var u=e&xH,d=u?s:void 0,p=u?void 0:s,f=u?i:void 0,m=u?void 0:i;e|=u?u0:d0,e&=~(u?d0:u0),e&bH||(e&=~(vH|yH));var g=[t,e,o,f,d,m,p,a,l,c],y=n.apply(void 0,g);return hH(t)&&mH(y,g),y.placeholder=r,gH(y,t,e)}var Bw=wH;function CH(t){var e=t;return e.placeholder}var jw=CH,SH=hu,kH=sE,MH=Math.min;function EH(t,e){for(var n=t.length,r=MH(e.length,n),o=SH(t);r--;){var i=e[r];t[r]=kH(i,n)?o[i]:void 0}return t}var TH=EH,p0="__lodash_placeholder__";function OH(t,e){for(var n=-1,r=t.length,o=0,i=[];++n1&&x.reverse(),u&&li?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var s=Array(i);++o{if(!Np.has(e))throw Error(`Invalid country code: ${e}`);return Np.get(e).test(t)},R9=t=>Np.has(t);function D9(t){return!(t===null||typeof t!="object"||!("value"in t)||!("label"in t))}function qw(t,e=", ",n=" and "){if(t.length<3)return t.join(n);const r=t.slice(0,t.length-1).join(e),o=t[t.length-1];return`${r}${n}${o}`}const L0="Segmenter"in Intl&&new Intl.Segmenter("en",{granularity:"grapheme"});function Vh(t){return L0?[...L0.segment(t)].length:Array.from(t).length}const Kw=["https","http"];function A0(t,e=Kw){if(!t)return"";const[n=""]=e;for(const r of e)if(t.substring(0,r.length+3)===`${r}://`)return t;return`${n}://${t}`}const I9=["address","article","aside","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","li","main","nav","noscript","ol","p","pre","section","table","tfoot","ul","video"];function dc(t){return I9.includes(t.tagName.toLowerCase())}function Yw(t){return t.nodeType===Node.TEXT_NODE}function pc(t){return t.nodeType===Node.ELEMENT_NODE}function Jw(t,e,n){const r=e&&pc(e)&&dc(e),o=n&&pc(n)&&dc(n),i=r&&o;return t.textContent&&!i}function Wh(t,e){const n=Array.from(t.childNodes);n.forEach((r,o)=>{const i=pc(r)?r:void 0,s=Yw(r)?r:void 0;e({node:r,index:o,parent:t,elem:i,text:s,siblings:n}),i&&Wh(i,e)})}function $9(t,e,n){const o=new DOMParser().parseFromString(t,"text/html");let i=n;return Wh(o.body,s=>{const a=e(i,s);a!==void 0&&(i=a)}),i}function Zw(t){return $9(t,(e,{index:n,parent:r,siblings:o,text:i,elem:s})=>{if(i&&Jw(i,o[n-1],o[n+1])){const a=r.tagName.toLowerCase();if(a!=="script"&&a!=="style"){const l=document.createElement("div");l.appendChild(i.cloneNode());const c=l.innerHTML.replace(/\s+/g," ");return l.innerHTML=c,e+Vh(l.textContent||"")}}if(s){const a=s.tagName.toLowerCase();if(a!=="script"&&a!=="style"&&s!==o[0])return e+(dc(s)?1:0)}},0)}const toe="validateDateRange",noe="validateNumberRange";function N9(t){if(!(!t||t.toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)))return"The value is not a valid email"}function _9(t){if(t)return new Promise(function(e){setTimeout(function(){return t.includes("test")?e("String cannot include test"):e(void 0)},1e3)})}function Uh(t){if(!(isFinite(t)&&Math.abs(t)<=90))return"Latitude should be between -90 and 90"}function Gh(t){if(!(isFinite(t)&&Math.abs(t)<=180))return"Longitude should be between -180 and 180"}function F9(t,e,n,r,o,i){if(!i.hasValue({value:t,internalValue:r}))return"This field is required, please fill it"}function B9(t){if(t&&!(!isNaN(Number(t))&&!isNaN(parseFloat(t))))return"The value is not a number"}function j9(t){if(!t)return;if(!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t))return"The value is not a valid URL"}async function z9(t,e,n){const r=e[n.startDateName]?e[n.startDateName]:t,o=e[n.endDateName]?e[n.endDateName]:t;if(!r||!o)return;const i=r===t?"Start date should happen before the end date":"End date should happen after the start date",s=new Date(r),a=new Date(o);if(s.getTime()>a.getTime())return i}function H9(t,e,{minName:n,maxName:r}){if(t===void 0)return;const o=n&&e[n],i=r&&e[r],s=Number(t);if(!(Number.isNaN(s)||!Number.isFinite(s))){if(o&&!i&&si)return`Number must be less than or equal to ${i}`;if(o&&i&&(si))return`Number must be between ${o} and ${i}`}}function V9(t,e,{min:n,max:r}){if(t instanceof Date){if(n&&!r&&tr)return`Date must come on or before ${Ki(r,Yi)}`;if(n&&r&&(tr))return`Date must come between ${Ki(n,Yi)} and ${Ki(r,Yi)}`}}function W9(t,e,n){if(!n.max||typeof t!="string")return;const r="You have exceeded the maximum number of characters";if(n.ignoreHTML&&Zw(t)>n.max||!n.ignoreHTML&&Vh(t)>n.max)return r}function U9(t){if(!(!t||t[0]!=="1"||t.length===11))return"Phone number must be exactly 10 numbers excluding the country code"}async function Xw(t,e,{countryField:n}){if(!t)return;const r=e[n];if(!r)return;const o=D9(r)?r.value:r;if(!(!o||!R9(o))&&!P9(t,o))return"This is not a valid postal code in the selected country"}async function G9(t,e,n,r){if(!(r!=null&&r.date))return;const{date:o,keyboardInputValue:i}=r;if(isNaN(o.getTime())||i&&!Lw(i,Yi))return"Please enter a valid MM/DD/YYYY date, e.g. 01/31/2024"}async function q9(t,e,n,r){if(!(r!=null&&r.time))return;const{time:o,keyboardInputValue:i}=r;if(isNaN(o.getTime())||i&&!Lw(i,lT))return"Please enter a valid 12hr time, e.g. 01:30 pm"}function K9({internalData:t,data:e,errors:n,disabled:r,touched:o,submitWarning:i,waits:s,loadingInitial:a}){return{internalData:t,data:e,errors:n,disabled:r,touched:o,submitWarning:i,waits:s,loadingInitial:a}}async function Y9(t,e,n,r,o,i){for(const s of t){const a=await s.fn(e,n,s.options,r,o,i);if(a)return{errorMessage:a,validator:s}}}function J9(t){const e={required:F9,validateLatitude:Uh,validateLongitude:Gh,validateDateRange:z9,validateMinDate:V9,validateDate:G9,validateTime:q9,validateNumberRange:H9,validateCharacterCount:W9,validateEmail:N9,validateNumber:B9,validateSlow:_9,validateURL:j9,validatePhoneNumber:U9,validatePostcode:Xw};return t.map(n=>typeof n=="string"?{fn:e[n],options:{}}:typeof n=="function"?{fn:n,options:{}}:{fn:e[n.fn],options:n.options})}function Qw({name:t,path:e=[],stable:n}){const{mounted:r}=n;if(!r[[...e,t].join(".")])return!1;const o=ns({name:t,path:e,stable:n}),i=Pl(o.disabled,K9(n),!1);return!Rl(i)}async function eC({name:t,include:e,path:n=[],stable:r}){var d,p,f,m,g;if(!Qw({name:t,path:n,stable:r}))return;const{data:o,internalData:i}=r,s=ns({name:t,path:n,stable:r}),{required:a,validators:l=[]}=s;a&&a.validator&&l.unshift({fn:"required",options:{}}),s.type==="phone"&&l.push({fn:"validatePhoneNumber",options:{}}),s.type==="date"&&l.push({fn:"validateDate",options:{}}),s.type==="time"&&l.push({fn:"validateTime",options:{}}),((d=s.inputSettings)==null?void 0:d.maxCharacters)>0&&l.push({fn:"validateCharacterCount",options:{max:s.inputSettings.maxCharacters,ignoreHTML:s.type==="textEditor"}}),((p=s.inputSettings)!=null&&p.minDate||(f=s.inputSettings)!=null&&f.maxDate)&&l.push({fn:"validateMinDate",options:{min:(m=s.inputSettings)==null?void 0:m.minDate,max:(g=s.inputSettings)==null?void 0:g.maxDate}});const c=J9(l).filter(y=>!e||e.includes(y.fn)),u=await Y9(c,mr(o,[...n,t]),n.length?mr(o,n):o,mr(i,[...n,t]),n.length?mr(i,n):i,s);if(u)return u.errorMessage}function Ou(t,e=[]){const n=Object.entries(t),r=[];n.sort(([,{order:o}],[,{order:i}])=>o-i);for(const[,o]of n){const i=[...e,o.name];if(o.type==="group"){r.push(i,...Ou(o.fields,i));continue}r.push(i)}return r}async function Ed({stable:t,paths:e=Ou(t.fields)}){const n=await Promise.all(e.map(async i=>{const{path:s,include:a}=Array.isArray(i)?{path:i,include:void 0}:i,l=await eC({name:s.at(-1),include:a,path:s.slice(0,-1),stable:t});return[s.join("."),l]})),r=Object.fromEntries(n),o=Object.values(r).filter(Boolean).length;return{errors:r,count:o}}function _p(t,e){const n=Object.entries(e),r={};for(const[o,i]of n)t&&("fields"in i&&i.fields?r[o]=_p(i.getResolvedValue(t[o]).internalValue,i.fields):r[o]=i.getResolvedValue(t[o]).internalValue);return r}function tC({fields:t,sections:e,stable:n}){const r=e&&e.map(({fields:o})=>o).flat(3);return t.reduce((o,i,s)=>{const a=DM(i.type),l=i.getResolvedValue||a.getResolvedValue,c={...i,validateOn:i.validateOn||a.validate,getResolvedValue:u=>l(u,i),hasValue:i.hasValue||a.hasValue,order:(r?r.indexOf(i.name):s)+1,fields:i.type==="group"?tC({fields:i.inputSettings.fields,stable:n}):void 0,required:typeof i.required=="object"?i.required:i.required?{validator:!0,asterisk:!0}:void 0};return{...o,[i.name]:c}},{})}function Z9({stable:t,path:e=[]}){let n=t.fields;for(const r of e)n=n[r].fields;return n}function nC({target:t,fieldName:e=t[0],path:n=[],value:r,currentValues:o,stable:i,depth:s=0}){const a=ns({name:e,path:n,stable:i});if(a.type==="group"){const c=Object.keys(a.fields).reduce((u,d)=>{var f,m;const p=nC({target:t,fieldName:d,path:[...n,e],value:r,currentValues:{values:((f=o==null?void 0:o.values)==null?void 0:f[e])||{},internalValues:((m=o==null?void 0:o.internalValues)==null?void 0:m[e])||{}},stable:i,depth:s+1});return{internalValue:{...u.internalValue,[d]:p.internalValue},value:{...u.value,[d]:p.value}}},{internalValue:o.internalValues[e],value:o.values[e]});return{internalValue:c.internalValue,value:a.getResolvedValue(c.value).value}}const l=t.join(".")===[...n,e].join(".");return a.getResolvedValue(l?typeof r=="function"?r(mr(i.internalData,[...n,e])):r:o.internalValues[e])}function Lu(){const t=h.useRef($6()),[e,n]=h.useReducer(A9,ya()),r=h.useCallback(async({name:b,path:x=[],validateLinkedFields:S})=>{const E=[...x,b];for(let k=0;ktypeof N=="object"?N:{name:N,include:void 0}),{errors:U}=await Ed({paths:P.map(N=>({...N,path:[...M,N.name]})),stable:t.current});t.current.errors={...t.current.errors,...U}}}n({type:"SET_FIELD_ERRORS",errors:t.current.errors})},[]),o=h.useCallback(async({values:b={},path:x=[],initial:S,validate:E})=>{const k=_p(b,Z9({stable:t.current,path:x}));if(t.current.data=x.length?to(x,b,t.current.data):b,t.current.internalData=x.length?to(x,k,t.current.internalData):k,S&&(t.current.initialData=x.length?to(x,b,t.current.initialData):b,t.current.disabled=!1),E){const{errors:w}=await Ed({stable:t.current});t.current.errors=x.length?to(x,w,t.current.errors):w,n({type:"SET_FIELD_ERRORS",errors:t.current.errors})}return n({type:"SET_FIELD_VALUES",values:t.current.data,internalValues:t.current.internalData,...S?{disabled:!1,loadingInitial:!1}:{}})},[]),i=h.useCallback(({fields:b,sections:x})=>{t.current.fields=tC({fields:b,sections:x,stable:t.current})},[]),s=h.useCallback(()=>{const{initialData:b,fields:x}=t.current,S={...b},E=_p(b,x);t.current={...ya(),...t.current,hasBlurred:{},data:S,internalData:E,disabled:!1,loadingInitial:!1},n({type:"RESET",data:S,internalData:E})},[]),a=h.useCallback(({name:b,value:x,touched:S,validate:E,path:k=[]})=>{const w=[...k,b],M=ns({name:b,path:k,stable:t.current}),{errors:T,hasBlurred:D,hasSubmitted:P}=t.current,{value:U,internalValue:N}=nC({target:w,stable:t.current,value:x,currentValues:{values:t.current.data,internalValues:t.current.internalData}});t.current.data=to(w[0],U,t.current.data),t.current.internalData=to(w[0],N,t.current.internalData),S&&(t.current.touched=to(w,!0,t.current.touched)),n({type:"SET_FIELD_VALUES",values:t.current.data,internalValues:t.current.internalData,touched:t.current.touched}),(E||M.validateOn==="onChange")&&r({name:b,validateLinkedFields:!0,path:k}),M.validateOn==="onBlurChange"&&(P||mr(D,w))&&r({name:b,validateLinkedFields:!0,path:k}),M.validateOn==="onBlurAmend"&&(P||mr(D,w))&&mr(T,w)&&(t.current.hasBlurred=O0(w,t.current.hasBlurred),t.current.errors=O0(w,t.current.errors),n({type:"SET_FIELD_ERRORS",errors:t.current.errors}))},[r]),l=h.useCallback(({name:b,path:x=[]})=>{const S=ns({name:b,path:x,stable:t.current});t.current.hasBlurred=to([...x,b],!0,t.current.hasBlurred),(S.validateOn==="onBlur"||S.validateOn==="onBlurAmend"||S.validateOn==="onBlurChange")&&r({name:b,path:x,validateLinkedFields:!0})},[r]),c=h.useCallback(({disabled:b=!1,initial:x})=>{n({type:"FORM_DISABLE",disabled:b,loadingInitial:x})},[]),u=h.useCallback(b=>{n({type:"SET_SUBMIT_WARNING",...b})},[]),d=h.useCallback(async()=>{const{data:b,waits:x}=t.current;t.current.hasSubmitted=!0;const{count:S,errors:E}=await Ed({stable:t.current});if(S)return t.current.errors=E,t.current.moveToError=!0,n({type:"SET_FIELD_ERRORS",errors:E}),{valid:!1,data:null};if(x.length>0)return u({open:!0,lead:"The form cannot be submitted at this time:",reasons:x.map(({message:w})=>w)}),{valid:!1,data:null};const k=Ou(t.current.fields).filter(w=>Qw({name:w.at(-1),path:w.slice(0,-1),stable:t.current})).map(w=>w.join("."));return{valid:!0,data:b,activeFields:k}},[u]),p=h.useCallback(({names:b})=>{const{waits:x}=t.current,S=x.filter(({name:E})=>!b.includes(E));t.current.waits=S,n({type:"SET_FORM_WAITS",waits:S})},[]),f=h.useCallback(({name:b,message:x,disableForm:S=!1})=>{const{waits:E}=t.current,k=[...E,{name:b,message:x,disableForm:S}];return t.current.waits=k,n({type:"SET_FORM_WAITS",waits:k}),{remove:(w={})=>p({names:[b],...w})}},[p]),m=h.useCallback(({name:b,path:x=[],fieldRef:S,inputRef:E})=>{const k=[...x,b].join(".");return t.current.mounted[k]={fieldRef:S,inputRef:E},{unmount:()=>{t.current.mounted[k]=!1,n({type:"SET_FIELD_ERRORS",errors:{[k]:void 0},merge:!0})}}},[]),g=h.useMemo(()=>({setFormValues:o,setFieldValue:a,setFieldBlur:l,submitForm:d,disableForm:c,addWait:f,removeWait:p,mountField:m,init:i,reset:s,setSubmitWarning:u}),[l,o,a,d,c,f,p,m,i,s,u]),y=h.useCallback((b,x)=>async()=>{const{data:S,activeFields:E,valid:k}=await d();if(!k){x&&x({data:S});return}b({data:S,activeFields:E})},[d]);return{state:e,stable:t.current,methods:g,handleSubmit:y}}function rC(t,e){const n=new Set(t),r=new Set(e),o=[...t].filter(a=>!r.has(a)),i=[...e].filter(a=>!n.has(a));return[...o,...i]}function X9(t,e){if(t===e||t===void 0&&Object.values(e).every(r=>r===void 0)||e===void 0&&Object.values(t).every(r=>r===void 0))return!0;if(!t||!e)return!1;const n=t.types===e.types||!rC(t.types||[],e.types||[]).length;return String(t.address1)===String(e.address1)&&String(t.address2)===String(e.address2)&&String(t.address3)===String(e.address3)&&String(t.city)===String(e.city)&&String(t.state)===String(e.state)&&String(t.postalCode)===String(e.postalCode)&&String(t.country)===String(e.country)&&n}const Q9=Q.div` display: flex; flex-direction: row; align-items: start; @@ -585,12 +585,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho svg { vertical-align: middle; } -`,cV=t=>{const{children:e,className:n,required:r,name:o,limit:i,instructionText:s,colsInRow:a,as:l="label"}=t,{anchorProps:c,tooltipProps:u}=Rf();return v.jsxs(rV,{className:n,children:[v.jsxs(sV,{htmlFor:l==="label"&&o?`${o}-input`:void 0,as:l==="label"?kx:oV,"data-testid":o&&`${Lr.FORM_FIELD_LABEL}:${o}`,title:typeof e=="string"?e:void 0,children:[e,r&&v.jsx(aV,{children:"*"})]}),s&&v.jsxs(lV,{$colsInRow:a,children:[v.jsx(MT,{...c}),v.jsx(Df,{...u,children:s})]}),i&&v.jsxs(iV,{$invalid:i[0]>i[1],children:[i[0],"/",i[1]]})]})},uV=Q.div` +`,cV=t=>{const{children:e,className:n,required:r,name:o,limit:i,instructionText:s,colsInRow:a,as:l="label"}=t,{anchorProps:c,tooltipProps:u}=Df();return v.jsxs(rV,{className:n,children:[v.jsxs(sV,{htmlFor:l==="label"&&o?`${o}-input`:void 0,as:l==="label"?kx:oV,"data-testid":o&&`${Lr.FORM_FIELD_LABEL}:${o}`,title:typeof e=="string"?e:void 0,children:[e,r&&v.jsx(aV,{children:"*"})]}),s&&v.jsxs(lV,{$colsInRow:a,children:[v.jsx(MT,{...c}),v.jsx(If,{...u,children:s})]}),i&&v.jsxs(iV,{$invalid:i[0]>i[1],children:[i[0],"/",i[1]]})]})},uV=Q.div` align-items: center; display: flex; flex-direction: row; margin-top: ${_.fieldSpecs.inputSpacing.helperText.marginTop}; -`,dV=Q(Gf)` +`,dV=Q(qf)` &.MuiSvgIcon-root { font-size: 16px; color: ${({$error:t})=>t?_.newColors.darkRed[100]:"transparent"}; @@ -608,7 +608,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho color: ${_.newColors.darkRed[100]}; margin: 0; } -`,_p=({children:t,error:e=!1})=>e?v.jsxs(uV,{children:[v.jsx(dV,{$error:!!t,"data-testid":"error-icon-test-id"}),v.jsx(P0,{error:e,children:t})]}):v.jsx(P0,{error:e,children:t}),pV=Q.div` +`,Fp=({children:t,error:e=!1})=>e?v.jsxs(uV,{children:[v.jsx(dV,{$error:!!t,"data-testid":"error-icon-test-id"}),v.jsx(P0,{error:e,children:t})]}):v.jsx(P0,{error:e,children:t}),pV=Q.div` padding-left: 20px; border-left: 2px solid ${_.newColors.grey2[100]}; flex: none; @@ -631,7 +631,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho font-family: ${_.fontFamily}; font-size: 14px; margin: 0; -`,oC=t=>{const{children:e,colsInRow:n}=t;return v.jsx(pV,{$colsInRow:n,children:v.jsx(fV,{children:e})})};oC.displayName="InstructionText";function iC(t){const{fieldDef:{name:e}={},skeleton:n,methods:{mountField:r}={},inputRef:o,fieldRef:i}=t;h.useEffect(()=>{if(!r||!e||n)return;const{unmount:s}=r({name:e,fieldRef:i==null?void 0:i.current,inputRef:o==null?void 0:o.current});return s},[r,e,o,n,i])}function hV(t){if(!(!t||!t.inputSettings)){if(t.type==="text"||t.type==="textEditor")return t.inputSettings.maxCharacters;if(t.type==="advancedSelection")return t.inputSettings.selectLimit<2?void 0:t.inputSettings.selectLimit}}function mV(t,e){return typeof t=="string"?e.type==="textEditor"?Zw(t):Hh(t):Array.isArray(t)?t.length:0}function gV(t,e){return h.useMemo(()=>{const n=hV(e);return n===void 0?void 0:[mV(t,e),n]},[e,t])}const vV=["color","date","dropdown","number","phone","text","textEditor","time"],yV=t=>{var b;const{children:e,error:n,fieldDef:r,colsInRow:o,value:i,id:s,spacing:a,disabled:l,skeleton:c,useRealLabel:u}=t,d=h.useRef(),p=typeof n=="string"?(n==null?void 0:n.trim().length)>0:!1,f=p||p&&!!(r!=null&&r.required)||typeof n=="boolean"&&n===!0,m=gV(i,r),g=(r==null?void 0:r.label)&&((b=r==null?void 0:r.label)==null?void 0:b.length)>0||m||(r==null?void 0:r.instructionText);iC({...t,fieldRef:d});const y=u||vV.includes(r==null?void 0:r.type);return v.jsxs(Q9,{id:s,className:r==null?void 0:r.className,style:r==null?void 0:r.style,"data-testid":"field-test-id",ref:d,"aria-disabled":l,children:[v.jsxs(eV,{$error:f,$spacing:a,children:[v.jsxs(tV,{$fullWidth:(r==null?void 0:r.size)==="full",children:[g&&(c?v.jsx(Xe,{width:92,height:28,sx:{marginBottom:"8px"}}):v.jsx(cV,{required:typeof r.required=="object"&&r.required.asterisk||!!r.required,limit:m,value:i,instructionText:r==null?void 0:r.instructionText,colsInRow:o,name:r.name,as:y?"label":"div",children:r==null?void 0:r.label})),v.jsx(nV,{$size:r==null?void 0:r.size,children:e})]}),f?v.jsx(_p,{error:!!n,children:typeof n=="string"?n:void 0}):(r==null?void 0:r.helperText)&&v.jsx(_p,{children:r==null?void 0:r.helperText})]}),(r==null?void 0:r.instructionText)&&v.jsx(oC,{colsInRow:o,children:r.instructionText})]})},qh=h.memo(yV);function bV({children:t,...e}){return iC(e),v.jsx(v.Fragment,{children:t})}const xV=h.memo(bV);var mo={},Kh={},wV="Expected a function",R0=NaN,CV="[object Symbol]",SV=/^\s+|\s+$/g,kV=/^[-+]0x[0-9a-f]+$/i,MV=/^0b[01]+$/i,EV=/^0o[0-7]+$/i,TV=parseInt,OV=typeof al=="object"&&al&&al.Object===Object&&al,LV=typeof self=="object"&&self&&self.Object===Object&&self,AV=OV||LV||Function("return this")(),PV=Object.prototype,RV=PV.toString,DV=Math.max,IV=Math.min,Ed=function(){return AV.Date.now()};function $V(t,e,n){var r,o,i,s,a,l,c=0,u=!1,d=!1,p=!0;if(typeof t!="function")throw new TypeError(wV);e=D0(e)||0,Fp(n)&&(u=!!n.leading,d="maxWait"in n,i=d?DV(D0(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p);function f(w){var M=r,T=o;return r=o=void 0,c=w,s=t.apply(T,M),s}function m(w){return c=w,a=setTimeout(b,e),u?f(w):s}function g(w){var M=w-l,T=w-c,D=e-M;return d?IV(D,i-T):D}function y(w){var M=w-l,T=w-c;return l===void 0||M>=e||M<0||d&&T>=i}function b(){var w=Ed();if(y(w))return x(w);a=setTimeout(b,g(w))}function x(w){return a=void 0,p&&r?f(w):(r=o=void 0,s)}function S(){a!==void 0&&clearTimeout(a),c=0,r=l=o=a=void 0}function E(){return a===void 0?s:x(Ed())}function k(){var w=Ed(),M=y(w);if(r=arguments,o=this,l=w,M){if(a===void 0)return m(l);if(d)return a=setTimeout(b,e),f(l)}return a===void 0&&(a=setTimeout(b,e)),s}return k.cancel=S,k.flush=E,k}function Fp(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function NV(t){return!!t&&typeof t=="object"}function _V(t){return typeof t=="symbol"||NV(t)&&RV.call(t)==CV}function D0(t){if(typeof t=="number")return t;if(_V(t))return R0;if(Fp(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Fp(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(SV,"");var n=MV.test(t);return n||EV.test(t)?TV(t.slice(2),n?2:8):kV.test(t)?R0:+t}var FV=$V,Lu={};Object.defineProperty(Lu,"__esModule",{value:!0});Lu.compose=function(){for(var e=arguments.length,n=Array(e),r=0;r1?n-1:0),o=1;o0},r.getInputProps=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(o.hasOwnProperty("value"))throw new Error("[react-places-autocomplete]: getInputProps does not accept `value`. Use `value` prop instead");if(o.hasOwnProperty("onChange"))throw new Error("[react-places-autocomplete]: getInputProps does not accept `onChange`. Use `onChange` prop instead");var i={type:"text",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-expanded":r.getIsExpanded(),"aria-activedescendant":r.getActiveSuggestionId(),disabled:!r.state.ready};return wi({},i,o,{onKeyDown:(0,Fr.compose)(r.handleInputKeyDown,o.onKeyDown),onBlur:(0,Fr.compose)(r.handleInputOnBlur,o.onBlur),value:r.props.value,onChange:function(a){r.handleInputChange(a)}})},r.getSuggestionItemProps=function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.handleSuggestionMouseEnter.bind(r,o.index),a=r.handleSuggestionClick.bind(r,o);return wi({},i,{key:o.id,id:r.getActiveSuggestionId(),role:"option",onMouseEnter:(0,Fr.compose)(s,i.onMouseEnter),onMouseLeave:(0,Fr.compose)(r.handleSuggestionMouseLeave,i.onMouseLeave),onMouseDown:(0,Fr.compose)(r.handleSuggestionMouseDown,i.onMouseDown),onMouseUp:(0,Fr.compose)(r.handleSuggestionMouseUp,i.onMouseUp),onTouchStart:(0,Fr.compose)(r.handleSuggestionTouchStart,i.onTouchStart),onTouchEnd:(0,Fr.compose)(r.handleSuggestionMouseUp,i.onTouchEnd),onClick:(0,Fr.compose)(a,i.onClick)})},r.handleSuggestionMouseEnter=function(o){r.setActiveAtIndex(o)},r.handleSuggestionMouseLeave=function(){r.mousedownOnSuggestion=!1,r.clearActive()},r.handleSuggestionMouseDown=function(o){o.preventDefault(),r.mousedownOnSuggestion=!0},r.handleSuggestionTouchStart=function(){r.mousedownOnSuggestion=!0},r.handleSuggestionMouseUp=function(){r.mousedownOnSuggestion=!1},r.handleSuggestionClick=function(o,i){i&&i.preventDefault&&i.preventDefault();var s=o.description,a=o.placeId;r.handleSelect(s,a,o),setTimeout(function(){r.mousedownOnSuggestion=!1})},r.state={loading:!1,suggestions:[],userInputValue:n.value,ready:!n.googleCallbackName},r.debouncedFetchPredictions=(0,WV.default)(r.fetchPredictions,n.debounce),r}return BV(e,[{key:"componentDidMount",value:function(){var r=this.props.googleCallbackName;if(r){var o=window.google&&window.google.maps&&window.google.maps.places;o?this.init():window[r]=this.init}else this.init()}},{key:"componentWillUnmount",value:function(){var r=this.props.googleCallbackName;r&&window[r]&&delete window[r]}},{key:"render",value:function(){return this.props.children({getInputProps:this.getInputProps,getSuggestionItemProps:this.getSuggestionItemProps,loading:this.state.loading,suggestions:this.state.suggestions})}}]),e}(zV.default.Component);Jh.propTypes={onChange:Ht.default.func.isRequired,value:Ht.default.string.isRequired,children:Ht.default.func.isRequired,onError:Ht.default.func,onSelect:Ht.default.func,searchOptions:Ht.default.shape({bounds:Ht.default.object,componentRestrictions:Ht.default.object,location:Ht.default.object,offset:Ht.default.oneOfType([Ht.default.number,Ht.default.string]),radius:Ht.default.oneOfType([Ht.default.number,Ht.default.string]),types:Ht.default.array}),debounce:Ht.default.number,highlightFirstSuggestion:Ht.default.bool,shouldFetchSuggestions:Ht.default.bool,googleCallbackName:Ht.default.string};Jh.defaultProps={onError:function(e,n){return console.error(`[react-places-autocomplete]: error happened when fetching data from Google Maps API. +`,oC=t=>{const{children:e,colsInRow:n}=t;return v.jsx(pV,{$colsInRow:n,children:v.jsx(fV,{children:e})})};oC.displayName="InstructionText";function iC(t){const{fieldDef:{name:e}={},path:n,skeleton:r,methods:{mountField:o}={},inputRef:i,fieldRef:s}=t;h.useEffect(()=>{if(!o||!e||r)return;const{unmount:a}=o({name:e,path:n,fieldRef:s==null?void 0:s.current,inputRef:i==null?void 0:i.current});return a},[o,e,n,i,r,s])}function hV(t){if(!(!t||!t.inputSettings)){if(t.type==="text"||t.type==="textEditor")return t.inputSettings.maxCharacters;if(t.type==="advancedSelection")return t.inputSettings.selectLimit<2?void 0:t.inputSettings.selectLimit}}function mV(t,e){return typeof t=="string"?e.type==="textEditor"?Zw(t):Vh(t):Array.isArray(t)?t.length:0}function gV(t,e){return h.useMemo(()=>{const n=hV(e);return n===void 0?void 0:[mV(t,e),n]},[e,t])}const vV=["color","date","dropdown","number","phone","text","textEditor","time"],yV=t=>{var b;const{children:e,error:n,fieldDef:r,colsInRow:o,value:i,id:s,spacing:a,disabled:l,skeleton:c,useRealLabel:u}=t,d=h.useRef(),p=typeof n=="string"?(n==null?void 0:n.trim().length)>0:!1,f=p||p&&!!(r!=null&&r.required)||typeof n=="boolean"&&n===!0,m=gV(i,r),g=(r==null?void 0:r.label)&&((b=r==null?void 0:r.label)==null?void 0:b.length)>0||m||(r==null?void 0:r.instructionText);iC({...t,fieldRef:d});const y=u||vV.includes(r==null?void 0:r.type);return v.jsxs(Q9,{id:s,className:r==null?void 0:r.className,style:r==null?void 0:r.style,"data-testid":"field-test-id",ref:d,"aria-disabled":l,children:[v.jsxs(eV,{$error:f,$spacing:a,children:[v.jsxs(tV,{$fullWidth:(r==null?void 0:r.size)==="full",children:[g&&(c?v.jsx(Xe,{width:92,height:28,sx:{marginBottom:"8px"}}):v.jsx(cV,{required:typeof r.required=="object"&&r.required.asterisk||!!r.required,limit:m,value:i,instructionText:r==null?void 0:r.instructionText,colsInRow:o,name:r.name,as:y?"label":"div",children:r==null?void 0:r.label})),v.jsx(nV,{$size:r==null?void 0:r.size,children:e})]}),f?v.jsx(Fp,{error:!!n,children:typeof n=="string"?n:void 0}):(r==null?void 0:r.helperText)&&v.jsx(Fp,{children:r==null?void 0:r.helperText})]}),(r==null?void 0:r.instructionText)&&v.jsx(oC,{colsInRow:o,children:r.instructionText})]})},qh=h.memo(yV);function bV({children:t,...e}){return iC(e),v.jsx(v.Fragment,{children:t})}const xV=h.memo(bV);var mo={},Kh={},wV="Expected a function",R0=NaN,CV="[object Symbol]",SV=/^\s+|\s+$/g,kV=/^[-+]0x[0-9a-f]+$/i,MV=/^0b[01]+$/i,EV=/^0o[0-7]+$/i,TV=parseInt,OV=typeof al=="object"&&al&&al.Object===Object&&al,LV=typeof self=="object"&&self&&self.Object===Object&&self,AV=OV||LV||Function("return this")(),PV=Object.prototype,RV=PV.toString,DV=Math.max,IV=Math.min,Td=function(){return AV.Date.now()};function $V(t,e,n){var r,o,i,s,a,l,c=0,u=!1,d=!1,p=!0;if(typeof t!="function")throw new TypeError(wV);e=D0(e)||0,Bp(n)&&(u=!!n.leading,d="maxWait"in n,i=d?DV(D0(n.maxWait)||0,e):i,p="trailing"in n?!!n.trailing:p);function f(w){var M=r,T=o;return r=o=void 0,c=w,s=t.apply(T,M),s}function m(w){return c=w,a=setTimeout(b,e),u?f(w):s}function g(w){var M=w-l,T=w-c,D=e-M;return d?IV(D,i-T):D}function y(w){var M=w-l,T=w-c;return l===void 0||M>=e||M<0||d&&T>=i}function b(){var w=Td();if(y(w))return x(w);a=setTimeout(b,g(w))}function x(w){return a=void 0,p&&r?f(w):(r=o=void 0,s)}function S(){a!==void 0&&clearTimeout(a),c=0,r=l=o=a=void 0}function E(){return a===void 0?s:x(Td())}function k(){var w=Td(),M=y(w);if(r=arguments,o=this,l=w,M){if(a===void 0)return m(l);if(d)return a=setTimeout(b,e),f(l)}return a===void 0&&(a=setTimeout(b,e)),s}return k.cancel=S,k.flush=E,k}function Bp(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function NV(t){return!!t&&typeof t=="object"}function _V(t){return typeof t=="symbol"||NV(t)&&RV.call(t)==CV}function D0(t){if(typeof t=="number")return t;if(_V(t))return R0;if(Bp(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Bp(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(SV,"");var n=MV.test(t);return n||EV.test(t)?TV(t.slice(2),n?2:8):kV.test(t)?R0:+t}var FV=$V,Au={};Object.defineProperty(Au,"__esModule",{value:!0});Au.compose=function(){for(var e=arguments.length,n=Array(e),r=0;r1?n-1:0),o=1;o0},r.getInputProps=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(o.hasOwnProperty("value"))throw new Error("[react-places-autocomplete]: getInputProps does not accept `value`. Use `value` prop instead");if(o.hasOwnProperty("onChange"))throw new Error("[react-places-autocomplete]: getInputProps does not accept `onChange`. Use `onChange` prop instead");var i={type:"text",autoComplete:"off",role:"combobox","aria-autocomplete":"list","aria-expanded":r.getIsExpanded(),"aria-activedescendant":r.getActiveSuggestionId(),disabled:!r.state.ready};return wi({},i,o,{onKeyDown:(0,Fr.compose)(r.handleInputKeyDown,o.onKeyDown),onBlur:(0,Fr.compose)(r.handleInputOnBlur,o.onBlur),value:r.props.value,onChange:function(a){r.handleInputChange(a)}})},r.getSuggestionItemProps=function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.handleSuggestionMouseEnter.bind(r,o.index),a=r.handleSuggestionClick.bind(r,o);return wi({},i,{key:o.id,id:r.getActiveSuggestionId(),role:"option",onMouseEnter:(0,Fr.compose)(s,i.onMouseEnter),onMouseLeave:(0,Fr.compose)(r.handleSuggestionMouseLeave,i.onMouseLeave),onMouseDown:(0,Fr.compose)(r.handleSuggestionMouseDown,i.onMouseDown),onMouseUp:(0,Fr.compose)(r.handleSuggestionMouseUp,i.onMouseUp),onTouchStart:(0,Fr.compose)(r.handleSuggestionTouchStart,i.onTouchStart),onTouchEnd:(0,Fr.compose)(r.handleSuggestionMouseUp,i.onTouchEnd),onClick:(0,Fr.compose)(a,i.onClick)})},r.handleSuggestionMouseEnter=function(o){r.setActiveAtIndex(o)},r.handleSuggestionMouseLeave=function(){r.mousedownOnSuggestion=!1,r.clearActive()},r.handleSuggestionMouseDown=function(o){o.preventDefault(),r.mousedownOnSuggestion=!0},r.handleSuggestionTouchStart=function(){r.mousedownOnSuggestion=!0},r.handleSuggestionMouseUp=function(){r.mousedownOnSuggestion=!1},r.handleSuggestionClick=function(o,i){i&&i.preventDefault&&i.preventDefault();var s=o.description,a=o.placeId;r.handleSelect(s,a,o),setTimeout(function(){r.mousedownOnSuggestion=!1})},r.state={loading:!1,suggestions:[],userInputValue:n.value,ready:!n.googleCallbackName},r.debouncedFetchPredictions=(0,WV.default)(r.fetchPredictions,n.debounce),r}return BV(e,[{key:"componentDidMount",value:function(){var r=this.props.googleCallbackName;if(r){var o=window.google&&window.google.maps&&window.google.maps.places;o?this.init():window[r]=this.init}else this.init()}},{key:"componentWillUnmount",value:function(){var r=this.props.googleCallbackName;r&&window[r]&&delete window[r]}},{key:"render",value:function(){return this.props.children({getInputProps:this.getInputProps,getSuggestionItemProps:this.getSuggestionItemProps,loading:this.state.loading,suggestions:this.state.suggestions})}}]),e}(zV.default.Component);Jh.propTypes={onChange:Ht.default.func.isRequired,value:Ht.default.string.isRequired,children:Ht.default.func.isRequired,onError:Ht.default.func,onSelect:Ht.default.func,searchOptions:Ht.default.shape({bounds:Ht.default.object,componentRestrictions:Ht.default.object,location:Ht.default.object,offset:Ht.default.oneOfType([Ht.default.number,Ht.default.string]),radius:Ht.default.oneOfType([Ht.default.number,Ht.default.string]),types:Ht.default.array}),debounce:Ht.default.number,highlightFirstSuggestion:Ht.default.bool,shouldFetchSuggestions:Ht.default.bool,googleCallbackName:Ht.default.string};Jh.defaultProps={onError:function(e,n){return console.error(`[react-places-autocomplete]: error happened when fetching data from Google Maps API. Please check the docs here (https://developers.google.com/maps/documentation/javascript/places#place_details_responses) Status: `,e)},searchOptions:{},debounce:200,highlightFirstSuggestion:!1,shouldFetchSuggestions:!0};Kh.default=Jh;var Ga={};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.geocodeByAddress=function(e){var n=new window.google.maps.Geocoder,r=window.google.maps.GeocoderStatus.OK;return new Promise(function(o,i){n.geocode({address:e},function(s,a){a!==r&&i(a),o(s)})})};Ga.getLatLng=function(e){return new Promise(function(n,r){try{var o={lat:e.geometry.location.lat(),lng:e.geometry.location.lng()};n(o)}catch(i){r(i)}})};Ga.geocodeByPlaceId=function(e){var n=new window.google.maps.Geocoder,r=window.google.maps.GeocoderStatus.OK;return new Promise(function(o,i){n.geocode({placeId:e},function(s,a){a!==r&&i(a),o(s)})})};Object.defineProperty(mo,"__esModule",{value:!0});var sC=mo.getLatLng=mo.geocodeByPlaceId=Xh=mo.geocodeByAddress=void 0,YV=Kh,JV=ZV(YV),Zh=Ga;function ZV(t){return t&&t.__esModule?t:{default:t}}var Xh=mo.geocodeByAddress=Zh.geocodeByAddress;mo.geocodeByPlaceId=Zh.geocodeByPlaceId;sC=mo.getLatLng=Zh.getLatLng;var XV=mo.default=JV.default;/*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -646,15 +646,15 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Bp=function(t,e){return Bp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},Bp(t,e)};function vt(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Bp(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Be=function(){return Be=Object.assign||function(e){for(var n,r=1,o=arguments.length;r0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]0&&i.innerText.includes(".gm-")}).forEach(function(i){i.parentNode&&i.parentNode.removeChild(i)})},n.injectScript=function(){n.props.preventGoogleFontsLoading&&uC(),Ft(!!n.props.id,'LoadScript requires "id" prop to be a string: %s',n.props.id);var r={id:n.props.id,nonce:n.props.nonce,url:dC(n.props)};cC(r).then(function(){n.props.onLoad&&n.props.onLoad(),n.setState(function(){return{loaded:!0}})}).catch(function(o){n.props.onError&&n.props.onError(o),console.error(` +`,"").indexOf(".gm-style")===0?(t.innerHTML="",!0):t.tagName.toLowerCase()==="style"&&!t.styleSheet&&!t.innerHTML}function uC(){var t=document.getElementsByTagName("head")[0];if(t){var e=t.insertBefore.bind(t);t.insertBefore=function(o,i){return N0(o)||Reflect.apply(e,t,[o,i]),o};var n=t.appendChild.bind(t);t.appendChild=function(o){return N0(o)||Reflect.apply(n,t,[o]),o}}}function dC(t){var e=t.googleMapsApiKey,n=t.googleMapsClientId,r=t.version,o=r===void 0?"weekly":r,i=t.language,s=t.region,a=t.libraries,l=t.channel,c=t.mapIds,u=t.authReferrerPolicy,d=[];return Ft(e&&n||!(e&&n),"You need to specify either googleMapsApiKey or googleMapsClientId for @react-google-maps/api load script to work. You cannot use both at the same time."),e?d.push("key=".concat(e)):n&&d.push("client=".concat(n)),o&&d.push("v=".concat(o)),i&&d.push("language=".concat(i)),s&&d.push("region=".concat(s)),a&&a.length&&d.push("libraries=".concat(a.sort().join(","))),l&&d.push("channel=".concat(l)),c&&c.length&&d.push("map_ids=".concat(c.join(","))),u&&d.push("auth_referrer_policy=".concat(u)),d.push("callback=initMap"),"https://maps.googleapis.com/maps/api/js?".concat(d.join("&"))}var As=!1;function pC(){return v.jsx("div",{children:"Loading..."})}var zp={id:"script-loader",version:"weekly"};(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.check=h.createRef(),n.state={loaded:!1},n.cleanupCallback=function(){delete window.google.maps,n.injectScript()},n.isCleaningUp=function(){return QV(n,void 0,void 0,function(){function r(o){if(!As)o();else if(Bo)var i=window.setInterval(function(){As||(window.clearInterval(i),o())},1)}return eW(this,function(o){return[2,new Promise(r)]})})},n.cleanup=function(){As=!0;var r=document.getElementById(n.props.id);r&&r.parentNode&&r.parentNode.removeChild(r),Array.prototype.slice.call(document.getElementsByTagName("script")).filter(function(i){return typeof i.src=="string"&&i.src.includes("maps.googleapis")}).forEach(function(i){i.parentNode&&i.parentNode.removeChild(i)}),Array.prototype.slice.call(document.getElementsByTagName("link")).filter(function(i){return i.href==="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans"}).forEach(function(i){i.parentNode&&i.parentNode.removeChild(i)}),Array.prototype.slice.call(document.getElementsByTagName("style")).filter(function(i){return i.innerText!==void 0&&i.innerText.length>0&&i.innerText.includes(".gm-")}).forEach(function(i){i.parentNode&&i.parentNode.removeChild(i)})},n.injectScript=function(){n.props.preventGoogleFontsLoading&&uC(),Ft(!!n.props.id,'LoadScript requires "id" prop to be a string: %s',n.props.id);var r={id:n.props.id,nonce:n.props.nonce,url:dC(n.props)};cC(r).then(function(){n.props.onLoad&&n.props.onLoad(),n.setState(function(){return{loaded:!0}})}).catch(function(o){n.props.onError&&n.props.onError(o),console.error(` There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(n.props.googleMapsApiKey||"-",") or Client ID (").concat(n.props.googleMapsClientId||"-",`) to Otherwise it is a Network issue. - `))})},n}return e.prototype.componentDidMount=function(){if(Bo){if(window.google&&window.google.maps&&!As){console.error("google api is already presented");return}this.isCleaningUp().then(this.injectScript).catch(function(r){console.error("Error at injecting script after cleaning up: ",r)})}},e.prototype.componentDidUpdate=function(n){this.props.libraries!==n.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),Bo&&n.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))},e.prototype.componentWillUnmount=function(){var n=this;if(Bo){this.cleanup();var r=function(){n.check.current||(delete window.google,As=!1)};window.setTimeout(r,1),this.props.onUnmount&&this.props.onUnmount()}},e.prototype.render=function(){return v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||v.jsx(pC,{})]})},e.defaultProps=jp,e})(h.PureComponent);var _0;function em(t){var e=t.id,n=e===void 0?jp.id:e,r=t.version,o=r===void 0?jp.version:r,i=t.nonce,s=t.googleMapsApiKey,a=t.googleMapsClientId,l=t.language,c=t.region,u=t.libraries,d=t.preventGoogleFontsLoading,p=t.channel,f=t.mapIds,m=t.authReferrerPolicy,g=h.useRef(!1),y=h.useState(!1),b=y[0],x=y[1],S=h.useState(void 0),E=S[0],k=S[1];h.useEffect(function(){return g.current=!0,function(){g.current=!1}},[]),h.useEffect(function(){Bo&&d&&uC()},[d]),h.useEffect(function(){b&&Ft(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")},[b]);var w=dC({version:o,googleMapsApiKey:s,googleMapsClientId:a,language:l,region:c,libraries:u,channel:p,mapIds:f,authReferrerPolicy:m});h.useEffect(function(){if(!Bo)return;function D(){g.current&&(x(!0),_0=w)}if(window.google&&window.google.maps&&_0===w){D();return}cC({id:n,url:w,nonce:i}).then(D).catch(function(U){g.current&&k(U),console.warn(` + `))})},n}return e.prototype.componentDidMount=function(){if(Bo){if(window.google&&window.google.maps&&!As){console.error("google api is already presented");return}this.isCleaningUp().then(this.injectScript).catch(function(r){console.error("Error at injecting script after cleaning up: ",r)})}},e.prototype.componentDidUpdate=function(n){this.props.libraries!==n.libraries&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),Bo&&n.language!==this.props.language&&(this.cleanup(),this.setState(function(){return{loaded:!1}},this.cleanupCallback))},e.prototype.componentWillUnmount=function(){var n=this;if(Bo){this.cleanup();var r=function(){n.check.current||(delete window.google,As=!1)};window.setTimeout(r,1),this.props.onUnmount&&this.props.onUnmount()}},e.prototype.render=function(){return v.jsxs(v.Fragment,{children:[v.jsx("div",{ref:this.check}),this.state.loaded?this.props.children:this.props.loadingElement||v.jsx(pC,{})]})},e.defaultProps=zp,e})(h.PureComponent);var _0;function em(t){var e=t.id,n=e===void 0?zp.id:e,r=t.version,o=r===void 0?zp.version:r,i=t.nonce,s=t.googleMapsApiKey,a=t.googleMapsClientId,l=t.language,c=t.region,u=t.libraries,d=t.preventGoogleFontsLoading,p=t.channel,f=t.mapIds,m=t.authReferrerPolicy,g=h.useRef(!1),y=h.useState(!1),b=y[0],x=y[1],S=h.useState(void 0),E=S[0],k=S[1];h.useEffect(function(){return g.current=!0,function(){g.current=!1}},[]),h.useEffect(function(){Bo&&d&&uC()},[d]),h.useEffect(function(){b&&Ft(!!window.google,"useLoadScript was marked as loaded, but window.google is not present. Something went wrong.")},[b]);var w=dC({version:o,googleMapsApiKey:s,googleMapsClientId:a,language:l,region:c,libraries:u,channel:p,mapIds:f,authReferrerPolicy:m});h.useEffect(function(){if(!Bo)return;function D(){g.current&&(x(!0),_0=w)}if(window.google&&window.google.maps&&_0===w){D();return}cC({id:n,url:w,nonce:i}).then(D).catch(function(U){g.current&&k(U),console.warn(` There has been an Error with loading Google Maps API script, please check that you provided correct google API key (`.concat(s||"-",") or Client ID (").concat(a||"-",`) Otherwise it is a Network issue. - `)),console.error(U)})},[n,w,i]);var M=h.useRef();return h.useEffect(function(){M.current&&u!==M.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),M.current=u},[u]),{isLoaded:b,loadError:E,url:w}}var uW=v.jsx(pC,{});function dW(t){var e=t.loadingElement,n=t.onLoad,r=t.onError,o=t.onUnmount,i=t.children,s=Qh(t,["loadingElement","onLoad","onError","onUnmount","children"]),a=em(s),l=a.isLoaded,c=a.loadError;return h.useEffect(function(){l&&typeof n=="function"&&n()},[l,n]),h.useEffect(function(){c&&typeof r=="function"&&r(c)},[c,r]),h.useEffect(function(){return function(){o&&o()}},[o]),l?i:e||uW}h.memo(dW);var F0;(function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.FAILURE=3]="FAILURE"})(F0||(F0={}));var B0={},j0={options:function(t,e){t.setOptions(e)}};function pW(t){var e=t.options,n=t.onLoad,r=t.onUnmount,o=h.useContext(Ue),i=h.useState(null),s=i[0],a=i[1];return h.useEffect(function(){s!==null&&s.setMap(o)},[o]),h.useEffect(function(){e&&s!==null&&s.setOptions(e)},[s,e]),h.useEffect(function(){var l=new google.maps.TrafficLayer(Be(Be({},e||{}),{map:o}));return a(l),n&&n(l),function(){s!==null&&(r&&r(s),s.setMap(null))}},[]),null}h.memo(pW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={trafficLayer:null},n.setTrafficLayerCallback=function(){n.state.trafficLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.trafficLayer)},n.registeredEvents=[],n}return e.prototype.componentDidMount=function(){var n=new google.maps.TrafficLayer(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:j0,eventMap:B0,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{trafficLayer:n}},this.setTrafficLayerCallback)},e.prototype.componentDidUpdate=function(n){this.state.trafficLayer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:j0,eventMap:B0,prevProps:n,nextProps:this.props,instance:this.state.trafficLayer}))},e.prototype.componentWillUnmount=function(){this.state.trafficLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),Qe(this.registeredEvents),this.state.trafficLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);function fW(t){var e=t.onLoad,n=t.onUnmount,r=h.useContext(Ue),o=h.useState(null),i=o[0],s=o[1];return h.useEffect(function(){i!==null&&i.setMap(r)},[r]),h.useEffect(function(){var a=new google.maps.BicyclingLayer;return s(a),a.setMap(r),e&&e(a),function(){a!==null&&(n&&n(a),a.setMap(null))}},[]),null}h.memo(fW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={bicyclingLayer:null},n.setBicyclingLayerCallback=function(){n.state.bicyclingLayer!==null&&(n.state.bicyclingLayer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.bicyclingLayer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.BicyclingLayer;this.setState(function(){return{bicyclingLayer:n}},this.setBicyclingLayerCallback)},e.prototype.componentWillUnmount=function(){this.state.bicyclingLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);function hW(t){var e=t.onLoad,n=t.onUnmount,r=h.useContext(Ue),o=h.useState(null),i=o[0],s=o[1];return h.useEffect(function(){i!==null&&i.setMap(r)},[r]),h.useEffect(function(){var a=new google.maps.TransitLayer;return s(a),a.setMap(r),e&&e(a),function(){i!==null&&(n&&n(i),i.setMap(null))}},[]),null}h.memo(hW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={transitLayer:null},n.setTransitLayerCallback=function(){n.state.transitLayer!==null&&(n.state.transitLayer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.transitLayer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:n}},this.setTransitLayerCallback)},e.prototype.componentWillUnmount=function(){this.state.transitLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var z0={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},H0={drawingMode:function(t,e){t.setDrawingMode(e)},options:function(t,e){t.setOptions(e)}};function mW(t){var e=t.options,n=t.drawingMode,r=t.onCircleComplete,o=t.onMarkerComplete,i=t.onOverlayComplete,s=t.onPolygonComplete,a=t.onPolylineComplete,l=t.onRectangleComplete,c=t.onLoad,u=t.onUnmount,d=h.useContext(Ue),p=h.useState(null),f=p[0],m=p[1],g=h.useState(null),y=g[0],b=g[1],x=h.useState(null),S=x[0],E=x[1],k=h.useState(null),w=k[0],M=k[1],T=h.useState(null),D=T[0],P=T[1],U=h.useState(null),N=U[0],K=U[1],R=h.useState(null),B=R[0],z=R[1];return h.useEffect(function(){f!==null&&f.setMap(d)},[d]),h.useEffect(function(){e&&f!==null&&f.setOptions(e)},[f,e]),h.useEffect(function(){f!==null&&f.setDrawingMode(n??null)},[f,n]),h.useEffect(function(){f&&r&&(y!==null&&google.maps.event.removeListener(y),b(google.maps.event.addListener(f,"circlecomplete",r)))},[f,r]),h.useEffect(function(){f&&o&&(S!==null&&google.maps.event.removeListener(S),E(google.maps.event.addListener(f,"markercomplete",o)))},[f,o]),h.useEffect(function(){f&&i&&(w!==null&&google.maps.event.removeListener(w),M(google.maps.event.addListener(f,"overlaycomplete",i)))},[f,i]),h.useEffect(function(){f&&s&&(D!==null&&google.maps.event.removeListener(D),P(google.maps.event.addListener(f,"polygoncomplete",s)))},[f,s]),h.useEffect(function(){f&&a&&(N!==null&&google.maps.event.removeListener(N),K(google.maps.event.addListener(f,"polylinecomplete",a)))},[f,a]),h.useEffect(function(){f&&l&&(B!==null&&google.maps.event.removeListener(B),z(google.maps.event.addListener(f,"rectanglecomplete",l)))},[f,l]),h.useEffect(function(){Ft(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var I=new google.maps.drawing.DrawingManager(Be(Be({},e||{}),{map:d}));return n&&I.setDrawingMode(n),r&&b(google.maps.event.addListener(I,"circlecomplete",r)),o&&E(google.maps.event.addListener(I,"markercomplete",o)),i&&M(google.maps.event.addListener(I,"overlaycomplete",i)),s&&P(google.maps.event.addListener(I,"polygoncomplete",s)),a&&K(google.maps.event.addListener(I,"polylinecomplete",a)),l&&z(google.maps.event.addListener(I,"rectanglecomplete",l)),m(I),c&&c(I),function(){f!==null&&(y&&google.maps.event.removeListener(y),S&&google.maps.event.removeListener(S),w&&google.maps.event.removeListener(w),D&&google.maps.event.removeListener(D),N&&google.maps.event.removeListener(N),B&&google.maps.event.removeListener(B),u&&u(f),f.setMap(null))}},[]),null}h.memo(mW);(function(t){vt(e,t);function e(n){var r=t.call(this,n)||this;return r.registeredEvents=[],r.state={drawingManager:null},r.setDrawingManagerCallback=function(){r.state.drawingManager!==null&&r.props.onLoad&&r.props.onLoad(r.state.drawingManager)},Ft(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing),r}return e.prototype.componentDidMount=function(){var n=new google.maps.drawing.DrawingManager(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:H0,eventMap:z0,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{drawingManager:n}},this.setDrawingManagerCallback)},e.prototype.componentDidUpdate=function(n){this.state.drawingManager!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:H0,eventMap:z0,prevProps:n,nextProps:this.props,instance:this.state.drawingManager}))},e.prototype.componentWillUnmount=function(){this.state.drawingManager!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),Qe(this.registeredEvents),this.state.drawingManager.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var V0={onAnimationChanged:"animation_changed",onClick:"click",onClickableChanged:"clickable_changed",onCursorChanged:"cursor_changed",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDraggableChanged:"draggable_changed",onDragStart:"dragstart",onFlatChanged:"flat_changed",onIconChanged:"icon_changed",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onPositionChanged:"position_changed",onRightClick:"rightclick",onShapeChanged:"shape_changed",onTitleChanged:"title_changed",onVisibleChanged:"visible_changed",onZindexChanged:"zindex_changed"},W0={animation:function(t,e){t.setAnimation(e)},clickable:function(t,e){t.setClickable(e)},cursor:function(t,e){t.setCursor(e)},draggable:function(t,e){t.setDraggable(e)},icon:function(t,e){t.setIcon(e)},label:function(t,e){t.setLabel(e)},map:function(t,e){t.setMap(e)},opacity:function(t,e){t.setOpacity(e)},options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},shape:function(t,e){t.setShape(e)},title:function(t,e){t.setTitle(e)},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},fc={};function gW(t){var e=t.position,n=t.options,r=t.clusterer,o=t.noClustererRedraw,i=t.children,s=t.draggable,a=t.visible,l=t.animation,c=t.clickable,u=t.cursor,d=t.icon,p=t.label,f=t.opacity,m=t.shape,g=t.title,y=t.zIndex,b=t.onClick,x=t.onDblClick,S=t.onDrag,E=t.onDragEnd,k=t.onDragStart,w=t.onMouseOut,M=t.onMouseOver,T=t.onMouseUp,D=t.onMouseDown,P=t.onRightClick,U=t.onClickableChanged,N=t.onCursorChanged,K=t.onAnimationChanged,R=t.onDraggableChanged,B=t.onFlatChanged,z=t.onIconChanged,I=t.onPositionChanged,oe=t.onShapeChanged,me=t.onTitleChanged,te=t.onVisibleChanged,G=t.onZindexChanged,X=t.onLoad,ie=t.onUnmount,Y=h.useContext(Ue),C=h.useState(null),A=C[0],j=C[1],H=h.useState(null),V=H[0],fe=H[1],pe=h.useState(null),he=pe[0],ke=pe[1],Te=h.useState(null),$=Te[0],F=Te[1],de=h.useState(null),Z=de[0],ae=de[1],ue=h.useState(null),ye=ue[0],be=ue[1],ge=h.useState(null),ce=ge[0],je=ge[1],Oe=h.useState(null),Ae=Oe[0],He=Oe[1],Pe=h.useState(null),it=Pe[0],jt=Pe[1],Pt=h.useState(null),Gt=Pt[0],zt=Pt[1],qt=h.useState(null),lt=qt[0],xn=qt[1],In=h.useState(null),$t=In[0],dn=In[1],Kt=h.useState(null),On=Kt[0],$n=Kt[1],Kn=h.useState(null),pn=Kn[0],fn=Kn[1],Dr=h.useState(null),Yn=Dr[0],Jn=Dr[1],Rt=h.useState(null),bt=Rt[0],Yt=Rt[1],Nn=h.useState(null),Zn=Nn[0],Ir=Nn[1],$r=h.useState(null),Qt=$r[0],Xn=$r[1],_n=h.useState(null),Fn=_n[0],re=_n[1],ee=h.useState(null),Me=ee[0],xe=ee[1],ze=h.useState(null),et=ze[0],L=ze[1],q=h.useState(null),le=q[0],ve=q[1];h.useEffect(function(){A!==null&&A.setMap(Y)},[Y]),h.useEffect(function(){typeof n<"u"&&A!==null&&A.setOptions(n)},[A,n]),h.useEffect(function(){typeof s<"u"&&A!==null&&A.setDraggable(s)},[A,s]),h.useEffect(function(){e&&A!==null&&A.setPosition(e)},[A,e]),h.useEffect(function(){typeof a<"u"&&A!==null&&A.setVisible(a)},[A,a]),h.useEffect(function(){A==null||A.setAnimation(l)},[A,l]),h.useEffect(function(){A&&c!==void 0&&A.setClickable(c)},[A,c]),h.useEffect(function(){A&&u!==void 0&&A.setCursor(u)},[A,u]),h.useEffect(function(){A&&d!==void 0&&A.setIcon(d)},[A,d]),h.useEffect(function(){A&&p!==void 0&&A.setLabel(p)},[A,p]),h.useEffect(function(){A&&f!==void 0&&A.setOpacity(f)},[A,f]),h.useEffect(function(){A&&m!==void 0&&A.setShape(m)},[A,m]),h.useEffect(function(){A&&g!==void 0&&A.setTitle(g)},[A,g]),h.useEffect(function(){A&&y!==void 0&&A.setZIndex(y)},[A,y]),h.useEffect(function(){A&&x&&(V!==null&&google.maps.event.removeListener(V),fe(google.maps.event.addListener(A,"dblclick",x)))},[x]),h.useEffect(function(){A&&E&&(he!==null&&google.maps.event.removeListener(he),ke(google.maps.event.addListener(A,"dragend",E)))},[E]),h.useEffect(function(){A&&k&&($!==null&&google.maps.event.removeListener($),F(google.maps.event.addListener(A,"dragstart",k)))},[k]),h.useEffect(function(){A&&D&&(Z!==null&&google.maps.event.removeListener(Z),ae(google.maps.event.addListener(A,"mousedown",D)))},[D]),h.useEffect(function(){A&&w&&(ye!==null&&google.maps.event.removeListener(ye),be(google.maps.event.addListener(A,"mouseout",w)))},[w]),h.useEffect(function(){A&&M&&(ce!==null&&google.maps.event.removeListener(ce),je(google.maps.event.addListener(A,"mouseover",M)))},[M]),h.useEffect(function(){A&&T&&(Ae!==null&&google.maps.event.removeListener(Ae),He(google.maps.event.addListener(A,"mouseup",T)))},[T]),h.useEffect(function(){A&&P&&(it!==null&&google.maps.event.removeListener(it),jt(google.maps.event.addListener(A,"rightclick",P)))},[P]),h.useEffect(function(){A&&b&&(Gt!==null&&google.maps.event.removeListener(Gt),zt(google.maps.event.addListener(A,"click",b)))},[b]),h.useEffect(function(){A&&S&&(lt!==null&&google.maps.event.removeListener(lt),xn(google.maps.event.addListener(A,"drag",S)))},[S]),h.useEffect(function(){A&&U&&($t!==null&&google.maps.event.removeListener($t),dn(google.maps.event.addListener(A,"clickable_changed",U)))},[U]),h.useEffect(function(){A&&N&&(On!==null&&google.maps.event.removeListener(On),$n(google.maps.event.addListener(A,"cursor_changed",N)))},[N]),h.useEffect(function(){A&&K&&(pn!==null&&google.maps.event.removeListener(pn),fn(google.maps.event.addListener(A,"animation_changed",K)))},[K]),h.useEffect(function(){A&&R&&(Yn!==null&&google.maps.event.removeListener(Yn),Jn(google.maps.event.addListener(A,"draggable_changed",R)))},[R]),h.useEffect(function(){A&&B&&(bt!==null&&google.maps.event.removeListener(bt),Yt(google.maps.event.addListener(A,"flat_changed",B)))},[B]),h.useEffect(function(){A&&z&&(Zn!==null&&google.maps.event.removeListener(Zn),Ir(google.maps.event.addListener(A,"icon_changed",z)))},[z]),h.useEffect(function(){A&&I&&(Qt!==null&&google.maps.event.removeListener(Qt),Xn(google.maps.event.addListener(A,"position_changed",I)))},[I]),h.useEffect(function(){A&&oe&&(Fn!==null&&google.maps.event.removeListener(Fn),re(google.maps.event.addListener(A,"shape_changed",oe)))},[oe]),h.useEffect(function(){A&&me&&(Me!==null&&google.maps.event.removeListener(Me),xe(google.maps.event.addListener(A,"title_changed",me)))},[me]),h.useEffect(function(){A&&te&&(et!==null&&google.maps.event.removeListener(et),L(google.maps.event.addListener(A,"visible_changed",te)))},[te]),h.useEffect(function(){A&&G&&(le!==null&&google.maps.event.removeListener(le),ve(google.maps.event.addListener(A,"zindex_changed",G)))},[G]),h.useEffect(function(){var $e=Be(Be(Be({},n||fc),r?fc:{map:Y}),{position:e}),we=new google.maps.Marker($e);return r?r.addMarker(we,!!o):we.setMap(Y),e&&we.setPosition(e),typeof a<"u"&&we.setVisible(a),typeof s<"u"&&we.setDraggable(s),typeof c<"u"&&we.setClickable(c),typeof u=="string"&&we.setCursor(u),d&&we.setIcon(d),typeof p<"u"&&we.setLabel(p),typeof f<"u"&&we.setOpacity(f),m&&we.setShape(m),typeof g=="string"&&we.setTitle(g),typeof y=="number"&&we.setZIndex(y),x&&fe(google.maps.event.addListener(we,"dblclick",x)),E&&ke(google.maps.event.addListener(we,"dragend",E)),k&&F(google.maps.event.addListener(we,"dragstart",k)),D&&ae(google.maps.event.addListener(we,"mousedown",D)),w&&be(google.maps.event.addListener(we,"mouseout",w)),M&&je(google.maps.event.addListener(we,"mouseover",M)),T&&He(google.maps.event.addListener(we,"mouseup",T)),P&&jt(google.maps.event.addListener(we,"rightclick",P)),b&&zt(google.maps.event.addListener(we,"click",b)),S&&xn(google.maps.event.addListener(we,"drag",S)),U&&dn(google.maps.event.addListener(we,"clickable_changed",U)),N&&$n(google.maps.event.addListener(we,"cursor_changed",N)),K&&fn(google.maps.event.addListener(we,"animation_changed",K)),R&&Jn(google.maps.event.addListener(we,"draggable_changed",R)),B&&Yt(google.maps.event.addListener(we,"flat_changed",B)),z&&Ir(google.maps.event.addListener(we,"icon_changed",z)),I&&Xn(google.maps.event.addListener(we,"position_changed",I)),oe&&re(google.maps.event.addListener(we,"shape_changed",oe)),me&&xe(google.maps.event.addListener(we,"title_changed",me)),te&&L(google.maps.event.addListener(we,"visible_changed",te)),G&&ve(google.maps.event.addListener(we,"zindex_changed",G)),j(we),X&&X(we),function(){V!==null&&google.maps.event.removeListener(V),he!==null&&google.maps.event.removeListener(he),$!==null&&google.maps.event.removeListener($),Z!==null&&google.maps.event.removeListener(Z),ye!==null&&google.maps.event.removeListener(ye),ce!==null&&google.maps.event.removeListener(ce),Ae!==null&&google.maps.event.removeListener(Ae),it!==null&&google.maps.event.removeListener(it),Gt!==null&&google.maps.event.removeListener(Gt),$t!==null&&google.maps.event.removeListener($t),On!==null&&google.maps.event.removeListener(On),pn!==null&&google.maps.event.removeListener(pn),Yn!==null&&google.maps.event.removeListener(Yn),bt!==null&&google.maps.event.removeListener(bt),Zn!==null&&google.maps.event.removeListener(Zn),Qt!==null&&google.maps.event.removeListener(Qt),Me!==null&&google.maps.event.removeListener(Me),et!==null&&google.maps.event.removeListener(et),le!==null&&google.maps.event.removeListener(le),ie&&ie(we),r?r.removeMarker(we,!!o):we&&we.setMap(null)}},[]);var Fe=h.useMemo(function(){return i?h.Children.map(i,function($e){if(!h.isValidElement($e))return $e;var we=$e;return h.cloneElement(we,{anchor:A})}):null},[i,A]);return v.jsx(v.Fragment,{children:Fe})||null}h.memo(gW);var vW=function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n}return e.prototype.componentDidMount=function(){var n=Be(Be(Be({},this.props.options||fc),this.props.clusterer?fc:{map:this.context}),{position:this.props.position});this.marker=new google.maps.Marker(n),this.props.clusterer?this.props.clusterer.addMarker(this.marker,!!this.props.noClustererRedraw):this.marker.setMap(this.context),this.registeredEvents=Ye({updaterMap:W0,eventMap:V0,prevProps:{},nextProps:this.props,instance:this.marker}),this.props.onLoad&&this.props.onLoad(this.marker)},e.prototype.componentDidUpdate=function(n){this.marker&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:W0,eventMap:V0,prevProps:n,nextProps:this.props,instance:this.marker}))},e.prototype.componentWillUnmount=function(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),Qe(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))},e.prototype.render=function(){var n=this,r=null;return this.props.children&&(r=h.Children.map(this.props.children,function(o){if(!h.isValidElement(o))return o;var i=o;return h.cloneElement(i,{anchor:n.marker})})),r||null},e.contextType=Ue,e}(h.PureComponent),yW=function(){function t(e,n){e.getClusterer().extend(t,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=n,this.center=void 0,this.div=null,this.sums=null,this.visible=!1,this.boundsChangedListener=null,this.url="",this.height=0,this.width=0,this.anchorText=[0,0],this.anchorIcon=[0,0],this.textColor="black",this.textSize=11,this.textDecoration="none",this.fontWeight="bold",this.fontStyle="normal",this.fontFamily="Arial,sans-serif",this.backgroundPosition="0 0",this.cMouseDownInCluster=null,this.cDraggingMapByCluster=null,this.timeOut=null,this.setMap(e.getMap()),this.onBoundsChanged=this.onBoundsChanged.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onClick=this.onClick.bind(this),this.onMouseOver=this.onMouseOver.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onAdd=this.onAdd.bind(this),this.onRemove=this.onRemove.bind(this),this.draw=this.draw.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.useStyle=this.useStyle.bind(this),this.setCenter=this.setCenter.bind(this),this.getPosFromLatLng=this.getPosFromLatLng.bind(this)}return t.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},t.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},t.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var n=this.cluster.getClusterer();if(google.maps.event.trigger(n,"click",this.cluster),google.maps.event.trigger(n,"clusterclick",this.cluster),n.getZoomOnClick()){var r=n.getMaxZoom(),o=this.cluster.getBounds(),i=n.getMap();i!==null&&"fitBounds"in i&&i.fitBounds(o),this.timeOut=window.setTimeout(function(){var s=n.getMap();if(s!==null){"fitBounds"in s&&s.fitBounds(o);var a=s.getZoom()||0;r!==null&&a>r&&s.setZoom(r+1)}},100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},t.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},t.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},t.prototype.onAdd=function(){var e;this.div=document.createElement("div"),this.div.className=this.className,this.visible&&this.show(),(e=this.getPanes())===null||e===void 0||e.overlayMouseTarget.appendChild(this.div);var n=this.getMap();n!==null&&(this.boundsChangedListener=google.maps.event.addListener(n,"bounds_changed",this.onBoundsChanged),this.div.addEventListener("mousedown",this.onMouseDown),this.div.addEventListener("click",this.onClick),this.div.addEventListener("mouseover",this.onMouseOver),this.div.addEventListener("mouseout",this.onMouseOut))},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),this.boundsChangedListener!==null&&google.maps.event.removeListener(this.boundsChangedListener),this.div.removeEventListener("mousedown",this.onMouseDown),this.div.removeEventListener("click",this.onClick),this.div.removeEventListener("mouseover",this.onMouseOver),this.div.removeEventListener("mouseout",this.onMouseOut),this.div.parentNode.removeChild(this.div),this.timeOut!==null&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},t.prototype.draw=function(){if(this.visible&&this.div!==null&&this.center){var e=this.getPosFromLatLng(this.center);this.div.style.top=e!==null?"".concat(e.y,"px"):"0",this.div.style.left=e!==null?"".concat(e.x,"px"):"0"}},t.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},t.prototype.show=function(){var e,n,r,o,i,s;if(this.div&&this.center){var a=this.sums===null||typeof this.sums.title>"u"||this.sums.title===""?this.cluster.getClusterer().getTitle():this.sums.title,l=this.backgroundPosition.split(" "),c=parseInt(((e=l[0])===null||e===void 0?void 0:e.replace(/^\s+|\s+$/g,""))||"0",10),u=parseInt(((n=l[1])===null||n===void 0?void 0:n.replace(/^\s+|\s+$/g,""))||"0",10),d=this.getPosFromLatLng(this.center);this.div.className=this.className,this.div.setAttribute("style","cursor: pointer; position: absolute; top: ".concat(d!==null?"".concat(d.y,"px"):"0","; left: ").concat(d!==null?"".concat(d.x,"px"):"0","; width: ").concat(this.width,"px; height: ").concat(this.height,"px; "));var p=document.createElement("img");p.alt=a,p.src=this.url,p.width=this.width,p.height=this.height,p.setAttribute("style","position: absolute; top: ".concat(u,"px; left: ").concat(c,"px")),this.cluster.getClusterer().enableRetinaIcons||(p.style.clip="rect(-".concat(u,"px, -").concat(c+this.width,"px, -").concat(u+this.height,", -").concat(c,")"));var f=document.createElement("div");f.setAttribute("style","position: absolute; top: ".concat(this.anchorText[0],"px; left: ").concat(this.anchorText[1],"px; color: ").concat(this.textColor,"; font-size: ").concat(this.textSize,"px; font-family: ").concat(this.fontFamily,"; font-weight: ").concat(this.fontWeight,"; fontStyle: ").concat(this.fontStyle,"; text-decoration: ").concat(this.textDecoration,"; text-align: center; width: ").concat(this.width,"px; line-height: ").concat(this.height,"px")),!((r=this.sums)===null||r===void 0)&&r.text&&(f.innerText="".concat((o=this.sums)===null||o===void 0?void 0:o.text)),!((i=this.sums)===null||i===void 0)&&i.html&&(f.innerHTML="".concat((s=this.sums)===null||s===void 0?void 0:s.html)),this.div.innerHTML="",this.div.appendChild(p),this.div.appendChild(f),this.div.title=a,this.div.style.display=""}this.visible=!0},t.prototype.useStyle=function(e){this.sums=e;var n=this.cluster.getClusterer().getStyles(),r=n[Math.min(n.length-1,Math.max(0,e.index-1))];r&&(this.url=r.url,this.height=r.height,this.width=r.width,r.className&&(this.className="".concat(this.clusterClassName," ").concat(r.className)),this.anchorText=r.anchorText||[0,0],this.anchorIcon=r.anchorIcon||[this.height/2,this.width/2],this.textColor=r.textColor||"black",this.textSize=r.textSize||11,this.textDecoration=r.textDecoration||"none",this.fontWeight=r.fontWeight||"bold",this.fontStyle=r.fontStyle||"normal",this.fontFamily=r.fontFamily||"Arial,sans-serif",this.backgroundPosition=r.backgroundPosition||"0 0")},t.prototype.setCenter=function(e){this.center=e},t.prototype.getPosFromLatLng=function(e){var n=this.getProjection().fromLatLngToDivPixel(e);return n!==null&&(n.x-=this.anchorIcon[1],n.y-=this.anchorIcon[0]),n},t}(),bW=function(){function t(e){this.markerClusterer=e,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new yW(this,this.markerClusterer.getStyles()),this.getSize=this.getSize.bind(this),this.getMarkers=this.getMarkers.bind(this),this.getCenter=this.getCenter.bind(this),this.getMap=this.getMap.bind(this),this.getClusterer=this.getClusterer.bind(this),this.getBounds=this.getBounds.bind(this),this.remove=this.remove.bind(this),this.addMarker=this.addMarker.bind(this),this.isMarkerInClusterBounds=this.isMarkerInClusterBounds.bind(this),this.calculateBounds=this.calculateBounds.bind(this),this.updateIcon=this.updateIcon.bind(this),this.isMarkerAlreadyAdded=this.isMarkerAlreadyAdded.bind(this)}return t.prototype.getSize=function(){return this.markers.length},t.prototype.getMarkers=function(){return this.markers},t.prototype.getCenter=function(){return this.center},t.prototype.getMap=function(){return this.map},t.prototype.getClusterer=function(){return this.markerClusterer},t.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),n=this.getMarkers(),r=0,o=n;rs)e.getMap()!==this.map&&e.setMap(this.map);else if(ir){this.clusterIcon.hide();return}if(n0))for(var e=0;e3?new google.maps.LatLngBounds(o==null?void 0:o.getSouthWest(),o==null?void 0:o.getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625)),a=this.getExtendedBounds(s),l=Math.min(e+this.batchSize,this.markers.length),c=e;c"u"&&(typeof e.isHidden>"u"?e.visible=!0:e.visible=!e.isHidden),this.isHidden=!e.visible,this.alignBottom=e.alignBottom||!1,this.pane=e.pane||"floatPane",this.enableEventPropagation=e.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}return t.prototype.createInfoBoxDiv=function(){var e=this,n=function(c){c.returnValue=!1,c.preventDefault&&c.preventDefault(),e.enableEventPropagation||U0(c)};if(!this.div){this.div=document.createElement("div"),this.setBoxStyle(),typeof this.content=="string"?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content));var r=this.getPanes();if(r!==null&&r[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(this.maxWidth!==0&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var o=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-o.left-o.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var i=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],s=0,a=i;sa&&(r=y.x+d+c+f-a),this.alignBottom?y.y<-u+m+p?o=y.y+u-m-p:y.y+u+m>l&&(o=y.y+u+m-l):y.y<-u+m?o=y.y+u-m:y.y+p+u+m>l&&(o=y.y+p+u+m-l)),r===0&&o===0||n.panBy(r,o)}}},t.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.div.style[n]=e[n]);if(this.div.style.webkitTransform="translateZ(0)",typeof this.div.style.opacity<"u"&&this.div.style.opacity!==""){var r=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+r*100+')"',this.div.style.filter="alpha(opacity="+r*100+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",this.zIndex!==null&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},t.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var n=this.div.ownerDocument,r=n&&n.defaultView?n.defaultView.getComputedStyle(this.div,""):null;r&&(e.top=parseInt(r.borderTopWidth||"",10)||0,e.bottom=parseInt(r.borderBottomWidth||"",10)||0,e.left=parseInt(r.borderLeftWidth||"",10)||0,e.right=parseInt(r.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var o=this.div.currentStyle;o&&(e.top=parseInt(o.borderTopWidth||"",10)||0,e.bottom=parseInt(o.borderBottomWidth||"",10)||0,e.left=parseInt(o.borderLeftWidth||"",10)||0,e.right=parseInt(o.borderRightWidth||"",10)||0)}return e},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},t.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection(),n=e.fromLatLngToDivPixel(this.position);n!==null&&(this.div.style.left=n.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(n.y+this.pixelOffset.height)+"px":this.div.style.top=n.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},t.prototype.setOptions=function(e){e===void 0&&(e={}),typeof e.boxClass<"u"&&(this.boxClass=e.boxClass,this.setBoxStyle()),typeof e.boxStyle<"u"&&(this.boxStyle=e.boxStyle,this.setBoxStyle()),typeof e.content<"u"&&this.setContent(e.content),typeof e.disableAutoPan<"u"&&(this.disableAutoPan=e.disableAutoPan),typeof e.maxWidth<"u"&&(this.maxWidth=e.maxWidth),typeof e.pixelOffset<"u"&&(this.pixelOffset=e.pixelOffset),typeof e.alignBottom<"u"&&(this.alignBottom=e.alignBottom),typeof e.position<"u"&&this.setPosition(e.position),typeof e.zIndex<"u"&&this.setZIndex(e.zIndex),typeof e.closeBoxMargin<"u"&&(this.closeBoxMargin=e.closeBoxMargin),typeof e.closeBoxURL<"u"&&(this.closeBoxURL=e.closeBoxURL),typeof e.infoBoxClearance<"u"&&(this.infoBoxClearance=e.infoBoxClearance),typeof e.isHidden<"u"&&(this.isHidden=e.isHidden),typeof e.visible<"u"&&(this.isHidden=!e.visible),typeof e.enableEventPropagation<"u"&&(this.enableEventPropagation=e.enableEventPropagation),this.div&&this.draw()},t.prototype.setContent=function(e){this.content=e,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px",typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},t.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},t.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},t.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},t.prototype.getContent=function(){return this.content},t.prototype.getPosition=function(){return this.position},t.prototype.getZIndex=function(){return this.zIndex},t.prototype.getVisible=function(){var e=this.getMap();return typeof e>"u"||e===null?!1:!this.isHidden},t.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},t.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},t.prototype.open=function(e,n){var r=this;n&&(this.position=n.getPosition(),this.moveListener=google.maps.event.addListener(n,"position_changed",function(){var o=n.getPosition();r.setPosition(o)}),this.mapListener=google.maps.event.addListener(n,"map_changed",function(){r.setMap(n.map)})),this.setMap(e),this.div&&this.panBox()},t.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,n=this.eventListeners;e."),d&&d(G)}return function(){g!==null&&(x&&google.maps.event.removeListener(x),T&&google.maps.event.removeListener(T),k&&google.maps.event.removeListener(k),U&&google.maps.event.removeListener(U),R&&google.maps.event.removeListener(R),p&&p(g),g.close())}},[]),z.current?Eo.createPortal(h.Children.only(e),z.current):null}h.memo(AW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=null,n.state={infoBox:null},n.open=function(r,o){o?n.context!==null&&r.open(n.context,o):r.getPosition()?n.context!==null&&r.open(n.context):Ft(!1,"You must provide either an anchor or a position prop for .")},n.setInfoBoxCallback=function(){n.state.infoBox!==null&&n.containerElement!==null&&(n.state.infoBox.setContent(n.containerElement),n.open(n.state.infoBox,n.props.anchor),n.props.onLoad&&n.props.onLoad(n.state.infoBox))},n}return e.prototype.componentDidMount=function(){var n=this.props.options||{},r=n.position,o=Qh(n,["position"]),i;r&&!(r instanceof google.maps.LatLng)&&(i=new google.maps.LatLng(r.lat,r.lng));var s=new hC(Be(Be({},o),i?{position:i}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=Ye({updaterMap:q0,eventMap:G0,prevProps:{},nextProps:this.props,instance:s}),this.setState({infoBox:s},this.setInfoBoxCallback)},e.prototype.componentDidUpdate=function(n){var r=this.state.infoBox;r!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:q0,eventMap:G0,prevProps:n,nextProps:this.props,instance:r}))},e.prototype.componentWillUnmount=function(){var n=this.props.onUnmount,r=this.state.infoBox;r!==null&&(n&&n(r),Qe(this.registeredEvents),r.close())},e.prototype.render=function(){return this.containerElement?Eo.createPortal(h.Children.only(this.props.children),this.containerElement):null},e.contextType=Ue,e})(h.PureComponent);var PW=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!t(e[o],n[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},K0=aC(PW);const Y0=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Td=1,Ps=8;class tm{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=r>>4;if(o!==Td)throw new Error(`Got v${o} data when expected v${Td}.`);const i=Y0[r&15];if(!i)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new tm(a,s,i,e)}constructor(e,n=64,r=Float64Array,o){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const i=Y0.indexOf(this.ArrayType),s=e*2*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,Ps,e),this.coords=new this.ArrayType(this.data,Ps+a+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Ps+s+a+l),this.ids=new this.IndexArrayType(this.data,Ps,e),this.coords=new this.ArrayType(this.data,Ps+a+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Td<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=n,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return zp(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,r,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:s,nodeSize:a}=this,l=[0,i.length-1,0],c=[];for(;l.length;){const u=l.pop()||0,d=l.pop()||0,p=l.pop()||0;if(d-p<=a){for(let y=p;y<=d;y++){const b=s[2*y],x=s[2*y+1];b>=e&&b<=r&&x>=n&&x<=o&&c.push(i[y])}continue}const f=p+d>>1,m=s[2*f],g=s[2*f+1];m>=e&&m<=r&&g>=n&&g<=o&&c.push(i[f]),(u===0?e<=m:n<=g)&&(l.push(p),l.push(f-1),l.push(1-u)),(u===0?r>=m:o>=g)&&(l.push(f+1),l.push(d),l.push(1-u))}return c}within(e,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:i,nodeSize:s}=this,a=[0,o.length-1,0],l=[],c=r*r;for(;a.length;){const u=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let y=p;y<=d;y++)J0(i[2*y],i[2*y+1],e,n)<=c&&l.push(o[y]);continue}const f=p+d>>1,m=i[2*f],g=i[2*f+1];J0(m,g,e,n)<=c&&l.push(o[f]),(u===0?e-r<=m:n-r<=g)&&(a.push(p),a.push(f-1),a.push(1-u)),(u===0?e+r>=m:n+r>=g)&&(a.push(f+1),a.push(d),a.push(1-u))}return l}}function zp(t,e,n,r,o,i){if(o-r<=n)return;const s=r+o>>1;mC(t,e,s,r,o,i),zp(t,e,n,r,s-1,1-i),zp(t,e,n,s+1,o,1-i)}function mC(t,e,n,r,o,i){for(;o>r;){if(o-r>600){const c=o-r+1,u=n-r+1,d=Math.log(c),p=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*p*(c-p)/c)*(u-c/2<0?-1:1),m=Math.max(r,Math.floor(n-u*p/c+f)),g=Math.min(o,Math.floor(n+(c-u)*p/c+f));mC(t,e,n,m,g,i)}const s=e[2*n+i];let a=r,l=o;for(Rs(t,e,r,n),e[2*o+i]>s&&Rs(t,e,r,o);as;)l--}e[2*r+i]===s?Rs(t,e,r,l):(l++,Rs(t,e,l,o)),l<=n&&(r=l+1),n<=l&&(o=l-1)}}function Rs(t,e,n,r){Od(t,n,r),Od(e,2*n,2*r),Od(e,2*n+1,2*r+1)}function Od(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function J0(t,e,n,r){const o=t-n,i=e-r;return o*o+i*i}const RW={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},Z0=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),Ro=2,so=3,Ld=4,ro=5,gC=6;class DW{constructor(e){this.options=Object.assign(Object.create(RW),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:n,minZoom:r,maxZoom:o}=this.options;n&&console.time("total time");const i=`prepare ${e.length} points`;n&&console.time(i),this.points=e;const s=[];for(let l=0;l=r;l--){const c=+Date.now();a=this.trees[l]=this._createTree(this._cluster(a,l)),n&&console.log("z%d: %d clusters in %dms",l,a.numItems,+Date.now()-c)}return n&&console.timeEnd("total time"),this}getClusters(e,n){let r=((e[0]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[1]));let i=e[2]===180?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){const d=this.getClusters([r,o,180,s],n),p=this.getClusters([-180,o,i,s],n);return d.concat(p)}const a=this.trees[this._limitZoom(n)],l=a.range(bl(r),xl(s),bl(i),xl(o)),c=a.data,u=[];for(const d of l){const p=this.stride*d;u.push(c[p+ro]>1?X0(c,p,this.clusterProps):this.points[c[p+so]])}return u}getChildren(e){const n=this._getOriginId(e),r=this._getOriginZoom(e),o="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(o);const s=i.data;if(n*this.stride>=s.length)throw new Error(o);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),l=s[n*this.stride],c=s[n*this.stride+1],u=i.within(l,c,a),d=[];for(const p of u){const f=p*this.stride;s[f+Ld]===e&&d.push(s[f+ro]>1?X0(s,f,this.clusterProps):this.points[s[f+so]])}if(d.length===0)throw new Error(o);return d}getLeaves(e,n,r){n=n||10,r=r||0;const o=[];return this._appendLeaves(o,e,n,r,0),o}getTile(e,n,r){const o=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:s,radius:a}=this.options,l=a/s,c=(r-l)/i,u=(r+1+l)/i,d={features:[]};return this._addTileFeatures(o.range((n-l)/i,c,(n+1+l)/i,u),o.data,n,r,i,d),n===0&&this._addTileFeatures(o.range(1-l/i,c,1,u),o.data,i,r,i,d),n===i-1&&this._addTileFeatures(o.range(0,c,l/i,u),o.data,-1,r,i,d),d.features.length?d:null}getClusterExpansionZoom(e){let n=this._getOriginZoom(e)-1;for(;n<=this.options.maxZoom;){const r=this.getChildren(e);if(n++,r.length!==1)break;e=r[0].properties.cluster_id}return n}_appendLeaves(e,n,r,o,i){const s=this.getChildren(n);for(const a of s){const l=a.properties;if(l&&l.cluster?i+l.point_count<=o?i+=l.point_count:i=this._appendLeaves(e,l.cluster_id,r,o,i):i1;let u,d,p;if(c)u=vC(n,l,this.clusterProps),d=n[l],p=n[l+1];else{const g=this.points[n[l+so]];u=g.properties;const[y,b]=g.geometry.coordinates;d=bl(y),p=xl(b)}const f={type:1,geometry:[[Math.round(this.options.extent*(d*i-r)),Math.round(this.options.extent*(p*i-o))]],tags:u};let m;c||this.options.generateId?m=n[l+so]:m=this.points[n[l+so]].id,m!==void 0&&(f.id=m),s.features.push(f)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){const{radius:r,extent:o,reduce:i,minPoints:s}=this.options,a=r/(o*Math.pow(2,n)),l=e.data,c=[],u=this.stride;for(let d=0;dn&&(y+=l[x+ro])}if(y>g&&y>=s){let b=p*g,x=f*g,S,E=-1;const k=((d/u|0)<<5)+(n+1)+this.points.length;for(const w of m){const M=w*u;if(l[M+Ro]<=n)continue;l[M+Ro]=n;const T=l[M+ro];b+=l[M]*T,x+=l[M+1]*T,l[M+Ld]=k,i&&(S||(S=this._map(l,d,!0),E=this.clusterProps.length,this.clusterProps.push(S)),i(S,this._map(l,M)))}l[d+Ld]=k,c.push(b/y,x/y,1/0,k,-1,y),i&&c.push(E)}else{for(let b=0;b1)for(const b of m){const x=b*u;if(!(l[x+Ro]<=n)){l[x+Ro]=n;for(let S=0;S>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n,r){if(e[n+ro]>1){const s=this.clusterProps[e[n+gC]];return r?Object.assign({},s):s}const o=this.points[e[n+so]].properties,i=this.options.map(o);return r&&i===o?Object.assign({},i):i}}function X0(t,e,n){return{type:"Feature",id:t[e+so],properties:vC(t,e,n),geometry:{type:"Point",coordinates:[IW(t[e]),$W(t[e+1])]}}}function vC(t,e,n){const r=t[e+ro],o=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,i=t[e+gC],s=i===-1?{}:Object.assign({},n[i]);return Object.assign(s,{cluster:!0,cluster_id:t[e+so],point_count:r,point_count_abbreviated:o})}function bl(t){return t/360+.5}function xl(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function IW(t){return(t-.5)*360}function $W(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! ***************************************************************************** + `)),console.error(U)})},[n,w,i]);var M=h.useRef();return h.useEffect(function(){M.current&&u!==M.current&&console.warn("Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables"),M.current=u},[u]),{isLoaded:b,loadError:E,url:w}}var uW=v.jsx(pC,{});function dW(t){var e=t.loadingElement,n=t.onLoad,r=t.onError,o=t.onUnmount,i=t.children,s=Qh(t,["loadingElement","onLoad","onError","onUnmount","children"]),a=em(s),l=a.isLoaded,c=a.loadError;return h.useEffect(function(){l&&typeof n=="function"&&n()},[l,n]),h.useEffect(function(){c&&typeof r=="function"&&r(c)},[c,r]),h.useEffect(function(){return function(){o&&o()}},[o]),l?i:e||uW}h.memo(dW);var F0;(function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.LOADING=1]="LOADING",t[t.SUCCESS=2]="SUCCESS",t[t.FAILURE=3]="FAILURE"})(F0||(F0={}));var B0={},j0={options:function(t,e){t.setOptions(e)}};function pW(t){var e=t.options,n=t.onLoad,r=t.onUnmount,o=h.useContext(Ue),i=h.useState(null),s=i[0],a=i[1];return h.useEffect(function(){s!==null&&s.setMap(o)},[o]),h.useEffect(function(){e&&s!==null&&s.setOptions(e)},[s,e]),h.useEffect(function(){var l=new google.maps.TrafficLayer(Be(Be({},e||{}),{map:o}));return a(l),n&&n(l),function(){s!==null&&(r&&r(s),s.setMap(null))}},[]),null}h.memo(pW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={trafficLayer:null},n.setTrafficLayerCallback=function(){n.state.trafficLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.trafficLayer)},n.registeredEvents=[],n}return e.prototype.componentDidMount=function(){var n=new google.maps.TrafficLayer(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:j0,eventMap:B0,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{trafficLayer:n}},this.setTrafficLayerCallback)},e.prototype.componentDidUpdate=function(n){this.state.trafficLayer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:j0,eventMap:B0,prevProps:n,nextProps:this.props,instance:this.state.trafficLayer}))},e.prototype.componentWillUnmount=function(){this.state.trafficLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.trafficLayer),Qe(this.registeredEvents),this.state.trafficLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);function fW(t){var e=t.onLoad,n=t.onUnmount,r=h.useContext(Ue),o=h.useState(null),i=o[0],s=o[1];return h.useEffect(function(){i!==null&&i.setMap(r)},[r]),h.useEffect(function(){var a=new google.maps.BicyclingLayer;return s(a),a.setMap(r),e&&e(a),function(){a!==null&&(n&&n(a),a.setMap(null))}},[]),null}h.memo(fW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={bicyclingLayer:null},n.setBicyclingLayerCallback=function(){n.state.bicyclingLayer!==null&&(n.state.bicyclingLayer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.bicyclingLayer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.BicyclingLayer;this.setState(function(){return{bicyclingLayer:n}},this.setBicyclingLayerCallback)},e.prototype.componentWillUnmount=function(){this.state.bicyclingLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.bicyclingLayer),this.state.bicyclingLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);function hW(t){var e=t.onLoad,n=t.onUnmount,r=h.useContext(Ue),o=h.useState(null),i=o[0],s=o[1];return h.useEffect(function(){i!==null&&i.setMap(r)},[r]),h.useEffect(function(){var a=new google.maps.TransitLayer;return s(a),a.setMap(r),e&&e(a),function(){i!==null&&(n&&n(i),i.setMap(null))}},[]),null}h.memo(hW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={transitLayer:null},n.setTransitLayerCallback=function(){n.state.transitLayer!==null&&(n.state.transitLayer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.transitLayer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.TransitLayer;this.setState(function(){return{transitLayer:n}},this.setTransitLayerCallback)},e.prototype.componentWillUnmount=function(){this.state.transitLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.transitLayer),this.state.transitLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var z0={onCircleComplete:"circlecomplete",onMarkerComplete:"markercomplete",onOverlayComplete:"overlaycomplete",onPolygonComplete:"polygoncomplete",onPolylineComplete:"polylinecomplete",onRectangleComplete:"rectanglecomplete"},H0={drawingMode:function(t,e){t.setDrawingMode(e)},options:function(t,e){t.setOptions(e)}};function mW(t){var e=t.options,n=t.drawingMode,r=t.onCircleComplete,o=t.onMarkerComplete,i=t.onOverlayComplete,s=t.onPolygonComplete,a=t.onPolylineComplete,l=t.onRectangleComplete,c=t.onLoad,u=t.onUnmount,d=h.useContext(Ue),p=h.useState(null),f=p[0],m=p[1],g=h.useState(null),y=g[0],b=g[1],x=h.useState(null),S=x[0],E=x[1],k=h.useState(null),w=k[0],M=k[1],T=h.useState(null),D=T[0],P=T[1],U=h.useState(null),N=U[0],K=U[1],R=h.useState(null),B=R[0],z=R[1];return h.useEffect(function(){f!==null&&f.setMap(d)},[d]),h.useEffect(function(){e&&f!==null&&f.setOptions(e)},[f,e]),h.useEffect(function(){f!==null&&f.setDrawingMode(n??null)},[f,n]),h.useEffect(function(){f&&r&&(y!==null&&google.maps.event.removeListener(y),b(google.maps.event.addListener(f,"circlecomplete",r)))},[f,r]),h.useEffect(function(){f&&o&&(S!==null&&google.maps.event.removeListener(S),E(google.maps.event.addListener(f,"markercomplete",o)))},[f,o]),h.useEffect(function(){f&&i&&(w!==null&&google.maps.event.removeListener(w),M(google.maps.event.addListener(f,"overlaycomplete",i)))},[f,i]),h.useEffect(function(){f&&s&&(D!==null&&google.maps.event.removeListener(D),P(google.maps.event.addListener(f,"polygoncomplete",s)))},[f,s]),h.useEffect(function(){f&&a&&(N!==null&&google.maps.event.removeListener(N),K(google.maps.event.addListener(f,"polylinecomplete",a)))},[f,a]),h.useEffect(function(){f&&l&&(B!==null&&google.maps.event.removeListener(B),z(google.maps.event.addListener(f,"rectanglecomplete",l)))},[f,l]),h.useEffect(function(){Ft(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing);var I=new google.maps.drawing.DrawingManager(Be(Be({},e||{}),{map:d}));return n&&I.setDrawingMode(n),r&&b(google.maps.event.addListener(I,"circlecomplete",r)),o&&E(google.maps.event.addListener(I,"markercomplete",o)),i&&M(google.maps.event.addListener(I,"overlaycomplete",i)),s&&P(google.maps.event.addListener(I,"polygoncomplete",s)),a&&K(google.maps.event.addListener(I,"polylinecomplete",a)),l&&z(google.maps.event.addListener(I,"rectanglecomplete",l)),m(I),c&&c(I),function(){f!==null&&(y&&google.maps.event.removeListener(y),S&&google.maps.event.removeListener(S),w&&google.maps.event.removeListener(w),D&&google.maps.event.removeListener(D),N&&google.maps.event.removeListener(N),B&&google.maps.event.removeListener(B),u&&u(f),f.setMap(null))}},[]),null}h.memo(mW);(function(t){vt(e,t);function e(n){var r=t.call(this,n)||this;return r.registeredEvents=[],r.state={drawingManager:null},r.setDrawingManagerCallback=function(){r.state.drawingManager!==null&&r.props.onLoad&&r.props.onLoad(r.state.drawingManager)},Ft(!!google.maps.drawing,"Did you include prop libraries={['drawing']} in the URL? %s",google.maps.drawing),r}return e.prototype.componentDidMount=function(){var n=new google.maps.drawing.DrawingManager(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:H0,eventMap:z0,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{drawingManager:n}},this.setDrawingManagerCallback)},e.prototype.componentDidUpdate=function(n){this.state.drawingManager!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:H0,eventMap:z0,prevProps:n,nextProps:this.props,instance:this.state.drawingManager}))},e.prototype.componentWillUnmount=function(){this.state.drawingManager!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.drawingManager),Qe(this.registeredEvents),this.state.drawingManager.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var V0={onAnimationChanged:"animation_changed",onClick:"click",onClickableChanged:"clickable_changed",onCursorChanged:"cursor_changed",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDraggableChanged:"draggable_changed",onDragStart:"dragstart",onFlatChanged:"flat_changed",onIconChanged:"icon_changed",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onPositionChanged:"position_changed",onRightClick:"rightclick",onShapeChanged:"shape_changed",onTitleChanged:"title_changed",onVisibleChanged:"visible_changed",onZindexChanged:"zindex_changed"},W0={animation:function(t,e){t.setAnimation(e)},clickable:function(t,e){t.setClickable(e)},cursor:function(t,e){t.setCursor(e)},draggable:function(t,e){t.setDraggable(e)},icon:function(t,e){t.setIcon(e)},label:function(t,e){t.setLabel(e)},map:function(t,e){t.setMap(e)},opacity:function(t,e){t.setOpacity(e)},options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},shape:function(t,e){t.setShape(e)},title:function(t,e){t.setTitle(e)},visible:function(t,e){t.setVisible(e)},zIndex:function(t,e){t.setZIndex(e)}},fc={};function gW(t){var e=t.position,n=t.options,r=t.clusterer,o=t.noClustererRedraw,i=t.children,s=t.draggable,a=t.visible,l=t.animation,c=t.clickable,u=t.cursor,d=t.icon,p=t.label,f=t.opacity,m=t.shape,g=t.title,y=t.zIndex,b=t.onClick,x=t.onDblClick,S=t.onDrag,E=t.onDragEnd,k=t.onDragStart,w=t.onMouseOut,M=t.onMouseOver,T=t.onMouseUp,D=t.onMouseDown,P=t.onRightClick,U=t.onClickableChanged,N=t.onCursorChanged,K=t.onAnimationChanged,R=t.onDraggableChanged,B=t.onFlatChanged,z=t.onIconChanged,I=t.onPositionChanged,oe=t.onShapeChanged,me=t.onTitleChanged,te=t.onVisibleChanged,G=t.onZindexChanged,X=t.onLoad,ie=t.onUnmount,Y=h.useContext(Ue),C=h.useState(null),A=C[0],j=C[1],H=h.useState(null),V=H[0],fe=H[1],pe=h.useState(null),he=pe[0],ke=pe[1],Te=h.useState(null),$=Te[0],F=Te[1],de=h.useState(null),Z=de[0],ae=de[1],ue=h.useState(null),be=ue[0],ye=ue[1],ge=h.useState(null),ce=ge[0],je=ge[1],Oe=h.useState(null),Ae=Oe[0],He=Oe[1],Pe=h.useState(null),it=Pe[0],jt=Pe[1],Pt=h.useState(null),Gt=Pt[0],zt=Pt[1],qt=h.useState(null),lt=qt[0],xn=qt[1],In=h.useState(null),$t=In[0],dn=In[1],Kt=h.useState(null),On=Kt[0],$n=Kt[1],Kn=h.useState(null),pn=Kn[0],fn=Kn[1],Dr=h.useState(null),Yn=Dr[0],Jn=Dr[1],Rt=h.useState(null),bt=Rt[0],Yt=Rt[1],Nn=h.useState(null),Zn=Nn[0],Ir=Nn[1],$r=h.useState(null),Qt=$r[0],Xn=$r[1],_n=h.useState(null),Fn=_n[0],re=_n[1],ee=h.useState(null),Me=ee[0],xe=ee[1],ze=h.useState(null),et=ze[0],L=ze[1],q=h.useState(null),le=q[0],ve=q[1];h.useEffect(function(){A!==null&&A.setMap(Y)},[Y]),h.useEffect(function(){typeof n<"u"&&A!==null&&A.setOptions(n)},[A,n]),h.useEffect(function(){typeof s<"u"&&A!==null&&A.setDraggable(s)},[A,s]),h.useEffect(function(){e&&A!==null&&A.setPosition(e)},[A,e]),h.useEffect(function(){typeof a<"u"&&A!==null&&A.setVisible(a)},[A,a]),h.useEffect(function(){A==null||A.setAnimation(l)},[A,l]),h.useEffect(function(){A&&c!==void 0&&A.setClickable(c)},[A,c]),h.useEffect(function(){A&&u!==void 0&&A.setCursor(u)},[A,u]),h.useEffect(function(){A&&d!==void 0&&A.setIcon(d)},[A,d]),h.useEffect(function(){A&&p!==void 0&&A.setLabel(p)},[A,p]),h.useEffect(function(){A&&f!==void 0&&A.setOpacity(f)},[A,f]),h.useEffect(function(){A&&m!==void 0&&A.setShape(m)},[A,m]),h.useEffect(function(){A&&g!==void 0&&A.setTitle(g)},[A,g]),h.useEffect(function(){A&&y!==void 0&&A.setZIndex(y)},[A,y]),h.useEffect(function(){A&&x&&(V!==null&&google.maps.event.removeListener(V),fe(google.maps.event.addListener(A,"dblclick",x)))},[x]),h.useEffect(function(){A&&E&&(he!==null&&google.maps.event.removeListener(he),ke(google.maps.event.addListener(A,"dragend",E)))},[E]),h.useEffect(function(){A&&k&&($!==null&&google.maps.event.removeListener($),F(google.maps.event.addListener(A,"dragstart",k)))},[k]),h.useEffect(function(){A&&D&&(Z!==null&&google.maps.event.removeListener(Z),ae(google.maps.event.addListener(A,"mousedown",D)))},[D]),h.useEffect(function(){A&&w&&(be!==null&&google.maps.event.removeListener(be),ye(google.maps.event.addListener(A,"mouseout",w)))},[w]),h.useEffect(function(){A&&M&&(ce!==null&&google.maps.event.removeListener(ce),je(google.maps.event.addListener(A,"mouseover",M)))},[M]),h.useEffect(function(){A&&T&&(Ae!==null&&google.maps.event.removeListener(Ae),He(google.maps.event.addListener(A,"mouseup",T)))},[T]),h.useEffect(function(){A&&P&&(it!==null&&google.maps.event.removeListener(it),jt(google.maps.event.addListener(A,"rightclick",P)))},[P]),h.useEffect(function(){A&&b&&(Gt!==null&&google.maps.event.removeListener(Gt),zt(google.maps.event.addListener(A,"click",b)))},[b]),h.useEffect(function(){A&&S&&(lt!==null&&google.maps.event.removeListener(lt),xn(google.maps.event.addListener(A,"drag",S)))},[S]),h.useEffect(function(){A&&U&&($t!==null&&google.maps.event.removeListener($t),dn(google.maps.event.addListener(A,"clickable_changed",U)))},[U]),h.useEffect(function(){A&&N&&(On!==null&&google.maps.event.removeListener(On),$n(google.maps.event.addListener(A,"cursor_changed",N)))},[N]),h.useEffect(function(){A&&K&&(pn!==null&&google.maps.event.removeListener(pn),fn(google.maps.event.addListener(A,"animation_changed",K)))},[K]),h.useEffect(function(){A&&R&&(Yn!==null&&google.maps.event.removeListener(Yn),Jn(google.maps.event.addListener(A,"draggable_changed",R)))},[R]),h.useEffect(function(){A&&B&&(bt!==null&&google.maps.event.removeListener(bt),Yt(google.maps.event.addListener(A,"flat_changed",B)))},[B]),h.useEffect(function(){A&&z&&(Zn!==null&&google.maps.event.removeListener(Zn),Ir(google.maps.event.addListener(A,"icon_changed",z)))},[z]),h.useEffect(function(){A&&I&&(Qt!==null&&google.maps.event.removeListener(Qt),Xn(google.maps.event.addListener(A,"position_changed",I)))},[I]),h.useEffect(function(){A&&oe&&(Fn!==null&&google.maps.event.removeListener(Fn),re(google.maps.event.addListener(A,"shape_changed",oe)))},[oe]),h.useEffect(function(){A&&me&&(Me!==null&&google.maps.event.removeListener(Me),xe(google.maps.event.addListener(A,"title_changed",me)))},[me]),h.useEffect(function(){A&&te&&(et!==null&&google.maps.event.removeListener(et),L(google.maps.event.addListener(A,"visible_changed",te)))},[te]),h.useEffect(function(){A&&G&&(le!==null&&google.maps.event.removeListener(le),ve(google.maps.event.addListener(A,"zindex_changed",G)))},[G]),h.useEffect(function(){var $e=Be(Be(Be({},n||fc),r?fc:{map:Y}),{position:e}),we=new google.maps.Marker($e);return r?r.addMarker(we,!!o):we.setMap(Y),e&&we.setPosition(e),typeof a<"u"&&we.setVisible(a),typeof s<"u"&&we.setDraggable(s),typeof c<"u"&&we.setClickable(c),typeof u=="string"&&we.setCursor(u),d&&we.setIcon(d),typeof p<"u"&&we.setLabel(p),typeof f<"u"&&we.setOpacity(f),m&&we.setShape(m),typeof g=="string"&&we.setTitle(g),typeof y=="number"&&we.setZIndex(y),x&&fe(google.maps.event.addListener(we,"dblclick",x)),E&&ke(google.maps.event.addListener(we,"dragend",E)),k&&F(google.maps.event.addListener(we,"dragstart",k)),D&&ae(google.maps.event.addListener(we,"mousedown",D)),w&&ye(google.maps.event.addListener(we,"mouseout",w)),M&&je(google.maps.event.addListener(we,"mouseover",M)),T&&He(google.maps.event.addListener(we,"mouseup",T)),P&&jt(google.maps.event.addListener(we,"rightclick",P)),b&&zt(google.maps.event.addListener(we,"click",b)),S&&xn(google.maps.event.addListener(we,"drag",S)),U&&dn(google.maps.event.addListener(we,"clickable_changed",U)),N&&$n(google.maps.event.addListener(we,"cursor_changed",N)),K&&fn(google.maps.event.addListener(we,"animation_changed",K)),R&&Jn(google.maps.event.addListener(we,"draggable_changed",R)),B&&Yt(google.maps.event.addListener(we,"flat_changed",B)),z&&Ir(google.maps.event.addListener(we,"icon_changed",z)),I&&Xn(google.maps.event.addListener(we,"position_changed",I)),oe&&re(google.maps.event.addListener(we,"shape_changed",oe)),me&&xe(google.maps.event.addListener(we,"title_changed",me)),te&&L(google.maps.event.addListener(we,"visible_changed",te)),G&&ve(google.maps.event.addListener(we,"zindex_changed",G)),j(we),X&&X(we),function(){V!==null&&google.maps.event.removeListener(V),he!==null&&google.maps.event.removeListener(he),$!==null&&google.maps.event.removeListener($),Z!==null&&google.maps.event.removeListener(Z),be!==null&&google.maps.event.removeListener(be),ce!==null&&google.maps.event.removeListener(ce),Ae!==null&&google.maps.event.removeListener(Ae),it!==null&&google.maps.event.removeListener(it),Gt!==null&&google.maps.event.removeListener(Gt),$t!==null&&google.maps.event.removeListener($t),On!==null&&google.maps.event.removeListener(On),pn!==null&&google.maps.event.removeListener(pn),Yn!==null&&google.maps.event.removeListener(Yn),bt!==null&&google.maps.event.removeListener(bt),Zn!==null&&google.maps.event.removeListener(Zn),Qt!==null&&google.maps.event.removeListener(Qt),Me!==null&&google.maps.event.removeListener(Me),et!==null&&google.maps.event.removeListener(et),le!==null&&google.maps.event.removeListener(le),ie&&ie(we),r?r.removeMarker(we,!!o):we&&we.setMap(null)}},[]);var Fe=h.useMemo(function(){return i?h.Children.map(i,function($e){if(!h.isValidElement($e))return $e;var we=$e;return h.cloneElement(we,{anchor:A})}):null},[i,A]);return v.jsx(v.Fragment,{children:Fe})||null}h.memo(gW);var vW=function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n}return e.prototype.componentDidMount=function(){var n=Be(Be(Be({},this.props.options||fc),this.props.clusterer?fc:{map:this.context}),{position:this.props.position});this.marker=new google.maps.Marker(n),this.props.clusterer?this.props.clusterer.addMarker(this.marker,!!this.props.noClustererRedraw):this.marker.setMap(this.context),this.registeredEvents=Ye({updaterMap:W0,eventMap:V0,prevProps:{},nextProps:this.props,instance:this.marker}),this.props.onLoad&&this.props.onLoad(this.marker)},e.prototype.componentDidUpdate=function(n){this.marker&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:W0,eventMap:V0,prevProps:n,nextProps:this.props,instance:this.marker}))},e.prototype.componentWillUnmount=function(){this.marker&&(this.props.onUnmount&&this.props.onUnmount(this.marker),Qe(this.registeredEvents),this.props.clusterer?this.props.clusterer.removeMarker(this.marker,!!this.props.noClustererRedraw):this.marker&&this.marker.setMap(null))},e.prototype.render=function(){var n=this,r=null;return this.props.children&&(r=h.Children.map(this.props.children,function(o){if(!h.isValidElement(o))return o;var i=o;return h.cloneElement(i,{anchor:n.marker})})),r||null},e.contextType=Ue,e}(h.PureComponent),yW=function(){function t(e,n){e.getClusterer().extend(t,google.maps.OverlayView),this.cluster=e,this.clusterClassName=this.cluster.getClusterer().getClusterClass(),this.className=this.clusterClassName,this.styles=n,this.center=void 0,this.div=null,this.sums=null,this.visible=!1,this.boundsChangedListener=null,this.url="",this.height=0,this.width=0,this.anchorText=[0,0],this.anchorIcon=[0,0],this.textColor="black",this.textSize=11,this.textDecoration="none",this.fontWeight="bold",this.fontStyle="normal",this.fontFamily="Arial,sans-serif",this.backgroundPosition="0 0",this.cMouseDownInCluster=null,this.cDraggingMapByCluster=null,this.timeOut=null,this.setMap(e.getMap()),this.onBoundsChanged=this.onBoundsChanged.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onClick=this.onClick.bind(this),this.onMouseOver=this.onMouseOver.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onAdd=this.onAdd.bind(this),this.onRemove=this.onRemove.bind(this),this.draw=this.draw.bind(this),this.hide=this.hide.bind(this),this.show=this.show.bind(this),this.useStyle=this.useStyle.bind(this),this.setCenter=this.setCenter.bind(this),this.getPosFromLatLng=this.getPosFromLatLng.bind(this)}return t.prototype.onBoundsChanged=function(){this.cDraggingMapByCluster=this.cMouseDownInCluster},t.prototype.onMouseDown=function(){this.cMouseDownInCluster=!0,this.cDraggingMapByCluster=!1},t.prototype.onClick=function(e){if(this.cMouseDownInCluster=!1,!this.cDraggingMapByCluster){var n=this.cluster.getClusterer();if(google.maps.event.trigger(n,"click",this.cluster),google.maps.event.trigger(n,"clusterclick",this.cluster),n.getZoomOnClick()){var r=n.getMaxZoom(),o=this.cluster.getBounds(),i=n.getMap();i!==null&&"fitBounds"in i&&i.fitBounds(o),this.timeOut=window.setTimeout(function(){var s=n.getMap();if(s!==null){"fitBounds"in s&&s.fitBounds(o);var a=s.getZoom()||0;r!==null&&a>r&&s.setZoom(r+1)}},100)}e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()}},t.prototype.onMouseOver=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseover",this.cluster)},t.prototype.onMouseOut=function(){google.maps.event.trigger(this.cluster.getClusterer(),"mouseout",this.cluster)},t.prototype.onAdd=function(){var e;this.div=document.createElement("div"),this.div.className=this.className,this.visible&&this.show(),(e=this.getPanes())===null||e===void 0||e.overlayMouseTarget.appendChild(this.div);var n=this.getMap();n!==null&&(this.boundsChangedListener=google.maps.event.addListener(n,"bounds_changed",this.onBoundsChanged),this.div.addEventListener("mousedown",this.onMouseDown),this.div.addEventListener("click",this.onClick),this.div.addEventListener("mouseover",this.onMouseOver),this.div.addEventListener("mouseout",this.onMouseOut))},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.hide(),this.boundsChangedListener!==null&&google.maps.event.removeListener(this.boundsChangedListener),this.div.removeEventListener("mousedown",this.onMouseDown),this.div.removeEventListener("click",this.onClick),this.div.removeEventListener("mouseover",this.onMouseOver),this.div.removeEventListener("mouseout",this.onMouseOut),this.div.parentNode.removeChild(this.div),this.timeOut!==null&&(window.clearTimeout(this.timeOut),this.timeOut=null),this.div=null)},t.prototype.draw=function(){if(this.visible&&this.div!==null&&this.center){var e=this.getPosFromLatLng(this.center);this.div.style.top=e!==null?"".concat(e.y,"px"):"0",this.div.style.left=e!==null?"".concat(e.x,"px"):"0"}},t.prototype.hide=function(){this.div&&(this.div.style.display="none"),this.visible=!1},t.prototype.show=function(){var e,n,r,o,i,s;if(this.div&&this.center){var a=this.sums===null||typeof this.sums.title>"u"||this.sums.title===""?this.cluster.getClusterer().getTitle():this.sums.title,l=this.backgroundPosition.split(" "),c=parseInt(((e=l[0])===null||e===void 0?void 0:e.replace(/^\s+|\s+$/g,""))||"0",10),u=parseInt(((n=l[1])===null||n===void 0?void 0:n.replace(/^\s+|\s+$/g,""))||"0",10),d=this.getPosFromLatLng(this.center);this.div.className=this.className,this.div.setAttribute("style","cursor: pointer; position: absolute; top: ".concat(d!==null?"".concat(d.y,"px"):"0","; left: ").concat(d!==null?"".concat(d.x,"px"):"0","; width: ").concat(this.width,"px; height: ").concat(this.height,"px; "));var p=document.createElement("img");p.alt=a,p.src=this.url,p.width=this.width,p.height=this.height,p.setAttribute("style","position: absolute; top: ".concat(u,"px; left: ").concat(c,"px")),this.cluster.getClusterer().enableRetinaIcons||(p.style.clip="rect(-".concat(u,"px, -").concat(c+this.width,"px, -").concat(u+this.height,", -").concat(c,")"));var f=document.createElement("div");f.setAttribute("style","position: absolute; top: ".concat(this.anchorText[0],"px; left: ").concat(this.anchorText[1],"px; color: ").concat(this.textColor,"; font-size: ").concat(this.textSize,"px; font-family: ").concat(this.fontFamily,"; font-weight: ").concat(this.fontWeight,"; fontStyle: ").concat(this.fontStyle,"; text-decoration: ").concat(this.textDecoration,"; text-align: center; width: ").concat(this.width,"px; line-height: ").concat(this.height,"px")),!((r=this.sums)===null||r===void 0)&&r.text&&(f.innerText="".concat((o=this.sums)===null||o===void 0?void 0:o.text)),!((i=this.sums)===null||i===void 0)&&i.html&&(f.innerHTML="".concat((s=this.sums)===null||s===void 0?void 0:s.html)),this.div.innerHTML="",this.div.appendChild(p),this.div.appendChild(f),this.div.title=a,this.div.style.display=""}this.visible=!0},t.prototype.useStyle=function(e){this.sums=e;var n=this.cluster.getClusterer().getStyles(),r=n[Math.min(n.length-1,Math.max(0,e.index-1))];r&&(this.url=r.url,this.height=r.height,this.width=r.width,r.className&&(this.className="".concat(this.clusterClassName," ").concat(r.className)),this.anchorText=r.anchorText||[0,0],this.anchorIcon=r.anchorIcon||[this.height/2,this.width/2],this.textColor=r.textColor||"black",this.textSize=r.textSize||11,this.textDecoration=r.textDecoration||"none",this.fontWeight=r.fontWeight||"bold",this.fontStyle=r.fontStyle||"normal",this.fontFamily=r.fontFamily||"Arial,sans-serif",this.backgroundPosition=r.backgroundPosition||"0 0")},t.prototype.setCenter=function(e){this.center=e},t.prototype.getPosFromLatLng=function(e){var n=this.getProjection().fromLatLngToDivPixel(e);return n!==null&&(n.x-=this.anchorIcon[1],n.y-=this.anchorIcon[0]),n},t}(),bW=function(){function t(e){this.markerClusterer=e,this.map=this.markerClusterer.getMap(),this.gridSize=this.markerClusterer.getGridSize(),this.minClusterSize=this.markerClusterer.getMinimumClusterSize(),this.averageCenter=this.markerClusterer.getAverageCenter(),this.markers=[],this.center=void 0,this.bounds=null,this.clusterIcon=new yW(this,this.markerClusterer.getStyles()),this.getSize=this.getSize.bind(this),this.getMarkers=this.getMarkers.bind(this),this.getCenter=this.getCenter.bind(this),this.getMap=this.getMap.bind(this),this.getClusterer=this.getClusterer.bind(this),this.getBounds=this.getBounds.bind(this),this.remove=this.remove.bind(this),this.addMarker=this.addMarker.bind(this),this.isMarkerInClusterBounds=this.isMarkerInClusterBounds.bind(this),this.calculateBounds=this.calculateBounds.bind(this),this.updateIcon=this.updateIcon.bind(this),this.isMarkerAlreadyAdded=this.isMarkerAlreadyAdded.bind(this)}return t.prototype.getSize=function(){return this.markers.length},t.prototype.getMarkers=function(){return this.markers},t.prototype.getCenter=function(){return this.center},t.prototype.getMap=function(){return this.map},t.prototype.getClusterer=function(){return this.markerClusterer},t.prototype.getBounds=function(){for(var e=new google.maps.LatLngBounds(this.center,this.center),n=this.getMarkers(),r=0,o=n;rs)e.getMap()!==this.map&&e.setMap(this.map);else if(ir){this.clusterIcon.hide();return}if(n0))for(var e=0;e3?new google.maps.LatLngBounds(o==null?void 0:o.getSouthWest(),o==null?void 0:o.getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625)),a=this.getExtendedBounds(s),l=Math.min(e+this.batchSize,this.markers.length),c=e;c"u"&&(typeof e.isHidden>"u"?e.visible=!0:e.visible=!e.isHidden),this.isHidden=!e.visible,this.alignBottom=e.alignBottom||!1,this.pane=e.pane||"floatPane",this.enableEventPropagation=e.enableEventPropagation||!1,this.div=null,this.closeListener=null,this.moveListener=null,this.mapListener=null,this.contextListener=null,this.eventListeners=null,this.fixedWidthSet=null}return t.prototype.createInfoBoxDiv=function(){var e=this,n=function(c){c.returnValue=!1,c.preventDefault&&c.preventDefault(),e.enableEventPropagation||U0(c)};if(!this.div){this.div=document.createElement("div"),this.setBoxStyle(),typeof this.content=="string"?this.div.innerHTML=this.getCloseBoxImg()+this.content:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(this.content));var r=this.getPanes();if(r!==null&&r[this.pane].appendChild(this.div),this.addClickHandler(),this.div.style.width)this.fixedWidthSet=!0;else if(this.maxWidth!==0&&this.div.offsetWidth>this.maxWidth)this.div.style.width=this.maxWidth+"px",this.fixedWidthSet=!0;else{var o=this.getBoxWidths();this.div.style.width=this.div.offsetWidth-o.left-o.right+"px",this.fixedWidthSet=!1}if(this.panBox(this.disableAutoPan),!this.enableEventPropagation){this.eventListeners=[];for(var i=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],s=0,a=i;sa&&(r=y.x+d+c+f-a),this.alignBottom?y.y<-u+m+p?o=y.y+u-m-p:y.y+u+m>l&&(o=y.y+u+m-l):y.y<-u+m?o=y.y+u-m:y.y+p+u+m>l&&(o=y.y+p+u+m-l)),r===0&&o===0||n.panBy(r,o)}}},t.prototype.setBoxStyle=function(){if(this.div){this.div.className=this.boxClass,this.div.style.cssText="";var e=this.boxStyle;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this.div.style[n]=e[n]);if(this.div.style.webkitTransform="translateZ(0)",typeof this.div.style.opacity<"u"&&this.div.style.opacity!==""){var r=parseFloat(this.div.style.opacity||"");this.div.style.msFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+r*100+')"',this.div.style.filter="alpha(opacity="+r*100+")"}this.div.style.position="absolute",this.div.style.visibility="hidden",this.zIndex!==null&&(this.div.style.zIndex=this.zIndex+""),this.div.style.overflow||(this.div.style.overflow="auto")}},t.prototype.getBoxWidths=function(){var e={top:0,bottom:0,left:0,right:0};if(!this.div)return e;if(document.defaultView){var n=this.div.ownerDocument,r=n&&n.defaultView?n.defaultView.getComputedStyle(this.div,""):null;r&&(e.top=parseInt(r.borderTopWidth||"",10)||0,e.bottom=parseInt(r.borderBottomWidth||"",10)||0,e.left=parseInt(r.borderLeftWidth||"",10)||0,e.right=parseInt(r.borderRightWidth||"",10)||0)}else if(document.documentElement.currentStyle){var o=this.div.currentStyle;o&&(e.top=parseInt(o.borderTopWidth||"",10)||0,e.bottom=parseInt(o.borderBottomWidth||"",10)||0,e.left=parseInt(o.borderLeftWidth||"",10)||0,e.right=parseInt(o.borderRightWidth||"",10)||0)}return e},t.prototype.onRemove=function(){this.div&&this.div.parentNode&&(this.div.parentNode.removeChild(this.div),this.div=null)},t.prototype.draw=function(){if(this.createInfoBoxDiv(),this.div){var e=this.getProjection(),n=e.fromLatLngToDivPixel(this.position);n!==null&&(this.div.style.left=n.x+this.pixelOffset.width+"px",this.alignBottom?this.div.style.bottom=-(n.y+this.pixelOffset.height)+"px":this.div.style.top=n.y+this.pixelOffset.height+"px"),this.isHidden?this.div.style.visibility="hidden":this.div.style.visibility="visible"}},t.prototype.setOptions=function(e){e===void 0&&(e={}),typeof e.boxClass<"u"&&(this.boxClass=e.boxClass,this.setBoxStyle()),typeof e.boxStyle<"u"&&(this.boxStyle=e.boxStyle,this.setBoxStyle()),typeof e.content<"u"&&this.setContent(e.content),typeof e.disableAutoPan<"u"&&(this.disableAutoPan=e.disableAutoPan),typeof e.maxWidth<"u"&&(this.maxWidth=e.maxWidth),typeof e.pixelOffset<"u"&&(this.pixelOffset=e.pixelOffset),typeof e.alignBottom<"u"&&(this.alignBottom=e.alignBottom),typeof e.position<"u"&&this.setPosition(e.position),typeof e.zIndex<"u"&&this.setZIndex(e.zIndex),typeof e.closeBoxMargin<"u"&&(this.closeBoxMargin=e.closeBoxMargin),typeof e.closeBoxURL<"u"&&(this.closeBoxURL=e.closeBoxURL),typeof e.infoBoxClearance<"u"&&(this.infoBoxClearance=e.infoBoxClearance),typeof e.isHidden<"u"&&(this.isHidden=e.isHidden),typeof e.visible<"u"&&(this.isHidden=!e.visible),typeof e.enableEventPropagation<"u"&&(this.enableEventPropagation=e.enableEventPropagation),this.div&&this.draw()},t.prototype.setContent=function(e){this.content=e,this.div&&(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.fixedWidthSet||(this.div.style.width=""),typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e)),this.fixedWidthSet||(this.div.style.width=this.div.offsetWidth+"px",typeof e=="string"?this.div.innerHTML=this.getCloseBoxImg()+e:(this.div.innerHTML=this.getCloseBoxImg(),this.div.appendChild(e))),this.addClickHandler()),google.maps.event.trigger(this,"content_changed")},t.prototype.setPosition=function(e){this.position=e,this.div&&this.draw(),google.maps.event.trigger(this,"position_changed")},t.prototype.setVisible=function(e){this.isHidden=!e,this.div&&(this.div.style.visibility=this.isHidden?"hidden":"visible")},t.prototype.setZIndex=function(e){this.zIndex=e,this.div&&(this.div.style.zIndex=e+""),google.maps.event.trigger(this,"zindex_changed")},t.prototype.getContent=function(){return this.content},t.prototype.getPosition=function(){return this.position},t.prototype.getZIndex=function(){return this.zIndex},t.prototype.getVisible=function(){var e=this.getMap();return typeof e>"u"||e===null?!1:!this.isHidden},t.prototype.show=function(){this.isHidden=!1,this.div&&(this.div.style.visibility="visible")},t.prototype.hide=function(){this.isHidden=!0,this.div&&(this.div.style.visibility="hidden")},t.prototype.open=function(e,n){var r=this;n&&(this.position=n.getPosition(),this.moveListener=google.maps.event.addListener(n,"position_changed",function(){var o=n.getPosition();r.setPosition(o)}),this.mapListener=google.maps.event.addListener(n,"map_changed",function(){r.setMap(n.map)})),this.setMap(e),this.div&&this.panBox()},t.prototype.close=function(){if(this.closeListener&&(google.maps.event.removeListener(this.closeListener),this.closeListener=null),this.eventListeners){for(var e=0,n=this.eventListeners;e."),d&&d(G)}return function(){g!==null&&(x&&google.maps.event.removeListener(x),T&&google.maps.event.removeListener(T),k&&google.maps.event.removeListener(k),U&&google.maps.event.removeListener(U),R&&google.maps.event.removeListener(R),p&&p(g),g.close())}},[]),z.current?Eo.createPortal(h.Children.only(e),z.current):null}h.memo(AW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=null,n.state={infoBox:null},n.open=function(r,o){o?n.context!==null&&r.open(n.context,o):r.getPosition()?n.context!==null&&r.open(n.context):Ft(!1,"You must provide either an anchor or a position prop for .")},n.setInfoBoxCallback=function(){n.state.infoBox!==null&&n.containerElement!==null&&(n.state.infoBox.setContent(n.containerElement),n.open(n.state.infoBox,n.props.anchor),n.props.onLoad&&n.props.onLoad(n.state.infoBox))},n}return e.prototype.componentDidMount=function(){var n=this.props.options||{},r=n.position,o=Qh(n,["position"]),i;r&&!(r instanceof google.maps.LatLng)&&(i=new google.maps.LatLng(r.lat,r.lng));var s=new hC(Be(Be({},o),i?{position:i}:{}));this.containerElement=document.createElement("div"),this.registeredEvents=Ye({updaterMap:q0,eventMap:G0,prevProps:{},nextProps:this.props,instance:s}),this.setState({infoBox:s},this.setInfoBoxCallback)},e.prototype.componentDidUpdate=function(n){var r=this.state.infoBox;r!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:q0,eventMap:G0,prevProps:n,nextProps:this.props,instance:r}))},e.prototype.componentWillUnmount=function(){var n=this.props.onUnmount,r=this.state.infoBox;r!==null&&(n&&n(r),Qe(this.registeredEvents),r.close())},e.prototype.render=function(){return this.containerElement?Eo.createPortal(h.Children.only(this.props.children),this.containerElement):null},e.contextType=Ue,e})(h.PureComponent);var PW=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!t(e[o],n[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},K0=aC(PW);const Y0=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Od=1,Ps=8;class tm{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,r]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const o=r>>4;if(o!==Od)throw new Error(`Got v${o} data when expected v${Od}.`);const i=Y0[r&15];if(!i)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(e,2,1),[a]=new Uint32Array(e,4,1);return new tm(a,s,i,e)}constructor(e,n=64,r=Float64Array,o){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const i=Y0.indexOf(this.ArrayType),s=e*2*this.ArrayType.BYTES_PER_ELEMENT,a=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,Ps,e),this.coords=new this.ArrayType(this.data,Ps+a+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Ps+s+a+l),this.ids=new this.IndexArrayType(this.data,Ps,e),this.coords=new this.ArrayType(this.data,Ps+a+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Od<<4)+i]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=n,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Hp(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,r,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:s,nodeSize:a}=this,l=[0,i.length-1,0],c=[];for(;l.length;){const u=l.pop()||0,d=l.pop()||0,p=l.pop()||0;if(d-p<=a){for(let y=p;y<=d;y++){const b=s[2*y],x=s[2*y+1];b>=e&&b<=r&&x>=n&&x<=o&&c.push(i[y])}continue}const f=p+d>>1,m=s[2*f],g=s[2*f+1];m>=e&&m<=r&&g>=n&&g<=o&&c.push(i[f]),(u===0?e<=m:n<=g)&&(l.push(p),l.push(f-1),l.push(1-u)),(u===0?r>=m:o>=g)&&(l.push(f+1),l.push(d),l.push(1-u))}return c}within(e,n,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:o,coords:i,nodeSize:s}=this,a=[0,o.length-1,0],l=[],c=r*r;for(;a.length;){const u=a.pop()||0,d=a.pop()||0,p=a.pop()||0;if(d-p<=s){for(let y=p;y<=d;y++)J0(i[2*y],i[2*y+1],e,n)<=c&&l.push(o[y]);continue}const f=p+d>>1,m=i[2*f],g=i[2*f+1];J0(m,g,e,n)<=c&&l.push(o[f]),(u===0?e-r<=m:n-r<=g)&&(a.push(p),a.push(f-1),a.push(1-u)),(u===0?e+r>=m:n+r>=g)&&(a.push(f+1),a.push(d),a.push(1-u))}return l}}function Hp(t,e,n,r,o,i){if(o-r<=n)return;const s=r+o>>1;mC(t,e,s,r,o,i),Hp(t,e,n,r,s-1,1-i),Hp(t,e,n,s+1,o,1-i)}function mC(t,e,n,r,o,i){for(;o>r;){if(o-r>600){const c=o-r+1,u=n-r+1,d=Math.log(c),p=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*p*(c-p)/c)*(u-c/2<0?-1:1),m=Math.max(r,Math.floor(n-u*p/c+f)),g=Math.min(o,Math.floor(n+(c-u)*p/c+f));mC(t,e,n,m,g,i)}const s=e[2*n+i];let a=r,l=o;for(Rs(t,e,r,n),e[2*o+i]>s&&Rs(t,e,r,o);as;)l--}e[2*r+i]===s?Rs(t,e,r,l):(l++,Rs(t,e,l,o)),l<=n&&(r=l+1),n<=l&&(o=l-1)}}function Rs(t,e,n,r){Ld(t,n,r),Ld(e,2*n,2*r),Ld(e,2*n+1,2*r+1)}function Ld(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function J0(t,e,n,r){const o=t-n,i=e-r;return o*o+i*i}const RW={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},Z0=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),Ro=2,so=3,Ad=4,ro=5,gC=6;class DW{constructor(e){this.options=Object.assign(Object.create(RW),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:n,minZoom:r,maxZoom:o}=this.options;n&&console.time("total time");const i=`prepare ${e.length} points`;n&&console.time(i),this.points=e;const s=[];for(let l=0;l=r;l--){const c=+Date.now();a=this.trees[l]=this._createTree(this._cluster(a,l)),n&&console.log("z%d: %d clusters in %dms",l,a.numItems,+Date.now()-c)}return n&&console.timeEnd("total time"),this}getClusters(e,n){let r=((e[0]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[1]));let i=e[2]===180?180:((e[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){const d=this.getClusters([r,o,180,s],n),p=this.getClusters([-180,o,i,s],n);return d.concat(p)}const a=this.trees[this._limitZoom(n)],l=a.range(bl(r),xl(s),bl(i),xl(o)),c=a.data,u=[];for(const d of l){const p=this.stride*d;u.push(c[p+ro]>1?X0(c,p,this.clusterProps):this.points[c[p+so]])}return u}getChildren(e){const n=this._getOriginId(e),r=this._getOriginZoom(e),o="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(o);const s=i.data;if(n*this.stride>=s.length)throw new Error(o);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),l=s[n*this.stride],c=s[n*this.stride+1],u=i.within(l,c,a),d=[];for(const p of u){const f=p*this.stride;s[f+Ad]===e&&d.push(s[f+ro]>1?X0(s,f,this.clusterProps):this.points[s[f+so]])}if(d.length===0)throw new Error(o);return d}getLeaves(e,n,r){n=n||10,r=r||0;const o=[];return this._appendLeaves(o,e,n,r,0),o}getTile(e,n,r){const o=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:s,radius:a}=this.options,l=a/s,c=(r-l)/i,u=(r+1+l)/i,d={features:[]};return this._addTileFeatures(o.range((n-l)/i,c,(n+1+l)/i,u),o.data,n,r,i,d),n===0&&this._addTileFeatures(o.range(1-l/i,c,1,u),o.data,i,r,i,d),n===i-1&&this._addTileFeatures(o.range(0,c,l/i,u),o.data,-1,r,i,d),d.features.length?d:null}getClusterExpansionZoom(e){let n=this._getOriginZoom(e)-1;for(;n<=this.options.maxZoom;){const r=this.getChildren(e);if(n++,r.length!==1)break;e=r[0].properties.cluster_id}return n}_appendLeaves(e,n,r,o,i){const s=this.getChildren(n);for(const a of s){const l=a.properties;if(l&&l.cluster?i+l.point_count<=o?i+=l.point_count:i=this._appendLeaves(e,l.cluster_id,r,o,i):i1;let u,d,p;if(c)u=vC(n,l,this.clusterProps),d=n[l],p=n[l+1];else{const g=this.points[n[l+so]];u=g.properties;const[y,b]=g.geometry.coordinates;d=bl(y),p=xl(b)}const f={type:1,geometry:[[Math.round(this.options.extent*(d*i-r)),Math.round(this.options.extent*(p*i-o))]],tags:u};let m;c||this.options.generateId?m=n[l+so]:m=this.points[n[l+so]].id,m!==void 0&&(f.id=m),s.features.push(f)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,n){const{radius:r,extent:o,reduce:i,minPoints:s}=this.options,a=r/(o*Math.pow(2,n)),l=e.data,c=[],u=this.stride;for(let d=0;dn&&(y+=l[x+ro])}if(y>g&&y>=s){let b=p*g,x=f*g,S,E=-1;const k=((d/u|0)<<5)+(n+1)+this.points.length;for(const w of m){const M=w*u;if(l[M+Ro]<=n)continue;l[M+Ro]=n;const T=l[M+ro];b+=l[M]*T,x+=l[M+1]*T,l[M+Ad]=k,i&&(S||(S=this._map(l,d,!0),E=this.clusterProps.length,this.clusterProps.push(S)),i(S,this._map(l,M)))}l[d+Ad]=k,c.push(b/y,x/y,1/0,k,-1,y),i&&c.push(E)}else{for(let b=0;b1)for(const b of m){const x=b*u;if(!(l[x+Ro]<=n)){l[x+Ro]=n;for(let S=0;S>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,n,r){if(e[n+ro]>1){const s=this.clusterProps[e[n+gC]];return r?Object.assign({},s):s}const o=this.points[e[n+so]].properties,i=this.options.map(o);return r&&i===o?Object.assign({},i):i}}function X0(t,e,n){return{type:"Feature",id:t[e+so],properties:vC(t,e,n),geometry:{type:"Point",coordinates:[IW(t[e]),$W(t[e+1])]}}}function vC(t,e,n){const r=t[e+ro],o=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,i=t[e+gC],s=i===-1?{}:Object.assign({},n[i]);return Object.assign(s,{cluster:!0,cluster_id:t[e+so],point_count:r,point_count_abbreviated:o})}function bl(t){return t/360+.5}function xl(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function IW(t){return(t-.5)*360}function $W(t){const e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -667,12 +667,12 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */function NW(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);ozn.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(zn.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class _W{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return FW(e)}}const FW=t=>t.map(n=>new Hp({position:zn.getPosition(n),markers:[n]}));class BW extends _W{constructor(e){var{maxZoom:n,radius:r=60}=e,o=NW(e,["maxZoom","radius"]);super({maxZoom:n}),this.state={zoom:-1},this.superCluster=new DW(Object.assign({maxZoom:this.maxZoom,radius:r},o))}calculate(e){let n=!1;const r={zoom:e.map.getZoom()};if(!K0(e.markers,this.markers)){n=!0,this.markers=[...e.markers];const o=this.markers.map(i=>{const s=zn.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[s.lng(),s.lat()]},properties:{marker:i}}});this.superCluster.load(o)}return n||(this.state.zoom<=this.maxZoom||r.zoom<=this.maxZoom)&&(n=!K0(this.state,r)),this.state=r,n&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:n}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(n=>this.transformCluster(n))}transformCluster({geometry:{coordinates:[e,n]},properties:r}){if(r.cluster)return new Hp({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(i=>i.properties.marker),position:{lat:n,lng:e}});const o=r.marker;return new Hp({markers:[o],position:zn.getPosition(o)})}}class jW{constructor(e,n){this.markers={sum:e.length};const r=n.map(i=>i.count),o=r.reduce((i,s)=>i+s,0);this.clusters={count:n.length,markers:{mean:o/n.length,sum:o,min:Math.min(...r),max:Math.max(...r)}}}}class zW{render({count:e,position:n},r,o){const s=` +***************************************************************************** */function NW(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);ozn.getVisible(e)).length}push(e){this.markers.push(e)}delete(){this.marker&&(zn.setMap(this.marker,null),this.marker=void 0),this.markers.length=0}}class _W{constructor({maxZoom:e=16}){this.maxZoom=e}noop({markers:e}){return FW(e)}}const FW=t=>t.map(n=>new Vp({position:zn.getPosition(n),markers:[n]}));class BW extends _W{constructor(e){var{maxZoom:n,radius:r=60}=e,o=NW(e,["maxZoom","radius"]);super({maxZoom:n}),this.state={zoom:-1},this.superCluster=new DW(Object.assign({maxZoom:this.maxZoom,radius:r},o))}calculate(e){let n=!1;const r={zoom:e.map.getZoom()};if(!K0(e.markers,this.markers)){n=!0,this.markers=[...e.markers];const o=this.markers.map(i=>{const s=zn.getPosition(i);return{type:"Feature",geometry:{type:"Point",coordinates:[s.lng(),s.lat()]},properties:{marker:i}}});this.superCluster.load(o)}return n||(this.state.zoom<=this.maxZoom||r.zoom<=this.maxZoom)&&(n=!K0(this.state,r)),this.state=r,n&&(this.clusters=this.cluster(e)),{clusters:this.clusters,changed:n}}cluster({map:e}){return this.superCluster.getClusters([-180,-90,180,90],Math.round(e.getZoom())).map(n=>this.transformCluster(n))}transformCluster({geometry:{coordinates:[e,n]},properties:r}){if(r.cluster)return new Vp({markers:this.superCluster.getLeaves(r.cluster_id,1/0).map(i=>i.properties.marker),position:{lat:n,lng:e}});const o=r.marker;return new Vp({markers:[o],position:zn.getPosition(o)})}}class jW{constructor(e,n){this.markers={sum:e.length};const r=n.map(i=>i.count),o=r.reduce((i,s)=>i+s,0);this.clusters={count:n.length,markers:{mean:o/n.length,sum:o,min:Math.min(...r),max:Math.max(...r)}}}}class zW{render({count:e,position:n},r,o){const s=` ${e} -`,a=`Cluster of ${e} markers`,l=Number(google.maps.Marker.MAX_ZINDEX)+e;if(zn.isAdvancedMarkerAvailable(o)){const d=new DOMParser().parseFromString(s,"image/svg+xml").documentElement;d.setAttribute("transform","translate(0 25)");const p={map:o,position:n,zIndex:l,title:a,content:d};return new google.maps.marker.AdvancedMarkerElement(p)}const c={position:n,zIndex:l,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(c)}}function HW(t,e){for(let n in e.prototype)t.prototype[n]=e.prototype[n]}class nm{constructor(){HW(nm,google.maps.OverlayView)}}var na;(function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"})(na||(na={}));const VW=(t,e,n)=>{n.fitBounds(e.bounds)};class WW extends nm{constructor({map:e,markers:n=[],algorithmOptions:r={},algorithm:o=new BW(r),renderer:i=new zW,onClusterClick:s=VW}){super(),this.markers=[...n],this.clusters=[],this.algorithm=o,this.renderer=i,this.onClusterClick=s,e&&this.setMap(e)}addMarker(e,n){this.markers.includes(e)||(this.markers.push(e),n||this.render())}addMarkers(e,n){e.forEach(r=>{this.addMarker(r,!0)}),n||this.render()}removeMarker(e,n){const r=this.markers.indexOf(e);return r===-1?!1:(zn.setMap(e,null),this.markers.splice(r,1),n||this.render(),!0)}removeMarkers(e,n){let r=!1;return e.forEach(o=>{r=this.removeMarker(o,!0)||r}),r&&!n&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,na.CLUSTERING_BEGIN,this);const{clusters:n,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const o=new Set;for(const s of n)s.markers.length==1&&o.add(s.markers[0]);const i=[];for(const s of this.clusters)s.marker!=null&&(s.markers.length==1?o.has(s.marker)||zn.setMap(s.marker,null):i.push(s.marker));this.clusters=n,this.renderClusters(),requestAnimationFrame(()=>i.forEach(s=>zn.setMap(s,null)))}google.maps.event.trigger(this,na.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>zn.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new jW(this.markers,this.clusters),n=this.getMap();this.clusters.forEach(r=>{r.markers.length===1?r.marker=r.markers[0]:(r.marker=this.renderer.render(r,e,n),r.markers.forEach(o=>zn.setMap(o,null)),this.onClusterClick&&r.marker.addListener("click",o=>{google.maps.event.trigger(this,na.CLUSTER_CLICK,r),this.onClusterClick(o,r,n)})),zn.setMap(r.marker,n)})}}function UW(t){var e=lC(),n=h.useState(null),r=n[0],o=n[1];return h.useEffect(function(){if(e&&r===null){var i=new WW(Be(Be({},t),{map:e}));o(i)}},[e]),r}function GW(t){var e=t.children,n=t.options,r=UW(n);return r!==null?e(r):null}h.memo(GW);var Q0={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},ey={options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},zIndex:function(t,e){t.setZIndex(e)}};function qW(t){var e=t.children,n=t.anchor,r=t.options,o=t.position,i=t.zIndex,s=t.onCloseClick,a=t.onDomReady,l=t.onContentChanged,c=t.onPositionChanged,u=t.onZindexChanged,d=t.onLoad,p=t.onUnmount,f=h.useContext(Ue),m=h.useState(null),g=m[0],y=m[1],b=h.useState(null),x=b[0],S=b[1],E=h.useState(null),k=E[0],w=E[1],M=h.useState(null),T=M[0],D=M[1],P=h.useState(null),U=P[0],N=P[1],K=h.useState(null),R=K[0],B=K[1],z=h.useRef(null);return h.useEffect(function(){g!==null&&(g.close(),n?g.open(f,n):g.getPosition()&&g.open(f))},[f,g,n]),h.useEffect(function(){r&&g!==null&&g.setOptions(r)},[g,r]),h.useEffect(function(){o&&g!==null&&g.setPosition(o)},[o]),h.useEffect(function(){typeof i=="number"&&g!==null&&g.setZIndex(i)},[i]),h.useEffect(function(){g&&s&&(x!==null&&google.maps.event.removeListener(x),S(google.maps.event.addListener(g,"closeclick",s)))},[s]),h.useEffect(function(){g&&a&&(k!==null&&google.maps.event.removeListener(k),w(google.maps.event.addListener(g,"domready",a)))},[a]),h.useEffect(function(){g&&l&&(T!==null&&google.maps.event.removeListener(T),D(google.maps.event.addListener(g,"content_changed",l)))},[l]),h.useEffect(function(){g&&c&&(U!==null&&google.maps.event.removeListener(U),N(google.maps.event.addListener(g,"position_changed",c)))},[c]),h.useEffect(function(){g&&u&&(R!==null&&google.maps.event.removeListener(R),B(google.maps.event.addListener(g,"zindex_changed",u)))},[u]),h.useEffect(function(){var I=new google.maps.InfoWindow(Be({},r||{}));return y(I),z.current=document.createElement("div"),s&&S(google.maps.event.addListener(I,"closeclick",s)),a&&w(google.maps.event.addListener(I,"domready",a)),l&&D(google.maps.event.addListener(I,"content_changed",l)),c&&N(google.maps.event.addListener(I,"position_changed",c)),u&&B(google.maps.event.addListener(I,"zindex_changed",u)),I.setContent(z.current),o&&I.setPosition(o),i&&I.setZIndex(i),n?I.open(f,n):I.getPosition()?I.open(f):Ft(!1,"You must provide either an anchor (typically render it inside a ) or a position props for ."),d&&d(I),function(){x&&google.maps.event.removeListener(x),T&&google.maps.event.removeListener(T),k&&google.maps.event.removeListener(k),U&&google.maps.event.removeListener(U),R&&google.maps.event.removeListener(R),p&&p(I),I.close()}},[]),z.current?Eo.createPortal(h.Children.only(e),z.current):null}h.memo(qW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=null,n.state={infoWindow:null},n.open=function(r,o){o?r.open(n.context,o):r.getPosition()?r.open(n.context):Ft(!1,"You must provide either an anchor (typically render it inside a ) or a position props for .")},n.setInfoWindowCallback=function(){n.state.infoWindow!==null&&n.containerElement!==null&&(n.state.infoWindow.setContent(n.containerElement),n.open(n.state.infoWindow,n.props.anchor),n.props.onLoad&&n.props.onLoad(n.state.infoWindow))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.InfoWindow(Be({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=Ye({updaterMap:ey,eventMap:Q0,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{infoWindow:n}},this.setInfoWindowCallback)},e.prototype.componentDidUpdate=function(n){this.state.infoWindow!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:ey,eventMap:Q0,prevProps:n,nextProps:this.props,instance:this.state.infoWindow}))},e.prototype.componentWillUnmount=function(){this.state.infoWindow!==null&&(Qe(this.registeredEvents),this.props.onUnmount&&this.props.onUnmount(this.state.infoWindow),this.state.infoWindow.close())},e.prototype.render=function(){return this.containerElement?Eo.createPortal(h.Children.only(this.props.children),this.containerElement):null},e.contextType=Ue,e})(h.PureComponent);var ty={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ny={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},visible:function(t,e){t.setVisible(e)}},KW={};function YW(t){var e=t.options,n=t.draggable,r=t.editable,o=t.visible,i=t.path,s=t.onDblClick,a=t.onDragEnd,l=t.onDragStart,c=t.onMouseDown,u=t.onMouseMove,d=t.onMouseOut,p=t.onMouseOver,f=t.onMouseUp,m=t.onRightClick,g=t.onClick,y=t.onDrag,b=t.onLoad,x=t.onUnmount,S=h.useContext(Ue),E=h.useState(null),k=E[0],w=E[1],M=h.useState(null),T=M[0],D=M[1],P=h.useState(null),U=P[0],N=P[1],K=h.useState(null),R=K[0],B=K[1],z=h.useState(null),I=z[0],oe=z[1],me=h.useState(null),te=me[0],G=me[1],X=h.useState(null),ie=X[0],Y=X[1],C=h.useState(null),A=C[0],j=C[1],H=h.useState(null),V=H[0],fe=H[1],pe=h.useState(null),he=pe[0],ke=pe[1],Te=h.useState(null),$=Te[0],F=Te[1],de=h.useState(null),Z=de[0],ae=de[1];return h.useEffect(function(){k!==null&&k.setMap(S)},[S]),h.useEffect(function(){typeof e<"u"&&k!==null&&k.setOptions(e)},[k,e]),h.useEffect(function(){typeof n<"u"&&k!==null&&k.setDraggable(n)},[k,n]),h.useEffect(function(){typeof r<"u"&&k!==null&&k.setEditable(r)},[k,r]),h.useEffect(function(){typeof o<"u"&&k!==null&&k.setVisible(o)},[k,o]),h.useEffect(function(){typeof i<"u"&&k!==null&&k.setPath(i)},[k,i]),h.useEffect(function(){k&&s&&(T!==null&&google.maps.event.removeListener(T),D(google.maps.event.addListener(k,"dblclick",s)))},[s]),h.useEffect(function(){k&&a&&(U!==null&&google.maps.event.removeListener(U),N(google.maps.event.addListener(k,"dragend",a)))},[a]),h.useEffect(function(){k&&l&&(R!==null&&google.maps.event.removeListener(R),B(google.maps.event.addListener(k,"dragstart",l)))},[l]),h.useEffect(function(){k&&c&&(I!==null&&google.maps.event.removeListener(I),oe(google.maps.event.addListener(k,"mousedown",c)))},[c]),h.useEffect(function(){k&&u&&(te!==null&&google.maps.event.removeListener(te),G(google.maps.event.addListener(k,"mousemove",u)))},[u]),h.useEffect(function(){k&&d&&(ie!==null&&google.maps.event.removeListener(ie),Y(google.maps.event.addListener(k,"mouseout",d)))},[d]),h.useEffect(function(){k&&p&&(A!==null&&google.maps.event.removeListener(A),j(google.maps.event.addListener(k,"mouseover",p)))},[p]),h.useEffect(function(){k&&f&&(V!==null&&google.maps.event.removeListener(V),fe(google.maps.event.addListener(k,"mouseup",f)))},[f]),h.useEffect(function(){k&&m&&(he!==null&&google.maps.event.removeListener(he),ke(google.maps.event.addListener(k,"rightclick",m)))},[m]),h.useEffect(function(){k&&g&&($!==null&&google.maps.event.removeListener($),F(google.maps.event.addListener(k,"click",g)))},[g]),h.useEffect(function(){k&&y&&(Z!==null&&google.maps.event.removeListener(Z),ae(google.maps.event.addListener(k,"drag",y)))},[y]),h.useEffect(function(){var ue=new google.maps.Polyline(Be(Be({},e||KW),{map:S}));return i&&ue.setPath(i),typeof o<"u"&&ue.setVisible(o),typeof r<"u"&&ue.setEditable(r),typeof n<"u"&&ue.setDraggable(n),s&&D(google.maps.event.addListener(ue,"dblclick",s)),a&&N(google.maps.event.addListener(ue,"dragend",a)),l&&B(google.maps.event.addListener(ue,"dragstart",l)),c&&oe(google.maps.event.addListener(ue,"mousedown",c)),u&&G(google.maps.event.addListener(ue,"mousemove",u)),d&&Y(google.maps.event.addListener(ue,"mouseout",d)),p&&j(google.maps.event.addListener(ue,"mouseover",p)),f&&fe(google.maps.event.addListener(ue,"mouseup",f)),m&&ke(google.maps.event.addListener(ue,"rightclick",m)),g&&F(google.maps.event.addListener(ue,"click",g)),y&&ae(google.maps.event.addListener(ue,"drag",y)),w(ue),b&&b(ue),function(){T!==null&&google.maps.event.removeListener(T),U!==null&&google.maps.event.removeListener(U),R!==null&&google.maps.event.removeListener(R),I!==null&&google.maps.event.removeListener(I),te!==null&&google.maps.event.removeListener(te),ie!==null&&google.maps.event.removeListener(ie),A!==null&&google.maps.event.removeListener(A),V!==null&&google.maps.event.removeListener(V),he!==null&&google.maps.event.removeListener(he),$!==null&&google.maps.event.removeListener($),x&&x(ue),ue.setMap(null)}},[]),null}h.memo(YW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={polyline:null},n.setPolylineCallback=function(){n.state.polyline!==null&&n.props.onLoad&&n.props.onLoad(n.state.polyline)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Polyline(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:ny,eventMap:ty,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{polyline:n}},this.setPolylineCallback)},e.prototype.componentDidUpdate=function(n){this.state.polyline!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:ny,eventMap:ty,prevProps:n,nextProps:this.props,instance:this.state.polyline}))},e.prototype.componentWillUnmount=function(){this.state.polyline!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),Qe(this.registeredEvents),this.state.polyline.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var ry={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},oy={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},paths:function(t,e){t.setPaths(e)},visible:function(t,e){t.setVisible(e)}};function JW(t){var e=t.options,n=t.draggable,r=t.editable,o=t.visible,i=t.path,s=t.paths,a=t.onDblClick,l=t.onDragEnd,c=t.onDragStart,u=t.onMouseDown,d=t.onMouseMove,p=t.onMouseOut,f=t.onMouseOver,m=t.onMouseUp,g=t.onRightClick,y=t.onClick,b=t.onDrag,x=t.onLoad,S=t.onUnmount,E=t.onEdit,k=h.useContext(Ue),w=h.useState(null),M=w[0],T=w[1],D=h.useState(null),P=D[0],U=D[1],N=h.useState(null),K=N[0],R=N[1],B=h.useState(null),z=B[0],I=B[1],oe=h.useState(null),me=oe[0],te=oe[1],G=h.useState(null),X=G[0],ie=G[1],Y=h.useState(null),C=Y[0],A=Y[1],j=h.useState(null),H=j[0],V=j[1],fe=h.useState(null),pe=fe[0],he=fe[1],ke=h.useState(null),Te=ke[0],$=ke[1],F=h.useState(null),de=F[0],Z=F[1],ae=h.useState(null),ue=ae[0],ye=ae[1];return h.useEffect(function(){M!==null&&M.setMap(k)},[k]),h.useEffect(function(){typeof e<"u"&&M!==null&&M.setOptions(e)},[M,e]),h.useEffect(function(){typeof n<"u"&&M!==null&&M.setDraggable(n)},[M,n]),h.useEffect(function(){typeof r<"u"&&M!==null&&M.setEditable(r)},[M,r]),h.useEffect(function(){typeof o<"u"&&M!==null&&M.setVisible(o)},[M,o]),h.useEffect(function(){typeof i<"u"&&M!==null&&M.setPath(i)},[M,i]),h.useEffect(function(){typeof s<"u"&&M!==null&&M.setPaths(s)},[M,s]),h.useEffect(function(){M&&a&&(P!==null&&google.maps.event.removeListener(P),U(google.maps.event.addListener(M,"dblclick",a)))},[a]),h.useEffect(function(){M&&(google.maps.event.addListener(M.getPath(),"insert_at",function(){E==null||E(M)}),google.maps.event.addListener(M.getPath(),"set_at",function(){E==null||E(M)}))},[M,E]),h.useEffect(function(){M&&l&&(K!==null&&google.maps.event.removeListener(K),R(google.maps.event.addListener(M,"dragend",l)))},[l]),h.useEffect(function(){M&&c&&(z!==null&&google.maps.event.removeListener(z),I(google.maps.event.addListener(M,"dragstart",c)))},[c]),h.useEffect(function(){M&&u&&(me!==null&&google.maps.event.removeListener(me),te(google.maps.event.addListener(M,"mousedown",u)))},[u]),h.useEffect(function(){M&&d&&(X!==null&&google.maps.event.removeListener(X),ie(google.maps.event.addListener(M,"mousemove",d)))},[d]),h.useEffect(function(){M&&p&&(C!==null&&google.maps.event.removeListener(C),A(google.maps.event.addListener(M,"mouseout",p)))},[p]),h.useEffect(function(){M&&f&&(H!==null&&google.maps.event.removeListener(H),V(google.maps.event.addListener(M,"mouseover",f)))},[f]),h.useEffect(function(){M&&m&&(pe!==null&&google.maps.event.removeListener(pe),he(google.maps.event.addListener(M,"mouseup",m)))},[m]),h.useEffect(function(){M&&g&&(Te!==null&&google.maps.event.removeListener(Te),$(google.maps.event.addListener(M,"rightclick",g)))},[g]),h.useEffect(function(){M&&y&&(de!==null&&google.maps.event.removeListener(de),Z(google.maps.event.addListener(M,"click",y)))},[y]),h.useEffect(function(){M&&b&&(ue!==null&&google.maps.event.removeListener(ue),ye(google.maps.event.addListener(M,"drag",b)))},[b]),h.useEffect(function(){var be=new google.maps.Polygon(Be(Be({},e||{}),{map:k}));return i&&be.setPath(i),s&&be.setPaths(s),typeof o<"u"&&be.setVisible(o),typeof r<"u"&&be.setEditable(r),typeof n<"u"&&be.setDraggable(n),a&&U(google.maps.event.addListener(be,"dblclick",a)),l&&R(google.maps.event.addListener(be,"dragend",l)),c&&I(google.maps.event.addListener(be,"dragstart",c)),u&&te(google.maps.event.addListener(be,"mousedown",u)),d&&ie(google.maps.event.addListener(be,"mousemove",d)),p&&A(google.maps.event.addListener(be,"mouseout",p)),f&&V(google.maps.event.addListener(be,"mouseover",f)),m&&he(google.maps.event.addListener(be,"mouseup",m)),g&&$(google.maps.event.addListener(be,"rightclick",g)),y&&Z(google.maps.event.addListener(be,"click",y)),b&&ye(google.maps.event.addListener(be,"drag",b)),T(be),x&&x(be),function(){P!==null&&google.maps.event.removeListener(P),K!==null&&google.maps.event.removeListener(K),z!==null&&google.maps.event.removeListener(z),me!==null&&google.maps.event.removeListener(me),X!==null&&google.maps.event.removeListener(X),C!==null&&google.maps.event.removeListener(C),H!==null&&google.maps.event.removeListener(H),pe!==null&&google.maps.event.removeListener(pe),Te!==null&&google.maps.event.removeListener(Te),de!==null&&google.maps.event.removeListener(de),S&&S(be),be.setMap(null)}},[]),null}h.memo(JW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={polygon:null},n.setPolygonCallback=function(){n.state.polygon!==null&&n.props.onLoad&&n.props.onLoad(n.state.polygon)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Polygon(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:oy,eventMap:ry,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{polygon:n}},this.setPolygonCallback)},e.prototype.componentDidUpdate=function(n){this.state.polygon!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:oy,eventMap:ry,prevProps:n,nextProps:this.props,instance:this.state.polygon}))},e.prototype.componentWillUnmount=function(){this.state.polygon!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polygon),Qe(this.registeredEvents),this.state.polygon&&this.state.polygon.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var iy={onBoundsChanged:"bounds_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},sy={bounds:function(t,e){t.setBounds(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},visible:function(t,e){t.setVisible(e)}};function ZW(t){var e=t.options,n=t.bounds,r=t.draggable,o=t.editable,i=t.visible,s=t.onDblClick,a=t.onDragEnd,l=t.onDragStart,c=t.onMouseDown,u=t.onMouseMove,d=t.onMouseOut,p=t.onMouseOver,f=t.onMouseUp,m=t.onRightClick,g=t.onClick,y=t.onDrag,b=t.onBoundsChanged,x=t.onLoad,S=t.onUnmount,E=h.useContext(Ue),k=h.useState(null),w=k[0],M=k[1],T=h.useState(null),D=T[0],P=T[1],U=h.useState(null),N=U[0],K=U[1],R=h.useState(null),B=R[0],z=R[1],I=h.useState(null),oe=I[0],me=I[1],te=h.useState(null),G=te[0],X=te[1],ie=h.useState(null),Y=ie[0],C=ie[1],A=h.useState(null),j=A[0],H=A[1],V=h.useState(null),fe=V[0],pe=V[1],he=h.useState(null),ke=he[0],Te=he[1],$=h.useState(null),F=$[0],de=$[1],Z=h.useState(null),ae=Z[0],ue=Z[1],ye=h.useState(null),be=ye[0],ge=ye[1];return h.useEffect(function(){w!==null&&w.setMap(E)},[E]),h.useEffect(function(){typeof e<"u"&&w!==null&&w.setOptions(e)},[w,e]),h.useEffect(function(){typeof r<"u"&&w!==null&&w.setDraggable(r)},[w,r]),h.useEffect(function(){typeof o<"u"&&w!==null&&w.setEditable(o)},[w,o]),h.useEffect(function(){typeof i<"u"&&w!==null&&w.setVisible(i)},[w,i]),h.useEffect(function(){typeof n<"u"&&w!==null&&w.setBounds(n)},[w,n]),h.useEffect(function(){w&&s&&(D!==null&&google.maps.event.removeListener(D),P(google.maps.event.addListener(w,"dblclick",s)))},[s]),h.useEffect(function(){w&&a&&(N!==null&&google.maps.event.removeListener(N),K(google.maps.event.addListener(w,"dragend",a)))},[a]),h.useEffect(function(){w&&l&&(B!==null&&google.maps.event.removeListener(B),z(google.maps.event.addListener(w,"dragstart",l)))},[l]),h.useEffect(function(){w&&c&&(oe!==null&&google.maps.event.removeListener(oe),me(google.maps.event.addListener(w,"mousedown",c)))},[c]),h.useEffect(function(){w&&u&&(G!==null&&google.maps.event.removeListener(G),X(google.maps.event.addListener(w,"mousemove",u)))},[u]),h.useEffect(function(){w&&d&&(Y!==null&&google.maps.event.removeListener(Y),C(google.maps.event.addListener(w,"mouseout",d)))},[d]),h.useEffect(function(){w&&p&&(j!==null&&google.maps.event.removeListener(j),H(google.maps.event.addListener(w,"mouseover",p)))},[p]),h.useEffect(function(){w&&f&&(fe!==null&&google.maps.event.removeListener(fe),pe(google.maps.event.addListener(w,"mouseup",f)))},[f]),h.useEffect(function(){w&&m&&(ke!==null&&google.maps.event.removeListener(ke),Te(google.maps.event.addListener(w,"rightclick",m)))},[m]),h.useEffect(function(){w&&g&&(F!==null&&google.maps.event.removeListener(F),de(google.maps.event.addListener(w,"click",g)))},[g]),h.useEffect(function(){w&&y&&(ae!==null&&google.maps.event.removeListener(ae),ue(google.maps.event.addListener(w,"drag",y)))},[y]),h.useEffect(function(){w&&b&&(be!==null&&google.maps.event.removeListener(be),ge(google.maps.event.addListener(w,"bounds_changed",b)))},[b]),h.useEffect(function(){var ce=new google.maps.Rectangle(Be(Be({},e||{}),{map:E}));return typeof i<"u"&&ce.setVisible(i),typeof o<"u"&&ce.setEditable(o),typeof r<"u"&&ce.setDraggable(r),typeof n<"u"&&ce.setBounds(n),s&&P(google.maps.event.addListener(ce,"dblclick",s)),a&&K(google.maps.event.addListener(ce,"dragend",a)),l&&z(google.maps.event.addListener(ce,"dragstart",l)),c&&me(google.maps.event.addListener(ce,"mousedown",c)),u&&X(google.maps.event.addListener(ce,"mousemove",u)),d&&C(google.maps.event.addListener(ce,"mouseout",d)),p&&H(google.maps.event.addListener(ce,"mouseover",p)),f&&pe(google.maps.event.addListener(ce,"mouseup",f)),m&&Te(google.maps.event.addListener(ce,"rightclick",m)),g&&de(google.maps.event.addListener(ce,"click",g)),y&&ue(google.maps.event.addListener(ce,"drag",y)),b&&ge(google.maps.event.addListener(ce,"bounds_changed",b)),M(ce),x&&x(ce),function(){D!==null&&google.maps.event.removeListener(D),N!==null&&google.maps.event.removeListener(N),B!==null&&google.maps.event.removeListener(B),oe!==null&&google.maps.event.removeListener(oe),G!==null&&google.maps.event.removeListener(G),Y!==null&&google.maps.event.removeListener(Y),j!==null&&google.maps.event.removeListener(j),fe!==null&&google.maps.event.removeListener(fe),ke!==null&&google.maps.event.removeListener(ke),F!==null&&google.maps.event.removeListener(F),ae!==null&&google.maps.event.removeListener(ae),be!==null&&google.maps.event.removeListener(be),S&&S(ce),ce.setMap(null)}},[]),null}h.memo(ZW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={rectangle:null},n.setRectangleCallback=function(){n.state.rectangle!==null&&n.props.onLoad&&n.props.onLoad(n.state.rectangle)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Rectangle(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:sy,eventMap:iy,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{rectangle:n}},this.setRectangleCallback)},e.prototype.componentDidUpdate=function(n){this.state.rectangle!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:sy,eventMap:iy,prevProps:n,nextProps:this.props,instance:this.state.rectangle}))},e.prototype.componentWillUnmount=function(){this.state.rectangle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),Qe(this.registeredEvents),this.state.rectangle.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var ay={onCenterChanged:"center_changed",onRadiusChanged:"radius_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ly={center:function(t,e){t.setCenter(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},radius:function(t,e){t.setRadius(e)},visible:function(t,e){t.setVisible(e)}},XW={};function QW(t){var e=t.options,n=t.center,r=t.radius,o=t.draggable,i=t.editable,s=t.visible,a=t.onDblClick,l=t.onDragEnd,c=t.onDragStart,u=t.onMouseDown,d=t.onMouseMove,p=t.onMouseOut,f=t.onMouseOver,m=t.onMouseUp,g=t.onRightClick,y=t.onClick,b=t.onDrag,x=t.onCenterChanged,S=t.onRadiusChanged,E=t.onLoad,k=t.onUnmount,w=h.useContext(Ue),M=h.useState(null),T=M[0],D=M[1],P=h.useState(null),U=P[0],N=P[1],K=h.useState(null),R=K[0],B=K[1],z=h.useState(null),I=z[0],oe=z[1],me=h.useState(null),te=me[0],G=me[1],X=h.useState(null),ie=X[0],Y=X[1],C=h.useState(null),A=C[0],j=C[1],H=h.useState(null),V=H[0],fe=H[1],pe=h.useState(null),he=pe[0],ke=pe[1],Te=h.useState(null),$=Te[0],F=Te[1],de=h.useState(null),Z=de[0],ae=de[1],ue=h.useState(null),ye=ue[0],be=ue[1],ge=h.useState(null),ce=ge[0],je=ge[1],Oe=h.useState(null),Ae=Oe[0],He=Oe[1];return h.useEffect(function(){T!==null&&T.setMap(w)},[w]),h.useEffect(function(){typeof e<"u"&&T!==null&&T.setOptions(e)},[T,e]),h.useEffect(function(){typeof o<"u"&&T!==null&&T.setDraggable(o)},[T,o]),h.useEffect(function(){typeof i<"u"&&T!==null&&T.setEditable(i)},[T,i]),h.useEffect(function(){typeof s<"u"&&T!==null&&T.setVisible(s)},[T,s]),h.useEffect(function(){typeof r=="number"&&T!==null&&T.setRadius(r)},[T,r]),h.useEffect(function(){typeof n<"u"&&T!==null&&T.setCenter(n)},[T,n]),h.useEffect(function(){T&&a&&(U!==null&&google.maps.event.removeListener(U),N(google.maps.event.addListener(T,"dblclick",a)))},[a]),h.useEffect(function(){T&&l&&(R!==null&&google.maps.event.removeListener(R),B(google.maps.event.addListener(T,"dragend",l)))},[l]),h.useEffect(function(){T&&c&&(I!==null&&google.maps.event.removeListener(I),oe(google.maps.event.addListener(T,"dragstart",c)))},[c]),h.useEffect(function(){T&&u&&(te!==null&&google.maps.event.removeListener(te),G(google.maps.event.addListener(T,"mousedown",u)))},[u]),h.useEffect(function(){T&&d&&(ie!==null&&google.maps.event.removeListener(ie),Y(google.maps.event.addListener(T,"mousemove",d)))},[d]),h.useEffect(function(){T&&p&&(A!==null&&google.maps.event.removeListener(A),j(google.maps.event.addListener(T,"mouseout",p)))},[p]),h.useEffect(function(){T&&f&&(V!==null&&google.maps.event.removeListener(V),fe(google.maps.event.addListener(T,"mouseover",f)))},[f]),h.useEffect(function(){T&&m&&(he!==null&&google.maps.event.removeListener(he),ke(google.maps.event.addListener(T,"mouseup",m)))},[m]),h.useEffect(function(){T&&g&&($!==null&&google.maps.event.removeListener($),F(google.maps.event.addListener(T,"rightclick",g)))},[g]),h.useEffect(function(){T&&y&&(Z!==null&&google.maps.event.removeListener(Z),ae(google.maps.event.addListener(T,"click",y)))},[y]),h.useEffect(function(){T&&b&&(ye!==null&&google.maps.event.removeListener(ye),be(google.maps.event.addListener(T,"drag",b)))},[b]),h.useEffect(function(){T&&x&&(ce!==null&&google.maps.event.removeListener(ce),je(google.maps.event.addListener(T,"center_changed",x)))},[y]),h.useEffect(function(){T&&S&&(Ae!==null&&google.maps.event.removeListener(Ae),He(google.maps.event.addListener(T,"radius_changed",S)))},[S]),h.useEffect(function(){var Pe=new google.maps.Circle(Be(Be({},e||XW),{map:w}));return typeof r=="number"&&Pe.setRadius(r),typeof n<"u"&&Pe.setCenter(n),typeof r=="number"&&Pe.setRadius(r),typeof s<"u"&&Pe.setVisible(s),typeof i<"u"&&Pe.setEditable(i),typeof o<"u"&&Pe.setDraggable(o),a&&N(google.maps.event.addListener(Pe,"dblclick",a)),l&&B(google.maps.event.addListener(Pe,"dragend",l)),c&&oe(google.maps.event.addListener(Pe,"dragstart",c)),u&&G(google.maps.event.addListener(Pe,"mousedown",u)),d&&Y(google.maps.event.addListener(Pe,"mousemove",d)),p&&j(google.maps.event.addListener(Pe,"mouseout",p)),f&&fe(google.maps.event.addListener(Pe,"mouseover",f)),m&&ke(google.maps.event.addListener(Pe,"mouseup",m)),g&&F(google.maps.event.addListener(Pe,"rightclick",g)),y&&ae(google.maps.event.addListener(Pe,"click",y)),b&&be(google.maps.event.addListener(Pe,"drag",b)),x&&je(google.maps.event.addListener(Pe,"center_changed",x)),S&&He(google.maps.event.addListener(Pe,"radius_changed",S)),D(Pe),E&&E(Pe),function(){U!==null&&google.maps.event.removeListener(U),R!==null&&google.maps.event.removeListener(R),I!==null&&google.maps.event.removeListener(I),te!==null&&google.maps.event.removeListener(te),ie!==null&&google.maps.event.removeListener(ie),A!==null&&google.maps.event.removeListener(A),V!==null&&google.maps.event.removeListener(V),he!==null&&google.maps.event.removeListener(he),$!==null&&google.maps.event.removeListener($),Z!==null&&google.maps.event.removeListener(Z),ce!==null&&google.maps.event.removeListener(ce),Ae!==null&&google.maps.event.removeListener(Ae),k&&k(Pe),Pe.setMap(null)}},[]),null}h.memo(QW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={circle:null},n.setCircleCallback=function(){n.state.circle!==null&&n.props.onLoad&&n.props.onLoad(n.state.circle)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Circle(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:ly,eventMap:ay,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{circle:n}},this.setCircleCallback)},e.prototype.componentDidUpdate=function(n){this.state.circle!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:ly,eventMap:ay,prevProps:n,nextProps:this.props,instance:this.state.circle}))},e.prototype.componentWillUnmount=function(){var n;this.state.circle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),Qe(this.registeredEvents),(n=this.state.circle)===null||n===void 0||n.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var cy={onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick",onAddFeature:"addfeature",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},uy={add:function(t,e){t.add(e)},addgeojson:function(t,e,n){t.addGeoJson(e,n)},contains:function(t,e){t.contains(e)},foreach:function(t,e){t.forEach(e)},loadgeojson:function(t,e,n,r){t.loadGeoJson(e,n,r)},overridestyle:function(t,e,n){t.overrideStyle(e,n)},remove:function(t,e){t.remove(e)},revertstyle:function(t,e){t.revertStyle(e)},controlposition:function(t,e){t.setControlPosition(e)},controls:function(t,e){t.setControls(e)},drawingmode:function(t,e){t.setDrawingMode(e)},map:function(t,e){t.setMap(e)},style:function(t,e){t.setStyle(e)},togeojson:function(t,e){t.toGeoJson(e)}};function eU(t){var e=t.options,n=t.onClick,r=t.onDblClick,o=t.onMouseDown,i=t.onMouseMove,s=t.onMouseOut,a=t.onMouseOver,l=t.onMouseUp,c=t.onRightClick,u=t.onAddFeature,d=t.onRemoveFeature,p=t.onRemoveProperty,f=t.onSetGeometry,m=t.onSetProperty,g=t.onLoad,y=t.onUnmount,b=h.useContext(Ue),x=h.useState(null),S=x[0],E=x[1],k=h.useState(null),w=k[0],M=k[1],T=h.useState(null),D=T[0],P=T[1],U=h.useState(null),N=U[0],K=U[1],R=h.useState(null),B=R[0],z=R[1],I=h.useState(null),oe=I[0],me=I[1],te=h.useState(null),G=te[0],X=te[1],ie=h.useState(null),Y=ie[0],C=ie[1],A=h.useState(null),j=A[0],H=A[1],V=h.useState(null),fe=V[0],pe=V[1],he=h.useState(null),ke=he[0],Te=he[1],$=h.useState(null),F=$[0],de=$[1],Z=h.useState(null),ae=Z[0],ue=Z[1],ye=h.useState(null),be=ye[0],ge=ye[1];return h.useEffect(function(){S!==null&&S.setMap(b)},[b]),h.useEffect(function(){S&&r&&(w!==null&&google.maps.event.removeListener(w),M(google.maps.event.addListener(S,"dblclick",r)))},[r]),h.useEffect(function(){S&&o&&(D!==null&&google.maps.event.removeListener(D),P(google.maps.event.addListener(S,"mousedown",o)))},[o]),h.useEffect(function(){S&&i&&(N!==null&&google.maps.event.removeListener(N),K(google.maps.event.addListener(S,"mousemove",i)))},[i]),h.useEffect(function(){S&&s&&(B!==null&&google.maps.event.removeListener(B),z(google.maps.event.addListener(S,"mouseout",s)))},[s]),h.useEffect(function(){S&&a&&(oe!==null&&google.maps.event.removeListener(oe),me(google.maps.event.addListener(S,"mouseover",a)))},[a]),h.useEffect(function(){S&&l&&(G!==null&&google.maps.event.removeListener(G),X(google.maps.event.addListener(S,"mouseup",l)))},[l]),h.useEffect(function(){S&&c&&(Y!==null&&google.maps.event.removeListener(Y),C(google.maps.event.addListener(S,"rightclick",c)))},[c]),h.useEffect(function(){S&&n&&(j!==null&&google.maps.event.removeListener(j),H(google.maps.event.addListener(S,"click",n)))},[n]),h.useEffect(function(){S&&u&&(fe!==null&&google.maps.event.removeListener(fe),pe(google.maps.event.addListener(S,"addfeature",u)))},[u]),h.useEffect(function(){S&&d&&(ke!==null&&google.maps.event.removeListener(ke),Te(google.maps.event.addListener(S,"removefeature",d)))},[d]),h.useEffect(function(){S&&p&&(F!==null&&google.maps.event.removeListener(F),de(google.maps.event.addListener(S,"removeproperty",p)))},[p]),h.useEffect(function(){S&&f&&(ae!==null&&google.maps.event.removeListener(ae),ue(google.maps.event.addListener(S,"setgeometry",f)))},[f]),h.useEffect(function(){S&&m&&(be!==null&&google.maps.event.removeListener(be),ge(google.maps.event.addListener(S,"setproperty",m)))},[m]),h.useEffect(function(){if(b!==null){var ce=new google.maps.Data(Be(Be({},e||{}),{map:b}));r&&M(google.maps.event.addListener(ce,"dblclick",r)),o&&P(google.maps.event.addListener(ce,"mousedown",o)),i&&K(google.maps.event.addListener(ce,"mousemove",i)),s&&z(google.maps.event.addListener(ce,"mouseout",s)),a&&me(google.maps.event.addListener(ce,"mouseover",a)),l&&X(google.maps.event.addListener(ce,"mouseup",l)),c&&C(google.maps.event.addListener(ce,"rightclick",c)),n&&H(google.maps.event.addListener(ce,"click",n)),u&&pe(google.maps.event.addListener(ce,"addfeature",u)),d&&Te(google.maps.event.addListener(ce,"removefeature",d)),p&&de(google.maps.event.addListener(ce,"removeproperty",p)),f&&ue(google.maps.event.addListener(ce,"setgeometry",f)),m&&ge(google.maps.event.addListener(ce,"setproperty",m)),E(ce),g&&g(ce)}return function(){S&&(w!==null&&google.maps.event.removeListener(w),D!==null&&google.maps.event.removeListener(D),N!==null&&google.maps.event.removeListener(N),B!==null&&google.maps.event.removeListener(B),oe!==null&&google.maps.event.removeListener(oe),G!==null&&google.maps.event.removeListener(G),Y!==null&&google.maps.event.removeListener(Y),j!==null&&google.maps.event.removeListener(j),fe!==null&&google.maps.event.removeListener(fe),ke!==null&&google.maps.event.removeListener(ke),F!==null&&google.maps.event.removeListener(F),ae!==null&&google.maps.event.removeListener(ae),be!==null&&google.maps.event.removeListener(be),y&&y(S),S.setMap(null))}},[]),null}h.memo(eU);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={data:null},n.setDataCallback=function(){n.state.data!==null&&n.props.onLoad&&n.props.onLoad(n.state.data)},n}return e.prototype.componentDidMount=function(){if(this.context!==null){var n=new google.maps.Data(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:uy,eventMap:cy,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{data:n}},this.setDataCallback)}},e.prototype.componentDidUpdate=function(n){this.state.data!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:uy,eventMap:cy,prevProps:n,nextProps:this.props,instance:this.state.data}))},e.prototype.componentWillUnmount=function(){this.state.data!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),Qe(this.registeredEvents),this.state.data&&this.state.data.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var dy={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},py={options:function(t,e){t.setOptions(e)},url:function(t,e){t.setUrl(e)},zIndex:function(t,e){t.setZIndex(e)}};(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={kmlLayer:null},n.setKmlLayerCallback=function(){n.state.kmlLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.kmlLayer)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.KmlLayer(Be(Be({},this.props.options),{map:this.context}));this.registeredEvents=Ye({updaterMap:py,eventMap:dy,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{kmlLayer:n}},this.setKmlLayerCallback)},e.prototype.componentDidUpdate=function(n){this.state.kmlLayer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:py,eventMap:dy,prevProps:n,nextProps:this.props,instance:this.state.kmlLayer}))},e.prototype.componentWillUnmount=function(){this.state.kmlLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),Qe(this.registeredEvents),this.state.kmlLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);function yC(t,e){return typeof e=="function"?e(t.offsetWidth,t.offsetHeight):{x:0,y:0}}function tU(t,e){return new e(t.lat,t.lng)}function nU(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))}function rU(t,e,n){return t instanceof e?t:n(t,e)}function oU(t,e,n){return t instanceof e?t:n(t,e)}function iU(t,e,n){var r=t&&t.fromLatLngToDivPixel(n.getNorthEast()),o=t&&t.fromLatLngToDivPixel(n.getSouthWest());return r&&o?{left:"".concat(o.x+e.x,"px"),top:"".concat(r.y+e.y,"px"),width:"".concat(r.x-o.x-e.x,"px"),height:"".concat(o.y-r.y-e.y,"px")}:{left:"-9999px",top:"-9999px"}}function sU(t,e,n){var r=t&&t.fromLatLngToDivPixel(n);if(r){var o=r.x,i=r.y;return{left:"".concat(o+e.x,"px"),top:"".concat(i+e.y,"px")}}return{left:"-9999px",top:"-9999px"}}function bC(t,e,n,r){return n!==void 0?iU(t,e,oU(n,google.maps.LatLngBounds,nU)):sU(t,e,rU(r,google.maps.LatLng,tU))}function aU(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.height&&t.height===e.height}function lU(t,e,n,r,o){var i=function(s){vt(a,s);function a(l,c,u,d){var p=s.call(this)||this;return p.container=l,p.pane=c,p.position=u,p.bounds=d,p}return a.prototype.onAdd=function(){var l,c=(l=this.getPanes())===null||l===void 0?void 0:l[this.pane];c==null||c.appendChild(this.container)},a.prototype.draw=function(){for(var l=this.getProjection(),c=Be({},this.container?yC(this.container,o):{x:0,y:0}),u=bC(l,c,this.bounds,this.position),d=0,p=Object.entries(u);d? %s',google.maps.visualization),Ft(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var n=new google.maps.visualization.HeatmapLayer(Be(Be({},this.props.options||{}),{data:this.props.data,map:this.context}));this.registeredEvents=Ye({updaterMap:yy,eventMap:vy,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{heatmapLayer:n}},this.setHeatmapLayerCallback)},e.prototype.componentDidUpdate=function(n){Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:yy,eventMap:vy,prevProps:n,nextProps:this.props,instance:this.state.heatmapLayer})},e.prototype.componentWillUnmount=function(){this.state.heatmapLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),Qe(this.registeredEvents),this.state.heatmapLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var by={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},xy={register:function(t,e,n){t.registerPanoProvider(e,n)},links:function(t,e){t.setLinks(e)},motionTracking:function(t,e){t.setMotionTracking(e)},options:function(t,e){t.setOptions(e)},pano:function(t,e){t.setPano(e)},position:function(t,e){t.setPosition(e)},pov:function(t,e){t.setPov(e)},visible:function(t,e){t.setVisible(e)},zoom:function(t,e){t.setZoom(e)}};(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={streetViewPanorama:null},n.setStreetViewPanoramaCallback=function(){n.state.streetViewPanorama!==null&&n.props.onLoad&&n.props.onLoad(n.state.streetViewPanorama)},n}return e.prototype.componentDidMount=function(){var n,r,o=(r=(n=this.context)===null||n===void 0?void 0:n.getStreetView())!==null&&r!==void 0?r:null;this.registeredEvents=Ye({updaterMap:xy,eventMap:by,prevProps:{},nextProps:this.props,instance:o}),this.setState(function(){return{streetViewPanorama:o}},this.setStreetViewPanoramaCallback)},e.prototype.componentDidUpdate=function(n){this.state.streetViewPanorama!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:xy,eventMap:by,prevProps:n,nextProps:this.props,instance:this.state.streetViewPanorama}))},e.prototype.componentWillUnmount=function(){this.state.streetViewPanorama!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),Qe(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={streetViewService:null},n.setStreetViewServiceCallback=function(){n.state.streetViewService!==null&&n.props.onLoad&&n.props.onLoad(n.state.streetViewService)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:n}},this.setStreetViewServiceCallback)},e.prototype.componentWillUnmount=function(){this.state.streetViewService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={directionsService:null},n.setDirectionsServiceCallback=function(){n.state.directionsService!==null&&n.props.onLoad&&n.props.onLoad(n.state.directionsService)},n}return e.prototype.componentDidMount=function(){Ft(!!this.props.options,"DirectionsService expected options object as parameter, but got %s",this.props.options);var n=new google.maps.DirectionsService;this.setState(function(){return{directionsService:n}},this.setDirectionsServiceCallback)},e.prototype.componentDidUpdate=function(){this.state.directionsService!==null&&this.state.directionsService.route(this.props.options,this.props.callback)},e.prototype.componentWillUnmount=function(){this.state.directionsService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.directionsService)},e.prototype.render=function(){return null},e})(h.PureComponent);var wy={onDirectionsChanged:"directions_changed"},Cy={directions:function(t,e){t.setDirections(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},panel:function(t,e){t.setPanel(e)},routeIndex:function(t,e){t.setRouteIndex(e)}};(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={directionsRenderer:null},n.setDirectionsRendererCallback=function(){n.state.directionsRenderer!==null&&(n.state.directionsRenderer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.directionsRenderer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=Ye({updaterMap:Cy,eventMap:wy,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{directionsRenderer:n}},this.setDirectionsRendererCallback)},e.prototype.componentDidUpdate=function(n){this.state.directionsRenderer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Cy,eventMap:wy,prevProps:n,nextProps:this.props,instance:this.state.directionsRenderer}))},e.prototype.componentWillUnmount=function(){this.state.directionsRenderer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),Qe(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))},e.prototype.render=function(){return v.jsx(v.Fragment,{})},e.contextType=Ue,e})(h.PureComponent);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={distanceMatrixService:null},n.setDistanceMatrixServiceCallback=function(){n.state.distanceMatrixService!==null&&n.props.onLoad&&n.props.onLoad(n.state.distanceMatrixService)},n}return e.prototype.componentDidMount=function(){Ft(!!this.props.options,"DistanceMatrixService expected options object as parameter, but go %s",this.props.options);var n=new google.maps.DistanceMatrixService;this.setState(function(){return{distanceMatrixService:n}},this.setDistanceMatrixServiceCallback)},e.prototype.componentDidUpdate=function(){this.state.distanceMatrixService!==null&&this.state.distanceMatrixService.getDistanceMatrix(this.props.options,this.props.callback)},e.prototype.componentWillUnmount=function(){this.state.distanceMatrixService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.distanceMatrixService)},e.prototype.render=function(){return null},e})(h.PureComponent);var Sy={onPlacesChanged:"places_changed"},ky={bounds:function(t,e){t.setBounds(e)}};(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=h.createRef(),n.state={searchBox:null},n.setSearchBoxCallback=function(){n.state.searchBox!==null&&n.props.onLoad&&n.props.onLoad(n.state.searchBox)},n}return e.prototype.componentDidMount=function(){if(Ft(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places),this.containerElement!==null&&this.containerElement.current!==null){var n=this.containerElement.current.querySelector("input");if(n!==null){var r=new google.maps.places.SearchBox(n,this.props.options);this.registeredEvents=Ye({updaterMap:ky,eventMap:Sy,prevProps:{},nextProps:this.props,instance:r}),this.setState(function(){return{searchBox:r}},this.setSearchBoxCallback)}}},e.prototype.componentDidUpdate=function(n){this.state.searchBox!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:ky,eventMap:Sy,prevProps:n,nextProps:this.props,instance:this.state.searchBox}))},e.prototype.componentWillUnmount=function(){this.state.searchBox!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),Qe(this.registeredEvents))},e.prototype.render=function(){return v.jsx("div",{ref:this.containerElement,children:h.Children.only(this.props.children)})},e.contextType=Ue,e})(h.PureComponent);var My={onPlaceChanged:"place_changed"},Ey={bounds:function(t,e){t.setBounds(e)},restrictions:function(t,e){t.setComponentRestrictions(e)},fields:function(t,e){t.setFields(e)},options:function(t,e){t.setOptions(e)},types:function(t,e){t.setTypes(e)}};(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=h.createRef(),n.state={autocomplete:null},n.setAutocompleteCallback=function(){n.state.autocomplete!==null&&n.props.onLoad&&n.props.onLoad(n.state.autocomplete)},n}return e.prototype.componentDidMount=function(){var n;Ft(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places);var r=(n=this.containerElement.current)===null||n===void 0?void 0:n.querySelector("input");if(r){var o=new google.maps.places.Autocomplete(r,this.props.options);this.registeredEvents=Ye({updaterMap:Ey,eventMap:My,prevProps:{},nextProps:this.props,instance:o}),this.setState(function(){return{autocomplete:o}},this.setAutocompleteCallback)}},e.prototype.componentDidUpdate=function(n){Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Ey,eventMap:My,prevProps:n,nextProps:this.props,instance:this.state.autocomplete})},e.prototype.componentWillUnmount=function(){this.state.autocomplete!==null&&Qe(this.registeredEvents)},e.prototype.render=function(){return v.jsx("div",{ref:this.containerElement,className:this.props.className,children:h.Children.only(this.props.children)})},e.defaultProps={className:""},e.contextType=Ue,e})(h.PureComponent);const xC=["places"],rm={lat:0,lng:0};async function fU(t){const e=t.getBounds();if(e)return e;let n;return new Promise(r=>{n=google.maps.event.addListener(t,"bounds_changed",()=>{r(t.getBounds()),google.maps.event.removeListener(n)})})}function as(t){return!(!t||t.lat===void 0||t.lng===void 0||Number.isNaN(t.lat)||Number.isNaN(t.lng)||typeof Wh(t.lat)=="string"||typeof Uh(t.lng)=="string")}function hU(t){return t?/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/.test(t):!1}function Ty(t,e){return t===e||t&&e&&t.lat===e.lat&&t.lng===e.lng}const mU=Q.div` +`,a=`Cluster of ${e} markers`,l=Number(google.maps.Marker.MAX_ZINDEX)+e;if(zn.isAdvancedMarkerAvailable(o)){const d=new DOMParser().parseFromString(s,"image/svg+xml").documentElement;d.setAttribute("transform","translate(0 25)");const p={map:o,position:n,zIndex:l,title:a,content:d};return new google.maps.marker.AdvancedMarkerElement(p)}const c={position:n,zIndex:l,title:a,icon:{url:`data:image/svg+xml;base64,${btoa(s)}`,anchor:new google.maps.Point(25,25)}};return new google.maps.Marker(c)}}function HW(t,e){for(let n in e.prototype)t.prototype[n]=e.prototype[n]}class nm{constructor(){HW(nm,google.maps.OverlayView)}}var na;(function(t){t.CLUSTERING_BEGIN="clusteringbegin",t.CLUSTERING_END="clusteringend",t.CLUSTER_CLICK="click"})(na||(na={}));const VW=(t,e,n)=>{n.fitBounds(e.bounds)};class WW extends nm{constructor({map:e,markers:n=[],algorithmOptions:r={},algorithm:o=new BW(r),renderer:i=new zW,onClusterClick:s=VW}){super(),this.markers=[...n],this.clusters=[],this.algorithm=o,this.renderer=i,this.onClusterClick=s,e&&this.setMap(e)}addMarker(e,n){this.markers.includes(e)||(this.markers.push(e),n||this.render())}addMarkers(e,n){e.forEach(r=>{this.addMarker(r,!0)}),n||this.render()}removeMarker(e,n){const r=this.markers.indexOf(e);return r===-1?!1:(zn.setMap(e,null),this.markers.splice(r,1),n||this.render(),!0)}removeMarkers(e,n){let r=!1;return e.forEach(o=>{r=this.removeMarker(o,!0)||r}),r&&!n&&this.render(),r}clearMarkers(e){this.markers.length=0,e||this.render()}render(){const e=this.getMap();if(e instanceof google.maps.Map&&e.getProjection()){google.maps.event.trigger(this,na.CLUSTERING_BEGIN,this);const{clusters:n,changed:r}=this.algorithm.calculate({markers:this.markers,map:e,mapCanvasProjection:this.getProjection()});if(r||r==null){const o=new Set;for(const s of n)s.markers.length==1&&o.add(s.markers[0]);const i=[];for(const s of this.clusters)s.marker!=null&&(s.markers.length==1?o.has(s.marker)||zn.setMap(s.marker,null):i.push(s.marker));this.clusters=n,this.renderClusters(),requestAnimationFrame(()=>i.forEach(s=>zn.setMap(s,null)))}google.maps.event.trigger(this,na.CLUSTERING_END,this)}}onAdd(){this.idleListener=this.getMap().addListener("idle",this.render.bind(this)),this.render()}onRemove(){google.maps.event.removeListener(this.idleListener),this.reset()}reset(){this.markers.forEach(e=>zn.setMap(e,null)),this.clusters.forEach(e=>e.delete()),this.clusters=[]}renderClusters(){const e=new jW(this.markers,this.clusters),n=this.getMap();this.clusters.forEach(r=>{r.markers.length===1?r.marker=r.markers[0]:(r.marker=this.renderer.render(r,e,n),r.markers.forEach(o=>zn.setMap(o,null)),this.onClusterClick&&r.marker.addListener("click",o=>{google.maps.event.trigger(this,na.CLUSTER_CLICK,r),this.onClusterClick(o,r,n)})),zn.setMap(r.marker,n)})}}function UW(t){var e=lC(),n=h.useState(null),r=n[0],o=n[1];return h.useEffect(function(){if(e&&r===null){var i=new WW(Be(Be({},t),{map:e}));o(i)}},[e]),r}function GW(t){var e=t.children,n=t.options,r=UW(n);return r!==null?e(r):null}h.memo(GW);var Q0={onCloseClick:"closeclick",onContentChanged:"content_changed",onDomReady:"domready",onPositionChanged:"position_changed",onZindexChanged:"zindex_changed"},ey={options:function(t,e){t.setOptions(e)},position:function(t,e){t.setPosition(e)},zIndex:function(t,e){t.setZIndex(e)}};function qW(t){var e=t.children,n=t.anchor,r=t.options,o=t.position,i=t.zIndex,s=t.onCloseClick,a=t.onDomReady,l=t.onContentChanged,c=t.onPositionChanged,u=t.onZindexChanged,d=t.onLoad,p=t.onUnmount,f=h.useContext(Ue),m=h.useState(null),g=m[0],y=m[1],b=h.useState(null),x=b[0],S=b[1],E=h.useState(null),k=E[0],w=E[1],M=h.useState(null),T=M[0],D=M[1],P=h.useState(null),U=P[0],N=P[1],K=h.useState(null),R=K[0],B=K[1],z=h.useRef(null);return h.useEffect(function(){g!==null&&(g.close(),n?g.open(f,n):g.getPosition()&&g.open(f))},[f,g,n]),h.useEffect(function(){r&&g!==null&&g.setOptions(r)},[g,r]),h.useEffect(function(){o&&g!==null&&g.setPosition(o)},[o]),h.useEffect(function(){typeof i=="number"&&g!==null&&g.setZIndex(i)},[i]),h.useEffect(function(){g&&s&&(x!==null&&google.maps.event.removeListener(x),S(google.maps.event.addListener(g,"closeclick",s)))},[s]),h.useEffect(function(){g&&a&&(k!==null&&google.maps.event.removeListener(k),w(google.maps.event.addListener(g,"domready",a)))},[a]),h.useEffect(function(){g&&l&&(T!==null&&google.maps.event.removeListener(T),D(google.maps.event.addListener(g,"content_changed",l)))},[l]),h.useEffect(function(){g&&c&&(U!==null&&google.maps.event.removeListener(U),N(google.maps.event.addListener(g,"position_changed",c)))},[c]),h.useEffect(function(){g&&u&&(R!==null&&google.maps.event.removeListener(R),B(google.maps.event.addListener(g,"zindex_changed",u)))},[u]),h.useEffect(function(){var I=new google.maps.InfoWindow(Be({},r||{}));return y(I),z.current=document.createElement("div"),s&&S(google.maps.event.addListener(I,"closeclick",s)),a&&w(google.maps.event.addListener(I,"domready",a)),l&&D(google.maps.event.addListener(I,"content_changed",l)),c&&N(google.maps.event.addListener(I,"position_changed",c)),u&&B(google.maps.event.addListener(I,"zindex_changed",u)),I.setContent(z.current),o&&I.setPosition(o),i&&I.setZIndex(i),n?I.open(f,n):I.getPosition()?I.open(f):Ft(!1,"You must provide either an anchor (typically render it inside a ) or a position props for ."),d&&d(I),function(){x&&google.maps.event.removeListener(x),T&&google.maps.event.removeListener(T),k&&google.maps.event.removeListener(k),U&&google.maps.event.removeListener(U),R&&google.maps.event.removeListener(R),p&&p(I),I.close()}},[]),z.current?Eo.createPortal(h.Children.only(e),z.current):null}h.memo(qW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=null,n.state={infoWindow:null},n.open=function(r,o){o?r.open(n.context,o):r.getPosition()?r.open(n.context):Ft(!1,"You must provide either an anchor (typically render it inside a ) or a position props for .")},n.setInfoWindowCallback=function(){n.state.infoWindow!==null&&n.containerElement!==null&&(n.state.infoWindow.setContent(n.containerElement),n.open(n.state.infoWindow,n.props.anchor),n.props.onLoad&&n.props.onLoad(n.state.infoWindow))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.InfoWindow(Be({},this.props.options||{}));this.containerElement=document.createElement("div"),this.registeredEvents=Ye({updaterMap:ey,eventMap:Q0,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{infoWindow:n}},this.setInfoWindowCallback)},e.prototype.componentDidUpdate=function(n){this.state.infoWindow!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:ey,eventMap:Q0,prevProps:n,nextProps:this.props,instance:this.state.infoWindow}))},e.prototype.componentWillUnmount=function(){this.state.infoWindow!==null&&(Qe(this.registeredEvents),this.props.onUnmount&&this.props.onUnmount(this.state.infoWindow),this.state.infoWindow.close())},e.prototype.render=function(){return this.containerElement?Eo.createPortal(h.Children.only(this.props.children),this.containerElement):null},e.contextType=Ue,e})(h.PureComponent);var ty={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ny={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},visible:function(t,e){t.setVisible(e)}},KW={};function YW(t){var e=t.options,n=t.draggable,r=t.editable,o=t.visible,i=t.path,s=t.onDblClick,a=t.onDragEnd,l=t.onDragStart,c=t.onMouseDown,u=t.onMouseMove,d=t.onMouseOut,p=t.onMouseOver,f=t.onMouseUp,m=t.onRightClick,g=t.onClick,y=t.onDrag,b=t.onLoad,x=t.onUnmount,S=h.useContext(Ue),E=h.useState(null),k=E[0],w=E[1],M=h.useState(null),T=M[0],D=M[1],P=h.useState(null),U=P[0],N=P[1],K=h.useState(null),R=K[0],B=K[1],z=h.useState(null),I=z[0],oe=z[1],me=h.useState(null),te=me[0],G=me[1],X=h.useState(null),ie=X[0],Y=X[1],C=h.useState(null),A=C[0],j=C[1],H=h.useState(null),V=H[0],fe=H[1],pe=h.useState(null),he=pe[0],ke=pe[1],Te=h.useState(null),$=Te[0],F=Te[1],de=h.useState(null),Z=de[0],ae=de[1];return h.useEffect(function(){k!==null&&k.setMap(S)},[S]),h.useEffect(function(){typeof e<"u"&&k!==null&&k.setOptions(e)},[k,e]),h.useEffect(function(){typeof n<"u"&&k!==null&&k.setDraggable(n)},[k,n]),h.useEffect(function(){typeof r<"u"&&k!==null&&k.setEditable(r)},[k,r]),h.useEffect(function(){typeof o<"u"&&k!==null&&k.setVisible(o)},[k,o]),h.useEffect(function(){typeof i<"u"&&k!==null&&k.setPath(i)},[k,i]),h.useEffect(function(){k&&s&&(T!==null&&google.maps.event.removeListener(T),D(google.maps.event.addListener(k,"dblclick",s)))},[s]),h.useEffect(function(){k&&a&&(U!==null&&google.maps.event.removeListener(U),N(google.maps.event.addListener(k,"dragend",a)))},[a]),h.useEffect(function(){k&&l&&(R!==null&&google.maps.event.removeListener(R),B(google.maps.event.addListener(k,"dragstart",l)))},[l]),h.useEffect(function(){k&&c&&(I!==null&&google.maps.event.removeListener(I),oe(google.maps.event.addListener(k,"mousedown",c)))},[c]),h.useEffect(function(){k&&u&&(te!==null&&google.maps.event.removeListener(te),G(google.maps.event.addListener(k,"mousemove",u)))},[u]),h.useEffect(function(){k&&d&&(ie!==null&&google.maps.event.removeListener(ie),Y(google.maps.event.addListener(k,"mouseout",d)))},[d]),h.useEffect(function(){k&&p&&(A!==null&&google.maps.event.removeListener(A),j(google.maps.event.addListener(k,"mouseover",p)))},[p]),h.useEffect(function(){k&&f&&(V!==null&&google.maps.event.removeListener(V),fe(google.maps.event.addListener(k,"mouseup",f)))},[f]),h.useEffect(function(){k&&m&&(he!==null&&google.maps.event.removeListener(he),ke(google.maps.event.addListener(k,"rightclick",m)))},[m]),h.useEffect(function(){k&&g&&($!==null&&google.maps.event.removeListener($),F(google.maps.event.addListener(k,"click",g)))},[g]),h.useEffect(function(){k&&y&&(Z!==null&&google.maps.event.removeListener(Z),ae(google.maps.event.addListener(k,"drag",y)))},[y]),h.useEffect(function(){var ue=new google.maps.Polyline(Be(Be({},e||KW),{map:S}));return i&&ue.setPath(i),typeof o<"u"&&ue.setVisible(o),typeof r<"u"&&ue.setEditable(r),typeof n<"u"&&ue.setDraggable(n),s&&D(google.maps.event.addListener(ue,"dblclick",s)),a&&N(google.maps.event.addListener(ue,"dragend",a)),l&&B(google.maps.event.addListener(ue,"dragstart",l)),c&&oe(google.maps.event.addListener(ue,"mousedown",c)),u&&G(google.maps.event.addListener(ue,"mousemove",u)),d&&Y(google.maps.event.addListener(ue,"mouseout",d)),p&&j(google.maps.event.addListener(ue,"mouseover",p)),f&&fe(google.maps.event.addListener(ue,"mouseup",f)),m&&ke(google.maps.event.addListener(ue,"rightclick",m)),g&&F(google.maps.event.addListener(ue,"click",g)),y&&ae(google.maps.event.addListener(ue,"drag",y)),w(ue),b&&b(ue),function(){T!==null&&google.maps.event.removeListener(T),U!==null&&google.maps.event.removeListener(U),R!==null&&google.maps.event.removeListener(R),I!==null&&google.maps.event.removeListener(I),te!==null&&google.maps.event.removeListener(te),ie!==null&&google.maps.event.removeListener(ie),A!==null&&google.maps.event.removeListener(A),V!==null&&google.maps.event.removeListener(V),he!==null&&google.maps.event.removeListener(he),$!==null&&google.maps.event.removeListener($),x&&x(ue),ue.setMap(null)}},[]),null}h.memo(YW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={polyline:null},n.setPolylineCallback=function(){n.state.polyline!==null&&n.props.onLoad&&n.props.onLoad(n.state.polyline)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Polyline(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:ny,eventMap:ty,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{polyline:n}},this.setPolylineCallback)},e.prototype.componentDidUpdate=function(n){this.state.polyline!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:ny,eventMap:ty,prevProps:n,nextProps:this.props,instance:this.state.polyline}))},e.prototype.componentWillUnmount=function(){this.state.polyline!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polyline),Qe(this.registeredEvents),this.state.polyline.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var ry={onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},oy={draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},path:function(t,e){t.setPath(e)},paths:function(t,e){t.setPaths(e)},visible:function(t,e){t.setVisible(e)}};function JW(t){var e=t.options,n=t.draggable,r=t.editable,o=t.visible,i=t.path,s=t.paths,a=t.onDblClick,l=t.onDragEnd,c=t.onDragStart,u=t.onMouseDown,d=t.onMouseMove,p=t.onMouseOut,f=t.onMouseOver,m=t.onMouseUp,g=t.onRightClick,y=t.onClick,b=t.onDrag,x=t.onLoad,S=t.onUnmount,E=t.onEdit,k=h.useContext(Ue),w=h.useState(null),M=w[0],T=w[1],D=h.useState(null),P=D[0],U=D[1],N=h.useState(null),K=N[0],R=N[1],B=h.useState(null),z=B[0],I=B[1],oe=h.useState(null),me=oe[0],te=oe[1],G=h.useState(null),X=G[0],ie=G[1],Y=h.useState(null),C=Y[0],A=Y[1],j=h.useState(null),H=j[0],V=j[1],fe=h.useState(null),pe=fe[0],he=fe[1],ke=h.useState(null),Te=ke[0],$=ke[1],F=h.useState(null),de=F[0],Z=F[1],ae=h.useState(null),ue=ae[0],be=ae[1];return h.useEffect(function(){M!==null&&M.setMap(k)},[k]),h.useEffect(function(){typeof e<"u"&&M!==null&&M.setOptions(e)},[M,e]),h.useEffect(function(){typeof n<"u"&&M!==null&&M.setDraggable(n)},[M,n]),h.useEffect(function(){typeof r<"u"&&M!==null&&M.setEditable(r)},[M,r]),h.useEffect(function(){typeof o<"u"&&M!==null&&M.setVisible(o)},[M,o]),h.useEffect(function(){typeof i<"u"&&M!==null&&M.setPath(i)},[M,i]),h.useEffect(function(){typeof s<"u"&&M!==null&&M.setPaths(s)},[M,s]),h.useEffect(function(){M&&a&&(P!==null&&google.maps.event.removeListener(P),U(google.maps.event.addListener(M,"dblclick",a)))},[a]),h.useEffect(function(){M&&(google.maps.event.addListener(M.getPath(),"insert_at",function(){E==null||E(M)}),google.maps.event.addListener(M.getPath(),"set_at",function(){E==null||E(M)}))},[M,E]),h.useEffect(function(){M&&l&&(K!==null&&google.maps.event.removeListener(K),R(google.maps.event.addListener(M,"dragend",l)))},[l]),h.useEffect(function(){M&&c&&(z!==null&&google.maps.event.removeListener(z),I(google.maps.event.addListener(M,"dragstart",c)))},[c]),h.useEffect(function(){M&&u&&(me!==null&&google.maps.event.removeListener(me),te(google.maps.event.addListener(M,"mousedown",u)))},[u]),h.useEffect(function(){M&&d&&(X!==null&&google.maps.event.removeListener(X),ie(google.maps.event.addListener(M,"mousemove",d)))},[d]),h.useEffect(function(){M&&p&&(C!==null&&google.maps.event.removeListener(C),A(google.maps.event.addListener(M,"mouseout",p)))},[p]),h.useEffect(function(){M&&f&&(H!==null&&google.maps.event.removeListener(H),V(google.maps.event.addListener(M,"mouseover",f)))},[f]),h.useEffect(function(){M&&m&&(pe!==null&&google.maps.event.removeListener(pe),he(google.maps.event.addListener(M,"mouseup",m)))},[m]),h.useEffect(function(){M&&g&&(Te!==null&&google.maps.event.removeListener(Te),$(google.maps.event.addListener(M,"rightclick",g)))},[g]),h.useEffect(function(){M&&y&&(de!==null&&google.maps.event.removeListener(de),Z(google.maps.event.addListener(M,"click",y)))},[y]),h.useEffect(function(){M&&b&&(ue!==null&&google.maps.event.removeListener(ue),be(google.maps.event.addListener(M,"drag",b)))},[b]),h.useEffect(function(){var ye=new google.maps.Polygon(Be(Be({},e||{}),{map:k}));return i&&ye.setPath(i),s&&ye.setPaths(s),typeof o<"u"&&ye.setVisible(o),typeof r<"u"&&ye.setEditable(r),typeof n<"u"&&ye.setDraggable(n),a&&U(google.maps.event.addListener(ye,"dblclick",a)),l&&R(google.maps.event.addListener(ye,"dragend",l)),c&&I(google.maps.event.addListener(ye,"dragstart",c)),u&&te(google.maps.event.addListener(ye,"mousedown",u)),d&&ie(google.maps.event.addListener(ye,"mousemove",d)),p&&A(google.maps.event.addListener(ye,"mouseout",p)),f&&V(google.maps.event.addListener(ye,"mouseover",f)),m&&he(google.maps.event.addListener(ye,"mouseup",m)),g&&$(google.maps.event.addListener(ye,"rightclick",g)),y&&Z(google.maps.event.addListener(ye,"click",y)),b&&be(google.maps.event.addListener(ye,"drag",b)),T(ye),x&&x(ye),function(){P!==null&&google.maps.event.removeListener(P),K!==null&&google.maps.event.removeListener(K),z!==null&&google.maps.event.removeListener(z),me!==null&&google.maps.event.removeListener(me),X!==null&&google.maps.event.removeListener(X),C!==null&&google.maps.event.removeListener(C),H!==null&&google.maps.event.removeListener(H),pe!==null&&google.maps.event.removeListener(pe),Te!==null&&google.maps.event.removeListener(Te),de!==null&&google.maps.event.removeListener(de),S&&S(ye),ye.setMap(null)}},[]),null}h.memo(JW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={polygon:null},n.setPolygonCallback=function(){n.state.polygon!==null&&n.props.onLoad&&n.props.onLoad(n.state.polygon)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Polygon(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:oy,eventMap:ry,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{polygon:n}},this.setPolygonCallback)},e.prototype.componentDidUpdate=function(n){this.state.polygon!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:oy,eventMap:ry,prevProps:n,nextProps:this.props,instance:this.state.polygon}))},e.prototype.componentWillUnmount=function(){this.state.polygon!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.polygon),Qe(this.registeredEvents),this.state.polygon&&this.state.polygon.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var iy={onBoundsChanged:"bounds_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},sy={bounds:function(t,e){t.setBounds(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},visible:function(t,e){t.setVisible(e)}};function ZW(t){var e=t.options,n=t.bounds,r=t.draggable,o=t.editable,i=t.visible,s=t.onDblClick,a=t.onDragEnd,l=t.onDragStart,c=t.onMouseDown,u=t.onMouseMove,d=t.onMouseOut,p=t.onMouseOver,f=t.onMouseUp,m=t.onRightClick,g=t.onClick,y=t.onDrag,b=t.onBoundsChanged,x=t.onLoad,S=t.onUnmount,E=h.useContext(Ue),k=h.useState(null),w=k[0],M=k[1],T=h.useState(null),D=T[0],P=T[1],U=h.useState(null),N=U[0],K=U[1],R=h.useState(null),B=R[0],z=R[1],I=h.useState(null),oe=I[0],me=I[1],te=h.useState(null),G=te[0],X=te[1],ie=h.useState(null),Y=ie[0],C=ie[1],A=h.useState(null),j=A[0],H=A[1],V=h.useState(null),fe=V[0],pe=V[1],he=h.useState(null),ke=he[0],Te=he[1],$=h.useState(null),F=$[0],de=$[1],Z=h.useState(null),ae=Z[0],ue=Z[1],be=h.useState(null),ye=be[0],ge=be[1];return h.useEffect(function(){w!==null&&w.setMap(E)},[E]),h.useEffect(function(){typeof e<"u"&&w!==null&&w.setOptions(e)},[w,e]),h.useEffect(function(){typeof r<"u"&&w!==null&&w.setDraggable(r)},[w,r]),h.useEffect(function(){typeof o<"u"&&w!==null&&w.setEditable(o)},[w,o]),h.useEffect(function(){typeof i<"u"&&w!==null&&w.setVisible(i)},[w,i]),h.useEffect(function(){typeof n<"u"&&w!==null&&w.setBounds(n)},[w,n]),h.useEffect(function(){w&&s&&(D!==null&&google.maps.event.removeListener(D),P(google.maps.event.addListener(w,"dblclick",s)))},[s]),h.useEffect(function(){w&&a&&(N!==null&&google.maps.event.removeListener(N),K(google.maps.event.addListener(w,"dragend",a)))},[a]),h.useEffect(function(){w&&l&&(B!==null&&google.maps.event.removeListener(B),z(google.maps.event.addListener(w,"dragstart",l)))},[l]),h.useEffect(function(){w&&c&&(oe!==null&&google.maps.event.removeListener(oe),me(google.maps.event.addListener(w,"mousedown",c)))},[c]),h.useEffect(function(){w&&u&&(G!==null&&google.maps.event.removeListener(G),X(google.maps.event.addListener(w,"mousemove",u)))},[u]),h.useEffect(function(){w&&d&&(Y!==null&&google.maps.event.removeListener(Y),C(google.maps.event.addListener(w,"mouseout",d)))},[d]),h.useEffect(function(){w&&p&&(j!==null&&google.maps.event.removeListener(j),H(google.maps.event.addListener(w,"mouseover",p)))},[p]),h.useEffect(function(){w&&f&&(fe!==null&&google.maps.event.removeListener(fe),pe(google.maps.event.addListener(w,"mouseup",f)))},[f]),h.useEffect(function(){w&&m&&(ke!==null&&google.maps.event.removeListener(ke),Te(google.maps.event.addListener(w,"rightclick",m)))},[m]),h.useEffect(function(){w&&g&&(F!==null&&google.maps.event.removeListener(F),de(google.maps.event.addListener(w,"click",g)))},[g]),h.useEffect(function(){w&&y&&(ae!==null&&google.maps.event.removeListener(ae),ue(google.maps.event.addListener(w,"drag",y)))},[y]),h.useEffect(function(){w&&b&&(ye!==null&&google.maps.event.removeListener(ye),ge(google.maps.event.addListener(w,"bounds_changed",b)))},[b]),h.useEffect(function(){var ce=new google.maps.Rectangle(Be(Be({},e||{}),{map:E}));return typeof i<"u"&&ce.setVisible(i),typeof o<"u"&&ce.setEditable(o),typeof r<"u"&&ce.setDraggable(r),typeof n<"u"&&ce.setBounds(n),s&&P(google.maps.event.addListener(ce,"dblclick",s)),a&&K(google.maps.event.addListener(ce,"dragend",a)),l&&z(google.maps.event.addListener(ce,"dragstart",l)),c&&me(google.maps.event.addListener(ce,"mousedown",c)),u&&X(google.maps.event.addListener(ce,"mousemove",u)),d&&C(google.maps.event.addListener(ce,"mouseout",d)),p&&H(google.maps.event.addListener(ce,"mouseover",p)),f&&pe(google.maps.event.addListener(ce,"mouseup",f)),m&&Te(google.maps.event.addListener(ce,"rightclick",m)),g&&de(google.maps.event.addListener(ce,"click",g)),y&&ue(google.maps.event.addListener(ce,"drag",y)),b&&ge(google.maps.event.addListener(ce,"bounds_changed",b)),M(ce),x&&x(ce),function(){D!==null&&google.maps.event.removeListener(D),N!==null&&google.maps.event.removeListener(N),B!==null&&google.maps.event.removeListener(B),oe!==null&&google.maps.event.removeListener(oe),G!==null&&google.maps.event.removeListener(G),Y!==null&&google.maps.event.removeListener(Y),j!==null&&google.maps.event.removeListener(j),fe!==null&&google.maps.event.removeListener(fe),ke!==null&&google.maps.event.removeListener(ke),F!==null&&google.maps.event.removeListener(F),ae!==null&&google.maps.event.removeListener(ae),ye!==null&&google.maps.event.removeListener(ye),S&&S(ce),ce.setMap(null)}},[]),null}h.memo(ZW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={rectangle:null},n.setRectangleCallback=function(){n.state.rectangle!==null&&n.props.onLoad&&n.props.onLoad(n.state.rectangle)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Rectangle(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:sy,eventMap:iy,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{rectangle:n}},this.setRectangleCallback)},e.prototype.componentDidUpdate=function(n){this.state.rectangle!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:sy,eventMap:iy,prevProps:n,nextProps:this.props,instance:this.state.rectangle}))},e.prototype.componentWillUnmount=function(){this.state.rectangle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.rectangle),Qe(this.registeredEvents),this.state.rectangle.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var ay={onCenterChanged:"center_changed",onRadiusChanged:"radius_changed",onClick:"click",onDblClick:"dblclick",onDrag:"drag",onDragEnd:"dragend",onDragStart:"dragstart",onMouseDown:"mousedown",onMouseMove:"mousemove",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick"},ly={center:function(t,e){t.setCenter(e)},draggable:function(t,e){t.setDraggable(e)},editable:function(t,e){t.setEditable(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},radius:function(t,e){t.setRadius(e)},visible:function(t,e){t.setVisible(e)}},XW={};function QW(t){var e=t.options,n=t.center,r=t.radius,o=t.draggable,i=t.editable,s=t.visible,a=t.onDblClick,l=t.onDragEnd,c=t.onDragStart,u=t.onMouseDown,d=t.onMouseMove,p=t.onMouseOut,f=t.onMouseOver,m=t.onMouseUp,g=t.onRightClick,y=t.onClick,b=t.onDrag,x=t.onCenterChanged,S=t.onRadiusChanged,E=t.onLoad,k=t.onUnmount,w=h.useContext(Ue),M=h.useState(null),T=M[0],D=M[1],P=h.useState(null),U=P[0],N=P[1],K=h.useState(null),R=K[0],B=K[1],z=h.useState(null),I=z[0],oe=z[1],me=h.useState(null),te=me[0],G=me[1],X=h.useState(null),ie=X[0],Y=X[1],C=h.useState(null),A=C[0],j=C[1],H=h.useState(null),V=H[0],fe=H[1],pe=h.useState(null),he=pe[0],ke=pe[1],Te=h.useState(null),$=Te[0],F=Te[1],de=h.useState(null),Z=de[0],ae=de[1],ue=h.useState(null),be=ue[0],ye=ue[1],ge=h.useState(null),ce=ge[0],je=ge[1],Oe=h.useState(null),Ae=Oe[0],He=Oe[1];return h.useEffect(function(){T!==null&&T.setMap(w)},[w]),h.useEffect(function(){typeof e<"u"&&T!==null&&T.setOptions(e)},[T,e]),h.useEffect(function(){typeof o<"u"&&T!==null&&T.setDraggable(o)},[T,o]),h.useEffect(function(){typeof i<"u"&&T!==null&&T.setEditable(i)},[T,i]),h.useEffect(function(){typeof s<"u"&&T!==null&&T.setVisible(s)},[T,s]),h.useEffect(function(){typeof r=="number"&&T!==null&&T.setRadius(r)},[T,r]),h.useEffect(function(){typeof n<"u"&&T!==null&&T.setCenter(n)},[T,n]),h.useEffect(function(){T&&a&&(U!==null&&google.maps.event.removeListener(U),N(google.maps.event.addListener(T,"dblclick",a)))},[a]),h.useEffect(function(){T&&l&&(R!==null&&google.maps.event.removeListener(R),B(google.maps.event.addListener(T,"dragend",l)))},[l]),h.useEffect(function(){T&&c&&(I!==null&&google.maps.event.removeListener(I),oe(google.maps.event.addListener(T,"dragstart",c)))},[c]),h.useEffect(function(){T&&u&&(te!==null&&google.maps.event.removeListener(te),G(google.maps.event.addListener(T,"mousedown",u)))},[u]),h.useEffect(function(){T&&d&&(ie!==null&&google.maps.event.removeListener(ie),Y(google.maps.event.addListener(T,"mousemove",d)))},[d]),h.useEffect(function(){T&&p&&(A!==null&&google.maps.event.removeListener(A),j(google.maps.event.addListener(T,"mouseout",p)))},[p]),h.useEffect(function(){T&&f&&(V!==null&&google.maps.event.removeListener(V),fe(google.maps.event.addListener(T,"mouseover",f)))},[f]),h.useEffect(function(){T&&m&&(he!==null&&google.maps.event.removeListener(he),ke(google.maps.event.addListener(T,"mouseup",m)))},[m]),h.useEffect(function(){T&&g&&($!==null&&google.maps.event.removeListener($),F(google.maps.event.addListener(T,"rightclick",g)))},[g]),h.useEffect(function(){T&&y&&(Z!==null&&google.maps.event.removeListener(Z),ae(google.maps.event.addListener(T,"click",y)))},[y]),h.useEffect(function(){T&&b&&(be!==null&&google.maps.event.removeListener(be),ye(google.maps.event.addListener(T,"drag",b)))},[b]),h.useEffect(function(){T&&x&&(ce!==null&&google.maps.event.removeListener(ce),je(google.maps.event.addListener(T,"center_changed",x)))},[y]),h.useEffect(function(){T&&S&&(Ae!==null&&google.maps.event.removeListener(Ae),He(google.maps.event.addListener(T,"radius_changed",S)))},[S]),h.useEffect(function(){var Pe=new google.maps.Circle(Be(Be({},e||XW),{map:w}));return typeof r=="number"&&Pe.setRadius(r),typeof n<"u"&&Pe.setCenter(n),typeof r=="number"&&Pe.setRadius(r),typeof s<"u"&&Pe.setVisible(s),typeof i<"u"&&Pe.setEditable(i),typeof o<"u"&&Pe.setDraggable(o),a&&N(google.maps.event.addListener(Pe,"dblclick",a)),l&&B(google.maps.event.addListener(Pe,"dragend",l)),c&&oe(google.maps.event.addListener(Pe,"dragstart",c)),u&&G(google.maps.event.addListener(Pe,"mousedown",u)),d&&Y(google.maps.event.addListener(Pe,"mousemove",d)),p&&j(google.maps.event.addListener(Pe,"mouseout",p)),f&&fe(google.maps.event.addListener(Pe,"mouseover",f)),m&&ke(google.maps.event.addListener(Pe,"mouseup",m)),g&&F(google.maps.event.addListener(Pe,"rightclick",g)),y&&ae(google.maps.event.addListener(Pe,"click",y)),b&&ye(google.maps.event.addListener(Pe,"drag",b)),x&&je(google.maps.event.addListener(Pe,"center_changed",x)),S&&He(google.maps.event.addListener(Pe,"radius_changed",S)),D(Pe),E&&E(Pe),function(){U!==null&&google.maps.event.removeListener(U),R!==null&&google.maps.event.removeListener(R),I!==null&&google.maps.event.removeListener(I),te!==null&&google.maps.event.removeListener(te),ie!==null&&google.maps.event.removeListener(ie),A!==null&&google.maps.event.removeListener(A),V!==null&&google.maps.event.removeListener(V),he!==null&&google.maps.event.removeListener(he),$!==null&&google.maps.event.removeListener($),Z!==null&&google.maps.event.removeListener(Z),ce!==null&&google.maps.event.removeListener(ce),Ae!==null&&google.maps.event.removeListener(Ae),k&&k(Pe),Pe.setMap(null)}},[]),null}h.memo(QW);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={circle:null},n.setCircleCallback=function(){n.state.circle!==null&&n.props.onLoad&&n.props.onLoad(n.state.circle)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.Circle(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:ly,eventMap:ay,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{circle:n}},this.setCircleCallback)},e.prototype.componentDidUpdate=function(n){this.state.circle!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:ly,eventMap:ay,prevProps:n,nextProps:this.props,instance:this.state.circle}))},e.prototype.componentWillUnmount=function(){var n;this.state.circle!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.circle),Qe(this.registeredEvents),(n=this.state.circle)===null||n===void 0||n.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var cy={onClick:"click",onDblClick:"dblclick",onMouseDown:"mousedown",onMouseOut:"mouseout",onMouseOver:"mouseover",onMouseUp:"mouseup",onRightClick:"rightclick",onAddFeature:"addfeature",onRemoveFeature:"removefeature",onRemoveProperty:"removeproperty",onSetGeometry:"setgeometry",onSetProperty:"setproperty"},uy={add:function(t,e){t.add(e)},addgeojson:function(t,e,n){t.addGeoJson(e,n)},contains:function(t,e){t.contains(e)},foreach:function(t,e){t.forEach(e)},loadgeojson:function(t,e,n,r){t.loadGeoJson(e,n,r)},overridestyle:function(t,e,n){t.overrideStyle(e,n)},remove:function(t,e){t.remove(e)},revertstyle:function(t,e){t.revertStyle(e)},controlposition:function(t,e){t.setControlPosition(e)},controls:function(t,e){t.setControls(e)},drawingmode:function(t,e){t.setDrawingMode(e)},map:function(t,e){t.setMap(e)},style:function(t,e){t.setStyle(e)},togeojson:function(t,e){t.toGeoJson(e)}};function eU(t){var e=t.options,n=t.onClick,r=t.onDblClick,o=t.onMouseDown,i=t.onMouseMove,s=t.onMouseOut,a=t.onMouseOver,l=t.onMouseUp,c=t.onRightClick,u=t.onAddFeature,d=t.onRemoveFeature,p=t.onRemoveProperty,f=t.onSetGeometry,m=t.onSetProperty,g=t.onLoad,y=t.onUnmount,b=h.useContext(Ue),x=h.useState(null),S=x[0],E=x[1],k=h.useState(null),w=k[0],M=k[1],T=h.useState(null),D=T[0],P=T[1],U=h.useState(null),N=U[0],K=U[1],R=h.useState(null),B=R[0],z=R[1],I=h.useState(null),oe=I[0],me=I[1],te=h.useState(null),G=te[0],X=te[1],ie=h.useState(null),Y=ie[0],C=ie[1],A=h.useState(null),j=A[0],H=A[1],V=h.useState(null),fe=V[0],pe=V[1],he=h.useState(null),ke=he[0],Te=he[1],$=h.useState(null),F=$[0],de=$[1],Z=h.useState(null),ae=Z[0],ue=Z[1],be=h.useState(null),ye=be[0],ge=be[1];return h.useEffect(function(){S!==null&&S.setMap(b)},[b]),h.useEffect(function(){S&&r&&(w!==null&&google.maps.event.removeListener(w),M(google.maps.event.addListener(S,"dblclick",r)))},[r]),h.useEffect(function(){S&&o&&(D!==null&&google.maps.event.removeListener(D),P(google.maps.event.addListener(S,"mousedown",o)))},[o]),h.useEffect(function(){S&&i&&(N!==null&&google.maps.event.removeListener(N),K(google.maps.event.addListener(S,"mousemove",i)))},[i]),h.useEffect(function(){S&&s&&(B!==null&&google.maps.event.removeListener(B),z(google.maps.event.addListener(S,"mouseout",s)))},[s]),h.useEffect(function(){S&&a&&(oe!==null&&google.maps.event.removeListener(oe),me(google.maps.event.addListener(S,"mouseover",a)))},[a]),h.useEffect(function(){S&&l&&(G!==null&&google.maps.event.removeListener(G),X(google.maps.event.addListener(S,"mouseup",l)))},[l]),h.useEffect(function(){S&&c&&(Y!==null&&google.maps.event.removeListener(Y),C(google.maps.event.addListener(S,"rightclick",c)))},[c]),h.useEffect(function(){S&&n&&(j!==null&&google.maps.event.removeListener(j),H(google.maps.event.addListener(S,"click",n)))},[n]),h.useEffect(function(){S&&u&&(fe!==null&&google.maps.event.removeListener(fe),pe(google.maps.event.addListener(S,"addfeature",u)))},[u]),h.useEffect(function(){S&&d&&(ke!==null&&google.maps.event.removeListener(ke),Te(google.maps.event.addListener(S,"removefeature",d)))},[d]),h.useEffect(function(){S&&p&&(F!==null&&google.maps.event.removeListener(F),de(google.maps.event.addListener(S,"removeproperty",p)))},[p]),h.useEffect(function(){S&&f&&(ae!==null&&google.maps.event.removeListener(ae),ue(google.maps.event.addListener(S,"setgeometry",f)))},[f]),h.useEffect(function(){S&&m&&(ye!==null&&google.maps.event.removeListener(ye),ge(google.maps.event.addListener(S,"setproperty",m)))},[m]),h.useEffect(function(){if(b!==null){var ce=new google.maps.Data(Be(Be({},e||{}),{map:b}));r&&M(google.maps.event.addListener(ce,"dblclick",r)),o&&P(google.maps.event.addListener(ce,"mousedown",o)),i&&K(google.maps.event.addListener(ce,"mousemove",i)),s&&z(google.maps.event.addListener(ce,"mouseout",s)),a&&me(google.maps.event.addListener(ce,"mouseover",a)),l&&X(google.maps.event.addListener(ce,"mouseup",l)),c&&C(google.maps.event.addListener(ce,"rightclick",c)),n&&H(google.maps.event.addListener(ce,"click",n)),u&&pe(google.maps.event.addListener(ce,"addfeature",u)),d&&Te(google.maps.event.addListener(ce,"removefeature",d)),p&&de(google.maps.event.addListener(ce,"removeproperty",p)),f&&ue(google.maps.event.addListener(ce,"setgeometry",f)),m&&ge(google.maps.event.addListener(ce,"setproperty",m)),E(ce),g&&g(ce)}return function(){S&&(w!==null&&google.maps.event.removeListener(w),D!==null&&google.maps.event.removeListener(D),N!==null&&google.maps.event.removeListener(N),B!==null&&google.maps.event.removeListener(B),oe!==null&&google.maps.event.removeListener(oe),G!==null&&google.maps.event.removeListener(G),Y!==null&&google.maps.event.removeListener(Y),j!==null&&google.maps.event.removeListener(j),fe!==null&&google.maps.event.removeListener(fe),ke!==null&&google.maps.event.removeListener(ke),F!==null&&google.maps.event.removeListener(F),ae!==null&&google.maps.event.removeListener(ae),ye!==null&&google.maps.event.removeListener(ye),y&&y(S),S.setMap(null))}},[]),null}h.memo(eU);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={data:null},n.setDataCallback=function(){n.state.data!==null&&n.props.onLoad&&n.props.onLoad(n.state.data)},n}return e.prototype.componentDidMount=function(){if(this.context!==null){var n=new google.maps.Data(Be(Be({},this.props.options||{}),{map:this.context}));this.registeredEvents=Ye({updaterMap:uy,eventMap:cy,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{data:n}},this.setDataCallback)}},e.prototype.componentDidUpdate=function(n){this.state.data!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:uy,eventMap:cy,prevProps:n,nextProps:this.props,instance:this.state.data}))},e.prototype.componentWillUnmount=function(){this.state.data!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.data),Qe(this.registeredEvents),this.state.data&&this.state.data.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var dy={onClick:"click",onDefaultViewportChanged:"defaultviewport_changed",onStatusChanged:"status_changed"},py={options:function(t,e){t.setOptions(e)},url:function(t,e){t.setUrl(e)},zIndex:function(t,e){t.setZIndex(e)}};(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={kmlLayer:null},n.setKmlLayerCallback=function(){n.state.kmlLayer!==null&&n.props.onLoad&&n.props.onLoad(n.state.kmlLayer)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.KmlLayer(Be(Be({},this.props.options),{map:this.context}));this.registeredEvents=Ye({updaterMap:py,eventMap:dy,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{kmlLayer:n}},this.setKmlLayerCallback)},e.prototype.componentDidUpdate=function(n){this.state.kmlLayer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:py,eventMap:dy,prevProps:n,nextProps:this.props,instance:this.state.kmlLayer}))},e.prototype.componentWillUnmount=function(){this.state.kmlLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.kmlLayer),Qe(this.registeredEvents),this.state.kmlLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);function yC(t,e){return typeof e=="function"?e(t.offsetWidth,t.offsetHeight):{x:0,y:0}}function tU(t,e){return new e(t.lat,t.lng)}function nU(t,e){return new e(new google.maps.LatLng(t.ne.lat,t.ne.lng),new google.maps.LatLng(t.sw.lat,t.sw.lng))}function rU(t,e,n){return t instanceof e?t:n(t,e)}function oU(t,e,n){return t instanceof e?t:n(t,e)}function iU(t,e,n){var r=t&&t.fromLatLngToDivPixel(n.getNorthEast()),o=t&&t.fromLatLngToDivPixel(n.getSouthWest());return r&&o?{left:"".concat(o.x+e.x,"px"),top:"".concat(r.y+e.y,"px"),width:"".concat(r.x-o.x-e.x,"px"),height:"".concat(o.y-r.y-e.y,"px")}:{left:"-9999px",top:"-9999px"}}function sU(t,e,n){var r=t&&t.fromLatLngToDivPixel(n);if(r){var o=r.x,i=r.y;return{left:"".concat(o+e.x,"px"),top:"".concat(i+e.y,"px")}}return{left:"-9999px",top:"-9999px"}}function bC(t,e,n,r){return n!==void 0?iU(t,e,oU(n,google.maps.LatLngBounds,nU)):sU(t,e,rU(r,google.maps.LatLng,tU))}function aU(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.height&&t.height===e.height}function lU(t,e,n,r,o){var i=function(s){vt(a,s);function a(l,c,u,d){var p=s.call(this)||this;return p.container=l,p.pane=c,p.position=u,p.bounds=d,p}return a.prototype.onAdd=function(){var l,c=(l=this.getPanes())===null||l===void 0?void 0:l[this.pane];c==null||c.appendChild(this.container)},a.prototype.draw=function(){for(var l=this.getProjection(),c=Be({},this.container?yC(this.container,o):{x:0,y:0}),u=bC(l,c,this.bounds,this.position),d=0,p=Object.entries(u);d? %s',google.maps.visualization),Ft(!!this.props.data,"data property is required in HeatmapLayer %s",this.props.data);var n=new google.maps.visualization.HeatmapLayer(Be(Be({},this.props.options||{}),{data:this.props.data,map:this.context}));this.registeredEvents=Ye({updaterMap:yy,eventMap:vy,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{heatmapLayer:n}},this.setHeatmapLayerCallback)},e.prototype.componentDidUpdate=function(n){Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:yy,eventMap:vy,prevProps:n,nextProps:this.props,instance:this.state.heatmapLayer})},e.prototype.componentWillUnmount=function(){this.state.heatmapLayer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.heatmapLayer),Qe(this.registeredEvents),this.state.heatmapLayer.setMap(null))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);var by={onCloseClick:"closeclick",onPanoChanged:"pano_changed",onPositionChanged:"position_changed",onPovChanged:"pov_changed",onResize:"resize",onStatusChanged:"status_changed",onVisibleChanged:"visible_changed",onZoomChanged:"zoom_changed"},xy={register:function(t,e,n){t.registerPanoProvider(e,n)},links:function(t,e){t.setLinks(e)},motionTracking:function(t,e){t.setMotionTracking(e)},options:function(t,e){t.setOptions(e)},pano:function(t,e){t.setPano(e)},position:function(t,e){t.setPosition(e)},pov:function(t,e){t.setPov(e)},visible:function(t,e){t.setVisible(e)},zoom:function(t,e){t.setZoom(e)}};(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={streetViewPanorama:null},n.setStreetViewPanoramaCallback=function(){n.state.streetViewPanorama!==null&&n.props.onLoad&&n.props.onLoad(n.state.streetViewPanorama)},n}return e.prototype.componentDidMount=function(){var n,r,o=(r=(n=this.context)===null||n===void 0?void 0:n.getStreetView())!==null&&r!==void 0?r:null;this.registeredEvents=Ye({updaterMap:xy,eventMap:by,prevProps:{},nextProps:this.props,instance:o}),this.setState(function(){return{streetViewPanorama:o}},this.setStreetViewPanoramaCallback)},e.prototype.componentDidUpdate=function(n){this.state.streetViewPanorama!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:xy,eventMap:by,prevProps:n,nextProps:this.props,instance:this.state.streetViewPanorama}))},e.prototype.componentWillUnmount=function(){this.state.streetViewPanorama!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.streetViewPanorama),Qe(this.registeredEvents),this.state.streetViewPanorama.setVisible(!1))},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={streetViewService:null},n.setStreetViewServiceCallback=function(){n.state.streetViewService!==null&&n.props.onLoad&&n.props.onLoad(n.state.streetViewService)},n}return e.prototype.componentDidMount=function(){var n=new google.maps.StreetViewService;this.setState(function(){return{streetViewService:n}},this.setStreetViewServiceCallback)},e.prototype.componentWillUnmount=function(){this.state.streetViewService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.streetViewService)},e.prototype.render=function(){return null},e.contextType=Ue,e})(h.PureComponent);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={directionsService:null},n.setDirectionsServiceCallback=function(){n.state.directionsService!==null&&n.props.onLoad&&n.props.onLoad(n.state.directionsService)},n}return e.prototype.componentDidMount=function(){Ft(!!this.props.options,"DirectionsService expected options object as parameter, but got %s",this.props.options);var n=new google.maps.DirectionsService;this.setState(function(){return{directionsService:n}},this.setDirectionsServiceCallback)},e.prototype.componentDidUpdate=function(){this.state.directionsService!==null&&this.state.directionsService.route(this.props.options,this.props.callback)},e.prototype.componentWillUnmount=function(){this.state.directionsService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.directionsService)},e.prototype.render=function(){return null},e})(h.PureComponent);var wy={onDirectionsChanged:"directions_changed"},Cy={directions:function(t,e){t.setDirections(e)},map:function(t,e){t.setMap(e)},options:function(t,e){t.setOptions(e)},panel:function(t,e){t.setPanel(e)},routeIndex:function(t,e){t.setRouteIndex(e)}};(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.state={directionsRenderer:null},n.setDirectionsRendererCallback=function(){n.state.directionsRenderer!==null&&(n.state.directionsRenderer.setMap(n.context),n.props.onLoad&&n.props.onLoad(n.state.directionsRenderer))},n}return e.prototype.componentDidMount=function(){var n=new google.maps.DirectionsRenderer(this.props.options);this.registeredEvents=Ye({updaterMap:Cy,eventMap:wy,prevProps:{},nextProps:this.props,instance:n}),this.setState(function(){return{directionsRenderer:n}},this.setDirectionsRendererCallback)},e.prototype.componentDidUpdate=function(n){this.state.directionsRenderer!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Cy,eventMap:wy,prevProps:n,nextProps:this.props,instance:this.state.directionsRenderer}))},e.prototype.componentWillUnmount=function(){this.state.directionsRenderer!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.directionsRenderer),Qe(this.registeredEvents),this.state.directionsRenderer&&this.state.directionsRenderer.setMap(null))},e.prototype.render=function(){return v.jsx(v.Fragment,{})},e.contextType=Ue,e})(h.PureComponent);(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.state={distanceMatrixService:null},n.setDistanceMatrixServiceCallback=function(){n.state.distanceMatrixService!==null&&n.props.onLoad&&n.props.onLoad(n.state.distanceMatrixService)},n}return e.prototype.componentDidMount=function(){Ft(!!this.props.options,"DistanceMatrixService expected options object as parameter, but go %s",this.props.options);var n=new google.maps.DistanceMatrixService;this.setState(function(){return{distanceMatrixService:n}},this.setDistanceMatrixServiceCallback)},e.prototype.componentDidUpdate=function(){this.state.distanceMatrixService!==null&&this.state.distanceMatrixService.getDistanceMatrix(this.props.options,this.props.callback)},e.prototype.componentWillUnmount=function(){this.state.distanceMatrixService!==null&&this.props.onUnmount&&this.props.onUnmount(this.state.distanceMatrixService)},e.prototype.render=function(){return null},e})(h.PureComponent);var Sy={onPlacesChanged:"places_changed"},ky={bounds:function(t,e){t.setBounds(e)}};(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=h.createRef(),n.state={searchBox:null},n.setSearchBoxCallback=function(){n.state.searchBox!==null&&n.props.onLoad&&n.props.onLoad(n.state.searchBox)},n}return e.prototype.componentDidMount=function(){if(Ft(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places),this.containerElement!==null&&this.containerElement.current!==null){var n=this.containerElement.current.querySelector("input");if(n!==null){var r=new google.maps.places.SearchBox(n,this.props.options);this.registeredEvents=Ye({updaterMap:ky,eventMap:Sy,prevProps:{},nextProps:this.props,instance:r}),this.setState(function(){return{searchBox:r}},this.setSearchBoxCallback)}}},e.prototype.componentDidUpdate=function(n){this.state.searchBox!==null&&(Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:ky,eventMap:Sy,prevProps:n,nextProps:this.props,instance:this.state.searchBox}))},e.prototype.componentWillUnmount=function(){this.state.searchBox!==null&&(this.props.onUnmount&&this.props.onUnmount(this.state.searchBox),Qe(this.registeredEvents))},e.prototype.render=function(){return v.jsx("div",{ref:this.containerElement,children:h.Children.only(this.props.children)})},e.contextType=Ue,e})(h.PureComponent);var My={onPlaceChanged:"place_changed"},Ey={bounds:function(t,e){t.setBounds(e)},restrictions:function(t,e){t.setComponentRestrictions(e)},fields:function(t,e){t.setFields(e)},options:function(t,e){t.setOptions(e)},types:function(t,e){t.setTypes(e)}};(function(t){vt(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.registeredEvents=[],n.containerElement=h.createRef(),n.state={autocomplete:null},n.setAutocompleteCallback=function(){n.state.autocomplete!==null&&n.props.onLoad&&n.props.onLoad(n.state.autocomplete)},n}return e.prototype.componentDidMount=function(){var n;Ft(!!google.maps.places,'You need to provide libraries={["places"]} prop to component %s',google.maps.places);var r=(n=this.containerElement.current)===null||n===void 0?void 0:n.querySelector("input");if(r){var o=new google.maps.places.Autocomplete(r,this.props.options);this.registeredEvents=Ye({updaterMap:Ey,eventMap:My,prevProps:{},nextProps:this.props,instance:o}),this.setState(function(){return{autocomplete:o}},this.setAutocompleteCallback)}},e.prototype.componentDidUpdate=function(n){Qe(this.registeredEvents),this.registeredEvents=Ye({updaterMap:Ey,eventMap:My,prevProps:n,nextProps:this.props,instance:this.state.autocomplete})},e.prototype.componentWillUnmount=function(){this.state.autocomplete!==null&&Qe(this.registeredEvents)},e.prototype.render=function(){return v.jsx("div",{ref:this.containerElement,className:this.props.className,children:h.Children.only(this.props.children)})},e.defaultProps={className:""},e.contextType=Ue,e})(h.PureComponent);const xC=["places"],rm={lat:0,lng:0};async function fU(t){const e=t.getBounds();if(e)return e;let n;return new Promise(r=>{n=google.maps.event.addListener(t,"bounds_changed",()=>{r(t.getBounds()),google.maps.event.removeListener(n)})})}function as(t){return!(!t||t.lat===void 0||t.lng===void 0||Number.isNaN(t.lat)||Number.isNaN(t.lng)||typeof Uh(t.lat)=="string"||typeof Gh(t.lng)=="string")}function hU(t){return t?/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/.test(t):!1}function Ty(t,e){return t===e||t&&e&&t.lat===e.lat&&t.lng===e.lng}const mU=Q.div` &.mapCoordinates { margin-bottom: 8px; } @@ -715,8 +715,8 @@ By type they are: `),` Mosaic Result: -`,E),d(N.map(({label:K})=>K).join(", ")),f(!0))},[i,s,n,c]);return v.jsxs(v.Fragment,{children:[v.jsx(qh,{error:t.error,id:e.name,fieldDef:{name:e.name,type:"autocomplete",label:e.label,required:e.required,size:ft.lg},methods:t.methods,disabled:t.disabled,useRealLabel:!0,skeleton:r,children:r?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(wC,{onChange:g=>t.onChange(g),onBlur:t.onBlur,value:t.value??"",onSelect:m,googleMapsApiKey:a,disabled:t.disabled,id:`${e.name}-input`})}),Eo.createPortal(v.jsx(zf,{autoHideDuration:4e3,label:`The following fields could not be autocompleted: ${u}.`,open:p,onClose:()=>f(!1)}),document.body)]})}const CU=h.memo(wU);function SU(t){const{fieldDef:e,path:n,value:r}=t,{inputSettings:o}=e,{getOptionsStates:i}=o,{state:s,methods:a}=h.useContext(hi),{setFieldValue:l}=a,c=h.useMemo(()=>mr(s.data,[...n||[],"country"]),[s,n]),u=h.useCallback(async()=>c?i(c.value):[],[c,i]);return h.useEffect(()=>{if(!r)return;(async()=>{if(!c){l({name:"state",path:n,value:void 0});return}(await i(c.value)).find(({label:m})=>m.toLowerCase().includes(r.label.toLowerCase()))||l({name:"state",path:n,value:void 0})})()},[c,n,i,l,r]),v.jsx(qh,{error:t.error,id:e.name,fieldDef:{name:e.name,type:"addressState",label:e.label,required:e.required,size:e.size},methods:t.methods,disabled:t.disabled,useRealLabel:!0,skeleton:t.skeleton,children:v.jsx(Vx,{...t,fieldDef:{...e,inputSettings:{...o,getOptions:u}}})})}const kU=h.memo(SU);function CC(t,e,{by:n=(r,o,i)=>i in o}={}){return Object.fromEntries(Object.entries(t).map(([r,o])=>n(t,e,r)?yp(o)&&yp(e[r])?[r,CC(o,e[r])]:[r,e[r]]:[r,o]))}const Ly={address1:["country","city","state","postalCode"],address2:["address1"],address3:["address2"],state:["country","postalCode"],city:["country","state","postalCode"]};function MU(t){const e=[],n=t.map(r=>typeof r=="string"?r:r.name);for(const r of n)if(Ly[r])for(const o of Ly[r])n.includes(o)||e.push(`The "${r}" sub field requires the ${o} to also be included.`);return e.join(` -`)}function SC({getOptionsCountries:t,getOptionsStates:e,googleMapsApiKey:n,required:r,disabled:o,include:i}){const s=i&&MU(i);if(s)throw new Error(s);const a={address1:{name:"address1",required:r,disabled:o,label:"Address",size:"lg",...n?{type:CU,inputSettings:{getOptionsCountries:t,getOptionsStates:e,googleMapsApiKey:n}}:{type:"text"}},address2:{name:"address2",type:"text",label:void 0,size:"lg",disabled:o},address3:{name:"address3",type:"text",label:void 0,size:"lg",disabled:o},country:{name:"country",type:"dropdown",label:"Country",size:"sm",required:r,disabled:o,inputSettings:{getOptions:t},validates:[{name:"postalCode",include:[Xw]}]},city:{name:"city",type:"text",label:"City",size:"sm",required:r,disabled:o},state:{name:"state",type:kU,label:"State",size:"sm",disabled:o,inputSettings:{getOptionsStates:e}},postalCode:{name:"postalCode",type:"text",label:"Postal Code",size:"sm",required:r,disabled:o,inputSettings:{type:"string"},validators:[{fn:"validatePostcode",options:{countryField:"country"}}]}};return i?i.map(l=>typeof l=="string"?a[l]:CC(a[l.name],l)):Object.values(a)}const EU=t=>{const{onSave:e,addressToEdit:n,handleClose:r,handleUnsavedChanges:o,dialogOpen:i,handleDialogClose:s,addressTypes:a,getOptionsCountries:l,getOptionsStates:c,googleMapsApiKey:u}=t,d=Ou(),{state:p,handleSubmit:f}=d;h.useEffect(()=>{o&&o(!X9(n,p.data))},[n,p.data]);const m=f(h.useCallback(async()=>{e({...n||{},address1:p.data.address1,address2:p.data.address2,address3:p.data.address3,city:p.data.city,state:p.data.state,postalCode:p.data.postalCode,country:p.data.country,types:p.data.types}),r(!0)},[r,e,n,p.data.address1,p.data.address2,p.data.address3,p.data.city,p.data.state,p.data.postalCode,p.data.country,p.data.types])),g=h.useMemo(()=>[{fields:[[["address1"]],[["address2"]],[["address3"]],[["country"]],[["city"],["state"],["postalCode"]],...a?[[["types"]]]:[]]}],[a]),y=h.useMemo(()=>a?[{name:"types",type:"checkbox",label:"Type",size:"sm",required:!0,inputSettings:{options:[...a,...n?n.types.filter(E=>!a.find(({value:k})=>k===E.value)):[]]}}]:[],[a,n]),b=h.useMemo(()=>[...SC({getOptionsCountries:l,getOptionsStates:c,googleMapsApiKey:u,required:!0}),...y],[l,c,u,y]),x=h.useCallback(async()=>{if(!n)return{};const E={address1:n.address1,address2:n.address2,address3:n.address3,city:n.city,state:n.state,postalCode:n.postalCode,country:n.country};return a&&(E.types=n.types),E},[n,a]),S=h.useMemo(()=>[{label:"Cancel",onClick:()=>r(),color:"gray",variant:"outlined"},{label:"Save",onClick:m,color:"yellow",variant:"contained",type:"submit"}],[r,m]);return v.jsx(Hf,{className:"address",children:v.jsx(Uu,{...d,onBack:r,backLabel:"Cancel address entry",title:"Address Information",buttons:S,"data-testid":"address-testid",sections:g,fields:b,dialogOpen:i,handleDialogClose:s,getFormValues:x})})},TU=Q.div` +`,E),d(N.map(({label:K})=>K).join(", ")),f(!0))},[i,s,n,c]);return v.jsxs(v.Fragment,{children:[v.jsx(qh,{error:t.error,id:e.name,fieldDef:{name:e.name,type:"autocomplete",label:e.label,required:e.required,size:ft.lg},path:n,methods:t.methods,disabled:t.disabled,useRealLabel:!0,skeleton:r,children:r?v.jsx(Xe,{variant:"rectangular",width:"100%",height:43}):v.jsx(wC,{onChange:g=>t.onChange(g),onBlur:t.onBlur,value:t.value??"",onSelect:m,googleMapsApiKey:a,disabled:t.disabled,id:`${e.name}-input`})}),Eo.createPortal(v.jsx(Hf,{autoHideDuration:4e3,label:`The following fields could not be autocompleted: ${u}.`,open:p,onClose:()=>f(!1)}),document.body)]})}const CU=h.memo(wU);function SU(t){const{fieldDef:e,path:n,value:r}=t,{inputSettings:o}=e,{getOptionsStates:i}=o,{state:s,methods:a}=h.useContext(hi),{setFieldValue:l}=a,c=h.useMemo(()=>mr(s.data,[...n||[],"country"]),[s,n]),u=h.useCallback(async()=>c?i(c.value):[],[c,i]);return h.useEffect(()=>{if(!r)return;(async()=>{if(!c){l({name:"state",path:n,value:void 0});return}(await i(c.value)).find(({label:m})=>m.toLowerCase().includes(r.label.toLowerCase()))||l({name:"state",path:n,value:void 0})})()},[c,n,i,l,r]),v.jsx(qh,{error:t.error,id:e.name,fieldDef:{name:e.name,type:"addressState",label:e.label,required:e.required,size:e.size},path:n,methods:t.methods,disabled:t.disabled,useRealLabel:!0,skeleton:t.skeleton,children:v.jsx(Vx,{...t,fieldDef:{...e,inputSettings:{...o,getOptions:u}}})})}const kU=h.memo(SU);function CC(t,e,{by:n=(r,o,i)=>i in o}={}){return Object.fromEntries(Object.entries(t).map(([r,o])=>n(t,e,r)?bp(o)&&bp(e[r])?[r,CC(o,e[r])]:[r,e[r]]:[r,o]))}const Ly={address1:["country","city","state","postalCode"],address2:["address1"],address3:["address2"],state:["country","postalCode"],city:["country","state","postalCode"]};function MU(t){const e=[],n=t.map(r=>typeof r=="string"?r:r.name);for(const r of n)if(Ly[r])for(const o of Ly[r])n.includes(o)||e.push(`The "${r}" sub field requires the ${o} to also be included.`);return e.join(` +`)}function SC({getOptionsCountries:t,getOptionsStates:e,googleMapsApiKey:n,required:r,disabled:o,include:i}){const s=i&&MU(i);if(s)throw new Error(s);const a={address1:{name:"address1",required:r,disabled:o,label:"Address",size:"lg",...n?{type:CU,inputSettings:{getOptionsCountries:t,getOptionsStates:e,googleMapsApiKey:n}}:{type:"text"}},address2:{name:"address2",type:"text",label:void 0,size:"lg",disabled:o},address3:{name:"address3",type:"text",label:void 0,size:"lg",disabled:o},country:{name:"country",type:"dropdown",label:"Country",size:"sm",required:r,disabled:o,inputSettings:{getOptions:t},validates:[{name:"postalCode",include:[Xw]}]},city:{name:"city",type:"text",label:"City",size:"sm",required:r,disabled:o},state:{name:"state",type:kU,label:"State",size:"sm",disabled:o,inputSettings:{getOptionsStates:e}},postalCode:{name:"postalCode",type:"text",label:"Postal Code",size:"sm",required:r,disabled:o,inputSettings:{type:"string"},validators:[{fn:"validatePostcode",options:{countryField:"country"}}]}};return i?i.map(l=>typeof l=="string"?a[l]:CC(a[l.name],l)):Object.values(a)}const EU=t=>{const{onSave:e,addressToEdit:n,handleClose:r,handleUnsavedChanges:o,dialogOpen:i,handleDialogClose:s,addressTypes:a,getOptionsCountries:l,getOptionsStates:c,googleMapsApiKey:u}=t,d=Lu(),{state:p,handleSubmit:f}=d;h.useEffect(()=>{o&&o(!X9(n,p.data))},[n,p.data]);const m=f(h.useCallback(async()=>{e({...n||{},address1:p.data.address1,address2:p.data.address2,address3:p.data.address3,city:p.data.city,state:p.data.state,postalCode:p.data.postalCode,country:p.data.country,types:p.data.types}),r(!0)},[r,e,n,p.data.address1,p.data.address2,p.data.address3,p.data.city,p.data.state,p.data.postalCode,p.data.country,p.data.types])),g=h.useMemo(()=>[{fields:[[["address1"]],[["address2"]],[["address3"]],[["country"]],[["city"],["state"],["postalCode"]],...a?[[["types"]]]:[]]}],[a]),y=h.useMemo(()=>a?[{name:"types",type:"checkbox",label:"Type",size:"sm",required:!0,inputSettings:{options:[...a,...n?n.types.filter(E=>!a.find(({value:k})=>k===E.value)):[]]}}]:[],[a,n]),b=h.useMemo(()=>[...SC({getOptionsCountries:l,getOptionsStates:c,googleMapsApiKey:u,required:!0}),...y],[l,c,u,y]),x=h.useCallback(async()=>{if(!n)return{};const E={address1:n.address1,address2:n.address2,address3:n.address3,city:n.city,state:n.state,postalCode:n.postalCode,country:n.country};return a&&(E.types=n.types),E},[n,a]),S=h.useMemo(()=>[{label:"Cancel",onClick:()=>r(),color:"gray",variant:"outlined"},{label:"Save",onClick:m,color:"yellow",variant:"contained",type:"submit"}],[r,m]);return v.jsx(Vf,{className:"address",children:v.jsx(Gu,{...d,onBack:r,backLabel:"Cancel address entry",title:"Address Information",buttons:S,"data-testid":"address-testid",sections:g,fields:b,dialogOpen:i,handleDialogClose:s,getFormValues:x})})},TU=Q.div` display: flex; flex-direction: column; color: ${_.newColors.almostBlack[100]}; @@ -756,20 +756,20 @@ Mosaic Result: `,IU=Q.div` display: flex; gap: 16px; -`;function $U(){return v.jsxs("div",{children:[v.jsx(Xe,{variant:"rectangular",width:143,height:36,sx:{marginBottom:2}}),v.jsxs(IU,{children:[v.jsx(Xe,{variant:"rectangular",width:300,height:204}),v.jsx(Xe,{variant:"rectangular",width:300,height:204})]})]})}const Ad=[{label:"Physical",value:"physical",inputSettingsKey:"amountPhysical"},{label:"Billing",value:"billing",inputSettingsKey:"amountBilling"},{label:"Shipping",value:"shipping",inputSettingsKey:"amountShipping"}],NU=t=>{var D,P,U;const{disabled:e,value:n,onBlur:r,onChange:o,fieldDef:i,skeleton:s}=t,[a,l]=h.useState(!1),c=h.useMemo(()=>!n||Array.isArray(n)?n:[n],[n]),[u,d]=h.useState(!1),[p,f]=h.useState(!1),[m,g]=h.useState(null),{singleType:y,limits:b}=h.useMemo(()=>{var I,oe;const K=Ad.map(me=>{var te;return{...me,limit:(te=i==null?void 0:i.inputSettings)==null?void 0:te[me.inputSettingsKey]}}).filter(me=>me.limit!==void 0),R=K.length===1&&((I=i==null?void 0:i.inputSettings)==null?void 0:I.amountPerType)===void 0?K[0]:!1,B=((oe=i==null?void 0:i.inputSettings)==null?void 0:oe.amountPerType)??+!K.length;return{limits:Ad.reduce((me,te)=>{var G;return{...me,[te.value]:((G=i==null?void 0:i.inputSettings)==null?void 0:G[te.inputSettingsKey])??B}},{}),singleType:R}},[i==null?void 0:i.inputSettings]),x=h.useMemo(()=>Ad.filter(K=>{const R=(c||[]).filter(B=>{var z;return(z=B==null?void 0:B.types)==null?void 0:z.map(({value:I})=>I).includes(K.value)});return!(b[K.value]>-1&&R.length>=b[K.value])}),[b,c]),S=()=>{l(!0)},E=h.useCallback(async N=>{o((c||[]).filter(K=>K!==N)),await r()},[r,o,c]),k=async(N=!1)=>{typeof N=="boolean"&&N?(l(!1),r&&await r()):u?f(!0):(l(!1),r&&await r())},w=async N=>{N&&l(!1),f(!1)},M=N=>{const K=[...c||[]],R={...N,types:y?[{value:y.value,label:y.label}]:N.types};if(typeof a=="object"){const B=c.findIndex(z=>z===a);K.splice(B,1,R)}else K.push(R);o(K)},T=h.useMemo(()=>[{label:"No, keep it",onClick:()=>g(void 0),color:"gray",variant:"outlined"},{label:"Yes, remove it",onClick:()=>{E(m),g(void 0)},color:"yellow",variant:"contained"}],[E,m]);return s?v.jsx($U,{}):v.jsxs(v.Fragment,{children:[x.length>0&&v.jsx(DU,{children:v.jsx(un,{disabled:e,color:"gray",variant:"outlined",label:"ADD ADDRESS",onClick:S})}),!!c&&v.jsx(RU,{children:c.map((N,K)=>v.jsx(PU,{address:N,onEdit:l,disabled:e,onRemoveAddress:g},`${K}`))}),v.jsx(Bf,{open:!!a,onClose:k,children:v.jsx(EU,{googleMapsApiKey:(D=i==null?void 0:i.inputSettings)==null?void 0:D.googleMapsApiKey,handleClose:k,addressToEdit:typeof a=="object"?a:void 0,handleUnsavedChanges:N=>d(N),dialogOpen:p,handleDialogClose:w,addressTypes:y?void 0:x,getOptionsCountries:(P=i==null?void 0:i.inputSettings)==null?void 0:P.getOptionsCountries,getOptionsStates:(U=i==null?void 0:i.inputSettings)==null?void 0:U.getOptionsStates,onSave:M})}),v.jsx(jf,{buttons:T,dialogTitle:"Are you sure you want to remove this address?",open:!!m,children:"All data for this address will be lost. This action is irreversible."})]})},_U=h.memo(NU);function an(t){this.content=t}an.prototype={constructor:an,find:function(t){for(var e=0;e>1}};an.from=function(t){if(t instanceof an)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new an(e)};function kC(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=kC(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function MC(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ce&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);ie)for(let i=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new ne(r,o)}cutByIndex(e,n){return e==n?ne.empty:e==0&&n==this.content.length?this:new ne(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new ne(o,i)}addToStart(e){return new ne([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ne(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?wl(r+1,s):wl(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return ne.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new ne(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ne.empty;let n,r=0;for(let o=0;othis.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-o.type.rank),n}};mt.none=[];class ls extends Error{}class se{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=TC(this.content,e+this.openStart,n);return r&&new se(r,this.openStart,this.openEnd)}removeBetween(e,n){return new se(EC(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return se.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new se(ne.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new se(e,r,o)}}se.empty=new se(ne.empty,0,0);function EC(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(EC(i.content,e-o-1,n-o-1)))}function TC(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=TC(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function FU(t,e,n){if(n.openStart>t.depth)throw new ls("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ls("Inconsistent open depths");return OC(t,e,n,0)}function OC(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function ra(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Go(t.nodeAfter,r),i++));for(let a=i;ao&&Wp(t,e,o+1),s=r.depth>o&&Wp(n,r,o+1),a=[];return ra(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(LC(i,s),Go(qo(i,AC(t,e,n,r,o+1)),a)):(i&&Go(qo(i,mc(t,e,o+1)),a),ra(e,n,o,a),s&&Go(qo(s,mc(n,r,o+1)),a)),ra(r,null,o,a),new ne(a)}function mc(t,e,n){let r=[];if(ra(null,t,n,r),t.depth>n){let o=Wp(t,e,n+1);Go(qo(o,mc(t,e,n+1)),r)}return ra(e,null,n,r),new ne(r)}function BU(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(ne.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class ba{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new gc(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new ba(n,r,i)}static resolveCached(e,n){let r=Ay.get(e);if(r)for(let i=0;ie&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),PC(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ne.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=ne.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};Ko.prototype.text=void 0;class vc extends Ko{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):PC(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new vc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vc(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function PC(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Qo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new VU(e,n);if(r.next==null)return Qo.empty;let o=RC(r);r.next&&r.err("Unexpected trailing text");let i=JU(YU(o));return ZU(i,r),i}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return i}).join(` -`)}}Qo.empty=new Qo(!0);class VU{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function RC(t){let e=[];do e.push(WU(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function WU(t){let e=[];do e.push(UU(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function UU(t){let e=KU(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=GU(t,e);else break;return e}function Py(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function GU(t,e){let n=Py(t),r=n;return t.eat(",")&&(t.next!="}"?r=Py(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function qU(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function KU(t){if(t.eat("(")){let e=RC(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=qU(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function YU(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Qo(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[i]=new FC(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function XU(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class QU{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?XU(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class qa{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=_C(e,o.attrs),this.excluded=null;let i=IC(this.attrs);this.instance=i?new mt(this,i):null}create(e=null){return!e&&this.instance?this.instance:new mt(this,$C(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new qa(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n-1}}class BC{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=an.from(e.nodes),n.marks=an.from(e.marks||{}),this.nodes=Dy.compile(this.spec.nodes,this),this.marks=qa.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=Qo.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?Iy(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:Iy(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Dy){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new vc(r,r.defaultAttrs,e,mt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Ko.fromJSON(this,e)}markFromJSON(e){return mt.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Iy(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function e7(t){return t.tag!=null}function t7(t){return t.style!=null}let oa=class Gp{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(e7(o))this.tags.push(o);else if(t7(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new Ny(this,n,!1);return r.addAll(e,mt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Ny(this,n,!0);return r.addAll(e,mt.none,n.from,n.to),se.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;oe.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s{r(s=_y(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=_y(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Gp(e,Gp.schemaRules(e)))}};const jC={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},n7={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},zC={ol:!0,ul:!0},yc=1,bc=2,ia=4;function $y(t,e,n){return e!=null?(e?yc:0)|(e==="full"?bc:0):t&&t.whitespace=="pre"?yc|bc:n&~ia}class Cl{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=mt.none,this.match=i||(s&ia?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ne.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&yc)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=ne.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ne.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!jC.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ny{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,s=$y(null,n.preserveWhitespace,0)|(r?ia:0);o?i=new Cl(o.type,o.attrs,mt.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new Cl(null,null,mt.none,!0,null,s):i=new Cl(e.schema.topNodeType,null,mt.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top;if(o.options&bc||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o.options&yc)o.options&bc?r=r.replace(/\r\n?/g,` +`;function $U(){return v.jsxs("div",{children:[v.jsx(Xe,{variant:"rectangular",width:143,height:36,sx:{marginBottom:2}}),v.jsxs(IU,{children:[v.jsx(Xe,{variant:"rectangular",width:300,height:204}),v.jsx(Xe,{variant:"rectangular",width:300,height:204})]})]})}const Pd=[{label:"Physical",value:"physical",inputSettingsKey:"amountPhysical"},{label:"Billing",value:"billing",inputSettingsKey:"amountBilling"},{label:"Shipping",value:"shipping",inputSettingsKey:"amountShipping"}],NU=t=>{var D,P,U;const{disabled:e,value:n,onBlur:r,onChange:o,fieldDef:i,skeleton:s}=t,[a,l]=h.useState(!1),c=h.useMemo(()=>!n||Array.isArray(n)?n:[n],[n]),[u,d]=h.useState(!1),[p,f]=h.useState(!1),[m,g]=h.useState(null),{singleType:y,limits:b}=h.useMemo(()=>{var I,oe;const K=Pd.map(me=>{var te;return{...me,limit:(te=i==null?void 0:i.inputSettings)==null?void 0:te[me.inputSettingsKey]}}).filter(me=>me.limit!==void 0),R=K.length===1&&((I=i==null?void 0:i.inputSettings)==null?void 0:I.amountPerType)===void 0?K[0]:!1,B=((oe=i==null?void 0:i.inputSettings)==null?void 0:oe.amountPerType)??+!K.length;return{limits:Pd.reduce((me,te)=>{var G;return{...me,[te.value]:((G=i==null?void 0:i.inputSettings)==null?void 0:G[te.inputSettingsKey])??B}},{}),singleType:R}},[i==null?void 0:i.inputSettings]),x=h.useMemo(()=>Pd.filter(K=>{const R=(c||[]).filter(B=>{var z;return(z=B==null?void 0:B.types)==null?void 0:z.map(({value:I})=>I).includes(K.value)});return!(b[K.value]>-1&&R.length>=b[K.value])}),[b,c]),S=()=>{l(!0)},E=h.useCallback(async N=>{o((c||[]).filter(K=>K!==N)),await r()},[r,o,c]),k=async(N=!1)=>{typeof N=="boolean"&&N?(l(!1),r&&await r()):u?f(!0):(l(!1),r&&await r())},w=async N=>{N&&l(!1),f(!1)},M=N=>{const K=[...c||[]],R={...N,types:y?[{value:y.value,label:y.label}]:N.types};if(typeof a=="object"){const B=c.findIndex(z=>z===a);K.splice(B,1,R)}else K.push(R);o(K)},T=h.useMemo(()=>[{label:"No, keep it",onClick:()=>g(void 0),color:"gray",variant:"outlined"},{label:"Yes, remove it",onClick:()=>{E(m),g(void 0)},color:"yellow",variant:"contained"}],[E,m]);return s?v.jsx($U,{}):v.jsxs(v.Fragment,{children:[x.length>0&&v.jsx(DU,{children:v.jsx(un,{disabled:e,color:"gray",variant:"outlined",label:"ADD ADDRESS",onClick:S})}),!!c&&v.jsx(RU,{children:c.map((N,K)=>v.jsx(PU,{address:N,onEdit:l,disabled:e,onRemoveAddress:g},`${K}`))}),v.jsx(jf,{open:!!a,onClose:k,children:v.jsx(EU,{googleMapsApiKey:(D=i==null?void 0:i.inputSettings)==null?void 0:D.googleMapsApiKey,handleClose:k,addressToEdit:typeof a=="object"?a:void 0,handleUnsavedChanges:N=>d(N),dialogOpen:p,handleDialogClose:w,addressTypes:y?void 0:x,getOptionsCountries:(P=i==null?void 0:i.inputSettings)==null?void 0:P.getOptionsCountries,getOptionsStates:(U=i==null?void 0:i.inputSettings)==null?void 0:U.getOptionsStates,onSave:M})}),v.jsx(zf,{buttons:T,dialogTitle:"Are you sure you want to remove this address?",open:!!m,children:"All data for this address will be lost. This action is irreversible."})]})},_U=h.memo(NU);function an(t){this.content=t}an.prototype={constructor:an,find:function(t){for(var e=0;e>1}};an.from=function(t){if(t instanceof an)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new an(e)};function kC(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=kC(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function MC(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;ce&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);ie)for(let i=0,s=0;se&&((sn)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new ne(r,o)}cutByIndex(e,n){return e==n?ne.empty:e==0&&n==this.content.length?this:new ne(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new ne(o,i)}addToStart(e){return new ne([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ne(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?wl(r+1,s):wl(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return ne.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new ne(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ne.empty;let n,r=0;for(let o=0;othis.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-o.type.rank),n}};mt.none=[];class ls extends Error{}class se{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=TC(this.content,e+this.openStart,n);return r&&new se(r,this.openStart,this.openEnd)}removeBetween(e,n){return new se(EC(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return se.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new se(ne.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new se(e,r,o)}}se.empty=new se(ne.empty,0,0);function EC(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(EC(i.content,e-o-1,n-o-1)))}function TC(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=TC(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function FU(t,e,n){if(n.openStart>t.depth)throw new ls("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ls("Inconsistent open depths");return OC(t,e,n,0)}function OC(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function ra(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Go(t.nodeAfter,r),i++));for(let a=i;ao&&Up(t,e,o+1),s=r.depth>o&&Up(n,r,o+1),a=[];return ra(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(LC(i,s),Go(qo(i,AC(t,e,n,r,o+1)),a)):(i&&Go(qo(i,mc(t,e,o+1)),a),ra(e,n,o,a),s&&Go(qo(s,mc(n,r,o+1)),a)),ra(r,null,o,a),new ne(a)}function mc(t,e,n){let r=[];if(ra(null,t,n,r),t.depth>n){let o=Up(t,e,n+1);Go(qo(o,mc(t,e,n+1)),r)}return ra(e,null,n,r),new ne(r)}function BU(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(ne.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class ba{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new gc(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new ba(n,r,i)}static resolveCached(e,n){let r=Ay.get(e);if(r)for(let i=0;ie&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),PC(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=ne.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=ne.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};Ko.prototype.text=void 0;class vc extends Ko{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):PC(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new vc(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vc(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function PC(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Qo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new VU(e,n);if(r.next==null)return Qo.empty;let o=RC(r);r.next&&r.err("Unexpected trailing text");let i=JU(YU(o));return ZU(i,r),i}matchType(e){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return i}).join(` +`)}}Qo.empty=new Qo(!0);class VU{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function RC(t){let e=[];do e.push(WU(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function WU(t){let e=[];do e.push(UU(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function UU(t){let e=KU(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=GU(t,e);else break;return e}function Py(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function GU(t,e){let n=Py(t),r=n;return t.eat(",")&&(t.next!="}"?r=Py(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function qU(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.groups.indexOf(e)>-1&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function KU(t){if(t.eat("(")){let e=RC(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=qU(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function YU(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Qo(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[i]=new FC(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function XU(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class QU{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?XU(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class qa{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=_C(e,o.attrs),this.excluded=null;let i=IC(this.attrs);this.instance=i?new mt(this,i):null}create(e=null){return!e&&this.instance?this.instance:new mt(this,$C(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new qa(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n-1}}class BC{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=an.from(e.nodes),n.marks=an.from(e.marks||{}),this.nodes=Dy.compile(this.spec.nodes,this),this.marks=qa.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=Qo.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?Iy(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:Iy(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Dy){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new vc(r,r.defaultAttrs,e,mt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Ko.fromJSON(this,e)}markFromJSON(e){return mt.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Iy(t,e){let n=[];for(let r=0;r-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function e7(t){return t.tag!=null}function t7(t){return t.style!=null}let oa=class qp{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(e7(o))this.tags.push(o);else if(t7(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new Ny(this,n,!1);return r.addAll(e,mt.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Ny(this,n,!0);return r.addAll(e,mt.none,n.from,n.to),se.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;oe.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s{r(s=_y(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=_y(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new qp(e,qp.schemaRules(e)))}};const jC={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},n7={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},zC={ol:!0,ul:!0},yc=1,bc=2,ia=4;function $y(t,e,n){return e!=null?(e?yc:0)|(e==="full"?bc:0):t&&t.whitespace=="pre"?yc|bc:n&~ia}class Cl{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=mt.none,this.match=i||(s&ia?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ne.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&yc)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=ne.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ne.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!jC.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Ny{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,s=$y(null,n.preserveWhitespace,0)|(r?ia:0);o?i=new Cl(o.type,o.attrs,mt.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new Cl(null,null,mt.none,!0,null,s):i=new Cl(e.schema.topNodeType,null,mt.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top;if(o.options&bc||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o.options&yc)o.options&bc?r=r.replace(/\r\n?/g,` `):r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let i=o.content[o.content.length-1],s=e.previousSibling;(!i||s&&s.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=e.nodeName.toLowerCase(),i;zC.hasOwnProperty(o)&&this.parser.normalizeLists&&r7(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,r));if(s?s.ignore:n7.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let a,l=this.top,c=this.needsBlock;if(jC.hasOwnProperty(o))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),a=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);return}let u=s&&s.skip?n:this.readStyles(e,n);u&&this.addAll(e,u),a&&this.sync(l),this.needsBlock=c}else{let a=this.readStyles(e,n);a&&this.addElementByRule(e,s,a,s.consuming===!1?i:void 0)}}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r)}i&&this.sync(a)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n){let r,o;for(let i=this.open;i>=0;i--){let s=this.nodes[i],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,o=s,!a.length)||s.solid)break}if(!r)return null;this.sync(o);for(let i=0;i(s.type?s.type.allowsMarkType(c.type):Fy(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Cl(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function r7(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&zC.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function o7(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function _y(t){let e={};for(let n in t)e[n]=t[n];return e}function Fy(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l{if(i.length||s.marks.length){let a=0,l=0;for(;a=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&$l(Rd(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return $l(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new mi(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=By(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return By(e.marks)}}function By(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Rd(t){return t.document||window.document}const jy=new WeakMap;function i7(t){let e=jy.get(t);return e===void 0&&jy.set(t,e=s7(t)),e}function s7(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let p=d.indexOf(" ");p>0?l.setAttributeNS(d.slice(0,p),d.slice(p+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:m}=$l(t,p,n,r);if(l.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const HC=65535,VC=Math.pow(2,16);function a7(t,e){return t+e*VC}function zy(t){return t&HC}function l7(t){return(t-(t&HC))/VC}const WC=1,UC=2,Nl=4,GC=8;let qp=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&GC)>0}get deletedBefore(){return(this.delInfo&(WC|Nl))>0}get deletedAfter(){return(this.delInfo&(UC|Nl))>0}get deletedAcross(){return(this.delInfo&Nl)>0}},ei=class Vi{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Vi.empty)return Vi.empty}recover(e){let n=0,r=zy(e);if(!this.inverted)for(let o=0;oe)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let p=c?e==l?-1:e==d?1:n:n,f=l+o+(p<0?0:u);if(r)return f;let m=e==(n<0?l:d)?null:a7(a/3,e-l),g=e==l?UC:e==d?WC:Nl;return(n<0?e!=l:e!=d)&&(g|=GC),new qp(f,g,m)}o+=u-c}return r?e+o:new qp(e+o,0,null)}touches(e,n){let r=0,o=zy(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;n--){let o=e.getMirror(n);this.appendMap(e.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new _l;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ri&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return wn.fromReplace(e,this.from,this.to,i)}invert(){return new Ka(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new js(n.pos,r.pos,this.mark)}merge(e){return e instanceof js&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new js(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new js(n.from,n.to,e.markFromJSON(n.mark))}};gn.jsonID("addMark",im);let Ka=class zs extends gn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new se(om(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return wn.fromReplace(e,this.from,this.to,r)}invert(){return new im(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new zs(n.pos,r.pos,this.mark)}merge(e){return e instanceof zs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new zs(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new zs(n.from,n.to,e.markFromJSON(n.mark))}};gn.jsonID("removeMark",Ka);let sm=class Hs extends gn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return wn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return wn.fromReplace(e,this.pos,this.pos+1,new se(ne.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;or.pos?null:new Fl(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Fl(n.from,n.to,n.gapFrom,n.gapTo,se.fromJSON(e,n.slice),n.insert,!!n.structure)}};gn.jsonID("replaceAround",wr);function Yp(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function c7(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,e),f=Math.min(c+l.nodeSize,n),m=r.addToSet(d);for(let g=0;gt.step(l)),i.forEach(l=>t.step(l))}function u7(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof qa){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;ut.step(new Ka(s.from,s.to,s.style)))}function KC(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)t.step(s[l])}function d7(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function p7(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;m--)g||r.index(m)>0?(g=!0,u=ne.from(r.node(m).copy(u)),d++):l--;let p=ne.empty,f=0;for(let m=i,g=!1;m>n;m--)g||o.after(m+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ne.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new wr(o,i,o,i,new se(r,0,0),n.length,!0))}function y7(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&w7(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!m?c=!1:!f&&m&&(c=!0)}c===!1&&x7(t,s,a,i),KC(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let u=t.mapping.slice(i),d=u.map(a,1),p=u.map(a+s.nodeSize,1);return t.step(new wr(d,p,d+1,p-1,new se(ne.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&b7(t,s,a,i),!1}})}function b7(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function x7(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(` -`))}})}function w7(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function C7(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new wr(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new se(ne.from(s),0,0),1,!0))}function S7(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let l=o.depth-1,c=n-2;l>i;l--,c--){let u=o.node(l),d=o.index(l);if(u.type.spec.isolating)return!1;let p=u.content.cutByIndex(d,u.childCount),f=u;if(!u.canReplace(d+1,u.childCount)||!f.type.validContent(p))return!1}let a=o.indexAfter(i);return o.node(i).canReplaceWith(a,a,o.node(i+1).type)}function k7(t,e,n=1,r){let o=t.doc.resolve(e),i=ne.empty,s=ne.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=ne.from(o.node(a).copy(i));let u=r&&r[c];s=ne.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new Ur(e,e,new se(i.append(s),n,n),!0))}function M7(t,e){let n=t.resolve(e),r=n.index();return E7(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function E7(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function T7(t,e,n){let r=new Ur(e-n,e+n,se.empty,!0);t.step(r)}function O7(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function L7(t,e,n=e,r=se.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return JC(o,i,r)?new Ur(e,n,r):new A7(o,i,r).fit()}function JC(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}let A7=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ne.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=ne.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new se(i,s,a);return e>-1?new wr(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ur(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Id(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ne.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Id(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Id(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new se(Vs(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new se(Vs(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(ZC(g.mark(p.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?f:-1)))}let m=c==a.childCount;m||(f=-1),this.placed=Ws(this.placed,n,ne.from(u)),this.frontier[n].match=d,m&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n=0;a--){let{match:l,type:c}=this.frontier[a],u=$d(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ws(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Ws(this.placed,this.depth,ne.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ne.empty,!0);n.childCount&&(this.placed=Ws(this.placed,this.frontier.length,n))}};function Vs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Vs(t.firstChild.content,e-1,n)))}function Ws(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ws(t.lastChild.content,e-1,n)))}function Id(t,e){for(let n=0;n1&&(r=r.replaceChild(0,ZC(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ne.empty,!0)))),t.copy(r)}function $d(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!P7(n,i.content,s)?a:null}function P7(t,e,n){for(let r=n;r0;p--,f--){let m=o.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(p)>-1?a=p:o.before(p)==f&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],u=r.openStart;for(let p=r.content,f=0;;f++){let m=p.firstChild;if(c.push(m),f==r.openStart)break;p=m.content}for(let p=u-1;p>=0;p--){let f=c[p],m=R7(f.type);if(m&&!f.sameMarkup(o.node(Math.abs(a)-1)))u=p;else if(m||!f.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let f=(p+u+1)%(r.openStart+1),m=c[f];if(m)for(let g=0;g=0&&(t.replace(e,n,r),!(t.steps.length>d));p--){let f=s[p];f<0||(e=o.before(f),n=i.after(f))}}function XC(t,e,n,r,o){if(er){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(ne.empty,!0))}return t}function I7(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=O7(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new se(ne.from(r),0,0))}function $7(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=QC(r,o);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function QC(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(ie.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}let eS=class Bl extends gn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return wn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return wn.fromReplace(e,this.pos,this.pos+1,new se(ne.from(o),0,n.isLeaf?0:1))}getMap(){return ei.empty}invert(e){return new Bl(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Bl(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Bl(n.pos,n.attr,n.value)}};gn.jsonID("attr",eS);let tS=class Jp extends gn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return wn.ok(r)}getMap(){return ei.empty}invert(e){return new Jp(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Jp(n.attr,n.value)}};gn.jsonID("docAttr",tS);let cs=class extends Error{};cs=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};cs.prototype=Object.create(Error.prototype);cs.prototype.constructor=cs;cs.prototype.name="TransformError";let N7=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new qC}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cs(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=se.empty){let o=L7(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new se(ne.from(r),0,0))}delete(e,n){return this.replace(e,n,se.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return D7(this,e,n,r),this}replaceRangeWith(e,n,r){return I7(this,e,n,r),this}deleteRange(e,n){return $7(this,e,n),this}lift(e,n){return f7(this,e,n),this}join(e,n=1){return T7(this,e,n),this}wrap(e,n){return v7(this,e,n),this}setBlockType(e,n=e,r,o=null){return y7(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return C7(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new eS(e,n,r)),this}setDocAttribute(e,n){return this.step(new tS(e,n)),this}addNodeMark(e,n){return this.step(new sm(e,n)),this}removeNodeMark(e,n){if(!(n instanceof mt)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new am(e,n)),this}split(e,n=1,r){return k7(this,e,n,r),this}addMark(e,n,r){return c7(this,e,n,r),this}removeMark(e,n,r){return u7(this,e,n,r),this}clearIncompatible(e,n,r){return KC(this,e,n,r),this}};const Nd=Object.create(null);class Ze{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new _7(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;i--){let s=n<0?Wi(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Wi(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new yr(e.node(0))}static atStart(e){return Wi(e,e,0,0,1)||new yr(e)}static atEnd(e){return Wi(e,e,e.content.size,e.childCount,-1)||new yr(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Nd[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Nd)throw new RangeError("Duplicate use of selection JSON ID "+e);return Nd[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ke.between(this.$anchor,this.$head).getBookmark()}}Ze.prototype.visible=!0;class _7{constructor(e,n){this.$from=e,this.$to=n}}let Vy=!1;function Wy(t){!Vy&&!t.parent.inlineContent&&(Vy=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ke extends Ze{constructor(e,n=e){Wy(e),Wy(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ze.near(r);let o=e.resolve(n.map(this.anchor));return new Ke(o.parent.inlineContent?o:r,r)}replace(e,n=se.empty){if(super.replace(e,n),n==se.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ke&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Au(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ke(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Ze.findFrom(n,r,!0)||Ze.findFrom(n,-r,!0);if(i)n=i.$head;else return Ze.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Ze.findFrom(e,-r,!0)||Ze.findFrom(e,r,!0)).$anchor,e.pos0?0:1);o>0?s=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&Ve.isSelectable(a))return Ve.create(t,n-(o<0?a.nodeSize:0))}else{let l=Wi(t,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function Uy(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=u)}),t.setSelection(Ze.near(t.doc.resolve(s),n))}const Gy=1,Sl=2,qy=4;class B7 extends N7{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Sl,this}ensureMarks(e){return mt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Sl)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Sl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||mt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(Ze.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=qy,this}get scrolledIntoView(){return(this.updated&qy)>0}}function Ky(t,e){return!e||!t?t:t.bind(e)}class Us{constructor(e,n,r){this.name=e,this.init=Ky(n.init,r),this.apply=Ky(n.apply,r)}}const j7=[new Us("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Us("selection",{init(t,e){return t.selection||Ze.atStart(e.doc)},apply(t){return t.selection}}),new Us("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Us("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class _d{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=j7.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Us(r.key,r.spec.state,r))})}}class Xi{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new _d(e.schema,e.plugins),i=new Xi(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Ko.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=Ze.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,e,n[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function nS(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=nS(o,e,{})),n[r]=o}return n}class vn{constructor(e){this.spec=e,this.props={},e.props&&nS(e.props,this,this.props),this.key=e.key?e.key.key:rS("plugin")}getState(e){return e[this.key]}}const Fd=Object.create(null);function rS(t){return t in Fd?t+"$"+ ++Fd[t]:(Fd[t]=0,t+"$")}class Gn{constructor(e="key"){this.key=rS(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ln=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},xa=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Zp=null;const zr=function(t,e,n){let r=Zp||(Zp=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},z7=function(){Zp=null},ti=function(t,e,n,r){return n&&(Yy(t,e,n,r,-1)||Yy(t,e,n,r,1))},H7=/^(img|br|input|textarea|hr)$/i;function Yy(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:sr(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Ya(t)||H7.test(t.nodeName)||t.contentEditable=="false")return!1;e=ln(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?sr(t):0}else return!1}}function sr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function V7(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=sr(t)}else if(t.parentNode&&!Ya(t))e=ln(t),t=t.parentNode;else return null}}function W7(t,e){for(;;){if(t.nodeType==3&&e2),rr=us||(Pr?/Mac/.test(Pr.platform):!1),K7=Pr?/Win/.test(Pr.platform):!1,pr=/Android \d/.test(Oo),Ja=!!Jy&&"webkitFontSmoothing"in Jy.documentElement.style,Y7=Ja?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function J7(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Br(t,e){return typeof t=="number"?t:t[e]}function Z7(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Zy(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;s=xa(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?J7(i):Z7(a),u=0,d=0;if(e.topc.bottom-Br(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Br(o,"top")-c.top:e.bottom-c.bottom+Br(o,"bottom")),e.leftc.right-Br(r,"right")&&(u=e.right-c.right+Br(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let p=a.scrollLeft,f=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let m=a.scrollLeft-p,g=a.scrollTop-f;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function X7(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:sS(t.dom)}}function sS(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=xa(r));return e}function Q7({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;aS(n,r==0?0:r-e)}function aS(t,e){for(let n=0;n=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?tG(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:lS(n,o)}function tG(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function cm(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function nG(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function oG(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?o=a.posBefore:(!s&&l.right-1?o:t.docView.posFromDOM(e,n,-1)}function cS(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&o++}let c;Ja&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=oG(t,r,o,e))}a==null&&(a=rG(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Xy(t){return t.top=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Ds(oo(zr(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==sr(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return Bd(l.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(n<0||o==sr(r))){let l=r.childNodes[o-1],c=l.nodeType==3?zr(l,sr(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Ds(oo(c,1),!1)}if(i==null&&o=0)}function Ds(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Bd(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function dS(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function aG(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return dS(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=uS(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=zr(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const lG=/[\u0590-\u08ac]/;function cG(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?!lG.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:dS(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!f.contains(m.nodeType==1?m:m.parentNode)||l==m&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return p!=null&&(a.caretBidiLevel=p),y}):r.pos==r.start()||r.pos==r.end()}let Qy=null,eb=null,tb=!1;function uG(t,e,n){return Qy==e&&eb==n?tb:(Qy=e,eb=n,tb=n=="up"||n=="down"?aG(t,e,n):cG(t,e,n))}const ar=0,nb=1,jo=2,Rr=3;class Za{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=ar,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nln(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof fS){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof pS&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?ln(i.dom)+1:0}}else{let i,s=!0;for(;i=r=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let d=a;d>0;d--){let p=this.children[d-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){o=ln(p.dom)+1;break}e-=p.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;uf&&sn){let f=a;a=l,l=f}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o=r:er){let a=r+i.border,l=s-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?jo:nb,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Rr:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?jo:Rr}r=s}this.dirty=jo}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?jo:nb;n.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==ar&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class dG extends Za{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ni extends Za{constructor(e,n,r,o){super(e,[],r,o),this.mark=n}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=mi.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ni(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Rr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Rr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=ar){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=nf(i,0,e,r));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=mi.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let p=u;return u=gS(u,r,n),c?l=new pG(e,n,r,o,u,d||null,p,c,i,s+1):n.isText?new Ru(e,n,r,o,u,p,i):new vo(e,n,r,o,u,d||null,p,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ne.empty)}return e}matchesNode(e,n,r){return this.dirty==ar&&e.eq(this.node)&&xc(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new hG(this,s&&s.node,e);vG(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?mt.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,d,p)=>{l.syncToMarks(c.marks,r,e);let f;l.findNodeMatch(c,u,d,p)||a&&e.state.selection.from>o&&e.state.selection.to-1&&l.updateNodeAt(c,u,d,f,e)||l.updateNextNode(c,u,d,e,p,o)||l.addNode(c,u,d,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==jo)&&(s&&this.protectLocalComposition(e,s),hS(this.contentDOM,this.children,e),us&&yG(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Ke)||rn+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=bG(this.node.content,s,r-n,o-n);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new dG(this,i,n,o);e.input.compositionNodes.push(s),this.children=nf(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==Rr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=ar}updateOuterDeco(e){if(xc(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=mS(this.dom,this.nodeDOM,tf(this.outerDeco,this.node,n),tf(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function rb(t,e,n,r,o){gS(r,e,t);let i=new vo(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Ru extends vo{constructor(e,n,r,o,i,s,a){super(e,n,r,o,i,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==Rr||this.dirty!=ar&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ar||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=ar,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new Ru(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Rr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class fS extends Za{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ar&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class pG extends vo{constructor(e,n,r,o,i,s,a,l,c,u){super(e,n,r,o,i,s,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==Rr)return!1;if(this.spec.update){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function hS(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,e.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=ni.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof ni)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function gG(t,e){return t.type.side-e.type.side}function vG(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;ci;)a.push(o[s++]);let m=i+p.nodeSize;if(p.isText){let y=m;s!y.inline):a.slice();r(p,g,e.forChild(i,p),f),i=m}}function yG(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function bG(t,e,n,r){for(let o=0,i=0;o=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function nf(t,e,n,r,o){let i=[];for(let s=0,a=0;s=n||u<=e?i.push(l):(cn&&i.push(l.slice(n-c,l.size,r)))}return i}function um(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Pu(n)){for(l=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&Ve.isSelectable(d)&&o.parent&&!(d.isInline&&U7(n.focusNode,n.focusOffset,o.dom))){let p=o.posBefore;c=new Ve(s==p?a:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,p=s;for(let f=0;f{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!vS(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function wG(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setStart(r.parentNode,ln(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&An&&go<=11&&(r.disabled=!0,r.disabled=!1)}function yS(t,e){if(e instanceof Ve){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(lb(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else lb(t)}function lb(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function dm(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Ke.between(e,n,r)}function cb(t){return t.editable&&!t.hasFocus()?!1:bS(t)}function bS(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function CG(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ti(e.node,e.offset,n.anchorNode,n.anchorOffset)}function rf(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Ze.findFrom(i,e)}function ao(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function ub(t,e,n){let r=t.state.selection;if(r instanceof Ke)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return ao(t,new Ke(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=rf(t.state,e);return o&&o instanceof Ve?ao(t,o):!1}else if(!(rr&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?Ve.isSelectable(i)?ao(t,new Ve(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):Ja?ao(t,new Ke(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ve&&r.node.isInline)return ao(t,new Ke(e>0?r.$to:r.$from));{let o=rf(t.state,e);return o?ao(t,o):!1}}}function wc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function aa(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Si(t,e){return e<0?SG(t):kG(t)}function SG(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(br&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(aa(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(xS(n))break;{let a=n.previousSibling;for(;a&&aa(a,-1);)o=n.parentNode,i=ln(a),a=a.previousSibling;if(a)n=a,r=wc(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?of(t,n,r):o&&of(t,o,i)}function kG(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=wc(n),i,s;for(;;)if(r{t.state==o&&Vr(t)},50)}function db(t,e){let n=t.state.doc.resolve(e);if(!(mn||K7)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function pb(t,e,n){let r=t.state.selection;if(r instanceof Ke&&!r.empty||n.indexOf("s")>-1||rr&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=rf(t.state,e);if(s&&s instanceof Ve)return ao(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof yr?Ze.near(s,e):Ze.findFrom(s,e);return a?ao(t,a):!1}return!1}function fb(t,e){if(!(t.state.selection instanceof Ke))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function hb(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function TG(t){if(!Sn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;hb(t,r,"true"),setTimeout(()=>hb(t,r,"false"),20)}return!1}function OG(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function LG(t,e){let n=e.keyCode,r=OG(e);if(n==8||rr&&n==72&&r=="c")return fb(t,-1)||Si(t,-1);if(n==46&&!e.shiftKey||rr&&n==68&&r=="c")return fb(t,1)||Si(t,1);if(n==13||n==27)return!0;if(n==37||rr&&n==66&&r=="c"){let o=n==37?db(t,t.state.selection.from)=="ltr"?-1:1:-1;return ub(t,o,r)||Si(t,o)}else if(n==39||rr&&n==70&&r=="c"){let o=n==39?db(t,t.state.selection.from)=="ltr"?1:-1:1;return ub(t,o,r)||Si(t,o)}else{if(n==38||rr&&n==80&&r=="c")return pb(t,-1,r)||Si(t,-1);if(n==40||rr&&n==78&&r=="c")return TG(t)||pb(t,1,r)||Si(t,1);if(r==(rr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function wS(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let s=t.someProp("clipboardSerializer")||mi.fromSchema(t.state.schema),a=TS(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=ES[c.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let m=a.createElement(u[f]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,` +`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r)}i&&this.sync(a)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n){let r,o;for(let i=this.open;i>=0;i--){let s=this.nodes[i],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,o=s,!a.length)||s.solid)break}if(!r)return null;this.sync(o);for(let i=0;i(s.type?s.type.allowsMarkType(c.type):Fy(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Cl(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function r7(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&zC.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function o7(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function _y(t){let e={};for(let n in t)e[n]=t[n];return e}function Fy(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l{if(i.length||s.marks.length){let a=0,l=0;for(;a=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&$l(Dd(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return $l(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new mi(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=By(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return By(e.marks)}}function By(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Dd(t){return t.document||window.document}const jy=new WeakMap;function i7(t){let e=jy.get(t);return e===void 0&&jy.set(t,e=s7(t)),e}function s7(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let p=d.indexOf(" ");p>0?l.setAttributeNS(d.slice(0,p),d.slice(p+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:m}=$l(t,p,n,r);if(l.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const HC=65535,VC=Math.pow(2,16);function a7(t,e){return t+e*VC}function zy(t){return t&HC}function l7(t){return(t-(t&HC))/VC}const WC=1,UC=2,Nl=4,GC=8;let Kp=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&GC)>0}get deletedBefore(){return(this.delInfo&(WC|Nl))>0}get deletedAfter(){return(this.delInfo&(UC|Nl))>0}get deletedAcross(){return(this.delInfo&Nl)>0}},ei=class Vi{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Vi.empty)return Vi.empty}recover(e){let n=0,r=zy(e);if(!this.inverted)for(let o=0;oe)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let p=c?e==l?-1:e==d?1:n:n,f=l+o+(p<0?0:u);if(r)return f;let m=e==(n<0?l:d)?null:a7(a/3,e-l),g=e==l?UC:e==d?WC:Nl;return(n<0?e!=l:e!=d)&&(g|=GC),new Kp(f,g,m)}o+=u-c}return r?e+o:new Kp(e+o,0,null)}touches(e,n){let r=0,o=zy(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;n--){let o=e.getMirror(n);this.appendMap(e.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new _l;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ri&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return wn.fromReplace(e,this.from,this.to,i)}invert(){return new Ka(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new js(n.pos,r.pos,this.mark)}merge(e){return e instanceof js&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new js(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new js(n.from,n.to,e.markFromJSON(n.mark))}};gn.jsonID("addMark",im);let Ka=class zs extends gn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new se(om(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return wn.fromReplace(e,this.from,this.to,r)}invert(){return new im(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new zs(n.pos,r.pos,this.mark)}merge(e){return e instanceof zs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new zs(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new zs(n.from,n.to,e.markFromJSON(n.mark))}};gn.jsonID("removeMark",Ka);let sm=class Hs extends gn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return wn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return wn.fromReplace(e,this.pos,this.pos+1,new se(ne.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;or.pos?null:new Fl(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Fl(n.from,n.to,n.gapFrom,n.gapTo,se.fromJSON(e,n.slice),n.insert,!!n.structure)}};gn.jsonID("replaceAround",wr);function Jp(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function c7(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,e),f=Math.min(c+l.nodeSize,n),m=r.addToSet(d);for(let g=0;gt.step(l)),i.forEach(l=>t.step(l))}function u7(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof qa){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;ut.step(new Ka(s.from,s.to,s.style)))}function KC(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)t.step(s[l])}function d7(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function p7(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;m--)g||r.index(m)>0?(g=!0,u=ne.from(r.node(m).copy(u)),d++):l--;let p=ne.empty,f=0;for(let m=i,g=!1;m>n;m--)g||o.after(m+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ne.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new wr(o,i,o,i,new se(r,0,0),n.length,!0))}function y7(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&w7(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!m?c=!1:!f&&m&&(c=!0)}c===!1&&x7(t,s,a,i),KC(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let u=t.mapping.slice(i),d=u.map(a,1),p=u.map(a+s.nodeSize,1);return t.step(new wr(d,p,d+1,p-1,new se(ne.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&b7(t,s,a,i),!1}})}function b7(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function x7(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function w7(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function C7(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new wr(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new se(ne.from(s),0,0),1,!0))}function S7(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let l=o.depth-1,c=n-2;l>i;l--,c--){let u=o.node(l),d=o.index(l);if(u.type.spec.isolating)return!1;let p=u.content.cutByIndex(d,u.childCount),f=u;if(!u.canReplace(d+1,u.childCount)||!f.type.validContent(p))return!1}let a=o.indexAfter(i);return o.node(i).canReplaceWith(a,a,o.node(i+1).type)}function k7(t,e,n=1,r){let o=t.doc.resolve(e),i=ne.empty,s=ne.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=ne.from(o.node(a).copy(i));let u=r&&r[c];s=ne.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new Ur(e,e,new se(i.append(s),n,n),!0))}function M7(t,e){let n=t.resolve(e),r=n.index();return E7(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function E7(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function T7(t,e,n){let r=new Ur(e-n,e+n,se.empty,!0);t.step(r)}function O7(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function L7(t,e,n=e,r=se.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return JC(o,i,r)?new Ur(e,n,r):new A7(o,i,r).fit()}function JC(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}let A7=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ne.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=ne.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new se(i,s,a);return e>-1?new wr(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ur(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=$d(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ne.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=$d(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=$d(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new se(Vs(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new se(Vs(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(ZC(g.mark(p.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?f:-1)))}let m=c==a.childCount;m||(f=-1),this.placed=Ws(this.placed,n,ne.from(u)),this.frontier[n].match=d,m&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n=0;a--){let{match:l,type:c}=this.frontier[a],u=Nd(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ws(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Ws(this.placed,this.depth,ne.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ne.empty,!0);n.childCount&&(this.placed=Ws(this.placed,this.frontier.length,n))}};function Vs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Vs(t.firstChild.content,e-1,n)))}function Ws(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ws(t.lastChild.content,e-1,n)))}function $d(t,e){for(let n=0;n1&&(r=r.replaceChild(0,ZC(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ne.empty,!0)))),t.copy(r)}function Nd(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!P7(n,i.content,s)?a:null}function P7(t,e,n){for(let r=n;r0;p--,f--){let m=o.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(p)>-1?a=p:o.before(p)==f&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],u=r.openStart;for(let p=r.content,f=0;;f++){let m=p.firstChild;if(c.push(m),f==r.openStart)break;p=m.content}for(let p=u-1;p>=0;p--){let f=c[p],m=R7(f.type);if(m&&!f.sameMarkup(o.node(Math.abs(a)-1)))u=p;else if(m||!f.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let f=(p+u+1)%(r.openStart+1),m=c[f];if(m)for(let g=0;g=0&&(t.replace(e,n,r),!(t.steps.length>d));p--){let f=s[p];f<0||(e=o.before(f),n=i.after(f))}}function XC(t,e,n,r,o){if(er){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(ne.empty,!0))}return t}function I7(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=O7(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new se(ne.from(r),0,0))}function $7(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=QC(r,o);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function QC(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(ie.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}let eS=class Bl extends gn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return wn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return wn.fromReplace(e,this.pos,this.pos+1,new se(ne.from(o),0,n.isLeaf?0:1))}getMap(){return ei.empty}invert(e){return new Bl(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Bl(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Bl(n.pos,n.attr,n.value)}};gn.jsonID("attr",eS);let tS=class Zp extends gn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return wn.ok(r)}getMap(){return ei.empty}invert(e){return new Zp(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Zp(n.attr,n.value)}};gn.jsonID("docAttr",tS);let cs=class extends Error{};cs=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};cs.prototype=Object.create(Error.prototype);cs.prototype.constructor=cs;cs.prototype.name="TransformError";let N7=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new qC}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new cs(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=se.empty){let o=L7(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new se(ne.from(r),0,0))}delete(e,n){return this.replace(e,n,se.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return D7(this,e,n,r),this}replaceRangeWith(e,n,r){return I7(this,e,n,r),this}deleteRange(e,n){return $7(this,e,n),this}lift(e,n){return f7(this,e,n),this}join(e,n=1){return T7(this,e,n),this}wrap(e,n){return v7(this,e,n),this}setBlockType(e,n=e,r,o=null){return y7(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return C7(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new eS(e,n,r)),this}setDocAttribute(e,n){return this.step(new tS(e,n)),this}addNodeMark(e,n){return this.step(new sm(e,n)),this}removeNodeMark(e,n){if(!(n instanceof mt)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new am(e,n)),this}split(e,n=1,r){return k7(this,e,n,r),this}addMark(e,n,r){return c7(this,e,n,r),this}removeMark(e,n,r){return u7(this,e,n,r),this}clearIncompatible(e,n,r){return KC(this,e,n,r),this}};const _d=Object.create(null);class Ze{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new _7(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;i--){let s=n<0?Wi(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Wi(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new yr(e.node(0))}static atStart(e){return Wi(e,e,0,0,1)||new yr(e)}static atEnd(e){return Wi(e,e,e.content.size,e.childCount,-1)||new yr(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=_d[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in _d)throw new RangeError("Duplicate use of selection JSON ID "+e);return _d[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ke.between(this.$anchor,this.$head).getBookmark()}}Ze.prototype.visible=!0;class _7{constructor(e,n){this.$from=e,this.$to=n}}let Vy=!1;function Wy(t){!Vy&&!t.parent.inlineContent&&(Vy=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ke extends Ze{constructor(e,n=e){Wy(e),Wy(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ze.near(r);let o=e.resolve(n.map(this.anchor));return new Ke(o.parent.inlineContent?o:r,r)}replace(e,n=se.empty){if(super.replace(e,n),n==se.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ke&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Pu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ke(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Ze.findFrom(n,r,!0)||Ze.findFrom(n,-r,!0);if(i)n=i.$head;else return Ze.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Ze.findFrom(e,-r,!0)||Ze.findFrom(e,r,!0)).$anchor,e.pos0?0:1);o>0?s=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&Ve.isSelectable(a))return Ve.create(t,n-(o<0?a.nodeSize:0))}else{let l=Wi(t,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function Uy(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=u)}),t.setSelection(Ze.near(t.doc.resolve(s),n))}const Gy=1,Sl=2,qy=4;class B7 extends N7{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Sl,this}ensureMarks(e){return mt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Sl)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Sl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||mt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(Ze.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=qy,this}get scrolledIntoView(){return(this.updated&qy)>0}}function Ky(t,e){return!e||!t?t:t.bind(e)}class Us{constructor(e,n,r){this.name=e,this.init=Ky(n.init,r),this.apply=Ky(n.apply,r)}}const j7=[new Us("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Us("selection",{init(t,e){return t.selection||Ze.atStart(e.doc)},apply(t){return t.selection}}),new Us("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Us("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Fd{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=j7.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Us(r.key,r.spec.state,r))})}}class Xi{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new Fd(e.schema,e.plugins),i=new Xi(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=Ko.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=Ze.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,e,n[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function nS(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=nS(o,e,{})),n[r]=o}return n}class vn{constructor(e){this.spec=e,this.props={},e.props&&nS(e.props,this,this.props),this.key=e.key?e.key.key:rS("plugin")}getState(e){return e[this.key]}}const Bd=Object.create(null);function rS(t){return t in Bd?t+"$"+ ++Bd[t]:(Bd[t]=0,t+"$")}class Gn{constructor(e="key"){this.key=rS(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ln=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},xa=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Xp=null;const zr=function(t,e,n){let r=Xp||(Xp=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},z7=function(){Xp=null},ti=function(t,e,n,r){return n&&(Yy(t,e,n,r,-1)||Yy(t,e,n,r,1))},H7=/^(img|br|input|textarea|hr)$/i;function Yy(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:sr(t))){let i=t.parentNode;if(!i||i.nodeType!=1||Ya(t)||H7.test(t.nodeName)||t.contentEditable=="false")return!1;e=ln(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?sr(t):0}else return!1}}function sr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function V7(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=sr(t)}else if(t.parentNode&&!Ya(t))e=ln(t),t=t.parentNode;else return null}}function W7(t,e){for(;;){if(t.nodeType==3&&e2),rr=us||(Pr?/Mac/.test(Pr.platform):!1),K7=Pr?/Win/.test(Pr.platform):!1,pr=/Android \d/.test(Oo),Ja=!!Jy&&"webkitFontSmoothing"in Jy.documentElement.style,Y7=Ja?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function J7(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Br(t,e){return typeof t=="number"?t:t[e]}function Z7(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Zy(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;s=xa(s)){if(s.nodeType!=1)continue;let a=s,l=a==i.body,c=l?J7(i):Z7(a),u=0,d=0;if(e.topc.bottom-Br(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Br(o,"top")-c.top:e.bottom-c.bottom+Br(o,"bottom")),e.leftc.right-Br(r,"right")&&(u=e.right-c.right+Br(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let p=a.scrollLeft,f=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let m=a.scrollLeft-p,g=a.scrollTop-f;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function X7(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:sS(t.dom)}}function sS(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=xa(r));return e}function Q7({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;aS(n,r==0?0:r-e)}function aS(t,e){for(let n=0;n=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?tG(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:lS(n,o)}function tG(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function cm(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function nG(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function oG(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?o=a.posBefore:(!s&&l.right-1?o:t.docView.posFromDOM(e,n,-1)}function cS(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&o++}let c;Ja&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=oG(t,r,o,e))}a==null&&(a=rG(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Xy(t){return t.top=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Ds(oo(zr(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==sr(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return jd(l.getBoundingClientRect(),!1)}if(i==null&&o=0)}if(i==null&&o&&(n<0||o==sr(r))){let l=r.childNodes[o-1],c=l.nodeType==3?zr(l,sr(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Ds(oo(c,1),!1)}if(i==null&&o=0)}function Ds(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function jd(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function dS(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function aG(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return dS(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=uS(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=zr(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const lG=/[\u0590-\u08ac]/;function cG(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?!lG.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:dS(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),p=a.caretBidiLevel;a.modify("move",n,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!f.contains(m.nodeType==1?m:m.parentNode)||l==m&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return p!=null&&(a.caretBidiLevel=p),y}):r.pos==r.start()||r.pos==r.end()}let Qy=null,eb=null,tb=!1;function uG(t,e,n){return Qy==e&&eb==n?tb:(Qy=e,eb=n,tb=n=="up"||n=="down"?aG(t,e,n):cG(t,e,n))}const ar=0,nb=1,jo=2,Rr=3;class Za{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=ar,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nln(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof fS){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof pS&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?ln(i.dom)+1:0}}else{let i,s=!0;for(;i=r=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let d=a;d>0;d--){let p=this.children[d-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){o=ln(p.dom)+1;break}e-=p.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;uf&&sn){let f=a;a=l,l=f}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o=r:er){let a=r+i.border,l=s-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?jo:nb,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Rr:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?jo:Rr}r=s}this.dirty=jo}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?jo:nb;n.dirty{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==ar&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class dG extends Za{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ni extends Za{constructor(e,n,r,o){super(e,[],r,o),this.mark=n}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=mi.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new ni(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Rr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Rr&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=ar){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=rf(i,0,e,r));for(let a=0;a{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=mi.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let p=u;return u=gS(u,r,n),c?l=new pG(e,n,r,o,u,d||null,p,c,i,s+1):n.isText?new Du(e,n,r,o,u,p,i):new vo(e,n,r,o,u,d||null,p,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ne.empty)}return e}matchesNode(e,n,r){return this.dirty==ar&&e.eq(this.node)&&xc(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new hG(this,s&&s.node,e);vG(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?mt.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,d,p)=>{l.syncToMarks(c.marks,r,e);let f;l.findNodeMatch(c,u,d,p)||a&&e.state.selection.from>o&&e.state.selection.to-1&&l.updateNodeAt(c,u,d,f,e)||l.updateNextNode(c,u,d,e,p,o)||l.addNode(c,u,d,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==jo)&&(s&&this.protectLocalComposition(e,s),hS(this.contentDOM,this.children,e),us&&yG(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Ke)||rn+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=bG(this.node.content,s,r-n,o-n);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new dG(this,i,n,o);e.input.compositionNodes.push(s),this.children=rf(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==Rr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=ar}updateOuterDeco(e){if(xc(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=mS(this.dom,this.nodeDOM,nf(this.outerDeco,this.node,n),nf(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function rb(t,e,n,r,o){gS(r,e,t);let i=new vo(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class Du extends vo{constructor(e,n,r,o,i,s,a){super(e,n,r,o,i,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==Rr||this.dirty!=ar&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=ar||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=ar,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new Du(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Rr)}get domAtom(){return!1}isText(e){return this.node.text==e}}class fS extends Za{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==ar&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class pG extends vo{constructor(e,n,r,o,i,s,a,l,c,u){super(e,n,r,o,i,s,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==Rr)return!1;if(this.spec.update){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function hS(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i>1,s=Math.min(i,e.length);for(;o-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=ni.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof ni)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function gG(t,e){return t.type.side-e.type.side}function vG(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;ci;)a.push(o[s++]);let m=i+p.nodeSize;if(p.isText){let y=m;s!y.inline):a.slice();r(p,g,e.forChild(i,p),f),i=m}}function yG(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function bG(t,e,n,r){for(let o=0,i=0;o=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function rf(t,e,n,r,o){let i=[];for(let s=0,a=0;s=n||u<=e?i.push(l):(cn&&i.push(l.slice(n-c,l.size,r)))}return i}function um(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(Ru(n)){for(l=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&Ve.isSelectable(d)&&o.parent&&!(d.isInline&&U7(n.focusNode,n.focusOffset,o.dom))){let p=o.posBefore;c=new Ve(s==p?a:r.resolve(p))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,p=s;for(let f=0;f{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!vS(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function wG(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setStart(r.parentNode,ln(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&An&&go<=11&&(r.disabled=!0,r.disabled=!1)}function yS(t,e){if(e instanceof Ve){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(lb(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else lb(t)}function lb(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function dm(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Ke.between(e,n,r)}function cb(t){return t.editable&&!t.hasFocus()?!1:bS(t)}function bS(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function CG(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ti(e.node,e.offset,n.anchorNode,n.anchorOffset)}function of(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Ze.findFrom(i,e)}function ao(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function ub(t,e,n){let r=t.state.selection;if(r instanceof Ke)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return ao(t,new Ke(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=of(t.state,e);return o&&o instanceof Ve?ao(t,o):!1}else if(!(rr&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?Ve.isSelectable(i)?ao(t,new Ve(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):Ja?ao(t,new Ke(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Ve&&r.node.isInline)return ao(t,new Ke(e>0?r.$to:r.$from));{let o=of(t.state,e);return o?ao(t,o):!1}}}function wc(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function aa(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Si(t,e){return e<0?SG(t):kG(t)}function SG(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(br&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(aa(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(xS(n))break;{let a=n.previousSibling;for(;a&&aa(a,-1);)o=n.parentNode,i=ln(a),a=a.previousSibling;if(a)n=a,r=wc(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?sf(t,n,r):o&&sf(t,o,i)}function kG(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=wc(n),i,s;for(;;)if(r{t.state==o&&Vr(t)},50)}function db(t,e){let n=t.state.doc.resolve(e);if(!(mn||K7)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s1)return i.lefto.top&&s1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function pb(t,e,n){let r=t.state.selection;if(r instanceof Ke&&!r.empty||n.indexOf("s")>-1||rr&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=of(t.state,e);if(s&&s instanceof Ve)return ao(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof yr?Ze.near(s,e):Ze.findFrom(s,e);return a?ao(t,a):!1}return!1}function fb(t,e){if(!(t.state.selection instanceof Ke))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function hb(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function TG(t){if(!Sn||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;hb(t,r,"true"),setTimeout(()=>hb(t,r,"false"),20)}return!1}function OG(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function LG(t,e){let n=e.keyCode,r=OG(e);if(n==8||rr&&n==72&&r=="c")return fb(t,-1)||Si(t,-1);if(n==46&&!e.shiftKey||rr&&n==68&&r=="c")return fb(t,1)||Si(t,1);if(n==13||n==27)return!0;if(n==37||rr&&n==66&&r=="c"){let o=n==37?db(t,t.state.selection.from)=="ltr"?-1:1:-1;return ub(t,o,r)||Si(t,o)}else if(n==39||rr&&n==70&&r=="c"){let o=n==39?db(t,t.state.selection.from)=="ltr"?1:-1:1;return ub(t,o,r)||Si(t,o)}else{if(n==38||rr&&n==80&&r=="c")return pb(t,-1,r)||Si(t,-1);if(n==40||rr&&n==78&&r=="c")return TG(t)||pb(t,1,r)||Si(t,1);if(r==(rr?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function wS(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let s=t.someProp("clipboardSerializer")||mi.fromSchema(t.state.schema),a=TS(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=ES[c.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let m=a.createElement(u[f]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let p=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,` `);return{dom:l,text:p,slice:e}}function CS(t,e,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",p=>{e=p(e,i||r,t)}),i)return e?new se(ne.from(t.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):se.empty;let d=t.someProp("clipboardTextParser",p=>p(e,o,r,t));if(d)a=d;else{let p=o.marks(),{schema:f}=t.state,m=mi.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(f.text(g,p)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=DG(n),Ja&&IG(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||oa.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!AG.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)a=$G(mb(a,+u[1],+u[2]),u[4]);else if(a=se.maxOpen(PG(a.content,o),!0),a.openStart||a.openEnd){let d=0,p=0;for(let f=a.content.firstChild;d{a=d(a,t)}),a}const AG=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function PG(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&kS(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=MS(s[s.length-1],i.length));let u=SS(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return ne.from(s)}return t}function SS(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ne.from(t));return t}function kS(t,e,n,r,o){if(o1&&(i=0),o=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ne.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function mb(t,e,n){return en}).createHTML(t):t}function DG(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=TS().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&ES[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"").reverse().join("")),n.innerHTML=RG(t),o)for(let i=0;i=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=ne.from(l.create(r[a+1],o)),i++,s++}return new se(o,i,s)}const kn={},Mn={},NG={touchstart:!0,touchmove:!0};class _G{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function FG(t){for(let e in kn){let n=kn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{jG(t,r)&&!pm(t,r)&&(t.editable||!(r.type in Mn))&&n(t,r)},NG[e]?{passive:!0}:void 0)}Sn&&t.dom.addEventListener("input",()=>null),af(t)}function fo(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function BG(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function af(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>pm(t,r))})}function pm(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function jG(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function zG(t,e){!pm(t,e)&&kn[e.type]&&(t.editable||!(e.type in Mn))&&kn[e.type](t,e)}Mn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!LS(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(pr&&mn&&n.keyCode==13)))if(t.domObserver.selectionChanged(t.domSelectionRange())?t.domObserver.flush():n.keyCode!=229&&t.domObserver.forceFlush(),us&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,_o(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||LG(t,n)?n.preventDefault():fo(t,"key")};Mn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Mn.keypress=(t,e)=>{let n=e;if(LS(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||rr&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Ke)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function Du(t){return{left:t.clientX,top:t.clientY}}function HG(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function fm(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,n,i.nodeAfter,i.before(s),o,!0):a(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function rs(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function VG(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Ve.isSelectable(r)?(rs(t,new Ve(n)),!0):!1}function WG(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Ve&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(Ve.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(rs(t,Ve.create(t.state.doc,o)),!0):!1}function UG(t,e,n,r,o){return fm(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?WG(t,n):VG(t,n))}function GG(t,e,n,r){return fm(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function qG(t,e,n,r){return fm(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||KG(t,n,r)}function KG(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(rs(t,Ke.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)rs(t,Ke.create(r,a+1,a+1+s.content.size));else if(Ve.isSelectable(s))rs(t,Ve.create(r,a));else continue;return!0}}function hm(t){return Cc(t)}const OS=rr?"metaKey":"ctrlKey";kn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=hm(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&HG(n,t.input.lastClick)&&!n[OS]&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(Du(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new YG(t,s,n,!!r)):(i=="doubleClick"?GG:qG)(t,s.pos,s.inside,n)?n.preventDefault():fo(t,"pointer"))};class YG{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[OS],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Ve&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&br&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),fo(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Vr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Du(e))),this.updateAllowDefault(e),this.allowDefault||!n?fo(this.view,"pointer"):UG(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Sn&&this.mightDrag&&!this.mightDrag.node.isAtom||mn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(rs(this.view,Ze.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):fo(this.view,"pointer")}move(e){this.updateAllowDefault(e),fo(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}kn.touchstart=t=>{t.input.lastTouch=Date.now(),hm(t),fo(t,"pointer")};kn.touchmove=t=>{t.input.lastTouch=Date.now(),fo(t,"pointer")};kn.contextmenu=t=>hm(t);function LS(t,e){return t.composing?!0:Sn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const JG=pr?5e3:-1;Mn.compositionstart=Mn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Ke&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Cc(t,!0),t.markCursor=null;else if(Cc(t,!e.selection.empty),br&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}AS(t,JG)};Mn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,AS(t,20))};function AS(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Cc(t),e))}function PS(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=XG());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function ZG(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=V7(e.focusNode,e.focusOffset),r=W7(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function XG(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Cc(t,e=!1){if(!(pr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),PS(t),e||t.docView&&t.docView.dirty){let n=um(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function QG(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const wa=An&&go<15||us&&Y7<604;kn.copy=Mn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=wa?null:n.clipboardData,s=r.content(),{dom:a,text:l}=wS(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):QG(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function eq(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function tq(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ca(t,r.value,null,o,e):Ca(t,r.textContent,r.innerHTML,o,e)},50)}function Ca(t,e,n,r,o){let i=CS(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||se.empty)))return!0;if(!i)return!1;let s=eq(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function RS(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Mn.paste=(t,e)=>{let n=e;if(t.composing&&!pr)return;let r=wa?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Ca(t,RS(r),r.getData("text/html"),o,n)?n.preventDefault():tq(t,n)};class DS{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const IS=rr?"altKey":"ctrlKey";kn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(Du(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof Ve?o.to-1:o.to))){if(r&&r.mightDrag)s=Ve.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=Ve.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=wS(t,a);(!n.dataTransfer.files.length||!mn||iS>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(wa?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",wa||n.dataTransfer.setData("text/plain",c),t.dragging=new DS(u,!n[IS],s)};kn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Mn.dragover=Mn.dragenter=(t,e)=>e.preventDefault();Mn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(Du(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t)}):s=CS(t,RS(n.dataTransfer),wa?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[IS]);if(t.someProp("handleDrop",m=>m(t,n,s||se.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?YC(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let f=c.doc.resolve(u);if(d&&Ve.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ve(f));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,y,b,x)=>m=x),c.setSelection(dm(t,f,c.doc.resolve(m)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};kn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Vr(t)},20))};kn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};kn.beforeinput=(t,e)=>{if(mn&&pr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,_o(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in Mn)kn[t]=Mn[t];function Sa(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Sc{constructor(e,n){this.toDOM=e,this.spec=n||Yo,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new vr(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Sc&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Sa(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class yo{constructor(e,n){this.attrs=e,this.spec=n||Yo}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new vr(i,s,this)}valid(e,n){return n.from=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;se){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,o+a,i)}}map(e,n,r){return this==hn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Yo)}mapInner(e,n,r,o,i){let s;for(let a=0;a{let c=l+r,u;if(u=NS(n,a,c)){for(o||(o=this.children.slice());ia&&d.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,s=i+n.content.size;for(let a=0;ai&&l.type instanceof yo){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;co.map(e,n,Yo));return uo.from(r)}forChild(e,n){if(n.isLeaf)return tn.empty;let r=[];for(let o=0;on instanceof tn)?e:e.reduce((n,r)=>n.concat(r instanceof tn?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let y=g-m-(f-p);for(let b=0;bx+u-d)continue;let S=a[b]+u-d;f>=S?a[b+1]=p<=S?-2:-1:p>=u&&y&&(a[b]+=y,a[b+1]+=y)}d+=y}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let p=n.map(t[c+1]+i,-1),f=p-o,{index:m,offset:g}=r.content.findIndex(d),y=r.maybeChild(m);if(y&&g==d&&g+y.nodeSize==f){let b=a[c+2].mapInner(n,y,u+1,t[c]+i+1,s);b!=hn?(a[c]=d,a[c+1]=f,a[c+2]=b):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=rq(a,t,e,n,o,i,s),u=kc(c,r,0,s);e=u.local;for(let d=0;dn&&s.to{let c=NS(t,a,l+n);if(c){i=!0;let u=kc(c,a,n+l+1,r);u!=hn&&o.push(l,l+a.nodeSize,u)}});let s=$S(i?_S(t):t,-n).sort(Jo);for(let a=0;a0;)e++;t.splice(e,0,n)}function zd(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=hn&&e.push(r)}),t.cursorWrapper&&e.push(tn.create(t.state.doc,[t.cursorWrapper.deco])),uo.from(e)}const oq={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},iq=An&&go<=11;class sq{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class aq{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new sq,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),iq&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,oq)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(cb(this.view)){if(this.suppressingSelectionUpdates)return Vr(this.view);if(An&&go<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ti(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=xa(i))n.add(i);for(let i=e.anchorNode;i;i=xa(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}selectionChanged(e){return!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&cb(this.view)&&!this.ignoreSelectionChange(e)}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=this.selectionChanged(r),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;ud.nodeName=="BR");if(u.length==2){let[d,p]=u;d.parentNode&&d.parentNode.parentNode==p.parentNode?p.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let p of u){let f=p.parentNode;f&&f.nodeName=="LI"&&(!d||uq(e,d)!=f)&&p.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||o)&&(i>-1&&(e.docView.markDirty(i,s),lq(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Vr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;uo;y--){let b=r.childNodes[y-1],x=b.pmViewDesc;if(b.nodeName=="BR"&&!x){i=y;break}if(!x||x.size)break}let d=t.state.doc,p=t.someProp("domParser")||oa.fromSchema(t.state.schema),f=d.resolve(s),m=null,g=p.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:pq,context:f});if(c&&c[0].pos!=null){let y=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=y),m={anchor:y+s,head:b+s}}return{doc:g,sel:m,from:s,to:a}}function pq(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Sn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Sn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const fq=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function hq(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let D=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=um(t,D);if(P&&!t.state.selection.eq(P)){if(mn&&pr&&t.input.lastKeyCode===13&&Date.now()-100N(t,_o(13,"Enter"))))return;let U=t.state.tr.setSelection(P);D=="pointer"?U.setMeta("pointer",!0):D=="key"&&U.scrollIntoView(),i&&U.setMeta("composition",i),t.dispatch(U)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=dq(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),p,f;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||pr)&&o.some(D=>D.nodeType==1&&!fq.test(D.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",D=>D(t,_o(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof Ke&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let D=wb(t,t.state.doc,c.sel);if(D&&!D.eq(t.state.selection)){let P=t.state.tr.setSelection(D);i&&P.setMeta("composition",i),t.dispatch(P)}}return}t.state.selection.fromt.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),An&&go<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),y=c.doc.resolveNoCache(m.endB-c.from),b=u.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA,S;if((us&&t.input.lastIOSEnter>Date.now()-225&&(!x||o.some(D=>D.nodeName=="DIV"||D.nodeName=="P"))||!x&&g.posD(t,_o(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&gq(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",D=>D(t,_o(8,"Backspace")))){pr&&mn&&t.domObserver.suppressSelectionUpdates();return}mn&&pr&&m.endB==m.start&&(t.input.lastAndroidDelete=Date.now()),pr&&!x&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,y=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(D){return D(t,_o(13,"Enter"))})},20));let E=m.start,k=m.endA,w,M,T;if(x){if(g.pos==y.pos)An&&go<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Vr(t),20)),w=t.state.tr.delete(E,k),M=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(T=mq(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start()))))w=t.state.tr,T.type=="add"?w.addMark(E,k,T.mark):w.removeMark(E,k,T.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let D=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",P=>P(t,E,k,D)))return;w=t.state.tr.insertText(D,E,k)}}if(w||(w=t.state.tr.replace(E,k,c.doc.slice(m.start-c.from,m.endB-c.from))),c.sel){let D=wb(t,w.doc,c.sel);D&&!(mn&&pr&&t.composing&&D.empty&&(m.start!=m.endB||t.input.lastAndroidDeletee.content.size?null:dm(t,e.resolve(n.anchor),e.resolve(n.head))}function mq(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;un||Hd(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function vq(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s=s?i-r:0;i-=l,i&&i=a?i-r:0;i-=l,i&&i=56320&&e<=57343&&n>=55296&&n<=56319}class yq{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new _G,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Tb),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Mb(this),kb(this),this.nodeViews=Eb(this),this.docView=rb(this.state.doc,Sb(this),zd(this),this.dom,this),this.domObserver=new aq(this,(r,o,i,s)=>hq(this,r,o,i,s)),this.domObserver.start(),FG(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&af(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Tb),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(PS(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=Eb(this);xq(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&af(this),this.editable=Mb(this),kb(this);let l=zd(this),c=Sb(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(o.selection))&&(s=!0);let p=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&X7(this);if(s){this.domObserver.stop();let f=d&&(An||mn)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&bq(o.selection,e.selection);if(d){let m=mn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ZG(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=rb(e.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&CG(this))?Vr(this,f):(yS(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():p&&Q7(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Ve){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Zy(this,n.getBoundingClientRect(),e)}else Zy(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new DS(e.slice,e.move,o<0?void 0:Ve.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return iG(this,e)}coordsAtPos(e,n=1){return uS(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return uG(this,n||this.state,e)}pasteHTML(e,n){return Ca(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Ca(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(BG(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],zd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,z7())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return zG(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Sn&&this.root.nodeType===11&&G7(this.dom.ownerDocument)==this.dom&&cq(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Sb(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[vr.node(0,t.state.doc.content.size,e)]}function kb(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:vr.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Mb(t){return!t.someProp("editable",e=>e(t.state)===!1)}function bq(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Eb(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function xq(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Tb(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var So={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Mc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},wq=typeof navigator<"u"&&/Mac/.test(navigator.platform),Cq=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var cn=0;cn<10;cn++)So[48+cn]=So[96+cn]=String(cn);for(var cn=1;cn<=24;cn++)So[cn+111]="F"+cn;for(var cn=65;cn<=90;cn++)So[cn]=String.fromCharCode(cn+32),Mc[cn]=String.fromCharCode(cn);for(var Vd in So)Mc.hasOwnProperty(Vd)||(Mc[Vd]=So[Vd]);function Sq(t){var e=wq&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Cq&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Mc:So)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const kq=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Mq(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a127)&&(i=So[r.keyCode])&&i!=o){let a=e[Wd(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const FS=65535,BS=Math.pow(2,16);function Lq(t,e){return t+e*BS}function Ob(t){return t&FS}function Aq(t){return(t-(t&FS))/BS}const jS=1,zS=2,jl=4,HS=8;let lf=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&HS)>0}get deletedBefore(){return(this.delInfo&(jS|jl))>0}get deletedAfter(){return(this.delInfo&(zS|jl))>0}get deletedAcross(){return(this.delInfo&jl)>0}},ri=class Gi{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Gi.empty)return Gi.empty}recover(e){let n=0,r=Ob(e);if(!this.inverted)for(let o=0;oe)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let p=c?e==l?-1:e==d?1:n:n,f=l+o+(p<0?0:u);if(r)return f;let m=e==(n<0?l:d)?null:Lq(a/3,e-l),g=e==l?zS:e==d?jS:jl;return(n<0?e!=l:e!=d)&&(g|=HS),new lf(f,g,m)}o+=u-c}return r?e+o:new lf(e+o,0,null)}touches(e,n){let r=0,o=Ob(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;n--){let o=e.getMirror(n);this.appendMap(e.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new la;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ri&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return Cn.fromReplace(e,this.from,this.to,i)}invert(){return new Xa(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new qs(n.pos,r.pos,this.mark)}merge(e){return e instanceof qs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new qs(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new qs(n.from,n.to,e.markFromJSON(n.mark))}};yn.jsonID("addMark",ym);let Xa=class Ks extends yn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new se(vm(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Cn.fromReplace(e,this.from,this.to,r)}invert(){return new ym(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ks(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ks&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ks(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ks(n.from,n.to,e.markFromJSON(n.mark))}};yn.jsonID("removeMark",Xa);let bm=class Ys extends yn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Cn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Cn.fromReplace(e,this.pos,this.pos+1,new se(ne.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;or.pos?null:new zl(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new zl(n.from,n.to,n.gapFrom,n.gapTo,se.fromJSON(e,n.slice),n.insert,!!n.structure)}};yn.jsonID("replaceAround",gi);function uf(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function Pq(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,e),f=Math.min(c+l.nodeSize,n),m=r.addToSet(d);for(let g=0;gt.step(l)),i.forEach(l=>t.step(l))}function Rq(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof qa){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;ut.step(new Xa(s.from,s.to,s.style)))}function wm(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)t.step(s[l])}function Dq(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Iq(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;m--)g||r.index(m)>0?(g=!0,u=ne.from(r.node(m).copy(u)),d++):l--;let p=ne.empty,f=0;for(let m=i,g=!1;m>n;m--)g||o.after(m+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ne.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new gi(o,i,o,i,new se(r,0,0),n.length,!0))}function jq(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&zq(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!m?c=!1:!f&&m&&(c=!0)}c===!1&&WS(t,s,a,i),wm(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let u=t.mapping.slice(i),d=u.map(a,1),p=u.map(a+s.nodeSize,1);return t.step(new gi(d,p,d+1,p-1,new se(ne.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&VS(t,s,a,i),!1}})}function VS(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function WS(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(` -`))}})}function zq(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function Hq(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new gi(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new se(ne.from(s),0,0),1,!0))}function Hl(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),p=o.index(c);if(d.type.spec.isolating)return!1;let f=d.content.cutByIndex(p,d.childCount),m=r&&r[u+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||d;if(!d.canReplace(p+1,d.childCount)||!g.type.validContent(f))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function Vq(t,e,n=1,r){let o=t.doc.resolve(e),i=ne.empty,s=ne.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=ne.from(o.node(a).copy(i));let u=r&&r[c];s=ne.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new Gr(e,e,new se(i.append(s),n,n),!0))}function Cm(t,e){let n=t.resolve(e),r=n.index();return US(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Wq(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&US(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function Uq(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",d=!!s.contentMatch.matchType(o);u&&!d?r=!1:!u&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);WS(t,u.node(),u.before(),a)}s.inlineContent&&wm(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Gr(c,l.map(e+n,-1),se.empty,!0)),r===!0){let u=t.doc.resolve(c);VS(t,u.node(),u.before(),t.steps.length)}return t}function Gq(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i0;o--)this.placed=ne.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new se(i,s,a);return e>-1?new gi(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Gr(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Gd(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ne.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Gd(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Gd(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new se(Js(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new se(Js(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(KS(g.mark(p.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?f:-1)))}let m=c==a.childCount;m||(f=-1),this.placed=Zs(this.placed,n,ne.from(u)),this.frontier[n].match=d,m&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n=0;a--){let{match:l,type:c}=this.frontier[a],u=qd(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Zs(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Zs(this.placed,this.depth,ne.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ne.empty,!0);n.childCount&&(this.placed=Zs(this.placed,this.frontier.length,n))}};function Js(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Js(t.firstChild.content,e-1,n)))}function Zs(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Zs(t.lastChild.content,e-1,n)))}function Gd(t,e){for(let n=0;n1&&(r=r.replaceChild(0,KS(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ne.empty,!0)))),t.copy(r)}function qd(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!Yq(n,i.content,s)?a:null}function Yq(t,e,n){for(let r=n;r0;p--,f--){let m=o.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(p)>-1?a=p:o.before(p)==f&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],u=r.openStart;for(let p=r.content,f=0;;f++){let m=p.firstChild;if(c.push(m),f==r.openStart)break;p=m.content}for(let p=u-1;p>=0;p--){let f=c[p],m=Jq(f.type);if(m&&!f.sameMarkup(o.node(Math.abs(a)-1)))u=p;else if(m||!f.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let f=(p+u+1)%(r.openStart+1),m=c[f];if(m)for(let g=0;g=0&&(t.replace(e,n,r),!(t.steps.length>d));p--){let f=s[p];f<0||(e=o.before(f),n=i.after(f))}}function YS(t,e,n,r,o){if(er){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(ne.empty,!0))}return t}function Xq(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=Gq(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new se(ne.from(r),0,0))}function Qq(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=JS(r,o);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function JS(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(ie.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}let ZS=class Vl extends yn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Cn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Cn.fromReplace(e,this.pos,this.pos+1,new se(ne.from(o),0,n.isLeaf?0:1))}getMap(){return ri.empty}invert(e){return new Vl(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Vl(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Vl(n.pos,n.attr,n.value)}};yn.jsonID("attr",ZS);let XS=class df extends yn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Cn.ok(r)}getMap(){return ri.empty}invert(e){return new df(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new df(n.attr,n.value)}};yn.jsonID("docAttr",XS);let ds=class extends Error{};ds=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};ds.prototype=Object.create(Error.prototype);ds.prototype.constructor=ds;ds.prototype.name="TransformError";class eK{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new la}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ds(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=se.empty){let o=qq(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new se(ne.from(r),0,0))}delete(e,n){return this.replace(e,n,se.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Zq(this,e,n,r),this}replaceRangeWith(e,n,r){return Xq(this,e,n,r),this}deleteRange(e,n){return Qq(this,e,n),this}lift(e,n){return $q(this,e,n),this}join(e,n=1){return Uq(this,e,n),this}wrap(e,n){return Bq(this,e,n),this}setBlockType(e,n=e,r,o=null){return jq(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return Hq(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new ZS(e,n,r)),this}setDocAttribute(e,n){return this.step(new XS(e,n)),this}addNodeMark(e,n){return this.step(new bm(e,n)),this}removeNodeMark(e,n){if(!(n instanceof mt)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new xm(e,n)),this}split(e,n=1,r){return Vq(this,e,n,r),this}addMark(e,n,r){return Pq(this,e,n,r),this}removeMark(e,n,r){return Rq(this,e,n,r),this}clearIncompatible(e,n,r){return wm(this,e,n,r),this}}const QS=65535,ek=Math.pow(2,16);function tK(t,e){return t+e*ek}function Ab(t){return t&QS}function nK(t){return(t-(t&QS))/ek}const tk=1,nk=2,Wl=4,rk=8;class Pb{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&rk)>0}get deletedBefore(){return(this.delInfo&(tk|Wl))>0}get deletedAfter(){return(this.delInfo&(nk|Wl))>0}get deletedAcross(){return(this.delInfo&Wl)>0}}class Vn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Vn.empty)return Vn.empty}recover(e){let n=0,r=Ab(e);if(!this.inverted)for(let o=0;oe)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let p=c?e==l?-1:e==d?1:n:n,f=l+o+(p<0?0:u);if(r)return f;let m=e==(n<0?l:d)?null:tK(a/3,e-l),g=e==l?nk:e==d?tk:Wl;return(n<0?e!=l:e!=d)&&(g|=rk),new Pb(f,g,m)}o+=u-c}return r?e+o:new Pb(e+o,0,null)}touches(e,n){let r=0,o=Ab(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return Ut.fromReplace(e,this.from,this.to,i)}invert(){return new Vo(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ho(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ho&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ho(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ho(n.from,n.to,e.markFromJSON(n.mark))}}bn.jsonID("addMark",Ho);class Vo extends bn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new se(Sm(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Ut.fromReplace(e,this.from,this.to,r)}invert(){return new Ho(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Vo(n.pos,r.pos,this.mark)}merge(e){return e instanceof Vo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Vo(n.from,n.to,e.markFromJSON(n.mark))}}bn.jsonID("removeMark",Vo);class Wo extends bn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ut.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ut.fromReplace(e,this.pos,this.pos+1,new se(ne.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;or.pos?null:new bo(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bo(n.from,n.to,n.gapFrom,n.gapTo,se.fromJSON(e,n.slice),n.insert,!!n.structure)}}bn.jsonID("replaceAround",bo);function pf(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function rK(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Iu(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(ri;l--,c--){let u=o.node(l),d=o.index(l);if(u.type.spec.isolating)return!1;let p=u.content.cutByIndex(d,u.childCount),f=u;if(!u.canReplace(d+1,u.childCount)||!f.type.validContent(p))return!1}let a=o.indexAfter(i);return o.node(i).canReplaceWith(a,a,o.node(i+1).type)}function $u(t,e){let n=t.resolve(e),r=n.index();return ok(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function lK(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&ok(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function km(t,e,n=e,r=se.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return cK(o,i,r)?new fr(e,n,r):new uK(o,i,r).fit()}function cK(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class uK{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ne.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=ne.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new se(i,s,a);return e>-1?new bo(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new fr(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Yd(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ne.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Yd(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Yd(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new se(Xs(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new se(Xs(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(sk(g.mark(p.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?f:-1)))}let m=c==a.childCount;m||(f=-1),this.placed=Qs(this.placed,n,ne.from(u)),this.frontier[n].match=d,m&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n=0;a--){let{match:l,type:c}=this.frontier[a],u=Jd(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Qs(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Qs(this.placed,this.depth,ne.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ne.empty,!0);n.childCount&&(this.placed=Qs(this.placed,this.frontier.length,n))}}function Xs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Xs(t.firstChild.content,e-1,n)))}function Qs(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Qs(t.lastChild.content,e-1,n)))}function Yd(t,e){for(let n=0;n1&&(r=r.replaceChild(0,sk(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ne.empty,!0)))),t.copy(r)}function Jd(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!dK(n,i.content,s)?a:null}function dK(t,e,n){for(let r=n;rt.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function ak(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const fK=(t,e,n)=>{let r=ak(t,n);if(!r)return!1;let o=Mm(r);if(!o){let s=r.blockRange(),a=s&&Iu(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(dk(t,o,e,-1))return!0;if(r.parent.content.size==0&&(ps(i,"end")||Ve.isSelectable(i)))for(let s=r.depth;;s--){let a=km(t.doc,r.before(s),r.after(s),se.empty);if(a&&a.slice.size1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},hK=(t,e,n)=>{let r=ak(t,n);if(!r)return!1;let o=Mm(r);return o?lk(t,o,e):!1},mK=(t,e,n)=>{let r=ck(t,n);if(!r)return!1;let o=Em(r);return o?lk(t,o,e):!1};function lk(t,e,n){let r=e.nodeBefore,o=r,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=km(t.doc,i,l,se.empty);if(!c||c.from!=i||c instanceof fr&&c.slice.size>=l-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(Ke.create(u.doc,i)),n(u.scrollIntoView())}return!0}function ps(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const gK=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Mm(r)}let s=i&&i.nodeBefore;return!s||!Ve.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Ve.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function Mm(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function ck(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=ck(t,n);if(!r)return!1;let o=Em(r);if(!o)return!1;let i=o.nodeAfter;if(dk(t,o,e,1))return!0;if(r.parent.content.size==0&&(ps(i,"start")||Ve.isSelectable(i))){let s=km(t.doc,r.before(),r.after(),se.empty);if(s&&s.slice.size{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof Ve,o;if(r){if(n.node.isTextblock||!$u(t.doc,n.from))return!1;o=n.from}else if(o=ik(t.doc,n.from,-1),o==null)return!1;if(e){let i=t.tr.join(o);r&&i.setSelection(Ve.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},xK=(t,e)=>{let n=t.selection,r;if(n instanceof Ve){if(n.node.isTextblock||!$u(t.doc,n.to))return!1;r=n.to}else if(r=ik(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},wK=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&Iu(o);return i==null?!1:(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)},CK=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function uk(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=uk(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Ze.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},kK=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof yr||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=uk(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(aK(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Iu(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},EK=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(Ve.create(t.doc,o))),!0)};function TK(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||$u(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function dk(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&TK(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,m=ne.empty;for(let b=s.length-1;b>=0;b--)m=ne.from(s[b].create(null,m));m=ne.from(o.copy(m));let g=t.tr.step(new bo(e.pos-1,f,e.pos,f,new se(m,1,0),s.length,!0)),y=g.doc.resolve(f+2*s.length);y.nodeAfter&&y.nodeAfter.type==o.type&&$u(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&l?null:Ze.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),p=d&&Iu(d);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(d,p).scrollIntoView()),!0;if(c&&ps(i,"start",!0)&&ps(o,"end")){let f=o,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let g=i,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(n){let b=ne.empty;for(let S=m.length-1;S>=0;S--)b=ne.from(m[S].copy(b));let x=t.tr.step(new bo(e.pos-m.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new se(b,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function pk(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(Ke.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const OK=pk(-1),LK=pk(1);function AK(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&oK(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Db(t,e=null){return function(n,r){let o=!1;for(let i=0;i{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s=2&&o.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new gc(u,u,s.depth),s.endIndex=0;u--)i=ne.from(n[u].type.create(n[u].attrs,i));t.step(new wr(e.start-(r?2:0),e.end,e.start,e.end,new se(i,0,0),n.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?IK(e,n,t,i):$K(e,n,i):!0:!1}}function IK(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);ig;m--)f-=o.child(m).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?ne.empty:ne.from(o))))return!1;let d=i.pos,p=d+s.nodeSize;return r.step(new wr(d-(a?1:0),p+(l?1:0),d+1,p-1,new se((a?ne.empty:ne.from(o.copy(ne.empty))).append(l?ne.empty:ne.from(o.copy(ne.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function NK(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=ne.from(c?t.create():null),d=new se(ne.from(t.create(null,ne.from(a.type.create(null,u)))),c?3:1,0),p=i.start,f=i.end;n(e.tr.step(new wr(p-(c?3:1),f,p,f,d,1,!0)).scrollIntoView())}return!0}}function Nu(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class _u{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const d=l(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],l=!!e,c=e||i.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(p=>p===!0)),d={...Object.fromEntries(Object.entries(r).map(([p,f])=>[p,(...g)=>{const y=this.buildProps(c,n),b=f(...g)(y);return a.push(b),d}])),run:u};return d}createCan(e){const{rawCommands:n,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:e,editor:o,view:s,state:Nu({state:i,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class _K{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function Ie(t,e,n){return t.config[e]===void 0&&t.parent?Ie(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Ie(t.parent,e,n):null}):t.config[e]}function Fu(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function fk(t){const e=[],{nodeExtensions:n,markExtensions:r}=Fu(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:o},l=Ie(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([p,f])=>{e.push({type:d,name:p,attribute:{...i,...f}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=Ie(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,d])=>{const p={...i,...d};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,e.push({type:s.name,name:u,attribute:p})})}),e}function on(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function It(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const a=i?i.split(" "):[],l=r[o]?r[o].split(" "):[],c=a.filter(u=>!l.includes(u));r[o]=[...l,...c].join(" ")}else if(o==="style"){const a=i?i.split(";").map(u=>u.trim()).filter(Boolean):[],l=r[o]?r[o].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;l.forEach(u=>{const[d,p]=u.split(":").map(f=>f.trim());c.set(d,p)}),a.forEach(u=>{const[d,p]=u.split(":").map(f=>f.trim());c.set(d,p)}),r[o]=Array.from(c.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[o]=i}),r},{})}function Tc(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>It(n,r),{})}function hk(t){return typeof t=="function"}function Je(t,e=void 0,...n){return hk(t)?e?t.bind(e)(...n):t(...n):t}function FK(t={}){return Object.keys(t).length===0&&t.constructor===Object}function BK(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Ib(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):BK(n.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function $b(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&FK(n)?!1:n!=null))}function jK(t,e){var n;const r=fk(t),{nodeExtensions:o,markExtensions:i}=Fu(t),s=(n=o.find(c=>Ie(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(o.map(c=>{const u=r.filter(b=>b.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((b,x)=>{const S=Ie(x,"extendNodeSchema",d);return{...b,...S?S(c):{}}},{}),f=$b({...p,content:Je(Ie(c,"content",d)),marks:Je(Ie(c,"marks",d)),group:Je(Ie(c,"group",d)),inline:Je(Ie(c,"inline",d)),atom:Je(Ie(c,"atom",d)),selectable:Je(Ie(c,"selectable",d)),draggable:Je(Ie(c,"draggable",d)),code:Je(Ie(c,"code",d)),whitespace:Je(Ie(c,"whitespace",d)),defining:Je(Ie(c,"defining",d)),isolating:Je(Ie(c,"isolating",d)),attrs:Object.fromEntries(u.map(b=>{var x;return[b.name,{default:(x=b==null?void 0:b.attribute)===null||x===void 0?void 0:x.default}]}))}),m=Je(Ie(c,"parseHTML",d));m&&(f.parseDOM=m.map(b=>Ib(b,u)));const g=Ie(c,"renderHTML",d);g&&(f.toDOM=b=>g({node:b,HTMLAttributes:Tc(b,u)}));const y=Ie(c,"renderText",d);return y&&(f.toText=y),[c.name,f]})),l=Object.fromEntries(i.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((y,b)=>{const x=Ie(b,"extendMarkSchema",d);return{...y,...x?x(c):{}}},{}),f=$b({...p,inclusive:Je(Ie(c,"inclusive",d)),excludes:Je(Ie(c,"excludes",d)),group:Je(Ie(c,"group",d)),spanning:Je(Ie(c,"spanning",d)),code:Je(Ie(c,"code",d)),attrs:Object.fromEntries(u.map(y=>{var b;return[y.name,{default:(b=y==null?void 0:y.attribute)===null||b===void 0?void 0:b.default}]}))}),m=Je(Ie(c,"parseHTML",d));m&&(f.parseDOM=m.map(y=>Ib(y,u)));const g=Ie(c,"renderHTML",d);return g&&(f.toDOM=y=>g({mark:y,HTMLAttributes:Tc(y,u)})),[c.name,f]}));return new BC({topNode:s,nodes:a,marks:l})}function Zd(t,e){return e.nodes[t]||e.marks[t]||null}function Nb(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const zK=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,a)=>{var l,c;const u=((c=(l=o.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),n};function Tm(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Bu{constructor(e){this.find=e.find,this.handler=e.handler}}const HK=(t,e)=>{if(Tm(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function kl(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let u=!1;const d=zK(c)+i;return s.forEach(p=>{if(u)return;const f=HK(d,p.find);if(!f)return;const m=l.state.tr,g=Nu({state:l.state,transaction:m}),y={from:r-(f[0].length-i.length),to:o},{commands:b,chain:x,can:S}=new _u({editor:n,state:g});p.handler({state:g,range:y,match:f,commands:b,chain:x,can:S})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:o,text:i}),l.dispatch(m),u=!0)}),u}function VK(t){const{editor:e,rules:n}=t,r=new vn({state:{init(){return null},apply(o,i){const s=o.getMeta(r);if(s)return s;const a=o.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:c,text:u}=a,d=c+u.length;kl({editor:e,from:c,to:d,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return kl({editor:e,from:i,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&kl({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?kl({editor:e,from:s.pos,to:s.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function WK(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ml(t){return WK(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function ju(t,e){const n={...t};return Ml(t)&&Ml(e)&&Object.keys(e).forEach(r=>{Ml(e[r])&&Ml(t[r])?n[r]=ju(t[r],e[r]):n[r]=e[r]}),n}class Un{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Je(Ie(this,"addOptions",{name:this.name}))),this.storage=Je(Ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Un(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>ju(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Un(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Je(Ie(n,"addOptions",{name:n.name})),n.storage=Je(Ie(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}function UK(t){return typeof t=="number"}class GK{constructor(e){this.find=e.find,this.handler=e.handler}}const qK=(t,e,n)=>{if(Tm(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function KK(t){const{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:u}=new _u({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,o,(f,m)=>{if(!f.isTextblock||f.type.spec.code)return;const g=Math.max(r,m),y=Math.min(o,m+f.content.size),b=f.textBetween(g-m,y-m,void 0,"");qK(b,i.find,s).forEach(S=>{if(S.index===void 0)return;const E=g+S.index+1,k=E+S[0].length,w={from:n.tr.mapping.map(E),to:n.tr.mapping.map(k)},M=i.handler({state:n,range:w,match:S,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});d.push(M)})}),d.every(f=>f!==null)}const YK=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function JK(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a=typeof DragEvent<"u"?new DragEvent("drop"):null;const l=({state:u,from:d,to:p,rule:f,pasteEvt:m})=>{const g=u.tr,y=Nu({state:u,transaction:g});if(!(!KK({editor:e,state:y,from:Math.max(d-1,0),to:p.b-1,rule:f,pasteEvent:m,dropEvent:a})||!g.steps.length))return a=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g};return n.map(u=>new vn({view(d){const p=f=>{var m;r=!((m=d.dom.parentElement)===null||m===void 0)&&m.contains(f.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(d,p)=>(i=r===d.dom.parentElement,a=p,!1),paste:(d,p)=>{var f;const m=(f=p.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=p,o=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(d,p,f)=>{const m=d[0],g=m.getMeta("uiEvent")==="paste"&&!o,y=m.getMeta("uiEvent")==="drop"&&!i,b=m.getMeta("applyPasteRules"),x=!!b;if(!g&&!y&&!x)return;if(x){const{from:k,text:w}=b,M=k+w.length,T=YK(w);return l({rule:u,state:f,from:k,to:{b:M},pasteEvt:T})}const S=p.doc.content.findDiffStart(f.doc.content),E=p.doc.content.findDiffEnd(f.doc.content);if(!(!UK(S)||!E||S===E.b))return l({rule:u,state:f,from:S,to:E,pasteEvt:s})}}))}function ZK(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Qi{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Qi.resolve(e),this.schema=jK(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Qi.sort(Qi.flatten(e)),r=ZK(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=Ie(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((r,o)=>{const i=Ie(r,"priority")||100,s=Ie(o,"priority")||100;return i>s?-1:i{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Zd(n.name,this.schema)},o=Ie(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=Qi.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Zd(s.name,this.schema)},l=[],c=Ie(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&Ie(s,"exitable",a)&&(u.ArrowRight=()=>Un.handleExit({editor:e,mark:s})),c){const g=Object.fromEntries(Object.entries(c()).map(([y,b])=>[y,()=>b({editor:e})]));u={...u,...g}}const d=Tq(u);l.push(d);const p=Ie(s,"addInputRules",a);Nb(s,e.options.enableInputRules)&&p&&r.push(...p());const f=Ie(s,"addPasteRules",a);Nb(s,e.options.enablePasteRules)&&f&&o.push(...f());const m=Ie(s,"addProseMirrorPlugins",a);if(m){const g=m();l.push(...g)}return l}).flat();return[VK({editor:e,rules:r}),...JK({editor:e,rules:o}),...i]}get attributes(){return fk(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Fu(this.extensions);return Object.fromEntries(n.filter(r=>!!Ie(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:e,type:on(r.name,this.schema)},s=Ie(r,"addNodeView",i);if(!s)return[];const a=(l,c,u,d,p)=>{const f=Tc(l,o);return s()({node:l,view:c,getPos:u,decorations:d,innerDecorations:p,editor:e,extension:r,HTMLAttributes:f})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Zd(e.name,this.schema)};e.type==="mark"&&(!((n=Je(Ie(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const o=Ie(e,"onBeforeCreate",r),i=Ie(e,"onCreate",r),s=Ie(e,"onUpdate",r),a=Ie(e,"onSelectionUpdate",r),l=Ie(e,"onTransaction",r),c=Ie(e,"onFocus",r),u=Ie(e,"onBlur",r),d=Ie(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}class Pn{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Je(Ie(this,"addOptions",{name:this.name}))),this.storage=Je(Ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Pn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>ju(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Pn({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Je(Ie(n,"addOptions",{name:n.name})),n.storage=Je(Ie(n,"addStorage",{name:n.name,options:n.options})),n}}function mk(t,e,n){const{from:r,to:o}=e,{blockSeparator:i=` +`))),0,0):se.empty;let d=t.someProp("clipboardTextParser",p=>p(e,o,r,t));if(d)a=d;else{let p=o.marks(),{schema:f}=t.state,m=mi.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(f.text(g,p)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=DG(n),Ja&&IG(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||oa.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!AG.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)a=$G(mb(a,+u[1],+u[2]),u[4]);else if(a=se.maxOpen(PG(a.content,o),!0),a.openStart||a.openEnd){let d=0,p=0;for(let f=a.content.firstChild;d{a=d(a,t)}),a}const AG=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function PG(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&kS(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=MS(s[s.length-1],i.length));let u=SS(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return ne.from(s)}return t}function SS(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ne.from(t));return t}function kS(t,e,n,r,o){if(o1&&(i=0),o=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(ne.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function mb(t,e,n){return en}).createHTML(t):t}function DG(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=TS().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&ES[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"").reverse().join("")),n.innerHTML=RG(t),o)for(let i=0;i=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=ne.from(l.create(r[a+1],o)),i++,s++}return new se(o,i,s)}const kn={},Mn={},NG={touchstart:!0,touchmove:!0};class _G{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function FG(t){for(let e in kn){let n=kn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{jG(t,r)&&!pm(t,r)&&(t.editable||!(r.type in Mn))&&n(t,r)},NG[e]?{passive:!0}:void 0)}Sn&&t.dom.addEventListener("input",()=>null),lf(t)}function fo(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function BG(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function lf(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>pm(t,r))})}function pm(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function jG(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function zG(t,e){!pm(t,e)&&kn[e.type]&&(t.editable||!(e.type in Mn))&&kn[e.type](t,e)}Mn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!LS(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(pr&&mn&&n.keyCode==13)))if(t.domObserver.selectionChanged(t.domSelectionRange())?t.domObserver.flush():n.keyCode!=229&&t.domObserver.forceFlush(),us&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,_o(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||LG(t,n)?n.preventDefault():fo(t,"key")};Mn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Mn.keypress=(t,e)=>{let n=e;if(LS(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||rr&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Ke)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function Iu(t){return{left:t.clientX,top:t.clientY}}function HG(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function fm(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,n,i.nodeAfter,i.before(s),o,!0):a(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function rs(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function VG(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Ve.isSelectable(r)?(rs(t,new Ve(n)),!0):!1}function WG(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Ve&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(Ve.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(rs(t,Ve.create(t.state.doc,o)),!0):!1}function UG(t,e,n,r,o){return fm(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?WG(t,n):VG(t,n))}function GG(t,e,n,r){return fm(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function qG(t,e,n,r){return fm(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||KG(t,n,r)}function KG(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(rs(t,Ke.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)rs(t,Ke.create(r,a+1,a+1+s.content.size));else if(Ve.isSelectable(s))rs(t,Ve.create(r,a));else continue;return!0}}function hm(t){return Cc(t)}const OS=rr?"metaKey":"ctrlKey";kn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=hm(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&HG(n,t.input.lastClick)&&!n[OS]&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(Iu(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new YG(t,s,n,!!r)):(i=="doubleClick"?GG:qG)(t,s.pos,s.inside,n)?n.preventDefault():fo(t,"pointer"))};class YG{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[OS],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Ve&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&br&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),fo(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Vr(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Iu(e))),this.updateAllowDefault(e),this.allowDefault||!n?fo(this.view,"pointer"):UG(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Sn&&this.mightDrag&&!this.mightDrag.node.isAtom||mn&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(rs(this.view,Ze.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):fo(this.view,"pointer")}move(e){this.updateAllowDefault(e),fo(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}kn.touchstart=t=>{t.input.lastTouch=Date.now(),hm(t),fo(t,"pointer")};kn.touchmove=t=>{t.input.lastTouch=Date.now(),fo(t,"pointer")};kn.contextmenu=t=>hm(t);function LS(t,e){return t.composing?!0:Sn&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const JG=pr?5e3:-1;Mn.compositionstart=Mn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Ke&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Cc(t,!0),t.markCursor=null;else if(Cc(t,!e.selection.empty),br&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}AS(t,JG)};Mn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,AS(t,20))};function AS(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Cc(t),e))}function PS(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=XG());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function ZG(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=V7(e.focusNode,e.focusOffset),r=W7(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function XG(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Cc(t,e=!1){if(!(pr&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),PS(t),e||t.docView&&t.docView.dirty){let n=um(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function QG(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const wa=An&&go<15||us&&Y7<604;kn.copy=Mn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=wa?null:n.clipboardData,s=r.content(),{dom:a,text:l}=wS(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):QG(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function eq(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function tq(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Ca(t,r.value,null,o,e):Ca(t,r.textContent,r.innerHTML,o,e)},50)}function Ca(t,e,n,r,o){let i=CS(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||se.empty)))return!0;if(!i)return!1;let s=eq(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function RS(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Mn.paste=(t,e)=>{let n=e;if(t.composing&&!pr)return;let r=wa?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Ca(t,RS(r),r.getData("text/html"),o,n)?n.preventDefault():tq(t,n)};class DS{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const IS=rr?"altKey":"ctrlKey";kn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(Iu(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof Ve?o.to-1:o.to))){if(r&&r.mightDrag)s=Ve.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=Ve.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=wS(t,a);(!n.dataTransfer.files.length||!mn||iS>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(wa?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",wa||n.dataTransfer.setData("text/plain",c),t.dragging=new DS(u,!n[IS],s)};kn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Mn.dragover=Mn.dragenter=(t,e)=>e.preventDefault();Mn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(Iu(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t)}):s=CS(t,RS(n.dataTransfer),wa?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[IS]);if(t.someProp("handleDrop",m=>m(t,n,s||se.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?YC(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(p))return;let f=c.doc.resolve(u);if(d&&Ve.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Ve(f));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,y,b,x)=>m=x),c.setSelection(dm(t,f,c.doc.resolve(m)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))};kn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Vr(t)},20))};kn.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};kn.beforeinput=(t,e)=>{if(mn&&pr&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,_o(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in Mn)kn[t]=Mn[t];function Sa(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Sc{constructor(e,n){this.toDOM=e,this.spec=n||Yo,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new vr(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Sc&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Sa(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class yo{constructor(e,n){this.attrs=e,this.spec=n||Yo}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new vr(i,s,this)}valid(e,n){return n.from=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;se){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,o+a,i)}}map(e,n,r){return this==hn||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Yo)}mapInner(e,n,r,o,i){let s;for(let a=0;a{let c=l+r,u;if(u=NS(n,a,c)){for(o||(o=this.children.slice());ia&&d.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,s=i+n.content.size;for(let a=0;ai&&l.type instanceof yo){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;co.map(e,n,Yo));return uo.from(r)}forChild(e,n){if(n.isLeaf)return tn.empty;let r=[];for(let o=0;on instanceof tn)?e:e.reduce((n,r)=>n.concat(r instanceof tn?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let y=g-m-(f-p);for(let b=0;bx+u-d)continue;let S=a[b]+u-d;f>=S?a[b+1]=p<=S?-2:-1:p>=u&&y&&(a[b]+=y,a[b+1]+=y)}d+=y}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let p=n.map(t[c+1]+i,-1),f=p-o,{index:m,offset:g}=r.content.findIndex(d),y=r.maybeChild(m);if(y&&g==d&&g+y.nodeSize==f){let b=a[c+2].mapInner(n,y,u+1,t[c]+i+1,s);b!=hn?(a[c]=d,a[c+1]=f,a[c+2]=b):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=rq(a,t,e,n,o,i,s),u=kc(c,r,0,s);e=u.local;for(let d=0;dn&&s.to{let c=NS(t,a,l+n);if(c){i=!0;let u=kc(c,a,n+l+1,r);u!=hn&&o.push(l,l+a.nodeSize,u)}});let s=$S(i?_S(t):t,-n).sort(Jo);for(let a=0;a0;)e++;t.splice(e,0,n)}function Hd(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=hn&&e.push(r)}),t.cursorWrapper&&e.push(tn.create(t.state.doc,[t.cursorWrapper.deco])),uo.from(e)}const oq={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},iq=An&&go<=11;class sq{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class aq{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new sq,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;oo.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),iq&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,oq)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(cb(this.view)){if(this.suppressingSelectionUpdates)return Vr(this.view);if(An&&go<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ti(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=xa(i))n.add(i);for(let i=e.anchorNode;i;i=xa(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}selectionChanged(e){return!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&cb(this.view)&&!this.ignoreSelectionChange(e)}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=this.selectionChanged(r),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;ud.nodeName=="BR");if(u.length==2){let[d,p]=u;d.parentNode&&d.parentNode.parentNode==p.parentNode?p.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let p of u){let f=p.parentNode;f&&f.nodeName=="LI"&&(!d||uq(e,d)!=f)&&p.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||o)&&(i>-1&&(e.docView.markDirty(i,s),lq(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Vr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;uo;y--){let b=r.childNodes[y-1],x=b.pmViewDesc;if(b.nodeName=="BR"&&!x){i=y;break}if(!x||x.size)break}let d=t.state.doc,p=t.someProp("domParser")||oa.fromSchema(t.state.schema),f=d.resolve(s),m=null,g=p.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:pq,context:f});if(c&&c[0].pos!=null){let y=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=y),m={anchor:y+s,head:b+s}}return{doc:g,sel:m,from:s,to:a}}function pq(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Sn&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Sn&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const fq=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function hq(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let D=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,P=um(t,D);if(P&&!t.state.selection.eq(P)){if(mn&&pr&&t.input.lastKeyCode===13&&Date.now()-100N(t,_o(13,"Enter"))))return;let U=t.state.tr.setSelection(P);D=="pointer"?U.setMeta("pointer",!0):D=="key"&&U.scrollIntoView(),i&&U.setMeta("composition",i),t.dispatch(U)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=dq(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),p,f;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||pr)&&o.some(D=>D.nodeType==1&&!fq.test(D.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",D=>D(t,_o(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof Ke&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let D=wb(t,t.state.doc,c.sel);if(D&&!D.eq(t.state.selection)){let P=t.state.tr.setSelection(D);i&&P.setMeta("composition",i),t.dispatch(P)}}return}t.state.selection.fromt.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),An&&go<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=c.doc.resolveNoCache(m.start-c.from),y=c.doc.resolveNoCache(m.endB-c.from),b=u.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA,S;if((us&&t.input.lastIOSEnter>Date.now()-225&&(!x||o.some(D=>D.nodeName=="DIV"||D.nodeName=="P"))||!x&&g.posD(t,_o(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&gq(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",D=>D(t,_o(8,"Backspace")))){pr&&mn&&t.domObserver.suppressSelectionUpdates();return}mn&&pr&&m.endB==m.start&&(t.input.lastAndroidDelete=Date.now()),pr&&!x&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,y=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(D){return D(t,_o(13,"Enter"))})},20));let E=m.start,k=m.endA,w,M,T;if(x){if(g.pos==y.pos)An&&go<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Vr(t),20)),w=t.state.tr.delete(E,k),M=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(T=mq(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start()))))w=t.state.tr,T.type=="add"?w.addMark(E,k,T.mark):w.removeMark(E,k,T.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let D=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",P=>P(t,E,k,D)))return;w=t.state.tr.insertText(D,E,k)}}if(w||(w=t.state.tr.replace(E,k,c.doc.slice(m.start-c.from,m.endB-c.from))),c.sel){let D=wb(t,w.doc,c.sel);D&&!(mn&&pr&&t.composing&&D.empty&&(m.start!=m.endB||t.input.lastAndroidDeletee.content.size?null:dm(t,e.resolve(n.anchor),e.resolve(n.head))}function mq(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;un||Vd(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function vq(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s=s?i-r:0;i-=l,i&&i=a?i-r:0;i-=l,i&&i=56320&&e<=57343&&n>=55296&&n<=56319}class yq{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new _G,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Tb),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Mb(this),kb(this),this.nodeViews=Eb(this),this.docView=rb(this.state.doc,Sb(this),Hd(this),this.dom,this),this.domObserver=new aq(this,(r,o,i,s)=>hq(this,r,o,i,s)),this.domObserver.start(),FG(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&lf(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Tb),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(PS(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=Eb(this);xq(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&lf(this),this.editable=Mb(this),kb(this);let l=Hd(this),c=Sb(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(o.selection))&&(s=!0);let p=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&X7(this);if(s){this.domObserver.stop();let f=d&&(An||mn)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&bq(o.selection,e.selection);if(d){let m=mn?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ZG(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=rb(e.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&CG(this))?Vr(this,f):(yS(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():p&&Q7(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Ve){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Zy(this,n.getBoundingClientRect(),e)}else Zy(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new DS(e.slice,e.move,o<0?void 0:Ve.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return iG(this,e)}coordsAtPos(e,n=1){return uS(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return uG(this,n||this.state,e)}pasteHTML(e,n){return Ca(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Ca(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(BG(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Hd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,z7())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return zG(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Sn&&this.root.nodeType===11&&G7(this.dom.ownerDocument)==this.dom&&cq(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function Sb(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[vr.node(0,t.state.doc.content.size,e)]}function kb(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:vr.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Mb(t){return!t.someProp("editable",e=>e(t.state)===!1)}function bq(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Eb(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function xq(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function Tb(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var So={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Mc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},wq=typeof navigator<"u"&&/Mac/.test(navigator.platform),Cq=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var cn=0;cn<10;cn++)So[48+cn]=So[96+cn]=String(cn);for(var cn=1;cn<=24;cn++)So[cn+111]="F"+cn;for(var cn=65;cn<=90;cn++)So[cn]=String.fromCharCode(cn+32),Mc[cn]=String.fromCharCode(cn);for(var Wd in So)Mc.hasOwnProperty(Wd)||(Mc[Wd]=So[Wd]);function Sq(t){var e=wq&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Cq&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Mc:So)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const kq=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Mq(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a127)&&(i=So[r.keyCode])&&i!=o){let a=e[Ud(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const FS=65535,BS=Math.pow(2,16);function Lq(t,e){return t+e*BS}function Ob(t){return t&FS}function Aq(t){return(t-(t&FS))/BS}const jS=1,zS=2,jl=4,HS=8;let cf=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&HS)>0}get deletedBefore(){return(this.delInfo&(jS|jl))>0}get deletedAfter(){return(this.delInfo&(zS|jl))>0}get deletedAcross(){return(this.delInfo&jl)>0}},ri=class Gi{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Gi.empty)return Gi.empty}recover(e){let n=0,r=Ob(e);if(!this.inverted)for(let o=0;oe)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let p=c?e==l?-1:e==d?1:n:n,f=l+o+(p<0?0:u);if(r)return f;let m=e==(n<0?l:d)?null:Lq(a/3,e-l),g=e==l?zS:e==d?jS:jl;return(n<0?e!=l:e!=d)&&(g|=HS),new cf(f,g,m)}o+=u-c}return r?e+o:new cf(e+o,0,null)}touches(e,n){let r=0,o=Ob(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o=0;n--){let o=e.getMirror(n);this.appendMap(e.maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new la;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ri&&l!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return Cn.fromReplace(e,this.from,this.to,i)}invert(){return new Xa(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new qs(n.pos,r.pos,this.mark)}merge(e){return e instanceof qs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new qs(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new qs(n.from,n.to,e.markFromJSON(n.mark))}};yn.jsonID("addMark",ym);let Xa=class Ks extends yn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new se(vm(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Cn.fromReplace(e,this.from,this.to,r)}invert(){return new ym(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ks(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ks&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ks(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ks(n.from,n.to,e.markFromJSON(n.mark))}};yn.jsonID("removeMark",Xa);let bm=class Ys extends yn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Cn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Cn.fromReplace(e,this.pos,this.pos+1,new se(ne.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;or.pos?null:new zl(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new zl(n.from,n.to,n.gapFrom,n.gapTo,se.fromJSON(e,n.slice),n.insert,!!n.structure)}};yn.jsonID("replaceAround",gi);function df(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function Pq(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,e),f=Math.min(c+l.nodeSize,n),m=r.addToSet(d);for(let g=0;gt.step(l)),i.forEach(l=>t.step(l))}function Rq(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof qa){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;ut.step(new Xa(s.from,s.to,s.style)))}function wm(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l=0;l--)t.step(s[l])}function Dq(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Iq(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;m--)g||r.index(m)>0?(g=!0,u=ne.from(r.node(m).copy(u)),d++):l--;let p=ne.empty,f=0;for(let m=i,g=!1;m>n;m--)g||o.after(m+1)=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ne.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new gi(o,i,o,i,new se(r,0,0),n.length,!0))}function jq(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&zq(t.doc,t.mapping.slice(i).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!m?c=!1:!f&&m&&(c=!0)}c===!1&&WS(t,s,a,i),wm(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let u=t.mapping.slice(i),d=u.map(a,1),p=u.map(a+s.nodeSize,1);return t.step(new gi(d,p,d+1,p-1,new se(ne.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&VS(t,s,a,i),!1}})}function VS(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function WS(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function zq(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function Hq(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new gi(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new se(ne.from(s),0,0),1,!0))}function Hl(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),p=o.index(c);if(d.type.spec.isolating)return!1;let f=d.content.cutByIndex(p,d.childCount),m=r&&r[u+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||d;if(!d.canReplace(p+1,d.childCount)||!g.type.validContent(f))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function Vq(t,e,n=1,r){let o=t.doc.resolve(e),i=ne.empty,s=ne.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=ne.from(o.node(a).copy(i));let u=r&&r[c];s=ne.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new Gr(e,e,new se(i.append(s),n,n),!0))}function Cm(t,e){let n=t.resolve(e),r=n.index();return US(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Wq(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&US(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function Uq(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",d=!!s.contentMatch.matchType(o);u&&!d?r=!1:!u&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);WS(t,u.node(),u.before(),a)}s.inlineContent&&wm(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new Gr(c,l.map(e+n,-1),se.empty,!0)),r===!0){let u=t.doc.resolve(c);VS(t,u.node(),u.before(),t.steps.length)}return t}function Gq(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i0;o--)this.placed=ne.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new se(i,s,a);return e>-1?new gi(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Gr(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=qd(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ne.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=qd(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=qd(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new se(Js(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new se(Js(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(KS(g.mark(p.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?f:-1)))}let m=c==a.childCount;m||(f=-1),this.placed=Zs(this.placed,n,ne.from(u)),this.frontier[n].match=d,m&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n=0;a--){let{match:l,type:c}=this.frontier[a],u=Kd(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Zs(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Zs(this.placed,this.depth,ne.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ne.empty,!0);n.childCount&&(this.placed=Zs(this.placed,this.frontier.length,n))}};function Js(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Js(t.firstChild.content,e-1,n)))}function Zs(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Zs(t.lastChild.content,e-1,n)))}function qd(t,e){for(let n=0;n1&&(r=r.replaceChild(0,KS(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ne.empty,!0)))),t.copy(r)}function Kd(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!Yq(n,i.content,s)?a:null}function Yq(t,e,n){for(let r=n;r0;p--,f--){let m=o.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(p)>-1?a=p:o.before(p)==f&&s.splice(1,0,-p)}let l=s.indexOf(a),c=[],u=r.openStart;for(let p=r.content,f=0;;f++){let m=p.firstChild;if(c.push(m),f==r.openStart)break;p=m.content}for(let p=u-1;p>=0;p--){let f=c[p],m=Jq(f.type);if(m&&!f.sameMarkup(o.node(Math.abs(a)-1)))u=p;else if(m||!f.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let f=(p+u+1)%(r.openStart+1),m=c[f];if(m)for(let g=0;g=0&&(t.replace(e,n,r),!(t.steps.length>d));p--){let f=s[p];f<0||(e=o.before(f),n=i.after(f))}}function YS(t,e,n,r,o){if(er){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(ne.empty,!0))}return t}function Xq(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=Gq(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new se(ne.from(r),0,0))}function Qq(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=JS(r,o);for(let s=0;s0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function JS(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(ie.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}let ZS=class Vl extends yn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Cn.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return Cn.fromReplace(e,this.pos,this.pos+1,new se(ne.from(o),0,n.isLeaf?0:1))}getMap(){return ri.empty}invert(e){return new Vl(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Vl(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Vl(n.pos,n.attr,n.value)}};yn.jsonID("attr",ZS);let XS=class pf extends yn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Cn.ok(r)}getMap(){return ri.empty}invert(e){return new pf(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new pf(n.attr,n.value)}};yn.jsonID("docAttr",XS);let ds=class extends Error{};ds=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};ds.prototype=Object.create(Error.prototype);ds.prototype.constructor=ds;ds.prototype.name="TransformError";class eK{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new la}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ds(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=se.empty){let o=qq(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new se(ne.from(r),0,0))}delete(e,n){return this.replace(e,n,se.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return Zq(this,e,n,r),this}replaceRangeWith(e,n,r){return Xq(this,e,n,r),this}deleteRange(e,n){return Qq(this,e,n),this}lift(e,n){return $q(this,e,n),this}join(e,n=1){return Uq(this,e,n),this}wrap(e,n){return Bq(this,e,n),this}setBlockType(e,n=e,r,o=null){return jq(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return Hq(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new ZS(e,n,r)),this}setDocAttribute(e,n){return this.step(new XS(e,n)),this}addNodeMark(e,n){return this.step(new bm(e,n)),this}removeNodeMark(e,n){if(!(n instanceof mt)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new xm(e,n)),this}split(e,n=1,r){return Vq(this,e,n,r),this}addMark(e,n,r){return Pq(this,e,n,r),this}removeMark(e,n,r){return Rq(this,e,n,r),this}clearIncompatible(e,n,r){return wm(this,e,n,r),this}}const QS=65535,ek=Math.pow(2,16);function tK(t,e){return t+e*ek}function Ab(t){return t&QS}function nK(t){return(t-(t&QS))/ek}const tk=1,nk=2,Wl=4,rk=8;class Pb{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&rk)>0}get deletedBefore(){return(this.delInfo&(tk|Wl))>0}get deletedAfter(){return(this.delInfo&(nk|Wl))>0}get deletedAcross(){return(this.delInfo&Wl)>0}}class Vn{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Vn.empty)return Vn.empty}recover(e){let n=0,r=Ab(e);if(!this.inverted)for(let o=0;oe)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let p=c?e==l?-1:e==d?1:n:n,f=l+o+(p<0?0:u);if(r)return f;let m=e==(n<0?l:d)?null:tK(a/3,e-l),g=e==l?nk:e==d?tk:Wl;return(n<0?e!=l:e!=d)&&(g|=rk),new Pb(f,g,m)}o+=u-c}return r?e+o:new Pb(e+o,0,null)}touches(e,n){let r=0,o=Ab(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return Ut.fromReplace(e,this.from,this.to,i)}invert(){return new Vo(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ho(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ho&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ho(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ho(n.from,n.to,e.markFromJSON(n.mark))}}bn.jsonID("addMark",Ho);class Vo extends bn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new se(Sm(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Ut.fromReplace(e,this.from,this.to,r)}invert(){return new Ho(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Vo(n.pos,r.pos,this.mark)}merge(e){return e instanceof Vo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Vo(n.from,n.to,e.markFromJSON(n.mark))}}bn.jsonID("removeMark",Vo);class Wo extends bn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ut.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ut.fromReplace(e,this.pos,this.pos+1,new se(ne.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;or.pos?null:new bo(n.pos,r.pos,o,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new bo(n.from,n.to,n.gapFrom,n.gapTo,se.fromJSON(e,n.slice),n.insert,!!n.structure)}}bn.jsonID("replaceAround",bo);function ff(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function rK(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function $u(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(ri;l--,c--){let u=o.node(l),d=o.index(l);if(u.type.spec.isolating)return!1;let p=u.content.cutByIndex(d,u.childCount),f=u;if(!u.canReplace(d+1,u.childCount)||!f.type.validContent(p))return!1}let a=o.indexAfter(i);return o.node(i).canReplaceWith(a,a,o.node(i+1).type)}function Nu(t,e){let n=t.resolve(e),r=n.index();return ok(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function lK(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&ok(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function km(t,e,n=e,r=se.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return cK(o,i,r)?new fr(e,n,r):new uK(o,i,r).fit()}function cK(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class uK{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ne.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=ne.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new se(i,s,a);return e>-1?new bo(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new fr(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=Jd(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(ne.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Jd(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new se(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Jd(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new se(Xs(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new se(Xs(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(d=y,u.push(sk(g.mark(p.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?f:-1)))}let m=c==a.childCount;m||(f=-1),this.placed=Qs(this.placed,n,ne.from(u)),this.frontier[n].match=d,m&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n=0;a--){let{match:l,type:c}=this.frontier[a],u=Zd(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Qs(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Qs(this.placed,this.depth,ne.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ne.empty,!0);n.childCount&&(this.placed=Qs(this.placed,this.frontier.length,n))}}function Xs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Xs(t.firstChild.content,e-1,n)))}function Qs(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Qs(t.lastChild.content,e-1,n)))}function Jd(t,e){for(let n=0;n1&&(r=r.replaceChild(0,sk(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ne.empty,!0)))),t.copy(r)}function Zd(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!dK(n,i.content,s)?a:null}function dK(t,e,n){for(let r=n;rt.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function ak(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const fK=(t,e,n)=>{let r=ak(t,n);if(!r)return!1;let o=Mm(r);if(!o){let s=r.blockRange(),a=s&&$u(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(dk(t,o,e,-1))return!0;if(r.parent.content.size==0&&(ps(i,"end")||Ve.isSelectable(i)))for(let s=r.depth;;s--){let a=km(t.doc,r.before(s),r.after(s),se.empty);if(a&&a.slice.size1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},hK=(t,e,n)=>{let r=ak(t,n);if(!r)return!1;let o=Mm(r);return o?lk(t,o,e):!1},mK=(t,e,n)=>{let r=ck(t,n);if(!r)return!1;let o=Em(r);return o?lk(t,o,e):!1};function lk(t,e,n){let r=e.nodeBefore,o=r,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=km(t.doc,i,l,se.empty);if(!c||c.from!=i||c instanceof fr&&c.slice.size>=l-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(Ke.create(u.doc,i)),n(u.scrollIntoView())}return!0}function ps(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const gK=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Mm(r)}let s=i&&i.nodeBefore;return!s||!Ve.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Ve.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function Mm(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function ck(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=ck(t,n);if(!r)return!1;let o=Em(r);if(!o)return!1;let i=o.nodeAfter;if(dk(t,o,e,1))return!0;if(r.parent.content.size==0&&(ps(i,"start")||Ve.isSelectable(i))){let s=km(t.doc,r.before(),r.after(),se.empty);if(s&&s.slice.size{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof Ve,o;if(r){if(n.node.isTextblock||!Nu(t.doc,n.from))return!1;o=n.from}else if(o=ik(t.doc,n.from,-1),o==null)return!1;if(e){let i=t.tr.join(o);r&&i.setSelection(Ve.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},xK=(t,e)=>{let n=t.selection,r;if(n instanceof Ve){if(n.node.isTextblock||!Nu(t.doc,n.to))return!1;r=n.to}else if(r=ik(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},wK=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&$u(o);return i==null?!1:(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)},CK=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function uk(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=uk(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Ze.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},kK=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof yr||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=uk(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(aK(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&$u(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},EK=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(Ve.create(t.doc,o))),!0)};function TK(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||Nu(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function dk(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&TK(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,m=ne.empty;for(let b=s.length-1;b>=0;b--)m=ne.from(s[b].create(null,m));m=ne.from(o.copy(m));let g=t.tr.step(new bo(e.pos-1,f,e.pos,f,new se(m,1,0),s.length,!0)),y=g.doc.resolve(f+2*s.length);y.nodeAfter&&y.nodeAfter.type==o.type&&Nu(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&l?null:Ze.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),p=d&&$u(d);if(p!=null&&p>=e.depth)return n&&n(t.tr.lift(d,p).scrollIntoView()),!0;if(c&&ps(i,"start",!0)&&ps(o,"end")){let f=o,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let g=i,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(n){let b=ne.empty;for(let S=m.length-1;S>=0;S--)b=ne.from(m[S].copy(b));let x=t.tr.step(new bo(e.pos-m.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new se(b,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function pk(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(Ke.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const OK=pk(-1),LK=pk(1);function AK(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&oK(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Db(t,e=null){return function(n,r){let o=!1;for(let i=0;i{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s=2&&o.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(o.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new gc(u,u,s.depth),s.endIndex=0;u--)i=ne.from(n[u].type.create(n[u].attrs,i));t.step(new wr(e.start-(r?2:0),e.end,e.start,e.end,new se(i,0,0),n.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?IK(e,n,t,i):$K(e,n,i):!0:!1}}function IK(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);ig;m--)f-=o.child(m).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?ne.empty:ne.from(o))))return!1;let d=i.pos,p=d+s.nodeSize;return r.step(new wr(d-(a?1:0),p+(l?1:0),d+1,p-1,new se((a?ne.empty:ne.from(o.copy(ne.empty))).append(l?ne.empty:ne.from(o.copy(ne.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function NK(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=ne.from(c?t.create():null),d=new se(ne.from(t.create(null,ne.from(a.type.create(null,u)))),c?3:1,0),p=i.start,f=i.end;n(e.tr.step(new wr(p-(c?3:1),f,p,f,d,1,!0)).scrollIntoView())}return!0}}function _u(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class Fu{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const d=l(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],l=!!e,c=e||i.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(p=>p===!0)),d={...Object.fromEntries(Object.entries(r).map(([p,f])=>[p,(...g)=>{const y=this.buildProps(c,n),b=f(...g)(y);return a.push(b),d}])),run:u};return d}createCan(e){const{rawCommands:n,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:e,editor:o,view:s,state:_u({state:i,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class _K{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function Ie(t,e,n){return t.config[e]===void 0&&t.parent?Ie(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Ie(t.parent,e,n):null}):t.config[e]}function Bu(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function fk(t){const e=[],{nodeExtensions:n,markExtensions:r}=Bu(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:o},l=Ie(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([p,f])=>{e.push({type:d,name:p,attribute:{...i,...f}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=Ie(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,d])=>{const p={...i,...d};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,e.push({type:s.name,name:u,attribute:p})})}),e}function on(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function It(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const a=i?i.split(" "):[],l=r[o]?r[o].split(" "):[],c=a.filter(u=>!l.includes(u));r[o]=[...l,...c].join(" ")}else if(o==="style"){const a=i?i.split(";").map(u=>u.trim()).filter(Boolean):[],l=r[o]?r[o].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;l.forEach(u=>{const[d,p]=u.split(":").map(f=>f.trim());c.set(d,p)}),a.forEach(u=>{const[d,p]=u.split(":").map(f=>f.trim());c.set(d,p)}),r[o]=Array.from(c.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[o]=i}),r},{})}function Tc(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>It(n,r),{})}function hk(t){return typeof t=="function"}function Je(t,e=void 0,...n){return hk(t)?e?t.bind(e)(...n):t(...n):t}function FK(t={}){return Object.keys(t).length===0&&t.constructor===Object}function BK(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Ib(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):BK(n.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function $b(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&FK(n)?!1:n!=null))}function jK(t,e){var n;const r=fk(t),{nodeExtensions:o,markExtensions:i}=Bu(t),s=(n=o.find(c=>Ie(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(o.map(c=>{const u=r.filter(b=>b.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((b,x)=>{const S=Ie(x,"extendNodeSchema",d);return{...b,...S?S(c):{}}},{}),f=$b({...p,content:Je(Ie(c,"content",d)),marks:Je(Ie(c,"marks",d)),group:Je(Ie(c,"group",d)),inline:Je(Ie(c,"inline",d)),atom:Je(Ie(c,"atom",d)),selectable:Je(Ie(c,"selectable",d)),draggable:Je(Ie(c,"draggable",d)),code:Je(Ie(c,"code",d)),whitespace:Je(Ie(c,"whitespace",d)),defining:Je(Ie(c,"defining",d)),isolating:Je(Ie(c,"isolating",d)),attrs:Object.fromEntries(u.map(b=>{var x;return[b.name,{default:(x=b==null?void 0:b.attribute)===null||x===void 0?void 0:x.default}]}))}),m=Je(Ie(c,"parseHTML",d));m&&(f.parseDOM=m.map(b=>Ib(b,u)));const g=Ie(c,"renderHTML",d);g&&(f.toDOM=b=>g({node:b,HTMLAttributes:Tc(b,u)}));const y=Ie(c,"renderText",d);return y&&(f.toText=y),[c.name,f]})),l=Object.fromEntries(i.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},p=t.reduce((y,b)=>{const x=Ie(b,"extendMarkSchema",d);return{...y,...x?x(c):{}}},{}),f=$b({...p,inclusive:Je(Ie(c,"inclusive",d)),excludes:Je(Ie(c,"excludes",d)),group:Je(Ie(c,"group",d)),spanning:Je(Ie(c,"spanning",d)),code:Je(Ie(c,"code",d)),attrs:Object.fromEntries(u.map(y=>{var b;return[y.name,{default:(b=y==null?void 0:y.attribute)===null||b===void 0?void 0:b.default}]}))}),m=Je(Ie(c,"parseHTML",d));m&&(f.parseDOM=m.map(y=>Ib(y,u)));const g=Ie(c,"renderHTML",d);return g&&(f.toDOM=y=>g({mark:y,HTMLAttributes:Tc(y,u)})),[c.name,f]}));return new BC({topNode:s,nodes:a,marks:l})}function Xd(t,e){return e.nodes[t]||e.marks[t]||null}function Nb(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const zK=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,a)=>{var l,c;const u=((c=(l=o.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),n};function Tm(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class ju{constructor(e){this.find=e.find,this.handler=e.handler}}const HK=(t,e)=>{if(Tm(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function kl(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let u=!1;const d=zK(c)+i;return s.forEach(p=>{if(u)return;const f=HK(d,p.find);if(!f)return;const m=l.state.tr,g=_u({state:l.state,transaction:m}),y={from:r-(f[0].length-i.length),to:o},{commands:b,chain:x,can:S}=new Fu({editor:n,state:g});p.handler({state:g,range:y,match:f,commands:b,chain:x,can:S})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:o,text:i}),l.dispatch(m),u=!0)}),u}function VK(t){const{editor:e,rules:n}=t,r=new vn({state:{init(){return null},apply(o,i){const s=o.getMeta(r);if(s)return s;const a=o.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:c,text:u}=a,d=c+u.length;kl({editor:e,from:c,to:d,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return kl({editor:e,from:i,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&kl({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?kl({editor:e,from:s.pos,to:s.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function WK(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ml(t){return WK(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function zu(t,e){const n={...t};return Ml(t)&&Ml(e)&&Object.keys(e).forEach(r=>{Ml(e[r])&&Ml(t[r])?n[r]=zu(t[r],e[r]):n[r]=e[r]}),n}class Un{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Je(Ie(this,"addOptions",{name:this.name}))),this.storage=Je(Ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Un(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>zu(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Un(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Je(Ie(n,"addOptions",{name:n.name})),n.storage=Je(Ie(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}function UK(t){return typeof t=="number"}class GK{constructor(e){this.find=e.find,this.handler=e.handler}}const qK=(t,e,n)=>{if(Tm(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function KK(t){const{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:u}=new Fu({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,o,(f,m)=>{if(!f.isTextblock||f.type.spec.code)return;const g=Math.max(r,m),y=Math.min(o,m+f.content.size),b=f.textBetween(g-m,y-m,void 0,"");qK(b,i.find,s).forEach(S=>{if(S.index===void 0)return;const E=g+S.index+1,k=E+S[0].length,w={from:n.tr.mapping.map(E),to:n.tr.mapping.map(k)},M=i.handler({state:n,range:w,match:S,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});d.push(M)})}),d.every(f=>f!==null)}const YK=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function JK(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a=typeof DragEvent<"u"?new DragEvent("drop"):null;const l=({state:u,from:d,to:p,rule:f,pasteEvt:m})=>{const g=u.tr,y=_u({state:u,transaction:g});if(!(!KK({editor:e,state:y,from:Math.max(d-1,0),to:p.b-1,rule:f,pasteEvent:m,dropEvent:a})||!g.steps.length))return a=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g};return n.map(u=>new vn({view(d){const p=f=>{var m;r=!((m=d.dom.parentElement)===null||m===void 0)&&m.contains(f.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(d,p)=>(i=r===d.dom.parentElement,a=p,!1),paste:(d,p)=>{var f;const m=(f=p.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=p,o=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(d,p,f)=>{const m=d[0],g=m.getMeta("uiEvent")==="paste"&&!o,y=m.getMeta("uiEvent")==="drop"&&!i,b=m.getMeta("applyPasteRules"),x=!!b;if(!g&&!y&&!x)return;if(x){const{from:k,text:w}=b,M=k+w.length,T=YK(w);return l({rule:u,state:f,from:k,to:{b:M},pasteEvt:T})}const S=p.doc.content.findDiffStart(f.doc.content),E=p.doc.content.findDiffEnd(f.doc.content);if(!(!UK(S)||!E||S===E.b))return l({rule:u,state:f,from:S,to:E,pasteEvt:s})}}))}function ZK(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Qi{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Qi.resolve(e),this.schema=jK(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Qi.sort(Qi.flatten(e)),r=ZK(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=Ie(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((r,o)=>{const i=Ie(r,"priority")||100,s=Ie(o,"priority")||100;return i>s?-1:i{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Xd(n.name,this.schema)},o=Ie(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=Qi.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Xd(s.name,this.schema)},l=[],c=Ie(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&Ie(s,"exitable",a)&&(u.ArrowRight=()=>Un.handleExit({editor:e,mark:s})),c){const g=Object.fromEntries(Object.entries(c()).map(([y,b])=>[y,()=>b({editor:e})]));u={...u,...g}}const d=Tq(u);l.push(d);const p=Ie(s,"addInputRules",a);Nb(s,e.options.enableInputRules)&&p&&r.push(...p());const f=Ie(s,"addPasteRules",a);Nb(s,e.options.enablePasteRules)&&f&&o.push(...f());const m=Ie(s,"addProseMirrorPlugins",a);if(m){const g=m();l.push(...g)}return l}).flat();return[VK({editor:e,rules:r}),...JK({editor:e,rules:o}),...i]}get attributes(){return fk(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Bu(this.extensions);return Object.fromEntries(n.filter(r=>!!Ie(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:e,type:on(r.name,this.schema)},s=Ie(r,"addNodeView",i);if(!s)return[];const a=(l,c,u,d,p)=>{const f=Tc(l,o);return s()({node:l,view:c,getPos:u,decorations:d,innerDecorations:p,editor:e,extension:r,HTMLAttributes:f})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Xd(e.name,this.schema)};e.type==="mark"&&(!((n=Je(Ie(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const o=Ie(e,"onBeforeCreate",r),i=Ie(e,"onCreate",r),s=Ie(e,"onUpdate",r),a=Ie(e,"onSelectionUpdate",r),l=Ie(e,"onTransaction",r),c=Ie(e,"onFocus",r),u=Ie(e,"onBlur",r),d=Ie(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}class Pn{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Je(Ie(this,"addOptions",{name:this.name}))),this.storage=Je(Ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Pn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>zu(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Pn({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Je(Ie(n,"addOptions",{name:n.name})),n.storage=Je(Ie(n,"addStorage",{name:n.name,options:n.options})),n}}function mk(t,e,n){const{from:r,to:o}=e,{blockSeparator:i=` -`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,o,(l,c,u,d)=>{var p;l.isBlock&&c>r&&(a+=i);const f=s==null?void 0:s[l.type.name];if(f)return u&&(a+=f({node:l,pos:c,parent:u,index:d,range:e})),!1;l.isText&&(a+=(p=l==null?void 0:l.text)===null||p===void 0?void 0:p.slice(Math.max(r,c)-c,o-c))}),a}function gk(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const XK=Pn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new vn({key:new Gn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map(u=>u.$from.pos)),a=Math.max(...i.map(u=>u.$to.pos)),l=gk(n);return mk(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),QK=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),eY=(t=!1)=>({commands:e})=>e.setContent("",t),tY=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),p=c.resolve(u.map(l+a.nodeSize)),f=d.blockRange(p);if(!f)return;const m=Iq(f);if(a.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(f.start,g)}(m||m===0)&&e.lift(f,m)})}),!0},nY=t=>e=>t(e),rY=()=>({state:t,dispatch:e})=>kK(t,e),oY=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new Ke(r.doc.resolve(s-1))),!0},iY=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(e){const a=o.before(i),l=o.after(i);t.delete(a,l).scrollIntoView()}return!0}return!1},sY=t=>({tr:e,state:n,dispatch:r})=>{const o=on(t,n.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const l=i.before(s),c=i.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},aY=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},lY=()=>({state:t,dispatch:e})=>pK(t,e),cY=()=>({commands:t})=>t.keyboardShortcut("Enter"),uY=()=>({state:t,dispatch:e})=>SK(t,e);function Oc(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Tm(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function ff(t,e,n={}){return t.find(r=>r.type===e&&Oc(r.attrs,n))}function dY(t,e,n={}){return!!ff(t,e,n)}function Om(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=ff([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(ff([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a({tr:n,state:r,dispatch:o})=>{const i=Lo(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const d=Om(l,i,e);if(d&&d.from<=c&&d.to>=u){const p=Ke.create(s,d.from,d.to);n.setSelection(p)}}return!0},fY=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{zu()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!vk(n.state.selection))return s(),!0;const a=yk(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},mY=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),gY=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),bk=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&bk(r)}return t};function El(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return bk(n)}function Lc(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return ne.fromArray(t.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),Lc("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new BC({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?oa.fromSchema(l).parseSlice(El(t),n.parseOptions):oa.fromSchema(l).parse(El(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=oa.fromSchema(e);return n.slice?i.parseSlice(El(t),n.parseOptions).content:i.parse(El(t),n.parseOptions)}return Lc("",e,n)}function vY(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=u)}),t.setSelection(Ze.near(t.doc.resolve(s),n))}const yY=t=>!("type"in t),bY=(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=Lc(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(m){return i.emit("contentError",{editor:i,error:m,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:l,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,d=!0;if((yY(a)?a:[a]).forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,d=d?m.isBlock:!1}),l===c&&d){const{parent:m}=r.doc.resolve(l);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(l-=1,c+=1)}let f;u?(Array.isArray(e)?f=e.map(m=>m.text||"").join(""):typeof e=="object"&&e&&e.text?f=e.text:f=e,r.insertText(f,l,c)):(f=a,r.replaceWith(l,c,f)),n.updateSelection&&vY(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:f}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:f})}return!0},xY=()=>({state:t,dispatch:e})=>bK(t,e),wY=()=>({state:t,dispatch:e})=>xK(t,e),CY=()=>({state:t,dispatch:e})=>fK(t,e),SY=()=>({state:t,dispatch:e})=>vK(t,e),kY=()=>({state:t,dispatch:e,tr:n})=>{try{const r=GS(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},MY=()=>({state:t,dispatch:e,tr:n})=>{try{const r=GS(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},EY=()=>({state:t,dispatch:e})=>hK(t,e),TY=()=>({state:t,dispatch:e})=>mK(t,e);function xk(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function OY(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:o})=>{const i=OY(t).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function Ea(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?on(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(d,p)=>{if(d.isText)return;const f=Math.max(r,p),m=Math.min(o,p+d.nodeSize);a.push({node:d,from:f,to:m})});const l=o-r,c=a.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>Oc(d.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((d,p)=>d+p.to-p.from,0)>=l}const AY=(t,e={})=>({state:n,dispatch:r})=>{const o=on(t,n.schema);return Ea(n,o,e)?wK(n,r):!1},PY=()=>({state:t,dispatch:e})=>MK(t,e),RY=t=>({state:e,dispatch:n})=>{const r=on(t,e.schema);return DK(r)(e,n)},DY=()=>({state:t,dispatch:e})=>CK(t,e);function Hu(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function _b(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const IY=(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Hu(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=on(t,r.schema)),a==="mark"&&(s=Lo(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&n.setNodeMarkup(u,void 0,_b(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(_b(d.attrs,e)))})})}),!0):!1},$Y=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),NY=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),_Y=()=>({state:t,dispatch:e})=>gK(t,e),FY=()=>({state:t,dispatch:e})=>yK(t,e),BY=()=>({state:t,dispatch:e})=>EK(t,e),jY=()=>({state:t,dispatch:e})=>LK(t,e),zY=()=>({state:t,dispatch:e})=>OK(t,e);function hf(t,e,n={},r={}){return Lc(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const HY=(t,e=!1,n={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var l,c;const{doc:u}=i;if(n.preserveWhitespace!=="full"){const d=hf(t,o.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:o.options.enableContentCheck});return s&&i.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function Lm(t,e){const n=Lo(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function VY(t,e){const n=new eK(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function WY(t){for(let e=0;e{n(o)&&r.push({node:o,pos:i})}),r}function GY(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Am(t){return e=>GY(e.$from,t)}function qY(t,e){const n=mi.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function KY(t,e){const n={from:0,to:t.content.size};return mk(t,n,e)}function YY(t,e){const n=on(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function wk(t,e){const n=Hu(typeof e=="string"?e:e.name,t.schema);return n==="node"?YY(t,e):n==="mark"?Lm(t,e):{}}function JY(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function ZY(t){const e=JY(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function XY(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[i];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=e.slice(i).map(a,-1),u=e.slice(i).map(l),d=e.invert().map(c,-1),p=e.invert().map(u);r.push({oldRange:{from:d,to:p},newRange:{from:c,to:u}})})}),ZY(r)}function Pm(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const i=n.resolve(t),s=Om(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function Ul(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function mf(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Lo(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>Oc(d.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:d,$to:p})=>{const f=d.pos,m=p.pos;t.doc.nodesBetween(f,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const b=Math.max(f,y),x=Math.min(m,y+g.nodeSize),S=x-b;s+=S,a.push(...g.marks.map(E=>({mark:E,from:b,to:x})))})}),s===0)return!1;const l=a.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>Oc(d.mark.attrs,n,{strict:!1})).reduce((d,p)=>d+p.to-p.from,0),c=a.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,p)=>d+p.to-p.from,0);return(l>0?l+c:l)>=s}function QY(t,e,n={}){if(!e)return Ea(t,null,n)||mf(t,null,n);const r=Hu(e,t.schema);return r==="node"?Ea(t,e,n):r==="mark"?mf(t,e,n):!1}function Fb(t,e){const{nodeExtensions:n}=Fu(e),r=n.find(s=>s.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=Je(Ie(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function Rm(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(Rm(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function eJ(t,e,n){const o=t.state.doc.content.size,i=Hr(e,0,o),s=Hr(n,0,o),a=t.coordsAtPos(i),l=t.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),p=Math.max(a.right,l.right),f=p-d,m=u-c,b={top:c,bottom:u,left:d,right:p,width:f,height:m,x:d,y:c};return{...b,toJSON:()=>b}}function tJ(t,e,n){var r;const{selection:o}=e;let i=null;if(vk(o)&&(i=o.$cursor),i){const a=(r=t.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,d,p)=>{if(c)return!1;if(u.isInline){const f=!p||p.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=f&&m}return!c}),c})}const nJ=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Lo(t,r.schema);if(o)if(s){const c=Lm(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(p,f)=>{const m=Math.max(f,u),g=Math.min(f+p.nodeSize,d);p.marks.find(b=>b.type===l)?p.marks.forEach(b=>{l===b.type&&n.addMark(m,g,l.create({...b.attrs,...e}))}):n.addMark(m,g,l.create(e))})});return tJ(r,n,l)},rJ=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),oJ=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=on(t,n.schema);return i.isTextblock?o().command(({commands:s})=>Db(i,e)(n)?!0:s.clearNodes()).command(({state:s})=>Db(i,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},iJ=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Hr(t,0,r.content.size),i=Ve.create(r,o);e.setSelection(i)}return!0},sJ=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,s=Ke.atStart(r).from,a=Ke.atEnd(r).to,l=Hr(o,s,a),c=Hr(i,s,a),u=Ke.create(r,l,c);e.setSelection(u)}return!0},aJ=t=>({state:e,dispatch:n})=>{const r=on(t,e.schema);return NK(r)(e,n)};function Bb(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const lJ=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=o.extensionManager.attributes,u=Ul(c,a.node().type.name,a.node().attrs);if(i instanceof Ve&&i.node.isBlock)return!a.parentOffset||!Hl(s,a.pos)?!1:(r&&(t&&Bb(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:WY(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=d&&p?[{type:p,attrs:u}]:void 0,m=Hl(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!m&&Hl(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(m=!0,f=p?[{type:p,attrs:u}]:void 0),r){if(m&&(i instanceof Ke&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,f),p&&!d&&!a.parentOffset&&a.parent.type!==p)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&Bb(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return m},cJ=(t,e={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const a=on(t,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const d=l.node(-1);if(d.type!==a)return!1;const p=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let b=ne.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let T=l.depth-x;T>=l.depth-3;T-=1)b=ne.from(l.node(T).copy(b));const S=l.indexAfter(-1){if(M>-1)return!1;T.isTextblock&&T.content.size===0&&(M=D+1)}),M>-1&&n.setSelection(Ke.near(n.doc.resolve(M))),n.scrollIntoView()}return!0}const f=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,m={...Ul(p,d.type.name,d.attrs),...e},g={...Ul(p,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const y=f?[{type:a,attrs:m},{type:f,attrs:g}]:[{type:a,attrs:m}];if(!Hl(n.doc,l.pos,2))return!1;if(o){const{selection:b,storedMarks:x}=r,{splittableMarks:S}=i.extensionManager,E=x||b.$to.parentOffset&&b.$from.marks();if(n.split(l.pos,2,y).scrollIntoView(),!E||!o)return!0;const k=E.filter(w=>S.includes(w.type.name));n.ensureMarks(k)}return!0},Xd=(t,e)=>{const n=Am(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Cm(t.doc,n.pos)&&t.join(n.pos),!0},Qd=(t,e)=>{const n=Am(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Cm(t.doc,r)&&t.join(r),!0},uJ=(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:p}=o.extensionManager,f=on(t,s.schema),m=on(e,s.schema),{selection:g,storedMarks:y}=s,{$from:b,$to:x}=g,S=b.blockRange(x),E=y||g.$to.parentOffset&&g.$from.marks();if(!S)return!1;const k=Am(w=>Fb(w.type.name,d))(g);if(S.depth>=1&&k&&S.depth-k.depth<=1){if(k.node.type===f)return c.liftListItem(m);if(Fb(k.node.type.name,d)&&f.validContent(k.node.content)&&a)return l().command(()=>(i.setNodeMarkup(k.pos,f),!0)).command(()=>Xd(i,f)).command(()=>Qd(i,f)).run()}return!n||!E||!a?l().command(()=>u().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>Xd(i,f)).command(()=>Qd(i,f)).run():l().command(()=>{const w=u().wrapInList(f,r),M=E.filter(T=>p.includes(T.type.name));return i.ensureMarks(M),w?!0:c.clearNodes()}).wrapInList(f,r).command(()=>Xd(i,f)).command(()=>Qd(i,f)).run()},dJ=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Lo(t,r.schema);return mf(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},pJ=(t,e,n={})=>({state:r,commands:o})=>{const i=on(t,r.schema),s=on(e,r.schema),a=Ea(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?o.setNode(s,l):o.setNode(i,{...l,...n})},fJ=(t,e={})=>({state:n,commands:r})=>{const o=on(t,n.schema);return Ea(n,o,e)?r.lift(o):r.wrapIn(o,e)},hJ=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1},mJ=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},gJ=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Lo(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&s){let{from:p,to:f}=a;const m=(i=c.marks().find(y=>y.type===l))===null||i===void 0?void 0:i.attrs,g=Om(c,l,m);g&&(p=g.from,f=g.to),n.removeMark(p,f,l)}else d.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},vJ=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Hu(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=on(t,r.schema)),a==="mark"&&(s=Lo(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(d,p)=>{i&&i===d.type&&n.setNodeMarkup(p,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(f=>{if(s===f.type){const m=Math.max(p,c),g=Math.min(p+d.nodeSize,u);n.addMark(m,g,s.create({...f.attrs,...e}))}})})}),!0):!1},yJ=(t,e={})=>({state:n,dispatch:r})=>{const o=on(t,n.schema);return AK(o,e)(n,r)},bJ=(t,e={})=>({state:n,dispatch:r})=>{const o=on(t,n.schema);return PK(o,e)(n,r)};var xJ=Object.freeze({__proto__:null,blur:QK,clearContent:eY,clearNodes:tY,command:nY,createParagraphNear:rY,cut:oY,deleteCurrentNode:iY,deleteNode:sY,deleteRange:aY,deleteSelection:lY,enter:cY,exitCode:uY,extendMarkRange:pY,first:fY,focus:hY,forEach:mY,insertContent:gY,insertContentAt:bY,joinBackward:CY,joinDown:wY,joinForward:SY,joinItemBackward:kY,joinItemForward:MY,joinTextblockBackward:EY,joinTextblockForward:TY,joinUp:xY,keyboardShortcut:LY,lift:AY,liftEmptyBlock:PY,liftListItem:RY,newlineInCode:DY,resetAttributes:IY,scrollIntoView:$Y,selectAll:NY,selectNodeBackward:_Y,selectNodeForward:FY,selectParentNode:BY,selectTextblockEnd:jY,selectTextblockStart:zY,setContent:HY,setMark:nJ,setMeta:rJ,setNode:oJ,setNodeSelection:iJ,setTextSelection:sJ,sinkListItem:aJ,splitBlock:lJ,splitListItem:cJ,toggleList:uJ,toggleMark:dJ,toggleNode:pJ,toggleWrap:fJ,undoInputRule:hJ,unsetAllMarks:mJ,unsetMark:gJ,updateAttributes:vJ,wrapIn:yJ,wrapInList:bJ});const wJ=Pn.create({name:"commands",addCommands(){return{...xJ}}}),CJ=Pn.create({name:"drop",addProseMirrorPlugins(){return[new vn({key:new Gn("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),SJ=Pn.create({name:"editable",addProseMirrorPlugins(){return[new vn({key:new Gn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),kJ=Pn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new vn({key:new Gn("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),MJ=Pn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:d}=l,{pos:p,parent:f}=d,m=d.parent.isTextblock&&p>0?a.doc.resolve(p-1):d,g=m.parent.type.spec.isolating,y=d.pos-d.parentOffset,b=g&&m.parent.childCount===1?y===d.pos:Ze.atStart(c).from===p;return!u||!f.type.isTextblock||f.textContent.length||!b||b&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return zu()||xk()?i:o},addProseMirrorPlugins(){return[new vn({key:new Gn("clearDocument"),appendTransaction:(t,e,n)=>{const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),o=t.some(g=>g.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:a}=e.selection,l=Ze.atStart(e.doc).from,c=Ze.atEnd(e.doc).to;if(i||!(s===l&&a===c)||!Rm(n.doc))return;const p=n.tr,f=Nu({state:n,transaction:p}),{commands:m}=new _u({editor:this.editor,state:f});if(m.clearNodes(),!!p.steps.length)return p}})]}}),EJ=Pn.create({name:"paste",addProseMirrorPlugins(){return[new vn({key:new Gn("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),TJ=Pn.create({name:"tabindex",addProseMirrorPlugins(){return[new vn({key:new Gn("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Fo{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Fo(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Fo(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Fo(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=this.pos+r+1,s=this.resolvedPos.doc.resolve(i);if(!o&&s.depth<=this.depth)return;const a=new Fo(s,this.editor,o,o?n:null);o&&(a.actualDepth=this.depth+1),e.push(new Fo(s,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const i=o.node.attrs,s=Object.keys(n);for(let a=0;a{r&&o.length>0||(s.node.type.name===e&&i.every(l=>n[l]===s.node.attrs[l])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,n,r))))}),o}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const OJ=`.ProseMirror { +`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,o,(l,c,u,d)=>{var p;l.isBlock&&c>r&&(a+=i);const f=s==null?void 0:s[l.type.name];if(f)return u&&(a+=f({node:l,pos:c,parent:u,index:d,range:e})),!1;l.isText&&(a+=(p=l==null?void 0:l.text)===null||p===void 0?void 0:p.slice(Math.max(r,c)-c,o-c))}),a}function gk(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const XK=Pn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new vn({key:new Gn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map(u=>u.$from.pos)),a=Math.max(...i.map(u=>u.$to.pos)),l=gk(n);return mk(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),QK=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),eY=(t=!1)=>({commands:e})=>e.setContent("",t),tY=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),p=c.resolve(u.map(l+a.nodeSize)),f=d.blockRange(p);if(!f)return;const m=Iq(f);if(a.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(f.start,g)}(m||m===0)&&e.lift(f,m)})}),!0},nY=t=>e=>t(e),rY=()=>({state:t,dispatch:e})=>kK(t,e),oY=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new Ke(r.doc.resolve(s-1))),!0},iY=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(e){const a=o.before(i),l=o.after(i);t.delete(a,l).scrollIntoView()}return!0}return!1},sY=t=>({tr:e,state:n,dispatch:r})=>{const o=on(t,n.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const l=i.before(s),c=i.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},aY=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},lY=()=>({state:t,dispatch:e})=>pK(t,e),cY=()=>({commands:t})=>t.keyboardShortcut("Enter"),uY=()=>({state:t,dispatch:e})=>SK(t,e);function Oc(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Tm(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function hf(t,e,n={}){return t.find(r=>r.type===e&&Oc(r.attrs,n))}function dY(t,e,n={}){return!!hf(t,e,n)}function Om(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const o=hf([...r.node.marks],e,n);if(!o)return;let i=r.index,s=t.start()+r.offset,a=i+1,l=s+r.node.nodeSize;for(hf([...r.node.marks],e,n);i>0&&o.isInSet(t.parent.child(i-1).marks);)i-=1,s-=t.parent.child(i).nodeSize;for(;a({tr:n,state:r,dispatch:o})=>{const i=Lo(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const d=Om(l,i,e);if(d&&d.from<=c&&d.to>=u){const p=Ke.create(s,d.from,d.to);n.setSelection(p)}}return!0},fY=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{Hu()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!vk(n.state.selection))return s(),!0;const a=yk(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},mY=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),gY=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),bk=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&bk(r)}return t};function El(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return bk(n)}function Lc(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return ne.fromArray(t.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),Lc("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new BC({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?oa.fromSchema(l).parseSlice(El(t),n.parseOptions):oa.fromSchema(l).parse(El(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=oa.fromSchema(e);return n.slice?i.parseSlice(El(t),n.parseOptions).content:i.parse(El(t),n.parseOptions)}return Lc("",e,n)}function vY(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=u)}),t.setSelection(Ze.near(t.doc.resolve(s),n))}const yY=t=>!("type"in t),bY=(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=Lc(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(m){return i.emit("contentError",{editor:i,error:m,disableCollaboration:()=>{console.error("[tiptap error]: Unable to disable collaboration at this point in time")}}),!1}let{from:l,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,d=!0;if((yY(a)?a:[a]).forEach(m=>{m.check(),u=u?m.isText&&m.marks.length===0:!1,d=d?m.isBlock:!1}),l===c&&d){const{parent:m}=r.doc.resolve(l);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(l-=1,c+=1)}let f;u?(Array.isArray(e)?f=e.map(m=>m.text||"").join(""):typeof e=="object"&&e&&e.text?f=e.text:f=e,r.insertText(f,l,c)):(f=a,r.replaceWith(l,c,f)),n.updateSelection&&vY(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:f}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:f})}return!0},xY=()=>({state:t,dispatch:e})=>bK(t,e),wY=()=>({state:t,dispatch:e})=>xK(t,e),CY=()=>({state:t,dispatch:e})=>fK(t,e),SY=()=>({state:t,dispatch:e})=>vK(t,e),kY=()=>({state:t,dispatch:e,tr:n})=>{try{const r=GS(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},MY=()=>({state:t,dispatch:e,tr:n})=>{try{const r=GS(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},EY=()=>({state:t,dispatch:e})=>hK(t,e),TY=()=>({state:t,dispatch:e})=>mK(t,e);function xk(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function OY(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let a=0;a({editor:e,view:n,tr:r,dispatch:o})=>{const i=OY(t).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function Ea(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?on(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(d,p)=>{if(d.isText)return;const f=Math.max(r,p),m=Math.min(o,p+d.nodeSize);a.push({node:d,from:f,to:m})});const l=o-r,c=a.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>Oc(d.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((d,p)=>d+p.to-p.from,0)>=l}const AY=(t,e={})=>({state:n,dispatch:r})=>{const o=on(t,n.schema);return Ea(n,o,e)?wK(n,r):!1},PY=()=>({state:t,dispatch:e})=>MK(t,e),RY=t=>({state:e,dispatch:n})=>{const r=on(t,e.schema);return DK(r)(e,n)},DY=()=>({state:t,dispatch:e})=>CK(t,e);function Vu(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function _b(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const IY=(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Vu(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=on(t,r.schema)),a==="mark"&&(s=Lo(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&n.setNodeMarkup(u,void 0,_b(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(_b(d.attrs,e)))})})}),!0):!1},$Y=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),NY=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),_Y=()=>({state:t,dispatch:e})=>gK(t,e),FY=()=>({state:t,dispatch:e})=>yK(t,e),BY=()=>({state:t,dispatch:e})=>EK(t,e),jY=()=>({state:t,dispatch:e})=>LK(t,e),zY=()=>({state:t,dispatch:e})=>OK(t,e);function mf(t,e,n={},r={}){return Lc(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const HY=(t,e=!1,n={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var l,c;const{doc:u}=i;if(n.preserveWhitespace!=="full"){const d=mf(t,o.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:o.options.enableContentCheck});return s&&i.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function Lm(t,e){const n=Lo(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function VY(t,e){const n=new eK(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function WY(t){for(let e=0;e{n(o)&&r.push({node:o,pos:i})}),r}function GY(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Am(t){return e=>GY(e.$from,t)}function qY(t,e){const n=mi.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function KY(t,e){const n={from:0,to:t.content.size};return mk(t,n,e)}function YY(t,e){const n=on(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function wk(t,e){const n=Vu(typeof e=="string"?e:e.name,t.schema);return n==="node"?YY(t,e):n==="mark"?Lm(t,e):{}}function JY(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function ZY(t){const e=JY(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function XY(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[i];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=e.slice(i).map(a,-1),u=e.slice(i).map(l),d=e.invert().map(c,-1),p=e.invert().map(u);r.push({oldRange:{from:d,to:p},newRange:{from:c,to:u}})})}),ZY(r)}function Pm(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const i=n.resolve(t),s=Om(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function Ul(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function gf(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Lo(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>Oc(d.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:d,$to:p})=>{const f=d.pos,m=p.pos;t.doc.nodesBetween(f,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const b=Math.max(f,y),x=Math.min(m,y+g.nodeSize),S=x-b;s+=S,a.push(...g.marks.map(E=>({mark:E,from:b,to:x})))})}),s===0)return!1;const l=a.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>Oc(d.mark.attrs,n,{strict:!1})).reduce((d,p)=>d+p.to-p.from,0),c=a.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,p)=>d+p.to-p.from,0);return(l>0?l+c:l)>=s}function QY(t,e,n={}){if(!e)return Ea(t,null,n)||gf(t,null,n);const r=Vu(e,t.schema);return r==="node"?Ea(t,e,n):r==="mark"?gf(t,e,n):!1}function Fb(t,e){const{nodeExtensions:n}=Bu(e),r=n.find(s=>s.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=Je(Ie(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function Rm(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(Rm(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function eJ(t,e,n){const o=t.state.doc.content.size,i=Hr(e,0,o),s=Hr(n,0,o),a=t.coordsAtPos(i),l=t.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),p=Math.max(a.right,l.right),f=p-d,m=u-c,b={top:c,bottom:u,left:d,right:p,width:f,height:m,x:d,y:c};return{...b,toJSON:()=>b}}function tJ(t,e,n){var r;const{selection:o}=e;let i=null;if(vk(o)&&(i=o.$cursor),i){const a=(r=t.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,d,p)=>{if(c)return!1;if(u.isInline){const f=!p||p.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=f&&m}return!c}),c})}const nJ=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Lo(t,r.schema);if(o)if(s){const c=Lm(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(p,f)=>{const m=Math.max(f,u),g=Math.min(f+p.nodeSize,d);p.marks.find(b=>b.type===l)?p.marks.forEach(b=>{l===b.type&&n.addMark(m,g,l.create({...b.attrs,...e}))}):n.addMark(m,g,l.create(e))})});return tJ(r,n,l)},rJ=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),oJ=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=on(t,n.schema);return i.isTextblock?o().command(({commands:s})=>Db(i,e)(n)?!0:s.clearNodes()).command(({state:s})=>Db(i,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},iJ=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Hr(t,0,r.content.size),i=Ve.create(r,o);e.setSelection(i)}return!0},sJ=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,s=Ke.atStart(r).from,a=Ke.atEnd(r).to,l=Hr(o,s,a),c=Hr(i,s,a),u=Ke.create(r,l,c);e.setSelection(u)}return!0},aJ=t=>({state:e,dispatch:n})=>{const r=on(t,e.schema);return NK(r)(e,n)};function Bb(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const lJ=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=o.extensionManager.attributes,u=Ul(c,a.node().type.name,a.node().attrs);if(i instanceof Ve&&i.node.isBlock)return!a.parentOffset||!Hl(s,a.pos)?!1:(r&&(t&&Bb(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,p=a.depth===0?void 0:WY(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=d&&p?[{type:p,attrs:u}]:void 0,m=Hl(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!m&&Hl(e.doc,e.mapping.map(a.pos),1,p?[{type:p}]:void 0)&&(m=!0,f=p?[{type:p,attrs:u}]:void 0),r){if(m&&(i instanceof Ke&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,f),p&&!d&&!a.parentOffset&&a.parent.type!==p)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,p)&&e.setNodeMarkup(e.mapping.map(a.before()),p)}t&&Bb(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return m},cJ=(t,e={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const a=on(t,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const d=l.node(-1);if(d.type!==a)return!1;const p=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let b=ne.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let T=l.depth-x;T>=l.depth-3;T-=1)b=ne.from(l.node(T).copy(b));const S=l.indexAfter(-1){if(M>-1)return!1;T.isTextblock&&T.content.size===0&&(M=D+1)}),M>-1&&n.setSelection(Ke.near(n.doc.resolve(M))),n.scrollIntoView()}return!0}const f=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,m={...Ul(p,d.type.name,d.attrs),...e},g={...Ul(p,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const y=f?[{type:a,attrs:m},{type:f,attrs:g}]:[{type:a,attrs:m}];if(!Hl(n.doc,l.pos,2))return!1;if(o){const{selection:b,storedMarks:x}=r,{splittableMarks:S}=i.extensionManager,E=x||b.$to.parentOffset&&b.$from.marks();if(n.split(l.pos,2,y).scrollIntoView(),!E||!o)return!0;const k=E.filter(w=>S.includes(w.type.name));n.ensureMarks(k)}return!0},Qd=(t,e)=>{const n=Am(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Cm(t.doc,n.pos)&&t.join(n.pos),!0},ep=(t,e)=>{const n=Am(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Cm(t.doc,r)&&t.join(r),!0},uJ=(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:p}=o.extensionManager,f=on(t,s.schema),m=on(e,s.schema),{selection:g,storedMarks:y}=s,{$from:b,$to:x}=g,S=b.blockRange(x),E=y||g.$to.parentOffset&&g.$from.marks();if(!S)return!1;const k=Am(w=>Fb(w.type.name,d))(g);if(S.depth>=1&&k&&S.depth-k.depth<=1){if(k.node.type===f)return c.liftListItem(m);if(Fb(k.node.type.name,d)&&f.validContent(k.node.content)&&a)return l().command(()=>(i.setNodeMarkup(k.pos,f),!0)).command(()=>Qd(i,f)).command(()=>ep(i,f)).run()}return!n||!E||!a?l().command(()=>u().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>Qd(i,f)).command(()=>ep(i,f)).run():l().command(()=>{const w=u().wrapInList(f,r),M=E.filter(T=>p.includes(T.type.name));return i.ensureMarks(M),w?!0:c.clearNodes()}).wrapInList(f,r).command(()=>Qd(i,f)).command(()=>ep(i,f)).run()},dJ=(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Lo(t,r.schema);return gf(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},pJ=(t,e,n={})=>({state:r,commands:o})=>{const i=on(t,r.schema),s=on(e,r.schema),a=Ea(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?o.setNode(s,l):o.setNode(i,{...l,...n})},fJ=(t,e={})=>({state:n,commands:r})=>{const o=on(t,n.schema);return Ea(n,o,e)?r.lift(o):r.wrapIn(o,e)},hJ=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1},mJ=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},gJ=(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Lo(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&s){let{from:p,to:f}=a;const m=(i=c.marks().find(y=>y.type===l))===null||i===void 0?void 0:i.attrs,g=Om(c,l,m);g&&(p=g.from,f=g.to),n.removeMark(p,f,l)}else d.forEach(p=>{n.removeMark(p.$from.pos,p.$to.pos,l)});return n.removeStoredMark(l),!0},vJ=(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=Vu(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=on(t,r.schema)),a==="mark"&&(s=Lo(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(d,p)=>{i&&i===d.type&&n.setNodeMarkup(p,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(f=>{if(s===f.type){const m=Math.max(p,c),g=Math.min(p+d.nodeSize,u);n.addMark(m,g,s.create({...f.attrs,...e}))}})})}),!0):!1},yJ=(t,e={})=>({state:n,dispatch:r})=>{const o=on(t,n.schema);return AK(o,e)(n,r)},bJ=(t,e={})=>({state:n,dispatch:r})=>{const o=on(t,n.schema);return PK(o,e)(n,r)};var xJ=Object.freeze({__proto__:null,blur:QK,clearContent:eY,clearNodes:tY,command:nY,createParagraphNear:rY,cut:oY,deleteCurrentNode:iY,deleteNode:sY,deleteRange:aY,deleteSelection:lY,enter:cY,exitCode:uY,extendMarkRange:pY,first:fY,focus:hY,forEach:mY,insertContent:gY,insertContentAt:bY,joinBackward:CY,joinDown:wY,joinForward:SY,joinItemBackward:kY,joinItemForward:MY,joinTextblockBackward:EY,joinTextblockForward:TY,joinUp:xY,keyboardShortcut:LY,lift:AY,liftEmptyBlock:PY,liftListItem:RY,newlineInCode:DY,resetAttributes:IY,scrollIntoView:$Y,selectAll:NY,selectNodeBackward:_Y,selectNodeForward:FY,selectParentNode:BY,selectTextblockEnd:jY,selectTextblockStart:zY,setContent:HY,setMark:nJ,setMeta:rJ,setNode:oJ,setNodeSelection:iJ,setTextSelection:sJ,sinkListItem:aJ,splitBlock:lJ,splitListItem:cJ,toggleList:uJ,toggleMark:dJ,toggleNode:pJ,toggleWrap:fJ,undoInputRule:hJ,unsetAllMarks:mJ,unsetMark:gJ,updateAttributes:vJ,wrapIn:yJ,wrapInList:bJ});const wJ=Pn.create({name:"commands",addCommands(){return{...xJ}}}),CJ=Pn.create({name:"drop",addProseMirrorPlugins(){return[new vn({key:new Gn("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),SJ=Pn.create({name:"editable",addProseMirrorPlugins(){return[new vn({key:new Gn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),kJ=Pn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new vn({key:new Gn("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),MJ=Pn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:d}=l,{pos:p,parent:f}=d,m=d.parent.isTextblock&&p>0?a.doc.resolve(p-1):d,g=m.parent.type.spec.isolating,y=d.pos-d.parentOffset,b=g&&m.parent.childCount===1?y===d.pos:Ze.atStart(c).from===p;return!u||!f.type.isTextblock||f.textContent.length||!b||b&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Hu()||xk()?i:o},addProseMirrorPlugins(){return[new vn({key:new Gn("clearDocument"),appendTransaction:(t,e,n)=>{const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),o=t.some(g=>g.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:a}=e.selection,l=Ze.atStart(e.doc).from,c=Ze.atEnd(e.doc).to;if(i||!(s===l&&a===c)||!Rm(n.doc))return;const p=n.tr,f=_u({state:n,transaction:p}),{commands:m}=new Fu({editor:this.editor,state:f});if(m.clearNodes(),!!p.steps.length)return p}})]}}),EJ=Pn.create({name:"paste",addProseMirrorPlugins(){return[new vn({key:new Gn("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),TJ=Pn.create({name:"tabindex",addProseMirrorPlugins(){return[new vn({key:new Gn("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Fo{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Fo(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Fo(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Fo(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=this.pos+r+1,s=this.resolvedPos.doc.resolve(i);if(!o&&s.depth<=this.depth)return;const a=new Fo(s,this.editor,o,o?n:null);o&&(a.actualDepth=this.depth+1),e.push(new Fo(s,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const i=o.node.attrs,s=Object.keys(n);for(let a=0;a{r&&o.length>0||(s.node.type.name===e&&i.every(l=>n[l]===s.node.attrs[l])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,n,r))))}),o}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const OJ=`.ProseMirror { position: relative; } @@ -843,9 +843,9 @@ img.ProseMirror-separator { .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 -}`;function LJ(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}let AJ=class extends _K{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=LJ(OJ,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=hk(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(n))});return this.view.updateState(r),r}createExtensionManager(){var e,n;const o=[...this.options.enableCoreExtensions?[SJ,XK.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),wJ,kJ,MJ,TJ,CJ,EJ].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Qi(o,this)}createCommandManager(){this.commandManager=new _u({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=hf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(i){if(!(i instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(i.message))throw i;this.emit("contentError",{editor:this,error:i,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=hf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=yk(e,this.options.autofocus);this.view=new yq(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Xi.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return wk(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return QY(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return qY(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=` +}`;function LJ(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}let AJ=class extends _K{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=LJ(OJ,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=hk(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(o=>!o.key.startsWith(n))});return this.view.updateState(r),r}createExtensionManager(){var e,n;const o=[...this.options.enableCoreExtensions?[SJ,XK.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),wJ,kJ,MJ,TJ,CJ,EJ].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new Qi(o,this)}createCommandManager(){this.commandManager=new Fu({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){let e;try{e=mf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(i){if(!(i instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(i.message))throw i;this.emit("contentError",{editor:this,error:i,disableCollaboration:()=>{this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),e=mf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=yk(e,this.options.autofocus);this.view=new yq(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Xi.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return wk(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return QY(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return qY(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=` -`,textSerializers:r={}}=e||{};return KY(this.state.doc,{blockSeparator:n,textSerializers:{...gk(this.schema),...r}})}get isEmpty(){return Rm(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Fo(n,this)}get $doc(){return this.$pos(0)}};function fs(t){return new Bu({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Je(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(Pm(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(g=>g===t.type&&g!==f.mark.type)).filter(f=>f.to>c).length)return null;un.from&&i.delete(n.from+l,c);const p=n.from+l+s.length;i.addMark(n.from+l,p,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function PJ(t){return new Bu({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Je(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from;let a=n.to;const l=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>a?u=a:a=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,s+r[0].length-1),i.replaceWith(u,a,l)}else if(r[0]){const c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function gf(t){return new Bu({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=Je(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}function Ta(t){return new Bu({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const i=Je(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&Nq(l,t.type,i);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:d,storedMarks:p}=e,{splittableMarks:f}=t.editor.extensionManager,m=p||d.$to.parentOffset&&d.$from.marks();if(m){const g=m.filter(y=>f.includes(y.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(d,i).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Cm(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let qn=class vf{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Je(Ie(this,"addOptions",{name:this.name}))),this.storage=Je(Ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new vf(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>ju(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new vf(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Je(Ie(n,"addOptions",{name:n.name})),n.storage=Je(Ie(n,"addStorage",{name:n.name,options:n.options})),n}};function RJ(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class DJ{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,o,i,s,a,l;const{view:c}=this.editor,u=e.target,d=u.nodeType===3?(n=u.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!d)return;let p=0,f=0;if(this.dom!==d){const b=this.dom.getBoundingClientRect(),x=d.getBoundingClientRect(),S=(o=e.offsetX)!==null&&o!==void 0?o:(i=e.nativeEvent)===null||i===void 0?void 0:i.offsetX,E=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;p=x.x-b.x+S,f=x.y-b.y+E}(l=e.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,p,f);const m=this.getPos();if(typeof m!="number")return;const g=Ve.create(c.state.doc,m),y=c.state.tr.setSelection(g);c.dispatch(y)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const i=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!i)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,d=Ve.isSelectable(this.node),p=e.type==="copy",f=e.type==="paste",m=e.type==="cut",g=e.type==="mousedown";if(!u&&d&&i&&e.preventDefault(),u&&i&&!c)return e.preventDefault(),!1;if(u&&l&&!c&&g){const y=r.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||s||p||f||m||g&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(zu()||RJ())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function oi(t){return new GK({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const i=Je(t.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),d=n.from+l.indexOf(a),p=d+a.length;if(Pm(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>d).length)return null;pn.from&&s.delete(n.from+u,d),c=n.from+u+a.length,s.addMark(n.from+u,c,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function IJ(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ck={exports:{}},ep={};/** +`,textSerializers:r={}}=e||{};return KY(this.state.doc,{blockSeparator:n,textSerializers:{...gk(this.schema),...r}})}get isEmpty(){return Rm(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Fo(n,this)}get $doc(){return this.$pos(0)}};function fs(t){return new ju({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Je(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(Pm(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(g=>g===t.type&&g!==f.mark.type)).filter(f=>f.to>c).length)return null;un.from&&i.delete(n.from+l,c);const p=n.from+l+s.length;i.addMark(n.from+l,p,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function PJ(t){return new ju({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Je(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from;let a=n.to;const l=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>a?u=a:a=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,s+r[0].length-1),i.replaceWith(u,a,l)}else if(r[0]){const c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function vf(t){return new ju({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=Je(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}function Ta(t){return new ju({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const i=Je(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&Nq(l,t.type,i);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:d,storedMarks:p}=e,{splittableMarks:f}=t.editor.extensionManager,m=p||d.$to.parentOffset&&d.$from.marks();if(m){const g=m.filter(y=>f.includes(y.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(d,i).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Cm(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}let qn=class yf{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Je(Ie(this,"addOptions",{name:this.name}))),this.storage=Je(Ie(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new yf(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>zu(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new yf(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Je(Ie(n,"addOptions",{name:n.name})),n.storage=Je(Ie(n,"addStorage",{name:n.name,options:n.options})),n}};function RJ(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class DJ{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,o,i,s,a,l;const{view:c}=this.editor,u=e.target,d=u.nodeType===3?(n=u.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!d)return;let p=0,f=0;if(this.dom!==d){const b=this.dom.getBoundingClientRect(),x=d.getBoundingClientRect(),S=(o=e.offsetX)!==null&&o!==void 0?o:(i=e.nativeEvent)===null||i===void 0?void 0:i.offsetX,E=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;p=x.x-b.x+S,f=x.y-b.y+E}(l=e.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,p,f);const m=this.getPos();if(typeof m!="number")return;const g=Ve.create(c.state.doc,m),y=c.state.tr.setSelection(g);c.dispatch(y)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const i=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!i)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,d=Ve.isSelectable(this.node),p=e.type==="copy",f=e.type==="paste",m=e.type==="cut",g=e.type==="mousedown";if(!u&&d&&i&&e.preventDefault(),u&&i&&!c)return e.preventDefault(),!1;if(u&&l&&!c&&g){const y=r.closest("[data-drag-handle]");y&&(this.dom===y||this.dom.contains(y))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||s||p||f||m||g&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Hu()||RJ())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function oi(t){return new GK({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const i=Je(t.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),d=n.from+l.indexOf(a),p=d+a.length;if(Pm(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>d).length)return null;pn.from&&s.delete(n.from+u,d),c=n.from+u+a.length,s.addMark(n.from+u,c,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function IJ(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ck={exports:{}},tp={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -853,7 +853,7 @@ img.ProseMirror-separator { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var jb;function $J(){if(jb)return ep;jb=1;var t=O;function e(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function a(d,p){var f=p(),m=r({inst:{value:f,getSnapshot:p}}),g=m[0].inst,y=m[1];return i(function(){g.value=f,g.getSnapshot=p,l(g)&&y({inst:g})},[d,f,p]),o(function(){return l(g)&&y({inst:g}),d(function(){l(g)&&y({inst:g})})},[d]),s(f),f}function l(d){var p=d.getSnapshot;d=d.value;try{var f=p();return!n(d,f)}catch{return!0}}function c(d,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return ep.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,ep}Ck.exports=$J();var Dm=Ck.exports;const NJ=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},_J=({contentComponent:t})=>{const e=Dm.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return O.createElement(O.Fragment,null,Object.values(e))};function FJ(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:kT.createPortal(r.reactElement,r.element,n)},t.forEach(o=>o())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(o=>o())}}}class BJ extends O.Component{constructor(e){var n;super(e),this.editorContentRef=O.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=FJ(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return O.createElement(O.Fragment,null,O.createElement("div",{ref:NJ(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&O.createElement(_J,{contentComponent:e.contentComponent}))}}const jJ=h.forwardRef((t,e)=>{const n=O.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return O.createElement(BJ,{key:n,innerRef:e,...t})}),zJ=O.memo(jJ);var HJ=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!t(e[o],n[o]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],n.get(o[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(e[o]!==n[o])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},VJ=IJ(HJ),Sk={exports:{}},tp={};/** + */var jb;function $J(){if(jb)return tp;jb=1;var t=O;function e(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function a(d,p){var f=p(),m=r({inst:{value:f,getSnapshot:p}}),g=m[0].inst,y=m[1];return i(function(){g.value=f,g.getSnapshot=p,l(g)&&y({inst:g})},[d,f,p]),o(function(){return l(g)&&y({inst:g}),d(function(){l(g)&&y({inst:g})})},[d]),s(f),f}function l(d){var p=d.getSnapshot;d=d.value;try{var f=p();return!n(d,f)}catch{return!0}}function c(d,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return tp.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,tp}Ck.exports=$J();var Dm=Ck.exports;const NJ=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},_J=({contentComponent:t})=>{const e=Dm.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return O.createElement(O.Fragment,null,Object.values(e))};function FJ(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:kT.createPortal(r.reactElement,r.element,n)},t.forEach(o=>o())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(o=>o())}}}class BJ extends O.Component{constructor(e){var n;super(e),this.editorContentRef=O.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=FJ(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return O.createElement(O.Fragment,null,O.createElement("div",{ref:NJ(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&O.createElement(_J,{contentComponent:e.contentComponent}))}}const jJ=h.forwardRef((t,e)=>{const n=O.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return O.createElement(BJ,{key:n,innerRef:e,...t})}),zJ=O.memo(jJ);var HJ=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!t(e[o],n[o]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],n.get(o[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(e[o]!==n[o])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},VJ=IJ(HJ),Sk={exports:{}},np={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -861,7 +861,7 @@ img.ProseMirror-separator { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var zb;function WJ(){if(zb)return tp;zb=1;var t=O,e=Dm;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return tp.useSyncExternalStoreWithSelector=function(c,u,d,p,f){var m=i(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=a(function(){function b(w){if(!x){if(x=!0,S=w,w=p(w),f!==void 0&&g.hasValue){var M=g.value;if(f(M,w))return E=M}return E=w}if(M=E,r(S,w))return M;var T=p(w);return f!==void 0&&f(M,T)?M:(S=w,E=T)}var x=!1,S,E,k=d===void 0?null:d;return[function(){return b(u())},k===null?void 0:function(){return b(k())}]},[u,d,p,f]);var y=o(c,m[0],m[1]);return s(function(){g.hasValue=!0,g.value=y},[y]),l(y),y},tp}Sk.exports=WJ();var UJ=Sk.exports;class GJ{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(o=>o())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function qJ(t){var e;const[n]=h.useState(()=>new GJ(t.editor)),r=UJ.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:VJ);return h.useEffect(()=>n.watch(t.editor),[t.editor,n]),h.useDebugValue(r),r}const KJ=!1,yf=typeof window>"u",YJ=yf||!!(typeof window<"u"&&window.next);class JJ{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return yf||YJ?null:this.createEditor();if(this.options.current.immediatelyRender&&yf&&KJ)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onBeforeCreate)===null||i===void 0?void 0:i.call(o,...r)},onBlur:(...r)=>{var o,i;return(i=(o=this.options.current).onBlur)===null||i===void 0?void 0:i.call(o,...r)},onCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onCreate)===null||i===void 0?void 0:i.call(o,...r)},onDestroy:(...r)=>{var o,i;return(i=(o=this.options.current).onDestroy)===null||i===void 0?void 0:i.call(o,...r)},onFocus:(...r)=>{var o,i;return(i=(o=this.options.current).onFocus)===null||i===void 0?void 0:i.call(o,...r)},onSelectionUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onSelectionUpdate)===null||i===void 0?void 0:i.call(o,...r)},onTransaction:(...r)=>{var o,i;return(i=(o=this.options.current).onTransaction)===null||i===void 0?void 0:i.call(o,...r)},onUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onUpdate)===null||i===void 0?void 0:i.call(o,...r)},onContentError:(...r)=>{var o,i;return(i=(o=this.options.current).onContentError)===null||i===void 0?void 0:i.call(o,...r)},onDrop:(...r)=>{var o,i;return(i=(o=this.options.current).onDrop)===null||i===void 0?void 0:i.call(o,...r)},onPaste:(...r)=>{var o,i;return(i=(o=this.options.current).onPaste)===null||i===void 0?void 0:i.call(o,...r)}};return new AJ(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions(this.options.current):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,o)=>r===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function ZJ(t={},e=[]){const n=h.useRef(t);n.current=t;const[r]=h.useState(()=>new JJ(n)),o=Dm.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return h.useDebugValue(o),h.useEffect(r.onRender(e)),qJ({editor:o,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&i===0?0:i+1}),o}const XJ=h.createContext({editor:null});XJ.Consumer;const kk=h.createContext({onDragStart:void 0}),QJ=()=>h.useContext(kk),eZ=O.forwardRef((t,e)=>{const{onDragStart:n}=QJ(),r=t.as||"div";return O.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function tZ(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function nZ(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class rZ{constructor(e,{editor:n,props:r={},as:o="div",className:i=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(o),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?Eo.flushSync(()=>{this.render()}):this.render()}render(){var e;const n=this.component,r=this.props,o=this.editor;(tZ(n)||nZ(n))&&(r.ref=i=>{this.ref=i}),this.reactElement=O.createElement(n,r),(e=o==null?void 0:o.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const n=this.editor;(e=n==null?void 0:n.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(n=>{this.element.setAttribute(n,e[n])})}}class oZ extends DJ{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const c=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=c(this.extension.name)}const o={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)}},i=this.component,s=O.memo(c=>O.createElement(kk.Provider,{value:o},O.createElement(i,c)));s.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.style.whiteSpace="inherit");let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new rZ(s,{editor:this.editor,props:e,as:a,className:`node-${this.node.type.name} ${l}`.trim()}),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,r){const o=i=>{this.renderer.updateProps(i),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,s=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:i,oldDecorations:s,newNode:e,newDecorations:n,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>o({node:e,decorations:n,innerDecorations:r})})}return e===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=e,this.decorations=n,this.innerDecorations=r,o({node:e,decorations:n,innerDecorations:r})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const n=this.editor.extensionManager.attributes,r=Tc(this.node,n);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}function iZ(t,e){return n=>n.editor.contentComponent?new oZ(t,n,e):{}}const Mk=ko`font-size: font-size: 28px;`,Ek=ko`font-size: font-size: 36px;`,Tk=ko`font-size: font-size: 22px;`,Ok=ko`font-size: font-size: 14px;`,Lk=ko`font-size: font-size: 12px;`,Ak=ko`font-size: font-size: 12px;`,Pk=ko` + */var zb;function WJ(){if(zb)return np;zb=1;var t=O,e=Dm;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return np.useSyncExternalStoreWithSelector=function(c,u,d,p,f){var m=i(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=a(function(){function b(w){if(!x){if(x=!0,S=w,w=p(w),f!==void 0&&g.hasValue){var M=g.value;if(f(M,w))return E=M}return E=w}if(M=E,r(S,w))return M;var T=p(w);return f!==void 0&&f(M,T)?M:(S=w,E=T)}var x=!1,S,E,k=d===void 0?null:d;return[function(){return b(u())},k===null?void 0:function(){return b(k())}]},[u,d,p,f]);var y=o(c,m[0],m[1]);return s(function(){g.hasValue=!0,g.value=y},[y]),l(y),y},np}Sk.exports=WJ();var UJ=Sk.exports;class GJ{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(o=>o())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function qJ(t){var e;const[n]=h.useState(()=>new GJ(t.editor)),r=UJ.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:VJ);return h.useEffect(()=>n.watch(t.editor),[t.editor,n]),h.useDebugValue(r),r}const KJ=!1,bf=typeof window>"u",YJ=bf||!!(typeof window<"u"&&window.next);class JJ{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return bf||YJ?null:this.createEditor();if(this.options.current.immediatelyRender&&bf&&KJ)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onBeforeCreate)===null||i===void 0?void 0:i.call(o,...r)},onBlur:(...r)=>{var o,i;return(i=(o=this.options.current).onBlur)===null||i===void 0?void 0:i.call(o,...r)},onCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onCreate)===null||i===void 0?void 0:i.call(o,...r)},onDestroy:(...r)=>{var o,i;return(i=(o=this.options.current).onDestroy)===null||i===void 0?void 0:i.call(o,...r)},onFocus:(...r)=>{var o,i;return(i=(o=this.options.current).onFocus)===null||i===void 0?void 0:i.call(o,...r)},onSelectionUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onSelectionUpdate)===null||i===void 0?void 0:i.call(o,...r)},onTransaction:(...r)=>{var o,i;return(i=(o=this.options.current).onTransaction)===null||i===void 0?void 0:i.call(o,...r)},onUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onUpdate)===null||i===void 0?void 0:i.call(o,...r)},onContentError:(...r)=>{var o,i;return(i=(o=this.options.current).onContentError)===null||i===void 0?void 0:i.call(o,...r)},onDrop:(...r)=>{var o,i;return(i=(o=this.options.current).onDrop)===null||i===void 0?void 0:i.call(o,...r)},onPaste:(...r)=>{var o,i;return(i=(o=this.options.current).onPaste)===null||i===void 0?void 0:i.call(o,...r)}};return new AJ(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?this.editor.setOptions(this.options.current):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,o)=>r===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function ZJ(t={},e=[]){const n=h.useRef(t);n.current=t;const[r]=h.useState(()=>new JJ(n)),o=Dm.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return h.useDebugValue(o),h.useEffect(r.onRender(e)),qJ({editor:o,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&i===0?0:i+1}),o}const XJ=h.createContext({editor:null});XJ.Consumer;const kk=h.createContext({onDragStart:void 0}),QJ=()=>h.useContext(kk),eZ=O.forwardRef((t,e)=>{const{onDragStart:n}=QJ(),r=t.as||"div";return O.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function tZ(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function nZ(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class rZ{constructor(e,{editor:n,props:r={},as:o="div",className:i=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(o),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?Eo.flushSync(()=>{this.render()}):this.render()}render(){var e;const n=this.component,r=this.props,o=this.editor;(tZ(n)||nZ(n))&&(r.ref=i=>{this.ref=i}),this.reactElement=O.createElement(n,r),(e=o==null?void 0:o.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const n=this.editor;(e=n==null?void 0:n.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(n=>{this.element.setAttribute(n,e[n])})}}class oZ extends DJ{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const c=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=c(this.extension.name)}const o={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)}},i=this.component,s=O.memo(c=>O.createElement(kk.Provider,{value:o},O.createElement(i,c)));s.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.style.whiteSpace="inherit");let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new rZ(s,{editor:this.editor,props:e,as:a,className:`node-${this.node.type.name} ${l}`.trim()}),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){const{from:e,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,r){const o=i=>{this.renderer.updateProps(i),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,s=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:i,oldDecorations:s,newNode:e,newDecorations:n,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>o({node:e,decorations:n,innerDecorations:r})})}return e===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=e,this.decorations=n,this.innerDecorations=r,o({node:e,decorations:n,innerDecorations:r})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const n=this.editor.extensionManager.attributes,r=Tc(this.node,n);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}function iZ(t,e){return n=>n.editor.contentComponent?new oZ(t,n,e):{}}const Mk=ko`font-size: font-size: 28px;`,Ek=ko`font-size: font-size: 36px;`,Tk=ko`font-size: font-size: 22px;`,Ok=ko`font-size: font-size: 14px;`,Lk=ko`font-size: font-size: 12px;`,Ak=ko`font-size: font-size: 12px;`,Pk=ko` &:disabled { color: ${_.colors.gray400}; } @@ -1251,15 +1251,15 @@ img.ProseMirror-separator { gap: 4px; font-size: 14px; color: ${_.colors.teal}; -`;var _m={},CZ=kt;Object.defineProperty(_m,"__esModule",{value:!0});var Fm=_m.default=void 0,SZ=CZ(Mt()),kZ=St();Fm=_m.default=(0,SZ.default)((0,kZ.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"OpenInNew");function MZ({url:t}){return v.jsxs(wZ,{href:t,target:"_blank",children:[v.jsx(Fm,{})," ","Preview"]})}function Dk({onRemove:t}){return v.jsxs(ZT,{$spacing:"compact",children:[v.jsx(un,{color:"yellow",variant:"contained",label:"Submit",type:"submit"}),t&&v.jsx(xZ,{color:"red",variant:"text",label:"Remove",onClick:t})]})}function EZ({editor:t,getFormValues:e,onClose:n,update:r}){const o=Ou(),{state:{data:{url:i}},handleSubmit:s}=o,a=s(h.useCallback(({data:{url:u,newTab:d,text:p}})=>{r({url:u,newTab:d,text:p})},[r])),l=h.useCallback(()=>{t.chain().focus().extendMarkRange("link").unsetLink().run(),n()},[t,n]),c=h.useMemo(()=>[{name:"url",label:"URL",type:"text",required:!0,validateOn:"onSubmit"},{name:"text",label:"Text",type:"text",required:!0,validateOn:"onSubmit"},{name:"open",type:()=>v.jsx(MZ,{url:i}),show:({data:u})=>!!u.url},{name:"newTab",label:"Open in new tab",type:"toggle"}],[i]);return v.jsx(Uu,{...o,fields:c,spacing:"compact",autoFocus:!0,getFormValues:e,onSubmit:a,bottomSlot:v.jsx(Dk,{onRemove:l})})}function TZ({getFormValues:t,update:e}){const n=Ou(),{handleSubmit:r}=n,o=r(h.useCallback(({data:{alt:s,src:a}})=>{e({alt:s,src:a})},[e])),i=h.useMemo(()=>[{name:"src",label:"Source",type:"text",required:!0,validateOn:"onSubmit"},{name:"alt",label:"Alternative Text",type:"text",validateOn:"onSubmit"}],[]);return v.jsx(Uu,{...n,fields:i,spacing:"compact",autoFocus:!0,getFormValues:t,onSubmit:o,bottomSlot:v.jsx(Dk,{})})}const OZ=[{name:"offset",options:{offset:[0,5]}}];function LZ({editor:t,onClose:e,type:n,values:r,update:o,anchorEl:i,open:s}){const a=h.useCallback(async()=>r||{},[r]);return v.jsx(yZ,{anchorEl:i,open:s,modifiers:OZ,children:v.jsx(ET,{onClickAway:e,children:v.jsx(bZ,{children:n==="link"?v.jsx(EZ,{editor:t,getFormValues:a,onClose:e,update:o}):n==="image"?v.jsx(TZ,{editor:t,getFormValues:a,onClose:e,update:o}):null})})})}function Vu({shortcut:t}){const n=window.navigator.userAgent.toUpperCase().includes("MAC")?t.mac:t.pc;return v.jsx(v.Fragment,{children:n})}const Ik=h.forwardRef(function({label:e,children:n,active:r,square:o,shortcut:i,disabled:s,...a},l){const{anchorProps:c,tooltipProps:u}=Rf(),d=p=>{c.ref(p),l&&(typeof l=="function"?l(p):l.current=p)};return v.jsxs(v.Fragment,{children:[v.jsx(Rk,{...a,...c,ref:d,$active:r,$square:o,disabled:s,children:n}),e&&v.jsxs(Df,{...u,children:[e," ",i&&v.jsxs(v.Fragment,{children:["(",v.jsx(Vu,{shortcut:i}),")"]})]})]})});function ws({editor:t,level:e,onClose:n,shortcut:r}){const o=()=>{t.chain().focus().toggleHeading({level:e}).run(),n&&n()};return v.jsxs(Im,{onClick:o,$active:t.isActive("heading",{level:e}),"data-testid":`${Lr.TEXT_EDITOR_HEADING_CONTROL}-${e}`,children:[v.jsx($m,{children:O.createElement(`h${e}`,null,`Heading ${e}`)}),r&&v.jsx(Nm,{children:v.jsx(Vu,{shortcut:r})})]})}function AZ({editor:t,onClose:e,shortcut:n}){const r=()=>{t.chain().focus().setParagraph().run(),e&&e()};return v.jsxs(Im,{onClick:r,$active:t.isActive("paragraph"),children:[v.jsx($m,{children:"Normal Text"}),n&&v.jsx(Nm,{children:v.jsx(Vu,{shortcut:n})})]})}function PZ(t){return v.jsx(ws,{level:1,...t})}function RZ(t){return v.jsx(ws,{level:2,...t})}function DZ(t){return v.jsx(ws,{level:3,...t})}function IZ(t){return v.jsx(ws,{level:4,...t})}function $Z(t){return v.jsx(ws,{level:5,...t})}function NZ(t){return v.jsx(ws,{level:6,...t})}function _Z({name:t,Icon:e,label:n,shortcut:r,cmd:o,editor:i,onClose:s,inputSettings:a}){const l=c=>{o({editor:i,inputSettings:a,event:c}),s()};return v.jsx("li",{children:v.jsxs(Im,{onClick:l,$active:i.isActive(t),"data-testid":`${Lr.TEXT_EDITOR_CONTROL}:${t}`,children:[v.jsxs($m,{children:[e&&v.jsx(e,{}),n]}),r&&v.jsx(Nm,{children:v.jsx(Vu,{shortcut:r})})]})})}function Vb({editor:t,controls:e,MenuButton:n,inputSettings:r,testId:o,disabled:i}){const[s,a]=h.useState(null),l=d=>{a(d.target)},c=()=>{a(null),t.chain().focus()},u=e.some(({name:d})=>t.isActive(d));return v.jsxs(v.Fragment,{children:[n?v.jsx(n,{onClick:l,editor:t,disabled:i}):v.jsx(Ik,{onClick:l,square:!0,active:u,"data-testid":o,disabled:i,children:v.jsx(TT,{})}),v.jsx(mZ,{anchorEl:s,open:!!s,onClose:c,children:e.map((d,p)=>"Component"in d?h.createElement(d.Component,{...d,onClose:c,editor:t,key:p,inputSettings:r,"data-testid":`${Lr.TEXT_EDITOR_CONTROL}:${d.name}`,disabled:i}):h.createElement(_Z,{...d,onClose:c,editor:t,inputSettings:r,key:p}))})]})}function FZ({disabled:t,editor:e,onClick:n}){const r={"Normal Text":e.isActive("paragraph"),"Heading 1":e.isActive("heading",{level:1}),"Heading 2":e.isActive("heading",{level:2}),"Heading 3":e.isActive("heading",{level:3}),"Heading 4":e.isActive("heading",{level:4}),"Heading 5":e.isActive("heading",{level:5}),"Heading 6":e.isActive("heading",{level:6})},o=Object.keys(r).reduce((i,s)=>r[s]?s:i,"");return v.jsx(pZ,{onClick:n,disabled:t,"data-testid":Lr.TEXT_EDITOR_HEADING_MENU,children:o||v.jsx(fZ,{children:"Multiple Styles"})})}var Bm={},BZ=kt;Object.defineProperty(Bm,"__esModule",{value:!0});var $k=Bm.default=void 0,jZ=BZ(Mt()),zZ=St();$k=Bm.default=(0,jZ.default)((0,zZ.jsx)("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5"}),"FormatBold");var jm={},HZ=kt;Object.defineProperty(jm,"__esModule",{value:!0});var Nk=jm.default=void 0,VZ=HZ(Mt()),WZ=St();Nk=jm.default=(0,VZ.default)((0,WZ.jsx)("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear");var zm={},UZ=kt;Object.defineProperty(zm,"__esModule",{value:!0});var _k=zm.default=void 0,GZ=UZ(Mt()),qZ=St();_k=zm.default=(0,GZ.default)((0,qZ.jsx)("path",{d:"M15 15H3v2h12zm0-8H3v2h12zM3 13h18v-2H3zm0 8h18v-2H3zM3 3v2h18V3z"}),"FormatAlignLeft");var Hm={},KZ=kt;Object.defineProperty(Hm,"__esModule",{value:!0});var Fk=Hm.default=void 0,YZ=KZ(Mt()),JZ=St();Fk=Hm.default=(0,YZ.default)((0,JZ.jsx)("path",{d:"M7 15v2h10v-2zm-4 6h18v-2H3zm0-8h18v-2H3zm4-6v2h10V7zM3 3v2h18V3z"}),"FormatAlignCenter");var Vm={},ZZ=kt;Object.defineProperty(Vm,"__esModule",{value:!0});var Bk=Vm.default=void 0,XZ=ZZ(Mt()),QZ=St();Bk=Vm.default=(0,XZ.default)((0,QZ.jsx)("path",{d:"M3 21h18v-2H3zm6-4h12v-2H9zm-6-4h18v-2H3zm6-4h12V7H9zM3 3v2h18V3z"}),"FormatAlignRight");var Wm={},eX=kt;Object.defineProperty(Wm,"__esModule",{value:!0});var jk=Wm.default=void 0,tX=eX(Mt()),nX=St();jk=Wm.default=(0,tX.default)((0,nX.jsx)("path",{d:"M3 21h18v-2H3zm0-4h18v-2H3zm0-4h18v-2H3zm0-4h18V7H3zm0-6v2h18V3z"}),"FormatAlignJustify");var Um={},rX=kt;Object.defineProperty(Um,"__esModule",{value:!0});var zk=Um.default=void 0,oX=rX(Mt()),iX=St();zk=Um.default=(0,oX.default)((0,iX.jsx)("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Image");var Gm={},sX=kt;Object.defineProperty(Gm,"__esModule",{value:!0});var Hk=Gm.default=void 0,aX=sX(Mt()),lX=St();Hk=Gm.default=(0,aX.default)((0,lX.jsx)("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}),"FormatItalic");var qm={},cX=kt;Object.defineProperty(qm,"__esModule",{value:!0});var Vk=qm.default=void 0,uX=cX(Mt()),dX=St();Vk=qm.default=(0,uX.default)((0,dX.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");var Km={},pX=kt;Object.defineProperty(Km,"__esModule",{value:!0});var Wk=Km.default=void 0,fX=pX(Mt()),hX=St();Wk=Km.default=(0,fX.default)((0,hX.jsx)("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8"}),"Undo");var Ym={},mX=kt;Object.defineProperty(Ym,"__esModule",{value:!0});var Uk=Ym.default=void 0,gX=mX(Mt()),vX=St();Uk=Ym.default=(0,gX.default)((0,vX.jsx)("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z"}),"Redo");var Jm={},yX=kt;Object.defineProperty(Jm,"__esModule",{value:!0});var Gk=Jm.default=void 0,bX=yX(Mt()),xX=St();Gk=Jm.default=(0,bX.default)((0,xX.jsx)("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6m-7 2v2h14v-2z"}),"FormatUnderlined");var Zm={},wX=kt;Object.defineProperty(Zm,"__esModule",{value:!0});var qk=Zm.default=void 0,CX=wX(Mt()),SX=St();qk=Zm.default=(0,CX.default)((0,SX.jsx)("path",{d:"M10 19h4v-3h-4zM5 4v3h5v3h4V7h5V4zM3 14h18v-2H3z"}),"FormatStrikethrough");var Xm={},kX=kt;Object.defineProperty(Xm,"__esModule",{value:!0});var Kk=Xm.default=void 0,MX=kX(Mt()),EX=St();Kk=Xm.default=(0,MX.default)((0,EX.jsx)("path",{d:"M22 7h-2v1h3v1h-4V7c0-.55.45-1 1-1h2V5h-3V4h3c.55 0 1 .45 1 1v1c0 .55-.45 1-1 1M5.88 20h2.66l3.4-5.42h.12l3.4 5.42h2.66l-4.65-7.27L17.81 6h-2.68l-3.07 4.99h-.12L8.85 6H6.19l4.32 6.73z"}),"Superscript");var Qm={},TX=kt;Object.defineProperty(Qm,"__esModule",{value:!0});var Yk=Qm.default=void 0,OX=TX(Mt()),LX=St();Yk=Qm.default=(0,OX.default)((0,LX.jsx)("path",{d:"M22 18h-2v1h3v1h-4v-2c0-.55.45-1 1-1h2v-1h-3v-1h3c.55 0 1 .45 1 1v1c0 .55-.45 1-1 1M5.88 18h2.66l3.4-5.42h.12l3.4 5.42h2.66l-4.65-7.27L17.81 4h-2.68l-3.07 4.99h-.12L8.85 4H6.19l4.32 6.73z"}),"Subscript");var eg={},AX=kt;Object.defineProperty(eg,"__esModule",{value:!0});var Jk=eg.default=void 0,PX=AX(Mt()),RX=St();Jk=eg.default=(0,PX.default)((0,RX.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var tg={},DX=kt;Object.defineProperty(tg,"__esModule",{value:!0});var Zk=tg.default=void 0,IX=DX(Mt()),$X=St();Zk=tg.default=(0,IX.default)((0,$X.jsx)("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"}),"FormatQuote");var ng={},NX=kt;Object.defineProperty(ng,"__esModule",{value:!0});var rg=ng.default=void 0,_X=NX(Mt()),FX=St();rg=ng.default=(0,_X.default)((0,FX.jsx)("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code");const BX={name:"normal-text",label:"Normal Text",Component:AZ,shortcut:{mac:"Cmd+Alt+0",pc:"Ctrl+Alt+0"}},jX={name:"heading-1",label:"Heading 1",Component:PZ,shortcut:{mac:"Cmd+Alt+1",pc:"Ctrl+Alt+1"}},zX={name:"heading-2",label:"Heading 2",Component:RZ,shortcut:{mac:"Cmd+Alt+2",pc:"Ctrl+Alt+2"}},HX={name:"heading-3",label:"Heading 3",Component:DZ,shortcut:{mac:"Cmd+Alt+3",pc:"Ctrl+Alt+3"}},VX={name:"heading-4",label:"Heading 4",Component:IZ,shortcut:{mac:"Cmd+Alt+4",pc:"Ctrl+Alt+4"}},WX={name:"heading-5",label:"Heading 5",Component:$Z,shortcut:{mac:"Cmd+Alt+5",pc:"Ctrl+Alt+5"}},UX={name:"heading-6",label:"Heading 6",Component:NZ,shortcut:{mac:"Cmd+Alt+6",pc:"Ctrl+Alt+6"}},GX={name:"headings",label:"Headings",MenuButton:FZ,controls:[BX,jX,zX,HX,VX,WX,UX]},Xk={name:"bold",label:"Bold",cmd:({editor:t})=>t.chain().focus().toggleBold().run(),Icon:$k,shortcut:{mac:"Cmd+B",pc:"Ctrl+B"}},Qk={name:"italic",label:"Italic",cmd:({editor:t})=>t.chain().focus().toggleItalic().run(),Icon:Hk,shortcut:{mac:"Cmd+I",pc:"Ctrl+I"}},eM={name:"underline",label:"Underline",cmd:({editor:t})=>t.chain().focus().toggleUnderline().run(),Icon:Gk,shortcut:{mac:"Cmd+U",pc:"Ctrl+U"}},tM={name:"strike",label:"Strikethrough",cmd:({editor:t})=>t.chain().focus().toggleStrike().run(),Icon:qk,shortcut:{mac:"Cmd+Shift+S",pc:"Ctrl+Shift+S"}},nM={name:"superscript",label:"Superscript",cmd:({editor:t})=>t.chain().focus().toggleSuperscript().run(),Icon:Kk,shortcut:{mac:"Cmd+.",pc:"Ctrl+."}},rM={name:"subscript",label:"Subscript",cmd:({editor:t})=>t.chain().focus().toggleSubscript().run(),Icon:Yk,shortcut:{mac:"Cmd+,",pc:"Ctrl+,"}},oM={name:"clear",label:"Clear Formatting",cmd:({editor:t})=>t.chain().focus().unsetAllMarks().run(),Icon:Nk},qX={name:"bulletList",label:"Bullet List",cmd:({editor:t})=>t.chain().focus().toggleBulletList().run(),Icon:rT,shortcut:{mac:"Cmd+Shift+8",pc:"Ctrl+Shift+8"}},KX={name:"orderedList",label:"Ordered List",cmd:({editor:t})=>t.chain().focus().toggleOrderedList().run(),Icon:Jk,shortcut:{mac:"Cmd+Shift+7",pc:"Ctrl+Shift+7"}},YX={name:"alignLeft",label:"Align Left",cmd:({editor:t})=>t.chain().focus().setTextAlign("left").run(),Icon:_k,shortcut:{mac:"Cmd+Shift+L",pc:"Ctrl+Shift+L"}},JX={name:"alignCenter",label:"Align Center",cmd:({editor:t})=>t.chain().focus().setTextAlign("center").run(),Icon:Fk,shortcut:{mac:"Cmd+Shift+E",pc:"Ctrl+Shift+E"}},ZX={name:"alignRight",label:"Align Right",cmd:({editor:t})=>t.chain().focus().setTextAlign("right").run(),Icon:Bk,shortcut:{mac:"Cmd+Shift+R",pc:"Ctrl+Shift+R"}},XX={name:"alignJustify",label:"Align Justify",cmd:({editor:t})=>t.chain().focus().setTextAlign("justify").run(),Icon:jk,shortcut:{mac:"Cmd+Shift+J",pc:"Ctrl+Shift+J"}},iM={name:"link",label:"Link",cmd:({editor:t,inputSettings:{onLink:e,allowedLinkProtocols:n=Kw}})=>{var u;const{view:r}=t,{state:o,state:{selection:{from:i,to:s}}}=r,a=t.isActive("link")&&t.getAttributes("link"),l=a?(u=t.state.doc.nodeAt(i-1))==null?void 0:u.textContent:o.doc.textBetween(i,s),c={url:a.href,newTab:a.target==="_blank",text:l};e({...c,updateLink:({url:d,newTab:p,text:f})=>{const{state:{selection:{from:m,to:g}}}=t;t.isActive("link")?t.state.doc.nodesBetween(m-1,m,(y,b)=>{if(y.type.name==="text")return t.chain().focus().extendMarkRange("link").setLink({href:A0(d,n),target:p?"_blank":""}).insertContentAt({from:b,to:b+y.nodeSize-1},f).insertContentAt({from:b+f.length,to:b+f.length+1},"").extendMarkRange("link").run(),!1}):t.chain().insertContentAt({from:m,to:g},f).setTextSelection({from:m,to:m+f.length}).focus().extendMarkRange("link").setLink({href:A0(d,n),target:p?"_blank":""}).run()}})},Icon:Vk},sM={name:"linkPreview",label:"Open URL in new tab",cmd:({editor:t})=>{const e=t.state.selection.$to.marks().find(({type:n})=>n.name==="link");!e||!e.attrs.href||window.open(e.attrs.href,"_blank")},Icon:Fm},aM={name:"image",label:"Image",cmd:({editor:t,inputSettings:{onImage:e}})=>{const n=t.state.selection.node,r=(n==null?void 0:n.type.name)==="image"?n:void 0,o={src:(r==null?void 0:r.attrs.src)||"",alt:r==null?void 0:r.attrs.alt};e({...o,updateImage:i=>t.chain().focus().setImage(i).run()})},Icon:zk},QX={name:"codeBlock",label:"Code Block",cmd:({editor:t})=>t.chain().focus().toggleCodeBlock().run(),Icon:rg,shortcut:{mac:"Cmd+Alt+C",pc:"Ctrl+Alt+C"}},eQ={name:"blockquote",label:"Quote",cmd:({editor:t})=>t.chain().focus().toggleBlockquote().run(),Icon:Zk,shortcut:{mac:"Cmd+Shift+B",pc:"Ctrl+Shift+B"}},tQ={name:"undo",label:"Undo",cmd:({editor:t})=>t.chain().focus().undo().run(),Icon:Wk,shortcut:{mac:"Cmd+Z",pc:"Ctrl+Z"}},nQ={name:"redo",label:"Redo",cmd:({editor:t})=>t.chain().focus().redo().run(),Icon:Uk,shortcut:{mac:"Cmd+Y",pc:"Ctrl+Y"}},rQ=[YX,JX,ZX,XX,GX,Xk,Qk,eM,tM,nM,rM,oM,qX,KX,iM,sM,aM,QX,eQ,tQ,nQ];function oQ(t){return!("MenuButton"in t)&&!Array.isArray(t)}function lM(t,e){if(typeof t=="string"){const n=rQ.find(({name:r})=>r===t);if(n){const r=Pl(n.show,{selectionTypes:e});if(Rl(r))return n}}else if(Array.isArray(t)){const n=[];for(const r of t){const o=lM(r,e);if(o){if(!oQ(o))throw new Error("Menu controls only allow standard controls as their children.");const i=Pl(o.show,{selectionTypes:e});Rl(i)&&n.push(o)}}if(n.length)return n}else{const n=Pl(t.show,{selectionTypes:e});if(Rl(n))return t}}function iQ(t,e){const n=[];for(const r of t){const o=[];for(const i of r){const s=lM(i,e);s&&o.push(s)}o.length&&n.push(o)}return n}const sQ=[{label:"Visual",value:"visual"},{label:"Source",value:"code"}];function aQ({mode:t,onChange:e,focus:n}){return v.jsx(gZ,{children:sQ.map(({value:r,label:o})=>v.jsx(vZ,{onClick:()=>e(r),$active:r===t,$focus:n,children:o},r))})}function cM({editor:t,controls:e,selectionTypes:n,inputSettings:r={},disabled:o}){const i=h.useMemo(()=>iQ(e,n),[e,n]);return v.jsx(uZ,{children:i.map((s,a)=>v.jsx(dZ,{children:s.map((l,c)=>Array.isArray(l)?v.jsx(Vb,{editor:t,controls:l,inputSettings:r,testId:`${Lr.TEXT_EDITOR_CONTROL}:menu-${a}-${c}`,disabled:o},c):"MenuButton"in l?v.jsx(Vb,{editor:t,controls:l.controls,MenuButton:l.MenuButton,inputSettings:r,disabled:o},c):"Component"in l?h.createElement(l.Component,{...l,key:c,editor:t,inputSettings:r,"data-testid":`${Lr.TEXT_EDITOR_CONTROL}:${l.name}`,disabled:o}):v.jsx(Ik,{onClick:u=>l.cmd({editor:t,inputSettings:r,event:u}),label:l.label,shortcut:l.shortcut,active:t.isActive(l.name),square:!0,"data-testid":`${Lr.TEXT_EDITOR_CONTROL}:${l.name}`,disabled:o,children:v.jsx(l.Icon,{})},l.name))},a))})}function lQ(){return v.jsx(eZ,{className:"tiptap-flex",contentEditable:!1,children:v.jsxs("div",{className:"tiptap-pill",draggable:!0,"data-drag-handle":"",children:[v.jsx(rg,{})," ","Script"]})})}function uM(t,e){const r=new DOMParser().parseFromString(t,"text/html");return Vh(r.body,e),r.body.innerHTML}const Gl=qn.create({name:"script",group:"block",content:"inline*",code:!0,draggable:!0,parseHTML(){return[{tag:"script",preserveWhitespace:"full"}]},renderHTML({HTMLAttributes:t}){return["span",It({"data-type":this.name},this.options.HTMLAttributes,t),0]},addNodeView(){return iZ(lQ,{className:"tiptap-block"})}});function cQ(t){return t.includes(``)?uM(t,({elem:e})=>{if(!e||e.tagName.toLowerCase()!=="span"||e.getAttribute("data-type")!==Gl.name)return;const n=e.outerHTML.replace(new RegExp(`^`)," - + diff --git a/sb8/qa/project.json b/sb8/qa/project.json index 4825e8d352..377e69056e 100644 --- a/sb8/qa/project.json +++ b/sb8/qa/project.json @@ -1 +1 @@ -{"generatedAt":1736339317985,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{},"packageManager":{"type":"yarn","version":"3.1.1"},"typescriptOptions":{"reactDocgen":false},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"8.1.11","storybookVersionSpecifier":"^8.1.11","language":"typescript","storybookPackages":{"@storybook/blocks":{"version":"8.1.11"},"@storybook/react":{"version":"8.1.11"},"@storybook/react-vite":{"version":"8.1.11"},"@storybook/test":{"version":"8.1.11"},"eslint-plugin-storybook":{"version":"0.11.1"},"storybook":{"version":"8.1.11"}},"addons":{"@storybook/addon-links":{"version":"8.1.11"},"@storybook/addon-essentials":{"version":"8.1.11"},"@storybook/addon-interactions":{"version":"8.1.11"},"@storybook/addon-docs":{"version":"8.1.11"}}} +{"generatedAt":1736762095171,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":false,"hasStorybookEslint":true,"refCount":0,"testPackages":{},"packageManager":{"type":"yarn","version":"3.1.1"},"typescriptOptions":{"reactDocgen":false},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"8.1.11","storybookVersionSpecifier":"^8.1.11","language":"typescript","storybookPackages":{"@storybook/blocks":{"version":"8.1.11"},"@storybook/react":{"version":"8.1.11"},"@storybook/react-vite":{"version":"8.1.11"},"@storybook/test":{"version":"8.1.11"},"eslint-plugin-storybook":{"version":"0.11.1"},"storybook":{"version":"8.1.11"}},"addons":{"@storybook/addon-links":{"version":"8.1.11"},"@storybook/addon-essentials":{"version":"8.1.11"},"@storybook/addon-interactions":{"version":"8.1.11"},"@storybook/addon-docs":{"version":"8.1.11"}}}